Fix: Change closes when pushing commit to other branch.

Gerrit currently closes an open change when pushing the same commit to
another branch.

Background:

There are several issues in Gerrit when it comes to reusing commits in
several branches.

Deniz Türkoglu has made an effort to fix most (all?) of them [1].

The issue was also discussed during the May & Nov 2012 Hackathons.

With all various edge cases and different views on how Gerrit should
actually behave in certain circumstances, this is a small effort to
start fixing the most obvious issues, on a case by case basis.

Hopefully this approach will make it easier for the community to come
to an agreement on the expected behavior by Gerrit and also allow us
to fix the worst issues while simultaneously continuing discussing of
the more crazy edge cases.

This first patch just fixes so that an open change is not closed when
the very same commit is pushed to another refs/heads/<branch>.

To reproduce the issue today:

1 Check out an open change.
2 Push it to refs/heads/<another_branch>

Result: The change is closed regardless of whether the destination
branch matches or not.

This change fixes this issue, so the change will continue to stay open
in this case.

[1] https://gerrit-review.googlesource.com/#/c/32881

Change-Id: Ib23e4242dbb7bc1a02a858c33fa7cf9f2e9acbc4
1 file changed