diff options
author | Colby Ranger <cranger@google.com> | 2013-08-08 07:57:49 -0700 |
---|---|---|
committer | Colby Ranger <cranger@google.com> | 2013-08-08 11:10:40 -0400 |
commit | ae1f46989c0515dce640ab339453b09810c0c5a5 (patch) | |
tree | ee40a2bb0c8914d64f27f0914e8c504e78103bfc /org.eclipse.jgit | |
parent | 15adcefb73a48ee11ec1b231a2ebf8c18e15e53f (diff) | |
download | jgit-ae1f46989c0515dce640ab339453b09810c0c5a5.tar.gz jgit-ae1f46989c0515dce640ab339453b09810c0c5a5.zip |
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
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java index f0ee974177..fd1de2956d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java +++ b/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(); } |