@@ -184,10 +184,11 @@ public void deleteBranch(String branchName, String commitMessage) {
184
184
185
185
private void push (Git git , RefSpec refSpec ) throws GitAPIException {
186
186
PushCommand cmd = git
187
- .push ()
188
- .setPushAll ();
187
+ .push ();
189
188
if (refSpec != null ) {
190
189
cmd .setRefSpecs (refSpec );
190
+ } else {
191
+ cmd .setPushAll ();
191
192
}
192
193
cmd
193
194
.setRemote ("origin" )
@@ -743,7 +744,6 @@ List<Ref> getTagRefs() throws Exception {
743
744
Git git = getLocalGit (wc );
744
745
Repository gitRepo = git .getRepository ()) {
745
746
746
- //checkout(git, gitRepo, MASTER_BRANCH_NAME, null);
747
747
git .pull ().call ();
748
748
749
749
List <Ref > refs = git
@@ -827,7 +827,7 @@ public void checkout(String branchName, String targetPath, String revision) {
827
827
Repository gitRepo = git .getRepository ()) {
828
828
829
829
checkout (git , gitRepo , branchName , revision );
830
-
830
+
831
831
} catch (GitAPIException e ) {
832
832
throw new EVCSException (e );
833
833
} catch (Exception e ) {
@@ -838,9 +838,10 @@ public void checkout(String branchName, String targetPath, String revision) {
838
838
@ Override
839
839
public Boolean isRevisionTagged (String revision ) {
840
840
try (IVCSLockedWorkingCopy wc = repo .getVCSLockedWorkingCopy ();
841
- Git git = getLocalGit (wc );
842
- Repository gitRepo = git .getRepository ();
843
- RevWalk rw = new RevWalk (gitRepo )) {
841
+ Git git = getLocalGit (wc );
842
+ Repository gitRepo = git .getRepository ();
843
+ RevWalk rw = new RevWalk (gitRepo )) {
844
+
844
845
checkout (git , gitRepo , MASTER_BRANCH_NAME , null );
845
846
List <Ref > tagRefs = getTagRefs ();
846
847
for (Ref ref : tagRefs ) {
@@ -870,6 +871,8 @@ public VCSTag getTagByName(String tagName) {
870
871
Repository gitRepo = git .getRepository ();
871
872
RevWalk rw = new RevWalk (gitRepo )) {
872
873
874
+ git .pull ().call ();
875
+
873
876
List <Ref > tagRefs = getTagRefs ();
874
877
RevCommit revCommit ;
875
878
for (Ref ref : tagRefs ) {
0 commit comments