Skip to content

Commit 4cc7ff5

Browse files
committed
test(git): Fix masquerade feature list for shallow fetch
1 parent 89b89bd commit 4cc7ff5

File tree

1 file changed

+17
-45
lines changed

1 file changed

+17
-45
lines changed

tests/testsuite/git_shallow.rs

Lines changed: 17 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,7 @@ fn perform_two_revs_same_deps(mode: RepoMode) {
102102
RepoMode::Shallow => "build -v -Zgitoxide=fetch -Zgit=shallow-deps",
103103
};
104104
foo.cargo(args)
105-
.masquerade_as_nightly_cargo(&[
106-
"unstable features must be available for -Z gitoxide and -Z git",
107-
])
105+
.masquerade_as_nightly_cargo(&["gitoxide=fetch", "git=shallow-deps"])
108106
.run();
109107
assert!(foo.bin("foo").is_file());
110108
foo.process(&foo.bin("foo")).run();
@@ -131,9 +129,7 @@ fn gitoxide_clones_registry_with_shallow_protocol_and_follow_up_with_git2_fetch(
131129
p.cargo("fetch")
132130
.arg("-Zgitoxide=fetch")
133131
.arg("-Zgit=shallow-index")
134-
.masquerade_as_nightly_cargo(&[
135-
"unstable features must be available for -Z gitoxide and -Z git",
136-
])
132+
.masquerade_as_nightly_cargo(&["gitoxide=fetch", "git=shallow-index"])
137133
.run();
138134

139135
let shallow_repo = gix::open_opts(find_index(), gix::open::Options::isolated())?;
@@ -214,9 +210,7 @@ fn gitoxide_clones_git_dependency_with_shallow_protocol_and_git2_is_used_for_fol
214210
p.cargo("update")
215211
.arg("-Zgitoxide=fetch")
216212
.arg("-Zgit=shallow-deps")
217-
.masquerade_as_nightly_cargo(&[
218-
"unstable features must be available for -Z gitoxide and -Z git",
219-
])
213+
.masquerade_as_nightly_cargo(&["gitoxide=fetch", "git=shallow-deps"])
220214
.run();
221215

222216
let db_clone = gix::open_opts(
@@ -352,9 +346,7 @@ fn gitoxide_shallow_clone_followed_by_non_shallow_update() -> anyhow::Result<()>
352346
p.cargo("update")
353347
.arg("-Zgitoxide=fetch")
354348
.arg("-Zgit=shallow-deps")
355-
.masquerade_as_nightly_cargo(&[
356-
"unstable features must be available for -Z gitoxide and -Z git",
357-
])
349+
.masquerade_as_nightly_cargo(&["gitoxide=fetch", "git=shallow-deps"])
358350
.run();
359351

360352
let shallow_db_clone = gix::open_opts(
@@ -398,7 +390,7 @@ fn gitoxide_shallow_clone_followed_by_non_shallow_update() -> anyhow::Result<()>
398390

399391
p.cargo("update")
400392
.arg("-Zgitoxide=fetch") // shallow-deps is omitted intentionally
401-
.masquerade_as_nightly_cargo(&["unstable features must be available for -Z gitoxide"])
393+
.masquerade_as_nightly_cargo(&["gitoxide=fetch"])
402394
.run();
403395

404396
let db_clone = gix::open_opts(
@@ -471,9 +463,7 @@ fn gitoxide_clones_registry_with_shallow_protocol_and_follow_up_fetch_maintains_
471463
p.cargo("fetch")
472464
.arg("-Zgitoxide=fetch")
473465
.arg("-Zgit=shallow-index")
474-
.masquerade_as_nightly_cargo(&[
475-
"unstable features must be available for -Z gitoxide and -Z git",
476-
])
466+
.masquerade_as_nightly_cargo(&["gitoxide=fetch", "git=shallow-index"])
477467
.run();
478468

479469
let repo = gix::open_opts(find_index(), gix::open::Options::isolated())?;
@@ -491,9 +481,7 @@ fn gitoxide_clones_registry_with_shallow_protocol_and_follow_up_fetch_maintains_
491481
p.cargo("update")
492482
.arg("-Zgitoxide=fetch")
493483
.arg("-Zgit=shallow-index") // NOTE: the flag needs to be consistent or else a different index is created
494-
.masquerade_as_nightly_cargo(&[
495-
"unstable features must be available for -Z gitoxide and -Z git",
496-
])
484+
.masquerade_as_nightly_cargo(&["gitoxide=fetch", "git=shallow-index"])
497485
.run();
498486

499487
assert_eq!(
@@ -511,9 +499,7 @@ fn gitoxide_clones_registry_with_shallow_protocol_and_follow_up_fetch_maintains_
511499
p.cargo("update")
512500
.arg("-Zgitoxide=fetch")
513501
.arg("-Zgit=shallow-index")
514-
.masquerade_as_nightly_cargo(&[
515-
"unstable features must be available for -Z gitoxide and -Z git",
516-
])
502+
.masquerade_as_nightly_cargo(&["gitoxide=fetch", "git=shallow-index"])
517503
.run();
518504

519505
assert_eq!(
@@ -550,7 +536,7 @@ fn gitoxide_clones_registry_without_shallow_protocol_and_follow_up_fetch_uses_sh
550536
.build();
551537
p.cargo("fetch")
552538
.arg("-Zgitoxide=fetch")
553-
.masquerade_as_nightly_cargo(&["unstable features must be available for -Z gitoxide"])
539+
.masquerade_as_nightly_cargo(&["gitoxide=fetch"])
554540
.run();
555541

556542
let repo = gix::open_opts(find_index(), gix::open::Options::isolated())?;
@@ -568,9 +554,7 @@ fn gitoxide_clones_registry_without_shallow_protocol_and_follow_up_fetch_uses_sh
568554
p.cargo("update")
569555
.arg("-Zgitoxide=fetch")
570556
.arg("-Zgit=shallow-index")
571-
.masquerade_as_nightly_cargo(&[
572-
"unstable features must be available for -Z gitoxide and -Z git",
573-
])
557+
.masquerade_as_nightly_cargo(&["gitoxide=fetch", "git=shallow-index"])
574558
.run();
575559

576560
let shallow_repo = gix::open_opts(
@@ -592,9 +576,7 @@ fn gitoxide_clones_registry_without_shallow_protocol_and_follow_up_fetch_uses_sh
592576
p.cargo("update")
593577
.arg("-Zgitoxide=fetch")
594578
.arg("-Zgit=shallow-index")
595-
.masquerade_as_nightly_cargo(&[
596-
"unstable features must be available for -Z gitoxide and -Z git",
597-
])
579+
.masquerade_as_nightly_cargo(&["gitoxide=fetch", "git=shallow-index"])
598580
.run();
599581

600582
assert_eq!(
@@ -610,7 +592,7 @@ fn gitoxide_clones_registry_without_shallow_protocol_and_follow_up_fetch_uses_sh
610592

611593
p.cargo("update")
612594
.arg("-Zgitoxide=fetch")
613-
.masquerade_as_nightly_cargo(&["unstable features must be available for -Z gitoxide"])
595+
.masquerade_as_nightly_cargo(&["gitoxide=fetch"])
614596
.run();
615597

616598
assert_eq!(
@@ -662,9 +644,7 @@ fn gitoxide_git_dependencies_switch_from_branch_to_rev() -> anyhow::Result<()> {
662644
p.cargo("check")
663645
.arg("-Zgitoxide=fetch")
664646
.arg("-Zgit=shallow-deps")
665-
.masquerade_as_nightly_cargo(&[
666-
"unstable features must be available for -Z gitoxide and -Z git",
667-
])
647+
.masquerade_as_nightly_cargo(&["gitoxide=fetch", "git=shallow-deps"])
668648
.run();
669649

670650
let db_clone = gix::open_opts(
@@ -695,9 +675,7 @@ fn gitoxide_git_dependencies_switch_from_branch_to_rev() -> anyhow::Result<()> {
695675
p.cargo("check")
696676
.arg("-Zgitoxide=fetch")
697677
.arg("-Zgit=shallow-deps")
698-
.masquerade_as_nightly_cargo(&[
699-
"unstable features must be available for -Z gitoxide and -Z git",
700-
])
678+
.masquerade_as_nightly_cargo(&["gitoxide=fetch", "git=shallow-deps"])
701679
.run();
702680

703681
assert!(
@@ -746,9 +724,7 @@ fn shallow_deps_work_with_revisions_and_branches_mixed_on_same_dependency() -> a
746724
p.cargo("check")
747725
.arg("-Zgitoxide=fetch")
748726
.arg("-Zgit=shallow-deps")
749-
.masquerade_as_nightly_cargo(&[
750-
"unstable features must be available for -Z gitoxide and -Z git",
751-
])
727+
.masquerade_as_nightly_cargo(&["gitoxide=fetch", "git=shallow-deps"])
752728
.run();
753729

754730
let db_paths = glob::glob(paths::home().join(".cargo/git/db/bar-*").to_str().unwrap())?
@@ -789,9 +765,7 @@ fn gitoxide_clones_registry_with_shallow_protocol_and_aborts_and_updates_again(
789765
p.cargo("fetch")
790766
.arg("-Zgitoxide=fetch")
791767
.arg("-Zgit=shallow-index")
792-
.masquerade_as_nightly_cargo(&[
793-
"unstable features must be available for -Z gitoxide and -Z git",
794-
])
768+
.masquerade_as_nightly_cargo(&["gitoxide=fetch", "git=shallow-index"])
795769
.run();
796770

797771
let repo = gix::open_opts(find_index(), gix::open::Options::isolated())?;
@@ -814,9 +788,7 @@ fn gitoxide_clones_registry_with_shallow_protocol_and_aborts_and_updates_again(
814788
p.cargo("update")
815789
.arg("-Zgitoxide=fetch")
816790
.arg("-Zgit=shallow-index")
817-
.masquerade_as_nightly_cargo(&[
818-
"unstable features must be available for -Z gitoxide and -Z git",
819-
])
791+
.masquerade_as_nightly_cargo(&["gitoxide=fetch", "git=shallow-index"])
820792
.run();
821793

822794
assert!(!shallow_lock.is_file(), "the repository was re-initialized");

0 commit comments

Comments
 (0)