fix: Git - change regexp to be compatible with SHA256 commits (#227281)#317363
Open
PositroniumJS wants to merge 3 commits into
Open
fix: Git - change regexp to be compatible with SHA256 commits (#227281)#317363PositroniumJS wants to merge 3 commits into
PositroniumJS wants to merge 3 commits into
Conversation
Author
|
@microsoft-github-policy-service agree |
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @lszomoruMatched files:
|
Contributor
There was a problem hiding this comment.
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #227281
Modify the regexp to look not only for 40-character commit hashes but also 64-character.