diff options
Diffstat (limited to 'git-sh-setup-script')
| -rwxr-xr-x | git-sh-setup-script | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/git-sh-setup-script b/git-sh-setup-script index 84e15df1bc..9ed5e85152 100755 --- a/git-sh-setup-script +++ b/git-sh-setup-script @@ -11,6 +11,17 @@ die() { exit 1 } +check_clean_tree() { + dirty1_=`git-update-cache -q --refresh` && { + dirty2_=`git-diff-cache --name-only --cached HEAD` + case "$dirty2_" in '') : ;; *) (exit 1) ;; esac + } || { + echo >&2 "$dirty1_" + echo "$dirty2_" | sed >&2 -e 's/^/modified: /' + (exit 1) + } +} + [ -h "$GIT_DIR/HEAD" ] && [ -d "$GIT_DIR/refs" ] && [ -d "$GIT_OBJECT_DIRECTORY/00" ] |
