Skip to content

Commit 9931e2f

Browse files
authored
Confirm identity validity (#1360)
1 parent bb5ced6 commit 9931e2f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/components/GitPanel.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -846,17 +846,22 @@ export class GitPanel extends React.Component<IGitPanelProps, IGitPanelState> {
846846
return null;
847847
}
848848

849-
// If the repository path changes or explicitly configured, check the user identity
849+
const isIdentityValid =
850+
!!this.props.model.lastAuthor?.name &&
851+
!!this.props.model.lastAuthor?.email;
852+
853+
// If the repository path changes, is explicitly configured, or the last authors identity is invalid check the user identity
850854
if (
851855
path !== this._previousRepoPath ||
852-
this.props.settings.composite['promptUserIdentity']
856+
this.props.settings.composite['promptUserIdentity'] ||
857+
!isIdentityValid
853858
) {
854859
try {
855860
let userOrEmailNotSet = false;
856861
let author: Git.IIdentity | null;
857862
let authorOverride: string | null = null;
858863

859-
if (this.props.model.lastAuthor === null) {
864+
if (this.props.model.lastAuthor === null || !isIdentityValid) {
860865
const data: JSONObject = (await this.props.model.config()) as any;
861866
const options: JSONObject = data['options'] as JSONObject;
862867

0 commit comments

Comments
 (0)