From fd6db9f75d89e29d9e519a32f9b3f1828c8632b0 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Tue, 28 Jan 2014 19:46:50 +0400 Subject: [PATCH] [git] IDEA-119887 Support one more git version output format Allow just 2 version numbers. --- plugins/git4idea/src/git4idea/config/GitVersion.java | 2 +- plugins/git4idea/tests/git4idea/tests/GitVersionTest.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/git4idea/src/git4idea/config/GitVersion.java b/plugins/git4idea/src/git4idea/config/GitVersion.java index 794ca8b500e3..57ac40dfb5fa 100644 --- a/plugins/git4idea/src/git4idea/config/GitVersion.java +++ b/plugins/git4idea/src/git4idea/config/GitVersion.java @@ -69,7 +69,7 @@ public final class GitVersion implements Comparable { public static final GitVersion NULL = new GitVersion(0, 0, 0, 0, Type.NULL); private static final Pattern FORMAT = Pattern.compile( - "git version (\\d+)\\.(\\d+)\\.(\\d+)(?:\\.(\\d+))?(.*)", Pattern.CASE_INSENSITIVE); + "git version (\\d+)\\.(\\d+)(?:\\.(\\d+))?(?:\\.(\\d+))?(.*)", Pattern.CASE_INSENSITIVE); private static final Logger LOG = Logger.getInstance(GitVersion.class.getName()); diff --git a/plugins/git4idea/tests/git4idea/tests/GitVersionTest.java b/plugins/git4idea/tests/git4idea/tests/GitVersionTest.java index 47966d8a2436..52232a1c4c88 100644 --- a/plugins/git4idea/tests/git4idea/tests/GitVersionTest.java +++ b/plugins/git4idea/tests/git4idea/tests/GitVersionTest.java @@ -34,7 +34,8 @@ public class GitVersionTest { new TestGitVersion("git version 1.7.3.3", 1, 7, 3, 3), new TestGitVersion("git version 1.7.3.5.gb27be", 1, 7, 3, 5), new TestGitVersion("git version 1.7.4-rc1", 1, 7, 4, 0), - new TestGitVersion("git version 1.7.7.5 (Apple Git-24)", 1, 7, 7, 5) + new TestGitVersion("git version 1.7.7.5 (Apple Git-24)", 1, 7, 7, 5), + new TestGitVersion("git version 1.9.rc0.143.g6fd479e", 1, 9, 0, 0) }; private static final TestGitVersion[] msysTests = {