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 1
1
import argparse
2
2
import logging
3
3
import sys
4
+ from pathlib import Path
4
5
from functools import partial
5
6
from types import TracebackType
6
7
from typing import List
64
65
},
65
66
{
66
67
"name" : "--write-message-to-file" ,
68
+ "type" : Path ,
67
69
"metavar" : "FILE_PATH" ,
68
70
"help" : "write message to file before commiting (can be combined with --dry-run)" ,
69
71
},
Original file line number Diff line number Diff line change @@ -69,12 +69,8 @@ def __call__(self):
69
69
if git .is_staging_clean () and not dry_run :
70
70
raise NothingToCommitError ("No files added to staging!" )
71
71
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" )
78
74
79
75
retry : bool = self .arguments .get ("retry" )
80
76
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments