From 7b3959b22784d63dd6f21bc250602b886d726294 Mon Sep 17 00:00:00 2001 From: Sascha Cunz Date: Sat, 2 Nov 2013 03:45:32 +0000 Subject: [PATCH] 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. --- src/checkout.c | 14 +------------- 1 file changed, 1 insertion(+), 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); }