summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-07-16 18:16:16 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-07-16 18:16:16 (GMT)
commit64630d807ae0a9717ae39c87bd1458bf15c62142 (patch)
treeab4955b7e70e14600028aa4f7fd0d99f5579452a
parent9092a9696bee9a5729b7b1741a5de99aecb75552 (diff)
parent95104c7e257652b82aed089494def344e3938928 (diff)
downloadgit-64630d807ae0a9717ae39c87bd1458bf15c62142.zip
git-64630d807ae0a9717ae39c87bd1458bf15c62142.tar.gz
git-64630d807ae0a9717ae39c87bd1458bf15c62142.tar.bz2
Merge branch 'bc/fix-rebase-merge-skip' into maint
During "git rebase --merge", a conflicted patch could not be skipped with "--skip" if the next one also conflicted. * bc/fix-rebase-merge-skip: rebase--merge: fix --skip with two conflicts in a row
-rw-r--r--git-rebase--merge.sh5
-rwxr-xr-xt/t3402-rebase-merge.sh15
2 files changed, 18 insertions, 2 deletions
diff --git a/git-rebase--merge.sh b/git-rebase--merge.sh
index 71429fd..66c64d7 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
diff --git a/t/t3402-rebase-merge.sh b/t/t3402-rebase-merge.sh
index be8c1d5..5a27ec9 100755
--- a/t/t3402-rebase-merge.sh
+++ b/t/t3402-rebase-merge.sh
@@ -33,6 +33,7 @@ test_expect_success setup '
tr "[a-z]" "[A-Z]" <original >newfile &&
git add newfile &&
git commit -a -m"side edits further." &&
+ git branch second-side &&
tr "[a-m]" "[A-M]" <original >newfile &&
rm -f original &&
@@ -41,6 +42,7 @@ test_expect_success setup '
git branch test-rebase side &&
git branch test-rebase-pick side &&
git branch test-reference-pick side &&
+ git branch test-conflicts side &&
git checkout -b test-merge side
'
@@ -138,4 +140,17 @@ test_expect_success 'rebase -s funny -Xopt' '
test -f funny.was.run
'
+test_expect_success 'rebase --skip works with two conflicts in a row' '
+ git checkout second-side &&
+ tr "[A-Z]" "[a-z]" <newfile >tmp &&
+ mv tmp newfile &&
+ git commit -a -m"edit conflicting with side" &&
+ tr "[d-f]" "[D-F]" <newfile >tmp &&
+ mv tmp newfile &&
+ git commit -a -m"another edit conflicting with side" &&
+ test_must_fail git rebase --merge test-conflicts &&
+ test_must_fail git rebase --skip &&
+ git rebase --skip
+'
+
test_done