From: Philippe Blain via GitGitGadget Date: Fri, 21 Oct 2022 15:13:36 GMT Subject: [PATCH 6/9] subtree: use named variables instead of "$@" in cmd_pull Message-ID: <429b3656f503785b60297ace4f83fcceb7363a4c.1666365220.git.gitgitgadget@gmail.com> In-Reply-To: From: Philippe Blain '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 --- contrib/subtree/git-subtree.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh index d91a9679075..2b3c429991b 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 } -- gitgitgadget