File tree Expand file tree Collapse file tree 3 files changed +7
-57
lines changed
Expand file tree Collapse file tree 3 files changed +7
-57
lines changed Original file line number Diff line number Diff line change @@ -31,4 +31,4 @@ dialoguer = "0.11"
3131assert_cmd = " 2.0"
3232tempfile = " 3.20"
3333predicates = " 3.1"
34- criterion = " 0.5 "
34+ criterion = " 0.7 "
Original file line number Diff line number Diff line change @@ -216,36 +216,6 @@ fn test_get_current_branch_success() {
216216 assert ! ( !branch. is_empty( ) ) ;
217217}
218218
219- #[ test]
220- fn test_get_current_branch_not_git_repo ( ) {
221- let temp_dir = TempDir :: new ( ) . expect ( "Failed to create temp directory" ) ;
222-
223- // Create a completely isolated directory that definitely isn't a git repo
224- let isolated_dir = temp_dir. path ( ) . join ( "isolated" ) ;
225- std:: fs:: create_dir ( & isolated_dir) . expect ( "Failed to create isolated directory" ) ;
226-
227- // Use a wrapper to test the function in isolation without changing global state
228- let result = std:: thread:: spawn ( move || {
229- // Unset GIT_DIR and GIT_WORK_TREE to ensure git doesn't find parent repos
230- unsafe {
231- std:: env:: remove_var ( "GIT_DIR" ) ;
232- std:: env:: remove_var ( "GIT_WORK_TREE" ) ;
233- }
234-
235- // Change directory in this isolated thread
236- if std:: env:: set_current_dir ( & isolated_dir) . is_err ( ) {
237- return Err ( "Failed to change directory" ) ;
238- }
239-
240- get_current_branch ( )
241- } )
242- . join ( )
243- . expect ( "Thread should not panic" ) ;
244-
245- assert ! ( result. is_err( ) ) ;
246- assert_eq ! ( result. unwrap_err( ) , "Not in a git repository" ) ;
247- }
248-
249219#[ test]
250220fn test_get_upstream_branch_no_upstream ( ) {
251221 let ( _temp_dir, repo_path) = create_test_repo ( ) ;
You can’t perform that action at this time.
0 commit comments