| #include "parse-options.h" |
| static const char * const git_symbolic_ref_usage[] = { |
| "git-symbolic-ref [options] name [ref]", |
| static void check_symref(const char *HEAD, int quiet) |
| const char *refs_heads_master = resolve_ref(HEAD, sha1, 0, &flag); |
| die("No such ref: %s", HEAD); |
| else if (!(flag & REF_ISSYMREF)) { |
| die("ref %s is not a symbolic ref", HEAD); |
| int cmd_symbolic_ref(int argc, const char **argv, const char *prefix) |
| struct option options[] = { |
| OPT_STRING('m', NULL, &msg, "reason", "reason of the update"), |
| git_config(git_default_config); |
| argc = parse_options(argc, argv, options, git_symbolic_ref_usage, 0); |
| die("Refusing to perform update with empty message"); |
| check_symref(argv[0], quiet); |
| create_symref(argv[0], argv[1], msg); |
| usage_with_options(git_symbolic_ref_usage, options); |