diff options
author | nulltoken <emeric.fermas@gmail.com> | 2012-11-22 18:51:06 +0100 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2012-11-22 18:51:06 +0100 |
commit | 5cec896a3b7b85190a7862fb09f8ba20b2241f76 (patch) | |
tree | c374bc72694e87bf9c88a127daae1d6b1aaa9604 /src/checkout.c | |
parent | a94002a983fb02eafb09788e003a545a2d23ab76 (diff) | |
download | libgit2-5cec896a3b7b85190a7862fb09f8ba20b2241f76.tar.gz |
repo: Make git_repository_head_tree() return error codes
Diffstat (limited to 'src/checkout.c')
-rw-r--r-- | src/checkout.c | 4 |
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) |