git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 06/14] update-index: use istate->cache_changed

From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
Date
Jan 8, 2021, 20:02 UTC
Message-ID
<f450f43cd0dc837622ada37d45b35f465ef902c8.1610136177.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.830.v3.git.1610136177.gitgitgadget@gmail.com>
From: Derrick Stolee <dstolee@microsoft.com>
This is a mechanical replacement of active_cache_changed.
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
---
 builtin/update-index.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/builtin/update-index.c b/builtin/update-index.c
index 2b03b29261b..70ca47e712c 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -241,7 +241,7 @@ static int mark_ce_flags(const char *path, int flag, int mark)
 			istate->cache[pos]->ce_flags &= ~flag;
 		istate->cache[pos]->ce_flags |= CE_UPDATE_IN_BASE;
 		cache_tree_invalidate_path(istate, path);
-		active_cache_changed |= CE_ENTRY_CHANGED;
+		istate->cache_changed |= CE_ENTRY_CHANGED;
 		return 0;
 	}
 	return -1;
@@ -915,7 +915,7 @@ static enum parse_opt_result unresolve_callback(
 	*has_errors = do_unresolve(ctx->argc, ctx->argv,
 				prefix, prefix ? strlen(prefix) : 0);
 	if (*has_errors)
-		active_cache_changed = 0;
+		repo->index->cache_changed = 0;
 
 	ctx->argv += ctx->argc - 1;
 	ctx->argc = 1;
@@ -936,7 +936,7 @@ static enum parse_opt_result reupdate_callback(
 	setup_work_tree();
 	*has_errors = do_reupdate(ctx->argc, ctx->argv, prefix);
 	if (*has_errors)
-		active_cache_changed = 0;
+		repo->index->cache_changed = 0;
 
 	ctx->argv += ctx->argc - 1;
 	ctx->argc = 1;
@@ -1135,7 +1135,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
 			    INDEX_FORMAT_LB, INDEX_FORMAT_UB);
 
 		if (repo->index->version != preferred_index_format)
-			active_cache_changed |= SOMETHING_CHANGED;
+			repo->index->cache_changed |= SOMETHING_CHANGED;
 		repo->index->version = preferred_index_format;
 	}
 
@@ -1223,7 +1223,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
 		report(_("fsmonitor disabled"));
 	}
 
