MCPcopy Create free account
hub / github.com/dtormoen/tsk-tsk / test_branch_operations

Function test_branch_operations

src/test_utils/git_test_utils.rs:376–390  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

374
375 #[test]
376 fn test_branch_operations() -> Result<()> {
377 let repo = TestGitRepository::new()?;
378 repo.init_with_commit()?;
379
380 let initial_branch = repo.current_branch()?;
381 assert!(initial_branch == "main" || initial_branch == "master");
382
383 repo.checkout_new_branch("feature")?;
384 assert_eq!(repo.current_branch()?, "feature");
385
386 repo.checkout_branch(&initial_branch)?;
387 assert_eq!(repo.current_branch()?, initial_branch);
388
389 Ok(())
390 }
391
392 #[test]
393 fn test_setup_with_uncommitted_changes() -> Result<()> {

Callers

nothing calls this directly

Calls 4

init_with_commitMethod · 0.80
current_branchMethod · 0.80
checkout_new_branchMethod · 0.80
checkout_branchMethod · 0.80

Tested by

no test coverage detected