diff options
author | James Moger <james.moger@gitblit.com> | 2012-01-09 21:10:27 -0500 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2012-01-09 21:10:27 -0500 |
commit | cc1cd7800940f98efe206fe50a4375a3fb9dc621 (patch) | |
tree | 5eb6dd864650ecc5aca016624354fb562623689f /src/com/gitblit/utils/TicgitUtils.java | |
parent | d25c599b9967549fe0ebc7a56ca785c317ba3d4b (diff) | |
download | gitblit-cc1cd7800940f98efe206fe50a4375a3fb9dc621.tar.gz gitblit-cc1cd7800940f98efe206fe50a4375a3fb9dc621.zip |
Refactored named branch retrieval function
Diffstat (limited to 'src/com/gitblit/utils/TicgitUtils.java')
-rw-r--r-- | src/com/gitblit/utils/TicgitUtils.java | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/src/com/gitblit/utils/TicgitUtils.java b/src/com/gitblit/utils/TicgitUtils.java index 87a2b3ae..aab5a3e1 100644 --- a/src/com/gitblit/utils/TicgitUtils.java +++ b/src/com/gitblit/utils/TicgitUtils.java @@ -48,29 +48,7 @@ public class TicgitUtils { * @return a refmodel for the ticgit branch or null
*/
public static RefModel getTicketsBranch(Repository repository) {
- RefModel ticgitBranch = null;
- try {
- // search for ticgit branch in local heads
- for (RefModel ref : JGitUtils.getLocalBranches(repository, false, -1)) {
- if (ref.displayName.endsWith("ticgit")) {
- ticgitBranch = ref;
- break;
- }
- }
-
- // search for ticgit branch in remote heads
- if (ticgitBranch == null) {
- for (RefModel ref : JGitUtils.getRemoteBranches(repository, false, -1)) {
- if (ref.displayName.endsWith("ticgit")) {
- ticgitBranch = ref;
- break;
- }
- }
- }
- } catch (Throwable t) {
- LOGGER.error("Failed to find ticgit branch!", t);
- }
- return ticgitBranch;
+ return JGitUtils.getBranch(repository, "ticgit");
}
/**
|