diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2016-03-14 10:52:40 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2016-03-14 10:52:40 -0700 |
commit | 0b2d2c68dec7ffc7c90a5635dd87a6ca611fe2a8 (patch) | |
tree | 5a66ea4b16309a35faf624a5d650db655748fac6 | |
parent | 800d272848b95889ffdcc401094dcbf661f6352c (diff) | |
download | dotfiles-0b2d2c68dec7ffc7c90a5635dd87a6ca611fe2a8.tar.gz |
fix git_isclean, I hope
-rw-r--r-- | home-mrconfig | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/home-mrconfig b/home-mrconfig index 33e15e84..5ddbc9cf 100644 --- a/home-mrconfig +++ b/home-mrconfig @@ -20,10 +20,14 @@ git_update = git remote update; git pull --ff-only "$@" # `mr -ms status` is a great way to check for unpushed branches and # unchecked in files, but what about checking only for the latter? git_isclean = - (git diff-index --quiet --cached HEAD \ # check HEAD versus index - && git diff-files --quiet \ # index versus working tree - && [ -z "$(git status --porcelain)" ]) \ # untracked files - || (git status --porcelain && exit 1) + ( + # 1st line: check HEAD versus index + # 2nd line: index versus working tree + # 3rd line: untracked files + git diff-index --quiet --cached HEAD && \ + git diff-files --quiet && \ + test -z "$(git status --porcelain)" + ) || (git status --porcelain && exit 1) # --- Adam Spiers' plugin for managing dotfile symlinks with mr |