diff options
author | kylezhao <kylezhao@tencent.com> | 2021-03-30 11:04:12 +0800 |
---|---|---|
committer | Christian Halstrick <christian.halstrick@sap.com> | 2021-05-26 10:14:22 +0200 |
commit | 46a702ef418e9f7723dac10d94460a4f3c0a689a (patch) | |
tree | 6deadcd1badcab22612f92098c922836bba258b4 /org.eclipse.jgit.pgm/src/org | |
parent | c718e6059c0371dcde83d51f83f3031f934c34b7 (diff) | |
download | jgit-46a702ef418e9f7723dac10d94460a4f3c0a689a.tar.gz jgit-46a702ef418e9f7723dac10d94460a4f3c0a689a.zip |
pgm: rewrite parents when --parents flag is passed
According to [1], we should rewrite parents in RevWalkTextBuiltin
when variable parents is true.
[1]
https://git-scm.com/docs/git-rev-list#Documentation/git-rev-list.txt---parents
Change-Id: If5dca3b280366969d0488fa895bc37253a797394
Signed-off-by: kylezhao <kylezhao@tencent.com>
Diffstat (limited to 'org.eclipse.jgit.pgm/src/org')
-rw-r--r-- | org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java index 822f8998bd..696a924ecf 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java @@ -129,6 +129,9 @@ abstract class RevWalkTextBuiltin extends TextBuiltin { walk.setTreeFilter(AndTreeFilter.create(pathFilter, TreeFilter.ANY_DIFF)); } + if (parents) { + walk.setRewriteParents(true); + } if (revLimiter.size() == 1) walk.setRevFilter(revLimiter.get(0)); |