File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -1546,14 +1546,14 @@ impl Patch {
1546
1546
}
1547
1547
}
1548
1548
1549
- pub fn apply ( & self , dir : & Path ) -> Result < ( ) , String > {
1549
+ pub fn apply ( & self , dir : & Path ) -> anyhow :: Result < ( ) > {
1550
1550
log:: debug!( "applying {} to {:?}" , self . name, dir) ;
1551
- let mut cmd = Command :: new ( "patch" ) ;
1552
- cmd. current_dir ( dir ) . args ( & [ "-Np1" , "-i" ] ) . arg ( & * self . path ) ;
1553
- cmd. stdout ( Stdio :: null ( ) ) ;
1554
- if cmd . status ( ) . map ( |s| !s . success ( ) ) . unwrap_or ( false ) {
1555
- return Err ( format ! ( "could not execute {:?}." , cmd) ) ;
1556
- }
1551
+
1552
+ let mut cmd = Command :: new ( "git" ) ;
1553
+ cmd. current_dir ( dir ) . args ( & [ "apply" ] ) . args ( & [ "-Np1" ] ) . arg ( & * self . path ) ;
1554
+
1555
+ command_output ( & mut cmd) ? ;
1556
+
1557
1557
Ok ( ( ) )
1558
1558
}
1559
1559
}
You can’t perform that action at this time.
0 commit comments