refuse a dependency add of an issue on itself
This commit is contained in:
parent
8895bfc63f
commit
a70b25847e
1 changed files with 19 additions and 0 deletions
|
|
@ -202,6 +202,11 @@ fn apply_and_verify(
|
|||
/// `Internal Server Error`) and accepts longer cycles without complaint,
|
||||
/// so the check walks `dependency list` client-side.
|
||||
fn refuse_cycle(client: &Client, owner: &str, name: &str, number: u64, dep: u64) -> Result<()> {
|
||||
if dep == number {
|
||||
bail!(
|
||||
"hive-forge dependency add: #{number} cannot depend on itself, which would create a cycle"
|
||||
);
|
||||
}
|
||||
let path = find_dependency_path(dep, number, |n| {
|
||||
let deps = dependency_summaries(client, owner, name, n)?;
|
||||
Ok(deps
|
||||
|
|
|
|||
Loading…
Reference in a new issue