bash: Refactor function `_edit_last_committed_files`