diff options
author | Kevin Ballard <kevin@sb.org> | 2008-04-05 20:28:53 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-04-06 01:31:45 +0200 |
commit | f53423b0e09d0de9584f72ac298bdfdc9e886d73 (patch) | |
tree | 7d3f9e54432d9912ee8669d48462c7ca68425b56 /builtin-fetch.c | |
parent | Revert "gitweb: Add 'status_str' to parse_difftree_raw_line output" (diff) | |
download | git-f53423b0e09d0de9584f72ac298bdfdc9e886d73.tar.xz git-f53423b0e09d0de9584f72ac298bdfdc9e886d73.zip |
git-fetch: Don't trigger a bus error when given the refspec "tag"
When git-fetch encounters the refspec "tag" it assumes that the next
argument will be a tag name. If there is no next argument, it should
die gracefully instead of erroring.
Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-fetch.c')
-rw-r--r-- | builtin-fetch.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin-fetch.c b/builtin-fetch.c index a11548c894..5841b3e51a 100644 --- a/builtin-fetch.c +++ b/builtin-fetch.c @@ -637,6 +637,8 @@ int cmd_fetch(int argc, const char **argv, const char *prefix) if (!strcmp(argv[i], "tag")) { char *ref; i++; + if (i >= argc) + die("You need to specify a tag name."); ref = xmalloc(strlen(argv[i]) * 2 + 22); strcpy(ref, "refs/tags/"); strcat(ref, argv[i]); |