Thread (17 messages) flat view 17 messages, 3 authors, 2016-06-15
STALE3736d

[JGIT PATCH 11/13] Allow null new ObjectId during RefUpdate.delete

From: Shawn O. Pearce <hidden>
Date: 2016-06-15 22:45:49
Subsystem: the rest · Maintainer: Linus Torvalds

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help