Code

do not write out index when status does not have to
authorJunio C Hamano <gitster@pobox.com>
Wed, 7 Jul 2010 04:53:11 +0000 (21:53 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 7 Jul 2010 04:53:11 +0000 (21:53 -0700)
commitd5f5d0a9443c3892cdf9665ed8e0f9004706ed65
treed8ee6f246324d911ad44ad98a6d4cf6e6d47a88e
parentb4cf0f1784362fb4aa2383d8d5d829caa92ca3a0
do not write out index when status does not have to

Some codepaths, such as "git status" and "git commit --dry-run",
tried to opportunisticly refresh the index and write the result
out.  But they did so without checking if there was actually any
change that needs to be written out.

Noticed by Jeff King and Daniel at Rutgers.edu

Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/commit.c