Skip to content

Commit 310aff4

Browse files
committed
refactor
1 parent ac8c7e2 commit 310aff4

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/main/java/org/scm4j/vcs/GitVCS.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public VCSTag createUnannotatedTag(String branchName, String tagName, String rev
9797
Git git = getLocalGit(wc);
9898
Repository gitRepo = git.getRepository();
9999
RevWalk rw = new RevWalk(gitRepo)) {
100-
100+
101101
git
102102
.pull()
103103
.setCredentialsProvider(credentials)
@@ -263,8 +263,6 @@ public void connectFailed(URI uri, SocketAddress sa, IOException ioe) {
263263
Authenticator.setDefault(new Authenticator() {
264264
@Override
265265
protected PasswordAuthentication getPasswordAuthentication() {
266-
System.out.println(super.getRequestingSite().getHostName());
267-
System.out.println(repo.getRepoUrl());
268266
if (super.getRequestingSite().getHostName().contains(repo.getRepoUrl()) &&
269267
super.getRequestingPort() == port) {
270268
return new PasswordAuthentication(proxyUser, proxyPassword.toCharArray());
@@ -467,19 +465,13 @@ public Set<String> getBranches(String path) {
467465
.setCredentialsProvider(credentials)
468466
.call();
469467

470-
471-
472468
Collection<Ref> refs = gitRepo.getRefDatabase().getRefs(REFS_REMOTES_ORIGIN).values();
473469
Set<String> res = new HashSet<>();
474470
String bn;
475471
for (Ref ref : refs) {
476472
bn = ref.getName().replace(REFS_REMOTES_ORIGIN, "");
477-
if (path == null) {
473+
if (bn.startsWith(path == null ? "" : path)) {
478474
res.add(bn);
479-
} else {
480-
if (bn.startsWith(path)) {
481-
res.add(bn);
482-
}
483475
}
484476
}
485477
return res;

0 commit comments

Comments
 (0)