diff options
author | Russell Belfer <rb@github.com> | 2013-08-21 14:10:27 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-08-21 14:10:27 -0700 |
commit | 24c71f14b4dcb696d9d87330322c12fd2c185317 (patch) | |
tree | 779a0dcb86c051b5722aa60c784020e4b171fc80 /src/refs.h | |
parent | a4977169e1e1920ed33f10a77e5dd8706f103f4f (diff) | |
download | libgit2-24c71f14b4dcb696d9d87330322c12fd2c185317.tar.gz |
Add internal ref set_name fn instead of realloc
The refdb_fs implementation calls realloc directly on a reference
object when it wants to rename it. It is not a public object, so
this doesn't mess with the immutability of references, but it does
assume certain constraints on the reference representation. This
commit wraps that assumption in an isolated API to isolate it.
Diffstat (limited to 'src/refs.h')
-rw-r--r-- | src/refs.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/refs.h b/src/refs.h index f487ee3fc..4bb49d02a 100644 --- a/src/refs.h +++ b/src/refs.h @@ -61,6 +61,8 @@ struct git_reference { char name[0]; }; +git_reference *git_reference__set_name(git_reference *ref, const char *name); + int git_reference__normalize_name_lax(char *buffer_out, size_t out_size, const char *name); int git_reference__normalize_name(git_buf *buf, const char *name, unsigned int flags); int git_reference__update_terminal(git_repository *repo, const char *ref_name, const git_oid *oid); |