diff options
author | Doan Tran Cong Danh <congdanhqx@gmail.com> | 2019-10-16 12:18:41 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-10-18 09:43:10 +0900 |
commit | d58deb9c4e151d4d8380cd14223391ce0d58f588 (patch) | |
tree | df6b2fcfe848eaeb41160b20f082cf8e73c4d3a6 /Documentation/git-notes.txt | |
parent | t3301: test diagnose messages for too few/many paramters (diff) | |
download | tgif-d58deb9c4e151d4d8380cd14223391ce0d58f588.tar.xz |
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 'Documentation/git-notes.txt')
-rw-r--r-- | Documentation/git-notes.txt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Documentation/git-notes.txt b/Documentation/git-notes.txt index f56a5a9197..ced2e8280e 100644 --- a/Documentation/git-notes.txt +++ b/Documentation/git-notes.txt @@ -10,7 +10,7 @@ SYNOPSIS [verse] 'git notes' [list [<object>]] 'git notes' add [-f] [--allow-empty] [-F <file> | -m <msg> | (-c | -C) <object>] [<object>] -'git notes' copy [-f] ( --stdin | <from-object> <to-object> ) +'git notes' copy [-f] ( --stdin | <from-object> [<to-object>] ) 'git notes' append [--allow-empty] [-F <file> | -m <msg> | (-c | -C) <object>] [<object>] 'git notes' edit [--allow-empty] [<object>] 'git notes' show [<object>] @@ -68,8 +68,8 @@ add:: subcommand). copy:: - Copy the notes for the first object onto the second object. - Abort if the second object already has notes, or if the first + Copy the notes for the first object onto the second object (defaults to + HEAD). Abort if the second object already has notes, or if the first object has none (use -f to overwrite existing notes to the second object). This subcommand is equivalent to: `git notes add [-f] -C $(git notes list <from-object>) <to-object>` |