[JGIT PATCH 1/6] Fix RefUpdate.delete to update the result status

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

 



Some applications may want to use getResult() to obtain the
status of the delete operation, as perhaps they lost access
to the return value.  This makes delete() more consistent in
use with update().

Signed-off-by: Shawn O. Pearce <spearce@xxxxxxxxxxx>
---
 .../src/org/spearce/jgit/lib/RefUpdate.java        |    4 ++--
 1 files changed, 2 insertions(+), 2 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 7ad2bab..d1820da 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/RefUpdate.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/RefUpdate.java
@@ -401,11 +401,11 @@ public Result delete(final RevWalk walk) throws IOException {
 		if (getName().startsWith(Constants.R_HEADS)) {
 			final Ref head = db.readRef(Constants.HEAD);
 			if (head != null && getName().equals(head.getName()))
-				return Result.REJECTED_CURRENT_BRANCH;
+				return result = Result.REJECTED_CURRENT_BRANCH;
 		}
 
 		try {
-			return updateImpl(walk, new DeleteStore());
+			return result = updateImpl(walk, new DeleteStore());
 		} catch (IOException x) {
 			result = Result.IO_FAILURE;
 			throw x;
-- 
1.6.2.rc0.226.gf08f

--
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