Skip to content

Commit

Permalink
Push commits before tags
Browse files Browse the repository at this point in the history
Some Git servers like Gerrit do not support tag push before commit push.
  • Loading branch information
reda-alaoui committed Feb 15, 2022
1 parent 0130343 commit d474e0f
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public void call(String targetBranch, String targetRepo)
git.fetch_().from(remoteURI, remote.getFetchRefSpecs()).execute();
ObjectId remoteRev = git.revParse(targetRepo + "/" + targetBranch);
git.merge().setRevisionToMerge(remoteRev).execute();
git.push().to(remoteURI).ref("HEAD:" + targetBranch).execute();
git.push().to(remoteURI).ref("HEAD:" + targetBranch).tags(true).execute();
git.fetch_().from(remoteURI, remote.getFetchRefSpecs()).execute();
} catch (GitException e) {
Expand Down

0 comments on commit d474e0f

Please sign in to comment.