Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2011-08-04 08:36:24 +0400
committerJunio C Hamano <gitster@pobox.com>2011-08-05 02:53:18 +0400
commit46f96a6d8ed70ecac7c1532d7f9775320409917b (patch)
treeb8d5c11013dc200cd51d192b0bdeb49d2921f053 /builtin/check-attr.c
parentee548df3005d976d4e6a78b3b4454fed812ea28c (diff)
git-check-attr: Extract a function output_attr()
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/check-attr.c')
-rw-r--r--builtin/check-attr.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/builtin/check-attr.c b/builtin/check-attr.c
index 5f04126d4d..384c5a6171 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;