Affected Version: 2.8.2 - 2.8.4 (the issue does not exist in version 2.8.1)
What steps will reproduce the problem?
1. Create empty project and clone it
git clone ssh://user@localhost:29418/project.git
cd project
scp -P 29418 user@localhost:hooks/commit-msg .git/hooks/
2. Create initial commit history
echo hello > hello.txt
git add hello.txt
git commit -m 1
echo world >> hello.txt
git add hello.txt
git commit -m 2
git push origin master
5. Create task branch
git checkout -b task HEAD~
echo 1 > task
git add task
git commit -m c1
echo 2 >> task
git add task
git commit -m c2
6. Push the two commits in task branch into review
git push origin HEAD:refs/publish/master
7. Rebase on top of master and merge changes
git rebase origin/master
git push origin task:master
It is expected that both of the commits in task branch are marked as merged but instead only the last one is marked merged and the first commit is marked still as open. If you have more than 2 commits in your task branch only the last is marked as merged.
When pushing in the step 8 the following error is emitted:
Counting objects: 14, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 544 bytes | 0 bytes/s, done.
Total 4 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2)
remote: Processing changes: updated: 1, closed: 1, refs: 2, done
To ssh://janne@localhost:29418/test
! [remote rejected] task -> master (commit already exists (in the project))
error: failed to push some refs to 'ssh://janne@localhost:29418/test'
The master branch is updated correctly (though you need to fetch changes before the change is visible in your local clone)
$ git fetch origin
From ssh://localhost:29418/test
2a2a2ac..a121216 master -> origin/master
You can avoid this issue by manually pushing each commit one by one to the target branch, i.e. first push the first commit in your branch, then the second etc.
Mergedinto: 2607