Commit 7b3959b2 by Sascha Cunz

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.
parent 35221441
......@@ -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);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment