beads/internal/storage/versioncontrolops
Robin Carswell a097723f28
fix: suppress auto-backup address conflict warning (#2927)
* fix: suppress auto-backup address conflict warning when default backup is configured

When a user runs `bd backup init <path>` it registers a Dolt backup named
"default". The auto-backup system also calls BackupDatabase() which registers
its own remote named "backup_export" pointing to the same .beads/backup/
directory. Dolt returns "Error 1105: address conflict with a remote: 'default'"
because two remotes cannot share a URL, causing a noisy warning on every write:

  Warning: auto-backup failed: register backup remote: add backup backup_export: \
  Error 1105: address conflict with a remote: 'default' -> file://.../backup

Fix: when BackupAdd fails with an address conflict, extract the name of the
already-registered remote from the error message and sync using that name
instead. The backup still runs — it just reuses the existing remote.

Adds ExtractAddressConflictName() to versioncontrolops for parsing the
conflicting name out of the Dolt error. Applies the fix to both the
EmbeddedDoltStore and DoltStore implementations of BackupDatabase().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* test: add table-driven tests for ExtractAddressConflictName

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 20:28:47 -07:00
..
backup.go fix: suppress auto-backup address conflict warning (#2927) 2026-04-02 20:28:47 -07:00
backup_test.go fix: suppress auto-backup address conflict warning (#2927) 2026-04-02 20:28:47 -07:00
branches.go /{cmd,internal}: wip sync and data EmbeddedDoltStore methods 2026-03-24 12:01:16 -07:00
clone.go /internal/storage: pr feedback 2026-03-26 11:17:39 -07:00
commit.go /{.github,cmd,internal}: pr feedback, ci fix 2026-03-25 12:58:46 -07:00
compact.go /internal/storage: pr feedback 2026-03-26 11:17:39 -07:00
db.go /{cmd,internal}: wip sync and data EmbeddedDoltStore methods 2026-03-24 12:01:16 -07:00
flatten.go /{cmd,internal}: pr feedback 2026-03-25 15:09:54 -07:00
gc.go /{cmd,internal}: fix commands 2026-03-25 13:48:13 -07:00
remotes.go /{cmd,internal}: wip sync and data EmbeddedDoltStore methods 2026-03-24 12:01:16 -07:00
version_control.go /{cmd,internal}: pr feedback 2026-03-25 15:09:54 -07:00