summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit/utils/IssueUtils.java
diff options
context:
space:
mode:
authorRafael Cavazin <rafaelcavazin@gmail.com>2013-01-27 12:46:50 -0200
committerRafael Cavazin <rafaelcavazin@gmail.com>2013-01-27 12:46:50 -0200
commit06ae63123c94038b90153f4847de2c57c0193db8 (patch)
tree552bf7cfa3af0f314ac1337a12147b3ec515a1a5 /src/com/gitblit/utils/IssueUtils.java
parent71a71dad2df82bf8256c91bc48a600bafdef0d33 (diff)
parentc7acc2e1fa86102bb87e715c8fe4e336329fbcc6 (diff)
downloadgitblit-06ae63123c94038b90153f4847de2c57c0193db8.tar.gz
gitblit-06ae63123c94038b90153f4847de2c57c0193db8.zip
updating current development
Merge remote-tracking branch 'upstream/master' into translation_to_pt-br
Diffstat (limited to 'src/com/gitblit/utils/IssueUtils.java')
-rw-r--r--src/com/gitblit/utils/IssueUtils.java18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/com/gitblit/utils/IssueUtils.java b/src/com/gitblit/utils/IssueUtils.java
index 7b24ccf7..dd09235b 100644
--- a/src/com/gitblit/utils/IssueUtils.java
+++ b/src/com/gitblit/utils/IssueUtils.java
@@ -76,9 +76,9 @@ public class IssueUtils {
public abstract boolean accept(IssueModel issue);
}
- public static final String GB_ISSUES = "refs/heads/gb-issues";
+ public static final String GB_ISSUES = "refs/gitblit/issues";
- static final Logger LOGGER = LoggerFactory.getLogger(JGitUtils.class);
+ static final Logger LOGGER = LoggerFactory.getLogger(IssueUtils.class);
/**
* Log an error message and exception.
@@ -111,7 +111,13 @@ public class IssueUtils {
* @return a refmodel for the gb-issues branch or null
*/
public static RefModel getIssuesBranch(Repository repository) {
- return JGitUtils.getBranch(repository, "gb-issues");
+ List<RefModel> refs = JGitUtils.getRefs(repository, com.gitblit.Constants.R_GITBLIT);
+ for (RefModel ref : refs) {
+ if (ref.reference.getName().equals(GB_ISSUES)) {
+ return ref;
+ }
+ }
+ return null;
}
/**
@@ -374,7 +380,7 @@ public class IssueUtils {
String issuePath = getIssuePath(issueId);
RevTree tree = JGitUtils.getCommit(repository, GB_ISSUES).getTree();
byte[] content = JGitUtils
- .getByteContent(repository, tree, issuePath + "/" + attachment.id);
+ .getByteContent(repository, tree, issuePath + "/" + attachment.id, false);
attachment.content = content;
attachment.size = content.length;
return attachment;
@@ -394,7 +400,7 @@ public class IssueUtils {
public static IssueModel createIssue(Repository repository, Change change) {
RefModel issuesBranch = getIssuesBranch(repository);
if (issuesBranch == null) {
- JGitUtils.createOrphanBranch(repository, "gb-issues", null);
+ JGitUtils.createOrphanBranch(repository, GB_ISSUES, null);
}
if (StringUtils.isEmpty(change.author)) {
@@ -471,7 +477,7 @@ public class IssueUtils {
RefModel issuesBranch = getIssuesBranch(repository);
if (issuesBranch == null) {
- throw new RuntimeException("gb-issues branch does not exist!");
+ throw new RuntimeException(GB_ISSUES + " does not exist!");
}
if (StringUtils.isEmpty(issueId)) {