Submodules not reset
Summary
The runner does not reset changes in a submodule or clean it.
Steps to reproduce
- Create two projects
- Include the second as a submodule of the first
- Write a CI job for the first that involves changes to the second and creates files in the submodule directory
- Commit and push - gitlab runs CI job, files are modified and generated
- Update the submodule to a different commit
- Commit and push
Actual behavior
- The runner cleans out the first project
- The runner checks out the new commit of the first project (forced, overwrites changes)
- The runner attempts to checkout the new commit of the submodule
- The runner fails with "error: Your local changes to the following files would be overwritten by checkout:"
Expected behavior
- The runner cleans out the first project
- The runner checks out the new commit of the first project (forced, overwrites changes)
- The runner cleans the submodule directory/second project
- The runner checks out the new commit of the submodule/second project (forced, overwrites changes)
Relevant logs and/or screenshots
Running with gitlab-runner 10.1.0 (c1ecf97f)
on Windows Powershell Runner [BUILDSERVER] (ead08551)
Using Shell executor...
Running on BUILDSERVER...
Fetching changes...
Removing <FILES>
HEAD is now at fcfa964 Fix test
From http://mss-git01.MillenniumSpaceSystems.local/group/project
fcfa964..931d7e9 develop -> origin/develop
Checking out 931d7e98 as develop...
Updating/initializing submodules...
Synchronizing submodule url for '.libs/MyLib'
From http://mss-git01.MillenniumSpaceSystems.local/group/my-lib
b754737..95c8bd5 develop -> origin/develop
error: Your local changes to the following files would be overwritten by checkout:
<FILES>
Please commit your changes or stash them before you switch branches.
Aborting
Unable to checkout '4d835186b403ef89a67c7bebface51526d436aed' in submodule path '.libs/MyLib'
ERROR: Job failed: exit status 1
Environment description
Custom installation (gitlab-ce 10.1
), gitlab-runner 10.1.0
on a Windows Server 2016 VM, Git for Windows 2.13.2.windows.1
.
The runner is a shell runner using PowerShell. NOT containerized.
Used GitLab Runner version
Version: 10.1.0
Git revision: c1ecf97f
Git branch: 10-1-stable
GO version: go1.8.3
Built: Sat, 21 Oct 2017 21:33:18 +0000
OS/Arch: windows/amd64