Skip to content

Commit c4c70c3

Browse files
committed
added pull on checkout
1 parent 8c898a8 commit c4c70c3

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,9 @@ void checkout(Git git, Repository gitRepo, String branchName, String revision) t
362362
.setUpstreamMode(SetupUpstreamMode.TRACK)
363363
.setName(bn)
364364
.call();
365+
git
366+
.pull()
367+
.call();
365368
} else {
366369
try (RevWalk walk = new RevWalk(gitRepo)) {
367370
RevCommit commit = walk.parseCommit(RevCommit.fromString(revision));
@@ -436,7 +439,11 @@ public Set<String> getBranches(String path) {
436439
try (IVCSLockedWorkingCopy wc = repo.getVCSLockedWorkingCopy();
437440
Git git = getLocalGit(wc);
438441
Repository gitRepo = git.getRepository()) {
439-
checkout(git, gitRepo, MASTER_BRANCH_NAME, null);
442+
443+
git
444+
.pull()
445+
.call();
446+
440447
List<Ref> refs = git
441448
.branchList()
442449
.setListMode(ListMode.REMOTE)
@@ -736,7 +743,8 @@ List<Ref> getTagRefs() throws Exception {
736743
Git git = getLocalGit(wc);
737744
Repository gitRepo = git.getRepository()) {
738745

739-
checkout(git, gitRepo, MASTER_BRANCH_NAME, null);
746+
//checkout(git, gitRepo, MASTER_BRANCH_NAME, null);
747+
git.pull().call();
740748

741749
List<Ref> refs = git
742750
.tagList()

0 commit comments

Comments
 (0)