From 801b1a160558ed8b862e683c7aaf5092b0c1adb2 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 28 Jul 2019 13:21:33 +0100 Subject: Support working tree based on a commit, tag or branch --- src/git.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/git.cpp') diff --git a/src/git.cpp b/src/git.cpp index 045d146..b169fa2 100644 --- a/src/git.cpp +++ b/src/git.cpp @@ -63,6 +63,16 @@ namespace GitFS { return gitSafeGet( git_tree_entry_bypath, git_tree_entry_free, tree.get(), path.c_str() + 1); } + RefPtr Commitish(const RepositoryPtr & repo, const std::string & name) + { + return gitSafeGet( + git_reference_dwim, git_reference_free, repo.get(), name.c_str()); + } + RefPtr Resolve(const RefPtr & ref) + { + return gitSafeGet( + git_reference_resolve, git_reference_free, ref.get()); + } } } -- cgit v1.2.3