summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2016-03-04 14:20:01 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2016-03-05 01:03:34 +0100
commit846ef78a02edceb99940d7aa92dcd2462a85c602 (patch)
tree1722c3087b49264f25e1b820b95b948ef9273702 /org.eclipse.jgit.pgm
parent770d36c8bafba2ad20686c161246a3a239cdf1d9 (diff)
downloadjgit-846ef78a02edceb99940d7aa92dcd2462a85c602.tar.gz
jgit-846ef78a02edceb99940d7aa92dcd2462a85c602.zip
Fix RebuildRefTree trying to add HEAD twice to RefTree
14dfa70520 fixed the problem that HEAD wasn't added to the reftree when rebuilding the reftree in an empty repository where HEAD isn't yet resolvable. Since non-resolvable refs are filtered out by RefDatabase.getRefs(ALL) we have to add HEAD to the reftree explicitly in this special case. This fix resulted in another bug: rebuilding the reftree in a repository which has a resolvable HEAD failed with a DirCacheNameConflictException in RefTree.apply(). If HEAD is resolvable RefDatabase.getRefs(ALL) does not filter out HEAD. This results in two identical CREATE commands for HEAD which RefTree.apply() refuses to execute. Fix this by no longer creating a duplicate CREATE command for HEAD. See: I46cbc2611b9ae683ef7319dc46af277925dfaee5 Change-Id: I58dd6bcdef88820aa7de29761d43e2edfa18fcbe Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.pgm')
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildRefTree.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildRefTree.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildRefTree.java
index f2ac9456d7..57345e20dc 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildRefTree.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildRefTree.java
@@ -154,7 +154,7 @@ class RebuildRefTree extends TextBuiltin {
}
for (Ref r : refdb.getRefs(RefDatabase.ALL).values()) {
- if (r.getName().equals(txnCommitted)
+ if (r.getName().equals(txnCommitted) || r.getName().equals(HEAD)
|| r.getName().startsWith(txnNamespace)) {
continue;
}