* [PATCH] Call refresh_cache() when updating the user index for --only commits.
@ 2007-11-12 20:48 Kristian Høgsberg
2007-11-12 23:01 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: Kristian Høgsberg @ 2007-11-12 20:48 UTC (permalink / raw)
To: gitster; +Cc: git, Kristian Høgsberg
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Call refresh_cache() when updating the user index for --only commits.
2007-11-12 20:48 [PATCH] Call refresh_cache() when updating the user index for --only commits Kristian Høgsberg
@ 2007-11-12 23:01 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2007-11-12 23:01 UTC (permalink / raw)
To: Kristian Høgsberg; +Cc: gitster, git
Kristian Høgsberg <krh@redhat.com> writes:
> 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");
>
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-11-12 23:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-12 20:48 [PATCH] Call refresh_cache() when updating the user index for --only commits Kristian Høgsberg
2007-11-12 23:01 ` 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).