diff options
author | Justin Wernick <justin@worthe-it.co.za> | 2023-07-14 13:13:11 +0200 |
---|---|---|
committer | Justin Wernick <justin@worthe-it.co.za> | 2023-07-14 13:13:11 +0200 |
commit | 755e28d044aaff9a8aa0fa4700105564726ec33d (patch) | |
tree | 45eb98e20c340fc203737843cf43f766026d0c72 /tests/cli_test_utils | |
parent | 58664db6007920939d94977cc7382a5709b16558 (diff) |
Add a housekeeping task, which does git gc
Diffstat (limited to 'tests/cli_test_utils')
-rw-r--r-- | tests/cli_test_utils/git.rs | 9 |
1 files changed, 9 insertions, 0 deletions
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<String> { 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") |