diff options
Diffstat (limited to 'src')
| -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; +} |
