Tabnine Logo
ProtocolV2Hook
Code IndexAdd Tabnine to your IDE (free)

How to use
ProtocolV2Hook
in
org.eclipse.jgit.transport

Best Java code snippets using org.eclipse.jgit.transport.ProtocolV2Hook (Showing top 8 results out of 315)

origin: org.eclipse.jgit/org.eclipse.jgit

private void serviceV2() throws IOException {
  if (biDirectionalPipe) {
    // Just like in service(), the capability advertisement
    // is sent only if this is a bidirectional pipe. (If
    // not, the client is expected to call
    // sendAdvertisedRefs() on its own.)
    protocolV2Hook
        .onCapabilities(CapabilitiesV2Request.builder().build());
    for (String s : getV2CapabilityAdvertisement()) {
      pckOut.writeString(s + "\n"); //$NON-NLS-1$
    }
    pckOut.end();
    while (!serveOneCommandV2()) {
      // Repeat until an empty command or EOF.
    }
    return;
  }
  try {
    serveOneCommandV2();
  } finally {
    while (0 < rawIn.skip(2048) || 0 <= rawIn.read()) {
      // Discard until EOF.
    }
    rawOut.stopBuffering();
  }
}
origin: org.eclipse.jgit/org.eclipse.jgit

rawOut.stopBuffering();
protocolV2Hook.onFetch(req);
origin: org.eclipse.jgit/org.eclipse.jgit

private void lsRefsV2() throws IOException {
  ProtocolV2Parser parser = new ProtocolV2Parser(transferConfig);
  LsRefsV2Request req = parser.parseLsRefsRequest(pckIn);
  protocolV2Hook.onLsRefs(req);
  rawOut.stopBuffering();
  PacketLineOutRefAdvertiser adv = new PacketLineOutRefAdvertiser(pckOut);
  adv.setUseProtocolV2(true);
  if (req.getPeel()) {
    adv.setDerefTags(true);
  }
  Map<String, Ref> refsToSend = getFilteredRefs(req.getRefPrefixes());
  if (req.getSymrefs()) {
    findSymrefs(adv, refsToSend);
  }
  adv.send(refsToSend);
  adv.end();
}
origin: org.eclipse.jgit/org.eclipse.jgit

    .onCapabilities(CapabilitiesV2Request.builder().build());
for (String s : getV2CapabilityAdvertisement()) {
  adv.writeOne(s);
origin: berlam/github-bucket

private void lsRefsV2() throws IOException {
  ProtocolV2Parser parser = new ProtocolV2Parser(transferConfig);
  LsRefsV2Request req = parser.parseLsRefsRequest(pckIn);
  protocolV2Hook.onLsRefs(req);
  rawOut.stopBuffering();
  PacketLineOutRefAdvertiser adv = new PacketLineOutRefAdvertiser(pckOut);
  adv.setUseProtocolV2(true);
  if (req.getPeel()) {
    adv.setDerefTags(true);
  }
  Map<String, Ref> refsToSend;
  if (req.getRefPrefixes().isEmpty()) {
    refsToSend = getAdvertisedOrDefaultRefs();
  } else {
    refsToSend = new HashMap<>();
    String[] prefixes = req.getRefPrefixes().toArray(new String[0]);
    for (Ref ref : db.getRefDatabase().getRefsByPrefix(prefixes)) {
      refsToSend.put(ref.getName(), ref);
    }
  }
  if (req.getSymrefs()) {
    findSymrefs(adv, refsToSend);
  }
  adv.send(refsToSend);
  adv.end();
}
origin: berlam/github-bucket

rawOut.stopBuffering();
protocolV2Hook.onFetch(req);
origin: berlam/github-bucket

private void serviceV2() throws IOException {
  if (biDirectionalPipe) {
    // Just like in service(), the capability advertisement
    // is sent only if this is a bidirectional pipe. (If
    // not, the client is expected to call
    // sendAdvertisedRefs() on its own.)
    protocolV2Hook
        .onCapabilities(CapabilitiesV2Request.builder().build());
    for (String s : getV2CapabilityAdvertisement()) {
      pckOut.writeString(s + "\n"); //$NON-NLS-1$
    }
    pckOut.end();
    while (!serveOneCommandV2()) {
      // Repeat until an empty command or EOF.
    }
    return;
  }
  try {
    serveOneCommandV2();
  } finally {
    while (0 < rawIn.skip(2048) || 0 <= rawIn.read()) {
      // Discard until EOF.
    }
    rawOut.stopBuffering();
  }
}
origin: berlam/github-bucket

    .onCapabilities(CapabilitiesV2Request.builder().build());
for (String s : getV2CapabilityAdvertisement()) {
  adv.writeOne(s);
org.eclipse.jgit.transportProtocolV2Hook

Javadoc

Hook to allow callers to be notified on Git protocol v2 requests.

Most used methods

  • onCapabilities
  • onFetch
  • onLsRefs

Popular in Java

  • Updating database using SQL prepared statement
  • onRequestPermissionsResult (Fragment)
  • setRequestProperty (URLConnection)
  • getSystemService (Context)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • JCheckBox (javax.swing)
  • Join (org.hibernate.mapping)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now