X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=git-status.sh;h=fbdd377539eea2c4521a2df2d37ff06b80567664;hb=750a09a7de63c92868cff41a3151eac320c77fa0;hp=ca9a15459fc55c8a03aabf2bed85bc34817df450;hpb=8098a178b26dc7a158d129a092a5b78da6d12b72;p=git.git diff --git a/git-status.sh b/git-status.sh index ca9a1545..fbdd3775 100755 --- a/git-status.sh +++ b/git-status.sh @@ -37,12 +37,20 @@ refs/heads/master) ;; *) echo "# On branch $branch" ;; esac -git-update-index --refresh >/dev/null 2>&1 +git-update-index -q --unmerged --refresh || exit if GIT_DIR="$GIT_DIR" git-rev-parse --verify HEAD >/dev/null 2>&1 then git-diff-index -M --cached HEAD | - sed 's/^://' | + sed -e ' + s/^:// + h + s/^[^ ]*// + s/ /\\ /g + x + s/ .*$// + G + s/\n/ /' | report "Updated but not checked in" "will commit" committable="$?" @@ -51,14 +59,24 @@ else # Initial commit #' git-ls-files | - sed 's/^/o o o o A /' | + sed -e ' + s/ /\\ /g + s/^/o o o o A /' | report "Updated but not checked in" "will commit" committable="$?" fi git-diff-files | -sed 's/^://' | +sed -e ' + s/^:// + h + s/^[^ ]*// + s/ /\\ /g + x + s/ .*$// + G + s/\n/ /' | report "Changed but not updated" "use git-update-index to mark for commit" if grep -v '^#' "$GIT_DIR/info/exclude" >/dev/null 2>&1