diff options
Diffstat (limited to 'source/shared.c')
| -rw-r--r-- | source/shared.c | 9 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 9 insertions, 0 deletions
diff --git a/source/shared.c b/source/shared.c index 0bd9fe3..a20773b 100644 --- a/source/shared.c +++ b/source/shared.c @@ -756,3 +756,12 @@ int cgit_readme_is_tracked(const char *readme) return colon && colon[1]; } + +int cgit_notes_ref_usable(const char *notes_ref) +{ + struct object_id oid; + + if (repo_get_oid_treeish(the_repository, notes_ref, &oid)) + return 0; + return !!parse_tree_indirect(&oid); +} |
