Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn2018-12-24 22:32:51 +0000
committerMatthias Sohn2018-12-24 22:36:29 +0000
commit3dd3fe9ea495b1b3dec740bbb95076a7aeba0380 (patch)
tree5287bceec991dcd606c27566e64487cbbda05871
parent7ae004509cf007b1750050adb5a3f9a46cc48b6b (diff)
parenta65ce1bfd135450abb11cf90263e5697785460fc (diff)
downloadjgit-3dd3fe9ea495b1b3dec740bbb95076a7aeba0380.tar.gz
jgit-3dd3fe9ea495b1b3dec740bbb95076a7aeba0380.tar.xz
jgit-3dd3fe9ea495b1b3dec740bbb95076a7aeba0380.zip
Merge branch 'stable-4.8' into stable-4.9
* stable-4.8: Prepare 4.7.8-SNAPSHOT builds JGit v4.7.7.201812240805-r Fix feature versions imported by feature org.eclipse.jgit.pgm Prepare 4.5.6-SNAPSHOT builds JGit v4.5.5.201812240535-r Call AdvertiseRefsHook before validating wants Change-Id: Ib44e314a68bca2349b45f4937257aa1298c8d74b Signed-off-by: Jonathan Nieder <jrn@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.jgit/.settings/.api_filters2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java22
2 files changed, 10 insertions, 14 deletions
diff --git a/org.eclipse.jgit/.settings/.api_filters b/org.eclipse.jgit/.settings/.api_filters
index bf71684a45..f746d882c1 100644
--- a/org.eclipse.jgit/.settings/.api_filters
+++ b/org.eclipse.jgit/.settings/.api_filters
@@ -3,7 +3,7 @@
<resource path="META-INF/MANIFEST.MF">
<filter id="924844039">
<message_arguments>
- <message_argument value="4.9.7"/>
+ <message_argument value="4.9.8"/>
<message_argument value="4.9.0"/>
</message_arguments>
</filter>
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 cf070c6348..63236cb810 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java
@@ -82,7 +82,6 @@ import org.eclipse.jgit.lib.NullProgressMonitor;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ProgressMonitor;
import org.eclipse.jgit.lib.Ref;
-import org.eclipse.jgit.lib.RefDatabase;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.AsyncRevObjectQueue;
import org.eclipse.jgit.revwalk.DepthWalk;
@@ -712,8 +711,14 @@ public class UploadPack {
}
private Map<String, Ref> getAdvertisedOrDefaultRefs() throws IOException {
- if (refs == null)
- setAdvertisedRefs(db.getRefDatabase().getRefs(RefDatabase.ALL));
+ if (refs != null) {
+ return refs;
+ }
+
+ advertiseRefsHook.advertiseRefs(this);
+ if (refs == null) {
+ setAdvertisedRefs(db.getRefDatabase().getRefs(ALL));
+ }
return refs;
}
@@ -892,15 +897,7 @@ public class UploadPack {
*/
public void sendAdvertisedRefs(final RefAdvertiser adv) throws IOException,
ServiceMayNotContinueException {
- try {
- advertiseRefsHook.advertiseRefs(this);
- } catch (ServiceMayNotContinueException fail) {
- if (fail.getMessage() != null) {
- adv.writeOne("ERR " + fail.getMessage()); //$NON-NLS-1$
- fail.setOutput();
- }
- throw fail;
- }
+ Map<String, Ref> advertisedOrDefaultRefs = getAdvertisedOrDefaultRefs();
adv.init(db);
adv.advertiseCapability(OPTION_INCLUDE_TAG);
@@ -925,7 +922,6 @@ public class UploadPack {
adv.advertiseCapability(OPTION_ALLOW_REACHABLE_SHA1_IN_WANT);
adv.advertiseCapability(OPTION_AGENT, UserAgent.get());
adv.setDerefTags(true);
- Map<String, Ref> advertisedOrDefaultRefs = getAdvertisedOrDefaultRefs();
findSymrefs(adv, advertisedOrDefaultRefs);
advertised = adv.send(advertisedOrDefaultRefs);
if (adv.isEmpty())

Back to the top