summaryrefslogtreecommitdiff
path: root/src/checkout.c
diff options
context:
space:
mode:
authorVicent Martí <vicent@github.com>2012-11-23 15:19:47 -0800
committerVicent Martí <vicent@github.com>2012-11-23 15:19:47 -0800
commitc4d8df27bc4d3c0ef5ea46f4953614955fc4bdc2 (patch)
tree62a1d39f547c562d71558309e6548783202d62dc /src/checkout.c
parent28de452a4b7915f1bb0c6913c23c04d412b281c7 (diff)
parent5cec896a3b7b85190a7862fb09f8ba20b2241f76 (diff)
downloadlibgit2-c4d8df27bc4d3c0ef5ea46f4953614955fc4bdc2.tar.gz
Merge pull request #1097 from nulltoken/topic/head_tree_error
Make `git_repository_head_tree()` return error codes
Diffstat (limited to 'src/checkout.c')
-rw-r--r--src/checkout.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/checkout.c b/src/checkout.c
index eff14813d..c4e4f999a 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -440,7 +440,9 @@ static int checkout_get_actions(
const git_index_entry *he;
/* if there is no HEAD, that's okay - we'll make an empty iterator */
- (void)git_repository_head_tree(&head, data->repo);
+ if (((error = git_repository_head_tree(&head, data->repo)) < 0) &&
+ !(error == GIT_ENOTFOUND || error == GIT_EORPHANEDHEAD))
+ return -1;
if ((error = git_iterator_for_tree_range(
&hiter, data->repo, head, pfx, pfx)) < 0)