From: Eric Sunshine Date: Wed, 27 Nov 2013 09:47:26 GMT Subject: Re: [PATCH v3 13/28] fetch: support fetching from a shallow repository Message-ID: In-Reply-To: <1385351754-9954-14-git-send-email-pclouds@gmail.com> On Sun, Nov 24, 2013 at 10:55 PM, Nguyễn Thái Ngọc Duy wrote: > diff --git a/t/t5536-fetch-shallow.sh b/t/t5536-fetch-shallow.sh > new file mode 100755 > index 0000000..41de74d > --- /dev/null > +++ b/t/t5536-fetch-shallow.sh > @@ -0,0 +1,128 @@ > +#!/bin/sh > + > +test_description='fetch/clone from a shallow clone' > + > +. ./test-lib.sh > + > +commit() { > + echo "$1" >tracked && > + git add tracked && > + git commit -m "$1" > +} > + > +test_expect_success 'fetch something upstream has but hidden by clients shallow boundaries' ' > + # the blob "1" is available in .git but hidden by the > + # shallow2/.git/shallow and it should be resent > + ! git --git-dir=shallow2/.git cat-file blob `echo 1|git hash-object --stdin` >/dev/null && > + echo 1 > 1.t && s/> />/ > + git add 1.t && > + git commit -m add-1-back && > + ( > + cd shallow2 && > + git fetch ../.git +refs/heads/master:refs/remotes/top/master && > + git fsck && > + git log --format=%s top/master >actual && > + cat <expect && > +add-1-back > +4 > +3 > +EOF > + test_cmp expect actual > + ) && > + git --git-dir=shallow2/.git cat-file blob `echo 1|git hash-object --stdin` >/dev/null > + > +'