Git development
 help / color / mirror / Atom feed
From: Brian Downing <bdowning@lavos.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Marius Storm-Olsen <marius@trolltech.com>,
	Steffen Prohaska <prohaska@zib.de>,
	dmitry.kakurin@gmail.com, git@vger.kernel.org,
	Brian Downing <bdowning@lavos.net>
Subject: [PATCH] Add read_cache to builtin-check-attr
Date: Tue, 14 Aug 2007 08:18:38 -0500	[thread overview]
Message-ID: <11870975181798-git-send-email-bdowning@lavos.net> (raw)
In-Reply-To: 7vwsvycxup.fsf_-_@assigned-by-dhcp.cox.net

We can now read .gitattributes files out of the index, but the index
must be loaded for this to work.

Signed-off-by: Brian Downing <bdowning@lavos.net>
---
 builtin-check-attr.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/builtin-check-attr.c b/builtin-check-attr.c
index 9d77f76..d949733 100644
--- a/builtin-check-attr.c
+++ b/builtin-check-attr.c
@@ -1,4 +1,5 @@
 #include "builtin.h"
+#include "cache.h"
 #include "attr.h"
 #include "quote.h"
 
@@ -10,6 +11,10 @@ int cmd_check_attr(int argc, const char **argv, const char *prefix)
 	struct git_attr_check *check;
 	int cnt, i, doubledash;
 
+	if (read_cache() < 0) {
+		die("invalid cache");
+	}
+
 	doubledash = -1;
 	for (i = 1; doubledash < 0 && i < argc; i++) {
 		if (!strcmp(argv[i], "--"))
-- 
1.5.3.GIT

             reply	other threads:[~2007-08-14 13:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-14 13:18 Brian Downing [this message]
2007-08-14 13:22 ` [PATCH] Add read_cache to builtin-check-attr Brian Downing
2007-08-14 14:08   ` Johannes Schindelin
2007-08-14 14:24     ` Brian Downing
2007-08-14 14:46       ` Johannes Schindelin
2007-08-14 18:38 ` Junio C Hamano
2007-08-14 18:45   ` Brian Downing
2007-08-15  5:45     ` 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=11870975181798-git-send-email-bdowning@lavos.net \
    --to=bdowning@lavos.net \
    --cc=dmitry.kakurin@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=marius@trolltech.com \
    --cc=prohaska@zib.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox