From 58664db6007920939d94977cc7382a5709b16558 Mon Sep 17 00:00:00 2001 From: Justin Wernick Date: Wed, 12 Jul 2023 17:13:52 +0200 Subject: Starting with tests for the planned git housekeeping tasks --- tests/cli.rs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'tests/cli.rs') diff --git a/tests/cli.rs b/tests/cli.rs index b8ada66..0520e89 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -271,3 +271,37 @@ fn can_delete_a_repo() -> Result<()> { Ok(()) } + +#[test] +#[ignore] +fn git_housekeeping_repacks_objects() -> Result<()> { + let mut c = TestContext::new_interactive()?; + let repo_path = personal_repo_path(REPO_NAME); + let repo_dir = c.personal_repo_dir(REPO_NAME); + + c.p.send_line(&format!("init {}", REPO_NAME))?; + c.expect_successful_init_message(&repo_path)?; + + let checkout_dir = create_clone(&c, &repo_dir, REPO_NAME); + create_commit(&checkout_dir)?; + + // push to the repo + // check that objects exist, not packs + // run housekeeping + // check that only packs exist + Ok(()) +} + +#[test] +#[ignore] +fn git_housekeeping_cleans_out_stale_refs() -> Result<()> { + // create a repo + // create a local clone + // make branch b, with commit b + // push it to the repo + // delete branch b on the remote + // check that commit b is still accessible by hash on the remote + // run housekeeping + // check that commit b isn't in the repo anymore + Ok(()) +} -- cgit v1.2.3