X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;ds=sidebyside;f=git-status.sh;fp=git-status.sh;h=ddab464dc29229bf211de19e5bb59de0debb3636;hb=646d28a9e550d907fd8353527aaaa7d87b365e76;hp=0000000000000000000000000000000000000000;hpb=d620650e20051859359c8bb1ec26c122261af652;p=git-scripts.git diff --git a/git-status.sh b/git-status.sh new file mode 100755 index 0000000..ddab464 --- /dev/null +++ b/git-status.sh @@ -0,0 +1,19 @@ +#! /bin/sh + +STMP="$HOME"/tmp/git-status.tmp +export STMP +trap 'exec rm -rf "$STMP"' 0 HUP INT QUIT TERM +rm -rf "$STMP" && mkdir "$STMP" && + +GIT_INDEX_FILE="$STMP"/index && +export GIT_INDEX_FILE && + +if [ -d .git -a -f .git/index ]; then + cp -p .git/index $GIT_INDEX_FILE +else + echo "$0: `pwd` is not a git directory" >&2 + exit 1 +fi && + +git status "$@" && +exec rm -rf "$STMP"