diff options
| author | eric sciple <ericsciple@users.noreply.github.com> | 2025-12-01 19:53:23 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-01 19:53:23 -0600 |
| commit | 14ac173bcffd0a72b08b5c47ca0799029f862682 (patch) | |
| tree | 3c41f524f02f19dbd73a805de9876f869f9d9ef2 /src/git-auth-helper.ts | |
| parent | f6ce9b5969c590f55c04bf74f2f14b53e26a26fb (diff) | |
Add worktree support for persist-credentials includeIf (#2327)
Diffstat (limited to 'src/git-auth-helper.ts')
| -rw-r--r-- | src/git-auth-helper.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/git-auth-helper.ts b/src/git-auth-helper.ts index a1950a6..e67db14 100644 --- a/src/git-auth-helper.ts +++ b/src/git-auth-helper.ts @@ -374,6 +374,10 @@ class GitAuthHelper { const hostIncludeKey = `includeIf.gitdir:${gitDir}.path` await this.git.config(hostIncludeKey, credentialsConfigPath) + // Configure host includeIf for worktrees + const hostWorktreeIncludeKey = `includeIf.gitdir:${gitDir}/worktrees/*.path` + await this.git.config(hostWorktreeIncludeKey, credentialsConfigPath) + // Container git directory const workingDirectory = this.git.getWorkingDirectory() const githubWorkspace = process.env['GITHUB_WORKSPACE'] @@ -395,6 +399,13 @@ class GitAuthHelper { // Configure container includeIf const containerIncludeKey = `includeIf.gitdir:${containerGitDir}.path` await this.git.config(containerIncludeKey, containerCredentialsPath) + + // Configure container includeIf for worktrees + const containerWorktreeIncludeKey = `includeIf.gitdir:${containerGitDir}/worktrees/*.path` + await this.git.config( + containerWorktreeIncludeKey, + containerCredentialsPath + ) } } |
