From 335e86d8e756188cb5eb354f18af816b51d28d5e Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Fri, 23 Jun 2023 23:27:48 -0700 Subject: [PATCH] test_branch_command: use bare repositories Otherwise, those tests cannot use `jj git push`. This is an issue with a test in the next commit, and I don't want people to copy these tests and be surprised. --- tests/test_branch_command.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_branch_command.rs b/tests/test_branch_command.rs index 98be8a2a8..8f6636dd1 100644 --- a/tests/test_branch_command.rs +++ b/tests/test_branch_command.rs @@ -288,7 +288,7 @@ fn test_branch_forget_fetched_branch() { test_env.jj_cmd_success(test_env.env_root(), &["init", "repo", "--git"]); let repo_path = test_env.env_root().join("repo"); let git_repo_path = test_env.env_root().join("git-repo"); - let git_repo = git2::Repository::init(git_repo_path).unwrap(); + let git_repo = git2::Repository::init_bare(git_repo_path).unwrap(); let signature = git2::Signature::new("Some One", "some.one@example.com", &git2::Time::new(0, 0)).unwrap(); let mut tree_builder = git_repo.treebuilder(None).unwrap(); @@ -385,7 +385,7 @@ fn test_branch_forget_deleted_or_nonexistent_branch() { test_env.jj_cmd_success(test_env.env_root(), &["init", "repo", "--git"]); let repo_path = test_env.env_root().join("repo"); let git_repo_path = test_env.env_root().join("git-repo"); - let git_repo = git2::Repository::init(git_repo_path).unwrap(); + let git_repo = git2::Repository::init_bare(git_repo_path).unwrap(); let signature = git2::Signature::new("Some One", "some.one@example.com", &git2::Time::new(0, 0)).unwrap(); let mut tree_builder = git_repo.treebuilder(None).unwrap();