git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [PATCH 3/5] fixup! d5ad6c13
Date: Wed,  8 Jun 2016 15:58:16 -0700	[thread overview]
Message-ID: <20160608225818.726-4-gitster@pobox.com> (raw)
In-Reply-To: <20160608225818.726-1-gitster@pobox.com>

As the topic is in 'next' already, I'll leave this floating near the
tip for now, until we can rewind the topic after the next release.
---
 attr.c | 9 ++++++---
 attr.h | 2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/attr.c b/attr.c
index 4e2172a..0e61950 100644
--- a/attr.c
+++ b/attr.c
@@ -899,13 +899,16 @@ struct git_attr_check *git_attr_check_alloc(void)
 	return xcalloc(1, sizeof(struct git_attr_check));
 }
 
-void git_attr_check_append(struct git_attr_check *check,
-			   const struct git_attr *attr)
+struct git_attr_check_elem *git_attr_check_append(struct git_attr_check *check,
+						  const struct git_attr *attr)
 {
+	struct git_attr_check_elem *elem;
 	if (check->finalized)
 		die("BUG: append after git_attr_check structure is finalized");
 	ALLOC_GROW(check->check, check->check_nr + 1, check->check_alloc);
-	check->check[check->check_nr++].attr = attr;
+	elem = &check->check[check->check_nr++];
+	elem->attr = attr;
+	return elem;
 }
 
 void git_attr_check_clear(struct git_attr_check *check)
diff --git a/attr.h b/attr.h
index fc72030..40abc16 100644
--- a/attr.h
+++ b/attr.h
@@ -47,7 +47,7 @@ extern int git_check_attr(const char *path, struct git_attr_check *);
 extern int git_check_attr_counted(const char *, int, struct git_attr_check *);
 
 extern struct git_attr_check *git_attr_check_alloc(void);
-extern void git_attr_check_append(struct git_attr_check *, const struct git_attr *);
+extern struct git_attr_check_elem *git_attr_check_append(struct git_attr_check *, const struct git_attr *);
 
 extern void git_attr_check_clear(struct git_attr_check *);
 extern void git_attr_check_free(struct git_attr_check *);
-- 
2.9.0-rc2-262-g9161bbf

  parent reply	other threads:[~2016-06-08 22:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-08 22:58 [PATCH 0/5] A bit more "attributes" Junio C Hamano
2016-06-08 22:58 ` [PATCH 1/5] attr.c: add push_stack() helper Junio C Hamano
2016-06-08 23:43   ` Stefan Beller
2016-06-09  0:15     ` Junio C Hamano
2016-06-08 22:58 ` [PATCH 2/5] attr.c: pass struct git_attr_check down the callchain Junio C Hamano
2016-06-08 23:54   ` Stefan Beller
2016-06-08 22:58 ` Junio C Hamano [this message]
2016-06-09  0:00   ` [PATCH 3/5] fixup! d5ad6c13 Stefan Beller
2016-06-09  0:10     ` Junio C Hamano
2016-06-08 22:58 ` [PATCH 4/5] attr.c: correct ugly hack for git_all_attrs() Junio C Hamano
2016-06-08 22:58 ` [PATCH 5/5] attr.c: always pass check[] to collect_some_attrs() Junio C Hamano
2016-06-09  0:25   ` Stefan Beller
2016-06-09 18:15     ` 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=20160608225818.726-4-gitster@pobox.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).