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:
parent
30aa459d2a
commit
dbfa267d60
1 changed files with 1 additions and 4 deletions
|
@ -1037,7 +1037,6 @@ fn graph_log_template(settings: &UserSettings) -> String {
|
||||||
|
|
||||||
fn skip_uninteresting_heads(repo: &ReadonlyRepo, heads: &HashSet<CommitId>) -> HashSet<CommitId> {
|
fn skip_uninteresting_heads(repo: &ReadonlyRepo, heads: &HashSet<CommitId>) -> HashSet<CommitId> {
|
||||||
let index = repo.index();
|
let index = repo.index();
|
||||||
let checkout_id = repo.view().checkout().clone();
|
|
||||||
let mut result = HashSet::new();
|
let mut result = HashSet::new();
|
||||||
let mut work: Vec<_> = heads
|
let mut work: Vec<_> = heads
|
||||||
.iter()
|
.iter()
|
||||||
|
@ -1050,9 +1049,7 @@ fn skip_uninteresting_heads(repo: &ReadonlyRepo, heads: &HashSet<CommitId>) -> H
|
||||||
if result.contains(&commit_id) {
|
if result.contains(&commit_id) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!index_entry.is_pruned() && !evolution.is_obsolete(&commit_id))
|
if !index_entry.is_pruned() && !evolution.is_obsolete(&commit_id) {
|
||||||
|| commit_id == checkout_id
|
|
||||||
{
|
|
||||||
result.insert(commit_id);
|
result.insert(commit_id);
|
||||||
} else {
|
} else {
|
||||||
for parent_entry in index_entry.parents() {
|
for parent_entry in index_entry.parents() {
|
||||||
|
|
Loading…
Reference in a new issue