summaryrefslogtreecommitdiff
path: root/src/git.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/git.h')
-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 &);
}