
code: Rename getBranchNames() to getRefNames()
The method actually doesn't return branch names but ref names,
@24d7a14e2802b157f368c06d8478f5cd54c269af
--- app/controllers/CodeApp.java
+++ app/controllers/CodeApp.java
... | ... | @@ -94,7 +94,7 @@ |
94 | 94 |
path = HttpUtil.decodePathSegment(path); |
95 | 95 |
|
96 | 96 |
PlayRepository repository = RepositoryService.getRepository(project); |
97 |
- List<String> branches = repository.getBranchNames(); |
|
97 |
+ List<String> branches = repository.getRefNames(); |
|
98 | 98 |
List<ObjectNode> recursiveData = RepositoryService.getMetaDataFromAncestorDirectories( |
99 | 99 |
repository, branch, path); |
100 | 100 |
|
--- app/controllers/ProjectApp.java
+++ app/controllers/ProjectApp.java
... | ... | @@ -169,7 +169,7 @@ |
169 | 169 |
Project project = Project.findByOwnerAndProjectName(ownerId, projectName); |
170 | 170 |
Form<Project> projectForm = form(Project.class).fill(project); |
171 | 171 |
PlayRepository repository = RepositoryService.getRepository(project); |
172 |
- return ok(setting.render("title.projectSetting", projectForm, project, repository.getBranchNames())); |
|
172 |
+ return ok(setting.render("title.projectSetting", projectForm, project, repository.getRefNames())); |
|
173 | 173 |
} |
174 | 174 |
|
175 | 175 |
@Transactional |
... | ... | @@ -246,7 +246,7 @@ |
246 | 246 |
|
247 | 247 |
if (validateWhenUpdate(ownerId, filledUpdatedProjectForm)) { |
248 | 248 |
return badRequest(setting.render("title.projectSetting", |
249 |
- filledUpdatedProjectForm, project, repository.getBranchNames())); |
|
249 |
+ filledUpdatedProjectForm, project, repository.getRefNames())); |
|
250 | 250 |
} |
251 | 251 |
|
252 | 252 |
Project updatedProject = filledUpdatedProjectForm.get(); |
--- app/models/Project.java
+++ app/models/Project.java
... | ... | @@ -224,7 +224,7 @@ |
224 | 224 |
public Date lastUpdateDate() { |
225 | 225 |
try { |
226 | 226 |
PlayRepository repository = RepositoryService.getRepository(this); |
227 |
- List<String> branches = repository.getBranchNames(); |
|
227 |
+ List<String> branches = repository.getRefNames(); |
|
228 | 228 |
if (!branches.isEmpty() && repository instanceof GitRepository) { |
229 | 229 |
GitRepository gitRepo = new GitRepository(owner, name); |
230 | 230 |
List<Commit> history = gitRepo.getHistory(0, 2, "HEAD", null); |
--- app/playRepository/GitRepository.java
+++ app/playRepository/GitRepository.java
... | ... | @@ -842,7 +842,7 @@ |
842 | 842 |
* @return a list of the name strings |
843 | 843 |
*/ |
844 | 844 |
@Override |
845 |
- public List<String> getBranchNames() { |
|
845 |
+ public List<String> getRefNames() { |
|
846 | 846 |
List<String> branches = new ArrayList<>(); |
847 | 847 |
|
848 | 848 |
for(String refName : repository.getAllRefs().keySet()) { |
... | ... | @@ -1821,7 +1821,7 @@ |
1821 | 1821 |
|
1822 | 1822 |
@Override |
1823 | 1823 |
public boolean isEmpty() { |
1824 |
- return this.getBranchNames().isEmpty(); |
|
1824 |
+ return this.getRefNames().isEmpty(); |
|
1825 | 1825 |
} |
1826 | 1826 |
|
1827 | 1827 |
/* |
--- app/playRepository/PlayRepository.java
+++ app/playRepository/PlayRepository.java
... | ... | @@ -56,7 +56,7 @@ |
56 | 56 |
|
57 | 57 |
public abstract Commit getCommit(String rev) throws IOException, SVNException; |
58 | 58 |
|
59 |
- public abstract List<String> getBranchNames(); |
|
59 |
+ public abstract List<String> getRefNames(); |
|
60 | 60 |
|
61 | 61 |
public abstract ObjectNode getMetaDataFromPath(String branch, String path) throws IOException, SVNException, GitAPIException; |
62 | 62 |
|
--- app/playRepository/SVNRepository.java
+++ app/playRepository/SVNRepository.java
... | ... | @@ -33,7 +33,6 @@ |
33 | 33 |
import org.eclipse.jgit.diff.RawText; |
34 | 34 |
import org.joda.time.format.DateTimeFormatter; |
35 | 35 |
import org.joda.time.format.ISODateTimeFormat; |
36 |
-import org.tigris.subversion.javahl.ClientException; |
|
37 | 36 |
import org.tmatesoft.svn.core.*; |
38 | 37 |
import org.tmatesoft.svn.core.io.SVNRepositoryFactory; |
39 | 38 |
import org.tmatesoft.svn.core.wc.SVNClientManager; |
... | ... | @@ -148,7 +147,7 @@ |
148 | 147 |
@Override |
149 | 148 |
public ObjectNode getMetaDataFromPath(String branch, String path) throws |
150 | 149 |
IOException, SVNException { |
151 |
- List<String> branches = getBranchNames(); |
|
150 |
+ List<String> branches = getRefNames(); |
|
152 | 151 |
if (!branches.contains(branch)) { |
153 | 152 |
return null; |
154 | 153 |
} |
... | ... | @@ -301,7 +300,7 @@ |
301 | 300 |
} |
302 | 301 |
|
303 | 302 |
@Override |
304 |
- public List<String> getBranchNames() { |
|
303 |
+ public List<String> getRefNames() { |
|
305 | 304 |
ArrayList<String> branches = new ArrayList<>(); |
306 | 305 |
branches.add(SVNRevision.HEAD.getName()); |
307 | 306 |
return branches; |
--- app/views/code/history.scala.html
+++ app/views/code/history.scala.html
... | ... | @@ -95,7 +95,7 @@ |
95 | 95 |
|
96 | 96 |
@if(path == null){ |
97 | 97 |
<select id="branches" data-toggle="select2" data-format="branch" data-dropdown-css-class="branches" class="pull-right"> |
98 |
- @defining(RepositoryService.getRepository(project).getBranchNames()) { branches => |
|
98 |
+ @defining(RepositoryService.getRepository(project).getRefNames()) { branches => |
|
99 | 99 |
@for(branchName <- branches){ |
100 | 100 |
<option value="@routes.CodeHistoryApp.history(project.owner, project.name, URLEncoder.encode(branchName, "UTF-8"), null)" |
101 | 101 |
@if(selectedBranch){ @if(branchItemName(branchName) == branchItemName(selectedBranch)){ selected } }> |
--- app/views/code/svnDiff.scala.html
+++ app/views/code/svnDiff.scala.html
... | ... | @@ -39,7 +39,7 @@ |
39 | 39 |
<span class="d-caret"><span class="caret"></span></span> |
40 | 40 |
</button> |
41 | 41 |
<ul class="dropdown-menu"> |
42 |
- @defining(RepositoryService.getRepository(project).getBranchNames()) { branches => |
|
42 |
+ @defining(RepositoryService.getRepository(project).getRefNames()) { branches => |
|
43 | 43 |
@for(branch <- branches){ |
44 | 44 |
@common.branchItem("history", project, branch, null, |
45 | 45 |
utils.TemplateHelper.equals(branch, selectedBranch)) |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?