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 53
53
crate :: head:: peel:: to_object:: Error :: Unborn { .. } ,
54
54
) ,
55
55
) ,
56
- ) ) => None ,
56
+ ) ) => Some ( gix_hash :: ObjectId :: empty_tree ( self . repo . object_hash ( ) ) ) ,
57
57
Err ( err) => return Err ( err. into ( ) ) ,
58
58
} ,
59
59
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
34
34
git init untracked-unborn
35
35
(cd untracked-unborn
36
36
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 {
113
113
Ok ( ( ) )
114
114
}
115
115
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
+
116
126
#[ test]
117
127
fn error_during_tree_traversal_causes_failure ( ) -> crate :: Result {
118
128
let repo = repo ( "untracked-only" ) ?;
You can’t perform that action at this time.
0 commit comments