Skip to content

Fixes #197 GitLab CI does not clean git repositories within git repositories

If GitLab CI is configured to utilize git fetch instead of git clone it will not clean out any subdirectory containing a .git directory.

From git help clean http://git-scm.com/docs/git-clean#_options :

-f [...] Git will refuse to delete directories with .git sub directory or file unless a second -f is given. [...]

How git clean is utilized right now (in shells/{cmd,bash,powershell}.go) is:

git clean -fdx

I suggest to change it to:

git clean -ffdx

to make subdirectories containing git repositories being cleaned out by default.

Merge request reports