fix profile ops, fully fixes #4

master
Aleš Katona 2 years ago
parent 9f4919e9af
commit 84193de488
Signed by: almindor
GPG Key ID: 2F773149BF38B48F

@ -326,9 +326,12 @@ impl Vcs {
}
}
let current_ref = project.repo.current_ref()?;
// stash changes before moving project off to a new ref
let stashed_changes = project.repo.stash_changes(&current_ref)?;
let stashed_changes = if let Some(current_ref) = project.current_ref()? {
project.repo.stash_changes(&current_ref)?
} else {
false
};
// try to switch to new ref using provided setter
let new_ref = match setter(project) {
@ -371,9 +374,10 @@ impl Vcs {
let mut table = Table::new();
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));
}
}
Ok(Value::Table(table))
}

Loading…
Cancel
Save