]>
Commit | Line | Data |
---|---|---|
b33e9666 LT |
1 | #!/bin/sh |
2 | # | |
3 | # Set up GIT_DIR and GIT_OBJECT_DIRECTORY | |
4 | # and return true if everything looks ok | |
5 | # | |
6 | : ${GIT_DIR=.git} | |
7 | : ${GIT_OBJECT_DIRECTORY="$GIT_DIR/objects"} | |
8 | ||
9 | die() { | |
10 | echo "$@" >&2 | |
11 | exit 1 | |
12 | } | |
13 | ||
48313592 JH |
14 | check_clean_tree() { |
15 | dirty1_=`git-update-cache -q --refresh` && { | |
16 | dirty2_=`git-diff-cache --name-only --cached HEAD` | |
17 | case "$dirty2_" in '') : ;; *) (exit 1) ;; esac | |
18 | } || { | |
19 | echo >&2 "$dirty1_" | |
20 | echo "$dirty2_" | sed >&2 -e 's/^/modified: /' | |
21 | (exit 1) | |
22 | } | |
23 | } | |
24 | ||
5f5608bc | 25 | [ -h "$GIT_DIR/HEAD" ] && |
e4ad5f09 | 26 | [ -d "$GIT_DIR/refs" ] && |
b33e9666 | 27 | [ -d "$GIT_OBJECT_DIRECTORY/00" ] |