def set_commit_editmsg(msg: str) -> Iterator[TextIO]:
filename = 'COMMIT_EDITMSG'
with open(filename, mode='w') as f:
f.write(msg)
try:
yield cast(TextIO, f)
finally:
if os.path.isfile(filename):
os.remove(filename)
评论列表
文章目录