Skip to content

Commit bbfe83c

Browse files
committed
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 d762feb + 5fd767a commit bbfe83c

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
@@ -28,6 +28,7 @@
2828
#include "submodule.h"
2929
#include "revision.h"
3030
#include "commit-reach.h"
31+
#include "virtualfilesystem.h"
3132

3233
struct path_hashmap_entry {
3334
struct hashmap_entry e;
@@ -846,15 +847,14 @@ static int would_lose_untracked(struct merge_options *opt, const char *path)
846847
static int was_dirty(struct merge_options *opt, const char *path)
847848
{
848849
struct cache_entry *ce;
849-
int dirty = 1;
850850

851-
if (opt->call_depth || !was_tracked(opt, path))
852-
return !dirty;
851+
if (opt->call_depth || !was_tracked(opt, path) ||
852+
is_excluded_from_virtualfilesystem(path, strlen(path), DT_REG) == 1)
853+
return 0;
853854

854855
ce = index_file_exists(opt->unpack_opts.src_index,
855856
path, strlen(path), ignore_case);
856-
dirty = verify_uptodate(ce, &opt->unpack_opts) != 0;
857-
return dirty;
857+
return !ce || verify_uptodate(ce, &opt->unpack_opts) != 0;
858858
}
859859

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

0 commit comments

Comments
 (0)