summaryrefslogtreecommitdiff
path: root/git-pull.sh
diff options
context:
space:
mode:
authorJohn Keeping <john@keeping.me.uk>2014-01-17 20:00:20 +0000
committerJunio C Hamano <gitster@pobox.com>2014-01-17 12:03:32 -0800
commitffc2b483dee43c2687088d4c73d7532fda855050 (patch)
treec73f6cd468c475a40ff4e10e0cfb2bedfcc35e3e /git-pull.sh
parentbb3f45838b859c8b17a53a24579a304333868cc8 (diff)
downloadgit-ffc2b483dee43c2687088d4c73d7532fda855050.tar.gz
pull: suppress error when no remoteref is foundjk/pull-rebase-using-fork-point
Commit 48059e4 (pull: use merge-base --fork-point when appropriate, 2013-12-08) incorrectly assumes that get_remote_merge_branch will either yield a non-empty string or return an error, but there are circumstances where it will yield an empty string. The previous code then invoked git-rev-list with no arguments, which results in an error suppressed by redirecting stderr to /dev/null. Now we invoke git-merge-base with an empty branch name, which also results in an error. Suppress this in the same way. Signed-off-by: John Keeping <john@keeping.me.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-pull.sh')
-rwxr-xr-xgit-pull.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/git-pull.sh b/git-pull.sh
index 605e9575df..11ac50552c 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -229,7 +229,7 @@ test true = "$rebase" && {
test -n "$curr_branch" &&
. git-parse-remote &&
remoteref="$(get_remote_merge_branch "$@" 2>/dev/null)" &&
- oldremoteref=$(git merge-base --fork-point "$remoteref" $curr_branch)
+ oldremoteref=$(git merge-base --fork-point "$remoteref" $curr_branch 2>/dev/null)
}
orig_head=$(git rev-parse -q --verify HEAD)
git fetch $verbosity $progress $dry_run $recurse_submodules --update-head-ok "$@" || exit 1