contrib/subtree: fix synopsis

Fix the documentation of add to show that a repository can be specified along with a commit. Suggested by Yann Dirson <dirson@bertin.fr>. Signed-off-by: David A. Greene <greened@obbligato.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

David A. Greene committed Feb 4, 2013 at 22:06 UTC 111dc0eea07d4843a9ed86e4069b899224a4489b
2 files changed +8 -1
contrib/subtree/git-subtree.sh
+6
@@ -9,6 +9,7 @@ if [ $# -eq 0 ]; then
9 fi
10 OPTS_SPEC="\
11 git subtree add --prefix=<prefix> <commit>
12 +git subtree add --prefix=<prefix> <repository> <commit>
13 git subtree merge --prefix=<prefix> <commit>
14 git subtree pull --prefix=<prefix> <repository> <refspec...>
15 git subtree push --prefix=<prefix> <repository> <refspec...>
@@ -502,6 +503,11 @@ cmd_add()
503
504 "cmd_add_commit" "$@"
505 elif [ $# -eq 2 ]; then
506 + # Technically we could accept a refspec here but we're
507 + # just going to turn around and add FETCH_HEAD under the
508 + # specified directory. Allowing a refspec might be
509 + # misleading because we won't do anything with any other
510 + # branches fetched via the refspec.
511 git rev-parse -q --verify "$2^{commit}" >/dev/null ||
512 die "'$2' does not refer to a commit"
513
contrib/subtree/git-subtree.txt
+2 -1
@@ -9,7 +9,8 @@ git-subtree - Merge subtrees together and split repository into subtrees
9 SYNOPSIS
10 --------
11 [verse]
12 -'git subtree' add -P <prefix> <commit>
12 +'git subtree' add -P <prefix> <refspec>
13 +'git subtree' add -P <prefix> <repository> <refspec>
14 'git subtree' pull -P <prefix> <repository> <refspec...>
15 'git subtree' push -P <prefix> <repository> <refspec...>
16 'git subtree' merge -P <prefix> <commit>