@@ -27,7 +27,7 @@ pub const GITBUTLER_WORKSPACE_COMMIT_TITLE: &str = "GitButler Workspace Commit";
2727/// what files have been modified.
2828///
2929/// This should be used to update the `gitbutler/workspace` ref with, which is usually
30- /// done from [`update_gitbutler_integration ()`], after any of its input changes.
30+ /// done from [`update_workspace_commit ()`], after any of its input changes.
3131/// This is namely the conflicting state, or any head of the virtual branches.
3232#[ instrument( level = tracing:: Level :: DEBUG , skip( ctx) ) ]
3333pub ( crate ) fn get_workspace_head ( ctx : & CommandContext ) -> Result < git2:: Oid > {
@@ -105,7 +105,7 @@ struct PreviousHead {
105105 sha : String ,
106106}
107107
108- fn read_integration_file ( path : & PathBuf ) -> Result < Option < PreviousHead > > {
108+ fn read_workspace_file ( path : & PathBuf ) -> Result < Option < PreviousHead > > {
109109 if let Ok ( prev_data) = std:: fs:: read_to_string ( path) {
110110 let parts: Vec < & str > = prev_data. split ( ':' ) . collect ( ) ;
111111 let prev_head = parts[ 0 ] . to_string ( ) ;
@@ -119,13 +119,13 @@ fn read_integration_file(path: &PathBuf) -> Result<Option<PreviousHead>> {
119119 }
120120}
121121
122- fn write_integration_file ( head : & git2:: Reference , path : PathBuf ) -> Result < ( ) > {
122+ fn write_workspace_file ( head : & git2:: Reference , path : PathBuf ) -> Result < ( ) > {
123123 let sha = head. target ( ) . unwrap ( ) . to_string ( ) ;
124124 std:: fs:: write ( path, format ! ( ":{}" , sha) ) ?;
125125 Ok ( ( ) )
126126}
127127#[ instrument( level = tracing:: Level :: DEBUG , skip( vb_state, ctx) , err( Debug ) ) ]
128- pub fn update_gitbutler_integration (
128+ pub fn update_workspace_commit (
129129 vb_state : & VirtualBranchesHandle ,
130130 ctx : & CommandContext ,
131131) -> Result < git2:: Oid > {
@@ -137,13 +137,13 @@ pub fn update_gitbutler_integration(
137137
138138 // get current repo head for reference
139139 let head_ref = repo. head ( ) ?;
140- let integration_filepath = repo. path ( ) . join ( "integration " ) ;
141- let mut prev_branch = read_integration_file ( & integration_filepath ) ?;
140+ let workspace_filepath = repo. path ( ) . join ( "workspace " ) ;
141+ let mut prev_branch = read_workspace_file ( & workspace_filepath ) ?;
142142 if let Some ( branch) = & prev_branch {
143143 if branch. head != GITBUTLER_WORKSPACE_REFERENCE . to_string ( ) {
144144 // we are moving from a regular branch to our gitbutler workspace branch, write a file to
145- // .git/integration with the previous head and name
146- write_integration_file ( & head_ref, integration_filepath ) ?;
145+ // .git/workspace with the previous head and name
146+ write_workspace_file ( & head_ref, workspace_filepath ) ?;
147147 prev_branch = Some ( PreviousHead {
148148 head : head_ref. target ( ) . unwrap ( ) . to_string ( ) ,
149149 sha : head_ref. target ( ) . unwrap ( ) . to_string ( ) ,
@@ -230,7 +230,7 @@ pub fn update_gitbutler_integration(
230230 & GITBUTLER_WORKSPACE_REFERENCE . clone ( ) . to_string ( ) ,
231231 final_commit,
232232 true ,
233- "updated integration commit" ,
233+ "updated workspace commit" ,
234234 ) ?;
235235 repo. set_head ( & GITBUTLER_WORKSPACE_REFERENCE . clone ( ) . to_string ( ) ) ?;
236236
@@ -333,7 +333,7 @@ fn verify_head_is_clean(ctx: &CommandContext, perm: &mut WorktreeWritePermission
333333 . log ( head_commit. id ( ) , LogUntil :: Commit ( default_target. sha ) )
334334 . context ( "failed to get log" ) ?;
335335
336- let integration_index = commits
336+ let workspace_index = commits
337337 . iter ( )
338338 . position ( |commit| {
339339 commit. message ( ) . is_some_and ( |message| {
@@ -342,8 +342,8 @@ fn verify_head_is_clean(ctx: &CommandContext, perm: &mut WorktreeWritePermission
342342 } )
343343 } )
344344 . context ( "GitButler workspace commit not found" ) ?;
345- let integration_commit = & commits[ integration_index ] ;
346- let mut extra_commits = commits[ ..integration_index ] . to_vec ( ) ;
345+ let workspace_commit = & commits[ workspace_index ] ;
346+ let mut extra_commits = commits[ ..workspace_index ] . to_vec ( ) ;
347347 extra_commits. reverse ( ) ;
348348
349349 if extra_commits. is_empty ( ) {
@@ -352,8 +352,8 @@ fn verify_head_is_clean(ctx: &CommandContext, perm: &mut WorktreeWritePermission
352352 }
353353
354354 ctx. repository ( )
355- . reset ( integration_commit . as_object ( ) , git2:: ResetType :: Soft , None )
356- . context ( "failed to reset to integration commit" ) ?;
355+ . reset ( workspace_commit . as_object ( ) , git2:: ResetType :: Soft , None )
356+ . context ( "failed to reset to workspace commit" ) ?;
357357
358358 let branch_manager = ctx. branch_manager ( ) ;
359359 let mut new_branch = branch_manager
0 commit comments