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

14 lines
316 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
2019-03-18 04:19:48 +00:00
is_git; or return 1
2018-11-28 16:08:06 +00:00
2019-03-18 04:19:48 +00:00
if git diff-files --quiet --ignore-submodules; 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