File tree Expand file tree Collapse file tree 4 files changed +18
-2
lines changed Expand file tree Collapse file tree 4 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 5353 crate :: head:: peel:: to_object:: Error :: Unborn { .. } ,
5454 ) ,
5555 ) ,
56- ) ) => None ,
56+ ) ) => Some ( gix_hash :: ObjectId :: empty_tree ( self . repo . object_hash ( ) ) ) ,
5757 Err ( err) => return Err ( err. into ( ) ) ,
5858 } ,
5959 Some ( Some ( tree_id) ) => Some ( tree_id) ,
Original file line number Diff line number Diff line change @@ -34,4 +34,10 @@ git init racy-git
3434git init untracked-unborn
3535(cd untracked-unborn
3636 touch untracked
37- )
37+ )
38+
39+ git init untracked-added
40+ (cd untracked-added
41+ echo content > added
42+ git add added
43+ )
Original file line number Diff line number Diff line change @@ -113,6 +113,16 @@ mod into_iter {
113113 Ok ( ( ) )
114114 }
115115
116+ #[ test]
117+ fn untracked_added ( ) -> crate :: Result {
118+ let repo = repo ( "untracked-added" ) ?;
119+ let mut status = repo. status ( gix:: progress:: Discard ) ?. into_iter ( None ) ?;
120+ let mut items: Vec < _ > = status. by_ref ( ) . filter_map ( Result :: ok) . collect ( ) ;
121+ items. sort_by ( |a, b| a. location ( ) . cmp ( b. location ( ) ) ) ;
122+ insta:: assert_debug_snapshot!( items, @r#""# ) ;
123+ Ok ( ( ) )
124+ }
125+
116126 #[ test]
117127 fn error_during_tree_traversal_causes_failure ( ) -> crate :: Result {
118128 let repo = repo ( "untracked-only" ) ?;
You can’t perform that action at this time.
0 commit comments