fix(gitutil): do not stash ignored files (#262)
Until now `gitutil.stashAndPop` ran the following command for each repo:
git stash save --all --quiet "coho stash"
Beside changed and untracked files, this also stashes ignored files. In
our case that includes the `node_modules` folder. Due to the massive
amount of files in there, that command takes a decent amount of time and
can also lead to _a lot_ of CRLF warning messages, depending on your
local git configuration.
Furthermore, the new build system of `cordova-js` needs to have its
dependencies present to be able to run. But since the `cordova-js` build
is run in a `stashAndPop` block, all modules have been stashed and thus
the build always fails.
AFAICT, no invocation of `gitutil.stashAndPop` does actually _need_ to
stash ignored files. Thus we can resolve these issues by replacing the
`--all` flag with `--include-untracked`, giving us this command:
git stash save --include-untracked --quiet "coho stash"
This safely stashes all content that could potentially be destroyed by
`coho` operations, while leaving ignored files in place.
diff --git a/src/gitutil.js b/src/gitutil.js
index fe7c558..a100432 100644
--- a/src/gitutil.js
+++ b/src/gitutil.js
@@ -119,7 +119,7 @@
var branchName = yield gitutil.retrieveCurrentBranchName();
if (requiresStash) {
- yield executil.execHelper(executil.ARGS('git stash save --all --quiet', 'coho stash'));
+ yield executil.execHelper(executil.ARGS('git stash save --include-untracked --quiet', 'coho stash'));
}
yield func();