File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ use gitbutler_operating_modes::{
2020} ;
2121use gitbutler_oxidize:: { git2_to_gix_object_id, gix_to_git2_index, GixRepositoryExt } ;
2222use gitbutler_project:: access:: { WorktreeReadPermission , WorktreeWritePermission } ;
23- use gitbutler_project:: AUTO_TRACK_LIMIT_BYTES ;
2423use gitbutler_reference:: { ReferenceName , Refname } ;
2524use gitbutler_repo:: { rebase:: cherry_rebase, RepositoryExt } ;
2625use gitbutler_repo:: { signature, SignaturePurpose } ;
@@ -235,7 +234,9 @@ pub(crate) fn save_and_return_to_workspace(
235234 let parents = commit. parents ( ) . collect :: < Vec < _ > > ( ) ;
236235
237236 // Recommit commit
238- let tree = repository. create_wd_tree ( AUTO_TRACK_LIMIT_BYTES ) ?;
237+ // While we perform hard resets we should pick up everything to avoid loosing worktree state.
238+ let pick_up_untracked_files_of_any_size = 0 ;
239+ let tree = repository. create_wd_tree ( pick_up_untracked_files_of_any_size) ?;
239240
240241 let ( _, committer) = repository. signatures ( ) ?;
241242 let commit_headers = commit
Original file line number Diff line number Diff line change @@ -20,4 +20,5 @@ pub fn configure_git2() {
2020}
2121
2222/// The maximum size of files to automatically start tracking, i.e. untracked files we pick up for tree-creation.
23- pub const AUTO_TRACK_LIMIT_BYTES : u64 = 32 * 1024 * 1024 ;
23+ /// **Inactive for now** while it's hard to tell if it's safe *not* to pick up everything.
24+ pub const AUTO_TRACK_LIMIT_BYTES : u64 = 0 ;
Original file line number Diff line number Diff line change @@ -575,8 +575,8 @@ fn submodule_change() -> anyhow::Result<()> {
575575fn big_files_check_is_disabled_with_zero ( ) -> anyhow:: Result < ( ) > {
576576 let test = TestingRepository :: open_with_initial_commit ( & [ ] ) ;
577577
578- std:: fs:: write ( & test. tempdir . path ( ) . join ( "empty" ) , "" ) ?;
579- std:: fs:: write ( & test. tempdir . path ( ) . join ( "with-content" ) , "content" ) ?;
578+ std:: fs:: write ( test. tempdir . path ( ) . join ( "empty" ) , "" ) ?;
579+ std:: fs:: write ( test. tempdir . path ( ) . join ( "with-content" ) , "content" ) ?;
580580
581581 let tree: git2:: Tree = test. repository . create_wd_tree ( 0 ) ?;
582582
You can’t perform that action at this time.
0 commit comments