From ed884475e20eebb860546d8f73f7d26c8a264f03 Mon Sep 17 00:00:00 2001 From: Tim Hutt Date: Wed, 16 Jun 2021 11:43:19 +0100 Subject: [PATCH] Tweaks & increment version --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/lib.rs | 6 ++---- tests/utils/mod.rs | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 71bdb1d..4aca48a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -48,7 +48,7 @@ dependencies = [ [[package]] name = "autorebase" -version = "0.4.0" +version = "0.4.1" dependencies = [ "anyhow", "argh", diff --git a/Cargo.toml b/Cargo.toml index 583c888..36f73be 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "autorebase" -version = "0.4.0" +version = "0.4.1" authors = ["Tim Hutt "] edition = "2018" license = "MIT" diff --git a/src/lib.rs b/src/lib.rs index 7bba0bd..bc790be 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -404,10 +404,8 @@ fn get_branches(repo_path: &Path) -> Result> { worktree, }) }) - .filter(|branch| match branch { - Ok(b) if b.branch == TEMPORARY_BRANCH_NAME => false, - _ => true, - }) + // This temporary branch should have been deleted but filter it out just in case something went wrong. + .filter(|branch| !matches!(branch, Ok(b) if b.branch == TEMPORARY_BRANCH_NAME)) .collect::>()?; Ok(branches) } diff --git a/tests/utils/mod.rs b/tests/utils/mod.rs index 1f95dc5..ee64819 100644 --- a/tests/utils/mod.rs +++ b/tests/utils/mod.rs @@ -62,7 +62,7 @@ pub struct CommitDescription { message: String, /// Map from filename to the new contents or None to delete it. changes: HashMap>, - /// Branch names on this commit. + /// Branch names on this commit, and their upstream branch if any. branches: Vec<(String, Option)>, /// Child commits. children: Vec,