|
|
@ -326,9 +326,12 @@ impl Vcs {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
let current_ref = project.repo.current_ref()?;
|
|
|
|
|
|
|
|
// stash changes before moving project off to a new ref
|
|
|
|
// stash changes before moving project off to a new ref
|
|
|
|
let stashed_changes = project.repo.stash_changes(¤t_ref)?;
|
|
|
|
let stashed_changes = if let Some(current_ref) = project.current_ref()? {
|
|
|
|
|
|
|
|
project.repo.stash_changes(¤t_ref)?
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
false
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// try to switch to new ref using provided setter
|
|
|
|
// try to switch to new ref using provided setter
|
|
|
|
let new_ref = match setter(project) {
|
|
|
|
let new_ref = match setter(project) {
|
|
|
@ -371,8 +374,9 @@ impl Vcs {
|
|
|
|
let mut table = Table::new();
|
|
|
|
let mut table = Table::new();
|
|
|
|
|
|
|
|
|
|
|
|
for project in &self.projects {
|
|
|
|
for project in &self.projects {
|
|
|
|
let head_ref_name = project.repo.current_ref()?;
|
|
|
|
if let Some(head_ref_name) = project.current_ref()? {
|
|
|
|
table.insert(project.name().into(), Value::String(head_ref_name));
|
|
|
|
table.insert(project.name().into(), Value::String(head_ref_name));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Ok(Value::Table(table))
|
|
|
|
Ok(Value::Table(table))
|
|
|
|