Skip to content

Commit

Permalink
merge-recursive: teach was_dirty() about the virtualfilesystem
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dscho authored and vdye committed Feb 26, 2024
1 parent a6513c4 commit 6207355
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion merge-recursive.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
#include "git-compat-util.h"
#include "merge-recursive.h"
#include "virtualfilesystem.h"

#include "alloc.h"
#include "cache-tree.h"
Expand Down Expand Up @@ -869,7 +870,8 @@ static int was_dirty(struct merge_options *opt, const char *path)
{
struct cache_entry *ce;

if (opt->priv->call_depth || !was_tracked(opt, path))
if (opt->priv->call_depth || !was_tracked(opt, path) ||
is_excluded_from_virtualfilesystem(path, strlen(path), DT_REG) == 1)
return 0;

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

0 comments on commit 6207355

Please sign in to comment.