Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: claytonrcarter/git-branchless
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 465edce15dc94a538adb7016e4b2d9dee52fa56e
Choose a base ref
..
head repository: claytonrcarter/git-branchless
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 45ffcd65d101612fbb1cf3a44645a1460a8fc9ff
Choose a head ref
Showing with 40 additions and 0 deletions.
  1. +40 −0 git-branchless/tests/test_move.rs
40 changes: 40 additions & 0 deletions git-branchless/tests/test_move.rs
Original file line number Diff line number Diff line change
@@ -6684,3 +6684,43 @@ fn test_move_fixup_conflict() -> eyre::Result<()> {

Ok(())
}

#[test]
fn test_move_fixup_added_files() -> eyre::Result<()> {
let git = make_git()?;
git.init_repo()?;
git.detach_head()?;

git.commit_file("test1", 1)?;
git.commit_file("test2", 2)?;

let (stdout, _stderr) = git.run(&[
"move",
"--in-memory",
"--fixup",
"-x",
"HEAD",
"-d",
"HEAD~",
])?;

insta::assert_snapshot!(stdout, @r###"
Attempting rebase in-memory...
[1/1] Committed as: e9f8a2b create test1.txt
branchless: processing 2 rewritten commits
branchless: running command: <git-executable> checkout e9f8a2b1e4c72b2ca31c5f2feffabc947e2f1b5a
O f777ecc (master) create initial.txt
|
@ e9f8a2b create test1.txt
In-memory rebase succeeded.
"###);

let (stdout, _stderr) = git.run(&["ls-files"])?;
insta::assert_snapshot!(stdout, @r###"
initial.txt
test1.txt
test2.txt
"###);

Ok(())
}