|
|
@ -82,7 +82,6 @@ import org.eclipse.jgit.lib.NullProgressMonitor; |
|
|
|
import org.eclipse.jgit.lib.ObjectId; |
|
|
|
import org.eclipse.jgit.lib.ObjectId; |
|
|
|
import org.eclipse.jgit.lib.ProgressMonitor; |
|
|
|
import org.eclipse.jgit.lib.ProgressMonitor; |
|
|
|
import org.eclipse.jgit.lib.Ref; |
|
|
|
import org.eclipse.jgit.lib.Ref; |
|
|
|
import org.eclipse.jgit.lib.RefDatabase; |
|
|
|
|
|
|
|
import org.eclipse.jgit.lib.Repository; |
|
|
|
import org.eclipse.jgit.lib.Repository; |
|
|
|
import org.eclipse.jgit.revwalk.AsyncRevObjectQueue; |
|
|
|
import org.eclipse.jgit.revwalk.AsyncRevObjectQueue; |
|
|
|
import org.eclipse.jgit.revwalk.DepthWalk; |
|
|
|
import org.eclipse.jgit.revwalk.DepthWalk; |
|
|
@ -707,8 +706,14 @@ public class UploadPack { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private Map<String, Ref> getAdvertisedOrDefaultRefs() throws IOException { |
|
|
|
private Map<String, Ref> getAdvertisedOrDefaultRefs() throws IOException { |
|
|
|
if (refs == null) |
|
|
|
if (refs != null) { |
|
|
|
setAdvertisedRefs(db.getRefDatabase().getRefs(RefDatabase.ALL)); |
|
|
|
return refs; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
advertiseRefsHook.advertiseRefs(this); |
|
|
|
|
|
|
|
if (refs == null) { |
|
|
|
|
|
|
|
setAdvertisedRefs(db.getRefDatabase().getRefs(ALL)); |
|
|
|
|
|
|
|
} |
|
|
|
return refs; |
|
|
|
return refs; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -867,15 +872,7 @@ public class UploadPack { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void sendAdvertisedRefs(final RefAdvertiser adv) throws IOException, |
|
|
|
public void sendAdvertisedRefs(final RefAdvertiser adv) throws IOException, |
|
|
|
ServiceMayNotContinueException { |
|
|
|
ServiceMayNotContinueException { |
|
|
|
try { |
|
|
|
Map<String, Ref> advertisedOrDefaultRefs = getAdvertisedOrDefaultRefs(); |
|
|
|
advertiseRefsHook.advertiseRefs(this); |
|
|
|
|
|
|
|
} catch (ServiceMayNotContinueException fail) { |
|
|
|
|
|
|
|
if (fail.getMessage() != null) { |
|
|
|
|
|
|
|
adv.writeOne("ERR " + fail.getMessage()); //$NON-NLS-1$
|
|
|
|
|
|
|
|
fail.setOutput(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
throw fail; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
adv.init(db); |
|
|
|
adv.init(db); |
|
|
|
adv.advertiseCapability(OPTION_INCLUDE_TAG); |
|
|
|
adv.advertiseCapability(OPTION_INCLUDE_TAG); |
|
|
@ -900,7 +897,6 @@ public class UploadPack { |
|
|
|
adv.advertiseCapability(OPTION_ALLOW_REACHABLE_SHA1_IN_WANT); |
|
|
|
adv.advertiseCapability(OPTION_ALLOW_REACHABLE_SHA1_IN_WANT); |
|
|
|
adv.advertiseCapability(OPTION_AGENT, UserAgent.get()); |
|
|
|
adv.advertiseCapability(OPTION_AGENT, UserAgent.get()); |
|
|
|
adv.setDerefTags(true); |
|
|
|
adv.setDerefTags(true); |
|
|
|
Map<String, Ref> advertisedOrDefaultRefs = getAdvertisedOrDefaultRefs(); |
|
|
|
|
|
|
|
findSymrefs(adv, advertisedOrDefaultRefs); |
|
|
|
findSymrefs(adv, advertisedOrDefaultRefs); |
|
|
|
advertised = adv.send(advertisedOrDefaultRefs); |
|
|
|
advertised = adv.send(advertisedOrDefaultRefs); |
|
|
|
if (adv.isEmpty()) |
|
|
|
if (adv.isEmpty()) |
|
|
|