Skip to content

Commit

Permalink
git-commit: show dirtiness including index.
Browse files Browse the repository at this point in the history
Earlier, when we switched a branch we used diff-files to show
paths that are dirty in the working tree.  But we allow switching
branches with updated index ("read-tree -m -u $old $new" works that
way), and only showing paths that have differences in the working
tree but not paths that are different in index was confusing.

This shows both as modified from the top commit of the branch we
just have switched to.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Feb 12, 2006
1 parent 024701f commit c5e09c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion git-checkout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ else
exit 0
)
saved_err=$?
git diff-files --name-status
test "$new" = "$old" ||
git diff-index --name-status "$new"
(exit $saved_err)
fi

Expand Down

0 comments on commit c5e09c1

Please sign in to comment.