If we are deleting a ref we really don't care about what the
new ObjectId value should be; it just doesn't matter. If we
didn't set the value we should consider it the same as if we
had a MissingObjectException, which means treat the value as
null and perform a force update test.
Signed-off-by: Shawn O. Pearce <redacted>
---
.../src/org/spearce/jgit/lib/RefUpdate.java | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/RefUpdate.java b/org.spearce.jgit/src/org/spearce/jgit/lib/RefUpdate.java
index 0c9ce91..1417f2c 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/RefUpdate.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/RefUpdate.java
@@ -424,7 +424,7 @@ private Result updateImpl(final RevWalk walk, final Store store)
private static RevObject safeParse(final RevWalk rw, final AnyObjectId id)
throws IOException {
try {
- return rw.parseAny(id);
+ return id != null ? rw.parseAny(id) : null;
} catch (MissingObjectException e) {
// We can expect some objects to be missing, like if we are
// trying to force a deletion of a branch and the object it--
1.6.1.rc4.301.g5497a