-
Notifications
You must be signed in to change notification settings - Fork 34.9k
Open
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable buggitGIT issuesGIT issues
Milestone
Description
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.101.2
- OS Version: Microsoft Windows [Version 10.0.26120.4520]
Steps to Reproduce
Run the commands:
> mkdir test_repo
> cd test_repo\
> git init
Initialized empty Git repository in [path]
> git config --local user.name 'Test "Quoted" Name'
> git config --local user.email '[email protected]'
> touch test_file
> git add .
> git commit -m "Test commit"
[main (root-commit) 56543c4] Test commit
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 test_file
> code .
>
Then go to "Source Control > Graph", hover over the commit and observe the poorly-rendered mailto:
links and names.

Extra notes
The problem might be that the Markdown to be rendered is directly interpolated without special quoting for the "author" and "email" fields:
vscode/extensions/git/src/timelineProvider.ts
Lines 57 to 70 in 8e55c8d
setItemDetails(uri: Uri, hash: string | undefined, shortHash: string | undefined, avatar: string | undefined, author: string, email: string | undefined, date: string, message: string, shortStat?: CommitShortStat, remoteSourceCommands: Command[] = []): void { | |
this.tooltip = new MarkdownString('', true); | |
this.tooltip.isTrusted = true; | |
const avatarMarkdown = avatar | |
? `` | |
: '$(account)'; | |
if (email) { | |
const emailTitle = l10n.t('Email'); | |
this.tooltip.appendMarkdown(`${avatarMarkdown} [**${author}**](mailto:${email} "${emailTitle} ${author}")`); | |
} else { | |
this.tooltip.appendMarkdown(`${avatarMarkdown} **${author}**`); | |
} |
If we modify the author name to be a image link, e.g. Test 
, we can make VSCode render an image in the author line.
> git config --local user.name 'Test '
> touch test_1
> git add .
> git commit -m "Test commit 1"
[main d6d0054] Test commit 1
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 test_1
> code .
>

Edit: Since vscode.git
is built-in, disabling all extensions does not invalidate this issue.
Metadata
Metadata
Assignees
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable buggitGIT issuesGIT issues