summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2020-08-23 19:38:01 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2020-08-23 19:38:01 +0100
commit49517304c4a564f45e66d1ba6ba2293d865c398b (patch)
tree22fa4275f929968a35da23cec9d7ea96f1f899ff /src
parentRemove unused helper (diff)
downloadnetfs-gitfs-0.2.tar.bz2
netfs-gitfs-0.2.tar.xz
netfs-gitfs-0.2.zip
Simpler, const pointer typedefsnetfs-gitfs-0.2
Diffstat (limited to 'src')
-rw-r--r--src/git.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/git.h b/src/git.h
index 38a89d3..46bdb18 100644
--- a/src/git.h
+++ b/src/git.h
@@ -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 &);
}