diff --git a/lib/src/commit.rs b/lib/src/commit.rs index a6ffe3ec2..3480c8152 100644 --- a/lib/src/commit.rs +++ b/lib/src/commit.rs @@ -117,12 +117,6 @@ impl Commit { &self.data } - pub fn is_empty(&self) -> bool { - let parents = self.parents(); - // TODO: Perhaps the root commit should also be considered empty. - parents.len() == 1 && parents[0].tree_id() == self.tree_id() - } - pub fn description(&self) -> &str { &self.data.description } diff --git a/lib/src/repo.rs b/lib/src/repo.rs index d7d90b061..008fb2872 100644 --- a/lib/src/repo.rs +++ b/lib/src/repo.rs @@ -835,7 +835,8 @@ impl MutableRepo { .store() .get_commit(&wc_commit_id) .map_err(EditCommitError::WorkingCopyCommitNotFound)?; - if wc_commit.is_empty() + if wc_commit.parent_ids().len() == 1 + && wc_commit.parents()[0].tree_id() == wc_commit.tree_id() && wc_commit.description().is_empty() && self.view().heads().contains(wc_commit.id()) {