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>

Philippe Blain committed Oct 21, 2022 at 15:13 UTC 7990142eb1b6fdd60e87f63f003bc593fc105260
1 file changed +4 -2
contrib/subtree/git-subtree.sh
+4 -2
@@ -1005,9 +1005,11 @@ cmd_pull () {
1005 then
1006 die "fatal: you must provide <repository> <ref>"
1007 fi
1008 + repository="$1"
1009 + ref="$2"
1010 ensure_clean
1009 - ensure_valid_ref_format "$2"
1010 - git fetch "$@" || exit $?
1011 + ensure_valid_ref_format "$ref"
1012 + git fetch "$repository" "$ref" || exit $?
1013 cmd_merge FETCH_HEAD
1014 }
1015