Skip to content

Commit 143b046

Browse files
dschoderrickstolee
authored andcommitted
Merge branch 'virtualfilesystem-and-merge-recursive'
The major work on merge-recursive.c that went into v2.21.0 necessitates an adjustment to work well with VFSforGit's virtualfilesystem hook.
2 parents cdfc945 + fcc1e45 commit 143b046

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

merge-recursive.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "tree-walk.h"
3030
#include "unpack-trees.h"
3131
#include "xdiff-interface.h"
32+
#include "virtualfilesystem.h"
3233

3334
struct merge_options_internal {
3435
int call_depth;
@@ -857,15 +858,14 @@ static int would_lose_untracked(struct merge_options *opt, const char *path)
857858
static int was_dirty(struct merge_options *opt, const char *path)
858859
{
859860
struct cache_entry *ce;
860-
int dirty = 1;
861861

862-
if (opt->priv->call_depth || !was_tracked(opt, path))
863-
return !dirty;
862+
if (opt->priv->call_depth || !was_tracked(opt, path) ||
863+
is_excluded_from_virtualfilesystem(path, strlen(path), DT_REG) == 1)
864+
return 0;
864865

865866
ce = index_file_exists(opt->priv->unpack_opts.src_index,
866867
path, strlen(path), ignore_case);
867-
dirty = verify_uptodate(ce, &opt->priv->unpack_opts) != 0;
868-
return dirty;
868+
return !ce || verify_uptodate(ce, &opt->priv->unpack_opts) != 0;
869869
}
870870

871871
static int make_room_for_path(struct merge_options *opt, const char *path)

0 commit comments

Comments
 (0)