mirror of
https://github.com/KohakuBlueleaf/KohakuHub.git
synced 2026-05-05 20:07:37 -05:00
[PR #10] [MERGED] Fix/tree #12
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/KohakuBlueleaf/KohakuHub/pull/10
Author: @MigoXV
Created: 2/4/2026
Status: ✅ Merged
Merged: 2/8/2026
Merged by: @KohakuBlueleaf
Base:
main← Head:fix/tree📝 Commits (2)
f41728ffix(api): update path handling in file and directory conversion functions59a8a16feat(lakefs): add resolve_revision function to handle branch names and commit hashes📊 Changes
4 files changed (+69 additions, -34 deletions)
View changed files
📝
docs/api/tree.md(+1 -1)📝
src/kohakuhub/api/files.py(+6 -20)📝
src/kohakuhub/api/repo/routers/tree.py(+10 -13)📝
src/kohakuhub/utils/lakefs.py(+52 -0)📄 Description
Pull Request
What changed?
Why?
Fixes #
Testing
This pull request refactors how file and directory paths are handled in the repository tree API, ensuring compatibility with HuggingFace's expected format. It also improves revision resolution to support both branch names and commit hashes, and simplifies related code by removing unnecessary parameters.
API compatibility and path handling:
pathfield in both documentation and code to always be relative to the repository root, matching HuggingFace's expectations. Removed logic for stripping a prefix from paths. [1] [2] [3] [4] [5] [6]Revision resolution improvements:
resolve_revisionasync utility that can resolve both branch names and commit hashes to a commit ID and its info, improving compatibility with clients that use either type of revision identifier.get_revisionendpoint to useresolve_revision, streamlining error handling and supporting both revision types. [1] [2]Code cleanup:
Checklist
Screenshots
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.