2018-09-20 19:13:23 +00:00
|
|
|
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
|
2018-09-20 19:13:23 +00:00
|
|
|
end
|
2018-11-28 16:08:06 +00:00
|
|
|
|