git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Stefan Beller <sbeller@google.com>
To: gitster@pobox.com, git@jeffhostetler.com
Cc: git@vger.kernel.org, Stefan Beller <sbeller@google.com>
Subject: [PATCH 05/24] cache.h: drop read_cache_unmerged()
Date: Tue,  2 May 2017 15:23:03 -0700	[thread overview]
Message-ID: <20170502222322.21055-6-sbeller@google.com> (raw)
In-Reply-To: <20170502222322.21055-1-sbeller@google.com>

@@ @@
-read_cache_unmerged()
+read_index_unmerged(&the_index)

Additionally drop the define from cache.h manually.

Signed-off-by: Stefan Beller <sbeller@google.com>
---
 builtin/am.c        | 2 +-
 builtin/merge.c     | 2 +-
 builtin/pull.c      | 2 +-
 builtin/read-tree.c | 2 +-
 builtin/reset.c     | 2 +-
 cache.h             | 1 -
 sequencer.c         | 2 +-
 7 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/builtin/am.c b/builtin/am.c
index cb3e4dff63..bb0927fbcc 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -2053,7 +2053,7 @@ static int clean_index(const struct object_id *head, const struct object_id *rem
 	if (!remote_tree)
 		return error(_("Could not parse object '%s'."), oid_to_hex(remote));
 
-	read_cache_unmerged();
+	read_index_unmerged(&the_index);
 
 	if (fast_forward_to(head_tree, head_tree, 1))
 		return -1;
diff --git a/builtin/merge.c b/builtin/merge.c
index 4d4c56050c..c27c806ac1 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -1170,7 +1170,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 		goto done;
 	}
 
-	if (read_cache_unmerged())
+	if (read_index_unmerged(&the_index))
 		die_resolve_conflict("merge");
 
 	if (file_exists(git_path_merge_head())) {
diff --git a/builtin/pull.c b/builtin/pull.c
index dd1a4a94e4..42578cee05 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -788,7 +788,7 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
 
 	git_config(git_pull_config, NULL);
 
-	if (read_cache_unmerged())
+	if (read_index_unmerged(&the_index))
 		die_resolve_conflict("pull");
 
 	if (file_exists(git_path_merge_head()))
diff --git a/builtin/read-tree.c b/builtin/read-tree.c
index f997814933..0bcf021ead 100644
--- a/builtin/read-tree.c
+++ b/builtin/read-tree.c
@@ -195,7 +195,7 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
 	 */
 
 	if (opts.reset || opts.merge || opts.prefix) {
-		if (read_cache_unmerged() && (opts.prefix || opts.merge))
+		if (read_index_unmerged(&the_index) && (opts.prefix || opts.merge))
 			die("You need to resolve your current index first");
 		stage = opts.merge = 1;
 	}
diff --git a/builtin/reset.c b/builtin/reset.c
index 03c5498d6e..4a4eb723dd 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -66,7 +66,7 @@ static int reset_index(const struct object_id *oid, int reset_type, int quiet)
 		opts.reset = 1;
 	}
 
-	read_cache_unmerged();
+	read_index_unmerged(&the_index);
 
 	if (reset_type == KEEP) {
 		struct object_id head_oid;
diff --git a/cache.h b/cache.h
index a66ae97fb7..9b94339573 100644
--- a/cache.h
+++ b/cache.h
@@ -355,7 +355,6 @@ extern void free_name_hash(struct index_state *istate);
 
 #ifndef NO_THE_INDEX_COMPATIBILITY_MACROS
 #define is_cache_unborn() is_index_unborn(&the_index)
-#define read_cache_unmerged() read_index_unmerged(&the_index)
 #define discard_cache() discard_index(&the_index)
 #define unmerged_cache() unmerged_index(&the_index)
 #define cache_name_pos(name, namelen) index_name_pos(&the_index,(name),(namelen))
diff --git a/sequencer.c b/sequencer.c
index 9409b65aaa..f20e05fe60 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -349,7 +349,7 @@ static struct tree *empty_tree(void)
 
 static int error_dirty_index(struct replay_opts *opts)
 {
-	if (read_cache_unmerged())
+	if (read_index_unmerged(&the_index))
 		return error_resolve_conflict(_(action_name(opts)));
 
 	error(_("your local changes would be overwritten by %s."),
-- 
2.13.0.rc1.39.ga6db8bfa24


  parent reply	other threads:[~2017-05-02 22:23 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-02 22:22 [PATCH 00/24] Retire NO_THE_INDEX_COMPATIBILITY_MACROS Stefan Beller
2017-05-02 22:22 ` [PATCH 01/24] cache.h: drop read_cache() Stefan Beller
2017-05-02 22:23 ` [PATCH 02/24] cache.h: drop active_* macros Stefan Beller
2017-05-02 22:23 ` [PATCH 03/24] cache.h: drop read_cache_from Stefan Beller
2017-05-02 22:23 ` [PATCH 04/24] cache.h: drop read_cache_preload(pathspec) Stefan Beller
2017-05-02 22:23 ` Stefan Beller [this message]
2017-05-02 22:23 ` [PATCH 06/24] unpack-trees.c: rename parameter 'the_index' Stefan Beller
2017-05-02 22:23 ` [PATCH 07/24] cache.h: drop read_blob_data_from_cache Stefan Beller
2017-05-02 22:23 ` [PATCH 08/24] cache.h: drop unmerge_cache[_entry_at] Stefan Beller
2017-05-02 22:23 ` [PATCH 09/24] cache.h: drop resolve_undo_clear Stefan Beller
2017-05-02 22:23 ` [PATCH 10/24] cache.h: drop cache_name_is_other Stefan Beller
2017-05-02 22:23 ` [PATCH 11/24] cache.h: drop cache_file_exists Stefan Beller
2017-05-02 22:23 ` [PATCH 12/24] cache.h: drop cache_dir_exists Stefan Beller
2017-05-02 22:23 ` [PATCH 13/24] cache.h: drop is_cache_unborn(), discard_cache(), unmerged_cache() Stefan Beller
2017-05-02 22:23 ` [PATCH 14/24] cache.h: drop cache_name_pos Stefan Beller
2017-05-02 22:23 ` [PATCH 15/24] cache.h: drop add_cache_entry Stefan Beller
2017-05-02 22:23 ` [PATCH 16/24] cache.h: drop rename_cache_entry_at Stefan Beller
2017-05-02 22:23 ` [PATCH 17/24] cache.h: drop remove_file_from_cache Stefan Beller
2017-05-02 22:23 ` [PATCH 18/24] cache.h: drop add_to_cache Stefan Beller
2017-05-02 22:23 ` [PATCH 19/24] cache.h: drop add_file_to_cache Stefan Beller
2017-05-02 22:23 ` [PATCH 20/24] cache.h: drop chmod_cache_entry Stefan Beller
2017-05-02 22:23 ` [PATCH 21/24] cache.h: drop refresh_cache Stefan Beller
2017-05-02 22:23 ` [PATCH 22/24] cache.h: drop ce_modified Stefan Beller
2017-05-02 22:23 ` [PATCH 23/24] cache.h: drop ce_match_stat Stefan Beller
2017-05-02 22:23 ` [PATCH 24/24] cache.h: retire NO_THE_INDEX_COMPATIBILITY_MACROS Stefan Beller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170502222322.21055-6-sbeller@google.com \
    --to=sbeller@google.com \
    --cc=git@jeffhostetler.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).