X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=git-sh-setup-script;h=9ed5e851523a47aa3633494072e6295aa93adb01;hb=78938b0d8a95b09d94af214fdb6b5f053a5edb98;hp=84e15df1bcedba39e9310700d2aa7bf14dde2395;hpb=933693da77857b12ba86d999a601dbdb8ab212ff;p=git.git diff --git a/git-sh-setup-script b/git-sh-setup-script index 84e15df1..9ed5e851 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" ]