diff --git a/src/main/java/jenkins/plugins/git/GitSCMFileSystem.java b/src/main/java/jenkins/plugins/git/GitSCMFileSystem.java index 35ea53e4f5..5a854b5628 100644 --- a/src/main/java/jenkins/plugins/git/GitSCMFileSystem.java +++ b/src/main/java/jenkins/plugins/git/GitSCMFileSystem.java @@ -327,7 +327,7 @@ static HeadNameResult calculate(@NonNull BranchSpec branchSpec, prefix = null; } else { // check for commit-id - final String regex = "^[a-fA-F0-9]{40}$"; + final String regex = "^([a-fA-F0-9]{40}|[a-fA-F0-9]{64})$"; final Pattern pattern = Pattern.compile(regex, Pattern.MULTILINE); final Matcher matcher = pattern.matcher(branchSpecExpandedName);