fix(init): use correct gitRef in error message, remove unused var

Small fixes from code review:
- Error message now shows actual gitRef instead of hardcoded HEAD
- Removed unused lineNum variable in readFirstIssueFromGit

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-05 14:51:32 -08:00
parent 0d2dc53c67
commit ce119551f6
2 changed files with 1 additions and 3 deletions

View File

@@ -50,7 +50,7 @@ func checkAndAutoImport(ctx context.Context, store storage.Storage) bool {
if err := importFromGit(ctx, dbPath, store, jsonlPath, gitRef); err != nil {
if !jsonOutput {
fmt.Fprintf(os.Stderr, "Warning: auto-import failed: %v\n", err)
fmt.Fprintf(os.Stderr, "Try manually: git show HEAD:%s | bd import -i /dev/stdin\n", jsonlPath)
fmt.Fprintf(os.Stderr, "Try manually: git show %s:%s | bd import -i /dev/stdin\n", gitRef, jsonlPath)
}
return false
}

View File

@@ -1220,9 +1220,7 @@ func readFirstIssueFromGit(jsonlPath, gitRef string) (*types.Issue, error) {
}
scanner := bufio.NewScanner(bytes.NewReader(output))
lineNum := 0
for scanner.Scan() {
lineNum++
line := scanner.Text()
// skip empty lines