Skip to content

[Scorpio] Fix Push#1101

Merged
genedna merged 6 commits into
gitmono-dev:mainfrom
kjx52:main
Jun 8, 2025
Merged

[Scorpio] Fix Push#1101
genedna merged 6 commits into
gitmono-dev:mainfrom
kjx52:main

Conversation

@kjx52

@kjx52 kjx52 commented Jun 6, 2025

Copy link
Copy Markdown
Contributor

Signed-off-by: kjx52 kjx52@outlook.com
Task Issue Number:#1010

Complete

  • Fixed the bug that Scorpio local repository cannot be pushed to remote after modification;
  • Optimized the String::from(GPath) method;
  • Added some error handling.

Screenshot_2025-06-06_11_33_11

@vercel

vercel Bot commented Jun 6, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mega ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 7, 2025 6:15am

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread scorpio/src/manager/store.rs Outdated
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);

Copilot AI Jun 6, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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..]);

Copilot uses AI. Check for mistakes.
@kjx52

kjx52 commented Jun 6, 2025

Copy link
Copy Markdown
Contributor Author

Signed-off-by: kjx52 kjx52@outlook.com
Task Issue Number:#1010

Complete

  • Fixed the bug that the Commit ID extracted in the Push operation would change with the signature timestamp.
  • Added documentation for Git operations in Scorpio.
  • Added some comments and a test case.
  • Fixed some minor issues.

Signed-off-by: kjx52 <kjx52@outlook.com>
.to_utc();
println!("author_time = {:?}", author_time);
println!("commit_time = {:?}", commit_time);
println!("now = {:?}", chrono::Utc::now());

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useless code

@genedna
genedna added this pull request to the merge queue Jun 8, 2025
Merged via the queue into gitmono-dev:main with commit 9afb7d5 Jun 8, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants