Skip to content

Commit ab8b532

Browse files
dschovdye
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 0b50bb8 commit ab8b532

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"
@@ -872,7 +873,8 @@ static int was_dirty(struct merge_options *opt, const char *path)
872873
{
873874
struct cache_entry *ce;
874875

875-
if (opt->priv->call_depth || !was_tracked(opt, path))
876+
if (opt->priv->call_depth || !was_tracked(opt, path) ||
877+
is_excluded_from_virtualfilesystem(path, strlen(path), DT_REG) == 1)
876878
return 0;
877879

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

0 commit comments

Comments
 (0)