diff options
-rw-r--r-- | src/git.h | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -30,23 +30,22 @@ namespace GitFS::Git { git_oid OidParse(const std::string_view & str); - using RepositoryPtr = decltype(gitSafeGet<std::exception>(git_repository_open_bare, git_repository_free, nullptr)); + using RepositoryPtr = TPtr<git_repository>; RepositoryPtr RepositoryOpenBare(const std::string & path); - using BlobPtr = decltype(gitSafeGet<std::exception>(git_blob_lookup, git_blob_free, nullptr, nullptr)); + using BlobPtr = TPtr<const git_blob>; BlobPtr BlobLookup(const RepositoryPtr & repo, const git_oid & blob); - using CommitPtr = decltype(gitSafeGet<std::exception>(git_commit_lookup, git_commit_free, nullptr, nullptr)); + using CommitPtr = TPtr<const git_commit>; CommitPtr CommitLookup(const RepositoryPtr & repo, const git_oid & commitId); - using TreePtr = decltype(gitSafeGet<std::exception>(git_tree_lookup, git_tree_free, nullptr, nullptr)); + using TreePtr = TPtr<const git_tree>; TreePtr TreeLookup(const RepositoryPtr & repo, const git_oid & treeId); - using TreeEntryPtr - = decltype(gitSafeGet<std::exception>(git_tree_entry_bypath, git_tree_entry_free, nullptr, nullptr)); + using TreeEntryPtr = TPtr<const git_tree_entry>; TreeEntryPtr TreeEntryByPath(const TreePtr & tree, const std::string & path); - using RefPtr = decltype(gitSafeGet<std::exception>(git_reference_dwim, git_reference_free, nullptr, nullptr)); + using RefPtr = TPtr<const git_reference>; RefPtr Commitish(const RepositoryPtr & repo, const std::string & name); RefPtr Resolve(const RefPtr &); } |