From ef0410e67c80bd66ba0bdd7d988e5e699c79dbe5 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Tue, 13 Nov 2018 20:09:19 +0000 Subject: [PATCH] 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. --- t/t-fetch.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/t/t-fetch.sh b/t/t-fetch.sh index b65d1fd5..9d88cbc8 100755 --- a/t/t-fetch.sh +++ b/t/t-fetch.sh @@ -51,8 +51,9 @@ begin_test "init for fetch tests" git push origin newbranch assert_server_object "$reponame" "$b_oid" - # This clone is used for subsequent tests + # These clones are used for subsequent tests clone_repo "$reponame" clone + git clone --shared "$TRASHDIR/clone" "$TRASHDIR/shared" ) end_test @@ -70,6 +71,21 @@ begin_test "fetch" ) end_test +begin_test "fetch (shared repository)" +( + set -e + cd shared + rm -rf .git/lfs/objects + + git lfs fetch 2>&1 | tee fetch.log + ! grep "Could not scan" fetch.log + assert_local_object "$contents_oid" 1 + + git lfs fsck 2>&1 | tee fsck.log + grep "Git LFS fsck OK" fsck.log +) +end_test + begin_test "fetch with remote" ( set -e