summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/completion/git-completion.bash8
-rwxr-xr-xcontrib/subtree/git-subtree.sh24
2 files changed, 16 insertions, 16 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 976e4a6548..93b5e972cb 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1024,7 +1024,7 @@ __git_all_commands=
__git_compute_all_commands ()
{
test -n "$__git_all_commands" ||
- __git_all_commands=$(git --list-cmds=main,others,alias,nohelpers)
+ __git_all_commands=$(__git --list-cmds=main,others,alias,nohelpers)
}
# Lists all set config variables starting with the given section prefix,
@@ -1652,9 +1652,9 @@ _git_help ()
esac
if test -n "$GIT_TESTING_ALL_COMMAND_LIST"
then
- __gitcomp "$GIT_TESTING_ALL_COMMAND_LIST $(git --list-cmds=alias,list-guide) gitk"
+ __gitcomp "$GIT_TESTING_ALL_COMMAND_LIST $(__git --list-cmds=alias,list-guide) gitk"
else
- __gitcomp "$(git --list-cmds=main,nohelpers,alias,list-guide) gitk"
+ __gitcomp "$(__git --list-cmds=main,nohelpers,alias,list-guide) gitk"
fi
}
@@ -2925,7 +2925,7 @@ __git_main ()
then
__gitcomp "$GIT_TESTING_PORCELAIN_COMMAND_LIST"
else
- __gitcomp "$(git --list-cmds=list-mainporcelain,others,nohelpers,alias,list-complete,config)"
+ __gitcomp "$(__git --list-cmds=list-mainporcelain,others,nohelpers,alias,list-complete,config)"
fi
;;
esac
diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index 147201dc6c..868e18b9a1 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -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")"