]> source.dussan.org Git - jgit.git/commit
Separate RefUpdate.Result.REJECTED_{MISSING_OBJECT,OTHER_REASON} 32/100932/6
authorDave Borowitz <dborowitz@google.com>
Fri, 7 Jul 2017 15:38:29 +0000 (11:38 -0400)
committerDave Borowitz <dborowitz@google.com>
Tue, 25 Jul 2017 17:12:34 +0000 (13:12 -0400)
commitcf9e3fad524f5c4a47144decd9091c84c3f07849
tree7846bd53eecc585ca82a20ae9fc0a79aa6f26bee
parent4940ea14b7f8324c15fe978b80313d51d8341e9d
Separate RefUpdate.Result.REJECTED_{MISSING_OBJECT,OTHER_REASON}

ReceiveCommand.Result has a slightly richer set of possibilities, so it
makes sense for RefUpdate.Result to have more values in order to match.
In particular, this allows us to return REJECTED_MISSING_OBJECT from
RefUpdate when an object is missing.

The comment in RefUpdate#safeParse about expecting some old objects to be
missing is only applicable to the old ID, not the new ID. A missing new
ID is a bug or programmer error, and we should not update a ref to point
to one.

Fix various tests that started failing because they depended for no good
reason on setting refs to point to nonexistent objects; it's always easy
to create a real object when necessary.

It is possible that some downstream users of RefUpdate.Result might
choose to handle one of the new statuses differently, for example by
providing a more user-readable error message; that is not done in this
change.

Change-Id: I734b1c32d5404752447d9e20329471436ffe05fc
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefDirectoryTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefUpdateTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/T0003_BasicTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleStatusTest.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/RefUpdate.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceiveCommand.java