Skip to content

Commit a739b00

Browse files
committed
test(git): Clarify we are doing shallow fetches
1 parent adf2578 commit a739b00

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

tests/testsuite/git_shallow.rs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ fn fetch_two_revs_same_deps(backend: Backend, mode: RepoMode) {
129129
}
130130

131131
#[cargo_test]
132-
fn gitoxide_clones_registry_with_shallow_protocol_and_follow_up_with_git2_fetch(
132+
fn gitoxide_fetch_registry_with_shallow_protocol_and_follow_up_with_git2_fetch(
133133
) -> anyhow::Result<()> {
134134
Package::new("bar", "1.0.0").publish();
135135
let p = project()
@@ -160,7 +160,7 @@ fn gitoxide_clones_registry_with_shallow_protocol_and_follow_up_with_git2_fetch(
160160
.all()?
161161
.count(),
162162
1,
163-
"shallow clones always start at depth of 1 to minimize download size"
163+
"shallow fetch always start at depth of 1 to minimize download size"
164164
);
165165
assert!(shallow_repo.is_shallow());
166166

@@ -179,14 +179,14 @@ fn gitoxide_clones_registry_with_shallow_protocol_and_follow_up_with_git2_fetch(
179179
.all()?
180180
.count(),
181181
3,
182-
"an entirely new repo was cloned which is never shallow"
182+
"an entirely new repo was fetched which is never shallow"
183183
);
184184
assert!(!repo.is_shallow());
185185
Ok(())
186186
}
187187

188188
#[cargo_test]
189-
fn gitoxide_clones_git_dependency_with_shallow_protocol_and_git2_is_used_for_followup_fetches(
189+
fn gitoxide_fetch_git_dependency_with_shallow_protocol_and_git2_is_used_for_followup_fetches(
190190
) -> anyhow::Result<()> {
191191
// Example where an old lockfile with an explicit branch="master" in Cargo.toml.
192192
Package::new("bar", "1.0.0").publish();
@@ -245,7 +245,7 @@ fn gitoxide_clones_git_dependency_with_shallow_protocol_and_git2_is_used_for_fol
245245
.all()?
246246
.count(),
247247
1,
248-
"db clones are shallow and have a shortened history"
248+
"db fetch are shallow and have a shortened history"
249249
);
250250

251251
let dep_checkout = gix::open_opts(
@@ -256,7 +256,7 @@ fn gitoxide_clones_git_dependency_with_shallow_protocol_and_git2_is_used_for_fol
256256
assert_eq!(
257257
dep_checkout.head_id()?.ancestors().all()?.count(),
258258
1,
259-
"db checkouts are hard-linked clones with the shallow file copied separately."
259+
"db checkouts are hard-linked fetches with the shallow file copied separately."
260260
);
261261

262262
bar.change_file("src/lib.rs", "// another change");
@@ -324,7 +324,7 @@ fn gitoxide_clones_git_dependency_with_shallow_protocol_and_git2_is_used_for_fol
324324
}
325325

326326
#[cargo_test]
327-
fn gitoxide_shallow_clone_followed_by_non_shallow_update() -> anyhow::Result<()> {
327+
fn gitoxide_shallow_fetch_followed_by_non_shallow_update() -> anyhow::Result<()> {
328328
Package::new("bar", "1.0.0").publish();
329329
let (bar, bar_repo) = git::new_repo("bar", |p| {
330330
p.file("Cargo.toml", &basic_manifest("bar", "1.0.0"))
@@ -381,7 +381,7 @@ fn gitoxide_shallow_clone_followed_by_non_shallow_update() -> anyhow::Result<()>
381381
.all()?
382382
.count(),
383383
1,
384-
"db clones are shallow and have a shortened history"
384+
"db fetches are shallow and have a shortened history"
385385
);
386386

387387
let dep_checkout = gix::open_opts(
@@ -392,7 +392,7 @@ fn gitoxide_shallow_clone_followed_by_non_shallow_update() -> anyhow::Result<()>
392392
assert_eq!(
393393
dep_checkout.head_id()?.ancestors().all()?.count(),
394394
1,
395-
"db checkouts are hard-linked clones with the shallow file copied separately."
395+
"db checkouts are hard-linked fetches with the shallow file copied separately."
396396
);
397397

398398
bar.change_file("src/lib.rs", "// another change");
@@ -463,7 +463,7 @@ fn gitoxide_shallow_clone_followed_by_non_shallow_update() -> anyhow::Result<()>
463463
}
464464

465465
#[cargo_test]
466-
fn gitoxide_clones_registry_with_shallow_protocol_and_follow_up_fetch_maintains_shallowness(
466+
fn gitoxide_fetch_registry_with_shallow_protocol_and_follow_up_fetch_maintains_shallowness(
467467
) -> anyhow::Result<()> {
468468
Package::new("bar", "1.0.0").publish();
469469
let p = project()
@@ -493,7 +493,7 @@ fn gitoxide_clones_registry_with_shallow_protocol_and_follow_up_fetch_maintains_
493493
.all()?
494494
.count(),
495495
1,
496-
"shallow clones always start at depth of 1 to minimize download size"
496+
"shallow fetches always start at depth of 1 to minimize download size"
497497
);
498498
assert!(repo.is_shallow());
499499

@@ -535,9 +535,9 @@ fn gitoxide_clones_registry_with_shallow_protocol_and_follow_up_fetch_maintains_
535535
Ok(())
536536
}
537537

538-
/// If there is shallow *and* non-shallow clones, non-shallow will naturally be returned due to sort order.
538+
/// If there is shallow *and* non-shallow fetches, non-shallow will naturally be returned due to sort order.
539539
#[cargo_test]
540-
fn gitoxide_clones_registry_without_shallow_protocol_and_follow_up_fetch_uses_shallowness(
540+
fn gitoxide_fetch_registry_without_shallow_protocol_and_follow_up_fetch_uses_shallowness(
541541
) -> anyhow::Result<()> {
542542
Package::new("bar", "1.0.0").publish();
543543
let p = project()
@@ -587,7 +587,7 @@ fn gitoxide_clones_registry_without_shallow_protocol_and_follow_up_fetch_uses_sh
587587
.all()?
588588
.count(),
589589
1,
590-
"the follow up clones an entirely new index which is now shallow and which is in its own location"
590+
"the follow up fetch an entirely new index which is now shallow and which is in its own location"
591591
);
592592
assert!(shallow_repo.is_shallow());
593593

@@ -630,14 +630,14 @@ fn gitoxide_clones_registry_without_shallow_protocol_and_follow_up_fetch_uses_sh
630630
#[cargo_test]
631631
fn gitoxide_git_dependencies_switch_from_branch_to_rev() -> anyhow::Result<()> {
632632
// db exists from previous build, then dependency changes to refer to revision that isn't
633-
// available in the shallow clone.
633+
// available in the shallow fetch.
634634

635635
let (bar, bar_repo) = git::new_repo("bar", |p| {
636636
p.file("Cargo.toml", &basic_manifest("bar", "1.0.0"))
637637
.file("src/lib.rs", "")
638638
});
639639

640-
// this commit would not be available in a shallow clone.
640+
// this commit would not be available in a shallow fetch.
641641
let first_commit_pre_change = bar_repo.head().unwrap().target().unwrap();
642642

643643
bar.change_file("src/lib.rs", "// change");
@@ -713,7 +713,7 @@ fn shallow_deps_work_with_revisions_and_branches_mixed_on_same_dependency() -> a
713713
.file("src/lib.rs", "")
714714
});
715715

716-
// this commit would not be available in a shallow clone.
716+
// this commit would not be available in a shallow fetch.
717717
let first_commit_pre_change = bar_repo.head().unwrap().target().unwrap();
718718

719719
bar.change_file("src/lib.rs", "// change");
@@ -765,8 +765,8 @@ fn shallow_deps_work_with_revisions_and_branches_mixed_on_same_dependency() -> a
765765
}
766766

767767
#[cargo_test]
768-
fn gitoxide_clones_registry_with_shallow_protocol_and_aborts_and_updates_again(
769-
) -> anyhow::Result<()> {
768+
fn gitoxide_fetch_registry_with_shallow_protocol_and_aborts_and_updates_again() -> anyhow::Result<()>
769+
{
770770
Package::new("bar", "1.0.0").publish();
771771
let p = project()
772772
.file(
@@ -795,11 +795,11 @@ fn gitoxide_clones_registry_with_shallow_protocol_and_aborts_and_updates_again(
795795
.all()?
796796
.count(),
797797
1,
798-
"shallow clones always start at depth of 1 to minimize download size"
798+
"shallow fetches always start at depth of 1 to minimize download size"
799799
);
800800
assert!(repo.is_shallow());
801801
let shallow_lock = repo.shallow_file().with_extension("lock");
802-
// adding a lock file and deleting the original simulates a left-over clone that was aborted, leaving a lock file
802+
// adding a lock file and deleting the original simulates a left-over fetch that was aborted, leaving a lock file
803803
// in place without ever having moved it to the right location.
804804
std::fs::write(&shallow_lock, &[])?;
805805
std::fs::remove_file(repo.shallow_file())?;
@@ -819,7 +819,7 @@ fn gitoxide_clones_registry_with_shallow_protocol_and_aborts_and_updates_again(
819819
.all()?
820820
.count(),
821821
1,
822-
"it's a fresh shallow clone - otherwise it would have 2 commits if the previous shallow clone would still be present"
822+
"it's a fresh shallow fetch - otherwise it would have 2 commits if the previous shallow fetch would still be present"
823823
);
824824

825825
Ok(())

0 commit comments

Comments
 (0)