Skip to content

Commit c1ca3d2

Browse files
committed
Merge branch 'munmap-before-ext-diff'
This topic branch fixes the usage pattern where files are still held open with an exclusive lock when an external program is asked to open those very same files. Signed-off-by: Johannes Schindelin <[email protected]>
2 parents 6df9631 + a09578b commit c1ca3d2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

diff.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4190,6 +4190,10 @@ static void run_external_diff(const char *pgm,
41904190
argv_array_pushf(&env, "GIT_DIFF_PATH_COUNTER=%d", ++o->diff_path_counter);
41914191
argv_array_pushf(&env, "GIT_DIFF_PATH_TOTAL=%d", q->nr);
41924192

4193+
if (one && one->should_munmap)
4194+
diff_free_filespec_data(one);
4195+
if (two && two->should_munmap)
4196+
diff_free_filespec_data(two);
41934197
if (run_command_v_opt_cd_env(argv.argv, RUN_USING_SHELL, NULL, env.argv))
41944198
die(_("external diff died, stopping at %s"), name);
41954199

0 commit comments

Comments
 (0)