[PATCH] Call refresh_cache() when updating the user index for --only commits.

Previous thread: wishlist: git info by Thomas Neumann on Monday, November 12, 2007 - 4:30 pm. (4 messages)

Next thread: [PATCH] Fix a strchrnul() related build error by Emil Medve on Monday, November 12, 2007 - 5:01 pm. (3 messages)
To: <gitster@...>
Cc: Kristian Høgsberg <krh@...>, <git@...>
Date: Monday, November 12, 2007 - 4:48 pm

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>
---
builtin-commit.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/builtin-commit.c b/builtin-commit.c
index 5011b8b..35205ef 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -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");

--
1.5.3.5.1762.g9a09d-dirty

-

To: Kristian <krh@...>
Cc: <gitster@...>, <git@...>
Date: Monday, November 12, 2007 - 7:01 pm

Ah. This is the real index file that is left for the user after
a partial commit "git-commit <path>" returns.

The other refresh_cache() after this one does not matter if we
did not have hook scripts, but it is not very easy to cheaply
detect if we are not going to run any hooks so let's leave it
there.

Thanks.

-

Previous thread: wishlist: git info by Thomas Neumann on Monday, November 12, 2007 - 4:30 pm. (4 messages)

Next thread: [PATCH] Fix a strchrnul() related build error by Emil Medve on Monday, November 12, 2007 - 5:01 pm. (3 messages)