Skip to content

Commit ffc2b48

Browse files
johnkeepinggitster
authored andcommitted
pull: suppress error when no remoteref is found
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bb3f458 commit ffc2b48

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git-pull.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ test true = "$rebase" && {
229229
test -n "$curr_branch" &&
230230
. git-parse-remote &&
231231
remoteref="$(get_remote_merge_branch "$@" 2>/dev/null)" &&
232-
oldremoteref=$(git merge-base --fork-point "$remoteref" $curr_branch)
232+
oldremoteref=$(git merge-base --fork-point "$remoteref" $curr_branch 2>/dev/null)
233233
}
234234
orig_head=$(git rev-parse -q --verify HEAD)
235235
git fetch $verbosity $progress $dry_run $recurse_submodules --update-head-ok "$@" || exit 1

0 commit comments

Comments
 (0)