File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,7 @@ export class IsomorphicGit extends GitManager {
197
197
198
198
async commit ( message : string ) : Promise < undefined > {
199
199
try {
200
+ await this . checkAuthorInfo ( ) ;
200
201
this . plugin . setState ( PluginState . commit ) ;
201
202
const formatMessage = await this . formatCommitMessage ( message ) ;
202
203
const hadConflict =
@@ -413,6 +414,8 @@ export class IsomorphicGit extends GitManager {
413
414
await this . fetch ( ) ;
414
415
const branchInfo = await this . branchInfo ( ) ;
415
416
417
+ await this . checkAuthorInfo ( ) ;
418
+
416
419
const mergeRes = await this . wrapFS (
417
420
git . merge ( {
418
421
...this . getRepo ( ) ,
@@ -1033,6 +1036,14 @@ export class IsomorphicGit extends GitManager {
1033
1036
} ;
1034
1037
}
1035
1038
1039
+ private async checkAuthorInfo ( ) : Promise < void > {
1040
+ const name = await this . getConfig ( "user.name" ) ;
1041
+ const email = await this . getConfig ( "user.email" ) ;
1042
+ if ( ! name || ! email ) {
1043
+ throw "Git author information is not set. Please set it in the settings." ;
1044
+ }
1045
+ }
1046
+
1036
1047
private showNotice ( message : string , infinity = true ) : Notice | undefined {
1037
1048
if ( ! this . plugin . settings . disablePopups ) {
1038
1049
return new Notice (
You can’t perform that action at this time.
0 commit comments