Subject: Re: [PATCH] archive: fix archive generation for empty trees

From: René Scharfe <[email-masked]>
Date: Thu, 08 Mar 2012 18:46:11 +0100

Am 08.03.2012 01:09, schrieb Brodie Rao:
> diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
> index 527c9e7..404786f 100755
> --- a/t/t5000-tar-tree.sh
> +++ b/t/t5000-tar-tree.sh
> @@ -360,4 +360,20 @@ test_expect_success GZIP 'remote tar.gz can be disabled' '
>   		>remote.tar.gz
>   '
>
> +test_expect_success \
> +    'git archive with an empty tree and a prefix' \
> +    'git rm -r .&&
> +     git commit -m empty&&
> +     git archive --format=tar --prefix=empty/ HEAD>  e1.tar&&
> +     "$TAR" tf e1.tar'
> +
> +test_expect_success \
> +    'git archive with an empty tree and no prefix' \
> +    'git archive --format=tar HEAD>  e2.tar&&
> +     test_must_fail "$TAR" tf e2.tar'

This test fails for me, i.e. tar does not complain about the empty 
archive (GNU tar 1.25).  Perhaps use git archive -v to generate a list 
of entries?

> +
> +test_expect_success \
> +    'git archive on specific paths with an empty tree' \
> +    'test_must_fail git archive --format=tar --prefix=empty/ HEAD foo'
> +
>   test_done
> -- 1.7.9.2
>