Permalink
Browse files

Fix RefUpdate.delete to update the result status

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@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
  • Loading branch information...
1 parent 22fbd6a commit dcbb6688edc5b6b9868d0f8a709f1f589ee289df @spearce spearce committed with robinrosenberg Feb 12, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 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;

0 comments on commit dcbb668

Please sign in to comment.