From 95104c7e257652b82aed089494def344e3938928 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Mon, 16 Jun 2014 00:01:25 +0000 Subject: rebase--merge: fix --skip with two conflicts in a row If git rebase --merge encountered a conflict, --skip would not work if the next commit also conflicted. The msgnum file would never be updated with the new patch number, so no patch would actually be skipped, resulting in an inescapable loop. Update the msgnum file's value as the first thing in call_merge. This also avoids an "Already applied" message when skipping a commit. There is no visible change for the other contexts in which call_merge is invoked, as the msgnum file's value remains unchanged in those situations. Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- git-rebase--merge.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'git-rebase--merge.sh') diff --git a/git-rebase--merge.sh b/git-rebase--merge.sh index 838fbed6c9..f6b5dd03d7 100644 --- a/git-rebase--merge.sh +++ b/git-rebase--merge.sh @@ -53,11 +53,12 @@ continue_merge () { } call_merge () { - cmt="$(cat "$state_dir/cmt.$1")" + msgnum="$1" + echo "$msgnum" >"$state_dir/msgnum" + cmt="$(cat "$state_dir/cmt.$msgnum")" echo "$cmt" > "$state_dir/current" hd=$(git rev-parse --verify HEAD) cmt_name=$(git symbolic-ref HEAD 2> /dev/null || echo HEAD) - msgnum=$(cat "$state_dir/msgnum") eval GITHEAD_$cmt='"${cmt_name##refs/heads/}~$(($end - $msgnum))"' eval GITHEAD_$hd='$onto_name' export GITHEAD_$cmt GITHEAD_$hd -- cgit v1.2.1