Inter-revision diff: patch 23

Comparing v2 (message) to v1 (message)

--- v2
+++ v1
@@ -1,29 +1,33 @@
 From: Derrick Stolee <dstolee@microsoft.com>
 
-Before iterating over all index entries, ensure that a sparse index is
-expanded to a full index to avoid unexpected behavior. This case could
-be integrated later by ensuring that we walk the tree in the
-sparse-directory entry, but the current behavior is only expecting
-blobs. Save this integration for later when it can be properly tested.
+Before iterating over all cache entries, ensure that a sparse index is
+expanded to a full index to avoid unexpected behavior.
 
 Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
 ---
- revision.c | 2 ++
+ read-cache.c | 2 ++
  1 file changed, 2 insertions(+)
 
-diff --git a/revision.c b/revision.c
-index b78733f5089b..b72e0ac1bdca 100644
---- a/revision.c
-+++ b/revision.c
-@@ -1680,6 +1680,8 @@ static void do_add_index_objects_to_pending(struct rev_info *revs,
- {
- 	int i;
- 
-+	/* TODO: audit for interaction with sparse-index. */
+diff --git a/read-cache.c b/read-cache.c
+index b143277ed106..7449f31381cf 100644
+--- a/read-cache.c
++++ b/read-cache.c
+@@ -1576,6 +1576,7 @@ int refresh_index(struct index_state *istate, unsigned int flags,
+ 	 */
+ 	preload_index(istate, pathspec, 0);
+ 	trace2_region_enter("index", "refresh", NULL);
 +	ensure_full_index(istate);
  	for (i = 0; i < istate->cache_nr; i++) {
- 		struct cache_entry *ce = istate->cache[i];
- 		struct blob *blob;
+ 		struct cache_entry *ce, *new_entry;
+ 		int cache_errno = 0;
+@@ -2493,6 +2494,7 @@ int repo_index_has_changes(struct repository *repo,
+ 		diff_flush(&opt);
+ 		return opt.flags.has_changes != 0;
+ 	} else {
++		ensure_full_index(istate);
+ 		for (i = 0; sb && i < istate->cache_nr; i++) {
+ 			if (i)
+ 				strbuf_addch(sb, ' ');
 -- 
 gitgitgadget
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help