Skip to content

Commit 7990142

Browse files
phil-blaingitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 34ab458 commit 7990142

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

contrib/subtree/git-subtree.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,9 +1005,11 @@ cmd_pull () {
10051005
then
10061006
die "fatal: you must provide <repository> <ref>"
10071007
fi
1008+
repository="$1"
1009+
ref="$2"
10081010
ensure_clean
1009-
ensure_valid_ref_format "$2"
1010-
git fetch "$@" || exit $?
1011+
ensure_valid_ref_format "$ref"
1012+
git fetch "$repository" "$ref" || exit $?
10111013
cmd_merge FETCH_HEAD
10121014
}
10131015

0 commit comments

Comments
 (0)