All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Beller <sbeller@google.com>
To: pclouds@gmail.com
Cc: ao2@ao2.it, bmwill@google.com, git@vger.kernel.org,
	gitster@pobox.com, sbeller@google.com
Subject: [PATCH 08/11] check-attr: switch to repo_read_index_or_die
Date: Wed, 16 May 2018 15:21:15 -0700	[thread overview]
Message-ID: <20180516222118.233868-9-sbeller@google.com> (raw)
In-Reply-To: <20180516222118.233868-1-sbeller@google.com>

Signed-off-by: Stefan Beller <sbeller@google.com>
---
 builtin/check-attr.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/builtin/check-attr.c b/builtin/check-attr.c
index 91444dc0448..bf05e7e93ca 100644
--- a/builtin/check-attr.c
+++ b/builtin/check-attr.c
@@ -4,6 +4,7 @@
 #include "attr.h"
 #include "quote.h"
 #include "parse-options.h"
+#include "repository.h"
 
 static int all_attrs;
 static int cached_attrs;
@@ -115,9 +116,7 @@ int cmd_check_attr(int argc, const char **argv, const char *prefix)
 	argc = parse_options(argc, argv, prefix, check_attr_options,
 			     check_attr_usage, PARSE_OPT_KEEP_DASHDASH);
 
-	if (read_cache() < 0) {
-		die("invalid cache");
-	}
+	repo_read_index_or_die(the_repository);
 
 	if (cached_attrs)
 		git_attr_set_direction(GIT_ATTR_INDEX, NULL);
-- 
2.17.0.582.gccdcbd54c44.dirty


  parent reply	other threads:[~2018-05-16 22:22 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-15  1:04 [PATCH] grep: handle corrupt index files early Stefan Beller
2018-05-15 12:18 ` Johannes Schindelin
2018-05-15 13:13 ` Duy Nguyen
2018-05-15 16:44   ` Stefan Beller
2018-05-16 15:24     ` Duy Nguyen
2018-05-16 22:21       ` [PATCH 00/11] Stefan Beller
2018-05-16 22:21         ` [PATCH 01/11] grep: handle corrupt index files early Stefan Beller
2018-05-16 22:21         ` [PATCH 02/11] repository: introduce repo_read_index_or_die Stefan Beller
2018-05-19  6:37           ` Duy Nguyen
2018-05-21 18:38             ` Stefan Beller
2018-05-21 18:50               ` Brandon Williams
2018-05-21 19:27                 ` Stefan Beller
2018-05-22 15:13                   ` Duy Nguyen
2018-05-22 17:49           ` Why do we have both x*() and *_or_die() for "do or die"? Ævar Arnfjörð Bjarmason
2018-05-22 17:55             ` Duy Nguyen
2018-05-22 18:38               ` Jonathan Nieder
2018-05-22 18:04             ` Stefan Beller
2018-05-23  3:19             ` Junio C Hamano
2018-05-16 22:21         ` [PATCH 03/11] builtin/grep: use repo_read_index_or_die Stefan Beller
2018-05-16 22:21         ` [PATCH 04/11] submodule: " Stefan Beller
2018-05-16 22:21         ` [PATCH 05/11] builtin/ls-files: " Stefan Beller
2018-05-16 22:21         ` [PATCH 06/11] read_cache: use repo_read_index_or_die with different error messages Stefan Beller
2018-05-16 22:21         ` [PATCH 07/11] rerere: use repo_read_index_or_die Stefan Beller
2018-05-20 17:45           ` Thomas Gummerer
2018-05-21 18:46             ` Stefan Beller
2018-05-16 22:21         ` Stefan Beller [this message]
2018-05-16 22:21         ` [PATCH 09/11] checkout-index: switch to repo_read_index Stefan Beller
2018-05-16 22:21         ` [PATCH 10/11] test helpers: switch to repo_read_index_or_die Stefan Beller
2018-05-16 22:21         ` [PATCH 11/11] read_cache: convert most calls " Stefan Beller
2018-05-16 22:27           ` Brandon Williams
2018-05-19  6:55             ` Duy Nguyen
2018-05-19  6:54           ` Duy Nguyen
2018-05-19  6:57         ` [PATCH 00/11] Duy Nguyen
2018-05-17  1:36       ` [PATCH] grep: handle corrupt index files early Junio C Hamano
2018-05-17 17:21         ` Stefan Beller
2018-05-17 22:57           ` Junio C Hamano
2018-05-15 17:01 ` Brandon Williams
2018-05-15 23:58 ` Junio C Hamano

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

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

  git send-email \
    --in-reply-to=20180516222118.233868-9-sbeller@google.com \
    --to=sbeller@google.com \
    --cc=ao2@ao2.it \
    --cc=bmwill@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pclouds@gmail.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.