]> source.dussan.org Git - gitblit.git/commitdiff
FIX: Allow correct search for RefModel using branch name.
authorLuca Milanesio <luca@milanesio.org>
Sun, 2 Dec 2012 08:50:55 +0000 (08:50 +0000)
committerLuca Milanesio <luca@milanesio.org>
Sun, 2 Dec 2012 08:53:09 +0000 (08:53 +0000)
DisplayName used previously contained ONLY the last part
of ref-spec: this would have not worked when looking for
objects with full ref-spec.

src/com/gitblit/utils/JGitUtils.java

index 9cfb37fd21d3f491fe4123b07589501baf3a680a..beaa27da1726ac5c6493cf94966a426fa42a41b8 100644 (file)
@@ -1528,7 +1528,7 @@ public class JGitUtils {
                try {\r
                        // search for the branch in local heads\r
                        for (RefModel ref : JGitUtils.getLocalBranches(repository, false, -1)) {\r
-                               if (ref.displayName.endsWith(name)) {\r
+                               if (ref.reference.getName().endsWith(name)) {\r
                                        branch = ref;\r
                                        break;\r
                                }\r
@@ -1537,7 +1537,7 @@ public class JGitUtils {
                        // search for the branch in remote heads\r
                        if (branch == null) {\r
                                for (RefModel ref : JGitUtils.getRemoteBranches(repository, false, -1)) {\r
-                                       if (ref.displayName.endsWith(name)) {\r
+                                       if (ref.reference.getName().endsWith(name)) {\r
                                                branch = ref;\r
                                                break;\r
                                        }\r