From: Philippe Blain Date: Fri, 21 Oct 2022 15:13:36 +0000 (+0000) Subject: subtree: use named variables instead of "$@" in cmd_pull X-Git-Tag: v2.39.0-rc0~59^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7990142eb1b6fdd60e87f63f003bc593fc105260;p=thirdparty%2Fgit.git 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 Signed-off-by: Junio C Hamano --- 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 " 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 }