]> source.dussan.org Git - jgit.git/commit
Fix missing RefsChangedEvent when packed refs are used 30/104330/3
authorThomas Wolf <thomas.wolf@paranor.ch>
Tue, 5 Sep 2017 09:09:27 +0000 (11:09 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Thu, 7 Sep 2017 22:47:45 +0000 (18:47 -0400)
commitc27f36dfc79d4127f41c4875d0c1374dbd487d4f
tree291db7cd2e00574cac69f570b6a3c7703d140c1d
parentbb09e093449b96fbec13b21577a1c9781e6ca45b
Fix missing RefsChangedEvent when packed refs are used

With atomic ref updates using packed refs, JGit did not fire a
RefsChangedEvent. This resulted in a user-visible regression in
EGit: the UI would not update after a "Fetch from upstream...".
Presumably it would also make Gerrit miss out on ref changes?

Strengthen the BatchRefUpdateTest by also asserting the expected
number of RefsChangedEvents, and ensure modCnt is incremented in
RefDirectory.commitPackedRefs() when refs really changed (as opposed
to some internal housekeeping operation, such as packing loose refs).

Bug: 521296
Change-Id: Ia985bda1d99f45a5f89c8020ca4845e7a66e743e
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/BatchRefUpdateTest.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackedBatchRefUpdate.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java