Skip to content

Commit d46bd3b

Browse files
committed
merge-recursive: teach was_dirty() about the virtualfilesystem
The idea of the virtual file system really is to tell Git to avoid accessing certain paths. This fixes the case where a given path is not yet included in the virtual file system and we are about to write a conflicted version of it.
1 parent ebefe9d commit d46bd3b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

merge-recursive.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
#include "git-compat-util.h"
77
#include "merge-recursive.h"
8+
#include "virtualfilesystem.h"
89

910
#include "advice.h"
1011
#include "alloc.h"
@@ -874,7 +875,8 @@ static int was_dirty(struct merge_options *opt, const char *path)
874875
{
875876
struct cache_entry *ce;
876877

877-
if (opt->priv->call_depth || !was_tracked(opt, path))
878+
if (opt->priv->call_depth || !was_tracked(opt, path) ||
879+
is_excluded_from_virtualfilesystem(path, strlen(path), DT_REG) == 1)
878880
return 0;
879881

880882
ce = index_file_exists(opt->priv->unpack_opts.src_index,

0 commit comments

Comments
 (0)