Merge branch 'dl/subtree-limit-to-one-rev'
"git subtree" (in contrib/) update. * dl/subtree-limit-to-one-rev: contrib/subtree: ensure only one rev is provided
This commit is contained in:
commit
8b7150327e
@ -14,7 +14,7 @@ git subtree add --prefix=<prefix> <repository> <ref>
|
||||
git subtree merge --prefix=<prefix> <commit>
|
||||
git subtree pull --prefix=<prefix> <repository> <ref>
|
||||
git subtree push --prefix=<prefix> <repository> <ref>
|
||||
git subtree split --prefix=<prefix> <commit...>
|
||||
git subtree split --prefix=<prefix> <commit>
|
||||
--
|
||||
h,help show the help
|
||||
q quiet
|
||||
@ -77,6 +77,12 @@ assert () {
|
||||
fi
|
||||
}
|
||||
|
||||
ensure_single_rev () {
|
||||
if test $# -ne 1
|
||||
then
|
||||
die "You must provide exactly one revision. Got: '$@'"
|
||||
fi
|
||||
}
|
||||
|
||||
while test $# -gt 0
|
||||
do
|
||||
@ -185,6 +191,7 @@ if test "$command" != "pull" &&
|
||||
then
|
||||
revs=$(git rev-parse $default --revs-only "$@") || exit $?
|
||||
dirs=$(git rev-parse --no-revs --no-flags "$@") || exit $?
|
||||
ensure_single_rev $revs
|
||||
if test -n "$dirs"
|
||||
then
|
||||
die "Error: Use --prefix instead of bare filenames."
|
||||
@ -716,9 +723,8 @@ cmd_add_repository () {
|
||||
}
|
||||
|
||||
cmd_add_commit () {
|
||||
revs=$(git rev-parse $default --revs-only "$@") || exit $?
|
||||
set -- $revs
|
||||
rev="$1"
|
||||
rev=$(git rev-parse $default --revs-only "$@") || exit $?
|
||||
ensure_single_rev $rev
|
||||
|
||||
debug "Adding $dir as '$rev'..."
|
||||
git read-tree --prefix="$dir" $rev || exit $?
|
||||
@ -817,16 +823,10 @@ cmd_split () {
|
||||
}
|
||||
|
||||
cmd_merge () {
|
||||
revs=$(git rev-parse $default --revs-only "$@") || exit $?
|
||||
rev=$(git rev-parse $default --revs-only "$@") || exit $?
|
||||
ensure_single_rev $rev
|
||||
ensure_clean
|
||||
|
||||
set -- $revs
|
||||
if test $# -ne 1
|
||||
then
|
||||
die "You must provide exactly one revision. Got: '$revs'"
|
||||
fi
|
||||
rev="$1"
|
||||
|
||||
if test -n "$squash"
|
||||
then
|
||||
first_split="$(find_latest_squash "$dir")"
|
||||
|
Loading…
Reference in New Issue
Block a user