diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2020-08-23 19:38:01 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2020-08-23 19:38:01 +0100 |
commit | 49517304c4a564f45e66d1ba6ba2293d865c398b (patch) | |
tree | 22fa4275f929968a35da23cec9d7ea96f1f899ff | |
parent | Remove unused helper (diff) | |
download | netfs-gitfs-49517304c4a564f45e66d1ba6ba2293d865c398b.tar.bz2 netfs-gitfs-49517304c4a564f45e66d1ba6ba2293d865c398b.tar.xz netfs-gitfs-49517304c4a564f45e66d1ba6ba2293d865c398b.zip |
Simpler, const pointer typedefsnetfs-gitfs-0.2
-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 &); } |