Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/subcommand/checkout_subcommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ void checkout_subcommand::run()
update_head(repo, annotated_commit, target_name);

std::cout << "Switched to a new branch '" << target_name << "'" << std::endl;
return;
}
else if (!pathspecs.empty())
{
Expand Down
2 changes: 2 additions & 0 deletions test/test_checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def test_checkout_b(repo_init_with_commit, git2cpp_path, tmp_path):
p_checkout = subprocess.run(checkout_cmd, capture_output=True, cwd=tmp_path, text=True)
assert p_checkout.returncode == 0
assert "Switched to a new branch 'foregone'" in p_checkout.stdout
assert "Switched to branch 'foregone'" not in p_checkout.stdout

branch_cmd = [git2cpp_path, "branch"]
p_branch = subprocess.run(branch_cmd, capture_output=True, cwd=tmp_path, text=True)
Expand Down Expand Up @@ -65,6 +66,7 @@ def test_checkout_B_force_create(repo_init_with_commit, git2cpp_path, tmp_path):
p_checkout = subprocess.run(checkout_cmd, capture_output=True, cwd=tmp_path, text=True)
assert p_checkout.returncode == 0
assert "Switched to a new branch 'resetme'" in p_checkout.stdout
assert "Switched to branch 'resetme'" not in p_checkout.stdout

# Verify we're on the branch
branch_cmd = [git2cpp_path, "branch"]
Expand Down
Loading