diff options
| author | Ben Straub <bstraub@github.com> | 2012-07-11 09:50:12 -0700 | 
|---|---|---|
| committer | Ben Straub <bstraub@github.com> | 2012-07-11 09:50:12 -0700 | 
| commit | 822d9dd51f8f2567766c38b719d9d6d5bdc1cfa0 (patch) | |
| tree | 5997c3c1101bfc2d2cacbfed7fefb5661733781c /src | |
| parent | 1c7eb971acb386406c71f1f000d4fc789a361611 (diff) | |
| download | libgit2-822d9dd51f8f2567766c38b719d9d6d5bdc1cfa0.tar.gz | |
Remove duplicate of git_repository_head_tree.
Diffstat (limited to 'src')
| -rw-r--r-- | src/checkout.c | 25 | 
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;  | 
