Skip to content

fix: Git - change regexp to be compatible with SHA256 commits (#227281)#317363

Open
PositroniumJS wants to merge 3 commits into
microsoft:mainfrom
PositroniumJS:fix-227281
Open

fix: Git - change regexp to be compatible with SHA256 commits (#227281)#317363
PositroniumJS wants to merge 3 commits into
microsoft:mainfrom
PositroniumJS:fix-227281

Conversation

@PositroniumJS
Copy link
Copy Markdown

Fix #227281

Modify the regexp to look not only for 40-character commit hashes but also 64-character.

Copilot AI review requested due to automatic review settings May 19, 2026 19:10
@PositroniumJS
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@vs-code-engineering
Copy link
Copy Markdown
Contributor

vs-code-engineering Bot commented May 19, 2026

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@lszomoru

Matched files:

  • extensions/git/src/blame.ts
  • extensions/git/src/git.ts
  • extensions/git/src/test/git.test.ts

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the built-in Git extension’s parsing/validation logic to recognize both 40-character (SHA-1) and 64-character (SHA-256) commit hashes, addressing SHA-256 repository issues like truncated commit IDs and incorrect ref parsing.

Changes:

  • Expanded multiple git-output regexes to accept 64-char commit hashes across commit parsing, stashes, blame parsing, refs parsing, and detached HEAD detection.
  • Updated Git blame controller logic to treat 64-char hashes as commit refs when deciding diff/blame behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
extensions/git/src/git.ts Extends core git-output parsing regexes to accept SHA-256 hashes (64 hex chars) in multiple parsing paths.
extensions/git/src/blame.ts Updates commit-ref detection to treat 64-char hashes as commit IDs when computing blame state.

Comment thread extensions/git/src/git.ts Outdated
Comment thread extensions/git/src/git.ts
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread extensions/git/src/blame.ts
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Copy link
Copy Markdown

@YongDo-Hyun YongDo-Hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Git - support for SHA256 repository

4 participants