threads / patch / 33876

patch, 6 partst5000: add test for pax extended header generation

Subject: [PATCH 0/6] t5000: add test for pax extended header generation

## tl;dr

15 messages between May 20, 2013 and May 20, 2013. Diffs are folded; open one to read it.

replies: 14people: 4as markdown or json

René Scharfe· May 20, 2013, 09:58 UTC · lore

This series adds a test that exercises git archive's pax header code. It checks for tar versions that don't support pax headers and works around their deficiency.

The first five patches are cleanups and refactorings to centralize tar calls into a helper function. The last patch adds the workaround at this central place and a file to the test archive whose name is too long to fit into the path field of a standard tar header, making a pax extended header necessary.

René Scharfe (6):
  t5000: integrate export-subst tests into regular tests
  t5000, t5003: create directories for extracted files lazily
  t5000: factor out check_tar
  t5000: use check_tar for prefix test
  t5000: simplify tar-tree tests
  t5000: test long filenames
 t/t5000-tar-tree.sh    | 160 +++++++++++++++++++++++++------------------------
 t/t5000/pax.tar        | Bin 0 -> 10240 bytes
 t/t5003-archive-zip.sh |   2 +-
 3 files changed, 84 insertions(+), 78 deletions(-)
 create mode 100644 t/t5000/pax.tar
-- 
1.8.2.3
René Scharfe· May 20, 2013, 09:58 UTC · re: René Scharfe · lore

[PATCH 1/6] t5000: integrate export-subst tests into regular tests

Instead of creating extra archives for testing substitutions, set the attribute export-subst and overwrite the marked file with the expected (expanded) content right between commiting and archiving. Thus placeholder expansion based on the committed content is performed with each archive creation and the comparision with the contents of directory a yields the correct result. We can then remove the special tests for export-subst.

Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
---
 t/t5000-tar-tree.sh | 38 ++++++--------------------------------
 1 file changed, 6 insertions(+), 32 deletions(-)
Show changes to t/t5000-tar-tree.sh +6 −32
diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index 3fbd366..68b5698 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -62,6 +62,12 @@ test_expect_success \
      git update-ref HEAD $(TZ=GMT GIT_COMMITTER_DATE="2005-05-27 22:00:00" \
      git commit-tree $treeid </dev/null)'
 
+test_expect_success 'setup export-subst' '
+	echo "substfile?" export-subst >>.git/info/attributes &&
+	git log --max-count=1 "--pretty=format:A${SUBSTFORMAT}O" HEAD \
+		>a/substfile1
+'
+
 test_expect_success \
     'create bare clone' \
     'git clone --bare . bare.git &&
@@ -148,38 +154,6 @@ test_expect_success \
     'validate file contents with prefix' \
     'diff -r a c/prefix/a'
 
-test_expect_success \
-    'create archives with substfiles' \
-    'cp .git/info/attributes .git/info/attributes.before &&
-     echo "substfile?" export-subst >>.git/info/attributes &&
-     git archive HEAD >f.tar &&
-     git archive --prefix=prefix/ HEAD >g.tar &&
-     mv .git/info/attributes.before .git/info/attributes'
-
-test_expect_success \
-    'extract substfiles' \
-    '(mkdir f && cd f && "$TAR" xf -) <f.tar'
-
-test_expect_success \
-     'validate substfile contents' \
-     'git log --max-count=1 "--pretty=format:A${SUBSTFORMAT}O" HEAD \
-      >f/a/substfile1.expected &&
-      test_cmp f/a/substfile1.expected f/a/substfile1 &&
-      test_cmp a/substfile2 f/a/substfile2
-'
-
-test_expect_success \
-    'extract substfiles from archive with prefix' \
-    '(mkdir g && cd g && "$TAR" xf -) <g.tar'
-
-test_expect_success \
-     'validate substfile contents from archive with prefix' \
-     'git log --max-count=1 "--pretty=format:A${SUBSTFORMAT}O" HEAD \
-      >g/prefix/a/substfile1.expected &&
-      test_cmp g/prefix/a/substfile1.expected g/prefix/a/substfile1 &&
-      test_cmp a/substfile2 g/prefix/a/substfile2
-'
-
 test_expect_success 'git archive with --output, override inferred format' '
 	git archive --format=tar --output=d4.zip HEAD &&
 	test_cmp b.tar d4.zip
-- 
1.8.2.3
Eric Sunshine· May 20, 2013, 19:53 UTC · re: René Scharfe · lore

Re: [PATCH 1/6] t5000: integrate export-subst tests into regular tests

On Mon, May 20, 2013 at 5:58 AM, René Scharfe <rene.scharfe@lsrfire.ath.cx> wrote:

Show 5 quoted lines
> Instead of creating extra archives for testing substitutions, set the
> attribute export-subst and overwrite the marked file with the expected
> (expanded) content right between commiting and archiving.  Thus
> placeholder expansion based on the committed content is performed with
> each archive creation and the comparision with the contents of directory
s/comparision/comparison/
> a yields the correct result.  We can then remove the special tests for
> export-subst.
>
> Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
René Scharfe· May 20, 2013, 20:22 UTC · re: Eric Sunshine · lore

Re: [PATCH 1/6] t5000: integrate export-subst tests into regular tests

Am 20.05.2013 21:53, schrieb Eric Sunshine:
Show 5 quoted lines
> On Mon, May 20, 2013 at 5:58 AM, René Scharfe
> <rene.scharfe@lsrfire.ath.cx> wrote:
>> Instead of creating extra archives for testing substitutions, set the
>> attribute export-subst and overwrite the marked file with the expected
>> (expanded) content right between commiting and archiving.  Thus
s/commiting/committing/
>> placeholder expansion based on the committed content is performed with
>> each archive creation and the comparision with the contents of directory
>
> s/comparision/comparison/
My spelling is getting worse and worse.
René
René Scharfe· May 20, 2013, 09:58 UTC · re: René Scharfe · lore

[PATCH 2/6] t5000, t5003: create directories for extracted files lazily

Create the directories b and c just before they are needed instead of up front. For t5003 it turns out we don't need them at all. For t5000 it makes the coming modifications easier.

Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
---
 t/t5000-tar-tree.sh    | 6 +++---
 t/t5003-archive-zip.sh | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
Show changes to 2 files +4 −4

t/t5000-tar-tree.sh, t/t5003-archive-zip.sh

diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index 68b5698..41cd609 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -32,7 +32,7 @@ SUBSTFORMAT=%H%n
 
 test_expect_success \
     'populate workdir' \
-    'mkdir a b c &&
+    'mkdir a &&
      echo simple textfile >a/a &&
      mkdir a/bin &&
      cp /bin/sh a/bin &&
@@ -126,7 +126,7 @@ test_expect_success \
 
 test_expect_success \
     'extract tar archive' \
-    '(cd b && "$TAR" xf -) <b.tar'
+    '(mkdir b && cd b && "$TAR" xf -) <b.tar'
 
 test_expect_success \
     'validate filenames' \
@@ -143,7 +143,7 @@ test_expect_success \
 
 test_expect_success \
     'extract tar archive with prefix' \
-    '(cd c && "$TAR" xf -) <c.tar'
+    '(mkdir c && cd c && "$TAR" xf -) <c.tar'
 
 test_expect_success \
     'validate filenames with prefix' \
