dotfiles/fish/.config/fish/functions/is_git_dirty.fish

15 lines
321 B
Fish
Raw Normal View History

function is_git_dirty
2018-11-28 16:08:06 +00:00
# based on https://github.com/git/git/blob/master/git-sh-setup.sh#L210
is_git; or return 1
if git diff-files --quiet --ignore-submodules
2018-11-28 16:32:25 +00:00
and git diff-index --cached --quiet --ignore-submodules HEAD --
2018-11-28 16:08:06 +00:00
return 1
else
2018-11-28 16:32:25 +00:00
# we're dirty
2018-11-28 16:08:06 +00:00
return 0
end
end
2018-11-28 16:08:06 +00:00