File tree Expand file tree Collapse file tree 3 files changed +4
-9
lines changed Expand file tree Collapse file tree 3 files changed +4
-9
lines changed Original file line number Diff line number Diff line change 11import argparse
22import logging
33import sys
4+ from pathlib import Path
45from functools import partial
56from types import TracebackType
67from typing import List
6465 },
6566 {
6667 "name" : "--write-message-to-file" ,
68+ "type" : Path ,
6769 "metavar" : "FILE_PATH" ,
6870 "help" : "write message to file before commiting (can be combined with --dry-run)" ,
6971 },
Original file line number Diff line number Diff line change @@ -69,12 +69,8 @@ def __call__(self):
6969 if git .is_staging_clean () and not dry_run :
7070 raise NothingToCommitError ("No files added to staging!" )
7171
72- if write_message_to_file is not None :
73- if not isinstance (write_message_to_file , str ):
74- raise NotAllowed (
75- "Commit message file name is broken.\n "
76- "Check the flag `--write-message-to-file` in the terminal"
77- )
72+ if write_message_to_file is not None and write_message_to_file .is_dir ():
73+ raise NotAllowed (f"{ write_message_to_file } is a directory" )
7874
7975 retry : bool = self .arguments .get ("retry" )
8076
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments