diff options
| author | nulltoken <emeric.fermas@gmail.com> | 2012-07-04 11:58:04 +0200 |
|---|---|---|
| committer | nulltoken <emeric.fermas@gmail.com> | 2012-07-07 12:15:28 +0200 |
| commit | 75261421ec00b6dc0a72931ed7640743a4998c7d (patch) | |
| tree | 87c013f55be20c3fe17169189e6ffb38bdc1b456 /src/refs.c | |
| parent | b6bfd96fdd0cffc37c843cbf0f7c43efdbe96ef9 (diff) | |
| download | libgit2-75261421ec00b6dc0a72931ed7640743a4998c7d.tar.gz | |
refs: add git_reference_has_log()
Diffstat (limited to 'src/refs.c')
| -rw-r--r-- | src/refs.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/refs.c b/src/refs.c index 80349b710..2aba83ef5 100644 --- a/src/refs.c +++ b/src/refs.c @@ -1802,3 +1802,20 @@ int git_reference_foreach_glob( return git_reference_foreach( repo, list_flags, fromglob_cb, &data); } + +int git_reference_has_log( + git_reference *ref) +{ + git_buf path = GIT_BUF_INIT; + int result; + + assert(ref); + + if (git_buf_join_n(&path, '/', 3, ref->owner->path_repository, GIT_REFLOG_DIR, ref->name) < 0) + return -1; + + result = git_path_isfile(git_buf_cstr(&path)); + git_buf_free(&path); + + return result; +} |
