Skip to content

Commit

Permalink
generic: transfer: check if links are empty
Browse files Browse the repository at this point in the history
Otherwise we might run into `IndexError: list index out of range` if none link types are supported and we use on_error.
  • Loading branch information
efiop committed Oct 31, 2023
1 parent 1b0eb14 commit fdb3851
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dvc_objects/fs/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def transfer(
# Try to link files sequentially. If/when the only remaining link type is
# copy, the remaining copy operations will be batched.
for i, (from_p, to_p) in enumerate(zip(from_path, to_path)):
if links[0] == "copy":
if links and links[0] == "copy":
copy(
from_fs,
from_path[i:],
Expand Down

0 comments on commit fdb3851

Please sign in to comment.