jenkinsci / jenkinsci/git-client-plugin
[JENKINS-55875] Submodule update fails when the submodule isn't clean
- Dominant language
- Java
- Stars
- 152
- Forks
- 402
- Avg merge
- 6h 47m
- Merged PRs (30d)
- 4
Description
Jenkins doesn't forcibly update submodules. This means that a checkout can fail with:
hudson.plugins.git.GitException: Command "git submodule update --init --recursive modules/gmock" returned status code 1:
stdout:
stderr: error: Your local changes to the following files would be overwritten by checkout:
build-aux/config.guess
build-aux/config.sub
gtest/build-aux/config.guess
gtest/build-aux/config.sub
Please, commit your changes or stash them before you can switch branches.
Aborting
Unable to checkout 'ec44c6c1675c25b9827aacd08c02433cccde7780' in submodule path 'modules/gmock'
Note, while JENKINS-22510">JENKINS-22510 is relevant, and cleaning the checkout before checking out would resolve the problem, that's not a viable solution. Cleaning the checkout throws away all built files, which means the build is no longer incremental.
Note, this means the behaviour for submodules doesn't match it's behaviour for the standard checkout (which is checked out with --force).
---
Originally reported by richardwhiuk, imported from: Submodule update fails when the submodule isn't clean
Raw content of original issue
Jenkins doesn't forcibly update submodules. This means that a checkout can fail with:
hudson.plugins.git.GitException: Command "git submodule update --init --recursive modules/gmock" returned status code 1:
stdout:
stderr: error: Your local changes to the following files would be overwritten by checkout:
build-aux/config.guess
build-aux/config.sub
gtest/build-aux/config.guess
gtest/build-aux/config.sub
Please, commit your changes or stash them before you can switch branches.
Aborting
Unable to checkout 'ec44c6c1675c25b9827aacd08c02433cccde7780' in submodule path 'modules/gmock'Note, while
JENKINS-22510is relevant, and cleaning the checkout before checking out would resolve the problem, that's not a viable solution. Cleaning the checkout throws away all built files, which means the build is no longer incremental.Note, this means the behaviour for submodules doesn't match it's behaviour for the standard checkout (which is checked out with --force).
Contributor guide
Assessment
This issue has not been assessed yet.