From: Michael Haggerty Date: Thu, 4 Aug 2011 04:36:24 +0000 (+0200) Subject: git-check-attr: Extract a function output_attr() X-Git-Tag: v1.7.7-rc0~23^2~15 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=46f96a6d8ed70ecac7c1532d7f9775320409917b;p=git.git git-check-attr: Extract a function output_attr() Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- diff --git a/builtin/check-attr.c b/builtin/check-attr.c index 5f04126d4..384c5a617 100644 --- a/builtin/check-attr.c +++ b/builtin/check-attr.c @@ -20,12 +20,10 @@ static const struct option check_attr_options[] = { OPT_END() }; -static void check_attr(int cnt, struct git_attr_check *check, +static void output_attr(int cnt, struct git_attr_check *check, const char *file) { int j; - if (git_checkattr(file, cnt, check)) - die("git_checkattr died"); for (j = 0; j < cnt; j++) { const char *value = check[j].value; @@ -41,6 +39,14 @@ static void check_attr(int cnt, struct git_attr_check *check, } } +static void check_attr(int cnt, struct git_attr_check *check, + const char *file) +{ + if (git_checkattr(file, cnt, check)) + die("git_checkattr died"); + output_attr(cnt, check, file); +} + static void check_attr_stdin_paths(int cnt, struct git_attr_check *check) { struct strbuf buf, nbuf;