]> git.ipfire.org Git - thirdparty/git.git/commitdiff
subtree: use named variables instead of "$@" in cmd_pull
authorPhilippe Blain <levraiphilippeblain@gmail.com>
Fri, 21 Oct 2022 15:13:36 +0000 (15:13 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 21 Oct 2022 20:51:06 +0000 (13:51 -0700)
'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>
contrib/subtree/git-subtree.sh

index d91a9679075d16dc7df82f9700069f0334fa48a4..2b3c429991b5d9cdb034df3f45c32d25378d8fbb 100755 (executable)
@@ -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
 }