@matheusbsbs / matheus-bagliano / commits / c5e09c1fbe
Fork 0

git-commit: show dirtiness including index.

Earlier, when we switched a branch we used diff-files to show paths that are dirty in the working tree. But we allow switching branches with updated index ("read-tree -m -u $old $new" works that way), and only showing paths that have differences in the working tree but not paths that are different in index was confusing. This shows both as modified from the top commit of the branch we just have switched to. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Feb 12, 2006 at 13:05 UTC c5e09c1fbec5dc1c15bcfe21e1a600f9e4b4e419
1 file changed +2 -1
git-checkout.sh
+2 -1
@@ -165,7 +165,8 @@ else
165 exit 0
166 )
167 saved_err=$?
168 - git diff-files --name-status
168 + test "$new" = "$old" ||
169 + git diff-index --name-status "$new"
170 (exit $saved_err)
171 fi
172