Skip to content
This repository was archived by the owner on Feb 12, 2025. It is now read-only.

Commit cf7474e

Browse files
askrinnikRubenWillems
authored andcommitted
Git Source control section has been extended with a new configuration parameter cleanUntrackedFiles. The purpose of this parameter is to avoid invocation of the command "git clean -d -f -x" during continue integration builds. You may want to use this trick for incremental builds when you don't want to delete compiled files after each sequential project. Default value is true. It corresponds to default behavior
1 parent e590eb4 commit cf7474e

File tree

1 file changed

+11
-1
lines changed
  • project/core/sourcecontrol

1 file changed

+11
-1
lines changed

project/core/sourcecontrol/Git.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,14 @@ public class Git : ProcessSourceControl
138138
[ReflectorProperty("autoGetSource", Required = false)]
139139
public bool AutoGetSource { get; set; }
140140

141+
/// <summary>
142+
/// Remove untracked files from the working tree
143+
/// </summary>
144+
/// <version>1.5</version>
145+
/// <default>true</default>
146+
[ReflectorProperty("cleanUntrackedFiles", Required = false)]
147+
public bool CleanUntrackedFiles { get; set; }
148+
141149
/// <summary>
142150
/// The location of the Git executable.
143151
/// </summary>
@@ -267,6 +275,7 @@ public Git(IHistoryParser historyParser, ProcessExecutor executor, IFileSystem f
267275
_fileSystem = fileSystem;
268276
_fileDirectoryDeleter = fileDirectoryDeleter;
269277
this.AutoGetSource = true;
278+
this.CleanUntrackedFiles = true;
270279
this.Executable = "git";
271280
this.Branch = "master";
272281
this.TagCommitMessage = "CCNet Build {0}";
@@ -327,7 +336,8 @@ public override void GetSource(IIntegrationResult result)
327336
GitUpdateSubmodules(result);
328337

329338
// clean up the local working copy
330-
GitClean(result);
339+
if (CleanUntrackedFiles)
340+
GitClean(result);
331341
}
332342

333343
/// <summary>

0 commit comments

Comments
 (0)