|
|
|
@ -43,6 +43,7 @@
|
|
|
|
|
|
|
|
|
|
package org.eclipse.jgit.transport; |
|
|
|
|
|
|
|
|
|
import static org.eclipse.jgit.transport.GitProtocolConstants.CAPABILITY_ATOMIC; |
|
|
|
|
import static org.eclipse.jgit.transport.GitProtocolConstants.CAPABILITY_DELETE_REFS; |
|
|
|
|
import static org.eclipse.jgit.transport.GitProtocolConstants.CAPABILITY_OFS_DELTA; |
|
|
|
|
import static org.eclipse.jgit.transport.GitProtocolConstants.CAPABILITY_REPORT_STATUS; |
|
|
|
@ -908,6 +909,8 @@ public abstract class BaseReceivePack {
|
|
|
|
|
adv.advertiseCapability(CAPABILITY_SIDE_BAND_64K); |
|
|
|
|
adv.advertiseCapability(CAPABILITY_DELETE_REFS); |
|
|
|
|
adv.advertiseCapability(CAPABILITY_REPORT_STATUS); |
|
|
|
|
if (db.getRefDatabase().performsAtomicTransactions()) |
|
|
|
|
adv.advertiseCapability(CAPABILITY_ATOMIC); |
|
|
|
|
if (allowOfsDelta) |
|
|
|
|
adv.advertiseCapability(CAPABILITY_OFS_DELTA); |
|
|
|
|
adv.send(getAdvertisedOrDefaultRefs()); |
|
|
|
@ -1251,6 +1254,23 @@ public abstract class BaseReceivePack {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** @return if any commands have been rejected so far. */ |
|
|
|
|
protected boolean anyRejects() { |
|
|
|
|
for (ReceiveCommand cmd : commands) { |
|
|
|
|
if (cmd.getResult() != Result.NOT_ATTEMPTED && cmd.getResult() != Result.OK) |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** Set the result to fail for any command that was not processed yet. */ |
|
|
|
|
protected void failPendingCommands() { |
|
|
|
|
for (ReceiveCommand cmd : commands) { |
|
|
|
|
if (cmd.getResult() == Result.NOT_ATTEMPTED) |
|
|
|
|
cmd.setResult(Result.REJECTED_OTHER_REASON, JGitText.get().transactionAborted); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Filter the list of commands according to result. |
|
|
|
|
* |
|
|
|
|