]>
git.ipfire.org Git - thirdparty/git.git/blob - builtin-symbolic-ref.c
4 static const char git_symbolic_ref_usage
[] =
5 "git-symbolic-ref name [ref]";
7 static void check_symref(const char *HEAD
)
9 unsigned char sha1
[20];
10 const char *refs_heads_master
= resolve_ref(HEAD
, sha1
, 0);
12 if (!refs_heads_master
)
13 die("No such ref: %s", HEAD
);
14 puts(refs_heads_master
);
17 int cmd_symbolic_ref(int argc
, const char **argv
, const char *prefix
)
19 git_config(git_default_config
);
22 check_symref(argv
[1]);
25 create_symref(argv
[1], argv
[2]);
28 usage(git_symbolic_ref_usage
);