diff --git a/t/t5003-archive-zip.sh b/t/t5003-archive-zip.sh
index 4e7b05d..c72f71e 100755
--- a/t/t5003-archive-zip.sh
+++ b/t/t5003-archive-zip.sh
@@ -37,7 +37,7 @@ check_zip() {
 
 test_expect_success \
     'populate workdir' \
-    'mkdir a b c &&
+    'mkdir a &&
      echo simple textfile >a/a &&
      mkdir a/bin &&
      cp /bin/sh a/bin &&
-- 
1.8.2.3
René Scharfe· May 20, 2013, 09:58 UTC · re: René Scharfe · lore

[PATCH 3/6] t5000: factor out check_tar

Create a helper function that extracts a tar archive and checks its contents, modelled after check_zip in t5003.

Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
---
 t/t5000-tar-tree.sh | 35 ++++++++++++++++++++++-------------
 1 file changed, 22 insertions(+), 13 deletions(-)
Show changes to t/t5000-tar-tree.sh +22 −13
diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index 41cd609..8337a1f 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -30,6 +30,26 @@ GUNZIP=${GUNZIP:-gzip -d}
 
 SUBSTFORMAT=%H%n
 
+check_tar() {
+	tarfile=$1.tar
+	listfile=$1.lst
+	dir=$1
+	dir_with_prefix=$dir/$2
+
+	test_expect_success ' extract tar archive' '
+		(mkdir $dir && cd $dir && "$TAR" xf -) <$tarfile
+	'
+
+	test_expect_success ' validate filenames' '
+		(cd ${dir_with_prefix}a && find .) | sort >$listfile &&
+		test_cmp a.lst $listfile
+	'
+
+	test_expect_success ' validate file contents' '
+		diff -r a ${dir_with_prefix}a
+	'
+}
+
 test_expect_success \
     'populate workdir' \
     'mkdir a &&
@@ -81,6 +101,8 @@ test_expect_success \
     'git archive' \
     'git archive HEAD >b.tar'
 
+check_tar b
+
 test_expect_success \
     'git tar-tree' \
     'git tar-tree HEAD >b2.tar'
@@ -125,19 +147,6 @@ test_expect_success \
      test_cmp .git/$(git symbolic-ref HEAD) b.commitid'
 
 test_expect_success \
-    'extract tar archive' \
-    '(mkdir b && cd b && "$TAR" xf -) <b.tar'
-
-test_expect_success \
-    'validate filenames' \
-    '(cd b/a && find .) | sort >b.lst &&
-     test_cmp a.lst b.lst'
-
-test_expect_success \
-    'validate file contents' \
-    'diff -r a b/a'
-
-test_expect_success \
     'git tar-tree with prefix' \
     'git tar-tree HEAD prefix >c.tar'
 
-- 
1.8.2.3
Eric Sunshine· May 20, 2013, 19:54 UTC · re: René Scharfe · lore

Re: [PATCH 3/6] t5000: factor out check_tar

On Mon, May 20, 2013 at 5:58 AM, René Scharfe <rene.scharfe@lsrfire.ath.cx> wrote:

Show 23 quoted lines
> Create a helper function that extracts a tar archive and checks its
> contents, modelled after check_zip in t5003.
>
> Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
> ---
>  t/t5000-tar-tree.sh | 35 ++++++++++++++++++++++-------------
>  1 file changed, 22 insertions(+), 13 deletions(-)
>
> diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
> index 41cd609..8337a1f 100755
> --- a/t/t5000-tar-tree.sh
> +++ b/t/t5000-tar-tree.sh
> @@ -30,6 +30,26 @@ GUNZIP=${GUNZIP:-gzip -d}
>
>  SUBSTFORMAT=%H%n
>
> +check_tar() {
> +       tarfile=$1.tar
> +       listfile=$1.lst
> +       dir=$1
> +       dir_with_prefix=$dir/$2
> +
> +       test_expect_success ' extract tar archive' '
s/' extract/'extract/
> +               (mkdir $dir && cd $dir && "$TAR" xf -) <$tarfile
> +       '
> +
> +       test_expect_success ' validate filenames' '
s/' validate/'validate/
Show 5 quoted lines
> +               (cd ${dir_with_prefix}a && find .) | sort >$listfile &&
> +               test_cmp a.lst $listfile
> +       '
> +
> +       test_expect_success ' validate file contents' '
s/' validate/'validate/
Show 43 quoted lines
> +               diff -r a ${dir_with_prefix}a
> +       '
> +}
> +
>  test_expect_success \
>      'populate workdir' \
>      'mkdir a &&
> @@ -81,6 +101,8 @@ test_expect_success \
>      'git archive' \
>      'git archive HEAD >b.tar'
>
> +check_tar b
> +
>  test_expect_success \
>      'git tar-tree' \
>      'git tar-tree HEAD >b2.tar'
> @@ -125,19 +147,6 @@ test_expect_success \
>       test_cmp .git/$(git symbolic-ref HEAD) b.commitid'
>
>  test_expect_success \
> -    'extract tar archive' \
> -    '(mkdir b && cd b && "$TAR" xf -) <b.tar'
> -
> -test_expect_success \
> -    'validate filenames' \
> -    '(cd b/a && find .) | sort >b.lst &&
> -     test_cmp a.lst b.lst'
> -
> -test_expect_success \
> -    'validate file contents' \
> -    'diff -r a b/a'
> -
> -test_expect_success \
>      'git tar-tree with prefix' \
>      'git tar-tree HEAD prefix >c.tar'
>
> --
> 1.8.2.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
René Scharfe· May 20, 2013, 20:22 UTC · re: Eric Sunshine · lore

Re: [PATCH 3/6] t5000: factor out check_tar

Am 20.05.2013 21:54, schrieb Eric Sunshine:
Show 11 quoted lines
> On Mon, May 20, 2013 at 5:58 AM, René Scharfe
> <rene.scharfe@lsrfire.ath.cx> wrote:
>> +check_tar() {
>> +       tarfile=$1.tar
>> +       listfile=$1.lst
>> +       dir=$1
>> +       dir_with_prefix=$dir/$2
>> +
>> +       test_expect_success ' extract tar archive' '
>
> s/' extract/'extract/

It might be a bit hackish, but I added that single space here and in the three other cases intentionally in order to designate sub-tests.

René
René Scharfe· May 20, 2013, 09:58 UTC · re: René Scharfe · lore

[PATCH 4/6] t5000: use check_tar for prefix test

Perform the full range of checks against all archived files instead of looking only at the file type of a few of them. Also add a test of a git archive with a prefix ending in with a slash, i.e. adding a full directory level.

Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
---
 t/t5000-tar-tree.sh | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
Show changes to t/t5000-tar-tree.sh +12 −12
diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index 8337a1f..5a9b570 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -103,6 +103,18 @@ test_expect_success \
 
 check_tar b
 
+test_expect_success 'git archive --prefix=prefix/' '
+	git archive --prefix=prefix/ HEAD >with_prefix.tar
+'
+
+check_tar with_prefix prefix/
+
+test_expect_success 'git-archive --prefix=olde-' '
+	git archive --prefix=olde- HEAD >with_olde-prefix.tar
+'
+
+check_tar with_olde-prefix olde-
+
 test_expect_success \
     'git tar-tree' \
     'git tar-tree HEAD >b2.tar'
@@ -180,18 +192,6 @@ test_expect_success 'clients cannot access unreachable commits' '
 	test_must_fail git archive --remote=. $sha1 >remote.tar
 '
 
-test_expect_success 'git-archive --prefix=olde-' '
-	git archive --prefix=olde- >h.tar HEAD &&
-	(
-		mkdir h &&
-		cd h &&
-		"$TAR" xf - <../h.tar
-	) &&
-	test -d h/olde-a &&
-	test -d h/olde-a/bin &&
-	test -f h/olde-a/bin/sh
-'
-
 test_expect_success 'setup tar filters' '
 	git config tar.tar.foo.command "tr ab ba" &&
 	git config tar.bar.command "tr ab ba" &&
-- 
1.8.2.3
René Scharfe· May 20, 2013, 09:58 UTC · re: René Scharfe · lore

[PATCH 5/6] t5000: simplify tar-tree tests

Just compare the archives created by git tar-tree with the ones created using git archive with the equivalent options, whose contents are checked already, instead of extracting them again.

Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
---
 t/t5000-tar-tree.sh | 31 ++++++++-----------------------
 1 file changed, 8 insertions(+), 23 deletions(-)
Show changes to t/t5000-tar-tree.sh +8 −23
diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index 5a9b570..a1f35d2 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -115,14 +115,6 @@ test_expect_success 'git-archive --prefix=olde-' '
 
 check_tar with_olde-prefix olde-
 
-test_expect_success \
-    'git tar-tree' \
-    'git tar-tree HEAD >b2.tar'
-
-test_expect_success \
-    'git archive vs. git tar-tree' \
-    'test_cmp b.tar b2.tar'
-
 test_expect_success 'git archive on large files' '
     test_config core.bigfilethreshold 1 &&
     git archive HEAD >b3.tar &&
@@ -158,22 +150,15 @@ test_expect_success \
     'git get-tar-commit-id <b.tar >b.commitid &&
      test_cmp .git/$(git symbolic-ref HEAD) b.commitid'
 
-test_expect_success \
-    'git tar-tree with prefix' \
-    'git tar-tree HEAD prefix >c.tar'
-
-test_expect_success \
-    'extract tar archive with prefix' \
-    '(mkdir c && cd c && "$TAR" xf -) <c.tar'
-
-test_expect_success \
-    'validate filenames with prefix' \
-    '(cd c/prefix/a && find .) | sort >c.lst &&
-     test_cmp a.lst c.lst'
+test_expect_success 'git tar-tree' '
+	git tar-tree HEAD >tar-tree.tar &&
+	test_cmp b.tar tar-tree.tar
+'
 
-test_expect_success \
-    'validate file contents with prefix' \
-    'diff -r a c/prefix/a'
+test_expect_success 'git tar-tree with prefix' '
+	git tar-tree HEAD prefix >tar-tree_with_prefix.tar &&
+	test_cmp with_prefix.tar tar-tree_with_prefix.tar
+'
 
 test_expect_success 'git archive with --output, override inferred format' '
 	git archive --format=tar --output=d4.zip HEAD &&
-- 
1.8.2.3
René Scharfe· May 20, 2013, 09:58 UTC · re: René Scharfe · lore

[PATCH 6/6] t5000: test long filenames

Add a file with a long name to the test archive in order to check entries with pax extended headers. Also add a check for tar versions that doen't understand this format. Those versions should extract the headers as a regular files. Add code to check_tar() to interpret the path header if present, so that our tests work even with those tar versions.

It's important to use the fallback code only if needed to still be able to detect git archive errorously creating pax headers as regular file entries (with a suitable tar version, of course).

The archive used to check for pax header support in tar was generated using GNU tar 1.26 and its option --format=pax.

Tested successfully on NetBSD 6.1, which has a tar version lacking pax header support.

Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
---
 t/t5000-tar-tree.sh |  46 ++++++++++++++++++++++++++++++++++++++++++++++
 t/t5000/pax.tar     | Bin 0 -> 10240 bytes
 2 files changed, 46 insertions(+)
 create mode 100644 t/t5000/pax.tar
Show changes to 2 files +46 −0

t/t5000-tar-tree.sh, t/t5000/pax.tar

diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index a1f35d2..c2023b1 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -30,6 +30,32 @@ GUNZIP=${GUNZIP:-gzip -d}
 
 SUBSTFORMAT=%H%n
 
+test_lazy_prereq TAR_NEEDS_PAX_FALLBACK '
+	(
+		mkdir pax &&
+		cd pax &&
+		"$TAR" xf "$TEST_DIRECTORY"/t5000/pax.tar &&
+		test -f PaxHeaders.1791/file
+	)
+'
+
+get_pax_header() {
+	file=$1
+	header=$2=
+
+	while read len rest
+	do
+		if test "$len" = $(echo "$len $rest" | wc -c)
+		then
+			case "$rest" in
+			$header*)
+				echo "${rest#$header}"
+				;;
+			esac
+		fi
+	done <"$file"
+}
+
 check_tar() {
 	tarfile=$1.tar
 	listfile=$1.lst
@@ -40,6 +66,24 @@ check_tar() {
 		(mkdir $dir && cd $dir && "$TAR" xf -) <$tarfile
 	'
 
+	test_expect_success TAR_NEEDS_PAX_FALLBACK ' interpret pax headers' '
+		(
+			cd $dir &&
+			for header in *.paxheader
+			do
+				data=${header%.paxheader}.data &&
+				if test -h $data -o -e $data
+				then
+					path=$(get_pax_header $header path) &&
+					if test -n "$path"
+					then
+						mv "$data" "$path"
+					fi
+				fi
+			done
+		)
+	'
+
 	test_expect_success ' validate filenames' '
 		(cd ${dir_with_prefix}a && find .) | sort >$listfile &&
 		test_cmp a.lst $listfile
@@ -54,6 +98,8 @@ test_expect_success \
     'populate workdir' \
     'mkdir a &&
      echo simple textfile >a/a &&
+     ten=0123456789 && hundred=$ten$ten$ten$ten$ten$ten$ten$ten$ten$ten &&
+     echo long filename >a/four$hundred &&
      mkdir a/bin &&
      cp /bin/sh a/bin &&
      printf "A\$Format:%s\$O" "$SUBSTFORMAT" >a/substfile1 &&
diff --git a/t/t5000/pax.tar b/t/t5000/pax.tar
new file mode 100644
index 0000000000000000000000000000000000000000..d91173714991fded560fcd6a8aaec6aa6ec7f5e8
GIT binary patch
literal 10240
zcmeIy%?g4*5Ww+0_Y^*X&3@?Sp?k+(L29F*2+YXGPl*s(6d@sk|6W#S)Sdakm@c<v
zvkB!sRJT<7LN5=eb5OG`X;<!?>h^Yh?xL+x+Gv-HHCB5i+IVkN(#%@Lz{l>lx~$rg
z2GWzmuipCRCcpUG2dyNR`g93vZSz%O3b*p9Sn-k>pDo&KIhx%KXMfulr%w}@f7;`7
zyU`e%|L&jgG5=zmO1_@SxRf~Zp8x84t>bJTc^pGH_qWm2pU!{O2LS{SKmY**5I_I{
l1Q0*~0R#|0009ILKmY**5I_I{1Q0*~0R#|00D->}cmml}KZ5`O

literal 0
HcmV?d00001
-- 
1.8.2.3
Eric Sunshine· May 20, 2013, 19:55 UTC · re: René Scharfe · lore

Re: [PATCH 6/6] t5000: test long filenames

On Mon, May 20, 2013 at 5:58 AM, René Scharfe <rene.scharfe@lsrfire.ath.cx> wrote:

Show 9 quoted lines
> diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
> index a1f35d2..c2023b1 100755
> --- a/t/t5000-tar-tree.sh
> +++ b/t/t5000-tar-tree.sh
> @@ -40,6 +66,24 @@ check_tar() {
>                 (mkdir $dir && cd $dir && "$TAR" xf -) <$tarfile
>         '
>
> +       test_expect_success TAR_NEEDS_PAX_FALLBACK ' interpret pax headers' '
s/' interpret/'interpret/
Show 42 quoted lines
> +               (
> +                       cd $dir &&
> +                       for header in *.paxheader
> +                       do
> +                               data=${header%.paxheader}.data &&
> +                               if test -h $data -o -e $data
> +                               then
> +                                       path=$(get_pax_header $header path) &&
> +                                       if test -n "$path"
> +                                       then
> +                                               mv "$data" "$path"
> +                                       fi
> +                               fi
> +                       done
> +               )
> +       '
> +
>         test_expect_success ' validate filenames' '
>                 (cd ${dir_with_prefix}a && find .) | sort >$listfile &&
>                 test_cmp a.lst $listfile
> @@ -54,6 +98,8 @@ test_expect_success \
>      'populate workdir' \
>      'mkdir a &&
>       echo simple textfile >a/a &&
> +     ten=0123456789 && hundred=$ten$ten$ten$ten$ten$ten$ten$ten$ten$ten &&
> +     echo long filename >a/four$hundred &&
>       mkdir a/bin &&
>       cp /bin/sh a/bin &&
>       printf "A\$Format:%s\$O" "$SUBSTFORMAT" >a/substfile1 &&
> diff --git a/t/t5000/pax.tar b/t/t5000/pax.tar
> new file mode 100644
> index 0000000000000000000000000000000000000000..d91173714991fded560fcd6a8aaec6aa6ec7f5e8
> GIT binary patch
> literal 10240
> zcmeIy%?g4*5Ww+0_Y^*X&3@?Sp?k+(L29F*2+YXGPl*s(6d@sk|6W#S)Sdakm@c<v
> zvkB!sRJT<7LN5=eb5OG`X;<!?>h^Yh?xL+x+Gv-HHCB5i+IVkN(#%@Lz{l>lx~$rg
> z2GWzmuipCRCcpUG2dyNR`g93vZSz%O3b*p9Sn-k>pDo&KIhx%KXMfulr%w}@f7;`7
> zyU`e%|L&jgG5=zmO1_@SxRf~Zp8x84t>bJTc^pGH_qWm2pU!{O2LS{SKmY**5I_I{
> l1Q0*~0R#|0009ILKmY**5I_I{1Q0*~0R#|00D->}cmml}KZ5`O
>
> literal 0
> HcmV?d00001
René Scharfe· May 20, 2013, 11:43 UTC · re: René Scharfe · lore

Re: [PATCH 0/6] t5000: add test for pax extended header generation

Am 20.05.2013 11:58, schrieb René Scharfe:
Show 9 quoted lines
> This series adds a test that exercises git archive's pax header code.
> It checks for tar versions that don't support pax headers and works
> around their deficiency.
>
> The first five patches are cleanups and refactorings to centralize
> tar calls into a helper function.  The last patch adds the workaround
> at this central place and a file to the test archive whose name is too
> long to fit into the path field of a standard tar header, making a pax
> extended header necessary.

Forgot to mention that the last patch was prompted by Thomas' recent test coverage patches.

René

← back to recent threads