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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <spearce@xxxxxxxxxxx>
---
 .../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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux