summaryrefslogtreecommitdiff
path: root/src/git.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2019-07-28 13:21:33 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2019-07-28 13:21:33 +0100
commit801b1a160558ed8b862e683c7aaf5092b0c1adb2 (patch)
treecdfd96d7f5164195e722f2c0d6df70c1613fa357 /src/git.cpp
parentReplace hard-coded test values with properties (diff)
downloadnetfs-gitfs-801b1a160558ed8b862e683c7aaf5092b0c1adb2.tar.bz2
netfs-gitfs-801b1a160558ed8b862e683c7aaf5092b0c1adb2.tar.xz
netfs-gitfs-801b1a160558ed8b862e683c7aaf5092b0c1adb2.zip
Support working tree based on a commit, tag or branch
Diffstat (limited to 'src/git.cpp')
-rw-r--r--src/git.cpp10
1 files changed, 10 insertions, 0 deletions
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<NetFS::SystemError>(
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<NetFS::ConfigError>(
+ git_reference_dwim, git_reference_free, repo.get(), name.c_str());
+ }
+ RefPtr Resolve(const RefPtr & ref)
+ {
+ return gitSafeGet<NetFS::ConfigError>(
+ git_reference_resolve, git_reference_free, ref.get());
+ }
}
}