Skip to content

Add search use head's ref.#1015

Merged
genedna merged 4 commits into
gitmono-dev:mainfrom
yyjeqhc:add_ref
May 11, 2025
Merged

Add search use head's ref.#1015
genedna merged 4 commits into
gitmono-dev:mainfrom
yyjeqhc:add_ref

Conversation

@yyjeqhc

@yyjeqhc yyjeqhc commented May 8, 2025

Copy link
Copy Markdown
Contributor

example:
libra switch -d HEAD^^^~~~^^^

@vercel

vercel Bot commented May 8, 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 May 11, 2025 2:52pm

example:
libra switch -d HEAD^^^~~~^^^
libra switch -d master^^^~~~^^^
libra switch -d c234^11~0^^

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 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.

Comment thread libra/tests/command/switch_test.rs Outdated
@genedna
genedna added this pull request to the merge queue May 11, 2025
Merged via the queue into gitmono-dev:main with commit 2a0d126 May 11, 2025
@yyjeqhc
yyjeqhc deleted the add_ref branch May 12, 2025 01:41
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.

3 participants