able to handle the case if the last commit message do not key in newline