@@ -86,17 +86,21 @@ public string Describe(string options)
8686 throw new ApplicationException ( "Unable to describe commit" ) ;
8787 }
8888
89- public string CommitTree ( string treeRef , IEnumerable < string > parentRefs , string message )
89+ public string CommitTree ( string authorName , string authorEmail , string treeRef , IEnumerable < string > parentRefs , string message )
9090 {
9191 var tempFile = Path . GetTempFileName ( ) ;
9292 File . WriteAllText ( tempFile , message ) ;
9393 try {
94+ Environment . SetEnvironmentVariable ( "GIT_AUTHOR_NAME" , authorName ) ;
95+ Environment . SetEnvironmentVariable ( "GIT_AUTHOR_EMAIL" , authorEmail ) ;
96+ Environment . SetEnvironmentVariable ( "GIT_COMMITTER_NAME" , authorName ) ;
97+ Environment . SetEnvironmentVariable ( "GIT_COMMITTER_EMAIL" , authorEmail ) ;
9498 var parents = String . Join ( " " , parentRefs . Select ( parentRef => $ "-p { parentRef } ") ) ;
9599 foreach ( var line in GetCommandOutput ( $ "commit-tree { treeRef } { parents } -F { tempFile } ") )
96100 {
97101 return line ;
98102 }
99- throw new ApplicationException ( "Unable to describe commit" ) ;
103+ throw new ApplicationException ( "Unable to commit tree " ) ;
100104 }
101105 finally
102106 {
@@ -113,7 +117,7 @@ public DateTimeOffset GetCommitDate(string reference)
113117 return DateTimeOffset . FromUnixTimeSeconds ( long . Parse ( line . Split ( "> " ) [ 1 ] . Split ( " " ) [ 0 ] ) ) ;
114118 }
115119 }
116- throw new ApplicationException ( "Unable to describe commit" ) ;
120+ throw new ApplicationException ( "Unable to get commit date " ) ;
117121 }
118122
119123 public void SetBranchRef ( string branch , string reference )
0 commit comments