Skip to content

Commit ef0410e

Browse files
committed
t: add a test for fetching from alternate repositories
Until recently, gitobj did not understand how to read from alternate repositories. This caused us to think objects not in the local repository were missing, and consequently, to cause the object scanner to exit early and a deadlock. Since both of these issue are now fixed, add a test that we can fetch from a shared repository without hangs or failures.
1 parent 35e69a2 commit ef0410e

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

t/t-fetch.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ begin_test "init for fetch tests"
5151
git push origin newbranch
5252
assert_server_object "$reponame" "$b_oid"
5353

54-
# This clone is used for subsequent tests
54+
# These clones are used for subsequent tests
5555
clone_repo "$reponame" clone
56+
git clone --shared "$TRASHDIR/clone" "$TRASHDIR/shared"
5657
)
5758
end_test
5859

@@ -70,6 +71,21 @@ begin_test "fetch"
7071
)
7172
end_test
7273

74+
begin_test "fetch (shared repository)"
75+
(
76+
set -e
77+
cd shared
78+
rm -rf .git/lfs/objects
79+
80+
git lfs fetch 2>&1 | tee fetch.log
81+
! grep "Could not scan" fetch.log
82+
assert_local_object "$contents_oid" 1
83+
84+
git lfs fsck 2>&1 | tee fsck.log
85+
grep "Git LFS fsck OK" fsck.log
86+
)
87+
end_test
88+
7389
begin_test "fetch with remote"
7490
(
7591
set -e

0 commit comments

Comments
 (0)