|
|
@ -56,6 +56,7 @@ import org.eclipse.jgit.lib.Repository; |
|
|
|
class RefDirectoryUpdate extends RefUpdate { |
|
|
|
class RefDirectoryUpdate extends RefUpdate { |
|
|
|
private final RefDirectory database; |
|
|
|
private final RefDirectory database; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean shouldDeref; |
|
|
|
private LockFile lock; |
|
|
|
private LockFile lock; |
|
|
|
|
|
|
|
|
|
|
|
RefDirectoryUpdate(final RefDirectory r, final Ref ref) { |
|
|
|
RefDirectoryUpdate(final RefDirectory r, final Ref ref) { |
|
|
@ -75,6 +76,7 @@ class RefDirectoryUpdate extends RefUpdate { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected boolean tryLock(boolean deref) throws IOException { |
|
|
|
protected boolean tryLock(boolean deref) throws IOException { |
|
|
|
|
|
|
|
shouldDeref = deref; |
|
|
|
Ref dst = getRef(); |
|
|
|
Ref dst = getRef(); |
|
|
|
if (deref) |
|
|
|
if (deref) |
|
|
|
dst = dst.getLeaf(); |
|
|
|
dst = dst.getLeaf(); |
|
|
@ -117,7 +119,7 @@ class RefDirectoryUpdate extends RefUpdate { |
|
|
|
msg = strResult; |
|
|
|
msg = strResult; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
database.log(this, msg, true); |
|
|
|
database.log(this, msg, shouldDeref); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!lock.commit()) |
|
|
|
if (!lock.commit()) |
|
|
|
return Result.LOCK_FAILURE; |
|
|
|
return Result.LOCK_FAILURE; |
|
|
@ -140,7 +142,7 @@ class RefDirectoryUpdate extends RefUpdate { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected Result doDelete(final Result status) throws IOException { |
|
|
|
protected Result doDelete(final Result status) throws IOException { |
|
|
|
if (getRef().getLeaf().getStorage() != Ref.Storage.NEW) |
|
|
|
if (getRef().getStorage() != Ref.Storage.NEW) |
|
|
|
database.delete(this); |
|
|
|
database.delete(this); |
|
|
|
return status; |
|
|
|
return status; |
|
|
|
} |
|
|
|
} |
|
|
|