Skip to content

Commit 6a4fb03

Browse files
committed
Effectively assure that create_wd_tree() picks up everything.
It's not safe to do that while performing hard resets, and we shouldn't risk it just yet.
1 parent c5b2746 commit 6a4fb03

File tree

2 files changed

+5
-2
lines changed
  • crates

2 files changed

+5
-2
lines changed

crates/gitbutler-edit-mode/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,9 @@ pub(crate) fn save_and_return_to_workspace(
235235
let parents = commit.parents().collect::<Vec<_>>();
236236

237237
// Recommit commit
238-
let tree = repository.create_wd_tree(AUTO_TRACK_LIMIT_BYTES)?;
238+
// While we perform hard resets we should pick up everything to avoid loosing worktree state.
239+
let pick_up_untracked_files_of_any_size = 0;
240+
let tree = repository.create_wd_tree(pick_up_untracked_files_of_any_size)?;
239241

240242
let (_, committer) = repository.signatures()?;
241243
let commit_headers = commit

crates/gitbutler-project/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)