diff options
author | Shawn Pearce <sop@google.com> | 2013-03-04 19:11:08 -0500 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org <gerrit@eclipse.org> | 2013-03-04 19:11:08 -0500 |
commit | 374406ac46e7654bce6b551f8898d27668599a79 (patch) | |
tree | eb0d10f3a68c38fba9f680b347707b98df0c63ae | |
parent | 22625cd1d89257d9564d87c9bbbe8f4863c413e3 (diff) | |
parent | f1dea3e279f4e8ca118e486cecdf7ab967279df3 (diff) | |
download | jgit-374406ac46e7654bce6b551f8898d27668599a79.tar.gz jgit-374406ac46e7654bce6b551f8898d27668599a79.zip |
Merge "Fix RefUpdate performance for existing Refs"
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/lib/RefUpdate.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefUpdate.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefUpdate.java index 394af29534..fcf38e6950 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefUpdate.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefUpdate.java @@ -598,7 +598,8 @@ public abstract class RefUpdate { RevObject newObj; RevObject oldObj; - if (getRefDatabase().isNameConflicting(getName())) + // don't make expensive conflict check if this is an existing Ref + if (oldValue == null && getRefDatabase().isNameConflicting(getName())) return Result.LOCK_FAILURE; try { if (!tryLock(true)) |