-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SCM-1022] - jgit push failure is not failing the build #203
Conversation
Looking into... |
|
||
import static org.junit.Assert.assertFalse; | ||
|
||
public class JGitCheckinCommandTest extends ScmTestCase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer having this test as part of the Git TCK so that it is executed against both Git CLI and JGit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. It turns out that the RemoteRefUpdate.Status#UP_TO_DATE
equivalent for gitexe is considered ok as the git push
command returns zero. Which seems questionable for maven-release. Nothing would be changed in the upstream.
Which is better: To have equal behavior for both implementations, or a successful, possibly empty release?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a push which doesn't add any commits should never be an error (neither in JGit nor in GitExe). If there is an up2date check being necessary in maven-release-plugin that needs to be triggered separately. I would therefore appreciate to add the test to the TCK but assert that it is returning a success status.
...src/main/java/org/apache/maven/scm/provider/git/jgit/command/checkin/JGitCheckInCommand.java
Outdated
Show resolved
Hide resolved
...test/java/org/apache/maven/scm/provider/git/jgit/command/checkin/JGitCheckinCommandTest.java
Outdated
Show resolved
Hide resolved
Moved RejectedNonFastForward Test to TCK. Removed UpToDate test since gitexec and jgit return different status, see #203 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am fine with this PR.
@kwin Any objections? |
013825e
to
2f6591c
Compare
...src/main/java/org/apache/maven/scm/provider/git/jgit/command/checkin/JGitCheckInCommand.java
Outdated
Show resolved
Hide resolved
Status.UP_TO_DATE is now successful. Added TCK testUpToDatePush. |
Let me run this again |
dca79a8
to
6575148
Compare
No description provided.