From 755e28d044aaff9a8aa0fa4700105564726ec33d Mon Sep 17 00:00:00 2001 From: Justin Wernick Date: Fri, 14 Jul 2023 13:13:11 +0200 Subject: Add a housekeeping task, which does git gc --- tests/cli_test_utils/git.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/cli_test_utils/git.rs') diff --git a/tests/cli_test_utils/git.rs b/tests/cli_test_utils/git.rs index 150af45..fe6e1bd 100644 --- a/tests/cli_test_utils/git.rs +++ b/tests/cli_test_utils/git.rs @@ -46,6 +46,15 @@ pub fn create_commit(repo_dir: &Path) -> Result { Ok(commit_hash) } +pub fn push(local_repo_dir: &Path, branch: &str) { + Command::new("git") + .args(["push", "origin", branch]) + .current_dir(&local_repo_dir) + .timeout(std::time::Duration::from_secs(3)) + .assert() + .success(); +} + pub fn verify_repo_exists(repo_dir: &Path) { Command::new("git") .arg("rev-list") -- cgit v1.2.3