ok/jj
1
0
Fork 0
forked from mirrors/jj

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.
This commit is contained in:
Martin von Zweigbergk 2021-04-16 08:28:36 -07:00
parent 30aa459d2a
commit dbfa267d60

View file

@ -1037,7 +1037,6 @@ fn graph_log_template(settings: &UserSettings) -> String {
fn skip_uninteresting_heads(repo: &ReadonlyRepo, heads: &HashSet<CommitId>) -> HashSet<CommitId> {
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<CommitId>) -> 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() {