parent
9a9f2e71ca
commit
320abe9b22
1 changed files with 14 additions and 6 deletions
|
@ -140,13 +140,21 @@ impl Example {
|
||||||
pub async fn setup(&mut self) -> Result<()> {
|
pub async fn setup(&mut self) -> Result<()> {
|
||||||
let repo_path = repo_path_for_url(&self.base.url);
|
let repo_path = repo_path_for_url(&self.base.url);
|
||||||
|
|
||||||
println!("{}Fetching", self.log_prefix);
|
let revision_exists = run_git(&repo_path, &["rev-parse", "--verify", &self.base.revision])
|
||||||
|
.await
|
||||||
|
.is_ok();
|
||||||
|
|
||||||
run_git(
|
if !revision_exists {
|
||||||
&repo_path,
|
println!(
|
||||||
&["fetch", "--depth", "1", "origin", &self.base.revision],
|
"{}Fetching revision {}",
|
||||||
)
|
self.log_prefix, &self.base.revision
|
||||||
.await?;
|
);
|
||||||
|
run_git(
|
||||||
|
&repo_path,
|
||||||
|
&["fetch", "--depth", "1", "origin", &self.base.revision],
|
||||||
|
)
|
||||||
|
.await?;
|
||||||
|
}
|
||||||
|
|
||||||
let worktree_path = self.worktree_path();
|
let worktree_path = self.worktree_path();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue