From 5b671d01e8b1335ded10ab81ca1be55940b143e4 Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Fri, 18 Sep 2020 22:03:35 -0600 Subject: [PATCH] Early exit testHideCredentials if Windows long path Git for Windows does not like working with long paths --- src/test/java/hudson/plugins/git/GitSCMTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/java/hudson/plugins/git/GitSCMTest.java b/src/test/java/hudson/plugins/git/GitSCMTest.java index a650403efd..7c16e78c13 100644 --- a/src/test/java/hudson/plugins/git/GitSCMTest.java +++ b/src/test/java/hudson/plugins/git/GitSCMTest.java @@ -1716,6 +1716,13 @@ public void testHideCredentials() throws Exception { descriptor.setHideCredentials(true); assertTrue("Hide credentials not set", scm.isHideCredentials()); + /* Exit test early if running on Windows and path will be too long */ + /* Known limitation of git for Windows 2.28.0 and earlier */ + /* Needs a longpath fix in git for Windows */ + String currentDirectoryPath = new File(".").getCanonicalPath(); + if (isWindows() && currentDirectoryPath.length() > 95) { + return; + } descriptor.setHideCredentials(false); final String commitFile1 = "commitFile1";