From 340b3507b93c13a007265f12927679b0b08f626d Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Wed, 26 Nov 2025 19:06:50 -0800 Subject: [PATCH] fix: expand tilde in global gitignore path from git config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git config --global core.excludesfile may return paths like ~/... which Go does not expand. This caused setupGlobalGitIgnore to fail when users had configured their gitignore with a tilde path. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- cmd/bd/init.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/bd/init.go b/cmd/bd/init.go index 4ebbdd18..aa485316 100644 --- a/cmd/bd/init.go +++ b/cmd/bd/init.go @@ -1198,6 +1198,14 @@ func setupGlobalGitIgnore(homeDir string, verbose bool) error { if err == nil && len(output) > 0 { // User has already configured a global gitignore file, use it ignorePath = strings.TrimSpace(string(output)) + + // Expand tilde if present (git config may return ~/... which Go doesn't expand) + if strings.HasPrefix(ignorePath, "~/") { + ignorePath = filepath.Join(homeDir, ignorePath[2:]) + } else if ignorePath == "~" { + ignorePath = homeDir + } + if verbose { fmt.Printf("Using existing configured global gitignore file: %s\n", ignorePath) }