Skip to content

Commit

Permalink
Merge branch 'rs/unify-is-branch'
Browse files Browse the repository at this point in the history
* rs/unify-is-branch:
  refs.c: add a public is_branch function
  • Loading branch information
Junio C Hamano committed Jul 21, 2014
2 parents fb0166c + e7e0f26 commit 528396a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
5 changes: 0 additions & 5 deletions builtin/fsck.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion refs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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/");
}
Expand Down
2 changes: 2 additions & 0 deletions refs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 528396a

Please sign in to comment.