File tree 1 file changed +7
-0
lines changed
contrib/filter-repo-demos 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -371,6 +371,7 @@ class BFG_ish:
371
371
bfg_args = self .parse_options ()
372
372
preserve_refs = self .get_preservation_info (bfg_args .preserve_ref_tips )
373
373
374
+ work_dir = os .getcwd ()
374
375
os .chdir (bfg_args .repo )
375
376
bfg_args .delete_files = java_to_fnmatch_glob (bfg_args .delete_files )
376
377
bfg_args .delete_folders = java_to_fnmatch_glob (bfg_args .delete_folders )
@@ -395,6 +396,9 @@ class BFG_ish:
395
396
extra_args += ['--preserve-commit-hashes' ]
396
397
new_replace_file = None
397
398
if bfg_args .replace_text :
399
+ if not os .path .isabs (bfg_args .replace_text ):
400
+ bfg_args .replace_text = os .path .join (work_dir , bfg_args .replace_text )
401
+
398
402
new_replace_file = self .convert_replace_text (bfg_args .replace_text )
399
403
rules = fr .FilteringOptions .get_replace_text (new_replace_file )
400
404
self .replacement_rules = rules
@@ -432,6 +436,9 @@ class BFG_ish:
432
436
if not fr .GitUtils .is_repository_bare ('.' ):
433
437
need_another_reset = True
434
438
439
+ if not os .path .isabs (os .fsdecode (bfg_args .repo )):
440
+ bfg_args .repo = os .fsencode (os .path .join (work_dir , os .fsdecode (bfg_args .repo )))
441
+
435
442
fr .RepoFilter .cleanup (bfg_args .repo , repack = True , reset = need_another_reset )
436
443
437
444
if __name__ == '__main__' :
You can’t perform that action at this time.
0 commit comments