瀏覽代碼

Advertise capabilities with no refs in upload service.

With reference hiding, it is possible for a repository to appear
empty when all refs are hidden. This causes capabilities to not be
advertised either, since they are published with the first reference,
breaking fetch by SHA1 support.

Always advertise the capabilites by publishing the symbolic capabilities
reference when the repository has no references to advertise (similar to
the receive service).

Change-Id: I8060e430ee03571dc51239e702864c85e888505c
tags/v3.1.0.201309270735-rc1
Colby Ranger 10 年之前
父節點
當前提交
ae1f46989c
共有 1 個檔案被更改,包括 2 行新增0 行删除
  1. 2
    0
      org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java

+ 2
- 0
org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java 查看文件

@@ -810,6 +810,8 @@ public class UploadPack {
adv.advertiseCapability(OPTION_ALLOW_TIP_SHA1_IN_WANT);
adv.setDerefTags(true);
advertised = adv.send(getAdvertisedOrDefaultRefs());
if (adv.isEmpty())
adv.advertiseId(ObjectId.zeroId(), "capabilities^{}"); //$NON-NLS-1$
adv.end();
}


Loading…
取消
儲存