@@ -55,17 +55,20 @@ def process_files_with_git_batch(json_files, output_dir, verbose, predocs):
5555 print (f"Fel vid läsning av { abs_json_file } : { e } " )
5656 continue
5757
58- # Create documents in the cloned repository
59- make_document (data , output_dir , ["git" ], True , verbose , True , predocs , True )
58+ # Create documents in the cloned repository AND save to original output directory
59+ # First convert to absolute path since we changed working directory
60+ original_output_dir = Path (original_cwd ) / Path (output_dir ).name if not Path (output_dir ).is_absolute () else Path (output_dir )
61+ make_document (data , original_output_dir , ["git" ], True , verbose , True , predocs , True )
6062
6163 # Push all commits to target repository
6264 if verbose :
6365 print (f"Pushar batch till target repository..." )
6466
65- subprocess .run (['git' , 'push' , 'origin' , unique_branch ],
66- check = True , capture_output = True , timeout = GIT_TIMEOUT )
67-
68- print (f"Batch pushad till target repository som branch '{ unique_branch } '" )
67+ from exporters .git .git_utils import push_to_target_repository
68+ if push_to_target_repository (unique_branch , 'origin' , verbose ):
69+ print (f"Batch pushad till target repository som branch '{ unique_branch } '" )
70+ else :
71+ print (f"Misslyckades med att pusha batch till target repository" )
6972
7073 except subprocess .CalledProcessError as e :
7174 print (f"Fel vid git batch processing: { e } " )
0 commit comments