fix: Resolve false positive merge conflict detection in auto-import
- Changed from substring matching to standalone line detection - Only flags actual Git conflict markers on their own lines - Prevents false alarms from conflict markers in issue descriptions - Fixes bd-313 Amp-Thread-ID: https://ampcode.com/threads/T-2acdebf1-e4ce-4534-8538-4e7c4fb84232 Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -210,9 +210,13 @@ func autoImportIfNewer() {
|
||||
}
|
||||
|
||||
// Check for Git merge conflict markers (bd-270)
|
||||
conflictMarkers := []string{"<<<<<<< ", "=======", ">>>>>>> "}
|
||||
for _, marker := range conflictMarkers {
|
||||
if bytes.Contains(jsonlData, []byte(marker)) {
|
||||
// Only match if they appear as standalone lines (not embedded in JSON strings)
|
||||
lines := bytes.Split(jsonlData, []byte("\n"))
|
||||
for _, line := range lines {
|
||||
trimmed := bytes.TrimSpace(line)
|
||||
if bytes.HasPrefix(trimmed, []byte("<<<<<<< ")) ||
|
||||
bytes.Equal(trimmed, []byte("=======")) ||
|
||||
bytes.HasPrefix(trimmed, []byte(">>>>>>> ")) {
|
||||
fmt.Fprintf(os.Stderr, "\n❌ Git merge conflict detected in %s\n\n", jsonlPath)
|
||||
fmt.Fprintf(os.Stderr, "The JSONL file contains unresolved merge conflict markers.\n")
|
||||
fmt.Fprintf(os.Stderr, "This prevents auto-import from loading your issues.\n\n")
|
||||
|
||||
Reference in New Issue
Block a user