microsoft / vso-agent

Visual Studio Team Services and TFS agent for Mac OSX and Linux
MIT License
131 stars 57 forks source link

Build sources directory is not cleaned if it contains other Git repositories #324

Closed michael-baker closed 7 years ago

michael-baker commented 7 years ago

In my setup I have a TFS 2017 build definition pointing at a Git repository.

image

During the build execution other Git repositories are fetched and dropped into the Build.SourcesDirectory via custom scripts.

The next time I queue a build it will fail as the source directory is not cleaned as "git clean -fdx" is not enough. As my sources directory contains other .git folders the clean command needs to be "git clean -ffdx" to really really force the clean to occur.

Example:

C:\agent\_work\4\s>git clean -fdx
Skipping repository Foo/
Skipping repository Bar/
Skipping repository Baz/
Skipping repository _BUILD_215248575/
C:\agent\_work\4\s>git clean -ffdx
Removing Foo/
Removing Bar/
Removing Baz/
Removing _BUILD_215248575/
bryanmacfarlane commented 7 years ago

Deprecated. Replacement is here: https://github.com/Microsoft/vsts-agent