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

[PATCH 09/24] cache.h: drop resolve_undo_clear

From
Stefan Beller <sbeller@google.com>
Date
May 2, 2017, 22:23 UTC
Message-ID
<20170502222322.21055-10-sbeller@google.com>
In-Reply-To
<20170502222322.21055-1-sbeller@google.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
---
 builtin/checkout.c     | 2 +-
 builtin/merge.c        | 2 +-
 builtin/read-tree.c    | 2 +-
 builtin/update-index.c | 2 +-
 cache.h                | 1 -
 merge.c                | 2 +-
 6 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 2328a475ea..abcc45a74f 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -491,7 +491,7 @@ static int merge_working_tree(const struct checkout_opts *opts,
 	if (read_index_preload(&the_index, NULL) < 0)
 		return error(_("index file corrupt"));
 
-	resolve_undo_clear();
+	resolve_undo_clear_index(&the_index);
 	if (opts->force) {
 		ret = reset_tree(new->commit->tree, opts, 1, writeout_error);
 		if (ret)
diff --git a/builtin/merge.c b/builtin/merge.c
index c27c806ac1..b023107d26 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -1191,7 +1191,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 		else
 			die(_("You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists)."));
 	}
-	resolve_undo_clear();
+	resolve_undo_clear_index(&the_index);
 
 	if (verbosity < 0)
 		show_diffstat = 0;
diff --git a/builtin/read-tree.c b/builtin/read-tree.c
index 0bcf021ead..61f5f6f028 100644
--- a/builtin/read-tree.c
+++ b/builtin/read-tree.c
@@ -199,7 +199,7 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
 			die("You need to resolve your current index first");
 		stage = opts.merge = 1;
 	}
-	resolve_undo_clear();
+	resolve_undo_clear_index(&the_index);
 
 	for (i = 0; i < argc; i++) {
 		const char *arg = argv[i];
diff --git a/builtin/update-index.c b/builtin/update-index.c
index b8458016f0..c9f06169c0 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -796,7 +796,7 @@ static int chmod_callback(const struct option *opt,
 static int resolve_undo_clear_callback(const struct option *opt,
 				const char *arg, int unset)
 {
-	resolve_undo_clear();
+	resolve_undo_clear_index(&the_index);
 	return 0;
 }
 
diff --git a/cache.h b/cache.h
index 8a2dc393dc..abf1474034 100644
--- a/cache.h
+++ b/cache.h
@@ -371,7 +371,6 @@ extern void free_name_hash(struct index_state *istate);
 #define cache_dir_exists(name, namelen) index_dir_exists(&the_index, (name), (namelen))
 #define cache_file_exists(name, namelen, igncase) index_file_exists(&the_index, (name), (namelen), (igncase))
 #define cache_name_is_other(name, namelen) index_name_is_other(&the_index, (name), (namelen))
-#define resolve_undo_clear() resolve_undo_clear_index(&the_index)
 #endif
 
 enum object_type {
diff --git a/merge.c b/merge.c
index 748305031e..06509a6df2 100644
--- a/merge.c
+++ b/merge.c
@@ -39,7 +39,7 @@ int try_merge_command(const char *strategy, size_t xopts_nr,
 	discard_cache();
 	if (read_index(&the_index) < 0)
 		die(_("failed to read the cache"));
-	resolve_undo_clear();
+	resolve_undo_clear_index(&the_index);
 
 	return ret;
 }
-- 
2.13.0.rc1.39.ga6db8bfa24
Previous: Stefan BellerNext: Stefan Beller
Message 13 of 25 in “Retire NO_THE_INDEX_COMPATIBILITY_MACROS”
  1. 00/24 Retire NO_THE_INDEX_COMPATIBILITY_MACROSStefan Beller, May 2, 2017
  2. 01/24 cache.h: drop read_cache()Stefan Beller, May 2, 2017
  3. 03/24 cache.h: drop read_cache_fromStefan Beller, May 2, 2017
  4. 02/24 cache.h: drop active_* macrosStefan Beller, May 2, 2017
  5. 06/24 unpack-trees.c: rename parameter 'the_index'Stefan Beller, May 2, 2017
  6. 04/24 cache.h: drop read_cache_preload(pathspec)Stefan Beller, May 2, 2017
  7. 07/24 cache.h: drop read_blob_data_from_cacheStefan Beller, May 2, 2017
  8. 05/24 cache.h: drop read_cache_unmerged()Stefan Beller, May 2, 2017
  9. 10/24 cache.h: drop cache_name_is_otherStefan Beller, May 2, 2017
  10. 12/24 cache.h: drop cache_dir_existsStefan Beller, May 2, 2017
  11. 11/24 cache.h: drop cache_file_existsStefan Beller, May 2, 2017
  12. 13/24 cache.h: drop is_cache_unborn(), discard_cache(), unmerged_cache()Stefan Beller, May 2, 2017
  13. 09/24 cache.h: drop resolve_undo_clearStefan Beller, May 2, 2017
  14. 08/24 cache.h: drop unmerge_cache[_entry_at]Stefan Beller, May 2, 2017
  15. 14/24 cache.h: drop cache_name_posStefan Beller, May 2, 2017
  16. 22/24 cache.h: drop ce_modifiedStefan Beller, May 2, 2017
  17. 20/24 cache.h: drop chmod_cache_entryStefan Beller, May 2, 2017
  18. 23/24 cache.h: drop ce_match_statStefan Beller, May 2, 2017
  19. 24/24 cache.h: retire NO_THE_INDEX_COMPATIBILITY_MACROSStefan Beller, May 2, 2017
  20. 21/24 cache.h: drop refresh_cacheStefan Beller, May 2, 2017
  21. 19/24 cache.h: drop add_file_to_cacheStefan Beller, May 2, 2017
  22. 18/24 cache.h: drop add_to_cacheStefan Beller, May 2, 2017
  23. 17/24 cache.h: drop remove_file_from_cacheStefan Beller, May 2, 2017
  24. 16/24 cache.h: drop rename_cache_entry_atStefan Beller, May 2, 2017
  25. 15/24 cache.h: drop add_cache_entryStefan Beller, May 2, 2017

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.