summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-07-21 11:18:57 -0700
committerJunio C Hamano <gitster@pobox.com>2014-07-21 11:18:57 -0700
commit528396a463e4030e19f150e8fddd8d911063e77e (patch)
tree5eac35b8c38fb8c12007ee3c88d37aedd21dfcf3
parentfb0166c674efbc940ac14453129ab81823badf3d (diff)
parente7e0f26eb64de205acaac63da89f47aab78ba229 (diff)
downloadgit-528396a463e4030e19f150e8fddd8d911063e77e.tar.gz
Merge branch 'rs/unify-is-branch'
* rs/unify-is-branch: refs.c: add a public is_branch function
-rw-r--r--builtin/fsck.c5
-rw-r--r--refs.c2
-rw-r--r--refs.h2
3 files changed, 3 insertions, 6 deletions
diff --git a/builtin/fsck.c b/builtin/fsck.c
index 8aadca160e..d42a27da89 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -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;
diff --git a/refs.c b/refs.c
index dc761599fd..3792314f3b 100644
--- a/refs.c
+++ b/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/");
}
diff --git a/refs.h b/refs.h
index c5376cee8d..ec46acdde7 100644
--- a/refs.h
+++ b/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,