-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
Jenkins: 2.504.2
OS: Windows Server 2022 - 10.0
Java: 21.0.7 - BellSoft (OpenJDK 64-Bit Server VM)
---
git:5.7.0
git-client:6.1.3
### Reproduction Steps
1. Configure Global Tool():
- Name: `MinGit-Auto`
- Set "Path to Git executable": `mingw64\bin\git.exe`
- Check "Install automatically(.zip/.tar.gz)"
- Select "MinGit" installer Url
- Set "Subdirectory": `MinGit`
2. Create pipeline job:
groovy pipeline { agent any tools { git 'MinGit-Auto' } stages { stage('Clone') { steps { git url: 'http://example.com/repo.git' } } } }
3. Run job :
logs:
*Started by user Admin Running as SYSTEM Building remotely on [Agent_IP] (windows) in workspace $WORKSPACE_PATH [WS-CLEANUP] Deleting project workspace... [WS-CLEANUP] Done Unpacking https://example.com/git/MinGit-2.50.0-64-bit.zip to $JENKINS_HOME/tools/mingw64/bin/git.exe on [Agent_IP] The recommended git tool is: NONE using credential Jenkins Cloning the remote Git repository Cloning repository http://example.com/repository.git > $JENKINS_HOME/tools/mingw64/bin/git.exe\MinGit init $WORKSPACE_PATH # timeout=10 ERROR: Error cloning remote repo 'origin' hudson.plugins.git.GitException: Could not init $WORKSPACE_PATH ... Caused by: hudson.plugins.git.GitException: Error performing git command: $JENKINS_HOME/tools/mingw64/bin/git.exe\MinGit init $WORKSPACE_PATH ... Caused by: java.io.IOException: Cannot run program "$JENKINS_HOME/tools/mingw64/bin/git.exe\MinGit" (in directory "$WORKSPACE_PATH"): CreateProcess error=2, 系统找不到指定的文件。 ... Caused by: java.io.IOException: CreateProcess error=2, 系统找不到指定的文件。 ... ERROR: Error cloning remote repo 'origin' Finished: FAILURE*
### Expected Behavior
1. MinGit installs to:
`$JENKINS_HOME/tools/mingw64/bin/git.exe`
2. Repository clones to:
`$WORKSPACE/<job_name>`
### Actual Behavior
Path reversal occurs:
1. Git executable path becomes invalid:
`$JENKINS_HOME/tools/mingw64/bin/git.exe\MinGit`
2. Repository initialization targets workspace path
3. Result: `java.io.IOException: CreateProcess error=2` (文件找不到)