feat: with fixes
Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
51e3ea3e2f
commit
0b66de6daf
@ -1,4 +1,4 @@
|
||||
use crate::command::{PleaseConfig, PleaseProjectConfig, PleaseSettingsConfig};
|
||||
use crate::command::{PleaseConfig, PleaseProjectConfig};
|
||||
|
||||
pub mod drone;
|
||||
|
||||
|
@ -163,7 +163,7 @@ impl GiteaClient {
|
||||
let branch: String = branch.into();
|
||||
let mut found_commit = false;
|
||||
loop {
|
||||
let (mut new_commits, has_more) = get_commits(&owner, &repo, &branch, page)?;
|
||||
let (new_commits, has_more) = get_commits(&owner, &repo, &branch, page)?;
|
||||
|
||||
for commit in new_commits {
|
||||
if commit.sha.contains(&since_sha) {
|
||||
|
@ -71,12 +71,12 @@ mod tests {
|
||||
use semver::Version;
|
||||
use tracing_test::traced_test;
|
||||
|
||||
use crate::{environment::get_from_environment, gitea_client::Commit};
|
||||
|
||||
|
||||
#[test]
|
||||
#[traced_test]
|
||||
fn is_prerelease() {
|
||||
let mut version = Version::parse("0.0.0-alpha.1").unwrap();
|
||||
let version = Version::parse("0.0.0-alpha.1").unwrap();
|
||||
|
||||
let commits = vec![
|
||||
"feat: something",
|
||||
@ -93,7 +93,7 @@ mod tests {
|
||||
#[test]
|
||||
#[traced_test]
|
||||
fn is_patch() {
|
||||
let mut version = Version::parse("0.0.1").unwrap();
|
||||
let version = Version::parse("0.0.1").unwrap();
|
||||
|
||||
let commits = vec![
|
||||
"fix: something",
|
||||
@ -111,7 +111,7 @@ mod tests {
|
||||
#[test]
|
||||
#[traced_test]
|
||||
fn is_minor() {
|
||||
let mut version = Version::parse("0.1.0").unwrap();
|
||||
let version = Version::parse("0.1.0").unwrap();
|
||||
|
||||
let commits = vec![
|
||||
"feat: something",
|
||||
@ -128,7 +128,7 @@ mod tests {
|
||||
#[test]
|
||||
#[traced_test]
|
||||
fn is_major() {
|
||||
let mut version = Version::parse("0.1.0").unwrap();
|
||||
let version = Version::parse("0.1.0").unwrap();
|
||||
|
||||
let commits = vec![
|
||||
"feat: something",
|
||||
@ -148,7 +148,7 @@ mod tests {
|
||||
#[test]
|
||||
#[traced_test]
|
||||
fn chore_is_patch() {
|
||||
let mut version = Version::parse("0.1.0").unwrap();
|
||||
let version = Version::parse("0.1.0").unwrap();
|
||||
|
||||
let commits = vec!["chore: something"];
|
||||
|
||||
@ -159,7 +159,7 @@ mod tests {
|
||||
#[test]
|
||||
#[traced_test]
|
||||
fn refactor_is_patch() {
|
||||
let mut version = Version::parse("0.1.0").unwrap();
|
||||
let version = Version::parse("0.1.0").unwrap();
|
||||
|
||||
let commits = vec!["refactor: something"];
|
||||
|
||||
@ -170,7 +170,7 @@ mod tests {
|
||||
#[test]
|
||||
#[traced_test]
|
||||
fn unknown_commits_are_patch() {
|
||||
let mut version = Version::parse("0.1.0").unwrap();
|
||||
let version = Version::parse("0.1.0").unwrap();
|
||||
|
||||
let commits = vec!["blablabla some commit"];
|
||||
|
||||
@ -181,7 +181,7 @@ mod tests {
|
||||
#[test]
|
||||
#[traced_test]
|
||||
fn nothing_returns_none() {
|
||||
let mut version = Version::parse("0.1.0").unwrap();
|
||||
let version = Version::parse("0.1.0").unwrap();
|
||||
|
||||
let commits: Vec<&str> = Vec::new();
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
use std::cmp::Reverse;
|
||||
|
||||
use crate::gitea_client::{Commit, Tag};
|
||||
use crate::gitea_client::{Tag};
|
||||
use semver::Version;
|
||||
|
||||
pub fn get_most_significant_version<'a>(tags: Vec<&'a Tag>) -> Option<&'a Tag> {
|
||||
|
Loading…
Reference in New Issue
Block a user