-
Notifications
You must be signed in to change notification settings - Fork 882
Switch but status from plumbing head_info to but-api head_info #12756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -318,6 +318,14 @@ pub struct Segment { | |||||||||||||||||||||||||
| /// This means one will see the entire workspace, while knowing the focus is on one specific segment. | ||||||||||||||||||||||||||
| /// *Note* that this segment can be listed in *multiple stacks* as it's reachable from multiple 'ahead' segments. | ||||||||||||||||||||||||||
| pub is_entrypoint: bool, | ||||||||||||||||||||||||||
| /// The ID of a linked worktree associated with this segment, if any. | ||||||||||||||||||||||||||
| #[serde(skip_serializing_if = "Option::is_none")] | ||||||||||||||||||||||||||
| #[cfg_attr(feature = "export-ts", ts(type = "number[] | null"))] | ||||||||||||||||||||||||||
| #[cfg_attr( | ||||||||||||||||||||||||||
| feature = "export-schema", | ||||||||||||||||||||||||||
| schemars(schema_with = "but_schemars::bstring_bytes_opt") | ||||||||||||||||||||||||||
| )] | ||||||||||||||||||||||||||
| pub linked_worktree_id: Option<BString>, | ||||||||||||||||||||||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Byron the
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
gitbutler/crates/but/src/command/legacy/status/mod.rs Lines 621 to 632 in 5793dde
The rebase engine would use this information to update linked worktrees when it changed what a reference points to (right now it's not doing that). |
||||||||||||||||||||||||||
| /// A derived value to help the UI decide which functions to make available. | ||||||||||||||||||||||||||
| pub push_status: ui::PushStatus, | ||||||||||||||||||||||||||
| /// This is always the `first()` commit in `commits` of the next stacksegment, or the first commit of | ||||||||||||||||||||||||||
|
|
@@ -351,6 +359,13 @@ impl Segment { | |||||||||||||||||||||||||
| }: crate::ref_info::Segment, | ||||||||||||||||||||||||||
| names: &gix::remote::Names, | ||||||||||||||||||||||||||
| ) -> anyhow::Result<Self> { | ||||||||||||||||||||||||||
| let linked_worktree_id = ref_info.as_ref().and_then(|ri| { | ||||||||||||||||||||||||||
| if let Some(but_graph::Worktree::LinkedId(id)) = &ri.worktree { | ||||||||||||||||||||||||||
| Some(id.clone()) | ||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||
| None | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||
| Ok(Segment { | ||||||||||||||||||||||||||
| ref_name: ref_info.map(|ri| ri.ref_name.into()), | ||||||||||||||||||||||||||
| remote_tracking_ref_name: remote_tracking_ref_name | ||||||||||||||||||||||||||
|
|
@@ -372,6 +387,7 @@ impl Segment { | |||||||||||||||||||||||||
| }), | ||||||||||||||||||||||||||
| metadata, | ||||||||||||||||||||||||||
| is_entrypoint, | ||||||||||||||||||||||||||
| linked_worktree_id, | ||||||||||||||||||||||||||
| push_status, | ||||||||||||||||||||||||||
| base, | ||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.