@@ -237,6 +237,7 @@ fn reword_rebases() {
237237 snapbox:: cmd:: Command :: new ( snapbox:: cmd:: cargo_bin!( "git-stack" ) )
238238 . arg ( "amend" )
239239 . arg ( "--message=new B" )
240+ . arg ( "target" )
240241 . current_dir ( root_path)
241242 . assert ( )
242243 . success ( )
@@ -247,7 +248,7 @@ fn reword_rebases() {
247248 . stderr_matches (
248249 "\
249250 Saved working directory and index state WIP on local (amend): [..]
250- Amended to [..]: C
251+ Amended to [..]: B
251252Dropped refs/stash [..]
252253note: to undo, run `git branch-stash pop git-stack`
253254" ,
@@ -256,6 +257,10 @@ note: to undo, run `git branch-stash pop git-stack`
256257 let new_head_id = repo. head_commit ( ) . id ;
257258 assert_ne ! ( old_head_id, new_head_id) ;
258259
260+ let local_branch = repo. find_local_branch ( "local" ) . unwrap ( ) ;
261+ let local_commit = repo. find_commit ( local_branch. id ) . unwrap ( ) ;
262+ snapbox:: assert_eq ( local_commit. summary . to_str_lossy ( ) . into_owned ( ) , "C" ) ;
263+
259264 snapbox:: assert_eq ( std:: fs:: read ( root_path. join ( "a" ) ) . unwrap ( ) , "unstaged a" ) ;
260265
261266 root. close ( ) . unwrap ( ) ;
@@ -479,6 +484,10 @@ note: to undo, run `git branch-stash pop git-stack`
479484 let new_head_id = repo. head_commit ( ) . id ;
480485 assert_ne ! ( old_head_id, new_head_id) ;
481486
487+ let local_branch = repo. find_local_branch ( "local" ) . unwrap ( ) ;
488+ let local_commit = repo. find_commit ( local_branch. id ) . unwrap ( ) ;
489+ snapbox:: assert_eq ( local_commit. summary . to_str_lossy ( ) . into_owned ( ) , "C" ) ;
490+
482491 snapbox:: assert_eq ( std:: fs:: read ( root_path. join ( "a" ) ) . unwrap ( ) , "unstaged a" ) ;
483492
484493 root. close ( ) . unwrap ( ) ;
@@ -636,6 +645,10 @@ note: to undo, run `git branch-stash pop git-stack`
636645 let new_head_id = repo. head_commit ( ) . id ;
637646 assert_ne ! ( old_head_id, new_head_id) ;
638647
648+ let local_branch = repo. find_local_branch ( "local" ) . unwrap ( ) ;
649+ let local_commit = repo. find_commit ( local_branch. id ) . unwrap ( ) ;
650+ snapbox:: assert_eq ( local_commit. summary . to_str_lossy ( ) . into_owned ( ) , "C" ) ;
651+
639652 snapbox:: assert_eq ( std:: fs:: read ( root_path. join ( "a" ) ) . unwrap ( ) , "unstaged a" ) ;
640653
641654 root. close ( ) . unwrap ( ) ;
@@ -717,9 +730,13 @@ note: to undo, run `git branch-stash pop git-stack`
717730 let new_head_id = repo. head_commit ( ) . id ;
718731 assert_ne ! ( old_head_id, new_head_id) ;
719732
720- snapbox:: assert_eq ( std:: fs:: read ( root_path. join ( "a" ) ) . unwrap ( ) , "unstaged a" ) ;
721-
722733 snapbox:: assert_eq ( repo. head_commit ( ) . summary . to_str ( ) . unwrap ( ) , "fixup! B" ) ;
723734
735+ let local_branch = repo. find_local_branch ( "local" ) . unwrap ( ) ;
736+ let local_commit = repo. find_commit ( local_branch. id ) . unwrap ( ) ;
737+ snapbox:: assert_eq ( local_commit. summary . to_str_lossy ( ) . into_owned ( ) , "fixup! B" ) ;
738+
739+ snapbox:: assert_eq ( std:: fs:: read ( root_path. join ( "a" ) ) . unwrap ( ) , "unstaged a" ) ;
740+
724741 root. close ( ) . unwrap ( ) ;
725742}
0 commit comments