Add search use head's ref.#1015
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
example: libra switch -d HEAD^^^~~~^^^ libra switch -d master^^^~~~^^^ libra switch -d c234^11~0^^
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds enhanced support for detaching HEAD using complex Git-style reference paths and updates several functions to async. Key changes include:
- Conversion of functions such as get_commit_base and storage.search to async.
- New tests in the switch_test module verifying various reference path formats for HEAD detachment.
- Minor improvements in error message formatting and comment updates.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| libra/tests/mega_test.rs | Removed an outdated integration test comment. |
| libra/tests/command/switch_test.rs | Added comprehensive tests for HEAD detachment using various reference paths. |
| libra/tests/command/log_test.rs | Updated diagram comments to clarify commit graph structure. |
| libra/src/utils/util.rs | Updated get_commit_base to async with awaited search calls. |
| libra/src/utils/client_storage.rs | Converted search to async and added Git-style reference path navigation. |
| libra/src/command/switch.rs | Updated detach branch logic to await the async get_commit_base. |
| libra/src/command/restore.rs | Replaced synchronous search calls with async ones. |
| libra/src/command/mod.rs | Changed search call to await retrieval of commit objects. |
| libra/src/command/commit.rs | Made create_tree public and async to support new test requirements. |
| libra/src/internal/head.rs | Removed an extraneous blank line in the head update flow. |
genedna
enabled auto-merge
May 11, 2025 15:27
genedna
approved these changes
May 11, 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.
example:
libra switch -d HEAD^^^~~~^^^