git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] builtin-commit: Refresh cache after adding files.
@ 2007-11-09 16:40 Kristian Høgsberg
  2007-11-09 17:05 ` Johannes Schindelin
  0 siblings, 1 reply; 14+ messages in thread
From: Kristian Høgsberg @ 2007-11-09 16:40 UTC (permalink / raw)
  To: gitster; +Cc: git, Johannes Schindelin, Kristian Høgsberg

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

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2007-11-10  9:02 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-09 16:40 [PATCH] builtin-commit: Refresh cache after adding files Kristian Høgsberg
2007-11-09 17:05 ` Johannes Schindelin
2007-11-09 17:13   ` Kristian Høgsberg
2007-11-09 17:24     ` Johannes Schindelin
2007-11-09 17:38       ` Kristian Høgsberg
2007-11-09 18:24   ` Junio C Hamano
2007-11-09 18:39     ` Kristian Høgsberg
2007-11-10  1:40     ` *[PATCH] " Junio C Hamano
2007-11-10  2:02       ` Johannes Schindelin
2007-11-10  2:26         ` Junio C Hamano
2007-11-10  2:22     ` [PATCH] git-add: make the entry stat-clean after re-adding the same contents Junio C Hamano
2007-11-10  2:43       ` Linus Torvalds
2007-11-10  9:01         ` [PATCH 1/2] ce_match_stat, run_diff_files: use symbolic constants for readability Junio C Hamano
2007-11-10  9:02         ` [PATCH 2/2] git-add: make the entry stat-clean after re-adding the same contents Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).