We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 06fa059 commit dc012d2Copy full SHA for dc012d2
contrib/filter-repo-demos/bfg-ish
@@ -174,6 +174,19 @@ class BFG_ish:
174
help=("file path for Git repository to clean"))
175
176
args = parser.parse_args()
177
+
178
+ # Sanity check on args.repo
179
+ if not os.path.isdir(args.repo):
180
+ raise SystemExit("Repo not found: {}".format(os.fsdecode(args.repo)))
181
+ dirname, basename = os.path.split(args.repo)
182
+ if not basename:
183
+ dirname, basename = os.path.split(dirname)
184
+ if not dirname:
185
+ dirname = b'.'
186
+ if basename == b".git":
187
+ raise SystemExit("For non-bare repos, please specify the toplevel directory ({}) for repo"
188
+ .format(os.fsdecode(dirname)))
189
190
return args
191
192
def convert_replace_text(self, filename):
0 commit comments