提交 41f13af5 编写于 作者: A Alex Riesen 提交者: Shawn O. Pearce

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: NAlex Riesen <raa.lkml@gmail.com>
Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
上级 fee75457
......@@ -444,10 +444,8 @@ static int remove_file(int clean, const char *path, int no_wd)
return -1;
}
if (update_working_directory) {
unlink(path);
if (errno != ENOENT || errno != EISDIR)
if (remove_path(path) && errno != ENOENT)
return -1;
remove_path(path);
}
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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册