Skip to content
This repository was archived by the owner on Mar 24, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions change/change-f0bd1776-bc07-4c5d-b8f9-04a5728eef3b.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"type": "patch",
"comment": "Limit git rev-list to one result",
"packageName": "workspace-tools",
"email": "rsiemens@microsoft.com",
"dependentChangeType": "patch"
}
]
}
4 changes: 2 additions & 2 deletions packages/workspace-tools/src/git/gitUtilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ export function getCurrentHash(cwd: string) {
* Get the commit hash in which the file was first added.
*/
export function getFileAddedHash(filename: string, cwd: string) {
const results = git(["rev-list", "HEAD", filename], { cwd });
const results = git(["rev-list", "--max-count=1", "HEAD", filename], { cwd });

if (results.success) {
return results.stdout.trim().split("\n").slice(-1)[0];
return results.stdout.trim();
}

return undefined;
Expand Down