Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions builtin/history.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ static int fill_commit_message(struct repository *repo,
wt_status_collect_free_buffers(&s);
string_list_clear_func(&s.change, change_data_free);

/*
* Close the handle before launching the editor: on Windows an open
* handle would prevent the editor from replacing the file (e.g.
* BusyBox' `ash` cannot overwrite a file that another process keeps
* open), and leaving it open leaks the descriptor everywhere else.
*/
fclose(s.fp);

strbuf_reset(out);
if (launch_editor(path, out, NULL)) {
fprintf(stderr, _("Aborting commit as launching the editor failed.\n"));
Expand Down
Loading