[Scorpio] Fix Push#1101
Merged
Merged
Conversation
Signed-off-by: kjx52 <kjx52@outlook.com>
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the issue preventing Scorpio’s local repository from being pushed to remote, optimizes the conversion of GPath to String, and improves error handling in the push process.
- Optimizes String conversion by filtering empty path parts.
- Enhances error handling and UTF-8 conversion in the store module.
- Updates HTTP client usage and URL formatting in the push functionality.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| scorpio/src/util/mod.rs | Simplified GPath-to-String conversion using retain and join. |
| scorpio/src/manager/store.rs | Added proper error conversion for UTF8 decoding; potential bug in hash joining logic. |
| scorpio/src/manager/push.rs | Improved HTTP client initialization and error handling in push. |
| scorpio/src/manager/mod.rs | Adjusted URL formatting for git-receive-pack endpoint. |
| SHA1::from_str(hash).map_err(|e| Error::new(ErrorKind::InvalidInput, e))?; | ||
|
|
||
| let data_path = hash_path.join(&hash[2..]); | ||
| let data_path = hash_path.join(hash_flag); |
There was a problem hiding this comment.
The code uses the same hash_flag for both the directory and file name. It looks like 'data_path' should be joined with the remainder of the hash (e.g., using hash[2..]) instead of reusing hash_flag, to correctly reconstruct the full path.
Suggested change
| let data_path = hash_path.join(hash_flag); | |
| let data_path = hash_path.join(&hash[2..]); |
Signed-off-by: kjx52 <kjx52@outlook.com>
Contributor
Author
|
Signed-off-by: kjx52 kjx52@outlook.com Complete
|
Signed-off-by: kjx52 <kjx52@outlook.com>
Ivanbeethoven
approved these changes
Jun 8, 2025
| .to_utc(); | ||
| println!("author_time = {:?}", author_time); | ||
| println!("commit_time = {:?}", commit_time); | ||
| println!("now = {:?}", chrono::Utc::now()); |
genedna
approved these changes
Jun 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: kjx52 kjx52@outlook.com
Task Issue Number:#1010
Complete
String::from(GPath)method;