diff options
| author | Russell Belfer <rb@github.com> | 2012-10-05 15:56:57 -0700 |
|---|---|---|
| committer | Russell Belfer <rb@github.com> | 2012-10-09 11:59:34 -0700 |
| commit | 0d64bef941928046d114c4da1acb70bd2907855e (patch) | |
| tree | 4ae0ac6484c62b0a63ca44f937d67ba15f97d7f0 /src/refs.c | |
| parent | f3a04e0f49d0f46e578613d1c27161abc4c2bf22 (diff) | |
| download | libgit2-0d64bef941928046d114c4da1acb70bd2907855e.tar.gz | |
Add complex checkout test and then fix checkout
This started as a complex new test for checkout going through the
"typechanges" test repository, but that revealed numerous issues
with checkout, including:
* complete failure with submodules
* failure to create blobs with exec bits
* problems when replacing a tree with a blob because the tree
"example/" sorts after the blob "example" so the delete was
being processed after the single file blob was created
This fixes most of those problems and includes a number of other
minor changes that made it easier to do that, including improving
the TYPECHANGE support in diff/status, etc.
Diffstat (limited to 'src/refs.c')
| -rw-r--r-- | src/refs.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/refs.c b/src/refs.c index 9dc422e1b..9249391e1 100644 --- a/src/refs.c +++ b/src/refs.c @@ -262,14 +262,15 @@ static int loose_write(git_reference *ref) if (git_buf_joinpath(&ref_path, ref->owner->path_repository, ref->name) < 0) return -1; - /* Remove a possibly existing empty directory hierarchy + /* Remove a possibly existing empty directory hierarchy * which name would collide with the reference name */ - if (git_path_isdir(git_buf_cstr(&ref_path)) && - (git_futils_rmdir_r(git_buf_cstr(&ref_path), GIT_DIRREMOVAL_ONLY_EMPTY_DIRS) < 0)) { - git_buf_free(&ref_path); - return -1; - } + if (git_path_isdir(git_buf_cstr(&ref_path)) && + git_futils_rmdir_r(git_buf_cstr(&ref_path), NULL, + GIT_DIRREMOVAL_ONLY_EMPTY_DIRS) < 0) { + git_buf_free(&ref_path); + return -1; + } if (git_filebuf_open(&file, ref_path.ptr, GIT_FILEBUF_FORCE) < 0) { git_buf_free(&ref_path); |
