@@ -345,12 +345,12 @@ public VCSCommit setFileContent(String branchName, String filePath, String conte
345
345
Git git = getLocalGit (wc );
346
346
Repository gitRepo = git .getRepository ()) {
347
347
String bn = getRealBranchName (branchName );
348
-
348
+
349
349
git
350
350
.pull ()
351
351
.setCredentialsProvider (credentials )
352
352
.call ();
353
-
353
+
354
354
git
355
355
.checkout ()
356
356
.setCreateBranch (gitRepo .exactRef ("refs/heads/" + bn ) == null )
@@ -485,7 +485,7 @@ public List<String> getCommitMessages(String branchName, Integer limit) {
485
485
486
486
Iterable <RevCommit > logs = git
487
487
.log ()
488
- .add (gitRepo .resolve ("remotes/origin/" + getRealBranchName (branchName )))
488
+ .add (gitRepo .resolve ("refs/ remotes/origin/" + getRealBranchName (branchName )))
489
489
.setMaxCount (limit )
490
490
.call ();
491
491
@@ -513,6 +513,7 @@ public VCSCommit removeFile(String branchName, String filePath, String commitMes
513
513
Repository gitRepo = git .getRepository ()) {
514
514
515
515
String bn = getRealBranchName (branchName );
516
+
516
517
git
517
518
.pull ()
518
519
.setCredentialsProvider (credentials )
@@ -678,12 +679,8 @@ private RevCommit getHeadRevCommit (String branchName) {
678
679
RevWalk rw = new RevWalk (gitRepo )) {
679
680
680
681
String bn = getRealBranchName (branchName );
681
- git
682
- .checkout ()
683
- .setCreateBranch (gitRepo .exactRef ("refs/heads/" + bn ) == null )
684
- .setName (bn )
685
- .call ();
686
- Ref ref = gitRepo .exactRef ("refs/heads/" + bn );
682
+
683
+ Ref ref = gitRepo .exactRef ("refs/remotes/origin/" + bn );
687
684
ObjectId commitId = ref .getObjectId ();
688
685
return rw .parseCommit ( commitId );
689
686
} catch (GitAPIException e ) {
@@ -763,7 +760,18 @@ public List<VCSTag> getTags() {
763
760
try (IVCSLockedWorkingCopy wc = repo .getVCSLockedWorkingCopy ();
764
761
Git git = getLocalGit (wc );
765
762
Repository gitRepo = git .getRepository ();
766
- RevWalk rw = new RevWalk (gitRepo ) ) {
763
+ RevWalk rw = new RevWalk (gitRepo )) {
764
+ git
765
+ .checkout ()
766
+ .setCreateBranch (gitRepo .exactRef ("refs/heads/" + MASTER_BRANCH_NAME ) == null )
767
+ .setName (MASTER_BRANCH_NAME )
768
+ .call ();
769
+
770
+ git
771
+ .pull ()
772
+ .setCredentialsProvider (credentials )
773
+ .call ();
774
+
767
775
List <Ref > refs = git
768
776
.tagList ()
769
777
.call ();
0 commit comments