X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=git-status-script;h=ee8f7061ea3d327bb4a565f9aaa9cdc04c0fb772;hb=78938b0d8a95b09d94af214fdb6b5f053a5edb98;hp=1696f23e04a1b96234c60ae07306fdd94d0da314;hpb=933693da77857b12ba86d999a601dbdb8ab212ff;p=git.git diff --git a/git-status-script b/git-status-script index 1696f23e..ee8f7061 100755 --- a/git-status-script +++ b/git-status-script @@ -39,11 +39,23 @@ esac git-update-cache --refresh >/dev/null 2>&1 -git-diff-cache -M --cached HEAD | -sed 's/^://' | -report "Updated but not checked in" "will commit" +if test -f "$GIT_DIR/HEAD" +then + git-diff-cache -M --cached HEAD | + sed 's/^://' | + report "Updated but not checked in" "will commit" + + committable="$?" +else + echo '# +# Initial commit +#' + git-ls-files | + sed 's/^/o o o o A /' | + report "Updated but not checked in" "will commit" -committable="$?" + committable="$?" +fi git-diff-files | sed 's/^://' | @@ -65,9 +77,9 @@ then #' fi -if [ "$committable" == "0" ] -then +case "$committable" in +0) echo "nothing to commit" exit 1 -fi +esac exit 0