Skip to content

Commit

Permalink
Close sindresorhusGH-80: Include untracked files in dirtiness check. F…
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Shishkin authored and sindresorhus committed Aug 9, 2014
1 parent 18c3d66 commit 1d97762
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pure.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ prompt_pure_git_dirty() {
# check if we're in a git repo
command git rev-parse --is-inside-work-tree &>/dev/null || return
# check if it's dirty
command git diff --quiet --ignore-submodules HEAD &>/dev/null
[[ "$PURE_GIT_UNTRACKED_DIRTY" == 0 ]] && local umode="-uno" || local umode="-unormal"
command test -n "$(git status --porcelain --ignore-submodules ${umode})"

(($? == 1)) && echo '*'
(($? == 0)) && echo '*'
}

# displays the exec time of the last command if set threshold was exceeded
Expand Down
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ The max execution time of a process before its run time is shown when it exits.

Set `PURE_GIT_PULL=0` to prevent Pure from checking whether the current Git remote has been updated.

### `PURE_GIT_UNTRACKED_DIRTY`

Set `PURE_GIT_UNTRACKED_DIRTY=0` to not include untracked files in dirtiness check.

## Example

```sh
Expand Down

0 comments on commit 1d97762

Please sign in to comment.