summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4ed4a34)
raw | patch | inline | side by side (parent: 4ed4a34)
author | Kevin Ballard <kevin@sb.org> | |
Sat, 5 Apr 2008 18:28:53 +0000 (14:28 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 5 Apr 2008 23:31:45 +0000 (16:31 -0700) |
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>
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>
builtin-fetch.c | patch | blob | history |
diff --git a/builtin-fetch.c b/builtin-fetch.c
index a11548c8943f75b8d3e9ddfa1e6e2e3d13eaa431..5841b3e51a5c908a32761398d6237968ddac4d46 100644 (file)
--- a/builtin-fetch.c
+++ b/builtin-fetch.c
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]);