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>
This commit is contained in:

committed by
Junio C Hamano

parent
34ab458cb1
commit
7990142eb1
@ -1005,9 +1005,11 @@ cmd_pull () {
|
|||||||
then
|
then
|
||||||
die "fatal: you must provide <repository> <ref>"
|
die "fatal: you must provide <repository> <ref>"
|
||||||
fi
|
fi
|
||||||
|
repository="$1"
|
||||||
|
ref="$2"
|
||||||
ensure_clean
|
ensure_clean
|
||||||
ensure_valid_ref_format "$2"
|
ensure_valid_ref_format "$ref"
|
||||||
git fetch "$@" || exit $?
|
git fetch "$repository" "$ref" || exit $?
|
||||||
cmd_merge FETCH_HEAD
|
cmd_merge FETCH_HEAD
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user