mirror of
https://github.com/git/git
synced 2024-08-28 12:09:19 +00:00
Remove empty directories in recursive merge
The code was actually supposed to do that, but was accidentally broken. Noticed by Anders Melchiorsen. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
parent
fee75457fc
commit
41f13af558
|
@ -444,10 +444,8 @@ static int remove_file(int clean, const char *path, int no_wd)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (update_working_directory) {
|
if (update_working_directory) {
|
||||||
unlink(path);
|
if (remove_path(path) && errno != ENOENT)
|
||||||
if (errno != ENOENT || errno != EISDIR)
|
|
||||||
return -1;
|
return -1;
|
||||||
remove_path(path);
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -535,4 +535,15 @@ test_expect_success 'reset and bind merge' '
|
||||||
|
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'merge removes empty directories' '
|
||||||
|
|
||||||
|
git reset --hard master &&
|
||||||
|
git checkout -b rm &&
|
||||||
|
git rm d/e &&
|
||||||
|
git commit -mremoved-d/e &&
|
||||||
|
git checkout master &&
|
||||||
|
git merge -s recursive rm &&
|
||||||
|
test_must_fail test -d d
|
||||||
|
'
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
|
Loading…
Reference in a new issue