From d37d320386369375b4e5b95b98517503125376f9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Fri, 9 Nov 2007 11:40:27 -0500 Subject: [PATCH] builtin-commit: Refresh cache after adding files. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We have promised our users that after running git-status or git-commit the index will be refreshed for a long time since these commands were introduced. Do refresh the index before writing it out to keep the promise. Signed-off-by: Kristian Høgsberg Signed-off-by: Junio C Hamano --- builtin-commit.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/builtin-commit.c b/builtin-commit.c index c8f79a88fb..a84a729da1 100644 --- a/builtin-commit.c +++ b/builtin-commit.c @@ -81,6 +81,7 @@ static char *prepare_index(const char **files, const char *prefix) if (all || also) { add_files_to_cache(verbose, also ? prefix : NULL, files); + refresh_cache(REFRESH_QUIET); if (write_cache(fd, active_cache, active_nr) || close(fd)) die("unable to write new_index file"); return lock_file.filename; @@ -110,6 +111,7 @@ static char *prepare_index(const char **files, const char *prefix) fd = hold_lock_file_for_update(next_index_lock, git_path("next-index-%d", getpid()), 1); 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"); -- 2.11.4.GIT