From 504fe714fe642b375992bb913075bee0d0bc1bbd Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 14 Feb 2006 16:05:57 -0800 Subject: [PATCH] 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 --- git-checkout.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/git-checkout.sh b/git-checkout.sh index 6a87c717e..76e7f5522 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 -- 2.30.2