Skip to content

Commit a1ef692

Browse files
committed
feat(git): pull branch after switching
1 parent f9ea6ef commit a1ef692

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/git.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ pub fn sync_repositories_to_branch(repositories: &[PathBuf], branch: &str) {
5454

5555
println!("\t!> Running git checkout {}", &branch);
5656
git_checkout(repository.to_path_buf(), branch.to_string());
57+
58+
println!("\t!> Running git pull");
59+
git_pull(repository.to_path_buf());
5760
println!("\n");
5861
}
5962
}
@@ -85,6 +88,11 @@ fn git_checkout(repository: PathBuf, branch: String) {
8588
run_command(command, args, repository);
8689
}
8790

91+
fn git_pull(repository: PathBuf) {
92+
let (command, args) = build_command("git pull");
93+
run_command(command, args, repository);
94+
}
95+
8896
fn git_fetch(repository: PathBuf) {
8997
let command_string = "git fetch";
9098
let (command, args) = build_command(command_string);

0 commit comments

Comments
 (0)