Skip to content

Commit

Permalink
Merge pull request #3112 from Faithfinder/fix/#3111
Browse files Browse the repository at this point in the history
[rush] Fixes git hooks install error when rush is not at the git root
  • Loading branch information
iclanton authored Dec 25, 2021
2 parents e357802 + 8b644b0 commit 6fd8f3e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/rush-lib/src/logic/Git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,10 @@ export class Git {
}

if (hooksResult.result) {
const absoluteHooksPath: string = path.resolve(repoInfo.root, hooksResult.result);
const absoluteHooksPath: string = path.resolve(
this._rushConfiguration.rushJsonFolder,
hooksResult.result
);
return absoluteHooksPath === defaultHooksPath;
}

Expand Down
10 changes: 10 additions & 0 deletions common/changes/@microsoft/rush/fix--3111_2021-12-24-15-33.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@microsoft/rush",
"comment": "Fix an issue with installing Git hooks that occurs when the rush.json folder isn't at the repo's root.",
"type": "none"
}
],
"packageName": "@microsoft/rush"
}

0 comments on commit 6fd8f3e

Please sign in to comment.