diff options
author | James Moger <james.moger@gitblit.com> | 2013-05-31 08:34:21 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2013-05-31 08:34:21 -0400 |
commit | b5a318c0e6340dc546323ea2ccd3861e55beff62 (patch) | |
tree | 667a445461f370b264a6e228493543ea6d74b4b7 /src/main/java/com/gitblit | |
parent | e14d3e49756f07a9cc73ecb46948c1c8b2b5d6fa (diff) | |
download | gitblit-b5a318c0e6340dc546323ea2ccd3861e55beff62.tar.gz gitblit-b5a318c0e6340dc546323ea2ccd3861e55beff62.zip |
Gracefully handle branch creation in daily log digests
Diffstat (limited to 'src/main/java/com/gitblit')
-rw-r--r-- | src/main/java/com/gitblit/utils/PushLogUtils.java | 6 | ||||
-rw-r--r-- | src/main/java/com/gitblit/wicket/GitBlitWebApp.properties | 1 | ||||
-rw-r--r-- | src/main/java/com/gitblit/wicket/panels/PushesPanel.java | 9 |
3 files changed, 13 insertions, 3 deletions
diff --git a/src/main/java/com/gitblit/utils/PushLogUtils.java b/src/main/java/com/gitblit/utils/PushLogUtils.java index e10a6864..6e77169c 100644 --- a/src/main/java/com/gitblit/utils/PushLogUtils.java +++ b/src/main/java/com/gitblit/utils/PushLogUtils.java @@ -531,7 +531,11 @@ public class PushLogUtils { dailydigests.put(dateStr, new DailyLogEntry(repositoryName, date)); } PushLogEntry digest = dailydigests.get(dateStr); - digest.updateRef(branch, ReceiveCommand.Type.UPDATE, commit.getParents()[0].getId().getName(), commit.getName()); + if (commit.getParentCount() == 0) { + digest.updateRef(branch, ReceiveCommand.Type.CREATE); + } else { + digest.updateRef(branch, ReceiveCommand.Type.UPDATE, commit.getParents()[0].getId().getName(), commit.getName()); + } RepositoryCommit repoCommit = digest.addCommit(branch, commit); if (repoCommit != null) { repoCommit.setRefs(allRefs.get(commit.getId())); diff --git a/src/main/java/com/gitblit/wicket/GitBlitWebApp.properties b/src/main/java/com/gitblit/wicket/GitBlitWebApp.properties index 036af264..2fe2293c 100644 --- a/src/main/java/com/gitblit/wicket/GitBlitWebApp.properties +++ b/src/main/java/com/gitblit/wicket/GitBlitWebApp.properties @@ -477,6 +477,7 @@ gb.pushedNewTag = pushed new tag gb.createdNewTag = created new tag gb.deletedTag = deleted tag gb.pushedNewBranch = pushed new branch +gb.createdNewBranch = created new branch gb.deletedBranch = deleted branch gb.rewind = REWIND gb.star = star diff --git a/src/main/java/com/gitblit/wicket/panels/PushesPanel.java b/src/main/java/com/gitblit/wicket/panels/PushesPanel.java index 423c44b4..7bac70e0 100644 --- a/src/main/java/com/gitblit/wicket/panels/PushesPanel.java +++ b/src/main/java/com/gitblit/wicket/panels/PushesPanel.java @@ -171,8 +171,13 @@ public class PushesPanel extends BasePanel { preposition = "gb.to";
}
} else {
- what = getString("gb.pushedNewBranch");
- preposition = "gb.to";
+ if (isDigest) {
+ what = getString("gb.createdNewBranch");
+ preposition = "gb.in";
+ } else {
+ what = getString("gb.pushedNewBranch");
+ preposition = "gb.to";
+ }
}
break;
case DELETE:
|