summaryrefslogtreecommitdiff
path: root/git-checkout.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-02-12 21:05:53 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-02-12 21:05:53 (GMT)
commitc5e09c1fbec5dc1c15bcfe21e1a600f9e4b4e419 (patch)
tree20bcd5435d57b54b4c18567a17ac53191b4f77cf /git-checkout.sh
parent024701f1d88d79f3777bf45c82437f40a80b6eaa (diff)
downloadgit-c5e09c1fbec5dc1c15bcfe21e1a600f9e4b4e419.zip
git-c5e09c1fbec5dc1c15bcfe21e1a600f9e4b4e419.tar.gz
git-c5e09c1fbec5dc1c15bcfe21e1a600f9e4b4e419.tar.bz2
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>
Diffstat (limited to 'git-checkout.sh')
-rwxr-xr-xgit-checkout.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/git-checkout.sh b/git-checkout.sh
index d99688f..6a87c71 100755
--- a/git-checkout.sh
+++ b/git-checkout.sh
@@ -165,7 +165,8 @@ else
exit 0
)
saved_err=$?
- git diff-files --name-status
+ test "$new" = "$old" ||
+ git diff-index --name-status "$new"
(exit $saved_err)
fi