Skip to content

Commit 528396a

Browse files
committed
Merge branch 'rs/unify-is-branch'
* rs/unify-is-branch: refs.c: add a public is_branch function
2 parents fb0166c + e7e0f26 commit 528396a

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

builtin/fsck.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -481,11 +481,6 @@ static int fsck_handle_reflog(const char *logname, const unsigned char *sha1, in
481481
return 0;
482482
}
483483

484-
static int is_branch(const char *refname)
485-
{
486-
return !strcmp(refname, "HEAD") || starts_with(refname, "refs/heads/");
487-
}
488-
489484
static int fsck_handle_ref(const char *refname, const unsigned char *sha1, int flag, void *cb_data)
490485
{
491486
struct object *obj;

refs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3074,7 +3074,7 @@ static int log_ref_write(const char *refname, const unsigned char *old_sha1,
30743074
return 0;
30753075
}
30763076

3077-
static int is_branch(const char *refname)
3077+
int is_branch(const char *refname)
30783078
{
30793079
return !strcmp(refname, "HEAD") || starts_with(refname, "refs/heads/");
30803080
}

refs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ extern int repack_without_refs(const char **refnames, int n,
128128

129129
extern int ref_exists(const char *);
130130

131+
extern int is_branch(const char *refname);
132+
131133
/*
132134
* If refname is a non-symbolic reference that refers to a tag object,
133135
* and the tag can be (recursively) dereferenced to a non-tag object,

0 commit comments

Comments
 (0)