Rename get_ident() to fmt_ident() and make it available to outside
This makes the functionality of ident.c::get_ident() available to other callers. Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
11dbe9e880
commit
798123af21
1
cache.h
1
cache.h
@ -321,6 +321,7 @@ unsigned long approxidate(const char *);
|
|||||||
|
|
||||||
extern const char *git_author_info(int);
|
extern const char *git_author_info(int);
|
||||||
extern const char *git_committer_info(int);
|
extern const char *git_committer_info(int);
|
||||||
|
extern const char *fmt_ident(const char *name, const char *email, const char *date_str, int);
|
||||||
|
|
||||||
struct checkout {
|
struct checkout {
|
||||||
const char *base_dir;
|
const char *base_dir;
|
||||||
|
6
ident.c
6
ident.c
@ -185,7 +185,7 @@ static const char *env_hint =
|
|||||||
"Add --global to set your account\'s default\n"
|
"Add --global to set your account\'s default\n"
|
||||||
"\n";
|
"\n";
|
||||||
|
|
||||||
static const char *get_ident(const char *name, const char *email,
|
const char *fmt_ident(const char *name, const char *email,
|
||||||
const char *date_str, int error_on_no_name)
|
const char *date_str, int error_on_no_name)
|
||||||
{
|
{
|
||||||
static char buffer[1000];
|
static char buffer[1000];
|
||||||
@ -233,7 +233,7 @@ static const char *get_ident(const char *name, const char *email,
|
|||||||
|
|
||||||
const char *git_author_info(int error_on_no_name)
|
const char *git_author_info(int error_on_no_name)
|
||||||
{
|
{
|
||||||
return get_ident(getenv("GIT_AUTHOR_NAME"),
|
return fmt_ident(getenv("GIT_AUTHOR_NAME"),
|
||||||
getenv("GIT_AUTHOR_EMAIL"),
|
getenv("GIT_AUTHOR_EMAIL"),
|
||||||
getenv("GIT_AUTHOR_DATE"),
|
getenv("GIT_AUTHOR_DATE"),
|
||||||
error_on_no_name);
|
error_on_no_name);
|
||||||
@ -241,7 +241,7 @@ const char *git_author_info(int error_on_no_name)
|
|||||||
|
|
||||||
const char *git_committer_info(int error_on_no_name)
|
const char *git_committer_info(int error_on_no_name)
|
||||||
{
|
{
|
||||||
return get_ident(getenv("GIT_COMMITTER_NAME"),
|
return fmt_ident(getenv("GIT_COMMITTER_NAME"),
|
||||||
getenv("GIT_COMMITTER_EMAIL"),
|
getenv("GIT_COMMITTER_EMAIL"),
|
||||||
getenv("GIT_COMMITTER_DATE"),
|
getenv("GIT_COMMITTER_DATE"),
|
||||||
error_on_no_name);
|
error_on_no_name);
|
||||||
|
Loading…
Reference in New Issue
Block a user