File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -98,8 +98,8 @@ pub(crate) struct GitContext {
9898
9999impl GitContext {
100100 pub ( crate ) fn from_dir ( path : & PathBuf ) -> Result < Self > {
101- let commit = git_cmd ( path, & [ "rev-parse" , "HEAD" ] ) ?;
102- let tree = git_cmd ( path, & [ "rev-parse" , "HEAD^{tree}" ] ) ?;
101+ let commit = git_cmd ( path, & [ "rev-parse" , "HEAD" , "--" ] ) ?;
102+ let tree = git_cmd ( path, & [ "rev-parse" , "HEAD^{tree}" , "--" ] ) ?;
103103 let source_uri = git_cmd ( path, & [ "remote" , "get-url" , "origin" ] ) . unwrap_or_default ( ) ;
104104 Ok ( Self {
105105 commit,
@@ -400,7 +400,18 @@ mod tests {
400400 . output ( )
401401 . unwrap ( ) ;
402402 std:: process:: Command :: new ( "git" )
403- . args ( [ "commit" , "--allow-empty" , "-m" , "init" ] )
403+ . args ( [ "config" , "user.email" , "kettle-ci@lunal.dev" ] )
404+ . current_dir ( tmp. path ( ) )
405+ . output ( )
406+ . unwrap ( ) ;
407+ std:: process:: Command :: new ( "git" )
408+ . args ( [
409+ "commit" ,
410+ "--author='Kettle CI <kettle-ci@lunal.dev>'" ,
411+ "--allow-empty" ,
412+ "-m" ,
413+ "init" ,
414+ ] )
404415 . current_dir ( tmp. path ( ) )
405416 . output ( )
406417 . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments