@@ -71,7 +71,7 @@ def test_current_branch(self):
7171 self .assertIsNone (groups )
7272
7373 def test_file_addition (self ):
74- """Test basic git branch actions on the clone."""
74+ """Test basic git add actions on the clone."""
7575 with ProjectTempClone (desired_branch_name = "main" ) as clone :
7676 branch = clone .create_branch (f"test-{ uuid4 ()} " )
7777 clone .checkout (branch )
@@ -89,6 +89,22 @@ def test_file_addition(self):
8989 added_files = [Path (clone .root ).joinpath (f ) for f in clone .list_files_added_on_current_branch ()]
9090 self .assertTrue (test_file in added_files )
9191
92+ def test_repo_clean (self ):
93+ """Test basic git clean on the clone."""
94+ with ProjectTempClone (desired_branch_name = "main" ) as clone :
95+ branch = clone .create_branch (f"test-{ uuid4 ()} " )
96+ clone .checkout (branch )
97+ self .assertTrue (len (clone .list_files_added_on_current_branch ()) == 0 )
98+ test_file = Path (clone .root ).joinpath (f"branch-test-{ uuid4 ()} .txt" )
99+ test_file .touch ()
100+ uncommitted_changes = clone .uncommitted_changes
101+ self .assertTrue (test_file in uncommitted_changes )
102+ self .assertTrue (clone .is_dirty ())
103+ clone .clean ()
104+ self .assertFalse (clone .is_dirty ())
105+ uncommitted_changes = clone .uncommitted_changes
106+ self .assertTrue (len (uncommitted_changes ) == 0 )
107+
92108 def test_file_addition_with_paths_to_initial_repository (self ):
93109 """Test basic git add on the clone."""
94110 git = ProjectGitWrapper ()
0 commit comments