Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
read-cache: let refresh_cache_ent pass up changed flags
author
Jeff King
<peff@peff.net>
Fri, 18 Nov 2011 11:11:08 +0000
(06:11 -0500)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 18 Nov 2011 19:53:46 +0000
(11:53 -0800)
This will enable refresh_cache to differentiate more cases
of modification (such as typechange) when telling the user
what isn't fresh.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
read-cache.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
bc1bbe0
)
diff --git
a/read-cache.c
b/read-cache.c
index 5790a91044e4fdf5b2eec515051a66c110e0daa4..8e69ea3ee5b460132d5626d3dfcc77a560851483 100644
(file)
--- a/
read-cache.c
+++ b/
read-cache.c
@@
-1001,7
+1001,8
@@
int add_index_entry(struct index_state *istate, struct cache_entry *ce, int opti
*/
static struct cache_entry *refresh_cache_ent(struct index_state *istate,
struct cache_entry *ce,
*/
static struct cache_entry *refresh_cache_ent(struct index_state *istate,
struct cache_entry *ce,
- unsigned int options, int *err)
+ unsigned int options, int *err,
+ int *changed_ret)
{
struct stat st;
struct cache_entry *updated;
{
struct stat st;
struct cache_entry *updated;
@@
-1033,6
+1034,8
@@
static struct cache_entry *refresh_cache_ent(struct index_state *istate,
}
changed = ie_match_stat(istate, ce, &st, options);
}
changed = ie_match_stat(istate, ce, &st, options);
+ if (changed_ret)
+ *changed_ret = changed;
if (!changed) {
/*
* The path is unchanged. If we were told to ignore
if (!changed) {
/*
* The path is unchanged. If we were told to ignore
@@
-1130,7
+1133,7
@@
int refresh_index(struct index_state *istate, unsigned int flags, const char **p
if (pathspec && !match_pathspec(pathspec, ce->name, strlen(ce->name), 0, seen))
continue;
if (pathspec && !match_pathspec(pathspec, ce->name, strlen(ce->name), 0, seen))
continue;
- new = refresh_cache_ent(istate, ce, options, &cache_errno);
+ new = refresh_cache_ent(istate, ce, options, &cache_errno
, NULL
);
if (new == ce)
continue;
if (!new) {
if (new == ce)
continue;
if (!new) {
@@
-1157,7
+1160,7
@@
int refresh_index(struct index_state *istate, unsigned int flags, const char **p
static struct cache_entry *refresh_cache_entry(struct cache_entry *ce, int really)
{
static struct cache_entry *refresh_cache_entry(struct cache_entry *ce, int really)
{
- return refresh_cache_ent(&the_index, ce, really, NULL);
+ return refresh_cache_ent(&the_index, ce, really, NULL
, NULL
);
}
static int verify_hdr(struct cache_header *hdr, unsigned long size)
}
static int verify_hdr(struct cache_header *hdr, unsigned long size)