-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
91b2b40
commit d6ac8cd
Showing
5 changed files
with
689 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/// Function to iterate over the commits in a repository in reverse topological order. | ||
/// | ||
/// # Arguments | ||
/// * `Repository` - A reference to the repository to iterate over. | ||
/// | ||
/// # Returns | ||
/// * Result containing the next commit in the iteration or an error if no commits are found. | ||
pub fn Fn(Repository: &Repository) -> Result<Oid, git2::Error> { | ||
let mut Walk = Repository.revwalk()?; | ||
Walk.push_head()?; | ||
Walk.set_sorting(Sort::TOPOLOGICAL | Sort::REVERSE)?; | ||
|
||
match Walk.next() { | ||
Some(Ok(Identifier)) => Ok(Identifier), | ||
Some(Err(_Error)) => Err(_Error), | ||
None => Err(git2::Error::from_str("Cannot git2.")), | ||
} | ||
} | ||
|
||
use git2::{Oid, Repository, Sort}; |
Oops, something went wrong.