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>
Junio C Hamano committed
Feb 14, 2006 at 16:05 UTC
504fe714fe642b375992bb913075bee0d0bc1bbd
1 file changed
+4
-2
git-checkout.sh
+4
-2
@@ -165,8 +165,10 @@ else
165
exit 0
166
)
167
saved_err=$?
168
- test "$new" = "$old" ||
169
- git diff-index --name-status "$new"
168
+ if test "$saved_err" = 0
169
+ then
170
+ test "$new" = "$old" || git diff-index --name-status "$new"
171
+ fi
172
(exit $saved_err)
173
fi
174