summaryrefslogtreecommitdiff
path: root/src/refs.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2020-06-17 14:57:13 +0200
committerPatrick Steinhardt <ps@pks.im>2020-07-12 18:12:16 +0200
commit5434f9a363cd9eee1866033da23c9bc7446232b1 (patch)
treec67a511931ff3cbce744259919660d37defe7a91 /src/refs.c
parent658954100c138fa28222f5cb3198d9f1335fa556 (diff)
downloadlibgit2-5434f9a363cd9eee1866033da23c9bc7446232b1.tar.gz
refs: remove function to read HEAD directly
With the last user of `git_reference__read_head` gone, let's remove it as it's been reading references without consulting the refdb backends.
Diffstat (limited to 'src/refs.c')
-rw-r--r--src/refs.c34
1 files changed, 0 insertions, 34 deletions
diff --git a/src/refs.c b/src/refs.c
index 470ed5441..b6234451f 100644
--- a/src/refs.c
+++ b/src/refs.c
@@ -263,40 +263,6 @@ int git_reference_lookup_resolved(
return 0;
}
-int git_reference__read_head(
- git_reference **out,
- git_repository *repo,
- const char *path)
-{
- git_buf reference = GIT_BUF_INIT;
- char *name = NULL;
- int error;
-
- if ((error = git_futils_readbuffer(&reference, path)) < 0)
- goto out;
- git_buf_rtrim(&reference);
-
- if (git__strncmp(reference.ptr, GIT_SYMREF, strlen(GIT_SYMREF)) == 0) {
- git_buf_consume(&reference, reference.ptr + strlen(GIT_SYMREF));
-
- name = git_path_basename(path);
-
- if ((*out = git_reference__alloc_symbolic(name, reference.ptr)) == NULL) {
- error = -1;
- goto out;
- }
- } else {
- if ((error = git_reference_lookup(out, repo, reference.ptr)) < 0)
- goto out;
- }
-
-out:
- git__free(name);
- git_buf_dispose(&reference);
-
- return error;
-}
-
int git_reference_dwim(git_reference **out, git_repository *repo, const char *refname)
{
int error = 0, i;