Skip to content

fix: git clone now lets you select an account

Tomas Vik requested to merge tv/2023-10/fix-git-clone into main

Description

This MR fixes Git: Clone behaviour where the credential helper picks the first account for the instance instead of letting the user choose. That made the feature almost unusable when a person has two accounts for the same GitLab instance. This scenario is not common.

git-clone-select-account

This MR is part of my ongoing crusade against the AccountService.getOneAccountForInstance() e.g. !1056 (merged)

How has this been tested?

See the screencast from above.

  1. ensure you don't have any credentials for gitlab.com already stored in your OS Keychain
  2. add two accounts to your VS Code Extension, both for gitlab.com
  3. run Git: Clone command
  4. select one account to use for searching repositories
  5. then select the same account when asked for it

This is not optimal, but the CredentialProvider interface only receives the URI so it can't know which account was used to find the project in the first place. That's why the user has to select the account twice 😞

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation
  • Chore (Related to CI or Packaging to platforms)
  • Test gap
Edited by Tomas Vik

Merge request reports

Loading