| 581 | } |
| 582 | |
| 583 | func TestRun_Replicate_SubcommandRejectsForce(t *testing.T) { |
| 584 | err := run(context.Background(), []string{ |
| 585 | modeReplicate, |
| 586 | "--force-with-lease", |
| 587 | "http://127.0.0.1:1/source.git", |
| 588 | "http://127.0.0.1:1/target.git", |
| 589 | }) |
| 590 | if err == nil { |
| 591 | t.Fatal("expected replicate --force-with-lease to be rejected") |
| 592 | } |
| 593 | if !strings.Contains(err.Error(), "replicate does not support force flags") { |
| 594 | t.Fatalf("unexpected error: %v", err) |
| 595 | } |
| 596 | } |
| 597 | |
| 598 | func TestRun_LegacyForceFlagRejected(t *testing.T) { |
| 599 | err := run(context.Background(), []string{ |