diff options
author | Matthias Sohn | 2018-11-25 22:15:11 +0000 |
---|---|---|
committer | Matthias Sohn | 2018-11-26 17:49:30 +0000 |
commit | df6263644bb3387239cd77aa57074380610a0ec4 (patch) | |
tree | 45668ccf29c4149b3d2f7e338a59243737a3cbd9 /org.eclipse.jgit.test/tst/org | |
parent | f9de9175477577c6c7d0a22ebe5a1c9a1c299c1a (diff) | |
download | jgit-df6263644bb3387239cd77aa57074380610a0ec4.tar.gz jgit-df6263644bb3387239cd77aa57074380610a0ec4.tar.xz jgit-df6263644bb3387239cd77aa57074380610a0ec4.zip |
Fix DescribeCommand with multiple match options
when multiple match options are given in git describe the result must
not depend on the order of the match options. JGit wrongly picked the
first match using the match options in the order they were defined. Fix
this by concatenating the streams of matching tags for all match options
and then choosing the first match on the concatenated stream sorted in
tie break order.
See https://git-scm.com/docs/git-describe#git-describe---matchltpatterngt
Change-Id: Id01433d35fa16fb4c30526605bee041ac1d954b2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/api/DescribeCommandTest.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/DescribeCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/DescribeCommandTest.java index a2d8e89699..be67893cb9 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/DescribeCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/DescribeCommandTest.java @@ -156,9 +156,9 @@ public class DescribeCommandTest extends RepositoryTestCase { assertEquals("v1.1.1-1-gb89dead", describe(c2, "v1.1*")); // Ensure that ordering of match precedence is preserved as per Git behaviour - assertEquals("v1.0.1", describe(c1, "v1.0*", "v1.1*")); + assertEquals("v1.1.1", describe(c1, "v1.0*", "v1.1*")); assertEquals("v1.1.1", describe(c1, "v1.1*", "v1.0*")); - assertEquals("v1.0.1-1-gb89dead", describe(c2, "v1.0*", "v1.1*")); + assertEquals("v1.1.1-1-gb89dead", describe(c2, "v1.0*", "v1.1*")); assertEquals("v1.1.1-1-gb89dead", describe(c2, "v1.1*", "v1.0*")); } else { // no timestamps so no guarantees on which tag is chosen |