]> source.dussan.org Git - jgit.git/commit
TagCommand: propagate NO_CHANGE information 38/173538/2
authorThomas Wolf <thomas.wolf@paranor.ch>
Tue, 8 Dec 2020 14:45:35 +0000 (15:45 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Tue, 8 Dec 2020 21:20:46 +0000 (22:20 +0100)
commite3ac56e2d0477b10993f2895f7a1a7cf1c40a3d5
treee6b1a9f600322316b8c6ec742c23065c2ea60bbc
parent29e1270768f217f7c8471d771d90ff43135d7c26
TagCommand: propagate NO_CHANGE information

Some clients may wish to allow NO_CHANGE lightweight tag updates
without setting the force flag. (For instance EGit does so.)
Command-line git does not allow this.

Propagate the RefUpdate result via the RefAlreadyExistsException.
That way a client has the possibility to catch it and check the
failure reason without having to parse the exception message, and
take appropriate action, like ignoring the exception on NO_CHANGE.

Change-Id: I60e7a15a3c309db4106cab87847a19b6d24866f6
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/TagCommandTest.java
org.eclipse.jgit/src/org/eclipse/jgit/api/TagCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/RefAlreadyExistsException.java