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

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Blain <levraiphilippeblain@gmail.com>2022-10-21 18:13:36 +0300
committerJunio C Hamano <gitster@pobox.com>2022-10-21 23:51:06 +0300
commit7990142eb1b6fdd60e87f63f003bc593fc105260 (patch)
tree518de4c572b4840c9dbbd0787dc23c6e0f0716bb /contrib
parent34ab458cb1df13ca400c10bbc4ff69c75a4e217e (diff)
subtree: use named variables instead of "$@" in cmd_pull
'cmd_pull' already checks that only two arguments are given, 'repository' and 'ref'. Define variables with these names instead of using the positional parameter $2 and "$@". This will allow a subsequent commit to pass 'repository' to 'cmd_merge'. Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/subtree/git-subtree.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index d91a967907..2b3c429991 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -1005,9 +1005,11 @@ cmd_pull () {
then
die "fatal: you must provide <repository> <ref>"
fi
+ repository="$1"
+ ref="$2"
ensure_clean
- ensure_valid_ref_format "$2"
- git fetch "$@" || exit $?
+ ensure_valid_ref_format "$ref"
+ git fetch "$repository" "$ref" || exit $?
cmd_merge FETCH_HEAD
}