File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,11 @@ pub fn scripted_fixture_repo_read_only_with_args(
127
127
git_lock:: acquire:: Fail :: AfterDurationWithBackoff ( Duration :: from_secs ( 5 ) ) ,
128
128
None ,
129
129
) ?;
130
- if !script_result_directory. is_dir ( ) {
130
+ let failure_marker = script_result_directory. join ( "_invalid_state_due_to_script_failure_" ) ;
131
+ if !script_result_directory. is_dir ( ) || failure_marker. is_file ( ) {
132
+ if failure_marker. is_file ( ) {
133
+ std:: fs:: remove_dir_all ( & script_result_directory) ?;
134
+ }
131
135
std:: fs:: create_dir_all ( & script_result_directory) ?;
132
136
match extract_archive ( & archive_file_path, & script_result_directory, script_identity) {
133
137
Ok ( ( archive_id, platform) ) => {
@@ -168,6 +172,9 @@ pub fn scripted_fixture_repo_read_only_with_args(
168
172
. env ( "GIT_CONFIG_KEY_1" , "init.defaultBranch" )
169
173
. env ( "GIT_CONFIG_VALUE_1" , "main" )
170
174
. output ( ) ?;
175
+ if !output. status . success ( ) {
176
+ std:: fs:: write ( failure_marker, & [ ] ) . ok ( ) ;
177
+ }
171
178
assert ! (
172
179
output. status. success( ) ,
173
180
"repo script failed: stdout: {}\n stderr: {}" ,
You can’t perform that action at this time.
0 commit comments