Skip to content

Commit 35a4612

Browse files
committed
Merge branch 'long-paths'
2 parents 47a54f0 + 2b7234f commit 35a4612

29 files changed

+1674
-122
lines changed

Documentation/config/core.adoc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,19 @@ relatively high IO latencies. When enabled, Git will do the
685685
index comparison to the filesystem data in parallel, allowing
686686
overlapping IO's. Defaults to true.
687687

688+
core.fscache::
689+
Enable additional caching of file system data for some operations.
690+
+
691+
Git for Windows uses this to bulk-read and cache lstat data of entire
692+
directories (instead of doing lstat file by file).
693+
694+
core.longpaths::
695+
Enable long path (> 260) support for builtin commands in Git for
696+
Windows. This is disabled by default, as long paths are not supported
697+
by Windows Explorer, cmd.exe and the Git for Windows tool chain
698+
(msys, bash, tcl, perl...). Only enable this if you know what you're
699+
doing and are prepared to live with a few quirks.
700+
688701
core.unsetenvvars::
689702
Windows-only: comma-separated list of environment variables'
690703
names that need to be unset before spawning any other process.

builtin/add.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,10 @@ int cmd_add(int argc,
477477
die_in_unpopulated_submodule(repo->index, prefix);
478478
die_path_inside_submodule(repo->index, &pathspec);
479479

480+
enable_fscache(0);
481+
/* We do not really re-read the index but update the up-to-date flags */
482+
preload_index(repo->index, &pathspec, 0);
483+
480484
if (add_new_files) {
481485
int baselen;
482486

@@ -589,5 +593,6 @@ int cmd_add(int argc,
589593
free(ps_matched);
590594
dir_clear(&dir);
591595
clear_pathspec(&pathspec);
596+
enable_fscache(0);
592597
return exit_status;
593598
}

builtin/checkout.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ static int checkout_worktree(const struct checkout_opts *opts,
407407
if (pc_workers > 1)
408408
init_parallel_checkout();
409409

410+
enable_fscache(the_repository->index->cache_nr);
410411
for (pos = 0; pos < the_repository->index->cache_nr; pos++) {
411412
struct cache_entry *ce = the_repository->index->cache[pos];
412413
if (ce->ce_flags & CE_MATCHED) {
@@ -432,6 +433,7 @@ static int checkout_worktree(const struct checkout_opts *opts,
432433
errs |= run_parallel_checkout(&state, pc_workers, pc_threshold,
433434
NULL, NULL);
434435
mem_pool_discard(&ce_mem_pool, should_validate_cache_entries());
436+
disable_fscache();
435437
remove_marked_cache_entries(the_repository->index, 1);
436438
remove_scheduled_dirs();
437439
errs |= finish_delayed_checkout(&state, opts->show_progress);

builtin/clean.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,7 @@ int cmd_clean(int argc,
10431043

10441044
if (repo_read_index(the_repository) < 0)
10451045
die(_("index file corrupt"));
1046+
enable_fscache(the_repository->index->cache_nr);
10461047

10471048
pl = add_pattern_list(&dir, EXC_CMDL, "--exclude option");
10481049
for (i = 0; i < exclude_list.nr; i++)
@@ -1117,6 +1118,7 @@ int cmd_clean(int argc,
11171118
}
11181119
}
11191120

1121+
disable_fscache();
11201122
strbuf_release(&abs_path);
11211123
strbuf_release(&buf);
11221124
string_list_clear(&del_list, 0);

builtin/commit.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,6 +1583,7 @@ struct repository *repo UNUSED)
15831583
PATHSPEC_PREFER_FULL,
15841584
prefix, argv);
15851585

1586+
enable_fscache(0);
15861587
if (status_format != STATUS_FORMAT_PORCELAIN &&
15871588
status_format != STATUS_FORMAT_PORCELAIN_V2)
15881589
progress_flag = REFRESH_PROGRESS;
@@ -1623,6 +1624,7 @@ struct repository *repo UNUSED)
16231624
wt_status_print(&s);
16241625
wt_status_collect_free_buffers(&s);
16251626

1627+
disable_fscache();
16261628
return 0;
16271629
}
16281630

0 commit comments

Comments
 (0)