Skip to content

Commit

Permalink
Call refresh_cache() when updating the user index for --only commits.
Browse files Browse the repository at this point in the history
We're guaranteeing the user that the index will be stat-clean after
git commit. Thus, we need to call refresh_cache() for the user index too,
in the 'git commit <paths>' case.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Kristian Høgsberg authored and Junio C Hamano committed Nov 23, 2007
1 parent 129fa60 commit ef12b50
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions builtin-commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ static char *prepare_index(const char **files, const char *prefix)

/* update the user index file */
add_files_to_cache(verbose, prefix, files);
refresh_cache(REFRESH_QUIET);
if (write_cache(fd, active_cache, active_nr) || close(fd))
die("unable to write new_index file");

Expand Down

0 comments on commit ef12b50

Please sign in to comment.