mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-21 22:21:37 +00:00
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.
This commit is contained in:
parent
352214416c
commit
7b3959b227
@ -2103,18 +2103,6 @@ int git_checkout_head(
|
|||||||
git_repository *repo,
|
git_repository *repo,
|
||||||
const git_checkout_opts *opts)
|
const git_checkout_opts *opts)
|
||||||
{
|
{
|
||||||
int error;
|
|
||||||
git_tree *head = NULL;
|
|
||||||
git_iterator *head_i = NULL;
|
|
||||||
|
|
||||||
assert(repo);
|
assert(repo);
|
||||||
|
return git_checkout_tree(repo, NULL, opts);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user