[PATCH] builtin-commit: Refresh cache after adding files.
- From
Kristian Høgsberg <krh@redhat.com>
- Date
- Nov 9, 2007, 16:40 UTC
- Message-ID
- <1194626427-2419-1-git-send-email-krh@redhat.com>
This fixes the race in the last test int t3700.
Signed-off-by: Kristian Høgsberg <krh@redhat.com> ---
I'm basically just copying what git-commit.sh does, but I'll admit to not quite understanding why it's necessary. It does fix the race in t3700 though. Applies on top of pu.
cheers, Kristian
builtin-commit.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/builtin-commit.c b/builtin-commit.c index 7dc8977..19862df 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");
-- 1.5.3.4.206.g58ba4