Skip to content

Commit

Permalink
Confirm identity validity
Browse files Browse the repository at this point in the history
  • Loading branch information
gjmooney committed Oct 22, 2024
1 parent bb5ced6 commit a456e06
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/components/GitPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -846,17 +846,22 @@ export class GitPanel extends React.Component<IGitPanelProps, IGitPanelState> {
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;

Expand Down

0 comments on commit a456e06

Please sign in to comment.