This is an archive of the discontinued Mercurial Phabricator instance.

histedit: don't crash if commit message is empty
ClosedPublic

Authored by martinvonz on Nov 16 2020, 2:10 PM.

Details

Summary

If the commit message is empty, histedit will crash before this patch
because it assumes that summary.splitlines() is non-empty. One of
our users at work ran into this crash for a commit that was created by
an internal system.

I don't think we have a good way of testing this because it's hard to
create a commit with an empty commit message. I've added a comment to
help prevent regressions.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

martinvonz created this revision.Nov 16 2020, 2:10 PM
durin42 requested changes to this revision.Nov 18 2020, 5:49 PM

Needs rebased.

This revision now requires changes to proceed.Nov 18 2020, 5:49 PM
martinvonz updated this revision to Diff 23557.Nov 19 2020, 1:54 AM

Needs rebased.

Done

pulkit accepted this revision.Nov 21 2020, 2:26 AM
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.