Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
git-check-attr: Extract a function error_with_usage()
author
Michael Haggerty
<mhagger@alum.mit.edu>
Thu, 4 Aug 2011 04:36:26 +0000
(06:36 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 4 Aug 2011 22:53:18 +0000
(15:53 -0700)
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/check-attr.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
d6541bb
)
diff --git
a/builtin/check-attr.c
b/builtin/check-attr.c
index c5270786d476271ca7cd25a27a9eeffc99aa3dad..d0042227c219d4e595cf73059af28318da7f3b66 100644
(file)
--- a/
builtin/check-attr.c
+++ b/
builtin/check-attr.c
@@
-68,6
+68,12
@@
static void check_attr_stdin_paths(int cnt, struct git_attr_check *check)
strbuf_release(&nbuf);
}
strbuf_release(&nbuf);
}
+static NORETURN void error_with_usage(const char *msg)
+{
+ error("%s", msg);
+ usage_with_options(check_attr_usage, check_attr_options);
+}
+
int cmd_check_attr(int argc, const char **argv, const char *prefix)
{
struct git_attr_check *check;
int cmd_check_attr(int argc, const char **argv, const char *prefix)
{
struct git_attr_check *check;
@@
-103,8
+109,7
@@
int cmd_check_attr(int argc, const char **argv, const char *prefix)
else if (stdin_paths && filei < argc)
errstr = "Can't specify files with --stdin";
if (errstr) {
else if (stdin_paths && filei < argc)
errstr = "Can't specify files with --stdin";
if (errstr) {
- error("%s", errstr);
- usage_with_options(check_attr_usage, check_attr_options);
+ error_with_usage(errstr);
}
check = xcalloc(cnt, sizeof(*check));
}
check = xcalloc(cnt, sizeof(*check));