From a85c08e1c8542be8078b5515b7c1f6336410062b Mon Sep 17 00:00:00 2001 From: Robin Rosenberg Date: Sun, 15 Aug 2010 11:53:42 +0200 Subject: [PATCH] Do not trigger RefsChangedEvent on the first attempt to read a ref Such events make no sense, it has never been visible to this process so no client can have a stale value of the ref. Change-Id: Iea3a5035b0a1410b80b09cf53387b22b78b18018 Signed-off-by: Robin Rosenberg --- .../src/org/eclipse/jgit/storage/file/RefDirectory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/RefDirectory.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/RefDirectory.java index b22b14a910..0f073b66fd 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/RefDirectory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/RefDirectory.java @@ -851,7 +851,7 @@ public class RefDirectory extends RefDatabase { private void fireRefsChanged() { final int last = lastNotifiedModCnt.get(); final int curr = modCnt.get(); - if (last != curr && lastNotifiedModCnt.compareAndSet(last, curr)) + if (last != curr && lastNotifiedModCnt.compareAndSet(last, curr) && last != 0) parent.fireEvent(new RefsChangedEvent()); } -- 2.39.5