From 9931e2f5fb40ab714bdd55beb19040a72cc44c90 Mon Sep 17 00:00:00 2001 From: Greg Mooney Date: Tue, 22 Oct 2024 15:08:13 +0200 Subject: [PATCH] Confirm identity validity (#1360) --- src/components/GitPanel.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/GitPanel.tsx b/src/components/GitPanel.tsx index 184a35a2..4fd1dd03 100644 --- a/src/components/GitPanel.tsx +++ b/src/components/GitPanel.tsx @@ -846,17 +846,22 @@ export class GitPanel extends React.Component { return null; } - // If the repository path changes or explicitly configured, check the user identity + const isIdentityValid = + !!this.props.model.lastAuthor?.name && + !!this.props.model.lastAuthor?.email; + + // If the repository path changes, is explicitly configured, or the last authors identity is invalid check the user identity if ( path !== this._previousRepoPath || - this.props.settings.composite['promptUserIdentity'] + this.props.settings.composite['promptUserIdentity'] || + !isIdentityValid ) { try { let userOrEmailNotSet = false; let author: Git.IIdentity | null; let authorOverride: string | null = null; - if (this.props.model.lastAuthor === null) { + if (this.props.model.lastAuthor === null || !isIdentityValid) { const data: JSONObject = (await this.props.model.config()) as any; const options: JSONObject = data['options'] as JSONObject;