aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2023-04-28 15:22:52 -0400
committerGerrit Code Review @ Eclipse.org <gerrit@eclipse.org>2023-04-28 15:22:52 -0400
commit2277f130416bb2a551ce77f36f062bc8145e617c (patch)
tree28a2cb9b509cb0cb74a8f3fc16c11b93bc643483 /org.eclipse.jgit/src
parenta4891f9f4991a7b9d006e0eb30bea783dd978d2e (diff)
parent4d9db14a5e31cd87128a059d96408062c0289040 (diff)
downloadjgit-2277f130416bb2a551ce77f36f062bc8145e617c.tar.gz
jgit-2277f130416bb2a551ce77f36f062bc8145e617c.zip
Merge "Merge branch 'stable-6.5'"
Diffstat (limited to 'org.eclipse.jgit/src')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/BranchConfig.java7
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java27
2 files changed, 20 insertions, 14 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BranchConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BranchConfig.java
index 19495dff1f..e15c7af932 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BranchConfig.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BranchConfig.java
@@ -35,7 +35,12 @@ public class BranchConfig {
*
* @since 6.5 used instead of deprecated "preserve" option
*/
- MERGES("merges"), //$NON-NLS-1$
+ MERGES("merges"){ //$NON-NLS-1$
+ @Override
+ public boolean matchConfigValue(String s) {
+ return super.matchConfigValue(s) || "preserve".equals(s); //$NON-NLS-1$
+ }
+ },
/** Value for rebasing interactively */
INTERACTIVE("interactive"), //$NON-NLS-1$
/** Value for not rebasing at all but merging */
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 b648706475..f245eae39f 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java
@@ -2444,11 +2444,11 @@ public class UploadPack implements Closeable {
if (peeledId == null || objectId == null)
continue;
- objectId = ref.getObjectId();
- if (pw.willInclude(peeledId) && !pw.willInclude(objectId)) {
- RevObject o = rw.parseAny(objectId);
- addTagChain(o, pw);
- pw.addObject(o);
+ if (pw.willInclude(peeledId)) {
+ // We don't need to handle parseTag throwing an
+ // IncorrectObjectTypeException as we only reach
+ // here when ref is an annotated tag
+ addTagChain(rw.parseTag(objectId), pw);
}
}
}
@@ -2498,15 +2498,16 @@ public class UploadPack implements Closeable {
}
private void addTagChain(
- RevObject o, PackWriter pw) throws IOException {
- while (Constants.OBJ_TAG == o.getType()) {
- RevTag t = (RevTag) o;
- o = t.getObject();
- if (o.getType() == Constants.OBJ_TAG && !pw.willInclude(o.getId())) {
- walk.parseBody(o);
- pw.addObject(o);
+ RevTag tag, PackWriter pw) throws IOException {
+ RevObject o = tag;
+ do {
+ tag = (RevTag) o;
+ walk.parseBody(tag);
+ if (!pw.willInclude(tag.getId())) {
+ pw.addObject(tag);
}
- }
+ o = tag.getObject();
+ } while (Constants.OBJ_TAG == o.getType());
}
private List<ObjectId> parseDeepenNots(List<String> deepenNots)