Raspbian Package Auto-Building

Build log for git (1:2.5.0-1) on armhf

git1:2.5.0-1armhf → 2015-08-08 05:17:12

sbuild (Debian sbuild) 0.65.2 (24 Mar 2015) on bm-wb-04

╔══════════════════════════════════════════════════════════════════════════════╗
║ git 1:2.5.0-1 (armhf)                                      08 Aug 2015 04:23 ║
╚══════════════════════════════════════════════════════════════════════════════╝

Package: git
Version: 1:2.5.0-1
Source Version: 1:2.5.0-1
Distribution: stretch-staging
Machine Architecture: armhf
Host Architecture: armhf
Build Architecture: armhf

I: NOTICE: Log filtering will replace 'build/git-EfndAz/git-2.5.0' with '«PKGBUILDDIR»'
I: NOTICE: Log filtering will replace 'build/git-EfndAz' with '«BUILDDIR»'
I: NOTICE: Log filtering will replace 'var/lib/schroot/mount/stretch-staging-armhf-sbuild-fcf5cca2-854e-40e2-af63-514f48582843' with '«CHROOT»'

┌──────────────────────────────────────────────────────────────────────────────┐
│ Update chroot                                                                │
└──────────────────────────────────────────────────────────────────────────────┘

Get:1 http://172.17.0.1 stretch-staging InRelease [11.3 kB]
Get:2 http://172.17.0.1 stretch-staging/main Sources [8215 kB]
Get:3 http://172.17.0.1 stretch-staging/main armhf Packages [10.1 MB]
Ign http://172.17.0.1 stretch-staging/main Translation-en
Fetched 18.3 MB in 33s (547 kB/s)
Reading package lists...

┌──────────────────────────────────────────────────────────────────────────────┐
│ Fetch source files                                                           │
└──────────────────────────────────────────────────────────────────────────────┘


Check APT
─────────

Checking available source versions...

Download source files with APT
──────────────────────────────

Reading package lists...
Building dependency tree...
Reading state information...
NOTICE: 'git' packaging is maintained in the 'Git' version control system at:
https://repo.or.cz/r/git/debian.git/
Need to get 4230 kB of source archives.
Get:1 http://172.17.0.1/private/ stretch-staging/main git 1:2.5.0-1 (dsc) [2765 B]
Get:2 http://172.17.0.1/private/ stretch-staging/main git 1:2.5.0-1 (tar) [3741 kB]
Get:3 http://172.17.0.1/private/ stretch-staging/main git 1:2.5.0-1 (diff) [487 kB]
Fetched 4230 kB in 1s (3808 kB/s)
Download complete and in download only mode

Check architectures
───────────────────


Check dependencies
──────────────────

Merged Build-Depends: build-essential, fakeroot
Filtered Build-Depends: build-essential, fakeroot
dpkg-deb: building package 'sbuild-build-depends-core-dummy' in '/«BUILDDIR»/resolver-qZHAoQ/apt_archive/sbuild-build-depends-core-dummy.deb'.
OK
Ign file: ./ InRelease
Get:1 file: ./ Release.gpg [299 B]
Get:2 file: ./ Release [2119 B]
Ign file: ./ Translation-en
Reading package lists...
Reading package lists...

┌──────────────────────────────────────────────────────────────────────────────┐
│ Install core build dependencies (apt-based resolver)                         │
└──────────────────────────────────────────────────────────────────────────────┘

Installing build dependencies
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
  sbuild-build-depends-core-dummy
debconf: delaying package configuration, since apt-utils is not installed
0 upgraded, 1 newly installed, 0 to remove and 18 not upgraded.
Need to get 0 B/758 B of archives.
After this operation, 0 B of additional disk space will be used.
Selecting previously unselected package sbuild-build-depends-core-dummy.
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 11966 files and directories currently installed.)
Preparing to unpack .../sbuild-build-depends-core-dummy.deb ...
Unpacking sbuild-build-depends-core-dummy (0.invalid.0) ...
Setting up sbuild-build-depends-core-dummy (0.invalid.0) ...
Merged Build-Depends: libc6-dev | libc-dev, gcc (>= 4:4.9.1), g++ (>= 4:4.9.1), make, dpkg-dev (>= 1.17.11), libz-dev, libpcre3-dev, gettext, libcurl4-gnutls-dev, libexpat1-dev, subversion, libsvn-perl, libyaml-perl, tcl, libhttp-date-perl | libtime-modules-perl, python, cvs, cvsps, libdbd-sqlite3-perl, unzip, libio-pty-perl, dpkg-dev (>= 1.16.2~)
Filtered Build-Depends: libc6-dev, gcc (>= 4:4.9.1), g++ (>= 4:4.9.1), make, dpkg-dev (>= 1.17.11), libz-dev, libpcre3-dev, gettext, libcurl4-gnutls-dev, libexpat1-dev, subversion, libsvn-perl, libyaml-perl, tcl, libhttp-date-perl, python, cvs, cvsps, libdbd-sqlite3-perl, unzip, libio-pty-perl, dpkg-dev (>= 1.16.2~)
dpkg-deb: building package 'sbuild-build-depends-git-dummy' in '/«BUILDDIR»/resolver-dcNOx1/apt_archive/sbuild-build-depends-git-dummy.deb'.
OK
Ign file: ./ InRelease
Get:1 file: ./ Release.gpg [299 B]
Get:2 file: ./ Release [2119 B]
Ign file: ./ Translation-en
Reading package lists...
Reading package lists...

┌──────────────────────────────────────────────────────────────────────────────┐
│ Install git build dependencies (apt-based resolver)                          │
└──────────────────────────────────────────────────────────────────────────────┘

Installing build dependencies
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
  cvs cvsps gettext gettext-base libapr1 libaprutil1 libasprintf0c2 libbsd0
  libcroco3 libcurl3-gnutls libcurl4-gnutls-dev libdbd-sqlite3-perl
  libdbi-perl libexpat1 libexpat1-dev libffi6 libglib2.0-0 libgnutls-deb0-28
  libgssapi-krb5-2 libhogweed4 libhttp-date-perl libidn11 libio-pty-perl
  libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.4-2 libnettle6
  libp11-kit0 libpcre16-3 libpcre3-dev libpcre32-3 libpcrecpp0
  libpython-stdlib libpython2.7-minimal libpython2.7-stdlib librtmp1
  libsasl2-2 libsasl2-modules-db libserf-1-1 libsqlite3-0 libssh2-1
  libssl1.0.0 libsvn-perl libsvn1 libtasn1-6 libtcl8.6 libunistring0 libxml2
  libyaml-perl mime-support python python-minimal python2.7 python2.7-minimal
  subversion tcl tcl8.6 unzip zlib1g-dev
Suggested packages:
  mksh rcs gettext-doc libcurl4-doc libcurl3-dbg libgnutls28-dev libidn11-dev
  libkrb5-dev libldap2-dev librtmp-dev libssh2-1-dev pkg-config libclone-perl
  libmldbm-perl libnet-daemon-perl libsql-statement-perl gnutls-bin krb5-doc
  krb5-user libyaml-shell-perl python-doc python-tk python2.7-doc
  binfmt-support subversion-tools db5.3-util tcl-tclreadline zip
Recommended packages:
  openssh-client curl wget lynx-cur autopoint libasprintf-dev libgettextpo-dev
  ca-certificates libglib2.0-data shared-mime-info xdg-user-dirs krb5-locales
  libsasl2-modules xml-core libyaml-libyaml-perl libyaml-syck-perl file
The following NEW packages will be installed:
  cvs cvsps gettext gettext-base libapr1 libaprutil1 libasprintf0c2 libbsd0
  libcroco3 libcurl3-gnutls libcurl4-gnutls-dev libdbd-sqlite3-perl
  libdbi-perl libexpat1 libexpat1-dev libffi6 libglib2.0-0 libgnutls-deb0-28
  libgssapi-krb5-2 libhogweed4 libhttp-date-perl libidn11 libio-pty-perl
  libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.4-2 libnettle6
  libp11-kit0 libpcre16-3 libpcre3-dev libpcre32-3 libpcrecpp0
  libpython-stdlib libpython2.7-minimal libpython2.7-stdlib librtmp1
  libsasl2-2 libsasl2-modules-db libserf-1-1 libsqlite3-0 libssh2-1
  libssl1.0.0 libsvn-perl libsvn1 libtasn1-6 libtcl8.6 libunistring0 libxml2
  libyaml-perl mime-support python python-minimal python2.7 python2.7-minimal
  sbuild-build-depends-git-dummy subversion tcl tcl8.6 unzip zlib1g-dev
0 upgraded, 62 newly installed, 0 to remove and 18 not upgraded.
Need to get 22.0 MB/22.0 MB of archives.
After this operation, 66.5 MB of additional disk space will be used.
Get:1 http://172.17.0.1/private/ stretch-staging/main libasprintf0c2 armhf 0.19.4-1 [31.5 kB]
Get:2 http://172.17.0.1/private/ stretch-staging/main libkeyutils1 armhf 1.5.9-5 [10.9 kB]
Get:3 http://172.17.0.1/private/ stretch-staging/main libkrb5support0 armhf 1.12.1+dfsg-20 [54.9 kB]
Get:4 http://172.17.0.1/private/ stretch-staging/main libk5crypto3 armhf 1.12.1+dfsg-20 [108 kB]
Get:5 http://172.17.0.1/private/ stretch-staging/main libkrb5-3 armhf 1.12.1+dfsg-20 [258 kB]
Get:6 http://172.17.0.1/private/ stretch-staging/main libgssapi-krb5-2 armhf 1.12.1+dfsg-20 [128 kB]
Get:7 http://172.17.0.1/private/ stretch-staging/main libnettle6 armhf 3.1.1-3 [200 kB]
Get:8 http://172.17.0.1/private/ stretch-staging/main libhogweed4 armhf 3.1.1-3 [126 kB]
Get:9 http://172.17.0.1/private/ stretch-staging/main libffi6 armhf 3.2.1-3 [18.5 kB]
Get:10 http://172.17.0.1/private/ stretch-staging/main libp11-kit0 armhf 0.23.1-3 [94.2 kB]
Get:11 http://172.17.0.1/private/ stretch-staging/main libtasn1-6 armhf 4.5-2 [43.9 kB]
Get:12 http://172.17.0.1/private/ stretch-staging/main libgnutls-deb0-28 armhf 3.3.16-2 [647 kB]
Get:13 http://172.17.0.1/private/ stretch-staging/main libsasl2-modules-db armhf 2.1.26.dfsg1-13 [65.5 kB]
Get:14 http://172.17.0.1/private/ stretch-staging/main libsasl2-2 armhf 2.1.26.dfsg1-13 [97.2 kB]
Get:15 http://172.17.0.1/private/ stretch-staging/main libldap-2.4-2 armhf 2.4.41+dfsg-1 [197 kB]
Get:16 http://172.17.0.1/private/ stretch-staging/main libxml2 armhf 2.9.1+dfsg1-5 [703 kB]
Get:17 http://172.17.0.1/private/ stretch-staging/main libpython2.7-minimal armhf 2.7.10-3 [380 kB]
Get:18 http://172.17.0.1/private/ stretch-staging/main python2.7-minimal armhf 2.7.10-3 [1163 kB]
Get:19 http://172.17.0.1/private/ stretch-staging/main python-minimal armhf 2.7.9-1 [40.1 kB]
Get:20 http://172.17.0.1/private/ stretch-staging/main mime-support all 3.59 [36.4 kB]
Get:21 http://172.17.0.1/private/ stretch-staging/main libexpat1 armhf 2.1.0-7 [59.8 kB]
Get:22 http://172.17.0.1/private/ stretch-staging/main libsqlite3-0 armhf 3.8.10.2-1 [389 kB]
Get:23 http://172.17.0.1/private/ stretch-staging/main libssl1.0.0 armhf 1.0.2d-1 [882 kB]
Get:24 http://172.17.0.1/private/ stretch-staging/main libpython2.7-stdlib armhf 2.7.10-3 [1815 kB]
Get:25 http://172.17.0.1/private/ stretch-staging/main python2.7 armhf 2.7.10-3 [259 kB]
Get:26 http://172.17.0.1/private/ stretch-staging/main libpython-stdlib armhf 2.7.9-1 [19.6 kB]
Get:27 http://172.17.0.1/private/ stretch-staging/main python armhf 2.7.9-1 [151 kB]
Get:28 http://172.17.0.1/private/ stretch-staging/main libapr1 armhf 1.5.1-3 [77.1 kB]
Get:29 http://172.17.0.1/private/ stretch-staging/main libaprutil1 armhf 1.5.4-1 [75.9 kB]
Get:30 http://172.17.0.1/private/ stretch-staging/main libbsd0 armhf 0.7.0-2 [63.7 kB]
Get:31 http://172.17.0.1/private/ stretch-staging/main libglib2.0-0 armhf 2.44.1-1.1 [2312 kB]
Get:32 http://172.17.0.1/private/ stretch-staging/main libcroco3 armhf 0.6.8-3 [121 kB]
Get:33 http://172.17.0.1/private/ stretch-staging/main libpcrecpp0 armhf 2:8.35-7 [139 kB]
Get:34 http://172.17.0.1/private/ stretch-staging/main libserf-1-1 armhf 1.3.8-1 [45.3 kB]
Get:35 http://172.17.0.1/private/ stretch-staging/main libssh2-1 armhf 1.5.0-2 [122 kB]
Get:36 http://172.17.0.1/private/ stretch-staging/main libtcl8.6 armhf 8.6.4+dfsg-2 [866 kB]
Get:37 http://172.17.0.1/private/ stretch-staging/main libunistring0 armhf 0.9.3-5.2 [253 kB]
Get:38 http://172.17.0.1/private/ stretch-staging/main gettext-base armhf 0.19.4-1 [117 kB]
Get:39 http://172.17.0.1/private/ stretch-staging/main libidn11 armhf 1.31-1 [168 kB]
Get:40 http://172.17.0.1/private/ stretch-staging/main cvs armhf 2:1.12.13+real-15 [2569 kB]
Get:41 http://172.17.0.1/private/ stretch-staging/main cvsps armhf 2.1-6 [46.6 kB]
Get:42 http://172.17.0.1/private/ stretch-staging/main gettext armhf 0.19.4-1 [1168 kB]
Get:43 http://172.17.0.1/private/ stretch-staging/main librtmp1 armhf 2.4+20150115.gita107cef-1+b1 [54.5 kB]
Get:44 http://172.17.0.1/private/ stretch-staging/main libcurl3-gnutls armhf 7.43.0-1 [235 kB]
Get:45 http://172.17.0.1/private/ stretch-staging/main libcurl4-gnutls-dev armhf 7.43.0-1 [318 kB]
Get:46 http://172.17.0.1/private/ stretch-staging/main libdbi-perl armhf 1.633-1 [811 kB]
Get:47 http://172.17.0.1/private/ stretch-staging/main libdbd-sqlite3-perl armhf 1.46-1 [150 kB]
Get:48 http://172.17.0.1/private/ stretch-staging/main libexpat1-dev armhf 2.1.0-7 [114 kB]
Get:49 http://172.17.0.1/private/ stretch-staging/main libhttp-date-perl all 6.02-1 [10.7 kB]
Get:50 http://172.17.0.1/private/ stretch-staging/main libio-pty-perl armhf 1:1.08-1+b2 [35.0 kB]
Get:51 http://172.17.0.1/private/ stretch-staging/main libpcre16-3 armhf 2:8.35-7 [221 kB]
Get:52 http://172.17.0.1/private/ stretch-staging/main libpcre32-3 armhf 2:8.35-7 [214 kB]
Get:53 http://172.17.0.1/private/ stretch-staging/main libpcre3-dev armhf 2:8.35-7 [550 kB]
Get:54 http://172.17.0.1/private/ stretch-staging/main libsvn1 armhf 1.8.13-1 [917 kB]
Get:55 http://172.17.0.1/private/ stretch-staging/main libsvn-perl armhf 1.8.13-1 [847 kB]
Get:56 http://172.17.0.1/private/ stretch-staging/main libyaml-perl all 1.13-1 [69.7 kB]
Get:57 http://172.17.0.1/private/ stretch-staging/main subversion armhf 1.8.13-1 [907 kB]
Get:58 http://172.17.0.1/private/ stretch-staging/main tcl8.6 armhf 8.6.4+dfsg-2 [122 kB]
Get:59 http://172.17.0.1/private/ stretch-staging/main tcl armhf 8.6.0+8+b1 [5508 B]
Get:60 http://172.17.0.1/private/ stretch-staging/main unzip armhf 6.0-17 [143 kB]
Get:61 http://172.17.0.1/private/ stretch-staging/main zlib1g-dev armhf 1:1.2.8.dfsg-2 [199 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 22.0 MB in 13s (1612 kB/s)
Selecting previously unselected package libasprintf0c2:armhf.
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 11966 files and directories currently installed.)
Preparing to unpack .../libasprintf0c2_0.19.4-1_armhf.deb ...
Unpacking libasprintf0c2:armhf (0.19.4-1) ...
Selecting previously unselected package libkeyutils1:armhf.
Preparing to unpack .../libkeyutils1_1.5.9-5_armhf.deb ...
Unpacking libkeyutils1:armhf (1.5.9-5) ...
Selecting previously unselected package libkrb5support0:armhf.
Preparing to unpack .../libkrb5support0_1.12.1+dfsg-20_armhf.deb ...
Unpacking libkrb5support0:armhf (1.12.1+dfsg-20) ...
Selecting previously unselected package libk5crypto3:armhf.
Preparing to unpack .../libk5crypto3_1.12.1+dfsg-20_armhf.deb ...
Unpacking libk5crypto3:armhf (1.12.1+dfsg-20) ...
Selecting previously unselected package libkrb5-3:armhf.
Preparing to unpack .../libkrb5-3_1.12.1+dfsg-20_armhf.deb ...
Unpacking libkrb5-3:armhf (1.12.1+dfsg-20) ...
Selecting previously unselected package libgssapi-krb5-2:armhf.
Preparing to unpack .../libgssapi-krb5-2_1.12.1+dfsg-20_armhf.deb ...
Unpacking libgssapi-krb5-2:armhf (1.12.1+dfsg-20) ...
Selecting previously unselected package libnettle6:armhf.
Preparing to unpack .../libnettle6_3.1.1-3_armhf.deb ...
Unpacking libnettle6:armhf (3.1.1-3) ...
Selecting previously unselected package libhogweed4:armhf.
Preparing to unpack .../libhogweed4_3.1.1-3_armhf.deb ...
Unpacking libhogweed4:armhf (3.1.1-3) ...
Selecting previously unselected package libffi6:armhf.
Preparing to unpack .../libffi6_3.2.1-3_armhf.deb ...
Unpacking libffi6:armhf (3.2.1-3) ...
Selecting previously unselected package libp11-kit0:armhf.
Preparing to unpack .../libp11-kit0_0.23.1-3_armhf.deb ...
Unpacking libp11-kit0:armhf (0.23.1-3) ...
Selecting previously unselected package libtasn1-6:armhf.
Preparing to unpack .../libtasn1-6_4.5-2_armhf.deb ...
Unpacking libtasn1-6:armhf (4.5-2) ...
Selecting previously unselected package libgnutls-deb0-28:armhf.
Preparing to unpack .../libgnutls-deb0-28_3.3.16-2_armhf.deb ...
Unpacking libgnutls-deb0-28:armhf (3.3.16-2) ...
Selecting previously unselected package libsasl2-modules-db:armhf.
Preparing to unpack .../libsasl2-modules-db_2.1.26.dfsg1-13_armhf.deb ...
Unpacking libsasl2-modules-db:armhf (2.1.26.dfsg1-13) ...
Selecting previously unselected package libsasl2-2:armhf.
Preparing to unpack .../libsasl2-2_2.1.26.dfsg1-13_armhf.deb ...
Unpacking libsasl2-2:armhf (2.1.26.dfsg1-13) ...
Selecting previously unselected package libldap-2.4-2:armhf.
Preparing to unpack .../libldap-2.4-2_2.4.41+dfsg-1_armhf.deb ...
Unpacking libldap-2.4-2:armhf (2.4.41+dfsg-1) ...
Selecting previously unselected package libxml2:armhf.
Preparing to unpack .../libxml2_2.9.1+dfsg1-5_armhf.deb ...
Unpacking libxml2:armhf (2.9.1+dfsg1-5) ...
Selecting previously unselected package libpython2.7-minimal:armhf.
Preparing to unpack .../libpython2.7-minimal_2.7.10-3_armhf.deb ...
Unpacking libpython2.7-minimal:armhf (2.7.10-3) ...
Selecting previously unselected package python2.7-minimal.
Preparing to unpack .../python2.7-minimal_2.7.10-3_armhf.deb ...
Unpacking python2.7-minimal (2.7.10-3) ...
Selecting previously unselected package python-minimal.
Preparing to unpack .../python-minimal_2.7.9-1_armhf.deb ...
Unpacking python-minimal (2.7.9-1) ...
Selecting previously unselected package mime-support.
Preparing to unpack .../mime-support_3.59_all.deb ...
Unpacking mime-support (3.59) ...
Selecting previously unselected package libexpat1:armhf.
Preparing to unpack .../libexpat1_2.1.0-7_armhf.deb ...
Unpacking libexpat1:armhf (2.1.0-7) ...
Selecting previously unselected package libsqlite3-0:armhf.
Preparing to unpack .../libsqlite3-0_3.8.10.2-1_armhf.deb ...
Unpacking libsqlite3-0:armhf (3.8.10.2-1) ...
Selecting previously unselected package libssl1.0.0:armhf.
Preparing to unpack .../libssl1.0.0_1.0.2d-1_armhf.deb ...
Unpacking libssl1.0.0:armhf (1.0.2d-1) ...
Selecting previously unselected package libpython2.7-stdlib:armhf.
Preparing to unpack .../libpython2.7-stdlib_2.7.10-3_armhf.deb ...
Unpacking libpython2.7-stdlib:armhf (2.7.10-3) ...
Selecting previously unselected package python2.7.
Preparing to unpack .../python2.7_2.7.10-3_armhf.deb ...
Unpacking python2.7 (2.7.10-3) ...
Selecting previously unselected package libpython-stdlib:armhf.
Preparing to unpack .../libpython-stdlib_2.7.9-1_armhf.deb ...
Unpacking libpython-stdlib:armhf (2.7.9-1) ...
Setting up libpython2.7-minimal:armhf (2.7.10-3) ...
Setting up python2.7-minimal (2.7.10-3) ...
Setting up python-minimal (2.7.9-1) ...
Selecting previously unselected package python.
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 12924 files and directories currently installed.)
Preparing to unpack .../python_2.7.9-1_armhf.deb ...
Unpacking python (2.7.9-1) ...
Selecting previously unselected package libapr1:armhf.
Preparing to unpack .../libapr1_1.5.1-3_armhf.deb ...
Unpacking libapr1:armhf (1.5.1-3) ...
Selecting previously unselected package libaprutil1:armhf.
Preparing to unpack .../libaprutil1_1.5.4-1_armhf.deb ...
Unpacking libaprutil1:armhf (1.5.4-1) ...
Selecting previously unselected package libbsd0:armhf.
Preparing to unpack .../libbsd0_0.7.0-2_armhf.deb ...
Unpacking libbsd0:armhf (0.7.0-2) ...
Selecting previously unselected package libglib2.0-0:armhf.
Preparing to unpack .../libglib2.0-0_2.44.1-1.1_armhf.deb ...
Unpacking libglib2.0-0:armhf (2.44.1-1.1) ...
Selecting previously unselected package libcroco3:armhf.
Preparing to unpack .../libcroco3_0.6.8-3_armhf.deb ...
Unpacking libcroco3:armhf (0.6.8-3) ...
Selecting previously unselected package libpcrecpp0:armhf.
Preparing to unpack .../libpcrecpp0_2%3a8.35-7_armhf.deb ...
Unpacking libpcrecpp0:armhf (2:8.35-7) ...
Selecting previously unselected package libserf-1-1:armhf.
Preparing to unpack .../libserf-1-1_1.3.8-1_armhf.deb ...
Unpacking libserf-1-1:armhf (1.3.8-1) ...
Selecting previously unselected package libssh2-1:armhf.
Preparing to unpack .../libssh2-1_1.5.0-2_armhf.deb ...
Unpacking libssh2-1:armhf (1.5.0-2) ...
Selecting previously unselected package libtcl8.6:armhf.
Preparing to unpack .../libtcl8.6_8.6.4+dfsg-2_armhf.deb ...
Unpacking libtcl8.6:armhf (8.6.4+dfsg-2) ...
Selecting previously unselected package libunistring0:armhf.
Preparing to unpack .../libunistring0_0.9.3-5.2_armhf.deb ...
Unpacking libunistring0:armhf (0.9.3-5.2) ...
Selecting previously unselected package gettext-base.
Preparing to unpack .../gettext-base_0.19.4-1_armhf.deb ...
Unpacking gettext-base (0.19.4-1) ...
Selecting previously unselected package libidn11:armhf.
Preparing to unpack .../libidn11_1.31-1_armhf.deb ...
Unpacking libidn11:armhf (1.31-1) ...
Selecting previously unselected package cvs.
Preparing to unpack .../cvs_2%3a1.12.13+real-15_armhf.deb ...
Unpacking cvs (2:1.12.13+real-15) ...
Selecting previously unselected package cvsps.
Preparing to unpack .../archives/cvsps_2.1-6_armhf.deb ...
Unpacking cvsps (2.1-6) ...
Selecting previously unselected package gettext.
Preparing to unpack .../gettext_0.19.4-1_armhf.deb ...
Unpacking gettext (0.19.4-1) ...
Selecting previously unselected package librtmp1:armhf.
Preparing to unpack .../librtmp1_2.4+20150115.gita107cef-1+b1_armhf.deb ...
Unpacking librtmp1:armhf (2.4+20150115.gita107cef-1+b1) ...
Selecting previously unselected package libcurl3-gnutls:armhf.
Preparing to unpack .../libcurl3-gnutls_7.43.0-1_armhf.deb ...
Unpacking libcurl3-gnutls:armhf (7.43.0-1) ...
Selecting previously unselected package libcurl4-gnutls-dev:armhf.
Preparing to unpack .../libcurl4-gnutls-dev_7.43.0-1_armhf.deb ...
Unpacking libcurl4-gnutls-dev:armhf (7.43.0-1) ...
Selecting previously unselected package libdbi-perl.
Preparing to unpack .../libdbi-perl_1.633-1_armhf.deb ...
Unpacking libdbi-perl (1.633-1) ...
Selecting previously unselected package libdbd-sqlite3-perl.
Preparing to unpack .../libdbd-sqlite3-perl_1.46-1_armhf.deb ...
Unpacking libdbd-sqlite3-perl (1.46-1) ...
Selecting previously unselected package libexpat1-dev:armhf.
Preparing to unpack .../libexpat1-dev_2.1.0-7_armhf.deb ...
Unpacking libexpat1-dev:armhf (2.1.0-7) ...
Selecting previously unselected package libhttp-date-perl.
Preparing to unpack .../libhttp-date-perl_6.02-1_all.deb ...
Unpacking libhttp-date-perl (6.02-1) ...
Selecting previously unselected package libio-pty-perl.
Preparing to unpack .../libio-pty-perl_1%3a1.08-1+b2_armhf.deb ...
Unpacking libio-pty-perl (1:1.08-1+b2) ...
Selecting previously unselected package libpcre16-3:armhf.
Preparing to unpack .../libpcre16-3_2%3a8.35-7_armhf.deb ...
Unpacking libpcre16-3:armhf (2:8.35-7) ...
Selecting previously unselected package libpcre32-3:armhf.
Preparing to unpack .../libpcre32-3_2%3a8.35-7_armhf.deb ...
Unpacking libpcre32-3:armhf (2:8.35-7) ...
Selecting previously unselected package libpcre3-dev:armhf.
Preparing to unpack .../libpcre3-dev_2%3a8.35-7_armhf.deb ...
Unpacking libpcre3-dev:armhf (2:8.35-7) ...
Selecting previously unselected package libsvn1:armhf.
Preparing to unpack .../libsvn1_1.8.13-1_armhf.deb ...
Unpacking libsvn1:armhf (1.8.13-1) ...
Selecting previously unselected package libsvn-perl.
Preparing to unpack .../libsvn-perl_1.8.13-1_armhf.deb ...
Unpacking libsvn-perl (1.8.13-1) ...
Selecting previously unselected package libyaml-perl.
Preparing to unpack .../libyaml-perl_1.13-1_all.deb ...
Unpacking libyaml-perl (1.13-1) ...
Selecting previously unselected package subversion.
Preparing to unpack .../subversion_1.8.13-1_armhf.deb ...
Unpacking subversion (1.8.13-1) ...
Selecting previously unselected package tcl8.6.
Preparing to unpack .../tcl8.6_8.6.4+dfsg-2_armhf.deb ...
Unpacking tcl8.6 (8.6.4+dfsg-2) ...
Selecting previously unselected package tcl.
Preparing to unpack .../tcl_8.6.0+8+b1_armhf.deb ...
Unpacking tcl (8.6.0+8+b1) ...
Selecting previously unselected package unzip.
Preparing to unpack .../unzip_6.0-17_armhf.deb ...
Unpacking unzip (6.0-17) ...
Selecting previously unselected package zlib1g-dev:armhf.
Preparing to unpack .../zlib1g-dev_1%3a1.2.8.dfsg-2_armhf.deb ...
Unpacking zlib1g-dev:armhf (1:1.2.8.dfsg-2) ...
Selecting previously unselected package sbuild-build-depends-git-dummy.
Preparing to unpack .../sbuild-build-depends-git-dummy.deb ...
Unpacking sbuild-build-depends-git-dummy (0.invalid.0) ...
Setting up libasprintf0c2:armhf (0.19.4-1) ...
Setting up libkeyutils1:armhf (1.5.9-5) ...
Setting up libkrb5support0:armhf (1.12.1+dfsg-20) ...
Setting up libk5crypto3:armhf (1.12.1+dfsg-20) ...
Setting up libkrb5-3:armhf (1.12.1+dfsg-20) ...
Setting up libgssapi-krb5-2:armhf (1.12.1+dfsg-20) ...
Setting up libnettle6:armhf (3.1.1-3) ...
Setting up libhogweed4:armhf (3.1.1-3) ...
Setting up libffi6:armhf (3.2.1-3) ...
Setting up libp11-kit0:armhf (0.23.1-3) ...
Setting up libtasn1-6:armhf (4.5-2) ...
Setting up libgnutls-deb0-28:armhf (3.3.16-2) ...
Setting up libsasl2-modules-db:armhf (2.1.26.dfsg1-13) ...
Setting up libsasl2-2:armhf (2.1.26.dfsg1-13) ...
Setting up libldap-2.4-2:armhf (2.4.41+dfsg-1) ...
Setting up libxml2:armhf (2.9.1+dfsg1-5) ...
Setting up mime-support (3.59) ...
Setting up libexpat1:armhf (2.1.0-7) ...
Setting up libsqlite3-0:armhf (3.8.10.2-1) ...
Setting up libssl1.0.0:armhf (1.0.2d-1) ...
Setting up libpython2.7-stdlib:armhf (2.7.10-3) ...
Setting up python2.7 (2.7.10-3) ...
Setting up libpython-stdlib:armhf (2.7.9-1) ...
Setting up python (2.7.9-1) ...
Setting up libapr1:armhf (1.5.1-3) ...
Setting up libaprutil1:armhf (1.5.4-1) ...
Setting up libbsd0:armhf (0.7.0-2) ...
Setting up libglib2.0-0:armhf (2.44.1-1.1) ...
No schema files found: doing nothing.
Setting up libcroco3:armhf (0.6.8-3) ...
Setting up libpcrecpp0:armhf (2:8.35-7) ...
Setting up libserf-1-1:armhf (1.3.8-1) ...
Setting up libssh2-1:armhf (1.5.0-2) ...
Setting up libtcl8.6:armhf (8.6.4+dfsg-2) ...
Setting up libunistring0:armhf (0.9.3-5.2) ...
Setting up gettext-base (0.19.4-1) ...
Setting up libidn11:armhf (1.31-1) ...
Setting up cvs (2:1.12.13+real-15) ...
Allowing use of questionable username.
Adding group `_cvsadmin' (GID 111) ...
Done.
Setting up cvsps (2.1-6) ...
Setting up gettext (0.19.4-1) ...
Setting up librtmp1:armhf (2.4+20150115.gita107cef-1+b1) ...
Setting up libcurl3-gnutls:armhf (7.43.0-1) ...
Setting up libcurl4-gnutls-dev:armhf (7.43.0-1) ...
Setting up libdbi-perl (1.633-1) ...
Setting up libdbd-sqlite3-perl (1.46-1) ...
Setting up libexpat1-dev:armhf (2.1.0-7) ...
Setting up libhttp-date-perl (6.02-1) ...
Setting up libio-pty-perl (1:1.08-1+b2) ...
Setting up libpcre16-3:armhf (2:8.35-7) ...
Setting up libpcre32-3:armhf (2:8.35-7) ...
Setting up libpcre3-dev:armhf (2:8.35-7) ...
Setting up libsvn1:armhf (1.8.13-1) ...
Setting up libsvn-perl (1.8.13-1) ...
Setting up libyaml-perl (1.13-1) ...
Setting up subversion (1.8.13-1) ...
Setting up tcl8.6 (8.6.4+dfsg-2) ...
Setting up tcl (8.6.0+8+b1) ...
Setting up unzip (6.0-17) ...
Setting up zlib1g-dev:armhf (1:1.2.8.dfsg-2) ...
Setting up sbuild-build-depends-git-dummy (0.invalid.0) ...
Processing triggers for libc-bin (2.19-19) ...

┌──────────────────────────────────────────────────────────────────────────────┐
│ Build environment                                                            │
└──────────────────────────────────────────────────────────────────────────────┘

Kernel: Linux 3.19.0-trunk-armmp armhf (armv7l)
Toolchain package versions: binutils_2.25-10 dpkg-dev_1.18.1 g++-4.9_4.9.3-2 gcc-4.9_4.9.3-2 libc6-dev_2.19-19 libstdc++-4.9-dev_4.9.3-2 libstdc++6_5.1.1-14+rpi1 linux-libc-dev_3.16.7-ckt4-1+rpi1+b2
Package versions: acl_2.2.52-2 adduser_3.113+nmu3 apt_1.0.9.10 base-files_9.2+rpi1 base-passwd_3.5.38 bash_4.3-12 binutils_2.25-10 bsdutils_1:2.26.2-6 build-essential_11.7 bzip2_1.0.6-8 coreutils_8.23-4 cpio_2.11+dfsg-4.1 cpp_4:4.9.2-4+rpi1 cpp-4.9_4.9.3-2 cvs_2:1.12.13+real-15 cvsps_2.1-6 dash_0.5.7-4 debconf_1.5.57 debfoster_2.7-2 debianutils_4.5.1 diffutils_1:3.3-1 dmsetup_2:1.02.90-2.2 dpkg_1.18.1 dpkg-dev_1.18.1 e2fslibs_1.42.13-1 e2fsprogs_1.42.13-1 fakeroot_1.20.2-1 findutils_4.4.2-9 g++_4:4.9.2-4+rpi1 g++-4.9_4.9.3-2 gcc_4:4.9.2-4+rpi1 gcc-4.6-base_4.6.4-5+rpi1 gcc-4.7-base_4.7.3-11+rpi1 gcc-4.8-base_4.8.4-4 gcc-4.9_4.9.3-2 gcc-4.9-base_4.9.3-2 gcc-5-base_5.1.1-14+rpi1 gettext_0.19.4-1 gettext-base_0.19.4-1 gnupg_1.4.19-3 gpgv_1.4.19-3 grep_2.21-2 gzip_1.6-4 hostname_3.15 init_1.23 init-system-helpers_1.23 initramfs-tools_0.120 initscripts_2.88dsf-59.2 insserv_1.14.0-5 klibc-utils_2.0.4-2+rpi1 kmod_21-1 libacl1_2.2.52-2 libapparmor1_2.9.2-3 libapr1_1.5.1-3 libaprutil1_1.5.4-1 libapt-pkg4.12_1.0.9.10 libasan1_4.9.3-2 libasprintf0c2_0.19.4-1 libatomic1_5.1.1-14+rpi1 libattr1_1:2.4.47-2 libaudit-common_1:2.4.2-1 libaudit1_1:2.4.2-1 libblkid1_2.26.2-6 libbsd0_0.7.0-2 libbz2-1.0_1.0.6-8 libc-bin_2.19-19 libc-dev-bin_2.19-19 libc6_2.19-19 libc6-dev_2.19-19 libcap2_1:2.24-9 libcap2-bin_1:2.24-9 libcloog-isl4_0.18.3-1 libcomerr2_1.42.13-1 libcroco3_0.6.8-3 libcryptsetup4_2:1.6.6-5 libcurl3-gnutls_7.43.0-1 libcurl4-gnutls-dev_7.43.0-1 libdb5.3_5.3.28-9 libdbd-sqlite3-perl_1.46-1 libdbi-perl_1.633-1 libdbus-1-3_1.8.20-1 libdebconfclient0_0.194 libdevmapper1.02.1_2:1.02.90-2.2 libdpkg-perl_1.18.1 libdrm2_2.4.62-1 libexpat1_2.1.0-7 libexpat1-dev_2.1.0-7 libfakeroot_1.20.2-1 libfdisk1_2.26.2-6 libffi6_3.2.1-3 libgc1c2_1:7.2d-6.4 libgcc-4.9-dev_4.9.3-2 libgcc1_1:5.1.1-14+rpi1 libgcrypt20_1.6.3-2 libgdbm3_1.8.3-13.1 libglib2.0-0_2.44.1-1.1 libgmp10_2:6.0.0+dfsg-7+rpi1 libgnutls-deb0-28_3.3.16-2 libgomp1_5.1.1-14+rpi1 libgpg-error0_1.19-2 libgssapi-krb5-2_1.12.1+dfsg-20 libhogweed4_3.1.1-3 libhttp-date-perl_6.02-1 libidn11_1.31-1 libio-pty-perl_1:1.08-1+b2 libisl13_0.14-2 libk5crypto3_1.12.1+dfsg-20 libkeyutils1_1.5.9-5 libklibc_2.0.4-2+rpi1 libkmod2_21-1 libkrb5-3_1.12.1+dfsg-20 libkrb5support0_1.12.1+dfsg-20 libldap-2.4-2_2.4.41+dfsg-1 liblocale-gettext-perl_1.05-9 liblzma5_5.1.1alpha+20120614-2.1 libmount1_2.26.2-6 libmpc3_1.0.3-1 libmpfr4_3.1.3-1 libncurses5_5.9+20150516-2 libncursesw5_5.9+20150516-2 libnettle6_3.1.1-3 libnih-dbus1_1.0.3-4.3 libnih1_1.0.3-4.3 libp11-kit0_0.23.1-3 libpam-modules_1.1.8-3.1 libpam-modules-bin_1.1.8-3.1 libpam-runtime_1.1.8-3.1 libpam0g_1.1.8-3.1 libpcre16-3_2:8.35-7 libpcre3_2:8.35-7 libpcre3-dev_2:8.35-7 libpcre32-3_2:8.35-7 libpcrecpp0_2:8.35-7 libpng12-0_1.2.50-2 libprocps3_2:3.3.9-9 libprocps4_2:3.3.10-2 libpython-stdlib_2.7.9-1 libpython2.7-minimal_2.7.10-3 libpython2.7-stdlib_2.7.10-3 libreadline6_6.3-8 librtmp1_2.4+20150115.gita107cef-1+b1 libsasl2-2_2.1.26.dfsg1-13 libsasl2-modules-db_2.1.26.dfsg1-13 libseccomp2_2.2.1-2 libselinux1_2.3-2 libsemanage-common_2.3-1 libsemanage1_2.3-1 libsepol1_2.3-2 libserf-1-1_1.3.8-1 libslang2_2.3.0-2 libsmartcols1_2.26.2-6 libsqlite3-0_3.8.10.2-1 libss2_1.42.13-1 libssh2-1_1.5.0-2 libssl1.0.0_1.0.2d-1 libstdc++-4.9-dev_4.9.3-2 libstdc++6_5.1.1-14+rpi1 libsvn-perl_1.8.13-1 libsvn1_1.8.13-1 libsystemd0_222-2 libtasn1-6_4.5-2 libtcl8.6_8.6.4+dfsg-2 libtext-charwidth-perl_0.04-7+b4 libtext-iconv-perl_1.7-5+b5 libtext-wrapi18n-perl_0.06-7 libtimedate-perl_2.3000-2 libtinfo5_5.9+20150516-2 libubsan0_5.1.1-14+rpi1 libudev1_222-2 libunistring0_0.9.3-5.2 libusb-0.1-4_2:0.1.12-25 libustr-1.0-1_1.0.4-5 libuuid1_2.26.2-6 libxml2_2.9.1+dfsg1-5 libyaml-perl_1.13-1 linux-libc-dev_3.16.7-ckt4-1+rpi1+b2 login_1:4.2-3 lsb-base_4.1+Debian13+rpi1+nmu1 make_4.0-8.1 makedev_2.3.1-93 mawk_1.3.3-17 mime-support_3.59 mount_2.26.2-6 mountall_2.54 multiarch-support_2.19-19 ncurses-base_5.9+20150516-2 ncurses-bin_5.9+20150516-2 passwd_1:4.2-3 patch_2.7.5-1 perl_5.20.2-6 perl-base_5.20.2-6 perl-modules_5.20.2-6 plymouth_0.9.0-9 procps_2:3.3.10-2 python_2.7.9-1 python-minimal_2.7.9-1 python2.7_2.7.10-3 python2.7-minimal_2.7.10-3 raspbian-archive-keyring_20120528.2 readline-common_6.3-8 sbuild-build-depends-core-dummy_0.invalid.0 sbuild-build-depends-git-dummy_0.invalid.0 sed_4.2.2-6.1 sensible-utils_0.0.9 startpar_0.59-3 subversion_1.8.13-1 systemd_222-2 systemd-sysv_222-2 sysv-rc_2.88dsf-59.2 sysvinit-utils_2.88dsf-59.2 tar_1.27.1-2 tcl_8.6.0+8+b1 tcl8.6_8.6.4+dfsg-2 tzdata_2015e-1 udev_222-2 unzip_6.0-17 util-linux_2.26.2-6 xz-utils_5.1.1alpha+20120614-2.1 zlib1g_1:1.2.8.dfsg-2 zlib1g-dev_1:1.2.8.dfsg-2

┌──────────────────────────────────────────────────────────────────────────────┐
│ Build                                                                        │
└──────────────────────────────────────────────────────────────────────────────┘


Unpack source
─────────────

gpgv: keyblock resource `/sbuild-nonexistent/.gnupg/trustedkeys.gpg': file open error
gpgv: Signature made Tue Jul 28 19:02:06 2015 UTC using RSA key ID B333FA25
gpgv: Can't check signature: public key not found
dpkg-source: warning: failed to verify signature on ./git_2.5.0-1.dsc
dpkg-source: info: extracting git in git-2.5.0
dpkg-source: info: unpacking git_2.5.0.orig.tar.xz
dpkg-source: info: unpacking git_2.5.0-1.debian.tar.xz

Check disc space
────────────────

Sufficient free space for build

User Environment
────────────────

DEB_BUILD_OPTIONS=parallel=4
HOME=/sbuild-nonexistent
LOGNAME=buildd
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
SCHROOT_ALIAS_NAME=stretch-staging-armhf-sbuild
SCHROOT_CHROOT_NAME=stretch-staging-armhf-sbuild
SCHROOT_COMMAND=env
SCHROOT_GID=109
SCHROOT_GROUP=buildd
SCHROOT_SESSION_ID=stretch-staging-armhf-sbuild-fcf5cca2-854e-40e2-af63-514f48582843
SCHROOT_UID=104
SCHROOT_USER=buildd
SHELL=/bin/sh
USER=buildd

dpkg-buildpackage
─────────────────

dpkg-buildpackage: source package git
dpkg-buildpackage: source version 1:2.5.0-1
dpkg-buildpackage: source distribution unstable
 dpkg-source --before-build git-2.5.0
dpkg-buildpackage: host architecture armhf
 fakeroot debian/rules clean
/usr/bin/make clean NO_OPENSSL=1 prefix=/usr gitexecdir=/usr/lib/git-core libexecdir=/usr/lib/git-core mandir=/usr/share/man htmldir=/usr/share/doc/git/html INSTALLDIRS=vendor USE_SRV_RR=1 USE_LIBPCRE=1 SANE_TOOL_PATH= INSTALL=install TAR=tar NO_CROSS_DIRECTORY_HARDLINKS=1 NO_INSTALL_HARDLINKS=1 DEFAULT_PAGER=pager DEFAULT_EDITOR=editor CC='gcc' CFLAGS='-Wall -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' LDFLAGS='-Wl,-z,relro'
make[1]: Entering directory '/«PKGBUILDDIR»'
GIT_VERSION = 2.5.0
rm -f /«PKGBUILDDIR»/./*.gcda /«PKGBUILDDIR»/block-sha1/*.gcda /«PKGBUILDDIR»/builtin/*.gcda /«PKGBUILDDIR»/compat/*.gcda /«PKGBUILDDIR»/ewah/*.gcda /«PKGBUILDDIR»/vcs-svn/*.gcda /«PKGBUILDDIR»/xdiff/*.gcda
rm -f ./*.gcov block-sha1/*.gcov builtin/*.gcov compat/*.gcov ewah/*.gcov vcs-svn/*.gcov xdiff/*.gcov
rm -f /«PKGBUILDDIR»/./*.gcno /«PKGBUILDDIR»/block-sha1/*.gcno /«PKGBUILDDIR»/builtin/*.gcno /«PKGBUILDDIR»/compat/*.gcno /«PKGBUILDDIR»/ewah/*.gcno /«PKGBUILDDIR»/vcs-svn/*.gcno /«PKGBUILDDIR»/xdiff/*.gcno
rm -f ./*.gcda block-sha1/*.gcda builtin/*.gcda compat/*.gcda ewah/*.gcda vcs-svn/*.gcda xdiff/*.gcda
rm -f coverage-untested-functions
rm -f -r cover_db/
rm -f -r cover_db_html/
rm -f ./*.gcno block-sha1/*.gcno builtin/*.gcno compat/*.gcno ewah/*.gcno vcs-svn/*.gcno xdiff/*.gcno
rm -f *.o *.res block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o
rm -f xdiff/*.o vcs-svn/*.o ewah/*.o builtin/*.o
rm -f libgit.a xdiff/lib.a vcs-svn/lib.a
rm -f   git-credential-store git-daemon git-fast-import git-http-backend git-imap-send git-sh-i18n--envsubst git-shell git-show-index git-upload-pack git-remote-testsvn git-http-fetch git-http-push git-credential-cache git-credential-cache--daemon git-remote-http git-remote-https git-remote-ftp git-remote-ftps git-am git-bisect git-difftool--helper git-filter-branch git-merge-octopus git-merge-one-file git-merge-resolve git-mergetool git-pull git-quiltimport git-rebase git-request-pull git-stash git-submodule git-web--browse git-add--interactive git-difftool git-archimport git-cvsexportcommit git-cvsimport git-cvsserver git-relink git-send-email git-svn git-p4 git-instaweb  git-mergetool--lib git-parse-remote git-rebase--am git-rebase--interactive git-rebase--merge git-sh-setup git-sh-i18n  git-add git-annotate git-apply git-archive git-bisect--helper git-blame git-branch git-bundle git-cat-file git-check-attr git-check-ignore git-check-mailmap git-check-ref-format git-checkout-index git-checkout git-clean git-clone git-column git-commit-tree git-commit git-config git-count-objects git-credential git-describe git-diff-files git-diff-index git-diff-tree git-diff git-fast-export git-fetch-pack git-fetch git-fmt-merge-msg git-for-each-ref git-fsck git-gc git-get-tar-commit-id git-grep git-hash-object git-help git-index-pack git-init-db git-interpret-trailers git-log git-ls-files git-ls-remote git-ls-tree git-mailinfo git-mailsplit git-merge git-merge-base git-merge-file git-merge-index git-merge-ours git-merge-recursive git-merge-tree git-mktag git-mktree git-mv git-name-rev git-notes git-pack-objects git-pack-redundant git-pack-refs git-patch-id git-prune-packed git-prune git-push git-read-tree git-receive-pack git-reflog git-remote git-remote-ext git-remote-fd git-repack git-replace git-rerere git-reset git-rev-list git-rev-parse git-revert git-rm git-send-pack git-shortlog git-show-branch git-show-ref git-stripspace git-symbolic-ref git-tag git-unpack-file git-unpack-objects git-update-index git-update-ref git-update-server-info git-upload-archive git-var git-verify-commit git-verify-pack git-verify-tag git-worktree git-write-tree git-cherry git-cherry-pick git-format-patch git-fsck-objects git-init git-merge-subtree git-show git-stage git-status git-whatchanged git
rm -f test-chmtime test-ctype test-config test-date test-delta test-dump-cache-tree test-dump-split-index test-dump-untracked-cache test-genrandom test-hashmap test-index-version test-line-buffer test-match-trees test-mergesort test-mktemp test-parse-options test-path-utils test-prio-queue test-read-cache test-regex test-revision-walking test-run-command test-scrap-cache-tree test-sha1 test-sha1-array test-sigchain test-string-list test-subprocess test-svn-fe test-urlmatch-normalization test-wildmatch git-remote-testgit
rm -f -r bin-wrappers ./.depend block-sha1/.depend builtin/.depend compat/.depend ewah/.depend vcs-svn/.depend xdiff/.depend
rm -f -r po/build/
rm -f *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags cscope*
rm -f -r git-2.5.0 .doc-tmp-dir
rm -f git-2.5.0.tar.gz git-core_2.5.0-*.tar.gz
rm -f git-htmldocs-2.5.0.tar.gz git-manpages-2.5.0.tar.gz
/usr/bin/make -C Documentation/ clean
make[2]: Entering directory '/«PKGBUILDDIR»/Documentation'
    GEN mergetools-list.made
    GEN cmd-list.made
    GEN doc.dep
make[3]: Entering directory '/«PKGBUILDDIR»'
make[3]: 'GIT-VERSION-FILE' is up to date.
make[3]: Leaving directory '/«PKGBUILDDIR»'
make[3]: Entering directory '/«PKGBUILDDIR»'
make[3]: 'GIT-VERSION-FILE' is up to date.
make[3]: Leaving directory '/«PKGBUILDDIR»'
rm -f *.xml *.xml+ *.html *.html+ *.1 *.5 *.7
rm -f *.texi *.texi+ *.texi++ git.info gitman.info
rm -f *.pdf
rm -f howto-index.txt howto/*.html doc.dep
rm -f technical/*.html technical/api-index.txt
rm -f cmds-ancillaryinterrogators.txt cmds-ancillarymanipulators.txt cmds-mainporcelain.txt cmds-plumbinginterrogators.txt cmds-plumbingmanipulators.txt cmds-synchingrepositories.txt cmds-synchelpers.txt cmds-purehelpers.txt cmds-foreignscminterface.txt mergetools-diff.txt mergetools-merge.txt *.made
rm -f manpage-base-url.xsl
make[2]: Leaving directory '/«PKGBUILDDIR»/Documentation'
/usr/bin/make -C gitweb clean
make[2]: Entering directory '/«PKGBUILDDIR»/gitweb'
make[3]: Entering directory '/«PKGBUILDDIR»'
make[3]: 'GIT-VERSION-FILE' is up to date.
make[3]: Leaving directory '/«PKGBUILDDIR»'
rm -f gitweb.cgi static/gitweb.js \
	static/gitweb.min.js static/gitweb.min.css \
	GITWEB-BUILD-OPTIONS
make[2]: Leaving directory '/«PKGBUILDDIR»/gitweb'
/usr/bin/make -C perl clean
make[2]: Entering directory '/«PKGBUILDDIR»/perl'
rm -f ppport.h
rm -f perl.mak
rm -f perl.mak.old
rm -f PM.stamp
make[2]: Leaving directory '/«PKGBUILDDIR»/perl'
/usr/bin/make -C templates/ clean
make[2]: Entering directory '/«PKGBUILDDIR»/templates'
rm -f -r blt boilerplates.made
make[2]: Leaving directory '/«PKGBUILDDIR»/templates'
/usr/bin/make -C t/ clean
make[2]: Entering directory '/«PKGBUILDDIR»/t'
rm -f -r 'trash directory'.* 'test-results'
rm -f -r valgrind/bin
rm -f .prove
make[2]: Leaving directory '/«PKGBUILDDIR»/t'
/usr/bin/make -C gitk-git clean
make[2]: Entering directory '/«PKGBUILDDIR»/gitk-git'
rm -f gitk-wish po/*.msg GIT-TCLTK-VARS
make[2]: Leaving directory '/«PKGBUILDDIR»/gitk-git'
/usr/bin/make -C git-gui clean
make[2]: Entering directory '/«PKGBUILDDIR»/git-gui'
GITGUI_VERSION = 0.19.0.18.g4498b
rm -rf git-gui lib/tclIndex po/*.msg
rm -rf GIT-VERSION-FILE GIT-GUI-VARS
make[2]: Leaving directory '/«PKGBUILDDIR»/git-gui'
rm -f GIT-VERSION-FILE GIT-CFLAGS GIT-LDFLAGS GIT-BUILD-OPTIONS
rm -f GIT-USER-AGENT GIT-PREFIX
rm -f GIT-SCRIPT-DEFINES GIT-PERL-DEFINES GIT-PYTHON-VARS
make[1]: Leaving directory '/«PKGBUILDDIR»'
! test -e patch-stamp || \
{ \
  set -e; \
  /usr/bin/make -Ccontrib/mw-to-git clean NO_OPENSSL=1 prefix=/usr gitexecdir=/usr/lib/git-core libexecdir=/usr/lib/git-core mandir=/usr/share/man htmldir=/usr/share/doc/git/html INSTALLDIRS=vendor USE_SRV_RR=1 USE_LIBPCRE=1 SANE_TOOL_PATH= INSTALL=install TAR=tar NO_CROSS_DIRECTORY_HARDLINKS=1 NO_INSTALL_HARDLINKS=1 DEFAULT_PAGER=pager DEFAULT_EDITOR=editor CC='gcc' CFLAGS='-Wall -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' LDFLAGS='-Wl,-z,relro'; \
  for i in `ls -1r debian/diff/*.diff debian/diff/*.patch \
      2>/dev/null || :`; do \
    patch -p1 -NR -r- <$i || test $? = 1 || exit 1; \
  done; \
}
rm -rf '/«PKGBUILDDIR»/tmp'
rm -f patch-stamp build-arch-stamp build-indep-stamp
set -e; \
  for i in '' -doc -arch -cvs -svn -mediawiki -daemon-run -daemon-sysvinit -email -gui k web -all -el -man -core; do \
    rm -rf '/«PKGBUILDDIR»/debian/git'$i; \
  done
rm -f debian/files debian/substvars
rm -f git-subtree
 debian/rules build-arch
for i in `ls -1 debian/diff/*.diff debian/diff/*.patch \
    2>/dev/null || :`; do \
  patch -p1 -N -r- <$i || test $? = 1 || exit 1; \
done
patching file templates/hooks--pre-rebase.sample
patching file Makefile
patching file connect.c
patching file connect.h
patching file tcp.c
patching file tcp.h
patching file daemon.c
patching file daemon.c
patching file tcp.c
patching file tcp.h
patching file Makefile
patching file dns-ipv4.c
patching file dns-ipv4.h
patching file dns-ipv6.c
patching file dns-ipv6.h
patching file tcp.c
patching file Makefile
patching file srv.c
patching file srv.h
patching file tcp.c
patching file srv.c
touch patch-stamp
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.9/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Raspbian 4.9.3-2' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 4.9.3 (Raspbian 4.9.3-2) 
DESTDIR='/«PKGBUILDDIR»/debian/git' /usr/bin/make all NO_OPENSSL=1 prefix=/usr gitexecdir=/usr/lib/git-core libexecdir=/usr/lib/git-core mandir=/usr/share/man htmldir=/usr/share/doc/git/html INSTALLDIRS=vendor USE_SRV_RR=1 USE_LIBPCRE=1 SANE_TOOL_PATH= INSTALL=install TAR=tar NO_CROSS_DIRECTORY_HARDLINKS=1 NO_INSTALL_HARDLINKS=1 DEFAULT_PAGER=pager DEFAULT_EDITOR=editor CC='gcc' CFLAGS='-Wall -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' LDFLAGS='-Wl,-z,relro'
make[1]: Entering directory '/«PKGBUILDDIR»'
GIT_VERSION = 2.5.0
    * new build flags
    * new link flags
    * new prefix flags
    GEN common-cmds.h
    CC hex.o
    CC ident.o
    CC kwset.o
    CC levenshtein.o
    CC line-log.o
    CC line-range.o
    CC list-objects.o
    CC ll-merge.o
    CC lockfile.o
    CC log-tree.o
    CC mailmap.o
    CC match-trees.o
    CC merge.o
    CC merge-blobs.o
    CC merge-recursive.o
    CC mergesort.o
    CC name-hash.o
    CC notes.o
    CC notes-cache.o
    CC notes-merge.o
    CC notes-utils.o
    CC object.o
    CC pack-bitmap.o
    CC pack-bitmap-write.o
    CC pack-check.o
    CC pack-objects.o
    CC pack-revindex.o
    CC pack-write.o
    CC pager.o
    CC parse-options.o
    CC parse-options-cb.o
    CC patch-delta.o
    CC patch-ids.o
    CC path.o
    CC pathspec.o
    CC pkt-line.o
    CC preload-index.o
    CC pretty.o
    CC prio-queue.o
    CC progress.o
    CC prompt.o
    CC quote.o
    CC reachable.o
    CC read-cache.o
    CC reflog-walk.o
    CC refs.o
    CC remote.o
    CC replace_object.o
    CC rerere.o
    CC resolve-undo.o
    CC revision.o
    CC run-command.o
    CC send-pack.o
    CC sequencer.o
    CC server-info.o
    CC setup.o
    CC sha1-array.o
    CC sha1-lookup.o
    CC sha1_file.o
    CC sha1_name.o
    CC shallow.o
    CC sideband.o
    CC sigchain.o
    CC split-index.o
    CC strbuf.o
    CC streaming.o
    CC string-list.o
    CC submodule.o
    CC symlinks.o
    CC tag.o
    CC tcp.o
    CC trace.o
    CC trailer.o
    CC transport.o
    CC transport-helper.o
    CC tree-diff.o
    CC tree.o
    CC tree-walk.o
    CC unpack-trees.o
    CC url.o
    CC urlmatch.o
    CC usage.o
    CC userdiff.o
    CC utf8.o
    CC varint.o
    CC versioncmp.o
    CC walker.o
    CC wildmatch.o
    CC wrapper.o
    CC write_or_die.o
    CC ws.o
    CC wt-status.o
    CC xdiff-interface.o
    CC zlib.o
    CC srv.o
    CC dns-ipv6.o
    CC unix-socket.o
    CC block-sha1/sha1.o
    CC thread-utils.o
    CC compat/strlcpy.o
    CC xdiff/xdiffi.o
    CC xdiff/xprepare.o
    CC xdiff/xutils.o
    CC xdiff/xemit.o
    CC xdiff/xmerge.o
    CC xdiff/xpatience.o
    CC xdiff/xhistogram.o
    CC daemon.o
    CC fast-import.o
    CC http-backend.o
    CC imap-send.o
    CC http.o
    CC sh-i18n--envsubst.o
    CC shell.o
    CC show-index.o
    CC upload-pack.o
    CC remote-testsvn.o
    CC vcs-svn/line_buffer.o
    CC vcs-svn/sliding_window.o
    CC vcs-svn/repo_tree.o
    CC vcs-svn/fast_export.o
    CC vcs-svn/svndiff.o
    CC vcs-svn/svndump.o
    CC http-walker.o
    CC http-fetch.o
    CC http-push.o
    CC credential-cache.o
    CC credential-cache--daemon.o
    CC remote-curl.o
    * new script parameters
    * new perl-specific parameters
    * new Python interpreter location
    GEN git-instaweb
    GEN git-mergetool--lib
    GEN git-parse-remote
    GEN git-rebase--am
    GEN git-rebase--interactive
    GEN git-rebase--merge
    GEN git-sh-setup
    GEN git-sh-i18n
    CC git.o
    CC builtin/add.o
    CC builtin/annotate.o
    CC builtin/apply.o
    CC builtin/archive.o
    CC builtin/bisect--helper.o
    CC builtin/blame.o
    CC builtin/branch.o
    CC builtin/bundle.o
    CC builtin/cat-file.o
    CC builtin/check-attr.o
    CC builtin/check-ignore.o
    CC builtin/check-mailmap.o
    CC builtin/check-ref-format.o
    CC builtin/checkout-index.o
    CC builtin/checkout.o
    CC builtin/clean.o
    CC builtin/clone.o
    CC builtin/column.o
    CC builtin/commit-tree.o
    CC builtin/commit.o
    CC builtin/config.o
    CC builtin/count-objects.o
    CC builtin/credential.o
    CC builtin/describe.o
    CC builtin/diff-files.o
    CC builtin/diff-index.o
    CC builtin/diff-tree.o
    CC builtin/diff.o
    CC builtin/fast-export.o
    CC builtin/fetch-pack.o
    CC builtin/fetch.o
    CC builtin/fmt-merge-msg.o
    CC builtin/for-each-ref.o
    CC builtin/fsck.o
    CC builtin/gc.o
    CC builtin/get-tar-commit-id.o
    CC builtin/grep.o
    CC builtin/hash-object.o
    CC builtin/help.o
    CC builtin/index-pack.o
    CC builtin/init-db.o
    CC builtin/interpret-trailers.o
    CC builtin/log.o
    CC builtin/ls-files.o
    CC builtin/ls-remote.o
    CC builtin/ls-tree.o
    CC builtin/mailinfo.o
    CC builtin/mailsplit.o
    CC builtin/merge.o
    CC builtin/merge-base.o
    CC builtin/merge-file.o
    CC builtin/merge-index.o
    CC builtin/merge-ours.o
    CC builtin/merge-recursive.o
    CC builtin/merge-tree.o
    CC builtin/mktag.o
    CC builtin/mktree.o
    CC builtin/mv.o
    CC builtin/name-rev.o
    CC builtin/notes.o
    CC builtin/pack-objects.o
    CC builtin/pack-redundant.o
    CC builtin/pack-refs.o
    CC builtin/patch-id.o
    CC builtin/prune-packed.o
    CC builtin/prune.o
    CC builtin/push.o
    CC builtin/read-tree.o
    CC builtin/receive-pack.o
    CC builtin/reflog.o
    CC builtin/remote.o
    CC builtin/remote-ext.o
    CC builtin/remote-fd.o
    CC builtin/repack.o
    CC builtin/replace.o
    CC builtin/rerere.o
    CC builtin/reset.o
    CC builtin/rev-list.o
    CC builtin/rev-parse.o
    CC builtin/revert.o
    CC builtin/rm.o
    CC builtin/send-pack.o
    CC builtin/shortlog.o
    CC builtin/show-branch.o
    CC builtin/show-ref.o
    CC builtin/stripspace.o
    CC builtin/symbolic-ref.o
    CC builtin/tag.o
    CC builtin/unpack-file.o
    CC builtin/unpack-objects.o
    CC builtin/update-index.o
    CC builtin/update-ref.o
    CC builtin/update-server-info.o
    CC builtin/upload-archive.o
    CC builtin/var.o
    CC builtin/verify-commit.o
    CC builtin/verify-pack.o
    CC builtin/verify-tag.o
    CC builtin/worktree.o
    CC builtin/write-tree.o
    MSGFMT po/build/locale/pt_PT/LC_MESSAGES/git.mo
306 translated messages, 687 untranslated messages.
    MSGFMT po/build/locale/de/LC_MESSAGES/git.mo
2359 translated messages.
    MSGFMT po/build/locale/vi/LC_MESSAGES/git.mo
    MSGFMT po/build/locale/is/LC_MESSAGES/git.mo
14 translated messages.
    MSGFMT po/build/locale/ca/LC_MESSAGES/git.mo
    MSGFMT po/build/locale/sv/LC_MESSAGES/git.mo
2359 translated messages.
    MSGFMT po/build/locale/fr/LC_MESSAGES/git.mo
2359 translated messages.
    MSGFMT po/build/locale/it/LC_MESSAGES/git.mo
716 translated messages, 350 untranslated messages.
    MSGFMT po/build/locale/bg/LC_MESSAGES/git.mo
2359 translated messages.
    MSGFMT po/build/locale/ru/LC_MESSAGES/git.mo
2359 translated messages.
    MSGFMT po/build/locale/zh_CN/LC_MESSAGES/git.mo
2359 translated messages.
    CC test-chmtime.o
2359 translated messages.
2359 translated messages.
    CC test-ctype.o
    CC test-config.o
    CC test-date.o
    CC test-delta.o
    CC test-dump-cache-tree.o
    CC test-dump-split-index.o
    CC test-dump-untracked-cache.o
    CC test-genrandom.o
    CC test-hashmap.o
    CC test-index-version.o
    CC test-line-buffer.o
    CC test-match-trees.o
    CC test-mergesort.o
    CC test-mktemp.o
    CC test-parse-options.o
    CC test-path-utils.o
    CC test-prio-queue.o
    CC test-read-cache.o
    CC test-regex.o
    CC test-revision-walking.o
    CC test-run-command.o
    CC test-scrap-cache-tree.o
    CC test-sha1.o
    CC test-sha1-array.o
    CC test-sigchain.o
    CC test-string-list.o
    CC test-subprocess.o
    CC test-svn-fe.o
    CC test-urlmatch-normalization.o
    CC test-wildmatch.o
    GEN bin-wrappers/git
    GEN bin-wrappers/git-upload-pack
    GEN bin-wrappers/git-receive-pack
    GEN bin-wrappers/git-upload-archive
    GEN bin-wrappers/git-shell
    GEN bin-wrappers/git-cvsserver
    GEN bin-wrappers/test-chmtime
    GEN bin-wrappers/test-ctype
    GEN bin-wrappers/test-config
    GEN bin-wrappers/test-date
    GEN bin-wrappers/test-delta
    GEN bin-wrappers/test-dump-cache-tree
    GEN bin-wrappers/test-dump-split-index
    GEN bin-wrappers/test-dump-untracked-cache
    GEN bin-wrappers/test-genrandom
    GEN bin-wrappers/test-hashmap
    GEN bin-wrappers/test-index-version
    GEN bin-wrappers/test-line-buffer
    GEN bin-wrappers/test-match-trees
    GEN bin-wrappers/test-mergesort
    GEN bin-wrappers/test-mktemp
    GEN bin-wrappers/test-parse-options
    GEN bin-wrappers/test-path-utils
    GEN bin-wrappers/test-prio-queue
    GEN bin-wrappers/test-read-cache
    GEN bin-wrappers/test-regex
    GEN bin-wrappers/test-revision-walking
    GEN bin-wrappers/test-run-command
    GEN bin-wrappers/test-scrap-cache-tree
    GEN bin-wrappers/test-sha1
    GEN bin-wrappers/test-sha1-array
    GEN bin-wrappers/test-sigchain
    GEN bin-wrappers/test-string-list
    GEN bin-wrappers/test-subprocess
    GEN bin-wrappers/test-svn-fe
    GEN bin-wrappers/test-urlmatch-normalization
    GEN bin-wrappers/test-wildmatch
    GEN git-remote-testgit
    CC credential-store.o
    CC abspath.o
    CC advice.o
    CC alias.o
    CC alloc.o
    CC archive.o
    CC archive-tar.o
    CC archive-zip.o
    CC argv-array.o
    CC attr.o
    CC base85.o
    CC bisect.o
    CC blob.o
    CC branch.o
    CC bulk-checkin.o
    CC bundle.o
    CC cache-tree.o
    CC color.o
    CC column.o
    CC combine-diff.o
    CC commit.o
    CC compat/obstack.o
    CC compat/terminal.o
    CC config.o
    CC connect.o
    CC connected.o
    CC convert.o
    CC copy.o
    CC credential.o
    CC csum-file.o
    CC ctype.o
    CC date.o
    CC decorate.o
    CC diffcore-break.o
    CC diffcore-delta.o
    CC diffcore-order.o
    CC diffcore-pickaxe.o
    CC diffcore-rename.o
    CC diff-delta.o
    CC diff-lib.o
    CC diff-no-index.o
    CC diff.o
    CC dir.o
    CC editor.o
    CC entry.o
    CC environment.o
    CC ewah/bitmap.o
    CC ewah/ewah_bitmap.o
    CC ewah/ewah_io.o
    CC ewah/ewah_rlw.o
    CC exec_cmd.o
    CC fetch-pack.o
    CC fsck.o
    CC gettext.o
    CC gpg-interface.o
    CC graph.o
    CC grep.o
    CC hashmap.o
    CC help.o
    CC version.o
    AR xdiff/lib.a
    AR vcs-svn/lib.a
    GEN git-am
    GEN git-bisect
    GEN git-difftool--helper
    GEN git-filter-branch
    GEN git-merge-octopus
    GEN git-merge-one-file
    GEN git-merge-resolve
    GEN git-mergetool
    GEN git-quiltimport
    GEN git-pull
    GEN git-rebase
    GEN git-stash
    GEN git-request-pull
    GEN git-submodule
    GEN git-web--browse
make[2]: Entering directory '/«PKGBUILDDIR»/perl'
/usr/bin/perl Makefile.PL PREFIX='/usr' INSTALL_BASE='' --localedir='/usr/share/locale'
    GEN git-p4
Generating a Unix-style perl.mak
Writing perl.mak for Git
Writing MYMETA.yml and MYMETA.json
make[2]: Leaving directory '/«PKGBUILDDIR»/perl'
    GEN git-add--interactive
    GEN git-difftool
    GEN git-archimport
    GEN git-cvsimport
    GEN git-cvsexportcommit
    GEN git-cvsserver
    GEN git-relink
    GEN git-send-email
    GEN git-svn
    AR libgit.a
    LINK git-credential-store
    LINK git-daemon
    LINK git-fast-import
    LINK git-http-backend
    LINK git-imap-send
    LINK git-sh-i18n--envsubst
    LINK git-shell
    LINK git-show-index
    LINK git-upload-pack
    LINK git-remote-testsvn
    LINK git-http-fetch
    LINK git-http-push
    LINK git-credential-cache
    LINK git-credential-cache--daemon
    LINK git-remote-http
    LINK git
    LINK test-chmtime
    LINK test-ctype
    LINK test-config
    LINK test-date
    LINK test-delta
    LINK test-dump-cache-tree
    LINK test-dump-split-index
    LINK test-dump-untracked-cache
    LINK test-genrandom
    LINK test-hashmap
    LINK test-index-version
    LINK test-line-buffer
    LINK test-match-trees
    LINK test-mergesort
    LINK test-mktemp
    LINK test-parse-options
    LINK test-path-utils
    LINK test-prio-queue
    LINK test-read-cache
    LINK test-regex
    LINK test-revision-walking
    LINK test-run-command
    LINK test-scrap-cache-tree
    LINK test-sha1
    LINK test-sha1-array
    LINK test-sigchain
    LINK test-string-list
    LINK test-subprocess
    LINK test-svn-fe
    LINK test-urlmatch-normalization
    LINK test-wildmatch
    LN/CP git-remote-https
    LN/CP git-remote-ftp
    LN/CP git-remote-ftps
    BUILTIN git-add
    BUILTIN git-annotate
    BUILTIN git-apply
    BUILTIN git-archive
    BUILTIN git-bisect--helper
    BUILTIN git-blame
    BUILTIN git-branch
    BUILTIN git-bundle
    BUILTIN git-cat-file
    BUILTIN git-check-attr
    BUILTIN git-check-ignore
    BUILTIN git-check-mailmap
    BUILTIN git-check-ref-format
    BUILTIN git-checkout-index
    BUILTIN git-checkout
    BUILTIN git-clean
    BUILTIN git-clone
    BUILTIN git-column
    BUILTIN git-commit-tree
    BUILTIN git-commit
    BUILTIN git-config
    BUILTIN git-count-objects
    BUILTIN git-credential
    BUILTIN git-describe
    BUILTIN git-diff-files
    BUILTIN git-diff-index
    BUILTIN git-diff-tree
    BUILTIN git-diff
    BUILTIN git-fast-export
    BUILTIN git-fetch-pack
    BUILTIN git-fetch
    BUILTIN git-fmt-merge-msg
    BUILTIN git-for-each-ref
    BUILTIN git-fsck
    BUILTIN git-gc
    BUILTIN git-get-tar-commit-id
    BUILTIN git-grep
    BUILTIN git-hash-object
    BUILTIN git-help
    BUILTIN git-index-pack
    BUILTIN git-interpret-trailers
    BUILTIN git-init-db
    BUILTIN git-log
    BUILTIN git-ls-files
    BUILTIN git-ls-remote
    BUILTIN git-ls-tree
    BUILTIN git-mailinfo
    BUILTIN git-mailsplit
    BUILTIN git-merge
    BUILTIN git-merge-base
    BUILTIN git-merge-file
    BUILTIN git-merge-index
    BUILTIN git-merge-ours
    BUILTIN git-merge-recursive
    BUILTIN git-merge-tree
    BUILTIN git-mktag
    BUILTIN git-mktree
    BUILTIN git-mv
    BUILTIN git-name-rev
    BUILTIN git-notes
    BUILTIN git-pack-objects
    BUILTIN git-pack-redundant
    BUILTIN git-pack-refs
    BUILTIN git-patch-id
    BUILTIN git-prune-packed
    BUILTIN git-prune
    BUILTIN git-push
    BUILTIN git-read-tree
    BUILTIN git-receive-pack
    BUILTIN git-reflog
    BUILTIN git-remote
    BUILTIN git-remote-ext
    BUILTIN git-remote-fd
    BUILTIN git-repack
    BUILTIN git-replace
    BUILTIN git-rerere
    BUILTIN git-reset
    BUILTIN git-rev-list
    BUILTIN git-rev-parse
    BUILTIN git-revert
    BUILTIN git-rm
    BUILTIN git-send-pack
    BUILTIN git-shortlog
    BUILTIN git-show-branch
    BUILTIN git-show-ref
    BUILTIN git-stripspace
    BUILTIN git-symbolic-ref
    BUILTIN git-tag
    BUILTIN git-unpack-file
    BUILTIN git-unpack-objects
    BUILTIN git-update-index
    BUILTIN git-update-ref
    BUILTIN git-update-server-info
    BUILTIN git-upload-archive
    BUILTIN git-var
    BUILTIN git-verify-commit
    BUILTIN git-verify-pack
    BUILTIN git-verify-tag
    BUILTIN git-worktree
    BUILTIN git-write-tree
    BUILTIN git-cherry
    BUILTIN git-cherry-pick
    BUILTIN git-fsck-objects
    BUILTIN git-format-patch
    BUILTIN git-init
    BUILTIN git-merge-subtree
    BUILTIN git-show
    BUILTIN git-stage
    BUILTIN git-status
    BUILTIN git-whatchanged
make[2]: Entering directory '/«PKGBUILDDIR»/git-gui'
GITGUI_VERSION = 0.19.0.18.g4498b
    * new locations or Tcl/Tk interpreter
    MSGFMT    po/de.msg     MSGFMT    po/vi.msg     MSGFMT    po/hu.msg     MSGFMT    po/nb.msg 520 translated.
474 translated, 39 untranslated.
    MSGFMT    po/sv.msg     MSGFMT    po/fr.msg 543 translated.
514 translated.
    MSGFMT    po/it.msg     MSGFMT    po/ja.msg 547 translated.
519 translated, 1 untranslated.
    MSGFMT po/pt_br.msg 520 translated.
520 translated.
    MSGFMT    po/bg.msg     MSGFMT po/zh_cn.msg     MSGFMT    po/ru.msg 520 translated.
    MSGFMT    po/el.msg 366 translated, 7 fuzzy, 17 untranslated.
    GEN git-gui
516 translated, 4 untranslated.
    INDEX lib/
547 translated.
381 translated, 4 fuzzy, 6 untranslated.
make[2]: Leaving directory '/«PKGBUILDDIR»/git-gui'
make[2]: Entering directory '/«PKGBUILDDIR»/gitk-git'
Generating catalog po/de.msg
    * new Tcl/Tk interpreter location
msgfmt --statistics --tcl po/de.po -l de -d po/
Generating catalog po/vi.msg
msgfmt --statistics --tcl po/vi.po -l vi -d po/
Generating catalog po/ca.msg
msgfmt --statistics --tcl po/ca.po -l ca -d po/
Generating catalog po/hu.msg
msgfmt --statistics --tcl po/hu.po -l hu -d po/
279 translated messages, 16 fuzzy translations, 9 untranslated messages.
301 translated messages, 2 fuzzy translations, 1 untranslated message.
Generating catalog po/es.msg
303 translated messages, 1 fuzzy translation.
277 translated messages, 17 fuzzy translations, 10 untranslated messages.
msgfmt --statistics --tcl po/es.po -l es -d po/
Generating catalog po/sv.msg
msgfmt --statistics --tcl po/sv.po -l sv -d po/
Generating catalog po/fr.msg
msgfmt --statistics --tcl po/fr.po -l fr -d po/
Generating catalog po/it.msg
msgfmt --statistics --tcl po/it.po -l it -d po/
183 translated messages, 45 fuzzy translations, 76 untranslated messages.
301 translated messages, 2 fuzzy translations, 1 untranslated message.
Generating catalog po/ja.msg
msgfmt --statistics --tcl po/ja.po -l ja -d po/
262 translated messages, 26 fuzzy translations, 16 untranslated messages.
Generating catalog po/pt_br.msg
274 translated messages, 16 fuzzy translations, 14 untranslated messages.
msgfmt --statistics --tcl po/pt_br.po -l pt_br -d po/
Generating catalog po/bg.msg
msgfmt --statistics --tcl po/bg.po -l bg -d po/
Generating catalog po/ru.msg
msgfmt --statistics --tcl po/ru.po -l ru -d po/
272 translated messages, 19 fuzzy translations, 13 untranslated messages.
280 translated messages, 15 fuzzy translations, 9 untranslated messages.
    GEN gitk-wish
302 translated messages, 1 fuzzy translation, 1 untranslated message.
225 translated messages, 33 fuzzy translations, 46 untranslated messages.
make[2]: Leaving directory '/«PKGBUILDDIR»/gitk-git'
make[2]: Entering directory '/«PKGBUILDDIR»/perl'
make[3]: Entering directory '/«PKGBUILDDIR»/perl'
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></usr/share/locale>" <Git/I18N.pm >blib/lib/Git/I18N.pm
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></usr/share/locale>" <Git/SVN/Memoize/YAML.pm >blib/lib/Git/SVN/Memoize/YAML.pm
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></usr/share/locale>" <Git/SVN/Editor.pm >blib/lib/Git/SVN/Editor.pm
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></usr/share/locale>" <Git/SVN.pm >blib/lib/Git/SVN.pm
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></usr/share/locale>" <Git.pm >blib/lib/Git.pm
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></usr/share/locale>" <Git/SVN/Migration.pm >blib/lib/Git/SVN/Migration.pm
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></usr/share/locale>" <Git/SVN/GlobSpec.pm >blib/lib/Git/SVN/GlobSpec.pm
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></usr/share/locale>" <Git/SVN/Fetcher.pm >blib/lib/Git/SVN/Fetcher.pm
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></usr/share/locale>" <Git/IndexInfo.pm >blib/lib/Git/IndexInfo.pm
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></usr/share/locale>" <Git/SVN/Utils.pm >blib/lib/Git/SVN/Utils.pm
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></usr/share/locale>" <Git/SVN/Prompt.pm >blib/lib/Git/SVN/Prompt.pm
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></usr/share/locale>" <Git/SVN/Ra.pm >blib/lib/Git/SVN/Ra.pm
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></usr/share/locale>" <Git/SVN/Log.pm >blib/lib/Git/SVN/Log.pm
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></usr/share/locale>" <private-Error.pm >blib/lib/Error.pm
Manifying blib/man3/Git.3pm
Manifying blib/man3/Git::I18N.3pm
Manifying blib/man3/Git::SVN::Editor.3pm
Manifying blib/man3/Git::SVN::Fetcher.3pm
Manifying blib/man3/Git::SVN::Memoize::YAML.3pm
Manifying blib/man3/Git::SVN::Prompt.3pm
Manifying blib/man3/Git::SVN::Ra.3pm
Manifying blib/man3/Git::SVN::Utils.3pm
Manifying blib/man3/private-Error.3pm
make[3]: Leaving directory '/«PKGBUILDDIR»/perl'
make[2]: Leaving directory '/«PKGBUILDDIR»/perl'
make[2]: Entering directory '/«PKGBUILDDIR»/templates'
make[2]: Leaving directory '/«PKGBUILDDIR»/templates'
make[1]: Leaving directory '/«PKGBUILDDIR»'
DESTDIR='/«PKGBUILDDIR»/debian/git' /usr/bin/make -C contrib/subtree all NO_OPENSSL=1 prefix=/usr gitexecdir=/usr/lib/git-core libexecdir=/usr/lib/git-core mandir=/usr/share/man htmldir=/usr/share/doc/git/html INSTALLDIRS=vendor USE_SRV_RR=1 USE_LIBPCRE=1 SANE_TOOL_PATH= INSTALL=install TAR=tar NO_CROSS_DIRECTORY_HARDLINKS=1 NO_INSTALL_HARDLINKS=1 DEFAULT_PAGER=pager DEFAULT_EDITOR=editor CC='gcc' CFLAGS='-Wall -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' LDFLAGS='-Wl,-z,relro'
make[1]: Entering directory '/«PKGBUILDDIR»/contrib/subtree'
/usr/bin/make -C ../../ GIT-VERSION-FILE
make[2]: Entering directory '/«PKGBUILDDIR»'
make[2]: 'GIT-VERSION-FILE' is up to date.
make[2]: Leaving directory '/«PKGBUILDDIR»'
sed -e '1s|#!.*/sh|#!/bin/sh|' git-subtree.sh >git-subtree
chmod +x git-subtree
make[1]: Leaving directory '/«PKGBUILDDIR»/contrib/subtree'
ln -s contrib/subtree/git-subtree
test -z 'test' || \
  DESTDIR='/«PKGBUILDDIR»/debian/git' /usr/bin/make test NO_OPENSSL=1 prefix=/usr gitexecdir=/usr/lib/git-core libexecdir=/usr/lib/git-core mandir=/usr/share/man htmldir=/usr/share/doc/git/html INSTALLDIRS=vendor USE_SRV_RR=1 USE_LIBPCRE=1 SANE_TOOL_PATH= INSTALL=install TAR=tar NO_CROSS_DIRECTORY_HARDLINKS=1 NO_INSTALL_HARDLINKS=1 DEFAULT_PAGER=pager DEFAULT_EDITOR=editor CC='gcc' CFLAGS='-Wall -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' LDFLAGS='-Wl,-z,relro' || \
  GIT_TEST_OPTS=--verbose DESTDIR='/«PKGBUILDDIR»/debian/git' /usr/bin/make test NO_OPENSSL=1 prefix=/usr gitexecdir=/usr/lib/git-core libexecdir=/usr/lib/git-core mandir=/usr/share/man htmldir=/usr/share/doc/git/html INSTALLDIRS=vendor USE_SRV_RR=1 USE_LIBPCRE=1 SANE_TOOL_PATH= INSTALL=install TAR=tar NO_CROSS_DIRECTORY_HARDLINKS=1 NO_INSTALL_HARDLINKS=1 DEFAULT_PAGER=pager DEFAULT_EDITOR=editor CC='gcc' CFLAGS='-Wall -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' LDFLAGS='-Wl,-z,relro'
make[1]: Entering directory '/«PKGBUILDDIR»'
make[2]: Entering directory '/«PKGBUILDDIR»/perl'
/usr/bin/perl Makefile.PL PREFIX='/usr' INSTALL_BASE='' --localedir='/usr/share/locale'
Generating a Unix-style perl.mak
Writing perl.mak for Git
Writing MYMETA.yml and MYMETA.json
make[2]: Leaving directory '/«PKGBUILDDIR»/perl'
    GEN git-add--interactive
    GEN git-difftool
    GEN git-archimport
    GEN git-cvsexportcommit
    GEN git-cvsserver
    GEN git-cvsimport
    GEN git-relink
    GEN git-send-email
    GEN git-svn
make[2]: Entering directory '/«PKGBUILDDIR»/git-gui'
make[2]: Leaving directory '/«PKGBUILDDIR»/git-gui'
make[2]: Entering directory '/«PKGBUILDDIR»/gitk-git'
make[2]: Leaving directory '/«PKGBUILDDIR»/gitk-git'
make[2]: Entering directory '/«PKGBUILDDIR»/perl'
make[3]: Entering directory '/«PKGBUILDDIR»/perl'
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></usr/share/locale>" <Git/SVN/Ra.pm >blib/lib/Git/SVN/Ra.pm
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></usr/share/locale>" <Git/SVN/Migration.pm >blib/lib/Git/SVN/Migration.pm
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></usr/share/locale>" <Git/SVN/Log.pm >blib/lib/Git/SVN/Log.pm
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></usr/share/locale>" <Git/SVN/Utils.pm >blib/lib/Git/SVN/Utils.pm
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></usr/share/locale>" <Git/SVN/Editor.pm >blib/lib/Git/SVN/Editor.pm
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></usr/share/locale>" <Git/SVN/GlobSpec.pm >blib/lib/Git/SVN/GlobSpec.pm
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></usr/share/locale>" <Git/IndexInfo.pm >blib/lib/Git/IndexInfo.pm
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></usr/share/locale>" <private-Error.pm >blib/lib/Error.pm
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></usr/share/locale>" <Git/SVN/Memoize/YAML.pm >blib/lib/Git/SVN/Memoize/YAML.pm
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></usr/share/locale>" <Git/SVN/Fetcher.pm >blib/lib/Git/SVN/Fetcher.pm
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></usr/share/locale>" <Git/I18N.pm >blib/lib/Git/I18N.pm
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></usr/share/locale>" <Git.pm >blib/lib/Git.pm
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></usr/share/locale>" <Git/SVN/Prompt.pm >blib/lib/Git/SVN/Prompt.pm
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></usr/share/locale>" <Git/SVN.pm >blib/lib/Git/SVN.pm
make[3]: Leaving directory '/«PKGBUILDDIR»/perl'
make[2]: Leaving directory '/«PKGBUILDDIR»/perl'
make[2]: Entering directory '/«PKGBUILDDIR»/templates'
make[2]: Leaving directory '/«PKGBUILDDIR»/templates'
/usr/bin/make -C t/ all
make[2]: Entering directory '/«PKGBUILDDIR»/t'
rm -f -r 'test-results'
/usr/bin/make aggregate-results-and-cleanup
make[3]: Entering directory '/«PKGBUILDDIR»/t'
*** t0000-basic.sh ***
*** t0001-init.sh ***
*** t0002-gitfile.sh ***
*** t0003-attributes.sh ***
ok 1 - initial setup
ok 2 - bad setup: invalid .git file format
ok 1 - setup
ok 1 - .git/objects should be empty after git init in an empty repo
ok 1 - plain
ok 3 - bad setup: invalid .git file path
ok 2 - .git/objects should have 3 subdirectories
ok 3 - success is reported like this
ok 4 - final setup + check rev-parse --git-dir
ok 5 - check hash-object
ok 6 - check cat-file
ok 2 - plain nested in bare
ok 2 - command line checks
ok 7 - check update-index
ok 8 - check write-tree
ok 3 - plain through aliased command, outside any git repo
ok 9 - check commit-tree
ok 10 - check rev-list
ok 4 - pretend we have a fully passing test suite
# passed all 10 test(s)
1..10
*** t0004-unwritable.sh ***
ok 4 - plain nested through aliased command
ok 5 - plain nested in bare through aliased command
ok 6 - plain with GIT_WORK_TREE
ok 5 - pretend we have a partially passing test suite
ok 1 - setup
ok 3 - attribute test
ok 7 - plain bare
ok 8 - plain bare with GIT_WORK_TREE
ok 2 - write-tree should notice unwritable repository
ok 9 - GIT_DIR bare
ok 3 - commit should notice unwritable repository
ok 4 - update-index should notice unwritable repository
ok 10 - init --bare
ok 6 - pretend we have a known breakage
ok 5 - add should notice unwritable repository
# passed all 5 test(s)
1..5
ok 11 - GIT_DIR non-bare
*** t0005-signals.sh ***
ok 12 - GIT_DIR & GIT_WORK_TREE (1)
ok 4 - attribute matching is case sensitive when core.ignorecase=0
ok 13 - GIT_DIR & GIT_WORK_TREE (2)
ok 7 - pretend we have fixed a known breakage
ok 1 - sigchain works
ok 14 - reinit
ok 2 - signals are propagated using shell convention
ok 15 - init with --template
ok 3 - create blob
ok 16 - init with --template (blank)
ok 4 - a constipated git dies with SIGPIPE
ok 5 - a constipated git dies with SIGPIPE even if parent ignores it
ok 8 - pretend we have fixed one of two known breakages (run in sub test-lib)
# passed all 5 test(s)
1..5
ok 17 - init with init.templatedir set
*** t0006-date.sh ***
ok 5 - attribute matching is case insensitive when core.ignorecase=1
ok 6 # skip additional case insensitivity tests (missing CASE_INSENSITIVE_FS)
ok 18 - init --bare/--shared overrides system/global config
ok 9 - pretend we have a pass, fail, and known breakage
ok 1 - relative date (5 seconds ago)
ok 2 - relative date (5 minutes ago)
ok 3 - relative date (5 hours ago)
ok 4 - relative date (5 days ago)
ok 19 - init honors global core.sharedRepository
ok 5 - relative date (3 weeks ago)
ok 20 - init rejects insanely long --template
ok 7 - unnormalized paths
ok 6 - relative date (5 months ago)
ok 7 - relative date (1 year, 2 months ago)
ok 21 - init creates a new directory
ok 8 - relative date (1 year, 9 months ago)
ok 22 - init creates a new bare directory
ok 10 - pretend we have a mix of all possible results
ok 9 - relative date (20 years ago)
ok 10 - relative date (12 months ago)
ok 23 - init recreates a directory
ok 11 - relative date (2 years ago)
ok 12 - parse date (2008)
ok 24 - init recreates a new bare directory
ok 13 - parse date (2008-02)
ok 14 - parse date (2008-02-14)
ok 25 - init creates a new deep directory
ok 15 - parse date (2008-02-14 20:30:45)
ok 8 - relative paths
ok 16 - parse date (2008-02-14 20:30:45 -0500)
ok 11 - test --verbose
ok 17 - parse date (2008-02-14 20:30:45 -0015)
ok 9 - prefixes are not confused with leading directories
ok 18 - parse date (2008-02-14 20:30:45 -5)
ok 26 - init creates a new deep directory (umask vs. shared)
ok 19 - parse date (2008-02-14 20:30:45 -5:)
ok 20 - parse date (2008-02-14 20:30:45 -05)
ok 27 - init notices EEXIST (1)
ok 21 - parse date (2008-02-14 20:30:45 -:30)
ok 28 - init notices EEXIST (2)
ok 22 - parse date (2008-02-14 20:30:45 -05:00)
ok 23 - parse date (2008-02-14 20:30:45 TZ=EST5)
ok 24 - parse approxidate (now)
ok 10 - core.attributesfile
ok 25 - parse approxidate (5 seconds ago)
ok 26 - parse approxidate (5.seconds.ago)
ok 29 - init notices EPERM
ok 11 - attribute test: read paths from stdin
ok 27 - parse approxidate (10.minutes.ago)
ok 12 - test --verbose-only
ok 30 - init creates a new bare directory with global --bare
ok 28 - parse approxidate (yesterday)
ok 29 - parse approxidate (3.days.ago)
ok 12 - attribute test: --all option
ok 30 - parse approxidate (3.weeks.ago)
ok 31 - init prefers command line to GIT_DIR
ok 31 - parse approxidate (3.months.ago)
ok 32 - parse approxidate (2.years.3.months.ago)
ok 32 - init with separate gitdir
ok 33 - parse approxidate (6am yesterday)
ok 33 - re-init on .git file
ok 34 - parse approxidate (6pm yesterday)
ok 13 - attribute test: --cached option
ok 35 - parse approxidate (3:00)
ok 34 - re-init to update git link
ok 36 - parse approxidate (15:00)
ok 13 - GIT_SKIP_TESTS
ok 14 - root subdir attribute test
ok 37 - parse approxidate (noon today)
ok 38 - parse approxidate (noon yesterday)
ok 15 - negative patterns
ok 39 - parse approxidate (last tuesday)
ok 35 - re-init to move gitdir
ok 16 - patterns starting with exclamation
ok 40 - parse approxidate (July 5th)
ok 41 - parse approxidate (06/05/2009)
ok 42 - parse approxidate (06.05.2009)
ok 43 - parse approxidate (Jun 6, 5AM)
ok 44 - parse approxidate (5AM Jun 6)
ok 17 - "**" test
ok 45 - parse approxidate (6AM, June 7, 2009)
ok 36 - re-init to move gitdir symlink
# passed all 36 test(s)
1..36
ok 46 - parse approxidate (2008-12-01)
ok 47 - parse approxidate (2009-12-01)
# passed all 47 test(s)
1..47
ok 14 - GIT_SKIP_TESTS several tests
ok 18 - "**" with no slashes test
*** t0007-git-var.sh ***
ok 19 - using --git-dir and --work-tree
*** t0008-ignores.sh ***
ok 20 - setup bare
ok 1 - get GIT_AUTHOR_IDENT
ok 2 - get GIT_COMMITTER_IDENT
ok 15 - GIT_SKIP_TESTS sh pattern
ok 3 - requested identites are strict
ok 4 - git var -l lists variables
ok 21 - bare repository: check that .gitattribute is ignored
ok 5 - git var -l lists config
ok 6 - listing and asking for variables are exclusive
ok 22 - bare repository: check that --cached honors index
# passed all 6 test(s)
1..6
*** t0009-prio-queue.sh ***
ok 1 - setup
ok 23 - bare repository: test info/attributes
# passed all 23 test(s)
1..23
ok 2 - . corner-case
ok 1 - basic ordering
ok 3 - . corner-case with -q
ok 16 - --run basic
ok 2 - mixed put and get
*** t0010-racy-git.sh ***
ok 4 - . corner-case with --quiet
ok 3 - notice empty queue
# passed all 3 test(s)
1..3
ok 5 - . corner-case with -v
*** t0011-hashmap.sh ***
ok 6 - . corner-case with -v -n
ok 7 - . corner-case with -v --non-matching
ok 8 - . corner-case with --verbose
ok 1 - Racy GIT trial #0 part A
ok 9 - . corner-case with --verbose -n
ok 10 - . corner-case with --verbose --non-matching
ok 1 - hash functions
ok 17 - --run with a range
ok 11 - empty command line
ok 2 - put
ok 3 - put (case insensitive)
ok 12 - empty command line with -q
ok 4 - replace
ok 5 - replace (case insensitive)
ok 13 - empty command line with --quiet
ok 6 - get
ok 7 - get (case insensitive)
ok 8 - add
ok 14 - empty command line with -v
ok 9 - add (case insensitive)
ok 15 - empty command line with -v -n
ok 10 - remove
ok 11 - remove (case insensitive)
ok 12 - iterate
ok 16 - empty command line with -v --non-matching
ok 13 - iterate (case insensitive)
ok 17 - empty command line with --verbose
ok 14 - grow / shrink
ok 18 - empty command line with --verbose -n
ok 15 - string interning
# passed all 15 test(s)
1..15
ok 19 - empty command line with --verbose --non-matching
ok 18 - --run with two ranges
*** t0020-crlf.sh ***
ok 20 - --stdin with empty STDIN
ok 21 - --stdin with empty STDIN with -q
ok 22 - --stdin with empty STDIN with --quiet
ok 23 - --stdin with empty STDIN with -v
ok 24 - --stdin with empty STDIN with -v -n
ok 25 - --stdin with empty STDIN with -v --non-matching
ok 19 - --run with a left open range
ok 26 - --stdin with empty STDIN with --verbose
ok 27 - --stdin with empty STDIN with --verbose -n
ok 1 - setup
ok 28 - --stdin with empty STDIN with --verbose --non-matching
ok 2 - safecrlf: autocrlf=input, all CRLF
ok 2 - Racy GIT trial #0 part B
ok 29 - -q with multiple args
ok 30 - --quiet with multiple args
ok 3 - Racy GIT trial #1 part A
ok 3 - safecrlf: autocrlf=input, mixed LF/CRLF
ok 31 - -q -v
ok 4 - safecrlf: autocrlf=true, all LF
ok 32 - --quiet -v
ok 20 - --run with a right open range
ok 5 - safecrlf: autocrlf=true mixed LF/CRLF
ok 33 - -q --verbose
ok 34 - --quiet --verbose
ok 35 - --quiet with multiple args
ok 6 - safecrlf: print warning only once
ok 36 - erroneous use of --
ok 7 - safecrlf: git diff demotes safecrlf=true to warn
ok 37 - erroneous use of -- with -q
ok 21 - --run with basic negation
ok 8 - switch off autocrlf, safecrlf, reset HEAD
ok 38 - erroneous use of -- with --quiet
ok 39 - erroneous use of -- with -v
ok 40 - erroneous use of -- with -v -n
ok 9 - update with autocrlf=input
ok 41 - erroneous use of -- with -v --non-matching
ok 42 - erroneous use of -- with --verbose
ok 43 - erroneous use of -- with --verbose -n
ok 10 - update with autocrlf=true
ok 44 - erroneous use of -- with --verbose --non-matching
ok 22 - --run with two negations
ok 45 - --stdin with superfluous arg
ok 46 - --stdin with superfluous arg with -q
ok 11 - checkout with autocrlf=true
ok 47 - --stdin with superfluous arg with --quiet
ok 48 - --stdin with superfluous arg with -v
ok 49 - --stdin with superfluous arg with -v -n
ok 12 - checkout with autocrlf=input
ok 50 - --stdin with superfluous arg with -v --non-matching
ok 4 - Racy GIT trial #1 part B
ok 51 - --stdin with superfluous arg with --verbose
ok 13 - apply patch (autocrlf=input)
ok 5 - Racy GIT trial #2 part A
ok 52 - --stdin with superfluous arg with --verbose -n
ok 23 - --run a range and negation
ok 53 - --stdin with superfluous arg with --verbose --non-matching
ok 14 - apply patch --cached (autocrlf=input)
ok 54 - --stdin -z with superfluous arg
ok 55 - --stdin -z with superfluous arg with -q
ok 15 - apply patch --index (autocrlf=input)
ok 56 - --stdin -z with superfluous arg with --quiet
ok 57 - --stdin -z with superfluous arg with -v
ok 16 - apply patch (autocrlf=true)
ok 58 - --stdin -z with superfluous arg with -v -n
ok 24 - --run range negation
ok 17 - apply patch --cached (autocrlf=true)
ok 59 - --stdin -z with superfluous arg with -v --non-matching
ok 60 - --stdin -z with superfluous arg with --verbose
ok 61 - --stdin -z with superfluous arg with --verbose -n
ok 18 - apply patch --index (autocrlf=true)
ok 62 - --stdin -z with superfluous arg with --verbose --non-matching
ok 19 - .gitattributes says two is binary
ok 63 - -z without --stdin
ok 20 - .gitattributes says two is input
ok 64 - -z without --stdin with -q
ok 21 - .gitattributes says two and three are text
ok 65 - -z without --stdin with --quiet
ok 66 - -z without --stdin with -v
ok 67 - -z without --stdin with -v -n
ok 25 - --run include, exclude and include
ok 22 - in-tree .gitattributes (1)
ok 68 - -z without --stdin with -v --non-matching
ok 23 - in-tree .gitattributes (2)
ok 69 - -z without --stdin with --verbose
ok 70 - -z without --stdin with --verbose -n
ok 24 - in-tree .gitattributes (3)
ok 71 - -z without --stdin with --verbose --non-matching
ok 6 - Racy GIT trial #2 part B
ok 72 - -z without --stdin and superfluous arg
ok 7 - Racy GIT trial #3 part A
ok 25 - in-tree .gitattributes (4)
ok 73 - -z without --stdin and superfluous arg with -q
ok 74 - -z without --stdin and superfluous arg with --quiet
ok 75 - -z without --stdin and superfluous arg with -v
ok 26 - --run include, exclude and include, comma separated
ok 76 - -z without --stdin and superfluous arg with -v -n
ok 77 - -z without --stdin and superfluous arg with -v --non-matching
ok 78 - -z without --stdin and superfluous arg with --verbose
ok 26 - checkout with existing .gitattributes
ok 79 - -z without --stdin and superfluous arg with --verbose -n
ok 80 - -z without --stdin and superfluous arg with --verbose --non-matching
ok 81 - needs work tree
ok 27 - checkout when deleting .gitattributes
ok 28 - invalid .gitattributes (must not crash)
ok 82 - needs work tree with -q
ok 27 - --run exclude and include
ok 83 - needs work tree with --quiet
ok 84 - needs work tree with -v
ok 29 - setting up for new autocrlf tests
ok 85 - needs work tree with -v -n
ok 30 - report no change after setting autocrlf
ok 86 - needs work tree with -v --non-matching
ok 31 - files are clean after checkout
ok 87 - needs work tree with --verbose
ok 32 - LF only file gets CRLF with autocrlf
ok 33 - Mixed file is still mixed with autocrlf
ok 34 - CRLF only file has CRLF with autocrlf
ok 88 - needs work tree with --verbose -n
ok 89 - needs work tree with --verbose --non-matching
ok 28 - --run empty selectors
ok 35 - New CRLF file gets LF in repo
# passed all 35 test(s)
1..35
ok 90 - non-existent file at top-level not ignored
ok 91 - non-existent file at top-level not ignored with -q
*** t0021-conversion.sh ***
ok 92 - non-existent file at top-level not ignored with --quiet
ok 93 - non-existent file at top-level not ignored with -v
ok 29 - --run invalid range start
ok 8 - Racy GIT trial #3 part B
ok 94 - non-existent file at top-level not ignored with -v -n
ok 9 - Racy GIT trial #4 part A
ok 95 - non-existent file at top-level not ignored with -v --non-matching
ok 96 - non-existent file at top-level not ignored with --verbose
ok 97 - non-existent file at top-level not ignored with --verbose -n
ok 98 - non-existent file at top-level not ignored with --verbose --non-matching
ok 1 - setup
ok 30 - --run invalid range end
ok 99 - non-existent file at top-level not ignored with --no-index
ok 2 - check
ok 100 - non-existent file at top-level not ignored with --no-index -q
ok 101 - non-existent file at top-level not ignored with --no-index --quiet
ok 102 - non-existent file at top-level not ignored with --no-index -v
ok 103 - non-existent file at top-level not ignored with --no-index -v -n
ok 31 - --run invalid selector
ok 104 - non-existent file at top-level not ignored with --no-index -v --non-matching
ok 32 - test runs if prerequisite is satisfied
ok 33 # skip unmet prerequisite causes test to be skipped (missing DONTHAVEIT)
ok 34 - test runs if prerequisites are satisfied
ok 35 # skip unmet prerequisites causes test to be skipped (missing DONTHAVEIT of HAVEIT,DONTHAVEIT)
ok 105 - non-existent file at top-level not ignored with --no-index --verbose
ok 36 # skip unmet prerequisites causes test to be skipped (missing DONTHAVEIT of DONTHAVEIT,HAVEIT)
ok 3 - expanded_in_repo
ok 37 - test runs if lazy prereq is satisfied
ok 38 # skip missing lazy prereqs skip tests (missing !LAZY_TRUE)
ok 106 - non-existent file at top-level not ignored with --no-index --verbose -n
ok 39 - negative lazy prereqs checked
ok 40 # skip missing negative lazy prereqs will skip (missing LAZY_FALSE)
ok 41 - tests clean up after themselves
ok 107 - non-existent file at top-level not ignored with --no-index --verbose --non-matching
ok 108 - non-existent file at top-level ignored
ok 109 - non-existent file at top-level ignored with -q
ok 110 - non-existent file at top-level ignored with --quiet
ok 111 - non-existent file at top-level ignored with -v
ok 4 - filter shell-escaped filenames
ok 42 - tests clean up even on failures
ok 43 - git update-index without --add should fail adding
ok 112 - non-existent file at top-level ignored with -v -n
ok 44 - git update-index with --add should succeed
ok 45 - writing tree out with git write-tree
ok 46 - validate object ID of a known tree
ok 113 - non-existent file at top-level ignored with -v --non-matching
ok 47 - git update-index without --remove should fail removing
ok 48 - git update-index with --remove should be able to remove
ok 114 - non-existent file at top-level ignored with --verbose
ok 49 - git write-tree should be able to write an empty tree
ok 5 - required filter should filter data
ok 50 - validate object ID of a known tree
ok 115 - non-existent file at top-level ignored with --verbose -n
ok 116 - non-existent file at top-level ignored with --verbose --non-matching
ok 10 - Racy GIT trial #4 part B
# passed all 10 test(s)
1..10
ok 117 - non-existent file at top-level ignored with --no-index
*** t0022-crlf-rename.sh ***
ok 118 - non-existent file at top-level ignored with --no-index -q
ok 119 - non-existent file at top-level ignored with --no-index --quiet
ok 120 - non-existent file at top-level ignored with --no-index -v
ok 121 - non-existent file at top-level ignored with --no-index -v -n
ok 122 - non-existent file at top-level ignored with --no-index -v --non-matching
ok 6 - required filter smudge failure
ok 123 - non-existent file at top-level ignored with --no-index --verbose
ok 1 - setup
ok 51 - adding various types of objects with git update-index --add
ok 52 - showing stage with git ls-files --stage
ok 124 - non-existent file at top-level ignored with --no-index --verbose -n
ok 53 - validate git ls-files output for a known tree
ok 2 - diff -M
ok 7 - required filter clean failure
# passed all 2 test(s)
1..2
ok 54 - writing tree out with git write-tree
ok 55 - validate object ID for a known tree
ok 125 - non-existent file at top-level ignored with --no-index --verbose --non-matching
*** t0023-crlf-am.sh ***
ok 56 - showing tree with git ls-tree
ok 57 - git ls-tree output for a known tree
ok 126 - existing untracked file at top-level not ignored
ok 58 - showing tree with git ls-tree -r
ok 59 - git ls-tree -r output for a known tree
ok 60 - showing tree with git ls-tree -r -t
ok 127 - existing untracked file at top-level not ignored with -q
ok 61 - git ls-tree -r output for a known tree
ok 62 - writing partial tree out with git write-tree --prefix
ok 63 - validate object ID for a known tree
ok 128 - existing untracked file at top-level not ignored with --quiet
ok 64 - writing partial tree out with git write-tree --prefix
ok 65 - validate object ID for a known tree
ok 66 - put invalid objects into the index
ok 129 - existing untracked file at top-level not ignored with -v
ok 67 - writing this tree without --missing-ok
ok 1 - setup
ok 130 - existing untracked file at top-level not ignored with -v -n
ok 68 - writing this tree with --missing-ok
ok 131 - existing untracked file at top-level not ignored with -v --non-matching
ok 132 - existing untracked file at top-level not ignored with --verbose
ok 69 - git read-tree followed by write-tree should be idempotent
ok 70 - validate git diff-files output for a know cache/work tree state
ok 133 - existing untracked file at top-level not ignored with --verbose -n
ok 71 - git update-index --refresh should succeed
ok 72 - no diff after checkout and git update-index --refresh
ok 134 - existing untracked file at top-level not ignored with --verbose --non-matching
ok 73 - git commit-tree records the correct tree in a commit
ok 135 - existing untracked file at top-level not ignored with --no-index
ok 136 - existing untracked file at top-level not ignored with --no-index -q
ok 74 - git commit-tree records the correct parent in a commit
ok 137 - existing untracked file at top-level not ignored with --no-index --quiet
ok 138 - existing untracked file at top-level not ignored with --no-index -v
ok 75 - git commit-tree omits duplicated parent in a commit
ok 139 - existing untracked file at top-level not ignored with --no-index -v -n
ok 76 - update-index D/F conflict
ok 140 - existing untracked file at top-level not ignored with --no-index -v --non-matching
ok 141 - existing untracked file at top-level not ignored with --no-index --verbose
ok 2 - am
# passed all 2 test(s)
1..2
ok 142 - existing untracked file at top-level not ignored with --no-index --verbose -n
*** t0024-crlf-archive.sh ***
ok 77 - very long name in the index handled sanely
# passed all 77 test(s)
1..77
ok 143 - existing untracked file at top-level not ignored with --no-index --verbose --non-matching
ok 144 - existing tracked file at top-level not ignored
ok 145 - existing tracked file at top-level not ignored with -q
*** t0025-crlf-auto.sh ***
ok 146 - existing tracked file at top-level not ignored with --quiet
ok 147 - existing tracked file at top-level not ignored with -v
ok 1 - setup
ok 148 - existing tracked file at top-level not ignored with -v -n
ok 2 - tar archive
ok 149 - existing tracked file at top-level not ignored with -v --non-matching
ok 150 - existing tracked file at top-level not ignored with --verbose
ok 151 - existing tracked file at top-level not ignored with --verbose -n
ok 1 - setup
ok 3 - zip archive
# passed all 3 test(s)
1..3
ok 152 - existing tracked file at top-level not ignored with --verbose --non-matching
*** t0026-eol-config.sh ***
ok 153 - existing tracked file at top-level shown as ignored with --no-index
ok 2 - default settings cause no changes
ok 154 - existing tracked file at top-level shown as ignored with --no-index -q
ok 3 - crlf=true causes a CRLF file to be normalized
ok 155 - existing tracked file at top-level shown as ignored with --no-index --quiet
ok 8 - filtering large input to small output should use little memory
ok 1 - setup
not ok 4 - text=true causes a CRLF file to be normalized
ok 156 - existing tracked file at top-level shown as ignored with --no-index -v
#	
#	
#		rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
#		echo "CRLFonly text" > .gitattributes &&
#		git read-tree --reset -u HEAD &&
#	
#		# Note, "normalized" means that git will normalize it if added
#		has_cr CRLFonly &&
#		CRLFonlydiff=$(git diff CRLFonly) &&
#		test -n "$CRLFonlydiff"
#	
ok 157 - existing tracked file at top-level shown as ignored with --no-index -v -n
ok 158 - existing tracked file at top-level shown as ignored with --no-index -v --non-matching
ok 5 - eol=crlf gives a normalized file CRLFs with autocrlf=false
ok 2 - eol=lf puts LFs in normalized file
ok 6 - eol=crlf gives a normalized file CRLFs with autocrlf=input
ok 159 - existing tracked file at top-level shown as ignored with --no-index --verbose
ok 3 - eol=crlf puts CRLFs in normalized file
ok 160 - existing tracked file at top-level shown as ignored with --no-index --verbose -n
ok 7 - eol=lf gives a normalized file LFs with autocrlf=true
ok 161 - existing tracked file at top-level shown as ignored with --no-index --verbose --non-matching
ok 4 - autocrlf=true overrides eol=lf
ok 162 - existing untracked file at top-level ignored
ok 8 - autocrlf=true does not normalize CRLF files
ok 5 - autocrlf=true overrides unset eol
ok 163 - existing untracked file at top-level ignored with -q
ok 6 # skip eol native is crlf (missing NATIVE_CRLF)
# passed all 6 test(s)
1..6
ok 164 - existing untracked file at top-level ignored with --quiet
*** t0027-auto-crlf.sh ***
ok 165 - existing untracked file at top-level ignored with -v
ok 9 - text=auto, autocrlf=true _does_ normalize CRLF files
ok 166 - existing untracked file at top-level ignored with -v -n
ok 167 - existing untracked file at top-level ignored with -v --non-matching
ok 10 - text=auto, autocrlf=true does not normalize binary files
1..0 # SKIP EXPENSIVE not set
ok 168 - existing untracked file at top-level ignored with --verbose
*** t0030-stripspace.sh ***
ok 169 - existing untracked file at top-level ignored with --verbose -n
ok 11 - eol=crlf _does_ normalize binary files
# failed 1 among 11 test(s)
1..11
make[3]: *** [t0025-crlf-auto.sh] Error 1
make[3]: *** Waiting for unfinished jobs....
Makefile:44: recipe for target 't0025-crlf-auto.sh' failed
ok 170 - existing untracked file at top-level ignored with --verbose --non-matching
ok 171 - existing untracked file at top-level ignored with --no-index
ok 172 - existing untracked file at top-level ignored with --no-index -q
ok 1 - long lines without spaces should be unchanged
ok 173 - existing untracked file at top-level ignored with --no-index --quiet
ok 9 - filter that does not read is fine
ok 10 # skip filter large file (missing EXPENSIVE)
ok 174 - existing untracked file at top-level ignored with --no-index -v
ok 2 - lines with spaces at the beginning should be unchanged
ok 175 - existing untracked file at top-level ignored with --no-index -v -n
ok 3 - lines with intermediate spaces should be unchanged
ok 176 - existing untracked file at top-level ignored with --no-index -v --non-matching
ok 11 - filter: clean empty file
ok 177 - existing untracked file at top-level ignored with --no-index --verbose
ok 178 - existing untracked file at top-level ignored with --no-index --verbose -n
ok 12 - filter: smudge empty file
ok 179 - existing untracked file at top-level ignored with --no-index --verbose --non-matching
# passed all 12 test(s)
1..12
ok 180 - mix of file types at top-level
ok 181 - mix of file types at top-level with -v
ok 4 - consecutive blank lines should be unified
ok 182 - mix of file types at top-level with -v -n
ok 183 - mix of file types at top-level with -v --non-matching
ok 184 - mix of file types at top-level with --verbose
ok 5 - only consecutive blank lines should be completely removed
ok 185 - mix of file types at top-level with --verbose -n
ok 186 - mix of file types at top-level with --verbose --non-matching
ok 187 - mix of file types at top-level with --no-index
ok 188 - mix of file types at top-level with --no-index -v
ok 189 - mix of file types at top-level with --no-index -v -n
ok 6 - consecutive blank lines at the beginning should be removed
ok 190 - mix of file types at top-level with --no-index -v --non-matching
ok 191 - mix of file types at top-level with --no-index --verbose
ok 192 - mix of file types at top-level with --no-index --verbose -n
ok 193 - mix of file types at top-level with --no-index --verbose --non-matching
ok 7 - consecutive blank lines at the end should be removed
ok 194 - non-existent file in subdir a/ not ignored
ok 195 - non-existent file in subdir a/ not ignored with -q
ok 196 - non-existent file in subdir a/ not ignored with --quiet
ok 8 - text without newline at end should end with newline
ok 197 - non-existent file in subdir a/ not ignored with -v
ok 198 - non-existent file in subdir a/ not ignored with -v -n
ok 9 - text plus spaces without newline at end should end with newline
ok 199 - non-existent file in subdir a/ not ignored with -v --non-matching
ok 200 - non-existent file in subdir a/ not ignored with --verbose
ok 201 - non-existent file in subdir a/ not ignored with --verbose -n
ok 10 - text plus spaces without newline at end should not show spaces
ok 202 - non-existent file in subdir a/ not ignored with --verbose --non-matching
ok 203 - non-existent file in subdir a/ not ignored with --no-index
ok 204 - non-existent file in subdir a/ not ignored with --no-index -q
ok 11 - text plus spaces without newline should show the correct lines
ok 205 - non-existent file in subdir a/ not ignored with --no-index --quiet
ok 206 - non-existent file in subdir a/ not ignored with --no-index -v
ok 207 - non-existent file in subdir a/ not ignored with --no-index -v -n
ok 12 - text plus spaces at end should not show spaces
ok 208 - non-existent file in subdir a/ not ignored with --no-index -v --non-matching
ok 209 - non-existent file in subdir a/ not ignored with --no-index --verbose
ok 210 - non-existent file in subdir a/ not ignored with --no-index --verbose -n
ok 211 - non-existent file in subdir a/ not ignored with --no-index --verbose --non-matching
ok 13 - text plus spaces at end should be cleaned and newline must remain
ok 212 - non-existent file in subdir a/ ignored
ok 213 - non-existent file in subdir a/ ignored with -q
ok 14 - spaces with newline at end should be replaced with empty string
ok 214 - non-existent file in subdir a/ ignored with --quiet
ok 215 - non-existent file in subdir a/ ignored with -v
ok 15 - spaces without newline at end should not show spaces
ok 216 - non-existent file in subdir a/ ignored with -v -n
ok 217 - non-existent file in subdir a/ ignored with -v --non-matching
ok 16 - spaces without newline at end should be replaced with empty string
ok 218 - non-existent file in subdir a/ ignored with --verbose
ok 219 - non-existent file in subdir a/ ignored with --verbose -n
ok 220 - non-existent file in subdir a/ ignored with --verbose --non-matching
ok 17 - consecutive text lines should be unchanged
ok 18 - strip comments, too
ok 221 - non-existent file in subdir a/ ignored with --no-index
ok 19 - strip comments with changed comment char
ok 222 - non-existent file in subdir a/ ignored with --no-index -q
ok 20 - -c with single line
ok 21 - -c with single line followed by empty line
ok 22 - -c with newline only
ok 223 - non-existent file in subdir a/ ignored with --no-index --quiet
ok 23 - --comment-lines with single line
ok 24 - -c with changed comment char
ok 25 - avoid SP-HT sequence in commented line
ok 224 - non-existent file in subdir a/ ignored with --no-index -v
# passed all 25 test(s)
1..25
ok 225 - non-existent file in subdir a/ ignored with --no-index -v -n
ok 226 - non-existent file in subdir a/ ignored with --no-index -v --non-matching
ok 227 - non-existent file in subdir a/ ignored with --no-index --verbose
ok 228 - non-existent file in subdir a/ ignored with --no-index --verbose -n
ok 229 - non-existent file in subdir a/ ignored with --no-index --verbose --non-matching
ok 230 - existing untracked file in subdir a/ not ignored
ok 231 - existing untracked file in subdir a/ not ignored with -q
ok 232 - existing untracked file in subdir a/ not ignored with --quiet
ok 233 - existing untracked file in subdir a/ not ignored with -v
ok 234 - existing untracked file in subdir a/ not ignored with -v -n
ok 235 - existing untracked file in subdir a/ not ignored with -v --non-matching
ok 236 - existing untracked file in subdir a/ not ignored with --verbose
ok 237 - existing untracked file in subdir a/ not ignored with --verbose -n
ok 238 - existing untracked file in subdir a/ not ignored with --verbose --non-matching
ok 239 - existing untracked file in subdir a/ not ignored with --no-index
ok 240 - existing untracked file in subdir a/ not ignored with --no-index -q
ok 241 - existing untracked file in subdir a/ not ignored with --no-index --quiet
ok 242 - existing untracked file in subdir a/ not ignored with --no-index -v
ok 243 - existing untracked file in subdir a/ not ignored with --no-index -v -n
ok 244 - existing untracked file in subdir a/ not ignored with --no-index -v --non-matching
ok 245 - existing untracked file in subdir a/ not ignored with --no-index --verbose
ok 246 - existing untracked file in subdir a/ not ignored with --no-index --verbose -n
ok 247 - existing untracked file in subdir a/ not ignored with --no-index --verbose --non-matching
ok 248 - existing tracked file in subdir a/ not ignored
ok 249 - existing tracked file in subdir a/ not ignored with -q
ok 250 - existing tracked file in subdir a/ not ignored with --quiet
ok 251 - existing tracked file in subdir a/ not ignored with -v
ok 252 - existing tracked file in subdir a/ not ignored with -v -n
ok 253 - existing tracked file in subdir a/ not ignored with -v --non-matching
ok 254 - existing tracked file in subdir a/ not ignored with --verbose
ok 255 - existing tracked file in subdir a/ not ignored with --verbose -n
ok 256 - existing tracked file in subdir a/ not ignored with --verbose --non-matching
ok 257 - existing tracked file in subdir a/ shown as ignored with --no-index
ok 258 - existing tracked file in subdir a/ shown as ignored with --no-index -q
ok 259 - existing tracked file in subdir a/ shown as ignored with --no-index --quiet
ok 260 - existing tracked file in subdir a/ shown as ignored with --no-index -v
ok 261 - existing tracked file in subdir a/ shown as ignored with --no-index -v -n
ok 262 - existing tracked file in subdir a/ shown as ignored with --no-index -v --non-matching
ok 263 - existing tracked file in subdir a/ shown as ignored with --no-index --verbose
ok 264 - existing tracked file in subdir a/ shown as ignored with --no-index --verbose -n
ok 265 - existing tracked file in subdir a/ shown as ignored with --no-index --verbose --non-matching
ok 266 - existing untracked file in subdir a/ ignored
ok 267 - existing untracked file in subdir a/ ignored with -q
ok 268 - existing untracked file in subdir a/ ignored with --quiet
ok 269 - existing untracked file in subdir a/ ignored with -v
ok 270 - existing untracked file in subdir a/ ignored with -v -n
ok 271 - existing untracked file in subdir a/ ignored with -v --non-matching
ok 272 - existing untracked file in subdir a/ ignored with --verbose
ok 273 - existing untracked file in subdir a/ ignored with --verbose -n
ok 274 - existing untracked file in subdir a/ ignored with --verbose --non-matching
ok 275 - existing untracked file in subdir a/ ignored with --no-index
ok 276 - existing untracked file in subdir a/ ignored with --no-index -q
ok 277 - existing untracked file in subdir a/ ignored with --no-index --quiet
ok 278 - existing untracked file in subdir a/ ignored with --no-index -v
ok 279 - existing untracked file in subdir a/ ignored with --no-index -v -n
ok 280 - existing untracked file in subdir a/ ignored with --no-index -v --non-matching
ok 281 - existing untracked file in subdir a/ ignored with --no-index --verbose
ok 282 - existing untracked file in subdir a/ ignored with --no-index --verbose -n
ok 283 - existing untracked file in subdir a/ ignored with --no-index --verbose --non-matching
ok 284 - mix of file types in subdir a/
ok 285 - mix of file types in subdir a/ with -v
ok 286 - mix of file types in subdir a/ with -v -n
ok 287 - mix of file types in subdir a/ with -v --non-matching
ok 288 - mix of file types in subdir a/ with --verbose
ok 289 - mix of file types in subdir a/ with --verbose -n
ok 290 - mix of file types in subdir a/ with --verbose --non-matching
ok 291 - mix of file types in subdir a/ with --no-index
ok 292 - mix of file types in subdir a/ with --no-index -v
ok 293 - mix of file types in subdir a/ with --no-index -v -n
ok 294 - mix of file types in subdir a/ with --no-index -v --non-matching
ok 295 - mix of file types in subdir a/ with --no-index --verbose
ok 296 - mix of file types in subdir a/ with --no-index --verbose -n
ok 297 - mix of file types in subdir a/ with --no-index --verbose --non-matching
ok 298 - sub-directory local ignore
ok 299 - sub-directory local ignore with --verbose
ok 300 - local ignore inside a sub-directory
ok 301 - local ignore inside a sub-directory with --verbose
ok 302 - nested include
ok 303 - nested include with -q
ok 304 - nested include with --quiet
ok 305 - nested include with -v
ok 306 - nested include with -v -n
ok 307 - nested include with -v --non-matching
ok 308 - nested include with --verbose
ok 309 - nested include with --verbose -n
ok 310 - nested include with --verbose --non-matching
ok 311 - ignored sub-directory
ok 312 - ignored sub-directory with -q
ok 313 - ignored sub-directory with --quiet
ok 314 - ignored sub-directory with -v
ok 315 - ignored sub-directory with -v -n
ok 316 - ignored sub-directory with -v --non-matching
ok 317 - ignored sub-directory with --verbose
ok 318 - ignored sub-directory with --verbose -n
ok 319 - ignored sub-directory with --verbose --non-matching
ok 320 - multiple files inside ignored sub-directory
ok 321 - multiple files inside ignored sub-directory with -v
ok 322 - cd to ignored sub-directory
ok 323 - cd to ignored sub-directory with -v
ok 324 - symlink
ok 325 - symlink with -q
ok 326 - symlink with --quiet
ok 327 - symlink with -v
ok 328 - symlink with -v -n
ok 329 - symlink with -v --non-matching
ok 330 - symlink with --verbose
ok 331 - symlink with --verbose -n
ok 332 - symlink with --verbose --non-matching
ok 333 - beyond a symlink
ok 334 - beyond a symlink with -q
ok 335 - beyond a symlink with --quiet
ok 336 - beyond a symlink with -v
ok 337 - beyond a symlink with -v -n
ok 338 - beyond a symlink with -v --non-matching
ok 339 - beyond a symlink with --verbose
ok 340 - beyond a symlink with --verbose -n
ok 341 - beyond a symlink with --verbose --non-matching
ok 342 - beyond a symlink from subdirectory
ok 343 - beyond a symlink from subdirectory with -q
ok 344 - beyond a symlink from subdirectory with --quiet
ok 345 - beyond a symlink from subdirectory with -v
ok 346 - beyond a symlink from subdirectory with -v -n
ok 347 - beyond a symlink from subdirectory with -v --non-matching
ok 348 - beyond a symlink from subdirectory with --verbose
ok 349 - beyond a symlink from subdirectory with --verbose -n
ok 350 - beyond a symlink from subdirectory with --verbose --non-matching
ok 351 - submodule
ok 352 - submodule with -q
ok 353 - submodule with --quiet
ok 354 - submodule with -v
ok 355 - submodule with -v -n
ok 356 - submodule with -v --non-matching
ok 357 - submodule with --verbose
ok 358 - submodule with --verbose -n
ok 359 - submodule with --verbose --non-matching
ok 360 - submodule from subdirectory
ok 361 - submodule from subdirectory with -q
ok 362 - submodule from subdirectory with --quiet
ok 363 - submodule from subdirectory with -v
ok 364 - submodule from subdirectory with -v -n
ok 365 - submodule from subdirectory with -v --non-matching
ok 366 - submodule from subdirectory with --verbose
ok 367 - submodule from subdirectory with --verbose -n
ok 368 - submodule from subdirectory with --verbose --non-matching
ok 369 - global ignore not yet enabled
ok 370 - global ignore
ok 371 - global ignore with -v
ok 372 - --stdin
ok 373 - --stdin -q
ok 374 - --stdin -v
ok 375 - --stdin -z
ok 376 - --stdin -z -q
ok 377 - --stdin -z -v
ok 378 - -z --stdin
ok 379 - -z --stdin -q
ok 380 - -z --stdin -v
ok 381 - --stdin from subdirectory
ok 382 - --stdin from subdirectory with -v
ok 383 - --stdin from subdirectory with -v -n
ok 384 - --stdin -z from subdirectory
ok 385 - --stdin -z from subdirectory with -v
ok 386 - -z --stdin from subdirectory
ok 387 - -z --stdin from subdirectory with -v
ok 388 - streaming support for --stdin
ok 389 - trailing whitespace is ignored
ok 390 - quoting allows trailing whitespace
ok 391 - correct handling of backslashes
ok 392 - info/exclude trumps core.excludesfile
# passed all 392 test(s)
1..392
make[3]: Leaving directory '/«PKGBUILDDIR»/t'
make[2]: *** [test] Error 2
Makefile:37: recipe for target 'test' failed
make[2]: Leaving directory '/«PKGBUILDDIR»/t'
make[1]: *** [test] Error 2
Makefile:2197: recipe for target 'test' failed
make[1]: Leaving directory '/«PKGBUILDDIR»'
make[1]: Entering directory '/«PKGBUILDDIR»'
    GEN git-add--interactive
    GEN git-difftool
    GEN git-archimport
    GEN git-cvsexportcommit
    GEN git-cvsimport
    GEN git-cvsserver
    GEN git-send-email
    GEN git-relink
    GEN git-svn
    GEN git-p4
make[2]: Entering directory '/«PKGBUILDDIR»/git-gui'
make[2]: Leaving directory '/«PKGBUILDDIR»/git-gui'
make[2]: Entering directory '/«PKGBUILDDIR»/gitk-git'
make[2]: Leaving directory '/«PKGBUILDDIR»/gitk-git'
make[2]: Entering directory '/«PKGBUILDDIR»/perl'
make[3]: Entering directory '/«PKGBUILDDIR»/perl'
make[3]: Leaving directory '/«PKGBUILDDIR»/perl'
make[2]: Leaving directory '/«PKGBUILDDIR»/perl'
make[2]: Entering directory '/«PKGBUILDDIR»/templates'
make[2]: Leaving directory '/«PKGBUILDDIR»/templates'
/usr/bin/make -C t/ all
make[2]: Entering directory '/«PKGBUILDDIR»/t'
rm -f -r 'test-results'
/usr/bin/make aggregate-results-and-cleanup
make[3]: Entering directory '/«PKGBUILDDIR»/t'
*** t0000-basic.sh ***
*** t0001-init.sh ***
*** t0003-attributes.sh ***
*** t0002-gitfile.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0003-attributes/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/.git/
expecting success: 
	mkdir -p a/b/d a/c b &&
	(
		echo "[attr]notest !test"
		echo "f	test=f"
		echo "a/i test=a/i"
		echo "onoff test -test"
		echo "offon -test test"
		echo "no notest"
		echo "A/e/F test=A/e/F"
	) >.gitattributes &&
	(
		echo "g test=a/g" &&
		echo "b/g test=a/b/g"
	) >a/.gitattributes &&
	(
		echo "h test=a/b/h" &&
		echo "d/* test=a/b/d/*"
		echo "d/yes notest"
	) >a/b/.gitattributes &&
	(
		echo "global test=global"
	) >"$HOME"/global-gitattributes &&
	cat <<-EOF >expect-all
	f: test: f
	a/f: test: f
	a/c/f: test: f
	a/g: test: a/g
	a/b/g: test: a/b/g
	b/g: test: unspecified
	a/b/h: test: a/b/h
	a/b/d/g: test: a/b/d/*
	onoff: test: unset
	offon: test: set
	no: notest: set
	no: test: unspecified
	a/b/d/no: notest: set
	a/b/d/no: test: a/b/d/*
	a/b/d/yes: notest: set
	a/b/d/yes: test: unspecified
	EOF

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0000-basic/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0002-gitfile/.git/
expecting success: 
	git init plain &&
	check_config plain/.git false unset

expecting success: 
	find .git/objects -type f -print >should-be-empty &&
	test_line_count = 0 should-be-empty

ok 1 - .git/objects should be empty after git init in an empty repo

expecting success: 
	REAL="$(pwd)/.real" &&
	mv .git "$REAL"

expecting success: 
	find .git/objects -type d -print >full-of-directories &&
	test_line_count = 3 full-of-directories

ok 1 - initial setup

ok 2 - .git/objects should have 3 subdirectories

expecting success: 
	echo "gitdir $REAL" >.git &&
	if git rev-parse 2>.err
	then
		echo "git rev-parse accepted an invalid .git file"
		false
	fi &&
	if ! grep "Invalid gitfile format" .err
	then
		echo "git rev-parse returned wrong error"
		false
	fi

expecting success: 
	:

ok 3 - success is reported like this

expecting success: 
	run_sub_test_lib_test full-pass '3 passing tests' <<-\EOF &&
	for i in 1 2 3
	do
		test_expect_success "passing test #$i" 'true'
	done
	test_done
	EOF
	check_sub_test_lib_test full-pass <<-\EOF
	> ok 1 - passing test #1
	> ok 2 - passing test #2
	> ok 3 - passing test #3
	> # passed all 3 test(s)
	> 1..3
	EOF

ok 1 - setup

expecting success: 
	test_must_fail git check-attr &&
	test_must_fail git check-attr -- &&
	test_must_fail git check-attr test &&
	test_must_fail git check-attr test -- &&
	test_must_fail git check-attr -- f &&
	echo "f" | test_must_fail git check-attr --stdin &&
	echo "f" | test_must_fail git check-attr --stdin -- f &&
	echo "f" | test_must_fail git check-attr --stdin test -- f &&
	test_must_fail git check-attr "" -- f

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/plain/.git/
error: No attribute specified
usage: git check-attr [-a | --all | <attr>...] [--] <pathname>...
   or: git check-attr --stdin [-z] [-a | --all | <attr>...] < <list-of-paths>

    -a, --all             report all attributes set on file
    --cached              use .gitattributes only from the index
    --stdin               read file names from stdin
    -z                    terminate input and output records by a NUL character

fatal: Invalid gitfile format: .git
ok 2 - bad setup: invalid .git file format

expecting success: 
	echo "gitdir: $REAL.not" >.git &&
	if git rev-parse 2>.err
	then
		echo "git rev-parse accepted an invalid .git file path"
		false
	fi &&
	if ! grep "Not a git repository" .err
	then
		echo "git rev-parse returned wrong error"
		false
	fi

error: No attribute specified
usage: git check-attr [-a | --all | <attr>...] [--] <pathname>...
   or: git check-attr --stdin [-z] [-a | --all | <attr>...] < <list-of-paths>

    -a, --all             report all attributes set on file
    --cached              use .gitattributes only from the index
    --stdin               read file names from stdin
    -z                    terminate input and output records by a NUL character

ok 1 - plain

expecting success: 
	(
		git init --bare bare-ancestor.git &&
		cd bare-ancestor.git &&
		mkdir plain-nested &&
		cd plain-nested &&
		git init
	) &&
	check_config bare-ancestor.git/plain-nested/.git false unset

fatal: Not a git repository: /«PKGBUILDDIR»/t/trash directory.t0002-gitfile/.real.not
error: No file specified
usage: git check-attr [-a | --all | <attr>...] [--] <pathname>...
   or: git check-attr --stdin [-z] [-a | --all | <attr>...] < <list-of-paths>

    -a, --all             report all attributes set on file
    --cached              use .gitattributes only from the index
    --stdin               read file names from stdin
    -z                    terminate input and output records by a NUL character

ok 3 - bad setup: invalid .git file path

expecting success: 
	echo "gitdir: $REAL" >.git &&
	test "$REAL" = "$(git rev-parse --git-dir)"

error: No file specified
usage: git check-attr [-a | --all | <attr>...] [--] <pathname>...
   or: git check-attr --stdin [-z] [-a | --all | <attr>...] < <list-of-paths>

    -a, --all             report all attributes set on file
    --cached              use .gitattributes only from the index
    --stdin               read file names from stdin
    -z                    terminate input and output records by a NUL character

error: No attribute specified
usage: git check-attr [-a | --all | <attr>...] [--] <pathname>...
   or: git check-attr --stdin [-z] [-a | --all | <attr>...] < <list-of-paths>

    -a, --all             report all attributes set on file
    --cached              use .gitattributes only from the index
    --stdin               read file names from stdin
    -z                    terminate input and output records by a NUL character

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/bare-ancestor.git/
ok 4 - final setup + check rev-parse --git-dir

expecting success: 
	echo "foo" >bar &&
	SHA=$(cat bar | git hash-object -w --stdin) &&
	objck $SHA

error: No attribute specified
usage: git check-attr [-a | --all | <attr>...] [--] <pathname>...
   or: git check-attr --stdin [-z] [-a | --all | <attr>...] < <list-of-paths>

    -a, --all             report all attributes set on file
    --cached              use .gitattributes only from the index
    --stdin               read file names from stdin
    -z                    terminate input and output records by a NUL character

error: No attribute specified
usage: git check-attr [-a | --all | <attr>...] [--] <pathname>...
   or: git check-attr --stdin [-z] [-a | --all | <attr>...] < <list-of-paths>

    -a, --all             report all attributes set on file
    --cached              use .gitattributes only from the index
    --stdin               read file names from stdin
    -z                    terminate input and output records by a NUL character

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/bare-ancestor.git/plain-nested/.git/
ok 5 - check hash-object

expecting success: 
	git cat-file blob $SHA >actual &&
	test_cmp bar actual

error: Can't specify files with --stdin
usage: git check-attr [-a | --all | <attr>...] [--] <pathname>...
   or: git check-attr --stdin [-z] [-a | --all | <attr>...] < <list-of-paths>

    -a, --all             report all attributes set on file
    --cached              use .gitattributes only from the index
    --stdin               read file names from stdin
    -z                    terminate input and output records by a NUL character

ok 2 - plain nested in bare

expecting success: 
	(
		HOME=$(pwd)/alias-config &&
		export HOME &&
		mkdir alias-config &&
		echo "[alias] aliasedinit = init" >alias-config/.gitconfig &&

		GIT_CEILING_DIRECTORIES=$(pwd) &&
		export GIT_CEILING_DIRECTORIES &&

		mkdir plain-aliased &&
		cd plain-aliased &&
		git aliasedinit
	) &&
	check_config plain-aliased/.git false unset

ok 6 - check cat-file

expecting success: 
	if test -f "$REAL/index"
	then
		echo "Hmm, $REAL/index exists?"
		false
	fi &&
	rm -f "$REAL/objects/$(objpath $SHA)" &&
	git update-index --add bar &&
	if ! test -f "$REAL/index"
	then
		echo "$REAL/index not found"
		false
error: : not a valid attribute name
	fi &&
	objck $SHA

ok 2 - command line checks

expecting success: 
	attr_check f f &&
	attr_check a/f f &&
	attr_check a/c/f f &&
	attr_check a/g a/g &&
	attr_check a/b/g a/b/g &&
	attr_check b/g unspecified &&
	attr_check a/b/h a/b/h &&
	attr_check a/b/d/g "a/b/d/*" &&
	attr_check onoff unset &&
	attr_check offon set &&
	attr_check no unspecified &&
	attr_check a/b/d/no "a/b/d/*" &&
	attr_check a/b/d/yes unspecified

ok 7 - check update-index

expecting success: 
	SHA=$(git write-tree) &&
	objck $SHA

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/plain-aliased/.git/
ok 4 - pretend we have a fully passing test suite

expecting success: 
	test_must_fail run_sub_test_lib_test 		partial-pass '2/3 tests passing' <<-\EOF &&
	test_expect_success 'passing test #1' 'true'
	test_expect_success 'failing test #2' 'false'
	test_expect_success 'passing test #3' 'true'
	test_done
	EOF
	check_sub_test_lib_test partial-pass <<-\EOF
	> ok 1 - passing test #1
	> not ok 2 - failing test #2
	#	false
	> ok 3 - passing test #3
	> # failed 1 among 3 test(s)
	> 1..3
	EOF

ok 8 - check write-tree

expecting success: 
	SHA=$(echo "commit bar" | git commit-tree $SHA) &&
	objck $SHA

ok 3 - plain through aliased command, outside any git repo

expecting success: 
	(
		git init plain-ancestor-aliased &&
		cd plain-ancestor-aliased &&
		echo "[alias] aliasedinit = init" >>.git/config &&
		mkdir plain-nested &&
		cd plain-nested &&
		git aliasedinit
	) &&
	check_config plain-ancestor-aliased/plain-nested/.git false unset

ok 9 - check commit-tree

expecting success: 
	echo $SHA >"$REAL/HEAD" &&
	test "$SHA" = "$(git rev-list HEAD)"

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/plain-ancestor-aliased/.git/
ok 10 - check rev-list

# passed all 10 test(s)
1..10
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/plain-ancestor-aliased/plain-nested/.git/
ok 4 - plain nested through aliased command

expecting success: 
	(
		git init --bare bare-ancestor-aliased.git &&
		cd bare-ancestor-aliased.git &&
		echo "[alias] aliasedinit = init" >>config &&
		mkdir plain-nested &&
		cd plain-nested &&
		git aliasedinit
	) &&
	check_config bare-ancestor-aliased.git/plain-nested/.git false unset

*** t0004-unwritable.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/bare-ancestor-aliased.git/
ok 5 - pretend we have a partially passing test suite

expecting success: 
	run_sub_test_lib_test failing-todo 'A failing TODO test' <<-\EOF &&
	test_expect_success 'passing test' 'true'
	test_expect_failure 'pretend we have a known breakage' 'false'
	test_done
	EOF
	check_sub_test_lib_test failing-todo <<-\EOF
	> ok 1 - passing test
	> not ok 2 - pretend we have a known breakage # TODO known breakage
	> # still have 1 known breakage(s)
	> # passed all remaining 1 test(s)
	> 1..2
	EOF

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/bare-ancestor-aliased.git/plain-nested/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0004-unwritable/.git/
expecting success: 

	>file &&
	git add file &&
	test_tick &&
	git commit -m initial &&
	echo >file &&
	git add file


ok 5 - plain nested in bare through aliased command

expecting success: 
	mkdir plain-wt &&
	test_must_fail env GIT_WORK_TREE="$(pwd)/plain-wt" git init plain-wt

fatal: GIT_WORK_TREE (or --work-tree=<directory>) not allowed without specifying GIT_DIR (or --git-dir=<directory>)
ok 6 - plain with GIT_WORK_TREE

expecting success: 
	git --bare init plain-bare-1 &&
	check_config plain-bare-1 true unset

[master (root-commit) 1bd44cb] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file
ok 3 - attribute test

expecting success: 

	test_must_fail attr_check F f "-c core.ignorecase=0" &&
	test_must_fail attr_check a/F f "-c core.ignorecase=0" &&
	test_must_fail attr_check a/c/F f "-c core.ignorecase=0" &&
	test_must_fail attr_check a/G a/g "-c core.ignorecase=0" &&
	test_must_fail attr_check a/B/g a/b/g "-c core.ignorecase=0" &&
	test_must_fail attr_check a/b/G a/b/g "-c core.ignorecase=0" &&
	test_must_fail attr_check a/b/H a/b/h "-c core.ignorecase=0" &&
	test_must_fail attr_check a/b/D/g "a/b/d/*" "-c core.ignorecase=0" &&
	test_must_fail attr_check oNoFf unset "-c core.ignorecase=0" &&
	test_must_fail attr_check oFfOn set "-c core.ignorecase=0" &&
	attr_check NO unspecified "-c core.ignorecase=0" &&
	test_must_fail attr_check a/b/D/NO "a/b/d/*" "-c core.ignorecase=0" &&
	attr_check a/b/d/YES a/b/d/* "-c core.ignorecase=0" &&
	test_must_fail attr_check a/E/f "A/e/F" "-c core.ignorecase=0"


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/plain-bare-1/
ok 1 - setup

--- expect	2015-08-08 04:35:21.557492657 +0000
+++ actual	2015-08-08 04:35:21.553492657 +0000
@@ -1 +1 @@
-F: test: f
+F: test: unspecified
ok 7 - plain bare

expecting success: 
	mkdir plain-bare-2 &&
	test_must_fail \
		env GIT_WORK_TREE="$(pwd)/plain-bare-2" \
		git --bare init plain-bare-2

checking prerequisite: SANITY

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	mkdir SANETESTD.1 SANETESTD.2 &&

	chmod +w SANETESTD.1 SANETESTD.2 &&
	>SANETESTD.1/x 2>SANETESTD.2/x &&
	chmod -w SANETESTD.1 &&
	chmod -rx SANETESTD.2 ||
	error "bug in test sript: cannot prepare SANETESTD"

	! rm SANETESTD.1/x && ! test -f SANETESTD.2/x
	status=$?

	chmod +rwx SANETESTD.1 SANETESTD.2 &&
	rm -rf SANETESTD.1 SANETESTD.2 ||
	error "bug in test sript: cannot clean SANETESTD"
	return $status

)
--- expect	2015-08-08 04:35:21.589492657 +0000
+++ actual	2015-08-08 04:35:21.581492657 +0000
@@ -1 +1 @@
-a/F: test: f
+a/F: test: unspecified
fatal: GIT_WORK_TREE (or --work-tree=<directory>) not allowed without specifying GIT_DIR (or --git-dir=<directory>)
ok 8 - plain bare with GIT_WORK_TREE

expecting success: 
	mkdir git-dir-bare.git &&
	GIT_DIR=git-dir-bare.git git init &&
	check_config git-dir-bare.git true unset

rm: cannot remove 'SANETESTD.1/x': Permission denied
--- expect	2015-08-08 04:35:21.621492657 +0000
+++ actual	2015-08-08 04:35:21.617492657 +0000
@@ -1 +1 @@
-a/c/F: test: f
+a/c/F: test: unspecified
prerequisite SANITY ok
expecting success: 
	test_when_finished "chmod 775 .git/objects .git/objects/??" &&
	chmod a-w .git/objects .git/objects/?? &&
	test_must_fail git write-tree

--- expect	2015-08-08 04:35:21.649492657 +0000
+++ actual	2015-08-08 04:35:21.649492657 +0000
@@ -1 +1 @@
-a/G: test: a/g
+a/G: test: unspecified
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/git-dir-bare.git/
error: insufficient permission for adding an object to repository database .git/objects
fatal: git-write-tree: error building trees
--- expect	2015-08-08 04:35:21.697492657 +0000
+++ actual	2015-08-08 04:35:21.689492657 +0000
@@ -1 +1 @@
-a/B/g: test: a/b/g
+a/B/g: test: a/g
ok 2 - write-tree should notice unwritable repository

expecting success: 
	test_when_finished "chmod 775 .git/objects .git/objects/??" &&
	chmod a-w .git/objects .git/objects/?? &&
	test_must_fail git commit -m second

ok 9 - GIT_DIR bare

expecting success: 
	git init --bare init-bare.git &&
	check_config init-bare.git true unset

ok 6 - pretend we have a known breakage

expecting success: 
	run_sub_test_lib_test passing-todo 'A passing TODO test' <<-\EOF &&
	test_expect_failure 'pretend we have fixed a known breakage' 'true'
	test_done
	EOF
	check_sub_test_lib_test passing-todo <<-\EOF
	> ok 1 - pretend we have fixed a known breakage # TODO known breakage vanished
	> # 1 known breakage(s) vanished; please update test(s)
	> 1..1
	EOF

--- expect	2015-08-08 04:35:21.737492657 +0000
+++ actual	2015-08-08 04:35:21.737492657 +0000
@@ -1 +1 @@
-a/b/G: test: a/b/g
+a/b/G: test: unspecified
error: insufficient permission for adding an object to repository database .git/objects
error: insufficient permission for adding an object to repository database .git/objects
error: Error building trees
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/init-bare.git/
ok 3 - commit should notice unwritable repository

expecting success: 
	test_when_finished "chmod 775 .git/objects .git/objects/??" &&
	echo 6O >file &&
	chmod a-w .git/objects .git/objects/?? &&
	test_must_fail git update-index file

--- expect	2015-08-08 04:35:21.789492657 +0000
+++ actual	2015-08-08 04:35:21.785492657 +0000
@@ -1 +1 @@
-a/b/H: test: a/b/h
+a/b/H: test: unspecified
error: insufficient permission for adding an object to repository database .git/objects
error: file: failed to insert into database
fatal: Unable to process path file
ok 10 - init --bare

expecting success: 

	(
		mkdir non-bare &&
		cd non-bare &&
		GIT_DIR=.git git init
	) &&
	check_config non-bare/.git false unset

ok 4 - update-index should notice unwritable repository

--- expect	2015-08-08 04:35:21.845492657 +0000
+++ actual	2015-08-08 04:35:21.841492657 +0000
@@ -1 +1 @@
-a/b/D/g: test: a/b/d/*
+a/b/D/g: test: a/g
expecting success: 
	test_when_finished "chmod 775 .git/objects .git/objects/??" &&
	echo b >file &&
	chmod a-w .git/objects .git/objects/?? &&
	test_must_fail git add file

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/non-bare/.git/
--- expect	2015-08-08 04:35:21.881492657 +0000
+++ actual	2015-08-08 04:35:21.881492657 +0000
@@ -1 +1 @@
-oNoFf: test: unset
+oNoFf: test: unspecified
error: insufficient permission for adding an object to repository database .git/objects
error: file: failed to insert into database
error: unable to index file file
fatal: updating files failed
ok 5 - add should notice unwritable repository

ok 11 - GIT_DIR non-bare

expecting success: 

	(
		mkdir git-dir-wt-1.git &&
		GIT_WORK_TREE=$(pwd) GIT_DIR=git-dir-wt-1.git git init
	) &&
	check_config git-dir-wt-1.git false "$(pwd)"

--- expect	2015-08-08 04:35:21.921492657 +0000
+++ actual	2015-08-08 04:35:21.917492657 +0000
@@ -1 +1 @@
-oFfOn: test: set
+oFfOn: test: unspecified
# passed all 5 test(s)
1..5
*** t0005-signals.sh ***
--- expect	2015-08-08 04:35:21.993492657 +0000
+++ actual	2015-08-08 04:35:21.989492657 +0000
@@ -1 +1 @@
-a/b/D/NO: test: a/b/d/*
+a/b/D/NO: test: unspecified
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/git-dir-wt-1.git/
ok 12 - GIT_DIR & GIT_WORK_TREE (1)

expecting success: 
	mkdir git-dir-wt-2.git &&
	test_must_fail env \
		GIT_WORK_TREE="$(pwd)" \
		GIT_DIR=git-dir-wt-2.git \
		git --bare init

--- expect	2015-08-08 04:35:22.081492657 +0000
+++ actual	2015-08-08 04:35:22.081492657 +0000
@@ -1 +1 @@
-a/E/f: test: A/e/F
+a/E/f: test: f
ok 4 - attribute matching is case sensitive when core.ignorecase=0

expecting success: 

	attr_check F f "-c core.ignorecase=1" &&
	attr_check a/F f "-c core.ignorecase=1" &&
	attr_check a/c/F f "-c core.ignorecase=1" &&
	attr_check a/G a/g "-c core.ignorecase=1" &&
	attr_check a/B/g a/b/g "-c core.ignorecase=1" &&
	attr_check a/b/G a/b/g "-c core.ignorecase=1" &&
	attr_check a/b/H a/b/h "-c core.ignorecase=1" &&
	attr_check a/b/D/g "a/b/d/*" "-c core.ignorecase=1" &&
	attr_check oNoFf unset "-c core.ignorecase=1" &&
	attr_check oFfOn set "-c core.ignorecase=1" &&
	attr_check NO unspecified "-c core.ignorecase=1" &&
	attr_check a/b/D/NO "a/b/d/*" "-c core.ignorecase=1" &&
	attr_check a/b/d/YES unspecified "-c core.ignorecase=1" &&
	attr_check a/E/f "A/e/F" "-c core.ignorecase=1"


fatal: GIT_WORK_TREE (or --work-tree=<directory>) not allowed without specifying GIT_DIR (or --git-dir=<directory>)
ok 13 - GIT_DIR & GIT_WORK_TREE (2)

expecting success: 

	(
		mkdir again &&
		cd again &&
		git init >out1 2>err1 &&
		git init >out2 2>err2
	) &&
	test_i18ngrep "Initialized empty" again/out1 &&
	test_i18ngrep "Reinitialized existing" again/out2 &&
	>again/empty &&
	test_i18ncmp again/empty again/err1 &&
	test_i18ncmp again/empty again/err2

ok 7 - pretend we have fixed a known breakage

expecting success: 
	run_sub_test_lib_test partially-passing-todos 		'2 TODO tests, one passing' <<-\EOF &&
	test_expect_failure 'pretend we have a known breakage' 'false'
	test_expect_success 'pretend we have a passing test' 'true'
	test_expect_failure 'pretend we have fixed another known breakage' 'true'
	test_done
	EOF
	check_sub_test_lib_test partially-passing-todos <<-\EOF
	> not ok 1 - pretend we have a known breakage # TODO known breakage
	> ok 2 - pretend we have a passing test
	> ok 3 - pretend we have fixed another known breakage # TODO known breakage vanished
	> # 1 known breakage(s) vanished; please update test(s)
	> # still have 1 known breakage(s)
	> # passed all remaining 1 test(s)
	> 1..3
	EOF

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0005-signals/.git/
expecting success: 
	{ test-sigchain >actual; ret=$?; } &&
	case "$ret" in
	143) true ;; # POSIX w/ SIGTERM=15
	271) true ;; # ksh w/ SIGTERM=15
	  3) true ;; # Windows
	  *) false ;;
	esac &&
	test_cmp expect actual

Terminated
ok 1 - sigchain works

expecting success: 
	# we use exec here to avoid any sub-shell interpretation
	# of the exit code
	git config alias.sigterm "!exec test-sigchain" &&
	test_expect_code 143 git sigterm

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/again/.git/
Reinitialized existing Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/again/.git/
ok 14 - reinit

expecting success: 
	mkdir template-source &&
	echo content >template-source/file &&
	git init --template=../template-source template-custom &&
	test_cmp template-source/file template-custom/.git/file

three
two
one
error: exec test-sigchain died of signal 15
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/template-custom/.git/
ok 2 - signals are propagated using shell convention

expecting success: 
	test-genrandom foo 16384 >file &&
	git add file

ok 15 - init with --template

expecting success: 
	git init template-plain &&
	test_path_is_file template-plain/.git/info/exclude &&
	git init --template= template-blank &&
	test_path_is_missing template-blank/.git/info/exclude

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/template-plain/.git/
ok 3 - create blob

expecting success: 
	OUT=$( ((large_git; echo $? 1>&3) | :) 3>&1 ) &&
	test "$OUT" -eq 141

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/template-blank/.git/
ok 16 - init with --template (blank)

expecting success: 
	mkdir templatedir-source &&
	echo Content >templatedir-source/file &&
	test_config_global init.templatedir "${HOME}/templatedir-source" &&
	(
		mkdir templatedir-set &&
		cd templatedir-set &&
		sane_unset GIT_TEMPLATE_DIR &&
		NO_SET_GIT_TEMPLATE_DIR=t &&
		export NO_SET_GIT_TEMPLATE_DIR &&
		git init
	) &&
	test_cmp templatedir-source/file templatedir-set/.git/file

ok 4 - a constipated git dies with SIGPIPE

expecting success: 
	OUT=$( ((trap "" PIPE; large_git; echo $? 1>&3) | :) 3>&1 ) &&
	test "$OUT" -eq 141

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/templatedir-set/.git/
ok 8 - pretend we have fixed one of two known breakages (run in sub test-lib)

expecting success: 
	test_must_fail run_sub_test_lib_test 		mixed-results1 'mixed results #1' <<-\EOF &&
	test_expect_success 'passing test' 'true'
	test_expect_success 'failing test' 'false'
	test_expect_failure 'pretend we have a known breakage' 'false'
	test_done
	EOF
	check_sub_test_lib_test mixed-results1 <<-\EOF
	> ok 1 - passing test
	> not ok 2 - failing test
	> #	false
	> not ok 3 - pretend we have a known breakage # TODO known breakage
	> # still have 1 known breakage(s)
	> # failed 1 among remaining 2 test(s)
	> 1..3
	EOF

ok 17 - init with init.templatedir set

expecting success: 
	test_config_global core.bare false &&
	test_config_global core.sharedRepository 0640 &&
	git init --bare --shared=0666 init-bare-shared-override &&
	check_config init-bare-shared-override true unset &&
	test x0666 = \
	x$(git config -f init-bare-shared-override/config core.sharedRepository)

ok 5 - a constipated git dies with SIGPIPE even if parent ignores it

# passed all 5 test(s)
1..5
*** t0006-date.sh ***
Initialized empty shared Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/init-bare-shared-override/
ok 5 - attribute matching is case insensitive when core.ignorecase=1

checking prerequisite: CASE_INSENSITIVE_FS

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	echo good >CamelCase &&
	echo bad >camelcase &&
	test "$(cat CamelCase)" != good

)
prerequisite CASE_INSENSITIVE_FS not satisfied
skipping test: additional case insensitivity tests 
	test_must_fail attr_check a/B/D/g "a/b/d/*" "-c core.ignorecase=0" &&
	test_must_fail attr_check A/B/D/NO "a/b/d/*" "-c core.ignorecase=0" &&
	attr_check A/b/h a/b/h "-c core.ignorecase=1" &&
	attr_check a/B/D/g "a/b/d/*" "-c core.ignorecase=1" &&
	attr_check A/B/D/NO "a/b/d/*" "-c core.ignorecase=1"

ok 6 # skip additional case insensitivity tests (missing CASE_INSENSITIVE_FS)

expecting success: 
	attr_check ./f f &&
	attr_check ./a/g a/g &&
	attr_check a/./g a/g &&
	attr_check a/c/../b/g a/b/g

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0006-date/.git/
ok 18 - init --bare/--shared overrides system/global config

expecting success: 
	test_config_global core.sharedRepository 0666 &&
	git init shared-honor-global &&
	test x0666 = \
	x$(git config -f shared-honor-global/.git/config core.sharedRepository)

expecting success: 
	test-date show 1251659995 >actual &&
	test_i18ncmp expect actual
	
ok 1 - relative date (5 seconds ago)

expecting success: 
	test-date show 1251659700 >actual &&
	test_i18ncmp expect actual
	
ok 9 - pretend we have a pass, fail, and known breakage

expecting success: 
	test_must_fail run_sub_test_lib_test 		mixed-results2 'mixed results #2' <<-\EOF &&
	test_expect_success 'passing test' 'true'
	test_expect_success 'passing test' 'true'
	test_expect_success 'passing test' 'true'
	test_expect_success 'passing test' 'true'
	test_expect_success 'failing test' 'false'
	test_expect_success 'failing test' 'false'
	test_expect_success 'failing test' 'false'
	test_expect_failure 'pretend we have a known breakage' 'false'
	test_expect_failure 'pretend we have a known breakage' 'false'
	test_expect_failure 'pretend we have fixed a known breakage' 'true'
	test_done
	EOF
	check_sub_test_lib_test mixed-results2 <<-\EOF
	> ok 1 - passing test
	> ok 2 - passing test
	> ok 3 - passing test
	> ok 4 - passing test
	> not ok 5 - failing test
	> #	false
	> not ok 6 - failing test
	> #	false
	> not ok 7 - failing test
	> #	false
	> not ok 8 - pretend we have a known breakage # TODO known breakage
	> not ok 9 - pretend we have a known breakage # TODO known breakage
	> ok 10 - pretend we have fixed a known breakage # TODO known breakage vanished
	> # 1 known breakage(s) vanished; please update test(s)
	> # still have 2 known breakage(s)
	> # failed 3 among remaining 7 test(s)
	> 1..10
	EOF

Initialized empty shared Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/shared-honor-global/.git/
ok 7 - unnormalized paths

expecting success: 
	(cd a && attr_check ../f f) &&
	(cd a && attr_check f f) &&
	(cd a && attr_check i a/i) &&
	(cd a && attr_check g a/g) &&
	(cd a && attr_check b/g a/b/g) &&
	(cd b && attr_check ../a/f f) &&
	(cd b && attr_check ../a/g a/g) &&
	(cd b && attr_check ../a/b/g a/b/g)

ok 2 - relative date (5 minutes ago)

expecting success: 
	test-date show 1251642000 >actual &&
	test_i18ncmp expect actual
	
ok 3 - relative date (5 hours ago)

expecting success: 
	test-date show 1251228000 >actual &&
	test_i18ncmp expect actual
	
ok 19 - init honors global core.sharedRepository

expecting success: 
	test_must_fail git init --template=$(printf "x%09999dx" 1) test

ok 4 - relative date (5 days ago)

expecting success: 
	test-date show 1249932000 >actual &&
	test_i18ncmp expect actual
	
ok 5 - relative date (3 weeks ago)

fatal: insanely long template path x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
expecting success: 
	test-date show 1238660000 >actual &&
	test_i18ncmp expect actual
	
ok 20 - init rejects insanely long --template

expecting success: 
	rm -fr newdir &&
	git init newdir &&
	test_path_is_dir newdir/.git/refs

ok 6 - relative date (5 months ago)

expecting success: 
	test-date show 1214160000 >actual &&
	test_i18ncmp expect actual
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/newdir/.git/
ok 7 - relative date (1 year, 2 months ago)

expecting success: 
	test-date show 1196472000 >actual &&
	test_i18ncmp expect actual
	
ok 21 - init creates a new directory

expecting success: 
	rm -fr newdir &&
	git init --bare newdir &&
	test_path_is_dir newdir/refs

ok 8 - relative date (1 year, 9 months ago)

expecting success: 
	test-date show 621660000 >actual &&
	test_i18ncmp expect actual
	
ok 9 - relative date (20 years ago)

expecting success: 
	test-date show 1220210400 >actual &&
	test_i18ncmp expect actual
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/newdir/
ok 22 - init creates a new bare directory

expecting success: 
	rm -fr newdir &&
	mkdir newdir &&
	git init newdir &&
	test_path_is_dir newdir/.git/refs

ok 10 - relative date (12 months ago)

expecting success: 
	test-date show 1188674400 >actual &&
	test_i18ncmp expect actual
	
ok 11 - relative date (2 years ago)

expecting success: 
	TZ=UTC test-date parse '2008' >actual &&
	test_cmp expect actual
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/newdir/.git/
ok 23 - init recreates a directory

expecting success: 
	rm -fr newdir &&
	mkdir newdir &&
	git init --bare newdir &&
	test_path_is_dir newdir/refs

ok 12 - parse date (2008)

expecting success: 
	TZ=UTC test-date parse '2008-02' >actual &&
	test_cmp expect actual
	
ok 8 - relative paths

expecting success: 
	attr_check a_plus/g unspecified &&
	cat >expect <<-\EOF &&
	a/g: test: a/g
	a_plus/g: test: unspecified
	EOF
	git check-attr test a/g a_plus/g >actual &&
	test_cmp expect actual

ok 10 - pretend we have a mix of all possible results

expecting success: 
	test_must_fail run_sub_test_lib_test \
		test-verbose "test verbose" --verbose <<-\EOF &&
	test_expect_success "passing test" true
	test_expect_success "test with output" "echo foo"
	test_expect_success "failing test" false
	test_done
	EOF
	mv test-verbose/out test-verbose/out+ &&
	grep -v "^Initialized empty" test-verbose/out+ >test-verbose/out &&
	check_sub_test_lib_test test-verbose <<-\EOF
	> expecting success: true
	> ok 1 - passing test
	> Z
	> expecting success: echo foo
	> foo
	> ok 2 - test with output
	> Z
	> expecting success: false
	> not ok 3 - failing test
	> #	false
	> Z
	> # failed 1 among 3 test(s)
	> 1..3
	EOF

ok 13 - parse date (2008-02)

expecting success: 
	TZ=UTC test-date parse '2008-02-14' >actual &&
	test_cmp expect actual
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/newdir/
ok 24 - init recreates a new bare directory

expecting success: 
	rm -fr newdir &&
	git init newdir/a/b/c &&
	test_path_is_dir newdir/a/b/c/.git/refs

ok 14 - parse date (2008-02-14)

expecting success: 
	TZ=UTC test-date parse '2008-02-14 20:30:45' >actual &&
	test_cmp expect actual
	
ok 9 - prefixes are not confused with leading directories

expecting success: 
	attr_check global unspecified &&
	git config core.attributesfile "$HOME/global-gitattributes" &&
	attr_check global global &&
	git config core.attributesfile "~/global-gitattributes" &&
	attr_check global global &&
	echo "global test=precedence" >>.gitattributes &&
	attr_check global precedence

ok 15 - parse date (2008-02-14 20:30:45)

expecting success: 
	TZ=UTC test-date parse '2008-02-14 20:30:45 -0500' >actual &&
	test_cmp expect actual
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/newdir/a/b/c/.git/
ok 25 - init creates a new deep directory

ok 16 - parse date (2008-02-14 20:30:45 -0500)

expecting success: 
	TZ=UTC test-date parse '2008-02-14 20:30:45 -0015' >actual &&
	test_cmp expect actual
	
expecting success: 
	rm -fr newdir &&
	(
		# Leading directories should honor umask while
		# the repository itself should follow "shared"
		umask 002 &&
		git init --bare --shared=0660 newdir/a/b/c &&
		test_path_is_dir newdir/a/b/c/refs &&
		ls -ld newdir/a newdir/a/b > lsab.out &&
		! grep -v "^drwxrw[sx]r-x" lsab.out &&
		ls -ld newdir/a/b/c > lsc.out &&
		! grep -v "^drwxrw[sx]---" lsc.out
	)

ok 17 - parse date (2008-02-14 20:30:45 -0015)

expecting success: 
	TZ=UTC test-date parse '2008-02-14 20:30:45 -5' >actual &&
	test_cmp expect actual
	
ok 18 - parse date (2008-02-14 20:30:45 -5)

expecting success: 
	TZ=UTC test-date parse '2008-02-14 20:30:45 -5:' >actual &&
	test_cmp expect actual
	
Initialized empty shared Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/newdir/a/b/c/
ok 19 - parse date (2008-02-14 20:30:45 -5:)

expecting success: 
	TZ=UTC test-date parse '2008-02-14 20:30:45 -05' >actual &&
	test_cmp expect actual
	
ok 20 - parse date (2008-02-14 20:30:45 -05)

expecting success: 
	TZ=UTC test-date parse '2008-02-14 20:30:45 -:30' >actual &&
	test_cmp expect actual
	
ok 10 - core.attributesfile

expecting success: 
	grep -v notest <expect-all >expect &&
	sed -e "s/:.*//" <expect | git check-attr --stdin test >actual &&
	test_cmp expect actual

ok 26 - init creates a new deep directory (umask vs. shared)

expecting success: 
	rm -fr newdir &&
	>newdir &&
	test_must_fail git init newdir &&
	test_path_is_file newdir

ok 21 - parse date (2008-02-14 20:30:45 -:30)

expecting success: 
	TZ=UTC test-date parse '2008-02-14 20:30:45 -05:00' >actual &&
	test_cmp expect actual
	
fatal: cannot mkdir newdir: File exists
ok 27 - init notices EEXIST (1)

expecting success: 
	rm -fr newdir &&
	mkdir newdir &&
	>newdir/a &&
	test_must_fail git init newdir/a/b &&
	test_path_is_file newdir/a

ok 22 - parse date (2008-02-14 20:30:45 -05:00)

expecting success: 
	TZ=EST5 test-date parse '2008-02-14 20:30:45' >actual &&
	test_cmp expect actual
	
ok 11 - test --verbose

expecting success: 
	test_must_fail run_sub_test_lib_test \
		test-verbose-only-2 "test verbose-only=2" \
		--verbose-only=2 <<-\EOF &&
	test_expect_success "passing test" true
	test_expect_success "test with output" "echo foo"
	test_expect_success "failing test" false
	test_done
	EOF
	check_sub_test_lib_test test-verbose-only-2 <<-\EOF
	> ok 1 - passing test
	> Z
	> expecting success: echo foo
	> foo
	> ok 2 - test with output
	> Z
	> not ok 3 - failing test
	> #	false
	> # failed 1 among 3 test(s)
	> 1..3
	EOF

ok 11 - attribute test: read paths from stdin

expecting success: 
	grep -v unspecified <expect-all | sort >specified-all &&
	sed -e "s/:.*//" <expect-all | uniq >stdin-all &&
	git check-attr --stdin --all <stdin-all | sort >actual &&
	test_cmp specified-all actual

ok 23 - parse date (2008-02-14 20:30:45 TZ=EST5)

expecting success: 
	test-date approxidate 'now' >actual &&
	test_cmp expect actual
	
fatal: cannot mkdir newdir/a/b: File exists
ok 28 - init notices EEXIST (2)

checking prerequisite: SANITY

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	mkdir SANETESTD.1 SANETESTD.2 &&

	chmod +w SANETESTD.1 SANETESTD.2 &&
	>SANETESTD.1/x 2>SANETESTD.2/x &&
	chmod -w SANETESTD.1 &&
	chmod -rx SANETESTD.2 ||
	error "bug in test sript: cannot prepare SANETESTD"

	! rm SANETESTD.1/x && ! test -f SANETESTD.2/x
	status=$?

	chmod +rwx SANETESTD.1 SANETESTD.2 &&
	rm -rf SANETESTD.1 SANETESTD.2 ||
	error "bug in test sript: cannot clean SANETESTD"
	return $status

)
ok 24 - parse approxidate (now)

expecting success: 
	test-date approxidate '5 seconds ago' >actual &&
	test_cmp expect actual
	
ok 25 - parse approxidate (5 seconds ago)

expecting success: 
	test-date approxidate '5.seconds.ago' >actual &&
	test_cmp expect actual
	
rm: cannot remove 'SANETESTD.1/x': Permission denied
ok 26 - parse approxidate (5.seconds.ago)

expecting success: 
	test-date approxidate '10.minutes.ago' >actual &&
	test_cmp expect actual
	
prerequisite SANITY ok
expecting success: 
	rm -fr newdir &&
	mkdir newdir &&
	chmod -w newdir &&
	test_must_fail git init newdir/a/b

ok 12 - attribute test: --all option

expecting success: 
	: >empty &&
	git check-attr --cached --stdin --all <stdin-all | sort >actual &&
	test_cmp empty actual &&
	git add .gitattributes a/.gitattributes a/b/.gitattributes &&
	git check-attr --cached --stdin --all <stdin-all | sort >actual &&
	test_cmp specified-all actual

ok 27 - parse approxidate (10.minutes.ago)

expecting success: 
	test-date approxidate 'yesterday' >actual &&
	test_cmp expect actual
	
fatal: cannot mkdir newdir/a/b: Permission denied
ok 29 - init notices EPERM

expecting success: 
	rm -rf newdir &&
	git --bare init newdir &&
	test_path_is_dir newdir/refs

ok 28 - parse approxidate (yesterday)

expecting success: 
	test-date approxidate '3.days.ago' >actual &&
	test_cmp expect actual
	
ok 29 - parse approxidate (3.days.ago)

expecting success: 
	test-date approxidate '3.weeks.ago' >actual &&
	test_cmp expect actual
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/newdir/
ok 30 - init creates a new bare directory with global --bare

expecting success: 
	rm -rf newdir &&
	mkdir otherdir &&
	GIT_DIR=otherdir git --bare init newdir &&
	test_path_is_dir newdir/refs &&
	test_path_is_missing otherdir/refs

ok 30 - parse approxidate (3.weeks.ago)

expecting success: 
	test-date approxidate '3.months.ago' >actual &&
	test_cmp expect actual
	
ok 13 - attribute test: --cached option

expecting success: 
	attr_check a/i a/i &&
	attr_check subdir/a/i unspecified

ok 31 - parse approxidate (3.months.ago)

expecting success: 
	test-date approxidate '2.years.3.months.ago' >actual &&
	test_cmp expect actual
	
ok 12 - test --verbose-only

expecting success: 
	(
		GIT_SKIP_TESTS='git.2' && export GIT_SKIP_TESTS &&
		run_sub_test_lib_test git-skip-tests-basic 			'GIT_SKIP_TESTS' <<-\EOF &&
		for i in 1 2 3
		do
			test_expect_success "passing test #$i" 'true'
		done
		test_done
		EOF
		check_sub_test_lib_test git-skip-tests-basic <<-\EOF
		> ok 1 - passing test #1
		> ok 2 # skip passing test #2 (GIT_SKIP_TESTS)
		> ok 3 - passing test #3
		> # passed all 3 test(s)
		> 1..3
		EOF
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/newdir/
ok 31 - init prefers command line to GIT_DIR

expecting success: 
	rm -rf newdir &&
	git init --separate-git-dir realgitdir newdir &&
	echo "gitdir: $(pwd)/realgitdir" >expected &&
	test_cmp expected newdir/.git &&
	test_path_is_dir realgitdir/refs

ok 32 - parse approxidate (2.years.3.months.ago)

expecting success: 
	test-date approxidate '6am yesterday' >actual &&
	test_cmp expect actual
	
ok 33 - parse approxidate (6am yesterday)

expecting success: 
	test-date approxidate '6pm yesterday' >actual &&
	test_cmp expect actual
	
ok 14 - root subdir attribute test

expecting success: 
	echo "!f test=bar" >.gitattributes &&
	git check-attr test -- '!f' 2>errors &&
	test_i18ngrep "Negative patterns are ignored" errors

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/realgitdir/
!f: test: unspecified
ok 32 - init with separate gitdir

ok 34 - parse approxidate (6pm yesterday)

expecting success: 
	( cd newdir && git init )

expecting success: 
	test-date approxidate '3:00' >actual &&
	test_cmp expect actual
	
warning: Negative patterns are ignored in git attributes
ok 15 - negative patterns

expecting success: 
	echo "\!f test=foo" >.gitattributes &&
	attr_check "!f" foo

Reinitialized existing Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/realgitdir/
ok 33 - re-init on .git file

ok 35 - parse approxidate (3:00)

expecting success: 
	(
	cd newdir &&
	git init --separate-git-dir ../surrealgitdir
	) &&
	echo "gitdir: $(pwd)/surrealgitdir" >expected &&
	test_cmp expected newdir/.git &&
	test_path_is_dir surrealgitdir/refs &&
	test_path_is_missing realgitdir/refs

expecting success: 
	test-date approxidate '15:00' >actual &&
	test_cmp expect actual
	
ok 16 - patterns starting with exclamation

expecting success: 
	echo "**/f foo=bar" >.gitattributes &&
	cat <<\EOF >expect &&
f: foo: bar
a/f: foo: bar
a/b/f: foo: bar
a/b/c/f: foo: bar
EOF
	git check-attr foo -- "f" >actual 2>err &&
	git check-attr foo -- "a/f" >>actual 2>>err &&
	git check-attr foo -- "a/b/f" >>actual 2>>err &&
	git check-attr foo -- "a/b/c/f" >>actual 2>>err &&
	test_cmp expect actual &&
	test_line_count = 0 err

Reinitialized existing Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/surrealgitdir/
ok 36 - parse approxidate (15:00)

expecting success: 
	test-date approxidate 'noon today' >actual &&
	test_cmp expect actual
	
ok 34 - re-init to update git link

expecting success: 
	rm -rf newdir realgitdir surrealgitdir &&
	git init newdir &&
	(
	cd newdir &&
	git init --separate-git-dir ../realgitdir
	) &&
	echo "gitdir: $(pwd)/realgitdir" >expected &&
	test_cmp expected newdir/.git &&
	test_path_is_dir realgitdir/refs

ok 37 - parse approxidate (noon today)

expecting success: 
	test-date approxidate 'noon yesterday' >actual &&
	test_cmp expect actual
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/newdir/.git/
ok 38 - parse approxidate (noon yesterday)

expecting success: 
	test-date approxidate 'last tuesday' >actual &&
	test_cmp expect actual
	
ok 17 - "**" test

expecting success: 
	echo "a**f foo=bar" >.gitattributes &&
	git check-attr foo -- "f" >actual &&
	cat <<\EOF >expect &&
f: foo: unspecified
af: foo: bar
axf: foo: bar
a/f: foo: unspecified
a/b/f: foo: unspecified
a/b/c/f: foo: unspecified
EOF
	git check-attr foo -- "f" >actual 2>err &&
	git check-attr foo -- "af" >>actual 2>err &&
	git check-attr foo -- "axf" >>actual 2>err &&
	git check-attr foo -- "a/f" >>actual 2>>err &&
	git check-attr foo -- "a/b/f" >>actual 2>>err &&
	git check-attr foo -- "a/b/c/f" >>actual 2>>err &&
	test_cmp expect actual &&
	test_line_count = 0 err

Reinitialized existing Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/realgitdir/
ok 39 - parse approxidate (last tuesday)

ok 35 - re-init to move gitdir

expecting success: 
	test-date approxidate 'July 5th' >actual &&
	test_cmp expect actual
	
checking prerequisite: SYMLINKS

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	# test whether the filesystem supports symbolic links
	ln -s x y && test -h y

)
ok 40 - parse approxidate (July 5th)

expecting success: 
	test-date approxidate '06/05/2009' >actual &&
	test_cmp expect actual
	
prerequisite SYMLINKS ok
expecting success: 
	rm -rf newdir realgitdir &&
	git init newdir &&
	(
	cd newdir &&
	mv .git here &&
	ln -s here .git &&
	git init --separate-git-dir ../realgitdir
	) &&
	echo "gitdir: $(pwd)/realgitdir" >expected &&
	test_cmp expected newdir/.git &&
	test_cmp expected newdir/here &&
	test_path_is_dir realgitdir/refs

ok 41 - parse approxidate (06/05/2009)

expecting success: 
	test-date approxidate '06.05.2009' >actual &&
	test_cmp expect actual
	
ok 13 - GIT_SKIP_TESTS

expecting success: 
	(
		GIT_SKIP_TESTS='git.2 git.5' && export GIT_SKIP_TESTS &&
		run_sub_test_lib_test git-skip-tests-several 			'GIT_SKIP_TESTS several tests' <<-\EOF &&
		for i in 1 2 3 4 5 6
		do
			test_expect_success "passing test #$i" 'true'
		done
		test_done
		EOF
		check_sub_test_lib_test git-skip-tests-several <<-\EOF
		> ok 1 - passing test #1
		> ok 2 # skip passing test #2 (GIT_SKIP_TESTS)
		> ok 3 - passing test #3
		> ok 4 - passing test #4
		> ok 5 # skip passing test #5 (GIT_SKIP_TESTS)
		> ok 6 - passing test #6
		> # passed all 6 test(s)
		> 1..6
		EOF
	)

ok 42 - parse approxidate (06.05.2009)

expecting success: 
	test-date approxidate 'Jun 6, 5AM' >actual &&
	test_cmp expect actual
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/newdir/.git/
ok 43 - parse approxidate (Jun 6, 5AM)

expecting success: 
	test-date approxidate '5AM Jun 6' >actual &&
	test_cmp expect actual
	
Reinitialized existing Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/realgitdir/
ok 44 - parse approxidate (5AM Jun 6)

expecting success: 
	test-date approxidate '6AM, June 7, 2009' >actual &&
	test_cmp expect actual
	
ok 36 - re-init to move gitdir symlink

# passed all 36 test(s)
1..36
ok 18 - "**" with no slashes test

expecting success: 
	mkdir unreal real &&
	git init real &&
	echo "file test=in-real" >real/.gitattributes &&
	(
		cd unreal &&
		attr_check file in-real "--git-dir ../real/.git --work-tree ../real"
	)

ok 45 - parse approxidate (6AM, June 7, 2009)

expecting success: 
	test-date approxidate '2008-12-01' >actual &&
	test_cmp expect actual
	
ok 46 - parse approxidate (2008-12-01)

expecting success: 
	test-date approxidate '2009-12-01' >actual &&
	test_cmp expect actual
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0003-attributes/real/.git/
ok 47 - parse approxidate (2009-12-01)

# passed all 47 test(s)
1..47
ok 19 - using --git-dir and --work-tree

expecting success: 
	git clone --bare . bare.git

Cloning into bare repository 'bare.git'...
*** t0007-git-var.sh ***
ok 14 - GIT_SKIP_TESTS several tests

expecting success: 
	(
		GIT_SKIP_TESTS='git.[2-5]' && export GIT_SKIP_TESTS &&
		run_sub_test_lib_test git-skip-tests-sh-pattern 			'GIT_SKIP_TESTS sh pattern' <<-\EOF &&
		for i in 1 2 3 4 5 6
		do
			test_expect_success "passing test #$i" 'true'
		done
		test_done
		EOF
		check_sub_test_lib_test git-skip-tests-sh-pattern <<-\EOF
		> ok 1 - passing test #1
		> ok 2 # skip passing test #2 (GIT_SKIP_TESTS)
		> ok 3 # skip passing test #3 (GIT_SKIP_TESTS)
		> ok 4 # skip passing test #4 (GIT_SKIP_TESTS)
		> ok 5 # skip passing test #5 (GIT_SKIP_TESTS)
		> ok 6 - passing test #6
		> # passed all 6 test(s)
		> 1..6
		EOF
	)

warning: You appear to have cloned an empty repository.
done.
ok 20 - setup bare

expecting success: 
	(
		cd bare.git &&
		(
			echo "f	test=f"
			echo "a/i test=a/i"
		) >.gitattributes &&
		attr_check f unspecified &&
		attr_check a/f unspecified &&
		attr_check a/c/f unspecified &&
		attr_check a/i unspecified &&
		attr_check subdir/a/i unspecified
	)

*** t0008-ignores.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0007-git-var/.git/
expecting success: 
	test_tick &&
	echo "$GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> $GIT_AUTHOR_DATE" >expect &&
	git var GIT_AUTHOR_IDENT >actual &&
	test_cmp expect actual

ok 1 - get GIT_AUTHOR_IDENT

expecting success: 
	test_tick &&
	echo "$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE" >expect &&
	git var GIT_COMMITTER_IDENT >actual &&
	test_cmp expect actual

ok 2 - get GIT_COMMITTER_IDENT

ok 21 - bare repository: check that .gitattribute is ignored

expecting success: 
	(
		cd bare.git &&
		GIT_INDEX_FILE=../.git/index \
		git check-attr --cached --stdin --all <../stdin-all |
		sort >actual &&
		test_cmp ../specified-all actual
	)

checking prerequisite: AUTOIDENT

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	sane_unset GIT_AUTHOR_NAME &&
	sane_unset GIT_AUTHOR_EMAIL &&
	git var GIT_AUTHOR_IDENT

)

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'buildd@bm-wb-04.(none)')
prerequisite AUTOIDENT not satisfied
expecting success: 
	(
		sane_unset GIT_COMMITTER_NAME &&
		sane_unset GIT_COMMITTER_EMAIL &&
		test_must_fail git var GIT_COMMITTER_IDENT
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0008-ignores/.git/
ok 22 - bare repository: check that --cached honors index

expecting success: 
	(
		cd bare.git &&
		(
			echo "f	test=f"
			echo "a/i test=a/i"
		) >info/attributes &&
		attr_check f f &&
		attr_check a/f f &&
		attr_check a/c/f f &&
		attr_check a/i a/i &&
		attr_check subdir/a/i unspecified
	)

expecting success: 
	init_vars &&
	mkdir -p a/b/ignored-dir a/submodule b &&
	if test_have_prereq SYMLINKS
	then
		ln -s b a/symlink
	fi &&
	(
		cd a/submodule &&
		git init &&
		echo a >a &&
		git add a &&
		git commit -m"commit in submodule"
	) &&
	git add a/submodule &&
	cat <<-\EOF >.gitignore &&
		one
		ignored-*
		top-level-dir/
	EOF
	for dir in . a
	do
		: >$dir/not-ignored &&
		: >$dir/ignored-and-untracked &&
		: >$dir/ignored-but-in-index
	done &&
	git add -f ignored-but-in-index a/ignored-but-in-index &&
	cat <<-\EOF >a/.gitignore &&
		two*
		*three
	EOF
	cat <<-\EOF >a/b/.gitignore &&
		four
		five
		# this comment should affect the line numbers
		six
		ignored-dir/
		# and so should this blank line:

		!on*
		!two
	EOF
	echo "seven" >a/b/ignored-dir/.gitignore &&
	test -n "$HOME" &&
	cat <<-\EOF >"$global_excludes" &&
		globalone
		!globaltwo
		globalthree
	EOF
	cat <<-\EOF >>.git/info/exclude
		per-repo
	EOF


*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'buildd@bm-wb-04.(none)')
ok 3 - requested identites are strict

expecting success: 
	git var -l >actual &&
	echo "$GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> $GIT_AUTHOR_DATE" >expect &&
	sed -n s/GIT_AUTHOR_IDENT=//p <actual >actual.author &&
	test_cmp expect actual.author

checking prerequisite: SYMLINKS

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	# test whether the filesystem supports symbolic links
	ln -s x y && test -h y

)
ok 15 - GIT_SKIP_TESTS sh pattern

expecting success: 
	run_sub_test_lib_test run-basic 		'--run basic' --run='1 3 5' <<-\EOF &&
	for i in 1 2 3 4 5 6
	do
		test_expect_success "passing test #$i" 'true'
	done
	test_done
	EOF
	check_sub_test_lib_test run-basic <<-\EOF
	> ok 1 - passing test #1
	> ok 2 # skip passing test #2 (--run)
	> ok 3 - passing test #3
	> ok 4 # skip passing test #4 (--run)
	> ok 5 - passing test #5
	> ok 6 # skip passing test #6 (--run)
	> # passed all 6 test(s)
	> 1..6
	EOF

ok 4 - git var -l lists variables

expecting success: 
	git var -l >actual &&
	echo false >expect &&
	sed -n s/core\\.bare=//p <actual >actual.bare &&
	test_cmp expect actual.bare

prerequisite SYMLINKS ok
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0008-ignores/a/submodule/.git/
ok 5 - git var -l lists config

expecting success: 
	test_must_fail git var -l GIT_COMMITTER_IDENT

usage: git var (-l | <variable>)
ok 6 - listing and asking for variables are exclusive

# passed all 6 test(s)
1..6
[master (root-commit) 50156cb] commit in submodule
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a
ok 23 - bare repository: test info/attributes

# passed all 23 test(s)
1..23
*** t0009-prio-queue.sh ***
ok 1 - setup

*** t0010-racy-git.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0009-prio-queue/.git/
expecting success: 
		expect "$expect" &&
		eval "$code"
	
expecting success: 
	test-prio-queue 2 6 3 10 9 5 7 4 5 8 1 dump >actual &&
	test_cmp expect actual

ok 2 - . corner-case

ok 1 - basic ordering

expecting success: 
	test-prio-queue 6 2 4 get 5 3 get get 1 dump >actual &&
	test_cmp expect actual

expecting success: 
			expect '' &&
			
	test_check_ignore . 1

		
ok 2 - mixed put and get

ok 3 - . corner-case with -q

expecting success: 
			expect '' &&
			
	test_check_ignore . 1

		
expecting success: 
	test-prio-queue 1 2 get get get 1 2 get get get >actual &&
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0010-racy-git/.git/
ok 3 - notice empty queue

# passed all 3 test(s)
1..3
ok 4 - . corner-case with --quiet

expecting success: 
				expect '' &&
				
	test_check_ignore . 1

			
expecting success: test "" != "$files"
ok 1 - Racy GIT trial #0 part A

*** t0011-hashmap.sh ***
ok 16 - --run basic

expecting success: 
	run_sub_test_lib_test run-range 		'--run with a range' --run='1-3' <<-\EOF &&
	for i in 1 2 3 4 5 6
	do
		test_expect_success "passing test #$i" 'true'
	done
	test_done
	EOF
	check_sub_test_lib_test run-range <<-\EOF
	> ok 1 - passing test #1
	> ok 2 - passing test #2
	> ok 3 - passing test #3
	> ok 4 # skip passing test #4 (--run)
	> ok 5 # skip passing test #5 (--run)
	> ok 6 # skip passing test #6 (--run)
	> # passed all 6 test(s)
	> 1..6
	EOF

ok 5 - . corner-case with -v

expecting success: 
				expect '::	.' &&
				
	test_check_ignore . 1

			
ok 6 - . corner-case with -v -n

expecting success: 
				expect '::	.' &&
				
	test_check_ignore . 1

			
ok 7 - . corner-case with -v --non-matching

expecting success: 
				expect '' &&
				
	test_check_ignore . 1

			
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0011-hashmap/.git/
expecting success: 

test_hashmap "hash key1" "2215982743 2215982743 116372151 116372151" &&
test_hashmap "hash key2" "2215982740 2215982740 116372148 116372148" &&
test_hashmap "hash fooBarFrotz" "1383912807 1383912807 3189766727 3189766727" &&
test_hashmap "hash foobarfrotz" "2862305959 2862305959 3189766727 3189766727"


ok 8 - . corner-case with --verbose

expecting success: 
				expect '::	.' &&
				
	test_check_ignore . 1

			
ok 9 - . corner-case with --verbose -n

expecting success: 
				expect '::	.' &&
				
	test_check_ignore . 1

			
ok 10 - . corner-case with --verbose --non-matching

ok 1 - hash functions

expecting success: 

test_hashmap "put key1 value1
put key2 value2
put fooBarFrotz value3
put foobarfrotz value4
size" "NULL
NULL
NULL
NULL
64 4"


expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 2 - put

expecting success: 

test_hashmap "put key1 value1
put key2 value2
put fooBarFrotz value3
size" "NULL
NULL
NULL
64 3" ignorecase


ok 3 - put (case insensitive)

expecting success: 

test_hashmap "put key1 value1
put key1 value2
put fooBarFrotz value3
put fooBarFrotz value4
size" "NULL
value1
NULL
value3
64 2"


fatal: no path specified
ok 11 - empty command line

expecting success: 
			expect '' &&
			
	test_check_ignore "" 128 &&
	stderr_contains "fatal: no path specified"

		
ok 4 - replace

expecting success: 

test_hashmap "put key1 value1
put Key1 value2
put fooBarFrotz value3
put foobarfrotz value4
size" "NULL
value1
NULL
value3
64 2" ignorecase


ok 5 - replace (case insensitive)

expecting success: 

test_hashmap "put key1 value1
put key2 value2
put fooBarFrotz value3
put foobarfrotz value4
get key1
get key2
get fooBarFrotz
get notInMap" "NULL
NULL
NULL
NULL
value1
value2
value3
NULL"


fatal: no path specified
ok 12 - empty command line with -q

expecting success: 
			expect '' &&
			
	test_check_ignore "" 128 &&
	stderr_contains "fatal: no path specified"

		
ok 6 - get

expecting success: 

test_hashmap "put key1 value1
put key2 value2
put fooBarFrotz value3
get Key1
get keY2
get foobarfrotz
get notInMap" "NULL
NULL
NULL
value1
value2
value3
NULL" ignorecase


ok 7 - get (case insensitive)

expecting success: 

test_hashmap "add key1 value1
add key1 value2
add fooBarFrotz value3
add fooBarFrotz value4
get key1
get fooBarFrotz
get notInMap" "value2
value1
value4
value3
NULL"


ok 17 - --run with a range

expecting success: 
	run_sub_test_lib_test run-two-ranges 		'--run with two ranges' --run='1-2 5-6' <<-\EOF &&
	for i in 1 2 3 4 5 6
	do
		test_expect_success "passing test #$i" 'true'
	done
	test_done
	EOF
	check_sub_test_lib_test run-two-ranges <<-\EOF
	> ok 1 - passing test #1
	> ok 2 - passing test #2
	> ok 3 # skip passing test #3 (--run)
	> ok 4 # skip passing test #4 (--run)
	> ok 5 - passing test #5
	> ok 6 - passing test #6
	> # passed all 6 test(s)
	> 1..6
	EOF

fatal: no path specified
ok 13 - empty command line with --quiet

expecting success: 
				expect '' &&
				
	test_check_ignore "" 128 &&
	stderr_contains "fatal: no path specified"

			
ok 8 - add

expecting success: 

test_hashmap "add key1 value1
add Key1 value2
add fooBarFrotz value3
add foobarfrotz value4
get key1
get Foobarfrotz
get notInMap" "value2
value1
value4
value3
NULL" ignorecase


ok 9 - add (case insensitive)

expecting success: 

test_hashmap "put key1 value1
put key2 value2
put fooBarFrotz value3
remove key1
remove key2
remove notInMap
size" "NULL
NULL
NULL
value1
value2
NULL
64 1"


fatal: no path specified
ok 14 - empty command line with -v

expecting success: 
				expect '' &&
				
	test_check_ignore "" 128 &&
	stderr_contains "fatal: no path specified"

			
ok 10 - remove

expecting success: 

test_hashmap "put key1 value1
put key2 value2
put fooBarFrotz value3
remove Key1
remove keY2
remove notInMap
size" "NULL
NULL
NULL
value1
value2
NULL
64 1" ignorecase


fatal: no path specified
ok 15 - empty command line with -v -n

expecting success: 
				expect '' &&
				
	test_check_ignore "" 128 &&
	stderr_contains "fatal: no path specified"

			
ok 11 - remove (case insensitive)

expecting success: 

test_hashmap "put key1 value1
put key2 value2
put fooBarFrotz value3
iterate" "NULL
NULL
NULL
key2 value2
key1 value1
fooBarFrotz value3"


ok 12 - iterate

expecting success: 

test_hashmap "put key1 value1
put key2 value2
put fooBarFrotz value3
iterate" "NULL
NULL
NULL
fooBarFrotz value3
key2 value2
key1 value1" ignorecase


fatal: no path specified
ok 16 - empty command line with -v --non-matching

expecting success: 
				expect '' &&
				
	test_check_ignore "" 128 &&
	stderr_contains "fatal: no path specified"

			
ok 13 - iterate (case insensitive)

expecting success: 

	rm -f in &&
	rm -f expect &&
	for n in $(test_seq 51)
	do
		echo put key$n value$n >> in &&
		echo NULL >> expect
	done &&
	echo size >> in &&
	echo 64 51 >> expect &&
	echo put key52 value52 >> in &&
	echo NULL >> expect &&
	echo size >> in &&
	echo 256 52 >> expect &&
	for n in $(test_seq 12)
	do
		echo remove key$n >> in &&
		echo value$n >> expect
	done &&
	echo size >> in &&
	echo 256 40 >> expect &&
	echo remove key40 >> in &&
	echo value40 >> expect &&
	echo size >> in &&
	echo 64 39 >> expect &&
	cat in | test-hashmap > out &&
	test_cmp expect out


fatal: no path specified
ok 17 - empty command line with --verbose

expecting success: 
				expect '' &&
				
	test_check_ignore "" 128 &&
	stderr_contains "fatal: no path specified"

			
fatal: no path specified
ok 18 - empty command line with --verbose -n

expecting success: 
				expect '' &&
				
	test_check_ignore "" 128 &&
	stderr_contains "fatal: no path specified"

			
ok 14 - grow / shrink

expecting success: 

test_hashmap "intern value1
intern Value1
intern value2
intern value2
" "value1
Value1
value2
value2"


ok 15 - string interning

fatal: no path specified
ok 19 - empty command line with --verbose --non-matching

# passed all 15 test(s)
1..15
expecting success: 
		expect "$expect" &&
		eval "$code"
	
*** t0020-crlf.sh ***
ok 20 - --stdin with empty STDIN

expecting success: 
			expect '' &&
			
	test_check_ignore "--stdin" 1 </dev/null &&
	test_stderr ""

		
ok 21 - --stdin with empty STDIN with -q

expecting success: 
			expect '' &&
			
	test_check_ignore "--stdin" 1 </dev/null &&
	test_stderr ""

		
ok 18 - --run with two ranges

expecting success: 
	run_sub_test_lib_test run-left-open-range 		'--run with a left open range' --run='-3' <<-\EOF &&
	for i in 1 2 3 4 5 6
	do
		test_expect_success "passing test #$i" 'true'
	done
	test_done
	EOF
	check_sub_test_lib_test run-left-open-range <<-\EOF
	> ok 1 - passing test #1
	> ok 2 - passing test #2
	> ok 3 - passing test #3
	> ok 4 # skip passing test #4 (--run)
	> ok 5 # skip passing test #5 (--run)
	> ok 6 # skip passing test #6 (--run)
	> # passed all 6 test(s)
	> 1..6
	EOF

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0020-crlf/.git/
ok 22 - --stdin with empty STDIN with --quiet

expecting success: 
				expect '' &&
				
	test_check_ignore "--stdin" 1 </dev/null &&
	test_stderr ""

			
expecting success: 

	git config core.autocrlf false &&

	for w in Hello world how are you; do echo $w; done >one &&
	mkdir dir &&
	for w in I am very very fine thank you; do echo $w; done >dir/two &&
	for w in Oh here is NULQin text here; do echo $w; done | q_to_nul >three &&
	git add . &&

	git commit -m initial &&

	one=$(git rev-parse HEAD:one) &&
	dir=$(git rev-parse HEAD:dir) &&
	two=$(git rev-parse HEAD:dir/two) &&
	three=$(git rev-parse HEAD:three) &&

	for w in Some extra lines here; do echo $w; done >>one &&
	git diff >patch.file &&
	patched=$(git hash-object --stdin <one) &&
	git read-tree --reset -u HEAD

ok 23 - --stdin with empty STDIN with -v

expecting success: 
				expect '' &&
				
	test_check_ignore "--stdin" 1 </dev/null &&
	test_stderr ""

			
expecting success: test "" != "$files"
ok 2 - Racy GIT trial #0 part B

ok 24 - --stdin with empty STDIN with -v -n

expecting success: 
				expect '' &&
				
	test_check_ignore "--stdin" 1 </dev/null &&
	test_stderr ""

			
expecting success: test "" != "$files"
ok 3 - Racy GIT trial #1 part A

ok 25 - --stdin with empty STDIN with -v --non-matching

expecting success: 
				expect '' &&
				
	test_check_ignore "--stdin" 1 </dev/null &&
	test_stderr ""

			
[master (root-commit) 063fa5f] initial
 Author: A U Thor <author@example.com>
 3 files changed, 12 insertions(+)
 create mode 100644 dir/two
 create mode 100644 one
 create mode 100644 three
ok 26 - --stdin with empty STDIN with --verbose

expecting success: 
				expect '' &&
				
	test_check_ignore "--stdin" 1 </dev/null &&
	test_stderr ""

			
ok 27 - --stdin with empty STDIN with --verbose -n

expecting success: 
				expect '' &&
				
	test_check_ignore "--stdin" 1 </dev/null &&
	test_stderr ""

			
ok 28 - --stdin with empty STDIN with --verbose --non-matching

expecting success: 
	expect "" &&
	test_check_ignore "-q one two" 128 &&
	stderr_contains "fatal: --quiet is only valid with a single pathname"

ok 1 - setup

fatal: --quiet is only valid with a single pathname
expecting success: 

	git config core.autocrlf input &&
	git config core.safecrlf true &&

	for w in I am all CRLF; do echo $w; done | append_cr >allcrlf &&
	test_must_fail git add allcrlf

ok 29 - -q with multiple args

expecting success: 
	expect "" &&
	test_check_ignore "--quiet one two" 128 &&
	stderr_contains "fatal: --quiet is only valid with a single pathname"

ok 19 - --run with a left open range

expecting success: 
	run_sub_test_lib_test run-right-open-range 		'--run with a right open range' --run='4-' <<-\EOF &&
	for i in 1 2 3 4 5 6
	do
		test_expect_success "passing test #$i" 'true'
	done
	test_done
	EOF
	check_sub_test_lib_test run-right-open-range <<-\EOF
	> ok 1 # skip passing test #1 (--run)
	> ok 2 # skip passing test #2 (--run)
	> ok 3 # skip passing test #3 (--run)
	> ok 4 - passing test #4
	> ok 5 - passing test #5
	> ok 6 - passing test #6
	> # passed all 6 test(s)
	> 1..6
	EOF

fatal: --quiet is only valid with a single pathname
ok 30 - --quiet with multiple args

expecting success: 
			expect '' &&
			test_check_ignore '-q -v foo' 128 &&
			stderr_contains 'fatal: cannot have both --quiet and --verbose'
		
fatal: CRLF would be replaced by LF in allcrlf.
fatal: cannot have both --quiet and --verbose
ok 31 - -q -v

expecting success: 
			expect '' &&
			test_check_ignore '--quiet -v foo' 128 &&
			stderr_contains 'fatal: cannot have both --quiet and --verbose'
		
ok 2 - safecrlf: autocrlf=input, all CRLF

expecting success: 

	git config core.autocrlf input &&
	git config core.safecrlf true &&

	for w in Oh here is CRLFQ in text; do echo $w; done | q_to_cr >mixed &&
	test_must_fail git add mixed

fatal: CRLF would be replaced by LF in mixed.
ok 3 - safecrlf: autocrlf=input, mixed LF/CRLF

expecting success: 

	git config core.autocrlf true &&
	git config core.safecrlf true &&

	for w in I am all LF; do echo $w; done >alllf &&
	test_must_fail git add alllf

fatal: cannot have both --quiet and --verbose
ok 32 - --quiet -v

expecting success: 
			expect '' &&
			test_check_ignore '-q --verbose foo' 128 &&
			stderr_contains 'fatal: cannot have both --quiet and --verbose'
		
fatal: LF would be replaced by CRLF in alllf
ok 4 - safecrlf: autocrlf=true, all LF

expecting success: 

	git config core.autocrlf true &&
	git config core.safecrlf true &&

	for w in Oh here is CRLFQ in text; do echo $w; done | q_to_cr >mixed &&
	test_must_fail git add mixed

fatal: cannot have both --quiet and --verbose
ok 33 - -q --verbose

expecting success: 
			expect '' &&
			test_check_ignore '--quiet --verbose foo' 128 &&
			stderr_contains 'fatal: cannot have both --quiet and --verbose'
		
fatal: cannot have both --quiet and --verbose
ok 34 - --quiet --verbose

expecting success: 
	expect "" &&
	test_check_ignore "--quiet one two" 128 &&
	stderr_contains "fatal: --quiet is only valid with a single pathname"

fatal: LF would be replaced by CRLF in mixed
ok 5 - safecrlf: autocrlf=true mixed LF/CRLF

expecting success: 

	git config core.autocrlf input &&
	git config core.safecrlf warn &&

	for w in I am all LF; do echo $w; done >doublewarn &&
	git add doublewarn &&
	git commit -m "nowarn" &&
	for w in Oh here is CRLFQ in text; do echo $w; done | q_to_cr >doublewarn &&
	test $(git add doublewarn 2>&1 | grep "CRLF will be replaced by LF" | wc -l) = 1

fatal: --quiet is only valid with a single pathname
ok 35 - --quiet with multiple args

ok 20 - --run with a right open range

expecting success: 
	run_sub_test_lib_test run-basic-neg 		'--run with basic negation' --run='!3' <<-\EOF &&
	for i in 1 2 3 4 5 6
	do
		test_expect_success "passing test #$i" 'true'
	done
	test_done
	EOF
	check_sub_test_lib_test run-basic-neg <<-\EOF
	> ok 1 - passing test #1
	> ok 2 - passing test #2
	> ok 3 # skip passing test #3 (--run)
	> ok 4 - passing test #4
	> ok 5 - passing test #5
	> ok 6 - passing test #6
	> # passed all 6 test(s)
	> 1..6
	EOF

expecting success: 
		expect "$expect" &&
		eval "$code"
	
fatal: no path specified
ok 36 - erroneous use of --

expecting success: 
			expect '' &&
			
	test_check_ignore "--" 128 &&
	stderr_contains "fatal: no path specified"

		
[master 4fb4e92] nowarn
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+)
 create mode 100644 doublewarn
fatal: no path specified
ok 37 - erroneous use of -- with -q

expecting success: 
			expect '' &&
			
	test_check_ignore "--" 128 &&
	stderr_contains "fatal: no path specified"

		
ok 6 - safecrlf: print warning only once

expecting success: 
	git config core.autocrlf input &&
	git config core.safecrlf true &&
	git diff HEAD

fatal: no path specified
ok 38 - erroneous use of -- with --quiet

expecting success: 
				expect '' &&
				
	test_check_ignore "--" 128 &&
	stderr_contains "fatal: no path specified"

			
warning: CRLF will be replaced by LF in doublewarn.
The file will have its original line endings in your working directory.
diff --git a/doublewarn b/doublewarn
index 03ba6c2..1ed2a2c 100644
--- a/doublewarn
+++ b/doublewarn
@@ -1,4 +1,6 @@
-I
-am
-all
-LF
+Oh
+here
+is
+CRLF
+in
+text
ok 7 - safecrlf: git diff demotes safecrlf=true to warn

expecting success: 
	git config core.autocrlf false &&
	git config core.safecrlf false &&
	git reset --hard HEAD^

fatal: no path specified
ok 39 - erroneous use of -- with -v

expecting success: 
				expect '' &&
				
	test_check_ignore "--" 128 &&
	stderr_contains "fatal: no path specified"

			
fatal: no path specified
HEAD is now at 063fa5f initial
ok 8 - switch off autocrlf, safecrlf, reset HEAD

ok 40 - erroneous use of -- with -v -n

expecting success: 

	rm -f tmp one dir/two three &&
	git read-tree --reset -u HEAD &&
	git config core.autocrlf input &&
	munge_cr append one &&
	munge_cr append dir/two &&
	git update-index -- one dir/two &&
	differs=$(git diff-index --cached HEAD) &&
	verbose test -z "$differs"


expecting success: 
				expect '' &&
				
	test_check_ignore "--" 128 &&
	stderr_contains "fatal: no path specified"

			
ok 21 - --run with basic negation

expecting success: 
	run_sub_test_lib_test run-two-neg 		'--run with two negations' --run='!3 !6' <<-\EOF &&
	for i in 1 2 3 4 5 6
	do
		test_expect_success "passing test #$i" 'true'
	done
	test_done
	EOF
	check_sub_test_lib_test run-two-neg <<-\EOF
	> ok 1 - passing test #1
	> ok 2 - passing test #2
	> ok 3 # skip passing test #3 (--run)
	> ok 4 - passing test #4
	> ok 5 - passing test #5
	> ok 6 # skip passing test #6 (--run)
	> # passed all 6 test(s)
	> 1..6
	EOF

fatal: no path specified
ok 41 - erroneous use of -- with -v --non-matching

expecting success: 
				expect '' &&
				
	test_check_ignore "--" 128 &&
	stderr_contains "fatal: no path specified"

			
fatal: no path specified
ok 42 - erroneous use of -- with --verbose

expecting success: 
				expect '' &&
				
	test_check_ignore "--" 128 &&
	stderr_contains "fatal: no path specified"

			
expecting success: test "" != "$files"
ok 4 - Racy GIT trial #1 part B

ok 9 - update with autocrlf=input

expecting success: 

	rm -f tmp one dir/two three &&
	git read-tree --reset -u HEAD &&
	git config core.autocrlf true &&
	munge_cr append one &&
	munge_cr append dir/two &&
	git update-index -- one dir/two &&
	differs=$(git diff-index --cached HEAD) &&
	verbose test -z "$differs"


fatal: no path specified
ok 43 - erroneous use of -- with --verbose -n

expecting success: 
				expect '' &&
				
	test_check_ignore "--" 128 &&
	stderr_contains "fatal: no path specified"

			
fatal: no path specified
ok 44 - erroneous use of -- with --verbose --non-matching

expecting success: test "" != "$files"
ok 5 - Racy GIT trial #2 part A

expecting success: 
		expect "$expect" &&
		eval "$code"
	
fatal: cannot specify pathnames with --stdin
ok 45 - --stdin with superfluous arg

expecting success: 
			expect '' &&
			
	test_check_ignore "--stdin foo" 128 &&
	stderr_contains "fatal: cannot specify pathnames with --stdin"

		
ok 10 - update with autocrlf=true

expecting success: 

	rm -f tmp one dir/two three &&
	git config core.autocrlf true &&
	git read-tree --reset -u HEAD &&
	munge_cr remove one &&
	munge_cr remove dir/two &&
	git update-index -- one dir/two &&
	test "$one" = $(git hash-object --stdin <one) &&
	test "$two" = $(git hash-object --stdin <dir/two) &&
	differs=$(git diff-index --cached HEAD) &&
	verbose test -z "$differs"

fatal: cannot specify pathnames with --stdin
ok 46 - --stdin with superfluous arg with -q

expecting success: 
			expect '' &&
			
	test_check_ignore "--stdin foo" 128 &&
	stderr_contains "fatal: cannot specify pathnames with --stdin"

		
fatal: cannot specify pathnames with --stdin
ok 47 - --stdin with superfluous arg with --quiet

expecting success: 
				expect '' &&
				
	test_check_ignore "--stdin foo" 128 &&
	stderr_contains "fatal: cannot specify pathnames with --stdin"

			
ok 22 - --run with two negations

expecting success: 
	run_sub_test_lib_test run-range-and-neg 		'--run a range and negation' --run='-4 !2' <<-\EOF &&
	for i in 1 2 3 4 5 6
	do
		test_expect_success "passing test #$i" 'true'
	done
	test_done
	EOF
	check_sub_test_lib_test run-range-and-neg <<-\EOF
	> ok 1 - passing test #1
	> ok 2 # skip passing test #2 (--run)
	> ok 3 - passing test #3
	> ok 4 - passing test #4
	> ok 5 # skip passing test #5 (--run)
	> ok 6 # skip passing test #6 (--run)
	> # passed all 6 test(s)
	> 1..6
	EOF

fatal: cannot specify pathnames with --stdin
ok 48 - --stdin with superfluous arg with -v

expecting success: 
				expect '' &&
				
	test_check_ignore "--stdin foo" 128 &&
	stderr_contains "fatal: cannot specify pathnames with --stdin"

			
ok 11 - checkout with autocrlf=true

expecting success: 

	rm -f tmp one dir/two three &&
	git config core.autocrlf input &&
	git read-tree --reset -u HEAD &&
	test_must_fail has_cr one &&
	test_must_fail has_cr two &&
	git update-index -- one dir/two &&
	test "$one" = $(git hash-object --stdin <one) &&
	test "$two" = $(git hash-object --stdin <dir/two) &&
	differs=$(git diff-index --cached HEAD) &&
	verbose test -z "$differs"

fatal: cannot specify pathnames with --stdin
ok 49 - --stdin with superfluous arg with -v -n

expecting success: 
				expect '' &&
				
	test_check_ignore "--stdin foo" 128 &&
	stderr_contains "fatal: cannot specify pathnames with --stdin"

			
fatal: cannot specify pathnames with --stdin
ok 50 - --stdin with superfluous arg with -v --non-matching

expecting success: 
				expect '' &&
				
	test_check_ignore "--stdin foo" 128 &&
	stderr_contains "fatal: cannot specify pathnames with --stdin"

			
t0020-crlf.sh: 8: eval: cannot open two: No such file
fatal: cannot specify pathnames with --stdin
ok 51 - --stdin with superfluous arg with --verbose

expecting success: 
				expect '' &&
				
	test_check_ignore "--stdin foo" 128 &&
	stderr_contains "fatal: cannot specify pathnames with --stdin"

			
ok 12 - checkout with autocrlf=input

expecting success: 

	rm -f tmp one dir/two three &&
	git config core.autocrlf input &&
	git read-tree --reset -u HEAD &&

	git apply patch.file &&
	verbose test "$patched" = "$(git hash-object --stdin <one)"

fatal: cannot specify pathnames with --stdin
ok 52 - --stdin with superfluous arg with --verbose -n

expecting success: 
				expect '' &&
				
	test_check_ignore "--stdin foo" 128 &&
	stderr_contains "fatal: cannot specify pathnames with --stdin"

			
ok 13 - apply patch (autocrlf=input)

expecting success: 

	rm -f tmp one dir/two three &&
	git config core.autocrlf input &&
	git read-tree --reset -u HEAD &&

	git apply --cached patch.file &&
	verbose test "$patched" = $(git rev-parse :one)

fatal: cannot specify pathnames with --stdin
ok 53 - --stdin with superfluous arg with --verbose --non-matching

ok 23 - --run a range and negation

expecting success: 
	run_sub_test_lib_test run-range-neg 		'--run range negation' --run='!1-3' <<-\EOF &&
	for i in 1 2 3 4 5 6
	do
		test_expect_success "passing test #$i" 'true'
	done
	test_done
	EOF
	check_sub_test_lib_test run-range-neg <<-\EOF
	> ok 1 # skip passing test #1 (--run)
	> ok 2 # skip passing test #2 (--run)
	> ok 3 # skip passing test #3 (--run)
	> ok 4 - passing test #4
	> ok 5 - passing test #5
	> ok 6 - passing test #6
	> # passed all 6 test(s)
	> 1..6
	EOF

expecting success: 
		expect "$expect" &&
		eval "$code"
	
fatal: cannot specify pathnames with --stdin
ok 54 - --stdin -z with superfluous arg

ok 14 - apply patch --cached (autocrlf=input)

expecting success: 

	rm -f tmp one dir/two three &&
	git config core.autocrlf input &&
	git read-tree --reset -u HEAD &&

	git apply --index patch.file &&
	verbose test "$patched" = $(git rev-parse :one) &&
	verbose test "$patched" = $(git hash-object --stdin <one)

expecting success: 
			expect '' &&
			
	test_check_ignore "--stdin -z foo" 128 &&
	stderr_contains "fatal: cannot specify pathnames with --stdin"

		
fatal: cannot specify pathnames with --stdin
ok 55 - --stdin -z with superfluous arg with -q

expecting success: 
			expect '' &&
			
	test_check_ignore "--stdin -z foo" 128 &&
	stderr_contains "fatal: cannot specify pathnames with --stdin"

		
ok 15 - apply patch --index (autocrlf=input)

expecting success: 

	rm -f tmp one dir/two three &&
	git config core.autocrlf true &&
	git read-tree --reset -u HEAD &&

	git apply patch.file &&
	verbose test "$patched" = "$(remove_cr <one | git hash-object --stdin)"

fatal: cannot specify pathnames with --stdin
ok 56 - --stdin -z with superfluous arg with --quiet

expecting success: 
				expect '' &&
				
	test_check_ignore "--stdin -z foo" 128 &&
	stderr_contains "fatal: cannot specify pathnames with --stdin"

			
fatal: cannot specify pathnames with --stdin
ok 57 - --stdin -z with superfluous arg with -v

expecting success: 
				expect '' &&
				
	test_check_ignore "--stdin -z foo" 128 &&
	stderr_contains "fatal: cannot specify pathnames with --stdin"

			
ok 16 - apply patch (autocrlf=true)

expecting success: 

	rm -f tmp one dir/two three &&
	git config core.autocrlf true &&
	git read-tree --reset -u HEAD &&

	git apply --cached patch.file &&
	verbose test "$patched" = $(git rev-parse :one)

fatal: cannot specify pathnames with --stdin
ok 58 - --stdin -z with superfluous arg with -v -n

expecting success: 
				expect '' &&
				
	test_check_ignore "--stdin -z foo" 128 &&
	stderr_contains "fatal: cannot specify pathnames with --stdin"

			
fatal: cannot specify pathnames with --stdin
ok 59 - --stdin -z with superfluous arg with -v --non-matching

expecting success: 
				expect '' &&
				
	test_check_ignore "--stdin -z foo" 128 &&
	stderr_contains "fatal: cannot specify pathnames with --stdin"

			
ok 24 - --run range negation

expecting success: 
	run_sub_test_lib_test run-inc-neg-inc 		'--run include, exclude and include' 		--run='1-5 !1-3 2' <<-\EOF &&
	for i in 1 2 3 4 5 6
	do
		test_expect_success "passing test #$i" 'true'
	done
	test_done
	EOF
	check_sub_test_lib_test run-inc-neg-inc <<-\EOF
	> ok 1 # skip passing test #1 (--run)
	> ok 2 - passing test #2
	> ok 3 # skip passing test #3 (--run)
	> ok 4 - passing test #4
	> ok 5 - passing test #5
	> ok 6 # skip passing test #6 (--run)
	> # passed all 6 test(s)
	> 1..6
	EOF

ok 17 - apply patch --cached (autocrlf=true)

expecting success: 

	rm -f tmp one dir/two three &&
	git config core.autocrlf true &&
	git read-tree --reset -u HEAD &&

	git apply --index patch.file &&
	verbose test "$patched" = $(git rev-parse :one) &&
	verbose test "$patched" = "$(remove_cr <one | git hash-object --stdin)"

expecting success: test "" != "$files"
ok 6 - Racy GIT trial #2 part B

fatal: cannot specify pathnames with --stdin
ok 60 - --stdin -z with superfluous arg with --verbose

expecting success: 
				expect '' &&
				
	test_check_ignore "--stdin -z foo" 128 &&
	stderr_contains "fatal: cannot specify pathnames with --stdin"

			
expecting success: test "" != "$files"
ok 7 - Racy GIT trial #3 part A

fatal: cannot specify pathnames with --stdin
ok 61 - --stdin -z with superfluous arg with --verbose -n

expecting success: 
				expect '' &&
				
	test_check_ignore "--stdin -z foo" 128 &&
	stderr_contains "fatal: cannot specify pathnames with --stdin"

			
ok 18 - apply patch --index (autocrlf=true)

expecting success: 

	rm -f tmp one dir/two three &&
	echo "two -crlf" >.gitattributes &&
	git config core.autocrlf true &&
	git read-tree --reset -u HEAD &&

	test_must_fail has_cr dir/two &&
	verbose has_cr one &&
	test_must_fail has_cr three

fatal: cannot specify pathnames with --stdin
ok 62 - --stdin -z with superfluous arg with --verbose --non-matching

expecting success: 
		expect "$expect" &&
		eval "$code"
	
fatal: -z only makes sense with --stdin
ok 63 - -z without --stdin

ok 19 - .gitattributes says two is binary

expecting success: 

	rm -f tmp one dir/two three &&
	echo "two crlf=input" >.gitattributes &&
	git read-tree --reset -u HEAD &&

	test_must_fail has_cr dir/two

expecting success: 
			expect '' &&
			
	test_check_ignore "-z" 128 &&
	stderr_contains "fatal: -z only makes sense with --stdin"

		
fatal: -z only makes sense with --stdin
ok 64 - -z without --stdin with -q

expecting success: 
			expect '' &&
			
	test_check_ignore "-z" 128 &&
	stderr_contains "fatal: -z only makes sense with --stdin"

		
ok 20 - .gitattributes says two is input

expecting success: 

	rm -f tmp one dir/two three &&
	echo "t* crlf" >.gitattributes &&
	git read-tree --reset -u HEAD &&

	verbose has_cr dir/two &&
	verbose has_cr three

fatal: -z only makes sense with --stdin
ok 65 - -z without --stdin with --quiet

expecting success: 
				expect '' &&
				
	test_check_ignore "-z" 128 &&
	stderr_contains "fatal: -z only makes sense with --stdin"

			
ok 21 - .gitattributes says two and three are text

expecting success: 

	echo "one -crlf" >>.gitattributes &&
	git add .gitattributes &&
	git commit -m "Add .gitattributes" &&

	rm -rf tmp one dir .gitattributes patch.file three &&
	git read-tree --reset -u HEAD &&

	test_must_fail has_cr one &&
	verbose has_cr three

fatal: -z only makes sense with --stdin
ok 66 - -z without --stdin with -v

expecting success: 
				expect '' &&
				
	test_check_ignore "-z" 128 &&
	stderr_contains "fatal: -z only makes sense with --stdin"

			
[master 19d3889] Add .gitattributes
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+)
 create mode 100644 .gitattributes
fatal: -z only makes sense with --stdin
ok 67 - -z without --stdin with -v -n

expecting success: 
				expect '' &&
				
	test_check_ignore "-z" 128 &&
	stderr_contains "fatal: -z only makes sense with --stdin"

			
ok 25 - --run include, exclude and include

ok 22 - in-tree .gitattributes (1)

expecting success: 

	rm -rf tmp one dir .gitattributes patch.file three &&
	git read-tree --reset HEAD &&
	git checkout-index -f -q -u -a &&

	test_must_fail has_cr one &&
	verbose has_cr three

expecting success: 
	run_sub_test_lib_test run-inc-neg-inc-comma 		'--run include, exclude and include, comma separated' 		--run=1-5,\!1-3,2 <<-\EOF &&
	for i in 1 2 3 4 5 6
	do
		test_expect_success "passing test #$i" 'true'
	done
	test_done
	EOF
	check_sub_test_lib_test run-inc-neg-inc-comma <<-\EOF
	> ok 1 # skip passing test #1 (--run)
	> ok 2 - passing test #2
	> ok 3 # skip passing test #3 (--run)
	> ok 4 - passing test #4
	> ok 5 - passing test #5
	> ok 6 # skip passing test #6 (--run)
	> # passed all 6 test(s)
	> 1..6
	EOF

fatal: -z only makes sense with --stdin
ok 68 - -z without --stdin with -v --non-matching

expecting success: 
				expect '' &&
				
	test_check_ignore "-z" 128 &&
	stderr_contains "fatal: -z only makes sense with --stdin"

			
fatal: -z only makes sense with --stdin
ok 69 - -z without --stdin with --verbose

expecting success: 
				expect '' &&
				
	test_check_ignore "-z" 128 &&
	stderr_contains "fatal: -z only makes sense with --stdin"

			
ok 23 - in-tree .gitattributes (2)

expecting success: 

	rm -rf tmp one dir .gitattributes patch.file three &&
	git read-tree --reset HEAD &&
	git checkout-index -u .gitattributes &&
	git checkout-index -u one dir/two three &&

	test_must_fail has_cr one &&
	verbose has_cr three

fatal: -z only makes sense with --stdin
ok 70 - -z without --stdin with --verbose -n

expecting success: 
				expect '' &&
				
	test_check_ignore "-z" 128 &&
	stderr_contains "fatal: -z only makes sense with --stdin"

			
fatal: -z only makes sense with --stdin
ok 71 - -z without --stdin with --verbose --non-matching

expecting success: 
		expect "$expect" &&
		eval "$code"
	
fatal: -z only makes sense with --stdin
ok 72 - -z without --stdin and superfluous arg

ok 24 - in-tree .gitattributes (3)

expecting success: 

	rm -rf tmp one dir .gitattributes patch.file three &&
	git read-tree --reset HEAD &&
	git checkout-index -u one dir/two three &&
	git checkout-index -u .gitattributes &&

	test_must_fail has_cr one &&
	verbose has_cr three

expecting success: 
			expect '' &&
			
	test_check_ignore "-z foo" 128 &&
	stderr_contains "fatal: -z only makes sense with --stdin"

		
fatal: -z only makes sense with --stdin
ok 73 - -z without --stdin and superfluous arg with -q

expecting success: 
			expect '' &&
			
	test_check_ignore "-z foo" 128 &&
	stderr_contains "fatal: -z only makes sense with --stdin"

		
fatal: -z only makes sense with --stdin
ok 25 - in-tree .gitattributes (4)

ok 74 - -z without --stdin and superfluous arg with --quiet

expecting success: 

	git config core.autocrlf true &&
	git config --unset core.safecrlf &&
	echo ".file2 -crlfQ" | q_to_cr >> .gitattributes &&
	git add .gitattributes &&
	git commit -m initial &&
	echo ".file -crlfQ" | q_to_cr >> .gitattributes &&
	echo "contents" > .file &&
	git add .gitattributes .file &&
	git commit -m second &&

	git checkout master~1 &&
	git checkout master &&
	test "$(git diff-files --raw)" = ""


expecting success: 
				expect '' &&
				
	test_check_ignore "-z foo" 128 &&
	stderr_contains "fatal: -z only makes sense with --stdin"

			
fatal: -z only makes sense with --stdin
ok 75 - -z without --stdin and superfluous arg with -v

expecting success: 
				expect '' &&
				
	test_check_ignore "-z foo" 128 &&
	stderr_contains "fatal: -z only makes sense with --stdin"

			
fatal: -z only makes sense with --stdin
ok 76 - -z without --stdin and superfluous arg with -v -n

expecting success: 
				expect '' &&
				
	test_check_ignore "-z foo" 128 &&
	stderr_contains "fatal: -z only makes sense with --stdin"

			
[master 2cca5a8] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
fatal: -z only makes sense with --stdin
ok 77 - -z without --stdin and superfluous arg with -v --non-matching

ok 26 - --run include, exclude and include, comma separated

expecting success: 
				expect '' &&
				
	test_check_ignore "-z foo" 128 &&
	stderr_contains "fatal: -z only makes sense with --stdin"

			
expecting success: 
	run_sub_test_lib_test run-neg-inc 		'--run exclude and include' 		--run='!3- 5' <<-\EOF &&
	for i in 1 2 3 4 5 6
	do
		test_expect_success "passing test #$i" 'true'
	done
	test_done
	EOF
	check_sub_test_lib_test run-neg-inc <<-\EOF
	> ok 1 - passing test #1
	> ok 2 - passing test #2
	> ok 3 # skip passing test #3 (--run)
	> ok 4 # skip passing test #4 (--run)
	> ok 5 - passing test #5
	> ok 6 # skip passing test #6 (--run)
	> # passed all 6 test(s)
	> 1..6
	EOF

[master f2a5328] second
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 .file
fatal: -z only makes sense with --stdin
ok 78 - -z without --stdin and superfluous arg with --verbose

expecting success: 
				expect '' &&
				
	test_check_ignore "-z foo" 128 &&
	stderr_contains "fatal: -z only makes sense with --stdin"

			
expecting success: test "" != "$files"
ok 8 - Racy GIT trial #3 part B

Note: checking out 'master~1'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 2cca5a8... initial
Previous HEAD position was 2cca5a8... initial
Switched to branch 'master'
expecting success: test "" != "$files"
fatal: -z only makes sense with --stdin
ok 79 - -z without --stdin and superfluous arg with --verbose -n

expecting success: 
				expect '' &&
				
	test_check_ignore "-z foo" 128 &&
	stderr_contains "fatal: -z only makes sense with --stdin"

			
ok 9 - Racy GIT trial #4 part A

ok 26 - checkout with existing .gitattributes

expecting success: 

	git rm .gitattributes &&
	echo "contentsQ" | q_to_cr > .file2 &&
	git add .file2 &&
	git commit -m third &&

	git checkout master~1 &&
	git checkout master &&
	has_cr .file2


rm '.gitattributes'
fatal: -z only makes sense with --stdin
ok 80 - -z without --stdin and superfluous arg with --verbose --non-matching

expecting success: 
		expect "$expect" &&
		eval "$code"
	
[master ed656b0] third
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 4 deletions(-)
 create mode 100644 .file2
 delete mode 100644 .gitattributes
Note: checking out 'master~1'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at f2a5328... second
fatal: This operation must be run in a work tree
ok 81 - needs work tree

expecting success: 
			expect '' &&
			
	(
		cd .git &&
		test_check_ignore "foo" 128
	) &&
	stderr_contains "fatal: This operation must be run in a work tree"

		
Previous HEAD position was f2a5328... second
Switched to branch 'master'
ok 27 - checkout when deleting .gitattributes

expecting success: 

	echo "three +crlf" >>.gitattributes &&
	git diff


+crlf is not a valid attribute name: .gitattributes:1
ok 28 - invalid .gitattributes (must not crash)

expecting success: 
	git config core.autocrlf false &&
	git config core.safecrlf false &&
	rm -rf .????* * &&
	for w in I am all LF; do echo $w; done >alllf &&
	for w in Oh here is CRLFQ in text; do echo $w; done | q_to_cr >mixed &&
	for w in I am all CRLF; do echo $w; done | append_cr >allcrlf &&
	git add -A . &&
	git commit -m "alllf, allcrlf and mixed only" &&
	git tag -a -m "message" autocrlf-checkpoint

fatal: This operation must be run in a work tree
ok 82 - needs work tree with -q

expecting success: 
			expect '' &&
			
	(
		cd .git &&
		test_check_ignore "foo" 128
	) &&
	stderr_contains "fatal: This operation must be run in a work tree"

		
fatal: This operation must be run in a work tree
ok 83 - needs work tree with --quiet

expecting success: 
				expect '' &&
				
	(
		cd .git &&
		test_check_ignore "foo" 128
	) &&
	stderr_contains "fatal: This operation must be run in a work tree"

			
fatal: This operation must be run in a work tree
ok 84 - needs work tree with -v

expecting success: 
				expect '' &&
				
	(
		cd .git &&
		test_check_ignore "foo" 128
	) &&
	stderr_contains "fatal: This operation must be run in a work tree"

			
ok 27 - --run exclude and include

expecting success: 
	run_sub_test_lib_test run-empty-sel 		'--run empty selectors' 		--run='1,,3,,,5' <<-\EOF &&
	for i in 1 2 3 4 5 6
	do
		test_expect_success "passing test #$i" 'true'
	done
	test_done
	EOF
	check_sub_test_lib_test run-empty-sel <<-\EOF
	> ok 1 - passing test #1
	> ok 2 # skip passing test #2 (--run)
	> ok 3 - passing test #3
	> ok 4 # skip passing test #4 (--run)
	> ok 5 - passing test #5
	> ok 6 # skip passing test #6 (--run)
	> # passed all 6 test(s)
	> 1..6
	EOF

[master 9e16e70] alllf, allcrlf and mixed only
 Author: A U Thor <author@example.com>
 7 files changed, 8 insertions(+), 14 deletions(-)
 delete mode 100644 .file
 delete mode 100644 .file2
 create mode 100644 allcrlf
 create mode 100644 alllf
 delete mode 100644 dir/two
 rename three => mixed (57%)
 delete mode 100644 one
fatal: This operation must be run in a work tree
ok 85 - needs work tree with -v -n

expecting success: 
				expect '' &&
				
	(
		cd .git &&
		test_check_ignore "foo" 128
	) &&
	stderr_contains "fatal: This operation must be run in a work tree"

			
ok 29 - setting up for new autocrlf tests

expecting success: 
	git config core.autocrlf true &&
	touch * &&
	git diff --exit-code

ok 30 - report no change after setting autocrlf

expecting success: 
	rm * &&
	git checkout -f &&
	git diff --exit-code

fatal: This operation must be run in a work tree
ok 86 - needs work tree with -v --non-matching

expecting success: 
				expect '' &&
				
	(
		cd .git &&
		test_check_ignore "foo" 128
	) &&
	stderr_contains "fatal: This operation must be run in a work tree"

			
fatal: This operation must be run in a work tree
ok 31 - files are clean after checkout
ok 87 - needs work tree with --verbose


expecting success: 
	test "$(cr_to_Q_no_NL < alllf)" = "IQamQallQLFQ"

expecting success: 
				expect '' &&
				
	(
		cd .git &&
		test_check_ignore "foo" 128
	) &&
	stderr_contains "fatal: This operation must be run in a work tree"

			
ok 32 - LF only file gets CRLF with autocrlf

expecting success: 
	test "$(cr_to_Q_no_NL < mixed)" = "OhhereisCRLFQintext"

ok 33 - Mixed file is still mixed with autocrlf

expecting success: 
	test "$(cr_to_Q_no_NL < allcrlf)" = "IQamQallQCRLFQ"

ok 34 - CRLF only file has CRLF with autocrlf

expecting success: 
	tr -d "\015" < alllf | append_cr > alllf2 &&
	git add alllf2 &&
	git commit -m "alllf2 added" &&
	git config core.autocrlf false &&
	rm * &&
	git checkout -f &&
	test_cmp alllf alllf2

fatal: This operation must be run in a work tree
ok 88 - needs work tree with --verbose -n

expecting success: 
				expect '' &&
				
	(
		cd .git &&
		test_check_ignore "foo" 128
	) &&
	stderr_contains "fatal: This operation must be run in a work tree"

			
fatal: This operation must be run in a work tree
ok 89 - needs work tree with --verbose --non-matching

[master 7dba471] alllf2 added
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+)
 create mode 100644 alllf2
expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 90 - non-existent file at top-level not ignored

ok 35 - New CRLF file gets LF in repo

expecting success: 
			expect '' &&
			test_check_ignore 'non-existent' 1
		
# passed all 35 test(s)
1..35
ok 91 - non-existent file at top-level not ignored with -q

ok 28 - --run empty selectors

expecting success: 
			expect '' &&
			test_check_ignore 'non-existent' 1
		
expecting success: 
	run_sub_test_lib_test_err run-inv-range-start 		'--run invalid range start' 		--run='a-5' <<-\EOF &&
	test_expect_success "passing test #1" 'true'
	test_done
	EOF
	check_sub_test_lib_test_err run-inv-range-start 		<<-\EOF_OUT 3<<-\EOF_ERR
	> FATAL: Unexpected exit with code 1
	EOF_OUT
	> error: --run: invalid non-numeric in range start: 'a-5'
	EOF_ERR

ok 92 - non-existent file at top-level not ignored with --quiet

*** t0021-conversion.sh ***
expecting success: 
				expect '' &&
				test_check_ignore 'non-existent' 1
			
ok 93 - non-existent file at top-level not ignored with -v

expecting success: 
				expect '::	non-existent' &&
				test_check_ignore 'non-existent' 1
			
ok 94 - non-existent file at top-level not ignored with -v -n

expecting success: 
				expect '::	non-existent' &&
				test_check_ignore 'non-existent' 1
			
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0021-conversion/.git/
ok 95 - non-existent file at top-level not ignored with -v --non-matching

expecting success: 
				expect '' &&
				test_check_ignore 'non-existent' 1
			
expecting success: 
	git config filter.rot13.smudge ./rot13.sh &&
	git config filter.rot13.clean ./rot13.sh &&

	{
	    echo "*.t filter=rot13"
	    echo "*.i ident"
	} >.gitattributes &&

	{
	    echo a b c d e f g h i j k l m
	    echo n o p q r s t u v w x y z
	    echo '$Id$'
	} >test &&
	cat test >test.t &&
	cat test >test.o &&
	cat test >test.i &&
	git add test test.t test.i &&
	rm -f test test.t test.i &&
	git checkout -- test test.t test.i

ok 96 - non-existent file at top-level not ignored with --verbose

expecting success: 
				expect '::	non-existent' &&
				test_check_ignore 'non-existent' 1
			
ok 97 - non-existent file at top-level not ignored with --verbose -n

expecting success: 
				expect '::	non-existent' &&
				test_check_ignore 'non-existent' 1
			
expecting success: test "" != "$files"
ok 10 - Racy GIT trial #4 part B

ok 29 - --run invalid range start

expecting success: 
	run_sub_test_lib_test_err run-inv-range-end 		'--run invalid range end' 		--run='1-z' <<-\EOF &&
	test_expect_success "passing test #1" 'true'
	test_done
	EOF
	check_sub_test_lib_test_err run-inv-range-end 		<<-\EOF_OUT 3<<-\EOF_ERR
	> FATAL: Unexpected exit with code 1
	EOF_OUT
	> error: --run: invalid non-numeric in range end: '1-z'
	EOF_ERR

# passed all 10 test(s)
1..10
ok 98 - non-existent file at top-level not ignored with --verbose --non-matching

*** t0022-crlf-rename.sh ***
expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 1 - setup

expecting success: 

	cmp test.o test &&
	cmp test.o test.t &&

	# ident should be stripped in the repository
	git diff --raw --exit-code :test :test.i &&
	id=$(git rev-parse --verify :test) &&
	embedded=$(sed -ne "$script" test.i) &&
	test "z$id" = "z$embedded" &&

	git cat-file blob :test.t > test.r &&

	./rot13.sh < test.o > test.t &&
	cmp test.r test.t

ok 99 - non-existent file at top-level not ignored with --no-index

expecting success: 
			expect '' &&
			test_check_ignore 'non-existent' 1
		
ok 100 - non-existent file at top-level not ignored with --no-index -q

expecting success: 
			expect '' &&
			test_check_ignore 'non-existent' 1
		
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0022-crlf-rename/.git/
ok 2 - check

expecting success: 

	cat "$TEST_DIRECTORY"/t0022-crlf-rename.sh >sample &&
	git add sample &&

	test_tick &&
	git commit -m Initial &&

	append_cr <"$TEST_DIRECTORY"/t0022-crlf-rename.sh >elpmas &&
	git add elpmas &&
	rm -f sample &&

	test_tick &&
	git commit -a -m Second


expecting success: 
	{
		echo "File with expanded keywords"
		echo "\$Id\$"
		echo "\$Id:\$"
		echo "\$Id: 0000000000000000000000000000000000000000 \$"
		echo "\$Id: NoSpaceAtEnd\$"
		echo "\$Id:NoSpaceAtFront \$"
		echo "\$Id:NoSpaceAtEitherEnd\$"
		echo "\$Id: NoTerminatingSymbol"
		echo "\$Id: Foreign Commit With Spaces \$"
	} >expanded-keywords.0 &&

	{
		cat expanded-keywords.0 &&
		printf "\$Id: NoTerminatingSymbolAtEOF"
	} >expanded-keywords &&
	cat expanded-keywords >expanded-keywords-crlf &&
	git add expanded-keywords expanded-keywords-crlf &&
	git commit -m "File with keywords expanded" &&
	id=$(git rev-parse --verify :expanded-keywords) &&

	{
		echo "File with expanded keywords"
		echo "\$Id: $id \$"
		echo "\$Id: $id \$"
		echo "\$Id: $id \$"
		echo "\$Id: $id \$"
		echo "\$Id: $id \$"
		echo "\$Id: $id \$"
		echo "\$Id: NoTerminatingSymbol"
		echo "\$Id: Foreign Commit With Spaces \$"
	} >expected-output.0 &&
	{
		cat expected-output.0 &&
		printf "\$Id: NoTerminatingSymbolAtEOF"
	} >expected-output &&
	{
		append_cr <expected-output.0 &&
		printf "\$Id: NoTerminatingSymbolAtEOF"
	} >expected-output-crlf &&
	{
		echo "expanded-keywords ident"
		echo "expanded-keywords-crlf ident text eol=crlf"
	} >>.gitattributes &&

	rm -f expanded-keywords expanded-keywords-crlf &&

	git checkout -- expanded-keywords &&
	test_cmp expanded-keywords expected-output &&

	git checkout -- expanded-keywords-crlf &&
	test_cmp expanded-keywords-crlf expected-output-crlf

ok 101 - non-existent file at top-level not ignored with --no-index --quiet

expecting success: 
				expect '' &&
				test_check_ignore 'non-existent' 1
			
ok 102 - non-existent file at top-level not ignored with --no-index -v

expecting success: 
				expect '::	non-existent' &&
				test_check_ignore 'non-existent' 1
			
[master (root-commit) 6ee20c2] Initial
 Author: A U Thor <author@example.com>
 1 file changed, 33 insertions(+)
 create mode 100644 sample
ok 30 - --run invalid range end

expecting success: 
	run_sub_test_lib_test_err run-inv-selector 		'--run invalid selector' 		--run='1?' <<-\EOF &&
	test_expect_success "passing test #1" 'true'
	test_done
	EOF
	check_sub_test_lib_test_err run-inv-selector 		<<-\EOF_OUT 3<<-\EOF_ERR
	> FATAL: Unexpected exit with code 1
	EOF_OUT
	> error: --run: invalid non-numeric in test selector: '1?'
	EOF_ERR

ok 103 - non-existent file at top-level not ignored with --no-index -v -n

expecting success: 
				expect '::	non-existent' &&
				test_check_ignore 'non-existent' 1
			
[master (root-commit) b0369a3] File with keywords expanded
 Author: A U Thor <author@example.com>
 5 files changed, 29 insertions(+)
 create mode 100644 expanded-keywords
 create mode 100644 expanded-keywords-crlf
 create mode 100644 test
 create mode 100644 test.i
 create mode 100644 test.t
[master d248b45] Second
 Author: A U Thor <author@example.com>
 1 file changed, 33 insertions(+), 33 deletions(-)
 rename sample => elpmas (94%)
ok 1 - setup

expecting success: 

	git diff-tree -M -r --name-status HEAD^ HEAD |
	sed -e "s/R[0-9]*/RNUM/" >actual &&
	echo "RNUM	sample	elpmas" >expect &&
	test_cmp expect actual


ok 104 - non-existent file at top-level not ignored with --no-index -v --non-matching

expecting success: 
				expect '' &&
				test_check_ignore 'non-existent' 1
			
ok 2 - diff -M

# passed all 2 test(s)
1..2
ok 105 - non-existent file at top-level not ignored with --no-index --verbose

expecting success: 
				expect '::	non-existent' &&
				test_check_ignore 'non-existent' 1
			
ok 3 - expanded_in_repo

expecting success: 
	cat >argc.sh <<-EOF &&
	#!$SHELL_PATH
	cat >/dev/null
	echo argc: \$# "\$@"
	EOF
	normal=name-no-magic &&
	special="name  with 'sq' and \$x" &&
	echo some test text >"$normal" &&
	echo some test text >"$special" &&
	git add "$normal" "$special" &&
	git commit -q -m "add files" &&
	echo "name* filter=argc" >.gitattributes &&

	# delete the files and check them out again, using a smudge filter
	# that will count the args and echo the command-line back to us
	git config filter.argc.smudge "sh ./argc.sh %f" &&
	rm "$normal" "$special" &&
	git checkout -- "$normal" "$special" &&

	# make sure argc.sh counted the right number of args
	echo "argc: 1 $normal" >expect &&
	test_cmp expect "$normal" &&
	echo "argc: 1 $special" >expect &&
	test_cmp expect "$special" &&

	# do the same thing, but with more args in the filter expression
	git config filter.argc.smudge "sh ./argc.sh %f --my-extra-arg" &&
	rm "$normal" "$special" &&
	git checkout -- "$normal" "$special" &&

	# make sure argc.sh counted the right number of args
	echo "argc: 2 $normal --my-extra-arg" >expect &&
	test_cmp expect "$normal" &&
	echo "argc: 2 $special --my-extra-arg" >expect &&
	test_cmp expect "$special" &&
	:

ok 106 - non-existent file at top-level not ignored with --no-index --verbose -n

expecting success: 
				expect '::	non-existent' &&
				test_check_ignore 'non-existent' 1
			
*** t0023-crlf-am.sh ***
ok 107 - non-existent file at top-level not ignored with --no-index --verbose --non-matching

expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 31 - --run invalid selector

expecting success: 
	test_have_prereq HAVEIT &&
	haveit=yes

ok 108 - non-existent file at top-level ignored

ok 32 - test runs if prerequisite is satisfied

skipping test: unmet prerequisite causes test to be skipped 
	donthaveit=no

ok 33 # skip unmet prerequisite causes test to be skipped (missing DONTHAVEIT)

expecting success: 
			expect '' &&
			test_check_ignore 'one'
		
expecting success: 
	test_have_prereq HAVEIT &&
	test_have_prereq HAVETHIS &&
	haveit=yes

ok 34 - test runs if prerequisites are satisfied

skipping test: unmet prerequisites causes test to be skipped 
	donthaveit=no

ok 35 # skip unmet prerequisites causes test to be skipped (missing DONTHAVEIT of HAVEIT,DONTHAVEIT)

skipping test: unmet prerequisites causes test to be skipped 
	donthaveiteither=no

ok 36 # skip unmet prerequisites causes test to be skipped (missing DONTHAVEIT of DONTHAVEIT,HAVEIT)

checking prerequisite: LAZY_TRUE
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0023-crlf-am/.git/

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&true
)
ok 109 - non-existent file at top-level ignored with -q

expecting success: 
			expect '' &&
			test_check_ignore 'one'
		
prerequisite LAZY_TRUE ok
expecting success: 
	havetrue=yes

ok 37 - test runs if lazy prereq is satisfied

skipping test: missing lazy prereqs skip tests 
	donthavetrue=no

ok 38 # skip missing lazy prereqs skip tests (missing !LAZY_TRUE)

expecting success: 

	git config core.autocrlf true &&
	echo foo >bar &&
	git add bar &&
	test_tick &&
	git commit -m initial


checking prerequisite: LAZY_FALSE

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&false
)
prerequisite LAZY_FALSE not satisfied
expecting success: 
	nothavefalse=yes

ok 110 - non-existent file at top-level ignored with --quiet

expecting success: 
				expect '.gitignore:1:one	one' &&
				test_check_ignore 'one'
			
ok 39 - negative lazy prereqs checked

warning: LF will be replaced by CRLF in bar.
The file will have its original line endings in your working directory.
skipping test: missing negative lazy prereqs will skip 
	havefalse=no

ok 40 # skip missing negative lazy prereqs will skip (missing LAZY_FALSE)

expecting success: 
	test_when_finished clean=yes

ok 41 - tests clean up after themselves

expecting success: 
	test_must_fail run_sub_test_lib_test 		failing-cleanup 'Failing tests with cleanup commands' <<-\EOF &&
	test_expect_success 'tests clean up even after a failure' '
		touch clean-after-failure &&
		test_when_finished rm clean-after-failure &&
		(exit 1)
	'
	test_expect_success 'failure to clean up causes the test to fail' '
		test_when_finished "(exit 2)"
	'
	test_done
	EOF
	check_sub_test_lib_test failing-cleanup <<-\EOF
	> not ok 1 - tests clean up even after a failure
	> #	Z
	> #	touch clean-after-failure &&
	> #	test_when_finished rm clean-after-failure &&
	> #	(exit 1)
	> #	Z
	> not ok 2 - failure to clean up causes the test to fail
	> #	Z
	> #	test_when_finished "(exit 2)"
	> #	Z
	> # failed 2 among 2 test(s)
	> 1..2
	EOF

warning: LF will be replaced by CRLF in bar.
The file will have its original line endings in your working directory.
[master (root-commit) 1adb513] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bar
ok 1 - setup

expecting success: 

	git am -3 <patchfile &&
	git diff-files --name-status --exit-code


ok 111 - non-existent file at top-level ignored with -v

expecting success: 
				expect '.gitignore:1:one	one' &&
				test_check_ignore 'one'
			
ok 4 - filter shell-escaped filenames

expecting success: 
	git config filter.required.smudge ./rot13.sh &&
	git config filter.required.clean ./rot13.sh &&
	git config filter.required.required true &&

	echo "*.r filter=required" >.gitattributes &&

	cat test.o >test.r &&
	git add test.r &&

	rm -f test.r &&
	git checkout -- test.r &&
	cmp test.o test.r &&

	./rot13.sh <test.o >expected &&
	git cat-file blob :test.r >actual &&
	cmp expected actual

ok 112 - non-existent file at top-level ignored with -v -n

expecting success: 
				expect '.gitignore:1:one	one' &&
				test_check_ignore 'one'
			
ok 113 - non-existent file at top-level ignored with -v --non-matching

expecting success: 
				expect '.gitignore:1:one	one' &&
				test_check_ignore 'one'
			
ok 114 - non-existent file at top-level ignored with --verbose

expecting success: 
				expect '.gitignore:1:one	one' &&
				test_check_ignore 'one'
			
ok 5 - required filter should filter data

expecting success: 
	git config filter.failsmudge.smudge false &&
	git config filter.failsmudge.clean cat &&
	git config filter.failsmudge.required true &&

	echo "*.fs filter=failsmudge" >.gitattributes &&

	echo test >test.fs &&
	git add test.fs &&
	rm -f test.fs &&
	test_must_fail git checkout -- test.fs

ok 42 - tests clean up even on failures

expecting success: 
	test_must_fail git update-index should-be-empty

ok 115 - non-existent file at top-level ignored with --verbose -n

expecting success: 
				expect '.gitignore:1:one	one' &&
				test_check_ignore 'one'
			
error: should-be-empty: cannot add to the index - missing --add option?
fatal: Unable to process path should-be-empty
ok 43 - git update-index without --add should fail adding

expecting success: 
	git update-index --add should-be-empty

ok 44 - git update-index with --add should succeed

expecting success: 
	tree=$(git write-tree)

ok 116 - non-existent file at top-level ignored with --verbose --non-matching

ok 45 - writing tree out with git write-tree

expecting success: 
	test "$tree" = 7bb943559a305bdd6bdee2cef6e5df2413c3d30a
    
ok 46 - validate object ID of a known tree

expecting success: 
	rm -f should-be-empty full-of-directories &&
	test_must_fail git update-index should-be-empty

expecting success: 
		expect "$expect" &&
		eval "$code"
	
error: external filter false failed 1
error: external filter false failed
fatal: test.fs: smudge filter failsmudge failed
ok 6 - required filter smudge failure

expecting success: 
	git config filter.failclean.smudge cat &&
	git config filter.failclean.clean false &&
	git config filter.failclean.required true &&

	echo "*.fc filter=failclean" >.gitattributes &&

	echo test >test.fc &&
	test_must_fail git add test.fc

error: should-be-empty: does not exist and --remove not passed
fatal: Unable to process path should-be-empty
ok 47 - git update-index without --remove should fail removing

expecting success: 
	git update-index --remove should-be-empty

ok 48 - git update-index with --remove should be able to remove

expecting success: 
	tree=$(git write-tree)

ok 117 - non-existent file at top-level ignored with --no-index

expecting success: 
			expect '' &&
			test_check_ignore 'one'
		
ok 49 - git write-tree should be able to write an empty tree

expecting success: 
	test "$tree" = 4b825dc642cb6eb9a060e54bf8d69288fbee4904

ok 50 - validate object ID of a known tree

expecting success: 
	mkdir path2 path3 path3/subp3 &&
	paths="path0 path2/file2 path3/file3 path3/subp3/file3" &&
	(
		for p in $paths
		do
			echo "hello $p" >$p || exit 1
			test_ln_s_add "hello $p" ${p}sym || exit 1
		done
	) &&
	find path* ! -type d -print | xargs git update-index --add

error: external filter false failed 1
error: external filter false failed
fatal: test.fc: clean filter 'failclean' failed
checking prerequisite: SYMLINKS

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	# test whether the filesystem supports symbolic links
	ln -s x y && test -h y

)
ok 7 - required filter clean failure

expecting success: 
	git config filter.devnull.clean "cat >/dev/null" &&
	git config filter.devnull.required true &&
	for i in $(test_seq 1 30); do printf "%1048576d" 1; done >30MB &&
	echo "30MB filter=devnull" >.gitattributes &&
	GIT_MMAP_LIMIT=1m GIT_ALLOC_LIMIT=1m git add 30MB

ok 118 - non-existent file at top-level ignored with --no-index -q

expecting success: 
			expect '' &&
			test_check_ignore 'one'
		
prerequisite SYMLINKS ok
Applying: test1
ok 119 - non-existent file at top-level ignored with --no-index --quiet

expecting success: 
				expect '.gitignore:1:one	one' &&
				test_check_ignore 'one'
			
ok 120 - non-existent file at top-level ignored with --no-index -v

expecting success: 
				expect '.gitignore:1:one	one' &&
				test_check_ignore 'one'
			
ok 121 - non-existent file at top-level ignored with --no-index -v -n

expecting success: 
				expect '.gitignore:1:one	one' &&
				test_check_ignore 'one'
			
ok 51 - adding various types of objects with git update-index --add

expecting success: 
	git ls-files --stage >current

ok 52 - showing stage with git ls-files --stage

expecting success: 
	cat >expected <<-\EOF &&
	100644 f87290f8eb2cbbea7857214459a0739927eab154 0	path0
	120000 15a98433ae33114b085f3eb3bb03b832b3180a01 0	path0sym
	100644 3feff949ed00a62d9f7af97c15cd8a30595e7ac7 0	path2/file2
	120000 d8ce161addc5173867a3c3c730924388daedbc38 0	path2/file2sym
	100644 0aa34cae68d0878578ad119c86ca2b5ed5b28376 0	path3/file3
	120000 8599103969b43aff7e430efea79ca4636466794f 0	path3/file3sym
	100644 00fb5908cb97c2564a9783c0c64087333b3b464f 0	path3/subp3/file3
	120000 6649a1ebe9e9f1c553b66f5a6e74136a07ccc57c 0	path3/subp3/file3sym
	EOF
	test_cmp expected current

ok 2 - am

ok 122 - non-existent file at top-level ignored with --no-index -v --non-matching

expecting success: 
				expect '.gitignore:1:one	one' &&
				test_check_ignore 'one'
			
ok 53 - validate git ls-files output for a known tree

expecting success: 
	tree=$(git write-tree)

# passed all 2 test(s)
1..2
ok 54 - writing tree out with git write-tree

expecting success: 
	test "$tree" = 087704a96baf1c2d1c869a8b084481e121c88b5b

ok 55 - validate object ID for a known tree

expecting success: 
    git ls-tree $tree >current

ok 123 - non-existent file at top-level ignored with --no-index --verbose

expecting success: 
				expect '.gitignore:1:one	one' &&
				test_check_ignore 'one'
			
*** t0024-crlf-archive.sh ***
ok 56 - showing tree with git ls-tree

expecting success: 
	cat >expected <<-\EOF &&
	100644 blob f87290f8eb2cbbea7857214459a0739927eab154	path0
	120000 blob 15a98433ae33114b085f3eb3bb03b832b3180a01	path0sym
	040000 tree 58a09c23e2ca152193f2786e06986b7b6712bdbe	path2
	040000 tree 21ae8269cacbe57ae09138dcc3a2887f904d02b3	path3
	EOF
	test_cmp expected current

ok 57 - git ls-tree output for a known tree

expecting success: 
	git ls-tree -r $tree >current

ok 124 - non-existent file at top-level ignored with --no-index --verbose -n

expecting success: 
				expect '.gitignore:1:one	one' &&
				test_check_ignore 'one'
			
ok 58 - showing tree with git ls-tree -r

expecting success: 
	cat >expected <<-\EOF &&
	100644 blob f87290f8eb2cbbea7857214459a0739927eab154	path0
	120000 blob 15a98433ae33114b085f3eb3bb03b832b3180a01	path0sym
	100644 blob 3feff949ed00a62d9f7af97c15cd8a30595e7ac7	path2/file2
	120000 blob d8ce161addc5173867a3c3c730924388daedbc38	path2/file2sym
	100644 blob 0aa34cae68d0878578ad119c86ca2b5ed5b28376	path3/file3
	120000 blob 8599103969b43aff7e430efea79ca4636466794f	path3/file3sym
	100644 blob 00fb5908cb97c2564a9783c0c64087333b3b464f	path3/subp3/file3
	120000 blob 6649a1ebe9e9f1c553b66f5a6e74136a07ccc57c	path3/subp3/file3sym
	EOF
	test_cmp expected current

ok 59 - git ls-tree -r output for a known tree

expecting success: 
	git ls-tree -r -t $tree >current

ok 60 - showing tree with git ls-tree -r -t

expecting success: 
	cat >expected <<-\EOF &&
	100644 blob f87290f8eb2cbbea7857214459a0739927eab154	path0
	120000 blob 15a98433ae33114b085f3eb3bb03b832b3180a01	path0sym
	040000 tree 58a09c23e2ca152193f2786e06986b7b6712bdbe	path2
	100644 blob 3feff949ed00a62d9f7af97c15cd8a30595e7ac7	path2/file2
	120000 blob d8ce161addc5173867a3c3c730924388daedbc38	path2/file2sym
	040000 tree 21ae8269cacbe57ae09138dcc3a2887f904d02b3	path3
	100644 blob 0aa34cae68d0878578ad119c86ca2b5ed5b28376	path3/file3
	120000 blob 8599103969b43aff7e430efea79ca4636466794f	path3/file3sym
	040000 tree 3c5e5399f3a333eddecce7a9b9465b63f65f51e2	path3/subp3
	100644 blob 00fb5908cb97c2564a9783c0c64087333b3b464f	path3/subp3/file3
	120000 blob 6649a1ebe9e9f1c553b66f5a6e74136a07ccc57c	path3/subp3/file3sym
	EOF
	test_cmp expected current

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0024-crlf-archive/.git/
ok 61 - git ls-tree -r output for a known tree

expecting success: 
	ptree=$(git write-tree --prefix=path3)

ok 125 - non-existent file at top-level ignored with --no-index --verbose --non-matching

expecting success: 

	git config core.autocrlf true &&

	printf "CRLF line ending\r\nAnd another\r\n" > sample &&
	git add sample &&

	test_tick &&
	git commit -m Initial


ok 62 - writing partial tree out with git write-tree --prefix

expecting success: 
	test "$ptree" = 21ae8269cacbe57ae09138dcc3a2887f904d02b3

ok 63 - validate object ID for a known tree

expecting success: 
	ptree=$(git write-tree --prefix=path3/subp3)

expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 64 - writing partial tree out with git write-tree --prefix

expecting success: 
	test "$ptree" = 3c5e5399f3a333eddecce7a9b9465b63f65f51e2

ok 65 - validate object ID for a known tree

expecting success: 
	rm -f .git/index &&
	cat >badobjects <<-\EOF &&
	100644 blob 1000000000000000000000000000000000000000	dir/file1
	100644 blob 2000000000000000000000000000000000000000	dir/file2
	100644 blob 3000000000000000000000000000000000000000	dir/file3
	100644 blob 4000000000000000000000000000000000000000	dir/file4
	100644 blob 5000000000000000000000000000000000000000	dir/file5
	EOF
	git update-index --index-info <badobjects

ok 126 - existing untracked file at top-level not ignored

expecting success: 
			expect '' &&
			test_check_ignore 'not-ignored' 1
		
[master (root-commit) 4f7f1aa] Initial
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+)
 create mode 100644 sample
ok 66 - put invalid objects into the index

ok 1 - setup

expecting success: 
	test_must_fail git write-tree

expecting success: 

	git archive --format=tar HEAD |
	( mkdir untarred && cd untarred && "$TAR" -xf - ) &&

	test_cmp sample untarred/sample


ok 127 - existing untracked file at top-level not ignored with -q

expecting success: 
			expect '' &&
			test_check_ignore 'not-ignored' 1
		
error: invalid object 100644 1000000000000000000000000000000000000000 for 'dir/file1'
fatal: git-write-tree: error building trees
ok 67 - writing this tree without --missing-ok

expecting success: 
	git write-tree --missing-ok

ok 2 - tar archive

851a367613bb6e1f0b2b518323eafed530b5b4c4
ok 68 - writing this tree with --missing-ok

expecting success: 
	rm -f .git/index &&
	git read-tree $tree &&
	test -f .git/index &&
	newtree=$(git write-tree) &&
	test "$newtree" = "$tree"

ok 128 - existing untracked file at top-level not ignored with --quiet

checking prerequisite: UNZIP

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	"$GIT_UNZIP" -v
	test $? -ne 127

)
expecting success: 
				expect '' &&
				test_check_ignore 'not-ignored' 1
			
UnZip 6.00 of 20 April 2009, by Debian. Original by Info-ZIP.

Latest sources and executables are at ftp://ftp.info-zip.org/pub/infozip/ ;
see ftp://ftp.info-zip.org/pub/infozip/UnZip.html for other sites.

Compiled with gcc 4.9.2 for Unix (Linux ELF).

UnZip special compilation options:
        ACORN_FTYPE_NFS
        COPYRIGHT_CLEAN (PKZIP 0.9x unreducing method not supported)
        SET_DIR_ATTRIB
        SYMLINKS (symbolic links supported, if RTL and file system permit)
        TIMESTAMP
        UNIXBACKUP
        USE_EF_UT_TIME
        USE_UNSHRINK (PKZIP/Zip 1.x unshrinking method supported)
        USE_DEFLATE64 (PKZIP 4.x Deflate64(tm) supported)
        UNICODE_SUPPORT [wide-chars, char coding: other] (handle UTF-8 paths)
        LARGE_FILE_SUPPORT (large files over 2 GiB supported)
        ZIP64_SUPPORT (archives using Zip64 for large files supported)
        USE_BZIP2 (PKZIP 4.6+, using bzip2 lib version 1.0.6, 6-Sept-2010)
        VMS_TEXT_CONV
        WILD_STOP_AT_DIR
        [decryption, version 2.11 of 05 Jan 2007]

UnZip and ZipInfo environment options:
           UNZIP:  [none]
        UNZIPOPT:  [none]
         ZIPINFO:  [none]
      ZIPINFOOPT:  [none]
prerequisite UNZIP ok
expecting success: 

	git archive --format=zip HEAD >test.zip &&

	( mkdir unzipped && cd unzipped && "$GIT_UNZIP" ../test.zip ) &&

	test_cmp sample unzipped/sample


ok 69 - git read-tree followed by write-tree should be idempotent

expecting success: 
	cat >expected <<\EOF &&
:100644 100644 f87290f8eb2cbbea7857214459a0739927eab154 0000000000000000000000000000000000000000 M	path0
:120000 120000 15a98433ae33114b085f3eb3bb03b832b3180a01 0000000000000000000000000000000000000000 M	path0sym
:100644 100644 3feff949ed00a62d9f7af97c15cd8a30595e7ac7 0000000000000000000000000000000000000000 M	path2/file2
:120000 120000 d8ce161addc5173867a3c3c730924388daedbc38 0000000000000000000000000000000000000000 M	path2/file2sym
:100644 100644 0aa34cae68d0878578ad119c86ca2b5ed5b28376 0000000000000000000000000000000000000000 M	path3/file3
:120000 120000 8599103969b43aff7e430efea79ca4636466794f 0000000000000000000000000000000000000000 M	path3/file3sym
:100644 100644 00fb5908cb97c2564a9783c0c64087333b3b464f 0000000000000000000000000000000000000000 M	path3/subp3/file3
:120000 120000 6649a1ebe9e9f1c553b66f5a6e74136a07ccc57c 0000000000000000000000000000000000000000 M	path3/subp3/file3sym
EOF
	git diff-files >current &&
	test_cmp current expected

ok 129 - existing untracked file at top-level not ignored with -v

expecting success: 
				expect '::	not-ignored' &&
				test_check_ignore 'not-ignored' 1
			
ok 70 - validate git diff-files output for a know cache/work tree state

expecting success: 
	git update-index --refresh

Archive:  ../test.zip
4f7f1aaec1ee996d8f5e13c2cfbd43a378578e1f
 extracting: sample                  
ok 130 - existing untracked file at top-level not ignored with -v -n

expecting success: 
				expect '::	not-ignored' &&
				test_check_ignore 'not-ignored' 1
			
ok 3 - zip archive
ok 71 - git update-index --refresh should succeed


expecting success: 
	git diff-files >current &&
	cmp -s current /dev/null

ok 72 - no diff after checkout and git update-index --refresh

expecting success: 
	commit0=$(echo NO | git commit-tree $P) &&
	tree=$(git show --pretty=raw $commit0 |
		 sed -n -e "s/^tree //p" -e "/^author /q") &&
	test "z$tree" = "z$P"

# passed all 3 test(s)
1..3
ok 131 - existing untracked file at top-level not ignored with -v --non-matching

expecting success: 
				expect '' &&
				test_check_ignore 'not-ignored' 1
			
ok 73 - git commit-tree records the correct tree in a commit

expecting success: 
	commit1=$(echo NO | git commit-tree $P -p $commit0) &&
	parent=$(git show --pretty=raw $commit1 |
		sed -n -e "s/^parent //p" -e "/^author /q") &&
	test "z$commit0" = "z$parent"

*** t0025-crlf-auto.sh ***
ok 132 - existing untracked file at top-level not ignored with --verbose

expecting success: 
				expect '::	not-ignored' &&
				test_check_ignore 'not-ignored' 1
			
ok 74 - git commit-tree records the correct parent in a commit

expecting success: 
	commit2=$(echo NO | git commit-tree $P -p $commit0 -p $commit0) &&
	     parent=$(git show --pretty=raw $commit2 |
		sed -n -e "s/^parent //p" -e "/^author /q" |
		sort -u) &&
	test "z$commit0" = "z$parent" &&
	numparent=$(git show --pretty=raw $commit2 |
		sed -n -e "s/^parent //p" -e "/^author /q" |
		wc -l) &&
	test $numparent = 1

ok 133 - existing untracked file at top-level not ignored with --verbose -n

expecting success: 
				expect '::	not-ignored' &&
				test_check_ignore 'not-ignored' 1
			
error: duplicate parent 2c21fdb504a08c3c57488b3c760364aeadbb5f0d ignored
ok 134 - existing untracked file at top-level not ignored with --verbose --non-matching

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0025-crlf-auto/.git/
expecting success: 

	git config core.autocrlf false &&

	for w in Hello world how are you; do echo $w; done >LFonly &&
	for w in I am very very fine thank you; do echo ${w}Q; done | q_to_cr >CRLFonly &&
	for w in Oh here is a QNUL byte how alarming; do echo ${w}; done | q_to_nul >LFwithNUL &&
	git add . &&

	git commit -m initial &&

	LFonly=$(git rev-parse HEAD:LFonly) &&
	CRLFonly=$(git rev-parse HEAD:CRLFonly) &&
	LFwithNUL=$(git rev-parse HEAD:LFwithNUL) &&

	echo happy.

expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 75 - git commit-tree omits duplicated parent in a commit

expecting success: 
	mv path0 tmp &&
	mv path2 path0 &&
	mv tmp path2 &&
	git update-index --add --replace path2 path0/file2 &&
	numpath0=$(git ls-files path0 | wc -l) &&
	test $numpath0 = 1

ok 135 - existing untracked file at top-level not ignored with --no-index

expecting success: 
			expect '' &&
			test_check_ignore 'not-ignored' 1
		
[master (root-commit) 1e9beb5] initial
 Author: A U Thor <author@example.com>
 3 files changed, 12 insertions(+)
 create mode 100644 CRLFonly
 create mode 100644 LFonly
 create mode 100644 LFwithNUL
ok 76 - update-index D/F conflict

expecting success: 

	a=a && # 1
	a=$a$a$a$a$a$a$a$a$a$a$a$a$a$a$a$a && # 16
	a=$a$a$a$a$a$a$a$a$a$a$a$a$a$a$a$a && # 256
	a=$a$a$a$a$a$a$a$a$a$a$a$a$a$a$a$a && # 4096
	a=${a}q &&

	>path4 &&
	git update-index --add path4 &&
	(
		git ls-files -s path4 |
		sed -e "s/	.*/	/" |
		tr -d "\012"
		echo "$a"
	) | git update-index --index-info &&
	len=$(git ls-files "a*" | wc -c) &&
	test $len = 4098

ok 136 - existing untracked file at top-level not ignored with --no-index -q

expecting success: 
			expect '' &&
			test_check_ignore 'not-ignored' 1
		
ok 137 - existing untracked file at top-level not ignored with --no-index --quiet

expecting success: 
				expect '' &&
				test_check_ignore 'not-ignored' 1
			
happy.
ok 1 - setup

expecting success: 

	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
	git read-tree --reset -u HEAD &&

	! has_cr LFonly &&
	has_cr CRLFonly &&
	LFonlydiff=$(git diff LFonly) &&
	CRLFonlydiff=$(git diff CRLFonly) &&
	LFwithNULdiff=$(git diff LFwithNUL) &&
	test -z "$LFonlydiff" -a -z "$CRLFonlydiff" -a -z "$LFwithNULdiff"

ok 77 - very long name in the index handled sanely

# passed all 77 test(s)
1..77
ok 138 - existing untracked file at top-level not ignored with --no-index -v

expecting success: 
				expect '::	not-ignored' &&
				test_check_ignore 'not-ignored' 1
			
ok 139 - existing untracked file at top-level not ignored with --no-index -v -n

expecting success: 
				expect '::	not-ignored' &&
				test_check_ignore 'not-ignored' 1
			
ok 2 - default settings cause no changes

expecting success: 

	# Backwards compatibility check
	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
	echo "CRLFonly crlf" > .gitattributes &&
	git read-tree --reset -u HEAD &&

	# Note, "normalized" means that git will normalize it if added
	has_cr CRLFonly &&
	CRLFonlydiff=$(git diff CRLFonly) &&
	test -n "$CRLFonlydiff"

ok 140 - existing untracked file at top-level not ignored with --no-index -v --non-matching

expecting success: 
				expect '' &&
				test_check_ignore 'not-ignored' 1
			
warning: CRLF will be replaced by LF in CRLFonly.
The file will have its original line endings in your working directory.
ok 3 - crlf=true causes a CRLF file to be normalized

expecting success: 

	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
	echo "CRLFonly text" > .gitattributes &&
	git read-tree --reset -u HEAD &&

	# Note, "normalized" means that git will normalize it if added
	has_cr CRLFonly &&
	CRLFonlydiff=$(git diff CRLFonly) &&
	test -n "$CRLFonlydiff"

ok 141 - existing untracked file at top-level not ignored with --no-index --verbose

expecting success: 
				expect '::	not-ignored' &&
				test_check_ignore 'not-ignored' 1
			
warning: CRLF will be replaced by LF in CRLFonly.
The file will have its original line endings in your working directory.
ok 4 - text=true causes a CRLF file to be normalized

expecting success: 

	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
	git config core.autocrlf false &&
	echo "LFonly eol=crlf" > .gitattributes &&
	git read-tree --reset -u HEAD &&

	has_cr LFonly &&
	LFonlydiff=$(git diff LFonly) &&
	test -z "$LFonlydiff"

ok 142 - existing untracked file at top-level not ignored with --no-index --verbose -n

expecting success: 
				expect '::	not-ignored' &&
				test_check_ignore 'not-ignored' 1
			
*** t0026-eol-config.sh ***
ok 143 - existing untracked file at top-level not ignored with --no-index --verbose --non-matching

expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 5 - eol=crlf gives a normalized file CRLFs with autocrlf=false

expecting success: 

	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
	git config core.autocrlf input &&
	echo "LFonly eol=crlf" > .gitattributes &&
	git read-tree --reset -u HEAD &&

	has_cr LFonly &&
	LFonlydiff=$(git diff LFonly) &&
	test -z "$LFonlydiff"

ok 144 - existing tracked file at top-level not ignored

expecting success: 
			expect '' &&
			test_check_ignore 'ignored-but-in-index' 1
		
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0026-eol-config/.git/
ok 145 - existing tracked file at top-level not ignored with -q

expecting success: 
			expect '' &&
			test_check_ignore 'ignored-but-in-index' 1
		
ok 6 - eol=crlf gives a normalized file CRLFs with autocrlf=input

expecting success: 

	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
	git config core.autocrlf true &&
	echo "LFonly eol=lf" > .gitattributes &&
	git read-tree --reset -u HEAD &&

	! has_cr LFonly &&
	LFonlydiff=$(git diff LFonly) &&
	test -z "$LFonlydiff"

expecting success: 

	git config core.autocrlf false &&

	echo "one text" > .gitattributes &&

	for w in Hello world how are you; do echo $w; done >one &&
	for w in I am very very fine thank you; do echo $w; done >two &&
	git add . &&

	git commit -m initial &&

	one=$(git rev-parse HEAD:one) &&
	two=$(git rev-parse HEAD:two) &&

	echo happy.

ok 146 - existing tracked file at top-level not ignored with --quiet

expecting success: 
				expect '' &&
				test_check_ignore 'ignored-but-in-index' 1
			
ok 147 - existing tracked file at top-level not ignored with -v

expecting success: 
				expect '::	ignored-but-in-index' &&
				test_check_ignore 'ignored-but-in-index' 1
			
ok 7 - eol=lf gives a normalized file LFs with autocrlf=true

expecting success: 

	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
	git config core.autocrlf true &&
	git read-tree --reset -u HEAD &&

	has_cr LFonly &&
	has_cr CRLFonly &&
	LFonlydiff=$(git diff LFonly) &&
	CRLFonlydiff=$(git diff CRLFonly) &&
	LFwithNULdiff=$(git diff LFwithNUL) &&
	test -z "$LFonlydiff" -a -z "$CRLFonlydiff" -a -z "$LFwithNULdiff"

[master (root-commit) 8e726fa] initial
 Author: A U Thor <author@example.com>
 3 files changed, 13 insertions(+)
 create mode 100644 .gitattributes
 create mode 100644 one
 create mode 100644 two
happy.
ok 1 - setup

expecting success: 

	rm -f .gitattributes tmp one two &&
	git config core.eol lf &&
	git read-tree --reset -u HEAD &&

	! has_cr one &&
	! has_cr two &&
	onediff=$(git diff one) &&
	twodiff=$(git diff two) &&
	test -z "$onediff" && test -z "$twodiff"

ok 148 - existing tracked file at top-level not ignored with -v -n

expecting success: 
				expect '::	ignored-but-in-index' &&
				test_check_ignore 'ignored-but-in-index' 1
			
ok 149 - existing tracked file at top-level not ignored with -v --non-matching

expecting success: 
				expect '' &&
				test_check_ignore 'ignored-but-in-index' 1
			
ok 150 - existing tracked file at top-level not ignored with --verbose

expecting success: 
				expect '::	ignored-but-in-index' &&
				test_check_ignore 'ignored-but-in-index' 1
			
ok 8 - autocrlf=true does not normalize CRLF files

expecting success: 

	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
	git config core.autocrlf true &&
	echo "* text=auto" > .gitattributes &&
	git read-tree --reset -u HEAD &&

	has_cr LFonly &&
	has_cr CRLFonly &&
	LFonlydiff=$(git diff LFonly) &&
	CRLFonlydiff=$(git diff CRLFonly) &&
	LFwithNULdiff=$(git diff LFwithNUL) &&
	test -z "$LFonlydiff" -a -n "$CRLFonlydiff" -a -z "$LFwithNULdiff"

ok 2 - eol=lf puts LFs in normalized file

expecting success: 

	rm -f .gitattributes tmp one two &&
	git config core.eol crlf &&
	git read-tree --reset -u HEAD &&

	has_cr one &&
	! has_cr two &&
	onediff=$(git diff one) &&
	twodiff=$(git diff two) &&
	test -z "$onediff" && test -z "$twodiff"

ok 151 - existing tracked file at top-level not ignored with --verbose -n

expecting success: 
				expect '::	ignored-but-in-index' &&
				test_check_ignore 'ignored-but-in-index' 1
			
ok 152 - existing tracked file at top-level not ignored with --verbose --non-matching

expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 8 - filtering large input to small output should use little memory

expecting success: 
	test-genrandom foo $((128 * 1024 + 1)) >big &&
	echo "big filter=epipe" >.gitattributes &&
	git config filter.epipe.clean "echo xyzzy" &&
	git add big &&
	git cat-file blob :big >actual &&
	echo xyzzy >expect &&
	test_cmp expect actual

ok 9 - text=auto, autocrlf=true _does_ normalize CRLF files

expecting success: 

	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
	git config core.autocrlf true &&
	echo "* text=auto" > .gitattributes &&
	git read-tree --reset -u HEAD &&

	! has_cr LFwithNUL &&
	LFwithNULdiff=$(git diff LFwithNUL) &&
	test -z "$LFwithNULdiff"

ok 3 - eol=crlf puts CRLFs in normalized file
ok 153 - existing tracked file at top-level shown as ignored with --no-index


expecting success: 

	rm -f .gitattributes tmp one two &&
	git config core.eol lf &&
	git config core.autocrlf true &&
	git read-tree --reset -u HEAD &&

	has_cr one &&
	has_cr two &&
	onediff=$(git diff one) &&
	twodiff=$(git diff two) &&
	test -z "$onediff" && test -z "$twodiff"

expecting success: 
			expect '' &&
			test_check_ignore 'ignored-but-in-index'
		
ok 154 - existing tracked file at top-level shown as ignored with --no-index -q

expecting success: 
			expect '' &&
			test_check_ignore 'ignored-but-in-index'
		
ok 10 - text=auto, autocrlf=true does not normalize binary files

expecting success: 

	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
	echo "LFwithNUL eol=crlf" > .gitattributes &&
	git read-tree --reset -u HEAD &&

	has_cr LFwithNUL &&
	LFwithNULdiff=$(git diff LFwithNUL) &&
	test -z "$LFwithNULdiff"

ok 9 - filter that does not read is fine
ok 155 - existing tracked file at top-level shown as ignored with --no-index --quiet


expecting success: 
				expect '.gitignore:2:ignored-*	ignored-but-in-index' &&
				test_check_ignore 'ignored-but-in-index'
			
checking prerequisite: EXPENSIVE

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	test -n "$GIT_TEST_LONG"

)
prerequisite EXPENSIVE not satisfied
skipping test: filter large file 
	git config filter.largefile.smudge cat &&
	git config filter.largefile.clean cat &&
	for i in $(test_seq 1 2048); do printf "%1048576d" 1; done >2GB &&
	echo "2GB filter=largefile" >.gitattributes &&
	git add 2GB 2>err &&
	! test -s err &&
	rm -f 2GB &&
	git checkout -- 2GB 2>err &&
	! test -s err

ok 10 # skip filter large file (missing EXPENSIVE)

expecting success: 
	git config filter.in-repo-header.clean  "echo cleaned && cat" &&
	git config filter.in-repo-header.smudge "sed 1d" &&

	echo "empty-in-worktree    filter=in-repo-header" >>.gitattributes &&
	>empty-in-worktree &&

	echo cleaned >expected &&
	git add empty-in-worktree &&
	git show :empty-in-worktree >actual &&
	test_cmp expected actual

ok 4 - autocrlf=true overrides eol=lf

expecting success: 

	rm -f .gitattributes tmp one two &&
	git config --unset-all core.eol &&
	git config core.autocrlf true &&
	git read-tree --reset -u HEAD &&

	has_cr one &&
	has_cr two &&
	onediff=$(git diff one) &&
	twodiff=$(git diff two) &&
	test -z "$onediff" && test -z "$twodiff"

ok 11 - eol=crlf _does_ normalize binary files

ok 156 - existing tracked file at top-level shown as ignored with --no-index -v

expecting success: 
				expect '.gitignore:2:ignored-*	ignored-but-in-index' &&
				test_check_ignore 'ignored-but-in-index'
			
# passed all 11 test(s)
1..11
ok 157 - existing tracked file at top-level shown as ignored with --no-index -v -n

expecting success: 
				expect '.gitignore:2:ignored-*	ignored-but-in-index' &&
				test_check_ignore 'ignored-but-in-index'
			
*** t0027-auto-crlf.sh ***
ok 11 - filter: clean empty file

expecting success: 
	git config filter.empty-in-repo.clean "cat >/dev/null" &&
	git config filter.empty-in-repo.smudge "echo smudged && cat" &&

	echo "empty-in-repo filter=empty-in-repo" >>.gitattributes &&
	echo dead data walking >empty-in-repo &&
	git add empty-in-repo &&

	echo smudged >expected &&
	git checkout-index --prefix=filtered- empty-in-repo &&
	test_cmp expected filtered-empty-in-repo

ok 158 - existing tracked file at top-level shown as ignored with --no-index -v --non-matching

expecting success: 
				expect '.gitignore:2:ignored-*	ignored-but-in-index' &&
				test_check_ignore 'ignored-but-in-index'
			
ok 5 - autocrlf=true overrides unset eol

skipping test: eol native is crlf 

	rm -rf native_eol && mkdir native_eol &&
	(
		cd native_eol &&
		printf "*.txt text\n" >.gitattributes &&
		printf "one\r\ntwo\r\nthree\r\n" >filedos.txt &&
		printf "one\ntwo\nthree\n" >fileunix.txt &&
		git init &&
		git config core.autocrlf false &&
		git config core.eol native &&
		git add filedos.txt fileunix.txt &&
		git commit -m "first" &&
		rm file*.txt &&
		git reset --hard HEAD &&
		has_cr filedos.txt &&
		has_cr fileunix.txt
	)

ok 6 # skip eol native is crlf (missing NATIVE_CRLF)

ok 159 - existing tracked file at top-level shown as ignored with --no-index --verbose

expecting success: 
				expect '.gitignore:2:ignored-*	ignored-but-in-index' &&
				test_check_ignore 'ignored-but-in-index'
			
# passed all 6 test(s)
1..6
ok 160 - existing tracked file at top-level shown as ignored with --no-index --verbose -n

expecting success: 
				expect '.gitignore:2:ignored-*	ignored-but-in-index' &&
				test_check_ignore 'ignored-but-in-index'
			
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0027-auto-crlf/.git/
*** t0030-stripspace.sh ***
checking prerequisite: EXPENSIVE

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	test -n "$GIT_TEST_LONG"

)
ok 12 - filter: smudge empty file

prerequisite EXPENSIVE not satisfied
ok 161 - existing tracked file at top-level shown as ignored with --no-index --verbose --non-matching

# passed all 12 test(s)
1..12
1..0 # SKIP EXPENSIVE not set
expecting success: 
		expect "$expect" &&
		eval "$code"
	
*** t0040-parse-options.sh ***
ok 162 - existing untracked file at top-level ignored

expecting success: 
			expect '' &&
			test_check_ignore 'ignored-and-untracked'
		
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0030-stripspace/.git/
*** t0050-filesystem.sh ***
expecting success: 
    echo "$ttt" >expect &&
    git stripspace <expect >actual &&
    test_cmp expect actual &&

    echo "$ttt$ttt" >expect &&
    git stripspace <expect >actual &&
    test_cmp expect actual &&

    echo "$ttt$ttt$ttt" >expect &&
    git stripspace <expect >actual &&
    test_cmp expect actual &&

    echo "$ttt$ttt$ttt$ttt" >expect &&
    git stripspace <expect >actual &&
    test_cmp expect actual

ok 163 - existing untracked file at top-level ignored with -q

expecting success: 
			expect '' &&
			test_check_ignore 'ignored-and-untracked'
		
ok 164 - existing untracked file at top-level ignored with --quiet

expecting success: 
				expect '.gitignore:2:ignored-*	ignored-and-untracked' &&
				test_check_ignore 'ignored-and-untracked'
			
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0040-parse-options/.git/
ok 1 - long lines without spaces should be unchanged

expecting success: 
    echo "$sss$ttt" >expect &&
    git stripspace <expect >actual &&
    test_cmp expect actual &&

    echo "$sss$sss$ttt" >expect &&
    git stripspace <expect >actual &&
    test_cmp expect actual &&

    echo "$sss$sss$sss$ttt" >expect &&
    git stripspace <expect >actual &&
    test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0050-filesystem/.git/
expecting success: 
	test_must_fail test-parse-options -h > output 2> output.err &&
	test_must_be_empty output.err &&
	test_i18ncmp expect output

ok 165 - existing untracked file at top-level ignored with -v

expecting success: 
				expect '.gitignore:2:ignored-*	ignored-and-untracked' &&
				test_check_ignore 'ignored-and-untracked'
			
checking prerequisite: CASE_INSENSITIVE_FS

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	echo good >CamelCase &&
	echo bad >camelcase &&
	test "$(cat CamelCase)" != good

)
ok 1 - test help

prerequisite CASE_INSENSITIVE_FS not satisfied
checking prerequisite: UTF8_NFD_TO_NFC

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	# check whether FS converts nfd unicode to nfc
	auml=$(printf "\303\244")
	aumlcdiar=$(printf "\141\314\210")
	>"$auml" &&
	case "$(echo *)" in
	"$aumlcdiar")
		true ;;
	*)
		false ;;
	esac

)
ok 166 - existing untracked file at top-level ignored with -v -n

expecting success: 
				expect '.gitignore:2:ignored-*	ignored-and-untracked' &&
				test_check_ignore 'ignored-and-untracked'
			
expecting success: check boolean: 1 --yes
prerequisite UTF8_NFD_TO_NFC not satisfied
checking prerequisite: SYMLINKS

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	# test whether the filesystem supports symbolic links
	ln -s x y && test -h y

)
ok 2 - lines with spaces at the beginning should be unchanged

expecting success: 
    echo "$ttt$sss$ttt" >expect &&
    git stripspace <expect >actual &&
    test_cmp expect actual &&

    echo "$ttt$sss$sss$ttt" >expect &&
    git stripspace <expect >actual &&
    test_cmp expect actual

prerequisite SYMLINKS ok
expecting success: 
	{
		test_must_fail git config --bool core.ignorecase >/dev/null ||
			test $(git config --bool core.ignorecase) = false
	}

ok 2 - OPT_BOOL() #1

expecting success: check boolean: 1 --no-doubt
ok 167 - existing untracked file at top-level ignored with -v --non-matching

expecting success: 
				expect '.gitignore:2:ignored-*	ignored-and-untracked' &&
				test_check_ignore 'ignored-and-untracked'
			
ok 1 - detection of case insensitive filesystem during repo init

expecting success: 
	{
		test_must_fail git config --bool core.symlinks ||
		test "$(git config --bool core.symlinks)" = true
	}

ok 3 - lines with intermediate spaces should be unchanged

expecting success: 
    printf "$ttt\n\n$ttt\n" > expect &&
    printf "$ttt\n\n\n\n\n$ttt\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt$ttt\n\n$ttt\n" > expect &&
    printf "$ttt$ttt\n\n\n\n\n$ttt\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt$ttt$ttt\n\n$ttt\n" > expect &&
    printf "$ttt$ttt$ttt\n\n\n\n\n$ttt\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt\n\n$ttt\n" > expect &&
    printf "$ttt\n\n\n\n\n$ttt\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt\n\n$ttt$ttt\n" > expect &&
    printf "$ttt\n\n\n\n\n$ttt$ttt\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt\n\n$ttt$ttt$ttt\n" > expect &&
    printf "$ttt\n\n\n\n\n$ttt$ttt$ttt\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt\n\n$ttt\n" > expect &&
    printf "$ttt\n\t\n \n\n  \t\t\n$ttt\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt$ttt\n\n$ttt\n" > expect &&
    printf "$ttt$ttt\n\t\n \n\n  \t\t\n$ttt\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt$ttt$ttt\n\n$ttt\n" > expect &&
    printf "$ttt$ttt$ttt\n\t\n \n\n  \t\t\n$ttt\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt\n\n$ttt\n" > expect &&
    printf "$ttt\n\t\n \n\n  \t\t\n$ttt\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt\n\n$ttt$ttt\n" > expect &&
    printf "$ttt\n\t\n \n\n  \t\t\n$ttt$ttt\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt\n\n$ttt$ttt$ttt\n" > expect &&
    printf "$ttt\n\t\n \n\n  \t\t\n$ttt$ttt$ttt\n" | git stripspace >actual &&
    test_cmp expect actual

ok 3 - OPT_BOOL() #2

expecting success: check boolean: 1 -D
ok 2 - detection of filesystem w/o symlink support during repo init

expecting success: 
	git config core.ignorecase true &&
	touch camelcase &&
	git add camelcase &&
	git commit -m "initial" &&
	git tag initial &&
	git checkout -b topic &&
	git mv camelcase tmp &&
	git mv tmp CamelCase &&
	git commit -m "rename" &&
	git checkout -f master

ok 168 - existing untracked file at top-level ignored with --verbose

expecting success: 
				expect '.gitignore:2:ignored-*	ignored-and-untracked' &&
				test_check_ignore 'ignored-and-untracked'
			
ok 4 - OPT_BOOL() #3

expecting success: check boolean: 1 --no-fear
ok 169 - existing untracked file at top-level ignored with --verbose -n

ok 5 - OPT_BOOL() #4

expecting success: 
				expect '.gitignore:2:ignored-*	ignored-and-untracked' &&
				test_check_ignore 'ignored-and-untracked'
			
expecting success: check boolean: 1 -B
[master (root-commit) 086fd14] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 camelcase
ok 6 - OPT_BOOL() #5

expecting success: check boolean: 1 --yes --yes
Switched to a new branch 'topic'
ok 170 - existing untracked file at top-level ignored with --verbose --non-matching

expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 7 - OPT_BOOL() is idempotent #1

expecting success: check boolean: 1 -DB
ok 8 - OPT_BOOL() is idempotent #2

expecting success: check boolean: 0 -D --no-yes
[topic 376f6d7] rename
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename camelcase => CamelCase (100%)
ok 171 - existing untracked file at top-level ignored with --no-index

expecting success: 
			expect '' &&
			test_check_ignore 'ignored-and-untracked'
		
ok 9 - OPT_BOOL() negation #1

expecting success: check boolean: 0 -D --no-no-doubt
Switched to branch 'master'
ok 3 - setup case tests

expecting success: 
	git mv camelcase CamelCase &&
	git commit -m "rename"

ok 172 - existing untracked file at top-level ignored with --no-index -q

expecting success: 
			expect '' &&
			test_check_ignore 'ignored-and-untracked'
		
ok 4 - consecutive blank lines should be unified

expecting success: 
    > expect &&

    printf "\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "\n\n\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$sss\n$sss\n$sss\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$sss$sss\n$sss\n\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "\n$sss\n$sss$sss\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$sss$sss$sss$sss\n\n\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "\n$sss$sss$sss$sss\n\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "\n\n$sss$sss$sss$sss\n" | git stripspace >actual &&
    test_cmp expect actual

ok 10 - OPT_BOOL() negation #2

expecting success: check_unknown_i18n --fear
[master 376f6d7] rename
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename camelcase => CamelCase (100%)
ok 4 - rename (case change)

expecting success: 
	rm -f CamelCase &&
	rm -f camelcase &&
	git reset --hard initial &&
	git merge topic

ok 173 - existing untracked file at top-level ignored with --no-index --quiet

expecting success: 
				expect '.gitignore:2:ignored-*	ignored-and-untracked' &&
				test_check_ignore 'ignored-and-untracked'
			
ok 11 - OPT_BOOL() no negation #1

expecting success: check_unknown_i18n --no-no-fear
HEAD is now at 086fd14 initial
ok 174 - existing untracked file at top-level ignored with --no-index -v

expecting success: 
				expect '.gitignore:2:ignored-*	ignored-and-untracked' &&
				test_check_ignore 'ignored-and-untracked'
			
ok 12 - OPT_BOOL() no negation #2

expecting success: check boolean: 0 -D --doubt
Updating 086fd14..376f6d7
Fast-forward
 camelcase => CamelCase | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename camelcase => CamelCase (100%)
ok 5 - merge (case change)

ok 175 - existing untracked file at top-level ignored with --no-index -v -n
ok 13 - OPT_BOOL() positivation


expecting success: 
				expect '.gitignore:2:ignored-*	ignored-and-untracked' &&
				test_check_ignore 'ignored-and-untracked'
			
skipping test: add (with different case) 
	git reset --hard initial &&
	rm camelcase &&
	echo 1 >CamelCase &&
	git add CamelCase &&
	camel=$(git ls-files | grep -i camelcase) &&
	test $(echo "$camel" | wc -l) = 1 &&
	test "z$(git cat-file blob :$camel)" = z1

expecting success: 
	test-parse-options -s123 -b -i 1729 -b -vv -n -F my.file \
	> output 2> output.err &&
	test_cmp expect output &&
	test_must_be_empty output.err

ok 6 # skip add (with different case) (missing CASE_INSENSITIVE_FS)

expecting success: 
	test_create_repo unicode &&
	cd unicode &&
	git config core.precomposeunicode false &&
	touch "$aumlcdiar" &&
	git add "$aumlcdiar" &&
	git commit -m initial &&
	git tag initial &&
	git checkout -b topic &&
	git mv $aumlcdiar tmp &&
	git mv tmp "$auml" &&
	git commit -m rename &&
	git checkout -f master

ok 5 - only consecutive blank lines should be completely removed

expecting success: 
    printf "$ttt\n" > expect &&
    printf "\n$ttt\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt\n" > expect &&
    printf "\n\n\n$ttt\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt$ttt\n" > expect &&
    printf "\n\n\n$ttt$ttt\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt$ttt$ttt\n" > expect &&
    printf "\n\n\n$ttt$ttt$ttt\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt$ttt$ttt$ttt\n" > expect &&
    printf "\n\n\n$ttt$ttt$ttt$ttt\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt\n" > expect &&

    printf "$sss\n$sss\n$sss\n$ttt\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "\n$sss\n$sss$sss\n$ttt\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$sss$sss\n$sss\n\n$ttt\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$sss$sss$sss\n\n\n$ttt\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "\n$sss$sss$sss\n\n$ttt\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "\n\n$sss$sss$sss\n$ttt\n" | git stripspace >actual &&
    test_cmp expect actual

ok 176 - existing untracked file at top-level ignored with --no-index -v --non-matching

expecting success: 
				expect '.gitignore:2:ignored-*	ignored-and-untracked' &&
				test_check_ignore 'ignored-and-untracked'
			
ok 14 - short options

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0050-filesystem/unicode/.git/
expecting success: 
	test-parse-options --boolean --integer 1729 --boolean --string2=321 \
		--verbose --verbose --no-dry-run --abbrev=10 --file fi.le\
		--obsolete > output 2> output.err &&
	test_must_be_empty output.err &&
	test_cmp expect output

ok 15 - long options

expecting success: 
	test_expect_code 129 test-parse-options -s &&
	test_expect_code 129 test-parse-options --string &&
	test_expect_code 129 test-parse-options --file

ok 177 - existing untracked file at top-level ignored with --no-index --verbose

expecting success: 
				expect '.gitignore:2:ignored-*	ignored-and-untracked' &&
				test_check_ignore 'ignored-and-untracked'
			
error: switch `s' requires a value
usage: test-parse-options <options>

    --yes                 get a boolean
    -D, --no-doubt        begins with 'no-'
    -B, --no-fear         be brave
    -b, --boolean         increment by one
    -4, --or4             bitwise-or boolean with ...0100
    --neg-or4             same as --no-or4

    -i, --integer <n>     get a integer
    -j <n>                get a integer, too
    --set23               set integer to 23
    -t <time>             get timestamp of <time>
    -L, --length <str>    get length of <str>
    -F, --file <file>     set file to <file>

String options
    -s, --string <string>
                          get a string
    --string2 <str>       get another string
    --st <st>             get another string (pervert ordering)
    -o <str>              get another string
    --list <str>          add str to list

Magic arguments
    --quux                means --quux
    -NUM                  set integer to NUM
    +                     same as -b
    --ambiguous           positive ambiguity
    --no-ambiguous        negative ambiguity

Standard options
    --abbrev[=<n>]        use <n> digits to display SHA-1s
    -v, --verbose         be verbose
    -n, --dry-run         dry run
    -q, --quiet           be quiet

error: option `string' requires a value
usage: test-parse-options <options>

    --yes                 get a boolean
    -D, --no-doubt        begins with 'no-'
    -B, --no-fear         be brave
    -b, --boolean         increment by one
    -4, --or4             bitwise-or boolean with ...0100
    --neg-or4             same as --no-or4

    -i, --integer <n>     get a integer
    -j <n>                get a integer, too
    --set23               set integer to 23
    -t <time>             get timestamp of <time>
    -L, --length <str>    get length of <str>
    -F, --file <file>     set file to <file>

String options
    -s, --string <string>
                          get a string
    --string2 <str>       get another string
    --st <st>             get another string (pervert ordering)
    -o <str>              get another string
    --list <str>          add str to list

Magic arguments
    --quux                means --quux
    -NUM                  set integer to NUM
    +                     same as -b
    --ambiguous           positive ambiguity
    --no-ambiguous        negative ambiguity

Standard options
    --abbrev[=<n>]        use <n> digits to display SHA-1s
    -v, --verbose         be verbose
    -n, --dry-run         dry run
    -q, --quiet           be quiet

ok 178 - existing untracked file at top-level ignored with --no-index --verbose -n

error: option `file' requires a value
usage: test-parse-options <options>

    --yes                 get a boolean
    expecting success: 
-D, --no-doubt        begins with 'no-'
    -B, --no-fear         be brave
				expect '.gitignore:2:ignored-*	ignored-and-untracked' &&
    -b, --boolean         increment by one
    -4, --or4				test_check_ignore 'ignored-and-untracked'
             bitwise-or boolean with ...0100
    --neg-or4             same as --no-or4

    -i			
, --integer <n>     get a integer
    -j <n>                get a integer, too
    --set23               set integer to 23
    -t <time>             get timestamp of <time>
    -L, --length <str>    get length of <str>
    -F, --file <file>     set file to <file>

String options
    -s, --string <string>
                          get a string
    --string2 <str>       get another string
    --st <st>             get another string (pervert ordering)
    -o <str>              get another string
    --list <str>          add str to list

Magic arguments
    --quux                means --quux
    -NUM                  set integer to NUM
    +                     same as -b
    --ambiguous           positive ambiguity
    --no-ambiguous        negative ambiguity

Standard options
    --abbrev[=<n>]        use <n> digits to display SHA-1s
    -v, --verbose         be verbose
    -n, --dry-run         dry run
    -q, --quiet           be quiet

ok 16 - missing required value

expecting success: 
	test-parse-options a1 --string 123 b1 --boolean -j 13 -- --boolean \
		> output 2> output.err &&
	test_must_be_empty output.err &&
	test_cmp expect output

[master (root-commit) 5cea4c4] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 "a\314\210"
ok 17 - intermingled arguments

expecting success: 
	test-parse-options --int 2 --boolean --no-bo > output 2> output.err &&
	test_must_be_empty output.err &&
	test_cmp expect output

ok 179 - existing untracked file at top-level ignored with --no-index --verbose --non-matching

Switched to a new branch 'topic'
ok 18 - unambiguously abbreviated option

expecting success: 
	test-parse-options --int=2 > output 2> output.err &&
	test_must_be_empty output.err &&
	test_cmp expect output

expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 19 - unambiguously abbreviated option with "="

expecting success: 
	test_expect_code 129 test-parse-options --strin 123

error: Ambiguous option: strin (could be --string or --string2)
usage: test-parse-options <options>

    --yes                 get a boolean
    -D, --no-doubt        begins with 'no-'
    -B, --no-fear         be brave
    -b, --boolean         increment by one
    -4, --or4             bitwise-or boolean with ...0100
ok 180 - mix of file types at top-level

    --neg-or4             same as --no-or4

    -i, --integer <n>     get a integer
    -j <n>                get a integer, too
    --set23               set integer to 23
    -t <time>             get timestamp of <time>
    -L, --length <str>    get length of <str>
    -F, --file <file>     set file to <file>

String options
    -s, --string <string>
                          get a string
    --string2 <str>       get another string
    --st <st>             get another string (pervert ordering)
    -o <str>              get another string
    --list <str>          add str to list

Magic arguments
    --quux                means --quux
    -NUM                  set integer to NUM
    +                     same as -b
    --ambiguous           positive ambiguity
    --no-ambiguous        negative ambiguity

Standard options
    --abbrev[=<n>]        use <n> digits to display SHA-1s
    -v, --verbose         be verbose
    -n, --dry-run         dry run
    -q, --quiet           be quiet

ok 20 - ambiguously abbreviated option

ok 6 - consecutive blank lines at the beginning should be removed

expecting success: 
    printf "$ttt\n" > expect &&
    printf "$ttt\n\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt\n" > expect &&
    printf "$ttt\n\n\n\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt$ttt\n" > expect &&
    printf "$ttt$ttt\n\n\n\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt$ttt$ttt\n" > expect &&
    printf "$ttt$ttt$ttt\n\n\n\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt$ttt$ttt$ttt\n" > expect &&
    printf "$ttt$ttt$ttt$ttt\n\n\n\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt\n" > expect &&

    printf "$ttt\n$sss\n$sss\n$sss\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt\n\n$sss\n$sss$sss\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt\n$sss$sss\n$sss\n\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt\n$sss$sss$sss\n\n\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt\n\n$sss$sss$sss\n\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt\n\n\n$sss$sss$sss\n" | git stripspace >actual &&
    test_cmp expect actual

expecting success: 
				expect '.gitignore:1:one	one
.gitignore:2:ignored-*	ignored-and-untracked' &&
				test_check_ignore '
			non-existent
			one
			not-ignored
			ignored-but-in-index
			ignored-and-untracked'
		
			
expecting success: 
	test-parse-options --st 123 > output 2> output.err &&
	test_must_be_empty output.err &&
	test_cmp expect output

[topic b0ed0e4] rename
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename "a\314\210" => "\303\244" (100%)
ok 21 - non ambiguous option (after two options it abbreviates)

expecting success: 
	test_must_fail test-parse-options -boolean > output 2> output.err &&
	test_must_be_empty output &&
	test_cmp typo.err output.err

Switched to branch 'master'
ok 7 - setup unicode normalization tests

expecting success: 
	git mv "$aumlcdiar" "$auml" &&
	git commit -m rename

ok 181 - mix of file types at top-level with -v

expecting success: 
				expect '::	non-existent
.gitignore:1:one	one
::	not-ignored
::	ignored-but-in-index
.gitignore:2:ignored-*	ignored-and-untracked' &&
				test_check_ignore '
			non-existent
			one
			not-ignored
			ignored-but-in-index
			ignored-and-untracked'
		
			
ok 22 - detect possible typos

expecting success: 
	test_must_fail test-parse-options -ambiguous > output 2> output.err &&
	test_must_be_empty output &&
	test_cmp typo.err output.err

[master b0ed0e4] rename
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename "a\314\210" => "\303\244" (100%)
ok 23 - detect possible typos

ok 8 - rename (silent unicode normalization)

expecting success: 
	git reset --hard initial &&
	git merge topic

ok 182 - mix of file types at top-level with -v -n

expecting success: 
				expect '::	non-existent
.gitignore:1:one	one
::	not-ignored
::	ignored-but-in-index
.gitignore:2:ignored-*	ignored-and-untracked' &&
				test_check_ignore '
			non-existent
			one
			not-ignored
			ignored-but-in-index
			ignored-and-untracked'
		
			
expecting success: 
	test-parse-options --quux > output 2> output.err &&
	test_must_be_empty output.err &&
        test_cmp expect output

ok 24 - keep some options as arguments

expecting success: 
	test-parse-options -t "1970-01-01 00:00:01 +0000" \
		foo -q > output 2> output.err &&
	test_must_be_empty output.err &&
	test_cmp expect output

HEAD is now at 5cea4c4 initial
ok 183 - mix of file types at top-level with -v --non-matching

expecting success: 
				expect '.gitignore:1:one	one
.gitignore:2:ignored-*	ignored-and-untracked' &&
				test_check_ignore '
			non-existent
			one
			not-ignored
			ignored-but-in-index
			ignored-and-untracked'
		
			
ok 25 - OPT_DATE() works

expecting success: 
	test-parse-options --length=four -b -4 > output 2> output.err &&
	test_must_be_empty output.err &&
	test_cmp expect output

Updating 5cea4c4..b0ed0e4
Fast-forward
 "a\314\210" => "\303\244" | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename "a\314\210" => "\303\244" (100%)
ok 9 - merge (silent unicode normalization)

ok 184 - mix of file types at top-level with --verbose

expecting success: 
				expect '::	non-existent
.gitignore:1:one	one
::	not-ignored
::	ignored-but-in-index
.gitignore:2:ignored-*	ignored-and-untracked' &&
				test_check_ignore '
			non-existent
			one
			not-ignored
			ignored-but-in-index
			ignored-and-untracked'
		
			
ok 26 - OPT_CALLBACK() and OPT_BIT() work

expecting success: 
	test_must_fail test-parse-options --no-length > output 2> output.err &&
	test_i18ncmp expect output &&
	test_i18ncmp expect.err output.err

# passed all 9 test(s)
1..9
ok 185 - mix of file types at top-level with --verbose -n

expecting success: 
				expect '::	non-existent
.gitignore:1:one	one
::	not-ignored
::	ignored-but-in-index
.gitignore:2:ignored-*	ignored-and-untracked' &&
				test_check_ignore '
			non-existent
			one
			not-ignored
			ignored-but-in-index
			ignored-and-untracked'
		
			
ok 27 - OPT_CALLBACK() and callback errors work

expecting success: 
	test-parse-options --set23 -bbbbb --no-or4 > output 2> output.err &&
	test_must_be_empty output.err &&
	test_cmp expect output

ok 7 - consecutive blank lines at the end should be removed

expecting success: 
    test $(printf "$ttt" | git stripspace | wc -l) -gt 0 &&
    test $(printf "$ttt$ttt" | git stripspace | wc -l) -gt 0 &&
    test $(printf "$ttt$ttt$ttt" | git stripspace | wc -l) -gt 0 &&
    test $(printf "$ttt$ttt$ttt$ttt" | git stripspace | wc -l) -gt 0

*** t0055-beyond-symlinks.sh ***
ok 28 - OPT_BIT() and OPT_SET_INT() work

expecting success: 
	test-parse-options --set23 -bbbbb --neg-or4 > output 2> output.err &&
	test_must_be_empty output.err &&
	test_cmp expect output

ok 186 - mix of file types at top-level with --verbose --non-matching

ok 29 - OPT_NEGBIT() and OPT_SET_INT() work

expecting success: 
	test-parse-options -bb --or4 > output 2> output.err &&
	test_must_be_empty output.err &&
	test_cmp expect output

ok 8 - text without newline at end should end with newline

expecting success: 
    test $(printf "$ttt$sss" | git stripspace | wc -l) -gt 0 &&
    test $(printf "$ttt$ttt$sss" | git stripspace | wc -l) -gt 0 &&
    test $(printf "$ttt$ttt$ttt$sss" | git stripspace | wc -l) -gt 0 &&
    test $(printf "$ttt$sss$sss" | git stripspace | wc -l) -gt 0 &&
    test $(printf "$ttt$ttt$sss$sss" | git stripspace | wc -l) -gt 0 &&
    test $(printf "$ttt$sss$sss$sss" | git stripspace | wc -l) -gt 0

ok 30 - OPT_BIT() works

expecting success: 
	test-parse-options -bb --no-neg-or4 > output 2> output.err &&
	test_must_be_empty output.err &&
	test_cmp expect output

expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 31 - OPT_NEGBIT() works

expecting success: 
	test-parse-options + + + + + + > output 2> output.err &&
	test_must_be_empty output.err &&
	test_cmp expect output

ok 32 - OPT_COUNTUP() with PARSE_OPT_NODASH works

expecting success: 
	test-parse-options -12345 > output 2> output.err &&
	test_must_be_empty output.err &&
	test_cmp expect output

ok 33 - OPT_NUMBER_CALLBACK() works

ok 187 - mix of file types at top-level with --no-index

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0055-beyond-symlinks/.git/
expecting success: 
	test-parse-options --no-ambig >output 2>output.err &&
	test_must_be_empty output.err &&
	test_cmp expect output

expecting success: 
				expect '.gitignore:1:one	one
.gitignore:2:ignored-*	ignored-but-in-index
.gitignore:2:ignored-*	ignored-and-untracked' &&
				test_check_ignore '
			non-existent
			one
			not-ignored
			ignored-but-in-index
			ignored-and-untracked'
		
			
checking prerequisite: SYMLINKS

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	# test whether the filesystem supports symbolic links
	ln -s x y && test -h y

)
ok 34 - negation of OPT_NONEG flags is not ambiguous

expecting success: 
	test-parse-options --list foo --list=bar --list=baz >output &&
	test_cmp expect output

ok 9 - text plus spaces without newline at end should end with newline

expecting success: 
    ! (printf "$ttt$sss" | git stripspace | grep "  " >/dev/null) &&
    ! (printf "$ttt$ttt$sss" | git stripspace | grep "  " >/dev/null) &&
    ! (printf "$ttt$ttt$ttt$sss" | git stripspace | grep "  " >/dev/null) &&
    ! (printf "$ttt$sss$sss" | git stripspace | grep "  " >/dev/null) &&
    ! (printf "$ttt$ttt$sss$sss" | git stripspace | grep "  " >/dev/null) &&
    ! (printf "$ttt$sss$sss$sss" | git stripspace | grep "  " >/dev/null)

prerequisite SYMLINKS ok
expecting success: 
	>a &&
	mkdir b &&
	ln -s b c &&
	>c/d &&
	git update-index --add a b/d

ok 188 - mix of file types at top-level with --no-index -v

expecting success: 
				expect '::	non-existent
.gitignore:1:one	one
::	not-ignored
.gitignore:2:ignored-*	ignored-but-in-index
.gitignore:2:ignored-*	ignored-and-untracked' &&
				test_check_ignore '
			non-existent
			one
			not-ignored
			ignored-but-in-index
			ignored-and-untracked'
		
			
ok 35 - --list keeps list of strings

expecting success: 
	test-parse-options --list=other --list=irrelevant --list=options \
		--no-list --list=foo --list=bar --list=baz >output &&
	test_cmp expect output

ok 36 - --no-list resets list

ok 1 - setup

expecting success: 
	test_must_fail git update-index --add c/d &&
	! ( git ls-files | grep c/d )

# passed all 36 test(s)
1..36
error: 'c/d' is beyond a symbolic link
fatal: Unable to process path c/d
ok 189 - mix of file types at top-level with --no-index -v -n

expecting success: 
				expect '::	non-existent
.gitignore:1:one	one
::	not-ignored
.gitignore:2:ignored-*	ignored-but-in-index
.gitignore:2:ignored-*	ignored-and-untracked' &&
				test_check_ignore '
			non-existent
			one
			not-ignored
			ignored-but-in-index
			ignored-and-untracked'
		
			
ok 2 - update-index --add beyond symlinks

expecting success: 
	test_must_fail git add c/d &&
	! ( git ls-files | grep c/d )

*** t0056-git-C.sh ***
fatal: pathspec 'c/d' is beyond a symbolic link
ok 10 - text plus spaces without newline at end should not show spaces

expecting success: 
    printf "$ttt\n" >expect &&
    printf "$ttt$sss" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt\n" >expect &&
    printf "$ttt$sss$sss" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt\n" >expect &&
    printf "$ttt$sss$sss$sss" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt$ttt\n" >expect &&
    printf "$ttt$ttt$sss" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt$ttt\n" >expect &&
    printf "$ttt$ttt$sss$sss" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt$ttt$ttt\n" >expect &&
    printf "$ttt$ttt$ttt$sss" | git stripspace >actual &&
    test_cmp expect actual

ok 3 - add beyond symlinks

ok 190 - mix of file types at top-level with --no-index -v --non-matching

expecting success: 
				expect '.gitignore:1:one	one
.gitignore:2:ignored-*	ignored-but-in-index
.gitignore:2:ignored-*	ignored-and-untracked' &&
				test_check_ignore '
			non-existent
			one
			not-ignored
			ignored-but-in-index
			ignored-and-untracked'
		
			
# passed all 3 test(s)
1..3
ok 191 - mix of file types at top-level with --no-index --verbose

expecting success: 
				expect '::	non-existent
.gitignore:1:one	one
::	not-ignored
.gitignore:2:ignored-*	ignored-but-in-index
.gitignore:2:ignored-*	ignored-and-untracked' &&
				test_check_ignore '
			non-existent
			one
			not-ignored
			ignored-but-in-index
			ignored-and-untracked'
		
			
*** t0060-path-utils.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0056-git-C/.git/
ok 192 - mix of file types at top-level with --no-index --verbose -n

expecting success: 
				expect '::	non-existent
.gitignore:1:one	one
::	not-ignored
.gitignore:2:ignored-*	ignored-but-in-index
.gitignore:2:ignored-*	ignored-and-untracked' &&
				test_check_ignore '
			non-existent
			one
			not-ignored
			ignored-but-in-index
			ignored-and-untracked'
		
			
expecting success: 
	test_create_repo dir1 &&
	echo 1 >dir1/a.txt &&
	msg="initial in dir1" &&
	(cd dir1 && git add a.txt && git commit -m "$msg") &&
	echo "$msg" >expected &&
	git -C dir1 log --format=%s >actual &&
	test_cmp expected actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0056-git-C/dir1/.git/
ok 11 - text plus spaces without newline should show the correct lines

expecting success: 
    ! (echo "$ttt$sss" | git stripspace | grep "  " >/dev/null) &&
    ! (echo "$ttt$ttt$sss" | git stripspace | grep "  " >/dev/null) &&
    ! (echo "$ttt$ttt$ttt$sss" | git stripspace | grep "  " >/dev/null) &&
    ! (echo "$ttt$sss$sss" | git stripspace | grep "  " >/dev/null) &&
    ! (echo "$ttt$ttt$sss$sss" | git stripspace | grep "  " >/dev/null) &&
    ! (echo "$ttt$sss$sss$sss" | git stripspace | grep "  " >/dev/null)

ok 193 - mix of file types at top-level with --no-index --verbose --non-matching

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0060-path-utils/.git/
expecting success: 
		expect "$expect" &&
		eval "$code"
	
[master (root-commit) 09014ad] initial in dir1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a.txt
expecting success: test "$(test-path-utils normalize_path_copy '')" = ''
ok 194 - non-existent file in subdir a/ not ignored

ok 1 - normalize path:  => 

ok 1 - "git -C <path>" runs git from the directory <path>

expecting success: 
	(
		mkdir -p dir1/subdir &&
		cd dir1/subdir &&
		git -C "" rev-parse --show-prefix >actual &&
		echo subdir/ >expect &&
		test_cmp expect actual
	)

expecting success: 
			expect '' &&
			test_check_ignore 'a/non-existent' 1
		
expecting success: test "$(test-path-utils normalize_path_copy '.')" = ''
ok 12 - text plus spaces at end should not show spaces

expecting success: 
    echo "$ttt" >expect &&
    echo "$ttt$sss" | git stripspace >actual &&
    test_cmp expect actual &&

    echo "$ttt" >expect &&
    echo "$ttt$sss$sss" | git stripspace >actual &&
    test_cmp expect actual &&

    echo "$ttt" >expect &&
    echo "$ttt$sss$sss$sss" | git stripspace >actual &&
    test_cmp expect actual &&

    echo "$ttt$ttt" >expect &&
    echo "$ttt$ttt$sss" | git stripspace >actual &&
    test_cmp expect actual &&

    echo "$ttt$ttt" >expect &&
    echo "$ttt$ttt$sss$sss" | git stripspace >actual &&
    test_cmp expect actual &&

    echo "$ttt$ttt$ttt" >expect &&
    echo "$ttt$ttt$ttt$sss" | git stripspace >actual &&
    test_cmp expect actual

ok 2 - normalize path: . => 

ok 195 - non-existent file in subdir a/ not ignored with -q

expecting success: 
			expect '' &&
			test_check_ignore 'a/non-existent' 1
		
expecting success: test "$(test-path-utils normalize_path_copy './')" = ''
ok 2 - "git -C <path>" with an empty <path> is a no-op

expecting success: 
	test_create_repo dir1/dir2 &&
	echo 1 >dir1/dir2/b.txt &&
	git -C dir1/dir2 add b.txt &&
	msg="initial in dir1/dir2" &&
	echo "$msg" >expected &&
	git -C dir1/dir2 commit -m "$msg" &&
	git -C dir1 -C dir2 log --format=%s >actual &&
	test_cmp expected actual

ok 3 - normalize path: ./ => 

expecting success: test "$(test-path-utils normalize_path_copy './.')" = ''
ok 196 - non-existent file in subdir a/ not ignored with --quiet

expecting success: 
				expect '' &&
				test_check_ignore 'a/non-existent' 1
			
ok 4 - normalize path: ./. => 

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0056-git-C/dir1/dir2/.git/
expecting success: test "$(test-path-utils normalize_path_copy './..')" = '++failed++'
ok 5 - normalize path: ./.. => ++failed++

ok 197 - non-existent file in subdir a/ not ignored with -v

expecting success: 
				expect '::	a/non-existent' &&
				test_check_ignore 'a/non-existent' 1
			
expecting success: test "$(test-path-utils normalize_path_copy '../.')" = '++failed++'
ok 6 - normalize path: ../. => ++failed++

ok 198 - non-existent file in subdir a/ not ignored with -v -n

expecting success: test "$(test-path-utils normalize_path_copy './.././/')" = '++failed++'
expecting success: 
				expect '::	a/non-existent' &&
				test_check_ignore 'a/non-existent' 1
			
[master (root-commit) 761d2e8] initial in dir1/dir2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 b.txt
ok 13 - text plus spaces at end should be cleaned and newline must remain

expecting success: 
    printf "" >expect &&

    echo | git stripspace >actual &&
    test_cmp expect actual &&

    echo "$sss" | git stripspace >actual &&
    test_cmp expect actual &&

    echo "$sss$sss" | git stripspace >actual &&
    test_cmp expect actual &&

    echo "$sss$sss$sss" | git stripspace >actual &&
    test_cmp expect actual &&

    echo "$sss$sss$sss$sss" | git stripspace >actual &&
    test_cmp expect actual

ok 7 - normalize path: ./../.// => ++failed++

expecting success: test "$(test-path-utils normalize_path_copy 'dir/..')" = ''
ok 199 - non-existent file in subdir a/ not ignored with -v --non-matching

expecting success: 
				expect '' &&
				test_check_ignore 'a/non-existent' 1
			
ok 8 - normalize path: dir/.. => 

ok 3 - Multiple -C options: "-C dir1 -C dir2" is equivalent to "-C dir1/dir2"

expecting success: 
	mkdir c &&
	mkdir c/a &&
	mkdir c/a.git &&
	(cd c/a.git && git init --bare) &&
	echo 1 >c/a/a.txt &&
	git --git-dir c/a.git --work-tree=c/a add a.txt &&
	git --git-dir c/a.git --work-tree=c/a commit -m "initial" &&
	git --git-dir=c/a.git log -1 --format=%s >expected &&
	git -C c --git-dir=a.git log -1 --format=%s >actual &&
	test_cmp expected actual

expecting success: test "$(test-path-utils normalize_path_copy 'dir/sub/../..')" = ''
ok 200 - non-existent file in subdir a/ not ignored with --verbose

expecting success: 
				expect '::	a/non-existent' &&
				test_check_ignore 'a/non-existent' 1
			
ok 9 - normalize path: dir/sub/../.. => 

expecting success: test "$(test-path-utils normalize_path_copy 'dir/sub/../../..')" = '++failed++'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0056-git-C/c/a.git/
ok 201 - non-existent file in subdir a/ not ignored with --verbose -n

expecting success: 
				expect '::	a/non-existent' &&
				test_check_ignore 'a/non-existent' 1
			
ok 10 - normalize path: dir/sub/../../.. => ++failed++

ok 14 - spaces with newline at end should be replaced with empty string

expecting success: 
    ! (printf "" | git stripspace | grep " " >/dev/null) &&
    ! (printf "$sss" | git stripspace | grep " " >/dev/null) &&
    ! (printf "$sss$sss" | git stripspace | grep " " >/dev/null) &&
    ! (printf "$sss$sss$sss" | git stripspace | grep " " >/dev/null) &&
    ! (printf "$sss$sss$sss$sss" | git stripspace | grep " " >/dev/null)

expecting success: test "$(test-path-utils normalize_path_copy 'dir')" = 'dir'
ok 202 - non-existent file in subdir a/ not ignored with --verbose --non-matching

ok 11 - normalize path: dir => dir

[master (root-commit) ad00f4d] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a.txt
expecting success: test "$(test-path-utils normalize_path_copy 'dir//')" = 'dir/'
expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 12 - normalize path: dir// => dir/

expecting success: test "$(test-path-utils normalize_path_copy './dir')" = 'dir'
ok 13 - normalize path: ./dir => dir

ok 4 - Effect on --git-dir option: "-C c --git-dir=a.git" is equivalent to "--git-dir c/a.git"

ok 203 - non-existent file in subdir a/ not ignored with --no-index
expecting success: 
	git -C c --git-dir=a.git log -1 --format=%s >expected &&
	git --git-dir=a.git -C c log -1 --format=%s >actual &&
	test_cmp expected actual


expecting success: test "$(test-path-utils normalize_path_copy 'dir/.')" = 'dir/'
ok 15 - spaces without newline at end should not show spaces

expecting success: 
    printf "" >expect &&

    printf "" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$sss$sss" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$sss$sss$sss" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$sss$sss$sss$sss" | git stripspace >actual &&
    test_cmp expect actual

expecting success: 
			expect '' &&
			test_check_ignore 'a/non-existent' 1
		
ok 14 - normalize path: dir/. => dir/

expecting success: test "$(test-path-utils normalize_path_copy 'dir///./')" = 'dir/'
ok 204 - non-existent file in subdir a/ not ignored with --no-index -q

expecting success: 
			expect '' &&
			test_check_ignore 'a/non-existent' 1
		
ok 15 - normalize path: dir///./ => dir/

ok 5 - Order should not matter: "--git-dir=a.git -C c" is equivalent to "-C c --git-dir=a.git"

expecting success: 
	rm c/a/a.txt &&
	git --git-dir=c/a.git --work-tree=c/a status >expected &&
	git -C c/a.git --work-tree=../a status >actual &&
	test_cmp expected actual

expecting success: test "$(test-path-utils normalize_path_copy 'dir//sub/..')" = 'dir/'
ok 16 - normalize path: dir//sub/.. => dir/

ok 205 - non-existent file in subdir a/ not ignored with --no-index --quiet

expecting success: 
				expect '' &&
				test_check_ignore 'a/non-existent' 1
			
ok 16 - spaces without newline at end should be replaced with empty string

expecting success: 
    printf "$ttt$ttt\n$ttt\n" >expect &&
    printf "$ttt$ttt\n$ttt\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt\n$ttt$ttt\n$ttt\n" >expect &&
    printf "$ttt\n$ttt$ttt\n$ttt\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt\n$ttt\n$ttt\n$ttt$ttt\n" >expect &&
    printf "$ttt\n$ttt\n$ttt\n$ttt$ttt\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt\n$ttt\n\n$ttt$ttt\n$ttt\n" >expect &&
    printf "$ttt\n$ttt\n\n$ttt$ttt\n$ttt\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt$ttt\n\n$ttt\n$ttt$ttt\n" >expect &&
    printf "$ttt$ttt\n\n$ttt\n$ttt$ttt\n" | git stripspace >actual &&
    test_cmp expect actual &&

    printf "$ttt\n$ttt$ttt\n\n$ttt\n" >expect &&
    printf "$ttt\n$ttt$ttt\n\n$ttt\n" | git stripspace >actual &&
    test_cmp expect actual

expecting success: test "$(test-path-utils normalize_path_copy 'dir/sub/../')" = 'dir/'
ok 6 - Effect on --work-tree option: "-C c/a.git --work-tree=../a"  is equivalent to "--work-tree=c/a --git-dir=c/a.git"

expecting success: 
	git -C c/a.git --work-tree=../a status >expected &&
	git --work-tree=../a -C c/a.git status >actual &&
	test_cmp expected actual

ok 17 - normalize path: dir/sub/../ => dir/

ok 206 - non-existent file in subdir a/ not ignored with --no-index -v

expecting success: 
				expect '::	a/non-existent' &&
				test_check_ignore 'a/non-existent' 1
			
expecting success: test "$(test-path-utils normalize_path_copy 'dir/sub/../.')" = 'dir/'
ok 18 - normalize path: dir/sub/../. => dir/

ok 7 - Order should not matter: "--work-tree=../a -C c/a.git" is equivalent to "-C c/a.git --work-tree=../a"

expecting success: test "$(test-path-utils normalize_path_copy 'dir/s1/../s2/')" = 'dir/s2/'
expecting success: 
	git --git-dir=c/a.git --work-tree=c/a status >expected &&
	git -C c --git-dir=a.git --work-tree=a status >actual &&
	test_cmp expected actual

ok 207 - non-existent file in subdir a/ not ignored with --no-index -v -n

expecting success: 
				expect '::	a/non-existent' &&
				test_check_ignore 'a/non-existent' 1
			
ok 19 - normalize path: dir/s1/../s2/ => dir/s2/

expecting success: test "$(test-path-utils normalize_path_copy 'd1/s1///s2/..//../s3/')" = 'd1/s3/'
ok 20 - normalize path: d1/s1///s2/..//../s3/ => d1/s3/

ok 208 - non-existent file in subdir a/ not ignored with --no-index -v --non-matching

expecting success: 
				expect '' &&
				test_check_ignore 'a/non-existent' 1
			
expecting success: test "$(test-path-utils normalize_path_copy 'd1/s1//../s2/../../d2')" = 'd2'
ok 8 - Effect on --git-dir and --work-tree options - "-C c --git-dir=a.git --work-tree=a" is equivalent to "--git-dir=c/a.git --work-tree=c/a"

expecting success: 
	git -C c --git-dir=a.git --work-tree=a status >expected &&
	git --git-dir=a.git -C c --work-tree=a status >actual &&
	test_cmp expected actual

ok 21 - normalize path: d1/s1//../s2/../../d2 => d2

ok 17 - consecutive text lines should be unchanged

expecting success: 
	test ! -z "$(echo "# comment" | git stripspace)" &&
	test -z "$(echo "# comment" | git stripspace -s)"

expecting success: test "$(test-path-utils normalize_path_copy 'd1/.../d2')" = 'd1/.../d2'
ok 22 - normalize path: d1/.../d2 => d1/.../d2

ok 209 - non-existent file in subdir a/ not ignored with --no-index --verbose

expecting success: 
				expect '::	a/non-existent' &&
				test_check_ignore 'a/non-existent' 1
			
ok 9 - Order should not matter: "-C c --git-dir=a.git --work-tree=a" is equivalent to "--git-dir=a.git -C c --work-tree=a"

expecting success: test "$(test-path-utils normalize_path_copy 'd1/..././../d2')" = 'd1/d2'
expecting success: 
	git -C c --git-dir=a.git --work-tree=a status >expected &&
	git --git-dir=a.git --work-tree=a -C c status >actual &&
	test_cmp expected actual

ok 18 - strip comments, too

expecting success: 
	test ! -z "$(echo "; comment" | git -c core.commentchar=";" stripspace)" &&
	test -z "$(echo "; comment" | git -c core.commentchar=";" stripspace -s)"

ok 23 - normalize path: d1/..././../d2 => d1/d2

expecting success: test "$(test-path-utils normalize_path_copy '/')" = '/'
ok 210 - non-existent file in subdir a/ not ignored with --no-index --verbose -n

expecting success: 
				expect '::	a/non-existent' &&
				test_check_ignore 'a/non-existent' 1
			
ok 19 - strip comments with changed comment char

expecting success: 
	printf "# foo\n" >expect &&
	printf "foo" | git stripspace -c >actual &&
	test_cmp expect actual

ok 24 - normalize path: / => /

ok 10 - Order should not matter: "-C c --git-dir=a.git --work-tree=a" is equivalent to "--git-dir=a.git --work-tree=a -C c"

expecting success: 
	echo "initial in dir1/dir2" >expected &&
	git -C dir1 -C "$(pwd)/dir1/dir2" log --format=%s >actual &&
	test_cmp expected actual

ok 20 - -c with single line

expecting success: 
	printf "# foo\n#\n" >expect &&
	printf "foo\n\n" | git stripspace -c >actual &&
	test_cmp expect actual

expecting success: test "$(test-path-utils normalize_path_copy '//')" = '/'
ok 211 - non-existent file in subdir a/ not ignored with --no-index --verbose --non-matching

ok 25 - normalize path: // => /

expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 11 - Relative followed by fullpath: "-C ./here -C /there" is equivalent to "-C /there"

expecting success: test "$(test-path-utils normalize_path_copy '///')" = '/'
ok 21 - -c with single line followed by empty line

expecting success: 
	printf "#\n" >expect &&
	printf "\n" | git stripspace -c >actual &&
	test_cmp expect actual

# passed all 11 test(s)
1..11
ok 26 - normalize path: /// => /

expecting success: test "$(test-path-utils normalize_path_copy '/.')" = '/'
ok 22 - -c with newline only

expecting success: 
	printf "# foo\n" >expect &&
	printf "foo" | git stripspace -c >actual &&
	test_cmp expect actual

ok 212 - non-existent file in subdir a/ ignored

ok 27 - normalize path: /. => /

expecting success: 
			expect '' &&
			test_check_ignore 'a/one'
		
ok 23 - --comment-lines with single line

expecting success: test "$(test-path-utils normalize_path_copy '/./')" = '/'
expecting success: 
	printf "; foo\n" >expect &&
	printf "foo" | git -c core.commentchar=";" stripspace -c >actual &&
	test_cmp expect actual

ok 28 - normalize path: /./ => /

expecting success: test "$(test-path-utils normalize_path_copy '/./..')" = '++failed++'
ok 24 - -c with changed comment char

expecting success: 
	printf "#\tone\n#\n# two\n" >expect &&
	printf "\tone\n\ntwo\n" | git stripspace -c >actual &&
	test_cmp expect actual

ok 213 - non-existent file in subdir a/ ignored with -q

expecting success: 
			expect '' &&
			test_check_ignore 'a/one'
		
*** t0061-run-command.sh ***
ok 29 - normalize path: /./.. => ++failed++

expecting success: test "$(test-path-utils normalize_path_copy '/../.')" = '++failed++'
ok 25 - avoid SP-HT sequence in commented line

ok 30 - normalize path: /../. => ++failed++

# passed all 25 test(s)
1..25
ok 214 - non-existent file in subdir a/ ignored with --quiet

expecting success: 
				expect '.gitignore:1:one	a/one' &&
				test_check_ignore 'a/one'
			
expecting success: test "$(test-path-utils normalize_path_copy '/./.././/')" = '++failed++'
ok 31 - normalize path: /./../.// => ++failed++

*** t0062-revision-walking.sh ***
expecting success: test "$(test-path-utils normalize_path_copy '/dir/..')" = '/'
ok 215 - non-existent file in subdir a/ ignored with -v

expecting success: 
				expect '.gitignore:1:one	a/one' &&
				test_check_ignore 'a/one'
			
ok 32 - normalize path: /dir/.. => /

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0061-run-command/.git/
expecting success: test "$(test-path-utils normalize_path_copy '/dir/sub/../..')" = '/'
ok 33 - normalize path: /dir/sub/../.. => /

expecting success: 
	test-run-command start-command-ENOENT ./does-not-exist

ok 216 - non-existent file in subdir a/ ignored with -v -n

expecting success: 
				expect '.gitignore:1:one	a/one' &&
				test_check_ignore 'a/one'
			
expecting success: test "$(test-path-utils normalize_path_copy '/dir/sub/../../..')" = '++failed++'
error: cannot run ./does-not-exist: No such file or directory
ok 1 - start_command reports ENOENT

expecting success: 
	cat hello-script >hello.sh &&
	chmod +x hello.sh &&
	test-run-command run-command ./hello.sh >actual 2>err &&

	test_cmp hello-script actual &&
	test_cmp empty err

ok 34 - normalize path: /dir/sub/../../.. => ++failed++

expecting success: test "$(test-path-utils normalize_path_copy '/dir')" = '/dir'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0062-revision-walking/.git/
ok 217 - non-existent file in subdir a/ ignored with -v --non-matching

expecting success: 
				expect '.gitignore:1:one	a/one' &&
				test_check_ignore 'a/one'
			
ok 35 - normalize path: /dir => /dir

expecting success: test "$(test-path-utils normalize_path_copy '/dir//')" = '/dir/'
expecting success: 
	echo a > a &&
	git add a &&
	git commit -m "add a" &&
	echo b > b &&
	git add b &&
	git commit -m "add b"

ok 2 - run_command can run a command

ok 36 - normalize path: /dir// => /dir/

expecting success: 
	cat hello-script >hello.sh &&
	chmod -x hello.sh &&
	test_must_fail test-run-command run-command ./hello.sh 2>err &&

	grep "fatal: cannot exec.*hello.sh" err

expecting success: test "$(test-path-utils normalize_path_copy '/./dir')" = '/dir'
ok 218 - non-existent file in subdir a/ ignored with --verbose

expecting success: 
				expect '.gitignore:1:one	a/one' &&
				test_check_ignore 'a/one'
			
ok 37 - normalize path: /./dir => /dir

expecting success: test "$(test-path-utils normalize_path_copy '/dir/.')" = '/dir/'
fatal: cannot exec './hello.sh': Permission denied
ok 3 - run_command reports EACCES

checking prerequisite: SANITY

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	mkdir SANETESTD.1 SANETESTD.2 &&

	chmod +w SANETESTD.1 SANETESTD.2 &&
	>SANETESTD.1/x 2>SANETESTD.2/x &&
	chmod -w SANETESTD.1 &&
	chmod -rx SANETESTD.2 ||
	error "bug in test sript: cannot prepare SANETESTD"

	! rm SANETESTD.1/x && ! test -f SANETESTD.2/x
	status=$?

	chmod +rwx SANETESTD.1 SANETESTD.2 &&
	rm -rf SANETESTD.1 SANETESTD.2 ||
	error "bug in test sript: cannot clean SANETESTD"
	return $status

)
[master (root-commit) 6cdf070] add a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a
ok 38 - normalize path: /dir/. => /dir/

ok 219 - non-existent file in subdir a/ ignored with --verbose -n

expecting success: 
				expect '.gitignore:1:one	a/one' &&
				test_check_ignore 'a/one'
			
expecting success: test "$(test-path-utils normalize_path_copy '/dir///./')" = '/dir/'
ok 39 - normalize path: /dir///./ => /dir/

rm: cannot remove 'SANETESTD.1/x': Permission denied
[master ad01e7c] add b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 b
expecting success: test "$(test-path-utils normalize_path_copy '/dir//sub/..')" = '/dir/'
ok 1 - setup

expecting success: 
	test-revision-walking run-twice >run_twice_actual &&
	test_cmp run_twice_expected run_twice_actual

ok 220 - non-existent file in subdir a/ ignored with --verbose --non-matching

prerequisite SANITY ok
expecting success: 
	mkdir local-command &&
	test_when_finished "chmod u+rwx local-command && rm -fr local-command" &&
	git config alias.nitfol "!echo frotz" &&
	chmod a-rx local-command &&
	(
		PATH=./local-command:$PATH &&
		git nitfol >actual
	) &&
	echo frotz >expect &&
	test_cmp expect actual

ok 40 - normalize path: /dir//sub/.. => /dir/

expecting success: test "$(test-path-utils normalize_path_copy '/dir/sub/../')" = '/dir/'
ok 2 - revision walking can be done twice

expecting success: 
		expect "$expect" &&
		eval "$code"
	
# passed all 2 test(s)
1..2
ok 41 - normalize path: /dir/sub/../ => /dir/

expecting success: test "$(test-path-utils normalize_path_copy '//dir/sub/../.')" = '/dir/'
*** t0063-string-list.sh ***
ok 42 - normalize path: //dir/sub/../. => /dir/

ok 4 - unreadable directory in PATH

ok 221 - non-existent file in subdir a/ ignored with --no-index

expecting success: test "$(test-path-utils normalize_path_copy '/dir/s1/../s2/')" = '/dir/s2/'
expecting success: 
			expect '' &&
			test_check_ignore 'a/one'
		
# passed all 4 test(s)
1..4
ok 43 - normalize path: /dir/s1/../s2/ => /dir/s2/

expecting success: test "$(test-path-utils normalize_path_copy '/d1/s1///s2/..//../s3/')" = '/d1/s3/'
*** t0064-sha1-array.sh ***
ok 222 - non-existent file in subdir a/ ignored with --no-index -q

expecting success: 
			expect '' &&
			test_check_ignore 'a/one'
		
ok 44 - normalize path: /d1/s1///s2/..//../s3/ => /d1/s3/

expecting success: test "$(test-path-utils normalize_path_copy '/d1/s1//../s2/../../d2')" = '/d2'
ok 45 - normalize path: /d1/s1//../s2/../../d2 => /d2

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0063-string-list/.git/
expecting success: test "$(test-path-utils normalize_path_copy '/d1/.../d2')" = '/d1/.../d2'
ok 223 - non-existent file in subdir a/ ignored with --no-index --quiet

expecting success: 
				expect '.gitignore:1:one	a/one' &&
				test_check_ignore 'a/one'
			
ok 46 - normalize path: /d1/.../d2 => /d1/.../d2

expecting success: 
		test-string-list split 'foo:bar:baz' ':' '-1' >actual &&
		test_cmp expected actual &&
		test-string-list split_in_place 'foo:bar:baz' ':' '-1' >actual &&
		test_cmp expected actual
	
expecting success: test "$(test-path-utils normalize_path_copy '/d1/..././../d2')" = '/d1/d2'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0064-sha1-array/.git/
ok 224 - non-existent file in subdir a/ ignored with --no-index -v

expecting success: 
				expect '.gitignore:1:one	a/one' &&
				test_check_ignore 'a/one'
			
ok 1 - split foo:bar:baz at :, max -1

ok 47 - normalize path: /d1/..././../d2 => /d1/d2

expecting success: actual=$(test-path-utils longest_ancestor_length '/' '/') &&
	 test "$actual" = '-1'
expecting success: 
		test-string-list split 'foo:bar:baz' ':' '0' >actual &&
		test_cmp expected actual &&
		test-string-list split_in_place 'foo:bar:baz' ':' '0' >actual &&
		test_cmp expected actual
	
expecting success: 
	echo20 "" 44 55 88 aa >expect &&
	{
		echo20 append 88 44 aa 55 &&
		echo for_each_unique
	} | test-sha1-array >actual &&
	test_cmp expect actual

ok 48 - longest ancestor: / / => -1

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo' '/') &&
	 test "$actual" = '0'
ok 1 - ordered enumeration

expecting success: 
	echo20 "" 44 55 88 aa >expect &&
	{
		echo20 append 88 44 aa 55 &&
		echo20 append 88 44 aa 55 &&
		echo for_each_unique
	} | test-sha1-array >actual &&
	test_cmp expect actual

ok 49 - longest ancestor: /foo / => 0

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo' '/fo') &&
	 test "$actual" = '-1'
ok 225 - non-existent file in subdir a/ ignored with --no-index -v -n

expecting success: 
				expect '.gitignore:1:one	a/one' &&
				test_check_ignore 'a/one'
			
ok 50 - longest ancestor: /foo /fo => -1

ok 2 - ordered enumeration with duplicate suppression

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo' '/foo') &&
	 test "$actual" = '-1'
expecting success: 
	{
		echo20 append 88 44 aa 55 &&
		echo20 lookup 55
	} | test-sha1-array >actual &&
	n=$(cat actual) &&
	test "$n" -eq 1

ok 2 - split foo:bar:baz at :, max 0

expecting success: 
		test-string-list split 'foo:bar:baz' ':' '1' >actual &&
		test_cmp expected actual &&
		test-string-list split_in_place 'foo:bar:baz' ':' '1' >actual &&
		test_cmp expected actual
	
ok 51 - longest ancestor: /foo /foo => -1

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo' '/bar') &&
	 test "$actual" = '-1'
ok 3 - lookup

expecting success: 
	{
		echo20 append 88 44 aa 55 &&
		echo20 lookup 33
	} | test-sha1-array >actual &&
	n=$(cat actual) &&
	test "$n" -lt 0

ok 226 - non-existent file in subdir a/ ignored with --no-index -v --non-matching

expecting success: 
				expect '.gitignore:1:one	a/one' &&
				test_check_ignore 'a/one'
			
ok 52 - longest ancestor: /foo /bar => -1

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo' '/foo/bar') &&
	 test "$actual" = '-1'
ok 3 - split foo:bar:baz at :, max 1

expecting success: 
		test-string-list split 'foo:bar:baz' ':' '2' >actual &&
		test_cmp expected actual &&
		test-string-list split_in_place 'foo:bar:baz' ':' '2' >actual &&
		test_cmp expected actual
	
ok 4 - lookup non-existing entry

expecting success: 
	{
		echo20 append 88 44 aa 55 &&
		echo20 append 88 44 aa 55 &&
		echo20 lookup 55
	} | test-sha1-array >actual &&
	n=$(cat actual) &&
	test "$n" -ge 2 &&
	test "$n" -le 3

ok 53 - longest ancestor: /foo /foo/bar => -1

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo' '/foo:/bar') &&
	 test "$actual" = '-1'
ok 54 - longest ancestor: /foo /foo:/bar => -1

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo' '/:/foo:/bar') &&
	 test "$actual" = '0'
ok 227 - non-existent file in subdir a/ ignored with --no-index --verbose

expecting success: 
				expect '.gitignore:1:one	a/one' &&
				test_check_ignore 'a/one'
			
ok 5 - lookup with duplicates

expecting success: 
	{
		echo20 append 88 44 aa 55 &&
		echo20 append 88 44 aa 55 &&
		echo20 lookup 66
	} | test-sha1-array >actual &&
	n=$(cat actual) &&
	test "$n" -lt 0

ok 55 - longest ancestor: /foo /:/foo:/bar => 0

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo' '/foo:/:/bar') &&
	 test "$actual" = '0'
ok 4 - split foo:bar:baz at :, max 2

expecting success: 
		test-string-list split 'foo:bar:' ':' '-1' >actual &&
		test_cmp expected actual &&
		test-string-list split_in_place 'foo:bar:' ':' '-1' >actual &&
		test_cmp expected actual
	
ok 56 - longest ancestor: /foo /foo:/:/bar => 0

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo' '/:/bar:/foo') &&
	 test "$actual" = '0'
ok 6 - lookup non-existing entry with duplicates

expecting success: 
	{
		echo "append 5555555555555555555555555555555555555555" &&
		echo "append 555555555555555555555555555555555555555f" &&
		echo20 lookup 55
	} | test-sha1-array >actual &&
	n=$(cat actual) &&
	test "$n" -eq 0

ok 228 - non-existent file in subdir a/ ignored with --no-index --verbose -n

expecting success: 
				expect '.gitignore:1:one	a/one' &&
				test_check_ignore 'a/one'
			
ok 57 - longest ancestor: /foo /:/bar:/foo => 0

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo/bar' '/') &&
	 test "$actual" = '0'
ok 58 - longest ancestor: /foo/bar / => 0

ok 7 - lookup with almost duplicate values

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo/bar' '/fo') &&
	 test "$actual" = '-1'
expecting success: 
	{
		echo20 append 55 55 &&
		echo20 lookup 55
	} | test-sha1-array >actual &&
	n=$(cat actual) &&
	test "$n" -ge 0 &&
	test "$n" -le 1

ok 5 - split foo:bar: at :, max -1

expecting success: 
		test-string-list split '' ':' '-1' >actual &&
		test_cmp expected actual &&
		test-string-list split_in_place '' ':' '-1' >actual &&
		test_cmp expected actual
	
ok 8 - lookup with single duplicate value

ok 59 - longest ancestor: /foo/bar /fo => -1

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo/bar' '/foo') &&
	 test "$actual" = '4'
ok 229 - non-existent file in subdir a/ ignored with --no-index --verbose --non-matching

# passed all 8 test(s)
1..8
ok 60 - longest ancestor: /foo/bar /foo => 4

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo/bar' '/foo/ba') &&
	 test "$actual" = '-1'
expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 61 - longest ancestor: /foo/bar /foo/ba => -1

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo/bar' '/:/fo') &&
	 test "$actual" = '0'
*** t0070-fundamental.sh ***
ok 6 - split  at :, max -1

expecting success: 
		test-string-list split ':' ':' '-1' >actual &&
		test_cmp expected actual &&
		test-string-list split_in_place ':' ':' '-1' >actual &&
		test_cmp expected actual
	
ok 62 - longest ancestor: /foo/bar /:/fo => 0

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo/bar' '/foo:/foo/ba') &&
	 test "$actual" = '4'
ok 230 - existing untracked file in subdir a/ not ignored

expecting success: 
			expect '' &&
			test_check_ignore 'a/not-ignored' 1
		
ok 63 - longest ancestor: /foo/bar /foo:/foo/ba => 4

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo/bar' '/bar') &&
	 test "$actual" = '-1'
ok 7 - split : at :, max -1

expecting success: 
	test "x-" = "x$(test-string-list filter - y)" &&
	test "x-" = "x$(test-string-list filter no y)" &&
	test yes = "$(test-string-list filter yes y)" &&
	test yes = "$(test-string-list filter no:yes y)" &&
	test yes = "$(test-string-list filter yes:no y)" &&
	test y1:y2 = "$(test-string-list filter y1:y2 y)" &&
	test y2:y1 = "$(test-string-list filter y2:y1 y)" &&
	test "x-" = "x$(test-string-list filter x1:x2 y)"

ok 64 - longest ancestor: /foo/bar /bar => -1

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo/bar' '/fo') &&
	 test "$actual" = '-1'
ok 231 - existing untracked file in subdir a/ not ignored with -q

expecting success: 
			expect '' &&
			test_check_ignore 'a/not-ignored' 1
		
ok 65 - longest ancestor: /foo/bar /fo => -1

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo/bar' '/foo:/bar') &&
	 test "$actual" = '4'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0070-fundamental/.git/
ok 66 - longest ancestor: /foo/bar /foo:/bar => 4

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo/bar' '/:/foo:/bar') &&
	 test "$actual" = '4'
ok 232 - existing untracked file in subdir a/ not ignored with --quiet

expecting success: 
				expect '' &&
				test_check_ignore 'a/not-ignored' 1
			
expecting success: 
	test-ctype

ok 67 - longest ancestor: /foo/bar /:/foo:/bar => 4

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo/bar' '/foo:/:/bar') &&
	 test "$actual" = '4'
ok 1 - character classes (isspace, isalpha etc.)

expecting success: 
	test_must_fail test-mktemp doesnotexist/testXXXXXX 2>err &&
	grep "doesnotexist/test" err

ok 233 - existing untracked file in subdir a/ not ignored with -v

expecting success: 
				expect '::	a/not-ignored' &&
				test_check_ignore 'a/not-ignored' 1
			
ok 68 - longest ancestor: /foo/bar /foo:/:/bar => 4

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo/bar' '/:/bar:/fo') &&
	 test "$actual" = '0'
ok 69 - longest ancestor: /foo/bar /:/bar:/fo => 0

fatal: Unable to create temporary file '/«PKGBUILDDIR»/t/trash directory.t0070-fundamental/doesnotexist/testX7EAQv': No such file or directory
expecting success: actual=$(test-path-utils longest_ancestor_length '/foo/bar' '/:/bar') &&
	 test "$actual" = '0'
ok 2 - mktemp to nonexistent directory prints filename

ok 8 - test filter_string_list

expecting success: 
	test "x-" = "x$(test-string-list remove_duplicates -)" &&
	test "x" = "x$(test-string-list remove_duplicates "")" &&
	test a = "$(test-string-list remove_duplicates a)" &&
	test a = "$(test-string-list remove_duplicates a:a)" &&
	test a = "$(test-string-list remove_duplicates a:a:a:a:a)" &&
	test a:b = "$(test-string-list remove_duplicates a:b)" &&
	test a:b = "$(test-string-list remove_duplicates a:a:b)" &&
	test a:b = "$(test-string-list remove_duplicates a:b:b)" &&
	test a:b:c = "$(test-string-list remove_duplicates a:b:c)" &&
	test a:b:c = "$(test-string-list remove_duplicates a:a:b:c)" &&
	test a:b:c = "$(test-string-list remove_duplicates a:b:b:c)" &&
	test a:b:c = "$(test-string-list remove_duplicates a:b:c:c)" &&
	test a:b:c = "$(test-string-list remove_duplicates a:a:b:b:c:c)" &&
	test a:b:c = "$(test-string-list remove_duplicates a:a:a:b:b:b:c:c:c)"

checking prerequisite: SANITY

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	mkdir SANETESTD.1 SANETESTD.2 &&

	chmod +w SANETESTD.1 SANETESTD.2 &&
	>SANETESTD.1/x 2>SANETESTD.2/x &&
	chmod -w SANETESTD.1 &&
	chmod -rx SANETESTD.2 ||
	error "bug in test sript: cannot prepare SANETESTD"

	! rm SANETESTD.1/x && ! test -f SANETESTD.2/x
	status=$?

	chmod +rwx SANETESTD.1 SANETESTD.2 &&
	rm -rf SANETESTD.1 SANETESTD.2 ||
	error "bug in test sript: cannot clean SANETESTD"
	return $status

)
ok 70 - longest ancestor: /foo/bar /:/bar => 0

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo/bar' '/foo') &&
	 test "$actual" = '4'
ok 234 - existing untracked file in subdir a/ not ignored with -v -n

expecting success: 
				expect '::	a/not-ignored' &&
				test_check_ignore 'a/not-ignored' 1
			
ok 71 - longest ancestor: /foo/bar /foo => 4

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo/bar' '/foo:/bar') &&
	 test "$actual" = '4'
ok 72 - longest ancestor: /foo/bar /foo:/bar => 4

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo/bar' '/bar') &&
	 test "$actual" = '-1'
rm: cannot remove 'SANETESTD.1/x': Permission denied
ok 235 - existing untracked file in subdir a/ not ignored with -v --non-matching

expecting success: 
				expect '' &&
				test_check_ignore 'a/not-ignored' 1
			
ok 73 - longest ancestor: /foo/bar /bar => -1

expecting success: 
	test c:/msysgit = $(test-path-utils strip_path_suffix \
		c:/msysgit/libexec//git-core libexec/git-core)

prerequisite SANITY ok
expecting success: 
	mkdir cannotwrite &&
	chmod -w cannotwrite &&
	test_when_finished "chmod +w cannotwrite" &&
	test_must_fail test-mktemp cannotwrite/testXXXXXX 2>err &&
	grep "cannotwrite/test" err

ok 74 - strip_path_suffix

expecting success: 
	test_must_fail test-path-utils absolute_path ""

fatal: The empty string is not a valid path
ok 75 - absolute path rejects the empty string

expecting success: 
	test_must_fail test-path-utils real_path ""

ok 236 - existing untracked file in subdir a/ not ignored with --verbose

expecting success: 
				expect '::	a/not-ignored' &&
				test_check_ignore 'a/not-ignored' 1
			
fatal: Unable to create temporary file '/«PKGBUILDDIR»/t/trash directory.t0070-fundamental/cannotwrite/testlsy7ZK': Permission denied
fatal: The empty string is not a valid path
ok 76 - real path rejects the empty string

ok 3 - mktemp to unwritable directory prints filename

expecting success: 
	git commit --allow-empty -m message <&-

expecting success: 
	nopath="hopefully-absent-path" &&
	test "/" = "$(test-path-utils real_path "/")" &&
	test "/$nopath" = "$(test-path-utils real_path "/$nopath")"

ok 237 - existing untracked file in subdir a/ not ignored with --verbose -n

expecting success: 
				expect '::	a/not-ignored' &&
				test_check_ignore 'a/not-ignored' 1
			
[master (root-commit) ffce11e] message
 Author: A U Thor <author@example.com>
ok 4 - git_mkstemps_mode does not fail if fd 0 is not open

expecting success: 
	# if this test fails, re-build git with NO_REGEX=1
	test-regex

ok 77 - real path works on absolute paths 1

expecting success: 
	nopath="hopefully-absent-path" &&
	# Find an existing top-level directory for the remaining tests:
	d=$(pwd -P | sed -e "s|^\([^/]*/[^/]*\)/.*|\1|") &&
	test "$d" = "$(test-path-utils real_path "$d")" &&
	test "$d/$nopath" = "$(test-path-utils real_path "$d/$nopath")"

ok 5 - check for a bug in the regex routines

ok 9 - test remove_duplicates

# passed all 9 test(s)
1..9
ok 238 - existing untracked file in subdir a/ not ignored with --verbose --non-matching

# passed all 5 test(s)
1..5
ok 78 - real path works on absolute paths 2

expecting success: 
		expect "$expect" &&
		eval "$code"
	
expecting success: 
	nopath="hopefully-absent-path" &&
	test "/" = "$(test-path-utils real_path "///")" &&
	test "/$nopath" = "$(test-path-utils real_path "///$nopath")" &&
	# Find an existing top-level directory for the remaining tests:
	d=$(pwd -P | sed -e "s|^\([^/]*/[^/]*\)/.*|\1|") &&
	test "$d" = "$(test-path-utils real_path "//$d")" &&
	test "$d/$nopath" = "$(test-path-utils real_path "//$d/$nopath")"

*** t0081-line-buffer.sh ***
ok 239 - existing untracked file in subdir a/ not ignored with --no-index

*** t0090-cache-tree.sh ***
expecting success: 
			expect '' &&
			test_check_ignore 'a/not-ignored' 1
		
ok 79 - real path removes extra leading slashes

expecting success: 
	nopath="hopefully-absent-path" &&
	# Find an existing top-level directory for the remaining tests:
	d=$(pwd -P | sed -e "s|^\([^/]*/[^/]*\)/.*|\1|") &&
	test "$d" = "$(test-path-utils real_path "$d///")" &&
	test "$d/$nopath" = "$(test-path-utils real_path "$d///$nopath")"

ok 240 - existing untracked file in subdir a/ not ignored with --no-index -q

expecting success: 
			expect '' &&
			test_check_ignore 'a/not-ignored' 1
		
ok 80 - real path removes other extra slashes

ok 241 - existing untracked file in subdir a/ not ignored with --no-index --quiet

expecting success: 
				expect '' &&
				test_check_ignore 'a/not-ignored' 1
			
checking prerequisite: SYMLINKS

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	# test whether the filesystem supports symbolic links
	ln -s x y && test -h y

)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0081-line-buffer/.git/
prerequisite SYMLINKS ok
expecting success: 
	mkdir first &&
	ln -s ../.git first/.git &&
	mkdir second &&
	ln -s ../first second/other &&
	mkdir third &&
	dir="$(cd .git; pwd -P)" &&
	dir2=third/../second/other/.git &&
	test "$dir" = "$(test-path-utils real_path $dir2)" &&
	file="$dir"/index &&
	test "$file" = "$(test-path-utils real_path $dir2/index)" &&
	basename=blub &&
	test "$dir/$basename" = "$(cd .git && test-path-utils real_path "$basename")" &&
	ln -s ../first/file .git/syml &&
	sym="$(cd first; pwd -P)"/file &&
	test "$sym" = "$(test-path-utils real_path "$dir2/syml")"

expecting success: 
	echo ">HELLO" >expect &&
	test-line-buffer <<-\EOF >actual &&
	binary 6
	HELLO
	EOF
	test_cmp expect actual

ok 242 - existing untracked file in subdir a/ not ignored with --no-index -v

expecting success: 
				expect '::	a/not-ignored' &&
				test_check_ignore 'a/not-ignored' 1
			
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0090-cache-tree/.git/
expecting success: 
	test_commit foo &&
	test_cache_tree

ok 1 - hello world

expecting success: 
	echo ">HELLO" >expect &&
	test-line-buffer <<-\EOF >actual &&
	binary 0
	copy 6
	HELLO
	EOF
	test_cmp expect actual

ok 243 - existing untracked file in subdir a/ not ignored with --no-index -v -n

expecting success: 
				expect '::	a/not-ignored' &&
				test_check_ignore 'a/not-ignored' 1
			
ok 2 - 0-length read, send along greeting

expecting success: 
	rm -f input &&
	echo hello >expect &&
	echo hello >input &&
	echo copy 6 |
	test-line-buffer "&4" 4<input >actual &&
	test_cmp expect actual

[master (root-commit) ddd63c9] foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo.t
ok 3 - read from file descriptor

expecting success: 
	echo Q | q_to_nul >expect &&
	q_to_nul <<-\EOF | test-line-buffer >actual &&
	skip 2
	Q
	copy 2
	Q
	EOF
	test_cmp expect actual

ok 244 - existing untracked file in subdir a/ not ignored with --no-index -v --non-matching

expecting success: 
				expect '' &&
				test_check_ignore 'a/not-ignored' 1
			
ok 81 - real path works on symlinks

expecting success: 
	ln -s target symlink &&
	test "$(test-path-utils prefix_path prefix "$(pwd)/symlink")" = "symlink"

ok 82 - prefix_path works with absolute paths to work tree symlinks

expecting success: 
	echo "" >expected &&
	test-path-utils prefix_path prefix "$(pwd)" >actual &&
	test_cmp expected actual

ok 4 - skip, copy null byte

expecting success: 
	echo ">QhelloQ" | q_to_nul >expect &&
	q_to_nul <<-\EOF | test-line-buffer >actual &&
	binary 8
	QhelloQ
	EOF
	test_cmp expect actual

ok 245 - existing untracked file in subdir a/ not ignored with --no-index --verbose

expecting success: 
				expect '::	a/not-ignored' &&
				test_check_ignore 'a/not-ignored' 1
			
ok 83 - prefix_path works with only absolute path to work tree

expecting success: 
	test_must_fail test-path-utils prefix_path prefix "$(pwd)a"

ok 246 - existing untracked file in subdir a/ not ignored with --no-index --verbose -n

expecting success: 
				expect '::	a/not-ignored' &&
				test_check_ignore 'a/not-ignored' 1
			
ok 1 - initial commit has cache-tree

expecting success: 
	git read-tree HEAD &&
	test_cache_tree

fatal: '/«PKGBUILDDIR»/t/trash directory.t0060-path-utilsa' is outside repository
ok 84 - prefix_path rejects absolute path to dir with same beginning as work tree

expecting success: 
	git init repo &&
	ln -s repo repolink &&
	test "a" = "$(cd repo && test-path-utils prefix_path prefix "$(pwd)/../repolink/a")"

ok 5 - read null byte

expecting success: 
	echo ">foo" >expect &&
	test-line-buffer <<-\EOF >actual &&
	binary 5
	foo
	EOF
	test_cmp expect actual

ok 247 - existing untracked file in subdir a/ not ignored with --no-index --verbose --non-matching

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0060-path-utils/repo/.git/
ok 6 - long reads are truncated

expecting success: 
	printf "%s\n" ">" foo >expect &&
	test-line-buffer <<-\EOF >actual &&
	binary 1

	copy 5
	foo
	EOF
	test_cmp expect actual

expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 7 - long copies are truncated

expecting success: 
	echo ">foo" >expect &&
	test-line-buffer <<-\EOF >actual &&
	binary 5
	foo
	EOF
	test_cmp expect actual

ok 85 - prefix_path works with absolute path to a symlink to work tree having  same beginning as work tree

expecting success: test "$(test-path-utils relative_path '/foo/a/b/c/' '/foo/a/b/')" = 'c/'
ok 8 - long binary reads are truncated
ok 86 - relative path: /foo/a/b/c/ /foo/a/b/ => c/


ok 248 - existing tracked file in subdir a/ not ignored

# passed all 8 test(s)
1..8
expecting success: test "$(test-path-utils relative_path '/foo/a/b/c/' '/foo/a/b')" = 'c/'
expecting success: 
			expect '' &&
			test_check_ignore 'a/ignored-but-in-index' 1
		
ok 87 - relative path: /foo/a/b/c/ /foo/a/b => c/

ok 2 - read-tree HEAD establishes cache-tree

expecting success: 
	test_when_finished "git reset --hard; git read-tree HEAD" &&
	echo "I changed this file" >foo &&
	git add foo &&
	test_invalid_cache_tree

expecting success: test "$(test-path-utils relative_path '/foo/a//b//c/' '///foo/a/b//')" = 'c/'
ok 249 - existing tracked file in subdir a/ not ignored with -q

expecting success: 
			expect '' &&
			test_check_ignore 'a/ignored-but-in-index' 1
		
*** t0100-previous.sh ***
ok 88 - relative path: /foo/a//b//c/ ///foo/a/b// => c/

expecting success: test "$(test-path-utils relative_path '/foo/a/b' '/foo/a/b')" = './'
ok 250 - existing tracked file in subdir a/ not ignored with --quiet

expecting success: 
				expect '' &&
				test_check_ignore 'a/ignored-but-in-index' 1
			
ok 89 - relative path: /foo/a/b /foo/a/b => ./

HEAD is now at ddd63c9 foo
expecting success: test "$(test-path-utils relative_path '/foo/a/b/' '/foo/a/b')" = './'
ok 3 - git-add invalidates cache-tree

expecting success: 
	test_when_finished "git reset --hard; git read-tree HEAD" &&
	mkdir dirx &&
	echo "I changed this file" >dirx/foo &&
	git add dirx/foo &&
	test_invalid_cache_tree

ok 251 - existing tracked file in subdir a/ not ignored with -v

ok 90 - relative path: /foo/a/b/ /foo/a/b => ./

expecting success: 
				expect '::	a/ignored-but-in-index' &&
				test_check_ignore 'a/ignored-but-in-index' 1
			
expecting success: test "$(test-path-utils relative_path '/foo/a' '/foo/a/b')" = '../'
ok 91 - relative path: /foo/a /foo/a/b => ../

ok 252 - existing tracked file in subdir a/ not ignored with -v -n

expecting success: 
				expect '::	a/ignored-but-in-index' &&
				test_check_ignore 'a/ignored-but-in-index' 1
			
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0100-previous/.git/
expecting success: test "$(test-path-utils relative_path '/' '/foo/a/b/')" = '../../../'
error: invalid object 040000 59d259507ddf2acc00997a8b70c61d7bdc240440 for 'dirx'
expecting success: 
	test_commit A &&
	git checkout -b junk &&
	git checkout - &&
	test "$(git symbolic-ref HEAD)" = refs/heads/master &&
	git branch -d @{-1} &&
	test_must_fail git rev-parse --verify refs/heads/junk

ok 92 - relative path: / /foo/a/b/ => ../../../

ok 253 - existing tracked file in subdir a/ not ignored with -v --non-matching

expecting success: 
				expect '' &&
				test_check_ignore 'a/ignored-but-in-index' 1
			
expecting success: test "$(test-path-utils relative_path '/foo/a/c' '/foo/a/b/')" = '../c'
HEAD is now at ddd63c9 foo
ok 93 - relative path: /foo/a/c /foo/a/b/ => ../c

ok 4 - git-add in subdir invalidates cache-tree

[master (root-commit) 0ddfaf1] A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 A.t
ok 254 - existing tracked file in subdir a/ not ignored with --verbose

expecting success: 
				expect '::	a/ignored-but-in-index' &&
				test_check_ignore 'a/ignored-but-in-index' 1
			
expecting success: test "$(test-path-utils relative_path '/foo/a/c' '/foo/a/b')" = '../c'
expecting success: 
	git tag no-children &&
	test_when_finished "git reset --hard no-children; git read-tree HEAD" &&
	mkdir dir1 dir2 &&
	test_commit dir1/a &&
	test_commit dir2/b &&
	echo "I changed this file" >dir1/a &&
	cmp_cache_tree before &&
	echo "I changed this file" >dir1/a &&
	git add dir1/a &&
	cmp_cache_tree expect

ok 94 - relative path: /foo/a/c /foo/a/b => ../c

expecting success: test "$(test-path-utils relative_path '/foo/x/y' '/foo/a/b/')" = '../../x/y'
Switched to a new branch 'junk'
ok 255 - existing tracked file in subdir a/ not ignored with --verbose -n

expecting success: 
				expect '::	a/ignored-but-in-index' &&
				test_check_ignore 'a/ignored-but-in-index' 1
			
ok 95 - relative path: /foo/x/y /foo/a/b/ => ../../x/y

Switched to branch 'master'
expecting success: test "$(test-path-utils relative_path '/foo/a/b' '<empty>')" = '/foo/a/b'
ok 96 - relative path: /foo/a/b <empty> => /foo/a/b
ok 256 - existing tracked file in subdir a/ not ignored with --verbose --non-matching


[master 365c8fc] dir1/a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 dir1/a.t
expecting success: test "$(test-path-utils relative_path '/foo/a/b' '<null>')" = '/foo/a/b'
Deleted branch junk (was 0ddfaf1).
ok 97 - relative path: /foo/a/b <null> => /foo/a/b

expecting success: 
		expect "$expect" &&
		eval "$code"
	
fatal: Needed a single revision
ok 1 - branch -d @{-1}

expecting success: 
	git reflog expire --expire=now &&
	git checkout -b junk2 &&
	git checkout - &&
	test "$(git symbolic-ref HEAD)" = refs/heads/master &&
	test_must_fail git branch -d @{-12} &&
	git rev-parse --verify refs/heads/master

expecting success: test "$(test-path-utils relative_path 'foo/a/b/c/' 'foo/a/b/')" = 'c/'
ok 98 - relative path: foo/a/b/c/ foo/a/b/ => c/

expecting success: test "$(test-path-utils relative_path 'foo/a/b/c/' 'foo/a/b')" = 'c/'
Switched to a new branch 'junk2'
ok 99 - relative path: foo/a/b/c/ foo/a/b => c/

ok 257 - existing tracked file in subdir a/ shown as ignored with --no-index

[master 8be4607] dir2/b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 dir2/b.t
expecting success: test "$(test-path-utils relative_path 'foo/a/b//c' 'foo/a//b')" = 'c'
Switched to branch 'master'
expecting success: 
			expect '' &&
			test_check_ignore 'a/ignored-but-in-index'
		
ok 100 - relative path: foo/a/b//c foo/a//b => c

expecting success: test "$(test-path-utils relative_path 'foo/a/b/' 'foo/a/b/')" = './'
error: branch '@{-12}' not found.
0ddfaf193ff13d6ab39b7cbd9eed645e3ee2f050
ok 101 - relative path: foo/a/b/ foo/a/b/ => ./

ok 2 - branch -d @{-12} when there is not enough switches yet

expecting success: 
	git checkout A &&
	test_commit B &&
	git checkout A &&
	test_commit C &&
	test_commit D &&
	git branch -f master B &&
	git branch -f other &&
	git checkout other &&
	git checkout master &&
	git merge @{-1} &&
	git cat-file commit HEAD | grep "Merge branch 'other'"

ok 258 - existing tracked file in subdir a/ shown as ignored with --no-index -q

expecting success: 
			expect '' &&
			test_check_ignore 'a/ignored-but-in-index'
		
expecting success: test "$(test-path-utils relative_path 'foo/a/b/' 'foo/a/b')" = './'
ok 102 - relative path: foo/a/b/ foo/a/b => ./

Note: checking out 'A'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 0ddfaf1... A
expecting success: test "$(test-path-utils relative_path 'foo/a' 'foo/a/b')" = '../'
ok 259 - existing tracked file in subdir a/ shown as ignored with --no-index --quiet

expecting success: 
				expect '.gitignore:2:ignored-*	a/ignored-but-in-index' &&
				test_check_ignore 'a/ignored-but-in-index'
			
ok 103 - relative path: foo/a foo/a/b => ../

error: invalid object 040000 3b5b859722b671676295bf3795f34b8c6f2393f5 for 'dir1'
expecting success: test "$(test-path-utils relative_path 'foo/x/y' 'foo/a/b')" = '../../x/y'
[detached HEAD d9df450] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 B.t
ok 260 - existing tracked file in subdir a/ shown as ignored with --no-index -v

expecting success: 
				expect '.gitignore:2:ignored-*	a/ignored-but-in-index' &&
				test_check_ignore 'a/ignored-but-in-index'
			
ok 104 - relative path: foo/x/y foo/a/b => ../../x/y

expecting success: test "$(test-path-utils relative_path 'foo/a/c' 'foo/a/b')" = '../c'
Previous HEAD position was d9df450... B
HEAD is now at 0ddfaf1... A
ok 105 - relative path: foo/a/c foo/a/b => ../c

HEAD is now at ddd63c9 foo
ok 261 - existing tracked file in subdir a/ shown as ignored with --no-index -v -n

expecting success: 
				expect '.gitignore:2:ignored-*	a/ignored-but-in-index' &&
				test_check_ignore 'a/ignored-but-in-index'
			
expecting success: test "$(test-path-utils relative_path 'foo/a/b' '/foo/x/y')" = 'foo/a/b'
[detached HEAD 5dee784] C
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 C.t
ok 106 - relative path: foo/a/b /foo/x/y => foo/a/b

ok 5 - git-add in subdir does not invalidate sibling cache-tree

expecting success: 
	test_when_finished "git reset --hard; git read-tree HEAD" &&
	echo "I changed this file" >foo &&
	git update-index --add foo &&
	test_invalid_cache_tree

expecting success: test "$(test-path-utils relative_path '/foo/a/b' 'foo/x/y')" = '/foo/a/b'
ok 262 - existing tracked file in subdir a/ shown as ignored with --no-index -v --non-matching

expecting success: 
				expect '.gitignore:2:ignored-*	a/ignored-but-in-index' &&
				test_check_ignore 'a/ignored-but-in-index'
			
ok 107 - relative path: /foo/a/b foo/x/y => /foo/a/b

skipping test: relative path: d:/a/b D:/a/c => ../b test "$(test-path-utils relative_path 'd:/a/b' 'D:/a/c')" = '../b'
ok 108 # skip relative path: d:/a/b D:/a/c => ../b (missing MINGW)

skipping test: relative path: C:/a/b D:/a/c => C:/a/b test "$(test-path-utils relative_path 'C:/a/b' 'D:/a/c')" = 'C:/a/b'
ok 109 # skip relative path: C:/a/b D:/a/c => C:/a/b (missing MINGW)

ok 263 - existing tracked file in subdir a/ shown as ignored with --no-index --verbose

expecting success: 
				expect '.gitignore:2:ignored-*	a/ignored-but-in-index' &&
				test_check_ignore 'a/ignored-but-in-index'
			
expecting success: test "$(test-path-utils relative_path 'foo/a/b' '<empty>')" = 'foo/a/b'
[detached HEAD 12bd07b] D
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 D.t
HEAD is now at ddd63c9 foo
ok 110 - relative path: foo/a/b <empty> => foo/a/b

ok 6 - update-index invalidates cache-tree

expecting success: 
	test-scrap-cache-tree &&
	git write-tree &&
	test_cache_tree

expecting success: test "$(test-path-utils relative_path 'foo/a/b' '<null>')" = 'foo/a/b'
ok 264 - existing tracked file in subdir a/ shown as ignored with --no-index --verbose -n

expecting success: 
				expect '.gitignore:2:ignored-*	a/ignored-but-in-index' &&
				test_check_ignore 'a/ignored-but-in-index'
			
ok 111 - relative path: foo/a/b <null> => foo/a/b

expecting success: test "$(test-path-utils relative_path '<empty>' '/foo/a/b')" = './'
64fd3796c57084e7b8cbae358ce37970b8e954f6
ok 112 - relative path: <empty> /foo/a/b => ./

expecting success: test "$(test-path-utils relative_path '<empty>' '<empty>')" = './'
Switched to branch 'other'
ok 265 - existing tracked file in subdir a/ shown as ignored with --no-index --verbose --non-matching

ok 113 - relative path: <empty> <empty> => ./

expecting success: 
		expect "$expect" &&
		eval "$code"
	
expecting success: test "$(test-path-utils relative_path '<empty>' '<null>')" = './'
Switched to branch 'master'
ok 114 - relative path: <empty> <null> => ./

expecting success: test "$(test-path-utils relative_path '<null>' '<empty>')" = './'
ok 115 - relative path: <null> <empty> => ./

ok 266 - existing untracked file in subdir a/ ignored

ok 7 - write-tree establishes cache-tree

expecting success: 
	git read-tree HEAD &&
	test-scrap-cache-tree &&
	test_no_cache_tree

Merging:
d9df450 B
virtual @{-1}
found 1 common ancestor:
0ddfaf1 A
Merge made by the 'recursive' strategy.
expecting success: 
			expect '' &&
			test_check_ignore 'a/ignored-and-untracked'
		
expecting success: test "$(test-path-utils relative_path '<null>' '<null>')" = './'
 C.t | 1 +
 D.t | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 C.t
 create mode 100644 D.t
ok 116 - relative path: <null> <null> => ./

Merge branch 'other'
ok 3 - merge @{-1}

expecting success: 
	git checkout master &&
	git reset --hard B &&
	git checkout other &&
	git checkout master &&
	git merge @{-1}~1 &&
	git cat-file commit HEAD >actual &&
	grep "Merge branch 'other'" actual

expecting success: test "$(test-path-utils relative_path '<null>' '/foo/a/b')" = './'
ok 117 - relative path: <null> /foo/a/b => ./

expecting success: 
		A=B git rev-parse --git-path info/grafts >actual &&
		echo .git/info/grafts >expect &&
		test_cmp expect actual
	
ok 267 - existing untracked file in subdir a/ ignored with -q

expecting success: 
			expect '' &&
			test_check_ignore 'a/ignored-and-untracked'
		
Already on 'master'
ok 118 - git-path A=B info/grafts => .git/info/grafts

expecting success: 
		GIT_GRAFT_FILE=foo git rev-parse --git-path info/grafts >actual &&
		echo foo >expect &&
		test_cmp expect actual
	
ok 8 - test-scrap-cache-tree works

expecting success: 
	test_commit bar &&
	test_cache_tree

HEAD is now at d9df450 B
ok 119 - git-path GIT_GRAFT_FILE=foo info/grafts => foo

expecting success: 
		GIT_GRAFT_FILE=foo git rev-parse --git-path info/////grafts >actual &&
		echo foo >expect &&
		test_cmp expect actual
	
ok 268 - existing untracked file in subdir a/ ignored with --quiet

expecting success: 
				expect '.gitignore:2:ignored-*	a/ignored-and-untracked' &&
				test_check_ignore 'a/ignored-and-untracked'
			
Switched to branch 'other'
ok 120 - git-path GIT_GRAFT_FILE=foo info/////grafts => foo

expecting success: 
		GIT_INDEX_FILE=foo git rev-parse --git-path index >actual &&
		echo foo >expect &&
		test_cmp expect actual
	
[master eeeeed8] bar
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bar.t
Switched to branch 'master'
ok 269 - existing untracked file in subdir a/ ignored with -v

expecting success: 
				expect '.gitignore:2:ignored-*	a/ignored-and-untracked' &&
				test_check_ignore 'a/ignored-and-untracked'
			
ok 121 - git-path GIT_INDEX_FILE=foo index => foo

expecting success: 
		GIT_INDEX_FILE=foo git rev-parse --git-path index/foo >actual &&
		echo .git/index/foo >expect &&
		test_cmp expect actual
	
Merging:
d9df450 B
virtual @{-1}~1
found 1 common ancestor:
0ddfaf1 A
Merge made by the 'recursive' strategy.
 C.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 C.t
ok 122 - git-path GIT_INDEX_FILE=foo index/foo => .git/index/foo

expecting success: 
		GIT_INDEX_FILE=foo git rev-parse --git-path index2 >actual &&
		echo .git/index2 >expect &&
		test_cmp expect actual
	
ok 270 - existing untracked file in subdir a/ ignored with -v -n

expecting success: 
				expect '.gitignore:2:ignored-*	a/ignored-and-untracked' &&
				test_check_ignore 'a/ignored-and-untracked'
			
Merge branch 'other' (early part)
ok 4 - merge @{-1}~1

expecting success: 
	git reflog expire --expire=now &&
	git checkout -f master &&
	git reset --hard B &&
	git branch -f other C &&
	git checkout other &&
	git checkout master &&
	test_must_fail git merge @{-100}

ok 123 - git-path GIT_INDEX_FILE=foo index2 => .git/index2

expecting success: mkdir foo
ok 271 - existing untracked file in subdir a/ ignored with -v --non-matching

expecting success: 
				expect '.gitignore:2:ignored-*	a/ignored-and-untracked' &&
				test_check_ignore 'a/ignored-and-untracked'
			
ok 124 - setup fake objects directory foo

ok 9 - second commit has cache-tree

expecting success: 
		GIT_OBJECT_DIRECTORY=foo git rev-parse --git-path objects >actual &&
		echo foo >expect &&
		test_cmp expect actual
	
expecting success: 
	cat <<-\EOT >foo.c &&
	int foo()
	{
		return 42;
	}
	int bar()
	{
		return 42;
	}
	EOT
	git add foo.c &&
	test_invalid_cache_tree &&
	git commit -m "add a file" &&
	test_cache_tree &&
	cat <<-\EOT >foo.c &&
	int foo()
	{
		return 43;
	}
	int bar()
	{
		return 44;
	}
	EOT
	(echo p; echo 1; echo; echo s; echo n; echo y; echo q) |
	git commit --interactive -m foo &&
	test_cache_tree

ok 125 - git-path GIT_OBJECT_DIRECTORY=foo objects => foo

expecting success: 
		GIT_OBJECT_DIRECTORY=foo git rev-parse --git-path objects/foo >actual &&
		echo foo/foo >expect &&
		test_cmp expect actual
	
Already on 'master'
ok 126 - git-path GIT_OBJECT_DIRECTORY=foo objects/foo => foo/foo

expecting success: 
		GIT_OBJECT_DIRECTORY=foo git rev-parse --git-path objects2 >actual &&
		echo .git/objects2 >expect &&
		test_cmp expect actual
	
ok 272 - existing untracked file in subdir a/ ignored with --verbose

expecting success: 
				expect '.gitignore:2:ignored-*	a/ignored-and-untracked' &&
				test_check_ignore 'a/ignored-and-untracked'
			
HEAD is now at d9df450 B
ok 127 - git-path GIT_OBJECT_DIRECTORY=foo objects2 => .git/objects2

expecting success: git --git-dir=bar init
ok 273 - existing untracked file in subdir a/ ignored with --verbose -n

expecting success: 
				expect '.gitignore:2:ignored-*	a/ignored-and-untracked' &&
				test_check_ignore 'a/ignored-and-untracked'
			
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0060-path-utils/bar/
ok 128 - setup common repository

expecting success: 
		GIT_COMMON_DIR=bar git rev-parse --git-path index >actual &&
		echo .git/index >expect &&
		test_cmp expect actual
	
[master d1075a6] add a file
 Author: A U Thor <author@example.com>
 1 file changed, 8 insertions(+)
 create mode 100644 foo.c
Switched to branch 'other'
ok 129 - git-path GIT_COMMON_DIR=bar index => .git/index

expecting success: 
		GIT_COMMON_DIR=bar git rev-parse --git-path HEAD >actual &&
		echo .git/HEAD >expect &&
		test_cmp expect actual
	
ok 274 - existing untracked file in subdir a/ ignored with --verbose --non-matching

ok 130 - git-path GIT_COMMON_DIR=bar HEAD => .git/HEAD

expecting success: 
		GIT_COMMON_DIR=bar git rev-parse --git-path logs/HEAD >actual &&
		echo .git/logs/HEAD >expect &&
		test_cmp expect actual
	
Switched to branch 'master'
expecting success: 
		expect "$expect" &&
		eval "$code"
	
merge: @{-100} - not something we can merge
ok 131 - git-path GIT_COMMON_DIR=bar logs/HEAD => .git/logs/HEAD

ok 5 - merge @{-100} before checking out that many branches yet

expecting success: 
		GIT_COMMON_DIR=bar git rev-parse --git-path objects >actual &&
		echo bar/objects >expect &&
		test_cmp expect actual
	
# passed all 5 test(s)
1..5
ok 132 - git-path GIT_COMMON_DIR=bar objects => bar/objects

expecting success: 
		GIT_COMMON_DIR=bar git rev-parse --git-path objects/bar >actual &&
		echo bar/objects/bar >expect &&
		test_cmp expect actual
	
ok 275 - existing untracked file in subdir a/ ignored with --no-index

ok 133 - git-path GIT_COMMON_DIR=bar objects/bar => bar/objects/bar

expecting success: 
		GIT_COMMON_DIR=bar git rev-parse --git-path info/exclude >actual &&
		echo bar/info/exclude >expect &&
		test_cmp expect actual
	
expecting success: 
			expect '' &&
			test_check_ignore 'a/ignored-and-untracked'
		
ok 134 - git-path GIT_COMMON_DIR=bar info/exclude => bar/info/exclude

expecting success: 
		GIT_COMMON_DIR=bar git rev-parse --git-path info/grafts >actual &&
		echo bar/info/grafts >expect &&
		test_cmp expect actual
	
*** t0101-at-syntax.sh ***
ok 135 - git-path GIT_COMMON_DIR=bar info/grafts => bar/info/grafts

expecting success: 
		GIT_COMMON_DIR=bar git rev-parse --git-path info/sparse-checkout >actual &&
		echo .git/info/sparse-checkout >expect &&
		test_cmp expect actual
	
ok 136 - git-path GIT_COMMON_DIR=bar info/sparse-checkout => .git/info/sparse-checkout

expecting success: 
		GIT_COMMON_DIR=bar git rev-parse --git-path remotes/bar >actual &&
		echo bar/remotes/bar >expect &&
		test_cmp expect actual
	
ok 276 - existing untracked file in subdir a/ ignored with --no-index -q

expecting success: 
			expect '' &&
			test_check_ignore 'a/ignored-and-untracked'
		
ok 137 - git-path GIT_COMMON_DIR=bar remotes/bar => bar/remotes/bar

expecting success: 
		GIT_COMMON_DIR=bar git rev-parse --git-path branches/bar >actual &&
		echo bar/branches/bar >expect &&
		test_cmp expect actual
	
ok 277 - existing untracked file in subdir a/ ignored with --no-index --quiet

expecting success: 
				expect '.gitignore:2:ignored-*	a/ignored-and-untracked' &&
				test_check_ignore 'a/ignored-and-untracked'
			
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0101-at-syntax/.git/
expecting success: 
	test_commit one &&
	test_commit two

ok 138 - git-path GIT_COMMON_DIR=bar branches/bar => bar/branches/bar

expecting success: 
		GIT_COMMON_DIR=bar git rev-parse --git-path logs/refs/heads/master >actual &&
		echo bar/logs/refs/heads/master >expect &&
		test_cmp expect actual
	
ok 278 - existing untracked file in subdir a/ ignored with --no-index -v

expecting success: 
				expect '.gitignore:2:ignored-*	a/ignored-and-untracked' &&
				test_check_ignore 'a/ignored-and-untracked'
			
ok 139 - git-path GIT_COMMON_DIR=bar logs/refs/heads/master => bar/logs/refs/heads/master

expecting success: 
		GIT_COMMON_DIR=bar git rev-parse --git-path refs/heads/master >actual &&
		echo bar/refs/heads/master >expect &&
		test_cmp expect actual
	
[master (root-commit) d79ce16] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
ok 140 - git-path GIT_COMMON_DIR=bar refs/heads/master => bar/refs/heads/master

expecting success: 
		GIT_COMMON_DIR=bar git rev-parse --git-path hooks/me >actual &&
		echo bar/hooks/me >expect &&
		test_cmp expect actual
	
ok 279 - existing untracked file in subdir a/ ignored with --no-index -v -n

expecting success: 
				expect '.gitignore:2:ignored-*	a/ignored-and-untracked' &&
				test_check_ignore 'a/ignored-and-untracked'
			
ok 141 - git-path GIT_COMMON_DIR=bar hooks/me => bar/hooks/me

expecting success: 
		GIT_COMMON_DIR=bar git rev-parse --git-path config >actual &&
		echo bar/config >expect &&
		test_cmp expect actual
	
ok 142 - git-path GIT_COMMON_DIR=bar config => bar/config

expecting success: 
		GIT_COMMON_DIR=bar git rev-parse --git-path packed-refs >actual &&
		echo bar/packed-refs >expect &&
		test_cmp expect actual
	
ok 280 - existing untracked file in subdir a/ ignored with --no-index -v --non-matching

expecting success: 
				expect '.gitignore:2:ignored-*	a/ignored-and-untracked' &&
				test_check_ignore 'a/ignored-and-untracked'
			
ok 143 - git-path GIT_COMMON_DIR=bar packed-refs => bar/packed-refs

expecting success: 
		GIT_COMMON_DIR=bar git rev-parse --git-path shallow >actual &&
		echo bar/shallow >expect &&
		test_cmp expect actual
	
[master 139b20d] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two.t
ok 144 - git-path GIT_COMMON_DIR=bar shallow => bar/shallow

ok 1 - setup

expecting success: 
	check_at @{0} two

ok 281 - existing untracked file in subdir a/ ignored with --no-index --verbose

expecting success: 
				expect '.gitignore:2:ignored-*	a/ignored-and-untracked' &&
				test_check_ignore 'a/ignored-and-untracked'
			
# passed all 144 test(s)
1..144
ok 2 - @{0} shows current

expecting success: 
	check_at @{1} one

ok 282 - existing untracked file in subdir a/ ignored with --no-index --verbose -n

expecting success: 
				expect '.gitignore:2:ignored-*	a/ignored-and-untracked' &&
				test_check_ignore 'a/ignored-and-untracked'
			
*** t0110-urlmatch-normalization.sh ***
ok 3 - @{1} shows old

expecting success: 
	check_at @{now} two

ok 283 - existing untracked file in subdir a/ ignored with --no-index --verbose --non-matching

ok 4 - @{now} shows current

expecting success: 
	check_at @{2001-09-17} one

expecting success: 
		expect "$expect" &&
		eval "$code"
	
warning: Log for 'master' only goes back to Thu, 7 Apr 2005 15:13:13 -0700.
ok 5 - @{2001-09-17} (before the first commit) shows old

expecting success: 
	check_at @{3.hot.dogs.on.2001-09-17} one

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0110-urlmatch-normalization/.git/
ok 284 - mix of file types in subdir a/

warning: Log for 'master' only goes back to Thu, 7 Apr 2005 15:13:13 -0700.
expecting success: 
				expect '.gitignore:1:one	a/one
.gitignore:2:ignored-*	a/ignored-and-untracked' &&
				test_check_ignore '
			a/non-existent
			a/one
			a/not-ignored
			a/ignored-but-in-index
			a/ignored-and-untracked'
		
			
expecting success: 
	! test-urlmatch-normalization "" &&
	! test-urlmatch-normalization "_" &&
	! test-urlmatch-normalization "scheme" &&
	! test-urlmatch-normalization "scheme:" &&
	! test-urlmatch-normalization "scheme:/" &&
	! test-urlmatch-normalization "scheme://" &&
	! test-urlmatch-normalization "file" &&
	! test-urlmatch-normalization "file:" &&
	! test-urlmatch-normalization "file:/" &&
	test-urlmatch-normalization "file://" &&
	! test-urlmatch-normalization "://acme.co" &&
	! test-urlmatch-normalization "x_test://acme.co" &&
	! test-urlmatch-normalization "-test://acme.co" &&
	! test-urlmatch-normalization "0test://acme.co" &&
	! test-urlmatch-normalization "+test://acme.co" &&
	! test-urlmatch-normalization ".test://acme.co" &&
	! test-urlmatch-normalization "schem%6e://" &&
	test-urlmatch-normalization "x-Test+v1.0://acme.co" &&
	test "$(test-urlmatch-normalization -p "AbCdeF://x.Y")" = "abcdef://x.y/"

ok 6 - silly approxidates work

expecting success: 
	test_must_fail git log -1 --format=%s @{usptream}

fatal: ambiguous argument '@{usptream}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
ok 7 - notice misspelled upstream

expecting success: 
	test_must_fail git log -1 --format=%s @{utter.bogosity}

ok 285 - mix of file types in subdir a/ with -v

expecting success: 
				expect '::	a/non-existent
.gitignore:1:one	a/one
::	a/not-ignored
::	a/ignored-but-in-index
.gitignore:2:ignored-*	a/ignored-and-untracked' &&
				test_check_ignore '
			a/non-existent
			a/one
			a/not-ignored
			a/ignored-but-in-index
			a/ignored-and-untracked'
		
			
fatal: ambiguous argument '@{utter.bogosity}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
ok 8 - complain about total nonsense

# passed all 8 test(s)
1..8
ok 286 - mix of file types in subdir a/ with -v -n

expecting success: 
				expect '::	a/non-existent
.gitignore:1:one	a/one
::	a/not-ignored
::	a/ignored-but-in-index
.gitignore:2:ignored-*	a/ignored-and-untracked' &&
				test_check_ignore '
			a/non-existent
			a/one
			a/not-ignored
			a/ignored-but-in-index
			a/ignored-and-untracked'
		
			
*** t0200-gettext-basic.sh ***
ok 287 - mix of file types in subdir a/ with -v --non-matching

expecting success: 
				expect '.gitignore:1:one	a/one
.gitignore:2:ignored-*	a/ignored-and-untracked' &&
				test_check_ignore '
			a/non-existent
			a/one
			a/not-ignored
			a/ignored-but-in-index
			a/ignored-and-untracked'
		
			
ok 288 - mix of file types in subdir a/ with --verbose

expecting success: 
				expect '::	a/non-existent
.gitignore:1:one	a/one
::	a/not-ignored
::	a/ignored-but-in-index
.gitignore:2:ignored-*	a/ignored-and-untracked' &&
				test_check_ignore '
			a/non-existent
			a/one
			a/not-ignored
			a/ignored-but-in-index
			a/ignored-and-untracked'
		
			
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0200-gettext-basic/.git/
ok 289 - mix of file types in subdir a/ with --verbose -n

expecting success: 
				expect '::	a/non-existent
.gitignore:1:one	a/one
::	a/not-ignored
::	a/ignored-but-in-index
.gitignore:2:ignored-*	a/ignored-and-untracked' &&
				test_check_ignore '
			a/non-existent
			a/one
			a/not-ignored
			a/ignored-but-in-index
			a/ignored-and-untracked'
		
			
ok 1 - url scheme

# lib-gettext: No is_IS UTF-8 locale available
# lib-gettext: No is_IS ISO-8859-1 locale available
expecting success: 
    test -n "$GIT_INTERNAL_GETTEXT_SH_SCHEME"

expecting success: 
	! test-urlmatch-normalization "scheme://user:pass@" &&
	! test-urlmatch-normalization "scheme://?" &&
	! test-urlmatch-normalization "scheme://#" &&
	! test-urlmatch-normalization "scheme:///" &&
	! test-urlmatch-normalization "scheme://:" &&
	! test-urlmatch-normalization "scheme://:555" &&
	test-urlmatch-normalization "file://user:pass@" &&
	test-urlmatch-normalization "file://?" &&
	test-urlmatch-normalization "file://#" &&
	test-urlmatch-normalization "file:///" &&
	test-urlmatch-normalization "file://:" &&
	! test-urlmatch-normalization "file://:555" &&
	test-urlmatch-normalization "scheme://user:pass@host" &&
	test-urlmatch-normalization "scheme://@host" &&
	test-urlmatch-normalization "scheme://%00@host" &&
	! test-urlmatch-normalization "scheme://%%@host" &&
	! test-urlmatch-normalization "scheme://host_" &&
	test-urlmatch-normalization "scheme://user:pass@host/" &&
	test-urlmatch-normalization "scheme://@host/" &&
	test-urlmatch-normalization "scheme://host/" &&
	test-urlmatch-normalization "scheme://host?x" &&
	test-urlmatch-normalization "scheme://host#x" &&
	test-urlmatch-normalization "scheme://host/@" &&
	test-urlmatch-normalization "scheme://host?@x" &&
	test-urlmatch-normalization "scheme://host#@x" &&
	test-urlmatch-normalization "scheme://[::1]" &&
	test-urlmatch-normalization "scheme://[::1]/" &&
	! test-urlmatch-normalization "scheme://hos%41/" &&
	test-urlmatch-normalization "scheme://[invalid....:/" &&
	test-urlmatch-normalization "scheme://invalid....:]/" &&
	! test-urlmatch-normalization "scheme://invalid....:[/" &&
	! test-urlmatch-normalization "scheme://invalid....:["

ok 1 - sanity: $GIT_INTERNAL_GETTEXT_SH_SCHEME is set (to gnu)

expecting success: 
    test $TEXTDOMAIN = "git"

ok 2 - sanity: $TEXTDOMAIN is git

expecting success: 
    ! grep "A Perl string xgettext will not get" "$GIT_PO_PATH"/is.po

ok 3 - xgettext sanity: Perl _() strings are not extracted

expecting success: 
    grep "TRANSLATORS: This is a test" "$TEST_DIRECTORY"/t0200/* | wc -l >expect &&
    grep "TRANSLATORS: This is a test" "$GIT_PO_PATH"/is.po  | wc -l >actual &&
    test_cmp expect actual

ok 290 - mix of file types in subdir a/ with --verbose --non-matching

expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 4 - xgettext sanity: Comment extraction with --add-comments

expecting success: 
    ! grep "This is a phony" "$GIT_PO_PATH"/is.po &&
    ! grep "the above comment" "$GIT_PO_PATH"/is.po

ok 5 - xgettext sanity: Comment extraction with --add-comments stops at statements

expecting success: 
    test -d "$TEXTDOMAINDIR" &&
    test "$TEXTDOMAINDIR" = "$GIT_TEXTDOMAINDIR"

ok 6 - sanity: $TEXTDOMAINDIR exists without NO_GETTEXT=YesPlease

ok 291 - mix of file types in subdir a/ with --no-index

expecting success: 
    test -f "$TEXTDOMAINDIR/is/LC_MESSAGES/git.mo"

ok 7 - sanity: Icelandic locale was compiled

expecting success: 
				expect '.gitignore:1:one	a/one
.gitignore:2:ignored-*	a/ignored-but-in-index
.gitignore:2:ignored-*	a/ignored-and-untracked' &&
				test_check_ignore '
			a/non-existent
			a/one
			a/not-ignored
			a/ignored-but-in-index
			a/ignored-and-untracked'
		
			
skipping test: sanity: gettext("") metadata is OK 
    # Return value may be non-zero
    LANGUAGE=is LC_ALL="$is_IS_locale" gettext "" >zero-expect &&
    grep "Project-Id-Version: Git" zero-expect &&
    grep "Git Mailing List <git@vger.kernel.org>" zero-expect &&
    grep "Content-Type: text/plain; charset=UTF-8" zero-expect &&
    grep "Content-Transfer-Encoding: 8bit" zero-expect

ok 8 # skip sanity: gettext("") metadata is OK (missing GETTEXT_LOCALE)

skipping test: sanity: gettext(unknown) is passed through 
    printf "This is not a translation string"  >expect &&
    gettext "This is not a translation string" >actual &&
    eval_gettext "This is not a translation string" >actual &&
    test_cmp expect actual

ok 9 # skip sanity: gettext(unknown) is passed through (missing GETTEXT_LOCALE)

skipping test: xgettext: C extraction of _() and N_() strings 
    printf "TILRAUN: C tilraunastrengur" >expect &&
    printf "\n" >>expect &&
    printf "Sjá 'git help SKIPUN' til að sjá hjálp fyrir tiltekna skipun." >>expect &&
    LANGUAGE=is LC_ALL="$is_IS_locale" gettext "TEST: A C test string" >actual &&
    printf "\n" >>actual &&
    LANGUAGE=is LC_ALL="$is_IS_locale" gettext "See 'git help COMMAND' for more information on a specific command." >>actual &&
    test_cmp expect actual

ok 10 # skip xgettext: C extraction of _() and N_() strings (missing GETTEXT_LOCALE)

skipping test: xgettext: C extraction with %s 
    printf "TILRAUN: C tilraunastrengur %%s" >expect &&
    LANGUAGE=is LC_ALL="$is_IS_locale" gettext "TEST: A C test string %s" >actual &&
    test_cmp expect actual

ok 11 # skip xgettext: C extraction with %s (missing GETTEXT_LOCALE)

skipping test: xgettext: Shell extraction 
    printf "TILRAUN: Skeljartilraunastrengur" >expect &&
    LANGUAGE=is LC_ALL="$is_IS_locale" gettext "TEST: A Shell test string" >actual &&
    test_cmp expect actual

ok 12 # skip xgettext: Shell extraction (missing GETTEXT_LOCALE)

ok 292 - mix of file types in subdir a/ with --no-index -v

expecting success: 
				expect '::	a/non-existent
.gitignore:1:one	a/one
::	a/not-ignored
.gitignore:2:ignored-*	a/ignored-but-in-index
.gitignore:2:ignored-*	a/ignored-and-untracked' &&
				test_check_ignore '
			a/non-existent
			a/one
			a/not-ignored
			a/ignored-but-in-index
			a/ignored-and-untracked'
		
			
skipping test: xgettext: Shell extraction with $variable 
    printf "TILRAUN: Skeljartilraunastrengur með breytunni a var i able" >x-expect &&
    LANGUAGE=is LC_ALL="$is_IS_locale" variable="a var i able" eval_gettext "TEST: A Shell test \$variable" >x-actual &&
    test_cmp x-expect x-actual

ok 13 # skip xgettext: Shell extraction with $variable (missing GETTEXT_LOCALE)

skipping test: xgettext: Perl extraction 
    printf "TILRAUN: Perl tilraunastrengur" >expect &&
    LANGUAGE=is LC_ALL="$is_IS_locale" gettext "TEST: A Perl test string" >actual &&
    test_cmp expect actual

ok 14 # skip xgettext: Perl extraction (missing GETTEXT_LOCALE)

skipping test: xgettext: Perl extraction with %s 
    printf "TILRAUN: Perl tilraunastrengur með breytunni %%s" >expect &&
    LANGUAGE=is LC_ALL="$is_IS_locale" gettext "TEST: A Perl test variable %s" >actual &&
    test_cmp expect actual

ok 15 # skip xgettext: Perl extraction with %s (missing GETTEXT_LOCALE)

skipping test: sanity: Some gettext("") data for real locale 
    LANGUAGE=is LC_ALL="$is_IS_locale" gettext "" >real-locale &&
    test -s real-locale

ok 16 # skip sanity: Some gettext("") data for real locale (missing GETTEXT_LOCALE)

# passed all 16 test(s)
1..16
ok 293 - mix of file types in subdir a/ with --no-index -v -n

expecting success: 
				expect '::	a/non-existent
.gitignore:1:one	a/one
::	a/not-ignored
.gitignore:2:ignored-*	a/ignored-but-in-index
.gitignore:2:ignored-*	a/ignored-and-untracked' &&
				test_check_ignore '
			a/non-existent
			a/one
			a/not-ignored
			a/ignored-but-in-index
			a/ignored-and-untracked'
		
			
*** t0201-gettext-fallbacks.sh ***
           staged     unstaged path
  1:    unchanged        +2/-2 foo.c

*** Commands ***
  1: [s]tatus	  2: [u]pdate	  3: [r]evert	  4: [a]dd untracked
  5: [p]atch	  6: [d]iff	  7: [q]uit	  8: [h]elp
What now> ok 294 - mix of file types in subdir a/ with --no-index -v --non-matching

expecting success: 
				expect '.gitignore:1:one	a/one
.gitignore:2:ignored-*	a/ignored-but-in-index
.gitignore:2:ignored-*	a/ignored-and-untracked' &&
				test_check_ignore '
			a/non-existent
			a/one
			a/not-ignored
			a/ignored-but-in-index
			a/ignored-and-untracked'
		
			
           staged     unstaged path
  1:    unchanged        +2/-2 [f]oo.c
Patch update>>            staged     unstaged path
* 1:    unchanged        +2/-2 [f]oo.c
Patch update>> diff --git a/foo.c b/foo.c
index 75522e2..3f7f049 100644
--- a/foo.c
+++ b/foo.c
@@ -1,8 +1,8 @@
 int foo()
 {
-return 42;
+return 43;
 }
 int bar()
 {
-return 42;
+return 44;
 }
Stage this hunk [y,n,q,a,d,/,s,e,?]? Split into 2 hunks.
@@ -1,6 +1,6 @@
 int foo()
 {
-return 42;
+return 43;
 }
 int bar()
 {
Stage this hunk [y,n,q,a,d,/,j,J,g,e,?]? @@ -4,5 +4,5 @@
 }
 int bar()
 {
-return 42;
+return 44;
 }
Stage this hunk [y,n,q,a,d,/,K,g,e,?]? ok 295 - mix of file types in subdir a/ with --no-index --verbose

expecting success: 
				expect '::	a/non-existent
.gitignore:1:one	a/one
::	a/not-ignored
.gitignore:2:ignored-*	a/ignored-but-in-index
.gitignore:2:ignored-*	a/ignored-and-untracked' &&
				test_check_ignore '
			a/non-existent
			a/one
			a/not-ignored
			a/ignored-but-in-index
			a/ignored-and-untracked'
		
			
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0201-gettext-fallbacks/.git/

*** Commands ***
  1: [s]tatus	  2: [u]pdate	  3: [r]evert	  4: [a]dd untracked
  5: [p]atch	  6: [d]iff	  7: [q]uit	  8: [h]elp
What now> Bye.
[master 65d7dde] foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 296 - mix of file types in subdir a/ with --no-index --verbose -n

expecting success: 
				expect '::	a/non-existent
.gitignore:1:one	a/one
::	a/not-ignored
.gitignore:2:ignored-*	a/ignored-but-in-index
.gitignore:2:ignored-*	a/ignored-and-untracked' &&
				test_check_ignore '
			a/non-existent
			a/one
			a/not-ignored
			a/ignored-but-in-index
			a/ignored-and-untracked'
		
			
# lib-gettext: No is_IS UTF-8 locale available
# lib-gettext: No is_IS ISO-8859-1 locale available
expecting success: 
    test -n "$GIT_INTERNAL_GETTEXT_SH_SCHEME"

ok 2 - url authority

ok 1 - sanity: $GIT_INTERNAL_GETTEXT_SH_SCHEME is set (to fallthrough)
expecting success: 
	test-urlmatch-normalization "xyz://q@some.host:" &&
	test-urlmatch-normalization "xyz://q@some.host:456/" &&
	! test-urlmatch-normalization "xyz://q@some.host:0" &&
	! test-urlmatch-normalization "xyz://q@some.host:0000000" &&
	test-urlmatch-normalization "xyz://q@some.host:0000001?" &&
	test-urlmatch-normalization "xyz://q@some.host:065535#" &&
	test-urlmatch-normalization "xyz://q@some.host:65535" &&
	! test-urlmatch-normalization "xyz://q@some.host:65536" &&
	! test-urlmatch-normalization "xyz://q@some.host:99999" &&
	! test-urlmatch-normalization "xyz://q@some.host:100000" &&
	! test-urlmatch-normalization "xyz://q@some.host:100001" &&
	test-urlmatch-normalization "http://q@some.host:80" &&
	test-urlmatch-normalization "https://q@some.host:443" &&
	test-urlmatch-normalization "http://q@some.host:80/" &&
	test-urlmatch-normalization "https://q@some.host:443?" &&
	! test-urlmatch-normalization "http://q@:8008" &&
	! test-urlmatch-normalization "http://:8080" &&
	! test-urlmatch-normalization "http://:" &&
	test-urlmatch-normalization "xyz://q@some.host:456/" &&
	test-urlmatch-normalization "xyz://[::1]:456/" &&
	test-urlmatch-normalization "xyz://[::1]:/" &&
	! test-urlmatch-normalization "xyz://[::1]:000/" &&
	! test-urlmatch-normalization "xyz://[::1]:0%300/" &&
	! test-urlmatch-normalization "xyz://[::1]:0x80/" &&
	! test-urlmatch-normalization "xyz://[::1]:4294967297/" &&
	! test-urlmatch-normalization "xyz://[::1]:030f/"


expecting success: 
    test -n "$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS"

ok 2 - sanity: $GIT_INTERNAL_GETTEXT_TEST_FALLBACKS is set

expecting success: 
    echo fallthrough >expect &&
    echo $GIT_INTERNAL_GETTEXT_SH_SCHEME >actual &&
    test_cmp expect actual

ok 3 - sanity: $GIT_INTERNAL_GETTEXT_SH_SCHEME" is fallthrough

expecting success: 
    printf "test" >expect &&
    gettext "test" >actual &&
    test_i18ncmp expect actual &&
    printf "test more words" >expect &&
    gettext "test more words" >actual &&
    test_i18ncmp expect actual

ok 297 - mix of file types in subdir a/ with --no-index --verbose --non-matching

expecting success: 
	expect "a/3-three" &&
	test_check_ignore "a/3-three a/three-not-this-one"

ok 4 - gettext: our gettext() fallback has pass-through semantics

expecting success: 
    printf "test" >expect &&
    eval_gettext "test" >actual &&
    test_i18ncmp expect actual &&
    printf "test more words" >expect &&
    eval_gettext "test more words" >actual &&
    test_i18ncmp expect actual

ok 298 - sub-directory local ignore

expecting success: 
	expect "a/.gitignore:2:*three	a/3-three" &&
	test_check_ignore "--verbose a/3-three a/three-not-this-one"

ok 10 - commit --interactive gives cache-tree on partial commit

expecting success: 
	mkdir dir &&
	>dir/child.t &&
	git add dir/child.t &&
	git commit -m dir/child.t &&
	test_cache_tree

ok 299 - sub-directory local ignore with --verbose

expecting success: 
	expect "3-three" &&
	(
		cd a &&
		test_check_ignore "3-three three-not-this-one"
	)

[master 0cd4af7] dir/child.t
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 dir/child.t
ok 300 - local ignore inside a sub-directory

expecting success: 
	expect "a/.gitignore:2:*three	3-three" &&
	(
		cd a &&
		test_check_ignore "--verbose 3-three three-not-this-one"
	)

ok 5 - eval_gettext: our eval_gettext() fallback has pass-through semantics

expecting success: 
    printf "test YesPlease" >expect &&
    GIT_INTERNAL_GETTEXT_TEST_FALLBACKS=YesPlease eval_gettext "test \$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS" >actual &&
    test_i18ncmp expect actual

ok 6 - eval_gettext: our eval_gettext() fallback can interpolate variables

expecting success: 
    cmdline="git am" &&
    export cmdline &&
    printf "When you have resolved this problem, run git am --resolved." >expect &&
    eval_gettext "When you have resolved this problem, run \$cmdline --resolved." >actual &&
    test_i18ncmp expect actual

ok 301 - local ignore inside a sub-directory with --verbose

expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 7 - eval_gettext: our eval_gettext() fallback can interpolate variables with spaces

expecting success: 
    cmdline="git am" &&
    export cmdline &&
    printf "When you have resolved this problem, run \"git am --resolved\"." >expect &&
    eval_gettext "When you have resolved this problem, run \"\$cmdline --resolved\"." >actual &&
    test_i18ncmp expect actual

ok 11 - commit in child dir has cache-tree

expecting success: 
	test-scrap-cache-tree &&
	git reset --hard &&
	test_cache_tree

ok 302 - nested include

expecting success: 
			expect '' &&
			
	test_check_ignore "a/b/one"

		
HEAD is now at 0cd4af7 dir/child.t
ok 8 - eval_gettext: our eval_gettext() fallback can interpolate variables with spaces and quotes

ok 3 - url port checks

expecting success: 
	test "$(test-urlmatch-normalization -p "http://x:800")" = "http://x:800/" &&
	test "$(test-urlmatch-normalization -p "http://x:0800")" = "http://x:800/" &&
	test "$(test-urlmatch-normalization -p "http://x:00000800")" = "http://x:800/" &&
	test "$(test-urlmatch-normalization -p "http://x:065535")" = "http://x:65535/" &&
	test "$(test-urlmatch-normalization -p "http://x:1")" = "http://x:1/" &&
	test "$(test-urlmatch-normalization -p "http://x:80")" = "http://x/" &&
	test "$(test-urlmatch-normalization -p "http://x:080")" = "http://x/" &&
	test "$(test-urlmatch-normalization -p "http://x:000000080")" = "http://x/" &&
	test "$(test-urlmatch-normalization -p "https://x:443")" = "https://x/" &&
	test "$(test-urlmatch-normalization -p "https://x:0443")" = "https://x/" &&
	test "$(test-urlmatch-normalization -p "https://x:000000443")" = "https://x/"

# passed all 8 test(s)
1..8
ok 303 - nested include with -q

expecting success: 
			expect '' &&
			
	test_check_ignore "a/b/one"

		
*** t0202-gettext-perl.sh ***
ok 304 - nested include with --quiet

expecting success: 
				expect 'a/b/.gitignore:8:!on*	a/b/one' &&
				
	test_check_ignore "a/b/one"

			
ok 305 - nested include with -v

expecting success: 
				expect 'a/b/.gitignore:8:!on*	a/b/one' &&
				
	test_check_ignore "a/b/one"

			
ok 4 - url port normalization

expecting success: 
	! test-urlmatch-normalization "http://x.y?%fg" &&
	test "$(test-urlmatch-normalization -p "X://W/%7e%41^%3a")" = "x://w/~A%5E%3A" &&
	test "$(test-urlmatch-normalization -p "X://W/:/?#[]@")" = "x://w/:/?#[]@" &&
	test "$(test-urlmatch-normalization -p "X://W/$&()*+,;=")" = "x://w/$&()*+,;=" &&
	test "$(test-urlmatch-normalization -p "X://W/'")" = "x://w/'" &&
	test "$(test-urlmatch-normalization -p "X://W?!")" = "x://w/?!"

ok 12 - reset --hard gives cache-tree

expecting success: 
	rm -f .git/index &&
	git reset --hard &&
	test_cache_tree

ok 306 - nested include with -v -n

expecting success: 
				expect 'a/b/.gitignore:8:!on*	a/b/one' &&
				
	test_check_ignore "a/b/one"

			
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0202-gettext-perl/.git/
HEAD is now at 0cd4af7 dir/child.t
ok 307 - nested include with -v --non-matching

expecting success: 
				expect 'a/b/.gitignore:8:!on*	a/b/one' &&
				
	test_check_ignore "a/b/one"

			
ok 5 - url general escapes

# lib-gettext: No is_IS UTF-8 locale available
# lib-gettext: No is_IS ISO-8859-1 locale available
expecting success: 
	test "$(test-urlmatch-normalization -p "$(cat "$tu-1")")" = "x://q/%01%02%03%04%05%06%07%08%0E%0F%10%11%12" &&
	test "$(test-urlmatch-normalization -p "$(cat "$tu-2")")" = "x://q/%13%14%15%16%17%18%19%1B%1C%1D%1E%1F%7F" &&
	test "$(test-urlmatch-normalization -p "$(cat "$tu-3")")" = "x://q/%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F" &&
	test "$(test-urlmatch-normalization -p "$(cat "$tu-4")")" = "x://q/%90%91%92%93%94%95%96%97%98%99%9A%9B%9C%9D%9E%9F" &&
	test "$(test-urlmatch-normalization -p "$(cat "$tu-5")")" = "x://q/%A0%A1%A2%A3%A4%A5%A6%A7%A8%A9%AA%AB%AC%AD%AE%AF" &&
	test "$(test-urlmatch-normalization -p "$(cat "$tu-6")")" = "x://q/%B0%B1%B2%B3%B4%B5%B6%B7%B8%B9%BA%BB%BC%BD%BE%BF" &&
	test "$(test-urlmatch-normalization -p "$(cat "$tu-7")")" = "x://q/%C0%C1%C2%C3%C4%C5%C6%C7%C8%C9%CA%CB%CC%CD%CE%CF" &&
	test "$(test-urlmatch-normalization -p "$(cat "$tu-8")")" = "x://q/%D0%D1%D2%D3%D4%D5%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF" &&
	test "$(test-urlmatch-normalization -p "$(cat "$tu-9")")" = "x://q/%E0%E1%E2%E3%E4%E5%E6%E7%E8%E9%EA%EB%EC%ED%EE%EF" &&
	test "$(test-urlmatch-normalization -p "$(cat "$tu-10")")" = "x://q/%F0%F1%F2%F3%F4%F5%F6%F7%F8%F9%FA%FB%FC%FD%FE%FF"

ok 308 - nested include with --verbose

expecting success: 
				expect 'a/b/.gitignore:8:!on*	a/b/one' &&
				
	test_check_ignore "a/b/one"

			
ok 309 - nested include with --verbose -n

expecting success: 
				expect 'a/b/.gitignore:8:!on*	a/b/one' &&
				
	test_check_ignore "a/b/one"

			
ok 13 - reset --hard without index gives cache-tree

expecting success: 
	git tag current &&
	git checkout HEAD^ &&
	test_cache_tree

ok 310 - nested include with --verbose --non-matching

Note: checking out 'HEAD^'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 65d7dde... foo
ok 6 - url high-bit escapes

expecting success: 
	test "$(test-urlmatch-normalization -p "$(cat "$tu-11")")" = "x://q/%C2%80%DF%BF%E0%A0%80%EF%BF%BD%F0%90%80%80%F0%AF%BF%BD"

ok 7 - url utf-8 escapes

expecting success: 
	test "$(test-urlmatch-normalization -p "x://%41%62(^):%70+d@foo")" = "x://Ab(%5E):p+d@foo/"

expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 8 - url username/password escapes

expecting success: 
	test "$(test-urlmatch-normalization -l "Http://%4d%65:%4d^%70@The.Host")" = 25 &&
	test "$(test-urlmatch-normalization -l "http://%41:%42@x.y/%61/")" = 17 &&
	test "$(test-urlmatch-normalization -l "http://@x.y/^")" = 15

ok 311 - ignored sub-directory

expecting success: 
			expect '' &&
			
	test_check_ignore "a/b/ignored-dir"

		
ok 14 - checkout gives cache-tree

expecting success: 
	git checkout current &&
	git checkout -b prev HEAD^ &&
	test_cache_tree

# run 0: Perl Git::I18N API (perl /«PKGBUILDDIR»/t/t0202/test.pl)
Previous HEAD position was 65d7dde... foo
HEAD is now at 0cd4af7... dir/child.t
ok 9 - url normalized lengths

expecting success: 
	test "$(test-urlmatch-normalization -p "x://y/.")" = "x://y/" &&
	test "$(test-urlmatch-normalization -p "x://y/./")" = "x://y/" &&
	test "$(test-urlmatch-normalization -p "x://y/a/.")" = "x://y/a" &&
	test "$(test-urlmatch-normalization -p "x://y/a/./")" = "x://y/a/" &&
	test "$(test-urlmatch-normalization -p "x://y/.?")" = "x://y/?" &&
	test "$(test-urlmatch-normalization -p "x://y/./?")" = "x://y/?" &&
	test "$(test-urlmatch-normalization -p "x://y/a/.?")" = "x://y/a?" &&
	test "$(test-urlmatch-normalization -p "x://y/a/./?")" = "x://y/a/?" &&
	test "$(test-urlmatch-normalization -p "x://y/a/./b/.././../c")" = "x://y/c" &&
	test "$(test-urlmatch-normalization -p "x://y/a/./b/../.././c/")" = "x://y/c/" &&
	test "$(test-urlmatch-normalization -p "x://y/a/./b/.././../c/././.././.")" = "x://y/" &&
	! test-urlmatch-normalization "x://y/a/./b/.././../c/././.././.." &&
	test "$(test-urlmatch-normalization -p "x://y/a/./?/././..")" = "x://y/a/?/././.." &&
	test "$(test-urlmatch-normalization -p "x://y/%2e/")" = "x://y/" &&
	test "$(test-urlmatch-normalization -p "x://y/%2E/")" = "x://y/" &&
	test "$(test-urlmatch-normalization -p "x://y/a/%2e./")" = "x://y/" &&
	test "$(test-urlmatch-normalization -p "x://y/b/.%2E/")" = "x://y/" &&
	test "$(test-urlmatch-normalization -p "x://y/c/%2e%2E/")" = "x://y/"

ok 312 - ignored sub-directory with -q

expecting success: 
			expect '' &&
			
	test_check_ignore "a/b/ignored-dir"

		
Previous HEAD position was 0cd4af7... dir/child.t
Switched to a new branch 'prev'
ok 313 - ignored sub-directory with --quiet

expecting success: 
				expect 'a/b/.gitignore:5:ignored-dir/	a/b/ignored-dir' &&
				
	test_check_ignore "a/b/ignored-dir"

			
ok 314 - ignored sub-directory with -v

expecting success: 
				expect 'a/b/.gitignore:5:ignored-dir/	a/b/ignored-dir' &&
				
	test_check_ignore "a/b/ignored-dir"

			
ok 315 - ignored sub-directory with -v -n

expecting success: 
				expect 'a/b/.gitignore:5:ignored-dir/	a/b/ignored-dir' &&
				
	test_check_ignore "a/b/ignored-dir"

			
ok 15 - checkout -b gives cache-tree

expecting success: 
	git checkout current &&
	git checkout -B prev HEAD^ &&
	test_cache_tree

ok 316 - ignored sub-directory with -v --non-matching

expecting success: 
				expect 'a/b/.gitignore:5:ignored-dir/	a/b/ignored-dir' &&
				
	test_check_ignore "a/b/ignored-dir"

			
Note: checking out 'current'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 0cd4af7... dir/child.t
ok 317 - ignored sub-directory with --verbose

expecting success: 
				expect 'a/b/.gitignore:5:ignored-dir/	a/b/ignored-dir' &&
				
	test_check_ignore "a/b/ignored-dir"

			
Previous HEAD position was 0cd4af7... dir/child.t
Switched to and reset branch 'prev'
ok 10 - url . and .. segments

expecting success: 
	test-urlmatch-normalization "httP://x" "Http://X/" &&
	test-urlmatch-normalization "Http://%4d%65:%4d^%70@The.Host" "hTTP://Me:%4D^p@the.HOST:80/" &&
	! test-urlmatch-normalization "https://@x.y/^" "httpS://x.y:443/^" &&
	test-urlmatch-normalization "https://@x.y/^" "httpS://@x.y:0443/^" &&
	test-urlmatch-normalization "https://@x.y/^/../abc" "httpS://@x.y:0443/abc" &&
	test-urlmatch-normalization "https://@x.y/^/.." "httpS://@x.y:0443/"

ok 318 - ignored sub-directory with --verbose -n

expecting success: 
				expect 'a/b/.gitignore:5:ignored-dir/	a/b/ignored-dir' &&
				
	test_check_ignore "a/b/ignored-dir"

			
1..8
ok 319 - ignored sub-directory with --verbose --non-matching
ok 16 - checkout -B gives cache-tree


expecting success: 
	git checkout -b partial no-children &&
	test_commit one &&
	test_commit two &&
	echo "some change" >one.t &&
	git add one.t &&
	echo "some other change" >two.t &&
	git commit two.t -m partial &&
	test_cache_tree

expecting success: 
	expect_from_stdin <<-\EOF &&
		a/b/ignored-dir/foo
		a/b/ignored-dir/twoooo
		a/b/ignored-dir/seven
	EOF
	test_check_ignore "a/b/ignored-dir/foo a/b/ignored-dir/twoooo a/b/ignored-dir/seven"

ok 1 - Testing Git::I18N with NO Perl gettext library
ok 2 - Git::I18N is located at /«PKGBUILDDIR»/t/../perl/blib/lib/Git/I18N.pm
ok 3 - sanity: Git::I18N has 1 export(s)
ok 4 - sanity: Git::I18N exports everything by default
ok 5 - sanity: __ has a $ prototype
ok 6 - Passing a string through __() in the C locale works
ok 7 # skip GETTEXT_LOCALE must be set by lib-gettext.sh for exhaustive Git::I18N tests
Switched to a new branch 'partial'
ok 11 - url equivalents

ok 8 # skip GETTEXT_LOCALE must be set by lib-gettext.sh for exhaustive Git::I18N tests
# passed all 11 test(s)
1..11
# test_external test Perl Git::I18N API was ok
# expecting no stderr from previous command
# test_external_without_stderr test no stderr: Perl Git::I18N API was ok
ok 320 - multiple files inside ignored sub-directory

expecting success: 
	expect_from_stdin <<-\EOF &&
		a/b/.gitignore:5:ignored-dir/	a/b/ignored-dir/foo
		a/b/.gitignore:5:ignored-dir/	a/b/ignored-dir/twoooo
		a/b/.gitignore:5:ignored-dir/	a/b/ignored-dir/seven
	EOF
	test_check_ignore "-v a/b/ignored-dir/foo a/b/ignored-dir/twoooo a/b/ignored-dir/seven"

*** t0203-gettext-setlocale-sanity.sh ***
[partial 63ffdd6] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
*** t0204-gettext-reencode-sanity.sh ***
ok 321 - multiple files inside ignored sub-directory with -v

expecting success: 
	expect_from_stdin <<-\EOF &&
		foo
		twoooo
		../one
		seven
		../../one
	EOF
	(
		cd a/b/ignored-dir &&
		test_check_ignore "foo twoooo ../one seven ../../one"
	)

[partial 0114d26] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two.t
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0203-gettext-setlocale-sanity/.git/
ok 322 - cd to ignored sub-directory

expecting success: 
	expect_from_stdin <<-\EOF &&
		a/b/.gitignore:5:ignored-dir/	foo
		a/b/.gitignore:5:ignored-dir/	twoooo
		a/b/.gitignore:8:!on*	../one
		a/b/.gitignore:5:ignored-dir/	seven
		.gitignore:1:one	../../one
	EOF
	(
		cd a/b/ignored-dir &&
		test_check_ignore "-v foo twoooo ../one seven ../../one"
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0204-gettext-reencode-sanity/.git/
# lib-gettext: No is_IS UTF-8 locale available
# lib-gettext: No is_IS ISO-8859-1 locale available
expecting success: 
	. "$TEST_DIRECTORY"/t3901-8859-1.txt &&
	test_commit "iso-c-commit" iso-under-c &&
	git show >out 2>err &&
	! test -s err &&
	grep -q "iso-c-commit" out

ok 323 - cd to ignored sub-directory with -v

[partial 0598380] partial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
# lib-gettext: No is_IS UTF-8 locale available
# lib-gettext: No is_IS ISO-8859-1 locale available
skipping test: gettext: Emitting UTF-8 from our UTF-8 *.mo files / Icelandic 
    printf "TILRAUN: Halló Heimur!" >expect &&
    LANGUAGE=is LC_ALL="$is_IS_locale" gettext "TEST: Hello World!" >actual &&
    test_cmp expect actual

ok 1 # skip gettext: Emitting UTF-8 from our UTF-8 *.mo files / Icelandic (missing GETTEXT_LOCALE)

skipping test: gettext: Emitting UTF-8 from our UTF-8 *.mo files / Runes 
    printf "%s" "$RUNES" >expect &&
    LANGUAGE=is LC_ALL="$is_IS_locale" gettext "$MSGKEY" >actual &&
    test_cmp expect actual

ok 2 # skip gettext: Emitting UTF-8 from our UTF-8 *.mo files / Runes (missing GETTEXT_LOCALE)

Warning: commit message did not conform to UTF-8.
You may want to amend it after fixing the message, or set the config
variable i18n.commitencoding to the encoding your project uses.
expecting success: 
		expect "$expect" &&
		eval "$code"
	
skipping test: gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Icelandic 
    printf "TILRAUN: Halló Heimur!" | iconv -f UTF-8 -t ISO8859-1 >expect &&
    LANGUAGE=is LC_ALL="$is_IS_iso_locale" gettext "TEST: Hello World!" >actual &&
    test_cmp expect actual

ok 3 # skip gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Icelandic (missing GETTEXT_ISO_LOCALE)

[master (root-commit) f2030b4] iso-c-commit
 Author: Áéí óú <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 iso-under-c
skipping test: gettext: impossible ISO-8859-1 output 
	LANGUAGE=is LC_ALL="$is_IS_iso_locale" gettext "$MSGKEY" >runes &&
	case "$(cat runes)" in
	"$MSGKEY")
		say "Your system gives back the key to message catalog"
		;;
	"$PUNTS")
		say "Your system replaces an impossible character with ?"
		;;
	"$RUNES")
		say "Your system gives back the raw message for an impossible request"
		;;
	*)
		say "We never saw the error behaviour your system exhibits"
		false
		;;
	esac

ok 4 # skip gettext: impossible ISO-8859-1 output (missing GETTEXT_ISO_LOCALE)

skipping test: gettext: Fetching a UTF-8 msgid -> UTF-8 
    printf "TILRAUN: ‚einfaldar‘ og „tvöfaldar“ gæsalappir" >expect &&
    LANGUAGE=is LC_ALL="$is_IS_locale" gettext "TEST: ‘single’ and “double” quotes" >actual &&
    test_cmp expect actual

ok 5 # skip gettext: Fetching a UTF-8 msgid -> UTF-8 (missing GETTEXT_LOCALE)

ok 324 - symlink

skipping test: gettext: Fetching a UTF-8 msgid -> ISO-8859-1 
    LANGUAGE=is LC_ALL="$is_IS_iso_locale" gettext "TEST: ‘single’ and “double” quotes" >actual &&
    grep "einfaldar" actual &&
    grep "$(echo tvöfaldar | iconv -f UTF-8 -t ISO8859-1)" actual

ok 6 # skip gettext: Fetching a UTF-8 msgid -> ISO-8859-1 (missing GETTEXT_ISO_LOCALE)

skipping test: gettext.c: git init UTF-8 -> UTF-8 
    printf "Bjó til tóma Git lind" >expect &&
    LANGUAGE=is LC_ALL="$is_IS_locale" git init repo >actual &&
    test_when_finished "rm -rf repo" &&
    grep "^$(cat expect) " actual

ok 7 # skip gettext.c: git init UTF-8 -> UTF-8 (missing GETTEXT_LOCALE)

skipping test: gettext.c: git init UTF-8 -> ISO-8859-1 
    printf "Bjó til tóma Git lind" >expect &&
    LANGUAGE=is LC_ALL="$is_IS_iso_locale" git init repo >actual &&
    test_when_finished "rm -rf repo" &&
    grep "^$(cat expect | iconv -f UTF-8 -t ISO8859-1) " actual

ok 8 # skip gettext.c: git init UTF-8 -> ISO-8859-1 (missing GETTEXT_ISO_LOCALE)

expecting success: 
			expect '' &&
			
	test_check_ignore "a/symlink" 1

		
ok 17 - partial commit gives cache-tree

expecting success: 
	mkdir newdir &&
	>newdir/one &&
	git add newdir/one &&
	git checkout 2>errors &&
	! test -s errors

ok 1 - git show a ISO-8859-1 commit under C locale

# passed all 8 test(s)
1..8
skipping test: git show a ISO-8859-1 commit under a UTF-8 locale 
	. "$TEST_DIRECTORY"/t3901-8859-1.txt &&
	test_commit "iso-utf8-commit" iso-under-utf8 &&
	LANGUAGE=is LC_ALL="$is_IS_locale" git show >out 2>err &&
	! test -s err &&
	grep -q "iso-utf8-commit" out

ok 2 # skip git show a ISO-8859-1 commit under a UTF-8 locale (missing GETTEXT_LOCALE)

# passed all 2 test(s)
1..2
ok 325 - symlink with -q

*** t0205-gettext-poison.sh ***
A	newdir/one
M	one.t
ok 18 - no phantom error when switching trees
expecting success: 
			expect '' &&
			
	test_check_ignore "a/symlink" 1

		

*** t0300-credentials.sh ***
# passed all 18 test(s)
1..18
ok 326 - symlink with --quiet

expecting success: 
				expect '' &&
				
	test_check_ignore "a/symlink" 1

			
ok 327 - symlink with -v

expecting success: 
				expect '::	a/symlink' &&
				
	test_check_ignore "a/symlink" 1

			
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0300-credentials/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0205-gettext-poison/.git/
*** t0301-credential-cache.sh ***
ok 328 - symlink with -v -n

expecting success: 
				expect '::	a/symlink' &&
				
	test_check_ignore "a/symlink" 1

			
expecting success: 
	cat >dump <<-\EOF &&
	whoami=$(echo $0 | sed s/.*git-credential-//)
	echo >&2 "$whoami: $*"
	OIFS=$IFS
	IFS==
	while read key value; do
		echo >&2 "$whoami: $key=$value"
		eval "$key=$value"
	done
	IFS=$OIFS
	EOF

	write_script git-credential-useless <<-\EOF &&
	. ./dump
	exit 0
	EOF

	write_script git-credential-verbatim <<-\EOF &&
	user=$1; shift
	pass=$1; shift
	. ./dump
	test -z "$user" || echo username=$user
	test -z "$pass" || echo password=$pass
	EOF

	PATH="$PWD:$PATH"

ok 329 - symlink with -v --non-matching

# lib-gettext: No is_IS UTF-8 locale available
# lib-gettext: No is_IS ISO-8859-1 locale available
expecting success: 
				expect '' &&
				
	test_check_ignore "a/symlink" 1

			
skipping test: sanity: $GIT_INTERNAL_GETTEXT_SH_SCHEME is set (to gnu) 
    test -n "$GIT_INTERNAL_GETTEXT_SH_SCHEME"

ok 1 # skip sanity: $GIT_INTERNAL_GETTEXT_SH_SCHEME is set (to gnu) (missing GETTEXT_POISON)

skipping test: sanity: $GIT_INTERNAL_GETTEXT_SH_SCHEME" is poison 
    test "$GIT_INTERNAL_GETTEXT_SH_SCHEME" = "poison"

ok 2 # skip sanity: $GIT_INTERNAL_GETTEXT_SH_SCHEME" is poison (missing GETTEXT_POISON)

skipping test: gettext: our gettext() fallback has poison semantics 
    printf "# GETTEXT POISON #" >expect &&
    gettext "test" >actual &&
    test_cmp expect actual &&
    printf "# GETTEXT POISON #" >expect &&
    gettext "test more words" >actual &&
    test_cmp expect actual

ok 3 # skip gettext: our gettext() fallback has poison semantics (missing GETTEXT_POISON)

skipping test: eval_gettext: our eval_gettext() fallback has poison semantics 
    printf "# GETTEXT POISON #" >expect &&
    eval_gettext "test" >actual &&
    test_cmp expect actual &&
    printf "# GETTEXT POISON #" >expect &&
    eval_gettext "test more words" >actual &&
    test_cmp expect actual

ok 4 # skip eval_gettext: our eval_gettext() fallback has poison semantics (missing GETTEXT_POISON)

ok 330 - symlink with --verbose

# passed all 4 test(s)
1..4
expecting success: 
				expect '::	a/symlink' &&
				
	test_check_ignore "a/symlink" 1

			
ok 1 - setup helper scripts

expecting success: 
	check fill "verbatim foo bar" <<-\EOF
	--
	username=foo
	password=bar
	--
	verbatim: get
	EOF

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0301-credential-cache/.git/
ok 331 - symlink with --verbose -n

*** t0302-credential-store.sh ***
expecting success: 
				expect '::	a/symlink' &&
				
	test_check_ignore "a/symlink" 1

			
ok 2 - credential_fill invokes helper

expecting success: 
	check fill useless "verbatim foo bar" <<-\EOF
	--
	username=foo
	password=bar
	--
	useless: get
	verbatim: get
	EOF

ok 332 - symlink with --verbose --non-matching

expecting success: 
		check fill $HELPER <<-\EOF
		protocol=https
		host=example.com
		--
		protocol=https
		host=example.com
		username=askpass-username
		password=askpass-password
		--
		askpass: Username for 'https://example.com':
		askpass: Password for 'https://askpass-username@example.com':
		EOF
	
expecting success: 
		expect "$expect" &&
		eval "$code"
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0302-credential-store/.git/
ok 333 - beyond a symlink

expecting success: 
		check fill $HELPER <<-\EOF
		protocol=https
		host=example.com
		--
		protocol=https
		host=example.com
		username=askpass-username
		password=askpass-password
		--
		askpass: Username for 'https://example.com':
		askpass: Password for 'https://askpass-username@example.com':
		EOF
	
ok 1 - helper (cache) has no existing data

expecting success: 
			expect '' &&
			
	test_check_ignore "a/symlink/foo" 128 &&
	test_stderr "fatal: pathspec 'a/symlink/foo' is beyond a symbolic link"

		
expecting success: 
		check approve $HELPER <<-\EOF
		protocol=https
		host=example.com
		username=store-user
		password=store-pass
		EOF
	
ok 3 - credential_fill invokes multiple helpers

expecting success: 
	check fill "verbatim one two" "verbatim three four" <<-\EOF
	--
	username=one
	password=two
	--
	verbatim: get
	EOF

ok 334 - beyond a symlink with -q

expecting success: 
			expect '' &&
			
	test_check_ignore "a/symlink/foo" 128 &&
	test_stderr "fatal: pathspec 'a/symlink/foo' is beyond a symbolic link"

		
ok 2 - helper (cache) stores password

expecting success: 
		check fill $HELPER <<-\EOF
		protocol=https
		host=example.com
		--
		protocol=https
		host=example.com
		username=store-user
		password=store-pass
		--
		EOF
	
ok 4 - credential_fill stops when we get a full response

expecting success: 
	check fill "verbatim one \"\"" "verbatim two three" <<-\EOF
	--
	username=two
	password=three
	--
	verbatim: get
	verbatim: get
	verbatim: username=one
	EOF

ok 1 - helper (store) has no existing data

expecting success: 
		check approve $HELPER <<-\EOF
		protocol=https
		host=example.com
		username=store-user
		password=store-pass
		EOF
	
ok 335 - beyond a symlink with --quiet

expecting success: 
				expect '' &&
				
	test_check_ignore "a/symlink/foo" 128 &&
	test_stderr "fatal: pathspec 'a/symlink/foo' is beyond a symbolic link"

			
ok 3 - helper (cache) can retrieve password

expecting success: 
		check fill $HELPER <<-\EOF
		protocol=http
		host=example.com
		--
		protocol=http
		host=example.com
		username=askpass-username
		password=askpass-password
		--
		askpass: Username for 'http://example.com':
		askpass: Password for 'http://askpass-username@example.com':
		EOF
	
ok 336 - beyond a symlink with -v

ok 2 - helper (store) stores password

expecting success: 
		check fill $HELPER <<-\EOF
		protocol=https
		host=example.com
		--
		protocol=https
		host=example.com
		username=store-user
		password=store-pass
		--
		EOF
	
expecting success: 
				expect '' &&
				
	test_check_ignore "a/symlink/foo" 128 &&
	test_stderr "fatal: pathspec 'a/symlink/foo' is beyond a symbolic link"

			
ok 5 - credential_fill continues through partial response

expecting success: 
	check fill "verbatim one two" <<-\EOF
	protocol=ftp
	host=example.com
	path=foo.git
	--
	protocol=ftp
	host=example.com
	path=foo.git
	username=one
	password=two
	--
	verbatim: get
	verbatim: protocol=ftp
	verbatim: host=example.com
	verbatim: path=foo.git
	EOF

ok 337 - beyond a symlink with -v -n

expecting success: 
				expect '' &&
				
	test_check_ignore "a/symlink/foo" 128 &&
	test_stderr "fatal: pathspec 'a/symlink/foo' is beyond a symbolic link"

			
ok 4 - helper (cache) requires matching protocol

expecting success: 
		check fill $HELPER <<-\EOF
		protocol=https
		host=other.tld
		--
		protocol=https
		host=other.tld
		username=askpass-username
		password=askpass-password
		--
		askpass: Username for 'https://other.tld':
		askpass: Password for 'https://askpass-username@other.tld':
		EOF
	
ok 3 - helper (store) can retrieve password

expecting success: 
		check fill $HELPER <<-\EOF
		protocol=http
		host=example.com
		--
		protocol=http
		host=example.com
		username=askpass-username
		password=askpass-password
		--
		askpass: Username for 'http://example.com':
		askpass: Password for 'http://askpass-username@example.com':
		EOF
	
ok 6 - credential_fill passes along metadata

expecting success: 
	check approve useless "verbatim one two" <<-\EOF
	username=foo
	password=bar
	--
	--
	useless: store
	useless: username=foo
	useless: password=bar
	verbatim: store
	verbatim: username=foo
	verbatim: password=bar
	EOF

ok 338 - beyond a symlink with -v --non-matching

expecting success: 
				expect '' &&
				
	test_check_ignore "a/symlink/foo" 128 &&
	test_stderr "fatal: pathspec 'a/symlink/foo' is beyond a symbolic link"

			
ok 339 - beyond a symlink with --verbose

expecting success: 
				expect '' &&
				
	test_check_ignore "a/symlink/foo" 128 &&
	test_stderr "fatal: pathspec 'a/symlink/foo' is beyond a symbolic link"

			
ok 4 - helper (store) requires matching protocol

expecting success: 
		check fill $HELPER <<-\EOF
		protocol=https
		host=other.tld
		--
		protocol=https
		host=other.tld
		username=askpass-username
		password=askpass-password
		--
		askpass: Username for 'https://other.tld':
		askpass: Password for 'https://askpass-username@other.tld':
		EOF
	
ok 5 - helper (cache) requires matching host

expecting success: 
		check fill $HELPER <<-\EOF
		protocol=https
		host=example.com
		username=other
		--
		protocol=https
		host=example.com
		username=other
		password=askpass-password
		--
		askpass: Password for 'https://other@example.com':
		EOF
	
ok 7 - credential_approve calls all helpers

expecting success: 
	check approve useless <<-\EOF
	username=foo
	--
	--
	EOF

ok 340 - beyond a symlink with --verbose -n

expecting success: 
				expect '' &&
				
	test_check_ignore "a/symlink/foo" 128 &&
	test_stderr "fatal: pathspec 'a/symlink/foo' is beyond a symbolic link"

			
ok 8 - do not bother storing password-less credential

expecting success: 
	check reject useless "verbatim one two" <<-\EOF
	username=foo
	password=bar
	--
	--
	useless: erase
	useless: username=foo
	useless: password=bar
	verbatim: erase
	verbatim: username=foo
	verbatim: password=bar
	EOF

ok 341 - beyond a symlink with --verbose --non-matching

ok 6 - helper (cache) requires matching username

expecting success: 
		test_config credential.usehttppath true &&
		check approve $HELPER <<-\EOF &&
		protocol=http
		host=path.tld
		path=foo.git
		username=user
		password=pass
		EOF
		check fill $HELPER <<-\EOF
		protocol=http
		host=path.tld
		path=bar.git
		--
		protocol=http
		host=path.tld
		path=bar.git
		username=askpass-username
		password=askpass-password
		--
		askpass: Username for 'http://path.tld/bar.git':
		askpass: Password for 'http://askpass-username@path.tld/bar.git':
		EOF
	
ok 5 - helper (store) requires matching host

expecting success: 
		check fill $HELPER <<-\EOF
		protocol=https
		host=example.com
		username=other
		--
		protocol=https
		host=example.com
		username=other
		password=askpass-password
		--
		askpass: Password for 'https://other@example.com':
		EOF
	
expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 6 - helper (store) requires matching username

expecting success: 
		test_config credential.usehttppath true &&
		check approve $HELPER <<-\EOF &&
		protocol=http
		host=path.tld
		path=foo.git
		username=user
		password=pass
		EOF
		check fill $HELPER <<-\EOF
		protocol=http
		host=path.tld
		path=bar.git
		--
		protocol=http
		host=path.tld
		path=bar.git
		username=askpass-username
		password=askpass-password
		--
		askpass: Username for 'http://path.tld/bar.git':
		askpass: Password for 'http://askpass-username@path.tld/bar.git':
		EOF
	
ok 9 - credential_reject calls all helpers

expecting success: 
	check fill "verbatim \"\" three" <<-\EOF
	username=one
	--
	username=one
	password=three
	--
	verbatim: get
	verbatim: username=one
	EOF

ok 342 - beyond a symlink from subdirectory

expecting success: 
			expect '' &&
			
	(
		cd a &&
		test_check_ignore "symlink/foo" 128
	) &&
	test_stderr "fatal: pathspec 'symlink/foo' is beyond a symbolic link"

		
ok 10 - usernames can be preserved

expecting success: 
	check fill "verbatim two three" <<-\EOF
	username=one
	--
	username=two
	password=three
	--
	verbatim: get
	verbatim: username=one
	EOF

ok 343 - beyond a symlink from subdirectory with -q

expecting success: 
			expect '' &&
			
	(
		cd a &&
		test_check_ignore "symlink/foo" 128
	) &&
	test_stderr "fatal: pathspec 'symlink/foo' is beyond a symbolic link"

		
ok 344 - beyond a symlink from subdirectory with --quiet

ok 7 - helper (cache) requires matching path

expecting success: 
		check reject $HELPER <<-\EOF &&
		protocol=https
		host=example.com
		EOF
		check fill $HELPER <<-\EOF
		protocol=https
		host=example.com
		--
		protocol=https
		host=example.com
		username=askpass-username
		password=askpass-password
		--
		askpass: Username for 'https://example.com':
		askpass: Password for 'https://askpass-username@example.com':
		EOF
	
expecting success: 
				expect '' &&
				
	(
		cd a &&
		test_check_ignore "symlink/foo" 128
	) &&
	test_stderr "fatal: pathspec 'symlink/foo' is beyond a symbolic link"

			
ok 11 - usernames can be overridden

expecting success: 
	check fill "verbatim three four" <<-\EOF
	username=one
	password=two
	--
	username=one
	password=two
	--
	EOF

ok 7 - helper (store) requires matching path

expecting success: 
		check reject $HELPER <<-\EOF &&
		protocol=https
		host=example.com
		EOF
		check fill $HELPER <<-\EOF
		protocol=https
		host=example.com
		--
		protocol=https
		host=example.com
		username=askpass-username
		password=askpass-password
		--
		askpass: Username for 'https://example.com':
		askpass: Password for 'https://askpass-username@example.com':
		EOF
	
ok 12 - do not bother completing already-full credential

expecting success: 
	check fill <<-\EOF
	--
	username=askpass-username
	password=askpass-password
	--
	askpass: Username:
	askpass: Password:
	EOF

ok 345 - beyond a symlink from subdirectory with -v

expecting success: 
				expect '' &&
				
	(
		cd a &&
		test_check_ignore "symlink/foo" 128
	) &&
	test_stderr "fatal: pathspec 'symlink/foo' is beyond a symbolic link"

			
ok 346 - beyond a symlink from subdirectory with -v -n

expecting success: 
				expect '' &&
				
	(
		cd a &&
		test_check_ignore "symlink/foo" 128
	) &&
	test_stderr "fatal: pathspec 'symlink/foo' is beyond a symbolic link"

			
ok 13 - empty helper list falls back to internal getpass

expecting success: 
	check fill <<-\EOF
	username=foo
	--
	username=foo
	password=askpass-password
	--
	askpass: Password:
	EOF

ok 347 - beyond a symlink from subdirectory with -v --non-matching

expecting success: 
				expect '' &&
				
	(
		cd a &&
		test_check_ignore "symlink/foo" 128
	) &&
	test_stderr "fatal: pathspec 'symlink/foo' is beyond a symbolic link"

			
ok 8 - helper (store) can forget host

expecting success: 
		check approve $HELPER <<-\EOF &&
		protocol=https
		host=example.com
		username=user1
		password=pass1
		EOF
		check approve $HELPER <<-\EOF &&
		protocol=https
		host=example.com
		username=user2
		password=pass2
		EOF
		check fill $HELPER <<-\EOF &&
		protocol=https
		host=example.com
		username=user1
		--
		protocol=https
		host=example.com
		username=user1
		password=pass1
		EOF
		check fill $HELPER <<-\EOF
		protocol=https
		host=example.com
		username=user2
		--
		protocol=https
		host=example.com
		username=user2
		password=pass2
		EOF
	
ok 8 - helper (cache) can forget host

expecting success: 
		check approve $HELPER <<-\EOF &&
		protocol=https
		host=example.com
		username=user1
		password=pass1
		EOF
		check approve $HELPER <<-\EOF &&
		protocol=https
		host=example.com
		username=user2
		password=pass2
		EOF
		check fill $HELPER <<-\EOF &&
		protocol=https
		host=example.com
		username=user1
		--
		protocol=https
		host=example.com
		username=user1
		password=pass1
		EOF
		check fill $HELPER <<-\EOF
		protocol=https
		host=example.com
		username=user2
		--
		protocol=https
		host=example.com
		username=user2
		password=pass2
		EOF
	
ok 14 - internal getpass does not ask for known username

expecting success: 
	test_config credential.helper "$HELPER" &&
	check fill <<-\EOF
	--
	username=foo
	password=bar
	--
	EOF

ok 348 - beyond a symlink from subdirectory with --verbose

expecting success: 
				expect '' &&
				
	(
		cd a &&
		test_check_ignore "symlink/foo" 128
	) &&
	test_stderr "fatal: pathspec 'symlink/foo' is beyond a symbolic link"

			
ok 349 - beyond a symlink from subdirectory with --verbose -n

expecting success: 
				expect '' &&
				
	(
		cd a &&
		test_check_ignore "symlink/foo" 128
	) &&
	test_stderr "fatal: pathspec 'symlink/foo' is beyond a symbolic link"

			
ok 15 - respect configured credentials

expecting success: 
	test_config credential.https://example.com.helper "$HELPER" &&
	check fill <<-\EOF
	protocol=https
	host=example.com
	path=repo.git
	--
	protocol=https
	host=example.com
	username=foo
	password=bar
	--
	EOF

ok 350 - beyond a symlink from subdirectory with --verbose --non-matching

expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 16 - match configured credential

expecting success: 
	test_config credential.https://foo.helper "$HELPER" &&
	check fill <<-\EOF
	protocol=https
	host=bar
	--
	protocol=https
	host=bar
	username=askpass-username
	password=askpass-password
	--
	askpass: Username for 'https://bar':
	askpass: Password for 'https://askpass-username@bar':
	EOF

ok 351 - submodule

expecting success: 
			expect '' &&
			
	test_check_ignore "a/submodule/one" 128 &&
	test_stderr "fatal: Pathspec 'a/submodule/one' is in submodule 'a/submodule'"

		
ok 9 - helper (cache) can store multiple users

ok 9 - helper (store) can store multiple users

expecting success: 
		check reject $HELPER <<-\EOF &&
		protocol=https
		host=example.com
		username=user1
		EOF
		check fill $HELPER <<-\EOF
		protocol=https
		host=example.com
		username=user1
		--
		protocol=https
		host=example.com
		username=user1
		password=askpass-password
		--
		askpass: Password for 'https://user1@example.com':
		EOF
	
expecting success: 
		check reject $HELPER <<-\EOF &&
		protocol=https
		host=example.com
		username=user1
		EOF
		check fill $HELPER <<-\EOF
		protocol=https
		host=example.com
		username=user1
		--
		protocol=https
		host=example.com
		username=user1
		password=askpass-password
		--
		askpass: Password for 'https://user1@example.com':
		EOF
	
ok 352 - submodule with -q

expecting success: 
			expect '' &&
			
	test_check_ignore "a/submodule/one" 128 &&
	test_stderr "fatal: Pathspec 'a/submodule/one' is in submodule 'a/submodule'"

		
ok 353 - submodule with --quiet

ok 17 - do not match configured credential

expecting success: 
				expect '' &&
				
	test_check_ignore "a/submodule/one" 128 &&
	test_stderr "fatal: Pathspec 'a/submodule/one' is in submodule 'a/submodule'"

			
expecting success: 
	test_config credential.https://example.com.username foo &&
	check fill <<-\EOF
	protocol=https
	host=example.com
	--
	protocol=https
	host=example.com
	username=foo
	password=askpass-password
	--
	askpass: Password for 'https://foo@example.com':
	EOF

ok 354 - submodule with -v

expecting success: 
				expect '' &&
				
	test_check_ignore "a/submodule/one" 128 &&
	test_stderr "fatal: Pathspec 'a/submodule/one' is in submodule 'a/submodule'"

			
ok 10 - helper (store) can forget user

expecting success: 
		check fill $HELPER <<-\EOF
		protocol=https
		host=example.com
		username=user2
		--
		protocol=https
		host=example.com
		username=user2
		password=pass2
		EOF
	
ok 10 - helper (cache) can forget user

expecting success: 
		check fill $HELPER <<-\EOF
		protocol=https
		host=example.com
		username=user2
		--
		protocol=https
		host=example.com
		username=user2
		password=pass2
		EOF
	
ok 18 - pull username from config

expecting success: 
	check fill "verbatim foo bar" <<-\EOF &&
	protocol=https
	host=example.com
	path=foo.git
	--
	protocol=https
	host=example.com
	username=foo
	password=bar
	--
	verbatim: get
	verbatim: protocol=https
	verbatim: host=example.com
	EOF
	test_config credential.https://example.com.useHttpPath true &&
	check fill "verbatim foo bar" <<-\EOF
	protocol=https
	host=example.com
	path=foo.git
	--
	protocol=https
	host=example.com
	path=foo.git
	username=foo
	password=bar
	--
	verbatim: get
	verbatim: protocol=https
	verbatim: host=example.com
	verbatim: path=foo.git
	EOF

ok 355 - submodule with -v -n

expecting success: 
				expect '' &&
				
	test_check_ignore "a/submodule/one" 128 &&
	test_stderr "fatal: Pathspec 'a/submodule/one' is in submodule 'a/submodule'"

			
ok 11 - helper (store) remembers other user

expecting success: 
	test_path_is_missing "$HOME/.config/git/credentials" &&
	test -s "$HOME/.git-credentials"

ok 12 - when xdg file does not exist, xdg file not created

expecting success: 
	rm -f "$HOME/.git-credentials" &&
	mkdir -p "$HOME/.config/git" &&
	>"$HOME/.config/git/credentials"

ok 13 - setup xdg file

expecting success: 
		check fill $HELPER <<-\EOF
		protocol=https
		host=example.com
		--
		protocol=https
		host=example.com
		username=askpass-username
		password=askpass-password
		--
		askpass: Username for 'https://example.com':
		askpass: Password for 'https://askpass-username@example.com':
		EOF
	
ok 11 - helper (cache) remembers other user

expecting success: 
		check approve "$HELPER" <<-\EOF &&
		protocol=https
		host=timeout.tld
		username=user
		password=pass
		EOF
		sleep 2 &&
		check fill "$HELPER" <<-\EOF
		protocol=https
		host=timeout.tld
		--
		protocol=https
		host=timeout.tld
		username=askpass-username
		password=askpass-password
		--
		askpass: Username for 'https://timeout.tld':
		askpass: Password for 'https://askpass-username@timeout.tld':
		EOF
	
ok 356 - submodule with -v --non-matching

expecting success: 
				expect '' &&
				
	test_check_ignore "a/submodule/one" 128 &&
	test_stderr "fatal: Pathspec 'a/submodule/one' is in submodule 'a/submodule'"

			
ok 357 - submodule with --verbose

expecting success: 
				expect '' &&
				
	test_check_ignore "a/submodule/one" 128 &&
	test_stderr "fatal: Pathspec 'a/submodule/one' is in submodule 'a/submodule'"

			
ok 358 - submodule with --verbose -n

expecting success: 
				expect '' &&
				
	test_check_ignore "a/submodule/one" 128 &&
	test_stderr "fatal: Pathspec 'a/submodule/one' is in submodule 'a/submodule'"

			
ok 14 - helper (store) has no existing data

expecting success: 
		check approve $HELPER <<-\EOF
		protocol=https
		host=example.com
		username=store-user
		password=store-pass
		EOF
	
ok 359 - submodule with --verbose --non-matching

expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 19 - http paths can be part of context

expecting success: 
	test_must_fail git \
		-c credential.helper="!f() { echo quit=1; }; f" \
		-c credential.helper="verbatim foo bar" \
		credential fill >stdout &&
	>expect &&
	test_cmp expect stdout

ok 15 - helper (store) stores password

expecting success: 
		check fill $HELPER <<-\EOF
		protocol=https
		host=example.com
		--
		protocol=https
		host=example.com
		username=store-user
		password=store-pass
		--
		EOF
	
fatal: credential helper '!f() { echo quit=1; }; f' told us to quit
ok 360 - submodule from subdirectory

ok 20 - helpers can abort the process

expecting success: 
			expect '' &&
			
	(
		cd a &&
		test_check_ignore "submodule/one" 128
	) &&
	test_stderr "fatal: Pathspec 'submodule/one' is in submodule 'a/submodule'"

		
# passed all 20 test(s)
1..20
ok 361 - submodule from subdirectory with -q

expecting success: 
			expect '' &&
			
	(
		cd a &&
		test_check_ignore "submodule/one" 128
	) &&
	test_stderr "fatal: Pathspec 'submodule/one' is in submodule 'a/submodule'"

		
*** t0303-credential-external.sh ***
ok 16 - helper (store) can retrieve password

expecting success: 
		check fill $HELPER <<-\EOF
		protocol=http
		host=example.com
		--
		protocol=http
		host=example.com
		username=askpass-username
		password=askpass-password
		--
		askpass: Username for 'http://example.com':
		askpass: Password for 'http://askpass-username@example.com':
		EOF
	
ok 362 - submodule from subdirectory with --quiet

expecting success: 
				expect '' &&
				
	(
		cd a &&
		test_check_ignore "submodule/one" 128
	) &&
	test_stderr "fatal: Pathspec 'submodule/one' is in submodule 'a/submodule'"

			
ok 363 - submodule from subdirectory with -v

expecting success: 
				expect '' &&
				
	(
		cd a &&
		test_check_ignore "submodule/one" 128
	) &&
	test_stderr "fatal: Pathspec 'submodule/one' is in submodule 'a/submodule'"

			
ok 17 - helper (store) requires matching protocol

expecting success: 
		check fill $HELPER <<-\EOF
		protocol=https
		host=other.tld
		--
		protocol=https
		host=other.tld
		username=askpass-username
		password=askpass-password
		--
		askpass: Username for 'https://other.tld':
		askpass: Password for 'https://askpass-username@other.tld':
		EOF
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0303-credential-external/.git/
ok 364 - submodule from subdirectory with -v -n

expecting success: 
				expect '' &&
				
	(
		cd a &&
		test_check_ignore "submodule/one" 128
	) &&
	test_stderr "fatal: Pathspec 'submodule/one' is in submodule 'a/submodule'"

			
1..0 # SKIP used to test external credential helpers
ok 365 - submodule from subdirectory with -v --non-matching

expecting success: 
				expect '' &&
				
	(
		cd a &&
		test_check_ignore "submodule/one" 128
	) &&
	test_stderr "fatal: Pathspec 'submodule/one' is in submodule 'a/submodule'"

			
*** t1000-read-tree-m-3way.sh ***
ok 18 - helper (store) requires matching host

expecting success: 
		check fill $HELPER <<-\EOF
		protocol=https
		host=example.com
		username=other
		--
		protocol=https
		host=example.com
		username=other
		password=askpass-password
		--
		askpass: Password for 'https://other@example.com':
		EOF
	
ok 366 - submodule from subdirectory with --verbose

expecting success: 
				expect '' &&
				
	(
		cd a &&
		test_check_ignore "submodule/one" 128
	) &&
	test_stderr "fatal: Pathspec 'submodule/one' is in submodule 'a/submodule'"

			
ok 367 - submodule from subdirectory with --verbose -n

expecting success: 
				expect '' &&
				
	(
		cd a &&
		test_check_ignore "submodule/one" 128
	) &&
	test_stderr "fatal: Pathspec 'submodule/one' is in submodule 'a/submodule'"

			
ok 19 - helper (store) requires matching username

expecting success: 
		test_config credential.usehttppath true &&
		check approve $HELPER <<-\EOF &&
		protocol=http
		host=path.tld
		path=foo.git
		username=user
		password=pass
		EOF
		check fill $HELPER <<-\EOF
		protocol=http
		host=path.tld
		path=bar.git
		--
		protocol=http
		host=path.tld
		path=bar.git
		username=askpass-username
		password=askpass-password
		--
		askpass: Username for 'http://path.tld/bar.git':
		askpass: Password for 'http://askpass-username@path.tld/bar.git':
		EOF
	
ok 368 - submodule from subdirectory with --verbose --non-matching

expecting success: 
	expect_from_stdin <<-\EOF &&
		.git/info/exclude:7:per-repo	per-repo
		a/.gitignore:2:*three	a/globalthree
		.git/info/exclude:7:per-repo	a/per-repo
	EOF
	test_check_ignore "-v globalone per-repo a/globalthree a/per-repo not-ignored a/globaltwo"

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1000-read-tree-m-3way/.git/
expecting success: git update-index --add $p &&
	    git update-index --add Z/$p
ok 369 - global ignore not yet enabled

expecting success: 
	enable_global_excludes &&
	expect_from_stdin <<-\EOF &&
		globalone
		per-repo
		globalthree
		a/globalthree
		a/per-repo
		globaltwo
	EOF
	test_check_ignore "globalone per-repo globalthree a/globalthree a/per-repo not-ignored globaltwo"

ok 1 - adding test file NN and Z/NN

expecting success: git update-index --add $p &&
	    git update-index --add Z/$p
ok 2 - adding test file ND and Z/ND

expecting success: git update-index --add $p &&
	    git update-index --add Z/$p
ok 370 - global ignore

expecting success: 
	enable_global_excludes &&
	expect_from_stdin <<-EOF &&
		$global_excludes:1:globalone	globalone
		.git/info/exclude:7:per-repo	per-repo
		$global_excludes:3:globalthree	globalthree
		a/.gitignore:2:*three	a/globalthree
		.git/info/exclude:7:per-repo	a/per-repo
		$global_excludes:2:!globaltwo	globaltwo
	EOF
	test_check_ignore "-v globalone per-repo globalthree a/globalthree a/per-repo not-ignored globaltwo"

ok 3 - adding test file NM and Z/NM

expecting success: git update-index --add $p &&
	    git update-index --add Z/$p
ok 20 - helper (store) requires matching path

expecting success: 
		check reject $HELPER <<-\EOF &&
		protocol=https
		host=example.com
		EOF
		check fill $HELPER <<-\EOF
		protocol=https
		host=example.com
		--
		protocol=https
		host=example.com
		username=askpass-username
		password=askpass-password
		--
		askpass: Username for 'https://example.com':
		askpass: Password for 'https://askpass-username@example.com':
		EOF
	
ok 371 - global ignore with -v

ok 4 - adding test file DN and Z/DN

expecting success: git update-index --add $p &&
	    git update-index --add Z/$p
expecting success: 
	expect_from_stdin <expected-default &&
	test_check_ignore "--stdin" <stdin

ok 5 - adding test file DD and Z/DD

expecting success: git update-index --add $p &&
	    git update-index --add Z/$p
ok 372 - --stdin

expecting success: 
	expect "" &&
	test_check_ignore "-q --stdin" <stdin

ok 6 - adding test file DM and Z/DM

expecting success: git update-index --add $p &&
	    git update-index --add Z/$p
ok 21 - helper (store) can forget host

expecting success: 
		check approve $HELPER <<-\EOF &&
		protocol=https
		host=example.com
		username=user1
		password=pass1
		EOF
		check approve $HELPER <<-\EOF &&
		protocol=https
		host=example.com
		username=user2
		password=pass2
		EOF
		check fill $HELPER <<-\EOF &&
		protocol=https
		host=example.com
		username=user1
		--
		protocol=https
		host=example.com
		username=user1
		password=pass1
		EOF
		check fill $HELPER <<-\EOF
		protocol=https
		host=example.com
		username=user2
		--
		protocol=https
		host=example.com
		username=user2
		password=pass2
		EOF
	
ok 7 - adding test file MN and Z/MN

expecting success: git update-index --add $p &&
	    git update-index --add Z/$p
ok 373 - --stdin -q

expecting success: 
	expect_from_stdin <expected-verbose &&
	test_check_ignore "-v --stdin" <stdin

ok 8 - adding test file MD and Z/MD

expecting success: git update-index --add $p &&
	    git update-index --add Z/$p
ok 374 - --stdin -v

expecting success: 
		expect_from_stdin <expected-default0 &&
		test_check_ignore '--stdin -z' <stdin0
	
ok 9 - adding test file MM and Z/MM

expecting success: git update-index --add SS
ok 375 - --stdin -z

expecting success: 
		expect  &&
		test_check_ignore '-q --stdin -z' <stdin0
	
ok 10 - adding test file SS

expecting success: git update-index --add TT
ok 376 - --stdin -z -q

expecting success: 
		expect_from_stdin <expected-verbose0 &&
		test_check_ignore '-v --stdin -z' <stdin0
	
ok 11 - adding test file TT

expecting success: tree_O=$(git write-tree)
ok 12 - prepare initial tree

expecting success: git update-index --remove $to_remove
ok 377 - --stdin -z -v

expecting success: 
		expect_from_stdin <expected-default0 &&
		test_check_ignore '-z --stdin' <stdin0
	
ok 13 - change in branch A (removal)

expecting success: git update-index MD
ok 22 - helper (store) can store multiple users

expecting success: 
		check reject $HELPER <<-\EOF &&
		protocol=https
		host=example.com
		username=user1
		EOF
		check fill $HELPER <<-\EOF
		protocol=https
		host=example.com
		username=user1
		--
		protocol=https
		host=example.com
		username=user1
		password=askpass-password
		--
		askpass: Password for 'https://user1@example.com':
		EOF
	
ok 14 - change in branch A (modification)

expecting success: git update-index MM
ok 378 - -z --stdin

expecting success: 
		expect  &&
		test_check_ignore '-q -z --stdin' <stdin0
	
ok 15 - change in branch A (modification)

expecting success: git update-index MN
ok 379 - -z --stdin -q

ok 16 - change in branch A (modification)

expecting success: 
		expect_from_stdin <expected-verbose0 &&
		test_check_ignore '-v -z --stdin' <stdin0
	
expecting success: git update-index Z/MD
ok 17 - change in branch A (modification)

expecting success: git update-index Z/MM
ok 380 - -z --stdin -v

ok 18 - change in branch A (modification)

expecting success: git update-index Z/MN
ok 23 - helper (store) can forget user

expecting success: 
		check fill $HELPER <<-\EOF
		protocol=https
		host=example.com
		username=user2
		--
		protocol=https
		host=example.com
		username=user2
		password=pass2
		EOF
	
ok 19 - change in branch A (modification)

expecting success: git update-index --add AN
ok 20 - change in branch A (addition)

expecting success: 
	expect_from_stdin <expected-default &&
	(
		cd a &&
		test_check_ignore "--stdin" <../stdin
	)

expecting success: git update-index --add AA
ok 21 - change in branch A (addition)

expecting success: git update-index --add Z/AN
ok 24 - helper (store) remembers other user

expecting success: 
	test -s "$HOME/.config/git/credentials" &&
	test_path_is_missing "$HOME/.git-credentials"

ok 25 - when xdg file exists, home file not created

expecting success: 
	rm -f "$HOME/.git-credentials" &&
	rm -f "$HOME/.config/git/credentials" &&
	mkdir -p "$HOME/xdg/git" &&
	>"$HOME/xdg/git/credentials"

ok 381 - --stdin from subdirectory

expecting success: 
	expect_from_stdin <expected-verbose &&
	(
		cd a &&
		test_check_ignore "--stdin -v" <../stdin
	)

ok 22 - change in branch A (addition)

expecting success: git update-index --add Z/AA
ok 26 - setup custom xdg file

expecting success: 
		check fill $HELPER <<-\EOF
		protocol=https
		host=example.com
		--
		protocol=https
		host=example.com
		username=askpass-username
		password=askpass-password
		--
		askpass: Username for 'https://example.com':
		askpass: Password for 'https://askpass-username@example.com':
		EOF
	
ok 23 - change in branch A (addition)

expecting success: git update-index --add LL &&
     git update-index SS
ok 382 - --stdin from subdirectory with -v

expecting success: 
	expect_from_stdin <expected-all &&
	(
		cd a &&
		test_check_ignore "--stdin -v -n" <../stdin
	)

ok 24 - change in branch A (addition)

expecting success: git update-index TT
ok 383 - --stdin from subdirectory with -v -n

expecting success: 
		expect_from_stdin <expected-default0 &&
		(
			cd a &&
			test_check_ignore "--stdin -z" <../stdin0
		)
	
ok 27 - helper (store) has no existing data

expecting success: 
		check approve $HELPER <<-\EOF
		protocol=https
		host=example.com
		username=store-user
		password=store-pass
		EOF
	
ok 25 - change in branch A (edit)

expecting success: git update-index --add DF/DF
ok 384 - --stdin -z from subdirectory

expecting success: 
		expect_from_stdin <expected-verbose0 &&
		(
			cd a &&
			test_check_ignore "--stdin -z -v" <../stdin0
		)
	
ok 26 - change in branch A (change file to directory)

expecting success: tree_A=$(git write-tree)
ok 28 - helper (store) stores password

expecting success: 
		check fill $HELPER <<-\EOF
		protocol=https
		host=example.com
		--
		protocol=https
		host=example.com
		username=store-user
		password=store-pass
		--
		EOF
	
ok 27 - recording branch A tree

ok 385 - --stdin -z from subdirectory with -v

expecting success: 
		expect_from_stdin <expected-default0 &&
		(
			cd a &&
			test_check_ignore "-z --stdin" <../stdin0
		)
	
expecting success: git read-tree $tree_O &&
     git checkout-index -a
ok 29 - helper (store) can retrieve password

expecting success: 
		check fill $HELPER <<-\EOF
		protocol=http
		host=example.com
		--
		protocol=http
		host=example.com
		username=askpass-username
		password=askpass-password
		--
		askpass: Username for 'http://example.com':
		askpass: Password for 'http://askpass-username@example.com':
		EOF
	
ok 386 - -z --stdin from subdirectory

expecting success: 
		expect_from_stdin <expected-verbose0 &&
		(
			cd a &&
			test_check_ignore "-z --stdin -v" <../stdin0
		)
	
ok 28 - reading original tree and checking out

expecting success: git update-index --remove DD MD ND Z/DD Z/MD Z/ND
ok 29 - change in branch B (removal)

expecting success: git update-index DM
ok 387 - -z --stdin from subdirectory with -v

ok 30 - change in branch B (modification)

expecting success: git update-index MM
checking prerequisite: PIPE

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	# test whether the filesystem supports FIFOs
	case $(uname -s) in
	CYGWIN*)
		false
		;;
	*)
		rm -f testfifo && mkfifo testfifo
		;;
	esac

)
ok 30 - helper (store) requires matching protocol

expecting success: 
		check fill $HELPER <<-\EOF
		protocol=https
		host=other.tld
		--
		protocol=https
		host=other.tld
		username=askpass-username
		password=askpass-password
		--
		askpass: Username for 'https://other.tld':
		askpass: Password for 'https://askpass-username@other.tld':
		EOF
	
ok 31 - change in branch B (modification)

expecting success: git update-index NM
ok 32 - change in branch B (modification)

ok 12 - helper (cache --timeout=1) times out

expecting success: git update-index Z/DM
prerequisite PIPE ok
expecting success: 
	mkfifo in out &&
	(git check-ignore -n -v --stdin <in >out &) &&

	# We cannot just "echo >in" because check-ignore would get EOF
	# after echo exited; instead we open the descriptor in our
	# shell, and then echo to the fd. We make sure to close it at
	# the end, so that the subprocess does get EOF and dies
	# properly.
	#
	# Similarly, we must keep "out" open so that check-ignore does
	# not ever get SIGPIPE trying to write to us. Not only would that
	# produce incorrect results, but then there would be no writer on the
	# other end of the pipe, and we would potentially block forever trying
	# to open it.
	exec 9>in &&
	exec 8<out &&
	test_when_finished "exec 9>&-" &&
	test_when_finished "exec 8<&-" &&
	echo >&9 one &&
	read response <&8 &&
	echo "$response" | grep "^\.gitignore:1:one	one" &&
	echo >&9 two &&
	read response <&8 &&
	echo "$response" | grep "^::	two"

ok 33 - change in branch B (modification)

expecting success: git update-index Z/MM
# passed all 12 test(s)
1..12
.gitignore:1:one	one
::	two
ok 34 - change in branch B (modification)

expecting success: git update-index Z/NM
ok 388 - streaming support for --stdin

expecting success: 
	mkdir whitespace &&
	>whitespace/trailing &&
	>whitespace/untracked &&
	echo "whitespace/trailing   " >ignore &&
	cat >expect <<EOF &&
whitespace/untracked
EOF
	: >err.expect &&
	git ls-files -o -X ignore whitespace >actual 2>err &&
	test_cmp expect actual &&
	test_cmp err.expect err

ok 31 - helper (store) requires matching host

expecting success: 
		check fill $HELPER <<-\EOF
		protocol=https
		host=example.com
		username=other
		--
		protocol=https
		host=example.com
		username=other
		password=askpass-password
		--
		askpass: Password for 'https://other@example.com':
		EOF
	
ok 35 - change in branch B (modification)

expecting success: git update-index --add NA
*** t1001-read-tree-m-2way.sh ***
ok 36 - change in branch B (addition)

expecting success: git update-index --add AA
ok 389 - trailing whitespace is ignored

expecting success: 
	rm -rf whitespace &&
	mkdir whitespace &&
	>"whitespace/trailing  " &&
	>whitespace/untracked &&
	echo "whitespace/trailing\\ \\ " >ignore &&
	echo whitespace/untracked >expect &&
	: >err.expect &&
	git ls-files -o -X ignore whitespace >actual 2>err &&
	test_cmp expect actual &&
	test_cmp err.expect err

ok 37 - change in branch B (addition)

expecting success: git update-index --add Z/NA
ok 38 - change in branch B (addition)

expecting success: git update-index --add Z/AA
ok 32 - helper (store) requires matching username

expecting success: 
		test_config credential.usehttppath true &&
		check approve $HELPER <<-\EOF &&
		protocol=http
		host=path.tld
		path=foo.git
		username=user
		password=pass
		EOF
		check fill $HELPER <<-\EOF
		protocol=http
		host=path.tld
		path=bar.git
		--
		protocol=http
		host=path.tld
		path=bar.git
		username=askpass-username
		password=askpass-password
		--
		askpass: Username for 'http://path.tld/bar.git':
		askpass: Password for 'http://askpass-username@path.tld/bar.git':
		EOF
	
ok 390 - quoting allows trailing whitespace

ok 39 - change in branch B (addition)

expecting success: git update-index --add LL &&
     git update-index SS
expecting success: 
	rm -rf whitespace &&
	mkdir whitespace &&
	>"whitespace/trailing 1  " &&
	>"whitespace/trailing 2 \\\\" &&
	>"whitespace/trailing 3 \\\\" &&
	>"whitespace/trailing 4   \\ " &&
	>"whitespace/trailing 5 \\ \\ " &&
	>"whitespace/trailing 6 \\a\\" &&
	>whitespace/untracked &&
	sed -e "s/Z$//" >ignore <<-\EOF &&
	whitespace/trailing 1 \    Z
	whitespace/trailing 2 \\\\Z
	whitespace/trailing 3 \\\\ Z
	whitespace/trailing 4   \\\    Z
	whitespace/trailing 5 \\ \\\   Z
	whitespace/trailing 6 \\a\\Z
	EOF
	echo whitespace/untracked >expect &&
	>err.expect &&
	git ls-files -o -X ignore whitespace >actual 2>err &&
	test_cmp expect actual &&
	test_cmp err.expect err

ok 40 - change in branch B (addition and modification)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1001-read-tree-m-2way/.git/
ok 391 - correct handling of backslashes

expecting success: 
	echo >>global-excludes usually-ignored &&
	echo >>.git/info/exclude "!usually-ignored" &&
	>usually-ignored &&
	echo "?? usually-ignored" >expect &&

	git status --porcelain usually-ignored >actual &&
	test_cmp expect actual

expecting success: git update-index TT
expecting success: echo frotz >frotz &&
     echo nitfol >nitfol &&
     cat bozbar-old >bozbar &&
     echo rezrov >rezrov &&
     echo yomin >yomin &&
     git update-index --add nitfol bozbar rezrov &&
     treeH=$(git write-tree) &&
     echo treeH $treeH &&
     git ls-tree $treeH &&

     cat bozbar-new >bozbar &&
     git update-index --add frotz bozbar --force-remove rezrov &&
     git ls-files --stage >M.out &&
     treeM=$(git write-tree) &&
     echo treeM $treeM &&
     git ls-tree $treeM &&
     git diff-tree $treeH $treeM
ok 392 - info/exclude trumps core.excludesfile

ok 41 - change in branch B (modification)

expecting success: git update-index --add DF
# passed all 392 test(s)
1..392
ok 42 - change in branch B (addition of a file to conflict with directory)

expecting success: tree_B=$(git write-tree)
treeH ca3aa9e6ee09349df7db6f0de15016afcdf5d9e4
ok 43 - recording branch B tree

100644 blob 3e8d9abb979a4fbdc93309f457a5496bc41ba6ab	bozbar
100644 blob dca6b92303befc93086aa025d90a5facd7eb2812	nitfol
100644 blob 766498d93a4b06057a8e49d23f4068f1170ff38f	rezrov
expecting success: rm -f .git/index &&
     git read-tree $tree_O &&
     mkdir .orig-O &&
     git checkout-index --prefix=.orig-O/ -f -q -a &&
     rm -f .git/index &&
     git read-tree $tree_A &&
     mkdir .orig-A &&
     git checkout-index --prefix=.orig-A/ -f -q -a &&
     rm -f .git/index &&
     git read-tree $tree_B &&
     mkdir .orig-B &&
     git checkout-index --prefix=.orig-B/ -f -q -a
*** t1002-read-tree-m-u-2way.sh ***
treeM d2c045ead2ecb56f2632385a395918bf21816c12
ok 33 - helper (store) requires matching path

expecting success: 
		check reject $HELPER <<-\EOF &&
		protocol=https
		host=example.com
		EOF
		check fill $HELPER <<-\EOF
		protocol=https
		host=example.com
		--
		protocol=https
		host=example.com
		username=askpass-username
		password=askpass-password
		--
		askpass: Username for 'https://example.com':
		askpass: Password for 'https://askpass-username@example.com':
		EOF
	
100644 blob 346d4e61f111336a1443ef6b2e834aa5b1a7f91a	bozbar
100644 blob 8e4020bb5a8d8c873b25de15933e75cc0fc275df	frotz
100644 blob dca6b92303befc93086aa025d90a5facd7eb2812	nitfol
:100644 100644 3e8d9abb979a4fbdc93309f457a5496bc41ba6ab 346d4e61f111336a1443ef6b2e834aa5b1a7f91a M	bozbar
:000000 100644 0000000000000000000000000000000000000000 8e4020bb5a8d8c873b25de15933e75cc0fc275df A	frotz
:100644 000000 766498d93a4b06057a8e49d23f4068f1170ff38f 0000000000000000000000000000000000000000 D	rezrov
ok 1 - setup

expecting success: rm -f .git/index &&
     read_tree_twoway $treeH $treeM &&
     git ls-files --stage >1-3.out &&
     test_cmp M.out 1-3.out &&
     check_cache_at bozbar dirty &&
     check_cache_at frotz dirty &&
     check_cache_at nitfol dirty
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1002-read-tree-m-u-2way/.git/
100644 346d4e61f111336a1443ef6b2e834aa5b1a7f91a 0	bozbar
100644 8e4020bb5a8d8c873b25de15933e75cc0fc275df 0	frotz
100644 dca6b92303befc93086aa025d90a5facd7eb2812 0	nitfol
expecting success: echo frotz >frotz &&
     echo nitfol >nitfol &&
     echo bozbar >bozbar &&
     echo rezrov >rezrov &&
     git update-index --add nitfol bozbar rezrov &&
     treeH=$(git write-tree) &&
     echo treeH $treeH &&
     git ls-tree $treeH &&

     echo gnusto >bozbar &&
     git update-index --add frotz bozbar --force-remove rezrov &&
     git ls-files --stage >M.out &&
     treeM=$(git write-tree) &&
     echo treeM $treeM &&
     git ls-tree $treeM &&
     sum bozbar frotz nitfol >M.sum &&
     git diff-tree $treeH $treeM
bozbar: dirty
ok 44 - keep contents of 3 trees for easy access

frotz: dirty
expecting success: rm -fr [NDMALTS][NDMALTSF] Z &&
     rm .git/index &&
     read_tree_must_succeed -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226 &&
     check_result
nitfol: dirty
ok 2 - 1, 2, 3 - no carry forward

expecting success: rm -f .git/index &&
     read_tree_must_succeed $treeH &&
     git checkout-index -u -f -q -a &&
     git update-index --add yomin &&
     read_tree_twoway $treeH $treeM &&
     git ls-files --stage >4.out &&
     test_must_fail git diff --no-index M.out 4.out >4diff.out &&
     compare_change 4diff.out expected &&
     check_cache_at yomin clean
treeH 661afa9096b7e2d4b9a28a6e43736cd0b06d1308
ok 34 - helper (store) can forget host

expecting success: 
		check approve $HELPER <<-\EOF &&
		protocol=https
		host=example.com
		username=user1
		password=pass1
		EOF
		check approve $HELPER <<-\EOF &&
		protocol=https
		host=example.com
		username=user2
		password=pass2
		EOF
		check fill $HELPER <<-\EOF &&
		protocol=https
		host=example.com
		username=user1
		--
		protocol=https
		host=example.com
		username=user1
		password=pass1
		EOF
		check fill $HELPER <<-\EOF
		protocol=https
		host=example.com
		username=user2
		--
		protocol=https
		host=example.com
		username=user2
		password=pass2
		EOF
	
100644 blob 78d812a2124ff980a1a70f8cca493698d643d242	bozbar
100644 blob dca6b92303befc93086aa025d90a5facd7eb2812	nitfol
100644 blob 766498d93a4b06057a8e49d23f4068f1170ff38f	rezrov
treeM 05bf9652e9b06473d6ca2f32ff60e2401e59bfa6
100644 blob bb3b2cd2e136e1e4e7ecdf10068e246196dd8294	bozbar
100644 blob 8e4020bb5a8d8c873b25de15933e75cc0fc275df	frotz
100644 blob dca6b92303befc93086aa025d90a5facd7eb2812	nitfol
ok 45 - 3-way merge with git read-tree -m, empty cache

expecting success: rm -fr [NDMALTS][NDMALTSF] Z &&
     rm .git/index &&
     read_tree_must_succeed 997bbc4a0a51e0574168a4f637739380edebe4d7 &&
     git checkout-index -f -u -a &&
     read_tree_must_succeed -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226 &&
     check_result
:100644 100644 78d812a2124ff980a1a70f8cca493698d643d242 bb3b2cd2e136e1e4e7ecdf10068e246196dd8294 M	bozbar
:000000 100644 0000000000000000000000000000000000000000 8e4020bb5a8d8c873b25de15933e75cc0fc275df A	frotz
:100644 000000 766498d93a4b06057a8e49d23f4068f1170ff38f 0000000000000000000000000000000000000000 D	rezrov
ok 1 - setup

expecting success: rm -f .git/index nitfol bozbar rezrov frotz &&
     read_tree_u_must_succeed --reset -u $treeH &&
     read_tree_u_must_succeed -m -u $treeH $treeM &&
     git ls-files --stage >1-3.out &&
     cmp M.out 1-3.out &&
     sum bozbar frotz nitfol >actual3.sum &&
     cmp M.sum actual3.sum &&
     check_cache_at bozbar clean &&
     check_cache_at frotz clean &&
     check_cache_at nitfol clean
100644 346d4e61f111336a1443ef6b2e834aa5b1a7f91a 0	bozbar
100644 8e4020bb5a8d8c873b25de15933e75cc0fc275df 0	frotz
100644 dca6b92303befc93086aa025d90a5facd7eb2812 0	nitfol
100644 0a41e115ab61be0328a19b29f18cdcb49338d516 0	yomin
yomin: clean
ok 3 - 4 - carry forward local addition.

expecting success: rm -f .git/index &&
     read_tree_must_succeed $treeH &&
     git checkout-index -u -f -q -a &&
     echo yomin >yomin &&
     git update-index --add yomin &&
     echo yomin yomin >yomin &&
     read_tree_twoway $treeH $treeM &&
     git ls-files --stage >5.out &&
     test_must_fail git diff --no-index M.out 5.out >5diff.out &&
     compare_change 5diff.out expected &&
     check_cache_at yomin dirty
ok 35 - helper (store) can store multiple users

expecting success: 
		check reject $HELPER <<-\EOF &&
		protocol=https
		host=example.com
		username=user1
		EOF
		check fill $HELPER <<-\EOF
		protocol=https
		host=example.com
		username=user1
		--
		protocol=https
		host=example.com
		username=user1
		password=askpass-password
		--
		askpass: Password for 'https://user1@example.com':
		EOF
	
ok 46 - 3-way merge with git read-tree -m, match H

expecting success: 
     rm -f .git/index XX &&
     echo XX >XX &&
     git update-index --add XX &&
     read_tree_must_fail -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226

100644 346d4e61f111336a1443ef6b2e834aa5b1a7f91a 0	bozbar
100644 8e4020bb5a8d8c873b25de15933e75cc0fc275df 0	frotz
100644 dca6b92303befc93086aa025d90a5facd7eb2812 0	nitfol
100644 0a41e115ab61be0328a19b29f18cdcb49338d516 0	yomin
ok 36 - helper (store) can forget user

expecting success: 
		check fill $HELPER <<-\EOF
		protocol=https
		host=example.com
		username=user2
		--
		protocol=https
		host=example.com
		username=user2
		password=pass2
		EOF
	
error: Entry 'XX' would be overwritten by merge. Cannot merge.
yomin: dirty
ok 4 - 5 - carry forward local addition.

ok 37 - helper (store) remembers other user

expecting success: rm -f .git/index &&
     read_tree_must_succeed $treeH &&
     git checkout-index -u -f -q -a &&
     git update-index --add frotz &&
     read_tree_twoway $treeH $treeM &&
     git ls-files --stage >6.out &&
     test_cmp M.out 6.out &&
     check_cache_at frotz clean
expecting success: 
	test_when_finished "rm -f $HOME/xdg/git/credentials" &&
	test -s "$HOME/xdg/git/credentials" &&
	test_path_is_missing "$HOME/.git-credentials" &&
	test_path_is_missing "$HOME/.config/git/credentials"

bozbar: clean
ok 38 - if custom xdg file exists, home and xdg files not created

expecting success: 
	echo "https://home-user:home-pass@example.com" >"$HOME/.git-credentials" &&
	mkdir -p "$HOME/.config/git" &&
	echo "https://xdg-user:xdg-pass@example.com" >"$HOME/.config/git/credentials" &&
	check fill store <<-\EOF
	protocol=https
	host=example.com
	--
	protocol=https
	host=example.com
	username=home-user
	password=home-pass
	--
	EOF

frotz: clean
error: Entry 'XX' would be overwritten by merge. Cannot merge.
ok 47 - 1 - must not have an entry not in A.

expecting success: rm -f .git/index NA &&
     cp .orig-B/NA NA &&
     git update-index --add NA &&
     read_tree_must_succeed -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226
nitfol: clean
ok 2 - 1, 2, 3 - no carry forward

expecting success: rm -f .git/index nitfol bozbar rezrov frotz &&
     read_tree_u_must_succeed --reset -u $treeH &&
     echo "+100644 X 0	yomin" >expected &&
     echo yomin >yomin &&
     git update-index --add yomin &&
     read_tree_u_must_succeed -m -u $treeH $treeM &&
     git ls-files --stage >4.out &&
     test_might_fail git diff -U0 --no-index M.out 4.out >4diff.out &&
     compare_change 4diff.out expected &&
     check_cache_at yomin clean &&
     sum bozbar frotz nitfol >actual4.sum &&
     cmp M.sum actual4.sum &&
     echo yomin >yomin1 &&
     diff yomin yomin1 &&
     rm -f yomin1
ok 39 - get: use home file if both home and xdg files have matches

expecting success: 
	>"$HOME/.git-credentials" &&
	mkdir -p "$HOME/.config/git" &&
	echo "https://xdg-user:xdg-pass@example.com" >"$HOME/.config/git/credentials" &&
	check fill store <<-\EOF
	protocol=https
	host=example.com
	--
	protocol=https
	host=example.com
	username=xdg-user
	password=xdg-pass
	--
	EOF

100644 346d4e61f111336a1443ef6b2e834aa5b1a7f91a 0	bozbar
100644 8e4020bb5a8d8c873b25de15933e75cc0fc275df 0	frotz
100644 dca6b92303befc93086aa025d90a5facd7eb2812 0	nitfol
ok 40 - get: use xdg file if home file has no matches

ok 48 - 2 - must match B in !O && !A && B case.

expecting success: rm -f .git/index NA &&
     cp .orig-B/NA NA &&
     git update-index --add NA &&
     echo extra >>NA &&
     read_tree_must_succeed -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226
checking prerequisite: SANITY

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	mkdir SANETESTD.1 SANETESTD.2 &&

	chmod +w SANETESTD.1 SANETESTD.2 &&
	>SANETESTD.1/x 2>SANETESTD.2/x &&
	chmod -w SANETESTD.1 &&
	chmod -rx SANETESTD.2 ||
	error "bug in test sript: cannot prepare SANETESTD"

	! rm SANETESTD.1/x && ! test -f SANETESTD.2/x
	status=$?

	chmod +rwx SANETESTD.1 SANETESTD.2 &&
	rm -rf SANETESTD.1 SANETESTD.2 ||
	error "bug in test sript: cannot clean SANETESTD"
	return $status

)
frotz: clean
ok 5 - 6 - local addition already has the same.

expecting success: rm -f .git/index &&
     read_tree_must_succeed $treeH &&
     git checkout-index -u -f -q -a &&
     echo frotz >frotz &&
     git update-index --add frotz &&
     echo frotz frotz >frotz &&
     read_tree_twoway $treeH $treeM &&
     git ls-files --stage >7.out &&
     test_cmp M.out 7.out &&
     check_cache_at frotz dirty
rm: cannot remove 'SANETESTD.1/x': Permission denied
prerequisite SANITY ok
expecting success: 
	echo "https://home-user:home-pass@example.com" >"$HOME/.git-credentials" &&
	chmod -r "$HOME/.git-credentials" &&
	mkdir -p "$HOME/.config/git" &&
	echo "https://xdg-user:xdg-pass@example.com" >"$HOME/.config/git/credentials" &&
	check fill store <<-\EOF
	protocol=https
	host=example.com
	--
	protocol=https
	host=example.com
	username=xdg-user
	password=xdg-pass
	--
	EOF

ok 49 - 2 - matching B alone is OK in !O && !A && B case.

expecting success: rm -f .git/index AN &&
     cp .orig-A/AN AN &&
     git update-index --add AN &&
     read_tree_must_succeed -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226 &&
     check_result
ok 41 - get: use xdg file if home file is unreadable

expecting success: 
	>"$HOME/.git-credentials" &&
	mkdir -p "$HOME/.config/git" &&
	>"$HOME/.config/git/credentials" &&
	check approve store <<-\EOF &&
	protocol=https
	host=example.com
	username=store-user
	password=store-pass
	EOF
	echo "https://store-user:store-pass@example.com" >expected &&
	test_cmp expected "$HOME/.git-credentials" &&
	test_must_be_empty "$HOME/.config/git/credentials"

100644 346d4e61f111336a1443ef6b2e834aa5b1a7f91a 0	bozbar
100644 8e4020bb5a8d8c873b25de15933e75cc0fc275df 0	frotz
100644 dca6b92303befc93086aa025d90a5facd7eb2812 0	nitfol
yomin: clean
ok 42 - store: if both xdg and home files exist, only store in home file

expecting success: 
	echo "https://home-user:home-pass@example.com" >"$HOME/.git-credentials" &&
	mkdir -p "$HOME/.config/git" &&
	echo "https://xdg-user:xdg-pass@example.com" >"$HOME/.config/git/credentials" &&
	check reject store <<-\EOF &&
	protocol=https
	host=example.com
	EOF
	test_must_be_empty "$HOME/.git-credentials" &&
	test_must_be_empty "$HOME/.config/git/credentials"

ok 3 - 4 - carry forward local addition.

expecting success: rm -f .git/index nitfol bozbar rezrov frotz &&
     read_tree_u_must_succeed --reset -u $treeH &&
     read_tree_u_must_succeed -m -u $treeH &&
     echo yomin >yomin &&
     git update-index --add yomin &&
     echo yomin yomin >yomin &&
     read_tree_u_must_succeed -m -u $treeH $treeM &&
     git ls-files --stage >5.out &&
     test_might_fail git diff -U0 --no-index M.out 5.out >5diff.out &&
     compare_change 5diff.out expected &&
     check_cache_at yomin dirty &&
     sum bozbar frotz nitfol >actual5.sum &&
     cmp M.sum actual5.sum &&
     : dirty index should have prevented -u from checking it out. &&
     echo yomin yomin >yomin1 &&
     diff yomin yomin1 &&
     rm -f yomin1
frotz: dirty
ok 6 - 7 - local addition already has the same.

expecting success: rm -f .git/index &&
     read_tree_must_succeed $treeH &&
     git checkout-index -u -f -q -a &&
     echo frotz frotz >frotz &&
     git update-index --add frotz &&
     if read_tree_twoway $treeH $treeM; then false; else :; fi
ok 50 - 3 - must match A in !O && A && !B case.

expecting success: rm -f .git/index AN &&
     cp .orig-A/AN AN &&
     git update-index --add AN &&
     echo extra >>AN &&
     read_tree_must_succeed -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226
ok 43 - erase: erase matching credentials from both xdg and home files

# passed all 43 test(s)
1..43
*** t1003-read-tree-prefix.sh ***
ok 51 - 3 - matching A alone is OK in !O && A && !B case.

expecting success: 
     rm -f .git/index AN &&
     cp .orig-A/AN AN &&
     echo extra >>AN &&
     git update-index --add AN &&
     read_tree_must_fail -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226

error: Entry 'frotz' would be overwritten by merge. Cannot merge.
ok 7 - 8 - conflicting addition.

expecting success: rm -f .git/index &&
     read_tree_must_succeed $treeH &&
     git checkout-index -u -f -q -a &&
     echo frotz frotz >frotz &&
     git update-index --add frotz &&
     echo frotz >frotz &&
     if read_tree_twoway $treeH $treeM; then false; else :; fi
error: Entry 'AN' would be overwritten by merge. Cannot merge.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1003-read-tree-prefix/.git/
error: Entry 'AN' would be overwritten by merge. Cannot merge.
ok 52 - 3 (fail) - must match A in !O && A && !B case.

expecting success: rm -f .git/index AA &&
     cp .orig-A/AA AA &&
     git update-index --add AA &&
     read_tree_must_succeed -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226 &&
     check_result
expecting success: 
	echo hello >one &&
	git update-index --add one &&
	tree=$(git write-tree) &&
	echo tree is $tree

error: Entry 'frotz' would be overwritten by merge. Cannot merge.
tree is 700196ec4e5b1c75e9f5481e5b545d78533ff917
ok 1 - setup
ok 8 - 9 - conflicting addition.


expecting success: rm -f .git/index &&
     read_tree_must_succeed $treeH &&
     git checkout-index -u -f -q -a &&
     echo rezrov >rezrov &&
     git update-index --add rezrov &&
     read_tree_twoway $treeH $treeM &&
     git ls-files --stage >10.out &&
     test_cmp M.out 10.out
expecting success: 
	git read-tree --prefix=two/ $tree &&
	git ls-files >actual &&
	cmp expect actual

ok 2 - read-tree --prefix

# passed all 2 test(s)
1..2
*** t1004-read-tree-m-u-wf.sh ***
ok 53 - 4 - must match and be up-to-date in !O && A && B && A!=B case.

expecting success: 
     rm -f .git/index AA &&
     cp .orig-A/AA AA &&
     git update-index --add AA &&
     echo extra >>AA &&
     read_tree_must_fail -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226

100644 346d4e61f111336a1443ef6b2e834aa5b1a7f91a 0	bozbar
100644 8e4020bb5a8d8c873b25de15933e75cc0fc275df 0	frotz
100644 dca6b92303befc93086aa025d90a5facd7eb2812 0	nitfol
error: Entry 'AA' not uptodate. Cannot merge.
ok 9 - 10 - path removed.

expecting success: rm -f .git/index &&
     read_tree_must_succeed $treeH &&
     git checkout-index -u -f -q -a &&
     echo rezrov >rezrov &&
     git update-index --add rezrov &&
     echo rezrov rezrov >rezrov &&
     if read_tree_twoway $treeH $treeM; then false; else :; fi
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1004-read-tree-m-u-wf/.git/
yomin: dirty
error: Entry 'AA' not uptodate. Cannot merge.
ok 54 - 4 (fail) - must match and be up-to-date in !O && A && B && A!=B case.

expecting success: 

	mkdir subdir &&
	echo >file1 file one &&
	echo >file2 file two &&
	echo >subdir/file1 file one in subdirectory &&
	echo >subdir/file2 file two in subdirectory &&
	git update-index --add file1 file2 subdir/file1 subdir/file2 &&
	git commit -m initial &&

	git branch side &&
	git tag -f branch-point &&

	echo file2 is not tracked on the master anymore &&
	rm -f file2 subdir/file2 &&
	git update-index --remove file2 subdir/file2 &&
	git commit -a -m "master removes file2 and subdir/file2"

expecting success: 
     rm -f .git/index AA &&
     cp .orig-A/AA AA &&
     echo extra >>AA &&
     git update-index --add AA &&
     read_tree_must_fail -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226

ok 4 - 5 - carry forward local addition.

expecting success: rm -f .git/index nitfol bozbar rezrov frotz &&
     read_tree_u_must_succeed --reset -u $treeH &&
     echo frotz >frotz &&
     git update-index --add frotz &&
     read_tree_u_must_succeed -m -u $treeH $treeM &&
     git ls-files --stage >6.out &&
     test_cmp M.out 6.out &&
     check_cache_at frotz clean &&
     sum bozbar frotz nitfol >actual3.sum &&
     cmp M.sum actual3.sum &&
     echo frotz >frotz1 &&
     diff frotz frotz1 &&
     rm -f frotz1
error: Entry 'AA' would be overwritten by merge. Cannot merge.
error: Entry 'rezrov' not uptodate. Cannot merge.
ok 10 - 11 - dirty path removed.

expecting success: rm -f .git/index &&
     read_tree_must_succeed $treeH &&
     git checkout-index -u -f -q -a &&
     echo rezrov rezrov >rezrov &&
     git update-index --add rezrov &&
     if read_tree_twoway $treeH $treeM; then false; else :; fi
[master (root-commit) 8335eaf] initial
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 file1
 create mode 100644 file2
 create mode 100644 subdir/file1
 create mode 100644 subdir/file2
error: Entry 'AA' would be overwritten by merge. Cannot merge.
ok 55 - 4 (fail) - must match and be up-to-date in !O && A && B && A!=B case.

expecting success: rm -f .git/index LL &&
     cp .orig-A/LL LL &&
     git update-index --add LL &&
     read_tree_must_succeed -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226 &&
     check_result
file2 is not tracked on the master anymore
[master 5d3fcf9] master removes file2 and subdir/file2
 Author: A U Thor <author@example.com>
 2 files changed, 2 deletions(-)
 delete mode 100644 file2
 delete mode 100644 subdir/file2
ok 1 - two-way setup

expecting success: 

	echo >file2 master creates untracked file2 &&
	echo >subdir/file2 master creates untracked subdir/file2 &&
	if err=$(read_tree_u_must_succeed -m -u master side 2>&1)
	then
		echo should have complained
		false
	else
		echo "happy to see $err"
	fi

error: Entry 'rezrov' would be overwritten by merge. Cannot merge.
ok 11 - 12 - unmatching local changes being removed.

expecting success: rm -f .git/index &&
     read_tree_must_succeed $treeH &&
     git checkout-index -u -f -q -a &&
     echo rezrov rezrov >rezrov &&
     git update-index --add rezrov &&
     echo rezrov >rezrov &&
     if read_tree_twoway $treeH $treeM; then false; else :; fi
ok 56 - 5 - must match in !O && A && B && A==B case.

expecting success: rm -f .git/index LL &&
     cp .orig-A/LL LL &&
     git update-index --add LL &&
     echo extra >>LL &&
     read_tree_must_succeed -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226 &&
     check_result
happy to see error: Untracked working tree file 'file2' would be overwritten by merge.
ok 2 - two-way not clobbering

expecting success: 

	if err=$(read_tree_u_must_succeed -m --exclude-per-directory=.gitignore master side 2>&1)
	then
		echo should have complained
		false
	else
		echo "happy to see $err"
	fi

frotz: clean
error: Entry 'rezrov' would be overwritten by merge. Cannot merge.
ok 12 - 13 - unmatching local changes being removed.

happy to see fatal: --exclude-per-directory is meaningless unless -u
ok 3 - two-way with incorrect --exclude-per-directory (1)

expecting success: 

	if err=$(read_tree_u_must_succeed -m -u --exclude-per-directory=foo --exclude-per-directory=.gitignore master side 2>&1)
	then
		echo should have complained
		false
	else
		echo "happy to see $err"
	fi

ok 57 - 5 - must match in !O && A && B && A==B case.

expecting success: 
     rm -f .git/index LL &&
     cp .orig-A/LL LL &&
     echo extra >>LL &&
     git update-index --add LL &&
     read_tree_must_fail -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226

ok 5 - 6 - local addition already has the same.

expecting success: rm -f .git/index nitfol bozbar rezrov frotz &&
     read_tree_u_must_succeed --reset -u $treeH &&
     echo frotz >frotz &&
     git update-index --add frotz &&
     echo frotz frotz >frotz &&
     read_tree_u_must_succeed -m -u $treeH $treeM &&
     git ls-files --stage >7.out &&
     test_cmp M.out 7.out &&
     check_cache_at frotz dirty &&
     sum bozbar frotz nitfol >actual7.sum &&
     if cmp M.sum actual7.sum; then false; else :; fi &&
     : dirty index should have prevented -u from checking it out. &&
     echo frotz frotz >frotz1 &&
     diff frotz frotz1 &&
     rm -f frotz1
expecting success: rm -f .git/index &&
     read_tree_must_succeed $treeH &&
     git checkout-index -u -f -q -a &&
     echo nitfol nitfol >nitfol &&
     git update-index --add nitfol &&
     read_tree_twoway $treeH $treeM &&
     git ls-files --stage >14.out &&
     test_must_fail git diff --no-index M.out 14.out >14diff.out &&
     compare_change 14diff.out expected &&
     check_cache_at nitfol clean
happy to see fatal: more than one --exclude-per-directory given.
ok 4 - two-way with incorrect --exclude-per-directory (2)

expecting success: 

	read_tree_u_must_succeed -m -u --exclude-per-directory=.gitignore master side

error: Entry 'LL' would be overwritten by merge. Cannot merge.
error: Entry 'LL' would be overwritten by merge. Cannot merge.
ok 58 - 5 (fail) - must match A in !O && A && B && A==B case.

expecting success: 
     rm -f .git/index DD &&
     echo DD >DD &&
     git update-index --add DD &&
     read_tree_must_fail -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226

100644 346d4e61f111336a1443ef6b2e834aa5b1a7f91a 0	bozbar
100644 8e4020bb5a8d8c873b25de15933e75cc0fc275df 0	frotz
100644 7e1bf714fb103c778a21dd67411666901222425a 0	nitfol
ok 5 - two-way clobbering a ignored file

expecting success: 

	rm -f file2 subdir/file2 &&
	git checkout side &&
	echo >file3 file three &&
	echo >subdir/file3 file three &&
	git update-index --add file3 subdir/file3 &&
	git commit -a -m "side adds file3 and removes file2" &&

	git checkout master &&
	echo >file2 file two is untracked on the master side &&
	echo >subdir/file2 file two is untracked on the master side &&

	read_tree_u_must_succeed -m -u branch-point master side

error: Entry 'DD' would be overwritten by merge. Cannot merge.
Switched to branch 'side'
D	file2
D	subdir/file2
nitfol: clean
ok 13 - 14 - unchanged in two heads.

expecting success: rm -f .git/index &&
     read_tree_must_succeed $treeH &&
     git checkout-index -u -f -q -a &&
     echo nitfol nitfol >nitfol &&
     git update-index --add nitfol &&
     echo nitfol nitfol nitfol >nitfol &&
     read_tree_twoway $treeH $treeM &&
     git ls-files --stage >15.out &&
     test_must_fail git diff --no-index M.out 15.out >15diff.out &&
     compare_change 15diff.out expected &&
     check_cache_at nitfol dirty
error: Entry 'DD' would be overwritten by merge. Cannot merge.
ok 59 - 6 - must not exist in O && !A && !B case

expecting success: 
     rm -f .git/index DM &&
     cp .orig-B/DM DM &&
     git update-index --add DM &&
     read_tree_must_fail -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226

[side 9fb8560] side adds file3 and removes file2
 Author: A U Thor <author@example.com>
 4 files changed, 2 insertions(+), 2 deletions(-)
 delete mode 100644 file2
 create mode 100644 file3
 delete mode 100644 subdir/file2
 create mode 100644 subdir/file3
error: Entry 'DM' would be overwritten by merge. Cannot merge.
Switched to branch 'master'
frotz: dirty
error: Entry 'DM' would be overwritten by merge. Cannot merge.
ok 60 - 7 - must not exist in O && !A && B && O!=B case

expecting success: 
     rm -f .git/index DN &&
     cp .orig-B/DN DN &&
     git update-index --add DN &&
     read_tree_must_fail -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226

M.sum actual7.sum differ: char 20, line 2
ok 6 - 7 - local addition already has the same.

expecting success: rm -f .git/index nitfol bozbar rezrov frotz &&
     read_tree_u_must_succeed --reset -u $treeH &&
     echo frotz frotz >frotz &&
     git update-index --add frotz &&
     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi
100644 346d4e61f111336a1443ef6b2e834aa5b1a7f91a 0	bozbar
100644 8e4020bb5a8d8c873b25de15933e75cc0fc275df 0	frotz
100644 7e1bf714fb103c778a21dd67411666901222425a 0	nitfol
error: Entry 'DN' would be overwritten by merge. Cannot merge.
nitfol: dirty
ok 14 - 15 - unchanged in two heads.

expecting success: rm -f .git/index &&
     read_tree_must_succeed $treeH &&
     git checkout-index -u -f -q -a &&
     echo bozbar bozbar >bozbar &&
     git update-index --add bozbar &&
     if read_tree_twoway $treeH $treeM; then false; else :; fi
error: Entry 'DN' would be overwritten by merge. Cannot merge.
ok 61 - 8 - must not exist in O && !A && B && O==B case

expecting success: rm -f .git/index MD &&
     cp .orig-A/MD MD &&
     git update-index --add MD &&
     read_tree_must_succeed -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226 &&
     check_result
ok 6 - three-way not complaining on an untracked path in both

expecting success: 

	git reset --hard &&
	rm -f file2 subdir/file2 file3 subdir/file3 &&
	git checkout master &&
	echo >file3 file three created in master, untracked &&
	echo >subdir/file3 file three created in master, untracked &&
	if err=$(read_tree_u_must_succeed -m -u branch-point master side 2>&1)
	then
		echo should have complained
		false
	else
		echo "happy to see $err"
	fi

HEAD is now at 5d3fcf9 master removes file2 and subdir/file2
Already on 'master'
error: Entry 'frotz' would be overwritten by merge. Cannot merge.
ok 7 - 8 - conflicting addition.

expecting success: rm -f .git/index nitfol bozbar rezrov frotz &&
     read_tree_u_must_succeed --reset -u $treeH &&
     echo frotz frotz >frotz &&
     git update-index --add frotz &&
     echo frotz >frotz &&
     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi
happy to see error: Untracked working tree file 'file3' would be overwritten by merge.
ok 7 - three-way not clobbering a working tree file

expecting success: 

	git reset --hard &&
	rm -f file2 subdir/file2 file3 subdir/file3 &&
	git checkout master &&
	echo >file3 file three created in master, untracked &&
	echo >subdir/file3 file three created in master, untracked &&

	read_tree_u_must_succeed -m -u --exclude-per-directory=.gitignore branch-point master side

ok 62 - 9 - must match and be up-to-date in O && A && !B && O!=A case

expecting success: 
     rm -f .git/index MD &&
     cp .orig-A/MD MD &&
     git update-index --add MD &&
     echo extra >>MD &&
     read_tree_must_fail -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226

error: Entry 'bozbar' would be overwritten by merge. Cannot merge.
ok 15 - 16 - conflicting local change.

expecting success: rm -f .git/index &&
     read_tree_must_succeed $treeH &&
     git checkout-index -u -f -q -a &&
     echo bozbar bozbar >bozbar &&
     git update-index --add bozbar &&
     echo bozbar bozbar bozbar >bozbar &&
     if read_tree_twoway $treeH $treeM; then false; else :; fi
HEAD is now at 5d3fcf9 master removes file2 and subdir/file2
Already on 'master'
error: Entry 'MD' not uptodate. Cannot merge.
error: Entry 'MD' not uptodate. Cannot merge.
ok 63 - 9 (fail) - must match and be up-to-date in O && A && !B && O!=A case

expecting success: 
     rm -f .git/index MD &&
     cp .orig-A/MD MD &&
     echo extra >>MD &&
     git update-index --add MD &&
     read_tree_must_fail -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226

error: Entry 'bozbar' would be overwritten by merge. Cannot merge.
ok 16 - 17 - conflicting local change.

expecting success: rm -f .git/index &&
     read_tree_must_succeed $treeH &&
     git checkout-index -u -f -q -a &&
     cat bozbar-new >bozbar &&
     git update-index --add bozbar &&
     read_tree_twoway $treeH $treeM &&
     git ls-files --stage >18.out &&
     test_cmp M.out 18.out &&
     check_cache_at bozbar clean
error: Entry 'frotz' would be overwritten by merge. Cannot merge.
ok 8 - 9 - conflicting addition.

expecting success: rm -f .git/index nitfol bozbar rezrov frotz &&
     read_tree_u_must_succeed --reset -u $treeH &&
     echo rezrov >rezrov &&
     git update-index --add rezrov &&
     read_tree_u_must_succeed -m -u $treeH $treeM &&
     git ls-files --stage >10.out &&
     cmp M.out 10.out &&
     sum bozbar frotz nitfol >actual10.sum &&
     cmp M.sum actual10.sum
ok 8 - three-way not complaining on an untracked file

expecting success: 

	git reset --hard &&
	git checkout -b side-a branch-point &&
	echo >>file1 "new line to be kept in the merge result" &&
	git commit -a -m "side-a changes file1" &&
	git checkout -b side-b branch-point &&
	echo >>file2 "new line to be kept in the merge result" &&
	git commit -a -m "side-b changes file2" &&
	git checkout side-a


error: Entry 'MD' would be overwritten by merge. Cannot merge.
HEAD is now at 5d3fcf9 master removes file2 and subdir/file2
error: Entry 'MD' would be overwritten by merge. Cannot merge.
ok 64 - 9 (fail) - must match and be up-to-date in O && A && !B && O!=A case

expecting success: rm -f .git/index ND &&
     cp .orig-A/ND ND &&
     git update-index --add ND &&
     read_tree_must_succeed -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226 &&
     check_result
Switched to a new branch 'side-a'
[side-a 8ee6c3a] side-a changes file1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Switched to a new branch 'side-b'
ok 65 - 10 - must match and be up-to-date in O && A && !B && O==A case

expecting success: 
     rm -f .git/index ND &&
     cp .orig-A/ND ND &&
     git update-index --add ND &&
     echo extra >>ND &&
     read_tree_must_fail -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226

[side-b 989255e] side-b changes file2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
100644 346d4e61f111336a1443ef6b2e834aa5b1a7f91a 0	bozbar
100644 8e4020bb5a8d8c873b25de15933e75cc0fc275df 0	frotz
100644 dca6b92303befc93086aa025d90a5facd7eb2812 0	nitfol
Switched to branch 'side-a'
ok 9 - 3-way not overwriting local changes (setup)

expecting success: 

	# At this point, file1 from side-a should be kept as side-b
	# did not touch it.

	git reset --hard &&

	echo >>file1 "local changes" &&
	read_tree_u_must_succeed -m -u branch-point side-a side-b &&
	grep "new line to be kept" file1 &&
	grep "local changes" file1


HEAD is now at 8ee6c3a side-a changes file1
error: Entry 'ND' not uptodate. Cannot merge.
bozbar: clean
ok 17 - 18 - local change already having a good result.

expecting success: rm -f .git/index &&
     read_tree_must_succeed $treeH &&
     git checkout-index -u -f -q -a &&
     cat bozbar-new >bozbar &&
     git update-index --add bozbar &&
     echo gnusto gnusto >bozbar &&
     read_tree_twoway $treeH $treeM &&
     git ls-files --stage >19.out &&
     test_cmp M.out 19.out &&
     check_cache_at bozbar dirty
ok 9 - 10 - path removed.

expecting success: rm -f .git/index nitfol bozbar rezrov frotz &&
     read_tree_u_must_succeed --reset -u $treeH &&
     echo rezrov >rezrov &&
     git update-index --add rezrov &&
     echo rezrov rezrov >rezrov &&
     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi
error: Entry 'ND' not uptodate. Cannot merge.
ok 66 - 10 (fail) - must match and be up-to-date in O && A && !B && O==A case

expecting success: 
     rm -f .git/index ND &&
     cp .orig-A/ND ND &&
     echo extra >>ND &&
     git update-index --add ND &&
     read_tree_must_fail -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226

error: Entry 'ND' would be overwritten by merge. Cannot merge.
new line to be kept in the merge result
local changes
ok 10 - 3-way not overwriting local changes (our side)

expecting success: 

	# At this point, file2 from side-b should be taken as side-a
	# did not touch it.

	git reset --hard &&

	echo >>file2 "local changes" &&
	read_tree_u_must_fail -m -u branch-point side-a side-b &&
	! grep "new line to be kept" file2 &&
	grep "local changes" file2


error: Entry 'ND' would be overwritten by merge. Cannot merge.
ok 67 - 10 (fail) - must match and be up-to-date in O && A && !B && O==A case

expecting success: rm -f .git/index MM &&
     cp .orig-A/MM MM &&
     git update-index --add MM &&
     read_tree_must_succeed -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226 &&
     check_result
100644 346d4e61f111336a1443ef6b2e834aa5b1a7f91a 0	bozbar
100644 8e4020bb5a8d8c873b25de15933e75cc0fc275df 0	frotz
100644 dca6b92303befc93086aa025d90a5facd7eb2812 0	nitfol
HEAD is now at 8ee6c3a side-a changes file1
bozbar: dirty
ok 18 - 19 - local change already having a good result, further modified.

expecting success: rm -f .git/index &&
     read_tree_must_succeed $treeH &&
     git checkout-index -u -f -q -a &&
     cat bozbar-old >bozbar &&
     git update-index --add bozbar &&
     read_tree_twoway $treeH $treeM &&
     git ls-files --stage >20.out &&
     test_cmp M.out 20.out &&
     check_cache_at bozbar dirty
error: Entry 'rezrov' not uptodate. Cannot merge.
ok 10 - 11 - dirty path removed.

expecting success: rm -f .git/index nitfol bozbar rezrov frotz &&
     read_tree_u_must_succeed --reset -u $treeH &&
     echo rezrov rezrov >rezrov &&
     git update-index --add rezrov &&
     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi
error: Entry 'file2' not uptodate. Cannot merge.
ok 68 - 11 - must match and be up-to-date in O && A && B && O!=A && O!=B && A!=B case

expecting success: 
     rm -f .git/index MM &&
     cp .orig-A/MM MM &&
     git update-index --add MM &&
     echo extra >>MM &&
     read_tree_must_fail -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226

error: Entry 'file2' not uptodate. Cannot merge.
local changes
ok 11 - 3-way not overwriting local changes (their side)

expecting success: 

	git reset --hard &&
	git checkout -b sym-b side-b &&
	mkdir -p a &&
	>a/b &&
	git add a/b &&
	git commit -m "side adds a/b" &&

	rm -fr a &&
	git checkout -b sym-a side-a &&
	mkdir -p a &&
	test_ln_s_add ../b a/b &&
	git commit -m "we add a/b" &&

	read_tree_u_must_succeed -m -u sym-a sym-a sym-b


HEAD is now at 8ee6c3a side-a changes file1
100644 346d4e61f111336a1443ef6b2e834aa5b1a7f91a 0	bozbar
100644 8e4020bb5a8d8c873b25de15933e75cc0fc275df 0	frotz
100644 dca6b92303befc93086aa025d90a5facd7eb2812 0	nitfol
error: Entry 'MM' not uptodate. Cannot merge.
Switched to a new branch 'sym-b'
error: Entry 'MM' not uptodate. Cannot merge.
bozbar: dirty
ok 19 - 20 - no local change, use new tree.

expecting success: rm -f .git/index &&
     read_tree_must_succeed $treeH &&
     git checkout-index -u -f -q -a &&
     cat bozbar-old >bozbar &&
     git update-index --add bozbar &&
     echo gnusto gnusto >bozbar &&
     if read_tree_twoway $treeH $treeM; then false; else :; fi
ok 69 - 11 (fail) - must match and be up-to-date in O && A && B && O!=A && O!=B && A!=B case

expecting success: 
     rm -f .git/index MM &&
     cp .orig-A/MM MM &&
     echo extra >>MM &&
     git update-index --add MM &&
     read_tree_must_fail -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226

error: Entry 'rezrov' would be overwritten by merge. Cannot merge.
ok 11 - 12 - unmatching local changes being removed.

expecting success: rm -f .git/index nitfol bozbar rezrov frotz &&
     read_tree_u_must_succeed --reset -u $treeH &&
     echo rezrov rezrov >rezrov &&
     git update-index --add rezrov &&
     echo rezrov >rezrov &&
     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi
[sym-b 7fe74bb] side adds a/b
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 a/b
Switched to a new branch 'sym-a'
error: Entry 'MM' would be overwritten by merge. Cannot merge.
checking prerequisite: SYMLINKS

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	# test whether the filesystem supports symbolic links
	ln -s x y && test -h y

)
prerequisite SYMLINKS ok
error: Entry 'MM' would be overwritten by merge. Cannot merge.
ok 70 - 11 (fail) - must match and be up-to-date in O && A && B && O!=A && O!=B && A!=B case

expecting success: rm -f .git/index SS &&
     cp .orig-A/SS SS &&
     git update-index --add SS &&
     read_tree_must_succeed -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226 &&
     check_result
error: Entry 'bozbar' not uptodate. Cannot merge.
ok 20 - 21 - no local change, dirty cache.

expecting success: rm -f .git/index &&
     read_tree_must_succeed $treeH &&
     git checkout-index -u -f -q -a &&
     sed -e "s/such as/SUCH AS/" bozbar-old >bozbar &&
     git update-index --add bozbar &&
     if read_tree_twoway $treeH $treeM; then false; else :; fi
[sym-a 749c233] we add a/b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 120000 a/b
error: Entry 'rezrov' would be overwritten by merge. Cannot merge.
ok 12 - 13 - unmatching local changes being removed.

expecting success: rm -f .git/index nitfol bozbar rezrov frotz &&
     read_tree_u_must_succeed --reset -u $treeH &&
     echo nitfol nitfol >nitfol &&
     git update-index --add nitfol &&
     read_tree_u_must_succeed -m -u $treeH $treeM &&
     git ls-files --stage >14.out &&
     test_must_fail git diff -U0 --no-index M.out 14.out >14diff.out &&
     compare_change 14diff.out expected &&
     sum bozbar frotz >actual14.sum &&
     grep -v nitfol M.sum > expected14.sum &&
     cmp expected14.sum actual14.sum &&
     sum bozbar frotz nitfol >actual14a.sum &&
     if cmp M.sum actual14a.sum; then false; else :; fi &&
     check_cache_at nitfol clean &&
     echo nitfol nitfol >nitfol1 &&
     diff nitfol nitfol1 &&
     rm -f nitfol1
ok 71 - 12 - must match A in O && A && B && O!=A && A==B case

expecting success: rm -f .git/index SS &&
     cp .orig-A/SS SS &&
     git update-index --add SS &&
     echo extra >>SS &&
     read_tree_must_succeed -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226 &&
     check_result
error: Entry 'bozbar' would be overwritten by merge. Cannot merge.
ok 21 - 22 - local change cache updated.

expecting success: rm -f .git/index &&
     echo DF >DF &&
     git update-index --add DF &&
     treeDF=$(git write-tree) &&
     echo treeDF $treeDF &&
     git ls-tree $treeDF &&

     rm -f DF &&
     mkdir DF &&
     echo DF/DF >DF/DF &&
     git update-index --add --remove DF DF/DF &&
     treeDFDF=$(git write-tree) &&
     echo treeDFDF $treeDFDF &&
     git ls-tree $treeDFDF &&
     git ls-files --stage >DFDF.out
ok 12 - funny symlink in work tree

checking prerequisite: SANITY

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	mkdir SANETESTD.1 SANETESTD.2 &&

	chmod +w SANETESTD.1 SANETESTD.2 &&
	>SANETESTD.1/x 2>SANETESTD.2/x &&
	chmod -w SANETESTD.1 &&
	chmod -rx SANETESTD.2 ||
	error "bug in test sript: cannot prepare SANETESTD"

	! rm SANETESTD.1/x && ! test -f SANETESTD.2/x
	status=$?

	chmod +rwx SANETESTD.1 SANETESTD.2 &&
	rm -rf SANETESTD.1 SANETESTD.2 ||
	error "bug in test sript: cannot clean SANETESTD"
	return $status

)
treeDF 6bf22db9043f2b5821c019d0ce0f2605421affcb
100644 blob 052efc3abbc31348f7abd34535b1953d38273257	DF
rm: cannot remove 'SANETESTD.1/x': Permission denied
prerequisite SANITY ok
expecting success: 

	rm -fr a b &&
	git reset --hard &&

	git checkout sym-a &&
	chmod a-w a &&
	test_must_fail git read-tree -m -u sym-a sym-a sym-b


ok 72 - 12 - must match A in O && A && B && O!=A && A==B case

expecting success: 
     rm -f .git/index SS &&
     cp .orig-A/SS SS &&
     echo extra >>SS &&
     git update-index --add SS &&
     read_tree_must_fail -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226

HEAD is now at 749c233 we add a/b
treeDFDF c38e296263d024b0f48c4a728d293232ac6c5443
040000 tree 90bbead36f4d6a7c325fd450e6cfbcc7479d421a	DF
Already on 'sym-a'
ok 22 - DF vs DF/DF case setup.

expecting success: rm -f .git/index &&
     rm -fr DF &&
     echo DF >DF &&
     git update-index --add DF &&
     read_tree_twoway $treeDF $treeDFDF &&
     git ls-files --stage >DFDFcheck.out &&
     test_cmp DFDF.out DFDFcheck.out &&
     check_cache_at DF/DF dirty &&
     :
error: Entry 'SS' would be overwritten by merge. Cannot merge.
error: unable to unlink old 'a/b' (Permission denied)
ok 13 - funny symlink in work tree, un-unlink-able

expecting success: 

	git reset --hard &&

	git checkout side-a &&
	rm -f subdir/file2 &&
	mkdir subdir/file2 &&
	echo qfwfq >subdir/file2/another &&
	git add subdir/file2/another &&
	test_tick &&
	git commit -m "side-a changes file2 to directory"


error: Entry 'SS' would be overwritten by merge. Cannot merge.
ok 73 - 12 (fail) - must match A in O && A && B && O!=A && A==B case

expecting success: rm -f .git/index MN &&
     cp .orig-A/MN MN &&
     git update-index --add MN &&
     read_tree_must_succeed -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226 &&
     check_result
100644 b90ea14b2dd74b6f377c10870b3757344bbe077c 0	DF/DF
HEAD is now at 749c233 we add a/b
Switched to branch 'side-a'
M.sum actual14a.sum differ: char 38, line 3
DF/DF: dirty
ok 23 - DF vs DF/DF case test.

expecting success: rm -f .git/index &&
     : >a &&
     git update-index --add a &&
     treeM=$(git write-tree) &&
     echo treeM $treeM &&
     git ls-tree $treeM &&
     git ls-files --stage >treeM.out &&

     rm -f a &&
     git update-index --remove a &&
     mkdir a &&
     : >a/b &&
     treeH=$(git write-tree) &&
     echo treeH $treeH &&
     git ls-tree $treeH
nitfol: clean
ok 13 - 14 - unchanged in two heads.

expecting success: rm -f .git/index nitfol bozbar rezrov frotz &&
     read_tree_u_must_succeed --reset -u $treeH &&
     echo nitfol nitfol >nitfol &&
     git update-index --add nitfol &&
     echo nitfol nitfol nitfol >nitfol &&
     read_tree_u_must_succeed -m -u $treeH $treeM &&
     git ls-files --stage >15.out &&
     test_must_fail git diff -U0 --no-index M.out 15.out >15diff.out &&
     compare_change 15diff.out expected &&
     check_cache_at nitfol dirty &&
     sum bozbar frotz >actual15.sum &&
     grep -v nitfol M.sum > expected15.sum &&
     cmp expected15.sum actual15.sum &&
     sum bozbar frotz nitfol >actual15a.sum &&
     if cmp M.sum actual15a.sum; then false; else :; fi &&
     echo nitfol nitfol nitfol >nitfol1 &&
     diff nitfol nitfol1 &&
     rm -f nitfol1
treeM 496d6428b9cf92981dc9495211e6e1120fb6f2ba
[side-a 9bac660] side-a changes file2 to directory
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 1 deletion(-)
 delete mode 100644 subdir/file2
 create mode 100644 subdir/file2/another
ok 14 - D/F setup

expecting success: 

	git checkout side-b &&
	read_tree_u_must_succeed -m -u branch-point side-b side-a &&
	git ls-files -u >actual &&
	(
		a=$(git rev-parse branch-point:subdir/file2)
		b=$(git rev-parse side-a:subdir/file2/another)
		echo "100644 $a 1	subdir/file2"
		echo "100644 $a 2	subdir/file2"
		echo "100644 $b 3	subdir/file2/another"
	) >expect &&
	test_cmp actual expect


ok 74 - 13 - must match A in O && A && B && O!=A && O==B case

expecting success: rm -f .git/index MN &&
     cp .orig-A/MN MN &&
     git update-index --add MN &&
     echo extra >>MN &&
     read_tree_must_succeed -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226 &&
     check_result
100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391	a
Switched to branch 'side-b'
treeH 4b825dc642cb6eb9a060e54bf8d69288fbee4904
ok 24 - a/b (untracked) vs a case setup.

expecting success: read_tree_u_must_fail -u -m "$treeH" "$treeM" &&
     git ls-files --stage &&
     test -f a/b
ok 75 - 13 - must match A in O && A && B && O!=A && O==B case

expecting success: rm -f .git/index NM &&
     cp .orig-A/NM NM &&
     git update-index --add NM &&
     read_tree_must_succeed -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226 &&
     check_result
error: Updating 'a' would lose untracked files in it
error: Updating 'a' would lose untracked files in it
ok 25 - a/b (untracked) vs a, plus c/d case test.

expecting success: rm -f .git/index &&
     rm -fr a &&
     : >a &&
     mkdir c &&
     : >c/d &&
     git update-index --add a c/d &&
     treeM=$(git write-tree) &&
     echo treeM $treeM &&
     git ls-tree $treeM &&
     git ls-files --stage >treeM.out &&

     rm -f a &&
     mkdir a &&
     : >a/b &&
     git update-index --add --remove a a/b &&
     treeH=$(git write-tree) &&
     echo treeH $treeH &&
     git ls-tree $treeH
ok 15 - D/F

expecting success: 

	git reset --hard &&
	git checkout side-b &&
	git merge-resolve branch-point -- side-b side-a


error: 'subdir/file2/another' appears as both a file and as a directory
error: subdir/file2/another: cannot drop to stage #0
nitfol: dirty
HEAD is now at 989255e side-b changes file2
ok 76 - 14 - must match and be up-to-date in O && A && B && O==A && O!=B case

expecting success: rm -f .git/index NM &&
     cp .orig-B/NM NM &&
     git update-index --add NM &&
     echo extra >>NM &&
     read_tree_must_succeed -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226 &&
     check_result
treeM 3e82e8b9894d6c7982dcd25a6dad66400d52735f
Already on 'side-b'
M.sum actual15a.sum differ: char 38, line 3
100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391	a
040000 tree 2a26db49a6962700da5bd4084ae0e5a22d6583ee	c
ok 14 - 15 - unchanged in two heads.

expecting success: rm -f .git/index nitfol bozbar rezrov frotz &&
     read_tree_u_must_succeed --reset -u $treeH &&
     echo bozbar bozbar >bozbar &&
     git update-index --add bozbar &&
     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi
Trying simple merge.
Simple merge failed, trying Automatic merge.
treeH 02c6f058fb950781e5b773c21e4c237db1ff4d5a
040000 tree 4277b6e69d25e5efa77c455340557b384a4c018a	a
040000 tree 2a26db49a6962700da5bd4084ae0e5a22d6583ee	c
ok 26 - a/b vs a, plus c/d case setup.

expecting success: read_tree_u_must_succeed -u -m "$treeH" "$treeM" &&
     git ls-files --stage | tee >treeMcheck.out &&
     test_cmp treeM.out treeMcheck.out
Adding subdir/file2/another
ok 77 - 14 - may match B in O && A && B && O==A && O!=B case

expecting success: 
     rm -f .git/index NM &&
     cp .orig-A/NM NM &&
     git update-index --add NM &&
     echo extra >>NM &&
     read_tree_must_fail -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226

ok 16 - D/F resolve

expecting success: 

	git reset --hard &&
	git checkout side-b &&
	git merge-recursive branch-point -- side-b side-a


HEAD is now at 989255e side-b changes file2
error: Entry 'bozbar' would be overwritten by merge. Cannot merge.
ok 15 - 16 - conflicting local change.

expecting success: rm -f .git/index nitfol bozbar rezrov frotz &&
error: Entry 'NM' not uptodate. Cannot merge.
     read_tree_u_must_succeed --reset -u $treeH &&
     echo bozbar bozbar >bozbar &&
     git update-index --add bozbar &&
     echo bozbar bozbar bozbar >bozbar &&
     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi
Already on 'side-b'
Merging side-b with side-a
Merging:
989255e side-b changes file2
9bac660 side-a changes file2 to directory
found 1 common ancestor:
8335eaf initial
Adding subdir/file2/another
Removing subdir/file2 to make room for subdirectory

Removing subdir/file2
ok 17 - D/F recursive

error: Entry 'NM' not uptodate. Cannot merge.
# passed all 17 test(s)
1..17
ok 27 - a/b vs a, plus c/d case test.

expecting success: 
	echo >file-a &&
	echo >file-b &&
	git add file-a file-b &&
	git commit -a -m "test for correct modified tree" &&
	git branch initial-mod &&
	echo b >file-b &&
	git commit -a -m "B" &&
	echo a >file-a &&
	git add file-a &&
	git ls-tree $(git write-tree) file-a >expect &&
	read_tree_must_succeed -m HEAD initial-mod &&
	git ls-tree $(git write-tree) file-a >actual &&
	test_cmp expect actual

ok 78 - 14 (fail) - must match and be up-to-date in O && A && B && O==A && O!=B case

expecting success: 
     rm -f .git/index NM &&
     cp .orig-A/NM NM &&
     echo extra >>NM &&
     git update-index --add NM &&
     read_tree_must_fail -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226

[master (root-commit) 64c6f4a] test for correct modified tree
 Author: A U Thor <author@example.com>
 4 files changed, 2 insertions(+)
 create mode 100644 a
 create mode 100644 c/d
 create mode 100644 file-a
 create mode 100644 file-b
*** t1005-read-tree-reset.sh ***
error: Entry 'NM' would be overwritten by merge. Cannot merge.
error: Entry 'bozbar' would be overwritten by merge. Cannot merge.
ok 16 - 17 - conflicting local change.

expecting success: rm -f .git/index nitfol bozbar rezrov frotz &&
     read_tree_u_must_succeed --reset -u $treeH &&
     echo gnusto >bozbar &&
     git update-index --add bozbar &&
     read_tree_u_must_succeed -m -u $treeH $treeM &&
     git ls-files --stage >18.out &&
     test_cmp M.out 18.out &&
     check_cache_at bozbar clean &&
     sum bozbar frotz nitfol >actual18.sum &&
     cmp M.sum actual18.sum
[master 81d78ba] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
error: Entry 'NM' would be overwritten by merge. Cannot merge.
ok 79 - 14 (fail) - must match and be up-to-date in O && A && B && O==A && O!=B case

expecting success: rm -f .git/index NN &&
     cp .orig-A/NN NN &&
     git update-index --add NN &&
     read_tree_must_succeed -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226 &&
     check_result
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1005-read-tree-reset/.git/
expecting success: 
	git init &&
	mkdir df &&
	echo content >df/file &&
	git add df/file &&
	git commit -m one &&
	git ls-files >expect &&
	rm -rf df &&
	echo content >df &&
	git add df &&
	echo content >new &&
	git add new &&
	git commit -m two

Reinitialized existing Git repository in /«PKGBUILDDIR»/t/trash directory.t1005-read-tree-reset/.git/
ok 80 - 15 - must match A in O && A && B && O==A && O==B case

expecting success: rm -f .git/index NN &&
     cp .orig-A/NN NN &&
     git update-index --add NN &&
     echo extra >>NN &&
     read_tree_must_succeed -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226 &&
     check_result
ok 28 - -m references the correct modified tree

# passed all 28 test(s)
1..28
[master (root-commit) 7737e2a] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 df/file
*** t1006-cat-file.sh ***
bozbar: clean
[master b9f9383] two
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
 rename df/file => df (100%)
 create mode 100644 new
ok 1 - setup

expecting success: 
	read_tree_u_must_succeed -u --reset HEAD^ &&
	git ls-files >actual &&
	test_cmp expect actual

ok 17 - 18 - local change already having a good result.

expecting success: rm -f .git/index nitfol bozbar rezrov frotz &&
     read_tree_u_must_succeed --reset -u $treeH &&
     echo gnusto >bozbar &&
     git update-index --add bozbar &&
     echo gnusto gnusto >bozbar &&
     read_tree_u_must_succeed -m -u $treeH $treeM &&
     git ls-files --stage >19.out &&
     test_cmp M.out 19.out &&
     check_cache_at bozbar dirty &&
     sum frotz nitfol >actual19.sum &&
     grep -v bozbar  M.sum > expected19.sum &&
     cmp expected19.sum actual19.sum &&
     sum bozbar frotz nitfol >actual19a.sum &&
     if cmp M.sum actual19a.sum; then false; else :; fi &&
     echo gnusto gnusto >bozbar1 &&
     diff bozbar bozbar1 &&
     rm -f bozbar1
ok 81 - 15 - must match A in O && A && B && O==A && O==B case

expecting success: 
     rm -f .git/index NN &&
     cp .orig-A/NN NN &&
     echo extra >>NN &&
     git update-index --add NN &&
     read_tree_must_fail -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226

error: Entry 'NN' would be overwritten by merge. Cannot merge.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1006-cat-file/.git/
error: Entry 'NN' would be overwritten by merge. Cannot merge.
ok 82 - 15 (fail) - must match A in O && A && B && O==A && O==B case

expecting success: rm -f .git/index F16 &&
    echo F16 >F16 &&
    git update-index --add F16 &&
    tree0=$(git write-tree) &&
    echo E16 >F16 &&
    git update-index F16 &&
    tree1=$(git write-tree) &&
    read_tree_must_succeed -m $tree0 $tree1 $tree1 $tree0 &&
    git ls-files --stage
ok 2 - reset should work

expecting success: 
	read_tree_u_must_succeed --reset -u HEAD &&
	git ls-files -s >expect &&
	sha1=$(git rev-parse :new) &&
	(
		echo "100644 $sha1 1	old"
		echo "100644 $sha1 3	old"
	) | git update-index --index-info &&
	>old &&
	git ls-files -s &&
	read_tree_u_must_succeed --reset -u HEAD &&
	git ls-files -s >actual &&
	! test -f old

expecting success: 
	echo_without_newline "$hello_content" > hello &&
	git update-index --add hello

ok 1 - setup

expecting success: 
	git cat-file -e $sha1
    
ok 2 - blob exists

expecting success: 
	echo $type >expect &&
	git cat-file -t $sha1 >actual &&
	test_cmp expect actual
    
ok 3 - Type of blob is correct

expecting success: 
	echo $size >expect &&
	git cat-file -s $sha1 >actual &&
	test_cmp expect actual
    
ok 4 - Size of blob is correct

expecting success: 
	echo $type >expect &&
	git cat-file -t --allow-unknown-type $sha1 >actual &&
	test_cmp expect actual
    
ok 5 - Type of blob is correct using --allow-unknown-type

expecting success: 
	echo $size >expect &&
	git cat-file -s --allow-unknown-type $sha1 >actual &&
	test_cmp expect actual
    
100644 ecbec6db011caa3ae26739812f092f76875fe6b6 2	F16
100644 bcf4afda2c30299bf6538240d40bcb8fb3857691 3	F16
ok 83 - 16 - A matches in one and B matches in another.

ok 6 - Size of blob is correct using --allow-unknown-type

expecting success: 
	maybe_remove_timestamp "$content" $no_ts >expect &&
	maybe_remove_timestamp "$(git cat-file $type $sha1)" $no_ts >actual &&
	test_cmp expect actual
    
# passed all 83 test(s)
1..83
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 0	df
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 0	new
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 1	old
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 3	old
bozbar: dirty
ok 7 - Content of blob is correct

expecting success: 
	maybe_remove_timestamp "$pretty_content" $no_ts >expect &&
	maybe_remove_timestamp "$(git cat-file -p $sha1)" $no_ts >actual &&
	test_cmp expect actual
    
M.sum actual19a.sum differ: char 1, line 1
ok 18 - 19 - local change already having a good result, further modified.

expecting success: rm -f .git/index nitfol bozbar rezrov frotz &&
     read_tree_u_must_succeed --reset -u $treeH &&
     echo bozbar >bozbar &&
     git update-index --add bozbar &&
     read_tree_u_must_succeed -m -u $treeH $treeM &&
     git ls-files --stage >20.out &&
     test_cmp M.out 20.out &&
     check_cache_at bozbar clean &&
     sum bozbar frotz nitfol >actual20.sum &&
     cmp M.sum actual20.sum
ok 8 - Pretty content of blob is correct

expecting success: 
	maybe_remove_timestamp "$batch_output" $no_ts >expect &&
	maybe_remove_timestamp "$(echo $sha1 | git cat-file --batch)" $no_ts >actual &&
	test_cmp expect actual
    
ok 9 - --batch output of blob is correct

expecting success: 
	echo "$sha1 $type $size" >expect &&
	echo_without_newline $sha1 | git cat-file --batch-check >actual &&
	test_cmp expect actual
    
*** t1007-hash-object.sh ***
ok 3 - reset should remove remnants from a failed merge

ok 10 - --batch-check output of blob is correct

expecting success: 
	read_tree_u_must_succeed --reset -u HEAD &&
	git ls-files -s >expect &&
	sha1=$(git rev-parse :new) &&
	(
		echo "100644 $sha1 1	old"
		echo "100644 $sha1 3	old"
	) | git update-index --index-info &&
	>old &&
	git ls-files -s &&
	read_tree_u_must_succeed --reset -u HEAD HEAD &&
	git ls-files -s >actual &&
	! test -f old

expecting success: 
	echo "$type $sha1" >expect &&
	echo $sha1 | git cat-file --batch-check="%(objecttype) %(objectname)" >actual &&
	test_cmp expect actual
    
ok 11 - custom --batch-check format

expecting success: 
	echo "$type this is some extra content" >expect &&
	echo "$sha1    this is some extra content" |
		git cat-file --batch-check="%(objecttype) %(rest)" >actual &&
	test_cmp expect actual
    
ok 12 - --batch-check with %(rest)

expecting success: 
	{
		echo "$size" &&
		maybe_remove_timestamp "$content" $no_ts
	} >expect &&
	echo $sha1 | git cat-file --batch="%(objectsize)" >actual.full &&
	maybe_remove_timestamp "$(cat actual.full)" $no_ts >actual &&
	test_cmp expect actual
    
ok 13 - --batch without type (blob)

expecting success: 
	{
		echo "$type" &&
		maybe_remove_timestamp "$content" $no_ts
	} >expect &&
	echo $sha1 | git cat-file --batch="%(objecttype)" >actual.full &&
	maybe_remove_timestamp "$(cat actual.full)" $no_ts >actual &&
	test_cmp expect actual
    
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1007-hash-object/.git/
ok 14 - --batch without size (blob)

expecting success: 
	echo example | test_must_fail git hash-object --stdin --stdin

expecting success: 
	echo "$hello_sha1 blob $hello_size" >expect &&
	git update-index --add --cacheinfo 100644 $hello_sha1 "white space" &&
	test_when_finished "git update-index --remove \"white space\"" &&
	echo ":white space" | git cat-file --batch-check >actual &&
	test_cmp expect actual

error: Multiple --stdin arguments are not supported
usage: git hash-object [-t <type>] [-w] [--path=<file> | --no-filters] [--stdin] [--] <file>...
   or: git hash-object  --stdin-paths < <list-of-paths>

    -t <type>             object type
    -w                    write the object into the object database
    --stdin               read the object from stdin
    --stdin-paths         read file names from stdin
    --no-filters          store file as is without filters
    --literally           just hash any random garbage to create corrupt objects for debugging Git
    --path <file>         process file as it were from this path

ok 1 - multiple '--stdin's are rejected

expecting success: 
	echo example | test_must_fail git hash-object --stdin --stdin-paths &&
	echo example | test_must_fail git hash-object --stdin-paths --stdin

error: Can't use --stdin-paths with --stdin
usage: git hash-object [-t <type>] [-w] [--path=<file> | --no-filters] [--stdin] [--] <file>...
   or: git hash-object  --stdin-paths < <list-of-paths>

    -t <type>             object type
    -w                    write the object into the object database
    --stdin               read the object from stdin
    --stdin-paths         read file names from stdin
    --no-filters          store file as is without filters
    --literally           just hash any random garbage to create corrupt objects for debugging Git
    --path <file>         process file as it were from this path

100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 0	df
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 0	new
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 1	old
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 3	old
bozbar: clean
ok 15 - --batch-check without %(rest) considers whole line

error: Can't use --stdin-paths with --stdin
usage: git hash-object [-t <type>] [-w] [--path=<file> | --no-filters] [--stdin] [--] <file>...
   or: git hash-object  --stdin-paths < <list-of-paths>

    -t <type>             object type
    -w                    write the object into the object database
    --stdin               read the object from stdin
    --stdin-paths         read file names from stdin
    --no-filters          store file as is without filters
    --literally           just hash any random garbage to create corrupt objects for debugging Git
    --path <file>         process file as it were from this path

ok 2 - Can't use --stdin and --stdin-paths together

expecting success: 
	echo example | test_must_fail git hash-object --stdin-paths hello

ok 19 - 20 - no local change, use new tree.

expecting success: rm -f .git/index nitfol bozbar rezrov frotz &&
     read_tree_u_must_succeed --reset -u $treeH &&
     echo bozbar >bozbar &&
     git update-index --add bozbar &&
     echo gnusto gnusto >bozbar &&
     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi
expecting success: 
	git cat-file -e $sha1
    
error: Can't specify files with --stdin-paths
usage: git hash-object [-t <type>] [-w] [--path=<file> | --no-filters] [--stdin] [--] <file>...
   or: git hash-object  --stdin-paths < <list-of-paths>

    -t <type>             object type
    -w                    write the object into the object database
    --stdin               read the object from stdin
    --stdin-paths         read file names from stdin
    --no-filters          store file as is without filters
    --literally           just hash any random garbage to create corrupt objects for debugging Git
    --path <file>         process file as it were from this path

ok 3 - Can't pass filenames as arguments with --stdin-paths

expecting success: 
	echo example | test_must_fail git hash-object --stdin-paths --path=foo

ok 16 - tree exists

expecting success: 
	echo $type >expect &&
	git cat-file -t $sha1 >actual &&
	test_cmp expect actual
    
error: Can't use --stdin-paths with --path
usage: git hash-object [-t <type>] [-w] [--path=<file> | --no-filters] [--stdin] [--] <file>...
   or: git hash-object  --stdin-paths < <list-of-paths>

    -t <type>             object type
    -w                    write the object into the object database
    --stdin               read the object from stdin
    --stdin-paths         read file names from stdin
    --no-filters          store file as is without filters
    --literally           just hash any random garbage to create corrupt objects for debugging Git
    --path <file>         process file as it were from this path

ok 4 - Can't use --path with --stdin-paths

expecting success: 
	test_must_fail git hash-object --no-filters --path=foo

ok 17 - Type of tree is correct

expecting success: 
	echo $size >expect &&
	git cat-file -s $sha1 >actual &&
	test_cmp expect actual
    
error: Can't use --path with --no-filters
usage: git hash-object [-t <type>] [-w] [--path=<file> | --no-filters] [--stdin] [--] <file>...
   or: git hash-object  --stdin-paths < <list-of-paths>

    -t <type>             object type
    -w                    write the object into the object database
    --stdin               read the object from stdin
    --stdin-paths         read file names from stdin
    --no-filters          store file as is without filters
    --literally           just hash any random garbage to create corrupt objects for debugging Git
    --path <file>         process file as it were from this path

ok 5 - Can't use --path with --no-filters

ok 18 - Size of tree is correct

expecting success: 
	echo $type >expect &&
	git cat-file -t --allow-unknown-type $sha1 >actual &&
	test_cmp expect actual
    
ok 4 - two-way reset should remove remnants too

expecting success: 
	read_tree_u_must_succeed --reset -u HEAD &&
	git ls-files -s >expect &&
	sha1=$(git rev-parse :new) &&
	(
		echo "100644 $sha1 1	old"
		echo "100644 $sha1 3	old"
	) | git update-index --index-info &&
	>old &&
	git ls-files -s &&
	git reset --hard &&
	git ls-files -s >actual &&
	! test -f old

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1007-hash-object/test/.git/
expecting success: 
	test $hello_sha1 = $(git hash-object hello)

ok 19 - Type of tree is correct using --allow-unknown-type

expecting success: 
	echo $size >expect &&
	git cat-file -s --allow-unknown-type $sha1 >actual &&
	test_cmp expect actual
    
ok 6 - hash a file

expecting success: 
		test_must_fail git cat-file blob 5e1c309dae7f45e0f39b1bf3ac3cd9db12e7d689
	
ok 20 - Size of tree is correct using --allow-unknown-type

expecting success: 
	maybe_remove_timestamp "$pretty_content" $no_ts >expect &&
	maybe_remove_timestamp "$(git cat-file -p $sha1)" $no_ts >actual &&
	test_cmp expect actual
    
fatal: git cat-file 5e1c309dae7f45e0f39b1bf3ac3cd9db12e7d689: bad file
ok 7 - blob does not exist in database

expecting success: 
	test $example_sha1 = $(git hash-object --stdin < example)

ok 8 - hash from stdin

expecting success: 
		test_must_fail git cat-file blob ddd3f836d3e3fbb7ae289aa9ae83536f76956399
	
error: Entry 'bozbar' not uptodate. Cannot merge.
ok 20 - 21 - no local change, dirty cache.

expecting success: rm -f .git/index &&
     echo DF >DF &&
     git update-index --add DF &&
     treeDF=$(git write-tree) &&
     echo treeDF $treeDF &&
     git ls-tree $treeDF &&

     rm -f DF &&
     mkdir DF &&
     echo DF/DF >DF/DF &&
     git update-index --add --remove DF DF/DF &&
     treeDFDF=$(git write-tree) &&
     echo treeDFDF $treeDFDF &&
     git ls-tree $treeDFDF &&
     git ls-files --stage >DFDF.out
ok 21 - Pretty content of tree is correct

expecting success: 
	echo "$sha1 $type $size" >expect &&
	echo_without_newline $sha1 | git cat-file --batch-check >actual &&
	test_cmp expect actual
    
fatal: git cat-file ddd3f836d3e3fbb7ae289aa9ae83536f76956399: bad file
ok 9 - blob does not exist in database

expecting success: 
	test $hello_sha1 = $(git hash-object -w hello)

ok 10 - hash a file and write to database

expecting success: 
		git cat-file blob 5e1c309dae7f45e0f39b1bf3ac3cd9db12e7d689
	
ok 22 - --batch-check output of tree is correct

expecting success: 
	echo "$type $sha1" >expect &&
	echo $sha1 | git cat-file --batch-check="%(objecttype) %(objectname)" >actual &&
	test_cmp expect actual
    
Hello Worldok 11 - blob exists in database

expecting success: 
	echo foo > file1 &&
	obname0=$(echo bar | git hash-object --stdin) &&
	obname1=$(git hash-object file1) &&
	obname0new=$(echo bar | git hash-object --stdin file1 | sed -n -e 1p) &&
	obname1new=$(echo bar | git hash-object --stdin file1 | sed -n -e 2p) &&
	test "$obname0" = "$obname0new" &&
	test "$obname1" = "$obname1new"

treeDF 6bf22db9043f2b5821c019d0ce0f2605421affcb
ok 23 - custom --batch-check format

expecting success: 
	echo "$type this is some extra content" >expect &&
	echo "$sha1    this is some extra content" |
		git cat-file --batch-check="%(objecttype) %(rest)" >actual &&
	test_cmp expect actual
    
100644 blob 052efc3abbc31348f7abd34535b1953d38273257	DF
ok 24 - --batch-check with %(rest)

100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 0	df
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 0	new
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 1	old
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 3	old
expecting success: 
	git cat-file -e $sha1
    
ok 12 - git hash-object --stdin file1 <file0 first operates on file0, then file1

expecting success: 
	echo fooQ | tr Q "\\015" >file0 &&
	cp file0 file1 &&
	echo "file0 -crlf" >.gitattributes &&
	echo "file1 crlf" >>.gitattributes &&
	git config core.autocrlf true &&
	file0_sha=$(git hash-object file0) &&
	file1_sha=$(git hash-object file1) &&
	test "$file0_sha" != "$file1_sha" &&
	path1_sha=$(git hash-object --path=file1 file0) &&
	path0_sha=$(git hash-object --path=file0 file1) &&
	test "$file0_sha" = "$path0_sha" &&
	test "$file1_sha" = "$path1_sha" &&
	path1_sha=$(cat file0 | git hash-object --path=file1 --stdin) &&
	path0_sha=$(cat file1 | git hash-object --path=file0 --stdin) &&
	test "$file0_sha" = "$path0_sha" &&
	test "$file1_sha" = "$path1_sha" &&
	git config --unset core.autocrlf

treeDFDF c38e296263d024b0f48c4a728d293232ac6c5443
HEAD is now at b9f9383 two
ok 25 - commit exists

expecting success: 
	echo $type >expect &&
	git cat-file -t $sha1 >actual &&
	test_cmp expect actual
    
040000 tree 90bbead36f4d6a7c325fd450e6cfbcc7479d421a	DF
ok 5 - Porcelain reset should remove remnants too

expecting success: 
	read_tree_u_must_succeed --reset -u HEAD &&
	git ls-files -s >expect &&
	sha1=$(git rev-parse :new) &&
	(
		echo "100644 $sha1 1	old"
		echo "100644 $sha1 3	old"
	) | git update-index --index-info &&
	>old &&
	git ls-files -s &&
	git checkout -f &&
	git ls-files -s >actual &&
	! test -f old

ok 26 - Type of commit is correct

expecting success: 
	echo $size >expect &&
	git cat-file -s $sha1 >actual &&
	test_cmp expect actual
    
ok 21 - DF vs DF/DF case setup.

expecting success: rm -f .git/index &&
     rm -fr DF &&
     echo DF >DF &&
     git update-index --add DF &&
     read_tree_u_must_succeed -m -u $treeDF $treeDFDF &&
     git ls-files --stage >DFDFcheck.out &&
     test_cmp DFDF.out DFDFcheck.out &&
     check_cache_at DF/DF clean
ok 27 - Size of commit is correct

expecting success: 
	echo $type >expect &&
	git cat-file -t --allow-unknown-type $sha1 >actual &&
	test_cmp expect actual
    
ok 28 - Type of commit is correct using --allow-unknown-type

expecting success: 
	echo $size >expect &&
	git cat-file -s --allow-unknown-type $sha1 >actual &&
	test_cmp expect actual
    
ok 29 - Size of commit is correct using --allow-unknown-type

expecting success: 
	maybe_remove_timestamp "$content" $no_ts >expect &&
	maybe_remove_timestamp "$(git cat-file $type $sha1)" $no_ts >actual &&
	test_cmp expect actual
    
ok 13 - check that appropriate filter is invoke when --path is used

expecting success: 
	echo fooQ | tr Q "\\015" >file0 &&
	cp file0 file1 &&
	echo "file0 -crlf" >.gitattributes &&
	echo "file1 crlf" >>.gitattributes &&
	git config core.autocrlf true &&
	file0_sha=$(git hash-object file0) &&
	file1_sha=$(git hash-object file1) &&
	test "$file0_sha" != "$file1_sha" &&
	nofilters_file1=$(git hash-object --no-filters file1) &&
	test "$file0_sha" = "$nofilters_file1" &&
	nofilters_file1=$(cat file1 | git hash-object --stdin) &&
	test "$file0_sha" = "$nofilters_file1" &&
	git config --unset core.autocrlf

ok 30 - Content of commit is correct

expecting success: 
	maybe_remove_timestamp "$pretty_content" $no_ts >expect &&
	maybe_remove_timestamp "$(git cat-file -p $sha1)" $no_ts >actual &&
	test_cmp expect actual
    
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 0	df
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 0	new
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 1	old
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 3	old
ok 31 - Pretty content of commit is correct

expecting success: 
	maybe_remove_timestamp "$batch_output" $no_ts >expect &&
	maybe_remove_timestamp "$(echo $sha1 | git cat-file --batch)" $no_ts >actual &&
	test_cmp expect actual
    
DF/DF: clean
ok 22 - DF vs DF/DF case test.

ok 6 - Porcelain checkout -f should remove remnants too

expecting success: 
	read_tree_u_must_succeed --reset -u HEAD &&
	git ls-files -s >expect &&
	sha1=$(git rev-parse :new) &&
	(
		echo "100644 $sha1 1	old"
		echo "100644 $sha1 3	old"
	) | git update-index --index-info &&
	>old &&
	git ls-files -s &&
	git checkout -f HEAD &&
	git ls-files -s >actual &&
	! test -f old

# passed all 22 test(s)
1..22
ok 14 - check that --no-filters option works

expecting success: 
	echo fooQ | tr Q "\\015" >file0 &&
	cp file0 file1 &&
	echo "file0 -crlf" >.gitattributes &&
	echo "file1 crlf" >>.gitattributes &&
	git config core.autocrlf true &&
	file0_sha=$(git hash-object file0) &&
	file1_sha=$(git hash-object file1) &&
	test "$file0_sha" != "$file1_sha" &&
	nofilters_file1=$(echo "file1" | git hash-object --stdin-paths --no-filters) &&
	test "$file0_sha" = "$nofilters_file1" &&
	git config --unset core.autocrlf

ok 32 - --batch output of commit is correct

expecting success: 
	echo "$sha1 $type $size" >expect &&
	echo_without_newline $sha1 | git cat-file --batch-check >actual &&
	test_cmp expect actual
    
ok 33 - --batch-check output of commit is correct

expecting success: 
	echo "$type $sha1" >expect &&
	echo $sha1 | git cat-file --batch-check="%(objecttype) %(objectname)" >actual &&
	test_cmp expect actual
    
*** t1008-read-tree-overlay.sh ***
ok 34 - custom --batch-check format

expecting success: 
	echo "$type this is some extra content" >expect &&
	echo "$sha1    this is some extra content" |
		git cat-file --batch-check="%(objecttype) %(rest)" >actual &&
	test_cmp expect actual
    
ok 15 - check that --no-filters option works with --stdin-paths

ok 35 - --batch-check with %(rest)

expecting success: 
	{
		echo "$size" &&
		maybe_remove_timestamp "$content" $no_ts
	} >expect &&
	echo $sha1 | git cat-file --batch="%(objectsize)" >actual.full &&
	maybe_remove_timestamp "$(cat actual.full)" $no_ts >actual &&
	test_cmp expect actual
    
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 0	df
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 0	new
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 1	old
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 3	old
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1007-hash-object/test/.git/
expecting success: 
		test $example_sha1 = $(git hash-object $args < example)
	
ok 36 - --batch without type (commit)

expecting success: 
	{
		echo "$type" &&
		maybe_remove_timestamp "$content" $no_ts
	} >expect &&
	echo $sha1 | git cat-file --batch="%(objecttype)" >actual.full &&
	maybe_remove_timestamp "$(cat actual.full)" $no_ts >actual &&
	test_cmp expect actual
    
ok 7 - Porcelain checkout -f HEAD should remove remnants too

ok 16 - hash from stdin and write to database (-w --stdin)

expecting success: 
		git cat-file blob ddd3f836d3e3fbb7ae289aa9ae83536f76956399
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1008-read-tree-overlay/.git/
# passed all 7 test(s)
1..7
This is an exampleok 17 - blob exists in database

expecting success: 
	echo one >a &&
	git add a &&
	git commit -m initial &&
	git tag initial &&
	echo two >b &&
	git add b &&
	git commit -m second &&
	git checkout -b side initial &&
	echo three >a &&
	mkdir b &&
	echo four >b/c &&
	git add b/c &&
	git commit -m third

ok 37 - --batch without size (commit)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1007-hash-object/test/.git/
*** t1009-read-tree-new-index.sh ***
expecting success: 
		test $example_sha1 = $(git hash-object $args < example)
	
[master (root-commit) 475740c] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a
ok 18 - hash from stdin and write to database (--stdin -w)

expecting success: 
		git cat-file blob ddd3f836d3e3fbb7ae289aa9ae83536f76956399
	
expecting success: 
	git cat-file -e $sha1
    
This is an exampleok 19 - blob exists in database

expecting success: 
	test "$sha1s" = "$(echo_without_newline "$filenames" | git hash-object --stdin-paths)"

ok 38 - tag exists

expecting success: 
	echo $type >expect &&
	git cat-file -t $sha1 >actual &&
	test_cmp expect actual
    
[master 37ad46f] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 b
ok 20 - hash two files with names on stdin

ok 39 - Type of tag is correct

expecting success: 
	echo $size >expect &&
	git cat-file -s $sha1 >actual &&
	test_cmp expect actual
    
Switched to a new branch 'side'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1009-read-tree-new-index/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1007-hash-object/test/.git/
ok 40 - Size of tag is correct

expecting success: 
	echo $type >expect &&
	git cat-file -t --allow-unknown-type $sha1 >actual &&
	test_cmp expect actual
    
expecting success: 
		test "$sha1s" = "$(echo_without_newline "$filenames" | git hash-object $args)"
	
expecting success: 
	echo one >a &&
	git add a &&
	git commit -m initial

ok 21 - hash two files with names on stdin and write to database (-w --stdin-paths)
ok 41 - Type of tag is correct using --allow-unknown-type


expecting success: 
		git cat-file blob 5e1c309dae7f45e0f39b1bf3ac3cd9db12e7d689
	
expecting success: 
	echo $size >expect &&
	git cat-file -s --allow-unknown-type $sha1 >actual &&
	test_cmp expect actual
    
[side 3340c27] third
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 b/c
ok 1 - setup

expecting success: 
	read_tree_must_succeed initial master side &&
	(echo a; echo b/c) >expect &&
	git ls-files >actual &&
	test_cmp expect actual

Hello Worldok 22 - blob exists in database

expecting success: 
		git cat-file blob ddd3f836d3e3fbb7ae289aa9ae83536f76956399
	
ok 42 - Size of tag is correct using --allow-unknown-type

expecting success: 
	maybe_remove_timestamp "$content" $no_ts >expect &&
	maybe_remove_timestamp "$(git cat-file $type $sha1)" $no_ts >actual &&
	test_cmp expect actual
    
This is an exampleok 23 - blob exists in database

[master (root-commit) 475740c] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a
ok 1 - setup

expecting success: 
	rm -f new-index &&
	GIT_INDEX_FILE=new-index git read-tree master

ok 43 - Content of tag is correct

expecting success: 
	maybe_remove_timestamp "$pretty_content" $no_ts >expect &&
	maybe_remove_timestamp "$(git cat-file -p $sha1)" $no_ts >actual &&
	test_cmp expect actual
    
ok 2 - non-existent index file

expecting success: 
	rm -f new-index &&
	> new-index &&
	GIT_INDEX_FILE=new-index git read-tree master

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1007-hash-object/test/.git/
expecting success: 
		test "$sha1s" = "$(echo_without_newline "$filenames" | git hash-object $args)"
	
ok 3 - empty index file

ok 44 - Pretty content of tag is correct

expecting success: 
	maybe_remove_timestamp "$batch_output" $no_ts >expect &&
	maybe_remove_timestamp "$(echo $sha1 | git cat-file --batch)" $no_ts >actual &&
	test_cmp expect actual
    
# passed all 3 test(s)
1..3
ok 2 - multi-read

ok 24 - hash two files with names on stdin and write to database (--stdin-paths -w)

expecting success: 
		git cat-file blob 5e1c309dae7f45e0f39b1bf3ac3cd9db12e7d689
	
# passed all 2 test(s)
1..2
Hello Worldok 25 - blob exists in database

expecting success: 
		git cat-file blob ddd3f836d3e3fbb7ae289aa9ae83536f76956399
	
ok 45 - --batch output of tag is correct

expecting success: 
	echo "$sha1 $type $size" >expect &&
	echo_without_newline $sha1 | git cat-file --batch-check >actual &&
	test_cmp expect actual
    
*** t1010-mktree.sh ***
This is an exampleok 26 - blob exists in database

ok 46 - --batch-check output of tag is correct

expecting success: 
	echo "$type $sha1" >expect &&
	echo $sha1 | git cat-file --batch-check="%(objecttype) %(objectname)" >actual &&
	test_cmp expect actual
    
expecting success: 
	echo abc >malformed-tree &&
	test_must_fail git hash-object -t tree malformed-tree

*** t1011-read-tree-sparse-checkout.sh ***
fatal: corrupt tree file
ok 27 - corrupt tree

expecting success: 
	test_must_fail git hash-object -t commit --stdin </dev/null

ok 47 - custom --batch-check format

expecting success: 
	echo "$type this is some extra content" >expect &&
	echo "$sha1    this is some extra content" |
		git cat-file --batch-check="%(objecttype) %(rest)" >actual &&
	test_cmp expect actual
    
error: bogus commit object 0000000000000000000000000000000000000000
fatal: corrupt commit
ok 28 - corrupt commit

expecting success: 
	test_must_fail git hash-object -t tag --stdin </dev/null

fatal: corrupt tag
ok 29 - corrupt tag

expecting success: 
	test_must_fail git hash-object -t bogus --stdin </dev/null

ok 48 - --batch-check with %(rest)

expecting success: 
	{
		echo "$size" &&
		maybe_remove_timestamp "$content" $no_ts
	} >expect &&
	echo $sha1 | git cat-file --batch="%(objectsize)" >actual.full &&
	maybe_remove_timestamp "$(cat actual.full)" $no_ts >actual &&
	test_cmp expect actual
    
fatal: invalid object type "bogus"
ok 30 - hash-object complains about bogus type name

expecting success: 
	test_must_fail git hash-object -t bl --stdin </dev/null

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1010-mktree/.git/
fatal: invalid object type "bl"
ok 31 - hash-object complains about truncated type name

expecting success: 
	t=1234567890 &&
	echo example | git hash-object -t $t --literally --stdin

expecting success: 
	for d in a a. a0
	do
		mkdir "$d" && echo "$d/one" >"$d/one" &&
		git add "$d"
	done &&
	echo zero >one &&
	git update-index --add --info-only one &&
	git write-tree --missing-ok >tree.missing &&
	git ls-tree $(cat tree.missing) >top.missing &&
	git ls-tree -r $(cat tree.missing) >all.missing &&
	echo one >one &&
	git add one &&
	git write-tree >tree &&
	git ls-tree $(cat tree) >top &&
	git ls-tree -r $(cat tree) >all &&
	test_tick &&
	git commit -q -m one &&
	H=$(git rev-parse HEAD) &&
	git update-index --add --cacheinfo 160000 $H sub &&
	test_tick &&
	git commit -q -m two &&
	git rev-parse HEAD^{tree} >tree.withsub &&
	git ls-tree HEAD >top.withsub &&
	git ls-tree -r HEAD >all.withsub

f78b23c3f872d473c764d5fcf4fb39af8bbf2123
ok 32 - --literally

expecting success: 
	t=12345678901234567890123456789012345678901234567890 &&
	t="$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t" &&
	echo example | git hash-object -t $t --literally --stdin

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1011-read-tree-sparse-checkout/.git/
ok 49 - --batch without type (tag)

expecting success: 
	{
		echo "$type" &&
		maybe_remove_timestamp "$content" $no_ts
	} >expect &&
	echo $sha1 | git cat-file --batch="%(objecttype)" >actual.full &&
	maybe_remove_timestamp "$(cat actual.full)" $no_ts >actual &&
	test_cmp expect actual
    
2a881776ee43e849175ee7158075560ca0ae7692
ok 33 - --literally with extra-long type

expecting success: 
	cat >expected <<-\EOF &&
	100644 77f0ba1734ed79d12881f81b36ee134de6a3327b 0	init.t
	100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0	sub/added
	100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0	sub/addedtoo
	100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0	subsub/added
	EOF
	cat >expected.swt <<-\EOF &&
	H init.t
	H sub/added
	H sub/addedtoo
	H subsub/added
	EOF

	test_commit init &&
	echo modified >>init.t &&
	mkdir sub subsub &&
	touch sub/added sub/addedtoo subsub/added &&
	git add init.t sub/added sub/addedtoo subsub/added &&
	git commit -m "modified and added" &&
	git tag top &&
	git rm sub/added &&
	git commit -m removed &&
	git tag removed &&
	git checkout top &&
	git ls-files --stage >result &&
	test_cmp expected result

# passed all 33 test(s)
1..33
*** t1012-read-tree-df.sh ***
ok 50 - --batch without size (tag)

expecting success: test 'Hello World' = "$(git cat-file blob bb50ec8a71343279c59ba488a3445888e3fb624b)"
[master (root-commit) 2519212] init
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 init.t
ok 51 - Reach a blob from a tag pointing to it

expecting success: 
	    test_must_fail git cat-file --$batch -$opt $hello_sha1
	
usage: git cat-file (-t [--allow-unknown-type]|-s [--allow-unknown-type]|-e|-p|<type>|--textconv) <object>
   or: git cat-file (--batch | --batch-check) [--follow-symlinks] < <list-of-objects>

<type> can be one of: blob, tree, commit, tag
    -t                    show object type
    -s                    show object size
    -e                    exit with zero when there's no error
    -p                    pretty-print object's content
    --textconv            for blob objects, run textconv on object's content
    --allow-unknown-type  allow -s and -t to work with broken/corrupt objects
    --batch[=<format>]    show info and content of objects fed from the standard input
    --batch-check[=<format>]
                          show info about objects fed from the standard input
    --follow-symlinks     follow in-tree symlinks (used with --batch or --batch-check)

ok 52 - Passing -t with --batch fails

expecting success: 
	    test_must_fail git cat-file -$opt --$batch $hello_sha1
	
usage: git cat-file (-t [--allow-unknown-type]|-s [--allow-unknown-type]|-e|-p|<type>|--textconv) <object>
   or: git cat-file (--batch | --batch-check) [--follow-symlinks] < <list-of-objects>

<type> can be one of: blob, tree, commit, tag
    -t                    show object type
    -s                    show object size
    -e                    exit with zero when there's no error
    -p                    pretty-print object's content
    --textconv            for blob objects, run textconv on object's content
    --allow-unknown-type  allow -s and -t to work with broken/corrupt objects
    --batch[=<format>]    show info and content of objects fed from the standard input
    --batch-check[=<format>]
                          show info about objects fed from the standard input
    --follow-symlinks     follow in-tree symlinks (used with --batch or --batch-check)

ok 53 - Passing --batch with -t fails

expecting success: 
	    test_must_fail git cat-file --$batch -$opt $hello_sha1
	
usage: git cat-file (-t [--allow-unknown-type]|-s [--allow-unknown-type]|-e|-p|<type>|--textconv) <object>
   or: git cat-file (--batch | --batch-check) [--follow-symlinks] < <list-of-objects>

<type> can be one of: blob, tree, commit, tag
    -t                    show object type
    -s                    show object size
    -e                    exit with zero when there's no error
    -p                    pretty-print object's content
    --textconv            for blob objects, run textconv on object's content
    --allow-unknown-type  allow -s and -t to work with broken/corrupt objects
    --batch[=<format>]    show info and content of objects fed from the standard input
    --batch-check[=<format>]
                          show info about objects fed from the standard input
    --follow-symlinks     follow in-tree symlinks (used with --batch or --batch-check)

ok 54 - Passing -s with --batch fails

expecting success: 
	    test_must_fail git cat-file -$opt --$batch $hello_sha1
	
usage: git cat-file (-t [--allow-unknown-type]|-s [--allow-unknown-type]|-e|-p|<type>|--textconv) <object>
   or: git cat-file (--batch | --batch-check) [--follow-symlinks] < <list-of-objects>

<type> can be one of: blob, tree, commit, tag
    -t                    show object type
    -s                    show object size
    -e                    exit with zero when there's no error
    -p                    pretty-print object's content
    --textconv            for blob objects, run textconv on object's content
    --allow-unknown-type  allow -s and -t to work with broken/corrupt objects
    --batch[=<format>]    show info and content of objects fed from the standard input
    --batch-check[=<format>]
                          show info about objects fed from the standard input
    --follow-symlinks     follow in-tree symlinks (used with --batch or --batch-check)

ok 55 - Passing --batch with -s fails

expecting success: 
	    test_must_fail git cat-file --$batch -$opt $hello_sha1
	
[master 9598e22] modified and added
 Author: A U Thor <author@example.com>
 4 files changed, 1 insertion(+)
 create mode 100644 sub/added
 create mode 100644 sub/addedtoo
 create mode 100644 subsub/added
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1012-read-tree-df/.git/
usage: git cat-file (-t [--allow-unknown-type]|-s [--allow-unknown-type]|-e|-p|<type>|--textconv) <object>
   or: git cat-file (--batch | --batch-check) [--follow-symlinks] < <list-of-objects>

<type> can be one of: blob, tree, commit, tag
    -t                    show object type
    -s                    show object size
    -e                    exit with zero when there's no error
    -p                    pretty-print object's content
    --textconv            for blob objects, run textconv on object's content
    --allow-unknown-type  allow -s and -t to work with broken/corrupt objects
    --batch[=<format>]    show info and content of objects fed from the standard input
    --batch-check[=<format>]
                          show info about objects fed from the standard input
    --follow-symlinks     follow in-tree symlinks (used with --batch or --batch-check)

ok 56 - Passing -e with --batch fails

expecting success: 
	    test_must_fail git cat-file -$opt --$batch $hello_sha1
	
expecting success: 
	maketree O-000 a/b-2/c/d a/b/c/d a/x &&
	maketree A-000 a/b-2/c/d a/b/c/d a/x &&
	maketree A-001 a/b-2/c/d a/b/c/d a/b/c/e a/x &&
	maketree B-000 a/b-2/c/d a/b     a/x &&

	maketree O-010 t-0     t/1  t/2 t=3 &&
	maketree A-010 t-0 t            t=3 &&
	maketree B-010         t/1:     t=3: &&

	maketree O-020 ds/dma/ioat.c ds/dma/ioat_dca.c &&
	maketree A-020 ds/dma/ioat/Makefile ds/dma/ioat/registers.h &&
	:

usage: git cat-file (-t [--allow-unknown-type]|-s [--allow-unknown-type]|-e|-p|<type>|--textconv) <object>
   or: git cat-file (--batch | --batch-check) [--follow-symlinks] < <list-of-objects>

<type> can be one of: blob, tree, commit, tag
    -t                    show object type
    -s                    show object size
    -e                    exit with zero when there's no error
    -p                    pretty-print object's content
    --textconv            for blob objects, run textconv on object's content
    --allow-unknown-type  allow -s and -t to work with broken/corrupt objects
    --batch[=<format>]    show info and content of objects fed from the standard input
    --batch-check[=<format>]
                          show info about objects fed from the standard input
    --follow-symlinks     follow in-tree symlinks (used with --batch or --batch-check)

ok 57 - Passing --batch with -e fails

expecting success: 
	    test_must_fail git cat-file --$batch -$opt $hello_sha1
	
rm 'sub/added'
usage: git cat-file (-t [--allow-unknown-type]|-s [--allow-unknown-type]|-e|-p|<type>|--textconv) <object>
   or: git cat-file (--batch | --batch-check) [--follow-symlinks] < <list-of-objects>

<type> can be one of: blob, tree, commit, tag
    -t                    show object type
    -s                    show object size
    -e                    exit with zero when there's no error
    -p                    pretty-print object's content
    --textconv            for blob objects, run textconv on object's content
    --allow-unknown-type  allow -s and -t to work with broken/corrupt objects
    --batch[=<format>]    show info and content of objects fed from the standard input
    --batch-check[=<format>]
                          show info about objects fed from the standard input
    --follow-symlinks     follow in-tree symlinks (used with --batch or --batch-check)

ok 58 - Passing -p with --batch fails

expecting success: 
	    test_must_fail git cat-file -$opt --$batch $hello_sha1
	
usage: git cat-file (-t [--allow-unknown-type]|-s [--allow-unknown-type]|-e|-p|<type>|--textconv) <object>
   or: git cat-file (--batch | --batch-check) [--follow-symlinks] < <list-of-objects>

<type> can be one of: blob, tree, commit, tag
    -t                    show object type
    -s                    show object size
    -e                    exit with zero when there's no error
    -p                    pretty-print object's content
    --textconv            for blob objects, run textconv on object's content
    --allow-unknown-type  allow -s and -t to work with broken/corrupt objects
    --batch[=<format>]    show info and content of objects fed from the standard input
    --batch-check[=<format>]
                          show info about objects fed from the standard input
    --follow-symlinks     follow in-tree symlinks (used with --batch or --batch-check)

[master de70956] removed
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 delete mode 100644 sub/added
ok 59 - Passing --batch with -p fails

expecting success: 
	test_must_fail git cat-file --$batch blob $hello_sha1
    
usage: git cat-file (-t [--allow-unknown-type]|-s [--allow-unknown-type]|-e|-p|<type>|--textconv) <object>
   or: git cat-file (--batch | --batch-check) [--follow-symlinks] < <list-of-objects>

<type> can be one of: blob, tree, commit, tag
    -t                    show object type
    -s                    show object size
    -e                    exit with zero when there's no error
    -p                    pretty-print object's content
    --textconv            for blob objects, run textconv on object's content
    --allow-unknown-type  allow -s and -t to work with broken/corrupt objects
    --batch[=<format>]    show info and content of objects fed from the standard input
    --batch-check[=<format>]
                          show info about objects fed from the standard input
    --follow-symlinks     follow in-tree symlinks (used with --batch or --batch-check)

ok 60 - Passing <type> with --batch fails

expecting success: 
	test_must_fail git cat-file blob --$batch $hello_sha1
    
usage: git cat-file (-t [--allow-unknown-type]|-s [--allow-unknown-type]|-e|-p|<type>|--textconv) <object>
   or: git cat-file (--batch | --batch-check) [--follow-symlinks] < <list-of-objects>

<type> can be one of: blob, tree, commit, tag
    -t                    show object type
    -s                    show object size
    -e                    exit with zero when there's no error
    -p                    pretty-print object's content
    --textconv            for blob objects, run textconv on object's content
    --allow-unknown-type  allow -s and -t to work with broken/corrupt objects
    --batch[=<format>]    show info and content of objects fed from the standard input
    --batch-check[=<format>]
                          show info about objects fed from the standard input
    --follow-symlinks     follow in-tree symlinks (used with --batch or --batch-check)

ok 61 - Passing --batch with <type> fails

expecting success: 
	test_must_fail git cat-file --$batch $hello_sha1
    
Note: checking out 'top'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 9598e22... modified and added
usage: git cat-file (-t [--allow-unknown-type]|-s [--allow-unknown-type]|-e|-p|<type>|--textconv) <object>
   or: git cat-file (--batch | --batch-check) [--follow-symlinks] < <list-of-objects>

<type> can be one of: blob, tree, commit, tag
    -t                    show object type
    -s                    show object size
    -e                    exit with zero when there's no error
    -p                    pretty-print object's content
    --textconv            for blob objects, run textconv on object's content
    --allow-unknown-type  allow -s and -t to work with broken/corrupt objects
    --batch[=<format>]    show info and content of objects fed from the standard input
    --batch-check[=<format>]
                          show info about objects fed from the standard input
    --follow-symlinks     follow in-tree symlinks (used with --batch or --batch-check)

ok 62 - Passing sha1 with --batch fails

expecting success: 
	    test_must_fail git cat-file --$batch -$opt $hello_sha1
	
usage: git cat-file (-t [--allow-unknown-type]|-s [--allow-unknown-type]|-e|-p|<type>|--textconv) <object>
   or: git cat-file (--batch | --batch-check) [--follow-symlinks] < <list-of-objects>

<type> can be one of: blob, tree, commit, tag
    -t                    show object type
    -s                    show object size
    -e                    exit with zero when there's no error
    -p                    pretty-print object's content
    --textconv            for blob objects, run textconv on object's content
    --allow-unknown-type  allow -s and -t to work with broken/corrupt objects
ok 1 - setup

expecting success: 
	read_tree_u_must_succeed -m -u HEAD &&
	git ls-files --stage >result &&
	test_cmp expected result &&
	git ls-files -t >result &&
	test_cmp expected.swt result

    --batch[=<format>]    show info and content of objects fed from the standard input
    --batch-check[=<format>]
                          show info about objects fed from the standard input
    --follow-symlinks     follow in-tree symlinks (used with --batch or --batch-check)

ok 63 - Passing -t with --batch-check fails

expecting success: 
	    test_must_fail git cat-file -$opt --$batch $hello_sha1
	
usage: git cat-file (-t [--allow-unknown-type]|-s [--allow-unknown-type]|-e|-p|<type>|--textconv) <object>
   or: git cat-file (--batch | --batch-check) [--follow-symlinks] < <list-of-objects>

<type> can be one of: blob, tree, commit, tag
    -t                    show object type
    -s                    show object size
    -e                    exit with zero when there's no error
    -p                    pretty-print object's content
    --textconv            for blob objects, run textconv on object's content
    --allow-unknown-type  allow -s and -t to work with broken/corrupt objects
    --batch[=<format>]    show info and content of objects fed from the standard input
    --batch-check[=<format>]
                          show info about objects fed from the standard input
    --follow-symlinks     follow in-tree symlinks (used with --batch or --batch-check)

ok 64 - Passing --batch-check with -t fails

expecting success: 
	    test_must_fail git cat-file --$batch -$opt $hello_sha1
	
ok 1 - setup

expecting success: 
	git mktree <top >actual &&
	test_cmp tree actual

usage: git cat-file (-t [--allow-unknown-type]|-s [--allow-unknown-type]|-e|-p|<type>|--textconv) <object>
   or: git cat-file (--batch | --batch-check) [--follow-symlinks] < <list-of-objects>

<type> can be one of: blob, tree, commit, tag
    -t                    show object type
    -s                    show object size
    -e                    exit with zero when there's no error
    -p                    pretty-print object's content
    --textconv            for blob objects, run textconv on object's content
    --allow-unknown-type  allow -s and -t to work with broken/corrupt objects
    --batch[=<format>]    show info and content of objects fed from the standard input
    --batch-check[=<format>]
                          show info about objects fed from the standard input
    --follow-symlinks     follow in-tree symlinks (used with --batch or --batch-check)

ok 65 - Passing -s with --batch-check fails

expecting success: 
	    test_must_fail git cat-file -$opt --$batch $hello_sha1
	
usage: git cat-file (-t [--allow-unknown-type]|-s [--allow-unknown-type]|-e|-p|<type>|--textconv) <object>
   or: git cat-file (--batch | --batch-check) [--follow-symlinks] < <list-of-objects>

<type> can be one of: blob, tree, commit, tag
    -t                    show object type
    -s                    show object size
    -e                    exit with zero when there's no error
    -p                    pretty-print object's content
    --textconv            for blob objects, run textconv on object's content
    --allow-unknown-type  allow -s and -t to work with broken/corrupt objects
    --batch[=<format>]    show info and content of objects fed from the standard input
    --batch-check[=<format>]
                          show info about objects fed from the standard input
    --follow-symlinks     follow in-tree symlinks (used with --batch or --batch-check)

ok 66 - Passing --batch-check with -s fails

expecting success: 
	    test_must_fail git cat-file --$batch -$opt $hello_sha1
	
ok 2 - ls-tree piped to mktree (1)

expecting success: 
	git mktree <top.withsub >actual &&
	test_cmp tree.withsub actual

usage: git cat-file (-t [--allow-unknown-type]|-s [--allow-unknown-type]|-e|-p|<type>|--textconv) <object>
   or: git cat-file (--batch | --batch-check) [--follow-symlinks] < <list-of-objects>

<type> can be one of: blob, tree, commit, tag
    -t                    show object type
    -s                    show object size
    -e                    exit with zero when there's no error
    -p                    pretty-print object's content
    --textconv            for blob objects, run textconv on object's content
    --allow-unknown-type  allow -s and -t to work with broken/corrupt objects
    --batch[=<format>]    show info and content of objects fed from the standard input
    --batch-check[=<format>]
                          show info about objects fed from the standard input
    --follow-symlinks     follow in-tree symlinks (used with --batch or --batch-check)

ok 67 - Passing -e with --batch-check fails

expecting success: 
	    test_must_fail git cat-file -$opt --$batch $hello_sha1
	
ok 3 - ls-tree piped to mktree (2)

expecting success: 
	perl -e "print reverse <>" <top |
	git mktree >actual &&
	test_cmp tree actual

usage: git cat-file (-t [--allow-unknown-type]|-s [--allow-unknown-type]|-e|-p|<type>|--textconv) <object>
   or: git cat-file (--batch | --batch-check) [--follow-symlinks] < <list-of-objects>

<type> can be one of: blob, tree, commit, tag
    -t                    show object type
    -s                    show object size
    -e                    exit with zero when there's no error
    -p                    pretty-print object's content
    --textconv            for blob objects, run textconv on object's content
    --allow-unknown-type  allow -s and -t to work with broken/corrupt objects
    --batch[=<format>]    show info and content of objects fed from the standard input
    --batch-check[=<format>]
                          show info about objects fed from the standard input
    --follow-symlinks     follow in-tree symlinks (used with --batch or --batch-check)

ok 68 - Passing --batch-check with -e fails

expecting success: 
	    test_must_fail git cat-file --$batch -$opt $hello_sha1
	
ok 4 - ls-tree output in wrong order given to mktree (1)

expecting success: 
	perl -e "print reverse <>" <top.withsub |
	git mktree >actual &&
	test_cmp tree.withsub actual

usage: git cat-file (-t [--allow-unknown-type]|-s [--allow-unknown-type]|-e|-p|<type>|--textconv) <object>
   or: git cat-file (--batch | --batch-check) [--follow-symlinks] < <list-of-objects>

<type> can be one of: blob, tree, commit, tag
    -t                    show object type
    -s                    show object size
    -e                    exit with zero when there's no error
    -p                    pretty-print object's content
    --textconv            for blob objects, run textconv on object's content
    --allow-unknown-type  allow -s and -t to work with broken/corrupt objects
    --batch[=<format>]    show info and content of objects fed from the standard input
    --batch-check[=<format>]
                          show info about objects fed from the standard input
    --follow-symlinks     follow in-tree symlinks (used with --batch or --batch-check)

ok 69 - Passing -p with --batch-check fails

expecting success: 
	    test_must_fail git cat-file -$opt --$batch $hello_sha1
	
ok 2 - read-tree without .git/info/sparse-checkout

expecting success: 
	echo >.git/info/sparse-checkout &&
	read_tree_u_must_succeed -m -u HEAD &&
	git ls-files -t >result &&
	test_cmp expected.swt result &&
	test -f init.t &&
	test -f sub/added

ok 5 - ls-tree output in wrong order given to mktree (2)

expecting success: 
	git mktree --missing <top.missing >actual &&
	test_cmp tree.missing actual

usage: git cat-file (-t [--allow-unknown-type]|-s [--allow-unknown-type]|-e|-p|<type>|--textconv) <object>
   or: git cat-file (--batch | --batch-check) [--follow-symlinks] < <list-of-objects>

<type> can be one of: blob, tree, commit, tag
    -t                    show object type
    -s                    show object size
    -e                    exit with zero when there's no error
    -p                    pretty-print object's content
    --textconv            for blob objects, run textconv on object's content
    --allow-unknown-type  allow -s and -t to work with broken/corrupt objects
    --batch[=<format>]    show info and content of objects fed from the standard input
    --batch-check[=<format>]
                          show info about objects fed from the standard input
    --follow-symlinks     follow in-tree symlinks (used with --batch or --batch-check)

ok 70 - Passing --batch-check with -p fails

expecting success: 
	test_must_fail git cat-file --$batch blob $hello_sha1
    
usage: git cat-file (-t [--allow-unknown-type]|-s [--allow-unknown-type]|-e|-p|<type>|--textconv) <object>
   or: git cat-file (--batch | --batch-check) [--follow-symlinks] < <list-of-objects>

<type> can be one of: blob, tree, commit, tag
    -t                    show object type
    -s                    show object size
    -e                    exit with zero when there's no error
    -p                    pretty-print object's content
    --textconv            for blob objects, run textconv on object's content
    --allow-unknown-type  allow -s and -t to work with broken/corrupt objects
    --batch[=<format>]    show info and content of objects fed from the standard input
    --batch-check[=<format>]
                          show info about objects fed from the standard input
    --follow-symlinks     follow in-tree symlinks (used with --batch or --batch-check)

ok 6 - allow missing object with --missing

expecting success: 
	test_must_fail git mktree <all >actual

ok 71 - Passing <type> with --batch-check fails

expecting success: 
	test_must_fail git cat-file blob --$batch $hello_sha1
    
usage: git cat-file (-t [--allow-unknown-type]|-s [--allow-unknown-type]|-e|-p|<type>|--textconv) <object>
   or: git cat-file (--batch | --batch-check) [--follow-symlinks] < <list-of-objects>

<type> can be one of: blob, tree, commit, tag
    -t                    show object type
    -s                    show object size
    -e                    exit with zero when there's no error
    -p                    pretty-print object's content
    --textconv            for blob objects, run textconv on object's content
    --allow-unknown-type  allow -s and -t to work with broken/corrupt objects
    --batch[=<format>]    show info and content of objects fed from the standard input
    --batch-check[=<format>]
                          show info about objects fed from the standard input
    --follow-symlinks     follow in-tree symlinks (used with --batch or --batch-check)

ok 72 - Passing --batch-check with <type> fails

expecting success: 
	test_must_fail git cat-file --$batch $hello_sha1
    
fatal: path a./one contains slash
ok 7 - mktree refuses to read ls-tree -r output (1)

expecting success: 
	test_must_fail git mktree <all.withsub >actual

usage: git cat-file (-t [--allow-unknown-type]|-s [--allow-unknown-type]|-e|-p|<type>|--textconv) <object>
   or: git cat-file (--batch | --batch-check) [--follow-symlinks] < <list-of-objects>

<type> can be one of: blob, tree, commit, tag
    -t                    show object type
    -s                    show object size
    -e                    exit with zero when there's no error
    -p                    pretty-print object's content
    --textconv            for blob objects, run textconv on object's content
    --allow-unknown-type  allow -s and -t to work with broken/corrupt objects
    --batch[=<format>]    show info and content of objects fed from the standard input
    --batch-check[=<format>]
                          show info about objects fed from the standard input
    --follow-symlinks     follow in-tree symlinks (used with --batch or --batch-check)

ok 73 - Passing sha1 with --batch-check fails

expecting success: 
	    test_must_fail git cat-file --follow-symlinks -$opt $hello_sha1
	
fatal: path a./one contains slash
ok 8 - mktree refuses to read ls-tree -r output (2)

usage: git cat-file (-t [--allow-unknown-type]|-s [--allow-unknown-type]|-e|-p|<type>|--textconv) <object>
   or: git cat-file (--batch | --batch-check) [--follow-symlinks] < <list-of-objects>

<type> can be one of: blob, tree, commit, tag
    -t                    show object type
    -s                    show object size
    -e                    exit with zero when there's no error
    -p                    pretty-print object's content
    --textconv            for blob objects, run textconv on object's content
    --allow-unknown-type  allow -s and -t to work with broken/corrupt objects
    --batch[=<format>]    show info and content of objects fed from the standard input
    --batch-check[=<format>]
                          show info about objects fed from the standard input
    --follow-symlinks     follow in-tree symlinks (used with --batch or --batch-check)

# passed all 8 test(s)
1..8
ok 74 - Passing -t with --follow-symlinks fails

expecting success: 
	    test_must_fail git cat-file --follow-symlinks -$opt $hello_sha1
	
usage: git cat-file (-t [--allow-unknown-type]|-s [--allow-unknown-type]|-e|-p|<type>|--textconv) <object>
   or: git cat-file (--batch | --batch-check) [--follow-symlinks] < <list-of-objects>

<type> can be one of: blob, tree, commit, tag
    -t                    show object type
    -s                    show object size
    -e                    exit with zero when there's no error
    -p                    pretty-print object's content
    --textconv            for blob objects, run textconv on object's content
    --allow-unknown-type  allow -s and -t to work with broken/corrupt objects
    --batch[=<format>]    show info and content of objects fed from the standard input
    --batch-check[=<format>]
                          show info about objects fed from the standard input
    --follow-symlinks     follow in-tree symlinks (used with --batch or --batch-check)

ok 75 - Passing -s with --follow-symlinks fails

expecting success: 
	    test_must_fail git cat-file --follow-symlinks -$opt $hello_sha1
	
usage: git cat-file (-t [--allow-unknown-type]|-s [--allow-unknown-type]|-e|-p|<type>|--textconv) <object>
   or: git cat-file (--batch | --batch-check) [--follow-symlinks] < <list-of-objects>

<type> can be one of: blob, tree, commit, tag
    -t                    show object type
    -s                    show object size
    -e                    exit with zero when there's no error
    -p                    pretty-print object's content
    --textconv            for blob objects, run textconv on object's content
    --allow-unknown-type  allow -s and -t to work with broken/corrupt objects
    --batch[=<format>]    show info and content of objects fed from the standard input
    --batch-check[=<format>]
                          show info about objects fed from the standard input
    --follow-symlinks     follow in-tree symlinks (used with --batch or --batch-check)

ok 76 - Passing -e with --follow-symlinks fails

expecting success: 
	    test_must_fail git cat-file --follow-symlinks -$opt $hello_sha1
	
ok 3 - read-tree with .git/info/sparse-checkout but disabled

expecting success: 
	git config core.sparsecheckout true &&
	echo >.git/info/sparse-checkout &&
	read_tree_u_must_succeed --no-sparse-checkout -m -u HEAD &&
	git ls-files -t >result &&
	test_cmp expected.swt result &&
	test -f init.t &&
	test -f sub/added

usage: git cat-file (-t [--allow-unknown-type]|-s [--allow-unknown-type]|-e|-p|<type>|--textconv) <object>
   or: git cat-file (--batch | --batch-check) [--follow-symlinks] < <list-of-objects>

<type> can be one of: blob, tree, commit, tag
    -t                    show object type
    -s                    show object size
    -e                    exit with zero when there's no error
    -p                    pretty-print object's content
    --textconv            for blob objects, run textconv on object's content
    --allow-unknown-type  allow -s and -t to work with broken/corrupt objects
    --batch[=<format>]    show info and content of objects fed from the standard input
    --batch-check[=<format>]
                          show info about objects fed from the standard input
    --follow-symlinks     follow in-tree symlinks (used with --batch or --batch-check)

ok 77 - Passing -p with --follow-symlinks fails

expecting success: 
    test "foobar42 missing
foobar84 missing" = \
    "$( ( echo foobar42; echo_without_newline foobar84; ) | git cat-file --batch-check)"

*** t1013-read-tree-submodule.sh ***
ok 78 - --batch-check for a non-existent named object

expecting success: 
    test "0000000000000000000000000000000000000042 missing
0000000000000000000000000000000000000084 missing" = \
    "$( ( echo 0000000000000000000000000000000000000042;
         echo_without_newline 0000000000000000000000000000000000000084; ) \
       | git cat-file --batch-check)"

ok 79 - --batch-check for a non-existent hash

expecting success: 
    test "$tag_sha1 tag $tag_size
$tag_content
0000000000000000000000000000000000000000 missing" = \
    "$( ( echo $tag_sha1;
         echo_without_newline 0000000000000000000000000000000000000000; ) \
       | git cat-file --batch)"

ok 80 - --batch for an existent and a non-existent hash

expecting success: 
    test " missing" = "$(echo | git cat-file --batch-check)"

ok 81 - --batch-check for an emtpy line

expecting success: 
	echo "$_z40 missing" >expect &&
	echo "$_z40" | git cat-file --batch-check="" >actual &&
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/.git/
ok 82 - empty --batch-check notices missing object

expecting success: 
	test "$(maybe_remove_timestamp "$batch_output" 1)" = "$(maybe_remove_timestamp "$(echo_without_newline "$batch_input" | git cat-file --batch)" 1)"

expecting success: 
		prolog &&
		reset_work_tree_to no_submodule &&
		(
			cd submodule_update &&
			git branch -t add_sub1 origin/add_sub1 &&
			$command add_sub1 &&
			test_superproject_content origin/add_sub1 &&
			test_dir_is_empty sub1 &&
			git submodule update --init --recursive &&
			test_submodule_content sub1 origin/add_sub1
		)
	
ok 4 - read-tree --no-sparse-checkout with empty .git/info/sparse-checkout and enabled

expecting success: 
	git config core.sparsecheckout true &&
	echo >.git/info/sparse-checkout &&
	read_tree_u_must_fail -m -u HEAD &&
	git ls-files --stage >result &&
	test_cmp expected result &&
	git ls-files -t >result &&
	test_cmp expected.swt result &&
	test -f init.t &&
	test -f sub/added

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.git/
ok 83 - --batch with multiple sha1s gives correct format

expecting success: 
    test "$batch_check_output" = \
    "$(echo_without_newline "$batch_check_input" | git cat-file --batch-check)"

ok 84 - --batch-check with multiple sha1s gives correct format

expecting success: 
	test-genrandom foo 10240 >foo &&
	{ cat foo; echo plus; } >foo-plus &&
	git add foo foo-plus &&
	git commit -m foo &&
	cat >blobs <<-\EOF
	HEAD:foo
	HEAD:foo-plus
	EOF

[master (root-commit) 913780c] Base
 Author: A U Thor <author@example.com>
 3 files changed, 4 insertions(+)
 create mode 100644 .gitignore
 create mode 100644 file1
 create mode 100644 file2
error: Sparse checkout leaves no entry on working directory
Switched to a new branch 'add_sub1'
[master (root-commit) 4b8eaf2] foo
 Author: A U Thor <author@example.com>
 3 files changed, 1 insertion(+)
 create mode 100644 foo
 create mode 100644 foo-plus
 create mode 100644 hello
error: Sparse checkout leaves no entry on working directory
ok 85 - setup blobs which are likely to delta

expecting success: 
	cat >expect <<-EOF &&
	$_z40
	$_z40
	EOF
	git cat-file --batch-check="%(deltabase)" <blobs >actual &&
	test_cmp expect actual

ok 5 - read-tree with empty .git/info/sparse-checkout

expecting success: 
	cat >expected.swt-noinit <<-\EOF &&
	S init.t
	H sub/added
	H sub/addedtoo
	S subsub/added
	EOF

	echo sub/ > .git/info/sparse-checkout &&
	read_tree_u_must_succeed -m -u HEAD &&
	git ls-files -t > result &&
	test_cmp expected.swt-noinit result &&
	test ! -f init.t &&
	test -f sub/added

ok 86 - confirm that neither loose blob is a delta

expecting success: 
	git repack -ad &&
	git cat-file --batch-check="%(deltabase)" <blobs >actual &&
	{
		grep "$(git rev-parse HEAD:foo)" actual ||
		grep "$(git rev-parse HEAD:foo-plus)" actual
	}

ok 6 - match directories with trailing slash

expecting success: 
	echo sub >.git/info/sparse-checkout &&
	read_tree_u_must_succeed -m -u HEAD &&
	git ls-files -t >result &&
	test_cmp expected.swt-noinit result &&
	test ! -f init.t &&
	test -f sub/added

Cloning into 'sub1'...
done.
9b546ef00c80e00a1733cb882d607028fcd562fc
ok 87 - %(deltabase) reports packed delta bases

ok 7 - match directories without trailing slash

expecting success: 
	cat >expected.swt-negation <<\EOF &&
S init.t
S sub/added
H sub/addedtoo
S subsub/added
EOF

	cat >.git/info/sparse-checkout <<\EOF &&
sub
!sub/added
EOF
	git read-tree -m -u HEAD &&
	git ls-files -t >result &&
	test_cmp expected.swt-negation result &&
	test ! -f init.t &&
	test ! -f sub/added &&
	test -f sub/addedtoo

expecting success: 
	echo $bogus_type >expect &&
	git cat-file -t --allow-unknown-type $bogus_sha1 >actual &&
	test_cmp expect actual

ok 88 - Type of broken object is correct

expecting success: 
	echo $bogus_size >expect &&
	git cat-file -s --allow-unknown-type $bogus_sha1 >actual &&
	test_cmp expect actual

ok 8 - match directories with negated patterns

expecting success: 
	cat >expected.swt-negation2 <<\EOF &&
H init.t
H sub/added
S sub/addedtoo
H subsub/added
EOF

	cat >.git/info/sparse-checkout <<\EOF &&
/*
!sub
sub/added
EOF
	git read-tree -m -u HEAD &&
	git ls-files -t >result &&
	test_cmp expected.swt-negation2 result &&
	test -f init.t &&
	test -f sub/added &&
	test ! -f sub/addedtoo

ok 89 - Size of broken object is correct

ok 9 - match directories with negated patterns (2)

expecting success: 
	echo "s?b" >.git/info/sparse-checkout &&
	read_tree_u_must_succeed -m -u HEAD &&
	git ls-files -t >result &&
	test_cmp expected.swt-noinit result &&
	test ! -f init.t &&
	test -f sub/added

expecting success: 
	echo $bogus_type >expect &&
	git cat-file -t --allow-unknown-type $bogus_sha1 >actual &&
	test_cmp expect actual

ok 90 - Type of broken object is correct when type is large

expecting success: 
	echo $bogus_size >expect &&
	git cat-file -s --allow-unknown-type $bogus_sha1 >actual &&
	test_cmp expect actual

ok 91 - Size of large broken object is correct when type is large

expecting success: 
	echo_without_newline "$hello_content" >morx &&
	test_ln_s_add morx same-dir-link &&
	test_ln_s_add dir link-to-dir &&
	test_ln_s_add ../fleem out-of-repo-link &&
	test_ln_s_add .. out-of-repo-link-dir &&
	test_ln_s_add same-dir-link link-to-link &&
	test_ln_s_add nope broken-same-dir-link &&
	mkdir dir &&
	test_ln_s_add ../morx dir/parent-dir-link &&
	test_ln_s_add .. dir/link-dir &&
	test_ln_s_add ../../escape dir/out-of-repo-link &&
	test_ln_s_add ../.. dir/out-of-repo-link-dir &&
	test_ln_s_add nope dir/broken-link-in-dir &&
	mkdir dir/subdir &&
	test_ln_s_add ../../morx dir/subdir/grandparent-dir-link &&
	test_ln_s_add ../../../great-escape dir/subdir/out-of-repo-link &&
	test_ln_s_add ../../.. dir/subdir/out-of-repo-link-dir &&
	test_ln_s_add ../../../ dir/subdir/out-of-repo-link-dir-trailing &&
	test_ln_s_add ../parent-dir-link dir/subdir/parent-dir-link-to-link &&
	echo_without_newline "$hello_content" >dir/subdir/ind2 &&
	echo_without_newline "$hello_content" >dir/ind1 &&
	test_ln_s_add dir dirlink &&
	test_ln_s_add dir/subdir subdirlink &&
	test_ln_s_add subdir/ind2 dir/link-to-child &&
	test_ln_s_add dir/link-to-child link-to-down-link &&
	test_ln_s_add dir/.. up-down &&
	test_ln_s_add dir/../ up-down-trailing &&
	test_ln_s_add dir/../morx up-down-file &&
	test_ln_s_add dir/../../morx up-up-down-file &&
	test_ln_s_add subdirlink/../../morx up-two-down-file &&
	test_ln_s_add loop1 loop2 &&
	test_ln_s_add loop2 loop1 &&
	git add morx dir/subdir/ind2 dir/ind1 &&
	git commit -am "test" &&
	echo $hello_sha1 blob $hello_size >found

checking prerequisite: SYMLINKS

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	# test whether the filesystem supports symbolic links
	ln -s x y && test -h y

)
prerequisite SYMLINKS ok
[add_sub1 d8d69e7] Add sub1
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
Switched to a new branch 'remove_sub1'
ok 10 - match directory pattern

expecting success: 
	cat >expected.swt-nosub <<-\EOF &&
	H init.t
	S sub/added
	S sub/addedtoo
	S subsub/added
	EOF

	echo init.t >.git/info/sparse-checkout &&
	read_tree_u_must_succeed -m -u HEAD &&
	git ls-files -t >result &&
	test_cmp expected.swt-nosub result &&
	test -f init.t &&
	test ! -f sub/added

Removing sub1
Removing .gitmodules
[remove_sub1 7af7c65] Revert "Add sub1"
 Author: A U Thor <author@example.com>
 2 files changed, 5 deletions(-)
 delete mode 100644 .gitmodules
 delete mode 160000 sub1
Switched to a new branch 'modify_sub1'
ok 11 - checkout area changes

expecting success: 
	echo sub/added >.git/info/sparse-checkout &&
	git checkout -f top &&
	read_tree_u_must_succeed -m -u HEAD^ &&
	test ! -f init.t

HEAD is now at 9598e22... modified and added
ok 1 - setup

expecting success: 
	settree A-000 &&
	read_tree_u_must_succeed -m -u O-000 A-000 B-000 &&
	checkindex <<-EOF
	3 a/b
	0 a/b-2/c/d
	1 a/b/c/d
	2 a/b/c/d
	0 a/x
	EOF

ok 12 - read-tree updates worktree, absent case

expecting success: 
	echo sub/added >.git/info/sparse-checkout &&
	git checkout -f top &&
	echo dirty >init.t &&
	read_tree_u_must_succeed -m -u HEAD^ &&
	grep -q dirty init.t &&
	rm init.t

HEAD is now at 9598e22... modified and added
ok 13 - read-tree updates worktree, dirty case

expecting success: 
	echo init.t >.git/info/sparse-checkout &&
	git checkout -f top &&
	echo dirty >added &&
	read_tree_u_must_succeed -m -u HEAD^ &&
	grep -q dirty added

HEAD is now at 9598e22... modified and added
ok 2 - 3-way (1)

expecting success: 
	settree A-001 &&
	read_tree_u_must_succeed -m -u O-000 A-001 B-000 &&
	checkindex <<-EOF
	3 a/b
	0 a/b-2/c/d
	1 a/b/c/d
	2 a/b/c/d
	2 a/b/c/e
	0 a/x
	EOF

From /«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.
   913780c..d8d69e7  add_sub1   -> origin/add_sub1
 * [new branch]      modify_sub1 -> origin/modify_sub1
 * [new branch]      remove_sub1 -> origin/remove_sub1
Switched to a new branch 'modifications'
[modifications 1a0bd5c] modified file2 and added file3
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 file3
ok 14 - read-tree removes worktree, dirty case

expecting success: 
	echo init.t >.git/info/sparse-checkout &&
	git checkout -f removed &&
	read_tree_u_must_succeed -u -m HEAD^ &&
	test ! -f sub/added

Previous HEAD position was 9598e22... modified and added
HEAD is now at de70956... removed
To /«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.
 * [new branch]      modifications -> modifications
ok 3 - 3-way (2)

expecting success: 
	settree A-010 &&
	read_tree_u_must_succeed -m -u O-010 A-010 B-010 &&
	checkindex <<-EOF
	2 t
	1 t-0
	2 t-0
	1 t/1
	3 t/1
	1 t/2
	0 t=3
	EOF

[modify_sub1 c9f7b0c] Modify sub1
 Author: A U Thor <author@example.com>
ok 15 - read-tree adds to worktree, absent case

expecting success: 
	echo init.t >.git/info/sparse-checkout &&
	git checkout -f removed &&
	mkdir sub &&
	echo dirty >sub/added &&
	read_tree_u_must_succeed -u -m HEAD^ &&
	grep -q dirty sub/added

Switched to a new branch 'replace_sub1_with_directory'
[master 84456c1] test
 Author: A U Thor <author@example.com>
 30 files changed, 30 insertions(+)
 create mode 120000 broken-same-dir-link
 create mode 120000 dir/broken-link-in-dir
 create mode 100644 dir/ind1
 create mode 120000 dir/link-dir
 create mode 120000 dir/link-to-child
 create mode 120000 dir/out-of-repo-link
 create mode 120000 dir/out-of-repo-link-dir
 create mode 120000 dir/parent-dir-link
 create mode 120000 dir/subdir/grandparent-dir-link
 create mode 100644 dir/subdir/ind2
 create mode 120000 dir/subdir/out-of-repo-link
 create mode 120000 dir/subdir/out-of-repo-link-dir
 create mode 120000 dir/subdir/out-of-repo-link-dir-trailing
 create mode 120000 dir/subdir/parent-dir-link-to-link
 create mode 120000 dirlink
 create mode 120000 link-to-dir
 create mode 120000 link-to-down-link
 create mode 120000 link-to-link
 create mode 120000 loop1
 create mode 120000 loop2
 create mode 100644 morx
 create mode 120000 out-of-repo-link
 create mode 120000 out-of-repo-link-dir
 create mode 120000 same-dir-link
 create mode 120000 subdirlink
 create mode 120000 up-down
 create mode 120000 up-down-file
 create mode 120000 up-down-trailing
 create mode 120000 up-two-down-file
 create mode 120000 up-up-down-file
ok 92 - prep for symlink tests

expecting success: 
	echo HEAD:morx | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp found actual &&
	echo HEAD:nope missing >expect &&
	echo HEAD:nope | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp expect actual

HEAD is now at de70956... removed
ok 93 - git cat-file --batch-check --follow-symlinks works for non-links

expecting success: 
	echo HEAD:same-dir-link | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp found actual

ok 94 - git cat-file --batch-check --follow-symlinks works for in-repo, same-dir links

expecting success: 
	echo HEAD:link-to-dir/ind1 | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp found actual

ok 95 - git cat-file --batch-check --follow-symlinks works for in-repo, links to dirs

expecting success: 
	echo dangling 25 >expect &&
	echo HEAD:broken-same-dir-link >>expect &&
	echo HEAD:broken-same-dir-link | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp expect actual

ok 96 - git cat-file --batch-check --follow-symlinks works for broken in-repo, same-dir links

expecting success: 
	echo HEAD:link-to-link | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp found actual

ok 16 - read-tree adds to worktree, dirty case

expecting success: 
	>empty &&
	echo init.t >.git/info/sparse-checkout &&
	echo sub/added >>.git/info/sparse-checkout &&
	git checkout -f top &&
	echo init.t >.git/info/sparse-checkout &&
	git checkout removed &&
	git ls-files sub/added >result &&
	test ! -f sub/added &&
	test_cmp empty result

ok 4 - 3-way (3)

expecting success: 
	settree O-020 &&
	read_tree_u_must_succeed -m -u O-020 A-020 &&
	checkindex <<-EOF
	0 ds/dma/ioat/Makefile
	0 ds/dma/ioat/registers.h
	EOF

ok 97 - git cat-file --batch-check --follow-symlinks works for same-dir links-to-links

expecting success: 
	echo HEAD:dir/parent-dir-link | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp found actual &&
	echo notdir 29 >expect &&
	echo HEAD:dir/parent-dir-link/nope >>expect &&
	echo HEAD:dir/parent-dir-link/nope | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp expect actual

Previous HEAD position was de70956... removed
HEAD is now at 9598e22... modified and added
Previous HEAD position was 9598e22... modified and added
HEAD is now at de70956... removed
ok 17 - index removal and worktree narrowing at the same time

expecting success: 
	>empty &&
	echo init.t >.git/info/sparse-checkout &&
	git checkout -f top &&
	git reset --hard removed &&
	git ls-files sub/added >result &&
	test_cmp empty result

ok 98 - git cat-file --batch-check --follow-symlinks works for parent-dir links

expecting success: 
	echo dangling 22 >expect &&
	echo HEAD:dir/link-dir/nope >>expect &&
	echo HEAD:dir/link-dir/nope | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp expect actual &&
	echo HEAD:dir/link-dir/morx | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp found actual &&
	echo dangling 27 >expect &&
	echo HEAD:dir/broken-link-in-dir >>expect &&
	echo HEAD:dir/broken-link-in-dir | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp expect actual

Previous HEAD position was de70956... removed
HEAD is now at 9598e22... modified and added
HEAD is now at de70956 removed
ok 99 - git cat-file --batch-check --follow-symlinks works for .. links

expecting success: 
	echo notdir 41 >expect &&
	echo HEAD:dir/subdir/grandparent-dir-link/nope >>expect &&
	echo HEAD:dir/subdir/grandparent-dir-link/nope | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp expect actual &&
	echo HEAD:dir/subdir/grandparent-dir-link | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp found actual &&
	echo HEAD:dir/subdir/parent-dir-link-to-link | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp found actual

ok 18 - read-tree --reset removes outside worktree

expecting success: 
	echo sub >.git/info/sparse-checkout &&
	git checkout -f init &&
	mkdir sub &&
	touch sub/added sub/addedtoo &&
	test_must_fail git checkout top 2>actual &&
	cat >expected <<\EOF &&
error: The following untracked working tree files would be overwritten by checkout:
	sub/added
	sub/addedtoo
Please move or remove them before you can switch branches.
Aborting
EOF
	test_cmp expected actual

Previous HEAD position was de70956... removed
HEAD is now at 2519212... init
Submodule path 'sub1': checked out '913780cd9739c4974f32aaa316af9267f73412c2'
ok 5 - 2-way (1)

ok 19 - print errors when failed to update worktree

Previous HEAD position was 913780c... Base
expecting success: 
	echo "*" >.git/info/sparse-checkout &&
	git checkout -f top &&
	test_path_is_file init.t &&
	echo sub >.git/info/sparse-checkout &&
	git checkout &&
	echo modified >> sub/added &&
	git checkout . &&
	test_path_is_missing init.t &&
	git diff --exit-code HEAD

Switched to branch 'modifications'
ok 100 - git cat-file --batch-check --follow-symlinks works for ../.. links

expecting success: 
	echo dangling 17 >expect &&
	echo HEAD:dirlink/morx >>expect &&
	echo HEAD:dirlink/morx | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp expect actual &&
	echo $hello_sha1 blob $hello_size >expect &&
	echo HEAD:dirlink/ind1 | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp expect actual

rm 'sub1'
Previous HEAD position was 2519212... init
# passed all 5 test(s)
1..5
HEAD is now at 9598e22... modified and added
ok 101 - git cat-file --batch-check --follow-symlinks works for dir/ links

expecting success: 
	echo dangling 20 >expect &&
	echo HEAD:subdirlink/morx >>expect &&
	echo HEAD:subdirlink/morx | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp expect actual &&
	echo HEAD:subdirlink/ind2 | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp found actual

ok 20 - checkout without --ignore-skip-worktree-bits

expecting success: 
	echo "*" >.git/info/sparse-checkout &&
	git checkout -f top &&
	test_path_is_file init.t &&
	echo sub >.git/info/sparse-checkout &&
	git checkout &&
	echo modified >> sub/added &&
	git checkout --ignore-skip-worktree-bits . &&
	test_path_is_file init.t &&
	git diff --exit-code HEAD

*** t1014-read-tree-confusing.sh ***
[replace_sub1_with_directory e238ef0] Replace sub1 with directory
 Author: A U Thor <author@example.com>
 5 files changed, 3 insertions(+), 5 deletions(-)
 delete mode 160000 sub1
 create mode 100644 sub1/file1
 create mode 100644 sub1/file2
 create mode 100644 sub1/file3
HEAD is now at 9598e22... modified and added
ok 102 - git cat-file --batch-check --follow-symlinks works for dir/subdir links

expecting success: 
	echo notdir 27 >expect &&
	echo HEAD:dir/link-to-child/morx >>expect &&
	echo HEAD:dir/link-to-child/morx | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp expect actual &&
	echo HEAD:dir/link-to-child | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp found actual &&
	echo HEAD:link-to-down-link | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp found actual

Switched to a new branch 'replace_directory_with_sub1'
Removing sub1/file3
Removing sub1/file2
Removing sub1/file1
Adding sub1
[replace_directory_with_sub1 4ddd772] Revert "Replace sub1 with directory"
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+), 3 deletions(-)
 delete mode 100644 sub1/file1
 delete mode 100644 sub1/file2
 delete mode 100644 sub1/file3
ok 21 - checkout with --ignore-skip-worktree-bits

# passed all 21 test(s)
1..21
ok 103 - git cat-file --batch-check --follow-symlinks works for dir ->subdir links

expecting success: 
	echo symlink 8 >expect &&
	echo ../fleem >>expect &&
	echo HEAD:out-of-repo-link | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp expect actual &&
	echo symlink 2 >expect &&
	echo .. >>expect &&
	echo HEAD:out-of-repo-link-dir | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp expect actual

Switched to a new branch 'replace_sub1_with_file'
rm 'sub1'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1014-read-tree-confusing/.git/
expecting success: 
	echo content >file &&
	git add file &&
	git commit -m base &&
	blob=$(git rev-parse HEAD:file) &&
	tree=$(git rev-parse HEAD^{tree})

*** t1020-subdirectory.sh ***
[replace_sub1_with_file f2e55ad] Replace sub1 with file
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
ok 104 - git cat-file --batch-check --follow-symlinks works for out-of-repo symlinks

expecting success: 
	echo symlink 9 >expect &&
	echo ../escape >>expect &&
	echo HEAD:dir/out-of-repo-link | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp expect actual &&
	echo symlink 2 >expect &&
	echo .. >>expect &&
	echo HEAD:dir/out-of-repo-link-dir | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp expect actual

Switched to a new branch 'replace_file_with_sub1'
[master (root-commit) 6e3efcd] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 105 - git cat-file --batch-check --follow-symlinks works for out-of-repo symlinks in dirs

expecting success: 
	echo symlink 15 >expect &&
	echo ../great-escape >>expect &&
	echo HEAD:dir/subdir/out-of-repo-link | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp expect actual &&
	echo symlink 2 >expect &&
	echo .. >>expect &&
	echo HEAD:dir/subdir/out-of-repo-link-dir | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp expect actual &&
	echo symlink 3 >expect &&
	echo ../ >>expect &&
	echo HEAD:dir/subdir/out-of-repo-link-dir-trailing | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp expect actual

ok 1 - create base tree

expecting success: 
	git config core.protectHFS true

[replace_file_with_sub1 b6a2c0f] Revert "Replace sub1 with file"
 Author: A U Thor <author@example.com>
 2 files changed, 5 insertions(+), 1 deletion(-)
 mode change 100644 => 160000 sub1
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1020-subdirectory/.git/
ok 2 - enable core.protectHFS for rejection tests

expecting success: 
	git config core.protectNTFS true

Switched to a new branch 'invalid_sub1'
ok 3 - enable core.protectNTFS for rejection tests

expecting success: 
		printf "100644 blob %s\t%s" "$blob" "$path" >tree &&
		bogus=$(git mktree <tree) &&
		test_must_fail git read-tree $bogus
	
expecting success: 
	long="a b c d e f g h i j k l m n o p q r s t u v w x y z" &&
	for c in $long; do echo $c; done >one &&
	mkdir dir &&
	for c in x y z $long a b c; do echo $c; done >dir/two &&
	cp one original.one &&
	cp dir/two original.two

error: Invalid path '.'
[invalid_sub1 b188e19] Invalid sub1 commit
 Author: A U Thor <author@example.com>
ok 4 - reject . at end of path

expecting success: 
		printf "040000 tree %s\t%s" "$tree" "$path" >tree &&
		bogus=$(git mktree <tree) &&
		test_must_fail git read-tree $bogus
	
ok 106 - git cat-file --batch-check --follow-symlinks works for out-of-repo symlinks in subdirs

expecting success: 
	echo HEAD: | git cat-file --batch-check >expect &&
	echo HEAD:up-down | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp expect actual &&
	echo HEAD:up-down-trailing | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp expect actual &&
	echo HEAD:up-down-file | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp found actual &&
	echo symlink 7 >expect &&
	echo ../morx >>expect &&
	echo HEAD:up-up-down-file | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp expect actual &&
	echo HEAD:up-two-down-file | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp found actual

ok 1 - setup

expecting success: 
	git update-index --add one &&
	case "$(git ls-files)" in
	one) echo pass one ;;
	*) echo bad one; exit 1 ;;
	esac &&
	(
		cd dir &&
		git update-index --add two &&
		case "$(git ls-files)" in
		two) echo pass two ;;
		*) echo bad two; exit 1 ;;
		esac
	) &&
	case "$(git ls-files)" in
	dir/two"$LF"one) echo pass both ;;
	*) echo bad; exit 1 ;;
	esac

Switched to a new branch 'valid_sub1'
error: Invalid path './file'
ok 5 - reject . as subtree

expecting success: 
		printf "100644 blob %s\t%s" "$blob" "$path" >tree &&
		bogus=$(git mktree <tree) &&
		test_must_fail git read-tree $bogus
	
pass one
error: Invalid path '..'
pass two
ok 6 - reject .. at end of path

expecting success: 
		printf "040000 tree %s\t%s" "$tree" "$path" >tree &&
		bogus=$(git mktree <tree) &&
		test_must_fail git read-tree $bogus
	
[valid_sub1 82289da] Revert "Invalid sub1 commit"
 Author: A U Thor <author@example.com>
pass both
ok 2 - update-index and ls-files

expecting success: 
	two=$(git ls-files -s dir/two) &&
	two=$(expr "$two" : "[0-7]* \\([0-9a-f]*\\)") &&
	echo "$two" &&
	git cat-file -p "$two" >actual &&
	cmp dir/two actual &&
	(
		cd dir &&
		git cat-file -p "$two" >actual &&
		cmp two actual
	)

Switched to branch 'master'
c1144d0671912dd26751c1fbf1eac57a907f82c7
error: Invalid path '../file'
ok 7 - reject .. as subtree

expecting success: 
		printf "100644 blob %s\t%s" "$blob" "$path" >tree &&
		bogus=$(git mktree <tree) &&
		test_must_fail git read-tree $bogus
	
error: Invalid path '.git'
ok 8 - reject .git at end of path

expecting success: 
		printf "040000 tree %s\t%s" "$tree" "$path" >tree &&
		bogus=$(git mktree <tree) &&
		test_must_fail git read-tree $bogus
	
ok 107 - git cat-file --batch-check --follow-symlinks works for symlinks with internal ..

expecting success: 
	echo loop 10 >expect &&
	echo HEAD:loop1 >>expect &&
	echo HEAD:loop1 | git cat-file --batch-check --follow-symlinks >actual &&
	test_cmp expect actual

ok 3 - cat-file

Cloning into 'submodule_update'...
expecting success: 
	echo a >>one &&
	echo d >>dir/two &&
	case "$(git diff-files --name-only)" in
	dir/two"$LF"one) echo pass top ;;
	*) echo bad top; exit 1 ;;
	esac &&
	# diff should not omit leading paths
	(
		cd dir &&
		case "$(git diff-files --name-only)" in
		dir/two"$LF"one) echo pass subdir ;;
		*) echo bad subdir; exit 1 ;;
		esac &&
		case "$(git diff-files --name-only .)" in
		dir/two) echo pass subdir limited ;;
		*) echo bad subdir limited; exit 1 ;;
		esac
	)

ok 108 - git cat-file --batch-check --follow-symlink breaks loops

expecting success: 
	echo HEAD:morx | git cat-file --batch >expect &&
	echo HEAD:morx | git cat-file --batch --follow-symlinks >actual &&
	test_cmp expect actual

pass top
error: Invalid path '.git/file'
ok 9 - reject .git as subtree

expecting success: 
		printf "100644 blob %s\t%s" "$blob" "$path" >tree &&
		bogus=$(git mktree <tree) &&
		test_must_fail git read-tree $bogus
	
pass subdir
pass subdir limited
ok 4 - diff-files

expecting success: 
	top=$(git write-tree) &&
	echo $top &&
	(
		cd dir &&
		sub=$(git write-tree) &&
		echo $sub &&
		test "z$top" = "z$sub"
	)

done.
error: Invalid path '.GIT'
ok 10 - reject .GIT at end of path

expecting success: 
		printf "040000 tree %s\t%s" "$tree" "$path" >tree &&
		bogus=$(git mktree <tree) &&
		test_must_fail git read-tree $bogus
	
ok 109 - git cat-file --batch --follow-symlink returns correct sha and mode

cf1e35b43464cccd320d58a813e14e25fa36b1d7
# passed all 109 test(s)
1..109
cf1e35b43464cccd320d58a813e14e25fa36b1d7
error: Invalid path '.GIT/file'
ok 5 - write-tree

expecting success: 
	git checkout-index -f -u one &&
	cmp one original.one &&
	(
		cd dir &&
		git checkout-index -f -u two &&
		cmp two ../original.two
	)

ok 11 - reject .GIT as subtree

expecting success: 
		printf "100644 blob %s\t%s" "$blob" "$path" >tree &&
		bogus=$(git mktree <tree) &&
		test_must_fail git read-tree $bogus
	
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
error: Invalid path '‌.Git'
ok 12 - reject {u200c}.Git at end of path

expecting success: 
		printf "040000 tree %s\t%s" "$tree" "$path" >tree &&
		bogus=$(git mktree <tree) &&
		test_must_fail git read-tree $bogus
	
Branch add_sub1 set up to track remote branch add_sub1 from origin.
error: Invalid path '‌.Git/file'
ok 13 - reject {u200c}.Git as subtree

expecting success: 
		printf "100644 blob %s\t%s" "$blob" "$path" >tree &&
		bogus=$(git mktree <tree) &&
		test_must_fail git read-tree $bogus
	
*** t1021-rerere-in-workdir.sh ***
ok 6 - checkout-index

expecting success: 
	rm -f one dir/two &&
	tree=$(git write-tree) &&
	read_tree_u_must_succeed --reset -u "$tree" &&
	cmp one original.one &&
	cmp dir/two original.two &&
	(
		cd dir &&
		rm -f two &&
		read_tree_u_must_succeed --reset -u "$tree" &&
		cmp two ../original.two &&
		cmp ../one ../original.one
	)

error: Invalid path '.gI‌T'
ok 14 - reject .gI{u200c}T at end of path

expecting success: 
		printf "040000 tree %s\t%s" "$tree" "$path" >tree &&
		bogus=$(git mktree <tree) &&
		test_must_fail git read-tree $bogus
	
error: Invalid path '.gI‌T/file'
ok 15 - reject .gI{u200c}T as subtree

expecting success: 
		printf "100644 blob %s\t%s" "$blob" "$path" >tree &&
		bogus=$(git mktree <tree) &&
		test_must_fail git read-tree $bogus
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1021-rerere-in-workdir/.git/
checking prerequisite: SYMLINKS

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	# test whether the filesystem supports symbolic links
	ln -s x y && test -h y

)
error: Invalid path '.GiT‌'
ok 16 - reject .GiT{u200c} at end of path

expecting success: 
		printf "040000 tree %s\t%s" "$tree" "$path" >tree &&
		bogus=$(git mktree <tree) &&
		test_must_fail git read-tree $bogus
	
prerequisite SYMLINKS ok
expecting success: 
	git config rerere.enabled true &&
	>world &&
	git add world &&
	test_tick &&
	git commit -m initial &&

	echo hello >world &&
	test_tick &&
	git commit -a -m hello &&

	git checkout -b side HEAD^ &&
	echo goodbye >world &&
	test_tick &&
	git commit -a -m goodbye &&

	git checkout master

error: Invalid path '.GiT‌/file'
ok 17 - reject .GiT{u200c} as subtree

expecting success: 
		printf "100644 blob %s\t%s" "$blob" "$path" >tree &&
		bogus=$(git mktree <tree) &&
		test_must_fail git read-tree $bogus
	
error: Invalid path 'git~1'
ok 18 - reject git~1 at end of path

expecting success: 
		printf "040000 tree %s\t%s" "$tree" "$path" >tree &&
		bogus=$(git mktree <tree) &&
		test_must_fail git read-tree $bogus
	
[master (root-commit) 21975ff] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 world
[master 02943d2] hello
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
error: Invalid path 'git~1/file'
ok 19 - reject git~1 as subtree

expecting success: 
		printf "100644 blob %s\t%s" "$blob" "$path" >tree &&
		bogus=$(git mktree <tree) &&
		test_must_fail git read-tree $bogus
	
Switched to a new branch 'side'
error: Invalid path '.git. '
ok 20 - reject .git.{space} at end of path

expecting success: 
		printf "040000 tree %s\t%s" "$tree" "$path" >tree &&
		bogus=$(git mktree <tree) &&
		test_must_fail git read-tree $bogus
	
[side 5611ff9] goodbye
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
error: Invalid path '.git. /file'
ok 21 - reject .git.{space} as subtree

expecting success: 
		printf "100644 blob %s\t%s" "$blob" "$path" >tree &&
		bogus=$(git mktree <tree) &&
		test_must_fail git read-tree $bogus
	
Switched to branch 'master'
ok 1 - setup

ok 7 - read-tree

expecting success: 
	(
		git config alias.test-status-alias status &&
		cd dir &&
		git status &&
		git test-status-alias
	)

expecting success: 
	rm -rf .git/rr-cache &&
	"$SHELL_PATH" "$TEST_DIRECTORY/../contrib/workdir/git-new-workdir" . work &&
	(
		cd work &&
		test_must_fail git merge side &&
		git rerere status >actual &&
		echo world >expect &&
		test_cmp expect actual
	)

error: Invalid path '.\.GIT\foobar'
ok 22 - reject backslashes at end of path

expecting success: 
		printf "040000 tree %s\t%s" "$tree" "$path" >tree &&
		bogus=$(git mktree <tree) &&
		test_must_fail git read-tree $bogus
	
On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   two
	new file:   ../one

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	post-dry-run
	post-dry-run-wt
	pre-dry-run
	pre-dry-run-wt
	../original.one
	../original.two
	../post-dry-run
	../post-dry-run-wt
	../pre-dry-run
	../pre-dry-run-wt

On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   two
	new file:   ../one

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	post-dry-run
	post-dry-run-wt
	pre-dry-run
	pre-dry-run-wt
	../original.one
	../original.two
	../post-dry-run
	../post-dry-run-wt
	../pre-dry-run
	../pre-dry-run-wt

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
error: Invalid path '.\.GIT\foobar/file'
ok 23 - reject backslashes as subtree

ok 8 - alias expansion

expecting success: 
		printf "100644 blob %s\t%s" "$blob" "$path" >tree &&
		bogus=$(git mktree <tree) &&
		test_must_fail git read-tree $bogus
	
expecting success: 
	pwd >expect &&
	(
		git config alias.test-alias-directory !pwd &&
		cd dir &&
		git test-alias-directory >../actual
	) &&
	test_cmp expect actual

error: Invalid path '.git\foobar'
ok 24 - reject backslashes2 at end of path

expecting success: 
		printf "040000 tree %s\t%s" "$tree" "$path" >tree &&
		bogus=$(git mktree <tree) &&
		test_must_fail git read-tree $bogus
	
ok 9 - !alias expansion

expecting success: 
	printf "dir/" >expect &&
	(
		git config alias.test-alias-directory "!sh -c \"printf \$GIT_PREFIX\"" &&
		cd dir &&
		git test-alias-directory >../actual
	) &&
	test_cmp expect actual

error: Invalid path '.git\foobar/file'
ok 25 - reject backslashes2 as subtree

expecting success: 
	test_when_finished "git read-tree HEAD" &&
	test_config core.protectHFS false &&
	printf "100644 blob %s\t%s" "$blob" ".gi${u200c}t" >tree &&
	ok=$(git mktree <tree) &&
	git read-tree $ok

Recorded preimage for 'world'
Merging:
02943d2 hello
virtual side
found 1 common ancestor:
21975ff initial
Auto-merging world
CONFLICT (content): Merge conflict in world
Automatic merge failed; fix conflicts and then commit the result.
ok 10 - GIT_PREFIX for !alias

expecting success: 
	# Use GIT_EXTERNAL_DIFF to test that the "diff" built-in
	# receives the GIT_PREFIX variable.
	printf "dir/" >expect &&
	printf "#!/bin/sh\n" >diff &&
	printf "printf \"\$GIT_PREFIX\"" >>diff &&
	chmod +x diff &&
	(
		cd dir &&
		printf "change" >two &&
		GIT_EXTERNAL_DIFF=./diff git diff >../actual
		git checkout -- two
	) &&
	test_cmp expect actual

ok 2 - rerere in workdir

checking known breakage: 
	rm -rf .git/rr-cache &&
	"$SHELL_PATH" "$TEST_DIRECTORY/../contrib/workdir/git-new-workdir" . krow &&
	(
		cd krow &&
		rm -f .git/rr-cache &&
		ln -s ../.git/rr-cache .git/rr-cache &&
		test_must_fail git merge side &&
		git rerere status >actual &&
		echo world >expect &&
		test_cmp expect actual
	)

Cloning into 'sub1'...
ok 11 - GIT_PREFIX for built-ins

expecting success: 
	git commit -a -m 1 &&
	(
		cd .git &&
		git show -s HEAD
	)

ok 26 - utf-8 paths allowed with core.protectHFS off

# passed all 26 test(s)
1..26
[master (root-commit) 1d2f5e6] 1
 Author: A U Thor <author@example.com>
 2 files changed, 58 insertions(+)
 create mode 100644 dir/two
 create mode 100644 one
commit 1d2f5e68c94bc6f73f718d235a305bdca7da2a31
Author: A U Thor <author@example.com>
Date:   Sat Aug 8 04:36:10 2015 +0000

    1
ok 12 - no file/rev ambiguity check inside .git

expecting success: 
	test_when_finished "rm -fr foo.git" &&
	git clone -s --bare .git foo.git &&
	(
		cd foo.git &&
		# older Git needed help by exporting GIT_DIR=.
		# to realize that it is inside a bare repository.
		# We keep this test around for regression testing.
		GIT_DIR=. git show -s HEAD
	)

done.
Cloning into bare repository 'foo.git'...
*** t1050-large.sh ***
done.
commit 1d2f5e68c94bc6f73f718d235a305bdca7da2a31
Author: A U Thor <author@example.com>
Date:   Sat Aug 8 04:36:10 2015 +0000

    1
ok 13 - no file/rev ambiguity check inside a bare repo (explicit GIT_DIR)

expecting success: 
	test_when_finished "rm -fr foo.git" &&
	git clone -s --bare .git foo.git &&
	(
		cd foo.git &&
		git show -s HEAD
	)

fatal: Could not create directory .git/rr-cache
Merging:
02943d2 hello
virtual side
found 1 common ancestor:
21975ff initial
Auto-merging world
CONFLICT (content): Merge conflict in world
Cloning into bare repository 'foo.git'...
fatal: Could not create directory .git/rr-cache
not ok 3 - rerere in workdir (relative) # TODO known breakage

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1050-large/.git/
# still have 1 known breakage(s)
# passed all remaining 2 test(s)
1..3
expecting success: 
	# clone does not allow us to pass core.bigfilethreshold to
	# new repos, so set core.bigfilethreshold globally
	git config --global core.bigfilethreshold 200k &&
	printf "%2000000s" X >large1 &&
	cp large1 large2 &&
	cp large1 large3 &&
	printf "%2500000s" Y >huge &&
	GIT_ALLOC_LIMIT=1500k &&
	export GIT_ALLOC_LIMIT

done.
commit 1d2f5e68c94bc6f73f718d235a305bdca7da2a31
Author: A U Thor <author@example.com>
Date:   Sat Aug 8 04:36:10 2015 +0000

    1
*** t1051-large-conversion.sh ***
ok 14 - no file/rev ambiguity check inside a bare repo

checking prerequisite: SYMLINKS

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	# test whether the filesystem supports symbolic links
	ln -s x y && test -h y

)
prerequisite SYMLINKS ok
expecting success: 
	git clone -s .git another &&
	ln -s another yetanother &&
	(
		cd yetanother/.git &&
		git show -s HEAD
	)

Submodule path 'sub1': checked out '913780cd9739c4974f32aaa316af9267f73412c2'
Cloning into 'another'...
done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1051-large-conversion/.git/
expecting success: 
	printf "\$Id: foo\$\\r\\n" >small &&
	cat small small >large &&
	git config core.bigfilethreshold 20 &&
	git config filter.test.clean "sed s/.*/CLEAN/"

commit 1d2f5e68c94bc6f73f718d235a305bdca7da2a31
Author: A U Thor <author@example.com>
Date:   Sat Aug 8 04:36:10 2015 +0000

    1
ok 15 - detection should not be fooled by a symlink

ok 1 - setup input tests

expecting success: 
	test_config core.autocrlf true &&
	check_input

# passed all 15 test(s)
1..15
ok 1 - setup

expecting success: 
	git add large1 huge large2 &&
	# make sure we got a single packfile and no loose objects
	bad= count=0 idx= &&
	for p in .git/objects/pack/pack-*.pack
	do
		count=$(( $count + 1 ))
		if test -f "$p" && idx=${p%.pack}.idx && test -f "$idx"
		then
			continue
		fi
		bad=t
	done &&
	test -z "$bad" &&
	test $count = 1 &&
	cnt=$(git show-index <"$idx" | wc -l) &&
	test $cnt = 2 &&
	for l in .git/objects/??/??????????????????????????????????????
	do
		test -f "$l" || continue
		bad=t
	done &&
	test -z "$bad" &&

	# attempt to add another copy of the same
	git add large3 &&
	bad= count=0 &&
	for p in .git/objects/pack/pack-*.pack
	do
		count=$(( $count + 1 ))
		if test -f "$p" && idx=${p%.pack}.idx && test -f "$idx"
		then
			continue
		fi
		bad=t
	done &&
	test -z "$bad" &&
	test $count = 1

*** t1060-object-corruption.sh ***
ok 1 - git read-tree -u -m: added submodule creates empty directory

expecting success: 
		prolog &&
		reset_work_tree_to no_submodule &&
		(
			cd submodule_update &&
			mkdir sub1 &&
			git branch -t add_sub1 origin/add_sub1 &&
			$command add_sub1 &&
			test_superproject_content origin/add_sub1 &&
			test_dir_is_empty sub1 &&
			git submodule update --init --recursive &&
			test_submodule_content sub1 origin/add_sub1
		)
	
ok 2 - autocrlf=true converts on input

expecting success: 
	set_attr eol=crlf &&
	check_input

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1060-object-corruption/.git/
expecting success: 
	git init bit-error &&
	(
		cd bit-error &&
		test_commit content &&
		corrupt_byte HEAD:content.t 10
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1060-object-corruption/bit-error/.git/
ok 3 - eol=crlf converts on input

Cloning into 'submodule_update'...
expecting success: 
	set_attr ident &&
	check_input

[master (root-commit) 0df6d69] content
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 content.t
done.
1+0 records in
1+0 records out
1 byte (1 B) copied, 0.00224167 s, 0.4 kB/s
ok 1 - setup corrupt repo

expecting success: 
	git init missing &&
	(
		cd missing &&
		test_commit content &&
		rm -f "$(obj_to_file HEAD:content.t)"
	)

ok 4 - ident converts on input

expecting success: 
	set_attr filter=test &&
	check_input

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1060-object-corruption/missing/.git/
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
[master (root-commit) 0df6d69] content
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 content.t
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 5 - user-defined filters convert on input

expecting success: 
	echo "\$Id\$" >small &&
	cat small small >large &&
	git add small large &&
	git config core.bigfilethreshold 7 &&
	git config filter.test.smudge "sed s/.*/SMUDGE/"

ok 2 - setup repo with missing object

expecting success: 
	git init misnamed &&
	(
		cd misnamed &&
		test_commit content &&
		good=$(obj_to_file HEAD:content.t) &&
		blob=$(echo corrupt | git hash-object -w --stdin) &&
		bad=$(obj_to_file $blob) &&
		rm -f "$good" &&
		mv "$bad" "$good"
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1060-object-corruption/misnamed/.git/
ok 6 - setup output tests

expecting success: 
	test_config core.autocrlf true &&
	check_output

[master (root-commit) 0df6d69] content
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 content.t
ok 7 - autocrlf=true converts on output

expecting success: 
	set_attr eol=crlf &&
	check_output

ok 8 - eol=crlf converts on output

expecting success: 
	set_attr filter=test &&
	check_output

ok 3 - setup repo with misnamed object

expecting success: 
	(
		cd bit-error &&
		test_must_fail git cat-file blob HEAD:content.t
	)

error: inflate: data stream error (invalid distance too far back)
error: unable to unpack d95f3ad14dee633a758d2e331151e950dd13e4ed header
error: inflate: data stream error (invalid distance too far back)
error: unable to unpack d95f3ad14dee633a758d2e331151e950dd13e4ed header
error: inflate: data stream error (invalid distance too far back)
fatal: loose object d95f3ad14dee633a758d2e331151e950dd13e4ed (stored in .git/objects/d9/5f3ad14dee633a758d2e331151e950dd13e4ed) is corrupt
ok 4 - streaming a corrupt blob fails

expecting success: 
	(
		cd bit-error &&
		rm -f content.t &&
		test_must_fail git read-tree --reset -u HEAD
	)

error: inflate: data stream error (invalid distance too far back)
error: unable to unpack d95f3ad14dee633a758d2e331151e950dd13e4ed header
error: inflate: data stream error (invalid distance too far back)
error: inflate: data stream error (invalid distance too far back)
fatal: loose object d95f3ad14dee633a758d2e331151e950dd13e4ed (stored in .git/objects/d9/5f3ad14dee633a758d2e331151e950dd13e4ed) is corrupt
ok 9 - user-defined filters convert on output

expecting success: 
	set_attr ident &&
	rm -f small large &&
	git checkout small large &&
	sed -n "s/Id: .*/Id: SHA/p" <small >small.clean &&
	head -n 1 large >large.head &&
	sed -n "s/Id: .*/Id: SHA/p" <large.head >large.clean &&
	test_cmp small.clean large.clean

ok 5 - read-tree -u detects bit-errors in blobs

expecting success: 
	(
		cd missing &&
		rm -f content.t &&
		test_must_fail git read-tree --reset -u HEAD
	)

error: unable to read sha1 file of content.t (d95f3ad14dee633a758d2e331151e950dd13e4ed)
ok 6 - read-tree -u detects missing objects

expecting success: 
	test_must_fail git clone --no-local --bare bit-error corrupt-transport

Cloning into bare repository 'corrupt-transport'...
ok 10 - ident converts on output

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
# passed all 10 test(s)
1..10
remote: error: inflate: data stream error (invalid distance too far back)        
remote: error: unable to unpack d95f3ad14dee633a758d2e331151e950dd13e4ed header        
*** t1100-commit-tree-options.sh ***
remote: error: inflate: data stream error (invalid distance too far back)        
remote: fatal: loose object d95f3ad14dee633a758d2e331151e950dd13e4ed (stored in ./objects/d9/5f3ad14dee633a758d2e331151e950dd13e4ed) is corrupt        
error: git upload-pack: git-pack-objects died with error.
fatal: git upload-pack: aborting due to possible repository corruption on the remote side.
remote: aborting due to possible repository corruption on the remote side.
fatal: early EOF
fatal: index-pack failed
ok 7 - clone --no-local --bare detects corruption

expecting success: 
	test_must_fail git clone --no-local --bare missing missing-transport

Cloning into bare repository 'missing-transport'...
remote: fatal: unable to read d95f3ad14dee633a758d2e331151e950dd13e4ed        
error: git upload-pack: git-pack-objects died with error.
fatal: git upload-pack: aborting due to possible repository corruption on the remote side.
remote: aborting due to possible repository corruption on the remote side.
fatal: early EOF
Cloning into 'sub1'...
fatal: index-pack failed
ok 8 - clone --no-local --bare detects missing object

expecting success: 
	test_must_fail git clone --no-local --bare misnamed misnamed-transport

Cloning into bare repository 'misnamed-transport'...
ok 2 - add a large file or two

expecting success: 
	large1=$(git rev-parse :large1) &&
	git update-index --add --cacheinfo 100644 $large1 another &&
	git checkout another &&
	test_cmp large1 another

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1100-commit-tree-options/.git/
done.
expecting success: git write-tree >treeid
fatal: did not receive expected object d95f3ad14dee633a758d2e331151e950dd13e4ed
fatal: index-pack failed
ok 1 - test preparation: write empty tree

expecting success: echo comment text |
     GIT_AUTHOR_NAME="Author Name" \
     GIT_AUTHOR_EMAIL="author@email" \
     GIT_AUTHOR_DATE="2005-05-26 23:00" \
     GIT_COMMITTER_NAME="Committer Name" \
     GIT_COMMITTER_EMAIL="committer@email" \
     GIT_COMMITTER_DATE="2005-05-26 23:30" \
     TZ=GMT git commit-tree `cat treeid` >commitid 2>/dev/null
ok 9 - clone --no-local --bare detects misnamed object

expecting success: 
	test_must_fail git clone --local bit-error corrupt-checkout

Cloning into 'corrupt-checkout'...
ok 2 - construct commit

expecting success: git cat-file commit `cat commitid` >commit
done.
error: inflate: data stream error (invalid distance too far back)
error: unable to unpack d95f3ad14dee633a758d2e331151e950dd13e4ed header
error: inflate: data stream error (invalid distance too far back)
error: inflate: data stream error (invalid distance too far back)
fatal: loose object d95f3ad14dee633a758d2e331151e950dd13e4ed (stored in .git/objects/d9/5f3ad14dee633a758d2e331151e950dd13e4ed) is corrupt
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'

ok 3 - read commit

expecting success: test_cmp expected commit
ok 10 - clone --local detects corruption

expecting success: 
	test_path_is_dir corrupt-checkout/.git

ok 11 - error detected during checkout leaves repo intact

expecting success: 
	test_must_fail git clone --local missing missing-checkout

ok 4 - compare commit

expecting success: 
	test_tick &&
	echo comment text |
	git commit-tree $(cat treeid) >commitid &&
	echo comment text |
	git commit-tree $(cat treeid) -p $(cat commitid) >childid-1 &&
	echo comment text |
	git commit-tree -p $(cat commitid) $(cat treeid) >childid-2 &&
	test_cmp childid-1 childid-2 &&
	git commit-tree $(cat treeid) -m foo >childid-3 &&
	git commit-tree -m foo $(cat treeid) >childid-4 &&
	test_cmp childid-3 childid-4

Cloning into 'missing-checkout'...
done.
ok 3 - checkout a large file

expecting success: 
	test_create_repo mid &&
	(
		cd mid &&
		git config core.bigfilethreshold 64k &&
		git config pack.packsizelimit 256k &&

		# mid1 and mid2 will fit within 256k limit but
		# appending mid3 will bust the limit and will
		# result in a separate packfile.
		test-genrandom "a" $(( 66 * 1024 )) >mid1 &&
		test-genrandom "b" $(( 80 * 1024 )) >mid2 &&
		test-genrandom "c" $(( 128 * 1024 )) >mid3 &&
		git add mid1 mid2 mid3 &&

		count=0
		for pi in .git/objects/pack/pack-*.idx
		do
			test -f "$pi" && count=$(( $count + 1 ))
		done &&
		test $count = 2 &&

		(
			git hash-object --stdin <mid1
			git hash-object --stdin <mid2
			git hash-object --stdin <mid3
		) |
		sort >expect &&

		for pi in .git/objects/pack/pack-*.idx
		do
			git show-index <"$pi"
		done |
		sed -e "s/^[0-9]* \([0-9a-f]*\) .*/\1/" |
		sort >actual &&

		test_cmp expect actual
	)

error: unable to read sha1 file of content.t (d95f3ad14dee633a758d2e331151e950dd13e4ed)
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'

ok 12 - clone --local detects missing objects

checking known breakage: 
	test_must_fail git clone --local misnamed misnamed-checkout

Submodule path 'sub1': checked out '913780cd9739c4974f32aaa316af9267f73412c2'
Cloning into 'misnamed-checkout'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1050-large/mid/.git/
done.
ok 5 - flags and then non flags

test_must_fail: command succeeded: git clone --local misnamed misnamed-checkout
not ok 13 - clone --local detects misnamed objects # TODO known breakage

# passed all 5 test(s)
1..5
# still have 1 known breakage(s)
# passed all remaining 12 test(s)
1..13
*** t1200-tutorial.sh ***
ok 2 - git read-tree -u -m: added submodule leaves existing empty directory alone

expecting success: 
		prolog &&
		reset_work_tree_to no_submodule &&
		(
			cd submodule_update &&
			git branch -t add_sub1 origin/add_sub1 &&
			>sub1 &&
			test_must_fail $command add_sub1 &&
			test_superproject_content origin/no_submodule &&
			test_must_be_empty sub1
		)
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1200-tutorial/.git/
expecting success: 
	echo "Hello World" > hello &&
	echo "Silly example" > example &&

	git update-index --add hello example &&

	test blob = "$(git cat-file -t 557db03)"

*** t1300-repo-config.sh ***
ok 1 - blob

expecting success: 
	test "Hello World" = "$(git cat-file blob 557db03)"

ok 2 - blob 557db03

expecting success: 
	git diff-files -p > diff.output &&
	test_cmp diff.expect diff.output

ok 3 - git diff-files -p

expecting success: 
	git diff > diff.output &&
	test_cmp diff.expect diff.output

Cloning into 'submodule_update'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1300-repo-config/.git/
ok 4 - git diff

expecting success: 
	tree=$(git write-tree 2>/dev/null) &&
	test 8988da15d077d4829fc51d8544c097def6644dbb = $tree

expecting success: 
	rm -f .git/config

ok 1 - clear default config

ok 5 - tree

expecting success: 
	test_tick &&
	tree=$(git write-tree) &&
	commit=$(echo "Initial commit" | git commit-tree $tree) &&
	git update-ref HEAD $commit &&
	git diff-index -p HEAD > diff.output &&
	test_cmp diff.expect diff.output

expecting success: 
	git config core.penguin "little blue" &&
	test_cmp expect .git/config

done.
ok 2 - initial

expecting success: 
	git config Core.Movie BadPhysics &&
	test_cmp expect .git/config

Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
ok 3 - mixed case

expecting success: 
	git config Cores.WhatEver Second &&
	test_cmp expect .git/config

ok 6 - git diff-index -p HEAD

expecting success: 
	git diff HEAD > diff.output &&
	test_cmp diff.expect diff.output

ok 4 - similar section

expecting success: 
	git config CORE.UPPERCASE true &&
	test_cmp expect .git/config

ok 7 - git diff HEAD

ok 5 - uppercase section

expecting success: 
	git config core.penguin kingpin !blue

expecting success: 
	git whatchanged -p --root |
		sed -e "1s/^\(.\{7\}\).\{40\}/\1VARIABLE/" \
		-e "2,3s/^\(.\{8\}\).*$/\1VARIABLE/" \
	> whatchanged.output &&
	test_cmp whatchanged.expect whatchanged.output

ok 6 - replace with non-match

expecting success: 
	git config core.penguin "very blue" !kingpin

Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 7 - replace with non-match (actually matching)

expecting success: test_cmp expect .git/config
ok 8 - git whatchanged -p --root

expecting success: 
	git tag my-first-tag &&
	test_cmp .git/refs/heads/master .git/refs/tags/my-first-tag

error: Untracked working tree file 'sub1' would be overwritten by merge.
ok 8 - non-match result

expecting success: 
	echo Second >expect &&
	git config cores.whatever >actual &&
	test_cmp expect actual

ok 9 - find mixed-case key by canonical name

ok 9 - git tag my-first-tag

expecting success: 
	echo Second >expect &&
	git config CoReS.WhAtEvEr >actual &&
	test_cmp expect actual

expecting success: 
	git checkout -b mybranch &&
	test_cmp .git/refs/heads/master .git/refs/heads/mybranch

Switched to a new branch 'mybranch'
M	hello
ok 10 - find mixed-case key by non-canonical name

expecting success: 
	cat >>.git/config <<-\EOF &&
	[section.SubSection]
	key = one
	[section "SubSection"]
	key = two
	EOF
	echo one >expect &&
	git config section.subsection.key >actual &&
	test_cmp expect actual &&
	echo two >expect &&
	git config section.SubSection.key >actual &&
	test_cmp expect actual

ok 10 - git checkout -b mybranch

expecting success: 
	git branch > branch.output &&
	test_cmp branch.expect branch.output

ok 3 - git read-tree -u -m: added submodule doesn't remove untracked unignored file with same name

expecting success: 
		prolog &&
		reset_work_tree_to replace_sub1_with_file &&
		(
			cd submodule_update &&
			git branch -t replace_file_with_sub1 origin/replace_file_with_sub1 &&
			$command replace_file_with_sub1 &&
			test_superproject_content origin/replace_file_with_sub1 &&
			test_dir_is_empty sub1 &&
			git submodule update --init --recursive &&
			test_submodule_content sub1 origin/replace_file_with_sub1
		)
	
ok 11 - git branch

expecting success: 
	git checkout mybranch &&
	echo "Work, work, work" >>hello &&
	test_tick &&
	git commit -m "Some work." -i hello &&

	git checkout master &&

	echo "Play, play, play" >>hello &&
	echo "Lots of fun" >>example &&
	test_tick &&
	git commit -m "Some fun." -i hello example &&

	test_must_fail git merge -m "Merge work in mybranch" mybranch

ok 11 - subsections are not canonicalized by git-config

Already on 'mybranch'
M	hello
expecting success: 
	git config --unset beta.baz

[mybranch 9014374] Some work.
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+)
ok 12 - unset with cont. lines

expecting success: test_cmp expect .git/config
Switched to branch 'master'
ok 13 - unset with cont. lines is correct

Cloning into 'submodule_update'...
expecting success: 
	git config --unset-all beta.haha

ok 14 - multiple unset

expecting success: 
	test_cmp expect .git/config

[master ab01a1a] Some fun.
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
ok 15 - multiple unset is correct

expecting success: 
	test_must_fail git config --replace-all beta.haha &&
	test_cmp .git/config2 .git/config

Merging:
ab01a1a Some fun.
virtual mybranch
found 1 common ancestor:
6758fe8 Initial commit
Auto-merging hello
CONFLICT (content): Merge conflict in hello
Automatic merge failed; fix conflicts and then commit the result.
ok 4 - packsize limit

expecting success: 
	git commit -q -m initial &&
	echo modified >>large1 &&
	git add large1 &&
	git commit -q -m modified &&
	git diff --raw HEAD^

ok 12 - git resolve now fails

error: wrong number of arguments
usage: git config [<options>]

Config file location
    --global              use global config file
    --system              use system config file
    --local               use repository config file
    -f, --file <file>     use given config file
    --blob <blob-id>      read config from given blob object

Action
    --get                 get value: name [value-regex]
    --get-all             get all values: key [value-regex]
    --get-regexp          get values for regexp: name-regex [value-regex]
    --get-urlmatch        get value specific for the URL: section[.var] URL
    --replace-all         replace all matching variables: name value [value_regex]
    --add                 add a new variable: name value
    --unset               remove a variable: name [value-regex]
    --unset-all           remove all matches: name [value-regex]
    --rename-section      rename section: old-name new-name
    --remove-section      remove a section: name
    -l, --list            list all
    -e, --edit            open an editor
    --get-color           find the color configured: slot [default]
    --get-colorbool       find the color setting: slot [stdout-is-tty]

Type
    --bool                value is "true" or "false"
    --int                 value is decimal number
    --bool-or-int         value is --bool or --int
    --path                value is a path (file or directory name)

Other
    -z, --null            terminate values with NUL byte
    --includes            respect include directives on lookup

done.
ok 16 - --replace-all missing value

expecting success: 
	git config --replace-all beta.haha gamma

expecting success: 
	test_tick &&
	git commit -m "Merge work in mybranch" -i hello &&
	git show-branch --topo-order --more=1 master mybranch \
		> show-branch.output &&
	test_cmp show-branch.expect show-branch.output

ok 17 - --replace-all

expecting success: 
	test_cmp expect .git/config

[master 062f127] Merge work in mybranch
 Author: A U Thor <author@example.com>
ok 18 - all replaced

expecting success: 
	git config beta.haha alpha &&
	test_cmp expect .git/config

Switched to a new branch 'replace_sub1_with_file'
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
ok 13 - git show-branch

expecting success: 
	git checkout mybranch &&
	git merge -m "Merge upstream changes." master |
		sed -e "1s/[0-9a-f]\{7\}/VARIABLE/g" \
		-e "s/^Fast[- ]forward /FASTFORWARD /" >resolve.output

ok 19 - really mean test

expecting success: 
	git config nextsection.nonewline wow &&
	test_cmp expect .git/config

Switched to branch 'mybranch'
ok 20 - really really mean test

expecting success: 
	echo alpha >expect &&
	git config beta.haha >actual &&
	test_cmp expect actual

t1013-read-tree-submodule.sh: 159: cd: can't cd to sub1
ok 21 - get value

expecting success: 
	git config --unset beta.haha &&
	test_cmp expect .git/config

Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
ok 14 - git resolve

expecting success: 
	test_i18ncmp resolve.expect resolve.output

ok 22 - unset

ok 15 - git resolve output

expecting success: 
	git config nextsection.NoNewLine "wow2 for me" "for me$" &&
	test_cmp expect .git/config

expecting success: 
	git show-branch --topo-order master mybranch > show-branch2.output &&
	test_cmp show-branch2.expect show-branch2.output

ok 23 - multivar

expecting success: 
	git config --get nextsection.nonewline !for

ok 16 - git show-branch (part 2)

wow
ok 24 - non-match

expecting success: 
	echo wow >expect &&
	git config --get nextsection.nonewline !for >actual &&
	test_cmp expect actual

expecting success: 
	git show-branch --topo-order --more=2 master mybranch \
		> show-branch3.output &&
	test_cmp show-branch3.expect show-branch3.output

ok 25 - non-match value

expecting success: 
	echo "wow2 for me" >expect &&
	git config --get nextsection.nonewline >actual &&
	test_cmp expect actual

ok 17 - git show-branch (part 3)

expecting success: 
	git checkout mybranch &&
	git reset --hard master^2 &&
	git checkout master &&
	git reset --hard master^

ok 26 - multi-valued get returns final one

expecting success: 
	cat >expect <<-\EOF &&
	wow
	wow2 for me
	EOF
	git config --get-all nextsection.nonewline >actual &&
	test_cmp expect actual

Already on 'mybranch'
HEAD is now at 9014374 Some work.
ok 27 - multi-valued get-all returns all

expecting success: 
	git config nextsection.nonewline "wow3" "wow$" &&
	test_cmp expect .git/config

Switched to branch 'master'
ok 28 - multivar replace

expecting success: 
	test_must_fail git config --unset nextsection.nonewline

warning: nextsection.nonewline has multiple values
ok 29 - ambiguous unset

expecting success: 
	test_must_fail git config --unset somesection.nonewline

HEAD is now at ab01a1a Some fun.
ok 30 - invalid unset

ok 18 - rewind to "Some fun." and "Some work."

expecting success: 
	git config --unset nextsection.nonewline "wow3$" &&
	test_cmp expect .git/config

expecting success: 
	git show-branch --topo-order > show-branch4.output &&
	test_cmp show-branch4.expect show-branch4.output

ok 31 - multivar unset

expecting success: test_must_fail git config inval.2key blabla
ok 19 - git show-branch (part 4)

expecting success: 
	mb=$(git merge-base HEAD mybranch) &&
	git name-rev --name-only --tags $mb > name-rev.output &&
	test "my-first-tag" = $(cat name-rev.output) &&

	git read-tree -m -u $mb HEAD mybranch

error: invalid key: inval.2key
ok 32 - invalid key

expecting success: git config 123456.a123 987
ok 33 - correct key

expecting success: 
	git config Version.1.2.3eX.Alpha beta

ok 34 - hierarchical section

expecting success: 
	test_cmp expect .git/config

ok 35 - hierarchical section value

expecting success: 
	git config --list > output &&
	test_cmp expect output

ok 20 - manual merge

expecting success: 
	git ls-files --stage > ls-files.output &&
	test_cmp ls-files.expect ls-files.output

ok 36 - working --list

ok 21 - git ls-files --stage

expecting success: 
	git --git-dir=nonexistent config --list >output &&
	test_cmp expect output

expecting success: 
	git ls-files --unmerged > ls-files-unmerged.output &&
	test_cmp ls-files-unmerged.expect ls-files-unmerged.output

ok 37 - --list without repo produces empty output

expecting success: 
	git config --get-regexp in >output &&
	test_cmp expect output

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 22 - git ls-files --unmerged

expecting success: 
	test_must_fail git merge-index git-merge-one-file hello

ok 38 - --get-regexp

:100644 100644 6cef6d8... 171a2cf... M	large1
ok 5 - diff --raw

expecting success: 
	git diff --stat HEAD^ HEAD

expecting success: 
	git config --add nextsection.nonewline "wow4 for you" &&
	git config --get-all nextsection.nonewline > output &&
	test_cmp expect output

 large1 | Bin 2000000 -> 2000009 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
ok 6 - diff --stat

expecting success: 
	git diff HEAD^ HEAD >actual &&
	grep "Binary files.*differ" actual

ok 39 - --add

expecting success: 
	git config --get novalue.variable ^$

Binary files a/large1 and b/large1 differ
ok 7 - diff

expecting success: 
	git diff --cached HEAD^ >actual &&
	grep "Binary files.*differ" actual


ok 40 - get variable with no value

expecting success: 
	git config --get emptyvalue.variable ^$


ok 41 - get variable with empty value

expecting success: 
	git config --get-regexp novalue > output &&
	test_cmp expect output

Auto-merging hello
Binary files a/large1 and b/large1 differ
ok 8 - diff --cached

expecting success: 
	git hash-object large1

ok 42 - get-regexp variable with no value

expecting success: 
	git config --bool --get-regexp novalue > output &&
	test_cmp expect output

ERROR: content conflict in hello
fatal: merge program failed
ok 23 - git-merge-index

expecting success: 
	git ls-files --stage > ls-files.output2 &&
	test_cmp ls-files.expect ls-files.output2

ok 43 - get-regexp --bool variable with no value

expecting success: 
	git config --get-regexp emptyvalue > output &&
	test_cmp expect output

ok 44 - get-regexp variable with empty value

expecting success: 
	git config --bool novalue.variable > output &&
	test_cmp expect output

ok 24 - git ls-files --stage (part 2)

expecting success: git repack
ok 45 - get bool variable with no value

expecting success: 
	git config --bool emptyvalue.variable > output &&
	test_cmp expect output

Cloning into 'sub1'...
ok 46 - get bool variable with empty value

expecting success: 
	test_must_fail git config >output 2>&1 &&
	test_i18ngrep usage output

usage: git config [<options>]
ok 47 - no arguments, but no crash

expecting success: 
	git config a.x y &&
	test_cmp expect .git/config

done.
ok 48 - new section is partial match of another

expecting success: 
	git config b.x y &&
	git config a.b c &&
	test_cmp expect .git/config

ok 49 - new variable inserts into proper section

expecting success: 
	test_must_fail git config --file non-existing-config -l

171a2cf5cd75bd8d405266c986591716925e9712
ok 9 - hash-object

expecting success: 
	git cat-file blob :large1 >/dev/null

fatal: unable to read config file 'non-existing-config': No such file or directory
ok 25 - git repack

expecting success: git prune-packed
ok 50 - alternative --file (non-existing file should fail)

expecting success: 
	GIT_CONFIG=other-config git config --list >output &&
	test_cmp expect output

ok 10 - cat-file a large file

expecting success: 
	git tag -m largefile largefiletag :large1 &&
	git cat-file blob largefiletag >/dev/null

ok 26 - git prune-packed

expecting success: 
	git prune && # Remove conflict marked blobs
	test $(find .git/objects/[0-9a-f][0-9a-f] -type f -print 2>/dev/null | wc -l) = 0

ok 51 - alternative GIT_CONFIG

expecting success: 
	git config --file other-config --list >output &&
	test_cmp expect output

ok 11 - cat-file a large file from a tag

expecting success: 
	git show :large1 >/dev/null


ok 52 - alternative GIT_CONFIG (--file)

expecting success: 
	git config --file - --list <other-config >output &&
	test_cmp expect output

ok 27 - -> only packed objects

# passed all 27 test(s)
1..27
ok 53 - alternative GIT_CONFIG (--file=-)

expecting success: 
	test_must_fail git config --file - some.value foo

fatal: writing to stdin is not supported
ok 54 - setting a value in stdin is an error

expecting success: 
	test_must_fail git config --file - --edit

Submodule path 'sub1': checked out '913780cd9739c4974f32aaa316af9267f73412c2'
fatal: editing stdin is not supported
ok 55 - editing stdin is an error

expecting success: 
	mkdir x &&
	(
		cd x &&
		echo strasse >expect &&
		git config --get --file ../other-config ein.bahn >actual &&
		test_cmp expect actual
	)


*** t1301-shared-repo.sh ***
ok 12 - git-show a large file

expecting success: 
	git clone file://"$(pwd)"/.git foo &&
	GIT_DIR=non-existent git index-pack --strict --verify foo/.git/objects/pack/*.pack

ok 56 - refer config from subdirectory

expecting success: 
	(
		cd x &&
		git config --file=../other-config --get ein.bahn >actual &&
		test_cmp expect actual
	)

Cloning into 'foo'...
ok 57 - refer config from subdirectory via --file

expecting success: 
	git config --file=other-config anwohner.park ausweis &&
	test_cmp expect other-config

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1301-shared-repo/.git/
ok 58 - --set in alternative file

expecting success: 
	git config --rename-section branch.eins branch.zwei

ok 4 - git read-tree -u -m: replace tracked file with submodule creates empty directory

ok 59 - rename section

expecting success: 
		prolog &&
		reset_work_tree_to replace_sub1_with_directory &&
		(
			cd submodule_update &&
			git branch -t replace_directory_with_sub1 origin/replace_directory_with_sub1 &&
			$command replace_directory_with_sub1 &&
			test_superproject_content origin/replace_directory_with_sub1 &&
			test_dir_is_empty sub1 &&
			git submodule update --init --recursive &&
			test_submodule_content sub1 origin/replace_directory_with_sub1
		)
	
expecting success: 
	test_cmp expect .git/config

ok 60 - rename succeeded

expecting success: 
	test_must_fail git config --rename-section \
		branch."world domination" branch.drei

fatal: No such section!
ok 61 - rename non-existing section

expecting success: 
	test_cmp expect .git/config

expecting success: 
	test_when_finished "rm -rf sub" &&
	mkdir sub && (
		cd sub &&
		test_must_fail git init --shared=0400
	)

ok 62 - rename succeeded

expecting success: 
	git config --rename-section branch."1 234 blabl/a" branch.drei

fatal: Problem with core.sharedRepository filemode value (0400).
The owner of files must always have read and write permissions.
ok 1 - shared = 0400 (faulty permission u-w)

ok 63 - rename another section

expecting success: 
		mkdir sub && (
			cd sub &&
			umask $u &&
			git init --shared=1 &&
			test 1 = "$(git config core.sharedrepository)"
		) &&
		actual=$(ls -l sub/.git/HEAD) &&
		case "$actual" in
		-rw-rw-r--*)
			: happy
			;;
		*)
			echo Oops, .git/HEAD is not 0664 but $actual
			false
			;;
		esac
	
expecting success: 
	test_cmp expect .git/config

ok 64 - rename succeeded

expecting success: 
	git config --rename-section branch.vier branch.zwei

Initialized empty shared Git repository in /«PKGBUILDDIR»/t/trash directory.t1301-shared-repo/sub/.git/
ok 65 - rename a section with a var on the same line

expecting success: 
	test_cmp expect .git/config

Cloning into 'submodule_update'...
ok 66 - rename succeeded

expecting success: 
	test_must_fail git config --rename-section branch.zwei ""

ok 2 - shared=1 does not clear bits preset by umask 002

error: invalid section name: 
ok 67 - renaming empty section name is rejected

expecting success: 
	test_must_fail git config --rename-section branch.zwei "bogus name"

error: invalid section name: bogus name
ok 68 - renaming to bogus section is rejected

expecting success: 
	git config --remove-section branch.zwei

done.
expecting success: 
		mkdir sub && (
			cd sub &&
			umask $u &&
			git init --shared=1 &&
			test 1 = "$(git config core.sharedrepository)"
		) &&
		actual=$(ls -l sub/.git/HEAD) &&
		case "$actual" in
		-rw-rw-r--*)
			: happy
			;;
		*)
			echo Oops, .git/HEAD is not 0664 but $actual
			false
			;;
		esac
	
ok 69 - remove section

expecting success: 
	test_cmp expect .git/config

ok 70 - section was removed properly

Initialized empty shared Git repository in /«PKGBUILDDIR»/t/trash directory.t1301-shared-repo/sub/.git/
expecting success: 
	rm -f .git/config &&
	git config gitcvs.enabled true &&
	git config gitcvs.ext.dbname %Ggitcvs1.%a.%m.sqlite &&
	git config gitcvs.dbname %Ggitcvs2.%a.%m.sqlite &&
	test_cmp expect .git/config


Switched to a new branch 'replace_sub1_with_directory'
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
ok 3 - shared=1 does not clear bits preset by umask 022

expecting success: 
	mkdir sub &&
	cd sub &&
	git init --shared=all &&
	test 2 = $(git config core.sharedrepository)

error: 8ed2e6719f8484ce01fa3ce133fe42d25c2441b8^{commit}: expected commit type, but the object dereferences to tree type
fatal: Needed a single revision
ok 71 - section ending

expecting success: 
	git config kilo.gram 1k &&
	git config mega.ton 1m &&
	echo 1024 >expect &&
	echo 1048576 >>expect &&
	git config --int --get kilo.gram >actual &&
	git config --int --get mega.ton >>actual &&
	test_cmp expect actual

Initialized empty shared Git repository in /«PKGBUILDDIR»/t/trash directory.t1301-shared-repo/sub/.git/
Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
ok 4 - shared=all

expecting success: 
	: > a1 &&
	git add a1 &&
	test_tick &&
	git commit -m a1 &&
	umask 0277 &&
	git update-server-info &&
	actual="$(ls -l .git/info/refs)" &&
	case "$actual" in
	-r--r--r--*)
		: happy
		;;
	*)
		echo Oops, .git/info/refs is not 0444
		false
		;;
	esac

[master (root-commit) a2bd363] a1
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 a1
ok 72 - numbers

expecting success: 
	git config giga.watts 121g &&
	echo 129922760704 >expect &&
	git config --int --get giga.watts >actual &&
	test_cmp expect actual

ok 5 - update-server-info honors core.sharedRepository

ok 73 - --int is at least 64 bits

expecting success: 
	git config aninvalid.unit "1auto" &&
	echo 1auto >expect &&
	git config aninvalid.unit >actual &&
	test_cmp expect actual &&
	cat >expect <<-\EOF &&
	fatal: bad numeric config value '1auto' for 'aninvalid.unit' in .git/config: invalid unit
	EOF
	test_must_fail git config --int --get aninvalid.unit 2>actual &&
	test_i18ncmp expect actual

expecting success: 

		rm -f .git/info/refs &&
		git update-server-info &&
		actual="$(modebits .git/info/refs)" &&
		verbose test "x$actual" = "x-$y"

	
ok 74 - invalid unit

ok 6 - shared = 0660 (r--r-----) ro

expecting success: 

		rm -f .git/info/refs &&
		git update-server-info &&
		actual="$(modebits .git/info/refs)" &&
		verbose test "x$actual" = "x-$x"

	
expecting success: 

	git config bool.true1 01 &&
	git config bool.true2 -1 &&
	git config bool.true3 YeS &&
	git config bool.true4 true &&
	git config bool.false1 000 &&
	git config bool.false2 "" &&
	git config bool.false3 nO &&
	git config bool.false4 FALSE &&
	rm -f result &&
	for i in 1 2 3 4
	do
	    git config --bool --get bool.true$i >>result
	    git config --bool --get bool.false$i >>result
        done &&
	test_cmp expect result
ok 7 - shared = 0660 (rw-rw----) rw

expecting success: 

		rm -f .git/info/refs &&
		git update-server-info &&
		actual="$(modebits .git/info/refs)" &&
		verbose test "x$actual" = "x-$y"

	
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 8 - shared = 0640 (r--r-----) ro

expecting success: 

		rm -f .git/info/refs &&
		git update-server-info &&
		actual="$(modebits .git/info/refs)" &&
		verbose test "x$actual" = "x-$x"

	
ok 9 - shared = 0640 (rw-r-----) rw

expecting success: 

		rm -f .git/info/refs &&
		git update-server-info &&
		actual="$(modebits .git/info/refs)" &&
		verbose test "x$actual" = "x-$y"

	
ok 10 - shared = 0600 (r--------) ro

expecting success: 

		rm -f .git/info/refs &&
		git update-server-info &&
		actual="$(modebits .git/info/refs)" &&
		verbose test "x$actual" = "x-$x"

	
ok 75 - bool

expecting success: 

	git config bool.nobool foobar &&
	test_must_fail git config --bool --get bool.nobool
Cloning into 'sub1'...
fatal: bad numeric config value 'foobar' for 'bool.nobool' in .git/config: invalid unit
ok 76 - invalid bool (--get)

expecting success: 

	test_must_fail git config --bool bool.nobool foobar
fatal: bad numeric config value 'foobar' for 'bool.nobool': invalid unit
ok 77 - invalid bool (set)

ok 11 - shared = 0600 (rw-------) rw

expecting success: 

	rm -f .git/config &&
	git config --bool bool.true1 01 &&
	git config --bool bool.true2 -1 &&
	git config --bool bool.true3 YeS &&
	git config --bool bool.true4 true &&
	git config --bool bool.false1 000 &&
	git config --bool bool.false2 "" &&
	git config --bool bool.false3 nO &&
	git config --bool bool.false4 FALSE &&
	test_cmp expect .git/config
done.
expecting success: 

		rm -f .git/info/refs &&
		git update-server-info &&
		actual="$(modebits .git/info/refs)" &&
		verbose test "x$actual" = "x-$y"

	
ok 12 - shared = 0666 (r--r--r--) ro

expecting success: 

		rm -f .git/info/refs &&
		git update-server-info &&
		actual="$(modebits .git/info/refs)" &&
		verbose test "x$actual" = "x-$x"

	
ok 13 - index-pack

expecting success: 
	git repack -ad

ok 78 - set --bool

expecting success: 

	rm -f .git/config &&
	git config --int int.val1 01 &&
	git config --int int.val2 -1 &&
	git config --int int.val3 5m &&
	test_cmp expect .git/config

ok 13 - shared = 0666 (rw-rw-rw-) rw

expecting success: 

		rm -f .git/info/refs &&
		git update-server-info &&
		actual="$(modebits .git/info/refs)" &&
		verbose test "x$actual" = "x-$y"

	
ok 79 - set --int

expecting success: 
	cat >.git/config <<-\EOF &&
	[bool]
	true1
	true2 = true
	false = false
	[int]
	int1 = 0
	int2 = 1
	int3 = -1
	EOF
	cat >expect <<-\EOF &&
	true
	true
	false
	0
	1
	-1
	EOF
	{
		git config --bool-or-int bool.true1 &&
		git config --bool-or-int bool.true2 &&
		git config --bool-or-int bool.false &&
		git config --bool-or-int int.int1 &&
		git config --bool-or-int int.int2 &&
		git config --bool-or-int int.int3
	} >actual &&
	test_cmp expect actual

Submodule path 'sub1': checked out '913780cd9739c4974f32aaa316af9267f73412c2'
ok 14 - shared = 0664 (r--r--r--) ro

expecting success: 

		rm -f .git/info/refs &&
		git update-server-info &&
		actual="$(modebits .git/info/refs)" &&
		verbose test "x$actual" = "x-$x"

	
ok 15 - shared = 0664 (rw-rw-r--) rw

expecting success: 
	rm -f .git/info/refs &&
	test_unconfig core.sharedrepository &&
	umask 002 &&
	git update-server-info &&
	echo "-rw-rw-r--" >expect &&
	modebits .git/info/refs >actual &&
	test_cmp expect actual

ok 80 - get --bool-or-int

ok 16 - info/refs respects umask in unshared repo

expecting success: 
	rm -f .git/config &&
	git config --bool-or-int bool.true1 true &&
	git config --bool-or-int bool.false1 false &&
	git config --bool-or-int bool.true2 yes &&
	git config --bool-or-int bool.false2 no &&
	git config --bool-or-int int.int1 0 &&
	git config --bool-or-int int.int2 1 &&
	git config --bool-or-int int.int3 -1 &&
	test_cmp expect .git/config

expecting success: 
	umask 077 &&
	git config core.sharedRepository group &&
	git reflog expire --all &&
	actual="$(ls -l .git/logs/refs/heads/master)" &&
	case "$actual" in
	-rw-rw-*)
		: happy
		;;
	*)
		echo Ooops, .git/logs/refs/heads/master is not 0662 [$actual]
		false
		;;
	esac

ok 14 - repack

expecting success: 
	SHA1=$(git hash-object huge) &&
	test_create_repo loose &&
	echo $SHA1 | git pack-objects --stdout |
		GIT_ALLOC_LIMIT=0 GIT_DIR=loose/.git git unpack-objects &&
	echo $SHA1 | GIT_DIR=loose/.git git pack-objects pack &&
	test_create_repo packed &&
	mv pack-* packed/.git/objects/pack &&
	GIT_DIR=packed/.git git cat-file blob $SHA1 >actual &&
	test_cmp huge actual

ok 17 - git reflog expire honors core.sharedRepository

ok 5 - git read-tree -u -m: replace directory with submodule

expecting success: 
		prolog &&
		reset_work_tree_to add_sub1 &&
		(
			cd submodule_update &&
			git branch -t remove_sub1 origin/remove_sub1 &&
			$command remove_sub1 &&
			test_superproject_content origin/remove_sub1 &&
			test_submodule_content sub1 origin/add_sub1
		)
	
expecting success: 
	mkdir -p templates/hooks &&
	echo update-server-info >templates/hooks/post-update &&
	chmod +x templates/hooks/post-update &&
	echo : >random-file &&
	mkdir new &&
	(
		cd new &&
		umask 002 &&
		git init --shared=0660 --template=../templates &&
		>frotz &&
		git add frotz &&
		git commit -a -m initial &&
		git repack
	) &&
	# List repository files meant to be protected; note that
	# COMMIT_EDITMSG does not matter---0mode is not about a
	# repository with a work tree.
	find new/.git -type f -name COMMIT_EDITMSG -prune -o -print |
	xargs ls -ld >actual &&

	# Everything must be unaccessible to others
	test -z "$(sed -e "/^.......---/d" actual)" &&

	# All directories must have either 2770 or 770
	test -z "$(sed -n -e "/^drwxrw[sx]---/d" -e "/^d/p" actual)" &&

	# post-update hook must be 0770
	test -z "$(sed -n -e "/post-update/{
		/^-rwxrwx---/d
		p
	}" actual)" &&

	# All files inside objects must be accessible by us
	test -z "$(sed -n -e "/objects\//{
		/^d/d
		/^-r.-r.----/d
		p
	}" actual)"

Initialized empty shared Git repository in /«PKGBUILDDIR»/t/trash directory.t1301-shared-repo/sub/new/.git/
ok 81 - set --bool-or-int

expecting success: 
	rm -f .git/config &&
	git config --path path.home "~/" &&
	git config --path path.normal "/dev/null" &&
	git config --path path.trailingtilde "foo~" &&
	test_cmp expect .git/config
[master (root-commit) e4c5dc6] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 frotz
ok 82 - set --path

expecting success: 
	git config --get --path path.home > result &&
	git config --get --path path.normal >> result &&
	git config --get --path path.trailingtilde >> result &&
	test_cmp expect result

Cloning into 'submodule_update'...
ok 83 - get --path

expecting success: 
	(
		unset HOME;
		test_must_fail git config --get --path path.home \
			>result 2>msg &&
		git config --get --path path.normal >>result &&
		git config --get --path path.trailingtilde >>result
	) &&
	grep "[Ff]ailed to expand.*~/" msg &&
	test_cmp expect result

done.
fatal: failed to expand user dir in: '~/'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1050-large/loose/.git/
ok 84 - get --path copes with unset $HOME

expecting success: 
	echo "[path]bool" >.git/config &&
	test_must_fail git config --get --path path.bool

error: Missing value for 'path.bool'
fatal: bad config file line 2 in .git/config
ok 85 - get --path barfs on boolean variable

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
expecting success: 
	rm -f .git/config &&
	git config quote.leading " test" &&
	git config quote.ending "test " &&
	git config quote.semicolon "test;test" &&
	git config quote.hash "test#test" &&
	test_cmp expect .git/config

ok 86 - quoting

expecting success: 
	test_must_fail git config "key.with
newline" 123
error: invalid key: key.with
newline
ok 87 - key with newline

expecting success: git config key.sub value.with\\\
newline
ok 18 - forced modes

# passed all 18 test(s)
1..18
ok 88 - value with newline

expecting success: 
	git config --list > result &&
	test_cmp result expect

ok 89 - value continued on next line

expecting success: 
	git config --null --list | nul_to_q >result &&
	echo >>result &&
	test_cmp expect result

*** t1302-repo-version.sh ***
ok 90 - --null --list

expecting success: 
	git config --null --get-regexp "val[0-9]" | nul_to_q >result &&
	echo >>result &&
	test_cmp expect result

ok 91 - --null --get-regexp

expecting success: 
	git config section.val "foo 	  bar" &&
	echo "foo 	  bar" >expect &&
	git config section.val >actual &&
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1302-repo-version/.git/
ok 92 - inner whitespace kept verbatim

expecting success: 
	cat >test.patch <<-\EOF &&
	diff --git a/test.txt b/test.txt
	new file mode 100644
	--- /dev/null
	+++ b/test.txt
	@@ -0,0 +1 @@
	+123
	EOF

	test_create_repo "test" &&
	test_create_repo "test2" &&
	git config --file=test2/.git/config core.repositoryformatversion 99

checking prerequisite: SYMLINKS

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	# test whether the filesystem supports symbolic links
	ln -s x y && test -h y

)
prerequisite SYMLINKS ok
expecting success: 
	ln -s notyet myconfig &&
	git config --file=myconfig test.frotz nitfol &&
	test -h myconfig &&
	test -f notyet &&
	test "z$(git config --file=notyet test.frotz)" = znitfol &&
	git config --file=myconfig test.xyzzy rezrov &&
	test -h myconfig &&
	test -f notyet &&
	cat >expect <<-\EOF &&
	nitfol
	rezrov
	EOF
	{
		git config --file=notyet test.frotz &&
		git config --file=notyet test.xyzzy
	} >actual &&
	test_cmp expect actual

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1302-repo-version/test/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1302-repo-version/test2/.git/
ok 1 - setup

expecting success: 
	echo 0 >expect &&
	git config core.repositoryformatversion >actual &&
	(
		cd test &&
		git config core.repositoryformatversion >../actual2
	) &&
	test_cmp expect actual &&
	test_cmp expect actual2

ok 2 - gitdir selection on normal repos

expecting success: 
	# Make sure it would stop at test2, not trash
	echo 99 >expect &&
	(
		cd test2 &&
		git config core.repositoryformatversion >../actual
	) &&
	test_cmp expect actual

warning: Expected git repo version <= 0, found 99
warning: Please upgrade Git
ok 93 - symlinked configuration

expecting success: 
	test_must_fail git config --file=doesnotexist --list &&
	test_must_fail git config --file=doesnotexist test.xyzzy

ok 3 - gitdir selection on unsupported repo

expecting success: 
	git apply --stat test.patch &&
	(
		cd test &&
		git apply --stat ../test.patch
	) &&
	(
		cd test2 &&
		git apply --stat ../test.patch
	)

fatal: unable to read config file 'doesnotexist': No such file or directory
Cloning into 'sub1'...
ok 94 - nonexistent configuration

expecting success: 
	ln -s doesnotexist linktonada &&
	ln -s linktonada linktolinktonada &&
	test_must_fail git config --file=linktonada --list &&
	test_must_fail git config --file=linktolinktonada --list

 test.txt |    1 +
 1 file changed, 1 insertion(+)
fatal: unable to read config file 'linktonada': No such file or directory
 test.txt |    1 +
 1 file changed, 1 insertion(+)
warning: Expected git repo version <= 0, found 99
warning: Please upgrade Git
 test.txt |    1 +
 1 file changed, 1 insertion(+)
fatal: unable to read config file 'linktolinktonada': No such file or directory
ok 95 - symlink to nonexistent configuration

expecting success: 
	git config alias.split-cmdline-fix 'echo "' &&
	test_must_fail git split-cmdline-fix &&
	echo foo > foo &&
	git add foo &&
	git commit -m 'initial commit' &&
	git config branch.master.mergeoptions 'echo "' &&
	test_must_fail git merge master
done.

ok 4 - gitdir not required mode

expecting success: 
	git apply --check --index test.patch &&
	(
		cd test &&
		git apply --check --index ../test.patch
	) &&
	(
		cd test2 &&
		test_must_fail git apply --check --index ../test.patch
	)

fatal: Bad alias.split-cmdline-fix string: unclosed quote
warning: Expected git repo version <= 0, found 99
warning: Please upgrade Git
fatal: --index outside a repository
ok 5 - gitdir required mode

# passed all 5 test(s)
1..5
dc5b4c5413c9a2a6ca4f121474e1c9c8ea086153
[master (root-commit) daf387c] initial commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
fatal: Bad branch.master.mergeoptions string: unclosed quote
ok 96 - check split_cmdline return

expecting success: 
	cat >expect <<-\EOF &&
	value
	value
	true
	EOF
	{
		git -c core.name=value config core.name &&
		git -c foo.CamelCase=value config foo.camelcase &&
		git -c foo.flag config --bool foo.flag
	} >actual &&
	test_cmp expect actual &&
	test_must_fail git -c name=value config core.name

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1050-large/packed/.git/
*** t1303-wacky-config.sh ***
Submodule path 'sub1': checked out '913780cd9739c4974f32aaa316af9267f73412c2'
error: key does not contain a section: name
ok 97 - git -c "key=value" support

expecting success: 
	echo >expect &&
	git -c foo.empty= config --path foo.empty >actual &&
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1303-wacky-config/.git/
ok 98 - git -c can represent empty string

expecting success: 
	test_must_fail git config foo=bar &&
	test_must_fail git config foo=.bar &&
	test_must_fail git config foo.ba=r &&
	test_must_fail git config foo.1bar &&
	test_must_fail git config foo."ba
				z".bar &&
	test_must_fail git config . false &&
	test_must_fail git config .foo false &&
	test_must_fail git config foo. false &&
	test_must_fail git config .foo. false &&
	git config foo.bar true &&
	git config foo."ba =z".bar false

error: key does not contain a section: foo=bar
expecting success: 
	setup &&
	git config section.key bar &&
	check section.key bar

error: invalid key: foo=.bar
error: invalid key: foo.ba=r
ok 1 - modify same key

expecting success: 
	setup &&
	git config section.other bar &&
	check section.key foo &&
	check section.other bar

error: invalid key: foo.1bar
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
error: invalid key (newline): foo.ba
				z.bar
error: key does not contain a section: .
warning: unable to rmdir sub1: Directory not empty
error: key does not contain a section: .foo
error: key does not contain variable name: foo.
ok 15 - pack-objects with large loose object

expecting success: 
	git archive --format=tar HEAD >/dev/null

error: key does not contain variable name: .foo.
ok 2 - add key in same section

expecting success: 
	setup &&
	git config section2.key bar &&
	check section.key foo &&
	check section2.key bar

ok 99 - key sanity-checking

expecting success: 
	git config alias.checkconfig "-c foo.check=bar config foo.check" &&
	echo bar >expect &&
	git checkconfig >actual &&
	test_cmp expect actual

ok 3 - add key in different section

expecting success: 
	git config "$SECTION" bar &&
	check "$SECTION" bar

ok 100 - git -c works with aliases of builtins

expecting success: 
	echo "value with = in it" >expect &&
	git -c core.foo="value with = in it" config core.foo >actual &&
	test_cmp expect actual

ok 6 - git read-tree -u -m: removed submodule leaves submodule directory and its contents in place

expecting success: 
		prolog &&
		reset_work_tree_to add_sub1 &&
		(
			cd submodule_update &&
			git branch -t remove_sub1 origin/remove_sub1 &&
			replace_gitfile_with_git_dir sub1 &&
			$command remove_sub1 &&
			test_superproject_content origin/remove_sub1 &&
			test_git_directory_is_unchanged sub1 &&
			test_submodule_content sub1 origin/add_sub1
		)
	
ok 101 - git -c does not split values on equals

expecting success: 
	test_must_fail git -c core.bare=foo rev-parse

ok 4 - make sure git config escapes section names properly

expecting success: 
	setup &&
	git config section.key "$LONG_VALUE" &&
	check section.key "$LONG_VALUE"

fatal: bad numeric config value 'foo' for 'core.bare': invalid unit
ok 102 - git -c dies on bogus config

expecting success: 
	test_must_fail git -c "=foo" rev-parse

ok 16 - tar achiving

expecting success: 
	git archive --format=zip -0 HEAD >/dev/null

error: bogus config parameter: =foo
fatal: unable to parse command-line config
ok 103 - git -c complains about empty key

expecting success: 
	test_must_fail git -c "" rev-parse

ok 5 - do not crash on special long config line

expecting success: 
	setup_many &&
	git config --get-all section.key >actual &&
	test_line_count = 3126 actual

error: bogus config parameter: 
fatal: unable to parse command-line config
ok 104 - git -c complains about empty key and value

expecting success: 
	git config -f tmp test.value no &&
	echo test.value=yes >expect &&
	GIT_EDITOR="echo [test]value=yes >" git config -f tmp --edit &&
	git config -f tmp --list >actual &&
	test_cmp expect actual

Cloning into 'submodule_update'...
ok 105 - git config --edit works

expecting success: 
	git config -f tmp test.value no &&
	echo test.value=yes >expect &&
	test_config core.editor "echo [test]value=yes >" &&
	git config -f tmp --edit &&
	git config -f tmp --list >actual &&
	test_cmp expect actual

done.
ok 6 - get many entries

expecting success: 
	setup_many &&
	git config --get-regexp "sec.*ke." >actual &&
	test_line_count = 3126 actual

ok 17 - zip achiving, store only

expecting success: 
	git archive --format=zip HEAD >/dev/null

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 106 - git config --edit respects core.editor

expecting success: 
	cat >.git/config <<-\EOF &&
	# broken section line
	[section]
	key garbage
	EOF
	test_must_fail git config --get section.key >actual 2>error &&
	grep " line 3 " error

ok 7 - get many entries by regex

expecting success: 
	setup_many &&
	git config --add section.key bar &&
	check_regex section.key "b.*r" bar &&
	git config section.key beer "b.*r" &&
	check_regex section.key "b.*r" beer

fatal: bad config file line 3 in .git/config
ok 107 - barf on syntax error

expecting success: 
	cat >.git/config <<-\EOF &&
	# broken section line
	[section
	key = value
	EOF
	test_must_fail git config --get section.key >actual 2>error &&
	grep " line 2 " error

fatal: bad config file line 2 in .git/config
ok 108 - barf on incomplete section header

expecting success: 
	cat >.git/config <<-\EOF &&
	# broken section line
	[section]
	key = "value string
	EOF
	test_must_fail git config --get section.key >actual 2>error &&
	grep " line 3 " error

fatal: bad config file line 3 in .git/config
ok 109 - barf on incomplete string

expecting success: 
	cat >.git/config <<-\EOF &&
	[http]
		sslVerify
	[http "https://weak.example.com"]
		sslVerify = false
		cookieFile = /tmp/cookie.txt
	EOF

	echo true >expect &&
	git config --bool --get-urlmatch http.SSLverify https://good.example.com >actual &&
	test_cmp expect actual &&

	echo false >expect &&
	git config --bool --get-urlmatch http.sslverify https://weak.example.com >actual &&
	test_cmp expect actual &&

	{
		echo http.cookiefile /tmp/cookie.txt &&
		echo http.sslverify false
	} >expect &&
	git config --get-urlmatch HTTP https://weak.example.com >actual &&
	test_cmp expect actual

ok 110 - urlmatch

checking known breakage: 
	cat >.git/config <<-\EOF &&
	# some generic comment on the configuration file itself
	# a comment specific to this "section" section.
	[section]
	# some intervening lines
	# that should also be dropped

	key = value
	# please be careful when you update the above variable
	EOF

	cat >expect <<-\EOF &&
	# some generic comment on the configuration file itself
	EOF

	git config --unset section.key &&
	test_cmp expect .git/config

--- expect	2015-08-08 04:36:20.617492664 +0000
+++ .git/config	2015-08-08 04:36:20.641492664 +0000
@@ -1 +1,7 @@
 # some generic comment on the configuration file itself
+# a comment specific to this "section" section.
+[section]
+# some intervening lines
+# that should also be dropped
+
+# please be careful when you update the above variable
not ok 111 - unsetting the last key in a section removes header # TODO known breakage

checking known breakage: 
	cat >.git/config <<-\EOF &&
	[section]
	EOF

	q_to_tab >expect <<-\EOF &&
	[section]
	Qkey = value
	EOF

	git config section.key value &&
	test_cmp expect .git/config

--- expect	2015-08-08 04:36:20.673492664 +0000
+++ .git/config	2015-08-08 04:36:20.689492664 +0000
@@ -1,2 +1,3 @@
 [section]
+[section]
 	key = value
not ok 112 - adding a key into an empty section reuses header # TODO known breakage

expecting success: 
	chmod 0600 .git/config &&
	git config imap.pass Hunter2 &&
	perl -e \
	  "die q(badset) if ((stat(q(.git/config)))[2] & 07777) != 0600" &&
	git config --rename-section imap pop &&
	perl -e \
	  "die q(badrename) if ((stat(q(.git/config)))[2] & 07777) != 0600"

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 113 - preserves existing permissions

# still have 2 known breakage(s)
# passed all remaining 111 test(s)
1..113
*** t1304-default-acl.sh ***
Cloning into 'sub1'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1304-default-acl/.git/
expecting success: 
	if setfacl -m d:m:rwx -m u:root:rwx . &&
	   getfacl . | grep user:root:rwx &&
	   touch should-have-readable-acl &&
	   getfacl should-have-readable-acl | egrep "mask::?rw-"
	then
		test_set_prereq SETFACL
	fi

done.
user:root:rwx
mask::rw-
ok 1 - checking for a working acl setup

expecting success: 
	setfacl -m d:u::rwx,d:g::---,d:o:---,d:m:rwx $dirs_to_set &&
	setfacl -m m:rwx               $dirs_to_set &&
	setfacl -m u:root:rwx          $dirs_to_set &&
	setfacl -m d:u:"$LOGNAME":rwx  $dirs_to_set &&
	setfacl -m d:u:root:rwx        $dirs_to_set &&

	touch file.txt &&
	git add file.txt &&
	git commit -m "init"

ok 18 - zip achiving, deflate

expecting success: 
	test_must_fail git fsck 2>err &&
	n=$(grep "error: attempting to allocate .* over limit" err | wc -l) &&
	test "$n" -gt 1

Submodule path 'sub1': checked out '913780cd9739c4974f32aaa316af9267f73412c2'
ok 19 - fsck

# passed all 19 test(s)
1..19
[master (root-commit) e21c273] init
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file.txt
ok 2 - Setup test repo

expecting success: 
	# SHA1 for empty blob
	check_perms_and_acl .git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391

ok 8 - add and replace one of many entries

expecting success: 
	setup_many &&
	git config --replace-all section.key bar &&
	check section.key bar

Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
ok 3 - Objects creation does not break ACLs with restrictive umask

expecting success: 
	git gc &&
	check_perms_and_acl .git/objects/pack/*.pack

*** t1305-config-include.sh ***
ok 9 - replace many entries

expecting success: 
	setup_many &&
	git config --unset-all section.key &&
	test_must_fail git config section.key

warning: unable to rmdir sub1: Directory not empty
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1305-config-include/.git/
expecting success: 
	echo "[test]one = 1" >one &&
	echo "[include]path = \"$(pwd)/one\"" >.gitconfig &&
	echo 1 >expect &&
	git config test.one >actual &&
	test_cmp expect actual

ok 1 - include file by absolute path

expecting success: 
	echo "[test]one = 1" >one &&
	echo "[include]path = one" >.gitconfig &&
	echo 1 >expect &&
	git config test.one >actual &&
	test_cmp expect actual

ok 2 - include file by relative path

expecting success: 
	mkdir subdir &&
	echo "[test]three = 3" >subdir/three &&
	echo "[include]path = three" >subdir/two &&
	echo "[include]path = subdir/two" >.gitconfig &&
	echo 3 >expect &&
	git config test.three >actual &&
	test_cmp expect actual

ok 10 - unset many entries

expecting success: 
	cat >expect <<-\EOF &&


	fool
	roll
	EOF
	cp .git/config .git/config.old &&
	test_when_finished "mv .git/config.old .git/config" &&
	cat >.git/config <<-\EOF &&
	[foo]
		baz
		baz =
		baz = fool
	EOF
	git config --add foo.baz roll &&
	git config --get-all foo.baz >output &&
	test_cmp expect output

ok 3 - chained relative paths

expecting success: 
	echo "[test]one = 1" >one &&
	echo "[include]path = ~/one" >.gitconfig &&
	echo 1 >expect &&
	git config test.one >actual &&
	test_cmp expect actual

ok 4 - include paths get tilde-expansion

expecting success: 
	echo "[test]one = 1" >one &&
	echo "[include]path = one" >.gitconfig &&
	echo one >expect &&
	git config include.path >actual &&
	test_cmp expect actual

ok 5 - include options can still be examined

expecting success: 
	echo "[test]one = 1" >one &&
	echo "[include]path = one" >.gitconfig &&
	cat >expect <<-\EOF &&
	include.path=one
	test.one=1
	EOF
	git config --list >actual.full &&
	grep -v ^core actual.full >actual &&
	test_cmp expect actual

ok 11 - --add appends new value after existing empty value

ok 4 - git gc does not break ACLs with restrictive umask
# passed all 11 test(s)

1..11
ok 6 - listing includes option and expansion

expecting success: 
	echo "[test]one = 1" >one &&
	echo "[include]path = one" >.gitconfig &&
	test_must_fail git config -f .gitconfig test.one &&
	test_must_fail git config --global test.one &&
	echo 1 >expect &&
	git config --includes -f .gitconfig test.one >actual &&
	test_cmp expect actual

# passed all 4 test(s)
1..4
*** t1306-xdg-files.sh ***
ok 7 - git read-tree -u -m: removed submodule leaves submodule containing a .git directory alone

expecting success: 
		prolog &&
		reset_work_tree_to add_sub1 &&
		(
			cd submodule_update &&
			git branch -t replace_sub1_with_directory origin/replace_sub1_with_directory &&
			test_must_fail $command replace_sub1_with_directory &&
			test_superproject_content origin/add_sub1 &&
			test_submodule_content sub1 origin/add_sub1
		)
	
*** t1307-config-blob.sh ***
ok 7 - single file lookup does not expand includes by default

expecting success: 
	echo "[test]one = 1" >one &&
	echo "[include]path = one" >.gitconfig &&
	echo "include.path=one" >expect &&
	git config -f .gitconfig --list >actual &&
	test_cmp expect actual

ok 8 - single file list does not expand includes by default

expecting success: 
	echo "[test]one = 1" >one &&
	echo "[include]path = one" >.gitconfig &&
	git config test.two 2 &&
	echo 2 >expect &&
	git config --no-includes test.two >actual &&
	test_cmp expect actual &&
	test_must_fail git config --no-includes test.one

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1306-xdg-files/.git/
ok 9 - writing config file does not expand includes

expecting success: 
	echo "[test]one = 1" >one &&
	echo "[include]path = one" >.gitconfig &&
	git config test.one 2 &&
	echo 1 >expect &&
	git config -f one test.one >actual &&
	test_cmp expect actual &&
	cat >expect <<-\EOF &&
	1
	2
	EOF
	git config --get-all test.one >actual &&
	test_cmp expect actual

expecting success: 
	mkdir -p .config/git &&
	echo "[alias]" >.config/git/config &&
	echo "	myalias = !echo in_config" >>.config/git/config &&
	echo in_config >expected &&
	git myalias >actual &&
	test_cmp expected actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1307-config-blob/.git/
ok 1 - read config: xdg file exists and ~/.gitconfig doesn't

expecting success: 
	>.gitconfig &&
	echo "[alias]" >.gitconfig &&
	echo "	myalias = !echo in_gitconfig" >>.gitconfig &&
	echo in_gitconfig >expected &&
	git myalias >actual &&
	test_cmp expected actual

expecting success: 
	cat >config <<-\EOF &&
	[some]
		value = 1
	EOF
	git add config &&
	git commit -m foo

ok 2 - read config: xdg file exists and ~/.gitconfig exists

expecting success: 
	rm .gitconfig &&
	echo "[user]" >.config/git/config &&
	echo "	name = read_config" >>.config/git/config &&
	echo read_config >expected &&
	git config --get user.name >actual &&
	test_cmp expected actual

ok 10 - config modification does not affect includes

Cloning into 'submodule_update'...
expecting success: 
	cat >.gitconfig <<-\EOF &&
	[include]path = foo
	[test]value = yes
	EOF
	echo yes >expect &&
	git config test.value >actual &&
	test_cmp expect actual

ok 3 - read with --get: xdg file exists and ~/.gitconfig doesn't

expecting success: 
	mkdir -p "$HOME"/xdg/git &&
	echo "[user]name = in_xdg" >"$HOME"/xdg/git/config &&
	echo in_xdg >expected &&
	XDG_CONFIG_HOME="$HOME"/xdg git config --get-all user.name >actual &&
	test_cmp expected actual

[master (root-commit) 4c5842f] foo
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+)
 create mode 100644 config
ok 11 - missing include files are ignored

expecting success: 
	echo "[test]one = 1" >one &&
	echo 1 >expect &&
	git -c include.path="$(pwd)/one" config test.one >actual &&
	test_cmp expect actual

ok 1 - create config blob

expecting success: 
	echo some.value=1 >expect &&
	git config --blob=HEAD:config --list >actual &&
	test_cmp expect actual

done.
ok 4 - "$XDG_CONFIG_HOME overrides $HOME/.config/git

expecting success: 
	>.gitconfig &&
	echo "[user]" >.gitconfig &&
	echo "	name = read_gitconfig" >>.gitconfig &&
	echo read_gitconfig >expected &&
	git config --get user.name >actual &&
	test_cmp expected actual

ok 12 - absolute includes from command line work

expecting success: 
	echo "[test]one = 1" >one &&
	test_must_fail git -c include.path=one config test.one

ok 2 - list config blob contents

expecting success: 
	echo true >expect &&
	git config --blob=HEAD:config --bool some.value >actual &&
	test_cmp expect actual

error: relative config includes must come from files
fatal: unable to parse command-line config
ok 5 - read with --get: xdg file exists and ~/.gitconfig exists

expecting success: 
	rm .gitconfig &&
	echo user.name=read_config >expected &&
	git config --global --list >actual &&
	test_cmp expected actual

ok 13 - relative includes from command line fail

expecting success: 
	echo "[test]one = 1" >one &&
	echo "[include]path=$(pwd)/one" >blob &&
	blob=$(git hash-object -w blob) &&
	echo 1 >expect &&
	git config --blob=$blob test.one >actual &&
	test_cmp expect actual

ok 3 - fetch value from blob

expecting success: 
	test_must_fail git config --blob=HEAD:config non.existing

ok 6 - read with --list: xdg file exists and ~/.gitconfig doesn't

expecting success: 
	>.gitconfig &&
	echo "[user]" >.gitconfig &&
	echo "	name = read_gitconfig" >>.gitconfig &&
	echo user.name=read_gitconfig >expected &&
	git config --global --list >actual &&
	test_cmp expected actual

ok 4 - reading non-existing value from blob is an error

expecting success: 
	test_must_fail git config --blob=HEAD:config --system --list

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 14 - absolute includes from blobs work

expecting success: 
	echo "[test]one = 1" >one &&
	echo "[include]path=one" >blob &&
	blob=$(git hash-object -w blob) &&
	test_must_fail git config --blob=$blob test.one

ok 7 - read with --list: xdg file exists and ~/.gitconfig exists

expecting success: 
	git init git &&
	cd git &&
	echo foo >to_be_excluded

error: only one config file at a time.
usage: git config [<options>]

Config file location
    --global              use global config file
    --system              use system config file
    --local               use repository config file
    -f, --file <file>     use given config file
    --blob <blob-id>      read config from given blob object

Action
    --get                 get value: name [value-regex]
    --get-all             get all values: key [value-regex]
    --get-regexp          get values for regexp: name-regex [value-regex]
    --get-urlmatch        get value specific for the URL: section[.var] URL
    --replace-all         replace all matching variables: name value [value_regex]
    --add                 add a new variable: name value
    --unset               remove a variable: name [value-regex]
    --unset-all           remove all matches: name [value-regex]
    --rename-section      rename section: old-name new-name
    --remove-section      remove a section: name
    -l, --list            list all
    -e, --edit            open an editor
    --get-color           find the color configured: slot [default]
    --get-colorbool       find the color setting: slot [stdout-is-tty]

Type
    --bool                value is "true" or "false"
    --int                 value is decimal number
    --bool-or-int         value is --bool or --int
    --path                value is a path (file or directory name)

Other
    -z, --null            terminate values with NUL byte
    --includes            respect include directives on lookup

ok 5 - reading from blob and file is an error

expecting success: 
	test_must_fail git config --blob=HEAD:doesnotexist --list

error: unable to resolve config blob 'HEAD:doesnotexist'
fatal: error processing config file(s)
ok 6 - reading from missing ref is an error

expecting success: 
	test_must_fail git config --blob=HEAD --list

error: relative config includes must come from files
error: bad config file line 2 in d085876092eb24c144128bcd5db5d26e665f4f8a
ok 15 - relative includes from blobs fail

expecting success: 
	echo "[test]one = 1" >one &&
	echo 1 >expect &&
	echo "[include]path=\"$(pwd)/one\"" |
	git config --file - test.one >actual &&
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1306-xdg-files/git/.git/
ok 8 - Setup
error: reference 'HEAD' does not point to a blob
fatal: error processing config file(s)

expecting success: 
	mkdir -p "$HOME"/.config/git/ &&
	echo to_be_excluded >"$HOME"/.config/git/ignore &&
	test_must_fail git add to_be_excluded

ok 7 - reading from non-blob is an error

expecting success: 
	test_must_fail git config --blob=HEAD:config some.value foo

fatal: writing config blobs is not supported
ok 16 - absolute includes from stdin work

ok 8 - setting a value in a blob is an error

expecting success: 
	echo "[test]one = 1" >one &&
	echo "[include]path=one" |
	test_must_fail git config --file - test.one

expecting success: 
	test_must_fail git config --blob=HEAD:config --unset some.value

The following paths are ignored by one of your .gitignore files:
to_be_excluded
Use -f if you really want to add them.
ok 9 - Exclusion of a file in the XDG ignore file

expecting success: 
	mkdir -p "$HOME"/xdg/git &&
	echo content >excluded_by_xdg_only &&
	echo excluded_by_xdg_only >"$HOME"/xdg/git/ignore &&
	test_when_finished "git read-tree --empty" &&
	(XDG_CONFIG_HOME="$HOME/xdg" &&
	 export XDG_CONFIG_HOME &&
	 git add to_be_excluded &&
	 test_must_fail git add excluded_by_xdg_only
	)

fatal: writing config blobs is not supported
ok 9 - deleting a value in a blob is an error

expecting success: 
	test_must_fail git config --blob=HEAD:config --edit

error: relative config includes must come from files
fatal: bad config file line 2 in <stdin>
ok 17 - relative includes from stdin line fail

expecting success: 
	cat >.gitconfig <<-\EOF &&
	[test]value = gitconfig
	[include]path = cycle
	EOF
	cat >cycle <<-\EOF &&
	[test]value = cycle
	[include]path = .gitconfig
	EOF
	cat >expect <<-\EOF &&
	gitconfig
	cycle
	EOF
	test_must_fail git config --get-all test.value 2>stderr &&
	grep "exceeded maximum include depth" stderr

fatal: editing blobs is not supported
ok 10 - editing a blob is an error

expecting success: 
	cat >config <<-\EOF &&
	[some]
		value = "
	EOF
	git add config &&
	git commit -m broken &&

	test_must_fail git config --blob=HEAD:config some.value 2>err &&

	# just grep for our token as the exact error message is likely to
	# change or be internationalized
	grep "HEAD:config" err

The following paths are ignored by one of your .gitignore files:
excluded_by_xdg_only
Use -f if you really want to add them.
fatal: exceeded maximum include depth (10) while including
ok 18 - include cycles are detected

ok 10 - $XDG_CONFIG_HOME overrides $HOME/.config/git/ignore

expecting success: 
	echo to_be_excluded >.gitignore &&
	test_must_fail git add to_be_excluded

# passed all 18 test(s)
1..18
The following paths are ignored by one of your .gitignore files:
to_be_excluded
Use -f if you really want to add them.
ok 11 - Exclusion in both XDG and local ignore files

expecting success: 
	rm .gitignore &&
	echo >"$HOME"/.config/git/ignore &&
	echo to_be_excluded >"$HOME"/my_gitignore &&
	git config core.excludesfile "$HOME"/my_gitignore &&
	test_must_fail git add to_be_excluded

[master 4469f47] broken
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
error: bad config file line 2 in HEAD:config
ok 11 - parse errors in blobs are properly attributed

expecting success: 
	printf "[some]key = value\\r" >config &&
	git add config &&
	git commit -m CR &&
	echo value >expect &&
	git config --blob=HEAD:config some.key >actual &&
	test_cmp expect actual

*** t1308-config-set.sh ***
The following paths are ignored by one of your .gitignore files:
to_be_excluded
Use -f if you really want to add them.
ok 12 - Exclusion in a non-XDG global ignore file

expecting success: 
	>expected &&
	(sane_unset HOME &&
	 git config --unset core.excludesfile &&
	 git ls-files --exclude-standard --ignored >actual) &&
	test_cmp expected actual

ok 13 - Checking XDG ignore file when HOME is unset

expecting success: 
	echo foo >f &&
	git check-attr -a f >actual &&
	test_line_count -eq 0 actual &&
	echo "f attr_f" >"$HOME"/.config/git/attributes &&
	echo "f: attr_f: set" >expected &&
	git check-attr -a f >actual &&
	test_cmp expected actual

[master ed72964] CR
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 2 deletions(-)
ok 12 - can parse blob ending with CR

# passed all 12 test(s)
1..12
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1308-config-set/.git/
expecting success: 
	cat >.git/config <<-\EOF
	[case]
		penguin = very blue
		Movie = BadPhysics
		UPPERCASE = true
		MixedCase = true
		my =
		foo
		baz = sam
	[Cores]
		WhatEver = Second
		baz = bar
	[cores]
		baz = bat
	[CORES]
		baz = ball
	[my "Foo bAr"]
		hi = mixed-case
	[my "FOO BAR"]
		hi = upper-case
	[my "foo bar"]
		hi = lower-case
	[case]
		baz = bat
		baz = hask
	[lamb]
		chop = 65
		head = none
	[goat]
		legs = 4
		head = true
		skin = false
		nose = 1
		horns
	EOF

ok 14 - Checking attributes in the XDG attributes file

expecting success: 
	>expected &&
	(sane_unset HOME &&
	 git check-attr -a f >actual) &&
	test_cmp expected actual

ok 1 - setup default config

expecting success: 
	check_config get_value case.penguin "very blue"

*** t1400-update-ref.sh ***
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 15 - Checking XDG attributes when HOME is unset

expecting success: 
	mkdir -p "$HOME"/xdg/git &&
	echo "f attr_f=xdg" >"$HOME"/xdg/git/attributes &&
	echo "f: attr_f: xdg" >expected &&
	XDG_CONFIG_HOME="$HOME/xdg" git check-attr -a f >actual &&
	test_cmp expected actual

ok 2 - get value for a simple key

expecting success: 
	check_config get_value case.my ""

ok 3 - get value for a key with value as an empty string

expecting success: 
	check_config get_value case.foo "(NULL)"

ok 16 - $XDG_CONFIG_HOME overrides $HOME/.config/git/attributes

expecting success: 
	echo "f -attr_f" >.gitattributes &&
	echo "f: attr_f: unset" >expected &&
	git check-attr -a f >actual &&
	test_cmp expected actual

ok 4 - get value for a key with value as NULL

expecting success: 
	check_config get_value case.UPPERCASE "true" &&
	check_config get_value case.uppercase "true"

ok 17 - Checking attributes in both XDG and local attributes files

expecting success: 
	test_might_fail rm .gitattributes &&
	echo "f attr_f=test" >"$HOME"/my_gitattributes &&
	git config core.attributesfile "$HOME"/my_gitattributes &&
	echo "f: attr_f: test" >expected &&
	git check-attr -a f >actual &&
	test_cmp expected actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1400-update-ref/.git/
ok 5 - upper case key

expecting success: 
	check_config get_value case.MixedCase "true" &&
	check_config get_value case.MIXEDCASE "true" &&
	check_config get_value case.mixedcase "true"

expecting success: 

	for name in A B C D E F
	do
		test_tick &&
		T=$(git write-tree) &&
		sha1=$(echo $name | git commit-tree $T) &&
		eval $name=$sha1
	done


Cloning into 'sub1'...
ok 18 - Checking attributes in a non-XDG global attributes file

expecting success: 
	mkdir -p "$HOME"/.config/git &&
	>"$HOME"/.config/git/config &&
	test_might_fail rm "$HOME"/.gitconfig &&
	git config --global user.name "write_config" &&
	echo "[user]" >expected &&
	echo "	name = write_config" >>expected &&
	test_cmp expected "$HOME"/.config/git/config

ok 6 - mixed case key

expecting success: 
	check_config get_value case.Movie "BadPhysics"

ok 19 - write: xdg file exists and ~/.gitconfig doesn't

expecting success: 
	>"$HOME"/.gitconfig &&
	git config --global user.name "write_gitconfig" &&
	echo "[user]" >expected &&
	echo "	name = write_gitconfig" >>expected &&
	test_cmp expected "$HOME"/.gitconfig

done.
ok 7 - key and value with mixed case

expecting success: 
	check_config get_value "my.Foo bAr.hi" "mixed-case" &&
	check_config get_value "my.FOO BAR.hi" "upper-case" &&
	check_config get_value "my.foo bar.hi" "lower-case"

ok 20 - write: xdg file exists and ~/.gitconfig exists

expecting success: 
	test_might_fail rm "$HOME"/.gitconfig &&
	test_might_fail rm "$HOME"/.config/git/config &&
	git config --global user.name "write_gitconfig" &&
	echo "[user]" >expected &&
	echo "	name = write_gitconfig" >>expected &&
	test_cmp expected "$HOME"/.gitconfig

ok 21 - write: ~/.config/git/ exists and config file doesn't

ok 8 - key with case sensitive subsection

expecting success: 
	check_config get_value cores.baz "ball" &&
	check_config get_value Cores.baz "ball" &&
	check_config get_value CORES.baz "ball" &&
	check_config get_value coreS.baz "ball"

# passed all 21 test(s)
1..21
*** t1401-symbolic-ref.sh ***
ok 1 - setup

expecting success: git update-ref refs/heads/master 102939797ab91a4f201d131418d2c9d919dcdd2c &&
	 test 102939797ab91a4f201d131418d2c9d919dcdd2c = $(cat .git/refs/heads/master)
ok 2 - create refs/heads/master

expecting success: git update-ref refs/heads/master 56d5c1374e8028a1e122ab046ab7b98165342dc4 102939797ab91a4f201d131418d2c9d919dcdd2c &&
	 test 56d5c1374e8028a1e122ab046ab7b98165342dc4 = $(cat .git/refs/heads/master)
ok 9 - key with case insensitive section header

expecting success: 
	check_config get_value CORES.BAZ "ball" &&
	check_config get_value cores.baz "ball" &&
	check_config get_value cores.BaZ "ball" &&
	check_config get_value cOreS.bAz "ball"

ok 3 - create refs/heads/master

expecting success: 
	test_must_fail git update-ref -d $m $A &&
	test $B = "$(cat .git/$m)"

Submodule path 'sub1': checked out '913780cd9739c4974f32aaa316af9267f73412c2'
error: cannot lock ref 'refs/heads/master': ref refs/heads/master is at 56d5c1374e8028a1e122ab046ab7b98165342dc4 but expected 102939797ab91a4f201d131418d2c9d919dcdd2c
ok 4 - fail to delete refs/heads/master with stale ref

expecting success: 
	git update-ref -d $m $B &&
	! test -f .git/$m

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1401-symbolic-ref/.git/
ok 5 - delete refs/heads/master

expecting success: 
	git symbolic-ref HEAD refs/heads/foo &&
	echo ref: refs/heads/foo >expect &&
	test_cmp expect .git/HEAD

expecting success: 
	git update-ref refs/heads/master 102939797ab91a4f201d131418d2c9d919dcdd2c &&
	test 102939797ab91a4f201d131418d2c9d919dcdd2c = $(cat .git/refs/heads/master) &&
	git update-ref -d refs/heads/master &&
	! test -f .git/refs/heads/master

ok 10 - key with case insensitive section header & variable

expecting success: 
	check_config expect_code 1 get_value "my.fOo Bar.hi" "Value not found for \"my.fOo Bar.hi\""

ok 1 - symbolic-ref writes HEAD

expecting success: 
	echo refs/heads/foo >expect &&
	git symbolic-ref HEAD >actual &&
	test_cmp expect actual

ok 11 - find value with misspelled key

expecting success: 
	check_config get_value case.baz "hask"

ok 2 - symbolic-ref reads HEAD

expecting success: 
	test_must_fail git symbolic-ref HEAD foo

Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
ok 6 - delete refs/heads/master without oldvalue verification

expecting success: touch .git/refs/heads/gu &&
	 test_must_fail git update-ref refs/heads/gu/fixes 102939797ab91a4f201d131418d2c9d919dcdd2c >out 2>err
fatal: Refusing to point HEAD outside of refs/
ok 12 - find value with the highest priority
ok 3 - symbolic-ref refuses non-ref for HEAD


expecting success: 
	check_config get_int lamb.chop 65

expecting success: 
	echo content >file && git add file && git commit -m one &&
	test_must_fail git symbolic-ref HEAD `git rev-parse HEAD`

error: Untracked working tree file 'sub1/file1' would be overwritten by merge.
ok 13 - find integer value for a key

expecting success: 
	check_config get_string case.baz hask &&
	check_config expect_code 1 get_string case.ba "Value not found for \"case.ba\""

ok 7 - fail to create refs/heads/gu/fixes

expecting success: git update-ref HEAD 102939797ab91a4f201d131418d2c9d919dcdd2c &&
	 test 102939797ab91a4f201d131418d2c9d919dcdd2c = $(cat .git/refs/heads/master)
[foo (root-commit) a06ba86] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 8 - create refs/heads/master (by HEAD)

expecting success: git update-ref HEAD 56d5c1374e8028a1e122ab046ab7b98165342dc4 102939797ab91a4f201d131418d2c9d919dcdd2c &&
	 test 56d5c1374e8028a1e122ab046ab7b98165342dc4 = $(cat .git/refs/heads/master)
fatal: Refusing to point HEAD outside of refs/
ok 4 - symbolic-ref refuses bare sha1

expecting success: 
	git symbolic-ref -d HEAD &&
	test_path_is_file .git/refs/heads/foo &&
	test_path_is_missing .git/HEAD

ok 14 - find string value for a key

expecting success: 
	test_expect_code 128 test-config get_string case.foo 2>result &&
	test_i18ngrep "fatal: .*case\.foo.*\.git/config.*line 7" result

ok 5 - symbolic-ref deletes HEAD

expecting success: 
	git symbolic-ref HEAD refs/heads/missing &&
	git symbolic-ref -d HEAD &&
	test_path_is_missing .git/refs/heads/missing &&
	test_path_is_missing .git/HEAD

ok 9 - create refs/heads/master (by HEAD)

expecting success: 
	test_must_fail git update-ref -d HEAD $A &&
	test $B = $(cat .git/$m)

fatal: bad config variable 'case.foo' in file '.git/config' at line 7
ok 15 - check line error when NULL string is queried

expecting success: 
	check_config expect_code 128 get_int lamb.head

error: cannot lock ref 'HEAD': ref refs/heads/master is at 56d5c1374e8028a1e122ab046ab7b98165342dc4 but expected 102939797ab91a4f201d131418d2c9d919dcdd2c
ok 10 - fail to delete refs/heads/master (by HEAD) with stale ref

expecting success: 
	git update-ref -d HEAD $B &&
	! test -f .git/$m

fatal: bad numeric config value 'none' for 'lamb.head': invalid unit
ok 6 - symbolic-ref deletes dangling HEAD

expecting success: 
	echo "fatal: Cannot delete FOO, not a symbolic ref" >expect &&
	test_must_fail git symbolic-ref -d FOO >actual 2>&1 &&
	test_cmp expect actual

ok 16 - find integer if value is non parse-able

expecting success: 
	check_config get_bool goat.head 1 &&
	check_config get_bool goat.skin 0 &&
	check_config get_bool goat.nose 1 &&
	check_config get_bool goat.horns 1 &&
	check_config get_bool goat.legs 1

ok 11 - delete refs/heads/master (by HEAD)

expecting success: git update-ref HEAD 102939797ab91a4f201d131418d2c9d919dcdd2c &&
	 test 102939797ab91a4f201d131418d2c9d919dcdd2c = $(cat .git/refs/heads/master)
ok 8 - git read-tree -u -m: replace submodule with a directory must fail

expecting success: 
		prolog &&
		reset_work_tree_to add_sub1 &&
		(
			cd submodule_update &&
			git branch -t replace_sub1_with_directory origin/replace_sub1_with_directory &&
			replace_gitfile_with_git_dir sub1 &&
			test_must_fail $command replace_sub1_with_directory &&
			test_superproject_content origin/add_sub1 &&
			test_git_directory_is_unchanged sub1 &&
			test_submodule_content sub1 origin/add_sub1
		)
	
ok 7 - symbolic-ref fails to delete missing FOO

expecting success: 
	echo "fatal: Cannot delete refs/heads/foo, not a symbolic ref" >expect &&
	test_must_fail git symbolic-ref -d refs/heads/foo >actual 2>&1 &&
	test_path_is_file .git/refs/heads/foo &&
	test_cmp expect actual

ok 12 - create refs/heads/master (by HEAD)

expecting success: git pack-refs --all
ok 8 - symbolic-ref fails to delete real ref

# passed all 8 test(s)
1..8
ok 13 - pack refs

expecting success: git update-ref HEAD 56d5c1374e8028a1e122ab046ab7b98165342dc4 102939797ab91a4f201d131418d2c9d919dcdd2c &&
	 test 56d5c1374e8028a1e122ab046ab7b98165342dc4 = $(cat .git/refs/heads/master)
ok 17 - find bool value for the entered key

expecting success: 
	check_config get_value_multi case.baz sam bat hask

ok 14 - move refs/heads/master (by HEAD)

expecting success: 
	git update-ref -d HEAD $B &&
	! grep "$m" .git/packed-refs &&
	! test -f .git/$m

*** t1402-check-ref-format.sh ***
ok 18 - find multiple values

expecting success: 
	cat >config2 <<-\EOF &&
	[case]
		baz = lama
	[my]
		new = silk
	[case]
		baz = ball
	EOF
	echo silk >expect &&
	test-config configset_get_value my.new config2 .git/config >actual &&
	test_cmp expect actual

Cloning into 'submodule_update'...
ok 15 - delete refs/heads/master (by HEAD) should remove both packed and loose refs/heads/master

expecting success: 
	git update-ref --no-deref -d HEAD &&
	! test -f .git/HEAD

ok 19 - find value from a configset

expecting success: 
	echo hask >expect &&
	test-config configset_get_value case.baz config2 .git/config >actual &&
	test_cmp expect actual

ok 16 - delete symref without dereference

expecting success: 
	echo foo >foo.c &&
	git add foo.c &&
	git commit -m foo &&
	git pack-refs --all &&
	git update-ref --no-deref -d HEAD &&
	! test -f .git/HEAD

done.
ok 20 - find value with highest priority from a configset

expecting success: 
	cat >except <<-\EOF &&
	sam
	bat
	hask
	lama
	ball
	EOF
	test-config configset_get_value case.baz config2 .git/config >actual &&
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1402-check-ref-format/.git/
ok 21 - find value_list for a key from a configset

expecting success: 
	echo "Error (-1) reading configuration file non-existent-file." >expect &&
	test_expect_code 2 test-config configset_get_value foo.bar non-existent-file 2>actual &&
	test_cmp expect actual

[master (root-commit) 40d5b0c] foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo.c
expecting success: 
		test_must_fail git check-ref-format  ''
	
ok 22 - proper error on non-existent files

checking prerequisite: SANITY

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	mkdir SANETESTD.1 SANETESTD.2 &&

	chmod +w SANETESTD.1 SANETESTD.2 &&
	>SANETESTD.1/x 2>SANETESTD.2/x &&
	chmod -w SANETESTD.1 &&
	chmod -rx SANETESTD.2 ||
	error "bug in test sript: cannot prepare SANETESTD"

	! rm SANETESTD.1/x && ! test -f SANETESTD.2/x
	status=$?

	chmod +rwx SANETESTD.1 SANETESTD.2 &&
	rm -rf SANETESTD.1 SANETESTD.2 ||
	error "bug in test sript: cannot clean SANETESTD"
	return $status

)
ok 1 - ref name '' is invalid

expecting success: 
		test_must_fail git check-ref-format  '/'
	
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 2 - ref name '/' is invalid

ok 17 - delete symref without dereference when the referred ref is packed

expecting success: 
		test_must_fail git check-ref-format --allow-onelevel '/'
	
rm: cannot remove 'SANETESTD.1/x': Permission denied
prerequisite SANITY ok
expecting success: 
	chmod -r .git/config &&
	test_when_finished "chmod +r .git/config" &&
	echo "Error (-1) reading configuration file .git/config." >expect &&
	test_expect_code 2 test-config configset_get_value foo.bar .git/config 2>actual &&
	test_cmp expect actual

ok 3 - ref name '/' is invalid with options --allow-onelevel

expecting success: 
		test_must_fail git check-ref-format --normalize '/'
	
expecting success: 
	git symbolic-ref refs/heads/self refs/heads/self &&
	test_when_finished "rm -f .git/refs/heads/self" &&
	test_path_is_file .git/refs/heads/self &&
	test_must_fail git update-ref -d refs/heads/self &&
	test_path_is_file .git/refs/heads/self

ok 23 - proper error on non-accessible files

expecting success: 
	cp .git/config .git/config.old &&
	test_when_finished "mv .git/config.old .git/config" &&
	echo "[" >>.git/config &&
	echo "fatal: bad config file line 34 in .git/config" >expect &&
	test_expect_code 128 test-config get_value foo.bar 2>actual &&
	test_cmp expect actual

ok 4 - ref name '/' is invalid with options --normalize

expecting success: 
		test_must_fail git check-ref-format --allow-onelevel --normalize '/'
	
error: cannot lock ref 'refs/heads/self': unable to resolve reference refs/heads/self: Too many levels of symbolic links
ok 5 - ref name '/' is invalid with options --allow-onelevel --normalize

expecting success: 
		git check-ref-format  'foo/bar/baz'
	
ok 18 - update-ref -d is not confused by self-reference

expecting success: 
	git symbolic-ref refs/heads/self refs/heads/self &&
	test_when_finished "rm -f .git/refs/heads/self" &&
	test_path_is_file .git/refs/heads/self &&
	git update-ref --no-deref -d refs/heads/self &&
	test_path_is_missing .git/refs/heads/self

ok 24 - proper error on error in default config files

expecting success: 
	echo "[" >>syntax-error &&
	echo "fatal: bad config file line 1 in syntax-error" >expect &&
	test_expect_code 128 test-config configset_get_value foo.bar syntax-error 2>actual &&
	test_cmp expect actual

ok 6 - ref name 'foo/bar/baz' is valid

expecting success: 
		git check-ref-format --normalize 'foo/bar/baz'
	
foo/bar/baz
ok 7 - ref name 'foo/bar/baz' is valid with options --normalize

expecting success: 
		test_must_fail git check-ref-format  'refs///heads/foo'
	
ok 25 - proper error on error in custom config files

expecting success: 
	mv .git/config .git/config.old &&
	test_when_finished "mv .git/config.old .git/config" &&
	cat >.git/config <<-\EOF &&
	[alias]
		br
	EOF
	test_expect_code 128 git br 2>result &&
	test_i18ngrep "fatal: .*alias\.br.*\.git/config.*line 2" result

ok 8 - ref name 'refs///heads/foo' is invalid

expecting success: 
		git check-ref-format --normalize 'refs///heads/foo'
	
ok 19 - update-ref --no-deref -d can delete self-reference

expecting success: 
	>.git/refs/heads/bad &&
	test_when_finished "rm -f .git/refs/heads/bad" &&
	git symbolic-ref refs/heads/ref-to-bad refs/heads/bad &&
	test_when_finished "rm -f .git/refs/heads/ref-to-bad" &&
	test_path_is_file .git/refs/heads/ref-to-bad &&
	git update-ref --no-deref -d refs/heads/ref-to-bad &&
	test_path_is_missing .git/refs/heads/ref-to-bad

refs/heads/foo
ok 9 - ref name 'refs///heads/foo' is valid with options --normalize

expecting success: 
		test_must_fail git check-ref-format  'heads/foo/'
	
ok 10 - ref name 'heads/foo/' is invalid

expecting success: 
		test_must_fail git check-ref-format  '/heads/foo'
	
fatal: bad config variable 'alias.br' in file '.git/config' at line 2
ok 26 - check line errors for malformed values

ok 11 - ref name '/heads/foo' is invalid

expecting success: 
		git check-ref-format --normalize '/heads/foo'
	
ok 20 - update-ref --no-deref -d can delete reference to bad ref

expecting success: 
	test_must_fail git update-ref HEAD 102939797ab91a4f201d131418d2c9d919dcdd2c 56d5c1374e8028a1e122ab046ab7b98165342dc4

# passed all 26 test(s)
1..26
heads/foo
ok 12 - ref name '/heads/foo' is valid with options --normalize

expecting success: 
		test_must_fail git check-ref-format  '///heads/foo'
	
fatal: update_ref failed for ref 'HEAD': cannot lock ref 'HEAD': unable to resolve reference HEAD: No such file or directory
ok 21 - (not) create HEAD with old sha1

expecting success: 
	! test -f .git/refs/heads/master

ok 13 - ref name '///heads/foo' is invalid

expecting success: 
		git check-ref-format --normalize '///heads/foo'
	
ok 22 - (not) prior created .git/refs/heads/master

expecting success: git update-ref HEAD 102939797ab91a4f201d131418d2c9d919dcdd2c
heads/foo
ok 14 - ref name '///heads/foo' is valid with options --normalize

expecting success: 
		test_must_fail git check-ref-format  './foo'
	
*** t1403-show-ref.sh ***
ok 23 - create HEAD

ok 15 - ref name './foo' is invalid

expecting success: 
	test_must_fail git update-ref HEAD 56d5c1374e8028a1e122ab046ab7b98165342dc4 0000000000000000000000000000000000000000

expecting success: 
		test_must_fail git check-ref-format  './foo/bar'
	
ok 16 - ref name './foo/bar' is invalid

expecting success: 
		test_must_fail git check-ref-format  'foo/./bar'
	
fatal: update_ref failed for ref 'HEAD': cannot lock ref 'HEAD': ref refs/heads/master is at 102939797ab91a4f201d131418d2c9d919dcdd2c but expected 0000000000000000000000000000000000000000
ok 24 - (not) change HEAD with wrong SHA1

expecting success: 
	! test 56d5c1374e8028a1e122ab046ab7b98165342dc4 = $(cat .git/refs/heads/master)

ok 17 - ref name 'foo/./bar' is invalid

expecting success: 
		test_must_fail git check-ref-format  'foo/bar/.'
	
ok 25 - (not) changed .git/refs/heads/master

expecting success: GIT_COMMITTER_DATE="2005-05-26 23:30" \
	 git update-ref HEAD 102939797ab91a4f201d131418d2c9d919dcdd2c -m "Initial Creation" &&
	 test 102939797ab91a4f201d131418d2c9d919dcdd2c = $(cat .git/refs/heads/master)
ok 18 - ref name 'foo/bar/.' is invalid

expecting success: 
		test_must_fail git check-ref-format  '.refs/foo'
	
ok 19 - ref name '.refs/foo' is invalid

expecting success: 
		test_must_fail git check-ref-format  'refs/heads/foo.'
	
ok 26 - create refs/heads/master (logged by touch)

expecting success: GIT_COMMITTER_DATE="2005-05-26 23:31" \
	 git update-ref HEAD 56d5c1374e8028a1e122ab046ab7b98165342dc4 102939797ab91a4f201d131418d2c9d919dcdd2c -m "Switch" &&
	 test 56d5c1374e8028a1e122ab046ab7b98165342dc4 = $(cat .git/refs/heads/master)
ok 20 - ref name 'refs/heads/foo.' is invalid

expecting success: 
		test_must_fail git check-ref-format  'heads/foo..bar'
	
ok 21 - ref name 'heads/foo..bar' is invalid

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
expecting success: 
		test_must_fail git check-ref-format  'heads/foo?bar'
	
ok 27 - update refs/heads/master (logged by touch)

expecting success: GIT_COMMITTER_DATE="2005-05-26 23:41" \
	 git update-ref HEAD 102939797ab91a4f201d131418d2c9d919dcdd2c &&
	 test 102939797ab91a4f201d131418d2c9d919dcdd2c = $(cat .git/refs/heads/master)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1403-show-ref/.git/
ok 22 - ref name 'heads/foo?bar' is invalid

expecting success: 
		git check-ref-format  'foo./bar'
	
expecting success: 
	test_commit A &&
	git tag -f -a -m "annotated A" A &&
	git checkout -b side &&
	test_commit B &&
	git tag -f -a -m "annotated B" B &&
	git checkout master &&
	test_commit C &&
	git branch B A^0

ok 23 - ref name 'foo./bar' is valid

expecting success: 
		test_must_fail git check-ref-format  'heads/foo.lock'
	
ok 28 - set refs/heads/master (logged by touch)

expecting success: test_cmp expect .git/logs/refs/heads/master
ok 29 - verifying refs/heads/master's log

ok 24 - ref name 'heads/foo.lock' is invalid

expecting success: 
		test_must_fail git check-ref-format  'heads///foo.lock'
	
expecting success: git config core.logAllRefUpdates true &&
	 test true = $(git config --bool --get core.logAllRefUpdates)
ok 25 - ref name 'heads///foo.lock' is invalid

expecting success: 
		test_must_fail git check-ref-format  'foo.lock/bar'
	
[master (root-commit) 0ddfaf1] A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 A.t
ok 30 - enable core.logAllRefUpdates

expecting success: GIT_COMMITTER_DATE="2005-05-26 23:32" \
	 git update-ref HEAD 102939797ab91a4f201d131418d2c9d919dcdd2c -m "Initial Creation" &&
	 test 102939797ab91a4f201d131418d2c9d919dcdd2c = $(cat .git/refs/heads/master)
ok 26 - ref name 'foo.lock/bar' is invalid

expecting success: 
		test_must_fail git check-ref-format  'foo.lock///bar'
	
ok 27 - ref name 'foo.lock///bar' is invalid

expecting success: 
		git check-ref-format  'heads/foo@bar'
	
ok 28 - ref name 'heads/foo@bar' is valid

expecting success: 
		test_must_fail git check-ref-format  'heads/v@{ation'
	
ok 31 - create refs/heads/master (logged by config)

expecting success: GIT_COMMITTER_DATE="2005-05-26 23:33" \
	 git update-ref HEAD 56d5c1374e8028a1e122ab046ab7b98165342dc4 102939797ab91a4f201d131418d2c9d919dcdd2c -m "Switch" &&
	 test 56d5c1374e8028a1e122ab046ab7b98165342dc4 = $(cat .git/refs/heads/master)
Updated tag 'A' (was 0ddfaf1)
ok 29 - ref name 'heads/v@{ation' is invalid

expecting success: 
		test_must_fail git check-ref-format  'heads/foo\bar'
	
Switched to a new branch 'side'
ok 30 - ref name 'heads/foo\bar' is invalid

expecting success: 
		test_must_fail git check-ref-format  'heads/foo	'
	
ok 32 - update refs/heads/master (logged by config)

expecting success: GIT_COMMITTER_DATE="2005-05-26 23:43" \
	 git update-ref HEAD 102939797ab91a4f201d131418d2c9d919dcdd2c &&
	 test 102939797ab91a4f201d131418d2c9d919dcdd2c = $(cat .git/refs/heads/master)
ok 31 - ref name 'heads/foo	' is invalid
Cloning into 'sub1'...

expecting success: 
		test_must_fail git check-ref-format  'heads/foo'
	
ok 32 - ref name 'heads/foo' is invalid

expecting success: 
		git check-ref-format  'heads/fuß'
	
ok 33 - set refs/heads/master (logged by config)

ok 33 - ref name 'heads/fuß' is valid

expecting success: 
		test_must_fail git check-ref-format --refspec-pattern 'heads/*foo/bar'
	
[side d9df450] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 B.t
expecting success: test_cmp expect .git/logs/$m
ok 34 - verifying refs/heads/master's log

ok 34 - ref name 'heads/*foo/bar' is invalid with options --refspec-pattern

expecting success: 
		test_must_fail git check-ref-format --refspec-pattern 'heads/foo*/bar'
	
ok 35 - ref name 'heads/foo*/bar' is invalid with options --refspec-pattern

expecting success: 
		test_must_fail git check-ref-format --refspec-pattern 'heads/f*o/bar'
	
done.
Updated tag 'B' (was d9df450)
expecting success: rm -f o e &&
	 git rev-parse --verify "master@{May 25 2005}" >o 2>e &&
	 test 3cceb89b690679aecbe1db39079f99221f1aaaa6 = $(cat o) &&
	 test "warning: Log for 'master' only goes back to $ed." = "$(cat e)"
ok 36 - ref name 'heads/f*o/bar' is invalid with options --refspec-pattern

expecting success: 
		test_must_fail git check-ref-format  'foo'
	
ok 37 - ref name 'foo' is invalid

Switched to branch 'master'
expecting success: 
		git check-ref-format --allow-onelevel 'foo'
	
ok 38 - ref name 'foo' is valid with options --allow-onelevel

expecting success: 
		test_must_fail git check-ref-format --refspec-pattern 'foo'
	
ok 35 - Query "master@{May 25 2005}" (before history)

expecting success: rm -f o e &&
	 git rev-parse --verify master@{2005-05-25} >o 2>e &&
	 test 3cceb89b690679aecbe1db39079f99221f1aaaa6 = $(cat o) &&
	 echo test "warning: Log for 'master' only goes back to $ed." = "$(cat e)"
ok 39 - ref name 'foo' is invalid with options --refspec-pattern

expecting success: 
		git check-ref-format --refspec-pattern --allow-onelevel 'foo'
	
ok 40 - ref name 'foo' is valid with options --refspec-pattern --allow-onelevel

expecting success: 
		test_must_fail git check-ref-format --normalize 'foo'
	
test warning: Log for 'master' only goes back to Thu, 26 May 2005 18:32:00 -0500. = warning: Log for 'master' only goes back to Thu, 26 May 2005 18:32:00 -0500.
ok 36 - Query master@{2005-05-25} (before history)

ok 41 - ref name 'foo' is invalid with options --normalize

expecting success: rm -f o e &&
	 git rev-parse --verify "master@{May 26 2005 23:31:59}" >o 2>e &&
	 test 3cceb89b690679aecbe1db39079f99221f1aaaa6 = $(cat o) &&
	 test "warning: Log for 'master' only goes back to $ed." = "$(cat e)"
expecting success: 
		git check-ref-format --allow-onelevel --normalize 'foo'
	
[master 5dee784] C
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 C.t
foo
ok 42 - ref name 'foo' is valid with options --allow-onelevel --normalize

expecting success: 
		git check-ref-format  'foo/bar'
	
ok 37 - Query "master@{May 26 2005 23:31:59}" (1 second before history)

expecting success: rm -f o e &&
	 git rev-parse --verify "master@{May 26 2005 23:32:00}" >o 2>e &&
	 test 3cceb89b690679aecbe1db39079f99221f1aaaa6 = $(cat o) &&
	 test "" = "$(cat e)"
ok 43 - ref name 'foo/bar' is valid

expecting success: 
		git check-ref-format --allow-onelevel 'foo/bar'
	
ok 44 - ref name 'foo/bar' is valid with options --allow-onelevel

expecting success: 
		git check-ref-format --refspec-pattern 'foo/bar'
	
ok 1 - setup

expecting success: 
	echo $(git rev-parse refs/tags/A) refs/tags/A >expect &&

	git show-ref A >actual &&
	test_cmp expect actual &&

	git show-ref tags/A >actual &&
	test_cmp expect actual &&

	git show-ref refs/tags/A >actual &&
	test_cmp expect actual &&

	>expect &&

	test_must_fail git show-ref D >actual &&
	test_cmp expect actual

ok 38 - Query "master@{May 26 2005 23:32:00}" (exactly history start)

expecting success: rm -f o e &&
	 git rev-parse --verify "master@{May 26 2005 23:32:30}" >o 2>e &&
	 test 102939797ab91a4f201d131418d2c9d919dcdd2c = $(cat o) &&
	 test "" = "$(cat e)"
ok 45 - ref name 'foo/bar' is valid with options --refspec-pattern

expecting success: 
		git check-ref-format --refspec-pattern --allow-onelevel 'foo/bar'
	
ok 46 - ref name 'foo/bar' is valid with options --refspec-pattern --allow-onelevel

expecting success: 
		git check-ref-format --normalize 'foo/bar'
	
foo/bar
ok 47 - ref name 'foo/bar' is valid with options --normalize

expecting success: 
		test_must_fail git check-ref-format  'foo/*'
	
ok 48 - ref name 'foo/*' is invalid

expecting success: 
		test_must_fail git check-ref-format --allow-onelevel 'foo/*'
	
ok 39 - Query "master@{May 26 2005 23:32:30}" (first non-creation change)

expecting success: rm -f o e &&
	 git rev-parse --verify "master@{2005-05-26 23:33:01}" >o 2>e &&
	 test 56d5c1374e8028a1e122ab046ab7b98165342dc4 = $(cat o) &&
	 test "warning: Log for ref refs/heads/master has gap after Thu, 26 May 2005 18:33:00 -0500." = "$(cat e)"
ok 49 - ref name 'foo/*' is invalid with options --allow-onelevel

expecting success: 
		git check-ref-format --refspec-pattern 'foo/*'
	
Submodule path 'sub1': checked out '913780cd9739c4974f32aaa316af9267f73412c2'
ok 50 - ref name 'foo/*' is valid with options --refspec-pattern

expecting success: 
		git check-ref-format --refspec-pattern --allow-onelevel 'foo/*'
	
ok 51 - ref name 'foo/*' is valid with options --refspec-pattern --allow-onelevel

expecting success: 
		test_must_fail git check-ref-format  '*/foo'
	
ok 2 - show-ref

expecting success: 
	>expect &&

	git show-ref -q A >actual &&
	test_cmp expect actual &&

	git show-ref -q tags/A >actual &&
	test_cmp expect actual &&

	git show-ref -q refs/tags/A >actual &&
	test_cmp expect actual &&

	test_must_fail git show-ref -q D >actual &&
	test_cmp expect actual

ok 52 - ref name '*/foo' is invalid

expecting success: 
		test_must_fail git check-ref-format --allow-onelevel '*/foo'
	
ok 40 - Query "master@{2005-05-26 23:33:01}" (middle of history with gap)

expecting success: rm -f o e &&
	 git rev-parse --verify "master@{2005-05-26 23:38:00}" >o 2>e &&
	 test 0000000000000000000000000000000000000000 = $(cat o) &&
	 test "" = "$(cat e)"
ok 53 - ref name '*/foo' is invalid with options --allow-onelevel

expecting success: 
		git check-ref-format --refspec-pattern '*/foo'
	
ok 41 - Query "master@{2005-05-26 23:38:00}" (middle of history)

expecting success: rm -f o e &&
	 git rev-parse --verify "master@{2005-05-26 23:43:00}" >o 2>e &&
	 test a6166d2809963b1da1148e6922729c21214390c8 = $(cat o) &&
	 test "" = "$(cat e)"
ok 54 - ref name '*/foo' is valid with options --refspec-pattern

expecting success: 
		git check-ref-format --refspec-pattern --allow-onelevel '*/foo'
	
ok 55 - ref name '*/foo' is valid with options --refspec-pattern --allow-onelevel

expecting success: 
		test_must_fail git check-ref-format --normalize '*/foo'
	
ok 56 - ref name '*/foo' is invalid with options --normalize

expecting success: 
		git check-ref-format --refspec-pattern --normalize '*/foo'
	
ok 42 - Query "master@{2005-05-26 23:43:00}" (exact end of history)

expecting success: rm -f o e &&
	 git rev-parse --verify "master@{2005-05-28}" >o 2>e &&
	 test 26caa67a0d551891a2ecec76098a9f8e705ab059 = $(cat o) &&
	 test "warning: Log for ref refs/heads/master unexpectedly ended on Thu, 26 May 2005 18:43:00 -0500." = "$(cat e)"
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
ok 3 - show-ref -q

expecting success: 
	echo $(git rev-parse refs/tags/A) refs/tags/A >expect &&

	git show-ref --verify refs/tags/A >actual &&
	test_cmp expect actual &&

	>expect &&

	test_must_fail git show-ref --verify A >actual &&
	test_cmp expect actual &&

	test_must_fail git show-ref --verify tags/A >actual &&
	test_cmp expect actual &&

	test_must_fail git show-ref --verify D >actual &&
	test_cmp expect actual

*/foo
ok 57 - ref name '*/foo' is valid with options --refspec-pattern --normalize

expecting success: 
		test_must_fail git check-ref-format  'foo/*/bar'
	
ok 43 - Query "master@{2005-05-28}" (past end of history)

expecting success: echo TEST >F &&
     git add F &&
	 GIT_AUTHOR_DATE="2005-05-26 23:30" \
	 GIT_COMMITTER_DATE="2005-05-26 23:30" git commit -m add -a &&
	 h_TEST=$(git rev-parse --verify HEAD) &&
	 echo The other day this did not work. >M &&
	 echo And then Bob told me how to fix it. >>M &&
	 echo OTHER >F &&
	 GIT_AUTHOR_DATE="2005-05-26 23:41" \
	 GIT_COMMITTER_DATE="2005-05-26 23:41" git commit -F M -a &&
	 h_OTHER=$(git rev-parse --verify HEAD) &&
	 GIT_AUTHOR_DATE="2005-05-26 23:44" \
	 GIT_COMMITTER_DATE="2005-05-26 23:44" git commit --amend &&
	 h_FIXED=$(git rev-parse --verify HEAD) &&
	 echo Merged initial commit and a later commit. >M &&
	 echo $h_TEST >.git/MERGE_HEAD &&
	 GIT_AUTHOR_DATE="2005-05-26 23:45" \
	 GIT_COMMITTER_DATE="2005-05-26 23:45" git commit -F M &&
	 h_MERGED=$(git rev-parse --verify HEAD) &&
	 rm -f M
ok 58 - ref name 'foo/*/bar' is invalid

expecting success: 
		test_must_fail git check-ref-format --allow-onelevel 'foo/*/bar'
	
ok 59 - ref name 'foo/*/bar' is invalid with options --allow-onelevel

expecting success: 
		git check-ref-format --refspec-pattern 'foo/*/bar'
	
fatal: 'A' - not a valid ref
ok 60 - ref name 'foo/*/bar' is valid with options --refspec-pattern

expecting success: 
		git check-ref-format --refspec-pattern --allow-onelevel 'foo/*/bar'
	
[master (root-commit) 0c23f5f] add
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 F
 create mode 100644 foo.c
fatal: 'tags/A' - not a valid ref
ok 61 - ref name 'foo/*/bar' is valid with options --refspec-pattern --allow-onelevel

expecting success: 
		test_must_fail git check-ref-format  '*'
	
ok 62 - ref name '*' is invalid

expecting success: 
		test_must_fail git check-ref-format --allow-onelevel '*'
	
fatal: 'D' - not a valid ref
ok 4 - show-ref --verify

ok 63 - ref name '*' is invalid with options --allow-onelevel

expecting success: 
	>expect &&

	git show-ref --verify -q refs/tags/A >actual &&
	test_cmp expect actual &&

	test_must_fail git show-ref --verify -q A >actual &&
	test_cmp expect actual &&

	test_must_fail git show-ref --verify -q tags/A >actual &&
	test_cmp expect actual &&

	test_must_fail git show-ref --verify -q D >actual &&
	test_cmp expect actual

expecting success: 
		test_must_fail git check-ref-format --refspec-pattern '*'
	
[master d3968db] The other day this did not work. And then Bob told me how to fix it.
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 64 - ref name '*' is invalid with options --refspec-pattern

expecting success: 
		git check-ref-format --refspec-pattern --allow-onelevel '*'
	
ok 65 - ref name '*' is valid with options --refspec-pattern --allow-onelevel

expecting success: 
		test_must_fail git check-ref-format --refspec-pattern 'foo/*/*'
	
error: Untracked working tree file 'sub1/file1' would be overwritten by merge.
[master e66de33] The other day this did not work. And then Bob told me how to fix it.
 Author: A U Thor <author@example.com>
 Date: Thu May 26 23:41:00 2005 +0000
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 66 - ref name 'foo/*/*' is invalid with options --refspec-pattern

expecting success: 
		test_must_fail git check-ref-format --refspec-pattern --allow-onelevel 'foo/*/*'
	
ok 67 - ref name 'foo/*/*' is invalid with options --refspec-pattern --allow-onelevel

expecting success: 
		test_must_fail git check-ref-format --refspec-pattern '*/foo/*'
	
[master 29d1ccd] Merged initial commit and a later commit.
 Author: A U Thor <author@example.com>
ok 5 - show-ref --verify -q

expecting success: 
	{
		echo $(git rev-parse refs/tags/A) refs/tags/A &&
		echo $(git rev-parse refs/tags/A^0) "refs/tags/A^{}"
		echo $(git rev-parse refs/tags/C) refs/tags/C
	} >expect &&
	git show-ref -d A C >actual &&
	test_cmp expect actual &&

	git show-ref -d tags/A tags/C >actual &&
	test_cmp expect actual &&

	git show-ref -d refs/tags/A refs/tags/C >actual &&
	test_cmp expect actual &&

	echo $(git rev-parse refs/heads/master) refs/heads/master >expect &&
	git show-ref -d master >actual &&
	test_cmp expect actual &&

	git show-ref -d heads/master >actual &&
	test_cmp expect actual &&

	git show-ref -d refs/heads/master >actual &&
	test_cmp expect actual &&

	git show-ref -d --verify refs/heads/master >actual &&
	test_cmp expect actual &&

	>expect &&

	test_must_fail git show-ref -d --verify master >actual &&
	test_cmp expect actual &&

	test_must_fail git show-ref -d --verify heads/master >actual &&
	test_cmp expect actual


ok 68 - ref name '*/foo/*' is invalid with options --refspec-pattern

expecting success: 
		test_must_fail git check-ref-format --refspec-pattern --allow-onelevel '*/foo/*'
	
ok 69 - ref name '*/foo/*' is invalid with options --refspec-pattern --allow-onelevel

expecting success: 
		test_must_fail git check-ref-format --refspec-pattern '*/*/foo'
	
ok 44 - creating initial files

expecting success: test_cmp expect .git/logs/refs/heads/master
ok 70 - ref name '*/*/foo' is invalid with options --refspec-pattern

expecting success: 
		test_must_fail git check-ref-format --refspec-pattern --allow-onelevel '*/*/foo'
	
ok 45 - git commit logged updates

expecting success: test OTHER = $(git cat-file blob master:F)
ok 71 - ref name '*/*/foo' is invalid with options --refspec-pattern --allow-onelevel

expecting success: 
		test_must_fail git check-ref-format  '/foo'
	
ok 46 - git cat-file blob master:F (expect OTHER)

expecting success: test TEST = $(git cat-file blob "master@{2005-05-26 23:30}:F")
ok 72 - ref name '/foo' is invalid

expecting success: 
		test_must_fail git check-ref-format --allow-onelevel '/foo'
	
ok 47 - git cat-file blob master@{2005-05-26 23:30}:F (expect TEST)

expecting success: test OTHER = $(git cat-file blob "master@{2005-05-26 23:42}:F")
ok 73 - ref name '/foo' is invalid with options --allow-onelevel

ok 48 - git cat-file blob master@{2005-05-26 23:42}:F (expect OTHER)

expecting success: 
	echo "$pws" >"$pws" &&
	git add -- "$pws" &&
	git commit -m "$pws"

expecting success: 
		test_must_fail git check-ref-format --refspec-pattern '/foo'
	
ok 74 - ref name '/foo' is invalid with options --refspec-pattern

expecting success: 
		test_must_fail git check-ref-format --refspec-pattern --allow-onelevel '/foo'
	
ok 75 - ref name '/foo' is invalid with options --refspec-pattern --allow-onelevel

[master 777b7c0] path with space
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 path with space
expecting success: 
		test_must_fail git check-ref-format --normalize '/foo'
	
ok 49 - stdin test setup

expecting success: 
	test_must_fail git update-ref -z $m $m $m 2>err &&
	grep "usage: git update-ref" err

ok 9 - git read-tree -u -m: replace submodule containing a .git directory with a directory must fail

checking known breakage: 
		prolog &&
		reset_work_tree_to add_sub1 &&
		(
			cd submodule_update &&
			git branch -t replace_sub1_with_file origin/replace_sub1_with_file &&
			test_must_fail $command replace_sub1_with_file &&
			test_superproject_content origin/add_sub1 &&
			test_submodule_content sub1 origin/add_sub1
		)
	
ok 76 - ref name '/foo' is invalid with options --normalize

usage: git update-ref [<options>] -d <refname> [<old-val>]
expecting success: 
		git check-ref-format --allow-onelevel --normalize '/foo'
	
ok 50 - -z fails without --stdin

expecting success: 
	>stdin &&
	git update-ref --stdin <stdin &&
	git rev-parse --verify -q $m

foo
ok 77 - ref name '/foo' is valid with options --allow-onelevel --normalize

expecting success: 
		test_must_fail git check-ref-format --refspec-pattern --normalize '/foo'
	
777b7c02e1a7bb137bd7443e34eb5512b6a19d6c
ok 51 - stdin works with no input

expecting success: 
	echo "" >stdin &&
	test_must_fail git update-ref --stdin <stdin 2>err &&
	grep "fatal: empty command in input" err

ok 78 - ref name '/foo' is invalid with options --refspec-pattern --normalize

fatal: 'master' - not a valid ref
expecting success: 
		git check-ref-format --refspec-pattern --allow-onelevel --normalize '/foo'
	
fatal: empty command in input
ok 52 - stdin fails on empty line

expecting success: 
	echo " " >stdin &&
	test_must_fail git update-ref --stdin <stdin 2>err &&
	grep "fatal: whitespace before command:  " err

fatal: 'heads/master' - not a valid ref
ok 6 - show-ref -d

expecting success: 
	for branch in B master side
	do
		echo $(git rev-parse refs/heads/$branch) refs/heads/$branch
	done >expect.heads &&
	git show-ref --heads >actual &&
	test_cmp expect.heads actual &&

	for tag in A B C
	do
		echo $(git rev-parse refs/tags/$tag) refs/tags/$tag
	done >expect.tags &&
	git show-ref --tags >actual &&
	test_cmp expect.tags actual &&

	cat expect.heads expect.tags >expect &&
	git show-ref --heads --tags >actual &&
	test_cmp expect actual &&

	{
		echo $(git rev-parse HEAD) HEAD &&
		cat expect.heads expect.tags
	} >expect &&
	git show-ref --heads --tags --head >actual &&
	test_cmp expect actual &&

	{
		echo $(git rev-parse HEAD) HEAD &&
		echo $(git rev-parse refs/heads/B) refs/heads/B
		echo $(git rev-parse refs/tags/B) refs/tags/B
	} >expect &&
	git show-ref --head B >actual &&
	test_cmp expect actual &&

	{
		echo $(git rev-parse HEAD) HEAD &&
		echo $(git rev-parse refs/heads/B) refs/heads/B
		echo $(git rev-parse refs/tags/B) refs/tags/B
		echo $(git rev-parse refs/tags/B^0) "refs/tags/B^{}"
	} >expect &&
	git show-ref --head -d B >actual &&
	test_cmp expect actual

foo
ok 79 - ref name '/foo' is valid with options --refspec-pattern --allow-onelevel --normalize

expecting success: 
	T=$(git write-tree) &&
	sha1=$(echo A | git commit-tree $T) &&
	git update-ref refs/heads/master $sha1 &&
	git update-ref refs/remotes/origin/master $sha1 &&
	git checkout master &&
	git checkout origin/master &&
	git checkout master &&
	refname=$(git check-ref-format --branch @{-1}) &&
	test "$refname" = "$sha1" &&
	refname2=$(git check-ref-format --branch @{-2}) &&
	test "$refname2" = master
fatal: whitespace before command:  
ok 53 - stdin fails on only whitespace

expecting success: 
	echo " create $a $m" >stdin &&
	test_must_fail git update-ref --stdin <stdin 2>err &&
	grep "fatal: whitespace before command:  create $a $m" err

fatal: whitespace before command:  create refs/heads/a refs/heads/master
ok 54 - stdin fails on leading whitespace

expecting success: 
	echo "unknown $a" >stdin &&
	test_must_fail git update-ref --stdin <stdin 2>err &&
	grep "fatal: unknown command: unknown $a" err

Cloning into 'submodule_update'...
fatal: unknown command: unknown refs/heads/a
ok 55 - stdin fails on unknown command

expecting success: 
	echo "create $a \"master" >stdin &&
	test_must_fail git update-ref --stdin <stdin 2>err &&
	grep "fatal: badly quoted argument: \\\"master" err

fatal: badly quoted argument: "master
ok 56 - stdin fails on unbalanced quotes

expecting success: 
	echo "create $a \"ma\zter\"" >stdin &&
	test_must_fail git update-ref --stdin <stdin 2>err &&
	grep "fatal: badly quoted argument: \\\"ma\\\\zter\\\"" err

Already on 'master'
done.
fatal: badly quoted argument: "ma\zter"
ok 57 - stdin fails on invalid escape

expecting success: 
	echo "create \"$a\"master" >stdin &&
	test_must_fail git update-ref --stdin <stdin 2>err &&
	grep "fatal: unexpected character after quoted argument: \\\"$a\\\"master" err

Note: checking out 'origin/master'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at bbd3a83... A
fatal: unexpected character after quoted argument: "refs/heads/a"master
Switched to branch 'master'
ok 58 - stdin fails on junk after quoted argument

expecting success: 
	echo "create " >stdin &&
	test_must_fail git update-ref --stdin <stdin 2>err &&
	grep "fatal: create: missing <ref>" err

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
fatal: create: missing <ref>
ok 59 - stdin fails create with no ref

expecting success: 
	echo "create $a" >stdin &&
	test_must_fail git update-ref --stdin <stdin 2>err &&
	grep "fatal: create $a: missing <newvalue>" err

fatal: create refs/heads/a: missing <newvalue>
ok 60 - stdin fails create with no new value

expecting success: 
	echo "create $a $m $m" >stdin &&
	test_must_fail git update-ref --stdin <stdin 2>err &&
	grep "fatal: create $a: extra input:  $m" err

ok 80 - check-ref-format --branch @{-1}

expecting success: 
	mkdir subdir &&

	T=$(git write-tree) &&
	sha1=$(echo A | git commit-tree $T) &&
	git update-ref refs/heads/master $sha1 &&
	git update-ref refs/remotes/origin/master $sha1 &&
	git checkout master &&
	git checkout origin/master &&
	git checkout master &&
	refname=$(
		cd subdir &&
		git check-ref-format --branch @{-1}
	) &&
	test "$refname" = "$sha1"

fatal: create refs/heads/a: extra input:  refs/heads/master
ok 61 - stdin fails create with too many arguments

expecting success: 
	echo "update " >stdin &&
	test_must_fail git update-ref --stdin <stdin 2>err &&
	grep "fatal: update: missing <ref>" err

fatal: update: missing <ref>
ok 62 - stdin fails update with no ref

expecting success: 
	echo "update $a" >stdin &&
	test_must_fail git update-ref --stdin <stdin 2>err &&
	grep "fatal: update $a: missing <newvalue>" err

fatal: update refs/heads/a: missing <newvalue>
ok 63 - stdin fails update with no new value

expecting success: 
	echo "update $a $m $m $m" >stdin &&
	test_must_fail git update-ref --stdin <stdin 2>err &&
	grep "fatal: update $a: extra input:  $m" err

fatal: update refs/heads/a: extra input:  refs/heads/master
ok 64 - stdin fails update with too many arguments

expecting success: 
	echo "delete " >stdin &&
	test_must_fail git update-ref --stdin <stdin 2>err &&
	grep "fatal: delete: missing <ref>" err

Already on 'master'
Note: checking out 'origin/master'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

fatal: delete: missing <ref>
ok 65 - stdin fails delete with no ref

expecting success: 
	echo "delete $a $m $m" >stdin &&
	test_must_fail git update-ref --stdin <stdin 2>err &&
	grep "fatal: delete $a: extra input:  $m" err

HEAD is now at 346fcc3... A
ok 7 - show-ref --heads, --tags, --head, pattern

Switched to branch 'master'
fatal: delete refs/heads/a: extra input:  refs/heads/master
ok 66 - stdin fails delete with too many arguments

expecting success: 
	echo "verify $a $m $m" >stdin &&
	test_must_fail git update-ref --stdin <stdin 2>err &&
	grep "fatal: verify $a: extra input:  $m" err

# passed all 7 test(s)
1..7
ok 81 - check-ref-format --branch from subdir

expecting success: 
		refname=$(git check-ref-format --normalize 'heads/foo') &&
		test "$refname" = 'heads/foo'
	
ok 82 - ref name 'heads/foo' simplifies to 'heads/foo'

fatal: verify refs/heads/a: extra input:  refs/heads/master
expecting success: 
		refname=$(git check-ref-format --normalize 'refs///heads/foo') &&
		test "$refname" = 'refs/heads/foo'
	
ok 67 - stdin fails verify with too many arguments

expecting success: 
	echo "option unknown" >stdin &&
	test_must_fail git update-ref --stdin <stdin 2>err &&
	grep "fatal: option unknown: unknown" err

ok 83 - ref name 'refs///heads/foo' simplifies to 'refs/heads/foo'

expecting success: 
		refname=$(git check-ref-format --normalize '/heads/foo') &&
		test "$refname" = 'heads/foo'
	
fatal: option unknown: unknown
ok 68 - stdin fails option with unknown name

expecting success: 
	cat >stdin <<-EOF &&
	create $a $m
	create $b $m
	create $a $m
	EOF
	test_must_fail git update-ref --stdin <stdin 2>err &&
	grep "fatal: Multiple updates for ref '$a' not allowed." err

*** t1404-update-ref-df-conflicts.sh ***
ok 84 - ref name '/heads/foo' simplifies to 'heads/foo'

expecting success: 
		refname=$(git check-ref-format --normalize '///heads/foo') &&
		test "$refname" = 'heads/foo'
	
ok 85 - ref name '///heads/foo' simplifies to 'heads/foo'

expecting success: 
		test_must_fail git check-ref-format --normalize 'foo'
	
fatal: Multiple updates for ref 'refs/heads/a' not allowed.
ok 69 - stdin fails with duplicate refs

expecting success: 
	echo "create $a $m" >stdin &&
	git update-ref --stdin <stdin &&
	git rev-parse $m >expect &&
	git rev-parse $a >actual &&
	test_cmp expect actual

ok 86 - check-ref-format --normalize rejects 'foo'

expecting success: 
		test_must_fail git check-ref-format --normalize '/foo'
	
ok 87 - check-ref-format --normalize rejects '/foo'

expecting success: 
		test_must_fail git check-ref-format --normalize 'heads/foo/../bar'
	
ok 88 - check-ref-format --normalize rejects 'heads/foo/../bar'

expecting success: 
		test_must_fail git check-ref-format --normalize 'heads/./foo'
	
ok 89 - check-ref-format --normalize rejects 'heads/./foo'

expecting success: 
		test_must_fail git check-ref-format --normalize 'heads\foo'
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1404-update-ref-df-conflicts/.git/
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 90 - check-ref-format --normalize rejects 'heads\foo'

expecting success: 
		test_must_fail git check-ref-format --normalize 'heads/foo.lock'
	
expecting success: 

	git commit --allow-empty -m Initial &&
	C=$(git rev-parse HEAD)


ok 70 - stdin create ref works

expecting success: 
	git update-ref -d $a &&
	echo "create $a \"$m\"" >stdin &&
	git update-ref --stdin <stdin &&
	git rev-parse $m >expect &&
	git rev-parse $a >actual &&
	test_cmp expect actual

ok 91 - check-ref-format --normalize rejects 'heads/foo.lock'

expecting success: 
		test_must_fail git check-ref-format --normalize 'heads///foo.lock'
	
ok 92 - check-ref-format --normalize rejects 'heads///foo.lock'

expecting success: 
		test_must_fail git check-ref-format --normalize 'foo.lock/bar'
	
[master (root-commit) 158918c] Initial
 Author: A U Thor <author@example.com>
ok 93 - check-ref-format --normalize rejects 'foo.lock/bar'

expecting success: 
		test_must_fail git check-ref-format --normalize 'foo.lock///bar'
	
ok 1 - setup

expecting success: 

	prefix=refs/1l &&
	test_update_rejected $prefix "a c e" false "b c/x d" \
		"$Q$prefix/c$Q exists; cannot create $Q$prefix/c/x$Q"


ok 94 - check-ref-format --normalize rejects 'foo.lock///bar'

ok 71 - stdin succeeds with quoted argument

# passed all 94 test(s)
1..94
expecting success: 
	git update-ref -d $a &&
	echo "create $a \"ma\\163ter\"" >stdin &&
	git update-ref --stdin <stdin &&
	git rev-parse $m >expect &&
	git rev-parse $a >actual &&
	test_cmp expect actual

fatal: cannot lock ref 'refs/1l/c/x': 'refs/1l/c' exists; cannot create 'refs/1l/c/x'
*** t1410-reflog.sh ***
ok 72 - stdin succeeds with escaped character

expecting success: 
	echo "update $b $m $Z" >stdin &&
	git update-ref --stdin <stdin &&
	git rev-parse $m >expect &&
	git rev-parse $b >actual &&
	test_cmp expect actual &&
	git update-ref -d $b

ok 2 - existing loose ref is a simple prefix of new

expecting success: 

	prefix=refs/1p &&
	test_update_rejected $prefix "a c e" true "b c/x d" \
		"$Q$prefix/c$Q exists; cannot create $Q$prefix/c/x$Q"


Cloning into 'sub1'...
ok 73 - stdin update ref creates with zero old value

expecting success: 
	echo "update $b $m $E" >stdin &&
	git update-ref --stdin <stdin &&
	git rev-parse $m >expect &&
	git rev-parse $b >actual &&
	test_cmp expect actual

done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1410-reflog/.git/
expecting success: 
	mkdir -p A/B &&
	echo rat >C &&
	echo ox >A/D &&
	echo tiger >A/B/E &&
	git add . &&

	test_tick && git commit -m rabbit &&
	H=`git rev-parse --verify HEAD` &&
	A=`git rev-parse --verify HEAD:A` &&
	B=`git rev-parse --verify HEAD:A/B` &&
	C=`git rev-parse --verify HEAD:C` &&
	D=`git rev-parse --verify HEAD:A/D` &&
	E=`git rev-parse --verify HEAD:A/B/E` &&
	check_fsck &&

	test_chmod +x C &&
	git add C &&
	test_tick && git commit -m dragon &&
	L=`git rev-parse --verify HEAD` &&
	check_fsck &&

	rm -f C A/B/E &&
	echo snake >F &&
	echo horse >A/G &&
	git add F A/G &&
	test_tick && git commit -a -m sheep &&
	F=`git rev-parse --verify HEAD:F` &&
	G=`git rev-parse --verify HEAD:A/G` &&
	I=`git rev-parse --verify HEAD:A` &&
	J=`git rev-parse --verify HEAD` &&
	check_fsck &&

	rm -f A/G &&
	test_tick && git commit -a -m monkey &&
	K=`git rev-parse --verify HEAD` &&
	check_fsck &&

	check_have A B C D E F G H I J K L &&

	git prune &&

	check_have A B C D E F G H I J K L &&

	check_fsck &&

	test_line_count = 4 .git/logs/refs/heads/master

ok 74 - stdin update ref creates with empty old value

expecting success: 
	echo "create refs/blobs/pws \"$m:$pws\"" >stdin &&
	git update-ref --stdin <stdin &&
	git rev-parse "$m:$pws" >expect &&
	git rev-parse refs/blobs/pws >actual &&
	test_cmp expect actual &&
	git update-ref -d refs/blobs/pws

fatal: cannot lock ref 'refs/1p/c/x': 'refs/1p/c' exists; cannot create 'refs/1p/c/x'
ok 3 - existing packed ref is a simple prefix of new

expecting success: 

	prefix=refs/2l &&
	test_update_rejected $prefix "a c e" false "b c/x/y d" \
		"$Q$prefix/c$Q exists; cannot create $Q$prefix/c/x/y$Q"


[master (root-commit) 07fcc4f] rabbit
 Author: A U Thor <author@example.com>
 3 files changed, 3 insertions(+)
 create mode 100644 A/B/E
 create mode 100644 A/D
 create mode 100644 C
ok 75 - stdin create ref works with path with space to blob

expecting success: 
	echo "update $c $m $m~1" >stdin &&
	test_must_fail git update-ref --stdin <stdin 2>err &&
	grep "fatal: cannot lock ref '$c'" err &&
	test_must_fail git rev-parse --verify -q $c

fatal: cannot lock ref 'refs/2l/c/x/y': 'refs/2l/c' exists; cannot create 'refs/2l/c/x/y'
ok 4 - existing loose ref is a deeper prefix of new

expecting success: 

	prefix=refs/2p &&
	test_update_rejected $prefix "a c e" true "b c/x/y d" \
		"$Q$prefix/c$Q exists; cannot create $Q$prefix/c/x/y$Q"


fatal: cannot lock ref 'refs/heads/c': unable to resolve reference refs/heads/c: No such file or directory
ok 76 - stdin update ref fails with wrong old value

expecting success: 
	echo "update $c $m does-not-exist" >stdin &&
	test_must_fail git update-ref --stdin <stdin 2>err &&
	grep "fatal: update $c: invalid <oldvalue>: does-not-exist" err &&
	test_must_fail git rev-parse --verify -q $c

Submodule path 'sub1': checked out '913780cd9739c4974f32aaa316af9267f73412c2'
fatal: update refs/heads/c: invalid <oldvalue>: does-not-exist
ok 77 - stdin update ref fails with bad old value

expecting success: 
	echo "create $c does-not-exist" >stdin &&
	test_must_fail git update-ref --stdin <stdin 2>err &&
	grep "fatal: create $c: invalid <newvalue>: does-not-exist" err &&
	test_must_fail git rev-parse --verify -q $c

fatal: create refs/heads/c: invalid <newvalue>: does-not-exist
ok 78 - stdin create ref fails with bad new value

expecting success: 
	echo "create $c " >stdin &&
	test_must_fail git update-ref --stdin <stdin 2>err &&
	grep "fatal: create $c: zero <newvalue>" err &&
	test_must_fail git rev-parse --verify -q $c

fatal: cannot lock ref 'refs/2p/c/x/y': 'refs/2p/c' exists; cannot create 'refs/2p/c/x/y'
fatal: create refs/heads/c: zero <newvalue>
ok 5 - existing packed ref is a deeper prefix of new

expecting success: 

	prefix=refs/3l &&
	test_update_rejected $prefix "a c/x e" false "b c d" \
		"$Q$prefix/c/x$Q exists; cannot create $Q$prefix/c$Q"


Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
[master 7d1a0b8] dragon
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 C
ok 79 - stdin create ref fails with zero new value

expecting success: 
	echo "update $b $m~1 $m" >stdin &&
	git update-ref --stdin <stdin &&
	git rev-parse $m~1 >expect &&
	git rev-parse $b >actual &&
	test_cmp expect actual

test_must_fail: command succeeded: git read-tree -u -m replace_sub1_with_file
not ok 10 - git read-tree -u -m: replace submodule with a file must fail # TODO known breakage

checking known breakage: 
		prolog &&
		reset_work_tree_to add_sub1 &&
		(
			cd submodule_update &&
			git branch -t replace_sub1_with_file origin/replace_sub1_with_file &&
			replace_gitfile_with_git_dir sub1 &&
			test_must_fail $command replace_sub1_with_file &&
			test_superproject_content origin/add_sub1 &&
			test_git_directory_is_unchanged sub1 &&
			test_submodule_content sub1 origin/add_sub1
		)
	
ok 80 - stdin update ref works with right old value

expecting success: 
	echo "delete $a $m~1" >stdin &&
	test_must_fail git update-ref --stdin <stdin 2>err &&
	grep "fatal: cannot lock ref '$a'" err &&
	git rev-parse $m >expect &&
	git rev-parse $a >actual &&
	test_cmp expect actual

fatal: cannot lock ref 'refs/3l/c': 'refs/3l/c/x' exists; cannot create 'refs/3l/c'
[master 15ab5f0] sheep
 Author: A U Thor <author@example.com>
 4 files changed, 2 insertions(+), 2 deletions(-)
 delete mode 100644 A/B/E
 create mode 100644 A/G
 delete mode 100755 C
 create mode 100644 F
fatal: cannot lock ref 'refs/heads/a': ref refs/heads/a is at 777b7c02e1a7bb137bd7443e34eb5512b6a19d6c but expected 29d1ccdc7ee9fe415beb2415b6206b8a20f76b1c
ok 6 - new ref is a simple prefix of existing loose

expecting success: 

	prefix=refs/3p &&
	test_update_rejected $prefix "a c/x e" true "b c d" \
		"$Q$prefix/c/x$Q exists; cannot create $Q$prefix/c$Q"


ok 81 - stdin delete ref fails with wrong old value

expecting success: 
	echo "delete $a " >stdin &&
	test_must_fail git update-ref --stdin <stdin 2>err &&
	grep "fatal: delete $a: zero <oldvalue>" err &&
	git rev-parse $m >expect &&
	git rev-parse $a >actual &&
	test_cmp expect actual

fatal: delete refs/heads/a: zero <oldvalue>
Cloning into 'submodule_update'...
ok 82 - stdin delete ref fails with zero old value

expecting success: 
	git symbolic-ref TESTSYMREF $b &&
	cat >stdin <<-EOF &&
	option no-deref
	update TESTSYMREF $a $b
	EOF
	git update-ref --stdin <stdin &&
	git rev-parse TESTSYMREF >expect &&
	git rev-parse $a >actual &&
	test_cmp expect actual &&
	git rev-parse $m~1 >expect &&
	git rev-parse $b >actual &&
	test_cmp expect actual

fatal: cannot lock ref 'refs/3p/c': 'refs/3p/c/x' exists; cannot create 'refs/3p/c'
[master 3ac530f] monkey
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 A/G
ok 7 - new ref is a simple prefix of existing packed

expecting success: 

	prefix=refs/4l &&
	test_update_rejected $prefix "a c/x/y e" false "b c d" \
		"$Q$prefix/c/x/y$Q exists; cannot create $Q$prefix/c$Q"


done.
tree
fatal: cannot lock ref 'refs/4l/c': 'refs/4l/c/x/y' exists; cannot create 'refs/4l/c'
tree
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
blob
ok 8 - new ref is a deeper prefix of existing loose

expecting success: 

	prefix=refs/4p &&
	test_update_rejected $prefix "a c/x/y e" true "b c d" \
		"$Q$prefix/c/x/y$Q exists; cannot create $Q$prefix/c$Q"


blob
ok 83 - stdin update symref works option no-deref

expecting success: 
	git symbolic-ref TESTSYMREF $b &&
	cat >stdin <<-EOF &&
	option no-deref
	delete TESTSYMREF $b
	EOF
	git update-ref --stdin <stdin &&
	test_must_fail git rev-parse --verify -q TESTSYMREF &&
	git rev-parse $m~1 >expect &&
	git rev-parse $b >actual &&
	test_cmp expect actual

blob
blob
blob
commit
tree
commit
fatal: cannot lock ref 'refs/4p/c': 'refs/4p/c/x/y' exists; cannot create 'refs/4p/c'
commit
ok 84 - stdin delete symref works option no-deref

expecting success: 
	echo "delete $b $m~1" >stdin &&
	git update-ref --stdin <stdin &&
	test_must_fail git rev-parse --verify -q $b

ok 9 - new ref is a deeper prefix of existing packed

expecting success: 

	prefix=refs/5 &&
	test_update_rejected $prefix "a e" false "b c c/x d" \
		"cannot process $Q$prefix/c$Q and $Q$prefix/c/x$Q at the same time"


commit
ok 85 - stdin delete ref works with right old value

expecting success: 
	cat >stdin <<-EOF &&
	update $a $m
	create $b $m
	verify $c
	EOF
	git update-ref --stdin <stdin &&
	git rev-parse $m >expect &&
	git rev-parse $a >actual &&
	test_cmp expect actual &&
	git rev-parse $b >actual &&
	test_cmp expect actual &&
	test_must_fail git rev-parse --verify -q $c

tree
tree
blob
fatal: cannot lock ref 'refs/5/c': cannot process 'refs/5/c' and 'refs/5/c/x' at the same time
blob
ok 10 - one new ref is a simple prefix of another

blob
ok 86 - stdin update/create/verify combination works

expecting success: 
	git rev-parse $m >expect &&
	echo "verify $m $m" >stdin &&
	git update-ref --stdin <stdin &&
	git rev-parse $m >actual &&
	test_cmp expect actual

# passed all 10 test(s)
1..10
blob
blob
commit
*** t1411-reflog-show.sh ***
tree
ok 87 - stdin verify succeeds for correct value

expecting success: 
	echo "verify refs/heads/missing $Z" >stdin &&
	git update-ref --stdin <stdin &&
	test_must_fail git rev-parse --verify -q refs/heads/missing

commit
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 88 - stdin verify succeeds for missing reference

expecting success: 
	echo "verify refs/heads/missing" >stdin &&
	git update-ref --stdin <stdin &&
	test_must_fail git rev-parse --verify -q refs/heads/missing

commit
commit
ok 89 - stdin verify treats no value as missing

expecting success: 
	git rev-parse $m >expect &&
	echo "verify $m $m~1" >stdin &&
	test_must_fail git update-ref --stdin <stdin &&
	git rev-parse $m >actual &&
	test_cmp expect actual

ok 1 - setup

expecting success: 
	test_tick && git reset --hard HEAD~2 &&
	test -f C &&
	test -f A/B/E &&
	! test -f F &&
	! test -f A/G &&

	check_have A B C D E F G H I J K L &&

	git prune &&

	check_have A B C D E F G H I J K L &&

	test_line_count = 5 .git/logs/refs/heads/master

fatal: cannot lock ref 'refs/heads/master': ref refs/heads/master is at 777b7c02e1a7bb137bd7443e34eb5512b6a19d6c but expected 29d1ccdc7ee9fe415beb2415b6206b8a20f76b1c
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1411-reflog-show/.git/
HEAD is now at 7d1a0b8 dragon
expecting success: 
	echo content >file &&
	git add file &&
	test_tick &&
	git commit -m one

tree
ok 90 - stdin verify fails for wrong value

expecting success: 
	git rev-parse $m >expect &&
	echo "verify $m $Z" >stdin &&
	test_must_fail git update-ref --stdin <stdin &&
	git rev-parse $m >actual &&
	test_cmp expect actual

tree
blob
fatal: cannot lock ref 'refs/heads/master': ref refs/heads/master is at 777b7c02e1a7bb137bd7443e34eb5512b6a19d6c but expected 0000000000000000000000000000000000000000
blob
Cloning into 'sub1'...
[master (root-commit) e46513e] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 1 - setup

ok 91 - stdin verify fails for mistaken null value

expecting success: 
	M=$(git rev-parse $m) &&
	test_when_finished "git update-ref $m $M" &&
	git rev-parse $m >expect &&
	echo "verify $m" >stdin &&
	test_must_fail git update-ref --stdin <stdin &&
	git rev-parse $m >actual &&
	test_cmp expect actual

blob
expecting success: 
	git log -g -1 >tmp &&
	grep ^Reflog <tmp >actual &&
	test_cmp expect actual

blob
blob
done.
ok 2 - log -g shows reflog headers

commit
fatal: cannot lock ref 'refs/heads/master': ref refs/heads/master is at 777b7c02e1a7bb137bd7443e34eb5512b6a19d6c but expected 0000000000000000000000000000000000000000
expecting success: 
	git log -g -1 --oneline >actual &&
	test_cmp expect actual

tree
commit
ok 3 - oneline reflog format

expecting success: 
	git reflog -1 >actual &&
	test_cmp expect actual

ok 92 - stdin verify fails for mistaken empty value

expecting success: 
	cat >stdin <<-EOF &&
	update $a $m $m
	update $b $m $m
	update $c $Z $E
	EOF
	git update-ref --stdin <stdin &&
	git rev-parse $m >expect &&
	git rev-parse $a >actual &&
	test_cmp expect actual &&
	git rev-parse $b >actual &&
	test_cmp expect actual &&
	test_must_fail git rev-parse --verify -q $c

commit
commit
ok 4 - reflog default format

expecting success: 
	git reflog --format=short -1 >actual &&
	test_cmp expect actual

ok 5 - override reflog default format

tree
expecting success: 
	git log -g -1 HEAD@{now} >tmp &&
	grep ^Reflog <tmp >actual &&
	test_cmp expect actual

tree
ok 93 - stdin update refs works with identity updates

expecting success: 
	git update-ref $c $m &&
	cat >stdin <<-EOF &&
	update $a $m $m
	update $b $m $m
	update $c  
	EOF
	test_must_fail git update-ref --stdin <stdin 2>err &&
	grep "fatal: cannot lock ref '$c'" err &&
	git rev-parse $m >expect &&
	git rev-parse $a >actual &&
	test_cmp expect actual &&
	git rev-parse $b >actual &&
	test_cmp expect actual &&
	git rev-parse $c >actual &&
	test_cmp expect actual

blob
ok 6 - using @{now} syntax shows reflog date (multiline)

expecting success: 
	git log -g -1 --oneline HEAD@{now} >actual &&
	test_cmp expect actual

blob
blob
Submodule path 'sub1': checked out '913780cd9739c4974f32aaa316af9267f73412c2'
blob
ok 7 - using @{now} syntax shows reflog date (oneline)

expecting success: 
	git log -g -1 --format=%gd HEAD@{now} >actual &&
	test_cmp expect actual

fatal: cannot lock ref 'refs/heads/c': ref refs/heads/c is at 777b7c02e1a7bb137bd7443e34eb5512b6a19d6c but expected 0000000000000000000000000000000000000000
blob
commit
ok 8 - using @{now} syntax shows reflog date (format=%gd)

expecting success: 
	git log -g -1 --date=default >tmp &&
	grep ^Reflog <tmp >actual &&
	test_cmp expect actual

tree
commit
ok 94 - stdin update refs fails with wrong old value

expecting success: 
	git pack-refs --all &&
	git update-ref $c $m~1 &&
	cat >stdin <<-EOF &&
	delete $a $m
	update $b $Z $m
	update $c $E $m~1
	EOF
	git update-ref --stdin <stdin &&
	test_must_fail git rev-parse --verify -q $a &&
	test_must_fail git rev-parse --verify -q $b &&
	test_must_fail git rev-parse --verify -q $c

commit
ok 9 - using --date= shows reflog date (multiline)

commit
expecting success: 
	git log -g -1 --oneline --date=default >actual &&
	test_cmp expect actual

ok 2 - rewind

expecting success: 

	corrupt $F &&
	check_fsck "missing blob $F"


Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
ok 10 - using --date= shows reflog date (oneline)

expecting success: 
	git log -g -1 --format=%gd --date=raw >actual &&
	test_cmp expect actual

missing blob 9ae84adb2704cbd49549e52169b4043871e13432
ok 3 - corrupt and check

expecting success: 

	git reflog expire --dry-run \
		--expire=$(($test_tick - 10000)) \
		--expire-unreachable=$(($test_tick - 10000)) \
		--stale-fix \
		--all &&

	test_line_count = 5 .git/logs/refs/heads/master &&

	check_fsck "missing blob $F"

ok 11 - using --date= shows reflog date (format=%gd)

expecting success: 
	test_config log.date raw &&
	git log -g -1 >tmp &&
	grep ^Reflog <tmp >actual &&
	test_cmp expect actual

would prune commit: sheep
would prune commit: monkey
would prune reset: moving to HEAD~2
would prune commit: sheep
would prune commit: monkey
would prune reset: moving to HEAD~2
ok 95 - stdin delete refs works with packed and loose refs

expecting success: 
	>stdin &&
	git update-ref -z --stdin <stdin &&
	git rev-parse --verify -q $m

777b7c02e1a7bb137bd7443e34eb5512b6a19d6c
ok 96 - stdin -z works on empty input

expecting success: 
	echo "" >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: whitespace before command: " err

missing blob 9ae84adb2704cbd49549e52169b4043871e13432
ok 4 - reflog expire --dry-run should not touch reflog

expecting success: 

	git reflog expire --verbose \
		--expire=$(($test_tick - 10000)) \
		--expire-unreachable=$(($test_tick - 10000)) \
		--stale-fix \
		--all &&

	test_line_count = 2 .git/logs/refs/heads/master &&

	check_fsck "dangling commit $K"

fatal: whitespace before command: 
ok 97 - stdin -z fails on empty line

expecting success: 
	printf $F "" >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: empty command in input" err

Marking reachable objects...
keep commit (initial): rabbit
keep commit: dragon
prune commit: sheep
prune commit: monkey
prune reset: moving to HEAD~2
keep commit (initial): rabbit
keep commit: dragon
prune commit: sheep
prune commit: monkey
prune reset: moving to HEAD~2
fatal: empty command in input
ok 12 - log.date does not invoke "--date" magic (multiline)

ok 98 - stdin -z fails on empty command

expecting success: 
	printf $F " " >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: whitespace before command:  " err

expecting success: 
	test_config log.date raw &&
	git log -g -1 --oneline >actual &&
	test_cmp expect actual

fatal: whitespace before command:  
test_must_fail: command succeeded: git read-tree -u -m replace_sub1_with_file
ok 99 - stdin -z fails on only whitespace

expecting success: 
	printf $F " create $a" "$m" >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: whitespace before command:  create $a" err

dangling commit 3ac530f2f6c3a45206a6b2d455baf89d1c8f672d
ok 5 - reflog expire

expecting success: 

	git prune &&
	check_fsck &&

	check_have A B C D E H L &&
	check_dont_have F G I J K


fatal: whitespace before command:  create refs/heads/a
ok 100 - stdin -z fails on leading whitespace

expecting success: 
	printf $F "unknown $a" >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: unknown command: unknown $a" err

not ok 11 - git read-tree -u -m: replace submodule containing a .git directory with a file must fail # TODO known breakage

expecting success: 
		prolog &&
		reset_work_tree_to add_sub1 &&
		(
			cd submodule_update &&
			git branch -t modify_sub1 origin/modify_sub1 &&
			$command modify_sub1 &&
			test_superproject_content origin/modify_sub1 &&
			test_submodule_content sub1 origin/add_sub1 &&
			git submodule update &&
			test_submodule_content sub1 origin/modify_sub1
		)
	
ok 13 - log.date does not invoke "--date" magic (oneline)

fatal: unknown command: unknown refs/heads/a
ok 101 - stdin -z fails on unknown command

expecting success: 
	printf $F "create " >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: create: missing <ref>" err

expecting success: 
	test_config log.date raw &&
	git log -g -1 --format=%gd >actual &&
	test_cmp expect actual

fatal: create: missing <ref>
ok 102 - stdin -z fails create with no ref

expecting success: 
	printf $F "create $a" >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: create $a: unexpected end of input when reading <newvalue>" err

tree
ok 14 - log.date does not invoke "--date" magic (format=%gd)

fatal: create refs/heads/a: unexpected end of input when reading <newvalue>
expecting success: 
	git log -g -1 --format=%gd --date=raw HEAD@{0} >actual &&
	test_cmp expect actual

ok 103 - stdin -z fails create with no new value

expecting success: 
	printf $F "create $a" "$m" "$m" >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: unknown command: $m" err

tree
ok 15 - --date magic does not override explicit @{0} syntax

expecting success: 
	git branch empty &&
	: >.git/logs/refs/heads/empty &&

	git log -g empty >actual &&
	test_cmp expect actual

blob
fatal: unknown command: refs/heads/master
ok 104 - stdin -z fails create with too many arguments

expecting success: 
	printf $F "update " >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: update: missing <ref>" err

blob
Cloning into 'submodule_update'...
fatal: update: missing <ref>
blob
ok 105 - stdin -z fails update with no ref

expecting success: 
	printf $F "update $a" "$m" >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: update $a: unexpected end of input when reading <oldvalue>" err

commit
ok 16 - empty reflog file

expecting success: 
	test_commit two &&
	git branch flipflop &&
	git update-ref refs/heads/flipflop -m flip1 HEAD^ &&
	git update-ref refs/heads/flipflop -m flop1 HEAD &&
	git update-ref refs/heads/flipflop -m flip2 HEAD^ &&
	git log -g -p flipflop >reflog &&
	grep -v ^Reflog reflog >actual &&
	git log -1 -p HEAD^ >log.one &&
	git log -1 -p HEAD >log.two &&
	(
		cat log.one; echo
		cat log.two; echo
		cat log.one; echo
		cat log.two
	) >expect &&
	test_cmp expect actual

fatal: update refs/heads/a: unexpected end of input when reading <oldvalue>
ok 106 - stdin -z fails update with too few args

expecting success: 
	git update-ref $a $m &&
	printf $F "update $a" "" "" >stdin &&
	git update-ref -z --stdin <stdin 2>err &&
	grep "warning: update $a: missing <newvalue>, treating as zero" err &&
	test_must_fail git rev-parse --verify -q $a

commit
fatal: git cat-file: could not get object info
done.
fatal: git cat-file: could not get object info
fatal: git cat-file: could not get object info
[master fc3e0aa] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two.t
warning: update refs/heads/a: missing <newvalue>, treating as zero
fatal: git cat-file: could not get object info
ok 107 - stdin -z emits warning with empty new value

expecting success: 
	printf $F "update $a" >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: update $a: unexpected end of input when reading <newvalue>" err

fatal: git cat-file: could not get object info
ok 6 - prune and fsck

expecting success: 

	recover $F &&
	check_fsck "dangling blob $F"


Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
fatal: update refs/heads/a: unexpected end of input when reading <newvalue>
ok 108 - stdin -z fails update with no new value

expecting success: 
	printf $F "update $a" "$m" >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: update $a: unexpected end of input when reading <oldvalue>" err

fatal: update refs/heads/a: unexpected end of input when reading <oldvalue>
ok 109 - stdin -z fails update with no old value

expecting success: 
	printf $F "update $a" "$m" "$m" "$m" >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: unknown command: $m" err

fatal: unknown command: refs/heads/master
ok 110 - stdin -z fails update with too many arguments

expecting success: 
	printf $F "delete " >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: delete: missing <ref>" err

dangling blob 9ae84adb2704cbd49549e52169b4043871e13432
ok 7 - recover and check

expecting success: 
	echo 1 > C &&
	test_tick &&
	git commit -m rat C &&

	echo 2 > C &&
	test_tick &&
	git commit -m ox C &&

	echo 3 > C &&
	test_tick &&
	git commit -m tiger C &&

	HEAD_entry_count=$(git reflog | wc -l) &&
	master_entry_count=$(git reflog show master | wc -l) &&

	test $HEAD_entry_count = 5 &&
	test $master_entry_count = 5 &&


	git reflog delete master@{1} &&
	git reflog show master > output &&
	test $(($master_entry_count - 1)) = $(wc -l < output) &&
	test $HEAD_entry_count = $(git reflog | wc -l) &&
	! grep ox < output &&

	master_entry_count=$(wc -l < output) &&

	git reflog delete HEAD@{1} &&
	test $(($HEAD_entry_count -1)) = $(git reflog | wc -l) &&
	test $master_entry_count = $(git reflog show master | wc -l) &&

	HEAD_entry_count=$(git reflog | wc -l) &&

	git reflog delete master@{07.04.2005.15:15:00.-0700} &&
	git reflog show master > output &&
	test $(($master_entry_count - 1)) = $(wc -l < output) &&
	! grep dragon < output


fatal: delete: missing <ref>
ok 111 - stdin -z fails delete with no ref

expecting success: 
	printf $F "delete $a" >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: delete $a: unexpected end of input when reading <oldvalue>" err

[master b60a214] rat
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
fatal: delete refs/heads/a: unexpected end of input when reading <oldvalue>
ok 112 - stdin -z fails delete with no old value

expecting success: 
	printf $F "delete $a" "$m" "$m" >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: unknown command: $m" err

fatal: unknown command: refs/heads/master
ok 17 - git log -g -p shows diffs vs. parents

ok 113 - stdin -z fails delete with too many arguments

expecting success: 
	printf $F "verify $a" "$m" "$m" >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: unknown command: $m" err

[master 9908ef9] ox
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
# passed all 17 test(s)
1..17
fatal: unknown command: refs/heads/master
ok 114 - stdin -z fails verify with too many arguments

expecting success: 
	printf $F "verify $a" >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: verify $a: unexpected end of input when reading <oldvalue>" err

fatal: verify refs/heads/a: unexpected end of input when reading <oldvalue>
ok 115 - stdin -z fails verify with no old value

expecting success: 
	printf $F "option unknown" >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: option unknown: unknown" err

[master b93561f] tiger
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
*** t1412-reflog-loop.sh ***
fatal: option unknown: unknown
ok 116 - stdin -z fails option with unknown name

expecting success: 
	printf $F "create $a" "$m" "create $b" "$m" "create $a" "$m" >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: Multiple updates for ref '$a' not allowed." err

fatal: Multiple updates for ref 'refs/heads/a' not allowed.
ok 117 - stdin -z fails with duplicate refs

expecting success: 
	printf $F "create $a" "$m" >stdin &&
	git update-ref -z --stdin <stdin &&
	git rev-parse $m >expect &&
	git rev-parse $a >actual &&
	test_cmp expect actual

ok 118 - stdin -z create ref works

expecting success: 
	printf $F "update $b" "$m" "$Z" >stdin &&
	git update-ref -z --stdin <stdin &&
	git rev-parse $m >expect &&
	git rev-parse $b >actual &&
	test_cmp expect actual &&
	git update-ref -d $b

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1412-reflog-loop/.git/
expecting success: 
	test_tick &&
	echo content >file && git add file && git commit -m one &&
	git tag one &&
	echo content >>file && git add file && git commit -m two &&
	git tag two

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
[master (root-commit) e46513e] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 119 - stdin -z update ref creates with zero old value

expecting success: 
	printf $F "update $b" "$m" "" >stdin &&
	git update-ref -z --stdin <stdin &&
	git rev-parse $m >expect &&
	git rev-parse $b >actual &&
	test_cmp expect actual

[master 441e5e0] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 120 - stdin -z update ref creates with empty old value

expecting success: 
	printf $F "create refs/blobs/pws" "$m:$pws" >stdin &&
	git update-ref -z --stdin <stdin &&
	git rev-parse "$m:$pws" >expect &&
	git rev-parse refs/blobs/pws >actual &&
	test_cmp expect actual &&
	git update-ref -d refs/blobs/pws

ok 1 - setup commits

expecting success: 
	git checkout -b topic &&
	git reset one &&
	git reset two &&
	git reset one &&
	git reset two

Switched to a new branch 'topic'
ok 8 - delete

expecting success: 

	test_tick && git reset --hard HEAD~2 &&
	test_line_count = 4 .git/logs/refs/heads/master

Cloning into 'sub1'...
Unstaged changes after reset:
M	file
HEAD is now at b60a214 rat
ok 9 - rewind2

expecting success: 

	git reflog expire --verbose \
		--expire=never \
		--expire-unreachable=never \
		--all &&
	test_line_count = 4 .git/logs/refs/heads/master

ok 121 - stdin -z create ref works with path with space to blob

expecting success: 
	printf $F "update $c" "$m" "$m~1" >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: cannot lock ref '$c'" err &&
	test_must_fail git rev-parse --verify -q $c

done.
keep commit (initial): rabbit
keep commit: rat
keep commit: tiger
keep reset: moving to HEAD~2
keep commit (initial): rabbit
keep commit: dragon
keep commit: rat
keep commit: tiger
keep reset: moving to HEAD~2
ok 10 - --expire=never

expecting success: 

	git config gc.reflogexpire never &&
	git config gc.reflogexpireunreachable never &&
	git reflog expire --verbose --all &&
	test_line_count = 4 .git/logs/refs/heads/master

Unstaged changes after reset:
M	file
fatal: cannot lock ref 'refs/heads/c': unable to resolve reference refs/heads/c: No such file or directory
ok 122 - stdin -z update ref fails with wrong old value

expecting success: 
	printf $F "update $c" "$m" "does-not-exist" >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: update $c: invalid <oldvalue>: does-not-exist" err &&
	test_must_fail git rev-parse --verify -q $c

ok 2 - setup reflog with alternating commits

expecting success: 
	cat >expect <<-\EOF &&
		topic@{0} reset: moving to two
		topic@{1} reset: moving to one
		topic@{2} reset: moving to two
		topic@{3} reset: moving to one
		topic@{4} branch: Created from HEAD
	EOF
	git log -g --format="%gd %gs" topic >actual &&
	test_cmp expect actual

keep commit (initial): rabbit
keep commit: rat
keep commit: tiger
keep reset: moving to HEAD~2
keep commit (initial): rabbit
keep commit: dragon
keep commit: rat
keep commit: tiger
keep reset: moving to HEAD~2
fatal: update refs/heads/c: invalid <oldvalue>: does-not-exist
ok 11 - gc.reflogexpire=never

expecting success: 

	git config gc.reflogexpire false &&
	git config gc.reflogexpireunreachable false &&
	git reflog expire --verbose --all &&
	test_line_count = 4 .git/logs/refs/heads/master &&

	git config --unset gc.reflogexpire &&
	git config --unset gc.reflogexpireunreachable


ok 123 - stdin -z update ref fails with bad old value

expecting success: 
	git update-ref $c $m &&
	git rev-parse "$c" >expect &&
	printf $F "create $c" "$m~1" >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: cannot lock ref '$c'" err &&
	git rev-parse "$c" >actual &&
	test_cmp expect actual

ok 3 - reflog shows all entries

# passed all 3 test(s)
1..3
keep commit (initial): rabbit
keep commit: rat
keep commit: tiger
keep reset: moving to HEAD~2
keep commit (initial): rabbit
keep commit: dragon
keep commit: rat
keep commit: tiger
keep reset: moving to HEAD~2
fatal: cannot lock ref 'refs/heads/c': ref refs/heads/c is at 777b7c02e1a7bb137bd7443e34eb5512b6a19d6c but expected 0000000000000000000000000000000000000000
*** t1413-reflog-detach.sh ***
ok 124 - stdin -z create ref fails when ref exists

expecting success: 
	git update-ref -d "$c" &&
	printf $F "create $c" "does-not-exist" >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: create $c: invalid <newvalue>: does-not-exist" err &&
	test_must_fail git rev-parse --verify -q $c

ok 12 - gc.reflogexpire=false

expecting success: 
	test $(git reflog master | wc -l) = 4 &&
	git branch foo &&
	git pack-refs --all &&
	git checkout foo &&
	test $(git reflog master | wc -l) = 4

Submodule path 'sub1': checked out '913780cd9739c4974f32aaa316af9267f73412c2'
fatal: create refs/heads/c: invalid <newvalue>: does-not-exist
ok 125 - stdin -z create ref fails with bad new value

expecting success: 
	printf $F "create $c" "" >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: create $c: missing <newvalue>" err &&
	test_must_fail git rev-parse --verify -q $c

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1413-reflog-detach/.git/
fatal: create refs/heads/c: missing <newvalue>
expecting success: 
	test_tick &&
	git commit --allow-empty -m initial &&
	git branch side &&
	test_tick &&
	git commit --allow-empty -m second &&
	cat .git/logs/HEAD >saved_reflog

ok 126 - stdin -z create ref fails with empty new value

expecting success: 
	printf $F "update $b" "$m~1" "$m" >stdin &&
	git update-ref -z --stdin <stdin &&
	git rev-parse $m~1 >expect &&
	git rev-parse $b >actual &&
	test_cmp expect actual

Switched to branch 'foo'
Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
ok 13 - checkout should not delete log for packed ref

expecting success: 
	test_when_finished "git branch -d one || git branch -d one/two" &&

	git branch one/two master &&
	echo "one/two@{0} branch: Created from master" >expect &&
	git log -g --format="%gd %gs" one/two >actual &&
	test_cmp expect actual &&
	git branch -d one/two &&

	# now logs/refs/heads/one is a stale directory, but
	# we should move it out of the way to create "one" reflog
	git branch one master &&
	echo "one@{0} branch: Created from master" >expect &&
	git log -g --format="%gd %gs" one >actual &&
	test_cmp expect actual

[master (root-commit) 66fe8b3] initial
 Author: A U Thor <author@example.com>
ok 127 - stdin -z update ref works with right old value

expecting success: 
	printf $F "delete $a" "$m~1" >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: cannot lock ref '$a'" err &&
	git rev-parse $m >expect &&
	git rev-parse $a >actual &&
	test_cmp expect actual

[master 5ce2b00] second
 Author: A U Thor <author@example.com>
fatal: cannot lock ref 'refs/heads/a': ref refs/heads/a is at 777b7c02e1a7bb137bd7443e34eb5512b6a19d6c but expected 29d1ccdc7ee9fe415beb2415b6206b8a20f76b1c
ok 1 - setup

expecting success: 
	reset_state &&
	git rev-parse master master^ >expect &&
	git log -g --format=%H >actual &&
	test_cmp expect actual

Already on 'master'
Deleted branch one/two (was b60a214).
ok 128 - stdin -z delete ref fails with wrong old value

expecting success: 
	printf $F "delete $a" "$Z" >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: delete $a: zero <oldvalue>" err &&
	git rev-parse $m >expect &&
	git rev-parse $a >actual &&
	test_cmp expect actual

fatal: delete refs/heads/a: zero <oldvalue>
ok 2 - baseline

expecting success: 
	reset_state &&
	git rev-parse side master master^ >expect &&
	git checkout side &&
	git log -g --format=%H >actual &&
	test_cmp expect actual

Already on 'master'
Deleted branch one (was b60a214).
ok 14 - stale dirs do not cause d/f conflicts (reflogs on)

expecting success: 
	test_when_finished "git branch -d one || git branch -d one/two" &&

	git branch one/two master &&
	echo "one/two@{0} branch: Created from master" >expect &&
	git log -g --format="%gd %gs" one/two >actual &&
	test_cmp expect actual &&
	git branch -d one/two &&

	# same as before, but we only create a reflog for "one" if
	# it already exists, which it does not
	git -c core.logallrefupdates=false branch one master &&
	: >expect &&
	git log -g --format="%gd %gs" one >actual &&
	test_cmp expect actual

ok 129 - stdin -z delete ref fails with zero old value

expecting success: 
	git symbolic-ref TESTSYMREF $b &&
	printf $F "option no-deref" "update TESTSYMREF" "$a" "$b" >stdin &&
	git update-ref -z --stdin <stdin &&
	git rev-parse TESTSYMREF >expect &&
	git rev-parse $a >actual &&
	test_cmp expect actual &&
	git rev-parse $m~1 >expect &&
	git rev-parse $b >actual &&
	test_cmp expect actual

Switched to branch 'side'
Deleted branch one/two (was b60a214).
ok 3 - switch to branch

expecting success: 
	reset_state &&
	git rev-parse master side master master^ >expect &&
	git checkout side &&
	git checkout master^0 &&
	git log -g --format=%H >actual &&
	test_cmp expect actual

Switched to branch 'master'
ok 130 - stdin -z update symref works option no-deref

expecting success: 
	git symbolic-ref TESTSYMREF $b &&
	printf $F "option no-deref" "delete TESTSYMREF" "$b" >stdin &&
	git update-ref -z --stdin <stdin &&
	test_must_fail git rev-parse --verify -q TESTSYMREF &&
	git rev-parse $m~1 >expect &&
	git rev-parse $b >actual &&
	test_cmp expect actual

warning: unable to unlink .git/logs/refs/heads/one: Is a directory
Deleted branch one (was b60a214).
ok 15 - stale dirs do not cause d/f conflicts (reflogs off)

expecting success: 
	git checkout -b reflogskip &&
	z38=00000000000000000000000000000000000000 &&
	ident="abc <xyz> 0000000001 +0000" &&
	for i in $(test_seq 1 75); do
		printf "$z38%02d $z38%02d %s\t" $i $(($i+1)) "$ident" &&
		if test $i = 75; then
			for j in $(test_seq 1 89); do
				printf X
			done
		else
			printf X
		fi &&
		printf "\n"
	done >.git/logs/refs/heads/reflogskip &&
	git rev-parse reflogskip@{73} >actual &&
	echo ${z38}03 >expect &&
	test_cmp expect actual

Switched to branch 'side'
Switched to a new branch 'reflogskip'
Note: checking out 'master^0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 5ce2b00... second
ok 131 - stdin -z delete symref works option no-deref

expecting success: 
	printf $F "delete $b" "$m~1" >stdin &&
	git update-ref -z --stdin <stdin &&
	test_must_fail git rev-parse --verify -q $b

ok 4 - detach to other

expecting success: 
	reset_state &&
	git rev-parse master master master^ >expect &&
	git checkout master^0 &&
	git log -g --format=%H >actual &&
	test_cmp expect actual

ok 16 - parsing reverse reflogs at BUFSIZ boundaries

Switched to branch 'master'
ok 132 - stdin -z delete ref works with right old value

expecting success: 
	printf $F "update $a" "$m" "" "create $b" "$m" "verify $c" "" >stdin &&
	git update-ref -z --stdin <stdin &&
	git rev-parse $m >expect &&
	git rev-parse $a >actual &&
	test_cmp expect actual &&
	git rev-parse $b >actual &&
	test_cmp expect actual &&
	test_must_fail git rev-parse --verify -q $c

# passed all 16 test(s)
1..16
Submodule path 'sub1': checked out '1a0bd5c3507ab3a659d00b59d3ba1209c79b4087'
Note: checking out 'master^0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 5ce2b00... second
*** t1420-lost-found.sh ***
ok 5 - detach to self

expecting success: 
	reset_state &&
	git rev-parse master master master master^ >expect &&
	git checkout master^0 &&
	git checkout master &&
	git log -g --format=%H >actual &&
	test_cmp expect actual

ok 133 - stdin -z update/create/verify combination works

expecting success: 
	git rev-parse $m >expect &&
	printf $F "verify $m" "$m" >stdin &&
	git update-ref -z --stdin <stdin &&
	git rev-parse $m >actual &&
	test_cmp expect actual

ok 12 - git read-tree -u -m: modified submodule does not update submodule work tree

expecting success: 
		prolog &&
		reset_work_tree_to add_sub1 &&
		(
			cd submodule_update &&
			git branch -t invalid_sub1 origin/invalid_sub1 &&
			$command invalid_sub1 &&
			test_superproject_content origin/invalid_sub1 &&
			test_submodule_content sub1 origin/add_sub1 &&
			test_must_fail git submodule update &&
			test_submodule_content sub1 origin/add_sub1
		)
	
Switched to branch 'master'
ok 134 - stdin -z verify succeeds for correct value

expecting success: 
	printf $F "verify refs/heads/missing" "$Z" >stdin &&
	git update-ref -z --stdin <stdin &&
	test_must_fail git rev-parse --verify -q refs/heads/missing

Note: checking out 'master^0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 5ce2b00... second
ok 135 - stdin -z verify succeeds for missing reference

expecting success: 
	printf $F "verify refs/heads/missing" "" >stdin &&
	git update-ref -z --stdin <stdin &&
	test_must_fail git rev-parse --verify -q refs/heads/missing

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1420-lost-found/.git/
Switched to branch 'master'
expecting success: 
	git config core.logAllRefUpdates 0 &&
	: > file1 &&
	git add file1 &&
	test_tick &&
	git commit -m initial &&
	echo 1 > file1 &&
	echo 2 > file2 &&
	git add file1 file2 &&
	test_tick &&
	git commit -m second &&
	echo 3 > file3 &&
	git add file3

ok 136 - stdin -z verify treats no value as missing

expecting success: 
	git rev-parse $m >expect &&
	printf $F "verify $m" "$m~1" >stdin &&
	test_must_fail git update-ref -z --stdin <stdin &&
	git rev-parse $m >actual &&
	test_cmp expect actual

ok 6 - attach to self

expecting success: 
	reset_state &&
	git rev-parse side master master master^ >expect &&
	git checkout master^0 &&
	git checkout side &&
	git log -g --format=%H >actual &&
	test_cmp expect actual

Cloning into 'submodule_update'...
fatal: cannot lock ref 'refs/heads/master': ref refs/heads/master is at 777b7c02e1a7bb137bd7443e34eb5512b6a19d6c but expected 29d1ccdc7ee9fe415beb2415b6206b8a20f76b1c
Already on 'master'
ok 137 - stdin -z verify fails for wrong value

expecting success: 
	git rev-parse $m >expect &&
	printf $F "verify $m" "$Z" >stdin &&
	test_must_fail git update-ref -z --stdin <stdin &&
	git rev-parse $m >actual &&
	test_cmp expect actual

[master (root-commit) 9bb1ae9] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file1
done.
fatal: cannot lock ref 'refs/heads/master': ref refs/heads/master is at 777b7c02e1a7bb137bd7443e34eb5512b6a19d6c but expected 0000000000000000000000000000000000000000
Note: checking out 'master^0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 5ce2b00... second
[master 8ad33be] second
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 file2
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 138 - stdin -z verify fails for mistaken null value

expecting success: 
	M=$(git rev-parse $m) &&
	test_when_finished "git update-ref $m $M" &&
	git rev-parse $m >expect &&
	printf $F "verify $m" "" >stdin &&
	test_must_fail git update-ref -z --stdin <stdin &&
	git rev-parse $m >actual &&
	test_cmp expect actual

Previous HEAD position was 5ce2b00... second
Switched to branch 'side'
ok 1 - setup

expecting success: 
	git rev-parse HEAD > lost-commit &&
	git rev-parse :file3 > lost-other &&
	test_tick &&
	git reset --hard HEAD^ &&
	git fsck --lost-found &&
	test 2 = $(ls .git/lost-found/*/* | wc -l) &&
	test -f .git/lost-found/commit/$(cat lost-commit) &&
	test -f .git/lost-found/other/$(cat lost-other)

ok 7 - attach to other

fatal: cannot lock ref 'refs/heads/master': ref refs/heads/master is at 777b7c02e1a7bb137bd7443e34eb5512b6a19d6c but expected 0000000000000000000000000000000000000000
# passed all 7 test(s)
1..7
HEAD is now at 9bb1ae9 initial
ok 139 - stdin -z verify fails for mistaken empty value

expecting success: 
	printf $F "update $a" "$m" "$m" "update $b" "$m" "$m" "update $c" "$Z" "" >stdin &&
	git update-ref -z --stdin <stdin &&
	git rev-parse $m >expect &&
	git rev-parse $a >actual &&
	test_cmp expect actual &&
	git rev-parse $b >actual &&
	test_cmp expect actual &&
	test_must_fail git rev-parse --verify -q $c

dangling blob 00750edc07d6415dcc07ae0351e9397b0222b7ba
dangling commit 8ad33beea8de8e15812274614acd0a26d73b60f8
*** t1430-bad-ref-name.sh ***
ok 2 - lost and found something

# passed all 2 test(s)
1..2
ok 140 - stdin -z update refs works with identity updates

expecting success: 
	git update-ref $c $m &&
	printf $F "update $a" "$m" "$m" "update $b" "$m" "$m" "update $c" "$m" "$Z" >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: cannot lock ref '$c'" err &&
	git rev-parse $m >expect &&
	git rev-parse $a >actual &&
	test_cmp expect actual &&
	git rev-parse $b >actual &&
	test_cmp expect actual &&
	git rev-parse $c >actual &&
	test_cmp expect actual

*** t1450-fsck.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1430-bad-ref-name/.git/
fatal: cannot lock ref 'refs/heads/c': ref refs/heads/c is at 777b7c02e1a7bb137bd7443e34eb5512b6a19d6c but expected 0000000000000000000000000000000000000000
expecting success: 
	test_commit one &&
	test_commit two

[master (root-commit) d79ce16] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/.git/
ok 141 - stdin -z update refs fails with wrong old value

expecting success: 
	git pack-refs --all &&
	git update-ref $c $m~1 &&
	printf $F "delete $a" "$m" "update $b" "$Z" "$m" "update $c" "" "$m~1" >stdin &&
	git update-ref -z --stdin <stdin &&
	test_must_fail git rev-parse --verify -q $a &&
	test_must_fail git rev-parse --verify -q $b &&
	test_must_fail git rev-parse --verify -q $c

expecting success: 
	git config gc.auto 0 &&
	git config i18n.commitencoding ISO-8859-1 &&
	test_commit A fileA one &&
	git config --unset i18n.commitencoding &&
	git checkout HEAD^0 &&
	test_commit B fileB two &&
	git tag -d A B &&
	git reflog expire --expire=now --all &&
	>empty

[master 139b20d] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two.t
warning: update refs/heads/c: missing <newvalue>, treating as zero
ok 1 - setup

expecting success: 
	test_when_finished "rm -f .git/objects/pack_* .git/objects/index_*" &&
	cat >input <<-INPUT_END &&
		commit .badbranchname
		committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
		data <<COMMIT
		corrupt
		COMMIT

		from refs/heads/master

	INPUT_END
	test_must_fail git fast-import <input

fatal: Branch name doesn't conform to GIT standards: .badbranchname
fast-import: dumping crash report to .git/fast_import_crash_30290
ok 142 - stdin -z delete refs works with packed and loose refs

checking prerequisite: ULIMIT_FILE_DESCRIPTORS

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&run_with_limited_open_files true
)
[master (root-commit) 1347563] A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 fileA
ok 2 - fast-import: fail on invalid branch name ".badbranchname"

expecting success: 
	test_when_finished "rm -f .git/objects/pack_* .git/objects/index_*" &&
	cat >input <<-INPUT_END &&
		commit bad[branch]name
		committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
		data <<COMMIT
		corrupt
		COMMIT

		from refs/heads/master

	INPUT_END
	test_must_fail git fast-import <input

prerequisite ULIMIT_FILE_DESCRIPTORS ok
expecting success: 
(
	for i in $(test_seq 33)
	do
		echo "create refs/heads/$i HEAD"
	done >large_input &&
	run_with_limited_open_files git update-ref --stdin <large_input &&
	git rev-parse --verify -q refs/heads/33
)

Cloning into 'sub1'...
fatal: Branch name doesn't conform to GIT standards: bad[branch]name
fast-import: dumping crash report to .git/fast_import_crash_30318
ok 3 - fast-import: fail on invalid branch name "bad[branch]name"

expecting success: 
	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
	git branch >output &&
	grep -e "broken\.\.\.ref" output

Note: checking out 'HEAD^0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 1347563... A
  broken...ref
done.
ok 4 - git branch shows badly named ref

expecting success: 
	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
	git branch -d broken...ref &&
	git branch >output &&
	! grep -e "broken\.\.\.ref" output

[detached HEAD c9145d6] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 fileB
Deleted branch broken...ref (was broken).
777b7c02e1a7bb137bd7443e34eb5512b6a19d6c
ok 143 - large transaction creating branches does not burst open file limit

expecting success: 
(
	for i in $(test_seq 33)
	do
		echo "delete refs/heads/$i HEAD"
	done >large_input &&
	run_with_limited_open_files git update-ref --stdin <large_input &&
	test_must_fail git rev-parse --verify -q refs/heads/33
)

Deleted tag 'A' (was 1347563)
Deleted tag 'B' (was c9145d6)
ok 5 - branch -d can delete badly named ref

expecting success: 
	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
	git branch -D broken...ref &&
	git branch >output &&
	! grep -e "broken\.\.\.ref" output

ok 1 - setup

expecting success: 
	mkdir another &&
	(
		cd another &&
		git init &&
		echo ../../../.git/objects >.git/objects/info/alternates &&
		test_commit C fileC one &&
		git fsck --no-dangling >../actual 2>&1
	) &&
	test_cmp empty actual

Deleted branch broken...ref (was broken).
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/another/.git/
ok 6 - branch -D can delete badly named ref

expecting success: 
	echo precious >.git/my-private-file &&
	echo precious >expect &&
	test_must_fail git branch -D ../../my-private-file &&
	test_cmp expect .git/my-private-file

ok 144 - large transaction deleting branches does not burst open file limit

error: branch '../../my-private-file' not found.
[master (root-commit) 1aac250] C
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 fileC
ok 7 - branch -D cannot delete non-ref in .git dir

expecting success: 
	git rev-parse HEAD >.git/my-private-file &&
	git rev-parse HEAD >expect &&
	git branch foo/legit &&
	test_must_fail git branch -D foo////./././../../../my-private-file &&
	test_cmp expect .git/my-private-file

# passed all 144 test(s)
1..144
Submodule path 'sub1': checked out '913780cd9739c4974f32aaa316af9267f73412c2'
ok 2 - loose objects borrowed from alternate are not missing

expecting success: 
	git fsck >actual 2>&1 &&
	test_cmp empty actual

error: branch 'foo////./././../../../my-private-file' not found.
ok 8 - branch -D cannot delete ref in .git dir

expecting success: 
	git branch -f extra &&
	test_must_fail git branch -D "$(pwd)/.git/refs/heads/extra" &&
	test_cmp_rev HEAD extra

*** t1500-rev-parse.sh ***
ok 3 - HEAD is part of refs, valid objects appear valid

expecting success: 
	sha1_file() {
		echo "$*" | sed "s#..#.git/objects/&/#"
	} &&

	remove_object() {
		file=$(sha1_file "$*") &&
		test -e "$file" &&
		rm -f "$file"
	}

ok 4 - setup: helpers for corruption tests

expecting success: 
	sha=$(echo blob | git hash-object -w --stdin) &&
	old=$(echo $sha | sed "s+^..+&/+") &&
	new=$(dirname $old)/ffffffffffffffffffffffffffffffffffffff &&
	sha="$(dirname $new)$(basename $new)" &&
	mv .git/objects/$old .git/objects/$new &&
	test_when_finished "remove_object $sha" &&
	git update-index --add --cacheinfo 100644 $sha foo &&
	test_when_finished "git read-tree -u --reset HEAD" &&
	tree=$(git write-tree) &&
	test_when_finished "remove_object $tree" &&
	cmt=$(echo bogus | git commit-tree $tree) &&
	test_when_finished "remove_object $cmt" &&
	git update-ref refs/heads/bogus $cmt &&
	test_when_finished "git update-ref -d refs/heads/bogus" &&

	test_must_fail git fsck 2>out &&
	cat out &&
	grep "$sha.*corrupt" out

error: branch '/«PKGBUILDDIR»/t/trash directory.t1430-bad-ref-name/.git/refs/heads/extra' not found.
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
ok 9 - branch -D cannot delete absolute path

expecting success: 
	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
	test_must_fail git branch broken...ref &&
	git branch >output &&
	! grep -e "broken\.\.\.ref" output

fatal: 'broken...ref' is not a valid branch name.
ok 10 - git branch cannot create a badly named ref

expecting success: 
	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
	test_might_fail git branch -D goodref &&
	git branch goodref &&
	test_must_fail git branch -m goodref broken...ref &&
	test_cmp_rev master goodref &&
	git branch >output &&
	! grep -e "broken\.\.\.ref" output

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1500-rev-parse/.git/
error: branch 'goodref' not found.
expecting success: test 'false' = "$(git rev-parse --is-bare-repository)"
ok 1 - toplevel: is-bare-repository

expecting success: test 'false' = "$(git rev-parse --is-inside-git-dir)"
fatal: 'broken...ref' is not a valid branch name.
ok 2 - toplevel: is-inside-git-dir

expecting success: test 'true' = "$(git rev-parse --is-inside-work-tree)"
ok 3 - toplevel: is-inside-work-tree

expecting success: test '' = "$(git rev-parse --show-prefix)"
missing blob 63ffffffffffffffffffffffffffffffffffffff
ok 4 - toplevel: prefix

expecting success: test '.git' = "$(git rev-parse --git-dir)"
ok 11 - branch -m cannot rename to a bad ref name

checking known breakage: 
	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
	git branch -m broken...ref renamed &&
	test_cmp_rev master renamed &&
	git branch >output &&
	! grep -e "broken\.\.\.ref" output

error: sha1 mismatch 63ffffffffffffffffffffffffffffffffffffff
error: 63ffffffffffffffffffffffffffffffffffffff: object corrupt or missing
ok 5 - toplevel: git-dir

expecting success: test 'false' = "$(git rev-parse --is-bare-repository)"
error: 63ffffffffffffffffffffffffffffffffffffff: object corrupt or missing
fatal: Invalid branch name: 'broken...ref'
not ok 12 - branch -m can rename from a bad ref name # TODO known breakage

expecting success: 
	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
	test_must_fail git push "file://$(pwd)" HEAD:refs/heads/broken...ref &&
	git branch >output &&
	! grep -e "broken\.\.\.ref" output

ok 6 - .git/: is-bare-repository

expecting success: test 'true' = "$(git rev-parse --is-inside-git-dir)"
fatal: remote part of refspec is not a valid name in HEAD:refs/heads/broken...ref
ok 7 - .git/: is-inside-git-dir

expecting success: test 'false' = "$(git rev-parse --is-inside-work-tree)"
ok 8 - .git/: is-inside-work-tree

expecting success: test '' = "$(git rev-parse --show-prefix)"
ok 13 - push cannot create a badly named ref

checking known breakage: 
	top=$(pwd) &&
	git init src &&
	git init dest &&

	(
		cd src &&
		test_commit one
	) &&
	(
		cd dest &&
		test_commit two &&
		git checkout --detach &&
		cp .git/refs/heads/master .git/refs/heads/broken...ref
	) &&
	git -C src push --mirror "file://$top/dest" &&
	git -C dest branch >output &&
	! grep -e "broken\.\.\.ref" output

ok 9 - .git/: prefix

expecting success: test '.' = "$(git rev-parse --git-dir)"
ok 10 - .git/: git-dir

expecting success: test 'false' = "$(git rev-parse --is-bare-repository)"
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1430-bad-ref-name/src/.git/
ok 11 - .git/objects/: is-bare-repository

expecting success: test 'true' = "$(git rev-parse --is-inside-git-dir)"
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1430-bad-ref-name/dest/.git/
ok 12 - .git/objects/: is-inside-git-dir

expecting success: test 'false' = "$(git rev-parse --is-inside-work-tree)"
ok 5 - object with bad sha1

expecting success: 
	git rev-parse HEAD^{tree} >.git/refs/heads/invalid &&
	test_when_finished "git update-ref -d refs/heads/invalid" &&
	git fsck 2>out &&
	cat out &&
	grep "not a commit" out

ok 13 - .git/objects/: is-inside-work-tree

expecting success: test '' = "$(git rev-parse --show-prefix)"
ok 14 - .git/objects/: prefix

expecting success: test '/«PKGBUILDDIR»/t/trash directory.t1500-rev-parse/.git' = "$(git rev-parse --git-dir)"
[master (root-commit) 4331c28] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
error: refs/heads/invalid: not a commit
ok 15 - .git/objects/: git-dir

error: refs/heads/invalid: not a commit
expecting success: test 'false' = "$(git rev-parse --is-bare-repository)"
ok 6 - branch pointing to non-commit

expecting success: 
	git cat-file commit HEAD >basis &&
	sed "s/@/AT/" basis >okay &&
	new=$(git hash-object -t commit -w --stdin <okay) &&
	test_when_finished "remove_object $new" &&
	git update-ref refs/heads/bogus "$new" &&
	test_when_finished "git update-ref -d refs/heads/bogus" &&
	git fsck 2>out &&
	cat out &&
	! grep "commit $new" out

ok 16 - subdirectory: is-bare-repository

expecting success: test 'false' = "$(git rev-parse --is-inside-git-dir)"
ok 17 - subdirectory: is-inside-git-dir

expecting success: test 'true' = "$(git rev-parse --is-inside-work-tree)"
[master (root-commit) 9db02ea] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two.t
ok 18 - subdirectory: is-inside-work-tree

expecting success: test 'sub/dir/' = "$(git rev-parse --show-prefix)"
ok 19 - subdirectory: prefix

expecting success: test '/«PKGBUILDDIR»/t/trash directory.t1500-rev-parse/.git' = "$(git rev-parse --git-dir)"
Note: checking out 'HEAD'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 9db02ea... two
ok 20 - subdirectory: git-dir

expecting success: test 'true' = "$(git rev-parse --is-bare-repository)"
ok 7 - email without @ is okay

expecting success: 
	git cat-file commit HEAD >basis &&
	sed "s/@[a-z]/&>/" basis >bad-email &&
	new=$(git hash-object -t commit -w --stdin <bad-email) &&
	test_when_finished "remove_object $new" &&
	git update-ref refs/heads/bogus "$new" &&
	test_when_finished "git update-ref -d refs/heads/bogus" &&
	test_must_fail git fsck 2>out &&
	cat out &&
	grep "error in commit $new" out

ok 21 - core.bare = true: is-bare-repository

expecting success: test 'false' = "$(git rev-parse --is-inside-git-dir)"
ok 22 - core.bare = true: is-inside-git-dir

expecting success: test 'false' = "$(git rev-parse --is-inside-work-tree)"
ok 23 - core.bare = true: is-inside-work-tree

fatal: reference is not a tree: 0123456789012345678901234567890123456789
expecting success: test 'false' = "$(git rev-parse --is-bare-repository)"
Unable to checkout '0123456789012345678901234567890123456789' in submodule path 'sub1'
ok 24 - core.bare undefined: is-bare-repository

expecting success: test 'false' = "$(git rev-parse --is-inside-git-dir)"
To file:///«PKGBUILDDIR»/t/trash directory.t1430-bad-ref-name/dest
 + 9db02ea...4331c28 master -> master (forced update)
 - [deleted]         two
 * [new tag]         one -> one
ok 25 - core.bare undefined: is-inside-git-dir

expecting success: test 'true' = "$(git rev-parse --is-inside-work-tree)"
  broken...ref
not ok 14 - push --mirror can delete badly named ref # TODO known breakage

expecting success: 
	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
	git branch shadow one &&
	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
	git symbolic-ref refs/tags/shadow refs/heads/broken...ref &&

	git rev-parse --verify one >expect &&
	git rev-parse --verify shadow >actual 2>err &&
	test_cmp expect actual &&
	test_i18ngrep "ignoring.*refs/tags/shadow" err

ok 26 - core.bare undefined: is-inside-work-tree

error in commit af421232fcba11d582d625f9041afbe3fccc01d9: invalid author/committer line - missing space before date
error in commit af421232fcba11d582d625f9041afbe3fccc01d9: invalid author/committer line - missing space before date
expecting success: test 'false' = "$(git rev-parse --is-bare-repository)"
ok 27 - GIT_DIR=../.git, core.bare = false: is-bare-repository

expecting success: test 'false' = "$(git rev-parse --is-inside-git-dir)"
ok 8 - email with embedded > is not okay

expecting success: 
	git cat-file commit HEAD >basis &&
	sed "s/<//" basis >bad-email-2 &&
	new=$(git hash-object -t commit -w --stdin <bad-email-2) &&
	test_when_finished "remove_object $new" &&
	git update-ref refs/heads/bogus "$new" &&
	test_when_finished "git update-ref -d refs/heads/bogus" &&
	test_must_fail git fsck 2>out &&
	cat out &&
	grep "error in commit $new.* - bad name" out

ok 13 - git read-tree -u -m: modified submodule does not update submodule work tree to invalid commit

expecting success: 
		prolog &&
		reset_work_tree_to invalid_sub1 &&
		(
			cd submodule_update &&
			git branch -t valid_sub1 origin/valid_sub1 &&
			$command valid_sub1 &&
			test_superproject_content origin/valid_sub1 &&
			test_dir_is_empty sub1 &&
			git submodule update --init --recursive &&
			test_submodule_content sub1 origin/valid_sub1
		)
	
warning: ignoring dangling symref refs/tags/shadow.
ok 28 - GIT_DIR=../.git, core.bare = false: is-inside-git-dir

expecting success: test 'true' = "$(git rev-parse --is-inside-work-tree)"
ok 15 - rev-parse skips symref pointing to broken name

expecting success: 
	git symbolic-ref refs/heads/badname refs/heads/broken...ref &&
	test_when_finished "rm -f .git/refs/heads/badname" &&
	test_path_is_file .git/refs/heads/badname &&
	git update-ref --no-deref -d refs/heads/badname &&
	test_path_is_missing .git/refs/heads/badname

ok 29 - GIT_DIR=../.git, core.bare = false: is-inside-work-tree

expecting success: test '' = "$(git rev-parse --show-prefix)"
ok 16 - update-ref --no-deref -d can delete reference to broken name

expecting success: 
	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
	git update-ref -d refs/heads/broken...ref &&
	git branch >output &&
	! grep -e "broken\.\.\.ref" output

ok 30 - GIT_DIR=../.git, core.bare = false: prefix

expecting success: test 'true' = "$(git rev-parse --is-bare-repository)"
ok 31 - GIT_DIR=../.git, core.bare = true: is-bare-repository

expecting success: test 'false' = "$(git rev-parse --is-inside-git-dir)"
ok 32 - GIT_DIR=../.git, core.bare = true: is-inside-git-dir

expecting success: test 'false' = "$(git rev-parse --is-inside-work-tree)"
ok 17 - update-ref -d can delete broken name

expecting success: 
	echo precious >.git/my-private-file &&
	echo precious >expect &&
	test_must_fail git update-ref -d my-private-file &&
	test_cmp expect .git/my-private-file

error in commit c4b6d356e934be1cc10cb58c734fbcc5fa3a5285: invalid author/committer line - bad name
ok 33 - GIT_DIR=../.git, core.bare = true: is-inside-work-tree

expecting success: test '' = "$(git rev-parse --show-prefix)"
error in commit c4b6d356e934be1cc10cb58c734fbcc5fa3a5285: invalid author/committer line - bad name
error: cannot lock ref 'my-private-file': unable to resolve reference my-private-file: Invalid argument
Cloning into 'submodule_update'...
ok 18 - update-ref -d cannot delete non-ref in .git dir

expecting success: 
	git branch -f extra &&
	test_must_fail git update-ref -d "$(pwd)/.git/refs/heads/extra" &&
	test_cmp_rev HEAD extra

ok 34 - GIT_DIR=../.git, core.bare = true: prefix

expecting success: test 'false' = "$(git rev-parse --is-bare-repository)"
error: cannot lock ref '/«PKGBUILDDIR»/t/trash directory.t1430-bad-ref-name/.git/refs/heads/extra': unable to resolve reference /«PKGBUILDDIR»/t/trash directory.t1430-bad-ref-name/.git/refs/heads/extra: Invalid argument
ok 35 - GIT_DIR=../.git, core.bare undefined: is-bare-repository

expecting success: test 'false' = "$(git rev-parse --is-inside-git-dir)"
ok 9 - missing < email delimiter is reported nicely

expecting success: 
	git cat-file commit HEAD >basis &&
	sed "s/[a-z]* <[^>]*>//" basis >bad-email-3 &&
	new=$(git hash-object -t commit -w --stdin <bad-email-3) &&
	test_when_finished "remove_object $new" &&
	git update-ref refs/heads/bogus "$new" &&
	test_when_finished "git update-ref -d refs/heads/bogus" &&
	test_must_fail git fsck 2>out &&
	cat out &&
	grep "error in commit $new.* - missing email" out

ok 36 - GIT_DIR=../.git, core.bare undefined: is-inside-git-dir

expecting success: test 'true' = "$(git rev-parse --is-inside-work-tree)"
ok 19 - update-ref -d cannot delete absolute path

expecting success: 
	echo "create ~a refs/heads/master" >stdin &&
	test_must_fail git update-ref --stdin <stdin 2>err &&
	grep "fatal: invalid ref format: ~a" err

done.
ok 37 - GIT_DIR=../.git, core.bare undefined: is-inside-work-tree

expecting success: test '' = "$(git rev-parse --show-prefix)"
ok 38 - GIT_DIR=../.git, core.bare undefined: prefix

fatal: invalid ref format: ~a
ok 20 - update-ref --stdin fails create with bad ref name

expecting success: 
	echo "update ~a refs/heads/master" >stdin &&
	test_must_fail git update-ref --stdin <stdin 2>err &&
	grep "fatal: invalid ref format: ~a" err

expecting success: test 'false' = "$(git rev-parse --is-bare-repository)"
ok 39 - GIT_DIR=../repo.git, core.bare = false: is-bare-repository

expecting success: test 'false' = "$(git rev-parse --is-inside-git-dir)"
fatal: invalid ref format: ~a
error in commit 35319efb0a67194811f8583362d460866d58b499: invalid author/committer line - missing email
ok 21 - update-ref --stdin fails update with bad ref name

expecting success: 
	echo "delete ~a refs/heads/master" >stdin &&
	test_must_fail git update-ref --stdin <stdin 2>err &&
	grep "fatal: invalid ref format: ~a" err

Switched to a new branch 'invalid_sub1'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
error in commit 35319efb0a67194811f8583362d460866d58b499: invalid author/committer line - missing email
ok 40 - GIT_DIR=../repo.git, core.bare = false: is-inside-git-dir

expecting success: test 'true' = "$(git rev-parse --is-inside-work-tree)"
ok 41 - GIT_DIR=../repo.git, core.bare = false: is-inside-work-tree

expecting success: test '' = "$(git rev-parse --show-prefix)"
fatal: invalid ref format: ~a
ok 22 - update-ref --stdin fails delete with bad ref name

expecting success: 
	printf "%s\0" "create ~a " refs/heads/master >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: invalid ref format: ~a " err

ok 42 - GIT_DIR=../repo.git, core.bare = false: prefix

ok 10 - missing email is reported nicely

fatal: invalid ref format: ~a 
expecting success: 
	git cat-file commit HEAD >basis &&
	sed "s/ </> </" basis >bad-email-4 &&
	new=$(git hash-object -t commit -w --stdin <bad-email-4) &&
	test_when_finished "remove_object $new" &&
	git update-ref refs/heads/bogus "$new" &&
	test_when_finished "git update-ref -d refs/heads/bogus" &&
	test_must_fail git fsck 2>out &&
	cat out &&
	grep "error in commit $new" out

ok 23 - update-ref --stdin -z fails create with bad ref name

expecting success: 
	printf "%s\0" "update ~a" refs/heads/master "" >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: invalid ref format: ~a" err

expecting success: test 'true' = "$(git rev-parse --is-bare-repository)"
fatal: Needed a single revision
fatal: invalid ref format: ~a
ok 24 - update-ref --stdin -z fails update with bad ref name

expecting success: 
	printf "%s\0" "delete ~a" refs/heads/master >stdin &&
	test_must_fail git update-ref -z --stdin <stdin 2>err &&
	grep "fatal: invalid ref format: ~a" err

ok 43 - GIT_DIR=../repo.git, core.bare = true: is-bare-repository

expecting success: test 'false' = "$(git rev-parse --is-inside-git-dir)"
Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
fatal: invalid ref format: ~a
ok 44 - GIT_DIR=../repo.git, core.bare = true: is-inside-git-dir

expecting success: test 'false' = "$(git rev-parse --is-inside-work-tree)"
ok 25 - update-ref --stdin -z fails delete with bad ref name

# still have 2 known breakage(s)
# passed all remaining 23 test(s)
1..25
ok 45 - GIT_DIR=../repo.git, core.bare = true: is-inside-work-tree

expecting success: test '' = "$(git rev-parse --show-prefix)"
ok 46 - GIT_DIR=../repo.git, core.bare = true: prefix

error in commit 301380051321b3e224015eea93b0ebc550c88198: invalid author/committer line - bad name
expecting success: test 'false' = "$(git rev-parse --is-bare-repository)"
error in commit 301380051321b3e224015eea93b0ebc550c88198: invalid author/committer line - bad name
ok 47 - GIT_DIR=../repo.git, core.bare undefined: is-bare-repository

expecting success: test 'false' = "$(git rev-parse --is-inside-git-dir)"
*** t1501-worktree.sh ***
ok 48 - GIT_DIR=../repo.git, core.bare undefined: is-inside-git-dir

expecting success: test 'true' = "$(git rev-parse --is-inside-work-tree)"
ok 11 - > in name is reported

expecting success: 
	git cat-file commit HEAD >basis &&
	sed "s/^\\(author .*>\\) [0-9]*/\\1 18446744073709551617/" \
		<basis >bad-timestamp &&
	new=$(git hash-object -t commit -w --stdin <bad-timestamp) &&
	test_when_finished "remove_object $new" &&
	git update-ref refs/heads/bogus "$new" &&
	test_when_finished "git update-ref -d refs/heads/bogus" &&
	test_must_fail git fsck 2>out &&
	cat out &&
	grep "error in commit $new.*integer overflow" out

ok 49 - GIT_DIR=../repo.git, core.bare undefined: is-inside-work-tree

expecting success: test '' = "$(git rev-parse --show-prefix)"
ok 50 - GIT_DIR=../repo.git, core.bare undefined: prefix

# passed all 50 test(s)
1..50
*** t1502-rev-parse-parseopt.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1501-worktree/.git/
error in commit c8453435c3587d0404f88f925c28a5944b73be1a: invalid author/committer line - date causes integer overflow
expecting success: 
	EMPTY_TREE=$(git write-tree) &&
	EMPTY_BLOB=$(git hash-object -t blob --stdin </dev/null) &&
	CHANGED_BLOB=$(echo changed | git hash-object -t blob --stdin) &&
	EMPTY_BLOB7=$(echo $EMPTY_BLOB | sed "s/\(.......\).*/\1/") &&
	CHANGED_BLOB7=$(echo $CHANGED_BLOB | sed "s/\(.......\).*/\1/") &&

	mkdir -p work/sub/dir &&
	mkdir -p work2 &&
	mv .git repo.git

error in commit c8453435c3587d0404f88f925c28a5944b73be1a: invalid author/committer line - date causes integer overflow
ok 12 - integer overflow in timestamps is reported

expecting success: 
	test_when_finished "git update-ref -d refs/tags/wrong" &&
	test_when_finished "remove_object \$T" &&
	T=$(
		GIT_INDEX_FILE=test-index &&
		export GIT_INDEX_FILE &&
		rm -f test-index &&
		>x &&
		git add x &&
		T=$(git write-tree) &&
		(
			git cat-file tree $T &&
			git cat-file tree $T
		) |
		git hash-object -w -t tree --stdin
	) &&
	test_must_fail git fsck 2>out &&
	grep "error in tree .*contains duplicate file entries" out

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1502-rev-parse-parseopt/.git/
ok 1 - setup

expecting success: 
	test_rev_parse() {
		echo $1 >expected.bare &&
		echo $2 >expected.inside-git &&
		echo $3 >expected.inside-worktree &&
		if test $# -ge 4
		then
			echo $4 >expected.prefix
		fi &&

		git rev-parse --is-bare-repository >actual.bare &&
		git rev-parse --is-inside-git-dir >actual.inside-git &&
		git rev-parse --is-inside-work-tree >actual.inside-worktree &&
		if test $# -ge 4
		then
			git rev-parse --show-prefix >actual.prefix
		fi &&

		test_cmp expected.bare actual.bare &&
		test_cmp expected.inside-git actual.inside-git &&
		test_cmp expected.inside-worktree actual.inside-worktree &&
		if test $# -ge 4
		then
			# rev-parse --show-prefix should output
			# a single newline when at the top of the work tree,
			# but we test for that separately.
			test -z "$4" && ! test -s actual.prefix ||
			test_cmp expected.prefix actual.prefix
		fi
	}

ok 2 - setup: helper for testing rev-parse

expecting success: 
	sane_unset GIT_WORK_TREE &&
	GIT_DIR=repo.git &&
	GIT_CONFIG="$(pwd)"/$GIT_DIR/config &&
	export GIT_DIR GIT_CONFIG &&
	git config core.worktree ../work

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
expecting success: 
	test_expect_code 129 git rev-parse --parseopt -- -h > output < optionspec &&
	test_i18ncmp expect output

ok 3 - setup: core.worktree = relative path

expecting success: 
	test_rev_parse false false false

ok 1 - test --parseopt help output

dangling tree 7997631de77b8a212b5c3e01eff5e9cf1d3c7580
expecting success: 
	git rev-parse --parseopt -- --foo --bar=ham --baz arg < optionspec > output &&
	test_cmp expect output

error in tree 7997631de77b8a212b5c3e01eff5e9cf1d3c7580: contains duplicate file entries
ok 2 - test --parseopt

expecting success: 
	git rev-parse --parseopt -- --foo arg --bar=ham --baz < optionspec > output &&
	test_cmp expect output

ok 4 - outside

expecting success: 
	(
		cd work &&
		GIT_DIR=../repo.git &&
		GIT_CONFIG="$(pwd)"/$GIT_DIR/config &&
		test_rev_parse false false true ""
	)

ok 3 - test --parseopt with mixed options and arguments

ok 13 - malformatted tree object

expecting success: 
	cat >invalid-tag <<-\EOF &&
	object ffffffffffffffffffffffffffffffffffffffff
	type commit
	tag invalid
	tagger T A Gger <tagger@example.com> 1234567890 -0000

	This is an invalid tag.
	EOF

	tag=$(git hash-object -t tag -w --stdin <invalid-tag) &&
	test_when_finished "remove_object $tag" &&
	echo $tag >.git/refs/tags/invalid &&
	test_when_finished "git update-ref -d refs/tags/invalid" &&
	test_must_fail git fsck --tags >out &&
	cat out &&
	grep "broken link" out

expecting success: 
	git rev-parse --parseopt -- --foo -- arg --bar=ham < optionspec > output &&
	test_cmp expect output

ok 4 - test --parseopt with --

expecting success: 
	git rev-parse --parseopt --stop-at-non-option -- --foo arg --bar=ham < optionspec > output &&
	test_cmp expect output

ok 5 - test --parseopt --stop-at-non-option

expecting success: 
	git rev-parse --parseopt --keep-dashdash -- --foo -- arg --bar=ham < optionspec > output &&
	test_cmp expect output

tagged commit ffffffffffffffffffffffffffffffffffffffff (invalid) in 1b6f5c03992c29264810d290b006c47651933356
broken link from     tag 1b6f5c03992c29264810d290b006c47651933356
              to  commit ffffffffffffffffffffffffffffffffffffffff
missing commit ffffffffffffffffffffffffffffffffffffffff
ok 6 - test --parseopt --keep-dashdash
broken link from     tag 1b6f5c03992c29264810d290b006c47651933356

ok 5 - inside work tree

expecting success: 
	echo >expected &&
	(
		cd work &&
		GIT_DIR=../repo.git &&
		GIT_CONFIG="$(pwd)"/$GIT_DIR/config &&
		git rev-parse --show-prefix >../actual
	) &&
	test_cmp expected actual

expecting success: 
	git rev-parse --parseopt --keep-dashdash --stop-at-non-option -- --foo -- arg --spam=ham <optionspec >output &&
	test_cmp expect output

ok 6 - empty prefix is actually written out

expecting success: 
	(
		cd work/sub/dir &&
		GIT_DIR=../../../repo.git &&
		GIT_CONFIG="$(pwd)"/$GIT_DIR/config &&
		test_rev_parse false false true sub/dir/
	)

ok 7 - test --parseopt --keep-dashdash --stop-at-non-option with --

ok 14 - tag pointing to nonexistent

expecting success: 
	sha=$(echo blob | git hash-object -w --stdin) &&
	test_when_finished "remove_object $sha" &&
	cat >wrong-tag <<-EOF &&
	object $sha
	type commit
	tag wrong
	tagger T A Gger <tagger@example.com> 1234567890 -0000

	This is an invalid tag.
	EOF

	tag=$(git hash-object -t tag -w --stdin <wrong-tag) &&
	test_when_finished "remove_object $tag" &&
	echo $tag >.git/refs/tags/wrong &&
	test_when_finished "git update-ref -d refs/tags/wrong" &&
	test_must_fail git fsck --tags

expecting success: 
	git rev-parse --parseopt --keep-dashdash --stop-at-non-option -- --foo arg --spam=ham <optionspec >output &&
	test_cmp expect output

Cloning into 'sub1'...
ok 8 - test --parseopt --keep-dashdash --stop-at-non-option without --

expecting success: 
	git rev-parse --parseopt --stuck-long -- --foo --bar=z -b arg -CZ -dA <optionspec >output &&
	test_cmp expect output

ok 9 - test --parseopt --stuck-long

expecting success: 
	git rev-parse --parseopt --stuck-long -- --data= arg -C -b <optionspec >output &&
	test_cmp expect output

ok 7 - subdir of work tree

expecting success: 
	sane_unset GIT_WORK_TREE &&
	GIT_DIR=$(pwd)/repo.git &&
	GIT_CONFIG=$GIT_DIR/config &&
	export GIT_DIR GIT_CONFIG &&
	git config core.worktree "$(pwd)/work"

error: object 63499e4ea8e096b831515ceb1d5a7593e4d87ae5 is a blob, not a commit
error in tag 66f6581d549f70e05ca586bc2df5c15a95662c36: broken links
error in tag 66f6581d549f70e05ca586bc2df5c15a95662c36: could not load tagged object
done.
broken link from     tag 66f6581d549f70e05ca586bc2df5c15a95662c36
broken link from unknown unknown
dangling blob 63499e4ea8e096b831515ceb1d5a7593e4d87ae5
ok 10 - test --parseopt --stuck-long and empty optional argument

ok 8 - setup: core.worktree = absolute path

expecting success: 
	test_rev_parse false false false &&
	(
		cd work2 &&
		test_rev_parse false false false
	)

expecting success: 
	git rev-parse --parseopt --stuck-long -- --data arg -b <optionspec >output &&
	test_cmp expect output

ok 11 - test --parseopt --stuck-long and long option with unset optional argument

expecting success: 
	git rev-parse --parseopt --stuck-long -- -d arg -b <optionspec >output &&
	test_cmp expect output

ok 15 - tag pointing to something else than its type

expecting success: 
	sha=$(git rev-parse HEAD) &&
	cat >wrong-tag <<-EOF &&
	object $sha
	type commit
	tag wrong name format

	This is an invalid tag.
	EOF

	tag=$(git hash-object -t tag -w --stdin <wrong-tag) &&
	test_when_finished "remove_object $tag" &&
	echo $tag >.git/refs/tags/wrong &&
	test_when_finished "git update-ref -d refs/tags/wrong" &&
	git fsck --tags 2>out &&

	cat >expect <<-EOF &&
	warning in tag $tag: invalid 'tag' name: wrong name format
	warning in tag $tag: invalid format - expected 'tagger' line
	EOF
	test_cmp expect out

ok 12 - test --parseopt --stuck-long and short option with unset optional argument

# passed all 12 test(s)
1..12
*** t1503-rev-parse-verify.sh ***
tagged commit c9145d6720f85544cc4bb6009a2e541660aa156b (wrong name format) in 6d73f1b4d41e4fdac4ba717a11e7409876bb75c3
ok 9 - outside

expecting success: 
	(
		cd work &&
		test_rev_parse false false true ""
	)

Submodule path 'sub1': checked out '913780cd9739c4974f32aaa316af9267f73412c2'
ok 16 - tag with incorrect tag name & missing tagger

expecting success: 
	sha=$(git rev-parse HEAD) &&
	cat >wrong-tag <<-EOF &&
	object $sha
	type commit
	tag not-quite-wrong
	tagger Bad Tagger Name

	This is an invalid tag.
	EOF

	tag=$(git hash-object --literally -t tag -w --stdin <wrong-tag) &&
	test_when_finished "remove_object $tag" &&
	echo $tag >.git/refs/tags/wrong &&
	test_when_finished "git update-ref -d refs/tags/wrong" &&
	test_must_fail git fsck --tags 2>out &&
	grep "error in tag .*: invalid author/committer" out

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1503-rev-parse-verify/.git/
ok 10 - inside work tree

expecting success: 
	(
		cd work/sub/dir &&
		test_rev_parse false false true sub/dir/
	)

expecting success: 
	add_line_into_file "1: Hello World" hello &&
	HASH1=$(git rev-parse --verify HEAD) &&
	add_line_into_file "2: A new day for git" hello &&
	HASH2=$(git rev-parse --verify HEAD) &&
	add_line_into_file "3: Another new day for git" hello &&
	HASH3=$(git rev-parse --verify HEAD) &&
	add_line_into_file "4: Ciao for now" hello &&
	HASH4=$(git rev-parse --verify HEAD)

error in tag d037dcc834669cc0c5d3416130c899572cb1aedd: invalid author/committer line - missing email
ok 17 - tag with bad tagger

expecting success: 
	git fsck >actual 2>&1 &&
	test_cmp empty actual

ok 11 - subdir of work tree

expecting success: 
	GIT_DIR=$(pwd)/repo.git &&
	GIT_CONFIG=$GIT_DIR/config &&
	git config core.worktree non-existent &&
	GIT_WORK_TREE=work &&
	export GIT_DIR GIT_CONFIG GIT_WORK_TREE

ok 12 - setup: GIT_WORK_TREE=relative (override core.worktree)

expecting success: 
	test_rev_parse false false false &&
	(
		cd work2 &&
		test_rev_parse false false false
	)

ok 18 - cleaned up

expecting success: 
	git rev-list --verify-objects --all >/dev/null 2>out &&
	test_cmp empty out

ok 14 - git read-tree -u -m: modified submodule does not update submodule work tree from invalid commit

expecting success: 
		prolog &&
		reset_work_tree_to no_submodule &&
		(
			cd submodule_update &&
			git branch -t add_sub1 origin/add_sub1 &&
			$command add_sub1 &&
			test_superproject_content origin/add_sub1 &&
			test_dir_is_empty sub1 &&
			git submodule update --init --recursive &&
			test_submodule_content sub1 origin/add_sub1
		)
	
ok 19 - rev-list --verify-objects

expecting success: 
	sha=$(echo blob | git hash-object -w --stdin) &&
	old=$(echo $sha | sed "s+^..+&/+") &&
	new=$(dirname $old)/ffffffffffffffffffffffffffffffffffffff &&
	sha="$(dirname $new)$(basename $new)" &&
	mv .git/objects/$old .git/objects/$new &&
	test_when_finished "remove_object $sha" &&
	git update-index --add --cacheinfo 100644 $sha foo &&
	test_when_finished "git read-tree -u --reset HEAD" &&
	tree=$(git write-tree) &&
	test_when_finished "remove_object $tree" &&
	cmt=$(echo bogus | git commit-tree $tree) &&
	test_when_finished "remove_object $cmt" &&
	git update-ref refs/heads/bogus $cmt &&
	test_when_finished "git update-ref -d refs/heads/bogus" &&

	test_might_fail git rev-list --verify-objects refs/heads/bogus >/dev/null 2>out &&
	cat out &&
	grep -q "error: sha1 mismatch 63ffffffffffffffffffffffffffffffffffffff" out

ok 1 - set up basic repo with 1 file (hello) and 4 commits

expecting success: 
	rev_hash1=$(git rev-parse --verify $HASH1) &&
	test "$rev_hash1" = "$HASH1" &&
	rev_hash2=$(git rev-parse --verify $HASH2) &&
	test "$rev_hash2" = "$HASH2" &&
	rev_hash3=$(git rev-parse --verify $HASH3) &&
	test "$rev_hash3" = "$HASH3" &&
	rev_hash4=$(git rev-parse --verify $HASH4) &&
	test "$rev_hash4" = "$HASH4" &&
	rev_master=$(git rev-parse --verify master) &&
	test "$rev_master" = "$HASH4" &&
	rev_head=$(git rev-parse --verify HEAD) &&
	test "$rev_head" = "$HASH4"

ok 13 - outside

expecting success: 
	(
		cd work &&
		GIT_WORK_TREE=. &&
		test_rev_parse false false true ""
	)

Cloning into 'submodule_update'...
ok 2 - works with one good rev

error: sha1 mismatch 63ffffffffffffffffffffffffffffffffffffff
expecting success: 
	test_must_fail git rev-parse --verify 2>error &&
	grep "single revision" error &&
	test_must_fail git rev-parse --verify foo 2>error &&
	grep "single revision" error &&
	test_must_fail git rev-parse --verify HEAD bar 2>error &&
	grep "single revision" error &&
	test_must_fail git rev-parse --verify baz HEAD 2>error &&
	grep "single revision" error &&
	test_must_fail git rev-parse --verify $HASH2 HEAD 2>error &&
	grep "single revision" error

ok 14 - inside work tree

expecting success: 
	(
		cd work/sub/dir &&
		GIT_WORK_TREE=../.. &&
		test_rev_parse false false true sub/dir/
	)

fatal: Needed a single revision
done.
fatal: Needed a single revision
fatal: Needed a single revision
fatal: Needed a single revision
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
ok 15 - subdir of work tree

expecting success: 
	mv work repo.git/work &&
	mv work2 repo.git/work2 &&
	GIT_DIR=$(pwd)/repo.git &&
	GIT_CONFIG=$GIT_DIR/config &&
	GIT_WORK_TREE=$(pwd)/repo.git/work &&
	export GIT_DIR GIT_CONFIG GIT_WORK_TREE

ok 20 - rev-list --verify-objects with bad sha1

expecting success: 
	(git init null-blob &&
	 cd null-blob &&
	 sha=$(printf "100644 file$_bz$_bz20" |
	       git hash-object -w --stdin -t tree) &&
	  git fsck 2>out &&
	  cat out &&
	  grep "warning.*null sha1" out
	)

fatal: Needed a single revision
ok 3 - fails with any bad rev or many good revs

expecting success: 
	test_must_fail git rev-parse --verify --quiet 2>error &&
	test_must_be_empty error &&
	test_must_fail git rev-parse -q --verify foo 2>error &&
	test_must_be_empty error &&
	test_must_fail git rev-parse --verify -q HEAD bar 2>error &&
	test_must_be_empty error &&
	test_must_fail git rev-parse --quiet --verify baz HEAD 2>error &&
	test_must_be_empty error &&
	test_must_fail git rev-parse -q --verify $HASH2 HEAD 2>error &&
	test_must_be_empty error

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/null-blob/.git/
ok 16 - setup: GIT_WORK_TREE=absolute, below git dir

expecting success: 
	echo outside &&
	test_rev_parse false false false

outside
Branch add_sub1 set up to track remote branch add_sub1 from origin.
notice: HEAD points to an unborn branch (master)
warning in tree aaf928e9279b56c88bcc8d79f881e5c820ea23e8: contains entries pointing to null sha1
notice: No default references
warning in tree aaf928e9279b56c88bcc8d79f881e5c820ea23e8: contains entries pointing to null sha1
ok 21 - fsck notices blob entry pointing to null sha1

expecting success: 
	(git init null-commit &&
	 cd null-commit &&
	 sha=$(printf "160000 submodule$_bz$_bz20" |
	       git hash-object -w --stdin -t tree) &&
	  git fsck 2>out &&
	  cat out &&
	  grep "warning.*null sha1" out
	)

ok 17 - outside

expecting success: 
	(
		cd repo.git &&
		test_rev_parse false true false
	) &&
	(
		cd repo.git/objects &&
		test_rev_parse false true false
	) &&
	(
		cd repo.git/work2 &&
		test_rev_parse false true false
	)

ok 4 - fails silently when using -q

expecting success: 
	ref=$(git rev-parse HEAD) &&
	: >.git/logs/refs/test &&
	git update-ref -m "message for refs/test" refs/test "$ref" &&
	git reflog delete --updateref --rewrite refs/test@{0} &&
	test_must_fail git rev-parse -q --verify refs/test@{0} >error 2>&1 &&
	test_must_be_empty error

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/null-commit/.git/
notice: HEAD points to an unborn branch (master)
warning in tree f87f3eabd15018382578c00e3a71a46c842e17e6: contains entries pointing to null sha1
notice: No default references
warning in tree f87f3eabd15018382578c00e3a71a46c842e17e6: contains entries pointing to null sha1
ok 22 - fsck notices submodule entry pointing to null sha1

expecting success: 
		(
			git init $name-$type &&
			cd $name-$type &&
			echo content >file &&
			git add file &&
			git commit -m base &&
			blob=$(git rev-parse :file) &&
			tree=$(git rev-parse HEAD^{tree}) &&
			value=$(eval "echo \$$type") &&
			printf "$mode $type %s\t%s" "$value" "$path" >bad &&
			bad_tree=$(git mktree <bad) &&
			git fsck 2>out &&
			cat out &&
			grep "warning.*tree $bad_tree" out
		)
ok 5 - fails silently when using -q with deleted reflogs

expecting success: 
	ref=$(git rev-parse HEAD) &&
	: >.git/logs/refs/test2 &&
	git update-ref -m "message for refs/test2" refs/test2 "$ref" &&
	test_must_fail git rev-parse -q --verify refs/test2@{999} >error 2>&1 &&
	test_must_be_empty error

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dot-blob/.git/
ok 6 - fails silently when using -q with not enough reflogs

expecting success: 
	ref=$(git rev-parse HEAD) &&
	: >.git/logs/refs/test3 &&
	git update-ref -m "message for refs/test3" refs/test3 "$ref" &&
	git rev-parse -q --verify refs/test3@{1.year.ago} >actual 2>error &&
	test_must_be_empty error &&
	echo "$ref" >expect &&
	test_cmp expect actual

[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 7 - succeeds silently with -q and reflogs that do not go far back enough in time

expecting success: 
	test -z "$(git rev-parse --verify)" &&
	test -z "$(git rev-parse --verify foo)" &&
	test -z "$(git rev-parse --verify baz HEAD)" &&
	test -z "$(git rev-parse --verify HEAD bar)" &&
	test -z "$(git rev-parse --verify $HASH2 HEAD)"

ok 18 - in repo.git

expecting success: 
	(
		cd repo.git/work &&
		test_rev_parse false true true ""
	)

fatal: Needed a single revision
fatal: Needed a single revision
warning in tree 4d6a3deda84474ed5f701962ea9bf83c5fe08185: contains '.'
warning in tree 4d6a3deda84474ed5f701962ea9bf83c5fe08185: contains '.'
ok 23 - fsck notices . as blob

expecting success: 
		(
			git init $name-$type &&
			cd $name-$type &&
			echo content >file &&
			git add file &&
			git commit -m base &&
			blob=$(git rev-parse :file) &&
			tree=$(git rev-parse HEAD^{tree}) &&
			value=$(eval "echo \$$type") &&
			printf "$mode $type %s\t%s" "$value" "$path" >bad &&
			bad_tree=$(git mktree <bad) &&
			git fsck 2>out &&
			cat out &&
			grep "warning.*tree $bad_tree" out
		)
fatal: Needed a single revision
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
fatal: Needed a single revision
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dot-tree/.git/
ok 19 - inside work tree

expecting success: 
	(
		cd repo.git/work/sub/dir &&
		test_rev_parse false true true sub/dir/
	)

fatal: Needed a single revision
ok 8 - no stdout output on error

expecting success: 
	git rev-parse --verify --default master &&
	git rev-parse --verify --default master HEAD &&
	git rev-parse --default master --verify &&
	git rev-parse --default master --verify HEAD &&
	git rev-parse --verify HEAD --default master &&
	test_must_fail git rev-parse --verify foo --default master &&
	test_must_fail git rev-parse --default HEAD --verify bar &&
	test_must_fail git rev-parse --verify --default HEAD baz &&
	test_must_fail git rev-parse --default foo --verify &&
	test_must_fail git rev-parse --verify --default bar

32a594a3fdac2d57cf6d02987e30eec68511498c
32a594a3fdac2d57cf6d02987e30eec68511498c
[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
32a594a3fdac2d57cf6d02987e30eec68511498c
ok 20 - subdir of work tree

expecting success: 
	echo sub/dir/untracked >expected &&
	cat <<-\EOF >repo.git/work/.gitignore &&
	expected.*
	actual.*
	.gitignore
	EOF
	>repo.git/work/sub/dir/untracked &&
	(
		cd repo.git &&
		git ls-files --others --exclude-standard >../actual
	) &&
	test_cmp expected actual

32a594a3fdac2d57cf6d02987e30eec68511498c
32a594a3fdac2d57cf6d02987e30eec68511498c
fatal: Needed a single revision
ok 21 - find work tree from repo

expecting success: 
	echo sub/dir/tracked >expected &&
	>repo.git/work/sub/dir/tracked &&
	(
		cd repo.git/work/sub/dir &&
		git --git-dir=../../.. add tracked
	) &&
	(
		cd repo.git &&
		git ls-files >../actual
	) &&
	test_cmp expected actual

fatal: Needed a single revision
Cloning into 'sub1'...
fatal: Needed a single revision
warning in tree 8984d55df404e56c99a9c5a2e5a168084a913e8f: contains '.'
fatal: Needed a single revision
warning in tree 8984d55df404e56c99a9c5a2e5a168084a913e8f: contains '.'
ok 24 - fsck notices . as tree

expecting success: 
		(
			git init $name-$type &&
			cd $name-$type &&
			echo content >file &&
			git add file &&
			git commit -m base &&
			blob=$(git rev-parse :file) &&
			tree=$(git rev-parse HEAD^{tree}) &&
			value=$(eval "echo \$$type") &&
			printf "$mode $type %s\t%s" "$value" "$path" >bad &&
			bad_tree=$(git mktree <bad) &&
			git fsck 2>out &&
			cat out &&
			grep "warning.*tree $bad_tree" out
		)
fatal: Needed a single revision
ok 9 - use --default

expecting success: 
	N=$(git reflog | wc -l) &&
	Nm1=$(($N-1)) &&
	Np1=$(($N+1)) &&
	git rev-parse --verify master@{0} &&
	git rev-parse --verify master@{1} &&
	git rev-parse --verify master@{$Nm1} &&
	test_must_fail git rev-parse --verify master@{$N} &&
	test_must_fail git rev-parse --verify master@{$Np1}

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dotdot-blob/.git/
ok 22 - find work tree from work tree

expecting success: 
	(
		cd repo.git/work/sub/dir &&
		GIT_DIR=../../.. &&
		GIT_WORK_TREE=../.. &&
		GIT_PAGER= &&
		export GIT_DIR GIT_WORK_TREE GIT_PAGER &&

		git diff --exit-code tracked &&
		echo changed >tracked &&
		test_must_fail git diff --exit-code tracked
	)

32a594a3fdac2d57cf6d02987e30eec68511498c
done.
3de952f2416b6084f557ec417709eac740c6818c
diff --git a/sub/dir/tracked b/sub/dir/tracked
index e69de29..5ea2ed4 100644
--- a/sub/dir/tracked
+++ b/sub/dir/tracked
@@ -0,0 +1 @@
+changed
ok 23 - _gently() groks relative GIT_DIR & GIT_WORK_TREE

expecting success: 
	cat >diff-index-cached.expected <<-EOF &&
	:000000 100644 $_z40 $EMPTY_BLOB A	sub/dir/tracked
	EOF
	cat >diff-index.expected <<-EOF &&
	:000000 100644 $_z40 $_z40 A	sub/dir/tracked
	EOF

	(
		GIT_DIR=repo.git &&
		GIT_WORK_TREE=repo.git/work &&
		export GIT_DIR GIT_WORK_TREE &&
		git diff-index $EMPTY_TREE >diff-index.actual &&
		git diff-index --cached $EMPTY_TREE >diff-index-cached.actual
	) &&
	test_cmp diff-index.expected diff-index.actual &&
	test_cmp diff-index-cached.expected diff-index-cached.actual

88bcdc1839f0ad191ffdd65cae2a2a862d682151
[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
fatal: Log for 'master' only has 4 entries.
fatal: Log for 'master' only has 4 entries.
ok 10 - master@{n} for various n

ok 24 - diff-index respects work tree under .git dir

# passed all 10 test(s)
expecting success: 
	cat >diff-files.expected <<-EOF &&
	:100644 100644 $EMPTY_BLOB $_z40 M	sub/dir/tracked
	EOF

	(
		GIT_DIR=repo.git &&
		GIT_WORK_TREE=repo.git/work &&
		export GIT_DIR GIT_WORK_TREE &&
		git diff-files >diff-files.actual
	) &&
	test_cmp diff-files.expected diff-files.actual

1..10
ok 25 - diff-files respects work tree under .git dir

expecting success: 
	cat >diff-TREE.expected <<-EOF &&
	diff --git a/sub/dir/tracked b/sub/dir/tracked
	new file mode 100644
	index 0000000..$CHANGED_BLOB7
	--- /dev/null
	+++ b/sub/dir/tracked
	@@ -0,0 +1 @@
	+changed
	EOF
	cat >diff-TREE-cached.expected <<-EOF &&
	diff --git a/sub/dir/tracked b/sub/dir/tracked
	new file mode 100644
	index 0000000..$EMPTY_BLOB7
	EOF
	cat >diff-FILES.expected <<-EOF &&
	diff --git a/sub/dir/tracked b/sub/dir/tracked
	index $EMPTY_BLOB7..$CHANGED_BLOB7 100644
	--- a/sub/dir/tracked
	+++ b/sub/dir/tracked
	@@ -0,0 +1 @@
	+changed
	EOF

	(
		GIT_DIR=repo.git &&
		GIT_WORK_TREE=repo.git/work &&
		export GIT_DIR GIT_WORK_TREE &&
		git diff $EMPTY_TREE >diff-TREE.actual &&
		git diff --cached $EMPTY_TREE >diff-TREE-cached.actual &&
		git diff >diff-FILES.actual
	) &&
	test_cmp diff-TREE.expected diff-TREE.actual &&
	test_cmp diff-TREE-cached.expected diff-TREE-cached.actual &&
	test_cmp diff-FILES.expected diff-FILES.actual

*** t1504-ceiling-dirs.sh ***
warning in tree 879560d9e3297f45ca9c25d4eea563f8dd179a32: contains '..'
warning in tree 879560d9e3297f45ca9c25d4eea563f8dd179a32: contains '..'
ok 25 - fsck notices .. as blob

expecting success: 
		(
			git init $name-$type &&
			cd $name-$type &&
			echo content >file &&
			git add file &&
			git commit -m base &&
			blob=$(git rev-parse :file) &&
			tree=$(git rev-parse HEAD^{tree}) &&
			value=$(eval "echo \$$type") &&
			printf "$mode $type %s\t%s" "$value" "$path" >bad &&
			bad_tree=$(git mktree <bad) &&
			git fsck 2>out &&
			cat out &&
			grep "warning.*tree $bad_tree" out
		)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dotdot-tree/.git/
ok 26 - git diff respects work tree under .git dir

expecting success: 
	echo dir/tracked >expected.grep &&
	(
		cd repo.git/work/sub &&
		GIT_DIR=../.. &&
		GIT_WORK_TREE=.. &&
		export GIT_DIR GIT_WORK_TREE &&
		git grep -l changed >../../../actual.grep
	) &&
	test_cmp expected.grep actual.grep

[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1504-ceiling-dirs/.git/
Submodule path 'sub1': checked out '913780cd9739c4974f32aaa316af9267f73412c2'
ok 27 - git grep

expecting success: 
	(
		cd repo.git &&
		GIT_DIR=. GIT_WORK_TREE=work git commit -a -m done
	)

expecting success: test '' = "$(git rev-parse --show-prefix)"
ok 1 - no_ceil

expecting success: test '' = "$(git rev-parse --show-prefix)"
[master (root-commit) 5bfa839] done
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 sub/dir/tracked
ok 28 - git commit

expecting success: 
	(
		cd repo.git &&
		test_might_fail git config --unset core.worktree &&
		test_must_fail git log HEAD -- /home
	)

ok 2 - ceil_empty

expecting success: test '' = "$(git rev-parse --show-prefix)"
ok 3 - ceil_at_parent

expecting success: test '' = "$(git rev-parse --show-prefix)"
fatal: /home: '/home' is outside repository
ok 29 - absolute pathspec should fail gracefully

expecting success: 
	>dummy_file &&
	echo git --git-dir="$(pwd)//repo.git" --work-tree="$(pwd)" add dummy_file &&
	git --git-dir="$(pwd)//repo.git" --work-tree="$(pwd)" add dummy_file

warning in tree e704ff9811f799e752c8894dbc145bc74e4561fa: contains '..'
git --git-dir=/«PKGBUILDDIR»/t/trash directory.t1501-worktree//repo.git --work-tree=/«PKGBUILDDIR»/t/trash directory.t1501-worktree add dummy_file
ok 4 - ceil_at_parent_slash

expecting success: test '' = "$(git rev-parse --show-prefix)"
warning in tree e704ff9811f799e752c8894dbc145bc74e4561fa: contains '..'
ok 26 - fsck notices .. as tree

expecting success: 
		(
			git init $name-$type &&
			cd $name-$type &&
			echo content >file &&
			git add file &&
			git commit -m base &&
			blob=$(git rev-parse :file) &&
			tree=$(git rev-parse HEAD^{tree}) &&
			value=$(eval "echo \$$type") &&
			printf "$mode $type %s\t%s" "$value" "$path" >bad &&
			bad_tree=$(git mktree <bad) &&
			git fsck 2>out &&
			cat out &&
			grep "warning.*tree $bad_tree" out
		)
ok 5 - ceil_at_trash

expecting success: test '' = "$(git rev-parse --show-prefix)"
ok 30 - make_relative_path handles double slashes in GIT_DIR

expecting success: 
	GIT_DIR=repo.git GIT_WORK_TREE=repo.git/work \
	test-subprocess --setup-work-tree rev-parse --show-toplevel >actual &&
	echo "$(pwd)/repo.git/work" >expected &&
	test_cmp expected actual

ok 6 - ceil_at_trash_slash

expecting success: test '' = "$(git rev-parse --show-prefix)"
ok 7 - ceil_at_sub

ok 31 - relative $GIT_WORK_TREE and git subprocesses

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dotgit-blob/.git/
expecting success: test '' = "$(git rev-parse --show-prefix)"
expecting success: 
	mkdir work &&
	mkdir -p repo.git/repos/foo &&
	cp repo.git/HEAD repo.git/index repo.git/repos/foo &&
	test_might_fail cp repo.git/sharedindex.* repo.git/repos/foo &&
	sane_unset GIT_DIR GIT_CONFIG GIT_WORK_TREE

ok 8 - ceil_at_sub_slash

checking prerequisite: SYMLINKS

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	# test whether the filesystem supports symbolic links
	ln -s x y && test -h y

)
ok 15 - git read-tree -u --reset: added submodule creates empty directory

expecting success: 
		prolog &&
		reset_work_tree_to no_submodule &&
		(
			cd submodule_update &&
			git branch -t add_sub1 origin/add_sub1 &&
			mkdir sub1 &&
			$command add_sub1 &&
			test_superproject_content origin/add_sub1 &&
			test_dir_is_empty sub1 &&
			git submodule update --init --recursive &&
			test_submodule_content sub1 origin/add_sub1
		)
	
prerequisite SYMLINKS ok
cp: cannot stat 'repo.git/sharedindex.*': No such file or directory
ok 32 - Multi-worktree setup

expecting success: 
	echo "gitdir: repo.git/repos/foo" >gitfile &&
	echo ../.. >repo.git/repos/foo/commondir &&
	(
		cd work &&
		GIT_DIR=../gitfile git rev-parse --git-common-dir >actual &&
		test-path-utils real_path "$TRASH_DIRECTORY/repo.git" >expect &&
		test_cmp expect actual
	)

[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
expecting success: test 'sub/dir/' = "$(git rev-parse --show-prefix)"
ok 9 - subdir_no_ceil

expecting success: test 'sub/dir/' = "$(git rev-parse --show-prefix)"
ok 33 - GIT_DIR set (1)

expecting success: 
	echo "gitdir: repo.git/repos/foo" >gitfile &&
	echo "$(pwd)/repo.git" >repo.git/repos/foo/commondir &&
	(
		cd work &&
		GIT_DIR=../gitfile git rev-parse --git-common-dir >actual &&
		test-path-utils real_path "$TRASH_DIRECTORY/repo.git" >expect &&
		test_cmp expect actual
	)

ok 10 - subdir_ceil_empty

expecting success: 
		test_expect_code 128 git rev-parse --show-prefix
	
fatal: Not a git repository (or any of the parent directories): .git
ok 11 - subdir_ceil_at_trash: prefix

expecting success: 
		test_expect_code 128 git rev-parse --show-prefix
	
ok 34 - GIT_DIR set (2)

expecting success: 
	echo "gitdir: repo.git/repos/foo" >.git &&
	echo ../.. >repo.git/repos/foo/commondir &&
	(
		cd work &&
		git rev-parse --git-common-dir >actual &&
		test-path-utils real_path "$TRASH_DIRECTORY/repo.git" >expect &&
		test_cmp expect actual &&
		echo haha >data1 &&
		git add data1 &&
		git ls-files --full-name :/ | grep data1 >actual &&
		echo work/data1 >expect &&
		test_cmp expect actual
	)

fatal: Not a git repository (or any of the parent directories): .git
ok 12 - subdir_ceil_at_trash_slash: prefix

expecting success: 
		test_expect_code 128 git rev-parse --show-prefix
	
warning in tree 8ac5f64528d35de17a03755d2f3387af1de58b5a: contains '.git'
fatal: Not a git repository (or any of the parent directories): .git
ok 13 - subdir_ceil_at_sub: prefix

expecting success: 
		test_expect_code 128 git rev-parse --show-prefix
	
warning in tree 8ac5f64528d35de17a03755d2f3387af1de58b5a: contains '.git'
ok 27 - fsck notices .git as blob

expecting success: 
		(
			git init $name-$type &&
			cd $name-$type &&
			echo content >file &&
			git add file &&
			git commit -m base &&
			blob=$(git rev-parse :file) &&
			tree=$(git rev-parse HEAD^{tree}) &&
			value=$(eval "echo \$$type") &&
			printf "$mode $type %s\t%s" "$value" "$path" >bad &&
			bad_tree=$(git mktree <bad) &&
			git fsck 2>out &&
			cat out &&
			grep "warning.*tree $bad_tree" out
		)
fatal: Not a git repository (or any of the parent directories): .git
ok 14 - subdir_ceil_at_sub_slash: prefix

expecting success: 
		test_expect_code 128 git rev-parse --show-prefix
	
fatal: Not a git repository (or any of the parent directories): .git
ok 15 - subdir_ceil_at_top: prefix

expecting success: 
		test_expect_code 128 git rev-parse --show-prefix
	
Cloning into 'submodule_update'...
fatal: Not a git repository (or any of the parent directories): .git
ok 16 - subdir_ceil_at_top_slash: prefix

expecting success: test 'sub/dir/' = "$(git rev-parse --show-prefix)"
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dotgit-tree/.git/
ok 17 - subdir_ceil_at_top_no_resolve

expecting success: test 'sub/dir/' = "$(git rev-parse --show-prefix)"
ok 35 - Auto discovery

expecting success: 
	mkdir elsewhere &&
	git --git-dir=repo.git config core.worktree "$TRASH_DIRECTORY/elsewhere" &&
	echo "gitdir: repo.git/repos/foo" >.git &&
	echo ../.. >repo.git/repos/foo/commondir &&
	(
		cd work &&
		git rev-parse --git-common-dir >actual &&
		test-path-utils real_path "$TRASH_DIRECTORY/repo.git" >expect &&
		test_cmp expect actual &&
		echo haha >data2 &&
		git add data2 &&
		git ls-files --full-name :/ | grep data2 >actual &&
		echo work/data2 >expect &&
		test_cmp expect actual
	)

ok 18 - subdir_ceil_at_top_slash_no_resolve

expecting success: test 'sub/dir/' = "$(git rev-parse --show-prefix)"
done.
ok 19 - subdir_ceil_at_subdir

[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
expecting success: test 'sub/dir/' = "$(git rev-parse --show-prefix)"
ok 20 - subdir_ceil_at_subdir_slash

expecting success: test 'sub/dir/' = "$(git rev-parse --show-prefix)"
ok 21 - subdir_ceil_at_su

expecting success: test 'sub/dir/' = "$(git rev-parse --show-prefix)"
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
ok 22 - subdir_ceil_at_su_slash

expecting success: test 'sub/dir/' = "$(git rev-parse --show-prefix)"
ok 23 - subdir_ceil_at_sub_di

expecting success: test 'sub/dir/' = "$(git rev-parse --show-prefix)"
warning in tree 69237360529ca48e6b6c1af14e753faabe339fb7: contains '.git'
ok 36 - $GIT_DIR/common overrides core.worktree

expecting success: 
	echo "gitdir: repo.git/repos/foo" >.git &&
	echo ../.. >repo.git/repos/foo/commondir &&
	(
		cd work &&
		echo haha >data3 &&
		git --git-dir=../.git --work-tree=. add data3 &&
		git ls-files --full-name -- :/ | grep data3 >actual &&
		echo data3 >expect &&
		test_cmp expect actual
	)

ok 24 - subdir_ceil_at_sub_di_slash

expecting success: test 'sub/dir/' = "$(git rev-parse --show-prefix)"
warning in tree 69237360529ca48e6b6c1af14e753faabe339fb7: contains '.git'
ok 28 - fsck notices .git as tree

expecting success: 
		(
			git init $name-$type &&
			cd $name-$type &&
			echo content >file &&
			git add file &&
			git commit -m base &&
			blob=$(git rev-parse :file) &&
			tree=$(git rev-parse HEAD^{tree}) &&
			value=$(eval "echo \$$type") &&
			printf "$mode $type %s\t%s" "$value" "$path" >bad &&
			bad_tree=$(git mktree <bad) &&
			git fsck 2>out &&
			cat out &&
			grep "warning.*tree $bad_tree" out
		)
ok 25 - subdir_ceil_at_subdi

expecting success: test 'sub/dir/' = "$(git rev-parse --show-prefix)"
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 26 - subdir_ceil_at_subdi_slash

expecting success: 
		test_expect_code 128 git rev-parse --show-prefix
	
fatal: Not a git repository (or any of the parent directories): .git
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dotgit-case-blob/.git/
ok 27 - second_of_two: prefix

expecting success: 
		test_expect_code 128 git rev-parse --show-prefix
	
ok 37 - $GIT_WORK_TREE overrides $GIT_DIR/common

# passed all 37 test(s)
1..37
fatal: Not a git repository (or any of the parent directories): .git
ok 28 - first_of_two: prefix

expecting success: 
		test_expect_code 128 git rev-parse --show-prefix
	
fatal: Not a git repository (or any of the parent directories): .git
ok 29 - second_of_three: prefix

expecting success: test '' = "$(git rev-parse --show-prefix)"
[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 30 - git_dir_specified

expecting success: test 's/d/' = "$(git rev-parse --show-prefix)"
*** t1505-rev-parse-last.sh ***
ok 31 - sd_no_ceil

expecting success: test 's/d/' = "$(git rev-parse --show-prefix)"
ok 32 - sd_ceil_empty

expecting success: 
		test_expect_code 128 git rev-parse --show-prefix
	
fatal: Not a git repository (or any of the parent directories): .git
ok 33 - sd_ceil_at_trash: prefix

expecting success: 
		test_expect_code 128 git rev-parse --show-prefix
	
warning in tree 56bac0d7a0a3c1451521352e3d40117e5ffc602e: contains '.git'
fatal: Not a git repository (or any of the parent directories): .git
ok 34 - sd_ceil_at_trash_slash: prefix

expecting success: 
		test_expect_code 128 git rev-parse --show-prefix
	
warning in tree 56bac0d7a0a3c1451521352e3d40117e5ffc602e: contains '.git'
ok 29 - fsck notices .GIT as blob

expecting success: 
		(
			git init $name-$type &&
			cd $name-$type &&
			echo content >file &&
			git add file &&
			git commit -m base &&
			blob=$(git rev-parse :file) &&
			tree=$(git rev-parse HEAD^{tree}) &&
			value=$(eval "echo \$$type") &&
			printf "$mode $type %s\t%s" "$value" "$path" >bad &&
			bad_tree=$(git mktree <bad) &&
			git fsck 2>out &&
			cat out &&
			grep "warning.*tree $bad_tree" out
		)
fatal: Not a git repository (or any of the parent directories): .git
ok 35 - sd_ceil_at_s: prefix

expecting success: 
		test_expect_code 128 git rev-parse --show-prefix
	
fatal: Not a git repository (or any of the parent directories): .git
ok 36 - sd_ceil_at_s_slash: prefix

expecting success: test 's/d/' = "$(git rev-parse --show-prefix)"
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dotgit-case-tree/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1505-rev-parse-last/.git/
ok 37 - sd_ceil_at_sd

expecting success: test 's/d/' = "$(git rev-parse --show-prefix)"
expecting success: 

	make_commit 1 &&
	git branch side &&
	make_commit 2 &&
	make_commit 3 &&
	git checkout side &&
	make_commit 4 &&
	git merge master &&
	git checkout master


ok 38 - sd_ceil_at_sd_slash

expecting success: test 's/d/' = "$(git rev-parse --show-prefix)"
[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 39 - sd_ceil_at_su

expecting success: test 's/d/' = "$(git rev-parse --show-prefix)"
ok 40 - sd_ceil_at_su_slash

expecting success: test 's/d/' = "$(git rev-parse --show-prefix)"
[master (root-commit) e25b50c] 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 1
ok 41 - sd_ceil_at_s_di

expecting success: test 's/d/' = "$(git rev-parse --show-prefix)"
warning in tree 968a2dfde1e164e0513456c00ef656b2497434a3: contains '.git'
ok 42 - sd_ceil_at_s_di_slash

expecting success: test 's/d/' = "$(git rev-parse --show-prefix)"
warning in tree 968a2dfde1e164e0513456c00ef656b2497434a3: contains '.git'
ok 30 - fsck notices .GIT as tree

expecting success: 
		(
			git init $name-$type &&
			cd $name-$type &&
			echo content >file &&
			git add file &&
			git commit -m base &&
			blob=$(git rev-parse :file) &&
			tree=$(git rev-parse HEAD^{tree}) &&
			value=$(eval "echo \$$type") &&
			printf "$mode $type %s\t%s" "$value" "$path" >bad &&
			bad_tree=$(git mktree <bad) &&
			git fsck 2>out &&
			cat out &&
			grep "warning.*tree $bad_tree" out
		)
ok 43 - sd_ceil_at_sdi

expecting success: test 's/d/' = "$(git rev-parse --show-prefix)"
[master e3236fb] 2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 2
ok 44 - sd_ceil_at_sdi_slash

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dotgit-unicode-blob/.git/
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
# passed all 44 test(s)
1..44
*** t1506-rev-parse-diagnosis.sh ***
[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
[master 0e62f78] 3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 3
Switched to branch 'side'
Cloning into 'sub1'...
[side 75718b6] 4
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 4
warning in tree 2b65491a1b39699fb2bffda8e997c85fcb9c7beb: contains '.git'
warning in tree 2b65491a1b39699fb2bffda8e997c85fcb9c7beb: contains '.git'
ok 31 - fsck notices .gI{u200c}T as blob

expecting success: 
		(
			git init $name-$type &&
			cd $name-$type &&
			echo content >file &&
			git add file &&
			git commit -m base &&
			blob=$(git rev-parse :file) &&
			tree=$(git rev-parse HEAD^{tree}) &&
			value=$(eval "echo \$$type") &&
			printf "$mode $type %s\t%s" "$value" "$path" >bad &&
			bad_tree=$(git mktree <bad) &&
			git fsck 2>out &&
			cat out &&
			grep "warning.*tree $bad_tree" out
		)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1506-rev-parse-diagnosis/.git/
Merging:
75718b6 4
virtual master
found 1 common ancestor:
e25b50c 1
Merge made by the 'recursive' strategy.
expecting success: 
	echo one > file.txt &&
	mkdir subdir &&
	echo two > subdir/file.txt &&
	echo three > subdir/file2.txt &&
	git add . &&
	git commit -m init &&
	echo four > index-only.txt &&
	git add index-only.txt &&
	echo five > disk-only.txt

 2 | 1 +
 3 | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 2
 create mode 100644 3
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dotgit-unicode-tree/.git/
Switched to branch 'master'
done.
ok 1 - setup

expecting success: 
	test_cmp_rev side @{-1}

[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
[master (root-commit) 5ef5122] init
 Author: A U Thor <author@example.com>
 3 files changed, 3 insertions(+)
 create mode 100644 file.txt
 create mode 100644 subdir/file.txt
 create mode 100644 subdir/file2.txt
ok 2 - @{-1} works

expecting success: 
	test_cmp_rev side~2 @{-1}~2

ok 1 - set up basic repo

expecting success: 
	HASH_file=$(git rev-parse HEAD:file.txt) &&
	git rev-parse HEAD:subdir/file.txt &&
	git rev-parse :index-only.txt &&
	(cd subdir &&
	 git rev-parse HEAD:subdir/file2.txt &&
	 test $HASH_file = $(git rev-parse HEAD:file.txt) &&
	 test $HASH_file = $(git rev-parse :file.txt) &&
	 test $HASH_file = $(git rev-parse :0:file.txt) )

ok 3 - @{-1}~2 works

expecting success: 
	test_cmp_rev side^2 @{-1}^2

f719efd430d52bcfc8566a43b2eb655688d38871
warning in tree 6a547d921721f1cf91601a53fcc7aae232947d23: contains '.git'
warning in tree 6a547d921721f1cf91601a53fcc7aae232947d23: contains '.git'
ok 32 - fsck notices .gI{u200c}T as tree

8510665149157c2bc901848c3e0b746954e9cbd9
expecting success: 
		(
			git init $name-$type &&
			cd $name-$type &&
			echo content >file &&
			git add file &&
			git commit -m base &&
			blob=$(git rev-parse :file) &&
			tree=$(git rev-parse HEAD^{tree}) &&
			value=$(eval "echo \$$type") &&
			printf "$mode $type %s\t%s" "$value" "$path" >bad &&
			bad_tree=$(git mktree <bad) &&
			git fsck 2>out &&
			cat out &&
			grep "warning.*tree $bad_tree" out
		)
2bdf67abb163a4ffb2d7f3f0880c9fe5068ce782
ok 4 - @{-1}^2 works

expecting success: 
	test_cmp_rev side@{1} @{-1}@{1}

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dotgit-case2-blob/.git/
ok 2 - correct file objects

expecting success: 
	git rev-parse :file.txt >expected &&
	git rev-parse :./file.txt >result &&
	test_cmp expected result &&
	git rev-parse :0:./file.txt >result &&
	test_cmp expected result

Submodule path 'sub1': checked out '913780cd9739c4974f32aaa316af9267f73412c2'
ok 5 - @{-1}@{1} works

[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
expecting success: 
	test_cmp_rev master @{-2}

ok 6 - @{-2} works

ok 3 - correct relative file objects (0)

expecting success: 
	test_must_fail git rev-parse @{-3}

expecting success: 
	git rev-parse HEAD:file.txt >expected &&
	git rev-parse HEAD:./file.txt >result &&
	test_cmp expected result

fatal: ambiguous argument '@{-3}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
@{-3}
ok 7 - @{-3} fails

# passed all 7 test(s)
1..7
ok 4 - correct relative file objects (1)

expecting success: 
	(
		cd subdir &&
		git rev-parse HEAD:../file.txt >result &&
		test_cmp ../expected result
	)

warning in tree 3e29dd65f814deffead951c60da749fdf8a668c8: contains '.git'
warning in tree 3e29dd65f814deffead951c60da749fdf8a668c8: contains '.git'
ok 33 - fsck notices .Git as blob

expecting success: 
		(
			git init $name-$type &&
			cd $name-$type &&
			echo content >file &&
			git add file &&
			git commit -m base &&
			blob=$(git rev-parse :file) &&
			tree=$(git rev-parse HEAD^{tree}) &&
			value=$(eval "echo \$$type") &&
			printf "$mode $type %s\t%s" "$value" "$path" >bad &&
			bad_tree=$(git mktree <bad) &&
			git fsck 2>out &&
			cat out &&
			grep "warning.*tree $bad_tree" out
		)
ok 5 - correct relative file objects (2)

expecting success: 
	(
		cd subdir &&
		git rev-parse HEAD:../subdir/../file.txt >result &&
		test_cmp ../expected result
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dotgit-case2-tree/.git/
*** t1507-rev-parse-upstream.sh ***
ok 16 - git read-tree -u --reset: added submodule leaves existing empty directory alone

ok 6 - correct relative file objects (3)
expecting success: 
		prolog &&
		reset_work_tree_to no_submodule &&
		(
			cd submodule_update &&
			git branch -t add_sub1 origin/add_sub1 &&
			>sub1 &&
			$command add_sub1 &&
			test_superproject_content origin/add_sub1 &&
			test_dir_is_empty sub1
		)
	

expecting success: 
	git rev-parse HEAD:subdir/file.txt >expected &&
	(
		cd subdir &&
		git rev-parse HEAD:./file.txt >result &&
		test_cmp ../expected result
	)

[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 7 - correct relative file objects (4)

expecting success: 
	git rev-parse :subdir/file.txt >expected &&
	(
		cd subdir &&
		git rev-parse :./file.txt >result &&
		test_cmp ../expected result &&
		git rev-parse :0:./file.txt >result &&
		test_cmp ../expected result
	)

ok 8 - correct relative file objects (5)

expecting success: 
	git rev-parse :file.txt >expected &&
	(
		cd subdir &&
		git rev-parse :../file.txt >result &&
		test_cmp ../expected result &&
		git rev-parse :0:../file.txt >result &&
		test_cmp ../expected result
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1507-rev-parse-upstream/.git/
expecting success: 

	test_commit 1 &&
	git checkout -b side &&
	test_commit 2 &&
	git checkout master &&
	git clone . clone &&
	test_commit 3 &&
	(cd clone &&
	 test_commit 4 &&
	 git branch --track my-side origin/side &&
	 git branch --track local-master master &&
	 git branch --track fun@ny origin/side &&
	 git branch --track @funny origin/side &&
	 git branch --track funny@ origin/side &&
	 git remote add -t master master-only .. &&
	 git fetch master-only &&
	 git branch bad-upstream &&
	 git config branch.bad-upstream.remote master-only &&
	 git config branch.bad-upstream.merge refs/heads/side
	)

warning in tree 50c7c9624762f2fe0d4efe5cba98835f58822ef4: contains '.git'
warning in tree 50c7c9624762f2fe0d4efe5cba98835f58822ef4: contains '.git'
ok 34 - fsck notices .Git as tree

expecting success: 
		(
			git init $name-$type &&
			cd $name-$type &&
			echo content >file &&
			git add file &&
			git commit -m base &&
			blob=$(git rev-parse :file) &&
			tree=$(git rev-parse HEAD^{tree}) &&
			value=$(eval "echo \$$type") &&
			printf "$mode $type %s\t%s" "$value" "$path" >bad &&
			bad_tree=$(git mktree <bad) &&
			git fsck 2>out &&
			cat out &&
			grep "warning.*tree $bad_tree" out
		)
Cloning into 'submodule_update'...
[master (root-commit) d0dcf97] 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 1.t
ok 9 - correct relative file objects (6)

expecting success: 
	test_must_fail git rev-parse foobar:file.txt 2>error &&
	grep "Invalid object name 'foobar'." error &&
	test_must_fail git rev-parse foobar 2> error &&
	grep "unknown revision or path not in the working tree." error

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/git-tilde1-blob/.git/
foobar:file.txt
done.
fatal: Invalid object name 'foobar'.
foobar
fatal: ambiguous argument 'foobar': unknown revision or path not in the working tree.
ok 10 - incorrect revision id

expecting success: 
	test_must_fail git rev-parse HEAD:nothing.txt 2> error &&
	grep "fatal: Path 'nothing.txt' does not exist in 'HEAD'" error &&
	test_must_fail git rev-parse HEAD:index-only.txt 2> error &&
	grep "fatal: Path 'index-only.txt' exists on disk, but not in 'HEAD'." error &&
	(cd subdir &&
	 test_must_fail git rev-parse HEAD:file2.txt 2> error &&
	 test_did_you_mean HEAD subdir/ file2.txt exists )

[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
Switched to a new branch 'side'
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
HEAD:nothing.txt
fatal: Path 'nothing.txt' does not exist in 'HEAD'
[side 82335b2] 2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 2.t
HEAD:index-only.txt
fatal: Path 'index-only.txt' exists on disk, but not in 'HEAD'.
Branch add_sub1 set up to track remote branch add_sub1 from origin.
HEAD:file2.txt
Switched to branch 'master'
ok 11 - incorrect file in sha1:path

expecting success: 
	test_must_fail git rev-parse :nothing.txt 2> error &&
	grep "fatal: Path 'nothing.txt' does not exist (neither on disk nor in the index)." error &&
	test_must_fail git rev-parse :1:nothing.txt 2> error &&
	grep "Path 'nothing.txt' does not exist (neither on disk nor in the index)." error &&
	test_must_fail git rev-parse :1:file.txt 2> error &&
	test_did_you_mean ":0" "" file.txt "is in the index" "at stage 1" &&
	(cd subdir &&
	 test_must_fail git rev-parse :1:file.txt 2> error &&
	 test_did_you_mean ":0" "" file.txt "is in the index" "at stage 1" &&
	 test_must_fail git rev-parse :file2.txt 2> error &&
	 test_did_you_mean ":0" subdir/ file2.txt "is in the index" &&
	 test_must_fail git rev-parse :2:file2.txt 2> error &&
	 test_did_you_mean :0 subdir/ file2.txt "is in the index") &&
	test_must_fail git rev-parse :disk-only.txt 2> error &&
	grep "fatal: Path 'disk-only.txt' exists on disk, but not in the index." error

Cloning into 'clone'...
warning in tree 1206e1b64fcedc2a9e7b8195c1c4c1a278285b20: contains '.git'
warning in tree 1206e1b64fcedc2a9e7b8195c1c4c1a278285b20: contains '.git'
ok 35 - fsck notices git~1 as blob

expecting success: 
		(
			git init $name-$type &&
			cd $name-$type &&
			echo content >file &&
			git add file &&
			git commit -m base &&
			blob=$(git rev-parse :file) &&
			tree=$(git rev-parse HEAD^{tree}) &&
			value=$(eval "echo \$$type") &&
			printf "$mode $type %s\t%s" "$value" "$path" >bad &&
			bad_tree=$(git mktree <bad) &&
			git fsck 2>out &&
			cat out &&
			grep "warning.*tree $bad_tree" out
		)
:nothing.txt
fatal: Path 'nothing.txt' does not exist (neither on disk nor in the index).
done.
:1:nothing.txt
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/git-tilde1-tree/.git/
fatal: Path 'nothing.txt' does not exist (neither on disk nor in the index).
ok 17 - git read-tree -u --reset: added submodule does remove untracked unignored file with same name when forced

expecting success: 
		prolog &&
		reset_work_tree_to replace_sub1_with_file &&
		(
			cd submodule_update &&
			git branch -t replace_file_with_sub1 origin/replace_file_with_sub1 &&
			$command replace_file_with_sub1 &&
			test_superproject_content origin/replace_file_with_sub1 &&
			test_dir_is_empty sub1 &&
			git submodule update --init --recursive &&
			test_submodule_content sub1 origin/replace_file_with_sub1
		)
	
:1:file.txt
[master 8f489d0] 3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 3.t
[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
:1:file.txt
:file2.txt
[master 6efda21] 4
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 4.t
:2:file2.txt
Cloning into 'submodule_update'...
:disk-only.txt
fatal: Path 'disk-only.txt' exists on disk, but not in the index.
ok 12 - incorrect file in :path and :N:path

expecting success: 
	test_must_fail git rev-parse master@{99999} >output 2>error &&
	test -z "$(cat output)" &&
	grep "fatal: Log for [^ ]* only has [0-9][0-9]* entries." error  &&
	test_must_fail git rev-parse --verify master@{99999} >output 2>error &&
	test -z "$(cat output)" &&
	grep "fatal: Log for [^ ]* only has [0-9][0-9]* entries." error

Branch my-side set up to track remote branch side from origin.
done.
warning in tree 06f99accfb778f3318c72f3ae1c809cca146d27c: contains '.git'
warning in tree 06f99accfb778f3318c72f3ae1c809cca146d27c: contains '.git'
ok 36 - fsck notices git~1 as tree

expecting success: 
		(
			git init $name-$type &&
			cd $name-$type &&
			echo content >file &&
			git add file &&
			git commit -m base &&
			blob=$(git rev-parse :file) &&
			tree=$(git rev-parse HEAD^{tree}) &&
			value=$(eval "echo \$$type") &&
			printf "$mode $type %s\t%s" "$value" "$path" >bad &&
			bad_tree=$(git mktree <bad) &&
			git fsck 2>out &&
			cat out &&
			grep "warning.*tree $bad_tree" out
		)
fatal: Log for 'master' only has 1 entries.
Branch local-master set up to track local branch master.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dotgitdot-blob/.git/
fatal: Log for 'master' only has 1 entries.
ok 13 - invalid @{n} reference

expecting success: 
	(
		cd subdir &&
		test_must_fail git rev-parse HEAD:./nonexistent.txt 2>error &&
		grep subdir/nonexistent.txt error
	)

Branch fun@ny set up to track remote branch side from origin.
Switched to a new branch 'replace_sub1_with_file'
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
HEAD:./nonexistent.txt
Branch @funny set up to track remote branch side from origin.
fatal: Path 'subdir/nonexistent.txt' does not exist in 'HEAD'
ok 14 - relative path not found

expecting success: 
	test_must_fail git rev-parse HEAD:../file.txt >output 2>error &&
	test -z "$(cat output)" &&
	grep "outside repository" error

[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
t1013-read-tree-submodule.sh: 159: cd: Branch funny@ set up to track remote branch side from origin.
can't cd to sub1
fatal: '../file.txt' is outside repository
ok 15 - relative path outside worktree

expecting success: 
	test_must_fail git --git-dir=.git --work-tree=subdir rev-parse HEAD:./file.txt >output 2>error &&
	test -z "$(cat output)" &&
	grep "relative path syntax can.t be used outside working tree." error

Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
fatal: relative path syntax can't be used outside working tree.
ok 16 - relative path when cwd is outside worktree

expecting success: 
	test_must_fail test-match-trees HEAD:./file.txt HEAD:./file.txt 2>error &&
	grep "BUG: startup_info struct is not initialized." error

warning in tree 08554698725ae2bc2c2ae0172779111c62bda7a2: contains '.git'
warning in tree 08554698725ae2bc2c2ae0172779111c62bda7a2: contains '.git'
fatal: BUG: startup_info struct is not initialized.
ok 37 - fsck notices .git. as blob
ok 17 - relative path when startup_info is NULL


expecting success: 
	test_must_fail git rev-parse file.txt HEAD:file.txt 1>actual 2>error &&
	test_i18ngrep ! "exists on disk" error &&
	test_i18ngrep "no such path in the working tree" error &&
	cat >expect <<-\EOF &&
	file.txt
	HEAD:file.txt
	EOF
	test_cmp expect actual

expecting success: 
		(
			git init $name-$type &&
			cd $name-$type &&
			echo content >file &&
			git add file &&
			git commit -m base &&
			blob=$(git rev-parse :file) &&
			tree=$(git rev-parse HEAD^{tree}) &&
			value=$(eval "echo \$$type") &&
			printf "$mode $type %s\t%s" "$value" "$path" >bad &&
			bad_tree=$(git mktree <bad) &&
			git fsck 2>out &&
			cat out &&
			grep "warning.*tree $bad_tree" out
		)
fatal: HEAD:file.txt: no such path in the working tree.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dotgitdot-tree/.git/
ok 18 - <commit>:file correctly diagnosed after a pathname

expecting success: 
	( H=$(git rev-parse HEAD) && echo $H && echo ^$H ) >expect &&

	git rev-parse HEAD.. >actual &&
	test_cmp expect actual &&

	git rev-parse ..HEAD >actual &&
	test_cmp expect actual &&

	echo .. >expect &&
	git rev-parse .. >actual &&
	test_cmp expect actual

From ..
 * [new branch]      master     -> master-only/master
 * [new tag]         3          -> 3
[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 19 - dotdot is not an empty set

expecting success: 
	test_must_fail git rev-parse foobar -- 2>stderr &&
	test_i18ngrep "bad revision" stderr

ok 1 - setup

expecting success: 
	test refs/remotes/origin/master = "$(full_name @{upstream})"

fatal: bad revision 'foobar'
ok 20 - arg before dashdash must be a revision (missing)
ok 2 - @{upstream} resolves to correct full name


expecting success: 
	test refs/remotes/origin/master = "$(full_name @{u})"

expecting success: 
	>foobar &&
	test_must_fail git rev-parse foobar -- 2>stderr &&
	test_i18ngrep "bad revision" stderr

ok 3 - @{u} resolves to correct full name

expecting success: 
	test refs/remotes/origin/side = "$(full_name my-side@{u})"

ok 4 - my-side@{upstream} resolves to correct full name

expecting success: 
	full_name fun@ny@{u} >actual &&
	echo refs/remotes/origin/side >expect &&
	test_cmp expect actual

fatal: bad revision 'foobar'
ok 21 - arg before dashdash must be a revision (file)

expecting success: 
	>foobar &&
	git update-ref refs/heads/foobar HEAD &&
	{
		# we do not want to use rev-parse here, because
		# we are testing it
		cat .git/refs/heads/foobar &&
		printf "%s\n" --
	} >expect &&
	git rev-parse foobar -- >actual &&
	test_cmp expect actual

warning in tree 4d7df7e65b79aeef4640dbfba95705b94a2bc266: contains '.git'
warning in tree 4d7df7e65b79aeef4640dbfba95705b94a2bc266: contains '.git'
ok 5 - upstream of branch with @ in middle

expecting success: 
	full_name @funny@{u} >actual &&
	echo refs/remotes/origin/side >expect &&
	test_cmp expect actual

ok 38 - fsck notices .git. as tree

expecting success: 
		(
			git init $name-$type &&
			cd $name-$type &&
			echo content >file &&
			git add file &&
			git commit -m base &&
			blob=$(git rev-parse :file) &&
			tree=$(git rev-parse HEAD^{tree}) &&
			value=$(eval "echo \$$type") &&
			printf "$mode $type %s\t%s" "$value" "$path" >bad &&
			bad_tree=$(git mktree <bad) &&
			git fsck 2>out &&
			cat out &&
			grep "warning.*tree $bad_tree" out
		)
ok 6 - upstream of branch with @ at start

expecting success: 
	full_name funny@@{u} >actual &&
	echo refs/remotes/origin/side >expect &&
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dot-backslash-case-blob/.git/
ok 22 - arg before dashdash must be a revision (ambiguous)

ok 7 - upstream of branch with @ at end

expecting success: 
	test_must_fail full_name refs/heads/my-side@{upstream}

# passed all 22 test(s)
1..22
fatal: no such branch: 'refs/heads/my-side'
ok 8 - refs/heads/my-side@{upstream} does not resolve to my-side{upstream}

expecting success: 
	git checkout side &&
	test_commit 5 &&
	(cd clone && git fetch) &&
	test 2 = "$(commit_subject my-side)" &&
	test 5 = "$(commit_subject my-side@{u})"

[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
Switched to branch 'side'
*** t1508-at-combinations.sh ***
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
[side e3f9627] 5
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 5.t
warning in tree 4447c608c557aa9e2d0d226c7af1f06937133ea1: contains '.git'
warning in tree 4447c608c557aa9e2d0d226c7af1f06937133ea1: contains '.git'
ok 39 - fsck notices .\.GIT\foobar as blob

expecting success: 
		(
			git init $name-$type &&
			cd $name-$type &&
			echo content >file &&
			git add file &&
			git commit -m base &&
			blob=$(git rev-parse :file) &&
			tree=$(git rev-parse HEAD^{tree}) &&
			value=$(eval "echo \$$type") &&
			printf "$mode $type %s\t%s" "$value" "$path" >bad &&
			bad_tree=$(git mktree <bad) &&
			git fsck 2>out &&
			cat out &&
			grep "warning.*tree $bad_tree" out
		)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dot-backslash-case-tree/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1508-at-combinations/.git/
expecting success: 
	test_commit master-one &&
	test_commit master-two &&
	git checkout -b upstream-branch &&
	test_commit upstream-one &&
	test_commit upstream-two &&
	git checkout -b @/at-test &&
	git checkout -b @@/at-test &&
	git checkout -b @at-test &&
	git checkout -b old-branch &&
	test_commit old-one &&
	test_commit old-two &&
	git checkout -b new-branch &&
	test_commit new-one &&
	test_commit new-two &&
	git branch -u master old-branch &&
	git branch -u upstream-branch new-branch

[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
From /«PKGBUILDDIR»/t/trash directory.t1507-rev-parse-upstream/.
   d0dcf97..8f489d0  master     -> origin/master
   82335b2..e3f9627  side       -> origin/side
 * [new tag]         5          -> 5
Cloning into 'sub1'...
[master (root-commit) 8ff5a25] master-one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 master-one.t
done.
ok 9 - my-side@{u} resolves to correct commit

expecting success: 
	test_must_fail full_name non-tracking@{u} &&
	(cd clone && git checkout --no-track -b non-tracking) &&
	test_must_fail full_name non-tracking@{u}

[master 8164ab4] master-two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 master-two.t
fatal: no such branch: 'non-tracking'
warning in tree a8562dc6d26106f039fc8af6b2aa6fed2b1e14d4: contains '.git'
warning in tree a8562dc6d26106f039fc8af6b2aa6fed2b1e14d4: contains '.git'
ok 40 - fsck notices .\.GIT\foobar as tree

expecting success: 
		(
			git init $name-$type &&
			cd $name-$type &&
			echo content >file &&
			git add file &&
			git commit -m base &&
			blob=$(git rev-parse :file) &&
			tree=$(git rev-parse HEAD^{tree}) &&
			value=$(eval "echo \$$type") &&
			printf "$mode $type %s\t%s" "$value" "$path" >bad &&
			bad_tree=$(git mktree <bad) &&
			git fsck 2>out &&
			cat out &&
			grep "warning.*tree $bad_tree" out
		)
Switched to a new branch 'upstream-branch'
Switched to a new branch 'non-tracking'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dotgit-case-backslash-blob/.git/
fatal: no upstream configured for branch 'non-tracking'
ok 10 - not-tracking@{u} fails

expecting success: 
	test_commit 6 &&
	(cd clone && git fetch) &&
	test 5 = $(commit_subject my-side@{u}@{1})

[upstream-branch 101729d] upstream-one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 upstream-one.t
[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
[side 8bf5882] 6
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 6.t
[upstream-branch 77f4b7f] upstream-two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 upstream-two.t
warning in tree 707c253cde8e3742e9f02a3cf02fdc4ca0f55652: contains '.git'
Switched to a new branch '@/at-test'
warning in tree 707c253cde8e3742e9f02a3cf02fdc4ca0f55652: contains '.git'
ok 41 - fsck notices .git\foobar as blob

expecting success: 
		(
			git init $name-$type &&
			cd $name-$type &&
			echo content >file &&
			git add file &&
			git commit -m base &&
			blob=$(git rev-parse :file) &&
			tree=$(git rev-parse HEAD^{tree}) &&
			value=$(eval "echo \$$type") &&
			printf "$mode $type %s\t%s" "$value" "$path" >bad &&
			bad_tree=$(git mktree <bad) &&
			git fsck 2>out &&
			cat out &&
			grep "warning.*tree $bad_tree" out
		)
Switched to a new branch '@@/at-test'
Submodule path 'sub1': checked out '913780cd9739c4974f32aaa316af9267f73412c2'
From /«PKGBUILDDIR»/t/trash directory.t1507-rev-parse-upstream/.
   e3f9627..8bf5882  side       -> origin/side
 * [new tag]         6          -> 6
Switched to a new branch '@at-test'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dotgit-case-backslash-tree/.git/
ok 11 - <branch>@{u}@{1} resolves correctly

expecting success: 
	git checkout HEAD^0 &&
	test_must_fail git rev-parse @{u}

Switched to a new branch 'old-branch'
Note: checking out 'HEAD^0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 8bf5882... 6
[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
fatal: HEAD does not point to a branch
ok 12 - @{u} without specifying branch fails on a detached HEAD

expecting success: 
(
	cd clone &&
	git checkout -b new my-side@{u} &&
	git rev-parse --symbolic-full-name my-side@{u} >expect &&
	git rev-parse --symbolic-full-name new@{u} >actual &&
	test_cmp expect actual
)

[old-branch 4e4e7fa] old-one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 old-one.t
Switched to a new branch 'new'
Branch new set up to track remote branch side from origin.
[old-branch 3273d4d] old-two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 old-two.t
ok 13 - checkout -b new my-side@{u} forks from the same

expecting success: 
(
	cd clone || exit
	git checkout master || exit
	git branch -D new ;# can fail but is ok
	git branch -t new my-side@{u} &&
	git merge -s ours new@{u} &&
	git show -s --pretty=tformat:%s >actual &&
	echo "Merge remote-tracking branch ${sq}origin/side${sq}" >expect &&
	test_cmp expect actual
)

ok 18 - git read-tree -u --reset: replace tracked file with submodule creates empty directory

expecting success: 
		prolog &&
		reset_work_tree_to replace_sub1_with_directory &&
		(
			cd submodule_update &&
			git branch -t replace_directory_with_sub1 origin/replace_directory_with_sub1 &&
			$command replace_directory_with_sub1 &&
			test_superproject_content origin/replace_directory_with_sub1 &&
			test_dir_is_empty sub1 &&
			git submodule update --init --recursive &&
			test_submodule_content sub1 origin/replace_directory_with_sub1
		)
	
warning in tree caa586f8ddde64c3fc9157a3a262c9bd6a6a41ff: contains '.git'
Switched to branch 'master'
warning in tree caa586f8ddde64c3fc9157a3a262c9bd6a6a41ff: contains '.git'
Your branch and 'origin/master' have diverged,
and have 1 and 1 different commit each, respectively.
  (use "git pull" to merge the remote branch into yours)
ok 42 - fsck notices .git\foobar as tree

expecting success: 
	(
		git init not-dotgit &&
		cd not-dotgit &&
		echo content >file &&
		git add file &&
		git commit -m base &&
		blob=$(git rev-parse :file) &&
		printf "100644 blob $blob\t.\\305\\207it" >tree &&
		tree=$(git mktree <tree) &&
		git fsck 2>err &&
		test_line_count = 0 err
	)

Switched to a new branch 'new-branch'
Deleted branch new (was 8bf5882).
Branch new set up to track remote branch side from origin.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/not-dotgit/.git/
[new-branch e49ce93] new-one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 new-one.t
[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
Merge made by the 'ours' strategy.
Cloning into 'submodule_update'...
[new-branch c493e4b] new-two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 new-two.t
ok 14 - merge my-side@{u} records the correct name

expecting success: 
	git checkout -t -b other master &&
	git branch -d @{u} &&
	git for-each-ref refs/heads/master >actual &&
	>expect &&
	test_cmp expect actual

ok 43 - fsck allows .Ňit

expecting success: 
	create_repo_missing HEAD:subdir/file &&
	test_must_fail git -C missing fsck

Previous HEAD position was 8bf5882... 6
Switched to a new branch 'other'
Branch old-branch set up to track local branch master.
Branch other set up to track local branch master.
done.
Branch new-branch set up to track local branch upstream-branch.
ok 1 - setup

expecting success: 
		echo 'refs/heads/new-branch' >expect &&
		if test 'ref' = 'commit'
		then
			git log -1 --format=%s 'HEAD' >actual
		elif test 'ref' = 'ref'
		then
			git rev-parse --symbolic-full-name 'HEAD' >actual
		else
			git cat-file -p 'HEAD' >actual
		fi &&
		test_cmp expect actual
	
Deleted branch master (was 8f489d0).
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/missing/.git/
ok 15 - branch -d other@{u}

expecting success: 
	git branch -f master HEAD &&
	git checkout -t -b another master &&
	git checkout @{u} &&
	git symbolic-ref HEAD >actual &&
	echo refs/heads/master >expect &&
	test_cmp expect actual

[master (root-commit) d38f542] one
 Author: A U Thor <author@example.com>
ok 2 - HEAD = refs/heads/new-branch

expecting success: 
		echo 'new-one' >expect &&
		if test 'commit' = 'commit'
		then
			git log -1 --format=%s '@{1}' >actual
		elif test 'commit' = 'ref'
		then
			git rev-parse --symbolic-full-name '@{1}' >actual
		else
			git cat-file -p '@{1}' >actual
		fi &&
		test_cmp expect actual
	
Switched to a new branch 'replace_sub1_with_directory'
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
ok 3 - @{1} = new-one

expecting success: 
		echo 'new-one' >expect &&
		if test 'commit' = 'commit'
		then
			git log -1 --format=%s 'HEAD@{1}' >actual
		elif test 'commit' = 'ref'
		then
			git rev-parse --symbolic-full-name 'HEAD@{1}' >actual
		else
			git cat-file -p 'HEAD@{1}' >actual
		fi &&
		test_cmp expect actual
	
Switched to a new branch 'another'
Branch another set up to track local branch master.
[master ca32bda] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 subdir/file
ok 4 - HEAD@{1} = new-one

expecting success: 
		echo 'new-two' >expect &&
		if test 'commit' = 'commit'
		then
			git log -1 --format=%s '@{now}' >actual
		elif test 'commit' = 'ref'
		then
			git rev-parse --symbolic-full-name '@{now}' >actual
		else
			git cat-file -p '@{now}' >actual
		fi &&
		test_cmp expect actual
	
Switched to branch 'master'
error: 8ed2e6719f8484ce01fa3ce133fe42d25c2441b8^{commit}: expected commit type, but the object dereferences to tree type
fatal: Needed a single revision
ok 5 - @{now} = new-two

expecting success: 
		echo 'new-two' >expect &&
		if test 'commit' = 'commit'
		then
			git log -1 --format=%s 'HEAD@{now}' >actual
		elif test 'commit' = 'ref'
		then
			git rev-parse --symbolic-full-name 'HEAD@{now}' >actual
		else
			git cat-file -p 'HEAD@{now}' >actual
		fi &&
		test_cmp expect actual
	
Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
ok 16 - checkout other@{u}

expecting success: 
	test refs/heads/master = "$(full_name local-master@{u})"

ok 6 - HEAD@{now} = new-two

expecting success: 
		echo 'refs/heads/old-branch' >expect &&
		if test 'ref' = 'commit'
		then
			git log -1 --format=%s '@{-1}' >actual
		elif test 'ref' = 'ref'
		then
			git rev-parse --symbolic-full-name '@{-1}' >actual
		else
			git cat-file -p '@{-1}' >actual
		fi &&
		test_cmp expect actual
	
ok 17 - branch@{u} works when tracking a local branch

expecting success: 
	cat >expect <<-EOF &&
	fatal: no upstream configured for branch ${sq}non-tracking${sq}
	EOF
	error_message non-tracking@{u} 2>actual &&
	test_i18ncmp expect actual

ok 7 - @{-1} = refs/heads/old-branch

expecting success: 
		echo 'old-two' >expect &&
		if test 'commit' = 'commit'
		then
			git log -1 --format=%s '@{-1}@{0}' >actual
		elif test 'commit' = 'ref'
		then
			git rev-parse --symbolic-full-name '@{-1}@{0}' >actual
		else
			git cat-file -p '@{-1}@{0}' >actual
		fi &&
		test_cmp expect actual
	
ok 18 - branch@{u} error message when no upstream

expecting success: 
	cat >expect <<-EOF &&
	fatal: no upstream configured for branch ${sq}master${sq}
	EOF
	test_must_fail git rev-parse --verify @{u} 2>actual &&
	test_i18ncmp expect actual

missing blob d95f3ad14dee633a758d2e331151e950dd13e4ed
ok 44 - fsck notices missing blob

expecting success: 
	create_repo_missing HEAD:subdir &&
	test_must_fail git -C missing fsck

ok 8 - @{-1}@{0} = old-two

expecting success: 
		echo 'old-one' >expect &&
		if test 'commit' = 'commit'
		then
			git log -1 --format=%s '@{-1}@{1}' >actual
		elif test 'commit' = 'ref'
		then
			git rev-parse --symbolic-full-name '@{-1}@{1}' >actual
		else
			git cat-file -p '@{-1}@{1}' >actual
		fi &&
		test_cmp expect actual
	
ok 19 - @{u} error message when no upstream

expecting success: 
	cat >expect <<-EOF &&
	fatal: no such branch: ${sq}no-such-branch${sq}
	EOF
	error_message no-such-branch@{u} 2>actual &&
	test_i18ncmp expect actual

ok 9 - @{-1}@{1} = old-one

expecting success: 
		echo 'refs/heads/upstream-branch' >expect &&
		if test 'ref' = 'commit'
		then
			git log -1 --format=%s '@{u}' >actual
		elif test 'ref' = 'ref'
		then
			git rev-parse --symbolic-full-name '@{u}' >actual
		else
			git cat-file -p '@{u}' >actual
		fi &&
		test_cmp expect actual
	
ok 20 - branch@{u} error message with misspelt branch

expecting success: 
	cat >expect <<-EOF &&
	fatal: HEAD does not point to a branch
	EOF
	git checkout HEAD^0 &&
	test_must_fail git rev-parse --verify @{u} 2>actual &&
	test_i18ncmp expect actual

ok 10 - @{u} = refs/heads/upstream-branch

expecting success: 
		echo 'refs/heads/upstream-branch' >expect &&
		if test 'ref' = 'commit'
		then
			git log -1 --format=%s 'HEAD@{u}' >actual
		elif test 'ref' = 'ref'
		then
			git rev-parse --symbolic-full-name 'HEAD@{u}' >actual
		else
			git cat-file -p 'HEAD@{u}' >actual
		fi &&
		test_cmp expect actual
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/missing/.git/
Note: checking out 'HEAD^0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 8f489d0... 3
ok 11 - HEAD@{u} = refs/heads/upstream-branch

expecting success: 
		echo 'upstream-one' >expect &&
		if test 'commit' = 'commit'
		then
			git log -1 --format=%s '@{u}@{1}' >actual
		elif test 'commit' = 'ref'
		then
			git rev-parse --symbolic-full-name '@{u}@{1}' >actual
		else
			git cat-file -p '@{u}@{1}' >actual
		fi &&
		test_cmp expect actual
	
[master (root-commit) d38f542] one
 Author: A U Thor <author@example.com>
ok 21 - @{u} error message when not on a branch

expecting success: 
	cat >expect <<-EOF &&
	fatal: upstream branch ${sq}refs/heads/side${sq} not stored as a remote-tracking branch
	EOF
	error_message bad-upstream@{u} 2>actual &&
	test_i18ncmp expect actual

ok 12 - @{u}@{1} = upstream-one

expecting success: 
		echo 'refs/heads/master' >expect &&
		if test 'ref' = 'commit'
		then
			git log -1 --format=%s '@{-1}@{u}' >actual
		elif test 'ref' = 'ref'
		then
			git rev-parse --symbolic-full-name '@{-1}@{u}' >actual
		else
			git cat-file -p '@{-1}@{u}' >actual
		fi &&
		test_cmp expect actual
	
ok 22 - branch@{u} error message if upstream branch not fetched

expecting success: 
(
	cd clone &&
	git checkout local-master &&
	git pull
)

ok 13 - @{-1}@{u} = refs/heads/master

expecting success: 
		echo 'master-one' >expect &&
		if test 'commit' = 'commit'
		then
			git log -1 --format=%s '@{-1}@{u}@{1}' >actual
		elif test 'commit' = 'ref'
		then
			git rev-parse --symbolic-full-name '@{-1}@{u}@{1}' >actual
		else
			git cat-file -p '@{-1}@{u}@{1}' >actual
		fi &&
		test_cmp expect actual
	
[master ca32bda] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 subdir/file
Switched to branch 'local-master'
Your branch is behind 'master' by 4 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)
ok 14 - @{-1}@{u}@{1} = master-one

expecting success: 
		echo 'new-two' >expect &&
		if test 'commit' = 'commit'
		then
			git log -1 --format=%s '@' >actual
		elif test 'commit' = 'ref'
		then
			git rev-parse --symbolic-full-name '@' >actual
		else
			git cat-file -p '@' >actual
		fi &&
		test_cmp expect actual
	
ok 15 - @ = new-two

expecting success: 
		echo 'refs/heads/upstream-branch' >expect &&
		if test 'ref' = 'commit'
		then
			git log -1 --format=%s '@@{u}' >actual
		elif test 'ref' = 'ref'
		then
			git rev-parse --symbolic-full-name '@@{u}' >actual
		else
			git cat-file -p '@@{u}' >actual
		fi &&
		test_cmp expect actual
	
ok 16 - @@{u} = refs/heads/upstream-branch

expecting success: 
		echo 'refs/heads/@@/at-test' >expect &&
		if test 'ref' = 'commit'
		then
			git log -1 --format=%s '@@/at-test' >actual
		elif test 'ref' = 'ref'
		then
			git rev-parse --symbolic-full-name '@@/at-test' >actual
		else
			git cat-file -p '@@/at-test' >actual
		fi &&
		test_cmp expect actual
	
ok 17 - @@/at-test = refs/heads/@@/at-test

expecting success: 
		echo 'refs/heads/@/at-test' >expect &&
		if test 'ref' = 'commit'
		then
			git log -1 --format=%s '@/at-test' >actual
		elif test 'ref' = 'ref'
		then
			git rev-parse --symbolic-full-name '@/at-test' >actual
		else
			git cat-file -p '@/at-test' >actual
		fi &&
		test_cmp expect actual
	
ok 18 - @/at-test = refs/heads/@/at-test

error: 07753f428765ac1afe2020b24e40785869bd4a85: invalid sha1 pointer in cache-tree
expecting success: 
		echo 'refs/heads/@at-test' >expect &&
		if test 'ref' = 'commit'
		then
			git log -1 --format=%s '@at-test' >actual
		elif test 'ref' = 'ref'
		then
			git rev-parse --symbolic-full-name '@at-test' >actual
		else
			git cat-file -p '@at-test' >actual
		fi &&
		test_cmp expect actual
	
broken link from    tree 5f9d5fe4279246e5b2ddcd446efc2aed53a52304
              to    tree 07753f428765ac1afe2020b24e40785869bd4a85
missing tree 07753f428765ac1afe2020b24e40785869bd4a85
ok 45 - fsck notices missing subtree

expecting success: 
	create_repo_missing HEAD^{tree} &&
	test_must_fail git -C missing fsck

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 19 - @at-test = refs/heads/@at-test

expecting success: 
		test_must_fail git rev-parse --verify '@{u}@{-1}'
	
fatal: Needed a single revision
ok 20 - @{u}@{-1} is nonsensical

expecting success: 
		test_must_fail git rev-parse --verify '@{0}@{0}'
	
fatal: Needed a single revision
ok 21 - @{0}@{0} is nonsensical

expecting success: 
		test_must_fail git rev-parse --verify '@{1}@{u}'
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/missing/.git/
fatal: no such branch: '@{1}'
ok 22 - @{1}@{u} is nonsensical

expecting success: 
		test_must_fail git rev-parse --verify 'HEAD@{-1}'
	
[master (root-commit) d38f542] one
 Author: A U Thor <author@example.com>
fatal: Needed a single revision
ok 23 - HEAD@{-1} is nonsensical

expecting success: 
		test_must_fail git rev-parse --verify '@{-1}@{-1}'
	
fatal: Needed a single revision
ok 24 - @{-1}@{-1} is nonsensical

expecting success: 
		echo 'old-two' >expect &&
		if test 'commit' = 'commit'
		then
			git log -1 --format=%s 'HEAD@{3}' >actual
		elif test 'commit' = 'ref'
		then
			git rev-parse --symbolic-full-name 'HEAD@{3}' >actual
		else
			git cat-file -p 'HEAD@{3}' >actual
		fi &&
		test_cmp expect actual
	
ok 25 - HEAD@{3} = old-two

expecting success: 
		test_must_fail git rev-parse --verify '@{3}'
	
fatal: Log for 'new-branch' only has 3 entries.
From .
 * branch            master     -> FETCH_HEAD
ok 26 - @{3} is nonsensical

expecting success: 
	git checkout old-branch

Cloning into 'sub1'...
[master ca32bda] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 subdir/file
Switched to branch 'old-branch'
Your branch is ahead of 'master' by 4 commits.
  (use "git push" to publish your local commits)
ok 27 - switch to old-branch

expecting success: 
		echo 'refs/heads/old-branch' >expect &&
		if test 'ref' = 'commit'
		then
			git log -1 --format=%s 'HEAD' >actual
		elif test 'ref' = 'ref'
		then
			git rev-parse --symbolic-full-name 'HEAD' >actual
		else
			git cat-file -p 'HEAD' >actual
		fi &&
		test_cmp expect actual
	
done.
Updating 6efda21..ac35135
Fast-forward
ok 23 - pull works when tracking a local branch

expecting success: 
	test refs/heads/master = "$(full_name @{u})"

ok 28 - HEAD = refs/heads/old-branch

expecting success: 
		echo 'new-two' >expect &&
		if test 'commit' = 'commit'
		then
			git log -1 --format=%s 'HEAD@{1}' >actual
		elif test 'commit' = 'ref'
		then
			git rev-parse --symbolic-full-name 'HEAD@{1}' >actual
		else
			git cat-file -p 'HEAD@{1}' >actual
		fi &&
		test_cmp expect actual
	
ok 24 - @{u} works when tracking a local branch

expecting success: 
	git log -1 -g other@{u} >actual &&
	test_cmp expect actual

ok 29 - HEAD@{1} = new-two

expecting success: 
		echo 'old-one' >expect &&
		if test 'commit' = 'commit'
		then
			git log -1 --format=%s '@{1}' >actual
		elif test 'commit' = 'ref'
		then
			git rev-parse --symbolic-full-name '@{1}' >actual
		else
			git cat-file -p '@{1}' >actual
		fi &&
		test_cmp expect actual
	
error: 5f9d5fe4279246e5b2ddcd446efc2aed53a52304: invalid sha1 pointer in cache-tree
broken link from  commit ca32bdaaf4ee9eab00bafa6471c9a2fa98fc42c3
              to    tree 5f9d5fe4279246e5b2ddcd446efc2aed53a52304
missing tree 5f9d5fe4279246e5b2ddcd446efc2aed53a52304
ok 46 - fsck notices missing root tree

expecting success: 
	create_repo_missing HEAD^ &&
	test_must_fail git -C missing fsck

ok 30 - @{1} = old-one

expecting success: 
	echo content >normal &&
	echo content >fun@ny &&
	git add normal fun@ny &&
	git commit -m "funny path"

ok 25 - log -g other@{u}

expecting success: 
	git log -1 -g other@{u}@{now} >actual &&
	test_cmp expect actual

ok 26 - log -g other@{u}@{now}

expecting success: 
	echo content >@{yesterday} &&
	git add @{yesterday} &&
	git commit -m "funny reflog file" &&
	git hash-object @{yesterday} >expect &&
	git rev-parse HEAD:@{yesterday} >actual

[old-branch 9d022ac] funny path
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 fun@ny
 create mode 100644 normal
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/missing/.git/
ok 31 - create path with @

expecting success: 
		echo 'content' >expect &&
		if test 'blob' = 'commit'
		then
			git log -1 --format=%s '@:normal' >actual
		elif test 'blob' = 'ref'
		then
			git rev-parse --symbolic-full-name '@:normal' >actual
		else
			git cat-file -p '@:normal' >actual
		fi &&
		test_cmp expect actual
	
[master (root-commit) d38f542] one
 Author: A U Thor <author@example.com>
ok 32 - @:normal = content

expecting success: 
		echo 'content' >expect &&
		if test 'blob' = 'commit'
		then
			git log -1 --format=%s '@:fun@ny' >actual
		elif test 'blob' = 'ref'
		then
			git rev-parse --symbolic-full-name '@:fun@ny' >actual
		else
			git cat-file -p '@:fun@ny' >actual
		fi &&
		test_cmp expect actual
	
Submodule path 'sub1': checked out '913780cd9739c4974f32aaa316af9267f73412c2'
[detached HEAD eae0df2] funny reflog file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 @{yesterday}
ok 33 - @:fun@ny = content

ok 27 - @{reflog}-parsing does not look beyond colon

expecting success: 
	echo content >@{upstream} &&
	git add @{upstream} &&
	git commit -m "funny upstream file" &&
	git hash-object @{upstream} >expect &&
	git rev-parse HEAD:@{upstream} >actual

# passed all 33 test(s)
1..33
[master ca32bda] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 subdir/file
[detached HEAD c358789] funny upstream file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 @{upstream}
*** t1509-root-worktree.sh ***
ok 28 - @{upstream}-parsing does not look beyond colon

# passed all 28 test(s)
1..28
missing commit d38f542f2d868bcbbb09173528a3bb403f53a0f0
ok 47 - fsck notices missing parent

expecting success: 
	create_repo_missing tag^{blob} &&
	test_must_fail git -C missing fsck

ok 19 - git read-tree -u --reset: replace directory with submodule

expecting success: 
		prolog &&
		reset_work_tree_to add_sub1 &&
		(
			cd submodule_update &&
			git branch -t remove_sub1 origin/remove_sub1 &&
			$command remove_sub1 &&
			test_superproject_content origin/remove_sub1 &&
			test_submodule_content sub1 origin/add_sub1
		)
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/missing/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1509-root-worktree/.git/
*** t1510-repo-setup.sh ***
[master (root-commit) d38f542] one
 Author: A U Thor <author@example.com>
1..0 # SKIP Test requiring writable / skipped. Read this test if you want to run it
*** t1511-rev-parse-caret.sh ***
Cloning into 'submodule_update'...
[master ca32bda] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 subdir/file
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/.git/
done.
expecting success: 
	try_repo 0 unset unset unset "" unset \
		.git "$here/0" "$here/0" "(null)" \
		.git "$here/0" "$here/0" sub/ 2>message &&
	! test -s message

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/0/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1511-rev-parse-caret/.git/
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
expecting success: 
	echo blob >a-blob &&
	git tag -a -m blob blob-tag `git hash-object -w a-blob` &&
	mkdir a-tree &&
	echo moreblobs >a-tree/another-blob &&
	git add . &&
	TREE_SHA1=`git write-tree` &&
	git tag -a -m tree tree-tag "$TREE_SHA1" &&
	git commit -m Initial &&
	git tag -a -m commit commit-tag &&
	git branch ref &&
	git checkout master &&
	echo modified >>a-blob &&
	git add -u &&
	git commit -m Modified

broken link from     tag 7c115056e13b1f41142fe9e6f6cb98a1c077facd
              to    blob c21c9352f7526e9576892a6631e0e8cf1fccd34d
missing blob c21c9352f7526e9576892a6631e0e8cf1fccd34d
ok 48 - fsck notices missing tagged object

expecting success: 
	create_repo_missing HEAD &&
	test_must_fail git -C missing fsck

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/missing/.git/
ok 1 - #0: nonbare repo, no explicit configuration

expecting success: 
	mkdir -p wt &&
	try_repo 1 "$here" unset unset "" unset \
		"$here/1/.git" "$here" "$here" 1/ \
		"$here/1/.git" "$here" "$here" 1/sub/ 2>message &&
	! test -s message

[master (root-commit) d38f542] one
 Author: A U Thor <author@example.com>
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/1/.git/
[master (root-commit) 7eabd5f] Initial
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 a-blob
 create mode 100644 a-tree/another-blob
[master ca32bda] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 subdir/file
Already on 'master'
[master a354e6b] Modified
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 1 - setup

expecting success: 
	test_must_fail git rev-parse ref^{non-existent}

ok 2 - #1: GIT_WORK_TREE without explicit GIT_DIR is accepted

expecting success: 
	try_repo 2 unset "$here/2/.git" unset "" unset \
		"$here/2/.git" "$here/2" "$here/2" "(null)" \
		"$here/2/.git" "$here/2/sub" "$here/2/sub" "(null)"

error: HEAD: invalid sha1 pointer ca32bdaaf4ee9eab00bafa6471c9a2fa98fc42c3
fatal: ambiguous argument 'ref^{non-existent}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
ref^{non-existent}
ok 2 - ref^{non-existent}

expecting success: 
	git rev-parse ref >expected &&
	git rev-parse ref^{} >actual &&
	test_cmp expected actual &&
	git rev-parse commit-tag^{} >actual &&
	test_cmp expected actual

error: refs/heads/master: invalid sha1 pointer ca32bdaaf4ee9eab00bafa6471c9a2fa98fc42c3
error: refs/heads/master: invalid reflog entry ca32bdaaf4ee9eab00bafa6471c9a2fa98fc42c3
error: HEAD: invalid reflog entry ca32bdaaf4ee9eab00bafa6471c9a2fa98fc42c3
ok 49 - fsck notices ref pointing to missing commit

expecting success: 
	create_repo_missing tag &&
	test_must_fail git -C missing fsck

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/2/.git/
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 3 - ref^{}

expecting success: 
	git rev-parse ref >expected &&
	git rev-parse ref^{commit} >actual &&
	test_cmp expected actual &&
	git rev-parse commit-tag^{commit} >actual &&
	test_cmp expected actual &&
	test_must_fail git rev-parse tree-tag^{commit} &&
	test_must_fail git rev-parse blob-tag^{commit}

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/missing/.git/
[master (root-commit) d38f542] one
 Author: A U Thor <author@example.com>
error: tree-tag^{commit}: expected commit type, but the object dereferences to tree type
ok 3 - #2: worktree defaults to cwd with explicit GIT_DIR

error: tree-tag^{commit}: expected commit type, but the object dereferences to tree type
fatal: ambiguous argument 'tree-tag^{commit}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
expecting success: 
	try_repo 2b unset ".git" unset "" unset \
		".git" "$here/2b" "$here/2b" "(null)" \
		"../.git" "$here/2b/sub" "$here/2b/sub" "(null)"

tree-tag^{commit}
error: blob-tag^{commit}: expected commit type, but the object dereferences to blob type
error: blob-tag^{commit}: expected commit type, but the object dereferences to blob type
fatal: ambiguous argument 'blob-tag^{commit}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
blob-tag^{commit}
ok 4 - ref^{commit}

expecting success: 
	echo $TREE_SHA1 >expected &&
	git rev-parse ref^{tree} >actual &&
	test_cmp expected actual &&
	git rev-parse commit-tag^{tree} >actual &&
	test_cmp expected actual &&
	git rev-parse tree-tag^{tree} >actual &&
	test_cmp expected actual &&
	test_must_fail git rev-parse blob-tag^{tree}

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/2b/.git/
[master ca32bda] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 subdir/file
Cloning into 'sub1'...
error: blob-tag^{tree}: expected tree type, but the object dereferences to blob type
error: blob-tag^{tree}: expected tree type, but the object dereferences to blob type
fatal: ambiguous argument 'blob-tag^{tree}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
blob-tag^{tree}
ok 5 - ref^{tree}

expecting success: 
	test_must_fail git rev-parse HEAD^{tag} &&
	git rev-parse commit-tag >expected &&
	git rev-parse commit-tag^{tag} >actual &&
	test_cmp expected actual

done.
ok 4 - #2b: relative GIT_DIR

expecting success: 
	setup_repo 3 unset "" unset &&
	mkdir -p 3/sub/sub 3/wt/sub

error: HEAD^{tag}: expected tag type, but the object dereferences to tree type
error: HEAD^{tag}: expected tag type, but the object dereferences to tree type
fatal: ambiguous argument 'HEAD^{tag}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
HEAD^{tag}
error: refs/tags/tag: invalid sha1 pointer 7c115056e13b1f41142fe9e6f6cb98a1c077facd
dangling blob c21c9352f7526e9576892a6631e0e8cf1fccd34d
ok 50 - fsck notices ref pointing to missing tag

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/3/.git/
# passed all 50 test(s)
1..50
ok 6 - ref^{tag}

expecting success: 
	git rev-parse master >expected &&
	git rev-parse master^{/.} >actual &&
	test_cmp expected actual

ok 5 - #3: setup

expecting success: 
		try_case $N "$here/$N" .git \
			"$dotgit" "$here/$N" "$here/$N" "(null)" &&
		try_case $N . .git \
			"$dotgit" "$here/$N" "$here/$N" "(null)" &&
		try_case $N "$here/$N" "$here/$N/.git" \
			"$absgit" "$here/$N" "$here/$N" "(null)" &&
		try_case $N . "$here/$N/.git" \
			"$absgit" "$here/$N" "$here/$N" "(null)"
	
ok 7 - ref^{/.}

expecting success: 
	test_must_fail git rev-parse master^{/non-existent}

fatal: ambiguous argument 'master^{/non-existent}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
master^{/non-existent}
ok 8 - ref^{/non-existent}

expecting success: 
	git rev-parse ref >expected &&
	git rev-parse master^{/Initial} >actual &&
	test_cmp expected actual

ok 9 - ref^{/Initial}

# passed all 9 test(s)
1..9
Submodule path 'sub1': checked out '913780cd9739c4974f32aaa316af9267f73412c2'
ok 6 - #3: explicit GIT_WORK_TREE and GIT_DIR at toplevel

expecting success: 
		try_case $N/sub/sub "$here/$N" ../../.git \
			"$absgit" "$here/$N" "$here/$N" sub/sub/ &&
		try_case $N/sub/sub ../.. ../../.git \
			"$absgit" "$here/$N" "$here/$N" sub/sub/ &&
		try_case $N/sub/sub "$here/$N" "$here/$N/.git" \
			"$absgit" "$here/$N" "$here/$N" sub/sub/ &&
		try_case $N/sub/sub ../.. "$here/$N/.git" \
			"$absgit" "$here/$N" "$here/$N" sub/sub/
	
*** t1512-rev-parse-disambiguation.sh ***
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
warning: unable to rmdir sub1: Directory not empty
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1512-rev-parse-disambiguation/.git/
expecting success: 
	test_tick &&
	(
		for i in 0 1 2 3 4 5 6 7 8 9
		do
			echo $i
		done
		echo
		echo b1rwzyc3
	) >a0blgqsjc &&

	# create one blob 0000000000b36
	git add a0blgqsjc &&

	# create one tree 0000000000cdc
	git write-tree

ok 7 - #3: explicit GIT_WORK_TREE and GIT_DIR in subdir

expecting success: 
		try_case $N "$here/$N/wt" .git \
			"$dotgit" "$here/$N/wt" "$here/$N" "(null)" &&
		try_case $N wt .git \
			"$dotgit" "$here/$N/wt" "$here/$N" "(null)" &&
		try_case $N wt "$here/$N/.git" \
			"$absgit" "$here/$N/wt" "$here/$N" "(null)" &&
		try_case $N "$here/$N/wt" "$here/$N/.git" \
			"$absgit" "$here/$N/wt" "$here/$N" "(null)"
	
0000000000cdcf04beb2fab69e65622616294984
ok 1 - blob and tree

expecting success: 
	test_must_fail git rev-parse --verify 000000000^{commit} 2>actual &&
	grep "short SHA1 000000000 is ambiguous" actual

error: short SHA1 000000000 is ambiguous.
ok 2 - warn ambiguity when no candidate matches type hint

expecting success: 
	# feed tree-ish in an unambiguous way
	git rev-parse --verify 0000000000cdc:a0blgqsjc &&

	# ambiguous at the object name level, but there is only one
	# such tree-ish (the other is a blob)
	git rev-parse --verify 000000000:a0blgqsjc

ok 20 - git read-tree -u --reset: removed submodule leaves submodule directory and its contents in place

expecting success: 
		prolog &&
		reset_work_tree_to add_sub1 &&
		(
			cd submodule_update &&
			git branch -t remove_sub1 origin/remove_sub1 &&
			replace_gitfile_with_git_dir sub1 &&
			$command remove_sub1 &&
			test_superproject_content origin/remove_sub1 &&
			test_git_directory_is_unchanged sub1 &&
			test_submodule_content sub1 origin/add_sub1
		)
	
0000000000b36b6aa7ea4b75318ed078f55505c3
0000000000b36b6aa7ea4b75318ed078f55505c3
ok 3 - disambiguate tree-ish

expecting success: 
	sed -e "s/|$//" >patch <<-EOF &&
	diff --git a/frotz b/frotz
	index 000000000..ffffff 100644
	--- a/frotz
	+++ b/frotz
	@@ -10,3 +10,4 @@
	 9
	 |
	 b1rwzyc3
	+irwry
	EOF
	(
		GIT_INDEX_FILE=frotz &&
		export GIT_INDEX_FILE &&
		git apply --build-fake-ancestor frotz patch &&
		git cat-file blob :frotz >actual
	) &&
	test_cmp a0blgqsjc actual

*** t1513-rev-parse-prefix.sh ***
ok 4 - disambiguate blob

expecting success: 
	commit=$(echo "d7xm" | git commit-tree 000000000) &&
	# this commit is fffff2e and not ambiguous with the 00000* objects
	test $(git rev-parse $commit^{tree}) = $(git rev-parse 0000000000cdc)

ok 5 - disambiguate tree

expecting success: 
	# create one commit 0000000000e4f
	git commit -m a2onsxbvj

Cloning into 'submodule_update'...
ok 8 - #3: explicit GIT_WORK_TREE from parent of worktree

expecting success: 
		try_case $N/sub/sub "$here/$N/wt" ../../.git \
			"$dotdotgit" "$here/$N/wt" "$here/$N/sub/sub" "(null)" &&
		try_case $N/sub/sub ../../wt ../../.git \
			"$dotdotgit" "$here/$N/wt" "$here/$N/sub/sub" "(null)" &&
		try_case $N/sub/sub ../../wt "$here/$N/.git" \
			"$absgit" "$here/$N/wt" "$here/$N/sub/sub" "(null)" &&
		try_case $N/sub/sub "$here/$N/wt" "$here/$N/.git" \
			"$absgit" "$here/$N/wt" "$here/$N/sub/sub" "(null)"
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1513-rev-parse-prefix/.git/
[master (root-commit) 0000000000e] a2onsxbvj
 Author: A U Thor <author@example.com>
 1 file changed, 12 insertions(+)
 create mode 100644 a0blgqsjc
ok 6 - first commit

expecting success: 
	# feed commit-ish in an unambiguous way
	git rev-parse --verify 0000000000e4f^{commit} &&

	# ambiguous at the object name level, but there is only one
	# such commit (the others are tree and blob)
	git rev-parse --verify 000000000^{commit} &&

	# likewise
	git rev-parse --verify 000000000^0

expecting success: 
	mkdir -p sub1/sub2 &&
	echo top >top &&
	echo file1 >sub1/file1 &&
	echo file2 >sub1/sub2/file2 &&
	git add top sub1/file1 sub1/sub2/file2 &&
	git commit -m commit

0000000000e4f9fbd19cf1e932319e5ad0d1d00b
0000000000e4f9fbd19cf1e932319e5ad0d1d00b
done.
0000000000e4f9fbd19cf1e932319e5ad0d1d00b
ok 7 - disambiguate commit-ish

expecting success: 
	commit=$(echo "hoaxj" | git commit-tree 0000000000cdc -p 000000000) &&
	# this commit is ffffffd8 and not ambiguous with the 00000* objects
	test $(git rev-parse $commit^) = $(git rev-parse 0000000000e4f)

[master (root-commit) d7dba3c] commit
 Author: A U Thor <author@example.com>
 3 files changed, 3 insertions(+)
 create mode 100644 sub1/file1
 create mode 100644 sub1/sub2/file2
 create mode 100644 top
ok 1 - setup

expecting success: 
	git rev-parse --prefix "" -- top sub1/file1 >actual &&
	cat <<-\EOF >expected &&
	--
	top
	sub1/file1
	EOF
	test_cmp expected actual

ok 2 - empty prefix -- file

expecting success: 
	git rev-parse --prefix sub1/ -- file1 sub2/file2 >actual &&
	cat <<-\EOF >expected &&
	--
	sub1/file1
	sub1/sub2/file2
	EOF
	test_cmp expected actual

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 8 - disambiguate commit

expecting success: 
	# These are underspecified from the prefix-length point of view
	# to disambiguate the commit with other objects, but there is only
	# one commit that has 00000* prefix at this point.
	git log 000000000..000000000 &&
	git log ..000000000 &&
	git log 000000000.. &&
	git log 000000000...000000000 &&
	git log ...000000000 &&
	git log 000000000...

ok 3 - valid prefix -- file

expecting success: 
	git rev-parse --prefix sub1/ -- ../top sub2/file2 >actual &&
	cat <<-\EOF >expected &&
	--
	sub1/../top
	sub1/sub2/file2
	EOF
	test_cmp expected actual

ok 4 - valid prefix -- ../file

expecting success: 
	git rev-parse --prefix "" HEAD:./top >actual &&
	git rev-parse HEAD:top >expected &&
	test_cmp expected actual

ok 9 - #3: explicit GIT_WORK_TREE from nephew of worktree

expecting success: 
		try_case $N "$here" .git \
			"$absgit" "$here" "$here" $N/ &&
		try_case $N .. .git \
			"$absgit" "$here" "$here" $N/ &&
		try_case $N .. "$here/$N/.git" \
			"$absgit" "$here" "$here" $N/ &&
		try_case $N "$here" "$here/$N/.git" \
			"$absgit" "$here" "$here" $N/
	
ok 5 - empty prefix HEAD:./path

expecting success: 
	git rev-parse --prefix sub1/ HEAD:./file1 >actual &&
	git rev-parse HEAD:sub1/file1 >expected &&
	test_cmp expected actual

ok 9 - log name1..name2 takes only commit-ishes on both ends

expecting success: 
	# Likewise.
	git rev-parse 000000000..000000000 &&
	git rev-parse ..000000000 &&
	git rev-parse 000000000..

ok 6 - valid prefix HEAD:./path

expecting success: 
	git rev-parse --prefix sub1/ HEAD:../top >actual &&
	git rev-parse HEAD:top >expected &&
	test_cmp expected actual

0000000000e4f9fbd19cf1e932319e5ad0d1d00b
^0000000000e4f9fbd19cf1e932319e5ad0d1d00b
ok 7 - valid prefix HEAD:../path

expecting success: 
	git rev-parse --prefix sub1/ HEAD:top >actual &&
	git rev-parse HEAD:top >expected &&
	test_cmp expected actual

0000000000e4f9fbd19cf1e932319e5ad0d1d00b
^0000000000e4f9fbd19cf1e932319e5ad0d1d00b
0000000000e4f9fbd19cf1e932319e5ad0d1d00b
^0000000000e4f9fbd19cf1e932319e5ad0d1d00b
ok 10 - rev-parse name1..name2 takes only commit-ishes on both ends

expecting success: 
	# Likewise.
	git log 000000000

commit 0000000000e4f9fbd19cf1e932319e5ad0d1d00b
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:13:13 2005 -0700

    a2onsxbvj
ok 11 - git log takes only commit-ish

expecting success: 
	# Likewise.
	git reset 000000000

ok 8 - prefix ignored with HEAD:top

expecting success: 
	git rev-parse --prefix sub1/ file1 >actual &&
	cat <<-\EOF >expected &&
	sub1/file1
	EOF
	test_cmp expected actual

ok 12 - git reset takes only commit-ish

expecting success: 
	# create one tag 0000000000f8f
	git tag -a -m j7cp83um v1.0.0

ok 9 - disambiguate path with valid prefix

expecting success: 
	git rev-parse --prefix sub1/ master file1 >actual &&
	cat <<-EOF >expected &&
	$(git rev-parse master)
	sub1/file1
	EOF
	test_cmp expected actual

ok 13 - first tag

checking known breakage: 
	# At this point, we have a tag 0000000000f8f that points
	# at a commit 0000000000e4f, and a tree and a blob that
	# share 0000000000 prefix with these tag and commit.
	#
	# Once the parser becomes ultra-smart, it could notice that
	# 0000000000 before ^{commit} name many different objects, but
	# that only two (HEAD and v1.0.0 tag) can be peeled to commit,
	# and that peeling them down to commit yield the same commit
	# without ambiguity.
	git rev-parse --verify 0000000000^{commit} &&

	# likewise
	git log 0000000000..0000000000 &&
	git log ..0000000000 &&
	git log 0000000000.. &&
	git log 0000000000...0000000000 &&
	git log ...0000000000 &&
	git log 0000000000...

ok 10 - #3: chdir_to_toplevel uses worktree, not git dir

expecting success: 
		try_case $N/sub/sub "$here" ../../.git \
			"$absgit" "$here" "$here" $N/sub/sub/ &&
		try_case $N/sub/sub ../../.. ../../.git \
			"$absgit" "$here" "$here" $N/sub/sub/ &&
		try_case $N/sub/sub ../../../ "$here/$N/.git" \
			"$absgit" "$here" "$here" $N/sub/sub/ &&
		try_case $N/sub/sub "$here" "$here/$N/.git" \
			"$absgit" "$here" "$here" $N/sub/sub/
	
error: short SHA1 0000000000 is ambiguous.
fatal: Needed a single revision
not ok 14 - two semi-ambiguous commit-ish # TODO known breakage

checking known breakage: 
	# Likewise for tree-ish.  HEAD, v1.0.0 and HEAD^{tree} share
	# the prefix but peeling them to tree yields the same thing
	git rev-parse --verify 0000000000^{tree}

ok 10 - file and refs with prefix

expecting success: 
	git rev-parse --prefix sub1/sub2/ -- file2 >actual &&
	cat <<-\EOF >expected &&
	--
	sub1/sub2/file2
	EOF
	test_cmp expected actual

error: short SHA1 0000000000 is ambiguous.
fatal: Needed a single revision
not ok 15 - three semi-ambiguous tree-ish # TODO known breakage

expecting success: 
	# feed an unambiguous describe name
	git rev-parse --verify v1.0.0-0-g0000000000e4f &&

	# ambiguous at the object name level, but there is only one
	# such commit (others are blob, tree and tag)
	git rev-parse --verify v1.0.0-0-g000000000

ok 11 - two-levels deep

0000000000e4f9fbd19cf1e932319e5ad0d1d00b
# passed all 11 test(s)
1..11
0000000000e4f9fbd19cf1e932319e5ad0d1d00b
ok 16 - parse describe name

expecting success: 
	# commit 0000000000043
	git mv a0blgqsjc d12cr3h8t &&
	echo h62xsjeu >>d12cr3h8t &&
	git add d12cr3h8t &&

	test_tick &&
	git commit -m czy8f73t &&

	# commit 00000000008ec
	git mv d12cr3h8t j000jmpzn &&
	echo j08bekfvt >>j000jmpzn &&
	git add j000jmpzn &&

	test_tick &&
	git commit -m ioiley5o &&

	# commit 0000000005b0
	git checkout v1.0.0^0 &&
	git mv a0blgqsjc f5518nwu &&

	for i in h62xsjeu j08bekfvt kg7xflhm
	do
		echo $i
	done >>f5518nwu &&
	git add f5518nwu &&

	test_tick &&
	git commit -m b3wettvi &&
	side=$(git rev-parse HEAD) &&

	# commit 000000000066
	git checkout master &&

	# If you use recursive, merge will fail and you will need to
	# clean up a0blgqsjc as well.  If you use resolve, merge will
	# succeed.
	test_might_fail git merge --no-commit -s recursive $side &&
	git rm -f f5518nwu j000jmpzn &&

	test_might_fail git rm -f a0blgqsjc &&
	(
		git cat-file blob $side:f5518nwu
		echo j3l0i9s6
	) >ab2gs879 &&
	git add ab2gs879 &&

	test_tick &&
	git commit -m ad2uee


Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
*** t1514-rev-parse-push.sh ***
[master 00000000000] czy8f73t
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 rename a0blgqsjc => d12cr3h8t (76%)
ok 11 - #3: chdir_to_toplevel uses worktree (from subdir)

expecting success: 
	setup_repo 4 ../sub "" unset &&
	mkdir -p 4/sub sub &&
	try_case 4 unset unset \
		.git "$here/4/sub" "$here/4" "(null)" \
		"$here/4/.git" "$here/4/sub" "$here/4/sub" "(null)" 2>message &&
	! test -s message

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1514-rev-parse-push/.git/
[master 00000000008] ioiley5o
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 rename d12cr3h8t => j000jmpzn (79%)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/4/.git/
expecting success: 
	git init --bare parent.git &&
	git init --bare other.git &&
	git remote add origin parent.git &&
	git remote add other other.git &&
	test_commit base &&
	git push origin HEAD &&
	git branch --set-upstream-to=origin/master master &&
	git branch --track topic origin/master &&
	git push origin topic &&
	git push other topic

Note: checking out 'v1.0.0^0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 0000000000e... a2onsxbvj
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1514-rev-parse-push/parent.git/
Cloning into 'sub1'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1514-rev-parse-push/other.git/
done.
ok 12 - #4: core.worktree without GIT_DIR set is accepted

expecting success: 
	# or: you cannot intimidate away the lack of GIT_DIR setting
	try_repo 5 "$here" unset "$here/5" "" unset \
		"$here/5/.git" "$here" "$here" 5/ \
		"$here/5/.git" "$here" "$here" 5/sub/ 2>message &&
	try_repo 5a .. unset "$here/5a" "" unset \
		"$here/5a/.git" "$here" "$here" 5a/ \
		"$here/5a/.git" "$here/5a" "$here/5a" sub/ &&
	! test -s message

[detached HEAD 0000000005] b3wettvi
 Author: A U Thor <author@example.com>
 1 file changed, 3 insertions(+)
 rename a0blgqsjc => f5518nwu (51%)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/5/.git/
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  0000000005 b3wettvi

If you want to keep it by creating a new branch, this may be a good time
to do so with:

 git branch <new-branch-name> 0000000005

Switched to branch 'master'
[master (root-commit) d1ff1c9] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 base.t
Merging:
00000000008 ioiley5o
virtual 0000000005b0d85f595e1a98533157ea161798da
found 1 common ancestor:
0000000000e a2onsxbvj
CONFLICT (rename/rename): Rename "a0blgqsjc"->"j000jmpzn" in branch "HEAD" rename "a0blgqsjc"->"f5518nwu" in "0000000005b0d85f595e1a98533157ea161798da"
Automatic merge failed; fix conflicts and then commit the result.
f5518nwu: needs merge
j000jmpzn: needs merge
rm 'f5518nwu'
rm 'j000jmpzn'
a0blgqsjc: needs merge
rm 'a0blgqsjc'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/5a/.git/
[master 00000000006] ad2uee
 Author: A U Thor <author@example.com>
ok 17 - more history

checking known breakage: 
	# ambiguous at the object name level, but there is only one
	# such commit at generation 0
	git rev-parse --verify v1.0.0-0-g000000000 &&

	# likewise for generation 2 and 4
	git rev-parse --verify v1.0.0-2-g000000000 &&
	git rev-parse --verify v1.0.0-4-g000000000

To parent.git
 * [new branch]      HEAD -> master
fatal: Needed a single revision
not ok 18 - parse describe name taking advantage of generation # TODO known breakage

expecting success: 
	# ambiguous at the object name level, and there are two such
	# commits at generation 1
	test_must_fail git rev-parse --verify v1.0.0-1-g000000000

Submodule path 'sub1': checked out '913780cd9739c4974f32aaa316af9267f73412c2'
fatal: Needed a single revision
ok 19 - parse describe name not ignoring ambiguity

expecting success: 
	# Now there are many commits that begin with the
	# common prefix, none of these should pick one at
	# random.  They all should result in ambiguity errors.
	test_must_fail git rev-parse --verify 00000000^{commit} &&

	# likewise
	test_must_fail git log 000000000..000000000 &&
	test_must_fail git log ..000000000 &&
	test_must_fail git log 000000000.. &&
	test_must_fail git log 000000000...000000000 &&
	test_must_fail git log ...000000000 &&
	test_must_fail git log 000000000...

error: short SHA1 00000000 is ambiguous.
fatal: Needed a single revision
error: short SHA1 000000000 is ambiguous.
fatal: ambiguous argument '000000000..000000000': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
error: short SHA1 000000000 is ambiguous.
fatal: ambiguous argument '..000000000': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Branch master set up to track remote branch master from origin.
error: short SHA1 000000000 is ambiguous.
fatal: ambiguous argument '000000000..': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
error: short SHA1 000000000 is ambiguous.
fatal: ambiguous argument '000000000...000000000': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Branch topic set up to track remote branch master from origin.
error: short SHA1 000000000 is ambiguous.
fatal: ambiguous argument '...000000000': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
ok 13 - #5: core.worktree + GIT_WORK_TREE is accepted

expecting success: 
	setup_repo 6 "$here/6" "" unset &&
	try_case 6 unset .git \
		.git "$here/6" "$here/6" "(null)" &&
	try_case 6 unset "$here/6/.git" \
		"$here/6/.git" "$here/6" "$here/6" "(null)" &&
	try_case 6/sub/sub unset ../../.git \
		"$here/6/.git" "$here/6" "$here/6" sub/sub/ &&
	try_case 6/sub/sub unset "$here/6/.git" \
		"$here/6/.git" "$here/6" "$here/6" sub/sub/

error: short SHA1 000000000 is ambiguous.
fatal: ambiguous argument '000000000...': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
ok 20 - ambiguous commit-ish

expecting success: 
	# The test creates 16 objects that share the prefix and two
	# commits created by commit-tree in earlier tests share a
	# different prefix.
	git rev-parse --disambiguate=000000000 >actual &&
	test $(wc -l <actual) = 16 &&
	test "$(sed -e "s/^\(.........\).*/\1/" actual | sort -u)" = 000000000

Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/6/.git/
ok 21 - rev-parse --disambiguate

expecting success: 
	TREE=$(git mktree </dev/null) &&
	REF=`git rev-parse HEAD` &&
	VAL=$(git commit-tree $TREE </dev/null) &&
	git update-ref refs/heads/$REF $VAL &&
	test `git rev-parse $REF 2>err` = $REF &&
	grep "refname.*${REF}.*ambiguous" err

To parent.git
 * [new branch]      topic -> topic
warning: unable to rmdir sub1: Directory not empty
warning: refname '0000000000663a70a94c2b280b575855256220fa' is ambiguous.
ok 22 - ambiguous 40-hex ref

expecting success: 
	TREE=$(git mktree </dev/null) &&
	REF=`git rev-parse --short HEAD` &&
	VAL=$(git commit-tree $TREE </dev/null) &&
	git update-ref refs/heads/$REF $VAL &&
	test `git rev-parse $REF 2>err` = $VAL &&
	grep "refname.*${REF}.*ambiguous" err

To other.git
 * [new branch]      topic -> topic
ok 1 - setup

expecting success: 
	test_config push.default nothing &&
	test_must_fail git rev-parse master@{push}

fatal: push has no destination (push.default is 'nothing')
warning: refname '00000000006' is ambiguous.
ok 23 - ambiguous short sha1 ref

ok 14 - #6: setting GIT_DIR brings core.worktree to life

expecting success: 
	setup_repo 6b .. "" unset &&
	try_case 6b unset .git \
		.git "$here/6b" "$here/6b" "(null)" &&
	try_case 6b unset "$here/6b/.git" \
		"$here/6b/.git" "$here/6b" "$here/6b" "(null)" &&
	try_case 6b/sub/sub unset ../../.git \
		"$here/6b/.git" "$here/6b" "$here/6b" sub/sub/ &&
	try_case 6b/sub/sub unset "$here/6b/.git" \
		"$here/6b/.git" "$here/6b" "$here/6b" sub/sub/

ok 2 - @{push} with default=nothing

expecting success: 
	test_config push.default simple &&
	resolve master@{push} refs/remotes/origin/master

# still have 3 known breakage(s)
# passed all remaining 20 test(s)
1..23
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/6b/.git/
*** t1600-index.sh ***
ok 3 - @{push} with default=simple

expecting success: 
	test_config push.default simple &&
	test_must_fail git rev-parse topic@{push}

fatal: cannot resolve 'simple' push to a single destination
ok 21 - git read-tree -u --reset: removed submodule leaves submodule containing a .git directory alone

checking known breakage: 
		prolog &&
		reset_work_tree_to add_sub1 &&
		(
			cd submodule_update &&
			git branch -t replace_sub1_with_directory origin/replace_sub1_with_directory &&
			test_must_fail $command replace_sub1_with_directory &&
			test_superproject_content origin/add_sub1 &&
			test_submodule_content sub1 origin/add_sub1
		)
	
ok 4 - triangular @{push} fails with default=simple

expecting success: 
	test_config push.default current &&
	resolve topic@{push} refs/remotes/origin/topic

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1600-index/.git/
expecting success: 
	echo 1 >a

ok 1 - setup

expecting success: 
	(
		rm -f .git/index &&
		GIT_INDEX_VERSION=2bogus &&
		export GIT_INDEX_VERSION &&
		git add a 2>&1 | sed "s/[0-9]//" >actual.err &&
		sed -e "s/ Z$/ /" <<-\EOF >expect.err &&
			warning: GIT_INDEX_VERSION set, but the value is invalid.
			Using version Z
		EOF
		test_i18ncmp expect.err actual.err
	)

ok 5 - @{push} with default=current

expecting success: 
	test_config push.default matching &&
	resolve topic@{push} refs/remotes/origin/topic

ok 2 - bogus GIT_INDEX_VERSION issues warning

expecting success: 
	(
		rm -f .git/index &&
		GIT_INDEX_VERSION=1 &&
		export GIT_INDEX_VERSION &&
		git add a 2>&1 | sed "s/[0-9]//" >actual.err &&
		sed -e "s/ Z$/ /" <<-\EOF >expect.err &&
			warning: GIT_INDEX_VERSION set, but the value is invalid.
			Using version Z
		EOF
		test_i18ncmp expect.err actual.err
	)

ok 15 - #6b: GIT_DIR set, core.worktree relative

expecting success: 
	setup_repo 6c "$here/6c/wt" "" unset &&
	mkdir -p 6c/wt/sub &&

	try_case 6c unset .git \
		.git "$here/6c/wt" "$here/6c" "(null)" &&
	try_case 6c unset "$here/6c/.git" \
		"$here/6c/.git" "$here/6c/wt" "$here/6c" "(null)" &&
	try_case 6c/sub/sub unset ../../.git \
		../../.git "$here/6c/wt" "$here/6c/sub/sub" "(null)" &&
	try_case 6c/sub/sub unset "$here/6c/.git" \
		"$here/6c/.git" "$here/6c/wt" "$here/6c/sub/sub" "(null)"

ok 6 - @{push} with default=matching

expecting success: 
	test_config push.default current &&
	test_config branch.topic.pushremote other &&
	resolve topic@{push} refs/remotes/other/topic

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/6c/.git/
ok 3 - out of bounds GIT_INDEX_VERSION issues warning

expecting success: 
	(
		GIT_INDEX_VERSION=1 &&
		export GIT_INDEX_VERSION &&
		git add a 2>actual.err &&
		>expect.err &&
		test_i18ncmp expect.err actual.err
	)

ok 4 - no warning with bogus GIT_INDEX_VERSION and existing index

expecting success: 
	(
		sane_unset GIT_INDEX_VERSION &&
		rm -f .git/index &&
		git config --add index.version 1 &&
		git add a 2>&1 | sed "s/[0-9]//" >actual.err &&
		sed -e "s/ Z$/ /" <<-\EOF >expect.err &&
			warning: index.version set, but the value is invalid.
			Using version Z
		EOF
		test_i18ncmp expect.err actual.err
	)

Cloning into 'submodule_update'...
ok 7 - @{push} with pushremote defined

expecting success: 
	test_config push.default nothing &&
	test_config remote.origin.push refs/heads/*:refs/heads/magic/* &&
	git push &&
	resolve topic@{push} refs/remotes/origin/magic/topic

done.
ok 5 - out of bounds index.version issues warning

expecting success: 
	(
		rm -f .git/index &&
		GIT_INDEX_VERSION=4 &&
		export GIT_INDEX_VERSION &&
		git config --add index.version 2 &&
		git add a 2>&1 &&
		echo 4 >expect &&
		test-index-version <.git/index >actual &&
		test_cmp expect actual
	)

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 6 - GIT_INDEX_VERSION takes precedence over config

# passed all 6 test(s)
1..6
To parent.git
 * [new branch]      master -> magic/master
 * [new branch]      topic -> magic/topic
ok 16 - #6c: GIT_DIR set, core.worktree=../wt (absolute)

expecting success: 
	setup_repo 6d "$here/6d/wt" "" unset &&
	mkdir -p 6d/wt/sub &&

	try_case 6d unset .git \
		.git "$here/6d/wt" "$here/6d" "(null)" &&
	try_case 6d unset "$here/6d/.git" \
		"$here/6d/.git" "$here/6d/wt" "$here/6d" "(null)" &&
	try_case 6d/sub/sub unset ../../.git \
		../../.git "$here/6d/wt" "$here/6d/sub/sub" "(null)" &&
	try_case 6d/sub/sub unset "$here/6d/.git" \
		"$here/6d/.git" "$here/6d/wt" "$here/6d/sub/sub" "(null)"

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/6d/.git/
*** t1700-split-index.sh ***
ok 8 - @{push} with push refspecs

# passed all 8 test(s)
1..8
*** t2000-checkout-cache-clash.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1700-split-index/.git/
expecting success: 
	git update-index --split-index &&
	test-dump-split-index .git/index >actual &&
	indexversion=$(test-index-version <.git/index) &&
	if test "$indexversion" = "4"
	then
		own=432ef4b63f32193984f339431fd50ca796493569
		base=508851a7f0dfa8691e9f69c7f055865389012491
	else
		own=8299b0bcd1ac364e5f1d7768efb62fa2da79a339
		base=39d890139ee5356c7ef572216cebcd27aa41f9df
	fi &&
	cat >expect <<EOF &&
own $own
base $base
replacements:
deletions:
EOF
	test_cmp expect actual

ok 1 - enable split index

expecting success: 
	: >one &&
	git update-index --add one &&
	git ls-files --stage >ls-files.actual &&
	cat >ls-files.expect <<EOF &&
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0	one
EOF
	test_cmp ls-files.expect ls-files.actual &&

	test-dump-split-index .git/index | sed "/^own/d" >actual &&
	cat >expect <<EOF &&
base $base
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0	one
replacements:
deletions:
EOF
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2000-checkout-cache-clash/.git/
ok 17 - #6d: GIT_DIR set, core.worktree=../wt (relative)

expecting success: 
	setup_repo 6e "$here" "" unset &&
	try_case 6e unset .git \
		"$here/6e/.git" "$here" "$here" 6e/ &&
	try_case 6e unset "$here/6e/.git" \
		"$here/6e/.git" "$here" "$here" 6e/ &&
	try_case 6e/sub/sub unset ../../.git \
		"$here/6e/.git" "$here" "$here" 6e/sub/sub/ &&
	try_case 6e/sub/sub unset "$here/6e/.git" \
		"$here/6e/.git" "$here" "$here" 6e/sub/sub/

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
expecting success: git update-index --add path0 path1/file1
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/6e/.git/
ok 2 - add one file

expecting success: 
	git update-index --no-split-index &&
	git ls-files --stage >ls-files.actual &&
	cat >ls-files.expect <<EOF &&
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0	one
EOF
	test_cmp ls-files.expect ls-files.actual &&

	BASE=`test-dump-split-index .git/index | grep "^own" | sed "s/own/base/"` &&
	test-dump-split-index .git/index | sed "/^own/d" >actual &&
	cat >expect <<EOF &&
not a split index
EOF
	test_cmp expect actual

ok 1 - git update-index --add various paths.

expecting success: test_must_fail git checkout-index -a
path0 already exists, no checkout
fatal: cannot create directory at 'path1': File exists
ok 2 - git checkout-index without -f should fail on conflicting work tree.

expecting success: git checkout-index -f -a
ok 3 - git checkout-index with -f should succeed.

expecting success: test -f path0 && test -d path1 && test -f path1/file1
ok 4 - git checkout-index conflicting paths.

checking prerequisite: SYMLINKS

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	# test whether the filesystem supports symbolic links
	ln -s x y && test -h y

)
ok 3 - disable split index

expecting success: 
	git update-index --split-index &&
	git ls-files --stage >ls-files.actual &&
	cat >ls-files.expect <<EOF &&
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0	one
EOF
	test_cmp ls-files.expect ls-files.actual &&

	test-dump-split-index .git/index | sed "/^own/d" >actual &&
	cat >expect <<EOF &&
$BASE
replacements:
deletions:
EOF
	test_cmp expect actual

prerequisite SYMLINKS ok
expecting success: 
	mkdir -p tar/get &&
	ln -s tar/get there &&
	echo first &&
	git checkout-index -a -f --prefix=there/ &&
	echo second &&
	git checkout-index -a -f --prefix=there/

Cloning into 'sub1'...
first
second
done.
ok 5 - checkout-index -f twice with --prefix

# passed all 5 test(s)
1..5
ok 4 - enable split index again, "one" now belongs to base index"

expecting success: 
	echo modified >one &&
	git update-index one &&
	git ls-files --stage >ls-files.actual &&
	cat >ls-files.expect <<EOF &&
100644 2e0996000b7e9019eabcad29391bf0f5c7702f0b 0	one
EOF
	test_cmp ls-files.expect ls-files.actual &&

	test-dump-split-index .git/index | sed "/^own/d" >actual &&
	q_to_tab >expect <<EOF &&
$BASE
100644 2e0996000b7e9019eabcad29391bf0f5c7702f0b 0Q
replacements: 0
deletions:
EOF
	test_cmp expect actual

*** t2001-checkout-cache-clash.sh ***
ok 18 - #6e: GIT_DIR set, core.worktree=../.. (absolute)

expecting success: 
	setup_repo 6f ../../ "" unset &&
	try_case 6f unset .git \
		"$here/6f/.git" "$here" "$here" 6f/ &&
	try_case 6f unset "$here/6f/.git" \
		"$here/6f/.git" "$here" "$here" 6f/ &&
	try_case 6f/sub/sub unset ../../.git \
		"$here/6f/.git" "$here" "$here" 6f/sub/sub/ &&
	try_case 6f/sub/sub unset "$here/6f/.git" \
		"$here/6f/.git" "$here" "$here" 6f/sub/sub/

ok 5 - modify original file, base index untouched

expecting success: 
	: >two &&
	git update-index --add two &&
	git ls-files --stage >ls-files.actual &&
	cat >ls-files.expect <<EOF &&
100644 2e0996000b7e9019eabcad29391bf0f5c7702f0b 0	one
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0	two
EOF
	test_cmp ls-files.expect ls-files.actual &&

	test-dump-split-index .git/index | sed "/^own/d" >actual &&
	q_to_tab >expect <<EOF &&
$BASE
100644 2e0996000b7e9019eabcad29391bf0f5c7702f0b 0Q
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0	two
replacements: 0
deletions:
EOF
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/6f/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2001-checkout-cache-clash/.git/
expecting success: git update-index --add path0/file0
Submodule path 'sub1': checked out '913780cd9739c4974f32aaa316af9267f73412c2'
ok 6 - add another file, which stays index

expecting success: 
	git update-index --force-remove two &&
	git ls-files --stage >ls-files.actual &&
	cat >ls-files.expect <<EOF &&
100644 2e0996000b7e9019eabcad29391bf0f5c7702f0b 0	one
EOF
	test_cmp ls-files.expect ls-files.actual &&

	test-dump-split-index .git/index | sed "/^own/d" >actual &&
	q_to_tab >expect <<EOF &&
$BASE
100644 2e0996000b7e9019eabcad29391bf0f5c7702f0b 0Q
replacements: 0
deletions:
EOF
	test_cmp expect actual

ok 1 - git update-index --add path0/file0

expecting success: tree1=$(git write-tree)
ok 2 - writing tree out with git write-tree

expecting success: git update-index --add path1/file1
ok 7 - remove file not in base index

expecting success: 
	git update-index --force-remove one &&
	git ls-files --stage >ls-files.actual &&
	cat >ls-files.expect <<EOF &&
EOF
	test_cmp ls-files.expect ls-files.actual &&

	test-dump-split-index .git/index | sed "/^own/d" >actual &&
	cat >expect <<EOF &&
$BASE
replacements:
deletions: 0
EOF
	test_cmp expect actual

ok 3 - git update-index --add path1/file1

expecting success: tree2=$(git write-tree)
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
ok 19 - #6f: GIT_DIR set, core.worktree=../.. (relative)

expecting success: 
	setup_repo 7 non-existent "" unset &&
	mkdir -p 7/sub/sub 7/wt/sub

ok 4 - writing tree out with git write-tree

warning: unable to rmdir sub1: Directory not empty
expecting success: git read-tree -m $tree1 && git checkout-index -f -a
test_must_fail: command succeeded: git read-tree -u --reset replace_sub1_with_directory
ok 8 - remove file in base index

expecting success: 
	: >one &&
	git update-index --add one &&
	git ls-files --stage >ls-files.actual &&
	cat >ls-files.expect <<EOF &&
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0	one
EOF
	test_cmp ls-files.expect ls-files.actual &&

	test-dump-split-index .git/index | sed "/^own/d" >actual &&
	cat >expect <<EOF &&
$BASE
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0	one
replacements:
deletions: 0
EOF
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/7/.git/
ok 5 - read previously written tree and checkout.

expecting success: test_ln_s_add path0 path1
checking prerequisite: SYMLINKS

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	# test whether the filesystem supports symbolic links
	ln -s x y && test -h y

)
not ok 22 - git read-tree -u --reset: replace submodule with a directory must fail # TODO known breakage

checking known breakage: 
		prolog &&
		reset_work_tree_to add_sub1 &&
		(
			cd submodule_update &&
			git branch -t replace_sub1_with_directory origin/replace_sub1_with_directory &&
			replace_gitfile_with_git_dir sub1 &&
			test_must_fail $command replace_sub1_with_directory &&
			test_superproject_content origin/add_sub1 &&
			test_git_directory_is_unchanged sub1 &&
			test_submodule_content sub1 origin/add_sub1
		)
	
prerequisite SYMLINKS ok
ok 20 - #7: setup

expecting success: 
		try_case $N "$here/$N" .git \
			"$dotgit" "$here/$N" "$here/$N" "(null)" &&
		try_case $N . .git \
			"$dotgit" "$here/$N" "$here/$N" "(null)" &&
		try_case $N "$here/$N" "$here/$N/.git" \
			"$absgit" "$here/$N" "$here/$N" "(null)" &&
		try_case $N . "$here/$N/.git" \
			"$absgit" "$here/$N" "$here/$N" "(null)"
	
ok 9 - add original file back

expecting success: 
	: >two &&
	git update-index --add two &&
	git ls-files --stage >actual &&
	cat >expect <<EOF &&
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0	one
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0	two
EOF
	test_cmp expect actual

ok 6 - add a symlink

expecting success: tree3=$(git write-tree)
ok 7 - writing tree out with git write-tree

expecting success: git read-tree $tree2 && git checkout-index -f -a
ok 10 - add new file

expecting success: 
	git update-index --no-split-index &&
	git ls-files --stage >ls-files.actual &&
	cat >ls-files.expect <<EOF &&
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0	one
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0	two
EOF
	test_cmp ls-files.expect ls-files.actual &&

	test-dump-split-index .git/index | sed "/^own/d" >actual &&
	cat >expect <<EOF &&
not a split index
EOF
	test_cmp expect actual

ok 8 - read previously written tree and checkout.

expecting success: test ! -h path0 && test -d path0 &&
     test ! -h path1 && test -d path1 &&
     test ! -h path0/file0 && test -f path0/file0 &&
     test ! -h path1/file1 && test -f path1/file1
ok 9 - checking out conflicting path with -f

# passed all 9 test(s)
1..9
Cloning into 'submodule_update'...
*** t2002-checkout-cache-u.sh ***
ok 11 - unify index, two files remain

# passed all 11 test(s)
1..11
done.
ok 21 - #7: explicit GIT_WORK_TREE and GIT_DIR at toplevel

expecting success: 
		try_case $N/sub/sub "$here/$N" ../../.git \
			"$absgit" "$here/$N" "$here/$N" sub/sub/ &&
		try_case $N/sub/sub ../.. ../../.git \
			"$absgit" "$here/$N" "$here/$N" sub/sub/ &&
		try_case $N/sub/sub "$here/$N" "$here/$N/.git" \
			"$absgit" "$here/$N" "$here/$N" sub/sub/ &&
		try_case $N/sub/sub ../.. "$here/$N/.git" \
			"$absgit" "$here/$N" "$here/$N" sub/sub/
	
*** t2003-checkout-cache-mkdir.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2002-checkout-cache-u/.git/
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
expecting success: 
echo frotz >path0 &&
git update-index --add path0 &&
t=$(git write-tree)
ok 1 - preparation

expecting success: 
rm -f path0 &&
git read-tree $t &&
git checkout-index -f -a &&
test_must_fail git diff-files --exit-code
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2003-checkout-cache-mkdir/.git/
expecting success: 
	mkdir path1 &&
	echo frotz >path0 &&
	echo rezrov >path1/file1 &&
	git update-index --add path0 path1/file1

ok 22 - #7: explicit GIT_WORK_TREE and GIT_DIR in subdir

expecting success: 
		try_case $N "$here/$N/wt" .git \
			"$dotgit" "$here/$N/wt" "$here/$N" "(null)" &&
		try_case $N wt .git \
			"$dotgit" "$here/$N/wt" "$here/$N" "(null)" &&
		try_case $N wt "$here/$N/.git" \
			"$absgit" "$here/$N/wt" "$here/$N" "(null)" &&
		try_case $N "$here/$N/wt" "$here/$N/.git" \
			"$absgit" "$here/$N/wt" "$here/$N" "(null)"
	
ok 1 - setup

checking prerequisite: SYMLINKS

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	# test whether the filesystem supports symbolic links
	ln -s x y && test -h y

)
:100644 100644 8e4020bb5a8d8c873b25de15933e75cc0fc275df 0000000000000000000000000000000000000000 M	path0
ok 2 - without -u, git checkout-index smudges stat information.

expecting success: 
rm -f path0 &&
git read-tree $t &&
git checkout-index -u -f -a &&
git diff-files --exit-code
prerequisite SYMLINKS ok
expecting success: 
	rm -fr path0 path1 &&
	mkdir path2 &&
	ln -s path2 path1 &&
	git checkout-index -f -a &&
	test ! -h path1 && test -d path1 &&
	test -f path1/file1 && test ! -f path2/file1

ok 2 - have symlink in place where dir is expected.

expecting success: 
	rm -fr path0 path1 path2 &&
	mkdir path2 &&
	git checkout-index --prefix=path2/ -f -a &&
	test -f path2/path0 &&
	test -f path2/path1/file1 &&
	test ! -f path0 &&
	test ! -f path1/file1

ok 3 - with -u, git checkout-index picks up stat information from new files.

# passed all 3 test(s)
1..3
ok 3 - use --prefix=path2/

expecting success: 
	rm -fr path0 path1 path2 tmp* &&
	git checkout-index --prefix=tmp- -f -a &&
	test -f tmp-path0 &&
	test -f tmp-path1/file1 &&
	test ! -f path0 &&
	test ! -f path1/file1

*** t2004-checkout-cache-temp.sh ***
ok 4 - use --prefix=tmp-

expecting success: 
	rm -fr path0 path1 path2 tmp* &&
	echo nitfol >tmp-path1 &&
	mkdir tmp-path0 &&
	git checkout-index --prefix=tmp- -f -a &&
	test -f tmp-path0 &&
	test -f tmp-path1/file1 &&
	test ! -f path0 &&
	test ! -f path1/file1

ok 23 - #7: explicit GIT_WORK_TREE from parent of worktree

expecting success: 
		try_case $N/sub/sub "$here/$N/wt" ../../.git \
			"$dotdotgit" "$here/$N/wt" "$here/$N/sub/sub" "(null)" &&
		try_case $N/sub/sub ../../wt ../../.git \
			"$dotdotgit" "$here/$N/wt" "$here/$N/sub/sub" "(null)" &&
		try_case $N/sub/sub ../../wt "$here/$N/.git" \
			"$absgit" "$here/$N/wt" "$here/$N/sub/sub" "(null)" &&
		try_case $N/sub/sub "$here/$N/wt" "$here/$N/.git" \
			"$absgit" "$here/$N/wt" "$here/$N/sub/sub" "(null)"
	
ok 5 - use --prefix=tmp- but with a conflicting file and dir

expecting success: 
	rm -fr path0 path1 path2 tmp* &&
	mkdir tmp1 tmp1/orary &&
	ln -s tmp1 tmp &&
	git checkout-index --prefix=tmp/orary/ -f -a &&
	test -d tmp1/orary &&
	test -f tmp1/orary/path0 &&
	test -f tmp1/orary/path1/file1 &&
	test -h tmp

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 6 - use --prefix=tmp/orary/ where tmp is a symlink

expecting success: 
	rm -fr path0 path1 path2 tmp* &&
	mkdir tmp1 &&
	ln -s tmp1 tmp &&
	git checkout-index --prefix=tmp/orary- -f -a &&
	test -f tmp1/orary-path0 &&
	test -f tmp1/orary-path1/file1 &&
	test -h tmp

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2004-checkout-cache-temp/.git/
expecting success: 
	mkdir asubdir &&
	echo tree1path0 >path0 &&
	echo tree1path1 >path1 &&
	echo tree1path3 >path3 &&
	echo tree1path4 >path4 &&
	echo tree1asubdir/path5 >asubdir/path5 &&
	git update-index --add path0 path1 path3 path4 asubdir/path5 &&
	t1=$(git write-tree) &&
	rm -f path* .merge_* actual .git/index &&
	echo tree2path0 >path0 &&
	echo tree2path1 >path1 &&
	echo tree2path2 >path2 &&
	echo tree2path4 >path4 &&
	git update-index --add path0 path1 path2 path4 &&
	t2=$(git write-tree) &&
	rm -f path* .merge_* actual .git/index &&
	echo tree2path0 >path0 &&
	echo tree3path1 >path1 &&
	echo tree3path2 >path2 &&
	echo tree3path3 >path3 &&
	git update-index --add path0 path1 path2 path3 &&
	t3=$(git write-tree)

ok 7 - use --prefix=tmp/orary- where tmp is a symlink

expecting success: 
	rm -fr path0 path1 path2 tmp* &&
	mkdir tmp1 &&
	ln -s tmp1 tmp-path1 &&
	git checkout-index --prefix=tmp- -f -a &&
	test -f tmp-path0 &&
	test ! -h tmp-path1 &&
	test -d tmp-path1 &&
	test -f tmp-path1/file1

ok 8 - use --prefix=tmp- where tmp-path1 is a symlink

expecting success: 
	rm -fr path0 path1 path2 tmp* &&
	mkdir path1 &&
	mkdir tmp &&
	git config filter.replace-all.smudge "sed -e s/./,/g" &&
	git config filter.replace-all.clean cat &&
	git config filter.replace-all.required true &&
	echo "file1 filter=replace-all" >path1/.gitattributes &&
	git checkout-index --prefix=tmp/ -f -a &&
	echo frotz >expected &&
	test_cmp expected tmp/path0 &&
	echo ,,,,,, >expected &&
	test_cmp expected tmp/path1/file1

Cloning into 'sub1'...
ok 24 - #7: explicit GIT_WORK_TREE from nephew of worktree

expecting success: 
		try_case $N "$here" .git \
			"$absgit" "$here" "$here" $N/ &&
		try_case $N .. .git \
			"$absgit" "$here" "$here" $N/ &&
		try_case $N .. "$here/$N/.git" \
			"$absgit" "$here" "$here" $N/ &&
		try_case $N "$here" "$here/$N/.git" \
			"$absgit" "$here" "$here" $N/
	
done.
ok 1 - setup

expecting success: 
	rm -f path* .merge_* actual .git/index &&
	git read-tree $t1 &&
	git checkout-index --temp -- path1 >actual &&
	test_line_count = 1 actual &&
	test $(cut "-d	" -f2 actual) = path1 &&
	p=$(cut "-d	" -f1 actual) &&
	test -f $p &&
	test $(cat $p) = tree1path1

ok 9 - apply filter from working tree .gitattributes with --prefix

expecting success: 
	rm -fr path0 path1 path2 tmp* &&
	mkdir path1 &&
	mkdir tmp &&
	echo "file1 eol=crlf" >path1/.gitattributes &&
	git checkout-index --prefix=tmp/ -f -a &&
	echo rezrovQ >expected &&
	tr \\015 Q <tmp/path1/file1 >actual &&
	test_cmp expected actual

ok 2 - checkout one stage 0 to temporary file

expecting success: 
	rm -f path* .merge_* actual .git/index &&
	git read-tree $t1 &&
	git checkout-index -a --temp >actual &&
	test_line_count = 5 actual &&
	for f in path0 path1 path3 path4 asubdir/path5
	do
		test $(grep $f actual | cut "-d	" -f2) = $f &&
		p=$(grep $f actual | cut "-d	" -f1) &&
		test -f $p &&
		test $(cat $p) = tree1$f
	done

ok 10 - apply CRLF filter from working tree .gitattributes with --prefix

# passed all 10 test(s)
1..10
*** t2005-checkout-index-symlinks.sh ***
ok 25 - #7: chdir_to_toplevel uses worktree, not git dir

expecting success: 
		try_case $N/sub/sub "$here" ../../.git \
			"$absgit" "$here" "$here" $N/sub/sub/ &&
		try_case $N/sub/sub ../../.. ../../.git \
			"$absgit" "$here" "$here" $N/sub/sub/ &&
		try_case $N/sub/sub ../../../ "$here/$N/.git" \
			"$absgit" "$here" "$here" $N/sub/sub/ &&
		try_case $N/sub/sub "$here" "$here/$N/.git" \
			"$absgit" "$here" "$here" $N/sub/sub/
	
Submodule path 'sub1': checked out '913780cd9739c4974f32aaa316af9267f73412c2'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2005-checkout-index-symlinks/.git/
expecting success: 
git config core.symlinks false &&
l=$(printf file | git hash-object -t blob -w --stdin) &&
echo "120000 $l	symlink" | git update-index --index-info
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
ok 3 - checkout all stage 0 to temporary files

expecting success: 
	rm -f path* .merge_* actual .git/index &&
	git read-tree -m $t1 $t2 $t3

ok 1 - preparation

expecting success: 
git checkout-index symlink &&
test -f symlink
ok 4 - setup 3-way merge

expecting success: 
	rm -f path* .merge_* actual &&
	git checkout-index --stage=2 --temp -- path1 >actual &&
	test_line_count = 1 actual &&
	test $(cut "-d	" -f2 actual) = path1 &&
	p=$(cut "-d	" -f1 actual) &&
	test -f $p &&
	test $(cat $p) = tree2path1

ok 2 - the checked-out symlink must be a file

expecting success: 
test "$(git hash-object -t blob symlink)" = $l
ok 26 - #7: chdir_to_toplevel uses worktree (from subdir)

expecting success: 
	try_repo 8 unset unset unset gitfile unset \
		"$here/8.git" "$here/8" "$here/8" "(null)" \
		"$here/8.git" "$here/8" "$here/8" sub/

ok 3 - the file must be the blob we added during the setup

ok 5 - checkout one stage 2 to temporary file

expecting success: 
	rm -f path* .merge_* actual &&
	git checkout-index --all --stage=2 --temp >actual &&
	test_line_count = 3 actual &&
	for f in path1 path2 path4
	do
		test $(grep $f actual | cut "-d	" -f2) = $f &&
		p=$(grep $f actual | cut "-d	" -f1) &&
		test -f $p &&
		test $(cat $p) = tree2$f
	done

# passed all 3 test(s)
1..3
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/8/.git/
*** t2006-checkout-index-basic.sh ***
warning: unable to rmdir sub1: Directory not empty
test_must_fail: command succeeded: git read-tree -u --reset replace_sub1_with_directory
not ok 23 - git read-tree -u --reset: replace submodule containing a .git directory with a directory must fail # TODO known breakage

checking known breakage: 
		prolog &&
		reset_work_tree_to add_sub1 &&
		(
			cd submodule_update &&
			git branch -t replace_sub1_with_file origin/replace_sub1_with_file &&
			test_must_fail $command replace_sub1_with_file &&
			test_superproject_content origin/add_sub1 &&
			test_submodule_content sub1 origin/add_sub1
		)
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2006-checkout-index-basic/.git/
ok 6 - checkout all stage 2 to temporary files

expecting success: 
	rm -f path* .merge_* actual &&
	git checkout-index --stage=all --temp -- path0 >actual &&
	test_line_count = 0 actual

expecting success: 
	test_expect_code 129 git checkout-index --gobbledegook 2>err &&
	test_i18ngrep "[Uu]sage" err

ok 27 - #8: gitfile, easy case

expecting success: 
	mkdir -p 9/wt &&
	try_repo 9 wt unset unset gitfile unset \
		"$here/9.git" "$here/9/wt" "$here/9" "(null)" \
		"$here/9.git" "$here/9/sub/wt" "$here/9/sub" "(null)" 2>message &&
	! test -s message

git checkout-index: path0 does not exist at stage 4
usage: git checkout-index [<options>] [--] [<file>...]
ok 1 - checkout-index --gobbledegook

expecting success: 
	mkdir broken &&
	(
		cd broken &&
		git init &&
		>.git/index &&
		test_expect_code 129 git checkout-index -h >usage 2>&1
	) &&
	test_i18ngrep "[Uu]sage" broken/usage

ok 7 - checkout all stages/one file to nothing

expecting success: 
	rm -f path* .merge_* actual &&
	git checkout-index --stage=all --temp -- path1 >actual &&
	test_line_count = 1 actual &&
	test $(cut "-d	" -f2 actual) = path1 &&
	cut "-d	" -f1 actual | (read s1 s2 s3 &&
	test -f $s1 &&
	test -f $s2 &&
	test -f $s3 &&
	test $(cat $s1) = tree1path1 &&
	test $(cat $s2) = tree2path1 &&
	test $(cat $s3) = tree3path1)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/9/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2006-checkout-index-basic/broken/.git/
usage: git checkout-index [<options>] [--] [<file>...]
ok 2 - checkout-index -h in broken repository

ok 8 - checkout all stages/one file to temporary files

expecting success: 
	rm -f path* .merge_* actual &&
	git checkout-index --stage=all --temp -- path2 >actual &&
	test_line_count = 1 actual &&
	test $(cut "-d	" -f2 actual) = path2 &&
	cut "-d	" -f1 actual | (read s1 s2 s3 &&
	test $s1 = . &&
	test -f $s2 &&
	test -f $s3 &&
	test $(cat $s2) = tree2path2 &&
	test $(cat $s3) = tree3path2)

# passed all 2 test(s)
1..2
ok 9 - checkout some stages/one file to temporary files

*** t2007-checkout-symlink.sh ***
expecting success: 
	rm -f path* .merge_* actual &&
	git checkout-index -a --stage=all --temp >actual &&
	test_line_count = 5 actual

Cloning into 'submodule_update'...
ok 28 - #9: GIT_WORK_TREE accepted with gitfile

expecting success: 
	try_repo 10 unset "$here/10/.git" unset gitfile unset \
		"$here/10.git" "$here/10" "$here/10" "(null)" \
		"$here/10.git" "$here/10/sub" "$here/10/sub" "(null)"

ok 10 - checkout all stages/all files to temporary files

expecting success: 
	test x$(grep path0 actual | cut "-d	" -f2) = x

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/10/.git/
ok 11 - -- path0: no entry

expecting success: 
	test $(grep path1 actual | cut "-d	" -f2) = path1 &&
	grep path1 actual | cut "-d	" -f1 | (read s1 s2 s3 &&
	test -f $s1 &&
	test -f $s2 &&
	test -f $s3 &&
	test $(cat $s1) = tree1path1 &&
	test $(cat $s2) = tree2path1 &&
	test $(cat $s3) = tree3path1)

done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2007-checkout-symlink/.git/
ok 12 - -- path1: all 3 stages

expecting success: 
	test $(grep path2 actual | cut "-d	" -f2) = path2 &&
	grep path2 actual | cut "-d	" -f1 | (read s1 s2 s3 &&
	test $s1 = . &&
	test -f $s2 &&
	test -f $s3 &&
	test $(cat $s2) = tree2path2 &&
	test $(cat $s3) = tree3path2)

expecting success: 

	mkdir frotz &&
	echo hello >frotz/filfre &&
	git add frotz/filfre &&
	test_tick &&
	git commit -m "master has file frotz/filfre" &&

	git branch side &&

	echo goodbye >nitfol &&
	git add nitfol &&
	test_tick &&
	git commit -m "master adds file nitfol" &&

	git checkout side &&

	git rm --cached frotz/filfre &&
	mv frotz xyzzy &&
	test_ln_s_add xyzzy frotz &&
	git add xyzzy/filfre &&
	test_tick &&
	git commit -m "side moves frotz/ to xyzzy/ and adds frotz->xyzzy/"


Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 13 - -- path2: no stage 1, have stage 2 and 3

expecting success: 
	test $(grep path3 actual | cut "-d	" -f2) = path3 &&
	grep path3 actual | cut "-d	" -f1 | (read s1 s2 s3 &&
	test -f $s1 &&
	test $s2 = . &&
	test -f $s3 &&
	test $(cat $s1) = tree1path3 &&
	test $(cat $s3) = tree3path3)

ok 29 - #10: GIT_DIR can point to gitfile

expecting success: 
	try_repo 10b unset .git unset gitfile unset \
		"$here/10b.git" "$here/10b" "$here/10b" "(null)" \
		"$here/10b.git" "$here/10b/sub" "$here/10b/sub" "(null)"

ok 14 - -- path3: no stage 2, have stage 1 and 3

expecting success: 
	test $(grep path4 actual | cut "-d	" -f2) = path4 &&
	grep path4 actual | cut "-d	" -f1 | (read s1 s2 s3 &&
	test -f $s1 &&
	test -f $s2 &&
	test $s3 = . &&
	test $(cat $s1) = tree1path4 &&
	test $(cat $s2) = tree2path4)

[master (root-commit) f92d3a8] master has file frotz/filfre
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 frotz/filfre
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/10b/.git/
ok 15 - -- path4: no stage 3, have stage 1 and 3

expecting success: 
	test $(grep asubdir/path5 actual | cut "-d	" -f2) = asubdir/path5 &&
	grep asubdir/path5 actual | cut "-d	" -f1 | (read s1 s2 s3 &&
	test -f $s1 &&
	test $s2 = . &&
	test $s3 = . &&
	test $(cat $s1) = tree1asubdir/path5)

ok 16 - -- asubdir/path5: no stage 2 and 3 have stage 1

expecting success: 
	(
		cd asubdir &&
		git checkout-index -a --stage=all >actual &&
		test_line_count = 1 actual &&
		test $(grep path5 actual | cut "-d	" -f2) = path5 &&
		grep path5 actual | cut "-d	" -f1 | (read s1 s2 s3 &&
		test -f ../$s1 &&
		test $s2 = . &&
		test $s3 = . &&
		test $(cat ../$s1) = tree1asubdir/path5)
	)

[master ed594a0] master adds file nitfol
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 nitfol
Switched to branch 'side'
ok 17 - checkout --temp within subdir

expecting success: 
	rm -f path* .merge_* actual .git/index &&
	test_ln_s_add path7 path6 &&
	git checkout-index --temp -a >actual &&
	test_line_count = 1 actual &&
	test $(cut "-d	" -f2 actual) = path6 &&
	p=$(cut "-d	" -f1 actual) &&
	test -f $p &&
	test $(cat $p) = path7

rm 'frotz/filfre'
checking prerequisite: SYMLINKS

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	# test whether the filesystem supports symbolic links
	ln -s x y && test -h y

)
checking prerequisite: SYMLINKS

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	# test whether the filesystem supports symbolic links
	ln -s x y && test -h y

)
ok 30 - #10b: relative GIT_DIR can point to gitfile

expecting success: 
	setup_repo 11 unset gitfile unset &&
	mkdir -p 11/sub/sub 11/wt/sub

prerequisite SYMLINKS ok
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/11/.git/
prerequisite SYMLINKS ok
ok 31 - #11: setup

expecting success: 
		try_case $N "$here/$N" .git \
			"$dotgit" "$here/$N" "$here/$N" "(null)" &&
		try_case $N . .git \
			"$dotgit" "$here/$N" "$here/$N" "(null)" &&
		try_case $N "$here/$N" "$here/$N/.git" \
			"$absgit" "$here/$N" "$here/$N" "(null)" &&
		try_case $N . "$here/$N/.git" \
			"$absgit" "$here/$N" "$here/$N" "(null)"
	
[side 1502bd7] side moves frotz/ to xyzzy/ and adds frotz->xyzzy/
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
 create mode 120000 fro