Code

Merge branch 'gs/pretty-hexval'
[git.git] / builtin-fetch.c
index a11548c8943f75b8d3e9ddfa1e6e2e3d13eaa431..5841b3e51a5c908a32761398d6237968ddac4d46 100644 (file)
@@ -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]);