2 * GIT - The information manager from hell
10 static const char builtin_check_ref_format_usage[] =
11 "git check-ref-format <refname>\n"
12 " or: git check-ref-format --branch <branchname-shorthand>";
14 int cmd_check_ref_format(int argc, const char **argv, const char *prefix)
16 if (argc == 3 && !strcmp(argv[1], "--branch")) {
17 struct strbuf sb = STRBUF_INIT;
19 if (strbuf_check_branch_ref(&sb, argv[2]))
20 die("'%s' is not a valid branch name", argv[2]);
21 printf("%s\n", sb.buf + 11);
25 usage(builtin_check_ref_format_usage);
26 return !!check_ref_format(argv[1]);