FIX: Allow correct search for RefModel using branch name.
DisplayName used previously contained ONLY the last part
of ref-spec: this would have not worked when looking for
objects with full ref-spec.
| | |
| | | try {
|
| | | // search for the branch in local heads
|
| | | for (RefModel ref : JGitUtils.getLocalBranches(repository, false, -1)) {
|
| | | if (ref.displayName.endsWith(name)) {
|
| | | if (ref.reference.getName().endsWith(name)) {
|
| | | branch = ref;
|
| | | break;
|
| | | }
|
| | |
| | | // search for the branch in remote heads
|
| | | if (branch == null) {
|
| | | for (RefModel ref : JGitUtils.getRemoteBranches(repository, false, -1)) {
|
| | | if (ref.displayName.endsWith(name)) {
|
| | | if (ref.reference.getName().endsWith(name)) {
|
| | | branch = ref;
|
| | | break;
|
| | | }
|