[PATCH 5/7] don't rely on zero-argument "git fetch" from within git pull
- From
Paolo Bonzini <bonzini@gnu.org>
- Date
- Apr 28, 2008, 15:32 UTC
- Message-ID
- <b5b9b866e5f942d024831d528ae599e3e6ce31da.1209391615.git.bonzini@gnu.org>
- In-Reply-To
- <d941a7a16cb7d5529b22a47f1dc7b986ba66ee56.1209391615.git.bonzini@gnu.org>
Since the series will change the meaning of zero-argument "git fetch", it is necessary that git pull does not rely on it. Instead, it resolves it using git-parse-remote, which will return either branch.*.remote or "origin" (at the end of the series, the latter will throw out a big deprecation warning).
Signed-off-by: Paolo Bonzini <bonzini@gnu.org> --- git-pull.sh | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/git-pull.sh b/git-pull.sh index bf0c298..5dec4cf 100755 --- a/git-pull.sh +++ b/git-pull.sh @@ -106,10 +106,13 @@ error_on_no_merge_candidates () { exit 1 } +. git-parse-remote +if test $# = 0; then + set x $(get_default_remote); shift +fi + +origin="$1" test true = "$rebase" && { - . git-parse-remote && - origin="$1" - test -z "$origin" && origin=$(get_default_remote) reflist="$(get_remote_refs_for_fetch "$@" 2>/dev/null | sed "s|refs/heads/\(.*\):|\1|")" && oldremoteref="$(git rev-parse --verify \
-- 1.5.5