Page MenuHomePhabricator

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

Authored by martinvonz on Mon, Nov 16, 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.Mon, Nov 16, 2:10 PM
durin42 requested changes to this revision.Wed, Nov 18, 5:49 PM

Needs rebased.

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

Needs rebased.

Done

pulkit accepted this revision.Sat, Nov 21, 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.