2 * GIT - The information manager from hell
10 int cmd_check_ref_format(int argc, const char **argv, const char *prefix)
12 if (argc == 3 && !strcmp(argv[1], "--branch")) {
13 struct strbuf sb = STRBUF_INIT;
14 strbuf_branchname(&sb, argv[2]);
15 strbuf_splice(&sb, 0, 0, "refs/heads/", 11);
16 if (check_ref_format(sb.buf))
17 die("'%s' is not a valid branch name", argv[2]);
18 printf("%s\n", sb.buf + 11);
22 usage("git check-ref-format refname");
23 return !!check_ref_format(argv[1]);