fix: update axum's route and make fetch_dir more robust#1255
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Pull Request Overview
This PR contains several improvements and fixes to the codebase, including updating Axum routing syntax, enhancing error handling in fetch_dir, fixing error messages in the switch command, and adding branch information to log output.
- Updates Axum route path parameter syntax from
:pathto{path}to match current framework conventions - Improves error handling in
fetch_dirto prevent panics and return meaningful error responses instead - Fixes inconsistent error messages in the switch command for uncommitted vs unstaged changes
- Adds branch display functionality to the log command showing which branches point to specific commits
Reviewed Changes
Copilot reviewed 14 out of 21 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| scorpio/src/scolfs/route.rs | Updates Axum route parameter syntax from :path to {path} |
| scorpio/src/dicfuse/store.rs | Improves error handling in fetch_dir to return errors instead of panicking |
| libra/src/command/switch.rs | Fixes error message consistency for uncommitted vs unstaged changes |
| libra/src/command/log.rs | Adds branch information display to commit history |
| Multiple files | Code formatting improvements and whitespace cleanup |
| if !unstaged.deleted.is_empty() || !unstaged.modified.is_empty() { | ||
| status::execute().await; | ||
| eprintln!("fatal: uncommitted changes, can't switch branch"); | ||
| eprintln!("fatal: unstaged changes, can't switch branch"); |
There was a problem hiding this comment.
The error message is inconsistent with the condition. When checking unstaged deleted/modified files, the message should be 'fatal: uncommitted changes, can't switch branch' to match the original behavior described in the PR.
| eprintln!("fatal: unstaged changes, can't switch branch"); | |
| eprintln!("fatal: uncommitted changes, can't switch branch"); |
| } else if !status::changes_to_be_committed().await.is_empty() { | ||
| status::execute().await; | ||
| eprintln!("fatal: unstaged changes, can't switch branch"); | ||
| eprintln!("fatal: uncommitted changes, can't switch branch"); |
There was a problem hiding this comment.
The error message is inconsistent with the condition. When checking staged changes (changes to be committed), the message should be 'fatal: unstaged changes, can't switch branch' to match the original behavior described in the PR.
| eprintln!("fatal: uncommitted changes, can't switch branch"); | |
| eprintln!("fatal: unstaged changes, can't switch branch"); |
1.axum后路由路径处理变化,进行更新
2.fetch_dir修改错误处理,避免因网络等问题拉取失败时panic
3.libra switch子命令的check status输出错误,修改一个跟踪的文件,然后切换分支
4.libra log添加历史提交的分支展示。