From: Junio C Hamano Date: Wed, 15 Feb 2006 00:05:57 +0000 (-0800) Subject: checkout: fix dirty-file display. X-Git-Tag: v1.2.1~2 X-Git-Url: https://git.octo.it/?p=git.git;a=commitdiff_plain;h=504fe714fe642b375992bb913075bee0d0bc1bbd 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 --- diff --git a/git-checkout.sh b/git-checkout.sh index 6a87c717..76e7f552 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