Skip to content

Commit

Permalink
Revert "Add ext_common_ancestor feature to Cargo.toml"
Browse files Browse the repository at this point in the history
This reverts commit a3fd36d.

<!-- ps-id: cd0fdde6-11ce-432a-99a3-32d43efc4b05 -->
  • Loading branch information
drewdeponte committed Nov 20, 2023
1 parent a3fd36d commit 6f44241
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 64 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,3 @@ clap_mangen = "0.2.14"

[features]
backup_cmd = []
ext_common_ancestor = []
2 changes: 0 additions & 2 deletions src/ps/private/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ mod create_commit;
mod create_cwd_repo;
mod create_signed_commit;
mod create_unsigned_commit;
mod ext_common_ancestor;
mod ext_delete_remote_branch;
mod ext_fetch;
mod ext_push;
Expand Down Expand Up @@ -69,7 +68,6 @@ pub use create_commit::*;
pub use create_cwd_repo::*;
pub use create_signed_commit::*;
pub use create_unsigned_commit::*;
pub use ext_common_ancestor::*;
pub use ext_delete_remote_branch::*;
pub use ext_fetch::*;
pub use ext_push::*;
Expand Down
53 changes: 0 additions & 53 deletions src/ps/private/git/ext_common_ancestor.rs

This file was deleted.

11 changes: 3 additions & 8 deletions src/ps/private/state_computation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ pub fn get_list_branch_info(
#[derive(Debug)]
pub enum GetPatchInfoCollectionError {
GetBranchHeadOid,
GetCommonAncestor(Box<dyn std::error::Error>),
GetCommonAncestor(git::CommonAncestorError),
GetCommits(git::GitError),
GetRevisionOid(git2::Error),
FindCommit(git2::Error),
Expand All @@ -269,7 +269,7 @@ impl std::error::Error for GetPatchInfoCollectionError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match self {
Self::GetBranchHeadOid => None,
Self::GetCommonAncestor(e) => Some(e.as_ref()),
Self::GetCommonAncestor(e) => Some(e),
Self::GetCommits(e) => Some(e),
Self::GetRevisionOid(e) => Some(e),
Self::FindCommit(e) => Some(e),
Expand All @@ -296,13 +296,8 @@ pub fn get_patch_info_collection(
.get()
.target()
.ok_or(GetPatchInfoCollectionError::GetBranchHeadOid)?;

#[cfg(not(feature = "ext_common_ancestor"))]
let common_ancestor_oid = git::common_ancestor(repo, branch_head_oid, base_oid)
.map_err(|e| GetPatchInfoCollectionError::GetCommonAncestor(e.into()))?;
#[cfg(feature = "ext_common_ancestor")]
let common_ancestor_oid = git::ext_common_ancestor(branch_head_oid, base_oid)
.map_err(|e| GetPatchInfoCollectionError::GetCommonAncestor(e.into()))?;
.map_err(GetPatchInfoCollectionError::GetCommonAncestor)?;

let revwalk = git::get_revs(
repo,
Expand Down

0 comments on commit 6f44241

Please sign in to comment.