summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSascha Cunz <sascha@babbelbox.org>2013-11-02 03:45:32 +0000
committerSascha Cunz <sascha@babbelbox.org>2013-11-02 03:45:32 +0000
commit7b3959b22784d63dd6f21bc250602b886d726294 (patch)
tree27ad94d399c4614e92c515440630dc14d2da47bc
parent352214416c0e5fd85ef02077ddf185103f3a92df (diff)
downloadlibgit2-7b3959b22784d63dd6f21bc250602b886d726294.tar.gz
Checkout: git_checkout_head is git_checkout_tree without a treeish
The last commit taught git_checkout_tree to actually do something meaningfull, when treeish was NULL. This lets us rewrite git_checkout_head to simply call git_checkout_tree without giving it a treeish.
-rw-r--r--src/checkout.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/checkout.c b/src/checkout.c
index d818a44bf..376d48b86 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -2103,18 +2103,6 @@ int git_checkout_head(
git_repository *repo,
const git_checkout_opts *opts)
{
- int error;
- git_tree *head = NULL;
- git_iterator *head_i = NULL;
-
assert(repo);
-
- if (!(error = checkout_lookup_head_tree(&head, repo)) &&
- !(error = git_iterator_for_tree(&head_i, head, 0, NULL, NULL)))
- error = git_checkout_iterator(head_i, opts);
-
- git_iterator_free(head_i);
- git_tree_free(head);
-
- return error;
+ return git_checkout_tree(repo, NULL, opts);
}