@@ -38,6 +38,21 @@ fn record(
38
38
aid : database:: ArtifactIdNumber ,
39
39
) -> anyhow:: Result < ( ) > {
40
40
let checkout = Path :: new ( "rust" ) ;
41
+ let status = Command :: new ( "git" )
42
+ . current_dir ( "rust" )
43
+ . arg ( "reset" )
44
+ . arg ( "--hard" )
45
+ . arg ( "origin/master" )
46
+ . status ( )
47
+ . context ( "git reset --hard origin/master" ) ?;
48
+ assert ! ( status. success( ) , "git reset --hard successful" ) ;
49
+ let status = Command :: new ( "git" )
50
+ . current_dir ( "rust" )
51
+ . arg ( "clean" )
52
+ . arg ( "-fxd" )
53
+ . status ( )
54
+ . context ( "git clean -fxd" ) ?;
55
+ assert ! ( status. success( ) , "git clean -fxd successful" ) ;
41
56
42
57
// Configure the compiler we're given as the one to use.
43
58
let status = Command :: new (
@@ -121,21 +136,6 @@ fn checkout() -> anyhow::Result<()> {
121
136
. status ( )
122
137
. context ( "git fetch origin" ) ?;
123
138
assert ! ( status. success( ) , "git fetch successful" ) ;
124
- let status = Command :: new ( "git" )
125
- . current_dir ( "rust" )
126
- . arg ( "reset" )
127
- . arg ( "--hard" )
128
- . arg ( "origin/master" )
129
- . status ( )
130
- . context ( "git reset --hard origin/master" ) ?;
131
- assert ! ( status. success( ) , "git reset --hard successful" ) ;
132
- let status = Command :: new ( "git" )
133
- . current_dir ( "rust" )
134
- . arg ( "clean" )
135
- . arg ( "-fxd" )
136
- . status ( )
137
- . context ( "git clean -fxd" ) ?;
138
- assert ! ( status. success( ) , "git clean -fxd successful" ) ;
139
139
} else {
140
140
let status = Command :: new ( "git" )
141
141
. arg ( "clone" )
0 commit comments