Skip to content

Commit a14ed48

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 26e35d4 + f75f283 commit a14ed48

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;
@@ -844,15 +845,14 @@ static int would_lose_untracked(struct merge_options *opt, const char *path)
844845
static int was_dirty(struct merge_options *opt, const char *path)
845846
{
846847
struct cache_entry *ce;
847-
int dirty = 1;
848848

849-
if (opt->call_depth || !was_tracked(opt, path))
850-
return !dirty;
849+
if (opt->call_depth || !was_tracked(opt, path) ||
850+
is_excluded_from_virtualfilesystem(path, strlen(path), DT_REG) == 1)
851+
return 0;
851852

852853
ce = index_file_exists(opt->unpack_opts.src_index,
853854
path, strlen(path), ignore_case);
854-
dirty = verify_uptodate(ce, &opt->unpack_opts) != 0;
855-
return dirty;
855+
return !ce || verify_uptodate(ce, &opt->unpack_opts) != 0;
856856
}
857857

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

0 commit comments

Comments
 (0)