diff options
| author | Russell Belfer <rb@github.com> | 2013-01-15 09:46:50 -0800 |
|---|---|---|
| committer | Russell Belfer <rb@github.com> | 2013-01-15 09:46:50 -0800 |
| commit | 230010d19b20764b5f73636c900bd3ff84295100 (patch) | |
| tree | e4961e5c86a084b9212a5578a63345db563c0260 /src/checkout.c | |
| parent | 848d77dc8314895d6ad1a9b36f30a36fc505e230 (diff) | |
| parent | 5b524d6902b50dc2eebcce760de614edc2ab4cf4 (diff) | |
| download | libgit2-230010d19b20764b5f73636c900bd3ff84295100.tar.gz | |
Merge pull request #1238 from nulltoken/fix/checkout-index
checkout: Teach checkout to cope with orphaned Head
Diffstat (limited to 'src/checkout.c')
| -rw-r--r-- | src/checkout.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/checkout.c b/src/checkout.c index b58ef9f44..d5a471d0c 100644 --- a/src/checkout.c +++ b/src/checkout.c @@ -1173,7 +1173,14 @@ static int checkout_data_init( if (!data->opts.baseline) { data->opts_free_baseline = true; - if ((error = checkout_lookup_head_tree(&data->opts.baseline, repo)) < 0) + error = checkout_lookup_head_tree(&data->opts.baseline, repo); + + if (error == GIT_EORPHANEDHEAD) { + error = 0; + giterr_clear(); + } + + if (error < 0) goto cleanup; } |
