Skip to content

Commit f75c1b2

Browse files
dschoderrickstolee
authored andcommitted
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 2bcd97f commit f75c1b2

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 "cache.h"
77
#include "merge-recursive.h"
8+
#include "virtualfilesystem.h"
89

910
#include "advice.h"
1011
#include "alloc.h"
@@ -865,7 +866,8 @@ static int was_dirty(struct merge_options *opt, const char *path)
865866
{
866867
struct cache_entry *ce;
867868

868-
if (opt->priv->call_depth || !was_tracked(opt, path))
869+
if (opt->priv->call_depth || !was_tracked(opt, path) ||
870+
is_excluded_from_virtualfilesystem(path, strlen(path), DT_REG) == 1)
869871
return 0;
870872

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

0 commit comments

Comments
 (0)