Skip to content

Commit 6ca188e

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 d1af813 commit 6ca188e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: merge-recursive.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include "git-compat-util.h"
1111
#include "merge-recursive.h"
12+
#include "virtualfilesystem.h"
1213

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

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

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

0 commit comments

Comments
 (0)