@@ -16,11 +16,16 @@ public Project(string gitPath)
1616 GitPath = gitPath ;
1717 }
1818
19- public void Init ( string repository )
19+ public void Init ( string repository , string authorName , string authorEmail )
2020 {
2121 if ( ! Directory . Exists ( GitPath ) ) Directory . CreateDirectory ( GitPath ) ;
2222 if ( ! File . Exists ( Path . Join ( GitPath , ".git" , "config" ) ) ) RunCommand ( $ "init") ;
2323
24+ Environment . SetEnvironmentVariable ( "GIT_AUTHOR_NAME" , authorName ) ;
25+ Environment . SetEnvironmentVariable ( "GIT_AUTHOR_EMAIL" , authorEmail ) ;
26+ Environment . SetEnvironmentVariable ( "GIT_COMMITTER_NAME" , authorName ) ;
27+ Environment . SetEnvironmentVariable ( "GIT_COMMITTER_EMAIL" , authorEmail ) ;
28+
2429 RunCommandIgnoreErrors ( $ "config remove-section remote.origin") ;
2530 RunCommand ( $ "remote add origin --mirror=fetch { repository } ") ;
2631 }
@@ -97,16 +102,12 @@ public string Describe(string options)
97102 throw new ApplicationException ( "Unable to describe commit" ) ;
98103 }
99104
100- public string CommitTree ( string authorName , string authorEmail , string treeRef , IEnumerable < string > parentRefs , string message )
105+ public string CommitTree ( string treeRef , IEnumerable < string > parentRefs , string message )
101106 {
102107 var tempFile = Path . GetTempFileName ( ) ;
103108 File . WriteAllText ( tempFile , message ) ;
104109 try
105110 {
106- Environment . SetEnvironmentVariable ( "GIT_AUTHOR_NAME" , authorName ) ;
107- Environment . SetEnvironmentVariable ( "GIT_AUTHOR_EMAIL" , authorEmail ) ;
108- Environment . SetEnvironmentVariable ( "GIT_COMMITTER_NAME" , authorName ) ;
109- Environment . SetEnvironmentVariable ( "GIT_COMMITTER_EMAIL" , authorEmail ) ;
110111 var parents = String . Join ( " " , parentRefs . Select ( parentRef => $ "-p { parentRef } ") ) ;
111112 foreach ( var line in GetCommandOutput ( $ "commit-tree { treeRef } { parents } -F { tempFile } ") )
112113 {
0 commit comments