@@ -40,7 +40,6 @@ fn all_file_types_added_to_index() -> anyhow::Result<()> {
4040#[ test]
4141#[ cfg( unix) ]
4242fn all_file_types_deleted_in_worktree ( ) -> anyhow:: Result < ( ) > {
43- util:: control_umask ( ) ;
4443 let ( repo, _tmp) = writable_scenario ( "delete-all-file-types-valid-submodule" ) ;
4544 insta:: assert_snapshot!( git_status( & repo) ?, @r"
4645 D .gitmodules
@@ -82,7 +81,6 @@ fn all_file_types_deleted_in_worktree() -> anyhow::Result<()> {
8281#[ test]
8382#[ cfg( unix) ]
8483fn replace_dir_with_file_discard_all_in_order_in_worktree ( ) -> anyhow:: Result < ( ) > {
85- util:: control_umask ( ) ;
8684 let ( repo, _tmp) = writable_scenario ( "replace-dir-with-submodule-with-file" ) ;
8785 insta:: assert_snapshot!( git_status( & repo) ?, @r"
8886 D dir/executable
@@ -129,7 +127,6 @@ fn replace_dir_with_file_discard_all_in_order_in_worktree() -> anyhow::Result<()
129127#[ test]
130128#[ cfg( unix) ]
131129fn replace_dir_with_file_discard_all_in_order_in_index ( ) -> anyhow:: Result < ( ) > {
132- util:: control_umask ( ) ;
133130 let ( repo, _tmp) = writable_scenario ( "replace-dir-with-submodule-with-file" ) ;
134131 git ( & repo) . args ( [ "add" , "." ] ) . run ( ) ;
135132 insta:: assert_snapshot!( git_status( & repo) ?, @r"
@@ -177,7 +174,6 @@ fn replace_dir_with_file_discard_all_in_order_in_index() -> anyhow::Result<()> {
177174#[ test]
178175#[ cfg( unix) ]
179176fn replace_dir_with_file_discard_just_the_file_in_worktree ( ) -> anyhow:: Result < ( ) > {
180- util:: control_umask ( ) ;
181177 let ( repo, _tmp) = writable_scenario ( "replace-dir-with-submodule-with-file" ) ;
182178 insta:: assert_snapshot!( git_status( & repo) ?, @r"
183179 D dir/executable
@@ -220,7 +216,6 @@ fn replace_dir_with_file_discard_just_the_file_in_worktree() -> anyhow::Result<(
220216#[ test]
221217#[ cfg( unix) ]
222218fn conflicts_are_invisible ( ) -> anyhow:: Result < ( ) > {
223- util:: control_umask ( ) ;
224219 let ( repo, _tmp) = writable_scenario ( "merge-with-two-branches-conflict" ) ;
225220 insta:: assert_snapshot!( git_status( & repo) ?, @"UU file" ) ;
226221 insta:: assert_snapshot!( visualize_index( & * * repo. index( ) ?) , @r"
@@ -254,7 +249,6 @@ fn conflicts_are_invisible() -> anyhow::Result<()> {
254249#[ test]
255250#[ cfg( unix) ]
256251fn replace_dir_with_file_discard_just_the_file_in_index ( ) -> anyhow:: Result < ( ) > {
257- util:: control_umask ( ) ;
258252 let ( repo, _tmp) = writable_scenario ( "replace-dir-with-submodule-with-file" ) ;
259253 git ( & repo) . args ( [ "add" , "." ] ) . run ( ) ;
260254 insta:: assert_snapshot!( git_status( & repo) ?, @r"
@@ -298,7 +292,6 @@ fn replace_dir_with_file_discard_just_the_file_in_index() -> anyhow::Result<()>
298292#[ test]
299293#[ cfg( unix) ]
300294fn all_file_types_modified_in_worktree ( ) -> anyhow:: Result < ( ) > {
301- util:: control_umask ( ) ;
302295 let ( repo, _tmp) = writable_scenario_slow ( "all-file-types-changed" ) ;
303296 insta:: assert_snapshot!( git_status( & repo) ?, @r"
304297 M soon-executable
@@ -338,7 +331,6 @@ fn all_file_types_modified_in_worktree() -> anyhow::Result<()> {
338331#[ test]
339332#[ cfg( unix) ]
340333fn all_file_types_modified_in_index ( ) -> anyhow:: Result < ( ) > {
341- util:: control_umask ( ) ;
342334 let ( repo, _tmp) = writable_scenario_slow ( "all-file-types-changed" ) ;
343335 git ( & repo) . args ( [ "add" , "." ] ) . run ( ) ;
344336 insta:: assert_snapshot!( git_status( & repo) ?, @r"
@@ -379,7 +371,6 @@ fn all_file_types_modified_in_index() -> anyhow::Result<()> {
379371#[ test]
380372#[ cfg( unix) ]
381373fn modified_submodule_and_embedded_repo_in_worktree ( ) -> anyhow:: Result < ( ) > {
382- util:: control_umask ( ) ;
383374 let ( repo, _tmp) = writable_scenario ( "modified-submodule-and-embedded-repo" ) ;
384375 insta:: assert_snapshot!( git_status( & repo) ?, @r"
385376 M embedded-repository
@@ -435,7 +426,6 @@ fn modified_submodule_and_embedded_repo_in_worktree() -> anyhow::Result<()> {
435426#[ test]
436427#[ cfg( unix) ]
437428fn modified_submodule_and_embedded_repo_in_index ( ) -> anyhow:: Result < ( ) > {
438- util:: control_umask ( ) ;
439429 let ( repo, _tmp) = writable_scenario ( "modified-submodule-and-embedded-repo" ) ;
440430 git ( & repo) . args ( [ "add" , "." ] ) . run ( ) ;
441431 insta:: assert_snapshot!( git_status( & repo) ?, @r"
@@ -465,7 +455,6 @@ fn modified_submodule_and_embedded_repo_in_index() -> anyhow::Result<()> {
465455#[ test]
466456#[ cfg( unix) ]
467457fn all_file_types_renamed_and_modified_in_worktree ( ) -> anyhow:: Result < ( ) > {
468- util:: control_umask ( ) ;
469458 let ( repo, _tmp) = writable_scenario_slow ( "all-file-types-renamed-and-modified" ) ;
470459 // Git doesn't detect renames between index/worktree, but we do.
471460 insta:: assert_snapshot!( git_status( & repo) ?, @r"
@@ -509,7 +498,6 @@ fn all_file_types_renamed_and_modified_in_worktree() -> anyhow::Result<()> {
509498#[ test]
510499#[ cfg( unix) ]
511500fn all_file_types_renamed_modified_in_index ( ) -> anyhow:: Result < ( ) > {
512- util:: control_umask ( ) ;
513501 let ( repo, _tmp) = writable_scenario_slow ( "all-file-types-renamed-and-modified" ) ;
514502 git ( & repo) . args ( [ "add" , "." ] ) . run ( ) ;
515503 insta:: assert_snapshot!( git_status( & repo) ?, @r"
@@ -556,7 +544,6 @@ fn all_file_types_renamed_modified_in_index() -> anyhow::Result<()> {
556544#[ test]
557545#[ cfg( unix) ]
558546fn all_file_types_renamed_overwriting_existing_and_modified_in_worktree ( ) -> anyhow:: Result < ( ) > {
559- util:: control_umask ( ) ;
560547 let ( repo, _tmp) = writable_scenario_slow ( "all-file-types-renamed-and-overwriting-existing" ) ;
561548 // This is actually misleading as `file-to-be-dir` seems missing even though it's now
562549 // a directory. It's untracked-state isn't visible.
@@ -623,7 +610,6 @@ fn all_file_types_renamed_overwriting_existing_and_modified_in_worktree() -> any
623610#[ test]
624611#[ cfg( unix) ]
625612fn all_file_types_renamed_overwriting_existing_and_modified_in_index ( ) -> anyhow:: Result < ( ) > {
626- util:: control_umask ( ) ;
627613 let ( repo, _tmp) = writable_scenario_slow ( "all-file-types-renamed-and-overwriting-existing" ) ;
628614 git ( & repo) . args ( [ "add" , "." ] ) . run ( ) ;
629615 // This is actually misleading as `file-to-be-dir` seems missing even though it's now
@@ -693,7 +679,6 @@ fn all_file_types_renamed_overwriting_existing_and_modified_in_index() -> anyhow
693679#[ cfg( unix) ]
694680fn all_file_types_renamed_overwriting_existing_and_modified_in_worktree_discard_selectively ( )
695681-> anyhow:: Result < ( ) > {
696- util:: control_umask ( ) ;
697682 let ( repo, _tmp) = writable_scenario_slow ( "all-file-types-renamed-and-overwriting-existing" ) ;
698683 // This is actually misleading as `file-to-be-dir` seems missing even though it's now
699684 // a directory. It's untracked-state isn't visible.
@@ -788,7 +773,6 @@ fn all_file_types_renamed_overwriting_existing_and_modified_in_worktree_discard_
788773#[ test]
789774#[ cfg( unix) ]
790775fn folder_with_all_file_types_moved_upwards_in_worktree ( ) -> anyhow:: Result < ( ) > {
791- util:: control_umask ( ) ;
792776 let ( repo, _tmp) = writable_scenario_slow ( "move-directory-into-sibling-file" ) ;
793777 insta:: assert_snapshot!( git_status( & repo) ?, @r"
794778 D a/b/executable
@@ -839,7 +823,6 @@ fn folder_with_all_file_types_moved_upwards_in_worktree() -> anyhow::Result<()>
839823#[ test]
840824#[ cfg( unix) ]
841825fn folder_with_all_file_types_moved_upwards_in_worktree_discard_selected ( ) -> anyhow:: Result < ( ) > {
842- util:: control_umask ( ) ;
843826 let ( repo, _tmp) = writable_scenario_slow ( "move-directory-into-sibling-file" ) ;
844827 insta:: assert_snapshot!( git_status( & repo) ?, @r"
845828 D a/b/executable
@@ -888,7 +871,6 @@ fn folder_with_all_file_types_moved_upwards_in_worktree_discard_selected() -> an
888871#[ test]
889872#[ cfg( unix) ]
890873fn folder_with_all_file_types_moved_upwards_in_index ( ) -> anyhow:: Result < ( ) > {
891- util:: control_umask ( ) ;
892874 let ( repo, _tmp) = writable_scenario_slow ( "move-directory-into-sibling-file" ) ;
893875 git ( & repo) . args ( [ "add" , "." ] ) . run ( ) ;
894876 insta:: assert_snapshot!( git_status( & repo) ?, @r"
@@ -925,7 +907,6 @@ fn folder_with_all_file_types_moved_upwards_in_index() -> anyhow::Result<()> {
925907#[ test]
926908#[ cfg( unix) ]
927909fn all_file_types_deleted_in_index ( ) -> anyhow:: Result < ( ) > {
928- util:: control_umask ( ) ;
929910 let ( repo, _tmp) = writable_scenario ( "delete-all-file-types-valid-submodule" ) ;
930911 insta:: assert_snapshot!( git_status( & repo) ?, @r"
931912 D .gitmodules
@@ -993,13 +974,6 @@ mod util {
993974 . into ( )
994975 }
995976
996- /// Set the process umask to a known value so filesystem listings will be as we expect on all machines.
997- #[ cfg( unix) ]
998- pub fn control_umask ( ) {
999- use rustix:: fs:: Mode ;
1000- rustix:: process:: umask ( Mode :: from_bits ( 0o022 ) . unwrap ( ) ) ;
1001- }
1002-
1003977 pub fn worktree_changes_to_discard_specs (
1004978 repo : & gix:: Repository ,
1005979 ) -> impl Iterator < Item = DiscardSpec > {
0 commit comments