-	if (active_cache_changed || force_write) {
+	if (repo->index->cache_changed || force_write) {
 		if (newfd < 0) {
 			if (refresh_args.flags & REFRESH_QUIET)
 				exit(128);
-- 
gitgitgadget
Previous: Derrick Stolee via GitGitGadgetNext: Derrick Stolee via GitGitGadget
Message 54 of 65 in “Remove more index compatibility macros”
  1. 00/12 Remove more index compatibility macrosDerrick Stolee via GitGitGadget, Jan 1, 2021
  2. 01/12 merge-index: drop index compatibility macrosDerrick Stolee via GitGitGadget, Jan 1, 2021
  3. Alban GruinJan 3, 2021
  4. Derrick StoleeJan 4, 2021
  5. 02/12 mv: remove index compatibility macrosDerrick Stolee via GitGitGadget, Jan 1, 2021
  6. 03/12 rm: remove compatilibity macrosDerrick Stolee via GitGitGadget, Jan 1, 2021
  7. 04/12 update-index: drop the_index, the_repositoryDerrick Stolee via GitGitGadget, Jan 1, 2021
  8. Elijah NewrenJan 1, 2021
  9. Derrick StoleeJan 4, 2021
  10. 07/12 update-index: use istate->cache_changedDerrick Stolee via GitGitGadget, Jan 1, 2021
  11. 06/12 update-index: use index->cache_nr over active_nrDerrick Stolee via GitGitGadget, Jan 1, 2021
  12. 10/12 update-index: use add_index_entry()Derrick Stolee via GitGitGadget, Jan 1, 2021
  13. 11/12 update-index: replace several compatibility macrosDerrick Stolee via GitGitGadget, Jan 1, 2021
  14. 09/12 update-index: use remove_file_from_index()Derrick Stolee via GitGitGadget, Jan 1, 2021
  15. 08/12 update-index: use index_name_pos() over cache_name_pos()Derrick Stolee via GitGitGadget, Jan 1, 2021
  16. 05/12 update-index: use istate->cache over active_cacheDerrick Stolee via GitGitGadget, Jan 1, 2021
  17. 12/12 update-index: remove ce_match_stat(), all macrosDerrick Stolee via GitGitGadget, Jan 1, 2021
  18. Elijah NewrenJan 1, 2021
  19. Elijah NewrenJan 1, 2021
  20. Eric SunshineJan 2, 2021
  21. Derrick StoleeJan 4, 2021
  22. Eric SunshineJan 4, 2021
  23. Derrick StoleeJan 5, 2021
  24. 00/14 Remove more index compatibility macrosDerrick Stolee via GitGitGadget, Jan 5, 2021
  25. 03/14 update-index: drop the_index, the_repositoryDerrick Stolee via GitGitGadget, Jan 5, 2021
  26. 02/14 rm: remove compatilibity macrosDerrick Stolee via GitGitGadget, Jan 5, 2021
  27. 01/14 mv: remove index compatibility macrosDerrick Stolee via GitGitGadget, Jan 5, 2021
  28. 04/14 update-index: use istate->cache over active_cacheDerrick Stolee via GitGitGadget, Jan 5, 2021
  29. 05/14 update-index: use index->cache_nr over active_nrDerrick Stolee via GitGitGadget, Jan 5, 2021
  30. 07/14 update-index: use index_name_pos() over cache_name_pos()Derrick Stolee via GitGitGadget, Jan 5, 2021
  31. 09/14 update-index: use add_index_entry()Derrick Stolee via GitGitGadget, Jan 5, 2021
  32. 12/14 update-index: reduce static globals, part 1Derrick Stolee via GitGitGadget, Jan 5, 2021
  33. 14/14 update-index: remove static globals from callbacksDerrick Stolee via GitGitGadget, Jan 5, 2021
  34. Eric SunshineJan 7, 2021
  35. Derrick StoleeJan 7, 2021
  36. Eric SunshineJan 7, 2021
  37. Junio C HamanoJan 7, 2021
  38. Derrick StoleeJan 8, 2021
  39. 10/14 update-index: replace several compatibility macrosDerrick Stolee via GitGitGadget, Jan 5, 2021
  40. 08/14 update-index: use remove_file_from_index()Derrick Stolee via GitGitGadget, Jan 5, 2021
  41. 06/14 update-index: use istate->cache_changedDerrick Stolee via GitGitGadget, Jan 5, 2021
  42. 13/14 update-index: reduce static globals, part 2Derrick Stolee via GitGitGadget, Jan 5, 2021
  43. 11/14 update-index: remove ce_match_stat(), all macrosDerrick Stolee via GitGitGadget, Jan 5, 2021
  44. 00/14 Remove more index compatibility macrosDerrick Stolee via GitGitGadget, Jan 8, 2021
  45. 01/14 mv: remove index compatibility macrosDerrick Stolee via GitGitGadget, Jan 8, 2021
  46. 02/14 rm: remove compatilibity macrosDerrick Stolee via GitGitGadget, Jan 8, 2021
  47. 04/14 update-index: use istate->cache over active_cacheDerrick Stolee via GitGitGadget, Jan 8, 2021
  48. 03/14 update-index: drop the_index, the_repositoryDerrick Stolee via GitGitGadget, Jan 8, 2021
  49. 12/14 update-index: reduce static globals, part 1Derrick Stolee via GitGitGadget, Jan 8, 2021
  50. 05/14 update-index: use istate->cache_nr over active_nrDerrick Stolee via GitGitGadget, Jan 8, 2021
  51. 07/14 update-index: use index_name_pos() over cache_name_pos()Derrick Stolee via GitGitGadget, Jan 8, 2021
  52. 09/14 update-index: use add_index_entry()Derrick Stolee via GitGitGadget, Jan 8, 2021
  53. 11/14 update-index: remove ce_match_stat(), all macrosDerrick Stolee via GitGitGadget, Jan 8, 2021
  54. 06/14 update-index: use istate->cache_changedDerrick Stolee via GitGitGadget, Jan 8, 2021
  55. 10/14 update-index: replace several compatibility macrosDerrick Stolee via GitGitGadget, Jan 8, 2021
  56. 08/14 update-index: use remove_file_from_index()Derrick Stolee via GitGitGadget, Jan 8, 2021
  57. 13/14 update-index: reduce static globals, part 2Derrick Stolee via GitGitGadget, Jan 8, 2021
  58. 14/14 update-index: remove static globals from callbacksDerrick Stolee via GitGitGadget, Jan 8, 2021
  59. Junio C HamanoJan 10, 2021
  60. Eric SunshineJan 10, 2021
  61. Derrick StoleeJan 10, 2021
  62. Derrick StoleeJan 25, 2021
  63. Junio C HamanoJan 6, 2021
  64. Derrick StoleeJan 6, 2021
  65. Junio C HamanoJan 6, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.