diff options
Diffstat (limited to 'src/git.h')
-rw-r--r-- | src/git.h | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -14,7 +14,7 @@ namespace GitFS { void gitSafe(int (*func)(P...), A ... p) { - if (int _giterror = func(p...); _giterror != 0) { + if (int _giterror = func(p...)) { throwError<E>(_giterror); } } @@ -61,6 +61,11 @@ namespace GitFS { using TreeEntryPtr = decltype(gitSafeGet<std::exception>( git_tree_entry_bypath, git_tree_entry_free, nullptr, nullptr)); TreeEntryPtr TreeEntryByPath(const TreePtr & tree, const std::string & path); + + using RefPtr = decltype(gitSafeGet<std::exception>( + git_reference_dwim, git_reference_free, nullptr, nullptr)); + RefPtr Commitish(const RepositoryPtr & repo, const std::string & name); + RefPtr Resolve(const RefPtr &); } } |