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>maint
parent
ee548df300
commit
46f96a6d8e
|
|
@ -20,12 +20,10 @@ static const struct option check_attr_options[] = {
|
||||||
OPT_END()
|
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)
|
const char *file)
|
||||||
{
|
{
|
||||||
int j;
|
int j;
|
||||||
if (git_checkattr(file, cnt, check))
|
|
||||||
die("git_checkattr died");
|
|
||||||
for (j = 0; j < cnt; j++) {
|
for (j = 0; j < cnt; j++) {
|
||||||
const char *value = check[j].value;
|
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)
|
static void check_attr_stdin_paths(int cnt, struct git_attr_check *check)
|
||||||
{
|
{
|
||||||
struct strbuf buf, nbuf;
|
struct strbuf buf, nbuf;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue