[PATCH 1/1] get_random_object: don't re-check existence for LocalRepos

0 views
Skip to first unread message

Rob Browning

unread,
Aug 31, 2025, 4:16:14 PMAug 31
to bup-...@googlegroups.com
Signed-off-by: Rob Browning <r...@defaultvalue.org>
---

Proposed for main.

lib/bup/cmd/get.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/bup/cmd/get.py b/lib/bup/cmd/get.py
index 5cdfaa45..1a16dfd5 100644
--- a/lib/bup/cmd/get.py
+++ b/lib/bup/cmd/get.py
@@ -224,7 +224,8 @@ def get_random_item(name, hash, src_repo, dest_repo, opt):
# attempts to write some other oid that the server already
# has. Without this check, we can provoke a duplicate index
# suggestion which then causes client.sync_index() to throw.
- if item.type != b'blob' and dest_repo.exists(item.oid):
+ if not isinstance(dest_repo, LocalRepo) and item.type != b'blob' \
+ and dest_repo.exists(item.oid):
continue
dest_repo.just_write(item.oid, item.type, item.data)

--
2.47.2

Reply all
Reply to author
Forward
0 new messages