summaryrefslogtreecommitdiff
path: root/git-checkout.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-02-14 16:05:57 -0800
committerJunio C Hamano <junkio@cox.net>2006-02-14 16:05:57 -0800
commit504fe714fe642b375992bb913075bee0d0bc1bbd (patch)
tree5517c7e050cfc002c1e1fd37d3abc6f4b9024f57 /git-checkout.sh
parent9ece7169a434d69a942b71dc49f507da37bbdbc3 (diff)
downloadgit-504fe714fe642b375992bb913075bee0d0bc1bbd.tar.gz
checkout: fix dirty-file display.
When we refused to switch branches, we incorrectly showed differences from the branch we would have switched to. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-checkout.sh')
-rwxr-xr-xgit-checkout.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/git-checkout.sh b/git-checkout.sh
index 6a87c717e9..76e7f55226 100755
--- a/git-checkout.sh
+++ b/git-checkout.sh
@@ -165,8 +165,10 @@ else
exit 0
)
saved_err=$?
- test "$new" = "$old" ||
- git diff-index --name-status "$new"
+ if test "$saved_err" = 0
+ then
+ test "$new" = "$old" || git diff-index --name-status "$new"
+ fi
(exit $saved_err)
fi