aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xgit-test13
1 files changed, 8 insertions, 5 deletions
diff --git a/git-test b/git-test
index ea01461..4aa1baa 100755
--- a/git-test
+++ b/git-test
@@ -41,7 +41,9 @@ OPTIONS
configuration 'git-test.test' is used.
-c, --clean
- Run "git clean -xdf" just before checking out the first tree.
+ Ensure the working tree is clean before running the test commands
+ specified by --test options. To be precise, this executes
+ "git clean -xdff".
-n, --dry-run
Do everything except actually check out the tree and run the test
@@ -155,10 +157,7 @@ puts color(:green, "Preparing a working tree at #{opts[:checkout]}...")
unless opts[:dry_run]
if File.directory?(opts[:checkout])
sh("git", "-C", opts[:checkout], "reset", "--hard")
- if opts[:clean]
- puts color(:green, "Cleaning the working tree...")
- sh("git", "-C", opts[:checkout], "clean", "-xdf")
- end
+ sh("git", "-C", opts[:checkout], "clean", "-xdff")
else
sh("git", "worktree", "add", "--detach", opts[:checkout])
end
@@ -178,6 +177,10 @@ commits.each_with_index do |sha1, i|
puts color(:green, "Checking out #{sha1} at #{opts[:checkout]}...")
unless opts[:dry_run]
sh("git", "-C", opts[:checkout], "checkout", "--detach", "--force", sha1)
+ if opts[:clean]
+ puts color(:green, "Cleaning the working tree...")
+ sh("git", "-C", opts[:checkout], "clean", "-xdff")
+ end
end
ok = true