@@ -52,7 +52,7 @@ def format_float(a, b=1):
52
52
main_dir = os .path .join (work_path , 'tree-main' )
53
53
54
54
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 ) )
56
56
(f , ext ) = os .path .splitext (result_file )
57
57
timing_file = f + '_timing' + ext
58
58
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):
75
75
sys .exit (1 )
76
76
77
77
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' )
80
79
with open (result_file , 'a' ) as myfile :
81
80
myfile .write ('Common ancestor: ' + commit_id + '\n \n ' )
82
81
package_width = '140'
@@ -85,7 +84,6 @@ def format_float(a, b=1):
85
84
myfile .write ('{:{package_width}} {:{timing_width}} {:{timing_width}} {:{timing_width}}\n ' .format (
86
85
'Package' , 'main' , 'your' , 'Factor' , package_width = package_width , timing_width = timing_width ))
87
86
88
- os .chdir (main_dir )
89
87
subprocess .check_call (['git' , 'fetch' , '--depth=1' , 'origin' , commit_id ])
90
88
subprocess .check_call (['git' , 'checkout' , '-f' , commit_id ])
91
89
except BaseException as e :
0 commit comments