summaryrefslogtreecommitdiff
path: root/src/checkout.c
diff options
context:
space:
mode:
authorBen Straub <bstraub@github.com>2012-07-11 09:50:12 -0700
committerBen Straub <bstraub@github.com>2012-07-11 09:50:12 -0700
commit822d9dd51f8f2567766c38b719d9d6d5bdc1cfa0 (patch)
tree5997c3c1101bfc2d2cacbfed7fefb5661733781c /src/checkout.c
parent1c7eb971acb386406c71f1f000d4fc789a361611 (diff)
downloadlibgit2-822d9dd51f8f2567766c38b719d9d6d5bdc1cfa0.tar.gz
Remove duplicate of git_repository_head_tree.
Diffstat (limited to 'src/checkout.c')
-rw-r--r--src/checkout.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/src/checkout.c b/src/checkout.c
index 58ae7f281..b9b5bc1f9 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -23,29 +23,6 @@
GIT_BEGIN_DECL
-static int get_head_tree(git_tree **out, git_repository *repo)
-{
- int retcode = GIT_ERROR;
- git_reference *head = NULL;
-
- /* Dereference HEAD all the way to an OID ref */
- if (!git_reference_lookup_resolved(&head, repo, GIT_HEAD_FILE, -1)) {
- /* The OID should be a commit */
- git_object *commit;
- if (!git_object_lookup(&commit, repo,
- git_reference_oid(head), GIT_OBJ_COMMIT)) {
- /* Get the tree */
- if (!git_commit_tree(out, (git_commit*)commit)) {
- retcode = 0;
- }
- git_object_free(commit);
- }
- git_reference_free(head);
- }
-
- return retcode;
-}
-
typedef struct tree_walk_data
{
git_indexer_stats *stats;
@@ -160,7 +137,7 @@ int git_checkout_force(git_repository *repo, git_indexer_stats *stats)
/* TODO: stats->total is never calculated. */
- if (!get_head_tree(&tree, repo)) {
+ if (!git_repository_head_tree(&tree, repo)) {
/* Checkout the files */
if (!git_tree_walk(tree, checkout_walker, GIT_TREEWALK_POST, &payload)) {
retcode = 0;