Re: [PATCH v3 13/28] fetch: support fetching from a shallow repository
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Nov 27, 2013, 09:47 UTC
- Message-ID
- <CAPig+cTaNuq+f7=27wnZgNi4niMt0xQyQxKq3VdpuH8ZvXxdYQ@mail.gmail.com>
- 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 <pclouds@gmail.com> wrote:
Show 23 quoted lines
> 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/> />/
Show 17 quoted lines
> + 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 <<EOF >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 > + > +'