From: Junio C Hamano Date: Sat, 14 Jan 2006 20:31:18 +0000 (-0800) Subject: [PATCH] checkout: show dirty state upon switching branches. X-Git-Tag: v1.2.0~143^2 X-Git-Url: https://git.octo.it/?p=git.git;a=commitdiff_plain;h=980d8ce551784b76e05077946b8a4f2ac6c5305d [PATCH] checkout: show dirty state upon switching branches. This shows your working file state when you switch branches. As a side effect, "git checkout" without any branch name (i.e. stay on the current branch) becomes a more concise shorthand for the "git status" command. Signed-off-by: Junio C Hamano --- diff --git a/git-checkout.sh b/git-checkout.sh index bd7f0073..d99688fb 100755 --- a/git-checkout.sh +++ b/git-checkout.sh @@ -164,6 +164,9 @@ else esac exit 0 ) + saved_err=$? + git diff-files --name-status + (exit $saved_err) fi #