зеркало из https://github.com/microsoft/git.git
Merge branch 'rs/unify-is-branch'
* rs/unify-is-branch: refs.c: add a public is_branch function
This commit is contained in:
Коммит
528396a463
|
@ -481,11 +481,6 @@ static int fsck_handle_reflog(const char *logname, const unsigned char *sha1, in
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int is_branch(const char *refname)
|
||||
{
|
||||
return !strcmp(refname, "HEAD") || starts_with(refname, "refs/heads/");
|
||||
}
|
||||
|
||||
static int fsck_handle_ref(const char *refname, const unsigned char *sha1, int flag, void *cb_data)
|
||||
{
|
||||
struct object *obj;
|
||||
|
|
2
refs.c
2
refs.c
|
@ -3074,7 +3074,7 @@ static int log_ref_write(const char *refname, const unsigned char *old_sha1,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int is_branch(const char *refname)
|
||||
int is_branch(const char *refname)
|
||||
{
|
||||
return !strcmp(refname, "HEAD") || starts_with(refname, "refs/heads/");
|
||||
}
|
||||
|
|
2
refs.h
2
refs.h
|
@ -128,6 +128,8 @@ extern int repack_without_refs(const char **refnames, int n,
|
|||
|
||||
extern int ref_exists(const char *);
|
||||
|
||||
extern int is_branch(const char *refname);
|
||||
|
||||
/*
|
||||
* If refname is a non-symbolic reference that refers to a tag object,
|
||||
* and the tag can be (recursively) dereferenced to a non-tag object,
|
||||
|
|
Загрузка…
Ссылка в новой задаче