From dbfa267d604355c68e026a1f22accb8bf0fca1c9 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Fri, 16 Apr 2021 08:28:36 -0700 Subject: [PATCH] cli: remove unnecessary check for checkout when filtering uninteresting heads When removing uninteresting heads, we had a check for explicitly keeping the checkout (working copy) commit. I'm pretty sure that is a leftover from before we had the "pruned" flag on commits; the working copy should never be pruned or obsolete. --- src/commands.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/commands.rs b/src/commands.rs index 00832d7da..c9e97da65 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -1037,7 +1037,6 @@ fn graph_log_template(settings: &UserSettings) -> String { fn skip_uninteresting_heads(repo: &ReadonlyRepo, heads: &HashSet) -> HashSet { let index = repo.index(); - let checkout_id = repo.view().checkout().clone(); let mut result = HashSet::new(); let mut work: Vec<_> = heads .iter() @@ -1050,9 +1049,7 @@ fn skip_uninteresting_heads(repo: &ReadonlyRepo, heads: &HashSet) -> H if result.contains(&commit_id) { continue; } - if (!index_entry.is_pruned() && !evolution.is_obsolete(&commit_id)) - || commit_id == checkout_id - { + if !index_entry.is_pruned() && !evolution.is_obsolete(&commit_id) { result.insert(commit_id); } else { for parent_entry in index_entry.parents() {