@@ -62,12 +62,12 @@ impl std::fmt::Debug for Outcome<'_> {
6262 }
6363}
6464
65- /// How the newly applied branch should be integrated into the workspace.
65+ /// How the newly applied branch should be merged into the workspace commit .
6666#[ derive( Default , Debug , Copy , Clone ) ]
67- pub enum IntegrationMode {
67+ pub enum WorkspaceMerge {
6868 /// Do nothing but to merge it into the workspace commit, *even* if it's not needed as the workspace reference
6969 /// can connect directly with the *one* workspace base.
70- /// This also ensures that there is a workspace merge commit.
70+ /// This also ensures that there is a workspace merge commit, even if it is none-sensical .
7171 #[ default]
7272 AlwaysMerge ,
7373 /// Only create a merge commit if a new commit is effectively merged in. This avoids *unnecessary* merge commits,
@@ -89,8 +89,8 @@ pub enum WorkspaceReferenceNaming {
8989/// Options for [function::apply()].
9090#[ derive( Default , Debug , Clone ) ]
9191pub struct Options {
92- /// how the branch should be brought into the workspace.
93- pub integration_mode : IntegrationMode ,
92+ /// How the branch should be brought into the workspace.
93+ pub workspace_merge : WorkspaceMerge ,
9494 /// Decide how to deal with conflicts when creating the workspace merge commit to bring in each stack.
9595 pub on_workspace_conflict : OnWorkspaceMergeConflict ,
9696 /// How the workspace reference should be named should it be created.
@@ -132,7 +132,7 @@ pub(crate) mod function {
132132 } ;
133133 use tracing:: instrument;
134134
135- use super :: { IntegrationMode , Options , Outcome , WorkspaceReferenceNaming } ;
135+ use super :: { Options , Outcome , WorkspaceMerge , WorkspaceReferenceNaming } ;
136136 use crate :: { WorkspaceCommit , branch:: checkout, ext:: ObjectStorageExt , ref_info:: WorkspaceExt } ;
137137
138138 /// Apply `branch` to the given `workspace`, and possibly create the workspace reference in `repo`
@@ -162,7 +162,7 @@ pub(crate) mod function {
162162 repo : & gix:: Repository ,
163163 meta : & mut impl RefMetadata ,
164164 Options {
165- integration_mode,
165+ workspace_merge : integration_mode,
166166 on_workspace_conflict,
167167 workspace_reference_naming,
168168 uncommitted_changes,
@@ -390,7 +390,7 @@ pub(crate) mod function {
390390 & ws_md,
391391 local_tracking_config_and_ref_info,
392392 ) ?;
393- let ws_commit_with_new_message = WorkspaceCommit :: from_graph_workspace (
393+ let ws_commit_with_new_message = WorkspaceCommit :: from_graph_workspace_and_tree (
394394 & workspace,
395395 repo,
396396 head_id. object ( ) ?. peel_to_tree ( ) ?. id ,
@@ -635,7 +635,7 @@ pub(crate) mod function {
635635 /// Setup `local_tracking_ref` to track `remote_tracking_ref` using the typical pattern, and prepare the configuration file
636636 /// so that it can replace `.git/config` of `repo` when written back, with everything the same but the branch configuration added.
637637 /// We also return the commit at which `local_tracking_ref` should be placed, which is assumed to not exist, and `repo` will be used
638- /// for computing the merge-base with `ws_ref_name `, traditionally, without a graph, as forcing the graph here wouldn't buy us anything.
638+ /// for computing the merge-base with `ws_ref_id `, traditionally, without a graph, as forcing the graph here wouldn't buy us anything.
639639 /// Merge-base computations can still be done with `repo` IF the graph isn't up to date.
640640 fn setup_local_tracking_configuration (
641641 repo : & gix:: Repository ,
@@ -827,18 +827,18 @@ pub(crate) mod function {
827827
828828 fn needs_workspace_commit_without_remerge (
829829 ws : & but_graph:: projection:: Workspace < ' _ > ,
830- integration_mode : IntegrationMode ,
830+ integration_mode : WorkspaceMerge ,
831831 ) -> bool {
832832 match integration_mode {
833- IntegrationMode :: AlwaysMerge => match ws. kind {
833+ WorkspaceMerge :: AlwaysMerge => match ws. kind {
834834 WorkspaceKind :: Managed { .. } => false ,
835835 WorkspaceKind :: AdHoc => {
836836 // If it's still ad-hoc, there must be a reason, and we don't try to create a managed commit
837837 false
838838 }
839839 WorkspaceKind :: ManagedMissingWorkspaceCommit { .. } => true ,
840840 } ,
841- IntegrationMode :: MergeIfNeeded => false ,
841+ WorkspaceMerge :: MergeIfNeeded => false ,
842842 }
843843 }
844844
0 commit comments