@@ -52,7 +52,7 @@ def format_float(a, b=1):
5252 main_dir = os .path .join (work_path , 'tree-main' )
5353
5454 lib .set_jobs ('-j' + str (args .j ))
55- result_file = os .path .join (work_path , args .o )
55+ result_file = os .path .abspath ( os . path . join (work_path , args .o ) )
5656 (f , ext ) = os .path .splitext (result_file )
5757 timing_file = f + '_timing' + ext
5858 your_repo_dir = os .path .dirname (os .path .dirname (os .path .abspath (sys .argv [0 ])))
@@ -75,8 +75,7 @@ def format_float(a, b=1):
7575 sys .exit (1 )
7676
7777 try :
78- os .chdir (your_repo_dir )
79- commit_id = (subprocess .check_output (['git' , 'merge-base' , 'origin/main' , 'HEAD' ])).strip ().decode ('ascii' )
78+ commit_id = (subprocess .check_output (['git' , 'merge-base' , 'origin/main' , 'HEAD' ], cwd = your_repo_dir )).strip ().decode ('ascii' )
8079 with open (result_file , 'a' ) as myfile :
8180 myfile .write ('Common ancestor: ' + commit_id + '\n \n ' )
8281 package_width = '140'
@@ -85,7 +84,6 @@ def format_float(a, b=1):
8584 myfile .write ('{:{package_width}} {:{timing_width}} {:{timing_width}} {:{timing_width}}\n ' .format (
8685 'Package' , 'main' , 'your' , 'Factor' , package_width = package_width , timing_width = timing_width ))
8786
88- os .chdir (main_dir )
8987 subprocess .check_call (['git' , 'fetch' , '--depth=1' , 'origin' , commit_id ])
9088 subprocess .check_call (['git' , 'checkout' , '-f' , commit_id ])
9189 except BaseException as e :
0 commit comments