[PATCH] git: fix trivial warning from show_rename_copy()
[git/jrn.git] / git-status-script
blob7d47fdea79aafaab1d6357d8ce478e2fb40b45b0
1 #!/bin/sh
2 report () {
3 header="#
4 # $1:
5 # ($2)
8 trailer=""
9 while read oldmode mode oldsha sha status name newname
11 echo -n "$header"
12 header=""
13 trailer="#
15 case "$status" in
16 M ) echo "# modified: $name";;
17 D*) echo "# deleted: $name";;
18 T ) echo "# typechange: $name";;
19 C*) echo "# copied: $name -> $newname";;
20 R*) echo "# renamed: $name -> $newname";;
21 N*) echo "# new file: $name";;
22 U ) echo "# unmerged: $name";;
23 esac
24 done
25 echo -n "$trailer"
26 [ "$header" ]
29 git-update-cache --refresh >& /dev/null
30 git-diff-cache -M --cached HEAD | sed 's/^://' | report "Updated but not checked in" "will commit"
31 committable="$?"
32 git-diff-files | sed 's/^://' | report "Changed but not updated" "use git-update-cache to mark for commit"
33 if [ "$committable" == "0" ]
34 then
35 echo "nothing to commit"
36 exit 1
38 exit 0