GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: handle symlinked .git directories · lint-staged/lint-staged@3a897ff

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • resolveGitRepo.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/resolveGitRepo.js‎

Copy file name to clipboardExpand all lines: lib/resolveGitRepo.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ const debugLog = debug('lint-staged:resolveGitRepo')
1414
* submodules and worktrees
1515
*/
1616
const resolveGitConfigDir = async (gitDir) => {
17-
const defaultDir = normalize(path.join(gitDir, '.git'))
17+
// Get the real path in case it's a symlink
18+
const defaultDir = normalize(await fs.realpath(path.join(gitDir, '.git')))
1819
const stats = await fs.lstat(defaultDir)
1920
// If .git is a directory, use it
2021
if (stats.isDirectory()) return defaultDir

0 commit comments

Comments
0 (0)
You are visitor 01402605 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.