]> asedeno.scripts.mit.edu Git - git.git/blobdiff - builtin/notes.c
revert: fix off by one read when searching the end of a commit subject
[git.git] / builtin / notes.c
index 26617546c8cadac493f06473d02f27f320713b28..f678f9cb520fa331de4899e372502cffccd9682c 100644 (file)
@@ -313,7 +313,7 @@ int commit_notes(struct notes_tree *t, const char *msg)
        return 0;
 }
 
-combine_notes_fn *parse_combine_notes_fn(const char *v)
+combine_notes_fn parse_combine_notes_fn(const char *v)
 {
        if (!strcasecmp(v, "overwrite"))
                return combine_notes_overwrite;
@@ -614,6 +614,10 @@ static int copy(int argc, const char **argv, const char *prefix)
                }
        }
 
+       if (argc < 2) {
+               error("too few parameters");
+               usage_with_options(git_notes_copy_usage, options);
+       }
        if (2 < argc) {
                error("too many parameters");
                usage_with_options(git_notes_copy_usage, options);