Skip to content

fix(hf): include folder deletions in git commit payload#7375

Merged
Xuanwo merged 2 commits intoapache:mainfrom
kszucs:hf-git-delete-folder
Apr 10, 2026
Merged

fix(hf): include folder deletions in git commit payload#7375
Xuanwo merged 2 commits intoapache:mainfrom
kszucs:hf-git-delete-folder

Conversation

@kszucs
Copy link
Copy Markdown
Member

@kszucs kszucs commented Apr 9, 2026

Which issue does this PR close?

Closes #.

Rationale for this change

HuggingFace git-based repos support deleting folders via the deletedFolders field in the commit API. The deleter was silently discarding directory-entry paths (those ending with /) instead of passing them through.

What changes are included in this PR?

  • Pass directory paths to commit_git as DeletedFolder entries instead of ignoring them
  • Update the unit test to assert files and folders are separated correctly in the commit payload
  • Skip test_remove_all_with_prefix_exists for HF git-based repos via a feature-gated scheme check instead of a fragile runtime probe write

Are there any user-facing changes?

Yes — deleting a directory path on a git-based HF repo now correctly removes the folder rather than silently doing nothing.

AI Usage Statement

Claude Code was used to assist with this change.

@kszucs kszucs requested a review from Xuanwo as a code owner April 9, 2026 17:09
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. releases-note/fix The PR fixes a bug or has a title that begins with "fix" labels Apr 9, 2026
@kszucs kszucs changed the title fix(services/hf): include folder deletions in git commit payload fix(hf): include folder deletions in git commit payload Apr 9, 2026
@Xuanwo Xuanwo merged commit ecf840b into apache:main Apr 10, 2026
372 of 373 checks passed
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer releases-note/fix The PR fixes a bug or has a title that begins with "fix" size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants