Skip to content

Work#21

Merged
jordfras merged 19 commits intomainfrom
work
Mar 21, 2026
Merged

Work#21
jordfras merged 19 commits intomainfrom
work

Conversation

@jordfras
Copy link
Copy Markdown
Owner

No description provided.

check_no_dirty_state now filters out gitlink deltas (mode 0o160000)
instead of relying on DiffOptions::ignore_submodules, which only works
for entries declared in .gitmodules.  This matches git-rebase behaviour:
a staged or unstaged submodule pointer update no longer blocks drop,
move, and squash.

Add a stage_gitlink test helper in tests/common.rs and one new test per
operation (drop_commit_allowed_with_staged_submodule,
move_commit_allowed_with_staged_submodule,
squash_commits_allowed_with_staged_submodule,
squash_try_combine_allowed_with_staged_submodule) to verify the
relaxed guard, alongside the existing tests that confirm ordinary
staged/unstaged file changes are still rejected.
Enable rename detection via find_similar() in commit_diff_for_fragmap
so git2 produces a single delta with old_path ≠ new_path instead of
separate delete+add pairs.

Build a rename map that traces each path back to its canonical
(earliest) name and use it throughout the fragmap pipeline:
extract_spans_propagated, build_fragmap, assign_hunk_groups,
build_matrix, determine_touch_kind, and dump_per_file_spg_stats.

Extract shared collect_file_commits() helper to replace four
duplicated inline file-grouping loops.
Make <BASE> optional on the command line. When omitted, resolve
refs/remotes/origin/HEAD symbolically to find the remote's default
branch (e.g. origin/main) and pass it to find_reference_point. Falls
back to 'main' when origin/HEAD is not configured.

- Add GitRepo::default_branch() to the trait
- Implement it in Git2Repo via refs/remotes/origin/HEAD
- Make Cli::base Option<String> with updated help text
- Add three tests in tests/reference_point.rs covering set/absent/non-main
- Add default_branch stub to TUI test mock impls
@jordfras jordfras force-pushed the work branch 2 times, most recently from 9e2d9b0 to f9ab6c8 Compare March 21, 2026 12:48
jordfras added 14 commits March 21, 2026 13:55
…(T131)

T133 was diagnosed as fixed by the T132 fix: libgit2's checkout_head(force)
already resets both the index and workdir to HEAD, including removing files
written to the workdir during conflict checkout that are absent from HEAD's
tree. The dirty-workdir symptom was a consequence of stage_file leaving the
index in a corrupt partial state, which T132 resolved.

Add squash_abort_leaves_clean_working_tree to confirm that after aborting a
conflicted squash, no staged changes, unstaged changes, or untracked files
remain — even when the source commit introduced a new file (b.txt) that was
written to the workdir by the conflict checkout but is absent from the
original HEAD.
@jordfras jordfras merged commit 8dbc56b into main Mar 21, 2026
1 check passed
@jordfras jordfras deleted the work branch March 21, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant