commit: don't check for space twice when looking for header