Skip to content

Commit

Permalink
fix(set-commits): Allow --initial-depth to be specified alongside --a…
Browse files Browse the repository at this point in the history
…uto (#1703)
  • Loading branch information
kamilogorek authored Jul 31, 2023
1 parent 9382274 commit 3d0595e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/commands/releases/set_commits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,14 @@ pub fn make_command(command: Command) -> Command {
will create a release with the default commits count (or the one specified with `--initial-depth`) \
instead of failing the command."))
.arg(Arg::new("local")
.conflicts_with_all(["auto", "clear", "commits", ])
.conflicts_with_all(["auto", "clear", "commits"])
.long("local")
.action(ArgAction::SetTrue)
.help("Set commits of a release from local git.{n}\
This requires that the command is run from within a git repository. \
sentry-cli will then automatically find remotely configured \
repositories and discover commits."))
.arg(Arg::new("initial-depth")
.conflicts_with("auto")
.long("initial-depth")
.value_name("INITIAL DEPTH")
.value_parser(clap::value_parser!(usize))
Expand Down Expand Up @@ -107,7 +106,10 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
if let Some(commits) = matches.get_many::<String>("commits") {
for spec in commits {
let commit_spec = CommitSpec::parse(spec)?;
if repos.iter().any(|r| r.name.to_lowercase() == commit_spec.repo.to_lowercase()) {
if repos
.iter()
.any(|r| r.name.to_lowercase() == commit_spec.repo.to_lowercase())
{
commit_specs.push(commit_spec);
} else {
bail!("Unknown repo '{}'", commit_spec.repo);
Expand Down

0 comments on commit 3d0595e

Please sign in to comment.