Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoan Tran Cong Danh <congdanhqx@gmail.com>2019-10-16 08:18:41 +0300
committerJunio C Hamano <gitster@pobox.com>2019-10-18 03:43:10 +0300
commitd58deb9c4e151d4d8380cd14223391ce0d58f588 (patch)
treedf6b2fcfe848eaeb41160b20f082cf8e73c4d3a6 /builtin/notes.c
parent8af69cf3e214ee9df3f78bd508465b75881b17a8 (diff)
notes: fix minimum number of parameters to "copy" subcommand
The builtin/notes.c::copy() function is prepared to handle either one or two arguments given from the command line; when one argument is given, to-obj defaults to HEAD. bbb1b8a3 ("notes: check number of parameters to "git notes copy"", 2010-06-28) tried to make sure "git notes copy" (with *no* other argument) does not dereference NULL by checking the number of parameters, but it incorrectly insisted that we need two arguments, instead of either one or two. This disabled the defaulting to-obj to HEAD. Correct it. Signed-off-by: Doan Tran Cong Danh <congdanhqx@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/notes.c')
-rw-r--r--builtin/notes.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/notes.c b/builtin/notes.c
index 02e97f55c5a..95456f31654 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -513,7 +513,7 @@ static int copy(int argc, const char **argv, const char *prefix)
}
}
- if (argc < 2) {
+ if (argc < 1) {
error(_("too few parameters"));
usage_with_options(git_notes_copy_usage, options);
}