Skip to content

Commit 450a24d

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 92b76fd commit 450a24d

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
@@ -8,6 +8,7 @@
88

99
#include "git-compat-util.h"
1010
#include "merge-recursive.h"
11+
#include "virtualfilesystem.h"
1112

1213
#include "alloc.h"
1314
#include "cache-tree.h"
@@ -875,7 +876,8 @@ static int was_dirty(struct merge_options *opt, const char *path)
875876
{
876877
struct cache_entry *ce;
877878

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

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

0 commit comments

Comments
 (0)