Skip to content

Commit b2358ea

Browse files
authored
kernel-builder: fix failed uploads trying to remove directories (#516)
When trying to collect candidates for stale entries, we included directories as well. This causes upload failures, since directories are not Git objects and the API would reject these.
1 parent 9d435cf commit b2358ea

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

kernel-builder/src/upload.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ fn run_upload_typed<T: RepoType>(args: UploadArgs) -> Result<()> {
188188
.send()
189189
.unwrap_or_default()
190190
.into_iter()
191-
.map(|entry| match entry {
192-
hf_hub::repository::RepoTreeEntry::File { path, .. } => path,
193-
hf_hub::repository::RepoTreeEntry::Directory { path, .. } => path,
191+
.filter_map(|entry| match entry {
192+
hf_hub::repository::RepoTreeEntry::File { path, .. } => Some(path),
193+
hf_hub::repository::RepoTreeEntry::Directory { .. } => None,
194194
})
195195
.collect();
196196

0 commit comments

Comments
 (0)