Raspbian Package Auto-Building

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

git1:2.6.4-1armhf → 2015-12-16 11:31:32

sbuild (Debian sbuild) 0.65.2 (24 Mar 2015) on testbuildd.raspbian.org

╔══════════════════════════════════════════════════════════════════════════════╗
║ git 1:2.6.4-1 (armhf)                                      16 Dec 2015 10:36 ║
╚══════════════════════════════════════════════════════════════════════════════╝

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

I: NOTICE: Log filtering will replace 'build/git-swmT1A/git-2.6.4' with '«PKGBUILDDIR»'
I: NOTICE: Log filtering will replace 'build/git-swmT1A' with '«BUILDDIR»'
I: NOTICE: Log filtering will replace 'var/lib/schroot/mount/stretch-staging-armhf-sbuild-4888389c-7c2f-446b-8532-61efa9b2f323' 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 [8534 kB]
Get:3 http://172.17.0.1 stretch-staging/main armhf Packages [10.5 MB]
Ign http://172.17.0.1 stretch-staging/main Translation-en
Fetched 19.0 MB in 36s (527 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 4319 kB of source archives.
Get:1 http://172.17.0.1/private/ stretch-staging/main git 1:2.6.4-1 (dsc) [2765 B]
Get:2 http://172.17.0.1/private/ stretch-staging/main git 1:2.6.4-1 (tar) [3821 kB]
Get:3 http://172.17.0.1/private/ stretch-staging/main git 1:2.6.4-1 (diff) [496 kB]
Fetched 4319 kB in 1s (2297 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-aymIDQ/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 27 not upgraded.
Need to get 0 B/768 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 ... 12030 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-K_qzEK/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 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 libicu55 libidn11
  libio-pty-perl libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0
  libldap-2.4-2 libnettle6 libnghttp2-14 libp11-kit0 libpcre16-3 libpcre3
  libpcre3-dev libpcre32-3 libpcrecpp0v5 libpython-stdlib libpython2.7-minimal
  libpython2.7-stdlib librtmp1 libsasl2-2 libsasl2-modules-db libserf-1-1
  libsqlite3-0 libssh2-1 libssl1.0.2 libsvn-perl libsvn1 libtasn1-6 libtcl8.6
  libtimedate-perl 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 autopoint libasprintf-dev libgettextpo-dev 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
  db5.3-util subversion-tools tcl-tclreadline zip
Recommended packages:
  openssh-client curl wget lynx-cur 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 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 libicu55 libidn11
  libio-pty-perl libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0
  libldap-2.4-2 libnettle6 libnghttp2-14 libp11-kit0 libpcre16-3 libpcre3-dev
  libpcre32-3 libpcrecpp0v5 libpython-stdlib libpython2.7-minimal
  libpython2.7-stdlib librtmp1 libsasl2-2 libsasl2-modules-db libserf-1-1
  libsqlite3-0 libssh2-1 libssl1.0.2 libsvn-perl libsvn1 libtasn1-6 libtcl8.6
  libtimedate-perl 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
The following packages will be upgraded:
  libpcre3
1 upgraded, 64 newly installed, 0 to remove and 26 not upgraded.
Need to get 30.5 MB/30.5 MB of archives.
After this operation, 101 MB of additional disk space will be used.
Get:1 http://172.17.0.1/private/ stretch-staging/main libpcre3 armhf 2:8.35-8 [299 kB]
Get:2 http://172.17.0.1/private/ stretch-staging/main libpython2.7-minimal armhf 2.7.10-5+b1 [380 kB]
Get:3 http://172.17.0.1/private/ stretch-staging/main python2.7-minimal armhf 2.7.10-5+b1 [1092 kB]
Get:4 http://172.17.0.1/private/ stretch-staging/main python-minimal armhf 2.7.9-1 [40.1 kB]
Get:5 http://172.17.0.1/private/ stretch-staging/main mime-support all 3.59 [36.4 kB]
Get:6 http://172.17.0.1/private/ stretch-staging/main libexpat1 armhf 2.1.0-7 [59.8 kB]
Get:7 http://172.17.0.1/private/ stretch-staging/main libffi6 armhf 3.2.1-3 [18.5 kB]
Get:8 http://172.17.0.1/private/ stretch-staging/main libsqlite3-0 armhf 3.9.2-1 [404 kB]
Get:9 http://172.17.0.1/private/ stretch-staging/main libssl1.0.2 armhf 1.0.2d-3 [881 kB]
Get:10 http://172.17.0.1/private/ stretch-staging/main libpython2.7-stdlib armhf 2.7.10-5+b1 [1811 kB]
Get:11 http://172.17.0.1/private/ stretch-staging/main python2.7 armhf 2.7.10-5+b1 [265 kB]
Get:12 http://172.17.0.1/private/ stretch-staging/main libpython-stdlib armhf 2.7.9-1 [19.6 kB]
Get:13 http://172.17.0.1/private/ stretch-staging/main python armhf 2.7.9-1 [151 kB]
Get:14 http://172.17.0.1/private/ stretch-staging/main libbsd0 armhf 0.7.0-2 [63.7 kB]
Get:15 http://172.17.0.1/private/ stretch-staging/main libpcrecpp0v5 armhf 2:8.35-8 [141 kB]
Get:16 http://172.17.0.1/private/ stretch-staging/main libssh2-1 armhf 1.5.0-2 [122 kB]
Get:17 http://172.17.0.1/private/ stretch-staging/main libtcl8.6 armhf 8.6.4+dfsg-2 [866 kB]
Get:18 http://172.17.0.1/private/ stretch-staging/main libunistring0 armhf 0.9.3-5.2 [253 kB]
Get:19 http://172.17.0.1/private/ stretch-staging/main gettext-base armhf 0.19.6-1 [119 kB]
Get:20 http://172.17.0.1/private/ stretch-staging/main libnettle6 armhf 3.1.1-4 [200 kB]
Get:21 http://172.17.0.1/private/ stretch-staging/main libhogweed4 armhf 3.1.1-4 [126 kB]
Get:22 http://172.17.0.1/private/ stretch-staging/main libp11-kit0 armhf 0.23.1-3 [94.2 kB]
Get:23 http://172.17.0.1/private/ stretch-staging/main libtasn1-6 armhf 4.7-2 [44.3 kB]
Get:24 http://172.17.0.1/private/ stretch-staging/main libgnutls-deb0-28 armhf 3.3.18-1 [645 kB]
Get:25 http://172.17.0.1/private/ stretch-staging/main libkeyutils1 armhf 1.5.9-8 [11.5 kB]
Get:26 http://172.17.0.1/private/ stretch-staging/main libkrb5support0 armhf 1.13.2+dfsg-4+b1 [56.5 kB]
Get:27 http://172.17.0.1/private/ stretch-staging/main libk5crypto3 armhf 1.13.2+dfsg-4+b1 [110 kB]
Get:28 http://172.17.0.1/private/ stretch-staging/main libkrb5-3 armhf 1.13.2+dfsg-4+b1 [261 kB]
Get:29 http://172.17.0.1/private/ stretch-staging/main libgssapi-krb5-2 armhf 1.13.2+dfsg-4+b1 [129 kB]
Get:30 http://172.17.0.1/private/ stretch-staging/main libidn11 armhf 1.32-3 [110 kB]
Get:31 http://172.17.0.1/private/ stretch-staging/main libsasl2-modules-db armhf 2.1.26.dfsg1-14+b1 [65.8 kB]
Get:32 http://172.17.0.1/private/ stretch-staging/main libsasl2-2 armhf 2.1.26.dfsg1-14+b1 [97.1 kB]
Get:33 http://172.17.0.1/private/ stretch-staging/main libldap-2.4-2 armhf 2.4.42+dfsg-2+rpi1 [197 kB]
Get:34 http://172.17.0.1/private/ stretch-staging/main libicu55 armhf 55.1-6 [7379 kB]
Get:35 http://172.17.0.1/private/ stretch-staging/main libxml2 armhf 2.9.2+zdfsg1-4 [797 kB]
Get:36 http://172.17.0.1/private/ stretch-staging/main cvs armhf 2:1.12.13+real-15 [2569 kB]
Get:37 http://172.17.0.1/private/ stretch-staging/main cvsps armhf 2.1-7 [45.1 kB]
Get:38 http://172.17.0.1/private/ stretch-staging/main libglib2.0-0 armhf 2.46.2-1 [2482 kB]
Get:39 http://172.17.0.1/private/ stretch-staging/main libcroco3 armhf 0.6.9-1 [129 kB]
Get:40 http://172.17.0.1/private/ stretch-staging/main gettext armhf 0.19.6-1 [1393 kB]
Get:41 http://172.17.0.1/private/ stretch-staging/main libapr1 armhf 1.5.2-3 [80.0 kB]
Get:42 http://172.17.0.1/private/ stretch-staging/main libaprutil1 armhf 1.5.4-1+b1 [75.6 kB]
Get:43 http://172.17.0.1/private/ stretch-staging/main libnghttp2-14 armhf 1.5.0-1 [70.1 kB]
Get:44 http://172.17.0.1/private/ stretch-staging/main librtmp1 armhf 2.4+20150115.gita107cef-1+b1 [54.5 kB]
Get:45 http://172.17.0.1/private/ stretch-staging/main libcurl3-gnutls armhf 7.45.0-1+b1 [240 kB]
Get:46 http://172.17.0.1/private/ stretch-staging/main libcurl4-gnutls-dev armhf 7.45.0-1+b1 [324 kB]
Get:47 http://172.17.0.1/private/ stretch-staging/main libdbi-perl armhf 1.634-1 [813 kB]
Get:48 http://172.17.0.1/private/ stretch-staging/main libdbd-sqlite3-perl armhf 1.46-1 [150 kB]
Get:49 http://172.17.0.1/private/ stretch-staging/main libexpat1-dev armhf 2.1.0-7 [114 kB]
Get:50 http://172.17.0.1/private/ stretch-staging/main libtimedate-perl all 2.3000-2 [42.2 kB]
Get:51 http://172.17.0.1/private/ stretch-staging/main libhttp-date-perl all 6.02-1 [10.7 kB]
Get:52 http://172.17.0.1/private/ stretch-staging/main libio-pty-perl armhf 1:1.08-1+b2 [35.0 kB]
Get:53 http://172.17.0.1/private/ stretch-staging/main libpcre16-3 armhf 2:8.35-8 [220 kB]
Get:54 http://172.17.0.1/private/ stretch-staging/main libpcre32-3 armhf 2:8.35-8 [214 kB]
Get:55 http://172.17.0.1/private/ stretch-staging/main libpcre3-dev armhf 2:8.35-8 [546 kB]
Get:56 http://172.17.0.1/private/ stretch-staging/main libserf-1-1 armhf 1.3.8-1+b1 [44.9 kB]
Get:57 http://172.17.0.1/private/ stretch-staging/main libsvn1 armhf 1.9.2-3 [1114 kB]
Get:58 http://172.17.0.1/private/ stretch-staging/main libsvn-perl armhf 1.9.2-3 [893 kB]
Get:59 http://172.17.0.1/private/ stretch-staging/main libyaml-perl all 1.15-1 [69.7 kB]
Get:60 http://172.17.0.1/private/ stretch-staging/main subversion armhf 1.9.2-3 [968 kB]
Get:61 http://172.17.0.1/private/ stretch-staging/main tcl8.6 armhf 8.6.4+dfsg-2 [122 kB]
Get:62 http://172.17.0.1/private/ stretch-staging/main tcl armhf 8.6.0+9 [5502 B]
Get:63 http://172.17.0.1/private/ stretch-staging/main unzip armhf 6.0-20 [142 kB]
Get:64 http://172.17.0.1/private/ stretch-staging/main zlib1g-dev armhf 1:1.2.8.dfsg-2+b1 [197 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 30.5 MB in 16s (1835 kB/s)
(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 ... 12030 files and directories currently installed.)
Preparing to unpack .../libpcre3_2%3a8.35-8_armhf.deb ...
Unpacking libpcre3:armhf (2:8.35-8) over (2:8.35-7.4) ...
Processing triggers for libc-bin (2.19-22) ...
Setting up libpcre3:armhf (2:8.35-8) ...
Processing triggers for libc-bin (2.19-22) ...
Selecting previously unselected package libpython2.7-minimal: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 ... 12030 files and directories currently installed.)
Preparing to unpack .../libpython2.7-minimal_2.7.10-5+b1_armhf.deb ...
Unpacking libpython2.7-minimal:armhf (2.7.10-5+b1) ...
Selecting previously unselected package python2.7-minimal.
Preparing to unpack .../python2.7-minimal_2.7.10-5+b1_armhf.deb ...
Unpacking python2.7-minimal (2.7.10-5+b1) ...
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 libffi6:armhf.
Preparing to unpack .../libffi6_3.2.1-3_armhf.deb ...
Unpacking libffi6:armhf (3.2.1-3) ...
Selecting previously unselected package libsqlite3-0:armhf.
Preparing to unpack .../libsqlite3-0_3.9.2-1_armhf.deb ...
Unpacking libsqlite3-0:armhf (3.9.2-1) ...
Selecting previously unselected package libssl1.0.2:armhf.
Preparing to unpack .../libssl1.0.2_1.0.2d-3_armhf.deb ...
Unpacking libssl1.0.2:armhf (1.0.2d-3) ...
Selecting previously unselected package libpython2.7-stdlib:armhf.
Preparing to unpack .../libpython2.7-stdlib_2.7.10-5+b1_armhf.deb ...
Unpacking libpython2.7-stdlib:armhf (2.7.10-5+b1) ...
Selecting previously unselected package python2.7.
Preparing to unpack .../python2.7_2.7.10-5+b1_armhf.deb ...
Unpacking python2.7 (2.7.10-5+b1) ...
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) ...
Processing triggers for libc-bin (2.19-22) ...
Setting up libpython2.7-minimal:armhf (2.7.10-5+b1) ...
Setting up python2.7-minimal (2.7.10-5+b1) ...
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 ... 12850 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 libbsd0:armhf.
Preparing to unpack .../libbsd0_0.7.0-2_armhf.deb ...
Unpacking libbsd0:armhf (0.7.0-2) ...
Selecting previously unselected package libpcrecpp0v5:armhf.
Preparing to unpack .../libpcrecpp0v5_2%3a8.35-8_armhf.deb ...
Unpacking libpcrecpp0v5:armhf (2:8.35-8) ...
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.6-1_armhf.deb ...
Unpacking gettext-base (0.19.6-1) ...
Selecting previously unselected package libnettle6:armhf.
Preparing to unpack .../libnettle6_3.1.1-4_armhf.deb ...
Unpacking libnettle6:armhf (3.1.1-4) ...
Selecting previously unselected package libhogweed4:armhf.
Preparing to unpack .../libhogweed4_3.1.1-4_armhf.deb ...
Unpacking libhogweed4:armhf (3.1.1-4) ...
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.7-2_armhf.deb ...
Unpacking libtasn1-6:armhf (4.7-2) ...
Selecting previously unselected package libgnutls-deb0-28:armhf.
Preparing to unpack .../libgnutls-deb0-28_3.3.18-1_armhf.deb ...
Unpacking libgnutls-deb0-28:armhf (3.3.18-1) ...
Selecting previously unselected package libkeyutils1:armhf.
Preparing to unpack .../libkeyutils1_1.5.9-8_armhf.deb ...
Unpacking libkeyutils1:armhf (1.5.9-8) ...
Selecting previously unselected package libkrb5support0:armhf.
Preparing to unpack .../libkrb5support0_1.13.2+dfsg-4+b1_armhf.deb ...
Unpacking libkrb5support0:armhf (1.13.2+dfsg-4+b1) ...
Selecting previously unselected package libk5crypto3:armhf.
Preparing to unpack .../libk5crypto3_1.13.2+dfsg-4+b1_armhf.deb ...
Unpacking libk5crypto3:armhf (1.13.2+dfsg-4+b1) ...
Selecting previously unselected package libkrb5-3:armhf.
Preparing to unpack .../libkrb5-3_1.13.2+dfsg-4+b1_armhf.deb ...
Unpacking libkrb5-3:armhf (1.13.2+dfsg-4+b1) ...
Selecting previously unselected package libgssapi-krb5-2:armhf.
Preparing to unpack .../libgssapi-krb5-2_1.13.2+dfsg-4+b1_armhf.deb ...
Unpacking libgssapi-krb5-2:armhf (1.13.2+dfsg-4+b1) ...
Selecting previously unselected package libidn11:armhf.
Preparing to unpack .../libidn11_1.32-3_armhf.deb ...
Unpacking libidn11:armhf (1.32-3) ...
Selecting previously unselected package libsasl2-modules-db:armhf.
Preparing to unpack .../libsasl2-modules-db_2.1.26.dfsg1-14+b1_armhf.deb ...
Unpacking libsasl2-modules-db:armhf (2.1.26.dfsg1-14+b1) ...
Selecting previously unselected package libsasl2-2:armhf.
Preparing to unpack .../libsasl2-2_2.1.26.dfsg1-14+b1_armhf.deb ...
Unpacking libsasl2-2:armhf (2.1.26.dfsg1-14+b1) ...
Selecting previously unselected package libldap-2.4-2:armhf.
Preparing to unpack .../libldap-2.4-2_2.4.42+dfsg-2+rpi1_armhf.deb ...
Unpacking libldap-2.4-2:armhf (2.4.42+dfsg-2+rpi1) ...
Selecting previously unselected package libicu55:armhf.
Preparing to unpack .../libicu55_55.1-6_armhf.deb ...
Unpacking libicu55:armhf (55.1-6) ...
Selecting previously unselected package libxml2:armhf.
Preparing to unpack .../libxml2_2.9.2+zdfsg1-4_armhf.deb ...
Unpacking libxml2:armhf (2.9.2+zdfsg1-4) ...
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-7_armhf.deb ...
Unpacking cvsps (2.1-7) ...
Selecting previously unselected package libglib2.0-0:armhf.
Preparing to unpack .../libglib2.0-0_2.46.2-1_armhf.deb ...
Unpacking libglib2.0-0:armhf (2.46.2-1) ...
Selecting previously unselected package libcroco3:armhf.
Preparing to unpack .../libcroco3_0.6.9-1_armhf.deb ...
Unpacking libcroco3:armhf (0.6.9-1) ...
Selecting previously unselected package gettext.
Preparing to unpack .../gettext_0.19.6-1_armhf.deb ...
Unpacking gettext (0.19.6-1) ...
Selecting previously unselected package libapr1:armhf.
Preparing to unpack .../libapr1_1.5.2-3_armhf.deb ...
Unpacking libapr1:armhf (1.5.2-3) ...
Selecting previously unselected package libaprutil1:armhf.
Preparing to unpack .../libaprutil1_1.5.4-1+b1_armhf.deb ...
Unpacking libaprutil1:armhf (1.5.4-1+b1) ...
Selecting previously unselected package libnghttp2-14:armhf.
Preparing to unpack .../libnghttp2-14_1.5.0-1_armhf.deb ...
Unpacking libnghttp2-14:armhf (1.5.0-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.45.0-1+b1_armhf.deb ...
Unpacking libcurl3-gnutls:armhf (7.45.0-1+b1) ...
Selecting previously unselected package libcurl4-gnutls-dev:armhf.
Preparing to unpack .../libcurl4-gnutls-dev_7.45.0-1+b1_armhf.deb ...
Unpacking libcurl4-gnutls-dev:armhf (7.45.0-1+b1) ...
Selecting previously unselected package libdbi-perl.
Preparing to unpack .../libdbi-perl_1.634-1_armhf.deb ...
Unpacking libdbi-perl (1.634-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 libtimedate-perl.
Preparing to unpack .../libtimedate-perl_2.3000-2_all.deb ...
Unpacking libtimedate-perl (2.3000-2) ...
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-8_armhf.deb ...
Unpacking libpcre16-3:armhf (2:8.35-8) ...
Selecting previously unselected package libpcre32-3:armhf.
Preparing to unpack .../libpcre32-3_2%3a8.35-8_armhf.deb ...
Unpacking libpcre32-3:armhf (2:8.35-8) ...
Selecting previously unselected package libpcre3-dev:armhf.
Preparing to unpack .../libpcre3-dev_2%3a8.35-8_armhf.deb ...
Unpacking libpcre3-dev:armhf (2:8.35-8) ...
Selecting previously unselected package libserf-1-1:armhf.
Preparing to unpack .../libserf-1-1_1.3.8-1+b1_armhf.deb ...
Unpacking libserf-1-1:armhf (1.3.8-1+b1) ...
Selecting previously unselected package libsvn1:armhf.
Preparing to unpack .../libsvn1_1.9.2-3_armhf.deb ...
Unpacking libsvn1:armhf (1.9.2-3) ...
Selecting previously unselected package libsvn-perl.
Preparing to unpack .../libsvn-perl_1.9.2-3_armhf.deb ...
Unpacking libsvn-perl (1.9.2-3) ...
Selecting previously unselected package libyaml-perl.
Preparing to unpack .../libyaml-perl_1.15-1_all.deb ...
Unpacking libyaml-perl (1.15-1) ...
Selecting previously unselected package subversion.
Preparing to unpack .../subversion_1.9.2-3_armhf.deb ...
Unpacking subversion (1.9.2-3) ...
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 .../archives/tcl_8.6.0+9_armhf.deb ...
Unpacking tcl (8.6.0+9) ...
Selecting previously unselected package unzip.
Preparing to unpack .../unzip_6.0-20_armhf.deb ...
Unpacking unzip (6.0-20) ...
Selecting previously unselected package zlib1g-dev:armhf.
Preparing to unpack .../zlib1g-dev_1%3a1.2.8.dfsg-2+b1_armhf.deb ...
Unpacking zlib1g-dev:armhf (1:1.2.8.dfsg-2+b1) ...
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) ...
Processing triggers for libc-bin (2.19-22) ...
Setting up mime-support (3.59) ...
Setting up libexpat1:armhf (2.1.0-7) ...
Setting up libffi6:armhf (3.2.1-3) ...
Setting up libsqlite3-0:armhf (3.9.2-1) ...
Setting up libssl1.0.2:armhf (1.0.2d-3) ...
Setting up libpython2.7-stdlib:armhf (2.7.10-5+b1) ...
Setting up python2.7 (2.7.10-5+b1) ...
Setting up libpython-stdlib:armhf (2.7.9-1) ...
Setting up python (2.7.9-1) ...
Setting up libbsd0:armhf (0.7.0-2) ...
Setting up libpcrecpp0v5:armhf (2:8.35-8) ...
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.6-1) ...
Setting up libnettle6:armhf (3.1.1-4) ...
Setting up libhogweed4:armhf (3.1.1-4) ...
Setting up libp11-kit0:armhf (0.23.1-3) ...
Setting up libtasn1-6:armhf (4.7-2) ...
Setting up libgnutls-deb0-28:armhf (3.3.18-1) ...
Setting up libkeyutils1:armhf (1.5.9-8) ...
Setting up libkrb5support0:armhf (1.13.2+dfsg-4+b1) ...
Setting up libk5crypto3:armhf (1.13.2+dfsg-4+b1) ...
Setting up libkrb5-3:armhf (1.13.2+dfsg-4+b1) ...
Setting up libgssapi-krb5-2:armhf (1.13.2+dfsg-4+b1) ...
Setting up libidn11:armhf (1.32-3) ...
Setting up libsasl2-modules-db:armhf (2.1.26.dfsg1-14+b1) ...
Setting up libsasl2-2:armhf (2.1.26.dfsg1-14+b1) ...
Setting up libldap-2.4-2:armhf (2.4.42+dfsg-2+rpi1) ...
Setting up libicu55:armhf (55.1-6) ...
Setting up libxml2:armhf (2.9.2+zdfsg1-4) ...
Setting up cvs (2:1.12.13+real-15) ...
Allowing use of questionable username.
Adding group `_cvsadmin' (GID 114) ...
Done.
Setting up cvsps (2.1-7) ...
Setting up libglib2.0-0:armhf (2.46.2-1) ...
No schema files found: doing nothing.
Setting up libcroco3:armhf (0.6.9-1) ...
Setting up gettext (0.19.6-1) ...
Setting up libapr1:armhf (1.5.2-3) ...
Setting up libaprutil1:armhf (1.5.4-1+b1) ...
Setting up libnghttp2-14:armhf (1.5.0-1) ...
Setting up librtmp1:armhf (2.4+20150115.gita107cef-1+b1) ...
Setting up libcurl3-gnutls:armhf (7.45.0-1+b1) ...
Setting up libcurl4-gnutls-dev:armhf (7.45.0-1+b1) ...
Setting up libdbi-perl (1.634-1) ...
Setting up libdbd-sqlite3-perl (1.46-1) ...
Setting up libexpat1-dev:armhf (2.1.0-7) ...
Setting up libtimedate-perl (2.3000-2) ...
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-8) ...
Setting up libpcre32-3:armhf (2:8.35-8) ...
Setting up libpcre3-dev:armhf (2:8.35-8) ...
Setting up libserf-1-1:armhf (1.3.8-1+b1) ...
Setting up libsvn1:armhf (1.9.2-3) ...
Setting up libsvn-perl (1.9.2-3) ...
Setting up libyaml-perl (1.15-1) ...
Setting up subversion (1.9.2-3) ...
Setting up tcl8.6 (8.6.4+dfsg-2) ...
Setting up tcl (8.6.0+9) ...
Setting up unzip (6.0-20) ...
Setting up zlib1g-dev:armhf (1:1.2.8.dfsg-2+b1) ...
Setting up sbuild-build-depends-git-dummy (0.invalid.0) ...
Processing triggers for libc-bin (2.19-22) ...

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

Kernel: Linux 3.19.0-trunk-armmp armhf (armv7l)
Toolchain package versions: binutils_2.25.1-7 dpkg-dev_1.18.3 g++-5_5.2.1-23+rpi1 gcc-5_5.2.1-23+rpi1 libc6-dev_2.19-22 libstdc++-5-dev_5.2.1-23+rpi1 libstdc++6_5.2.1-23+rpi1 linux-libc-dev_3.18.5-1~exp1+rpi19+stretch
Package versions: adduser_3.113+nmu3 apt_1.0.10.2 base-files_9.4+rpi1 base-passwd_3.5.38 bash_4.3-14 binutils_2.25.1-7 bsdutils_1:2.27.1-1 build-essential_11.7 bzip2_1.0.6-8 coreutils_8.23-4 cpio_2.11+dfsg-4.1 cpp_4:5.2.1-4+rpi2 cpp-5_5.2.1-23+rpi1 cvs_2:1.12.13+real-15 cvsps_2.1-7 dash_0.5.7-4 debconf_1.5.58 debconf-i18n_1.5.58 debfoster_2.7-2 debianutils_4.5.1 diffutils_1:3.3-2 dmsetup_2:1.02.110-1+rpi1 dpkg_1.18.3 dpkg-dev_1.18.3 e2fslibs_1.42.13-1 e2fsprogs_1.42.13-1 fakeroot_1.20.2-1 findutils_4.4.2-10 g++_4:5.2.1-4+rpi2 g++-5_5.2.1-23+rpi1 gcc_4:5.2.1-4+rpi2 gcc-4.6-base_4.6.4-5+rpi1 gcc-4.7-base_4.7.3-11+rpi1 gcc-4.8-base_4.8.5-1 gcc-4.9-base_4.9.3-5 gcc-5_5.2.1-23+rpi1 gcc-5-base_5.2.1-23+rpi1 gettext_0.19.6-1 gettext-base_0.19.6-1 gnupg_1.4.19-6 gpgv_1.4.19-6 grep_2.22-1 gzip_1.6-4 hostname_3.16 init_1.24 init-system-helpers_1.24 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.10-2+b2 libapr1_1.5.2-3 libaprutil1_1.5.4-1+b1 libapt-pkg4.16_1.0.10.2 libasan2_5.2.1-23+rpi1 libatomic1_5.2.1-23+rpi1 libattr1_1:2.4.47-2 libaudit-common_1:2.4.4-4 libaudit1_1:2.4.4-4 libblkid1_2.27.1-1 libbsd0_0.7.0-2 libbz2-1.0_1.0.6-8 libc-bin_2.19-22 libc-dev-bin_2.19-22 libc6_2.19-22 libc6-dev_2.19-22 libcap2_1:2.24-12 libcap2-bin_1:2.24-12 libcc1-0_5.2.1-23+rpi1 libcomerr2_1.42.13-1 libcroco3_0.6.9-1 libcryptsetup4_2:1.6.6-5 libcurl3-gnutls_7.45.0-1+b1 libcurl4-gnutls-dev_7.45.0-1+b1 libdb5.3_5.3.28-11 libdbd-sqlite3-perl_1.46-1 libdbi-perl_1.634-1 libdbus-1-3_1.10.4-1 libdebconfclient0_0.197 libdevmapper1.02.1_2:1.02.110-1+rpi1 libdpkg-perl_1.18.3 libdrm2_2.4.65-3 libexpat1_2.1.0-7 libexpat1-dev_2.1.0-7 libfakeroot_1.20.2-1 libfdisk1_2.27.1-1 libffi6_3.2.1-3 libgc1c2_1:7.4.2-7 libgcc-5-dev_5.2.1-23+rpi1 libgcc1_1:5.2.1-23+rpi1 libgcrypt20_1.6.4-3 libgdbm3_1.8.3-13.1 libglib2.0-0_2.46.2-1 libgmp10_2:6.1.0+dfsg-2 libgnutls-deb0-28_3.3.18-1 libgomp1_5.2.1-23+rpi1 libgpg-error0_1.20-1 libgssapi-krb5-2_1.13.2+dfsg-4+b1 libhogweed4_3.1.1-4 libhttp-date-perl_6.02-1 libicu55_55.1-6 libidn11_1.32-3 libio-pty-perl_1:1.08-1+b2 libisl13_0.14-2 libk5crypto3_1.13.2+dfsg-4+b1 libkeyutils1_1.5.9-8 libklibc_2.0.4-2+rpi1 libkmod2_21-1 libkrb5-3_1.13.2+dfsg-4+b1 libkrb5support0_1.13.2+dfsg-4+b1 libldap-2.4-2_2.4.42+dfsg-2+rpi1 liblocale-gettext-perl_1.07-1 liblzma5_5.1.1alpha+20120614-2.1 libmount1_2.27.1-1 libmpc3_1.0.3-1 libmpfr4_3.1.3-1 libncurses5_6.0+20151024-2 libncursesw5_6.0+20151024-2 libnettle6_3.1.1-4 libnghttp2-14_1.5.0-1 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-8 libpcre3_2:8.35-8 libpcre3-dev_2:8.35-8 libpcre32-3_2:8.35-8 libpcrecpp0v5_2:8.35-8 libpng12-0_1.2.54-1 libprocps4_2:3.3.10-2 libpython-stdlib_2.7.9-1 libpython2.7-minimal_2.7.10-5+b1 libpython2.7-stdlib_2.7.10-5+b1 libreadline6_6.3-8+b3 librtmp1_2.4+20150115.gita107cef-1+b1 libsasl2-2_2.1.26.dfsg1-14+b1 libsasl2-modules-db_2.1.26.dfsg1-14+b1 libseccomp2_2.2.3-2 libselinux1_2.4-3 libsemanage-common_2.4-3 libsemanage1_2.4-3 libsepol1_2.4-2 libserf-1-1_1.3.8-1+b1 libsmartcols1_2.27.1-1 libsqlite3-0_3.9.2-1 libss2_1.42.13-1 libssh2-1_1.5.0-2 libssl1.0.2_1.0.2d-3 libstdc++-5-dev_5.2.1-23+rpi1 libstdc++6_5.2.1-23+rpi1 libsvn-perl_1.9.2-3 libsvn1_1.9.2-3 libsystemd0_228-2 libtasn1-6_4.7-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.1 libtimedate-perl_2.3000-2 libtinfo5_6.0+20151024-2 libubsan0_5.2.1-23+rpi1 libudev1_228-2 libunistring0_0.9.3-5.2 libusb-0.1-4_2:0.1.12-27 libustr-1.0-1_1.0.4-5 libuuid1_2.27.1-1 libxml2_2.9.2+zdfsg1-4 libyaml-perl_1.15-1 linux-libc-dev_3.18.5-1~exp1+rpi19+stretch login_1:4.2-3.1 lsb-base_4.1+Debian13+rpi1+nmu1 make_4.0-8.2 makedev_2.3.1-93 mawk_1.3.3-17 mime-support_3.59 mount_2.27.1-1 multiarch-support_2.19-22 nano_2.4.2-1 ncurses-base_6.0+20151024-2 ncurses-bin_6.0+20151024-2 passwd_1:4.2-3.1 patch_2.7.5-1 perl_5.20.2-6 perl-base_5.20.2-6 perl-modules_5.20.2-6 procps_2:3.3.10-2 python_2.7.9-1 python-minimal_2.7.9-1 python2.7_2.7.10-5+b1 python2.7-minimal_2.7.10-5+b1 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.9.2-3 systemd_228-2 systemd-sysv_228-2 sysv-rc_2.88dsf-59.2 sysvinit-utils_2.88dsf-59.2 tar_1.28-2.1 tcl_8.6.0+9 tcl8.6_8.6.4+dfsg-2 tzdata_2015g-1 udev_228-2 unzip_6.0-20 util-linux_2.27.1-1 xz-utils_5.1.1alpha+20120614-2.1 zlib1g_1:1.2.8.dfsg-2+b1 zlib1g-dev_1:1.2.8.dfsg-2+b1

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


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

gpgv: keyblock resource `/sbuild-nonexistent/.gnupg/trustedkeys.gpg': file open error
gpgv: Signature made Fri Dec 11 00:50:38 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.6.4-1.dsc
dpkg-source: info: extracting git in git-2.6.4
dpkg-source: info: unpacking git_2.6.4.orig.tar.xz
dpkg-source: info: unpacking git_2.6.4-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=111
SCHROOT_GROUP=buildd
SCHROOT_SESSION_ID=stretch-staging-armhf-sbuild-4888389c-7c2f-446b-8532-61efa9b2f323
SCHROOT_UID=106
SCHROOT_USER=buildd
SHELL=/bin/sh
TERM=linux
USER=buildd

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

dpkg-buildpackage: source package git
dpkg-buildpackage: source version 1:2.6.4-1
dpkg-buildpackage: source distribution unstable
 dpkg-source --before-build git-2.6.4
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.6.4
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-bisect git-difftool--helper git-filter-branch git-merge-octopus git-merge-one-file git-merge-resolve git-mergetool 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-am 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-pull 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-submodule-config 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.6.4 .doc-tmp-dir
rm -f git-2.6.4.tar.gz git-core_2.6.4-*.tar.gz
rm -f git-htmldocs-2.6.4.tar.gz git-manpages-2.6.4.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/5/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Raspbian 5.2.1-23+rpi1' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --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-5-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-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 5.2.1 20151028 (Raspbian 5.2.1-23+rpi1) 
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.6.4
    * 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 ref-filter.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 submodule-config.o
    CC symlinks.o
    CC tag.o
    CC tcp.o
    CC tempfile.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/am.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/pull.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
2440 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
2440 translated messages.
    MSGFMT po/build/locale/fr/LC_MESSAGES/git.mo
2440 translated messages.
    MSGFMT po/build/locale/it/LC_MESSAGES/git.mo
2441 translated messages.
    MSGFMT po/build/locale/bg/LC_MESSAGES/git.mo
716 translated messages, 350 untranslated messages.
    MSGFMT po/build/locale/ru/LC_MESSAGES/git.mo
2440 translated messages.
    MSGFMT po/build/locale/zh_CN/LC_MESSAGES/git.mo
2359 translated messages.
    CC test-chmtime.o
2440 translated messages.
    CC test-ctype.o
2440 translated messages.
    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-submodule-config.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-submodule-config
    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-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-rebase
    GEN git-request-pull
    GEN git-stash
    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-cvsexportcommit
    GEN git-cvsimport
    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-submodule-config
    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-am
    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-init-db
    BUILTIN git-interpret-trailers
    BUILTIN git-log
    BUILTIN git-ls-files
    BUILTIN git-ls-remote
    BUILTIN git-ls-tree
    BUILTIN git-mailinfo
    BUILTIN git-merge
    BUILTIN git-mailsplit
    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-notes
    BUILTIN git-name-rev
    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-pull
    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-format-patch
    BUILTIN git-fsck-objects
    BUILTIN git-init
    BUILTIN git-show
    BUILTIN git-merge-subtree
    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 474 translated, 39 untranslated.
520 translated.
    MSGFMT    po/sv.msg 543 translated.
    MSGFMT    po/fr.msg     MSGFMT    po/it.msg 514 translated.
    MSGFMT    po/ja.msg 547 translated.
520 translated.
    MSGFMT po/pt_br.msg     MSGFMT    po/bg.msg 519 translated, 1 untranslated.
    MSGFMT    po/ru.msg 520 translated.
    MSGFMT po/zh_cn.msg 520 translated.
366 translated, 7 fuzzy, 17 untranslated.
    MSGFMT    po/el.msg     GEN git-gui
547 translated.
    INDEX lib/
516 translated, 4 untranslated.
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/
278 translated messages, 17 fuzzy translations, 12 untranslated messages.
300 translated messages, 3 fuzzy translations, 4 untranslated messages.
Generating catalog po/es.msg
msgfmt --statistics --tcl po/es.po -l es -d po/
277 translated messages, 18 fuzzy translations, 12 untranslated messages.
Generating catalog po/sv.msg
302 translated messages, 2 fuzzy translations, 3 untranslated messages.
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/
184 translated messages, 46 fuzzy translations, 77 untranslated messages.
303 translated messages, 2 fuzzy translations, 2 untranslated messages.
Generating catalog po/ja.msg
msgfmt --statistics --tcl po/ja.po -l ja -d po/
Generating catalog po/pt_br.msg
msgfmt --statistics --tcl po/pt_br.po -l pt_br -d po/
263 translated messages, 27 fuzzy translations, 17 untranslated messages.
274 translated messages, 17 fuzzy translations, 16 untranslated messages.
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/
279 translated messages, 16 fuzzy translations, 12 untranslated messages.
271 translated messages, 20 fuzzy translations, 16 untranslated messages.
    GEN gitk-wish
226 translated messages, 34 fuzzy translations, 47 untranslated messages.
307 translated 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/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
/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>" <private-Error.pm >blib/lib/Error.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/SVN/Log.pm >blib/lib/Git/SVN/Log.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/SVN/Memoize/YAML.pm >blib/lib/Git/SVN/Memoize/YAML.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>" <Git/SVN/Ra.pm >blib/lib/Git/SVN/Ra.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.pm >blib/lib/Git.pm
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></usr/share/locale>" <Git/SVN/Editor.pm >blib/lib/Git/SVN/Editor.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-cvsimport
    GEN git-cvsserver
    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/I18N.pm >blib/lib/Git/I18N.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/SVN/GlobSpec.pm >blib/lib/Git/SVN/GlobSpec.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/Fetcher.pm >blib/lib/Git/SVN/Fetcher.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/IndexInfo.pm >blib/lib/Git/IndexInfo.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/Ra.pm >blib/lib/Git/SVN/Ra.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/Prompt.pm >blib/lib/Git/SVN/Prompt.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/Utils.pm >blib/lib/Git/SVN/Utils.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 1 - .git/objects should be empty after git init in an empty repo
ok 1 - setup
ok 2 - .git/objects should have 3 subdirectories
ok 3 - success is reported like this
ok 2 - bad setup: invalid .git file format
ok 1 - plain
ok 3 - bad setup: invalid .git file path
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 4 - pretend we have a fully passing test suite
ok 9 - check commit-tree
ok 10 - check rev-list
ok 4 - plain nested through aliased command
ok 11 - setup_git_dir twice in subdir
ok 5 - plain nested in bare through aliased command
ok 5 - pretend we have a partially passing test suite
ok 6 - plain with GIT_WORK_TREE
ok 3 - attribute test
ok 7 - plain bare
ok 8 - plain bare with GIT_WORK_TREE
ok 12 - enter_repo non-strict mode
ok 9 - GIT_DIR bare
ok 6 - pretend we have a known breakage
ok 10 - init --bare
ok 13 - enter_repo linked checkout
ok 11 - GIT_DIR non-bare
ok 14 - enter_repo strict mode
# passed all 14 test(s)
1..14
ok 12 - GIT_DIR & GIT_WORK_TREE (1)
*** t0004-unwritable.sh ***
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 14 - reinit
ok 15 - init with --template
ok 16 - init with --template (blank)
ok 1 - setup
ok 8 - pretend we have fixed one of two known breakages (run in sub test-lib)
ok 17 - init with init.templatedir set
ok 2 - write-tree should notice unwritable repository
ok 3 - commit should notice unwritable repository
ok 5 - attribute matching is case insensitive when core.ignorecase=1
ok 4 - update-index should notice unwritable repository
ok 6 # skip additional case insensitivity tests (missing CASE_INSENSITIVE_FS)
ok 5 - add should notice unwritable repository
# passed all 5 test(s)
1..5
ok 18 - init --bare/--shared overrides system/global config
*** t0005-signals.sh ***
ok 9 - pretend we have a pass, fail, and known breakage
ok 7 - unnormalized paths
ok 19 - init honors global core.sharedRepository
ok 20 - init rejects insanely long --template
ok 21 - init creates a new directory
ok 1 - sigchain works
ok 22 - init creates a new bare directory
ok 2 - signals are propagated using shell convention
ok 23 - init recreates a directory
ok 3 - create blob
ok 10 - pretend we have a mix of all possible results
ok 24 - init recreates a new bare directory
ok 8 - relative paths
ok 4 - a constipated git dies with SIGPIPE
ok 25 - init creates a new deep directory
ok 5 - a constipated git dies with SIGPIPE even if parent ignores it
ok 9 - prefixes are not confused with leading directories
# passed all 5 test(s)
1..5
*** t0006-date.sh ***
ok 26 - init creates a new deep directory (umask vs. shared)
ok 27 - init notices EEXIST (1)
ok 11 - test --verbose
ok 10 - core.attributesfile
ok 28 - init notices EEXIST (2)
ok 11 - attribute test: read paths from stdin
ok 1 - relative date (5 seconds ago)
ok 2 - relative date (5 minutes ago)
ok 3 - relative date (5 hours ago)
ok 29 - init notices EPERM
ok 4 - relative date (5 days ago)
ok 12 - attribute test: --all option
ok 5 - relative date (3 weeks ago)
ok 30 - init creates a new bare directory with global --bare
ok 6 - relative date (5 months ago)
ok 7 - relative date (1 year, 2 months ago)
ok 8 - relative date (1 year, 9 months ago)
ok 31 - init prefers command line to GIT_DIR
ok 12 - test --verbose-only
ok 13 - attribute test: --cached option
ok 9 - relative date (20 years ago)
ok 10 - relative date (12 months ago)
ok 11 - relative date (2 years ago)
ok 14 - root subdir attribute test
ok 32 - init with separate gitdir
ok 12 - parse date (2008)
ok 33 - re-init on .git file
ok 15 - negative patterns
ok 13 - parse date (2008-02)
ok 16 - patterns starting with exclamation
ok 14 - parse date (2008-02-14)
ok 34 - re-init to update git link
ok 15 - parse date (2008-02-14 20:30:45)
ok 16 - parse date (2008-02-14 20:30:45 -0500)
ok 17 - parse date (2008-02-14 20:30:45 -0015)
ok 17 - "**" test
ok 18 - parse date (2008-02-14 20:30:45 -5)
ok 13 - GIT_SKIP_TESTS
ok 19 - parse date (2008-02-14 20:30:45 -5:)
ok 35 - re-init to move gitdir
ok 20 - parse date (2008-02-14 20:30:45 -05)
ok 21 - parse date (2008-02-14 20:30:45 -:30)
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 18 - "**" with no slashes test
ok 24 - parse approxidate (now)
ok 36 - re-init to move gitdir symlink
ok 25 - parse approxidate (5 seconds ago)
# passed all 36 test(s)
1..36
ok 26 - parse approxidate (5.seconds.ago)
ok 27 - parse approxidate (10.minutes.ago)
ok 19 - using --git-dir and --work-tree
ok 28 - parse approxidate (yesterday)
ok 29 - parse approxidate (3.days.ago)
ok 14 - GIT_SKIP_TESTS several tests
ok 30 - parse approxidate (3.weeks.ago)
ok 20 - setup bare
ok 31 - parse approxidate (3.months.ago)
ok 32 - parse approxidate (2.years.3.months.ago)
ok 33 - parse approxidate (6am yesterday)
ok 34 - parse approxidate (6pm yesterday)
ok 35 - parse approxidate (3:00)
ok 36 - parse approxidate (15:00)
ok 21 - bare repository: check that .gitattribute is ignored
*** t0007-git-var.sh ***
ok 37 - parse approxidate (noon today)
ok 38 - parse approxidate (noon yesterday)
ok 22 - bare repository: check that --cached honors index
ok 15 - GIT_SKIP_TESTS sh pattern
ok 39 - parse approxidate (last tuesday)
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 1 - get GIT_AUTHOR_IDENT
ok 44 - parse approxidate (5AM Jun 6)
ok 2 - get GIT_COMMITTER_IDENT
ok 23 - bare repository: test info/attributes
ok 45 - parse approxidate (6AM, June 7, 2009)
# passed all 23 test(s)
1..23
ok 46 - parse approxidate (2008-12-01)
ok 3 # skip requested identites are strict (missing !AUTOIDENT)
ok 47 - parse approxidate (2009-12-01)
# passed all 47 test(s)
1..47
ok 4 - git var -l lists variables
*** t0008-ignores.sh ***
ok 5 - git var -l lists config
*** t0009-prio-queue.sh ***
ok 6 - listing and asking for variables are exclusive
# passed all 6 test(s)
1..6
*** t0010-racy-git.sh ***
ok 16 - --run basic
ok 1 - basic ordering
ok 2 - mixed put and get
ok 3 - notice empty queue
ok 1 - Racy GIT trial #0 part A
# passed all 3 test(s)
1..3
*** t0011-hashmap.sh ***
ok 1 - setup
ok 2 - . corner-case
ok 3 - . corner-case with -q
ok 17 - --run with a range
ok 4 - . corner-case with --quiet
ok 1 - hash functions
ok 5 - . corner-case with -v
ok 2 - put
ok 3 - put (case insensitive)
ok 6 - . corner-case with -v -n
ok 4 - replace
ok 7 - . corner-case with -v --non-matching
ok 5 - replace (case insensitive)
ok 6 - get
ok 8 - . corner-case with --verbose
ok 7 - get (case insensitive)
ok 9 - . corner-case with --verbose -n
ok 8 - add
ok 9 - add (case insensitive)
ok 10 - . corner-case with --verbose --non-matching
ok 10 - remove
ok 11 - remove (case insensitive)
ok 12 - iterate
ok 11 - empty command line
ok 13 - iterate (case insensitive)
ok 18 - --run with two ranges
ok 12 - empty command line with -q
ok 14 - grow / shrink
ok 13 - empty command line with --quiet
ok 15 - string interning
# passed all 15 test(s)
1..15
ok 14 - empty command line with -v
*** t0020-crlf.sh ***
ok 15 - empty command line with -v -n
ok 16 - empty command line with -v --non-matching
ok 17 - empty command line with --verbose
ok 18 - empty command line with --verbose -n
ok 19 - empty command line with --verbose --non-matching
ok 19 - --run with a left open range
ok 20 - --stdin with empty STDIN
ok 2 - Racy GIT trial #0 part B
ok 21 - --stdin with empty STDIN with -q
ok 3 - Racy GIT trial #1 part A
ok 22 - --stdin with empty STDIN with --quiet
ok 1 - setup
ok 23 - --stdin with empty STDIN with -v
ok 2 - safecrlf: autocrlf=input, all CRLF
ok 24 - --stdin with empty STDIN with -v -n
ok 25 - --stdin with empty STDIN with -v --non-matching
ok 3 - safecrlf: autocrlf=input, mixed LF/CRLF
ok 20 - --run with a right open range
ok 26 - --stdin with empty STDIN with --verbose
ok 4 - safecrlf: autocrlf=true, all LF
ok 27 - --stdin with empty STDIN with --verbose -n
ok 28 - --stdin with empty STDIN with --verbose --non-matching
ok 5 - safecrlf: autocrlf=true mixed LF/CRLF
ok 29 - -q with multiple args
ok 30 - --quiet with multiple args
ok 31 - -q -v
ok 6 - safecrlf: print warning only once
ok 32 - --quiet -v
ok 21 - --run with basic negation
ok 7 - safecrlf: git diff demotes safecrlf=true to warn
ok 33 - -q --verbose
ok 34 - --quiet --verbose
ok 8 - switch off autocrlf, safecrlf, reset HEAD
ok 35 - --quiet with multiple args
ok 36 - erroneous use of --
ok 9 - update with autocrlf=input
ok 37 - erroneous use of -- with -q
ok 38 - erroneous use of -- with --quiet
ok 22 - --run with two negations
ok 39 - erroneous use of -- with -v
ok 10 - update with autocrlf=true
ok 40 - erroneous use of -- with -v -n
ok 41 - erroneous use of -- with -v --non-matching
ok 42 - erroneous use of -- with --verbose
ok 4 - Racy GIT trial #1 part B
ok 43 - erroneous use of -- with --verbose -n
ok 11 - checkout with autocrlf=true
ok 5 - Racy GIT trial #2 part A
ok 44 - erroneous use of -- with --verbose --non-matching
ok 45 - --stdin with superfluous arg
ok 23 - --run a range and negation
ok 12 - checkout with autocrlf=input
ok 46 - --stdin with superfluous arg with -q
ok 47 - --stdin with superfluous arg with --quiet
ok 13 - apply patch (autocrlf=input)
ok 48 - --stdin with superfluous arg with -v
ok 49 - --stdin with superfluous arg with -v -n
ok 14 - apply patch --cached (autocrlf=input)
ok 50 - --stdin with superfluous arg with -v --non-matching
ok 51 - --stdin with superfluous arg with --verbose
ok 52 - --stdin with superfluous arg with --verbose -n
ok 15 - apply patch --index (autocrlf=input)
ok 24 - --run range negation
ok 53 - --stdin with superfluous arg with --verbose --non-matching
ok 16 - apply patch (autocrlf=true)
ok 54 - --stdin -z with superfluous arg
ok 55 - --stdin -z with superfluous arg with -q
ok 17 - apply patch --cached (autocrlf=true)
ok 56 - --stdin -z with superfluous arg with --quiet
ok 57 - --stdin -z with superfluous arg with -v
ok 18 - apply patch --index (autocrlf=true)
ok 58 - --stdin -z with superfluous arg with -v -n
ok 59 - --stdin -z with superfluous arg with -v --non-matching
ok 19 - .gitattributes says two is binary
ok 60 - --stdin -z with superfluous arg with --verbose
ok 6 - Racy GIT trial #2 part B
ok 20 - .gitattributes says two is input
ok 61 - --stdin -z with superfluous arg with --verbose -n
ok 25 - --run include, exclude and include
ok 7 - Racy GIT trial #3 part A
ok 21 - .gitattributes says two and three are text
ok 62 - --stdin -z with superfluous arg with --verbose --non-matching
ok 63 - -z without --stdin
ok 22 - in-tree .gitattributes (1)
ok 64 - -z without --stdin with -q
ok 65 - -z without --stdin with --quiet
ok 23 - in-tree .gitattributes (2)
ok 66 - -z without --stdin with -v
ok 67 - -z without --stdin with -v -n
ok 68 - -z without --stdin with -v --non-matching
ok 24 - in-tree .gitattributes (3)
ok 69 - -z without --stdin with --verbose
ok 70 - -z without --stdin with --verbose -n
ok 26 - --run include, exclude and include, comma separated
ok 25 - in-tree .gitattributes (4)
ok 71 - -z without --stdin with --verbose --non-matching
ok 72 - -z without --stdin and superfluous arg
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 - checkout with existing .gitattributes
ok 76 - -z without --stdin and superfluous arg with -v -n
ok 77 - -z without --stdin and superfluous arg with -v --non-matching
ok 27 - --run exclude and include
ok 78 - -z without --stdin and superfluous arg with --verbose
ok 79 - -z without --stdin and superfluous arg with --verbose -n
ok 27 - checkout when deleting .gitattributes
ok 28 - invalid .gitattributes (must not crash)
ok 80 - -z without --stdin and superfluous arg with --verbose --non-matching
ok 81 - needs work tree
ok 8 - Racy GIT trial #3 part B
ok 82 - needs work tree with -q
ok 9 - Racy GIT trial #4 part A
ok 29 - setting up for new autocrlf tests
ok 83 - needs work tree with --quiet
ok 30 - report no change after setting autocrlf
ok 84 - needs work tree with -v
ok 28 - --run empty selectors
ok 31 - files are clean after checkout
ok 32 - LF only file gets CRLF with autocrlf
ok 85 - needs work tree with -v -n
ok 33 - Mixed file is still mixed with autocrlf
ok 34 - CRLF only file has CRLF with autocrlf
ok 86 - needs work tree with -v --non-matching
ok 87 - needs work tree with --verbose
ok 88 - needs work tree with --verbose -n
ok 35 - New CRLF file gets LF in repo
# passed all 35 test(s)
1..35
ok 29 - --run invalid range start
ok 89 - needs work tree with --verbose --non-matching
*** t0021-conversion.sh ***
ok 90 - non-existent file at top-level not ignored
ok 91 - non-existent file at top-level not ignored with -q
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 94 - non-existent file at top-level not ignored with -v -n
ok 30 - --run invalid range end
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 1 - setup
ok 98 - non-existent file at top-level not ignored with --verbose --non-matching
ok 2 - check
ok 99 - non-existent file at top-level not ignored with --no-index
ok 31 - --run invalid selector
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 100 - non-existent file at top-level not ignored with --no-index -q
ok 35 # skip unmet prerequisites causes test to be skipped (missing DONTHAVEIT of HAVEIT,DONTHAVEIT)
ok 36 # skip unmet prerequisites causes test to be skipped (missing DONTHAVEIT of DONTHAVEIT,HAVEIT)
ok 37 - test runs if lazy prereq is satisfied
ok 101 - non-existent file at top-level not ignored with --no-index --quiet
ok 38 # skip missing lazy prereqs skip tests (missing !LAZY_TRUE)
ok 39 - negative lazy prereqs checked
ok 102 - non-existent file at top-level not ignored with --no-index -v
ok 40 # skip missing negative lazy prereqs will skip (missing LAZY_FALSE)
ok 41 - tests clean up after themselves
ok 103 - non-existent file at top-level not ignored with --no-index -v -n
ok 3 - expanded_in_repo
ok 104 - non-existent file at top-level not ignored with --no-index -v --non-matching
ok 105 - non-existent file at top-level not ignored with --no-index --verbose
ok 10 - Racy GIT trial #4 part B
# passed all 10 test(s)
1..10
ok 106 - non-existent file at top-level not ignored with --no-index --verbose -n
*** t0022-crlf-rename.sh ***
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 42 - tests clean up even on failures
ok 43 - git update-index without --add should fail adding
ok 44 - git update-index with --add should succeed
ok 109 - non-existent file at top-level ignored with -q
ok 45 - writing tree out with git write-tree
ok 46 - validate object ID of a known tree
ok 4 - filter shell-escaped filenames
ok 47 - git update-index without --remove should fail removing
ok 110 - non-existent file at top-level ignored with --quiet
ok 48 - git update-index with --remove should be able to remove
ok 49 - git write-tree should be able to write an empty tree
ok 50 - validate object ID of a known tree
ok 111 - non-existent file at top-level ignored with -v
ok 1 - setup
ok 112 - non-existent file at top-level ignored with -v -n
ok 2 - diff -M
ok 113 - non-existent file at top-level ignored with -v --non-matching
# passed all 2 test(s)
1..2
ok 5 - required filter should filter data
ok 114 - non-existent file at top-level ignored with --verbose
*** t0023-crlf-am.sh ***
ok 115 - non-existent file at top-level ignored with --verbose -n
ok 51 - adding various types of objects with git update-index --add
ok 116 - non-existent file at top-level ignored with --verbose --non-matching
ok 52 - showing stage with git ls-files --stage
ok 53 - validate git ls-files output for a known tree
ok 6 - required filter smudge failure
ok 54 - writing tree out with git write-tree
ok 55 - validate object ID for a known tree
ok 117 - non-existent file at top-level ignored with --no-index
ok 56 - showing tree with git ls-tree
ok 57 - git ls-tree output for a known tree
ok 58 - showing tree with git ls-tree -r
ok 118 - non-existent file at top-level ignored with --no-index -q
ok 7 - required filter clean failure
ok 59 - git ls-tree -r output for a known tree
ok 1 - setup
ok 60 - showing tree with git ls-tree -r -t
ok 119 - non-existent file at top-level ignored with --no-index --quiet
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 120 - non-existent file at top-level ignored with --no-index -v
ok 64 - writing partial tree out with git write-tree --prefix
ok 65 - validate object ID for a known tree
ok 121 - non-existent file at top-level ignored with --no-index -v -n
ok 66 - put invalid objects into the index
ok 2 - am
# passed all 2 test(s)
1..2
ok 67 - writing this tree without --missing-ok
ok 122 - non-existent file at top-level ignored with --no-index -v --non-matching
ok 68 - writing this tree with --missing-ok
*** t0024-crlf-archive.sh ***
ok 123 - non-existent file at top-level ignored with --no-index --verbose
ok 69 - git read-tree followed by write-tree should be idempotent
ok 124 - non-existent file at top-level ignored with --no-index --verbose -n
ok 70 - validate git diff-files output for a know cache/work tree state
ok 125 - non-existent file at top-level ignored with --no-index --verbose --non-matching
ok 71 - git update-index --refresh should succeed
ok 72 - no diff after checkout and git update-index --refresh
ok 126 - existing untracked file at top-level not ignored
ok 73 - git commit-tree records the correct tree in a commit
ok 127 - existing untracked file at top-level not ignored with -q
ok 1 - setup
ok 128 - existing untracked file at top-level not ignored with --quiet
ok 74 - git commit-tree records the correct parent in a commit
ok 2 - tar archive
ok 129 - existing untracked file at top-level not ignored with -v
ok 75 - git commit-tree omits duplicated parent in a commit
ok 130 - existing untracked file at top-level not ignored with -v -n
ok 3 - zip archive
ok 131 - existing untracked file at top-level not ignored with -v --non-matching
# passed all 3 test(s)
1..3
ok 76 - update-index D/F conflict
ok 132 - existing untracked file at top-level not ignored with --verbose
*** t0025-crlf-auto.sh ***
ok 133 - existing untracked file at top-level not ignored with --verbose -n
ok 77 - very long name in the index handled sanely
# passed all 77 test(s)
1..77
ok 134 - existing untracked file at top-level not ignored with --verbose --non-matching
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 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 139 - existing untracked file at top-level not ignored with --no-index -v -n
ok 1 - setup
*** t0026-eol-config.sh ***
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 142 - existing untracked file at top-level not ignored with --no-index --verbose -n
ok 2 - default settings cause no changes
ok 143 - existing untracked file at top-level not ignored with --no-index --verbose --non-matching
not ok 3 - crlf=true causes a CRLF file to be normalized
#	
#	
#		# 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 144 - existing tracked file at top-level not ignored
ok 145 - existing tracked file at top-level not ignored with -q
ok 4 - text=true causes a CRLF file to be normalized
ok 1 - setup
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 5 - eol=crlf gives a normalized file CRLFs with autocrlf=false
ok 148 - existing tracked file at top-level not ignored with -v -n
ok 149 - existing tracked file at top-level not ignored with -v --non-matching
ok 2 - eol=lf puts LFs in normalized file
ok 6 - eol=crlf gives a normalized file CRLFs with autocrlf=input
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 7 - eol=lf gives a normalized file LFs with autocrlf=true
ok 3 - eol=crlf puts CRLFs in normalized file
ok 152 - existing tracked file at top-level not ignored with --verbose --non-matching
ok 153 - existing tracked file at top-level shown as ignored with --no-index
ok 8 - autocrlf=true does not normalize CRLF files
ok 4 - autocrlf=true overrides eol=lf
ok 154 - existing tracked file at top-level shown as ignored with --no-index -q
ok 155 - existing tracked file at top-level shown as ignored with --no-index --quiet
ok 156 - existing tracked file at top-level shown as ignored with --no-index -v
ok 9 - text=auto, autocrlf=true _does_ normalize CRLF files
ok 5 - autocrlf=true overrides unset eol
ok 6 # skip eol native is crlf (missing NATIVE_CRLF)
ok 157 - existing tracked file at top-level shown as ignored with --no-index -v -n
# passed all 6 test(s)
1..6
ok 158 - existing tracked file at top-level shown as ignored with --no-index -v --non-matching
ok 10 - text=auto, autocrlf=true does not normalize binary files
*** t0027-auto-crlf.sh ***
ok 159 - existing tracked file at top-level shown as ignored with --no-index --verbose
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 160 - existing tracked file at top-level shown as ignored with --no-index --verbose -n
ok 161 - existing tracked file at top-level shown as ignored with --no-index --verbose --non-matching
1..0 # SKIP EXPENSIVE not set
ok 162 - existing untracked file at top-level ignored
ok 8 - filtering large input to small output should use little memory
ok 163 - existing untracked file at top-level ignored with -q
ok 164 - existing untracked file at top-level ignored with --quiet
ok 165 - existing untracked file at top-level ignored with -v
ok 9 - filter that does not read is fine
ok 10 # skip filter large file (missing EXPENSIVE)
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 168 - existing untracked file at top-level ignored with --verbose
ok 11 - filter: clean empty file
ok 169 - existing untracked file at top-level ignored with --verbose -n
ok 170 - existing untracked file at top-level ignored with --verbose --non-matching
ok 12 - filter: smudge empty file
# passed all 12 test(s)
1..12
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 173 - existing untracked file at top-level ignored with --no-index --quiet
ok 174 - existing untracked file at top-level ignored with --no-index -v
ok 175 - existing untracked file at top-level ignored with --no-index -v -n
ok 176 - existing untracked file at top-level ignored with --no-index -v --non-matching
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 179 - existing untracked file at top-level ignored with --no-index --verbose --non-matching
ok 180 - mix of file types at top-level
ok 181 - mix of file types at top-level with -v
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 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 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 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 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 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 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 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 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 212 - non-existent file in subdir a/ ignored
ok 213 - non-existent file in subdir a/ ignored with -q
ok 214 - non-existent file in subdir a/ ignored with --quiet
ok 215 - non-existent file in subdir a/ ignored with -v
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 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 221 - non-existent file in subdir a/ ignored with --no-index
ok 222 - non-existent file in subdir a/ ignored with --no-index -q
ok 223 - non-existent file in subdir a/ ignored with --no-index --quiet
ok 224 - non-existent file in subdir a/ ignored with --no-index -v
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:2222: 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-relink
    GEN git-send-email
    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 ***
*** t0002-gitfile.sh ***
*** t0003-attributes.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0000-basic/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0003-attributes/.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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0002-gitfile/.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

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

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

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

ok 1 - initial setup

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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/plain/.git/
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

ok 2 - .git/objects should have 3 subdirectories

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

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>...]

    -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

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

    -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>...]

    -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 4 - final setup + check rev-parse --git-dir

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

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

    -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>...]

    -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: No attribute specified
usage: git check-attr [-a | --all | <attr>...] [--] <pathname>...
   or: git check-attr --stdin [-z] [-a | --all | <attr>...]

    -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>...]

    -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
	fi &&
	objck $SHA

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

    -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: : not a valid attribute name
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 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 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 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

expecting success: 
	git init sgd &&
	(
		cd sgd &&
		git config alias.lsfi ls-files &&
		mv .git .realgit &&
		echo "gitdir: .realgit" >.git &&
		mkdir subdir &&
		cd subdir &&
		>foo &&
		git add foo &&
		git lsfi >actual &&
		echo foo >expected &&
		test_cmp expected actual
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0002-gitfile/sgd/.git/
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

ok 11 - setup_git_dir twice in subdir

expecting success: 
	test_create_repo enter_repo &&
	(
		cd enter_repo &&
		test_tick &&
		test_commit foo &&
		mv .git .realgit &&
		echo "gitdir: .realgit" >.git
	) &&
	git ls-remote enter_repo >actual &&
	cat >expected <<-\EOF &&
	946e985ab20de757ca5b872b16d64e92ff3803a9	HEAD
	946e985ab20de757ca5b872b16d64e92ff3803a9	refs/heads/master
	946e985ab20de757ca5b872b16d64e92ff3803a9	refs/tags/foo
	EOF
	test_cmp expected actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/bare-ancestor-aliased.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0002-gitfile/enter_repo/.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/
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

[master (root-commit) 946e985] foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo.t
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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/plain-bare-1/
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"


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

ok 12 - enter_repo non-strict mode

expecting success: 
	(
		cd enter_repo &&
		git worktree add  ../foo refs/tags/foo
	) &&
	git ls-remote foo >actual &&
	cat >expected <<-\EOF &&
	946e985ab20de757ca5b872b16d64e92ff3803a9	HEAD
	946e985ab20de757ca5b872b16d64e92ff3803a9	refs/heads/master
	946e985ab20de757ca5b872b16d64e92ff3803a9	refs/tags/foo
	EOF
	test_cmp expected actual

--- expect	2015-12-16 10:48:12.957564762 +0000
+++ actual	2015-12-16 10:48:12.957564762 +0000
@@ -1 +1 @@
-F: test: f
+F: test: unspecified
Preparing ../foo (identifier foo)
--- expect	2015-12-16 10:48:12.993564762 +0000
+++ actual	2015-12-16 10:48:12.989564762 +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

--- expect	2015-12-16 10:48:13.025564762 +0000
+++ actual	2015-12-16 10:48:13.021564762 +0000
@@ -1 +1 @@
-a/c/F: test: f
+a/c/F: test: unspecified
HEAD is now at 946e985 foo
--- expect	2015-12-16 10:48:13.049564762 +0000
+++ actual	2015-12-16 10:48:13.049564762 +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/
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-12-16 10:48:13.077564762 +0000
+++ actual	2015-12-16 10:48:13.077564762 +0000
@@ -1 +1 @@
-a/B/g: test: a/b/g
+a/B/g: test: a/g
ok 9 - GIT_DIR bare

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

ok 13 - enter_repo linked checkout

expecting success: 
	git ls-remote --upload-pack="git upload-pack --strict" foo/.git >actual &&
	cat >expected <<-\EOF &&
	946e985ab20de757ca5b872b16d64e92ff3803a9	HEAD
	946e985ab20de757ca5b872b16d64e92ff3803a9	refs/heads/master
	946e985ab20de757ca5b872b16d64e92ff3803a9	refs/tags/foo
	EOF
	test_cmp expected actual

--- expect	2015-12-16 10:48:13.113564762 +0000
+++ actual	2015-12-16 10:48:13.109564762 +0000
@@ -1 +1 @@
-a/b/G: test: a/b/g
+a/b/G: test: unspecified
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/init-bare.git/
--- expect	2015-12-16 10:48:13.149564762 +0000
+++ actual	2015-12-16 10:48:13.145564762 +0000
@@ -1 +1 @@
-a/b/H: test: a/b/h
+a/b/H: test: unspecified
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 14 - enter_repo strict mode

--- expect	2015-12-16 10:48:13.181564762 +0000
+++ actual	2015-12-16 10:48:13.177564762 +0000
@@ -1 +1 @@
-a/b/D/g: test: a/b/d/*
+a/b/D/g: test: a/g
# passed all 14 test(s)
1..14
--- expect	2015-12-16 10:48:13.213564762 +0000
+++ actual	2015-12-16 10:48:13.213564762 +0000
@@ -1 +1 @@
-oNoFf: test: unset
+oNoFf: test: unspecified
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/non-bare/.git/
--- expect	2015-12-16 10:48:13.241564762 +0000
+++ actual	2015-12-16 10:48:13.241564762 +0000
@@ -1 +1 @@
-oFfOn: test: set
+oFfOn: test: unspecified
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)"

*** t0004-unwritable.sh ***
--- expect	2015-12-16 10:48:13.309564762 +0000
+++ actual	2015-12-16 10:48:13.305564762 +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

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

--- expect	2015-12-16 10:48:13.377564762 +0000
+++ actual	2015-12-16 10:48:13.377564762 +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

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


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

[master (root-commit) 1bd44cb] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/template-custom/.git/
ok 15 - init with --template

ok 1 - setup

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

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

)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/template-plain/.git/
rm: cannot remove 'SANETESTD.1/x': Permission denied
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 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

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

error: insufficient permission for adding an object to repository database .git/objects
fatal: git-write-tree: error building trees
ok 2 - write-tree should notice unwritable repository

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/templatedir-set/.git/
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 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)

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
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

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 4 - update-index should notice unwritable repository

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 shared Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/init-bare-shared-override/
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 - 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

)
ok 5 - add should notice unwritable repository

# passed all 5 test(s)
1..5
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

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

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)

*** t0005-signals.sh ***
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 19 - init honors global core.sharedRepository

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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0005-signals/.git/
fatal: insanely long template path x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001x
ok 20 - init rejects insanely long --template

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

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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/newdir/.git/
Terminated
ok 21 - init creates a new directory

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

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/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 - 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

three
two
one
error: exec test-sigchain died of signal 15
ok 2 - signals are propagated using shell convention

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

ok 3 - create blob

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

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

ok 4 - a constipated git dies with SIGPIPE

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

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/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 5 - a constipated git dies with SIGPIPE even if parent ignores it

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

# passed all 5 test(s)
1..5
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/newdir/a/b/c/.git/
ok 25 - init creates a new deep directory

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
	)

*** t0006-date.sh ***
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

Initialized empty shared Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/newdir/a/b/c/
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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0006-date/.git/
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

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

expecting success: 
	test-date show 1251659995 >actual &&
	test_i18ncmp expect actual
	
ok 11 - attribute test: read paths from stdin

fatal: cannot mkdir newdir/a/b: File exists
ok 1 - relative date (5 seconds ago)
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


expecting success: 
	test-date show 1251659700 >actual &&
	test_i18ncmp expect actual
	
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 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
	
rm: cannot remove 'SANETESTD.1/x': Permission deniedok 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
	)

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)

prerequisite SANITY ok
expecting success: 
	rm -fr newdir &&
	mkdir newdir &&
	chmod -w newdir &&
	test_must_fail git init newdir/a/b

expecting success: 
	test-date show 1238660000 >actual &&
	test_i18ncmp expect actual
	
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 6 - relative date (5 months ago)

expecting success: 
	test-date show 1214160000 >actual &&
	test_i18ncmp 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 7 - relative date (1 year, 2 months ago)

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

ok 30 - init creates a new bare directory with global --bare

expecting success: 
	test-date show 621660000 >actual &&
	test_i18ncmp expect actual
	
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 9 - relative date (20 years ago)

expecting success: 
	test-date show 1220210400 >actual &&
	test_i18ncmp expect actual
	
ok 13 - attribute test: --cached option

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

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/
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 12 - parse date (2008)

expecting success: 
	TZ=UTC test-date parse '2008-02' >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

!f: test: unspecified
ok 13 - parse date (2008-02)

expecting success: 
	TZ=UTC test-date parse '2008-02-14' >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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/realgitdir/
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 32 - init with separate gitdir

expecting success: 
	( cd newdir && git init )

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 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
	
Reinitialized existing Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/realgitdir/
ok 33 - re-init on .git file

ok 16 - patterns starting with exclamation

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: 
	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

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
	
Reinitialized existing Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/surrealgitdir/
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 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 Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/newdir/.git/
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 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

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

Reinitialized existing Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/realgitdir/
expecting success: 
	TZ=UTC test-date parse '2008-02-14 20:30:45 -:30' >actual &&
	test_cmp expect actual
	
ok 35 - re-init to move gitdir

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 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
	
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 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 23 - parse date (2008-02-14 20:30:45 TZ=EST5)

expecting success: 
	test-date approxidate 'now' >actual &&
	test_cmp expect actual
	
ok 24 - parse approxidate (now)

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

expecting success: 
	test-date approxidate '5.seconds.ago' >actual &&
	test_cmp expect actual
	
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
	)

ok 26 - parse approxidate (5.seconds.ago)

expecting success: 
	test-date approxidate '10.minutes.ago' >actual &&
	test_cmp expect actual
	
Reinitialized existing Git repository in /«PKGBUILDDIR»/t/trash directory.t0001-init/realgitdir/
ok 36 - re-init to move gitdir symlink
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"
	)

# passed all 36 test(s)
1..36
ok 27 - parse approxidate (10.minutes.ago)

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

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

expecting success: 
	test-date approxidate '3.weeks.ago' >actual &&
	test_cmp expect actual
	
ok 19 - using --git-dir and --work-tree

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

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

expecting success: 
	test-date approxidate '3.months.ago' >actual &&
	test_cmp expect actual
	
Cloning into bare repository 'bare.git'...
ok 31 - parse approxidate (3.months.ago)

expecting success: 
	test-date approxidate '2.years.3.months.ago' >actual &&
	test_cmp expect actual
	
ok 32 - parse approxidate (2.years.3.months.ago)

expecting success: 
	test-date approxidate '6am yesterday' >actual &&
	test_cmp expect actual
	
warning: You appear to have cloned an empty repository.
done.
ok 33 - parse approxidate (6am yesterday)

expecting success: 
	test-date approxidate '6pm yesterday' >actual &&
	test_cmp expect actual
	
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
	)

ok 34 - parse approxidate (6pm yesterday)

expecting success: 
	test-date approxidate '3:00' >actual &&
	test_cmp expect actual
	
ok 35 - parse approxidate (3:00)

expecting success: 
	test-date approxidate '15:00' >actual &&
	test_cmp expect actual
	
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 36 - parse approxidate (15:00)

expecting success: 
	test-date approxidate 'noon today' >actual &&
	test_cmp expect actual
	
ok 37 - parse approxidate (noon today)

expecting success: 
	test-date approxidate 'noon yesterday' >actual &&
	test_cmp expect actual
	
*** t0007-git-var.sh ***
ok 38 - parse approxidate (noon yesterday)

expecting success: 
	test-date approxidate 'last tuesday' >actual &&
	test_cmp expect actual
	
ok 39 - parse approxidate (last tuesday)

expecting success: 
	test-date approxidate 'July 5th' >actual &&
	test_cmp expect actual
	
ok 40 - parse approxidate (July 5th)

expecting success: 
	test-date approxidate '06/05/2009' >actual &&
	test_cmp expect actual
	
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
	)

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

expecting success: 
	test-date approxidate '06.05.2009' >actual &&
	test_cmp expect actual
	
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.t0007-git-var/.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
	)

ok 43 - parse approxidate (Jun 6, 5AM)

expecting success: 
	test-date approxidate '5AM Jun 6' >actual &&
	test_cmp expect actual
	
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 44 - parse approxidate (5AM Jun 6)

expecting success: 
	test-date approxidate '6AM, June 7, 2009' >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 45 - parse approxidate (6AM, June 7, 2009)

expecting success: 
	test-date approxidate '2008-12-01' >actual &&
	test_cmp expect actual
	
ok 2 - get GIT_COMMITTER_IDENT

ok 46 - parse approxidate (2008-12-01)

expecting success: 
	test-date approxidate '2009-12-01' >actual &&
	test_cmp expect 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

)
ok 47 - parse approxidate (2009-12-01)

Debian build daemon <buildd@testbuildd.raspbian.org> 1112912053 -0700
prerequisite AUTOIDENT ok
skipping test: requested identites are strict 
	(
		sane_unset GIT_COMMITTER_NAME &&
		sane_unset GIT_COMMITTER_EMAIL &&
		test_must_fail git var GIT_COMMITTER_IDENT
	)

ok 3 # skip requested identites are strict (missing !AUTOIDENT)

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

# passed all 47 test(s)
1..47
*** t0008-ignores.sh ***
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

ok 23 - bare repository: test info/attributes

# passed all 23 test(s)
1..23
ok 5 - git var -l lists config

expecting success: 
	test_must_fail git var -l GIT_COMMITTER_IDENT

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

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

# passed all 6 test(s)
1..6
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0008-ignores/.git/
*** t0009-prio-queue.sh ***
*** t0010-racy-git.sh ***
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

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
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0009-prio-queue/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0008-ignores/a/submodule/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0010-racy-git/.git/
expecting success: 
	test-prio-queue 2 6 3 10 9 5 7 4 5 8 1 dump >actual &&
	test_cmp expect actual

ok 1 - basic ordering

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

[master (root-commit) 68ebdf2] commit in submodule
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a
expecting success: test "" != "$files"
ok 1 - Racy GIT trial #0 part A

ok 2 - mixed put and get

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

ok 3 - notice empty queue

# passed all 3 test(s)
1..3
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

ok 1 - setup

*** t0011-hashmap.sh ***
expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 2 - . corner-case

expecting success: 
			expect '' &&
			
	test_check_ignore . 1

		
ok 3 - . corner-case with -q

expecting success: 
			expect '' &&
			
	test_check_ignore . 1

		
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0011-hashmap/.git/
ok 4 - . corner-case with --quiet

expecting success: 
				expect '' &&
				
	test_check_ignore . 1

			
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 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 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"


ok 2 - put

expecting success: 

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


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

expecting success: 
				expect '' &&
				
	test_check_ignore . 1

			
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"


ok 8 - . corner-case with --verbose

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

			
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"


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

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

			
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 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

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

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"


expecting success: 
		expect "$expect" &&
		eval "$code"
	
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 11 - empty command line

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


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"


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 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


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 13 - empty command line with --quiet

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

			
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 14 - grow / shrink

expecting success: 

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


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 15 - string interning

# passed all 15 test(s)
1..15
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: 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"

			
*** t0020-crlf.sh ***
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"

			
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0020-crlf/.git/
fatal: no path specified
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 19 - empty command line with --verbose --non-matching

expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 20 - --stdin with empty STDIN

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

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 21 - --stdin with empty STDIN with -q

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

		
[master (root-commit) 41add3b] 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 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

ok 22 - --stdin with empty STDIN with --quiet

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

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

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

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

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

			
ok 1 - setup

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 25 - --stdin with empty STDIN with -v --non-matching

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

			
ok 26 - --stdin with empty STDIN with --verbose

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

			
fatal: CRLF would be replaced by LF in allcrlf.
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

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

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

			
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

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"

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

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: --quiet is only valid with a single pathname
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"

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: 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: 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'
		
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'
		
[master e57d128] nowarn
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+)
 create mode 100644 doublewarn
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'
		
ok 6 - safecrlf: print warning only once

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

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"

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: --quiet is only valid with a single pathname
ok 35 - --quiet with multiple args

expecting success: 
		expect "$expect" &&
		eval "$code"
	
HEAD is now at 41add3b initial
ok 8 - switch off autocrlf, safecrlf, reset HEAD

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"


fatal: no path specified
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

ok 36 - erroneous use of --

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

		
fatal: no path specified
ok 37 - erroneous use of -- with -q

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

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

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

			
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 39 - erroneous use of -- with -v

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

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

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

			
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"

			
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: 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

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"

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

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

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

expecting success: 
		expect "$expect" &&
		eval "$code"
	
fatal: cannot specify pathnames with --stdin
ok 11 - checkout with autocrlf=true

ok 45 - --stdin with superfluous arg

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"

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

		
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"

		
t0020-crlf.sh: 8: eval: cannot open two: No such file
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 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 48 - --stdin with superfluous arg with -v

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

			
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"

			
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)

ok 24 - --run range negation

fatal: cannot specify pathnames with --stdin
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 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"

			
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 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)

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"

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

expecting success: 
		expect "$expect" &&
		eval "$code"
	
fatal: cannot specify pathnames with --stdin
ok 54 - --stdin -z with superfluous arg
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)"

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 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 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 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)"

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"

			
ok 25 - --run include, exclude and include

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: 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"

			
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"

			
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 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 19 - .gitattributes says two is binary

fatal: cannot specify pathnames with --stdin
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

ok 62 - --stdin -z with superfluous arg with --verbose --non-matching

expecting success: 
		expect "$expect" &&
		eval "$code"
	
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

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

fatal: -z only makes sense with --stdin
ok 63 - -z without --stdin

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

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

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"

		
[master 3ee77c8] 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 65 - -z without --stdin with --quiet

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 22 - in-tree .gitattributes (1)

ok 66 - -z without --stdin with -v

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: 
				expect '' &&
				
	test_check_ignore "-z" 128 &&
	stderr_contains "fatal: -z only makes sense with --stdin"

			
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 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

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

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

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 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

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"
	
ok 25 - in-tree .gitattributes (4)

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)" = ""


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

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"

		
[master 7fd7693] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
fatal: -z only makes sense with --stdin
ok 74 - -z without --stdin and superfluous arg with --quiet

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

			
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

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"

			
[master b6d33b1] 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 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"

			
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 7fd7693... initial
Previous HEAD position was 7fd7693... initial
Switched to branch 'master'
fatal: -z only makes sense with --stdin
ok 77 - -z without --stdin and superfluous arg with -v --non-matching

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

			
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 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"

			
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"

			
[master df647ca] 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 b6d33b1... second
M	three
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"
	
Previous HEAD position was b6d33b1... 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
diff --git a/three b/three
index 98efc5e..c5c386a 100644
Binary files a/three and b/three differ
fatal: This operation must be run in a work tree
ok 81 - needs work tree

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

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

		
ok 28 - --run empty selectors

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

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"

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

[master b9451be] 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 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"

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

ok 29 - setting up for new autocrlf tests

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

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 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"

			
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

ok 31 - files are clean after checkout

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

ok 32 - LF only file gets CRLF with autocrlf

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

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

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

			
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"

			
[master a56ad6b] alllf2 added
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+)
 create mode 100644 alllf2
fatal: This operation must be run in a work tree
ok 89 - needs work tree with --verbose --non-matching

expecting success: 
		expect "$expect" &&
		eval "$code"
	
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

expecting success: 
			expect '' &&
			test_check_ignore 'non-existent' 1
		
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 91 - non-existent file at top-level not ignored with -q

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

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

ok 31 - --run invalid selector

expecting success: 
				expect '::	non-existent' &&
				test_check_ignore 'non-existent' 1
			
expecting success: 
	test_have_prereq HAVEIT &&
	haveit=yes

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: 
	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
ok 97 - non-existent file at top-level not ignored with --verbose -n


mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&true
)
expecting success: 
				expect '::	non-existent' &&
				test_check_ignore 'non-existent' 1
			
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)

checking prerequisite: LAZY_FALSE

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&false
)
ok 98 - non-existent file at top-level not ignored with --verbose --non-matching

prerequisite LAZY_FALSE not satisfied
expecting success: 
	nothavefalse=yes

ok 39 - negative lazy prereqs checked

expecting success: 
		expect "$expect" &&
		eval "$code"
	
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

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

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

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
		
ok 2 - check

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
			
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) 83be45d] 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
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 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 42 - tests clean up even on failures

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

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 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
			
ok 3 - expanded_in_repo

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

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

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" &&
	:

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

ok 45 - writing tree out with git write-tree

expecting success: 
	test "$tree" = 7bb943559a305bdd6bdee2cef6e5df2413c3d30a
    
ok 107 - non-existent file at top-level not ignored with --no-index --verbose --non-matching

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

# passed all 10 test(s)
1..10
expecting success: 
		expect "$expect" &&
		eval "$code"
	
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

*** t0022-crlf-rename.sh ***
ok 48 - git update-index with --remove should be able to remove

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

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

ok 49 - git write-tree should be able to write an empty tree

expecting success: 
	test "$tree" = 4b825dc642cb6eb9a060e54bf8d69288fbee4904

expecting success: 
			expect '' &&
			test_check_ignore 'one'
		
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

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
ok 109 - non-existent file at top-level ignored with -q

expecting success: 
			expect '' &&
			test_check_ignore 'one'
		
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0022-crlf-rename/.git/
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


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

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

expecting success: 
				expect '.gitignore:1:one	one' &&
				test_check_ignore 'one'
			
[master (root-commit) 6ee20c2] Initial
 Author: A U Thor <author@example.com>
 1 file changed, 33 insertions(+)
 create mode 100644 sample
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 51 - adding various types of objects with git update-index --add

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

ok 113 - non-existent file at top-level ignored with -v --non-matching

expecting success: 
				expect '.gitignore:1:one	one' &&
				test_check_ignore 'one'
			
[master d248b45] Second
 Author: A U Thor <author@example.com>
 1 file changed, 33 insertions(+), 33 deletions(-)
 rename sample => elpmas (94%)
ok 1 - setup

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

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


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 53 - validate git ls-files output for a known tree

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

ok 114 - non-existent file at top-level ignored with --verbose

expecting success: 
				expect '.gitignore:1:one	one' &&
				test_check_ignore 'one'
			
ok 2 - diff -M

# 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 115 - non-existent file at top-level ignored with --verbose -n

expecting success: 
				expect '.gitignore:1:one	one' &&
				test_check_ignore 'one'
			
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

*** t0023-crlf-am.sh ***
ok 116 - non-existent file at top-level ignored with --verbose --non-matching

ok 5 - required filter should filter data

ok 58 - showing tree with git ls-tree -r

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

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

expecting success: 
		expect "$expect" &&
		eval "$code"
	
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

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

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

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

expecting success: 
			expect '' &&
			test_check_ignore 'one'
		
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)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0023-crlf-am/.git/
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 118 - non-existent file at top-level ignored with --no-index -q

expecting success: 
			expect '' &&
			test_check_ignore 'one'
		
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 core.autocrlf true &&
	echo foo >bar &&
	git add bar &&
	test_tick &&
	git commit -m initial


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

ok 66 - put invalid objects into the index

expecting success: 
	test_must_fail git write-tree

warning: LF will be replaced by CRLF in bar.
The file will have its original line endings in your working directory.
ok 119 - non-existent file at top-level ignored with --no-index --quiet

expecting success: 
				expect '.gitignore:1:one	one' &&
				test_check_ignore 'one'
			
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

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 120 - non-existent file at top-level ignored with --no-index -v

expecting success: 
				expect '.gitignore:1:one	one' &&
				test_check_ignore 'one'
			
error: external filter false failed 1
error: external filter false failed
fatal: test.fc: clean filter 'failclean' failed
warning: LF will be replaced by CRLF in bar.
The file will have its original line endings in your working directory.
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

[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 121 - non-existent file at top-level ignored with --no-index -v -n

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

expecting success: 
				expect '.gitignore:1:one	one' &&
				test_check_ignore 'one'
			
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

Applying: test1
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 70 - validate git diff-files output for a know cache/work tree state

expecting success: 
	git update-index --refresh

ok 71 - git update-index --refresh should succeed

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

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

expecting success: 
				expect '.gitignore:1:one	one' &&
				test_check_ignore 'one'
			
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"

ok 2 - am

# passed all 2 test(s)
1..2
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 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"

*** t0024-crlf-archive.sh ***
ok 125 - non-existent file at top-level ignored with --no-index --verbose --non-matching

expecting success: 
		expect "$expect" &&
		eval "$code"
	
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

error: duplicate parent f6d63b3f53a780586f4c31f1a602f23063a92842 ignored
ok 126 - existing untracked file at top-level not ignored

expecting success: 
			expect '' &&
			test_check_ignore 'not-ignored' 1
		
ok 127 - existing untracked file at top-level not ignored with -q

ok 75 - git commit-tree omits duplicated parent in a commit

expecting success: 
			expect '' &&
			test_check_ignore 'not-ignored' 1
		
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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0024-crlf-archive/.git/
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 128 - existing untracked file at top-level not ignored with --quiet

expecting success: 
				expect '' &&
				test_check_ignore 'not-ignored' 1
			
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 129 - existing untracked file at top-level not ignored with -v

expecting success: 
				expect '::	not-ignored' &&
				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 1 - setup

expecting success: 

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

	test_cmp sample untarred/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 77 - very long name in the index handled sanely
ok 2 - tar archive


checking prerequisite: UNZIP

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

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

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 5.2.1 20151028 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 132 - existing untracked file at top-level not ignored with --verbose

expecting success: 
				expect '::	not-ignored' &&
				test_check_ignore 'not-ignored' 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
			
Archive:  ../test.zip
4f7f1aaec1ee996d8f5e13c2cfbd43a378578e1f
 extracting: sample                  
ok 3 - zip archive

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

expecting success: 
		expect "$expect" &&
		eval "$code"
	
*** t0025-crlf-auto.sh ***
ok 135 - existing untracked file at top-level not ignored with --no-index

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

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

expecting success: 
				expect '' &&
				test_check_ignore 'not-ignored' 1
			
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0025-crlf-auto/.git/
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
			
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.

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 140 - existing untracked file at top-level not ignored with --no-index -v --non-matching

expecting success: 
				expect '' &&
				test_check_ignore 'not-ignored' 1
			
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0026-eol-config/.git/
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 141 - existing untracked file at top-level not ignored with --no-index --verbose

expecting success: 
				expect '::	not-ignored' &&
				test_check_ignore 'not-ignored' 1
			
[master (root-commit) bbb85a9] 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 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
			
[master (root-commit) fb1998c] 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
ok 143 - existing untracked file at top-level not ignored with --no-index --verbose --non-matching

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"

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"

expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 144 - existing tracked file at top-level not ignored

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

expecting success: 
			expect '' &&
			test_check_ignore 'ignored-but-in-index' 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 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 146 - existing tracked file at top-level not ignored with --quiet

expecting success: 
				expect '' &&
				test_check_ignore 'ignored-but-in-index' 1
			
warning: CRLF will be replaced by LF in CRLFonly.
The file will have its original line endings in your working directory.
ok 147 - existing tracked file at top-level not ignored with -v

ok 3 - crlf=true causes a CRLF file to be normalized

expecting success: 
				expect '::	ignored-but-in-index' &&
				test_check_ignore 'ignored-but-in-index' 1
			
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 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 3 - eol=crlf puts CRLFs in normalized file

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"

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 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 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 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 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

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: 
		expect "$expect" &&
		eval "$code"
	
ok 153 - existing tracked file at top-level shown as ignored with --no-index

ok 5 - autocrlf=true overrides unset eol

expecting success: 
			expect '' &&
			test_check_ignore 'ignored-but-in-index'
		
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)

# passed all 6 test(s)
1..6
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"

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'
		
*** t0027-auto-crlf.sh ***
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'
			
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'
			
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"

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0027-auto-crlf/.git/
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'
			
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
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

1..0 # SKIP EXPENSIVE not set
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'
			
*** t0030-stripspace.sh ***
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'
			
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 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'
			
ok 161 - existing tracked file at top-level shown as ignored with --no-index --verbose --non-matching

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0030-stripspace/.git/
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"

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

expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 162 - existing untracked file at top-level ignored

expecting success: 
			expect '' &&
			test_check_ignore 'ignored-and-untracked'
		
ok 11 - eol=crlf _does_ normalize binary files

# passed all 11 test(s)
1..11
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

ok 163 - existing untracked file at top-level ignored with -q

expecting success: 
			expect '' &&
			test_check_ignore 'ignored-and-untracked'
		
*** t0040-parse-options.sh ***
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'
			
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

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'
			
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 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'
			
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0040-parse-options/.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 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 - test help

expecting success: check boolean: 1 --yes
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 2 - OPT_BOOL() #1

expecting success: check boolean: 1 --no-doubt
ok 169 - existing untracked file at top-level ignored with --verbose -n

expecting success: 
				expect '.gitignore:2:ignored-*	ignored-and-untracked' &&
				test_check_ignore 'ignored-and-untracked'
			
ok 3 - OPT_BOOL() #2

expecting success: check boolean: 1 -D
ok 4 - OPT_BOOL() #3

expecting success: check boolean: 1 --no-fear
ok 170 - existing untracked file at top-level ignored with --verbose --non-matching

ok 5 - OPT_BOOL() #4

expecting success: check boolean: 1 -B
expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 6 - OPT_BOOL() #5

expecting success: check boolean: 1 --yes --yes
ok 171 - existing untracked file at top-level ignored with --no-index

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 7 - OPT_BOOL() is idempotent #1

expecting success: check boolean: 1 -DB
ok 172 - existing untracked file at top-level ignored with --no-index -q

expecting success: 
			expect '' &&
			test_check_ignore 'ignored-and-untracked'
		
ok 8 - OPT_BOOL() is idempotent #2

expecting success: check boolean: 0 -D --no-yes
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 9 - OPT_BOOL() negation #1

expecting success: check boolean: 0 -D --no-no-doubt
ok 10 - OPT_BOOL() negation #2

expecting success: check_unknown_i18n --fear
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 11 - OPT_BOOL() no negation #1

expecting success: check_unknown_i18n --no-no-fear
ok 175 - existing untracked file at top-level ignored with --no-index -v -n

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
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 13 - OPT_BOOL() positivation

expecting success: check integer: -2345 -i -2345
ok 14 - OPT_INT() negative

expecting success: 
	check magnitude: 2345678 -m 2345678

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'
			
ok 15 - OPT_MAGNITUDE() simple

expecting success: 
	check magnitude: 239616 -m 234k

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

expecting success: 
				expect '.gitignore:2:ignored-*	ignored-and-untracked' &&
				test_check_ignore 'ignored-and-untracked'
			
ok 16 - OPT_MAGNITUDE() kilo

expecting success: 
	check magnitude: 104857600 -m 100m

ok 179 - existing untracked file at top-level ignored with --no-index --verbose --non-matching

ok 17 - OPT_MAGNITUDE() mega

expecting success: 
	check magnitude: 1073741824 -m 1g

expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 18 - OPT_MAGNITUDE() giga

expecting success: 
	check magnitude: 3221225472 -m 3g

ok 19 - OPT_MAGNITUDE() 3giga

expecting success: 
	test-parse-options -s123 -b -i 1729 -m 16k -b -vv -n -F my.file \
	>output 2>output.err &&
	test_cmp expect output &&
	test_must_be_empty output.err

ok 180 - mix of file types at top-level

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 20 - short options

expecting success: 
	test-parse-options --boolean --integer 1729 --magnitude 16k \
		--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 181 - mix of file types at top-level with -v

ok 21 - long options

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_expect_code 129 test-parse-options -s &&
	test_expect_code 129 test-parse-options --string &&
	test_expect_code 129 test-parse-options --file

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

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
    -m, --magnitude <n>   get a magnitude
    --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
    -m, --magnitude <n>   get a magnitude
    --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 9 - filter that does not read is fine

checking prerequisite: EXPENSIVE

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

)
error: option `file' 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
    -m, --magnitude <n>   get a magnitude
    --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 22 - 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

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'
		
			
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 23 - 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 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 24 - unambiguously abbreviated option

expecting success: 
	test-parse-options --int=2 > output 2> output.err &&
	test_must_be_empty output.err &&
	test_cmp expect output

ok 25 - unambiguously abbreviated option with "="

expecting success: 
	test_expect_code 129 test-parse-options --strin 123

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'
		
			
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
    --neg-or4             same as --no-or4

    -i, --integer <n>     get a integer
    -j <n>                get a integer, too
    -m, --magnitude <n>   get a magnitude
    --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 26 - ambiguously abbreviated option

expecting success: 
	test-parse-options --st 123 > output 2> output.err &&
	test_must_be_empty output.err &&
	test_cmp expect output

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 27 - 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

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 28 - 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

ok 29 - detect possible typos

expecting success: 
	test-parse-options --quux > 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 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

expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 30 - 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

ok 31 - OPT_DATE() works

ok 12 - filter: smudge empty file

expecting success: 
	test-parse-options --length=four -b -4 > output 2> output.err &&
	test_must_be_empty output.err &&
	test_cmp expect output

ok 187 - mix of file types at top-level with --no-index

# passed all 12 test(s)
1..12
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'
		
			
ok 32 - OPT_CALLBACK() and OPT_BIT() work

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

expecting success: 
	test_must_fail test-parse-options --no-length > output 2> output.err &&
	test_i18ncmp expect output &&
	test_i18ncmp expect.err output.err

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 33 - 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 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 34 - 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

*** t0050-filesystem.sh ***
ok 35 - 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 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'
		
			
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)

ok 36 - 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

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'
		
			
ok 37 - OPT_NEGBIT() works

expecting success: 
	test-parse-options + + + + + + > output 2> output.err &&
	test_must_be_empty output.err &&
	test_cmp expect output

ok 38 - 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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0050-filesystem/.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'
		
			
ok 39 - OPT_NUMBER_CALLBACK() works

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

)
expecting success: 
	test-parse-options --no-ambig >output 2>output.err &&
	test_must_be_empty output.err &&
	test_cmp expect output

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

prerequisite CASE_INSENSITIVE_FS not satisfied
ok 40 - negation of OPT_NONEG flags is not ambiguous

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 193 - mix of file types at top-level with --no-index --verbose --non-matching

expecting success: 
	test-parse-options --list foo --list=bar --list=baz >output &&
	test_cmp expect output

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 41 - --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

expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 42 - --no-list resets list

prerequisite SYMLINKS ok
expecting success: 
	{
		test_must_fail git config --bool core.ignorecase >/dev/null ||
			test $(git config --bool core.ignorecase) = false
	}

# passed all 42 test(s)
1..42
ok 194 - non-existent file in subdir a/ not ignored

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
	}

expecting success: 
			expect '' &&
			test_check_ignore 'a/non-existent' 1
		
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

*** t0055-beyond-symlinks.sh ***
ok 195 - non-existent file in subdir a/ not ignored with -q

expecting success: 
			expect '' &&
			test_check_ignore 'a/non-existent' 1
		
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 196 - non-existent file in subdir a/ not ignored with --quiet

expecting success: 
				expect '' &&
				test_check_ignore 'a/non-existent' 1
			
[master (root-commit) dd53ea6] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 camelcase
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
			
Switched to a new branch 'topic'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0055-beyond-symlinks/.git/
ok 198 - non-existent file in subdir a/ not ignored with -v -n

expecting success: 
				expect '::	a/non-existent' &&
				test_check_ignore 'a/non-existent' 1
			
ok 12 - text plus spaces at end should not show spaces
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

)
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 199 - non-existent file in subdir a/ not ignored with -v --non-matching

expecting success: 
				expect '' &&
				test_check_ignore 'a/non-existent' 1
			
prerequisite SYMLINKS ok
expecting success: 
	>a &&
	mkdir b &&
	ln -s b c &&
	>c/d &&
	git update-index --add a b/d

[topic b6f660e] rename
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename camelcase => CamelCase (100%)
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
			
Switched to branch 'master'
ok 3 - setup case tests

expecting success: 
	git mv camelcase CamelCase &&
	git commit -m "rename"

ok 1 - setup

expecting success: 
	test_must_fail git update-index --add c/d &&
	! ( git ls-files | grep c/d )

error: 'c/d' is beyond a symbolic link
fatal: Unable to process path c/d
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
			
[master b6f660e] rename
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename camelcase => CamelCase (100%)
ok 2 - update-index --add beyond symlinks

ok 4 - rename (case change)

expecting success: 
	rm -f CamelCase &&
	rm -f camelcase &&
	git reset --hard initial &&
	git merge topic

expecting success: 
	test_must_fail git add c/d &&
	! ( git ls-files | grep c/d )

fatal: pathspec 'c/d' is beyond a symbolic link
ok 202 - non-existent file in subdir a/ not ignored with --verbose --non-matching

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

HEAD is now at dd53ea6 initial
expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 3 - add beyond symlinks

Updating dd53ea6..b6f660e
Fast-forward
# passed all 3 test(s)
1..3
 camelcase => CamelCase | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename camelcase => CamelCase (100%)
ok 5 - merge (case change)

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

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 203 - non-existent file in subdir a/ not ignored with --no-index

expecting success: 
			expect '' &&
			test_check_ignore 'a/non-existent' 1
		
*** t0056-git-C.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0050-filesystem/unicode/.git/
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 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)

ok 205 - non-existent file in subdir a/ not ignored with --no-index --quiet

expecting success: 
				expect '' &&
				test_check_ignore 'a/non-existent' 1
			
[master (root-commit) 5b9bcfe] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 "a\314\210"
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
			
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0056-git-C/.git/
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: 
	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

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
			
Switched to a new branch 'topic'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0056-git-C/dir1/.git/
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
			
[topic a11c35e] rename
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename "a\314\210" => "\303\244" (100%)
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 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

[master (root-commit) cf66d21] initial in dir1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a.txt
Switched to branch 'master'
ok 7 - setup unicode normalization tests

expecting success: 
	git mv "$aumlcdiar" "$auml" &&
	git commit -m rename

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 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
	)

ok 211 - non-existent file in subdir a/ not ignored with --no-index --verbose --non-matching

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

[master a11c35e] rename
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename "a\314\210" => "\303\244" (100%)
ok 8 - rename (silent unicode normalization)

expecting success: 
	git reset --hard initial &&
	git merge topic

expecting success: 
		expect "$expect" &&
		eval "$code"
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0056-git-C/dir1/dir2/.git/
HEAD is now at 5b9bcfe initial
ok 17 - consecutive text lines should be unchanged

ok 212 - non-existent file in subdir a/ ignored

expecting success: 
	test ! -z "$(echo "# comment" | git stripspace)" &&
	test -z "$(echo "# comment" | git stripspace -s)"

expecting success: 
			expect '' &&
			test_check_ignore 'a/one'
		
Updating 5b9bcfe..a11c35e
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)

[master (root-commit) 2cbbc49] initial in dir1/dir2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 b.txt
# passed all 9 test(s)
1..9
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 213 - non-existent file in subdir a/ ignored with -q

expecting success: 
			expect '' &&
			test_check_ignore 'a/one'
		
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

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 214 - non-existent file in subdir a/ ignored with --quiet

*** t0060-path-utils.sh ***
expecting success: 
				expect '.gitignore:1:one	a/one' &&
				test_check_ignore 'a/one'
			
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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0056-git-C/c/a.git/
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

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 22 - -c with newline only

expecting success: 
	printf "# foo\n" >expect &&
	printf "foo" | git stripspace -c >actual &&
	test_cmp expect actual

[master (root-commit) 6ec1d3d] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a.txt
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'
			
ok 23 - --comment-lines with single line

expecting success: 
	printf "; foo\n" >expect &&
	printf "foo" | git -c core.commentchar=";" stripspace -c >actual &&
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0060-path-utils/.git/
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 4 - Effect on --git-dir option: "-C c --git-dir=a.git" is equivalent to "--git-dir c/a.git"

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

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 25 - avoid SP-HT sequence in commented line

# passed all 25 test(s)
1..25
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 '')" = ''
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 1 - normalize path:  => 

*** t0061-run-command.sh ***
expecting success: test "$(test-path-utils normalize_path_copy '.')" = ''
ok 2 - normalize path: . => 

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'
			
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

expecting success: test "$(test-path-utils normalize_path_copy './')" = ''
ok 3 - normalize path: ./ => 

expecting success: test "$(test-path-utils normalize_path_copy './.')" = ''
ok 220 - non-existent file in subdir a/ ignored with --verbose --non-matching

ok 4 - normalize path: ./. => 

expecting success: test "$(test-path-utils normalize_path_copy './..')" = '++failed++'
expecting success: 
		expect "$expect" &&
		eval "$code"
	
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: 
	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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0061-run-command/.git/
ok 5 - normalize path: ./.. => ++failed++

expecting success: test "$(test-path-utils normalize_path_copy '../.')" = '++failed++'
expecting success: 
	test-run-command start-command-ENOENT ./does-not-exist

ok 6 - normalize path: ../. => ++failed++

ok 221 - non-existent file in subdir a/ ignored with --no-index

expecting success: test "$(test-path-utils normalize_path_copy './.././/')" = '++failed++'
error: cannot run ./does-not-exist: No such file or directory
expecting success: 
			expect '' &&
			test_check_ignore 'a/one'
		
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 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 7 - normalize path: ./../.// => ++failed++

expecting success: test "$(test-path-utils normalize_path_copy 'dir/..')" = ''
ok 8 - normalize path: dir/.. => 

ok 222 - non-existent file in subdir a/ ignored with --no-index -q

expecting success: 
			expect '' &&
			test_check_ignore 'a/one'
		
expecting success: test "$(test-path-utils normalize_path_copy 'dir/sub/../..')" = ''
ok 2 - run_command can run a command

ok 9 - normalize path: dir/sub/../.. => 

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

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: 
	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

expecting success: test "$(test-path-utils normalize_path_copy 'dir/sub/../../..')" = '++failed++'
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 10 - normalize path: dir/sub/../../.. => ++failed++

fatal: cannot exec './hello.sh': Permission denied
expecting success: test "$(test-path-utils normalize_path_copy 'dir')" = 'dir'
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

)
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 11 - normalize path: dir => dir

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

expecting success: test "$(test-path-utils normalize_path_copy 'dir//')" = 'dir/'
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 12 - normalize path: dir// => dir/

rm: cannot remove 'SANETESTD.1/x': Permission denied
ok 11 - Relative followed by fullpath: "-C ./here -C /there" is equivalent to "-C /there"

expecting success: test "$(test-path-utils normalize_path_copy './dir')" = 'dir'
# passed all 11 test(s)
1..11
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 13 - normalize path: ./dir => dir

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'
			
expecting success: test "$(test-path-utils normalize_path_copy 'dir/.')" = 'dir/'
ok 14 - normalize path: dir/. => dir/

expecting success: test "$(test-path-utils normalize_path_copy 'dir///./')" = 'dir/'
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 15 - normalize path: dir///./ => dir/

expecting success: test "$(test-path-utils normalize_path_copy 'dir//sub/..')" = 'dir/'
ok 4 - unreadable directory in PATH

*** t0062-revision-walking.sh ***
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'
			
# passed all 4 test(s)
1..4
ok 16 - normalize path: dir//sub/.. => dir/

expecting success: test "$(test-path-utils normalize_path_copy 'dir/sub/../')" = 'dir/'
ok 17 - normalize path: dir/sub/../ => dir/

*** t0063-string-list.sh ***
ok 229 - non-existent file in subdir a/ ignored with --no-index --verbose --non-matching

expecting success: test "$(test-path-utils normalize_path_copy 'dir/sub/../.')" = 'dir/'
ok 18 - normalize path: dir/sub/../. => dir/

expecting success: 
		expect "$expect" &&
		eval "$code"
	
expecting success: test "$(test-path-utils normalize_path_copy 'dir/s1/../s2/')" = 'dir/s2/'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0062-revision-walking/.git/
ok 19 - normalize path: dir/s1/../s2/ => dir/s2/

ok 230 - existing untracked file in subdir a/ not ignored

expecting success: test "$(test-path-utils normalize_path_copy 'd1/s1///s2/..//../s3/')" = 'd1/s3/'
expecting success: 
			expect '' &&
			test_check_ignore 'a/not-ignored' 1
		
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 20 - normalize path: d1/s1///s2/..//../s3/ => d1/s3/

expecting success: test "$(test-path-utils normalize_path_copy 'd1/s1//../s2/../../d2')" = 'd2'
ok 231 - existing untracked file in subdir a/ not ignored with -q

expecting success: 
			expect '' &&
			test_check_ignore 'a/not-ignored' 1
		
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0063-string-list/.git/
ok 21 - normalize path: d1/s1//../s2/../../d2 => d2

[master (root-commit) 378779e] add a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a
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'
ok 232 - existing untracked file in subdir a/ not ignored with --quiet

expecting success: 
				expect '' &&
				test_check_ignore 'a/not-ignored' 1
			
ok 22 - normalize path: d1/.../d2 => d1/.../d2

expecting success: test "$(test-path-utils normalize_path_copy 'd1/..././../d2')" = 'd1/d2'
ok 1 - split foo:bar:baz at :, max -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
	
ok 23 - normalize path: d1/..././../d2 => d1/d2

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
			
[master 1a1e17b] 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 '/')" = '/'
ok 1 - setup

expecting success: 
	test-revision-walking run-twice >run_twice_actual &&
	test_cmp run_twice_expected run_twice_actual

ok 24 - normalize path: / => /

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 2 - revision walking can be done twice

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
			
expecting success: test "$(test-path-utils normalize_path_copy '//')" = '/'
# passed all 2 test(s)
1..2
ok 25 - normalize path: // => /

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 235 - existing untracked file in subdir a/ not ignored with -v --non-matching

expecting success: test "$(test-path-utils normalize_path_copy '///')" = '/'
expecting success: 
				expect '' &&
				test_check_ignore 'a/not-ignored' 1
			
ok 26 - normalize path: /// => /

*** t0064-sha1-array.sh ***
expecting success: test "$(test-path-utils normalize_path_copy '/.')" = '/'
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
			
ok 4 - split foo:bar:baz at :, max 2

ok 27 - normalize path: /. => /

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
	
expecting success: test "$(test-path-utils normalize_path_copy '/./')" = '/'
ok 28 - normalize path: /./ => /

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
			
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
	
expecting success: test "$(test-path-utils normalize_path_copy '/./..')" = '++failed++'
ok 29 - normalize path: /./.. => ++failed++

ok 238 - existing untracked file in subdir a/ not ignored with --verbose --non-matching

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0064-sha1-array/.git/
expecting success: test "$(test-path-utils normalize_path_copy '/../.')" = '++failed++'
ok 6 - split  at :, max -1

ok 30 - normalize path: /../. => ++failed++

expecting success: 
		expect "$expect" &&
		eval "$code"
	
expecting success: 
		test-string-list split ':' ':' '-1' >actual &&
		test_cmp expected actual &&
		test-string-list split_in_place ':' ':' '-1' >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

expecting success: test "$(test-path-utils normalize_path_copy '/./.././/')" = '++failed++'
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 31 - normalize path: /./../.// => ++failed++

ok 239 - existing untracked file in subdir a/ not ignored with --no-index

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)"

expecting success: 
			expect '' &&
			test_check_ignore 'a/not-ignored' 1
		
expecting success: test "$(test-path-utils normalize_path_copy '/dir/..')" = '/'
ok 2 - ordered enumeration with duplicate suppression

expecting success: 
	{
		echo20 append 88 44 aa 55 &&
		echo20 lookup 55
	} | test-sha1-array >actual &&
	n=$(cat actual) &&
	test "$n" -eq 1

ok 32 - normalize path: /dir/.. => /

expecting success: test "$(test-path-utils normalize_path_copy '/dir/sub/../..')" = '/'
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 240 - existing untracked file in subdir a/ not ignored with --no-index -q

expecting success: 
			expect '' &&
			test_check_ignore 'a/not-ignored' 1
		
ok 33 - normalize path: /dir/sub/../.. => /

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

expecting success: test "$(test-path-utils normalize_path_copy '/dir/sub/../../..')" = '++failed++'
ok 241 - existing untracked file in subdir a/ not ignored with --no-index --quiet

expecting success: 
				expect '' &&
				test_check_ignore 'a/not-ignored' 1
			
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 34 - normalize path: /dir/sub/../../.. => ++failed++

expecting success: test "$(test-path-utils normalize_path_copy '/dir')" = '/dir'
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 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)"

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
			
ok 35 - normalize path: /dir => /dir

ok 7 - lookup with almost duplicate values

expecting success: 
	{
		echo20 append 55 55 &&
		echo20 lookup 55
	} | test-sha1-array >actual &&
	n=$(cat actual) &&
	test "$n" -ge 0 &&
	test "$n" -le 1

expecting success: test "$(test-path-utils normalize_path_copy '/dir//')" = '/dir/'
ok 36 - normalize path: /dir// => /dir/

ok 243 - existing untracked file in subdir a/ not ignored with --no-index -v -n

ok 8 - lookup with single duplicate value

expecting success: 
				expect '::	a/not-ignored' &&
				test_check_ignore 'a/not-ignored' 1
			
expecting success: test "$(test-path-utils normalize_path_copy '/./dir')" = '/dir'
# passed all 8 test(s)
1..8
ok 37 - normalize path: /./dir => /dir

expecting success: test "$(test-path-utils normalize_path_copy '/dir/.')" = '/dir/'
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
			
*** t0070-fundamental.sh ***
ok 38 - normalize path: /dir/. => /dir/

expecting success: test "$(test-path-utils normalize_path_copy '/dir///./')" = '/dir/'
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 39 - normalize path: /dir///./ => /dir/

expecting success: test "$(test-path-utils normalize_path_copy '/dir//sub/..')" = '/dir/'
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 40 - normalize path: /dir//sub/.. => /dir/

ok 9 - test remove_duplicates

expecting success: test "$(test-path-utils normalize_path_copy '/dir/sub/../')" = '/dir/'
# passed all 9 test(s)
1..9
ok 41 - normalize path: /dir/sub/../ => /dir/

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.t0070-fundamental/.git/
expecting success: test "$(test-path-utils normalize_path_copy '//dir/sub/../.')" = '/dir/'
expecting success: 
		expect "$expect" &&
		eval "$code"
	
*** t0081-line-buffer.sh ***
expecting success: 
	test-ctype

ok 42 - normalize path: //dir/sub/../. => /dir/

expecting success: test "$(test-path-utils normalize_path_copy '/dir/s1/../s2/')" = '/dir/s2/'
ok 1 - character classes (isspace, isalpha etc.)

expecting success: 
	test_must_fail test-mktemp doesnotexist/testXXXXXX 2>err &&
	grep "doesnotexist/test" err

ok 43 - normalize path: /dir/s1/../s2/ => /dir/s2/
ok 248 - existing tracked file in subdir a/ not ignored


fatal: Unable to create temporary file '/«PKGBUILDDIR»/t/trash directory.t0070-fundamental/doesnotexist/testjiXANf': No such file or directory
ok 2 - mktemp to nonexistent directory prints filename

expecting success: 
			expect '' &&
			test_check_ignore 'a/ignored-but-in-index' 1
		
expecting success: test "$(test-path-utils normalize_path_copy '/d1/s1///s2/..//../s3/')" = '/d1/s3/'
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 44 - normalize path: /d1/s1///s2/..//../s3/ => /d1/s3/

expecting success: test "$(test-path-utils normalize_path_copy '/d1/s1//../s2/../../d2')" = '/d2'
rm: cannot remove 'SANETESTD.1/x': Permission denied
ok 249 - existing tracked file in subdir a/ not ignored with -q

expecting success: 
			expect '' &&
			test_check_ignore 'a/ignored-but-in-index' 1
		
ok 45 - normalize path: /d1/s1//../s2/../../d2 => /d2

expecting success: test "$(test-path-utils normalize_path_copy '/d1/.../d2')" = '/d1/.../d2'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0081-line-buffer/.git/
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 46 - normalize path: /d1/.../d2 => /d1/.../d2

ok 250 - existing tracked file in subdir a/ not ignored with --quiet

expecting success: 
				expect '' &&
				test_check_ignore 'a/ignored-but-in-index' 1
			
expecting success: 
	echo ">HELLO" >expect &&
	test-line-buffer <<-\EOF >actual &&
	binary 6
	HELLO
	EOF
	test_cmp expect actual

expecting success: test "$(test-path-utils normalize_path_copy '/d1/..././../d2')" = '/d1/d2'
fatal: Unable to create temporary file '/«PKGBUILDDIR»/t/trash directory.t0070-fundamental/cannotwrite/testxolwhp': Permission denied
ok 47 - normalize path: /d1/..././../d2 => /d1/d2

expecting success: actual=$(test-path-utils longest_ancestor_length '/' '/') &&
	 test "$actual" = '-1'
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 3 - mktemp to unwritable directory prints filename

expecting success: 
	git commit --allow-empty -m message <&-

ok 251 - existing tracked file in subdir a/ not ignored with -v

expecting success: 
				expect '::	a/ignored-but-in-index' &&
				test_check_ignore 'a/ignored-but-in-index' 1
			
ok 48 - longest ancestor: / / => -1

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo' '/') &&
	 test "$actual" = '0'
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

ok 49 - longest ancestor: /foo / => 0

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo' '/fo') &&
	 test "$actual" = '-1'
[master (root-commit) c4e959d] 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 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
			
ok 50 - longest ancestor: /foo /fo => -1

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo' '/foo') &&
	 test "$actual" = '-1'
ok 5 - check for a bug in the regex routines

ok 51 - longest ancestor: /foo /foo => -1

ok 3 - read from file descriptor

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo' '/bar') &&
	 test "$actual" = '-1'
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

# passed all 5 test(s)
1..5
ok 52 - longest ancestor: /foo /bar => -1

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo' '/foo/bar') &&
	 test "$actual" = '-1'
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
			
ok 53 - longest ancestor: /foo /foo/bar => -1

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo' '/foo:/bar') &&
	 test "$actual" = '-1'
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

*** t0090-cache-tree.sh ***
ok 54 - longest ancestor: /foo /foo:/bar => -1

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo' '/:/foo:/bar') &&
	 test "$actual" = '0'
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
			
ok 55 - longest ancestor: /foo /:/foo:/bar => 0

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo' '/foo:/:/bar') &&
	 test "$actual" = '0'
ok 56 - longest ancestor: /foo /foo:/:/bar => 0

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo' '/:/bar:/foo') &&
	 test "$actual" = '0'
ok 5 - read null byte

expecting success: 
	echo ">foo" >expect &&
	test-line-buffer <<-\EOF >actual &&
	binary 5
	foo
	EOF
	test_cmp expect actual

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 57 - longest ancestor: /foo /:/bar:/foo => 0

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo/bar' '/') &&
	 test "$actual" = '0'
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

ok 58 - longest ancestor: /foo/bar / => 0

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo/bar' '/fo') &&
	 test "$actual" = '-1'
ok 256 - existing tracked file in subdir a/ not ignored with --verbose --non-matching

ok 59 - longest ancestor: /foo/bar /fo => -1

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo/bar' '/foo') &&
	 test "$actual" = '4'
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 60 - longest ancestor: /foo/bar /foo => 4

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo/bar' '/foo/ba') &&
	 test "$actual" = '-1'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0090-cache-tree/.git/
expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 8 - long binary reads are truncated

ok 61 - longest ancestor: /foo/bar /foo/ba => -1

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo/bar' '/:/fo') &&
	 test "$actual" = '0'
expecting success: 
	test_commit foo &&
	test_cache_tree

# passed all 8 test(s)
1..8
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 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 257 - existing tracked file in subdir a/ shown as ignored with --no-index

expecting success: 
			expect '' &&
			test_check_ignore 'a/ignored-but-in-index'
		
ok 64 - longest ancestor: /foo/bar /bar => -1

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo/bar' '/fo') &&
	 test "$actual" = '-1'
*** t0100-previous.sh ***
[master (root-commit) ddd63c9] foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo.t
ok 65 - longest ancestor: /foo/bar /fo => -1

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo/bar' '/foo:/bar') &&
	 test "$actual" = '4'
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 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'
		
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 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 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 69 - longest ancestor: /foo/bar /:/bar:/fo => 0

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo/bar' '/:/bar') &&
	 test "$actual" = '0'
ok 70 - longest ancestor: /foo/bar /:/bar => 0

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo/bar' '/foo') &&
	 test "$actual" = '4'
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 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'
			
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0100-previous/.git/
ok 1 - initial commit has cache-tree

expecting success: 
	git read-tree HEAD &&
	test_cache_tree

ok 72 - longest ancestor: /foo/bar /foo:/bar => 4

expecting success: actual=$(test-path-utils longest_ancestor_length '/foo/bar' '/bar') &&
	 test "$actual" = '-1'
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 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)

ok 74 - strip_path_suffix

expecting success: 
	test_must_fail test-path-utils absolute_path ""

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'
			
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 ""

fatal: The empty string is not a valid path
ok 76 - real path rejects the empty string

expecting success: 
	nopath="hopefully-absent-path" &&
	test "/" = "$(test-path-utils real_path "/")" &&
	test "/$nopath" = "$(test-path-utils real_path "/$nopath")"

[master (root-commit) 0ddfaf1] A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 A.t
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 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 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

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'
			
Switched to a new branch 'junk'
ok 78 - real path works on absolute paths 2

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")"

Switched to branch 'master'
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'
			
HEAD is now at ddd63c9 foo
Deleted branch junk (was 0ddfaf1).
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 265 - existing tracked file in subdir a/ shown as ignored with --no-index --verbose --non-matching

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")"

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: 
		expect "$expect" &&
		eval "$code"
	
error: invalid object 040000 59d259507ddf2acc00997a8b70c61d7bdc240440 for 'dirx'
ok 80 - real path removes other extra slashes

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

)
Switched to a new branch 'junk2'
ok 266 - existing untracked file in subdir a/ ignored

HEAD is now at ddd63c9 foo
expecting success: 
			expect '' &&
			test_check_ignore 'a/ignored-and-untracked'
		
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")"

Switched to branch 'master'
ok 4 - git-add in subdir invalidates cache-tree

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 267 - existing untracked file in subdir a/ ignored with -q

expecting success: 
			expect '' &&
			test_check_ignore 'a/ignored-and-untracked'
		
error: branch '@{-12}' not found.
0ddfaf193ff13d6ab39b7cbd9eed645e3ee2f050
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 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'
			
ok 81 - real path works on symlinks

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: 
	ln -s target symlink &&
	test "$(test-path-utils prefix_path prefix "$(pwd)/symlink")" = "symlink"

[master 365c8fc] dir1/a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 dir1/a.t
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 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 83 - prefix_path works with only absolute path to work tree

expecting success: 
	test_must_fail test-path-utils prefix_path prefix "$(pwd)a"

[detached HEAD d9df450] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 B.t
fatal: '/«PKGBUILDDIR»/t/trash directory.t0060-path-utilsa' is outside repository
ok 270 - existing untracked file in subdir a/ ignored with -v -n

ok 84 - prefix_path rejects absolute path to dir with same beginning as work tree

expecting success: 
				expect '.gitignore:2:ignored-*	a/ignored-and-untracked' &&
				test_check_ignore 'a/ignored-and-untracked'
			
expecting success: 
	git init repo &&
	ln -s repo repolink &&
	test "a" = "$(cd repo && test-path-utils prefix_path prefix "$(pwd)/../repolink/a")"

[master 8be4607] dir2/b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 dir2/b.t
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0060-path-utils/repo/.git/
Previous HEAD position was d9df450... B
HEAD is now at 0ddfaf1... A
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 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 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'
			
ok 86 - relative path: /foo/a/b/c/ /foo/a/b/ => c/

[detached HEAD 5dee784] C
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 C.t
expecting success: test "$(test-path-utils relative_path '/foo/a/b/c/' '/foo/a/b')" = 'c/'
error: invalid object 040000 3b5b859722b671676295bf3795f34b8c6f2393f5 for 'dir1'
ok 87 - relative path: /foo/a/b/c/ /foo/a/b => c/

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'
			
expecting success: test "$(test-path-utils relative_path '/foo/a//b//c/' '///foo/a/b//')" = 'c/'
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 274 - existing untracked file in subdir a/ ignored with --verbose --non-matching

[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 89 - relative path: /foo/a/b /foo/a/b => ./

expecting success: 
		expect "$expect" &&
		eval "$code"
	
expecting success: test "$(test-path-utils relative_path '/foo/a/b/' '/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

ok 90 - relative path: /foo/a/b/ /foo/a/b => ./

expecting success: test "$(test-path-utils relative_path '/foo/a' '/foo/a/b')" = '../'
ok 275 - existing untracked file in subdir a/ ignored with --no-index

expecting success: 
			expect '' &&
			test_check_ignore 'a/ignored-and-untracked'
		
ok 91 - relative path: /foo/a /foo/a/b => ../

expecting success: test "$(test-path-utils relative_path '/' '/foo/a/b/')" = '../../../'
Switched to branch 'other'
ok 92 - relative path: / /foo/a/b/ => ../../../

ok 276 - existing untracked file in subdir a/ ignored with --no-index -q

expecting success: 
			expect '' &&
			test_check_ignore 'a/ignored-and-untracked'
		
HEAD is now at ddd63c9 foo
expecting success: test "$(test-path-utils relative_path '/foo/a/c' '/foo/a/b/')" = '../c'
Switched to branch 'master'
ok 93 - relative path: /foo/a/c /foo/a/b/ => ../c

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/c' '/foo/a/b')" = '../c'
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'
			
Merging:
d9df450 B
virtual @{-1}
found 1 common ancestor:
0ddfaf1 A
Merge made by the 'recursive' strategy.
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'
64fd3796c57084e7b8cbae358ce37970b8e954f6
 C.t | 1 +
 D.t | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 C.t
 create mode 100644 D.t
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 95 - relative path: /foo/x/y /foo/a/b/ => ../../x/y

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 '/foo/a/b' '<empty>')" = '/foo/a/b'
ok 96 - relative path: /foo/a/b <empty> => /foo/a/b

Already on 'master'
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'
			
expecting success: test "$(test-path-utils relative_path '/foo/a/b' '<null>')" = '/foo/a/b'
HEAD is now at d9df450 B
ok 97 - relative path: /foo/a/b <null> => /foo/a/b

ok 7 - write-tree establishes cache-tree

expecting success: 
	git read-tree HEAD &&
	test-scrap-cache-tree &&
	test_no_cache_tree

expecting success: test "$(test-path-utils relative_path 'foo/a/b/c/' 'foo/a/b/')" = 'c/'
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'
			
Switched to branch 'other'
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 branch 'master'
ok 99 - relative path: foo/a/b/c/ foo/a/b => c/

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'
			
expecting success: test "$(test-path-utils relative_path 'foo/a/b//c' 'foo/a//b')" = 'c'
ok 8 - test-scrap-cache-tree works

expecting success: 
	test_commit bar &&
	test_cache_tree

ok 100 - relative path: foo/a/b//c foo/a//b => c

Merging:
d9df450 B
virtual @{-1}~1
found 1 common ancestor:
0ddfaf1 A
Merge made by the 'recursive' strategy.
expecting success: test "$(test-path-utils relative_path 'foo/a/b/' 'foo/a/b/')" = './'
 C.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 C.t
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'
			
ok 101 - relative path: foo/a/b/ foo/a/b/ => ./

expecting success: test "$(test-path-utils relative_path 'foo/a/b/' 'foo/a/b')" = './'
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}

[master eeeeed8] bar
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bar.t
ok 102 - relative path: foo/a/b/ foo/a/b => ./

ok 283 - existing untracked file in subdir a/ ignored with --no-index --verbose --non-matching

expecting success: test "$(test-path-utils relative_path 'foo/a' 'foo/a/b')" = '../'
Already on 'master'
ok 103 - relative path: foo/a foo/a/b => ../

expecting success: 
		expect "$expect" &&
		eval "$code"
	
expecting success: test "$(test-path-utils relative_path 'foo/x/y' 'foo/a/b')" = '../../x/y'
ok 104 - relative path: foo/x/y foo/a/b => ../../x/y

HEAD is now at d9df450 B
ok 284 - mix of file types in subdir a/

expecting success: test "$(test-path-utils relative_path 'foo/a/c' 'foo/a/b')" = '../c'
ok 9 - second commit has cache-tree

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: 
	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 105 - relative path: foo/a/c foo/a/b => ../c

expecting success: test "$(test-path-utils relative_path 'foo/a/b' '/foo/x/y')" = 'foo/a/b'
ok 106 - relative path: foo/a/b /foo/x/y => foo/a/b

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'
		
			
Switched to branch 'other'
expecting success: test "$(test-path-utils relative_path '/foo/a/b' 'foo/x/y')" = '/foo/a/b'
Switched to branch 'master'
ok 107 - relative path: /foo/a/b foo/x/y => /foo/a/b

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'
		
			
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)

[master d1075a6] add a file
 Author: A U Thor <author@example.com>
 1 file changed, 8 insertions(+)
 create mode 100644 foo.c
merge: @{-100} - not something we can merge
ok 5 - merge @{-100} before checking out that many branches yet

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)

# passed all 5 test(s)
1..5
expecting success: test "$(test-path-utils relative_path 'foo/a/b' '<empty>')" = 'foo/a/b'
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 110 - relative path: foo/a/b <empty> => foo/a/b

expecting success: test "$(test-path-utils relative_path 'foo/a/b' '<null>')" = 'foo/a/b'
ok 111 - relative path: foo/a/b <null> => foo/a/b

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'
		
			
*** t0101-at-syntax.sh ***
expecting success: test "$(test-path-utils relative_path '<empty>' '/foo/a/b')" = './'
ok 112 - relative path: <empty> /foo/a/b => ./

expecting success: test "$(test-path-utils relative_path '<empty>' '<empty>')" = './'
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 113 - relative path: <empty> <empty> => ./

expecting success: test "$(test-path-utils relative_path '<empty>' '<null>')" = './'
ok 290 - mix of file types in subdir a/ with --verbose --non-matching

ok 114 - relative path: <empty> <null> => ./

expecting success: test "$(test-path-utils relative_path '<null>' '<empty>')" = './'
expecting success: 
		expect "$expect" &&
		eval "$code"
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0101-at-syntax/.git/
ok 115 - relative path: <null> <empty> => ./

expecting success: test "$(test-path-utils relative_path '<null>' '<null>')" = './'
expecting success: 
	test_commit one &&
	test_commit two

ok 291 - mix of file types in subdir a/ with --no-index

ok 116 - relative path: <null> <null> => ./

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'
		
			
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 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'
		
			
[master (root-commit) d79ce16] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
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 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 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'
		
			
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 139b20d] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two.t
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'
		
			
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
	
ok 1 - setup

expecting success: 
	check_at @{0} two

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 2 - @{0} shows current

expecting success: 
	check_at @{1} one

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'
		
			
ok 123 - git-path GIT_INDEX_FILE=foo index2 => .git/index2

expecting success: mkdir foo
ok 3 - @{1} shows old

expecting success: 
	check_at @{now} two

ok 124 - setup fake objects directory foo

expecting success: 
		GIT_OBJECT_DIRECTORY=foo git rev-parse --git-path objects >actual &&
		echo foo >expect &&
		test_cmp expect actual
	
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'
		
			
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
	
ok 4 - @{now} shows current

expecting success: 
	check_at @{2001-09-17} one

warning: Log for 'master' only goes back to Thu, 7 Apr 2005 15:13:13 -0700.
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 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 5 - @{2001-09-17} (before the first commit) shows old

expecting success: 
	check_at @{3.hot.dogs.on.2001-09-17} one

ok 127 - git-path GIT_OBJECT_DIRECTORY=foo objects2 => .git/objects2

expecting success: git --git-dir=bar init
warning: Log for 'master' only goes back to Thu, 7 Apr 2005 15:13:13 -0700.
ok 298 - sub-directory local ignore
ok 6 - silly approxidates work


expecting success: 
	test_must_fail git log -1 --format=%s @{usptream}

expecting success: 
	expect "a/.gitignore:2:*three	a/3-three" &&
	test_check_ignore "--verbose a/3-three a/three-not-this-one"

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
	
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 299 - sub-directory local ignore with --verbose

expecting success: 
	expect "3-three" &&
	(
		cd a &&
		test_check_ignore "3-three three-not-this-one"
	)

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 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 8 - complain about total nonsense

# passed all 8 test(s)
1..8
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
	
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 131 - git-path GIT_COMMON_DIR=bar logs/HEAD => .git/logs/HEAD

expecting success: 
		GIT_COMMON_DIR=bar git rev-parse --git-path objects >actual &&
		echo bar/objects >expect &&
		test_cmp expect actual
	
*** t0110-urlmatch-normalization.sh ***
ok 132 - git-path GIT_COMMON_DIR=bar objects => bar/objects

ok 301 - local ignore inside a sub-directory with --verbose

expecting success: 
		GIT_COMMON_DIR=bar git rev-parse --git-path objects/bar >actual &&
		echo bar/objects/bar >expect &&
		test_cmp expect actual
	
expecting success: 
		expect "$expect" &&
		eval "$code"
	
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
	
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
	
ok 302 - nested include

expecting success: 
			expect '' &&
			
	test_check_ignore "a/b/one"

		
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
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0110-urlmatch-normalization/.git/
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
	
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/"

           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 303 - nested include with -q

expecting success: 
			expect '' &&
			
	test_check_ignore "a/b/one"

		
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 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 304 - nested include with --quiet

expecting success: 
				expect 'a/b/.gitignore:8:!on*	a/b/one' &&
				
	test_check_ignore "a/b/one"

			
           staged     unstaged path
  1:    unchanged        +2/-2 [f]oo.c
Patch update>>            staged     unstaged path
* 1:    unchanged        +2/-2 [f]oo.c
Patch update>> 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
	
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 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 305 - nested include with -v

expecting success: 
				expect 'a/b/.gitignore:8:!on*	a/b/one' &&
				
	test_check_ignore "a/b/one"

			

*** 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.
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 306 - nested include with -v -n

expecting success: 
				expect 'a/b/.gitignore:8:!on*	a/b/one' &&
				
	test_check_ignore "a/b/one"

			
[master 65d7dde] foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
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 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
	
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 144 - git-path GIT_COMMON_DIR=bar shallow => bar/shallow

# passed all 144 test(s)
1..144
ok 308 - nested include with --verbose

expecting success: 
				expect 'a/b/.gitignore:8:!on*	a/b/one' &&
				
	test_check_ignore "a/b/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 309 - nested include with --verbose -n

expecting success: 
				expect 'a/b/.gitignore:8:!on*	a/b/one' &&
				
	test_check_ignore "a/b/one"

			
ok 1 - url 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....:["

*** t0200-gettext-basic.sh ***
[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 310 - nested include with --verbose --non-matching

expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 311 - ignored sub-directory

expecting success: 
			expect '' &&
			
	test_check_ignore "a/b/ignored-dir"

		
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0200-gettext-basic/.git/
ok 11 - commit in child dir has cache-tree

expecting success: 
	test-scrap-cache-tree &&
	git reset --hard &&
	test_cache_tree

ok 312 - ignored sub-directory with -q

expecting success: 
			expect '' &&
			
	test_check_ignore "a/b/ignored-dir"

		
# 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 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

HEAD is now at 0cd4af7 dir/child.t
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 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 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 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 6 - sanity: $TEXTDOMAINDIR exists without NO_GETTEXT=YesPlease

expecting success: 
    test -f "$TEXTDOMAINDIR/is/LC_MESSAGES/git.mo"

ok 7 - sanity: Icelandic locale was compiled

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)

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"

			
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)

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)

ok 12 - reset --hard gives cache-tree

expecting success: 
	rm -f .git/index &&
	git reset --hard &&
	test_cache_tree

# passed all 16 test(s)
1..16
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"

			
ok 2 - url authority

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/"

HEAD is now at 0cd4af7 dir/child.t
*** t0201-gettext-fallbacks.sh ***
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"

			
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"

			
ok 319 - ignored sub-directory with --verbose --non-matching

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"

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0201-gettext-fallbacks/.git/
ok 13 - reset --hard without index gives cache-tree

expecting success: 
	git tag current &&
	git checkout HEAD^ &&
	test_cache_tree

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"

# 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 1 - sanity: $GIT_INTERNAL_GETTEXT_SH_SCHEME is set (to fallthrough)

expecting success: 
    test -n "$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS"

ok 2 - sanity: $GIT_INTERNAL_GETTEXT_TEST_FALLBACKS is set

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
expecting success: 
    echo fallthrough >expect &&
    echo $GIT_INTERNAL_GETTEXT_SH_SCHEME >actual &&
    test_cmp expect actual

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"
	)

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 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 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"
	)

ok 14 - checkout gives cache-tree

expecting success: 
	git checkout current &&
	git checkout -b prev HEAD^ &&
	test_cache_tree

ok 323 - cd to ignored sub-directory with -v

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/"

Previous HEAD position was 65d7dde... foo
HEAD is now at 0cd4af7... dir/child.t
expecting success: 
		expect "$expect" &&
		eval "$code"
	
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

Previous HEAD position was 0cd4af7... dir/child.t
Switched to a new branch 'prev'
ok 324 - symlink

expecting success: 
			expect '' &&
			
	test_check_ignore "a/symlink" 1

		
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 325 - symlink with -q

ok 15 - checkout -b gives cache-tree

expecting success: 
	git checkout current &&
	git checkout -B prev HEAD^ &&
	test_cache_tree

expecting success: 
			expect '' &&
			
	test_check_ignore "a/symlink" 1

		
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 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/?!"

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 326 - symlink with --quiet

expecting success: 
				expect '' &&
				
	test_check_ignore "a/symlink" 1

			
Previous HEAD position was 0cd4af7... dir/child.t
Switched to and reset branch 'prev'
ok 8 - eval_gettext: our eval_gettext() fallback can interpolate variables with spaces and quotes

ok 327 - symlink with -v

expecting success: 
				expect '::	a/symlink' &&
				
	test_check_ignore "a/symlink" 1

			
# passed all 8 test(s)
1..8
ok 5 - url general escapes

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 328 - symlink with -v -n

*** t0202-gettext-perl.sh ***
expecting success: 
				expect '::	a/symlink' &&
				
	test_check_ignore "a/symlink" 1

			
ok 16 - checkout -B gives cache-tree

expecting success: 
	git checkout current &&
	git checkout -b changes &&
	test_commit llamas &&
	test_commit pachyderm &&
	test_cache_tree &&
	git checkout current &&
	test_cache_tree &&
	git merge --ff-only changes &&
	test_cache_tree

ok 329 - symlink with -v --non-matching

expecting success: 
				expect '' &&
				
	test_check_ignore "a/symlink" 1

			
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 330 - symlink with --verbose

expecting success: 
				expect '::	a/symlink' &&
				
	test_check_ignore "a/symlink" 1

			
Switched to a new branch 'changes'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0202-gettext-perl/.git/
ok 331 - symlink with --verbose -n

expecting success: 
				expect '::	a/symlink' &&
				
	test_check_ignore "a/symlink" 1

			
# lib-gettext: No is_IS UTF-8 locale available
# lib-gettext: No is_IS ISO-8859-1 locale available
[changes 7bafa16] llamas
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 llamas.t
ok 332 - symlink with --verbose --non-matching

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"

expecting success: 
		expect "$expect" &&
		eval "$code"
	
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/"

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

[changes 94f8364] pachyderm
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 pachyderm.t
ok 333 - beyond a symlink

expecting success: 
			expect '' &&
			
	test_check_ignore "a/symlink/foo" 128 &&
	test_stderr "fatal: pathspec 'a/symlink/foo' is beyond a symbolic link"

		
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 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 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 336 - beyond a symlink with -v

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
expecting success: 
				expect '' &&
				
	test_check_ignore "a/symlink/foo" 128 &&
	test_stderr "fatal: pathspec 'a/symlink/foo' is beyond a symbolic link"

			
# run 0: Perl Git::I18N API (perl /«PKGBUILDDIR»/t/t0202/test.pl)
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 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 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 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"

			
Updating 0cd4af7..94f8364
Fast-forward
 llamas.t    | 1 +
 pachyderm.t | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 llamas.t
 create mode 100644 pachyderm.t
ok 11 - url equivalents

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"

			
# passed all 11 test(s)
1..11
*** t0203-gettext-setlocale-sanity.sh ***
ok 341 - beyond a symlink with --verbose --non-matching

expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 17 - merge --ff-only maintains cache-tree

expecting success: 
	git checkout current &&
	git checkout -b changes2 &&
	test_commit alpacas &&
	test_cache_tree &&
	git checkout current &&
	test_commit struthio &&
	test_cache_tree &&
	git merge changes2 &&
	test_cache_tree

ok 342 - beyond a symlink from subdirectory

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0203-gettext-setlocale-sanity/.git/
Previous HEAD position was 94f8364... pachyderm
HEAD is now at 0cd4af7... dir/child.t
expecting success: 
			expect '' &&
			
	(
		cd a &&
		test_check_ignore "symlink/foo" 128
	) &&
	test_stderr "fatal: pathspec 'symlink/foo' is beyond a symbolic link"

		
Switched to a new branch 'changes2'
1..8
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"

		
# 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 1 - Testing Git::I18N with NO Perl gettext library
[changes2 d94e838] alpacas
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 alpacas.t
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
ok 8 # skip GETTEXT_LOCALE must be set by lib-gettext.sh for exhaustive Git::I18N tests
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.
ok 344 - beyond a symlink from subdirectory with --quiet

# test_external test Perl Git::I18N API was ok
# expecting no stderr from previous command
expecting success: 
				expect '' &&
				
	(
		cd a &&
		test_check_ignore "symlink/foo" 128
	) &&
	test_stderr "fatal: pathspec 'symlink/foo' is beyond a symbolic link"

			
[master (root-commit) f2030b4] iso-c-commit
 Author: Áéí óú <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 iso-under-c
# test_external_without_stderr test no stderr: Perl Git::I18N API was ok
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"

			
*** t0204-gettext-reencode-sanity.sh ***
ok 1 - git show a ISO-8859-1 commit under C locale

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 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"

			
*** t0205-gettext-poison.sh ***
ok 347 - beyond a symlink from subdirectory with -v --non-matching

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>

expecting success: 
				expect '' &&
				
	(
HEAD is now at 0cd4af7... dir/child.t
		cd a &&
		test_check_ignore "symlink/foo" 128
	) &&
	test_stderr "fatal: pathspec 'symlink/foo' is beyond a symbolic link"

			
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0204-gettext-reencode-sanity/.git/
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"

			
[detached HEAD 8c0a55f] struthio
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 struthio.t
# 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)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0205-gettext-poison/.git/
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)

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)

ok 349 - beyond a symlink from subdirectory with --verbose -n

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)

expecting success: 
				expect '' &&
				
	(
		cd a &&
		test_check_ignore "symlink/foo" 128
	) &&
	test_stderr "fatal: pathspec 'symlink/foo' is beyond a symbolic link"

			
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)

# passed all 8 test(s)
1..8
# lib-gettext: No is_IS UTF-8 locale available
# lib-gettext: No is_IS ISO-8859-1 locale available
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)

ok 350 - beyond a symlink from subdirectory with --verbose --non-matching

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)

*** t0300-credentials.sh ***
# passed all 4 test(s)
1..4
expecting success: 
		expect "$expect" &&
		eval "$code"
	
*** t0301-credential-cache.sh ***
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'"

		
Merging:
8c0a55f struthio
virtual changes2
found 1 common ancestor:
0cd4af7 dir/child.t
Merge made by the 'recursive' strategy.
 alpacas.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 alpacas.t
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'"

		
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0300-credentials/.git/
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"

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0301-credential-cache/.git/
ok 353 - submodule with --quiet

expecting success: 
				expect '' &&
				
	test_check_ignore "a/submodule/one" 128 &&
	test_stderr "fatal: Pathspec 'a/submodule/one' is in submodule 'a/submodule'"

			
ok 1 - setup helper scripts

expecting success: 
	check fill "verbatim foo bar" <<-\EOF
	--
	username=foo
	password=bar
	--
	verbatim: get
	EOF

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 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 18 - merge maintains 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

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 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'"

			
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  83846e7 Merge branch 'changes2' into HEAD

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> 83846e7

Switched to a new branch 'partial'
ok 1 - helper (cache) has no existing data

expecting success: 
		check approve $HELPER <<-\EOF
		protocol=https
		host=example.com
		username=store-user
		password=store-pass
		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'"

			
[partial 6771940] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
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 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 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 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 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
	
[partial cd7fad9] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two.t
ok 359 - submodule with --verbose --non-matching

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

expecting success: 
		expect "$expect" &&
		eval "$code"
	
ok 360 - submodule from subdirectory

[partial f24c7c2] partial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
expecting success: 
			expect '' &&
			
	(
		cd a &&
		test_check_ignore "submodule/one" 128
	) &&
	test_stderr "fatal: Pathspec 'submodule/one' is in submodule 'a/submodule'"

		
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 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 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'"

		
ok 19 - partial commit gives cache-tree

expecting success: 
	mkdir newdir &&
	>newdir/one &&
	git add newdir/one &&
	git checkout 2>errors &&
	! test -s errors

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 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 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 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'"

			
A	newdir/one
M	one.t
ok 20 - no phantom error when switching trees

expecting success: 
	git update-index --split-index &&
	>split &&
	git add split &&
	test-dump-split-index .git/index | grep -v ^own >before &&
	git commit -m "as-is" &&
	test-dump-split-index .git/index | grep -v ^own >after &&
	test_cmp before after

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'"

			
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 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'"

			
ok 7 - credential_approve calls all helpers

expecting success: 
	check approve useless <<-\EOF
	username=foo
	--
	--
	EOF

[partial dc7a831] as-is
 Author: A U Thor <author@example.com>
 3 files changed, 1 insertion(+), 1 deletion(-)
 create mode 100644 newdir/one
 create mode 100644 split
ok 21 - switching trees does not invalidate shared index

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

# passed all 21 test(s)
1..21
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 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 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
	
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"

*** t0302-credential-store.sh ***
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 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 370 - global ignore

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0302-credential-store/.git/
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 11 - usernames can be overridden

expecting success: 
	check fill "verbatim three four" <<-\EOF
	username=one
	password=two
	--
	username=one
	password=two
	--
	EOF

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 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 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 371 - global ignore with -v

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 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
	
expecting success: 
	expect_from_stdin <expected-default &&
	test_check_ignore "--stdin" <stdin

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 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
	
ok 372 - --stdin

expecting success: 
	expect "" &&
	test_check_ignore "-q --stdin" <stdin

ok 373 - --stdin -q

expecting success: 
	expect_from_stdin <expected-verbose &&
	test_check_ignore "-v --stdin" <stdin

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 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 9 - helper (cache) 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 374 - --stdin -v

expecting success: 
		expect_from_stdin <expected-default0 &&
		test_check_ignore '--stdin -z' <stdin0
	
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 375 - --stdin -z

expecting success: 
		expect  &&
		test_check_ignore '-q --stdin -z' <stdin0
	
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 376 - --stdin -z -q

expecting success: 
		expect_from_stdin <expected-verbose0 &&
		test_check_ignore '-v --stdin -z' <stdin0
	
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 377 - --stdin -z -v

expecting success: 
		expect_from_stdin <expected-default0 &&
		test_check_ignore '-z --stdin' <stdin0
	
ok 17 - do not match configured credential

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 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
	
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 378 - -z --stdin

expecting success: 
		expect  &&
		test_check_ignore '-q -z --stdin' <stdin0
	
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 379 - -z --stdin -q

expecting success: 
		expect_from_stdin <expected-verbose0 &&
		test_check_ignore '-v -z --stdin' <stdin0
	
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 380 - -z --stdin -v

expecting success: 
	expect_from_stdin <expected-default &&
	(
		cd a &&
		test_check_ignore "--stdin" <../stdin
	)

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 381 - --stdin from subdirectory

expecting success: 
	expect_from_stdin <expected-verbose &&
	(
		cd a &&
		test_check_ignore "--stdin -v" <../stdin
	)

fatal: credential helper '!f() { echo quit=1; }; f' told us to quit
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 20 - helpers can abort the process

# passed all 20 test(s)
1..20
ok 382 - --stdin from subdirectory with -v

expecting success: 
	expect_from_stdin <expected-all &&
	(
		cd a &&
		test_check_ignore "--stdin -v -n" <../stdin
	)

*** t0303-credential-external.sh ***
ok 383 - --stdin from subdirectory with -v -n

expecting success: 
		expect_from_stdin <expected-default0 &&
		(
			cd a &&
			test_check_ignore "--stdin -z" <../stdin0
		)
	
ok 384 - --stdin -z from subdirectory

expecting success: 
		expect_from_stdin <expected-verbose0 &&
		(
			cd a &&
			test_check_ignore "--stdin -z -v" <../stdin0
		)
	
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
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t0303-credential-external/.git/
ok 385 - --stdin -z from subdirectory with -v

expecting success: 
		expect_from_stdin <expected-default0 &&
		(
			cd a &&
			test_check_ignore "-z --stdin" <../stdin0
		)
	
1..0 # SKIP used to test external credential helpers
*** t1000-read-tree-m-3way.sh ***
ok 386 - -z --stdin from subdirectory

expecting success: 
		expect_from_stdin <expected-verbose0 &&
		(
			cd a &&
			test_check_ignore "-z --stdin -v" <../stdin0
		)
	
ok 387 - -z --stdin from subdirectory with -v

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

)
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"

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1000-read-tree-m-3way/.git/
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: git update-index --add $p &&
	    git update-index --add Z/$p
.gitignore:1:one	one
::	two
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 1 - adding test file NN and Z/NN

expecting success: git update-index --add $p &&
	    git update-index --add Z/$p
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 2 - adding test file ND and Z/ND

expecting success: git update-index --add $p &&
	    git update-index --add Z/$p
ok 390 - quoting allows trailing whitespace

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
	
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 3 - adding test file NM and Z/NM

expecting success: git update-index --add $p &&
	    git update-index --add Z/$p
ok 391 - correct handling of backslashes
ok 11 - helper (store) remembers other user


expecting success: 
	test_path_is_missing "$HOME/.config/git/credentials" &&
	test -s "$HOME/.git-credentials"

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

ok 4 - adding test file DN and Z/DN

expecting success: git update-index --add $p &&
	    git update-index --add Z/$p
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 392 - info/exclude trumps core.excludesfile

# passed all 392 test(s)
1..392
ok 5 - adding test file DD and Z/DD

expecting success: git update-index --add $p &&
	    git update-index --add Z/$p
ok 6 - adding test file DM and Z/DM

expecting success: git update-index --add $p &&
	    git update-index --add Z/$p
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
	
*** t1001-read-tree-m-2way.sh ***
ok 7 - adding test file MN and Z/MN

expecting success: git update-index --add $p &&
	    git update-index --add Z/$p
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
	
ok 8 - adding test file MD and Z/MD

expecting success: git update-index --add $p &&
	    git update-index --add Z/$p
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1001-read-tree-m-2way/.git/
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 9 - adding test file MM and Z/MM

expecting success: git update-index --add SS
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 10 - adding test file SS

expecting success: git update-index --add TT
ok 11 - adding test file TT

expecting success: tree_O=$(git write-tree)
treeH ca3aa9e6ee09349df7db6f0de15016afcdf5d9e4
ok 12 - prepare initial tree

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
	
expecting success: git update-index --remove $to_remove
100644 blob 3e8d9abb979a4fbdc93309f457a5496bc41ba6ab	bozbar
100644 blob dca6b92303befc93086aa025d90a5facd7eb2812	nitfol
100644 blob 766498d93a4b06057a8e49d23f4068f1170ff38f	rezrov
ok 13 - change in branch A (removal)

expecting success: git update-index MD
ok 14 - change in branch A (modification)

expecting success: git update-index MM
treeM d2c045ead2ecb56f2632385a395918bf21816c12
ok 15 - change in branch A (modification)

expecting success: git update-index MN
100644 blob 346d4e61f111336a1443ef6b2e834aa5b1a7f91a	bozbar
100644 blob 8e4020bb5a8d8c873b25de15933e75cc0fc275df	frotz
100644 blob dca6b92303befc93086aa025d90a5facd7eb2812	nitfol
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 16 - change in branch A (modification)

expecting success: git update-index Z/MD
: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
ok 17 - change in branch A (modification)

expecting success: git update-index Z/MM
100644 346d4e61f111336a1443ef6b2e834aa5b1a7f91a 0	bozbar
100644 8e4020bb5a8d8c873b25de15933e75cc0fc275df 0	frotz
100644 dca6b92303befc93086aa025d90a5facd7eb2812 0	nitfol
ok 18 - change in branch A (modification)

expecting success: git update-index Z/MN
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 19 - change in branch A (modification)

expecting success: git update-index --add AN
bozbar: dirty
ok 20 - change in branch A (addition)

expecting success: git update-index --add AA
frotz: dirty
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
ok 21 - change in branch A (addition)

expecting success: git update-index --add Z/AN
ok 22 - change in branch A (addition)

expecting success: git update-index --add Z/AA
ok 23 - change in branch A (addition)

expecting success: git update-index --add LL &&
     git update-index SS
ok 24 - change in branch A (addition)

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
	
expecting success: git update-index TT
ok 25 - change in branch A (edit)

expecting success: git update-index --add DF/DF
100644 346d4e61f111336a1443ef6b2e834aa5b1a7f91a 0	bozbar
100644 8e4020bb5a8d8c873b25de15933e75cc0fc275df 0	frotz
100644 dca6b92303befc93086aa025d90a5facd7eb2812 0	nitfol
100644 0a41e115ab61be0328a19b29f18cdcb49338d516 0	yomin
ok 26 - change in branch A (change file to directory)

expecting success: tree_A=$(git write-tree)
ok 27 - recording branch A tree

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
expecting success: git read-tree $tree_O &&
     git checkout-index -a
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 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 30 - change in branch B (modification)

expecting success: git update-index MM
ok 31 - change in branch B (modification)

expecting success: git update-index NM
100644 346d4e61f111336a1443ef6b2e834aa5b1a7f91a 0	bozbar
100644 8e4020bb5a8d8c873b25de15933e75cc0fc275df 0	frotz
100644 dca6b92303befc93086aa025d90a5facd7eb2812 0	nitfol
100644 0a41e115ab61be0328a19b29f18cdcb49338d516 0	yomin
ok 32 - change in branch B (modification)

expecting success: git update-index Z/DM
ok 33 - change in branch B (modification)

expecting success: git update-index Z/MM
ok 34 - change in branch B (modification)

expecting success: git update-index Z/NM
yomin: dirty
ok 4 - 5 - carry forward local addition.

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
ok 35 - change in branch B (modification)

expecting success: git update-index --add NA
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 36 - change in branch B (addition)

expecting success: git update-index --add AA
ok 37 - change in branch B (addition)

expecting success: git update-index --add Z/NA
ok 12 - helper (cache --timeout=1) times out

ok 38 - change in branch B (addition)

expecting success: git update-index --add Z/AA
# passed all 12 test(s)
1..12
ok 39 - change in branch B (addition)

expecting success: git update-index --add LL &&
     git update-index SS
100644 346d4e61f111336a1443ef6b2e834aa5b1a7f91a 0	bozbar
100644 8e4020bb5a8d8c873b25de15933e75cc0fc275df 0	frotz
100644 dca6b92303befc93086aa025d90a5facd7eb2812 0	nitfol
ok 40 - change in branch B (addition and modification)

*** t1002-read-tree-m-u-2way.sh ***
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
	
frotz: clean
expecting success: git update-index TT
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
ok 41 - change in branch B (modification)

expecting success: git update-index --add DF
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

ok 42 - change in branch B (addition of a file to conflict with directory)

expecting success: 
	rm -f "$HOME/.git-credentials" &&
	rm -f "$HOME/.config/git/credentials" &&
	mkdir -p "$HOME/xdg/git" &&
	>"$HOME/xdg/git/credentials"

expecting success: tree_B=$(git write-tree)
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 43 - recording branch B tree

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
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1002-read-tree-m-u-2way/.git/
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
100644 346d4e61f111336a1443ef6b2e834aa5b1a7f91a 0	bozbar
100644 8e4020bb5a8d8c873b25de15933e75cc0fc275df 0	frotz
100644 dca6b92303befc93086aa025d90a5facd7eb2812 0	nitfol
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
	
treeH 661afa9096b7e2d4b9a28a6e43736cd0b06d1308
100644 blob 78d812a2124ff980a1a70f8cca493698d643d242	bozbar
100644 blob dca6b92303befc93086aa025d90a5facd7eb2812	nitfol
100644 blob 766498d93a4b06057a8e49d23f4068f1170ff38f	rezrov
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 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
	
treeM 05bf9652e9b06473d6ca2f32ff60e2401e59bfa6
100644 blob bb3b2cd2e136e1e4e7ecdf10068e246196dd8294	bozbar
100644 blob 8e4020bb5a8d8c873b25de15933e75cc0fc275df	frotz
100644 blob dca6b92303befc93086aa025d90a5facd7eb2812	nitfol
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 44 - keep contents of 3 trees for easy access

: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
expecting success: rm -fr [NDMALTS][NDMALTSF] Z &&
     rm .git/index &&
     read_tree_must_succeed -m 3fe085e0589de4327971d50e416fc292dd00fbfe 997bbc4a0a51e0574168a4f637739380edebe4d7 76d47d681d7f1d4fa975334a9a0ba8a6eeea2226 &&
     check_result
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
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 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
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
	
error: Entry 'frotz' would be overwritten by merge. Cannot merge.
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
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
	
bozbar: clean
frotz: clean
nitfol: clean
ok 2 - 1, 2, 3 - no carry forward

100644 346d4e61f111336a1443ef6b2e834aa5b1a7f91a 0	bozbar
100644 8e4020bb5a8d8c873b25de15933e75cc0fc275df 0	frotz
100644 dca6b92303befc93086aa025d90a5facd7eb2812 0	nitfol
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 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
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

error: Entry 'XX' would be overwritten by merge. Cannot merge.
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
	
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
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
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
	
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
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
yomin: clean
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 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
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
	
error: Entry 'rezrov' would be overwritten by merge. Cannot merge.
ok 12 - 13 - unmatching local changes being removed.

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
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 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
	
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

100644 346d4e61f111336a1443ef6b2e834aa5b1a7f91a 0	bozbar
100644 8e4020bb5a8d8c873b25de15933e75cc0fc275df 0	frotz
100644 7e1bf714fb103c778a21dd67411666901222425a 0	nitfol
ok 37 - helper (store) remembers other user

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"

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

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 'AN' would be overwritten by merge. Cannot merge.
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
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

ok 40 - get: use xdg file if home file has no matches

yomin: dirty
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 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
100644 346d4e61f111336a1443ef6b2e834aa5b1a7f91a 0	bozbar
100644 8e4020bb5a8d8c873b25de15933e75cc0fc275df 0	frotz
100644 7e1bf714fb103c778a21dd67411666901222425a 0	nitfol
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 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

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
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"

error: Entry 'AA' not uptodate. Cannot merge.
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: 
     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 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"

error: Entry 'bozbar' would be overwritten by merge. Cannot merge.
error: Entry 'AA' 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
ok 43 - erase: erase matching credentials from both xdg and home files

# passed all 43 test(s)
1..43
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
frotz: clean
*** t1003-read-tree-prefix.sh ***
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
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
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1003-read-tree-prefix/.git/
expecting success: 
	echo hello >one &&
	git update-index --add one &&
	tree=$(git write-tree) &&
	echo tree is $tree

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
tree is 700196ec4e5b1c75e9f5481e5b545d78533ff917
ok 1 - setup

expecting success: 
	git read-tree --prefix=two/ $tree &&
	git ls-files >actual &&
	cmp expect actual

ok 2 - read-tree --prefix

100644 346d4e61f111336a1443ef6b2e834aa5b1a7f91a 0	bozbar
100644 8e4020bb5a8d8c873b25de15933e75cc0fc275df 0	frotz
100644 dca6b92303befc93086aa025d90a5facd7eb2812 0	nitfol
# passed all 2 test(s)
1..2
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
*** t1004-read-tree-m-u-wf.sh ***
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

frotz: dirty
error: Entry 'LL' would be overwritten by merge. Cannot merge.
M.sum actual7.sum differ: char 20, line 2
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1004-read-tree-m-u-wf/.git/
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
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"

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 dca6b92303befc93086aa025d90a5facd7eb2812 0	nitfol
[master (root-commit) 47d3572] 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
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 'DD' would be overwritten by merge. Cannot merge.
file2 is not tracked on the master anymore
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

[master 78aa062] master removes file2 and subdir/file2
 Author: A U Thor <author@example.com>
 2 files changed, 2 deletions(-)
error: Entry 'frotz' would be overwritten by merge. Cannot merge.
 delete mode 100644 file2
 delete mode 100644 subdir/file2
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
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 'DM' would be overwritten by merge. Cannot merge.
100644 346d4e61f111336a1443ef6b2e834aa5b1a7f91a 0	bozbar
100644 8e4020bb5a8d8c873b25de15933e75cc0fc275df 0	frotz
100644 dca6b92303befc93086aa025d90a5facd7eb2812 0	nitfol
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

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

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
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

error: Entry 'DN' would be overwritten by merge. Cannot merge.
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 '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
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
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
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

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

Switched to branch 'side'
D	file2
D	subdir/file2
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
[side 8691cab] 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 'MD' not uptodate. Cannot merge.
Switched to branch 'master'
treeDF 6bf22db9043f2b5821c019d0ce0f2605421affcb
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

100644 blob 052efc3abbc31348f7abd34535b1953d38273257	DF
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
treeDFDF c38e296263d024b0f48c4a728d293232ac6c5443
error: Entry 'MD' would be overwritten by merge. Cannot merge.
040000 tree 90bbead36f4d6a7c325fd450e6cfbcc7479d421a	DF
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

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 '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
HEAD is now at 78aa062 master removes file2 and subdir/file2
100644 b90ea14b2dd74b6f377c10870b3757344bbe077c 0	DF/DF
Already on 'master'
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
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
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

treeM 496d6428b9cf92981dc9495211e6e1120fb6f2ba
HEAD is now at 78aa062 master removes file2 and subdir/file2
100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391	a
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

Already on 'master'
treeH 4b825dc642cb6eb9a060e54bf8d69288fbee4904
error: Entry 'ND' not uptodate. Cannot merge.
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
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: Updating 'a' would lose untracked files in it
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
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 'ND' would be overwritten by merge. Cannot merge.
HEAD is now at 78aa062 master removes file2 and subdir/file2
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
Switched to a new branch 'side-a'
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
[side-a de60b5c] side-a changes file1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
treeM 3e82e8b9894d6c7982dcd25a6dad66400d52735f
Switched to a new branch 'side-b'
100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391	a
040000 tree 2a26db49a6962700da5bd4084ae0e5a22d6583ee	c
[side-b 2e3a5a1] side-b changes file2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
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
Switched to branch 'side-a'
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

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


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
HEAD is now at de60b5c side-a changes file1
error: Entry 'MM' not uptodate. Cannot merge.
error: Entry 'MM' not uptodate. Cannot merge.
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

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

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 'MM' would be overwritten by merge. Cannot merge.
HEAD is now at de60b5c side-a changes file1
[master (root-commit) 40e9558] 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
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 'file2' not uptodate. Cannot merge.
[master c92a248] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
M.sum actual14a.sum differ: char 38, line 3
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


nitfol: clean
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
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
HEAD is now at de60b5c side-a changes file1
Switched to a new branch 'sym-b'
ok 28 - -m references the correct modified tree

# passed all 28 test(s)
1..28
[sym-b 1a396f3] side adds a/b
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 a/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

Switched to a new branch 'sym-a'
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
*** t1005-read-tree-reset.sh ***
error: Entry 'SS' would be overwritten by merge. Cannot merge.
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
[sym-a 4954699] we add a/b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 120000 a/b
nitfol: dirty
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

M.sum actual15a.sum differ: char 38, line 3
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
Reinitialized existing Git repository in /«PKGBUILDDIR»/t/trash directory.t1005-read-tree-reset/.git/
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

)
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
rm: cannot remove 'SANETESTD.1/x': Permission denied
[master (root-commit) 9df691f] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 df/file
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


HEAD is now at 4954699 we add a/b
Already on 'sym-a'
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
[master 0ef69a2] 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

error: Entry 'bozbar' would be overwritten by merge. Cannot merge.
error: unable to unlink old 'a/b' (Permission denied)
ok 15 - 16 - conflicting local change.

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 &&
     echo bozbar bozbar bozbar >bozbar &&
     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi
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"


HEAD is now at 4954699 we add a/b
Switched to branch 'side-a'
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
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

[side-a 193c97e] 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


Switched to branch 'side-b'
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
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

100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 0	df
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 0	new
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 1	old
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 3	old
error: Entry 'NM' not uptodate. Cannot merge.
error: Entry 'NM' not uptodate. Cannot merge.
ok 15 - D/F

expecting success: 

	git reset --hard &&
	git checkout side-b &&
	git merge-resolve branch-point -- side-b side-a


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

error: 'subdir/file2/another' appears as both a file and as a directory
error: subdir/file2/another: cannot drop to stage #0
HEAD is now at 2e3a5a1 side-b changes file2
Already on 'side-b'
error: Entry 'NM' would be overwritten by merge. Cannot merge.
bozbar: clean
ok 3 - reset should remove remnants from a failed merge

ok 17 - 18 - local change already having a good result.

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: 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
Trying simple merge.
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
Simple merge failed, trying Automatic merge.
Adding subdir/file2/another
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 2e3a5a1 side-b changes file2
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
Already on 'side-b'
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 0	df
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 0	new
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 1	old
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 3	old
Merging side-b with side-a
Merging:
2e3a5a1 side-b changes file2
193c97e side-a changes file2 to directory
found 1 common ancestor:
47d3572 initial
Adding subdir/file2/another
Removing subdir/file2 to make room for subdirectory

Removing subdir/file2
ok 17 - D/F recursive

# passed all 17 test(s)
1..17
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

bozbar: dirty
*** t1006-cat-file.sh ***
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 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

error: Entry 'NN' would be overwritten by merge. Cannot merge.
error: Entry 'NN' would be overwritten by merge. Cannot merge.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1006-cat-file/.git/
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
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
    
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 0	df
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 0	new
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 1	old
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 3	old
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
    
HEAD is now at 0ef69a2 two
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 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
    
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
    
100644 ecbec6db011caa3ae26739812f092f76875fe6b6 2	F16
100644 bcf4afda2c30299bf6538240d40bcb8fb3857691 3	F16
ok 83 - 16 - A matches in one and B matches in another.

# passed all 83 test(s)
1..83
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
    
bozbar: clean
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
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
    
ok 10 - --batch-check output of blob is correct

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
    
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 0	df
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 0	new
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 1	old
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 3	old
*** t1007-hash-object.sh ***
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 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

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
    
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 14 - --batch without size (blob)

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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1007-hash-object/.git/
treeDF 6bf22db9043f2b5821c019d0ce0f2605421affcb
expecting success: 
	echo example | test_must_fail git hash-object --stdin --stdin

100644 blob 052efc3abbc31348f7abd34535b1953d38273257	DF
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

    -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

ok 15 - --batch-check without %(rest) considers whole line

expecting success: 
	git cat-file -e $sha1
    
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

    -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

treeDFDF c38e296263d024b0f48c4a728d293232ac6c5443
ok 16 - tree exists

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

    -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

expecting success: 
	echo $type >expect &&
	git cat-file -t $sha1 >actual &&
	test_cmp expect actual
    
ok 2 - Can't use --stdin and --stdin-paths together

expecting success: 
	echo example | test_must_fail git hash-object --stdin-paths hello

100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 0	df
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 0	new
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 1	old
100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 3	old
040000 tree 90bbead36f4d6a7c325fd450e6cfbcc7479d421a	DF
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

    -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 17 - Type of tree is correct

expecting success: 
	echo $size >expect &&
	git cat-file -s $sha1 >actual &&
	test_cmp expect actual
    
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

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

ok 21 - DF vs DF/DF case setup.
    -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

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 4 - Can't use --path with --stdin-paths

expecting success: 
	test_must_fail git hash-object --no-filters --path=foo

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
    
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

    -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 7 - Porcelain checkout -f HEAD should remove remnants too

# passed all 7 test(s)
1..7
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
    
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1007-hash-object/test/.git/
expecting success: 
	test $hello_sha1 = $(git hash-object hello)

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
    
ok 6 - hash a file

expecting success: 
		test_must_fail git cat-file blob 5e1c309dae7f45e0f39b1bf3ac3cd9db12e7d689
	
*** t1008-read-tree-overlay.sh ***
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 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
	
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
    
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 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
    
ok 10 - hash a file and write to database

expecting success: 
		git cat-file blob 5e1c309dae7f45e0f39b1bf3ac3cd9db12e7d689
	
Hello Worldok 11 - blob exists in database

ok 24 - --batch-check with %(rest)

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"

expecting success: 
	git cat-file -e $sha1
    
DF/DF: clean
ok 22 - DF vs DF/DF case test.

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1008-read-tree-overlay/.git/
ok 25 - commit exists

expecting success: 
	echo $type >expect &&
	git cat-file -t $sha1 >actual &&
	test_cmp expect actual
    
# passed all 22 test(s)
1..22
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 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

ok 26 - Type of commit is correct

expecting success: 
	echo $size >expect &&
	git cat-file -s $sha1 >actual &&
	test_cmp expect actual
    
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
    
[master (root-commit) c6faa84] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a
*** t1009-read-tree-new-index.sh ***
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
    
[master 1e74c4e] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 b
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
    
Switched to a new branch 'side'
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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1009-read-tree-new-index/.git/
expecting success: 
	echo one >a &&
	git add a &&
	git commit -m initial

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
    
[side b66fdd3] 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

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
    
[master (root-commit) c6faa84] 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 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
    
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 2 - non-existent index file

expecting success: 
	rm -f new-index &&
	> new-index &&
	GIT_INDEX_FILE=new-index git read-tree master

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 3 - empty index file

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
    
# passed all 3 test(s)
1..3
ok 2 - multi-read

# passed all 2 test(s)
1..2
*** t1010-mktree.sh ***
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 15 - check that --no-filters option works with --stdin-paths

*** t1011-read-tree-sparse-checkout.sh ***
ok 37 - --batch without size (commit)

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 16 - hash from stdin and write to database (-w --stdin)

expecting success: 
		git cat-file blob ddd3f836d3e3fbb7ae289aa9ae83536f76956399
	
expecting success: 
	git cat-file -e $sha1
    
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1010-mktree/.git/
This is an exampleok 38 - tag exists

expecting success: 
	echo $type >expect &&
	git cat-file -t $sha1 >actual &&
	test_cmp expect actual
    
ok 17 - blob exists in database

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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1011-read-tree-sparse-checkout/.git/
ok 39 - Type of tag is correct

expecting success: 
	echo $size >expect &&
	git cat-file -s $sha1 >actual &&
	test_cmp expect actual
    
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

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
    
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 41 - Type of tag 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 18 - hash from stdin and write to database (--stdin -w)

expecting success: 
		git cat-file blob ddd3f836d3e3fbb7ae289aa9ae83536f76956399
	
[master (root-commit) 2519212] init
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 init.t
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 19 - blob exists in database

expecting success: 
	test "$sha1s" = "$(echo_without_newline "$filenames" | git hash-object --stdin-paths)"

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 20 - hash two files with names on stdin

[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.t1007-hash-object/test/.git/
ok 44 - Pretty content of tag is correct

expecting success: 
		test "$sha1s" = "$(echo_without_newline "$filenames" | git hash-object $args)"
	
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
    
rm 'sub/added'
ok 21 - hash two files with names on stdin and write to database (-w --stdin-paths)

expecting success: 
		git cat-file blob 5e1c309dae7f45e0f39b1bf3ac3cd9db12e7d689
	
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
    
Hello Worldok 22 - blob exists in database

expecting success: 
		git cat-file blob ddd3f836d3e3fbb7ae289aa9ae83536f76956399
	
[master de70956] removed
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 delete mode 100644 sub/added
This is an exampleok 23 - 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
    
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
    
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
ok 1 - setup

ok 48 - --batch-check with %(rest)

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

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
    
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 24 - hash two files with names on stdin and write to database (--stdin-paths -w)

expecting success: 
		git cat-file blob 5e1c309dae7f45e0f39b1bf3ac3cd9db12e7d689
	
Hello Worldok 25 - blob exists in database

expecting success: 
		git cat-file blob ddd3f836d3e3fbb7ae289aa9ae83536f76956399
	
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
    
This is an exampleok 26 - blob exists in database

expecting success: 
	echo abc >malformed-tree &&
	test_must_fail git hash-object -t tree malformed-tree

ok 1 - setup

expecting success: 
	git mktree <top >actual &&
	test_cmp tree actual

fatal: corrupt tree file
ok 27 - corrupt tree

expecting success: 
	test_must_fail git hash-object -t commit --stdin </dev/null

ok 50 - --batch without size (tag)

expecting success: test 'Hello World' = "$(git cat-file blob bb50ec8a71343279c59ba488a3445888e3fb624b)"
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

ok 2 - ls-tree piped to mktree (1)

expecting success: 
	git mktree <top.withsub >actual &&
	test_cmp tree.withsub actual

fatal: corrupt tag
ok 29 - corrupt tag

expecting success: 
	test_must_fail git hash-object -t bogus --stdin </dev/null

ok 51 - Reach a blob from a tag pointing to it

expecting success: 
	    test_must_fail git cat-file --$batch -$opt $hello_sha1
	
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

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]

<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
    --buffer              buffer --batch output
    --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)
    --batch-all-objects   show all objects with --batch or --batch-check

ok 52 - Passing -t with --batch 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

fatal: invalid object type "bl"
ok 3 - ls-tree piped to mktree (2)

expecting success: 
	perl -e "print reverse <>" <top |
	git mktree >actual &&
	test_cmp tree actual

ok 31 - hash-object complains about truncated type name

expecting success: 
	t=1234567890 &&
	echo example | git hash-object -t $t --literally --stdin

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]

<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
    --buffer              buffer --batch output
    --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)
    --batch-all-objects   show all objects with --batch or --batch-check

ok 53 - Passing --batch with -t fails

expecting success: 
	    test_must_fail git cat-file --$batch -$opt $hello_sha1
	
f78b23c3f872d473c764d5fcf4fb39af8bbf2123
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

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

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]

<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
    --buffer              buffer --batch output
    --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)
    --batch-all-objects   show all objects with --batch or --batch-check

ok 54 - Passing -s with --batch fails

expecting success: 
	    test_must_fail git cat-file -$opt --$batch $hello_sha1
	
2a881776ee43e849175ee7158075560ca0ae7692
ok 33 - --literally with extra-long type

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]

<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
    --buffer              buffer --batch output
    --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)
    --batch-all-objects   show all objects with --batch or --batch-check

ok 55 - Passing --batch with -s fails

expecting success: 
	    test_must_fail git cat-file --$batch -$opt $hello_sha1
	
# passed all 33 test(s)
1..33
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]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



<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
    --buffer              buffer --batch output
    --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)
    --batch-all-objects   show all objects with --batch or --batch-check

ok 56 - Passing -e 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]ok 6 - allow missing object with --missing

expecting success: 
	test_must_fail git mktree <all >actual



<type> can be one of: blob, tree, commit, tag
    -t                    show object type
*** t1012-read-tree-df.sh ***
    -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
    --buffer              buffer --batch output
    --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)
    --batch-all-objects   show all objects with --batch or --batch-check

ok 57 - Passing --batch with -e fails

expecting success: 
	    test_must_fail git cat-file --$batch -$opt $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]

<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
    --buffer              buffer --batch output
    --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)
    --batch-all-objects   show all objects with --batch or --batch-check

ok 58 - Passing -p with --batch fails

expecting success: 
	    test_must_fail git cat-file -$opt --$batch $hello_sha1
	
fatal: path a./one contains slash
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]

<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
    --buffer              buffer --batch output
    --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)
    --batch-all-objects   show all objects with --batch or --batch-check

ok 8 - mktree refuses to read ls-tree -r output (2)
ok 59 - Passing --batch with -p fails


expecting success: 
	test_must_fail git cat-file --$batch blob $hello_sha1
    
# passed all 8 test(s)
1..8
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]

<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
    --buffer              buffer --batch output
    --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)
    --batch-all-objects   show all objects 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]

<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
    --buffer              buffer --batch output
    --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)
    --batch-all-objects   show all objects with --batch or --batch-check

ok 61 - Passing --batch with <type> fails

expecting success: 
	test_must_fail git cat-file --$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]

<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
    --buffer              buffer --batch output
    --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)
    --batch-all-objects   show all objects with --batch or --batch-check

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1012-read-tree-df/.git/
ok 62 - Passing sha1 with --batch fails

expecting success: 
	    test_must_fail git cat-file --$batch -$opt $hello_sha1
	
*** t1013-read-tree-submodule.sh ***
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]

<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
    --buffer              buffer --batch output
    --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)
    --batch-all-objects   show all objects 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]

<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
    --buffer              buffer --batch output
    --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)
    --batch-all-objects   show all objects 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
	
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]

<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
    --buffer              buffer --batch output
    --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)
    --batch-all-objects   show all objects 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]

<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
    --buffer              buffer --batch output
    --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)
    --batch-all-objects   show all objects 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
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/.git/
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

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]

<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
    --buffer              buffer --batch output
    --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)
    --batch-all-objects   show all objects 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
	
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
		)
	
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]

<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
    --buffer              buffer --batch output
    --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)
    --batch-all-objects   show all objects 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
	
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]

<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
    --buffer              buffer --batch output
    --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)
    --batch-all-objects   show all objects 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
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.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]

<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
    --buffer              buffer --batch output
    --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)
    --batch-all-objects   show all objects 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
    
error: Sparse checkout leaves no entry on working directory
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]

<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
    --buffer              buffer --batch output
    --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)
    --batch-all-objects   show all objects with --batch or --batch-check

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]

<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
    --buffer              buffer --batch output
[master (root-commit) 58630c0] 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
    --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)
    --batch-all-objects   show all objects with --batch or --batch-check

ok 72 - Passing --batch-check with <type> fails

expecting success: 
	test_must_fail git cat-file --$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]

<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
    --buffer              buffer --batch output
    --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)
    --batch-all-objects   show all objects 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
	
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]
error: Sparse checkout leaves no entry on working directory

<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
    --buffer              buffer --batch output
    --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)
    --batch-all-objects   show all objects with --batch or --batch-check

ok 74 - Passing -t with --follow-symlinks fails

expecting success: 
	    test_must_fail git cat-file --follow-symlinks -$opt $hello_sha1
	
Switched to a new branch 'add_sub1'
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]

<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
    --buffer              buffer --batch output
    --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)
    --batch-all-objects   show all objects 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
	
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

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]

<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
    --buffer              buffer --batch output
    --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)
    --batch-all-objects   show all objects 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
	
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]

<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
    --buffer              buffer --batch output
    --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)
    --batch-all-objects   show all objects 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)"

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

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)"

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

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)"

Cloning into 'sub1'...
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

done.
[master (root-commit) 4eeced4] 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
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 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

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 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 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

[add_sub1 f82c245] Add sub1
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
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

Switched to a new branch 'remove_sub1'
Removing sub1
Removing .gitmodules
[remove_sub1 2616ca2] Revert "Add sub1"
 Author: A U Thor <author@example.com>
 2 files changed, 5 deletions(-)
 delete mode 100644 .gitmodules
 delete mode 160000 sub1
9b546ef00c80e00a1733cb882d607028fcd562fc
ok 87 - %(deltabase) reports packed delta bases

expecting success: 
	echo $bogus_type >expect &&
	git cat-file -t --allow-unknown-type $bogus_sha1 >actual &&
	test_cmp expect actual

Switched to a new branch 'modify_sub1'
ok 88 - Type of broken object is correct
ok 11 - checkout area changes


expecting success: 
	echo $bogus_size >expect &&
	git cat-file -s --allow-unknown-type $bogus_sha1 >actual &&
	test_cmp expect actual

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

ok 89 - Size of broken object is correct

HEAD is now at 9598e22... modified and 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
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
From /«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.
   58630c0..f82c245  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'
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
[modifications 853843e] modified file2 and added file3
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 file3
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 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

To /«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.
 * [new branch]      modifications -> modifications
HEAD is now at de70956... removed
[modify_sub1 cda2010] Modify sub1
 Author: A U Thor <author@example.com>
Switched to a new branch 'replace_sub1_with_directory'
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

Previous HEAD position was de70956... removed
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

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

Previous HEAD position was de70956... removed
HEAD is now at 9598e22... modified and added
HEAD is now at de70956 removed
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
[master 78646e6] 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

ok 19 - print errors when failed to update worktree

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

Previous HEAD position was 2519212... init
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

HEAD is now at 9598e22... modified and added
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

Submodule path 'sub1': checked out '58630c04cd08e6914ad0ab5a3126bcfb71a3e6ca'
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

Previous HEAD position was 58630c0... Base
Switched to branch 'modifications'
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

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

HEAD is now at 9598e22... modified and added
rm 'sub1'
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 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

ok 21 - checkout with --ignore-skip-worktree-bits

# passed all 21 test(s)
1..21
ok 98 - git cat-file --batch-check --follow-symlinks works for parent-dir links

[replace_sub1_with_directory 2fdc7b9] 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
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

Switched to a new branch 'replace_directory_with_sub1'
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

*** t1014-read-tree-confusing.sh ***
Removing sub1/file3
Removing sub1/file2
Removing sub1/file1
Adding sub1
[replace_directory_with_sub1 18f56b7] 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 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

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/
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

expecting success: 
	echo content >file &&
	git add file &&
	git commit -m base &&
	blob=$(git rev-parse HEAD:file) &&
	tree=$(git rev-parse HEAD^{tree})

[replace_sub1_with_file d2a0777] Replace sub1 with file
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
Switched to a new branch 'replace_file_with_sub1'
[master (root-commit) aba5342] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
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 5 - 2-way (1)

ok 1 - create base tree

expecting success: 
	git config core.protectHFS true

# passed all 5 test(s)
1..5
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

[replace_file_with_sub1 a142852] Revert "Replace sub1 with file"
 Author: A U Thor <author@example.com>
 2 files changed, 5 insertions(+), 1 deletion(-)
 mode change 100644 => 160000 sub1
ok 2 - enable core.protectHFS for rejection tests

expecting success: 
	git config core.protectNTFS true

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
	
Switched to a new branch 'invalid_sub1'
error: Invalid path '.'
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 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

*** t1020-subdirectory.sh ***
[invalid_sub1 ac86d0b] Invalid sub1 commit
 Author: A U Thor <author@example.com>
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
	
Switched to a new branch 'valid_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

error: Invalid path '..'
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 90d123d] Revert "Invalid sub1 commit"
 Author: A U Thor <author@example.com>
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

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
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1020-subdirectory/.git/
Switched to branch 'master'
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 '.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 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

ok 106 - git cat-file --batch-check --follow-symlinks works for out-of-repo symlinks in subdirs

Cloning into 'submodule_update'...
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

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 one
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
	
pass two
done.
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
	)

error: Invalid path '.GIT/file'
ok 11 - reject .GIT as subtree

c1144d0671912dd26751c1fbf1eac57a907f82c7
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 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 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
	
ok 3 - cat-file

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
	)

error: Invalid path '‌.Git/file'
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
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
	
pass subdir
Branch add_sub1 set up to track remote branch add_sub1 from origin.
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"
	)

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
	
ok 109 - git cat-file --batch --follow-symlink returns correct sha and mode

expecting success: 
	# make new repos so we know the full set of objects; we will
	# also make sure that there are some packed and some loose
	# objects, some referenced and some not, and that there are
	# some available only via alternates.
	git init all-one &&
	(
		cd all-one &&
		echo content >file &&
		git add file &&
		git commit -qm base &&
		git rev-parse HEAD HEAD^{tree} HEAD:file &&
		git repack -ad &&
		echo not-cloned | git hash-object -w --stdin
	) >expect.unsorted &&
	git clone -s all-one all-two &&
	(
		cd all-two &&
		echo local-unref | git hash-object -w --stdin
	) >>expect.unsorted &&
	sort <expect.unsorted >expect &&
	git -C all-two cat-file --batch-all-objects \
				--batch-check="%(objectname)" >actual &&
	test_cmp expect actual

cf1e35b43464cccd320d58a813e14e25fa36b1d7
cf1e35b43464cccd320d58a813e14e25fa36b1d7
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
	)

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.t1006-cat-file/all-one/.git/
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 '.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
	
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
	
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
	
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
	
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
	
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
	
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

expecting success: 
		printf "100644 blob %s\t%s" "$blob" "$path" >tree &&
		bogus=$(git mktree <tree) &&
		test_must_fail git read-tree $bogus
	
ok 7 - read-tree

expecting success: 
	(
		git config alias.test-status-alias status &&
		cd dir &&
		git status &&
		git test-status-alias
	)

error: Invalid path '.git\foobar'
Cloning into 'all-two'...
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
	
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

error: Invalid path '.git\foobar/file'
done.
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

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

ok 8 - alias expansion

expecting success: 
	pwd >expect &&
	(
		git config alias.test-alias-directory !pwd &&
		cd dir &&
		git test-alias-directory >../actual
	) &&
	test_cmp expect actual

Cloning into 'sub1'...
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

ok 110 - cat-file --batch-all-objects shows all objects

# passed all 110 test(s)
1..110
ok 26 - utf-8 paths allowed with core.protectHFS off

done.
# passed all 26 test(s)
1..26
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 11 - GIT_PREFIX for built-ins

expecting success: 
	git commit -a -m 1 &&
	(
		cd .git &&
		git show -s HEAD
	)

*** t1021-rerere-in-workdir.sh ***
[master (root-commit) f0aeb19] 1
 Author: A U Thor <author@example.com>
 2 files changed, 58 insertions(+)
 create mode 100644 dir/two
 create mode 100644 one
*** t1050-large.sh ***
commit f0aeb1993f1f89cccff09a60379174fefefa1f3b
Author: A U Thor <author@example.com>
Date:   Wed Dec 16 10:48:54 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
	)

Cloning into bare repository 'foo.git'...
done.
Submodule path 'sub1': checked out '58630c04cd08e6914ad0ab5a3126bcfb71a3e6ca'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1021-rerere-in-workdir/.git/
commit f0aeb1993f1f89cccff09a60379174fefefa1f3b
Author: A U Thor <author@example.com>
Date:   Wed Dec 16 10:48:54 2015 +0000

    1
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1050-large/.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

)
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
	)

Cloning into bare repository 'foo.git'...
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

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

done.
commit f0aeb1993f1f89cccff09a60379174fefefa1f3b
Author: A U Thor <author@example.com>
Date:   Wed Dec 16 10:48:54 2015 +0000

    1
[master (root-commit) 21975ff] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 world
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
	)

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
		)
	
[master 02943d2] hello
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Cloning into 'another'...
Switched to a new branch 'side'
done.
[side 5611ff9] goodbye
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Switched to branch 'master'
ok 1 - setup

commit f0aeb1993f1f89cccff09a60379174fefefa1f3b
Author: A U Thor <author@example.com>
Date:   Wed Dec 16 10:48:54 2015 +0000

    1
ok 15 - detection should not be fooled by a symlink

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
	)

# passed all 15 test(s)
1..15
ok 1 - setup

Cloning into 'submodule_update'...
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

*** t1051-large-conversion.sh ***
done.
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.
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1051-large-conversion/.git/
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
	)

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/"

ok 1 - setup input tests

expecting success: 
	test_config core.autocrlf true &&
	check_input

Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 2 - autocrlf=true converts on input

expecting success: 
	set_attr eol=crlf &&
	check_input

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
fatal: Could not create directory .git/rr-cache
not ok 3 - rerere in workdir (relative) # TODO known breakage

# still have 1 known breakage(s)
# passed all remaining 2 test(s)
1..3
ok 3 - eol=crlf converts on input

expecting success: 
	set_attr ident &&
	check_input

*** t1060-object-corruption.sh ***
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/.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/
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
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/"

[master (root-commit) 0df6d69] content
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 content.t
ok 6 - setup output tests

expecting success: 
	test_config core.autocrlf true &&
	check_output

Cloning into 'sub1'...
1+0 records in
1+0 records out
1 byte (1 B) copied, 0.000453 s, 2.2 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 7 - autocrlf=true converts on output

expecting success: 
	set_attr eol=crlf &&
	check_output

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1060-object-corruption/missing/.git/
done.
ok 8 - eol=crlf converts on output

expecting success: 
	set_attr filter=test &&
	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 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 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"
	)

ok 10 - ident converts on output

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1060-object-corruption/misnamed/.git/
# passed all 10 test(s)
1..10
*** t1090-sparse-checkout-scope.sh ***
Submodule path 'sub1': checked out '58630c04cd08e6914ad0ab5a3126bcfb71a3e6ca'
[master (root-commit) 0df6d69] content
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 content.t
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.t1090-sparse-checkout-scope/.git/
expecting success: 
	echo "initial" >a &&
	echo "initial" >b &&
	echo "initial" >c &&
	git add a b c &&
	git commit -m "initial commit"

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
	)

[master (root-commit) 0f1a731] initial commit
 Author: A U Thor <author@example.com>
 3 files changed, 3 insertions(+)
 create mode 100644 a
 create mode 100644 b
 create mode 100644 c
ok 1 - setup

expecting success: 
	git checkout -b feature &&
	echo "modified" >b &&
	echo "modified" >c &&
	git add b c &&
	git commit -m "modification"

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 5 - read-tree -u detects bit-errors in blobs

ok 2 - git read-tree -u -m: added submodule leaves existing empty directory alone

expecting success: 
	(
		cd missing &&
		rm -f content.t &&
		test_must_fail git read-tree --reset -u HEAD
	)

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
		)
	
Switched to a new branch 'feature'
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'...
[feature 16b7b31] modification
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 2 deletions(-)
ok 2 - create feature branch

expecting success: 
	git config --local --bool core.sparsecheckout true &&
	echo "!/*" >.git/info/sparse-checkout &&
	echo "/a" >>.git/info/sparse-checkout &&
	echo "/c" >>.git/info/sparse-checkout &&
	git checkout master &&
	test_path_is_file a &&
	test_path_is_missing b &&
	test_path_is_file c

remote: error: inflate: data stream error (invalid distance too far back)        
remote: error: unable to unpack d95f3ad14dee633a758d2e331151e950dd13e4ed header        
remote: error: inflate: data stream error (invalid distance too far back)        
remote: fatal: loose object d95f3ad14dee633a758d2e331151e950dd13e4ed (stored in ./objects/d9/5f3ad14dee633a758d2e331151e950dd13e4ed) is corrupt        
Switched to branch 'master'
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 3 - perform sparse checkout of master

expecting success: 
	git merge feature &&
	test_path_is_file a &&
	test_path_is_missing b &&
	test_path_is_file c &&
	test "$(cat c)" = "modified"

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
	)

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'...
Updating 0f1a731..16b7b31
Fast-forward
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1050-large/mid/.git/
 b | 2 +-
 c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Cloning into 'submodule_update'...
ok 4 - merge feature branch into sparse checkout of master

expecting success: 
	git checkout feature &&
	echo "/*" >.git/info/sparse-checkout &&
	git checkout master &&
	test_path_is_file a &&
	test_path_is_file b &&
	test_path_is_file c &&
	test "$(cat b)" = "modified"

Switched to branch 'feature'
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
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

Switched to branch 'master'
ok 5 - return to full checkout of master

Cloning into bare repository 'misnamed-transport'...
done.
# passed all 5 test(s)
1..5
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
*** t1100-commit-tree-options.sh ***
fatal: did not receive expected object d95f3ad14dee633a758d2e331151e950dd13e4ed
fatal: index-pack failed
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'...
Branch add_sub1 set up to track remote branch add_sub1 from origin.
done.
error: Untracked working tree file 'sub1' would be overwritten by merge.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1100-commit-tree-options/.git/
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 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

Cloning into 'missing-checkout'...
expecting success: git write-tree >treeid
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 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
		)
	
done.
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

Cloning into 'misnamed-checkout'...
done.
ok 2 - construct commit

expecting success: git cat-file commit `cat commitid` >commit
test_must_fail: command succeeded: git clone --local misnamed misnamed-checkout
not ok 13 - clone --local detects misnamed objects # TODO known breakage

Cloning into 'submodule_update'...
ok 3 - read commit

expecting success: test_cmp expected commit
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

# still have 1 known breakage(s)
# passed all remaining 12 test(s)
1..13
done.
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.
*** t1200-tutorial.sh ***
ok 5 - flags and then non flags

# passed all 5 test(s)
1..5
t1013-read-tree-submodule.sh: 159: cd: can't cd to sub1
Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
*** t1300-repo-config.sh ***
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)"

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1300-repo-config/.git/
ok 1 - blob

expecting success: 
	test "Hello World" = "$(git cat-file blob 557db03)"

expecting success: 
	rm -f .git/config

ok 1 - clear default config

ok 2 - blob 557db03

expecting success: 
	git config core.penguin "little blue" &&
	test_cmp expect .git/config

expecting success: 
	git diff-files -p > diff.output &&
	test_cmp diff.expect diff.output

ok 3 - git diff-files -p

ok 2 - initial

expecting success: 
	git diff > diff.output &&
	test_cmp diff.expect diff.output

expecting success: 
	git config Core.Movie BadPhysics &&
	test_cmp expect .git/config

ok 4 - git diff

expecting success: 
	tree=$(git write-tree 2>/dev/null) &&
	test 8988da15d077d4829fc51d8544c097def6644dbb = $tree

ok 3 - mixed case

ok 5 - tree

expecting success: 
	git config Cores.WhatEver Second &&
	test_cmp expect .git/config

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

ok 4 - similar section

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^

expecting success: 
	git config CORE.UPPERCASE true &&
	test_cmp expect .git/config

ok 5 - uppercase section

expecting success: 
	git config core.penguin kingpin !blue

ok 6 - replace with non-match

expecting success: 
	git config core.penguin "very blue" !kingpin

ok 7 - replace with non-match (actually matching)

expecting success: 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 8 - non-match result

expecting success: 
	echo Second >expect &&
	git config cores.whatever >actual &&
	test_cmp expect actual

ok 7 - git diff HEAD

ok 9 - find mixed-case key by canonical name

expecting success: 
	echo Second >expect &&
	git config CoReS.WhAtEvEr >actual &&
	test_cmp expect actual

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
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 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 8 - git whatchanged -p --root

expecting success: 
	git tag my-first-tag &&
	test_cmp .git/refs/heads/master .git/refs/tags/my-first-tag

ok 9 - git tag my-first-tag

expecting success: 
	git checkout -b mybranch &&
	test_cmp .git/refs/heads/master .git/refs/heads/mybranch

ok 11 - subsections are not canonicalized by git-config

expecting success: 
	git config --unset beta.baz

ok 12 - unset with cont. lines

Switched to a new branch 'mybranch'
M	hello
expecting success: test_cmp expect .git/config
ok 10 - git checkout -b mybranch

ok 13 - unset with cont. lines is correct

expecting success: 
	git branch > branch.output &&
	test_cmp branch.expect branch.output

expecting success: 
	git config --unset-all beta.haha

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 14 - multiple unset

expecting success: 
	test_cmp expect .git/config

ok 15 - multiple unset is correct

expecting success: 
	test_must_fail git config --replace-all beta.haha &&
	test_cmp .git/config2 .git/config

Already on 'mybranch'
M	hello
Cloning into 'sub1'...
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
    --name-only           show variable names only
    --includes            respect include directives on lookup

ok 16 - --replace-all missing value

expecting success: 
	git config --replace-all beta.haha gamma

ok 17 - --replace-all

expecting success: 
	test_cmp expect .git/config

[mybranch 9014374] Some work.
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+)
ok 18 - all replaced

expecting success: 
	git config beta.haha alpha &&
	test_cmp expect .git/config

Switched to branch 'master'
done.
ok 19 - really mean test

expecting success: 
	git config nextsection.nonewline wow &&
	test_cmp expect .git/config

[master ab01a1a] Some fun.
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
ok 20 - really really mean test

expecting success: 
	echo alpha >expect &&
	git config beta.haha >actual &&
	test_cmp expect actual

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 12 - git resolve now fails

ok 21 - get value

expecting success: 
	git config --unset beta.haha &&
	test_cmp expect .git/config

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 22 - unset

expecting success: 
	git config nextsection.NoNewLine "wow2 for me" "for me$" &&
	test_cmp expect .git/config

[master 062f127] Merge work in mybranch
 Author: A U Thor <author@example.com>
ok 23 - multivar

expecting success: 
	git config --get nextsection.nonewline !for

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

wow
ok 24 - non-match

expecting success: 
	echo wow >expect &&
	git config --get nextsection.nonewline !for >actual &&
	test_cmp expect actual

Switched to branch 'mybranch'
ok 25 - non-match value

expecting success: 
	echo "wow2 for me" >expect &&
	git config --get nextsection.nonewline >actual &&
	test_cmp expect actual

Submodule path 'sub1': checked out '58630c04cd08e6914ad0ab5a3126bcfb71a3e6ca'
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

ok 14 - git resolve

expecting success: 
	test_i18ncmp resolve.expect resolve.output

ok 15 - git resolve output

ok 27 - multi-valued get-all returns all

expecting success: 
	git show-branch --topo-order master mybranch > show-branch2.output &&
	test_cmp show-branch2.expect show-branch2.output

expecting success: 
	git config nextsection.nonewline "wow3" "wow$" &&
	test_cmp expect .git/config

ok 28 - multivar replace

expecting success: 
	test_must_fail git config --unset nextsection.nonewline

ok 16 - git show-branch (part 2)

expecting success: 
	git show-branch --topo-order --more=2 master mybranch \
		> show-branch3.output &&
	test_cmp show-branch3.expect show-branch3.output

warning: nextsection.nonewline has multiple values
ok 29 - ambiguous unset

expecting success: 
	test_must_fail git config --unset somesection.nonewline

ok 30 - invalid unset

expecting success: 
	git config --unset nextsection.nonewline "wow3$" &&
	test_cmp expect .git/config

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 31 - multivar unset

expecting success: test_must_fail git config inval.2key blabla
Already on 'mybranch'
error: invalid key: inval.2key
ok 32 - invalid key

expecting success: git config 123456.a123 987
HEAD is now at 9014374 Some work.
ok 33 - correct key

expecting success: 
	git config Version.1.2.3eX.Alpha beta

ok 34 - hierarchical section

ok 4 - git read-tree -u -m: 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
		)
	
Switched to branch 'master'
expecting success: 
	test_cmp expect .git/config

ok 35 - hierarchical section value

expecting success: 
	git config --list > output &&
	test_cmp expect output

HEAD is now at ab01a1a Some fun.
:100644 100644 6cef6d8... 171a2cf... M	large1
ok 18 - rewind to "Some fun." and "Some work."

ok 36 - working --list

ok 5 - diff --raw

expecting success: 
	git diff --stat HEAD^ HEAD

expecting success: 
	git show-branch --topo-order > show-branch4.output &&
	test_cmp show-branch4.expect show-branch4.output

expecting success: 
	git --git-dir=nonexistent config --list >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 37 - --list without repo produces empty output

expecting success: 
	git config --name-only --list >output &&
	test_cmp expect output

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

ok 38 - --name-only --list

Binary files a/large1 and b/large1 differ
ok 7 - diff

expecting success: 
	git diff --cached HEAD^ >actual &&
	grep "Binary files.*differ" actual

expecting success: 
	git config --get-regexp in >output &&
	test_cmp expect output

ok 39 - --get-regexp

expecting success: 
	git config --name-only --get-regexp in >output &&
	test_cmp expect output

Binary files a/large1 and b/large1 differ
ok 8 - diff --cached

expecting success: 
	git hash-object large1

ok 20 - manual merge

expecting success: 
	git ls-files --stage > ls-files.output &&
	test_cmp ls-files.expect ls-files.output

ok 40 - --name-only --get-regexp

expecting success: 
	git config --add nextsection.nonewline "wow4 for you" &&
	git config --get-all nextsection.nonewline > output &&
	test_cmp expect output

Cloning into 'submodule_update'...
ok 21 - git ls-files --stage

expecting success: 
	git ls-files --unmerged > ls-files-unmerged.output &&
	test_cmp ls-files-unmerged.expect ls-files-unmerged.output

ok 41 - --add

ok 22 - git ls-files --unmerged

expecting success: 
	git config --get novalue.variable ^$

expecting success: 
	test_must_fail git merge-index git-merge-one-file hello


ok 42 - get variable with no value

expecting success: 
	git config --get emptyvalue.variable ^$


ok 43 - get variable with empty value

expecting success: 
	git config --get-regexp novalue > output &&
	test_cmp expect output

done.
ok 44 - get-regexp variable with no value

expecting success: 
	git config --bool --get-regexp novalue > output &&
	test_cmp expect output

ok 45 - get-regexp --bool variable with no value

expecting success: 
	git config --get-regexp emptyvalue > output &&
	test_cmp expect output

ok 46 - get-regexp variable with empty value

expecting success: 
	git config --bool novalue.variable > output &&
	test_cmp expect output

Auto-merging hello
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 47 - get bool variable with no value

expecting success: 
	git config --bool emptyvalue.variable > output &&
	test_cmp expect output

171a2cf5cd75bd8d405266c986591716925e9712
ok 9 - hash-object

expecting success: 
	git cat-file blob :large1 >/dev/null

ok 48 - get bool variable with empty value

expecting success: 
	test_must_fail git config >output 2>&1 &&
	test_i18ngrep usage 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

usage: git config [<options>]
ok 24 - git ls-files --stage (part 2)
ok 49 - no arguments, but no crash


expecting success: git repack
error: 8ed2e6719f8484ce01fa3ce133fe42d25c2441b8^{commit}: expected commit type, but the object dereferences to tree type
fatal: Needed a single revision
ok 10 - cat-file a large file

expecting success: 
	git tag -m largefile largefiletag :large1 &&
	git cat-file blob largefiletag >/dev/null

expecting success: 
	git config a.x y &&
	test_cmp expect .git/config

ok 50 - new section is partial match of another

Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
expecting success: 
	git config b.x y &&
	git config a.b c &&
	test_cmp expect .git/config

ok 11 - cat-file a large file from a tag

expecting success: 
	git show :large1 >/dev/null


ok 51 - new variable inserts into proper section

expecting success: 
	test_must_fail git config --file non-existing-config -l

fatal: unable to read config file 'non-existing-config': No such file or directory
ok 52 - alternative --file (non-existing file should fail)

expecting success: 
	GIT_CONFIG=other-config git config --list >output &&
	test_cmp expect output

ok 53 - alternative GIT_CONFIG

expecting success: 
	git config --file other-config --list >output &&
	test_cmp expect output

ok 54 - alternative GIT_CONFIG (--file)

expecting success: 
	git config --file - --list <other-config >output &&
	test_cmp expect output

ok 25 - git repack

expecting success: git prune-packed
ok 55 - alternative GIT_CONFIG (--file=-)

expecting success: 
	test_must_fail git config --file - some.value foo

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

fatal: writing to stdin is not supported
Cloning into 'foo'...
ok 56 - setting a value in stdin is an error

expecting success: 
	test_must_fail git config --file - --edit

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

fatal: editing stdin is not supported
ok 57 - 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
	)


ok 58 - refer config from subdirectory

expecting success: 
	(
		cd x &&
		git config --file=../other-config --get ein.bahn >actual &&
		test_cmp expect actual
	)

ok 27 - -> only packed objects

# passed all 27 test(s)
1..27
ok 59 - refer config from subdirectory via --file

expecting success: 
	git config --file=other-config anwohner.park ausweis &&
	test_cmp expect other-config

ok 60 - --set in alternative file

expecting success: 
	git config --rename-section branch.eins branch.zwei

*** t1301-shared-repo.sh ***
ok 61 - rename section

expecting success: 
	test_cmp expect .git/config

ok 62 - rename succeeded

expecting success: 
	test_must_fail git config --rename-section \
		branch."world domination" branch.drei

fatal: No such section!
ok 63 - rename non-existing section

expecting success: 
	test_cmp expect .git/config

ok 64 - rename succeeded

expecting success: 
	git config --rename-section branch."1 234 blabl/a" branch.drei

ok 65 - rename another section

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
expecting success: 
	test_cmp expect .git/config

ok 66 - rename succeeded

expecting success: 
	git config --rename-section branch.vier branch.zwei

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1301-shared-repo/.git/
ok 67 - rename a section with a var on the same line

expecting success: 
	test_cmp expect .git/config

ok 68 - rename succeeded

expecting success: 
	test_must_fail git config --rename-section branch.zwei ""

expecting success: 
	test_when_finished "rm -rf sub" &&
	mkdir sub && (
		cd sub &&
		test_must_fail git init --shared=0400
	)

error: invalid section name: 
ok 69 - renaming empty section name is rejected

expecting success: 
	test_must_fail git config --rename-section branch.zwei "bogus name"

fatal: Problem with core.sharedRepository filemode value (0400).
The owner of files must always have read and write permissions.
error: invalid section name: bogus name
ok 70 - renaming to bogus section is rejected

ok 1 - shared = 0400 (faulty permission u-w)

expecting success: 
	git config --remove-section branch.zwei

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 71 - remove section

expecting success: 
	test_cmp expect .git/config

ok 72 - section was removed properly

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


Initialized empty shared Git repository in /«PKGBUILDDIR»/t/trash directory.t1301-shared-repo/sub/.git/
ok 2 - shared=1 does not clear bits preset by umask 002

Cloning into 'sub1'...
ok 73 - section ending

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: 
	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/
done.
ok 74 - numbers

expecting success: 
	git config giga.watts 121g &&
	echo 129922760704 >expect &&
	git config --int --get giga.watts >actual &&
	test_cmp expect actual

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)

ok 75 - --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

Initialized empty shared Git repository in /«PKGBUILDDIR»/t/trash directory.t1301-shared-repo/sub/.git/
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

ok 76 - invalid unit

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
[master (root-commit) a2bd363] a1
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 a1
Submodule path 'sub1': checked out '58630c04cd08e6914ad0ab5a3126bcfb71a3e6ca'
ok 5 - update-server-info honors core.sharedRepository

expecting success: 

		rm -f .git/info/refs &&
		git update-server-info &&
		actual="$(modebits .git/info/refs)" &&
		verbose test "x$actual" = "x-$y"

	
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"

	
ok 7 - shared = 0660 (rw-rw----) rw

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: 

		rm -f .git/info/refs &&
		git update-server-info &&
		actual="$(modebits .git/info/refs)" &&
		verbose test "x$actual" = "x-$y"

	
ok 77 - bool

expecting success: 

	git config bool.nobool foobar &&
	test_must_fail git config --bool --get bool.nobool
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"

	
fatal: bad numeric config value 'foobar' for 'bool.nobool' in .git/config: invalid unit
ok 78 - 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 79 - invalid bool (set)

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
ok 9 - shared = 0640 (rw-r-----) rw

Cloning into 'submodule_update'...
expecting success: 

		rm -f .git/info/refs &&
		git update-server-info &&
		actual="$(modebits .git/info/refs)" &&
		verbose test "x$actual" = "x-$y"

	
done.
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 13 - index-pack

expecting success: 
	git repack -ad

ok 80 - set --bool

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 11 - shared = 0600 (rw-------) rw

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

expecting success: 

		rm -f .git/info/refs &&
		git update-server-info &&
		actual="$(modebits .git/info/refs)" &&
		verbose test "x$actual" = "x-$y"

	
ok 81 - 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

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 - 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 82 - get --bool-or-int

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

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 83 - set --bool-or-int

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

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
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 16 - info/refs respects umask in unshared repo

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 84 - 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

ok 17 - git reflog expire honors core.sharedRepository

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)"

ok 85 - 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

Initialized empty shared Git repository in /«PKGBUILDDIR»/t/trash directory.t1301-shared-repo/sub/new/.git/
Cloning into 'sub1'...
fatal: failed to expand user dir in: '~/'
[master (root-commit) e4c5dc6] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 frotz
ok 86 - 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 87 - get --path barfs on boolean variable

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

done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1050-large/loose/.git/
ok 88 - quoting

expecting success: 
	test_must_fail git config "key.with
newline" 123
error: invalid key: key.with
newline
ok 89 - key with newline

expecting success: git config key.sub value.with\\\
newline
ok 90 - value with newline

expecting success: 
	git config --list > result &&
	test_cmp result expect

ok 91 - value continued on next line

expecting success: 
	git config --null --list | nul_to_q >result &&
	echo >>result &&
	test_cmp expect result

ok 18 - forced modes

Submodule path 'sub1': checked out '58630c04cd08e6914ad0ab5a3126bcfb71a3e6ca'
ok 92 - --null --list

expecting success: 
	git config --null --get-regexp "val[0-9]" | nul_to_q >result &&
	echo >>result &&
	test_cmp expect result

# passed all 18 test(s)
1..18
ok 93 - --null --get-regexp

expecting success: 
	git config section.val "foo 	  bar" &&
	echo "foo 	  bar" >expect &&
	git config section.val >actual &&
	test_cmp expect actual

ok 94 - inner whitespace kept verbatim

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

)
*** t1302-repo-version.sh ***
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

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.t1302-repo-version/.git/
ok 95 - symlinked configuration

expecting success: 
	test_must_fail git config --file=doesnotexist --list &&
	test_must_fail git config --file=doesnotexist test.xyzzy

fatal: unable to read config file 'doesnotexist': No such file or directory
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

ok 96 - 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

fatal: unable to read config file 'linktonada': No such file or directory
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1302-repo-version/test/.git/
fatal: unable to read config file 'linktolinktonada': No such file or directory
ok 97 - 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

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
		)
	
fatal: Bad alias.split-cmdline-fix string: unclosed quote
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

[master (root-commit) 132b1ec] initial commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
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 <= 1, found 99
warning: Please upgrade Git
fatal: Bad branch.master.mergeoptions string: unclosed quote
ok 98 - 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

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
	)

 test.txt |    1 +
 1 file changed, 1 insertion(+)
Cloning into 'submodule_update'...
 test.txt |    1 +
 1 file changed, 1 insertion(+)
warning: Expected git repo version <= 1, found 99
warning: Please upgrade Git
 test.txt |    1 +
 1 file changed, 1 insertion(+)
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
	)

error: key does not contain a section: name
ok 99 - git -c "key=value" support

expecting success: 
	echo >expect &&
	git -c foo.empty= config --path foo.empty >actual &&
	test_cmp expect actual

dc5b4c5413c9a2a6ca4f121474e1c9c8ea086153
ok 100 - 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

warning: Expected git repo version <= 1, found 99
warning: Please upgrade Git
fatal: --index outside a repository
ok 5 - gitdir required mode

expecting success: 
		mkconfig 0  >.git/config &&
		check_allow
	
done.
error: key does not contain a section: foo=bar
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1050-large/packed/.git/
error: invalid key: foo=.bar
ok 6 - allow version=0 

expecting success: 
		mkconfig 1  >.git/config &&
		check_allow
	
error: invalid key: foo.ba=r
ok 7 - allow version=1 

expecting success: 
		mkconfig 1 noop >.git/config &&
		check_allow
	
error: invalid key: foo.1bar
error: invalid key (newline): foo.ba
				z.bar
ok 8 - allow version=1 noop

expecting success: 
		mkconfig 1 no-such-extension >.git/config &&
		check_abort
	
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
error: key does not contain a section: .
fatal: unknown repository extension: no-such-extension
ok 9 - abort version=1 no-such-extension

expecting success: 
		mkconfig 0 no-such-extension >.git/config &&
		check_allow
	
error: key does not contain a section: .foo
ok 10 - allow version=0 no-such-extension

expecting success: 
	mkconfig 1 preciousObjects >.git/config &&
	check_allow

error: key does not contain variable name: foo.
error: key does not contain variable name: .foo.
ok 11 - precious-objects allowed

expecting success: 
	test_must_fail git repack -ad

fatal: cannot delete packs in a precious-objects repo
ok 12 - precious-objects blocks destructive repack

expecting success: 
	test_commit foo &&
	git repack

ok 101 - 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

[master (root-commit) ddd63c9] foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo.t
ok 102 - 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 103 - git -c does not split values on equals

expecting success: 
	test_must_fail git -c core.bare=foo rev-parse

fatal: bad numeric config value 'foo' for 'core.bare': invalid unit
ok 104 - git -c dies on bogus config

expecting success: 
	test_must_fail git -c "=foo" rev-parse

error: bogus config parameter: =foo
fatal: unable to parse command-line config
ok 105 - git -c complains about empty key

expecting success: 
	test_must_fail git -c "" rev-parse

error: bogus config parameter: 
fatal: unable to parse command-line config
ok 106 - 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

ok 15 - pack-objects with large loose object

expecting success: 
	git archive --format=tar HEAD >/dev/null

ok 107 - 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

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 13 - other repacks are OK

expecting success: 
	test_must_fail git prune

fatal: cannot prune in a precious-objects repo
ok 14 - precious-objects blocks prune

expecting success: 
	git gc

ok 108 - 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 16 - tar achiving

expecting success: 
	git archive --format=zip -0 HEAD >/dev/null

fatal: bad config file line 3 in .git/config
ok 109 - 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 110 - 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

ok 15 - gc runs without complaint

# passed all 15 test(s)
1..15
fatal: bad config file line 3 in .git/config
ok 111 - 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

Cloning into 'sub1'...
*** t1303-wacky-config.sh ***
ok 112 - 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

done.
ok 17 - zip achiving, store only

expecting success: 
	git archive --format=zip HEAD >/dev/null

--- expect	2015-12-16 10:49:03.721564768 +0000
+++ .git/config	2015-12-16 10:49:03.741564768 +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 113 - 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-12-16 10:49:03.765564768 +0000
+++ .git/config	2015-12-16 10:49:03.785564768 +0000
@@ -1,2 +1,3 @@
 [section]
+[section]
 	key = value
not ok 114 - 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"

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1303-wacky-config/.git/
expecting success: 
	setup &&
	git config section.key bar &&
	check section.key bar

ok 115 - preserves existing permissions

ok 1 - modify same key

expecting success: 
	setup &&
	git config section.other bar &&
	check section.key foo &&
	check section.other bar

# still have 2 known breakage(s)
# passed all remaining 113 test(s)
1..115
Submodule path 'sub1': checked out '58630c04cd08e6914ad0ab5a3126bcfb71a3e6ca'
*** t1304-default-acl.sh ***
ok 2 - add key in same section

expecting success: 
	setup &&
	git config section2.key bar &&
	check section.key foo &&
	check section2.key bar

ok 3 - add key in different section

expecting success: 
	git config "$SECTION" bar &&
	check "$SECTION" bar

ok 4 - make sure git config escapes section names properly

Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1304-default-acl/.git/
expecting success: 
	setup &&
	git config section.key "$LONG_VALUE" &&
	check section.key "$LONG_VALUE"

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

t1304-default-acl.sh: 4: eval: setfacl: not found
ok 1 - checking for a working acl setup

skipping test: Setup test repo 
	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 2 # skip Setup test repo (missing SETFACL)

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

skipping test: Objects creation does not break ACLs with restrictive umask 
	# SHA1 for empty blob
	check_perms_and_acl .git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391

ok 3 # skip Objects creation does not break ACLs with restrictive umask (missing SETFACL)

skipping test: git gc does not break ACLs with restrictive umask 
	git gc &&
	check_perms_and_acl .git/objects/pack/*.pack

ok 4 # skip git gc does not break ACLs with restrictive umask (missing SETFACL)

# passed all 4 test(s)
1..4
*** t1305-config-include.sh ***
warning: unable to rmdir sub1: Directory not empty
ok 6 - get many entries

expecting success: 
	setup_many &&
	git config --get-regexp "sec.*ke." >actual &&
	test_line_count = 3126 actual

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 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

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 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 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
		)
	
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 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

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

Cloning into 'submodule_update'...
ok 8 - add and replace one of many entries

expecting success: 
	setup_many &&
	git config --replace-all section.key bar &&
	check section.key bar

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

done.
ok 10 - config modification does not affect includes

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 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

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 9 - replace many entries

expecting success: 
	setup_many &&
	git config --unset-all section.key &&
	test_must_fail git config section.key

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

error: relative config includes must come from files
fatal: unable to parse command-line config
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 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

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 19 - fsck

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

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

# passed all 19 test(s)
1..19
ok 16 - absolute includes from stdin work

expecting success: 
	echo "[test]one = 1" >one &&
	echo "[include]path=one" |
	test_must_fail git config --file - test.one

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

ok 11 - --add appends new value after existing empty value

# passed all 11 test(s)
1..11
fatal: exceeded maximum include depth (10) while including
ok 18 - include cycles are detected

# passed all 18 test(s)
1..18
*** t1306-xdg-files.sh ***
*** t1307-config-blob.sh ***
*** t1308-config-set.sh ***
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.t1306-xdg-files/.git/
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/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1308-config-set/.git/
expecting success: 
	cat >config <<-\EOF &&
	[some]
		value = 1
	EOF
	git add config &&
	git commit -m foo

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 1 - read config: xdg file exists and ~/.gitconfig doesn't
ok 1 - setup default config


expecting success: 
	check_config get_value case.penguin "very blue"

expecting success: 
	>.gitconfig &&
	echo "[alias]" >.gitconfig &&
	echo "	myalias = !echo in_gitconfig" >>.gitconfig &&
	echo in_gitconfig >expected &&
	git myalias >actual &&
	test_cmp expected actual

ok 2 - get value for a simple key

expecting success: 
	check_config get_value case.my ""

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

[master (root-commit) 71c4991] foo
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+)
 create mode 100644 config
ok 1 - create config blob

expecting success: 
	echo some.value=1 >expect &&
	git config --blob=HEAD:config --list >actual &&
	test_cmp expect actual

ok 3 - get value for a key with value as an empty string

expecting success: 
	check_config get_value case.foo "(NULL)"

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

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 2 - list config blob contents

expecting success: 
	echo true >expect &&
	git config --blob=HEAD:config --bool some.value >actual &&
Cloning into 'sub1'...
	test_cmp expect actual

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 3 - fetch value from blob

expecting success: 
	test_must_fail git config --blob=HEAD:config non.existing

ok 5 - upper case key
ok 5 - read with --get: xdg file exists and ~/.gitconfig exists


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: 
	rm .gitconfig &&
	echo user.name=read_config >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

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]
done.
    --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
    --name-only           show variable names only
    --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

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

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

ok 7 - read with --list: xdg file exists and ~/.gitconfig exists

expecting success: 
	git init git &&
	cd git &&
	echo foo >to_be_excluded

error: reference 'HEAD' does not point to a blob
fatal: error processing config file(s)
ok 7 - reading from non-blob is an error

expecting success: 
	test_must_fail git config --blob=HEAD:config some.value foo

ok 6 - mixed case key

expecting success: 
	check_config get_value case.Movie "BadPhysics"

fatal: writing config blobs is not supported
ok 8 - setting a value in a blob is an error

expecting success: 
	test_must_fail git config --blob=HEAD:config --unset some.value

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1306-xdg-files/git/.git/
ok 8 - Setup

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 - 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"

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

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: 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.
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"

[master 2ae01d5] broken
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
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

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

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

Submodule path 'sub1': checked out '58630c04cd08e6914ad0ab5a3126bcfb71a3e6ca'
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 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"

[master 523ca0c] CR
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 2 deletions(-)
ok 12 - can parse blob ending with CR
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

# passed all 12 test(s)
1..12
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
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 14 - Checking attributes in the XDG attributes file

expecting success: 
	>expected &&
	(sane_unset HOME &&
	 git check-attr -a f >actual) &&
	test_cmp expected actual

*** t1400-update-ref.sh ***
error: Untracked working tree file 'sub1/file1' would be overwritten by merge.
ok 11 - find value with misspelled key

expecting success: 
	check_config get_value case.baz "hask"

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 12 - find value with the highest priority

expecting success: 
	check_config get_int lamb.chop 65

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 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 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

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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1400-update-ref/.git/
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

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

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


ok 8 - git read-tree -u -m: replace submodule with a directory must fail

fatal: bad numeric config value 'none' for 'lamb.head': invalid unit
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 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 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

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

# passed all 21 test(s)
1..21
ok 17 - find bool value for the entered key

expecting success: 
	check_config get_value_multi case.baz sam bat hask

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

*** t1401-symbolic-ref.sh ***
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

Cloning into 'submodule_update'...
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

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

ok 1 - setup

expecting success: git update-ref refs/heads/master 102939797ab91a4f201d131418d2c9d919dcdd2c &&
	 test 102939797ab91a4f201d131418d2c9d919dcdd2c = $(cat .git/refs/heads/master)
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"
done.
	return $status

)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1401-symbolic-ref/.git/
expecting success: 
	git symbolic-ref HEAD refs/heads/foo &&
	echo ref: refs/heads/foo >expect &&
	test_cmp expect .git/HEAD

ok 2 - create refs/heads/master

expecting success: git update-ref refs/heads/master 56d5c1374e8028a1e122ab046ab7b98165342dc4 102939797ab91a4f201d131418d2c9d919dcdd2c &&
	 test 56d5c1374e8028a1e122ab046ab7b98165342dc4 = $(cat .git/refs/heads/master)
rm: cannot remove 'SANETESTD.1/x': Permission denied
ok 1 - symbolic-ref writes HEAD

expecting success: 
	echo refs/heads/foo >expect &&
	git symbolic-ref HEAD >actual &&
	test_cmp expect actual

ok 3 - create refs/heads/master

expecting success: 
	test_must_fail git update-ref -d $m $A &&
	test $B = "$(cat .git/$m)"

Switched to a new branch 'add_sub1'
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

Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 2 - symbolic-ref reads HEAD

expecting success: 
	test_must_fail git symbolic-ref HEAD foo

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

fatal: Refusing to point HEAD outside of refs/
ok 3 - symbolic-ref refuses non-ref for HEAD

expecting success: 
	echo content >file && git add file && git commit -m one &&
	test_must_fail git symbolic-ref HEAD `git rev-parse HEAD`

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 5 - delete refs/heads/master

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

[foo (root-commit) 106c6c8] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
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 - 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 4 - symbolic-ref refuses bare sha1

ok 25 - proper error on error in custom config files

expecting success: 
	git symbolic-ref -d HEAD &&
	test_path_is_file .git/refs/heads/foo &&
	test_path_is_missing .git/HEAD

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 7 - fail to create refs/heads/gu/fixes

expecting success: git update-ref HEAD 102939797ab91a4f201d131418d2c9d919dcdd2c &&
	 test 102939797ab91a4f201d131418d2c9d919dcdd2c = $(cat .git/refs/heads/master)
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 8 - create refs/heads/master (by HEAD)

expecting success: git update-ref HEAD 56d5c1374e8028a1e122ab046ab7b98165342dc4 102939797ab91a4f201d131418d2c9d919dcdd2c &&
	 test 56d5c1374e8028a1e122ab046ab7b98165342dc4 = $(cat .git/refs/heads/master)
fatal: bad config variable 'alias.br' in file '.git/config' at line 2
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 26 - check line errors for malformed values

# passed all 26 test(s)
1..26
ok 9 - create refs/heads/master (by HEAD)

expecting success: 
	test_must_fail git update-ref -d HEAD $A &&
	test $B = $(cat .git/$m)

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

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

ok 8 - symbolic-ref fails to delete real ref

*** t1402-check-ref-format.sh ***
ok 11 - delete refs/heads/master (by HEAD)

expecting success: 
	test_when_finished "git update-ref -d $outside" &&
	git update-ref $outside $A &&
	git rev-parse $A >expect &&
	git rev-parse $outside >actual &&
	test_cmp expect actual &&
	test_must_fail git reflog exists $outside

# passed all 8 test(s)
1..8
*** t1403-show-ref.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1402-check-ref-format/.git/
ok 12 - update-ref does not create reflogs by default

expecting success: 
	test_when_finished "git update-ref -d $outside" &&
	git update-ref --create-reflog $outside $A &&
	git rev-parse $A >expect &&
	git rev-parse $outside >actual &&
	test_cmp expect actual &&
	git reflog exists $outside

expecting success: 
		test_must_fail git check-ref-format  ''
	
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 1 - ref name '' is invalid

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1403-show-ref/.git/
expecting success: 
		test_must_fail git check-ref-format  '/'
	
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 2 - ref name '/' is invalid

expecting success: 
		test_must_fail git check-ref-format --allow-onelevel '/'
	
ok 3 - ref name '/' is invalid with options --allow-onelevel

ok 13 - update-ref creates reflogs with --create-reflog

expecting success: git update-ref HEAD 102939797ab91a4f201d131418d2c9d919dcdd2c &&
	 test 102939797ab91a4f201d131418d2c9d919dcdd2c = $(cat .git/refs/heads/master)
expecting success: 
		test_must_fail git check-ref-format --normalize '/'
	
ok 4 - ref name '/' is invalid with options --normalize

[master (root-commit) 0ddfaf1] A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 A.t
expecting success: 
		test_must_fail git check-ref-format --allow-onelevel --normalize '/'
	
ok 14 - create refs/heads/master (by HEAD)

expecting success: git pack-refs --all
ok 5 - ref name '/' is invalid with options --allow-onelevel --normalize

expecting success: 
		git check-ref-format  'foo/bar/baz'
	
ok 15 - pack refs

expecting success: git update-ref HEAD 56d5c1374e8028a1e122ab046ab7b98165342dc4 102939797ab91a4f201d131418d2c9d919dcdd2c &&
	 test 56d5c1374e8028a1e122ab046ab7b98165342dc4 = $(cat .git/refs/heads/master)
ok 6 - ref name 'foo/bar/baz' is valid

expecting success: 
		git check-ref-format --normalize 'foo/bar/baz'
	
Updated tag 'A' (was 0ddfaf1)
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 16 - move refs/heads/master (by HEAD)

expecting success: 
	git update-ref -d HEAD $B &&
	! grep "$m" .git/packed-refs &&
	! test -f .git/$m

Cloning into 'sub1'...
ok 8 - ref name 'refs///heads/foo' is invalid

expecting success: 
		git check-ref-format --normalize 'refs///heads/foo'
	
Switched to a new branch 'side'
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 17 - delete refs/heads/master (by HEAD) should remove both packed and loose refs/heads/master

ok 10 - ref name 'heads/foo/' is invalid

expecting success: 
		test_must_fail git check-ref-format  '/heads/foo'
	
expecting success: 
	git update-ref --no-deref -d HEAD &&
	! test -f .git/HEAD

ok 11 - ref name '/heads/foo' is invalid
[side d9df450] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 B.t

expecting success: 
		git check-ref-format --normalize '/heads/foo'
	
ok 18 - delete symref without dereference

done.
heads/foo
ok 12 - ref name '/heads/foo' is valid with options --normalize

expecting success: 
		test_must_fail git check-ref-format  '///heads/foo'
	
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

ok 13 - ref name '///heads/foo' is invalid

expecting success: 
		git check-ref-format --normalize '///heads/foo'
	
Updated tag 'B' (was d9df450)
heads/foo
ok 14 - ref name '///heads/foo' is valid with options --normalize

expecting success: 
		test_must_fail git check-ref-format  './foo'
	
ok 15 - ref name './foo' is invalid

expecting success: 
		test_must_fail git check-ref-format  './foo/bar'
	
Switched to branch 'master'
[master (root-commit) 40d5b0c] foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo.c
ok 16 - ref name './foo/bar' is invalid

expecting success: 
		test_must_fail git check-ref-format  'foo/./bar'
	
ok 17 - ref name 'foo/./bar' is invalid

expecting success: 
		test_must_fail git check-ref-format  'foo/bar/.'
	
ok 18 - ref name 'foo/bar/.' is invalid

expecting success: 
		test_must_fail git check-ref-format  '.refs/foo'
	
ok 19 - delete symref without dereference when the referred ref is packed

[master 5dee784] C
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 C.t
ok 19 - ref name '.refs/foo' is invalid

expecting success: 
		test_must_fail git check-ref-format  'refs/heads/foo.'
	
ok 20 - ref name 'refs/heads/foo.' is invalid

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

expecting success: 
		test_must_fail git check-ref-format  'heads/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 21 - ref name 'heads/foo..bar' is invalid

expecting success: 
		test_must_fail git check-ref-format  'heads/foo?bar'
	
error: cannot lock ref 'refs/heads/self': unable to resolve reference refs/heads/self: Too many levels of symbolic links
ok 22 - ref name 'heads/foo?bar' is invalid

expecting success: 
		git check-ref-format  'foo./bar'
	
ok 20 - 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 23 - ref name 'foo./bar' is valid

expecting success: 
		test_must_fail git check-ref-format  'heads/foo.lock'
	
Submodule path 'sub1': checked out '58630c04cd08e6914ad0ab5a3126bcfb71a3e6ca'
ok 24 - ref name 'heads/foo.lock' is invalid

expecting success: 
		test_must_fail git check-ref-format  'heads///foo.lock'
	
ok 21 - 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

ok 25 - ref name 'heads///foo.lock' is invalid

expecting success: 
		test_must_fail git check-ref-format  'foo.lock/bar'
	
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 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 28 - ref name 'heads/foo@bar' is valid

expecting success: 
		test_must_fail git check-ref-format  'heads/v@{ation'
	
ok 22 - update-ref --no-deref -d can delete reference to bad ref

expecting success: 
	test_must_fail git update-ref HEAD 102939797ab91a4f201d131418d2c9d919dcdd2c 56d5c1374e8028a1e122ab046ab7b98165342dc4

fatal: update_ref failed for ref 'HEAD': cannot lock ref 'HEAD': unable to resolve reference HEAD: No such file or directory
ok 29 - ref name 'heads/v@{ation' is invalid

expecting success: 
		test_must_fail git check-ref-format  'heads/foo\bar'
	
ok 23 - (not) create HEAD with old sha1

expecting success: 
	! test -f .git/refs/heads/master

Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
ok 24 - (not) prior created .git/refs/heads/master

expecting success: git update-ref HEAD 102939797ab91a4f201d131418d2c9d919dcdd2c
ok 30 - ref name 'heads/foo\bar' is invalid

expecting success: 
		test_must_fail git check-ref-format  'heads/foo	'
	
ok 31 - ref name 'heads/foo	' is invalid

expecting success: 
		test_must_fail git check-ref-format  'heads/foo'
	
ok 25 - create HEAD

expecting success: 
	test_must_fail git update-ref HEAD 56d5c1374e8028a1e122ab046ab7b98165342dc4 0000000000000000000000000000000000000000

ok 32 - ref name 'heads/foo' is invalid

expecting success: 
		git check-ref-format  'heads/fuß'
	
fatal: update_ref failed for ref 'HEAD': cannot lock ref 'HEAD': ref refs/heads/master is at 102939797ab91a4f201d131418d2c9d919dcdd2c but expected 0000000000000000000000000000000000000000
ok 26 - (not) change HEAD with wrong SHA1

expecting success: 
	! test 56d5c1374e8028a1e122ab046ab7b98165342dc4 = $(cat .git/refs/heads/master)

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

ok 33 - ref name 'heads/fuß' is valid

expecting success: 
		git check-ref-format --refspec-pattern 'heads/*foo/bar'
	
ok 27 - (not) changed .git/refs/heads/master

ok 34 - ref name 'heads/*foo/bar' is valid with options --refspec-pattern

expecting success: 
		git check-ref-format --refspec-pattern 'heads/foo*/bar'
	
expecting success: GIT_COMMITTER_DATE="2005-05-26 23:30" \
	 git update-ref --create-reflog HEAD 102939797ab91a4f201d131418d2c9d919dcdd2c -m "Initial Creation" &&
	 test 102939797ab91a4f201d131418d2c9d919dcdd2c = $(cat .git/refs/heads/master)
ok 35 - ref name 'heads/foo*/bar' is valid with options --refspec-pattern

expecting success: 
		git check-ref-format --refspec-pattern 'heads/f*o/bar'
	
fatal: 'A' - not a valid ref
ok 36 - ref name 'heads/f*o/bar' is valid with options --refspec-pattern

expecting success: 
		test_must_fail git check-ref-format --refspec-pattern 'heads/f*o*/bar'
	
ok 28 - 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)
fatal: 'tags/A' - not a valid ref
ok 37 - ref name 'heads/f*o*/bar' is invalid with options --refspec-pattern

expecting success: 
		test_must_fail git check-ref-format --refspec-pattern 'heads/foo*/bar*'
	
fatal: 'D' - not a valid ref
ok 38 - ref name 'heads/foo*/bar*' is invalid with options --refspec-pattern

expecting success: 
		test_must_fail git check-ref-format  'foo'
	
error: Untracked working tree file 'sub1/file1' would be overwritten by merge.
ok 4 - show-ref --verify

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

ok 29 - 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)
ok 39 - ref name 'foo' is invalid

expecting success: 
		git check-ref-format --allow-onelevel 'foo'
	
ok 40 - ref name 'foo' is valid with options --allow-onelevel

expecting success: 
		test_must_fail git check-ref-format --refspec-pattern 'foo'
	
ok 30 - set refs/heads/master (logged by touch)

expecting success: test_cmp expect .git/logs/refs/heads/master
ok 41 - ref name 'foo' is invalid with options --refspec-pattern

expecting success: 
		git check-ref-format --refspec-pattern --allow-onelevel 'foo'
	
ok 31 - verifying refs/heads/master's log

expecting success: git config core.logAllRefUpdates true &&
	 test true = $(git config --bool --get core.logAllRefUpdates)
ok 42 - ref name 'foo' is valid with options --refspec-pattern --allow-onelevel

expecting success: 
		test_must_fail git check-ref-format --normalize 'foo'
	
ok 43 - ref name 'foo' is invalid with options --normalize

expecting success: 
		git check-ref-format --allow-onelevel --normalize 'foo'
	
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


foo
ok 44 - ref name 'foo' is valid with options --allow-onelevel --normalize

expecting success: 
		git check-ref-format  'foo/bar'
	
ok 32 - 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 45 - ref name 'foo/bar' is valid

expecting success: 
		git check-ref-format --allow-onelevel 'foo/bar'
	
ok 46 - ref name 'foo/bar' is valid with options --allow-onelevel

expecting success: 
		git check-ref-format --refspec-pattern 'foo/bar'
	
ok 33 - 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)
ok 47 - ref name 'foo/bar' is valid with options --refspec-pattern

expecting success: 
		git check-ref-format --refspec-pattern --allow-onelevel 'foo/bar'
	
ok 48 - ref name 'foo/bar' is valid with options --refspec-pattern --allow-onelevel

expecting success: 
		git check-ref-format --normalize 'foo/bar'
	
ok 34 - 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)
foo/bar
ok 49 - ref name 'foo/bar' is valid with options --normalize

expecting success: 
		test_must_fail git check-ref-format  'foo/*'
	
ok 50 - ref name 'foo/*' is invalid

expecting success: 
		test_must_fail git check-ref-format --allow-onelevel 'foo/*'
	
ok 35 - set refs/heads/master (logged by config)

expecting success: test_cmp expect .git/logs/$m
ok 36 - verifying refs/heads/master's log

ok 51 - ref name 'foo/*' is invalid with options --allow-onelevel

expecting success: 
		git check-ref-format --refspec-pattern 'foo/*'
	
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 52 - ref name 'foo/*' is valid with options --refspec-pattern

expecting success: 
		git check-ref-format --refspec-pattern --allow-onelevel 'foo/*'
	
ok 53 - ref name 'foo/*' is valid with options --refspec-pattern --allow-onelevel

expecting success: 
		test_must_fail git check-ref-format  '*/foo'
	
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 54 - ref name '*/foo' is invalid

expecting success: 
		test_must_fail git check-ref-format --allow-onelevel '*/foo'
	
ok 55 - ref name '*/foo' is invalid with options --allow-onelevel

expecting success: 
		git check-ref-format --refspec-pattern '*/foo'
	
ok 37 - 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 56 - ref name '*/foo' is valid with options --refspec-pattern

expecting success: 
		git check-ref-format --refspec-pattern --allow-onelevel '*/foo'
	
ok 57 - ref name '*/foo' is valid with options --refspec-pattern --allow-onelevel

expecting success: 
		test_must_fail git check-ref-format --normalize '*/foo'
	
fatal: 'master' - not a valid ref
ok 58 - ref name '*/foo' is invalid with options --normalize
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 38 - Query master@{2005-05-25} (before history)

expecting success: 
		git check-ref-format --refspec-pattern --normalize '*/foo'
	
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)"
*/foo
ok 59 - ref name '*/foo' is valid with options --refspec-pattern --normalize

expecting success: 
		test_must_fail git check-ref-format  'foo/*/bar'
	
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

ok 60 - ref name 'foo/*/bar' is invalid

expecting success: 
		test_must_fail git check-ref-format --allow-onelevel 'foo/*/bar'
	
ok 39 - 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 61 - ref name 'foo/*/bar' is invalid with options --allow-onelevel

expecting success: 
		git check-ref-format --refspec-pattern 'foo/*/bar'
	
ok 62 - ref name 'foo/*/bar' is valid with options --refspec-pattern

expecting success: 
		git check-ref-format --refspec-pattern --allow-onelevel 'foo/*/bar'
	
Cloning into 'submodule_update'...
ok 40 - 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 63 - ref name 'foo/*/bar' is valid with options --refspec-pattern --allow-onelevel

expecting success: 
		test_must_fail git check-ref-format  '*'
	
ok 64 - ref name '*' is invalid

expecting success: 
		test_must_fail git check-ref-format --allow-onelevel '*'
	
ok 65 - ref name '*' is invalid with options --allow-onelevel

ok 41 - Query "master@{May 26 2005 23:32:30}" (first non-creation change)

expecting success: 
		test_must_fail git check-ref-format --refspec-pattern '*'
	
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 66 - ref name '*' is invalid with options --refspec-pattern

expecting success: 
		git check-ref-format --refspec-pattern --allow-onelevel '*'
	
done.
ok 67 - ref name '*' is valid with options --refspec-pattern --allow-onelevel

expecting success: 
		test_must_fail git check-ref-format --refspec-pattern 'foo/*/*'
	
ok 42 - 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 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 43 - 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 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 71 - ref name '*/foo/*' is invalid with options --refspec-pattern --allow-onelevel

expecting success: 
		test_must_fail git check-ref-format --refspec-pattern '*/*/foo'
	
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 44 - 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)"
ok 72 - ref name '*/*/foo' is invalid with options --refspec-pattern

expecting success: 
		test_must_fail git check-ref-format --refspec-pattern --allow-onelevel '*/*/foo'
	
ok 73 - ref name '*/*/foo' is invalid with options --refspec-pattern --allow-onelevel

expecting success: 
		test_must_fail git check-ref-format  '/foo'
	
ok 74 - ref name '/foo' is invalid

ok 45 - Query "master@{2005-05-28}" (past end of history)

expecting success: 
		test_must_fail git check-ref-format --allow-onelevel '/foo'
	
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 75 - ref name '/foo' is invalid with options --allow-onelevel

expecting success: 
		test_must_fail git check-ref-format --refspec-pattern '/foo'
	
ok 76 - ref name '/foo' is invalid with options --refspec-pattern

[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
expecting success: 
		test_must_fail git check-ref-format --refspec-pattern --allow-onelevel '/foo'
	
ok 77 - ref name '/foo' is invalid with options --refspec-pattern --allow-onelevel

expecting success: 
		test_must_fail git check-ref-format --normalize '/foo'
	
ok 78 - ref name '/foo' is invalid with options --normalize

expecting success: 
		git check-ref-format --allow-onelevel --normalize '/foo'
	
[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(-)
foo
ok 79 - ref name '/foo' is valid with options --allow-onelevel --normalize

expecting success: 
		test_must_fail git check-ref-format --refspec-pattern --normalize '/foo'
	
ok 7 - show-ref --heads, --tags, --head, pattern

ok 80 - ref name '/foo' is invalid with options --refspec-pattern --normalize

expecting success: 
		git check-ref-format --refspec-pattern --allow-onelevel --normalize '/foo'
	
# passed all 7 test(s)
1..7
foo
ok 81 - ref name '/foo' is valid with options --refspec-pattern --allow-onelevel --normalize

[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(-)
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
*** t1404-update-ref-df-conflicts.sh ***
[master 29d1ccd] Merged initial commit and a later commit.
 Author: A U Thor <author@example.com>
ok 46 - creating initial files

expecting success: test_cmp expect .git/logs/refs/heads/master
ok 47 - git commit logged updates

expecting success: test OTHER = $(git cat-file blob master:F)
ok 48 - git cat-file blob master:F (expect OTHER)

expecting success: test TEST = $(git cat-file blob "master@{2005-05-26 23:30}:F")
Already on 'master'
ok 49 - 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")
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 64ab68f... A
ok 50 - 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"

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'
Switched to branch 'master'
expecting success: 

	git commit --allow-empty -m Initial &&
	C=$(git rev-parse HEAD)


ok 82 - 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"

[master (root-commit) 9b0e8d9] Initial
 Author: A U Thor <author@example.com>
[master 777b7c0] path with space
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 path with space
ok 51 - stdin test setup

expecting success: 
	test_must_fail git update-ref -z $m $m $m 2>err &&
	grep "usage: git update-ref" err

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"


usage: git update-ref [<options>] -d <refname> [<old-val>]
ok 52 - -z fails without --stdin

expecting success: 
	>stdin &&
	git update-ref --stdin <stdin &&
	git rev-parse --verify -q $m

777b7c02e1a7bb137bd7443e34eb5512b6a19d6c
ok 53 - 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

fatal: cannot lock ref 'refs/1l/c/x': 'refs/1l/c' exists; cannot create 'refs/1l/c/x'
Already on 'master'
fatal: empty command in input
ok 54 - 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

ok 2 - existing loose ref is a simple prefix of new

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 64ab68f... A
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"


fatal: whitespace before command:  
ok 55 - 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

Cloning into 'sub1'...
Switched to branch 'master'
fatal: whitespace before command:  create refs/heads/a refs/heads/master
ok 56 - 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

ok 83 - check-ref-format --branch from subdir

expecting success: 
		refname=$(git check-ref-format --normalize 'heads/foo') &&
		test "$refname" = 'heads/foo'
	
ok 84 - ref name 'heads/foo' simplifies to 'heads/foo'

expecting success: 
		refname=$(git check-ref-format --normalize 'refs///heads/foo') &&
		test "$refname" = 'refs/heads/foo'
	
fatal: unknown command: unknown refs/heads/a
ok 57 - 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

ok 85 - ref name 'refs///heads/foo' simplifies to 'refs/heads/foo'

expecting success: 
		refname=$(git check-ref-format --normalize '/heads/foo') &&
		test "$refname" = 'heads/foo'
	
done.
fatal: badly quoted argument: "master
ok 58 - 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

ok 86 - ref name '/heads/foo' simplifies to 'heads/foo'

expecting success: 
		refname=$(git check-ref-format --normalize '///heads/foo') &&
		test "$refname" = 'heads/foo'
	
fatal: cannot lock ref 'refs/1p/c/x': 'refs/1p/c' exists; cannot create 'refs/1p/c/x'
fatal: badly quoted argument: "ma\zter"
ok 87 - ref name '///heads/foo' simplifies to 'heads/foo'

expecting success: 
		test_must_fail git check-ref-format --normalize 'foo'
	
ok 59 - 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

ok 88 - check-ref-format --normalize rejects 'foo'

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"


fatal: unexpected character after quoted argument: "refs/heads/a"master
expecting success: 
		test_must_fail git check-ref-format --normalize '/foo'
	
ok 60 - 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

ok 89 - check-ref-format --normalize rejects '/foo'

expecting success: 
		test_must_fail git check-ref-format --normalize 'heads/foo/../bar'
	
fatal: create: missing <ref>
ok 61 - 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

ok 90 - check-ref-format --normalize rejects 'heads/foo/../bar'

expecting success: 
		test_must_fail git check-ref-format --normalize 'heads/./foo'
	
ok 91 - check-ref-format --normalize rejects 'heads/./foo'

expecting success: 
		test_must_fail git check-ref-format --normalize 'heads\foo'
	
fatal: create refs/heads/a: missing <newvalue>
ok 62 - 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 92 - check-ref-format --normalize rejects 'heads\foo'

expecting success: 
		test_must_fail git check-ref-format --normalize 'heads/foo.lock'
	
ok 93 - check-ref-format --normalize rejects 'heads/foo.lock'

expecting success: 
		test_must_fail git check-ref-format --normalize 'heads///foo.lock'
	
fatal: create refs/heads/a: extra input:  refs/heads/master
fatal: cannot lock ref 'refs/2l/c/x/y': 'refs/2l/c' exists; cannot create 'refs/2l/c/x/y'
ok 63 - 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

ok 94 - check-ref-format --normalize rejects 'heads///foo.lock'

expecting success: 
		test_must_fail git check-ref-format --normalize 'foo.lock/bar'
	
ok 95 - check-ref-format --normalize rejects 'foo.lock/bar'

expecting success: 
		test_must_fail git check-ref-format --normalize 'foo.lock///bar'
	
fatal: update: missing <ref>
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"


ok 64 - 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

ok 96 - check-ref-format --normalize rejects 'foo.lock///bar'

Submodule path 'sub1': checked out '58630c04cd08e6914ad0ab5a3126bcfb71a3e6ca'
# passed all 96 test(s)
1..96
fatal: update refs/heads/a: missing <newvalue>
ok 65 - 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 66 - 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

*** t1410-reflog.sh ***
fatal: delete: missing <ref>
ok 67 - 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

fatal: delete refs/heads/a: extra input:  refs/heads/master
ok 68 - 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

fatal: cannot lock ref 'refs/2p/c/x/y': 'refs/2p/c' exists; cannot create 'refs/2p/c/x/y'
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
fatal: verify refs/heads/a: extra input:  refs/heads/master
ok 69 - 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

test_must_fail: command succeeded: git read-tree -u -m replace_sub1_with_file
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"


fatal: option unknown: unknown
ok 70 - 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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1410-reflog/.git/
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
		)
	
fatal: Multiple updates for ref 'refs/heads/a' not allowed.
ok 71 - 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

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 &&

	git reflog refs/heads/master >output &&
	test_line_count = 4 output

fatal: cannot lock ref 'refs/3l/c': 'refs/3l/c/x' exists; cannot create 'refs/3l/c'
ok 72 - stdin create ref works

expecting success: 
	test_when_finished "git update-ref -d $outside" &&
	echo "create $outside $m" >stdin &&
	git update-ref --stdin <stdin &&
	git rev-parse $m >expect &&
	git rev-parse $outside >actual &&
	test_cmp expect actual &&
	test_must_fail git reflog exists $outside

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"


[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
Cloning into 'submodule_update'...
ok 73 - stdin does not create reflogs by default

expecting success: 
	echo "create $outside $m" >stdin &&
	git update-ref --create-reflog --stdin <stdin &&
	git rev-parse $m >expect &&
	git rev-parse $outside >actual &&
	test_cmp expect actual &&
	git reflog exists $outside

fatal: cannot lock ref 'refs/3p/c': 'refs/3p/c/x' exists; cannot create 'refs/3p/c'
done.
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"


ok 74 - stdin creates reflogs with --create-reflog

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

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
[master 7d1a0b8] dragon
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 C
fatal: cannot lock ref 'refs/4l/c': 'refs/4l/c/x/y' exists; cannot create 'refs/4l/c'
ok 75 - stdin succeeds with quoted argument

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

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"


ok 76 - 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

[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/4p/c': 'refs/4p/c/x/y' exists; cannot create 'refs/4p/c'
ok 77 - 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

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"


ok 78 - 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

[master 3ac530f] monkey
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 A/G
fatal: cannot lock ref 'refs/5/c': cannot process 'refs/5/c' and 'refs/5/c/x' at the same time
ok 10 - one new ref is a simple prefix of another

ok 79 - 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

# passed all 10 test(s)
1..10
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
tree
fatal: cannot lock ref 'refs/heads/c': unable to resolve reference refs/heads/c: No such file or directory
tree
ok 80 - 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

*** t1411-reflog-show.sh ***
blob
fatal: update refs/heads/c: invalid <oldvalue>: does-not-exist
blob
ok 81 - 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

blob
blob
fatal: create refs/heads/c: invalid <newvalue>: does-not-exist
blob
ok 82 - 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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1411-reflog-show/.git/
commit
expecting success: 
	echo content >file &&
	git add file &&
	test_tick &&
	git commit -m one

fatal: create refs/heads/c: zero <newvalue>
tree
Cloning into 'sub1'...
ok 83 - 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

commit
commit
[master (root-commit) e46513e] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 1 - setup

commit
expecting success: 
	git log -g -1 >tmp &&
	grep ^Reflog <tmp >actual &&
	test_cmp expect actual

ok 84 - 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

done.
ok 2 - log -g shows reflog headers

expecting success: 
	git log -g -1 --oneline >actual &&
	test_cmp expect actual

tree
fatal: cannot lock ref 'refs/heads/a': ref refs/heads/a is at 777b7c02e1a7bb137bd7443e34eb5512b6a19d6c but expected 29d1ccdc7ee9fe415beb2415b6206b8a20f76b1c
tree
ok 3 - oneline reflog format

expecting success: 
	git reflog -1 >actual &&
	test_cmp expect actual

blob
blob
ok 85 - 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

ok 4 - reflog default format

blob
expecting success: 
	git reflog --format=short -1 >actual &&
	test_cmp expect actual

fatal: delete refs/heads/a: zero <oldvalue>
blob
blob
ok 5 - override reflog default format

expecting success: 
	git log -g -1 HEAD@{now} >tmp &&
	grep ^Reflog <tmp >actual &&
	test_cmp expect actual

ok 86 - 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

commit
tree
ok 6 - using @{now} syntax shows reflog date (multiline)

commit
expecting success: 
	git log -g -1 --oneline HEAD@{now} >actual &&
	test_cmp expect actual

commit
commit
ok 7 - using @{now} syntax shows reflog date (oneline)

expecting success: 
	git log -g -1 --format=%gd HEAD@{now} >actual &&
	test_cmp expect actual

Submodule path 'sub1': checked out '58630c04cd08e6914ad0ab5a3126bcfb71a3e6ca'
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

ok 87 - 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

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 &&

	git reflog refs/heads/master >output &&
	test_line_count = 5 output

ok 9 - using --date= shows reflog date (multiline)

expecting success: 
	git log -g -1 --oneline --date=default >actual &&
	test_cmp expect actual

HEAD is now at 7d1a0b8 dragon
ok 10 - using --date= shows reflog date (oneline)

Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
expecting success: 
	git log -g -1 --format=%gd --date=raw >actual &&
	test_cmp expect actual

tree
ok 88 - 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

tree
blob
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

ok 89 - 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

blob
blob
blob
blob
commit
ok 12 - log.date does not invoke "--date" magic (multiline)

expecting success: 
	test_config log.date raw &&
	git log -g -1 --oneline >actual &&
	test_cmp expect actual

tree
commit
commit
ok 90 - 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

commit
test_must_fail: command succeeded: git read-tree -u -m replace_sub1_with_file
ok 13 - log.date does not invoke "--date" magic (oneline)

expecting success: 
	test_config log.date raw &&
	git log -g -1 --format=%gd >actual &&
	test_cmp expect actual

ok 91 - 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

tree
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
		)
	
tree
ok 92 - 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

blob
ok 14 - log.date does not invoke "--date" magic (format=%gd)

expecting success: 
	git log -g -1 --format=%gd --date=raw HEAD@{0} >actual &&
	test_cmp expect actual

blob
ok 93 - 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

blob
ok 15 - --date magic does not override explicit @{0} syntax

expecting success: 
	git branch empty &&
	git reflog expire --expire=all refs/heads/empty &&

	git log -g empty >actual &&
	test_cmp expect actual

blob
fatal: cannot lock ref 'refs/heads/master': ref refs/heads/master is at 777b7c02e1a7bb137bd7443e34eb5512b6a19d6c but expected 29d1ccdc7ee9fe415beb2415b6206b8a20f76b1c
blob
commit
ok 94 - 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
commit
Cloning into 'submodule_update'...
fatal: cannot lock ref 'refs/heads/master': ref refs/heads/master is at 777b7c02e1a7bb137bd7443e34eb5512b6a19d6c but expected 0000000000000000000000000000000000000000
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

commit
commit
ok 95 - 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

[master fc3e0aa] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two.t
ok 2 - rewind

expecting success: 

	corrupt $F &&
	check_fsck "missing blob $F"


fatal: cannot lock ref 'refs/heads/master': ref refs/heads/master is at 777b7c02e1a7bb137bd7443e34eb5512b6a19d6c but expected 0000000000000000000000000000000000000000
done.
ok 96 - 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

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 &&

	git reflog refs/heads/master >output &&
	test_line_count = 5 output &&

	check_fsck "missing blob $F"

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
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 97 - 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

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 &&

	git reflog refs/heads/master >output &&
	test_line_count = 2 output &&

	check_fsck "dangling commit $K"

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: cannot lock ref 'refs/heads/c': ref refs/heads/c is at 777b7c02e1a7bb137bd7443e34eb5512b6a19d6c but expected 0000000000000000000000000000000000000000
ok 17 - git log -g -p shows diffs vs. parents

expecting success: 
	git reflog exists refs/heads/master &&
	! git reflog exists refs/heads/nonexistent

dangling commit 3ac530f2f6c3a45206a6b2d455baf89d1c8f672d
ok 18 - reflog exists works

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


ok 98 - stdin update refs fails with wrong old value

# passed all 18 test(s)
1..18
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

*** t1412-reflog-loop.sh ***
tree
tree
blob
ok 99 - stdin delete refs works with packed and loose refs

expecting success: 
	>stdin &&
	git update-ref -z --stdin <stdin &&
	git rev-parse --verify -q $m

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
blob
blob
777b7c02e1a7bb137bd7443e34eb5512b6a19d6c
ok 100 - 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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1412-reflog-loop/.git/
commit
fatal: whitespace before command: 
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

ok 101 - 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

commit
fatal: git cat-file: could not get object info
fatal: git cat-file: could not get object info
fatal: empty command in input
ok 102 - 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

fatal: git cat-file: could not get object info
[master (root-commit) e46513e] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
fatal: whitespace before command:  
ok 103 - 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

fatal: git cat-file: could not get object info
fatal: git cat-file: could not get object info
fatal: whitespace before command:  create refs/heads/a
ok 6 - prune and fsck

expecting success: 

	recover $F &&
	check_fsck "dangling blob $F"


ok 104 - 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

Cloning into 'sub1'...
fatal: unknown command: unknown refs/heads/a
ok 105 - 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

[master 441e5e0] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
fatal: create: missing <ref>
ok 106 - 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

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


ok 1 - setup commits

expecting success: 
	git checkout -b topic &&
	git reset one &&
	git reset two &&
	git reset one &&
	git reset two

fatal: create refs/heads/a: unexpected end of input when reading <newvalue>
ok 107 - 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

done.
fatal: unknown command: refs/heads/master
Switched to a new branch 'topic'
ok 108 - 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

[master b60a214] rat
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Unstaged changes after reset:
M	file
fatal: update: missing <ref>
ok 109 - 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

[master 9908ef9] ox
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
fatal: update refs/heads/a: unexpected end of input when reading <oldvalue>
ok 110 - 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

Unstaged changes after reset:
M	file
[master b93561f] tiger
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
warning: update refs/heads/a: missing <newvalue>, treating as zero
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

ok 111 - 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: update refs/heads/a: unexpected end of input when reading <newvalue>
ok 112 - 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

ok 3 - reflog shows all entries

# passed all 3 test(s)
1..3
fatal: update refs/heads/a: unexpected end of input when reading <oldvalue>
ok 113 - 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

Submodule path 'sub1': checked out '58630c04cd08e6914ad0ab5a3126bcfb71a3e6ca'
fatal: unknown command: refs/heads/master
ok 114 - 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

fatal: delete: missing <ref>
ok 115 - 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

*** t1413-reflog-detach.sh ***
fatal: delete refs/heads/a: unexpected end of input when reading <oldvalue>
ok 116 - 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 117 - 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

Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
fatal: unknown command: refs/heads/master
ok 118 - 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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1413-reflog-detach/.git/
fatal: verify refs/heads/a: unexpected end of input when reading <oldvalue>
ok 119 - 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

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

fatal: option unknown: unknown
ok 120 - 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

ok 8 - delete

expecting success: 

	test_tick && git reset --hard HEAD~2 &&
	git reflog refs/heads/master >output &&
	test_line_count = 4 output

[master (root-commit) 66fe8b3] initial
 Author: A U Thor <author@example.com>
fatal: Multiple updates for ref 'refs/heads/a' not allowed.
ok 121 - 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

HEAD is now at b60a214 rat
ok 9 - rewind2
[master 
5ce2b00] second
 Author: A U Thor <author@example.com>
expecting success: 

	git reflog expire --verbose \
		--expire=never \
		--expire-unreachable=never \
		--all &&
	git reflog refs/heads/master >output &&
	test_line_count = 4 output

ok 1 - setup

expecting success: 
	reset_state &&
	git rev-parse master master^ >expect &&
	git log -g --format=%H >actual &&
	test_cmp expect actual

ok 122 - 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

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
Already on 'master'
ok 10 - --expire=never

expecting success: 

	git config gc.reflogexpire never &&
	git config gc.reflogexpireunreachable never &&
	git reflog expire --verbose --all &&
	git reflog refs/heads/master >output &&
	test_line_count = 4 output

ok 123 - 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

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

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
Already on 'master'
ok 124 - 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 11 - gc.reflogexpire=never

expecting success: 

	git config gc.reflogexpire false &&
	git config gc.reflogexpireunreachable false &&
	git reflog expire --verbose --all &&
	git reflog refs/heads/master >output &&
	test_line_count = 4 output &&

	git config --unset gc.reflogexpire &&
	git config --unset gc.reflogexpireunreachable


Switched to branch 'side'
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

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
Switched to branch 'master'
ok 125 - 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

fatal: cannot lock ref 'refs/heads/c': unable to resolve reference refs/heads/c: No such file or directory
ok 126 - 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

Switched to branch 'side'
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

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
fatal: update refs/heads/c: invalid <oldvalue>: does-not-exist
ok 127 - 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 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

Switched to branch 'master'
Switched to branch 'foo'
Submodule path 'sub1': checked out '853843e63cd0418826f5b5ca76d712e9cd620078'
fatal: cannot lock ref 'refs/heads/c': ref refs/heads/c is at 777b7c02e1a7bb137bd7443e34eb5512b6a19d6c but expected 0000000000000000000000000000000000000000
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

ok 128 - 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

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
fatal: create refs/heads/c: invalid <newvalue>: does-not-exist
ok 129 - 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

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

Deleted branch one/two (was b60a214).
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
		)
	
fatal: create refs/heads/c: missing <newvalue>
Switched to branch 'master'
ok 130 - 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

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
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

Switched to branch 'master'
ok 131 - 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

fatal: cannot lock ref 'refs/heads/a': ref refs/heads/a is at 777b7c02e1a7bb137bd7443e34eb5512b6a19d6c but expected 29d1ccdc7ee9fe415beb2415b6206b8a20f76b1c
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

Already on 'master'
Cloning into 'submodule_update'...
Deleted branch one/two (was b60a214).
ok 132 - 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>
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
done.
ok 133 - 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

warning: unable to unlink .git/logs/refs/heads/one: Is a directory
Deleted branch one (was b60a214).
Previous HEAD position was 5ce2b00... second
Switched to branch 'side'
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

ok 7 - attach to other

Switched to a new branch 'reflogskip'
# passed all 7 test(s)
1..7
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
*** t1420-lost-found.sh ***
ok 134 - 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

ok 16 - parsing reverse reflogs at BUFSIZ boundaries

# passed all 16 test(s)
1..16
ok 135 - 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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1420-lost-found/.git/
*** t1430-bad-ref-name.sh ***
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 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

[master (root-commit) 9bb1ae9] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file1
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1430-bad-ref-name/.git/
expecting success: 
	test_commit one &&
	test_commit two

[master 8ad33be] second
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 file2
ok 137 - 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 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)

[master (root-commit) d79ce16] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
ok 138 - 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

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
HEAD is now at 9bb1ae9 initial
ok 139 - 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

[master 139b20d] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two.t
ok 140 - 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

dangling blob 00750edc07d6415dcc07ae0351e9397b0222b7ba
dangling commit 8ad33beea8de8e15812274614acd0a26d73b60f8
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

ok 2 - lost and found something

fatal: cannot lock ref 'refs/heads/master': ref refs/heads/master is at 777b7c02e1a7bb137bd7443e34eb5512b6a19d6c but expected 29d1ccdc7ee9fe415beb2415b6206b8a20f76b1c
# passed all 2 test(s)
1..2
fatal: Branch name doesn't conform to GIT standards: .badbranchname
fast-import: dumping crash report to .git/fast_import_crash_4503
ok 141 - 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

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

*** t1450-fsck.sh ***
fatal: cannot lock ref 'refs/heads/master': ref refs/heads/master is at 777b7c02e1a7bb137bd7443e34eb5512b6a19d6c but expected 0000000000000000000000000000000000000000
fatal: Branch name doesn't conform to GIT standards: bad[branch]name
fast-import: dumping crash report to .git/fast_import_crash_4526
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

ok 142 - 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

Cloning into 'sub1'...
  broken...ref
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

fatal: cannot lock ref 'refs/heads/master': ref refs/heads/master is at 777b7c02e1a7bb137bd7443e34eb5512b6a19d6c but expected 0000000000000000000000000000000000000000
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/.git/
Deleted branch broken...ref (was broken).
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

ok 143 - 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

done.
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

Deleted branch broken...ref (was broken).
[master (root-commit) 1347563] A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 fileA
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 - 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

error: branch '../../my-private-file' not found.
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

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
fatal: cannot lock ref 'refs/heads/c': ref refs/heads/c is at 777b7c02e1a7bb137bd7443e34eb5512b6a19d6c but expected 0000000000000000000000000000000000000000
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

[detached HEAD c9145d6] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 fileB
Submodule path 'sub1': checked out '58630c04cd08e6914ad0ab5a3126bcfb71a3e6ca'
error: branch '/«PKGBUILDDIR»/t/trash directory.t1430-bad-ref-name/.git/refs/heads/extra' not found.
Deleted tag 'A' (was 1347563)
Deleted tag 'B' (was c9145d6)
ok 145 - 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

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

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

fatal: 'broken...ref' is not a valid branch name.
warning: update refs/heads/c: missing <newvalue>, treating as zero
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/another/.git/
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

error: branch 'goodref' not found.
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
fatal: 'broken...ref' is not a valid branch name.
ok 146 - stdin -z delete refs works with packed and loose refs

[master (root-commit) 1aac250] C
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 fileC
checking prerequisite: ULIMIT_FILE_DESCRIPTORS

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&run_with_limited_open_files true
)
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
)

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

ok 2 - loose objects borrowed from alternate are not missing

expecting success: 
	git fsck >actual 2>&1 &&
	test_cmp empty actual

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

fatal: remote part of refspec is not a valid name in HEAD:refs/heads/broken...ref
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

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

777b7c02e1a7bb137bd7443e34eb5512b6a19d6c
ok 147 - 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
)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1430-bad-ref-name/src/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1430-bad-ref-name/dest/.git/
[master (root-commit) 4331c28] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
ok 148 - large transaction deleting branches does not burst open file limit

# passed all 148 test(s)
1..148
missing blob 63ffffffffffffffffffffffffffffffffffffff
error: sha1 mismatch 63ffffffffffffffffffffffffffffffffffffff
error: 63ffffffffffffffffffffffffffffffffffffff: object corrupt or missing
error: 63ffffffffffffffffffffffffffffffffffffff: object corrupt or missing
[master (root-commit) 9db02ea] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two.t
*** t1500-rev-parse.sh ***
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 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" &&
	test_must_fail git fsck 2>out &&
	cat out &&
	grep "not a commit" out

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1500-rev-parse/.git/
error: refs/heads/invalid: not a commit
error: refs/heads/invalid: not a commit
expecting success: test 'false' = "$(git rev-parse --is-bare-repository)"
ok 6 - branch pointing to non-commit

ok 1 - toplevel: is-bare-repository

expecting success: 
	test_when_finished "mv .git/SAVED_HEAD .git/HEAD" &&
	mv .git/HEAD .git/SAVED_HEAD &&
	echo 0000000000000000000000000000000000000000 >.git/HEAD &&
	# avoid corrupt/broken HEAD from interfering with repo discovery
	test_must_fail env GIT_DIR=.git git fsck 2>out &&
	cat out &&
	grep "detached HEAD points" out

expecting success: test 'false' = "$(git rev-parse --is-inside-git-dir)"
ok 2 - toplevel: is-inside-git-dir

expecting success: test 'true' = "$(git rev-parse --is-inside-work-tree)"
To file:///«PKGBUILDDIR»/t/trash directory.t1430-bad-ref-name/dest
 + 9db02ea...4331c28 master -> master (forced update)
 - [deleted]         two
 * [new tag]         one -> one
ok 3 - toplevel: is-inside-work-tree

expecting success: test '' = "$(git rev-parse --show-prefix)"
dangling commit c9145d6720f85544cc4bb6009a2e541660aa156b
fatal: reference is not a tree: 0123456789012345678901234567890123456789
Unable to checkout '0123456789012345678901234567890123456789' in submodule path 'sub1'
error: HEAD: detached HEAD points at nothing
  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 4 - toplevel: prefix

expecting success: test '.git' = "$(git rev-parse --git-dir)"
error: HEAD: detached HEAD points at nothing
ok 7 - HEAD link pointing at a funny object

expecting success: 
	test_when_finished "mv .git/SAVED_HEAD .git/HEAD" &&
	mv .git/HEAD .git/SAVED_HEAD &&
	echo "ref: refs/funny/place" >.git/HEAD &&
	# avoid corrupt/broken HEAD from interfering with repo discovery
	test_must_fail env GIT_DIR=.git git fsck 2>out &&
	cat out &&
	grep "HEAD points to something strange" out

ok 5 - toplevel: git-dir

expecting success: test 'false' = "$(git rev-parse --is-bare-repository)"
ok 6 - .git/: is-bare-repository

expecting success: test 'true' = "$(git rev-parse --is-inside-git-dir)"
dangling commit c9145d6720f85544cc4bb6009a2e541660aa156b
error: HEAD points to something strange (refs/funny/place)
ok 7 - .git/: is-inside-git-dir

expecting success: test 'false' = "$(git rev-parse --is-inside-work-tree)"
error: HEAD points to something strange (refs/funny/place)
ok 8 - .git/: is-inside-work-tree

ok 8 - HEAD link pointing at a funny place

expecting success: test '' = "$(git rev-parse --show-prefix)"
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 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 9 - .git/: prefix

expecting success: test '.' = "$(git rev-parse --git-dir)"
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 10 - .git/: git-dir

expecting success: test 'false' = "$(git rev-parse --is-bare-repository)"
ok 11 - .git/objects/: is-bare-repository

expecting success: test 'true' = "$(git rev-parse --is-inside-git-dir)"
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 12 - .git/objects/: is-inside-git-dir

expecting success: test 'false' = "$(git rev-parse --is-inside-work-tree)"
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)"
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

ok 15 - .git/objects/: git-dir

error: cannot lock ref 'my-private-file': unable to resolve reference my-private-file: Invalid argument
expecting success: test 'false' = "$(git rev-parse --is-bare-repository)"
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

Cloning into 'submodule_update'...
ok 16 - subdirectory: is-bare-repository

expecting success: test 'false' = "$(git rev-parse --is-inside-git-dir)"
ok 9 - 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 17 - subdirectory: is-inside-git-dir

expecting success: test 'true' = "$(git rev-parse --is-inside-work-tree)"
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 18 - subdirectory: is-inside-work-tree

expecting success: test 'sub/dir/' = "$(git rev-parse --show-prefix)"
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

ok 19 - subdirectory: prefix

expecting success: test '/«PKGBUILDDIR»/t/trash directory.t1500-rev-parse/.git' = "$(git rev-parse --git-dir)"
done.
ok 20 - subdirectory: git-dir

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 'true' = "$(git rev-parse --is-bare-repository)"
fatal: invalid ref format: ~a
ok 21 - core.bare = true: is-bare-repository
ok 21 - update-ref --stdin fails update with bad ref name
error in commit af421232fcba11d582d625f9041afbe3fccc01d9: missingSpaceBeforeDate: invalid author/committer line - missing space before date


expecting success: test 'false' = "$(git rev-parse --is-inside-git-dir)"
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

error in commit af421232fcba11d582d625f9041afbe3fccc01d9: missingSpaceBeforeDate: invalid author/committer line - missing space before date
ok 22 - core.bare = true: is-inside-git-dir

expecting success: test 'false' = "$(git rev-parse --is-inside-work-tree)"
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

Switched to a new branch 'invalid_sub1'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
ok 23 - core.bare = true: is-inside-work-tree

ok 10 - 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

fatal: invalid ref format: ~a 
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 'false' = "$(git rev-parse --is-bare-repository)"
ok 24 - core.bare undefined: is-bare-repository

expecting success: test 'false' = "$(git rev-parse --is-inside-git-dir)"
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 25 - core.bare undefined: is-inside-git-dir
fatal: Needed a single revision

expecting success: test 'true' = "$(git rev-parse --is-inside-work-tree)"
fatal: invalid ref format: ~a
ok 25 - update-ref --stdin -z fails delete with bad ref name

ok 26 - core.bare undefined: is-inside-work-tree

Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
# still have 2 known breakage(s)
# passed all remaining 23 test(s)
1..25
expecting success: test 'false' = "$(git rev-parse --is-bare-repository)"
error in commit c4b6d356e934be1cc10cb58c734fbcc5fa3a5285: badName: invalid author/committer line - bad name
ok 27 - GIT_DIR=../.git, core.bare = false: is-bare-repository

error in commit c4b6d356e934be1cc10cb58c734fbcc5fa3a5285: badName: invalid author/committer line - bad name
expecting success: test 'false' = "$(git rev-parse --is-inside-git-dir)"
ok 28 - GIT_DIR=../.git, core.bare = false: is-inside-git-dir

expecting success: test 'true' = "$(git rev-parse --is-inside-work-tree)"
ok 29 - GIT_DIR=../.git, core.bare = false: is-inside-work-tree

expecting success: test '' = "$(git rev-parse --show-prefix)"
ok 11 - 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 30 - GIT_DIR=../.git, core.bare = false: prefix

*** t1501-worktree.sh ***
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 33 - GIT_DIR=../.git, core.bare = true: is-inside-work-tree

expecting success: test '' = "$(git rev-parse --show-prefix)"
error in commit 35319efb0a67194811f8583362d460866d58b499: missingEmail: invalid author/committer line - missing email
ok 34 - GIT_DIR=../.git, core.bare = true: prefix

error in commit 35319efb0a67194811f8583362d460866d58b499: missingEmail: invalid author/committer line - missing email
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1501-worktree/.git/
expecting success: test 'false' = "$(git rev-parse --is-bare-repository)"
ok 35 - GIT_DIR=../.git, core.bare undefined: is-bare-repository

expecting success: test 'false' = "$(git rev-parse --is-inside-git-dir)"
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

ok 12 - missing email is reported nicely

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 36 - GIT_DIR=../.git, core.bare undefined: is-inside-git-dir

expecting success: test 'true' = "$(git rev-parse --is-inside-work-tree)"
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

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)"
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

error in commit 301380051321b3e224015eea93b0ebc550c88198: badName: invalid author/committer line - bad name
error in commit 301380051321b3e224015eea93b0ebc550c88198: badName: invalid author/committer line - bad name
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 3 - setup: core.worktree = relative path

expecting success: 
	test_rev_parse false false false

ok 41 - GIT_DIR=../repo.git, core.bare = false: is-inside-work-tree

expecting success: test '' = "$(git rev-parse --show-prefix)"
ok 13 - > 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

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 42 - GIT_DIR=../repo.git, core.bare = false: prefix

expecting success: test 'true' = "$(git rev-parse --is-bare-repository)"
ok 43 - GIT_DIR=../repo.git, core.bare = true: is-bare-repository

ok 4 - outside
expecting success: test 'false' = "$(git rev-parse --is-inside-git-dir)"

expecting success: 
	(
		cd work &&
		GIT_DIR=../repo.git &&
		GIT_CONFIG="$(pwd)"/$GIT_DIR/config &&
		test_rev_parse false false true ""
	)

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 45 - GIT_DIR=../repo.git, core.bare = true: is-inside-work-tree

expecting success: test '' = "$(git rev-parse --show-prefix)"
error in commit c8453435c3587d0404f88f925c28a5944b73be1a: badDateOverflow: invalid author/committer line - date causes integer overflow
ok 46 - GIT_DIR=../repo.git, core.bare = true: prefix

error in commit c8453435c3587d0404f88f925c28a5944b73be1a: badDateOverflow: invalid author/committer line - date causes integer overflow
expecting success: test 'false' = "$(git rev-parse --is-bare-repository)"
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

ok 47 - GIT_DIR=../repo.git, core.bare undefined: is-bare-repository

expecting success: test 'false' = "$(git rev-parse --is-inside-git-dir)"
ok 14 - 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

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 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 49 - GIT_DIR=../repo.git, core.bare undefined: is-inside-work-tree

expecting success: test '' = "$(git rev-parse --show-prefix)"
Cloning into 'sub1'...
ok 50 - GIT_DIR=../repo.git, core.bare undefined: prefix

# passed all 50 test(s)
1..50
done.
ok 7 - subdir of work tree

*** t1502-rev-parse-parseopt.sh ***
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"

dangling tree 7997631de77b8a212b5c3e01eff5e9cf1d3c7580
error in tree 7997631de77b8a212b5c3e01eff5e9cf1d3c7580: duplicateEntries: contains duplicate file entries
ok 8 - setup: core.worktree = absolute path

expecting success: 
	test_rev_parse false false false &&
	(
		cd work2 &&
		test_rev_parse false false false
	)

ok 15 - 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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1502-rev-parse-parseopt/.git/
expecting success: 
	sed -e "s/^|//" >optionspec <<\EOF
|some-command [options] <args>...
|
|some-command does foo and bar!
|--
|h,help    show the help
|
|foo       some nifty option --foo
|bar=      some cool option --bar with an argument
|b,baz     a short and long option
|
| An option group Header
|C?        option C with an optional argument
|d,data?   short and long option with an optional argument
|
| Argument hints
|B=arg     short option required argument
|bar2=arg  long option required argument
|e,fuz=with-space  short and long option required argument
|s?some    short option optional argument
|long?data long option optional argument
|g,fluf?path     short and long option optional argument
|longest=very-long-argument-hint  a very long argument hint
|pair=key=value  with an equals sign in the hint
|short-hint=a    with a one symbol hint
|
|Extras
|extra1    line above used to cause a segfault but no longer does
EOF

ok 1 - setup optionspec

expecting success: 
	sed -e "s/^|//" >expect <<\END_EXPECT &&
|cat <<\EOF
|usage: some-command [options] <args>...
|
|    some-command does foo and bar!
|
|    -h, --help            show the help
|    --foo                 some nifty option --foo
|    --bar ...             some cool option --bar with an argument
|    -b, --baz             a short and long option
|
|An option group Header
|    -C[...]               option C with an optional argument
|    -d, --data[=...]      short and long option with an optional argument
|
|Argument hints
|    -B <arg>              short option required argument
|    --bar2 <arg>          long option required argument
|    -e, --fuz <with-space>
|                          short and long option required argument
|    -s[<some>]            short option optional argument
|    --long[=<data>]       long option optional argument
|    -g, --fluf[=<path>]   short and long option optional argument
|    --longest <very-long-argument-hint>
|                          a very long argument hint
|    --pair <key=value>    with an equals sign in the hint
|    --short-hint <a>      with a one symbol hint
|
|Extras
|    --extra1              line above used to cause a segfault but no longer does
|
|EOF
END_EXPECT
	test_expect_code 129 git rev-parse --parseopt -- -h > output < optionspec &&
	test_i18ncmp expect output

tagged commit ffffffffffffffffffffffffffffffffffffffff (invalid) in 1b6f5c03992c29264810d290b006c47651933356
broken link from     tag 1b6f5c03992c29264810d290b006c47651933356
              to  commit ffffffffffffffffffffffffffffffffffffffff
missing commit ffffffffffffffffffffffffffffffffffffffff
broken link from     tag 1b6f5c03992c29264810d290b006c47651933356
ok 9 - outside

expecting success: 
	(
		cd work &&
		test_rev_parse false false true ""
	)

ok 2 - test --parseopt help output

expecting success: 
	cat > expect <<EOF
set -- --foo --bar 'ham' -b -- 'arg'
EOF

ok 16 - tag pointing to nonexistent

ok 3 - setup expect.1

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 -- --foo --bar=ham --baz arg < optionspec > output &&
	test_cmp expect output

ok 4 - test --parseopt

expecting success: 
	git rev-parse --parseopt -- --foo arg --bar=ham --baz < optionspec > output &&
	test_cmp expect output

Submodule path 'sub1': checked out '58630c04cd08e6914ad0ab5a3126bcfb71a3e6ca'
ok 5 - test --parseopt with mixed options and arguments

expecting success: 
	cat > expect <<EOF
set -- --foo -- 'arg' '--bar=ham'
EOF

ok 6 - setup expect.2

expecting success: 
	git rev-parse --parseopt -- --foo -- arg --bar=ham < optionspec > output &&
	test_cmp expect output

ok 10 - inside work tree

expecting success: 
	(
		cd work/sub/dir &&
		test_rev_parse false false true sub/dir/
	)

error: object 63499e4ea8e096b831515ceb1d5a7593e4d87ae5 is a blob, not a commit
error in tag 66f6581d549f70e05ca586bc2df5c15a95662c36: broken links
error in tag 66f6581d549f70e05ca586bc2df5c15a95662c36: badTagObject: could not load tagged object
broken link from     tag 66f6581d549f70e05ca586bc2df5c15a95662c36
broken link from unknown unknown
dangling blob 63499e4ea8e096b831515ceb1d5a7593e4d87ae5
ok 7 - test --parseopt with --

expecting success: 
	git rev-parse --parseopt --stop-at-non-option -- --foo arg --bar=ham < optionspec > output &&
	test_cmp expect output

ok 8 - test --parseopt --stop-at-non-option

expecting success: 
	cat > expect <<EOF
set -- --foo -- '--' 'arg' '--bar=ham'
EOF

ok 9 - setup expect.3

expecting success: 
	git rev-parse --parseopt --keep-dashdash -- --foo -- arg --bar=ham < optionspec > output &&
	test_cmp expect output

ok 17 - 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: badTagName: invalid 'tag' name: wrong name format
	warning in tag $tag: missingTaggerEntry: invalid format - expected 'tagger' line
	EOF
	test_cmp expect out

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 10 - test --parseopt --keep-dashdash

expecting success: 
	cat >expect <<EOF
set -- --foo -- '--' 'arg' '--spam=ham'
EOF

ok 11 - setup expect.4

expecting success: 
	git rev-parse --parseopt --keep-dashdash --stop-at-non-option -- --foo -- arg --spam=ham <optionspec >output &&
	test_cmp expect output

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 12 - test --parseopt --keep-dashdash --stop-at-non-option with --

expecting success: 
	cat > expect <<EOF
set -- --foo -- 'arg' '--spam=ham'
EOF

ok 13 - setup expect.5

expecting success: 
	git rev-parse --parseopt --keep-dashdash --stop-at-non-option -- --foo arg --spam=ham <optionspec >output &&
	test_cmp expect output

tagged commit c9145d6720f85544cc4bb6009a2e541660aa156b (wrong name format) in 6d73f1b4d41e4fdac4ba717a11e7409876bb75c3
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 14 - test --parseopt --keep-dashdash --stop-at-non-option without --

expecting success: 
	cat > expect <<EOF
set -- --foo --bar='z' --baz -C'Z' --data='A' -- 'arg'
EOF

ok 15 - setup expect.6

expecting success: 
	git rev-parse --parseopt --stuck-long -- --foo --bar=z -b arg -CZ -dA <optionspec >output &&
	test_cmp expect output

ok 16 - test --parseopt --stuck-long

expecting success: 
	cat > expect <<EOF
set -- --data='' -C --baz -- 'arg'
EOF

ok 18 - 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

ok 17 - setup expect.7

expecting success: 
	git rev-parse --parseopt --stuck-long -- --data= arg -C -b <optionspec >output &&
	test_cmp expect output

ok 18 - test --parseopt --stuck-long and empty optional argument

expecting success: 
	cat > expect <<EOF
set -- --data --baz -- 'arg'
EOF

ok 13 - outside

expecting success: 
	(
		cd work &&
		GIT_WORK_TREE=. &&
		test_rev_parse false false true ""
	)

ok 19 - setup expect.8

expecting success: 
	git rev-parse --parseopt --stuck-long -- --data arg -b <optionspec >output &&
	test_cmp expect output

ok 20 - 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

error in tag d037dcc834669cc0c5d3416130c899572cb1aedd: missingEmail: invalid author/committer line - missing email
ok 21 - test --parseopt --stuck-long and short option with unset optional argument

Cloning into 'submodule_update'...
# passed all 21 test(s)
1..21
ok 19 - tag with bad tagger

expecting success: 
	git fsck >actual 2>&1 &&
	test_cmp empty actual

ok 14 - inside work tree

expecting success: 
	(
		cd work/sub/dir &&
		GIT_WORK_TREE=../.. &&
		test_rev_parse false false true sub/dir/
	)

*** t1503-rev-parse-verify.sh ***
ok 20 - cleaned up

expecting success: 
	git rev-list --verify-objects --all >/dev/null 2>out &&
	test_cmp empty out

done.
ok 21 - 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 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

Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1503-rev-parse-verify/.git/
ok 16 - setup: GIT_WORK_TREE=absolute, below git dir

expecting success: 
	echo outside &&
	test_rev_parse false false false

outside
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)

Branch add_sub1 set up to track remote branch add_sub1 from origin.
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
	)

error: sha1 mismatch 63ffffffffffffffffffffffffffffffffffffff
ok 22 - rev-list --verify-objects with bad sha1

expecting success: 
	git cat-file commit HEAD >basis &&
	sed "s/^author .*/&,&/" <basis | tr , \\n >multiple-authors &&
	new=$(git hash-object -t commit -w --stdin <multiple-authors) &&
	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 &&
	git -c fsck.multipleAuthors=ignore fsck

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 18 - in repo.git

expecting success: 
	(
		cd repo.git/work &&
		test_rev_parse false true true ""
	)

error in commit 3d94ae45b63882b239b90285e1f253e2d4cd5e9f: multipleAuthors: invalid format - multiple 'author' lines
ok 2 - works with one good rev

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 19 - inside work tree

expecting success: 
	(
		cd repo.git/work/sub/dir &&
		test_rev_parse false true true sub/dir/
	)

ok 23 - force fsck to ignore double author

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
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/null-blob/.git/
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
notice: HEAD points to an unborn branch (master)
warning in tree aaf928e9279b56c88bcc8d79f881e5c820ea23e8: nullSha1: contains entries pointing to null sha1
notice: No default references
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

warning in tree aaf928e9279b56c88bcc8d79f881e5c820ea23e8: nullSha1: contains entries pointing to null sha1
ok 24 - 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
	)

fatal: Needed a single revision
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-commit/.git/
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

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
	)

notice: HEAD points to an unborn branch (master)
warning in tree f87f3eabd15018382578c00e3a71a46c842e17e6: nullSha1: contains entries pointing to null sha1
notice: No default references
warning in tree f87f3eabd15018382578c00e3a71a46c842e17e6: nullSha1: contains entries pointing to null sha1
ok 25 - 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 4 - fails silently when using -q

expecting success: 
	ref=$(git rev-parse HEAD) &&
	git update-ref --create-reflog -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

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 &&
Cloning into 'sub1'...
		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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dot-blob/.git/
ok 5 - fails silently when using -q with deleted reflogs

expecting success: 
	ref=$(git rev-parse HEAD) &&
	git update-ref --create-reflog -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

ok 24 - diff-index respects work tree under .git dir

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

[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
done.
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

ok 6 - fails silently when using -q with not enough reflogs

expecting success: 
	ref=$(git rev-parse HEAD) &&
	git update-ref --create-reflog -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

warning in tree 4d6a3deda84474ed5f701962ea9bf83c5fe08185: hasDot: contains '.'
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)"

warning in tree 4d6a3deda84474ed5f701962ea9bf83c5fe08185: hasDot: contains '.'
ok 26 - 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
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

fatal: Needed a single revision
fatal: Needed a single revision
ok 27 - git grep

expecting success: 
	(
		cd repo.git &&
		GIT_DIR=. GIT_WORK_TREE=work git commit -a -m done
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dot-tree/.git/
fatal: Needed a single revision
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

[master (root-commit) 85cdc17] done
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 sub/dir/tracked
32a594a3fdac2d57cf6d02987e30eec68511498c
ok 28 - git commit

expecting success: 
	(
		cd repo.git &&
		test_might_fail git config --unset core.worktree &&
		test_must_fail git log HEAD -- /home
	)

32a594a3fdac2d57cf6d02987e30eec68511498c
[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
Submodule path 'sub1': checked out '58630c04cd08e6914ad0ab5a3126bcfb71a3e6ca'
32a594a3fdac2d57cf6d02987e30eec68511498c
fatal: /home: '/home' is outside repository
32a594a3fdac2d57cf6d02987e30eec68511498c
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

git --git-dir=/«PKGBUILDDIR»/t/trash directory.t1501-worktree//repo.git --work-tree=/«PKGBUILDDIR»/t/trash directory.t1501-worktree add dummy_file
32a594a3fdac2d57cf6d02987e30eec68511498c
fatal: Needed a single revision
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

fatal: Needed a single revision
fatal: Needed a single revision
warning in tree 8984d55df404e56c99a9c5a2e5a168084a913e8f: hasDot: contains '.'
fatal: Needed a single revision
ok 31 - relative $GIT_WORK_TREE and git subprocesses

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

warning in tree 8984d55df404e56c99a9c5a2e5a168084a913e8f: hasDot: contains '.'
ok 27 - 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}

cp: cannot stat 'repo.git/sharedindex.*': No such file or directory
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dotdot-blob/.git/
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
	)

32a594a3fdac2d57cf6d02987e30eec68511498c
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
	)

3de952f2416b6084f557ec417709eac740c6818c
[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
88bcdc1839f0ad191ffdd65cae2a2a862d682151
fatal: Log for 'master' only has 4 entries.
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
		)
	
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: Log for 'master' only has 4 entries.
ok 10 - master@{n} for various n

# passed all 10 test(s)
1..10
warning in tree 879560d9e3297f45ca9c25d4eea563f8dd179a32: hasDotdot: contains '..'
warning in tree 879560d9e3297f45ca9c25d4eea563f8dd179a32: hasDotdot: contains '..'
ok 28 - 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
		)
*** t1504-ceiling-dirs.sh ***
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
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dotdot-tree/.git/
Cloning into 'submodule_update'...
[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/
expecting success: test '' = "$(git rev-parse --show-prefix)"
done.
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 1 - no_ceil

expecting success: test '' = "$(git rev-parse --show-prefix)"
ok 2 - ceil_empty

expecting success: test '' = "$(git rev-parse --show-prefix)"
ok 37 - $GIT_WORK_TREE overrides $GIT_DIR/common

warning in tree e704ff9811f799e752c8894dbc145bc74e4561fa: hasDotdot: contains '..'
ok 3 - ceil_at_parent

expecting success: test '' = "$(git rev-parse --show-prefix)"
# passed all 37 test(s)
1..37
warning in tree e704ff9811f799e752c8894dbc145bc74e4561fa: hasDotdot: contains '..'
ok 29 - fsck notices .. as tree

expecting success: 
		(
			git init $name-$type &&
			cd $name-$type &&
			echo content >file &&
			git add file &&
Switched to a new branch 'no_submodule'
			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
		)
Branch no_submodule set up to track remote branch no_submodule from origin.
ok 4 - ceil_at_parent_slash

expecting success: test '' = "$(git rev-parse --show-prefix)"
ok 5 - ceil_at_trash

expecting success: test '' = "$(git rev-parse --show-prefix)"
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dotgit-blob/.git/
ok 6 - ceil_at_trash_slash

expecting success: test '' = "$(git rev-parse --show-prefix)"
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 7 - ceil_at_sub

expecting success: test '' = "$(git rev-parse --show-prefix)"
*** t1505-rev-parse-last.sh ***
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

)
[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
prerequisite SYMLINKS ok
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 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
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1505-rev-parse-last/.git/
warning in tree 8ac5f64528d35de17a03755d2f3387af1de58b5a: hasDotgit: contains '.git'
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
	
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


warning in tree 8ac5f64528d35de17a03755d2f3387af1de58b5a: hasDotgit: contains '.git'
fatal: Not a git repository (or any of the parent directories): .git
ok 30 - fsck notices .git as blob

ok 13 - subdir_ceil_at_sub: prefix
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
		)

expecting success: 
		test_expect_code 128 git rev-parse --show-prefix
	
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
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dotgit-tree/.git/
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)"
[master (root-commit) df33a3a] 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 1
ok 17 - subdir_ceil_at_top_no_resolve

expecting success: test 'sub/dir/' = "$(git rev-parse --show-prefix)"
ok 18 - subdir_ceil_at_top_slash_no_resolve

expecting success: test 'sub/dir/' = "$(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 19 - subdir_ceil_at_subdir

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)"
[master bb5de15] 2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 2
ok 21 - subdir_ceil_at_su

expecting success: test 'sub/dir/' = "$(git rev-parse --show-prefix)"
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: hasDotgit: contains '.git'
warning in tree 69237360529ca48e6b6c1af14e753faabe339fb7: hasDotgit: contains '.git'
[master 6e485f2] 3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 3
ok 31 - 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 24 - subdir_ceil_at_sub_di_slash

expecting success: test 'sub/dir/' = "$(git rev-parse --show-prefix)"
Switched to branch 'side'
ok 25 - subdir_ceil_at_subdi

expecting success: test 'sub/dir/' = "$(git rev-parse --show-prefix)"
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/dotgit-case-blob/.git/
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
ok 27 - second_of_two: prefix

expecting success: 
		test_expect_code 128 git rev-parse --show-prefix
	
[side eefe273] 4
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 4
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
	
[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
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)"
Merging:
eefe273 4
virtual master
found 1 common ancestor:
df33a3a 1
Merge made by the 'recursive' strategy.
ok 30 - git_dir_specified

 2 | 1 +
 3 | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 2
 create mode 100644 3
expecting success: test 's/d/' = "$(git rev-parse --show-prefix)"
ok 31 - sd_no_ceil

expecting success: test 's/d/' = "$(git rev-parse --show-prefix)"
Switched to branch 'master'
ok 1 - setup

expecting success: 
	test_cmp_rev side @{-1}

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: hasDotgit: 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: hasDotgit: contains '.git'
ok 32 - 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

ok 2 - @{-1} works
expecting success: 
		test_expect_code 128 git rev-parse --show-prefix
	

expecting success: 
	test_cmp_rev side~2 @{-1}~2

Cloning into 'sub1'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dotgit-case-tree/.git/
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)"
ok 37 - sd_ceil_at_sd

expecting success: test 's/d/' = "$(git rev-parse --show-prefix)"
ok 3 - @{-1}~2 works

expecting success: 
	test_cmp_rev side^2 @{-1}^2

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
done.
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)"
ok 4 - @{-1}^2 works

expecting success: 
	test_cmp_rev side@{1} @{-1}@{1}

ok 41 - sd_ceil_at_s_di

expecting success: test 's/d/' = "$(git rev-parse --show-prefix)"
ok 42 - sd_ceil_at_s_di_slash

expecting success: test 's/d/' = "$(git rev-parse --show-prefix)"
ok 43 - sd_ceil_at_sdi

expecting success: test 's/d/' = "$(git rev-parse --show-prefix)"
ok 5 - @{-1}@{1} works

expecting success: 
	test_cmp_rev master @{-2}

ok 44 - sd_ceil_at_sdi_slash

warning in tree 968a2dfde1e164e0513456c00ef656b2497434a3: hasDotgit: contains '.git'
# passed all 44 test(s)
1..44
warning in tree 968a2dfde1e164e0513456c00ef656b2497434a3: hasDotgit: contains '.git'
ok 33 - 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 - @{-2} works

expecting success: 
	test_must_fail git rev-parse @{-3}

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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dotgit-unicode-blob/.git/
*** t1506-rev-parse-diagnosis.sh ***
# passed all 7 test(s)
1..7
[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
Submodule path 'sub1': checked out '58630c04cd08e6914ad0ab5a3126bcfb71a3e6ca'
*** t1507-rev-parse-upstream.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1506-rev-parse-diagnosis/.git/
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

warning in tree 2b65491a1b39699fb2bffda8e997c85fcb9c7beb: hasDotgit: contains '.git'
warning in tree 2b65491a1b39699fb2bffda8e997c85fcb9c7beb: hasDotgit: contains '.git'
ok 34 - 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.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
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dotgit-unicode-tree/.git/
[master (root-commit) d3d3f97] 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 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) )

[master (root-commit) d0dcf97] 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 1.t
[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
f719efd430d52bcfc8566a43b2eb655688d38871
ok 16 - git read-tree -u --reset: 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 &&
			$command add_sub1 &&
			test_superproject_content origin/add_sub1 &&
			test_dir_is_empty sub1
		)
	
8510665149157c2bc901848c3e0b746954e9cbd9
2bdf67abb163a4ffb2d7f3f0880c9fe5068ce782
Switched to a new branch 'side'
warning in tree 6a547d921721f1cf91601a53fcc7aae232947d23: hasDotgit: contains '.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

[side 82335b2] 2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 2.t
warning in tree 6a547d921721f1cf91601a53fcc7aae232947d23: hasDotgit: contains '.git'
ok 35 - fsck notices .gI{u200c}T 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
		)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dotgit-case2-blob/.git/
Switched to branch 'master'
ok 3 - correct relative file objects (0)

expecting success: 
	git rev-parse HEAD:file.txt >expected &&
	git rev-parse HEAD:./file.txt >result &&
	test_cmp expected result

Cloning into 'clone'...
Cloning into 'submodule_update'...
ok 4 - correct relative file objects (1)

expecting success: 
	(
		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
done.
ok 5 - correct relative file objects (2)

expecting success: 
	(
		cd subdir &&
		git rev-parse HEAD:../subdir/../file.txt >result &&
		test_cmp ../expected result
	)

done.
ok 6 - correct relative file objects (3)

expecting success: 
	git rev-parse HEAD:subdir/file.txt >expected &&
	(
		cd subdir &&
		git rev-parse HEAD:./file.txt >result &&
		test_cmp ../expected result
	)

[master 8f489d0] 3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 3.t
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
	)

warning in tree 3e29dd65f814deffead951c60da749fdf8a668c8: hasDotgit: contains '.git'
warning in tree 3e29dd65f814deffead951c60da749fdf8a668c8: hasDotgit: contains '.git'
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
ok 36 - 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
		)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dotgit-case2-tree/.git/
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
	)

[master 6efda21] 4
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 4.t
Branch add_sub1 set up to track remote branch add_sub1 from origin.
[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
Branch my-side set up to track remote branch side from origin.
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

foobar:file.txt
fatal: Invalid object name 'foobar'.
Branch local-master set up to track local branch master.
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 )

Branch fun@ny set up to track remote branch side from origin.
HEAD:nothing.txt
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
		)
	
fatal: Path 'nothing.txt' does not exist in 'HEAD'
Branch @funny set up to track remote branch side from origin.
warning in tree 50c7c9624762f2fe0d4efe5cba98835f58822ef4: hasDotgit: contains '.git'
HEAD:index-only.txt
warning in tree 50c7c9624762f2fe0d4efe5cba98835f58822ef4: hasDotgit: contains '.git'
ok 37 - 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
		)
fatal: Path 'index-only.txt' exists on disk, but not in 'HEAD'.
Branch funny@ set up to track remote branch side from origin.
HEAD:file2.txt
ok 11 - incorrect file in sha1:path

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/git-tilde1-blob/.git/
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

:nothing.txt
fatal: Path 'nothing.txt' does not exist (neither on disk nor in the index).
Cloning into 'submodule_update'...
:1:nothing.txt
fatal: Path 'nothing.txt' does not exist (neither on disk nor in the index).
[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
:1:file.txt
done.
:1:file.txt
From ..
 * [new branch]      master     -> master-only/master
 * [new tag]         3          -> 3
:file2.txt
:2:file2.txt
warning in tree 1206e1b64fcedc2a9e7b8195c1c4c1a278285b20: hasDotgit: contains '.git'
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.
warning in tree 1206e1b64fcedc2a9e7b8195c1c4c1a278285b20: hasDotgit: contains '.git'
ok 38 - 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
		)
:disk-only.txt
ok 1 - setup

expecting success: 
	test refs/remotes/origin/master = "$(full_name @{upstream})"

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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/git-tilde1-tree/.git/
t1013-read-tree-submodule.sh: 159: cd: can't cd to sub1
Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
ok 2 - @{upstream} resolves to correct full name

expecting success: 
	test refs/remotes/origin/master = "$(full_name @{u})"

fatal: Log for 'master' only has 1 entries.
[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 3 - @{u} resolves to correct full name

expecting success: 
	test refs/remotes/origin/side = "$(full_name my-side@{u})"

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
	)

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

HEAD:./nonexistent.txt
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

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

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

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

warning in tree 06f99accfb778f3318c72f3ae1c809cca146d27c: hasDotgit: contains '.git'
warning in tree 06f99accfb778f3318c72f3ae1c809cca146d27c: hasDotgit: contains '.git'
ok 39 - 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
		)
ok 7 - upstream of branch with @ at end

expecting success: 
	test_must_fail full_name refs/heads/my-side@{upstream}

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

fatal: no such branch: 'refs/heads/my-side'
ok 8 - refs/heads/my-side@{upstream} does not resolve to my-side{upstream}

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dotgitdot-blob/.git/
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})"

fatal: BUG: startup_info struct is not initialized.
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

Switched to branch 'side'
fatal: HEAD:file.txt: no such path in the working tree.
[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
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

[side e3f9627] 5
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 5.t
ok 19 - dotdot is not an empty set

expecting success: 
	test_must_fail git rev-parse foobar -- 2>stderr &&
	test_i18ngrep "bad revision" stderr

warning in tree 08554698725ae2bc2c2ae0172779111c62bda7a2: hasDotgit: contains '.git'
warning in tree 08554698725ae2bc2c2ae0172779111c62bda7a2: hasDotgit: contains '.git'
ok 40 - 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: bad revision 'foobar'
ok 20 - arg before dashdash must be a revision (missing)

expecting success: 
	>foobar &&
	test_must_fail git rev-parse foobar -- 2>stderr &&
	test_i18ngrep "bad revision" stderr

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dotgitdot-tree/.git/
From /«PKGBUILDDIR»/t/trash directory.t1507-rev-parse-upstream/.
   d0dcf97..8f489d0  master     -> origin/master
   82335b2..e3f9627  side       -> origin/side
 * [new tag]         5          -> 5
ok 22 - arg before dashdash must be a revision (ambiguous)

# passed all 22 test(s)
1..22
[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
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}

*** t1508-at-combinations.sh ***
fatal: no such branch: 'non-tracking'
Switched to a new branch 'non-tracking'
Cloning into 'sub1'...
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})

warning in tree 4d7df7e65b79aeef4640dbfba95705b94a2bc266: hasDotgit: contains '.git'
warning in tree 4d7df7e65b79aeef4640dbfba95705b94a2bc266: hasDotgit: contains '.git'
ok 41 - 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
		)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dot-backslash-case-blob/.git/
done.
[side 8bf5882] 6
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 6.t
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
[master (root-commit) 8ff5a25] master-one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 master-one.t
warning in tree 4447c608c557aa9e2d0d226c7af1f06937133ea1: hasDotgit: contains '.git'
[master 8164ab4] master-two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 master-two.t
warning in tree 4447c608c557aa9e2d0d226c7af1f06937133ea1: hasDotgit: contains '.git'
ok 42 - 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
		)
From /«PKGBUILDDIR»/t/trash directory.t1507-rev-parse-upstream/.
   e3f9627..8bf5882  side       -> origin/side
 * [new tag]         6          -> 6
Switched to a new branch 'upstream-branch'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dot-backslash-case-tree/.git/
Submodule path 'sub1': checked out '58630c04cd08e6914ad0ab5a3126bcfb71a3e6ca'
ok 11 - <branch>@{u}@{1} resolves correctly

expecting success: 
	git checkout HEAD^0 &&
	test_must_fail git rev-parse @{u}

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>

[upstream-branch 101729d] upstream-one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 upstream-one.t
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
)

Switched to a new branch 'new'
Branch new set up to track remote branch side from origin.
[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 a8562dc6d26106f039fc8af6b2aa6fed2b1e14d4: hasDotgit: contains '.git'
warning in tree a8562dc6d26106f039fc8af6b2aa6fed2b1e14d4: hasDotgit: contains '.git'
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 43 - 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 '@/at-test'
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
		)
	
Switched to branch 'master'
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)
Switched to a new branch '@@/at-test'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dotgit-case-backslash-blob/.git/
Deleted branch new (was 8bf5882).
Switched to a new branch '@at-test'
Branch new set up to track remote branch side from origin.
[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 'old-branch'
Merge made by the 'ours' strategy.
[old-branch 4e4e7fa] old-one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 old-one.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

warning in tree 707c253cde8e3742e9f02a3cf02fdc4ca0f55652: hasDotgit: contains '.git'
warning in tree 707c253cde8e3742e9f02a3cf02fdc4ca0f55652: hasDotgit: contains '.git'
ok 44 - 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
		)
Previous HEAD position was 8bf5882... 6
Cloning into 'submodule_update'...
Switched to a new branch 'other'
Branch other set up to track local branch master.
[old-branch 3273d4d] old-two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 old-two.t
Deleted branch master (was 8f489d0).
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/dotgit-case-backslash-tree/.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

Switched to a new branch 'new-branch'
done.
[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 'another'
Branch another set up to track local branch master.
[new-branch e49ce93] new-one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 new-one.t
Switched to branch 'master'
Switched to a new branch 'replace_sub1_with_directory'
ok 16 - checkout other@{u}

expecting success: 
	test refs/heads/master = "$(full_name local-master@{u})"

Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
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

warning in tree caa586f8ddde64c3fc9157a3a262c9bd6a6a41ff: hasDotgit: contains '.git'
[new-branch c493e4b] new-two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 new-two.t
warning in tree caa586f8ddde64c3fc9157a3a262c9bd6a6a41ff: hasDotgit: contains '.git'
ok 45 - 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
	)

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

error: 8ed2e6719f8484ce01fa3ce133fe42d25c2441b8^{commit}: expected commit type, but the object dereferences to tree type
fatal: Needed a single revision
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/not-dotgit/.git/
Branch old-branch set up to track local branch master.
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

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
	
Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
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 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
	
[master (root-commit) ebd6d19] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
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 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
	
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 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
	
ok 46 - fsck allows .Ňit

expecting success: 
	create_repo_missing HEAD:subdir/file &&
	test_must_fail git -C missing fsck

ok 22 - branch@{u} error message if upstream branch not fetched

expecting success: 
(
	cd clone &&
	git checkout local-master &&
	git pull
)

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
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/missing/.git/
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 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 7 - @{-1} = refs/heads/old-branch

[master (root-commit) 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
	
d38f542] one
 Author: A U Thor <author@example.com>
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 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
	
[master ca32bda] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 subdir/file
From .
 * branch            master     -> FETCH_HEAD
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
	
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
	
Updating 6efda21..ac35135
Fast-forward
ok 23 - pull works when tracking a local branch

expecting success: 
	test refs/heads/master = "$(full_name @{u})"

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 24 - @{u} works when tracking a local branch

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
	
expecting success: 
	git log -1 -g other@{u} >actual &&
	test_cmp expect actual

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
missing blob d95f3ad14dee633a758d2e331151e950dd13e4ed
ok 47 - fsck notices missing blob

expecting success: 
	create_repo_missing HEAD:subdir &&
	test_must_fail git -C missing fsck

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 25 - log -g other@{u}

expecting success: 
	git log -1 -g other@{u}@{now} >actual &&
	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 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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/missing/.git/
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
	
[master (root-commit) ok 17 - @@/at-test = refs/heads/@@/at-test

d38f542] one
 Author: A U Thor <author@example.com>
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

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
	
[detached HEAD eae0df2] funny reflog file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 @{yesterday}
ok 19 - @at-test = refs/heads/@at-test

expecting success: 
		test_must_fail git rev-parse --verify '@{u}@{-1}'
	
[master ca32bda] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 subdir/file
Cloning into 'sub1'...
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

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}'
	
fatal: no such branch: '@{1}'
ok 22 - @{1}@{u} is nonsensical

expecting success: 
		test_must_fail git rev-parse --verify 'HEAD@{-1}'
	
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}'
	
[detached HEAD c358789] funny upstream file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 @{upstream}
fatal: Log for 'new-branch' only has 3 entries.
ok 26 - @{3} is nonsensical

expecting success: 
	git checkout old-branch

done.
ok 28 - @{upstream}-parsing does not look beyond colon

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
	
error: 07753f428765ac1afe2020b24e40785869bd4a85: invalid sha1 pointer in cache-tree
broken link from    tree 5f9d5fe4279246e5b2ddcd446efc2aed53a52304
              to    tree 07753f428765ac1afe2020b24e40785869bd4a85
missing tree 07753f428765ac1afe2020b24e40785869bd4a85
ok 48 - fsck notices missing subtree

expecting success: 
	create_repo_missing HEAD^{tree} &&
	test_must_fail git -C missing fsck

# passed all 28 test(s)
1..28
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 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
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/missing/.git/
ok 30 - @{1} = old-one

expecting success: 
	echo content >normal &&
	echo content >fun@ny &&
	git add normal fun@ny &&
	git commit -m "funny path"

[master (root-commit) d38f542] one
 Author: A U Thor <author@example.com>
*** t1509-root-worktree.sh ***
[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
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
	
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
	
[master ca32bda] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 subdir/file
Submodule path 'sub1': checked out '58630c04cd08e6914ad0ab5a3126bcfb71a3e6ca'
ok 33 - @:fun@ny = content

# passed all 33 test(s)
1..33
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1509-root-worktree/.git/
1..0 # SKIP Test requiring writable / skipped. Read this test if you want to run it
error: 5f9d5fe4279246e5b2ddcd446efc2aed53a52304: invalid sha1 pointer in cache-tree
broken link from  commit ca32bdaaf4ee9eab00bafa6471c9a2fa98fc42c3
              to    tree 5f9d5fe4279246e5b2ddcd446efc2aed53a52304
missing tree 5f9d5fe4279246e5b2ddcd446efc2aed53a52304
ok 49 - fsck notices missing root tree

expecting success: 
	create_repo_missing HEAD^ &&
	test_must_fail git -C missing fsck

*** t1510-repo-setup.sh ***
*** t1511-rev-parse-caret.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/missing/.git/
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
		)
	
[master (root-commit) d38f542] one
 Author: A U Thor <author@example.com>
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1511-rev-parse-caret/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/.git/
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

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/
[master ca32bda] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 subdir/file
Cloning into 'submodule_update'...
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) e73b1e7] 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
missing commit d38f542f2d868bcbbb09173528a3bb403f53a0f0
ok 50 - fsck notices missing parent

expecting success: 
	create_repo_missing tag^{blob} &&
	test_must_fail git -C missing fsck

done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/1/.git/
Already on 'master'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/missing/.git/
[master 13f1d88] 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}

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
fatal: ambiguous argument 'ref^{non-existent}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
[master (root-commit) d38f542] one
 Author: A U Thor <author@example.com>
'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

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)"

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/2/.git/
[master ca32bda] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 subdir/file
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}

error: tree-tag^{commit}: expected commit type, but the object dereferences to tree type
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>...]'
tree-tag^{commit}
ok 3 - #2: worktree defaults to cwd with explicit GIT_DIR

expecting success: 
	try_repo 2b unset ".git" unset "" unset \
		".git" "$here/2b" "$here/2b" "(null)" \
		"../.git" "$here/2b/sub" "$here/2b/sub" "(null)"

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>...]'
broken link from     tag 7c115056e13b1f41142fe9e6f6cb98a1c077facd
              to    blob c21c9352f7526e9576892a6631e0e8cf1fccd34d
missing blob c21c9352f7526e9576892a6631e0e8cf1fccd34d
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}

ok 51 - 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.t1510-repo-setup/2b/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/missing/.git/
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

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}
[master (root-commit) d38f542] one
 Author: A U Thor <author@example.com>
ok 4 - #2b: relative GIT_DIR

expecting success: 
	setup_repo 3 unset "" unset &&
	mkdir -p 3/sub/sub 3/wt/sub

ok 6 - ref^{tag}

expecting success: 
	git rev-parse master >expected &&
	git rev-parse master^{/.} >actual &&
	test_cmp expected actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/3/.git/
[master ca32bda] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 subdir/file
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
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

error: HEAD: invalid sha1 pointer ca32bdaaf4ee9eab00bafa6471c9a2fa98fc42c3
error: refs/heads/master: invalid sha1 pointer ca32bdaaf4ee9eab00bafa6471c9a2fa98fc42c3
ok 9 - ref^{/Initial}

error: refs/heads/master: invalid reflog entry ca32bdaaf4ee9eab00bafa6471c9a2fa98fc42c3
error: HEAD: invalid reflog entry ca32bdaaf4ee9eab00bafa6471c9a2fa98fc42c3
ok 52 - fsck notices ref pointing to missing commit

expecting success: 
	create_repo_missing tag &&
	test_must_fail git -C missing fsck

# passed all 9 test(s)
1..9
Cloning into 'sub1'...
*** t1512-rev-parse-disambiguation.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/missing/.git/
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/
	
[master (root-commit) d38f542] one
 Author: A U Thor <author@example.com>
done.
[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.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

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 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)"
	
error: refs/tags/tag: invalid sha1 pointer 7c115056e13b1f41142fe9e6f6cb98a1c077facd
dangling blob c21c9352f7526e9576892a6631e0e8cf1fccd34d
ok 53 - fsck notices ref pointing to missing tag

0000000000b36b6aa7ea4b75318ed078f55505c3
expecting success: 
	rm -rf connectivity-only &&
	git init connectivity-only &&
	(
		cd connectivity-only &&
		touch empty &&
		git add empty &&
		test_commit empty &&
		empty=.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 &&
		rm -f $empty &&
		echo invalid >$empty &&
		test_must_fail git fsck --strict &&
		git fsck --strict --connectivity-only &&
		tree=$(git rev-parse HEAD:) &&
		suffix=${tree#??} &&
		tree=.git/objects/${tree%$suffix}/$suffix &&
		rm -f $tree &&
		echo invalid >$tree &&
		test_must_fail git fsck --strict --connectivity-only
	)

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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1450-fsck/connectivity-only/.git/
Submodule path 'sub1': checked out '58630c04cd08e6914ad0ab5a3126bcfb71a3e6ca'
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)

[master (root-commit) 86520b7] empty
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
 create mode 100644 empty
 create mode 100644 empty.t
ok 5 - disambiguate tree

expecting success: 
	# create one commit 0000000000e4f
	git commit -m a2onsxbvj

[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

error: inflate: data stream error (incorrect header check)
error: unable to unpack e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 header
error: inflate: data stream error (incorrect header check)
error: inflate: data stream error (incorrect header check)
fatal: loose object e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 (stored in .git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391) is corrupt
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)"
	
0000000000e4f9fbd19cf1e932319e5ad0d1d00b
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
0000000000e4f9fbd19cf1e932319e5ad0d1d00b
warning: unable to rmdir sub1: Directory not empty
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)

error: inflate: data stream error (incorrect header check)
fatal: loose object 0d3d3508cb204b9201d016862e6025a49e8c01d6 (stored in .git/objects/0d/3d3508cb204b9201d016862e6025a49e8c01d6) is corrupt
ok 54 - fsck --connectivity-only

# passed all 54 test(s)
1..54
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 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
		)
	
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 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..

0000000000e4f9fbd19cf1e932319e5ad0d1d00b
^0000000000e4f9fbd19cf1e932319e5ad0d1d00b
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

Cloning into 'submodule_update'...
ok 12 - git reset takes only commit-ish

expecting success: 
	# create one tag 0000000000f8f
	git tag -a -m j7cp83um v1.0.0

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/
	
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...

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}

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

done.
0000000000e4f9fbd19cf1e932319e5ad0d1d00b
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


Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
[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.t1510-repo-setup/4/.git/
[master 00000000008] ioiley5o
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 rename d12cr3h8t => j000jmpzn (79%)
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
*** t1513-rev-parse-prefix.sh ***
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'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1513-rev-parse-prefix/.git/
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

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'
[master (root-commit) dce83f4] 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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/5a/.git/
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
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

[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

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

fatal: Needed a single revision
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 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
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 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..000000000': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/6/.git/
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 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

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>...]'
Cloning into 'sub1'...
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

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...': 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

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

done.
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

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 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 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 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

warning: refname '0000000000663a70a94c2b280b575855256220fa' is ambiguous.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/6b/.git/
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

ok 11 - two-levels deep

# passed all 11 test(s)
1..11
Submodule path 'sub1': checked out '58630c04cd08e6914ad0ab5a3126bcfb71a3e6ca'
*** t1514-rev-parse-push.sh ***
warning: refname '00000000006' is ambiguous.
ok 23 - ambiguous short sha1 ref

# still have 3 known breakage(s)
# passed all remaining 20 test(s)
1..23
*** t1600-index.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1514-rev-parse-push/.git/
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)"

Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1514-rev-parse-push/parent.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/6c/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1514-rev-parse-push/other.git/
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
	)

warning: unable to rmdir sub1: Directory not empty
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
	)

[master (root-commit) d1ff1c9] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 base.t
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
	)

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)"

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
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/6d/.git/
To parent.git
 * [new branch]      HEAD -> master
Branch master set up to track remote branch master from origin.
ok 6 - GIT_INDEX_VERSION takes precedence over config

# passed all 6 test(s)
1..6
Branch topic set up to track remote branch master from origin.
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
		)
	
*** t1700-split-index.sh ***
To parent.git
 * [new branch]      topic -> topic
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/

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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/6e/.git/
Cloning into 'submodule_update'...
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

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}

done.
fatal: push has no destination (push.default is 'nothing')
ok 2 - @{push} with default=nothing

expecting success: 
	test_config push.default simple &&
	resolve master@{push} refs/remotes/origin/master

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

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 3 - @{push} with default=simple

expecting success: 
	test_config push.default simple &&
	test_must_fail git rev-parse topic@{push}

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/

fatal: cannot resolve 'simple' push to a single destination
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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/6f/.git/
ok 4 - triangular @{push} fails with default=simple

expecting success: 
	test_config push.default current &&
	resolve topic@{push} refs/remotes/origin/topic

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

ok 5 - @{push} with default=current

expecting success: 
	test_config push.default matching &&
	resolve topic@{push} refs/remotes/origin/topic

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

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

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 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 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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/7/.git/
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
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 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 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

To parent.git
 * [new branch]      master -> magic/master
 * [new branch]      topic -> magic/topic
Cloning into 'sub1'...
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 8 - @{push} with push refspecs

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/
	
# passed all 8 test(s)
1..8
done.
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

*** t2000-checkout-cache-clash.sh ***
ok 11 - unify index, two files remain

# passed all 11 test(s)
1..11
*** t2001-checkout-cache-clash.sh ***
ok 22 - #7: explicit GIT_WORK_TREE and GIT_DIR in subdir

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2000-checkout-cache-clash/.git/
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)"
	
expecting success: git update-index --add path0 path1/file1
Submodule path 'sub1': checked out '58630c04cd08e6914ad0ab5a3126bcfb71a3e6ca'
ok 1 - git update-index --add various paths.

expecting success: test_must_fail git checkout-index -a
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2001-checkout-cache-clash/.git/
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.

expecting success: git update-index --add path0/file0
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

)
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
ok 1 - git update-index --add path0/file0

expecting success: tree1=$(git write-tree)
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/

warning: unable to rmdir sub1: Directory not empty
test_must_fail: command succeeded: git read-tree -u --reset replace_sub1_with_directory
ok 2 - writing tree out with git write-tree

first
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)"
	
expecting success: git update-index --add path1/file1
second
ok 3 - git update-index --add path1/file1

expecting success: tree2=$(git write-tree)
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
		)
	
ok 5 - checkout-index -f twice with --prefix

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

expecting success: git read-tree -m $tree1 && git checkout-index -f -a
*** t2002-checkout-cache-u.sh ***
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

)
prerequisite SYMLINKS ok
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 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/
	
Cloning into 'submodule_update'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2002-checkout-cache-u/.git/
expecting success: 
echo frotz >path0 &&
git update-index --add path0 &&
t=$(git write-tree)
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
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
done.
*** t2003-checkout-cache-mkdir.sh ***
: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
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
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/
	
ok 3 - with -u, git checkout-index picks up stat information from new files.

# passed all 3 test(s)
1..3
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

*** t2004-checkout-cache-temp.sh ***
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

)
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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2004-checkout-cache-temp/.git/
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 - 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

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)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/8/.git/
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 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

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

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

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
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 1 - setup

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/9/.git/
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 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

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 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)"

Cloning into 'sub1'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/10/.git/
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

done.
ok 10 - apply CRLF filter from working tree .gitattributes with --prefix

# passed all 10 test(s)
1..10
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 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)"

*** t2005-checkout-index-symlinks.sh ***
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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/10b/.git/
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

Submodule path 'sub1': checked out '58630c04cd08e6914ad0ab5a3126bcfb71a3e6ca'
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
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

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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/11/.git/
ok 1 - preparation

expecting success: 
git checkout-index symlink &&
test -f symlink
git checkout-index: path0 does not exist at stage 4
ok 2 - the checked-out symlink must be a file

expecting success: 
test "$(git hash-object -t blob symlink)" = $l
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)"
	
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)

ok 3 - the file must be the blob we added during the setup

Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
# passed all 3 test(s)
1..3
*** t2006-checkout-index-basic.sh ***
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)

ok 9 - checkout some stages/one file to temporary files

expecting success: 
	rm -f path* .merge_* actual &&
	git checkout-index -a --stage=all --temp >actual &&
	test_line_count = 5 actual

warning: unable to rmdir sub1: Directory not empty
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2006-checkout-index-basic/.git/
test_must_fail: command succeeded: git read-tree -u --reset replace_sub1_with_directory
ok 10 - checkout all stages/all files to temporary files

expecting success: 
	test x$(grep path0 actual | cut "-d	" -f2) = x

expecting success: 
	test_expect_code 129 git checkout-index --gobbledegook 2>err &&
	test_i18ngrep "[Uu]sage" err

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)

ok 32 - #11: 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/
	
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
		)
	
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 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)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2006-checkout-index-basic/broken/.git/
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)

usage: git checkout-index [<options>] [--] [<file>...]
ok 2 - checkout-index -h in broken repository

# passed all 2 test(s)
1..2
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)

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)

*** t2007-checkout-symlink.sh ***
ok 33 - #11: 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 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)
	)

Cloning into 'submodule_update'...
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

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2007-checkout-symlink/.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

)
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/"


prerequisite SYMLINKS ok
done.
[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
ok 18 - checkout --temp symlink

expecting success: 
	rm -f path* .merge_* actual .git/index &&
	>path0123456789 &&
	git update-index --add path0123456789 &&
	(
		cd asubdir &&
		git checkout-index --temp -- ../path0123456789 >actual &&
		test_line_count = 1 actual &&
		test $(cut "-d	" -f2 actual) = ../path0123456789
	)

ok 34 - #11: 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)"
	
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 19 - emit well-formed relative path

# passed all 19 test(s)
1..19
[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'
*** t2008-checkout-subdir.sh ***
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

)
prerequisite SYMLINKS ok
ok 35 - #11: 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/
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2008-checkout-subdir/.git/
expecting success: 

	echo "base" > file0 &&
	git add file0 &&
	mkdir dir1 &&
	echo "hello" > dir1/file1 &&
	git add dir1/file1 &&
	mkdir dir2 &&
	echo "bonjour" > dir2/file2 &&
	git add dir2/file2 &&
	test_tick &&
	git commit -m "populate tree"


[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 frotz
 rename {frotz => xyzzy}/filfre (100%)
ok 1 - setup

expecting success: 

	git checkout master


Switched to branch 'master'
ok 2 - switch from symlink to dir

expecting success: 
	rm -fr frotz xyzzy nitfol &&
	git checkout -f master

Already on 'master'
ok 3 - Remove temporary directories & switch to master

expecting success: 

	git checkout side


Switched to branch 'side'
ok 4 - switch from dir to symlink

[master (root-commit) 15793b3] populate tree
 Author: A U Thor <author@example.com>
 3 files changed, 3 insertions(+)
 create mode 100644 dir1/file1
 create mode 100644 dir2/file2
 create mode 100644 file0
# passed all 4 test(s)
1..4
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 1 - setup

expecting success: 

	(
		cd dir1 &&
		rm ../file0 &&
		git checkout HEAD -- ../file0 &&
		test "base" = "$(cat ../file0)" &&
		rm ../dir2/file2 &&
		git checkout HEAD -- ../dir2/file2 &&
		test "bonjour" = "$(cat ../dir2/file2)" &&
		rm ../file0 ./file1 &&
		git checkout HEAD -- .. &&
		test "base" = "$(cat ../file0)" &&
		test "hello" = "$(cat file1)"
	)


ok 36 - #11: 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/
	
*** t2009-checkout-statinfo.sh ***
ok 2 - remove and restore with relative path

expecting success: 

	rm file0 &&
	git checkout HEAD -- file0 &&
	test "base" = "$(cat file0)"


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2009-checkout-statinfo/.git/
ok 3 - checkout with empty prefix
Cloning into 'sub1'...

expecting success: 

	rm dir1/file1 &&
	git checkout HEAD -- dir1 &&
	test "hello" = "$(cat dir1/file1)" &&
	rm dir1/file1 &&
	git checkout HEAD -- dir1/file1 &&
	test "hello" = "$(cat dir1/file1)"


expecting success: 

	echo hello >world &&
	git update-index --add world &&
	git commit -m initial &&
	git branch side &&
	echo goodbye >world &&
	git update-index --add world &&
	git commit -m second


ok 4 - checkout with simple prefix

expecting success: 
	(
		cd dir1 &&
		rm file1 &&
		git checkout HEAD -- ../dir1/../dir1/file1 &&
		test "hello" = "$(cat file1)"
	)

ok 37 - #11: chdir_to_toplevel uses worktree (from subdir)

expecting success: 
	try_repo 12 unset unset "$here/12" gitfile unset \
		"$here/12.git" "$here/12" "$here/12" "(null)" \
		"$here/12.git" "$here/12" "$here/12" sub/ 2>message &&
	! test -s message

[master (root-commit) 86eaa07] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 world
done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/12/.git/
ok 5 - checkout with complex relative path

expecting success: test_must_fail git checkout HEAD -- ../../Makefile
fatal: ../../Makefile: '../../Makefile' is outside repository
ok 6 - relative path outside tree should fail

expecting success: test_must_fail git checkout HEAD -- ../file0
[master 8622032] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - setup

expecting success: 

	git reset --hard &&
	test "$(git diff-files --raw)" = "" &&

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

	git checkout side &&
	test "$(git diff-files --raw)" = "" &&

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


fatal: ../file0: '../file0' is outside repository
ok 7 - incorrect relative path to file should fail (1)

expecting success: ( cd dir1 && test_must_fail git checkout HEAD -- ./file0 )
error: pathspec './file0' did not match any file(s) known to git.
ok 8 - incorrect relative path should fail (2)

expecting success: ( cd dir1 && test_must_fail git checkout HEAD -- ../../file0 )
HEAD is now at 8622032 second
fatal: ../../file0: '../../file0' is outside repository
ok 9 - incorrect relative path should fail (3)

Already on 'master'
# passed all 9 test(s)
1..9
ok 38 - #12: core.worktree with gitfile is accepted

expecting success: 
	# or: you cannot intimidate away the lack of GIT_DIR setting
	try_repo 13 non-existent-too unset non-existent gitfile unset \
		"$here/13.git" "$here/13/non-existent-too" "$here/13" "(null)" \
		"$here/13.git" "$here/13/sub/non-existent-too" "$here/13/sub" "(null)" 2>message &&
	! test -s message

Switched to branch 'side'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/13/.git/
*** t2010-checkout-ambiguous.sh ***
Submodule path 'sub1': checked out '58630c04cd08e6914ad0ab5a3126bcfb71a3e6ca'
Switched to branch 'master'
ok 2 - branch switching

expecting success: 

	git reset --hard &&
	test "$(git diff-files --raw)" = "" &&

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

	git checkout side world &&
	test "$(git diff-files --raw)" = "" &&

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


HEAD is now at 8622032 second
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2010-checkout-ambiguous/.git/
expecting success: 
	echo hello >world &&
	echo hello >all &&
	git add all world &&
	git commit -m initial &&
	git branch world

ok 39 - #13: core.worktree+GIT_WORK_TREE accepted (with gitfile)

expecting success: 
	setup_repo 14 "$here/14" gitfile unset &&
	try_case 14 unset .git \
		"$here/14.git" "$here/14" "$here/14" "(null)" &&
	try_case 14 unset "$here/14/.git" \
		"$here/14.git" "$here/14" "$here/14" "(null)" &&
	try_case 14/sub/sub unset ../../.git \
		"$here/14.git" "$here/14" "$here/14" sub/sub/ &&
	try_case 14/sub/sub unset "$here/14/.git" \
		"$here/14.git" "$here/14" "$here/14" sub/sub/ &&

	setup_repo 14c "$here/14c/wt" gitfile unset &&
	mkdir -p 14c/wt/sub &&

	try_case 14c unset .git \
		"$here/14c.git" "$here/14c/wt" "$here/14c" "(null)" &&
	try_case 14c unset "$here/14c/.git" \
		"$here/14c.git" "$here/14c/wt" "$here/14c" "(null)" &&
	try_case 14c/sub/sub unset ../../.git \
		"$here/14c.git" "$here/14c/wt" "$here/14c/sub/sub" "(null)" &&
	try_case 14c/sub/sub unset "$here/14c/.git" \
		"$here/14c.git" "$here/14c/wt" "$here/14c/sub/sub" "(null)" &&

	setup_repo 14d "$here/14d/wt" gitfile unset &&
	mkdir -p 14d/wt/sub &&

	try_case 14d unset .git \
		"$here/14d.git" "$here/14d/wt" "$here/14d" "(null)" &&
	try_case 14d unset "$here/14d/.git" \
		"$here/14d.git" "$here/14d/wt" "$here/14d" "(null)" &&
	try_case 14d/sub/sub unset ../../.git \
		"$here/14d.git" "$here/14d/wt" "$here/14d/sub/sub" "(null)" &&
	try_case 14d/sub/sub unset "$here/14d/.git" \
		"$here/14d.git" "$here/14d/wt" "$here/14d/sub/sub" "(null)" &&

	setup_repo 14e "$here" gitfile unset &&
	try_case 14e unset .git \
		"$here/14e.git" "$here" "$here" 14e/ &&
	try_case 14e unset "$here/14e/.git" \
		"$here/14e.git" "$here" "$here" 14e/ &&
	try_case 14e/sub/sub unset ../../.git \
		"$here/14e.git" "$here" "$here" 14e/sub/sub/ &&
	try_case 14e/sub/sub unset "$here/14e/.git" \
		"$here/14e.git" "$here" "$here" 14e/sub/sub/

Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/14/.git/
[master (root-commit) 4635131] initial
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 all
 create mode 100644 world
test_must_fail: command succeeded: git read-tree -u --reset replace_sub1_with_file
ok 1 - setup

expecting success: 
	test_must_fail git checkout $(git hash-object ./all) --

ok 3 - path checkout

not ok 24 - git read-tree -u --reset: 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
		)
	
# passed all 3 test(s)
1..3
fatal: reference is not a tree: ce013625030ba8dba906f756967f9e9ca394464a
ok 2 - reference must be a tree

expecting success: 
	test "refs/heads/master" = "$(git symbolic-ref HEAD)" &&
	git checkout world -- &&
	test "refs/heads/world" = "$(git symbolic-ref HEAD)"

*** t2011-checkout-invalid-head.sh ***
Switched to branch 'world'
ok 3 - branch switching

expecting success: 
	echo bye > world &&
	git checkout -- world &&
	git diff --exit-code --quiet

ok 4 - checkout world from the index

expecting success: 
	git checkout all

Cloning into 'submodule_update'...
ok 5 - non ambiguous call

expecting success: 
	git checkout world &&
	test "refs/heads/world" = "$(git symbolic-ref HEAD)"

Already on 'world'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2011-checkout-invalid-head/.git/
ok 6 - allow the most common case

expecting success: 
	test_must_fail git checkout world all

expecting success: 
	echo hello >world &&
	git add world &&
	git commit -m initial

done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/14c/.git/
fatal: ambiguous argument 'world': both revision and filename
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
ok 7 - check ambiguity

expecting success: 
	echo bye > world &&
	git checkout world -- world &&
	git diff --exit-code --quiet

[master (root-commit) 2cbb940] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 world
ok 1 - setup

expecting success: 
	test_must_fail git checkout -b newbranch master^{tree}

ok 8 - disambiguate checking out from a tree-ish

expecting success: 
	test_must_fail git checkout HEAD master -- 2>actual &&
	grep 2 actual &&
	test_i18ngrep "one reference expected, 2 given" actual

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
fatal: Cannot switch branch to a non-commit 'master^{tree}'
ok 2 - checkout should not start branch from a tree

expecting success: 
	echo $_z40 >.git/HEAD &&
	git checkout master --

fatal: only one reference expected, 2 given.
fatal: only one reference expected, 2 given.
ok 9 - accurate error message with more than one ref

Switched to branch 'master'
ok 3 - checkout master from invalid HEAD

# passed all 9 test(s)
1..9
# passed all 3 test(s)
1..3
*** t2012-checkout-last.sh ***
*** t2013-checkout-submodule.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/14d/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2012-checkout-last/.git/
expecting success: 
	mkdir submodule &&
	(cd submodule &&
	 git init &&
	 test_commit first) &&
	git add submodule &&
	test_tick &&
	git commit -m superproject &&
	(cd submodule &&
	 test_commit second) &&
	git add submodule &&
	test_tick &&
	git commit -m updated.superproject

expecting success: 
	echo hello >world &&
	git add world &&
	git commit -m initial &&
	git branch other &&
	echo "hello again" >>world &&
	git add world &&
	git commit -m second

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule/.git/
[master (root-commit) 2cbb940] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 world
[master (root-commit) 50e526b] first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 first.t
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
[master 1c70d81] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 1 - setup

expecting success: 
	test_must_fail git checkout -

[master (root-commit) 1844aa5] superproject
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 160000 submodule
error: pathspec '-' did not match any file(s) known to git.
ok 2 - "checkout -" does not work initially

expecting success: 
	git checkout other

Switched to branch 'other'
ok 3 - first branch switch

[master d662100] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 second.t
expecting success: 
	git checkout - &&
	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/master"

Switched to branch 'master'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/14e/.git/
ok 4 - "checkout -" switches back

expecting success: 
	git checkout - &&
	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/other"

[master 14e674f] updated.superproject
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - setup

expecting success: 
	git update-index --refresh &&
	git diff-files --quiet &&
	git diff-index --quiet --cached HEAD &&
	git reset HEAD^ submodule &&
	test_must_fail git diff-files --quiet &&
	git reset submodule &&
	git diff-files --quiet

Cloning into 'sub1'...
Switched to branch 'other'
ok 5 - "checkout -" switches forth

expecting success: 
	git checkout $(git rev-parse HEAD)

done.
Note: checking out '2cbb94079bd629061f1ee70c696d17d67135080b'.

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 2cbb940... initial
ok 6 - detach HEAD

expecting success: 
	git checkout - &&
	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/other"

Unstaged changes after reset:
M	submodule
Switched to branch 'other'
ok 7 - "checkout -" attaches again

expecting success: 
	git checkout - &&
	test "z$(git rev-parse HEAD)" = "z$(git rev-parse other)" &&
	test_must_fail git symbolic-ref HEAD

Note: checking out '2cbb94079bd629061f1ee70c696d17d67135080b'.

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 2cbb940... initial
ok 2 - "reset <submodule>" updates the index

expecting success: 
	git update-index --refresh &&
	git diff-files --quiet &&
	git diff-index --quiet --cached HEAD &&
	git checkout HEAD^ submodule &&
	test_must_fail git diff-files --quiet &&
	git checkout HEAD submodule &&
	git diff-files --quiet

ok 40 - #14: core.worktree with GIT_DIR pointing to gitfile

expecting success: 
	setup_repo 14b ../14b gitfile unset &&
	try_case 14b unset .git \
		"$here/14b.git" "$here/14b" "$here/14b" "(null)" &&
	try_case 14b unset "$here/14b/.git" \
		"$here/14b.git" "$here/14b" "$here/14b" "(null)" &&
	try_case 14b/sub/sub unset ../../.git \
		"$here/14b.git" "$here/14b" "$here/14b" sub/sub/ &&
	try_case 14b/sub/sub unset "$here/14b/.git" \
		"$here/14b.git" "$here/14b" "$here/14b" sub/sub/ &&

	setup_repo 14f ../ gitfile unset &&
	try_case 14f unset .git \
		"$here/14f.git" "$here" "$here" 14f/ &&
	try_case 14f unset "$here/14f/.git" \
		"$here/14f.git" "$here" "$here" 14f/ &&
	try_case 14f/sub/sub unset ../../.git \
		"$here/14f.git" "$here" "$here" 14f/sub/sub/ &&
	try_case 14f/sub/sub unset "$here/14f/.git" \
		"$here/14f.git" "$here" "$here" 14f/sub/sub/

fatal: ref HEAD is not a symbolic ref
ok 8 - "checkout -" detaches again

expecting success: 
	for i in 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
	do
		git checkout -b branch$i
	done

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/14b/.git/
Switched to a new branch 'branch16'
Switched to a new branch 'branch15'
Submodule path 'sub1': checked out '58630c04cd08e6914ad0ab5a3126bcfb71a3e6ca'
Switched to a new branch 'branch14'
Switched to a new branch 'branch13'
ok 3 - "checkout <submodule>" updates the index only

expecting success: 
	git config diff.ignoreSubmodules dirty &&
	echo x> submodule/untracked &&
	git checkout HEAD >actual 2>&1 &&
	! test -s actual

Switched to a new branch 'branch12'
Switched to a new branch 'branch11'
ok 4 - "checkout <submodule>" honors diff.ignoreSubmodules

expecting success: 
	git config diff.ignoreSubmodules none &&
	git config -f .gitmodules submodule.submodule.path submodule &&
	git config -f .gitmodules submodule.submodule.ignore untracked &&
	git checkout HEAD >actual 2>&1 &&
	! test -s actual

Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
Switched to a new branch 'branch10'
Switched to a new branch 'branch9'
Switched to a new branch 'branch8'
ok 5 - "checkout <submodule>" honors submodule.*.ignore from .gitmodules

expecting success: 
	git config -f .gitmodules submodule.submodule.ignore none &&
	git config submodule.submodule.path submodule &&
	git config submodule.submodule.ignore all &&
	git checkout HEAD >actual 2>&1 &&
	! test -s actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/14f/.git/
Switched to a new branch 'branch7'
Switched to a new branch 'branch6'
Switched to a new branch 'branch5'
ok 6 - "checkout <submodule>" honors submodule.*.ignore from .git/config

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
		)
	
Switched to a new branch 'branch4'
test_must_fail: command succeeded: git read-tree -u --reset replace_sub1_with_file
Switched to a new branch 'branch3'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule_update_repo/.git/
Switched to a new branch 'branch2'
not ok 25 - git read-tree -u --reset: 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
		)
	
Switched to a new branch 'branch1'
ok 9 - more switches

expecting success: 
	more_switches &&
	git checkout @{-1} &&
	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/branch2"

[master (root-commit) 3950f7e] 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
Switched to branch 'branch16'
ok 41 - #14b: core.worktree is relative to actual git dir

expecting success: 
	setup_repo 15 non-existent gitfile unset &&
	mkdir -p 15/sub/sub 15/wt/sub

Switched to branch 'branch15'
Switched to a new branch 'add_sub1'
Switched to branch 'branch14'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/15/.git/
Switched to branch 'branch13'
ok 42 - #15: 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)"
	
Switched to branch 'branch12'
Cloning into 'submodule_update'...
Switched to branch 'branch11'
Switched to branch 'branch10'
done.
Switched to branch 'branch9'
Switched to branch 'branch8'
Switched to branch 'branch7'
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Cloning into 'sub1'...
Switched to branch 'branch6'
ok 43 - #15: 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/
	
Switched to branch 'branch5'
Switched to branch 'branch4'
done.
Switched to branch 'branch3'
Switched to branch 'branch2'
Switched to branch 'branch1'
Switched to branch 'branch2'
ok 10 - switch to the last

expecting success: 
	more_switches &&
	git checkout @{-2} &&
	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/branch3"

ok 44 - #15: 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)"
	
Switched to branch 'branch16'
Switched to branch 'branch15'
Switched to branch 'branch14'
Switched to branch 'branch13'
Switched to branch 'branch12'
[add_sub1 d6b6098] Add sub1
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
Switched to branch 'branch11'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
Switched to branch 'branch10'
Switched to a new branch 'remove_sub1'
ok 45 - #15: 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)"
	
Switched to branch 'branch9'
Removing sub1
Removing .gitmodules
Switched to branch 'branch8'
[remove_sub1 767f9cf] 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 branch 'branch7'
Switched to branch 'branch6'
Switched to branch 'branch5'
Switched to a new branch 'modify_sub1'
Switched to branch 'branch4'
Cloning into 'sub1'...
Switched to branch 'branch3'
ok 46 - #15: 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/
	
Switched to branch 'branch2'
done.
Switched to branch 'branch1'
Switched to branch 'branch3'
ok 11 - switch to second from the last

expecting success: 
	more_switches &&
	git checkout @{-3} &&
	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/branch4"

Switched to branch 'branch16'
Switched to branch 'branch15'
Switched to branch 'branch14'
Switched to branch 'branch13'
Switched to branch 'branch12'
ok 47 - #15: 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/
	
Switched to branch 'branch11'
Submodule path 'sub1': checked out '58630c04cd08e6914ad0ab5a3126bcfb71a3e6ca'
Switched to branch 'branch10'
Switched to branch 'branch9'
Switched to branch 'branch8'
Switched to branch 'branch7'
From /«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule_update_repo/.
   3950f7e..d6b6098  add_sub1   -> origin/add_sub1
 * [new branch]      modify_sub1 -> origin/modify_sub1
 * [new branch]      remove_sub1 -> origin/remove_sub1
Switched to branch 'branch6'
Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
Switched to a new branch 'modifications'
Switched to branch 'branch5'
ok 48 - #15: chdir_to_toplevel uses worktree (from subdir)

expecting success: 
	setup_repo 16a unset "" unset &&
	mkdir -p 16a/.git/wt/sub &&

	try_case 16a/.git unset unset \
		. "(null)" "$here/16a/.git" "(null)" &&
	try_case 16a/.git/wt unset unset \
		"$here/16a/.git" "(null)" "$here/16a/.git/wt" "(null)" &&
	try_case 16a/.git/wt/sub unset unset \
		"$here/16a/.git" "(null)" "$here/16a/.git/wt/sub" "(null)"

Switched to branch 'branch4'
[modifications 7cbf995] modified file2 and added file3
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 file3
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/16a/.git/
Switched to branch 'branch3'
Switched to branch 'branch2'
Switched to branch 'branch1'
Switched to branch 'branch4'
ok 12 - switch to third from the last

expecting success: 
	more_switches &&
	git checkout @{-4} &&
	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/branch5"

To /«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule_update_repo/.
 * [new branch]      modifications -> modifications
Switched to branch 'branch16'
Switched to branch 'branch15'
Switched to branch 'branch14'
ok 49 - #16a: implicitly bare repo (cwd inside .git dir)

expecting success: 
	setup_repo 16b unset "" true &&
	mkdir -p 16b/.git/wt/sub &&

	try_case 16b/.git unset unset \
		. "(null)" "$here/16b/.git" "(null)" &&
	try_case 16b/.git/wt unset unset \
		"$here/16b/.git" "(null)" "$here/16b/.git/wt" "(null)" &&
	try_case 16b/.git/wt/sub unset unset \
		"$here/16b/.git" "(null)" "$here/16b/.git/wt/sub" "(null)"

[modify_sub1 939eca0] Modify sub1
 Author: A U Thor <author@example.com>
Switched to branch 'branch13'
Switched to a new branch 'replace_sub1_with_directory'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/16b/.git/
Switched to branch 'branch12'
Switched to branch 'branch11'
Switched to branch 'branch10'
Switched to branch 'branch9'
Switched to branch 'branch8'
Switched to branch 'branch7'
Submodule path 'sub1': checked out '853843e63cd0418826f5b5ca76d712e9cd620078'
Switched to branch 'branch6'
Switched to branch 'branch5'
ok 50 - #16b: bare .git (cwd inside .git dir)

expecting success: 
	try_repo 16c unset unset unset "" true \
		.git "(null)" "$here/16c" "(null)" \
		"$here/16c/.git" "(null)" "$here/16c/sub" "(null)"

Switched to branch 'branch4'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/16c/.git/
Switched to branch 'branch3'
Switched to branch 'branch2'
ok 26 - git read-tree -u --reset: 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 'branch1'
Switched to branch 'branch5'
ok 13 - switch to fourth from the last

expecting success: 
	more_switches &&
	git checkout @{-12} &&
	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/branch13"

ok 51 - #16c: bare .git has no worktree

expecting success: 
	setup_repo 16d unset "" unset &&
	(
		cd 16d/.git &&
		test_must_fail git status &&
		git config alias.st status &&
		test_must_fail git st
	)

Submodule path 'sub1': checked out '3950f7ed37a2b5b8e95094de1b49ceba8eecb3d9'
Switched to branch 'branch16'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/16d/.git/
Switched to branch 'branch15'
Previous HEAD position was 3950f7e... Base
Switched to branch 'modifications'
fatal: This operation must be run in a work tree
Switched to branch 'branch14'
rm 'sub1'
Switched to branch 'branch13'
fatal: This operation must be run in a work tree
ok 52 - #16d: bareness preserved across alias

expecting success: 
	setup_repo 16e unset "" unset &&
	(
		cd 16e/.git &&
		test_must_fail git status &&
		test_must_fail git --bare status
	)

Cloning into 'submodule_update'...
Switched to branch 'branch12'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/16e/.git/
Switched to branch 'branch11'
fatal: This operation must be run in a work tree
Switched to branch 'branch10'
done.
fatal: This operation must be run in a work tree
ok 53 - #16e: bareness preserved by --bare

[replace_sub1_with_directory fabc310] 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
expecting success: 
	# Just like #16.
	setup_repo 17a unset "" true &&
	setup_repo 17b unset "" true &&
	mkdir -p 17a/.git/wt/sub &&
	mkdir -p 17b/.git/wt/sub &&

	try_case 17a/.git "$here/17a" unset \
		"$here/17a/.git" "$here/17a" "$here/17a" .git/ \
		2>message &&
	try_case 17a/.git/wt "$here/17a" unset \
		"$here/17a/.git" "$here/17a" "$here/17a" .git/wt/ &&
	try_case 17a/.git/wt/sub "$here/17a" unset \
		"$here/17a/.git" "$here/17a" "$here/17a" .git/wt/sub/ &&

	try_case 17b/.git "$here/17b" unset \
		"$here/17b/.git" "$here/17b" "$here/17b" .git/ &&
	try_case 17b/.git/wt "$here/17b" unset \
		"$here/17b/.git" "$here/17b" "$here/17b" .git/wt/ &&
	try_case 17b/.git/wt/sub "$here/17b" unset \
		"$here/17b/.git" "$here/17b" "$here/17b" .git/wt/sub/ &&

	try_repo 17c "$here/17c" unset unset "" true \
		.git "$here/17c" "$here/17c" "(null)" \
		"$here/17c/.git" "$here/17c" "$here/17c" sub/ 2>message &&
	! test -s message

Switched to branch 'branch9'
Switched to a new branch 'replace_directory_with_sub1'
Switched to branch 'branch8'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/17a/.git/
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Switched to branch 'branch7'
Removing sub1/file3
Removing sub1/file2
Removing sub1/file1
Adding sub1
Switched to branch 'branch6'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/17b/.git/
[replace_directory_with_sub1 4a5efd8] 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
Switched to branch 'branch5'
Switched to a new branch 'replace_sub1_with_file'
Switched to branch 'branch4'
rm 'sub1'
Switched to branch 'branch3'
Switched to branch 'branch2'
[replace_sub1_with_file 79a2913] Replace sub1 with file
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
Switched to branch 'branch1'
Switched to branch 'branch13'
Switched to a new branch 'replace_file_with_sub1'
ok 14 - switch to twelfth from the last

expecting success: 
	git checkout -b another other &&
	echo "hello again" >>world &&
	git add world &&
	git commit -m third

Switched to a new branch 'another'
[replace_file_with_sub1 03d0e45] Revert "Replace sub1 with file"
 Author: A U Thor <author@example.com>
 2 files changed, 5 insertions(+), 1 deletion(-)
 mode change 100644 => 160000 sub1
Switched to a new branch 'invalid_sub1'
[another 17676c7] third
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 15 - merge base test setup

expecting success: 
	git checkout another &&
	git checkout another...master &&
	test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify master^)"

Already on 'another'
[invalid_sub1 95845ae] Invalid sub1 commit
 Author: A U Thor <author@example.com>
Note: checking out 'another...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 2cbb940... initial
Switched to a new branch 'valid_sub1'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 16 - another...master

expecting success: 
	git checkout another &&
	git checkout ...master &&
	test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify master^)"

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/17c/.git/
Previous HEAD position was 2cbb940... initial
Switched to branch 'another'
[valid_sub1 47a3a2f] Revert "Invalid sub1 commit"
 Author: A U Thor <author@example.com>
Switched to branch 'master'
Note: checking out '...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 2cbb940... initial
ok 17 - ...master

expecting success: 
	git checkout another &&
	git checkout master... &&
	test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify master^)"

Previous HEAD position was 2cbb940... initial
Cloning into 'submodule_update'...
Switched to branch 'another'
ok 54 - #17: GIT_WORK_TREE without explicit GIT_DIR is accepted (bare case)

expecting success: 
	try_repo 18 unset .git unset "" true \
		.git "(null)" "$here/18" "(null)" \
		../.git "(null)" "$here/18/sub" "(null)" &&
	try_repo 18b unset "$here/18b/.git" unset "" true \
		"$here/18b/.git" "(null)" "$here/18b" "(null)" \
		"$here/18b/.git" "(null)" "$here/18b/sub" "(null)"

Note: checking out '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 2cbb940... initial
Cloning into 'sub1'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/18/.git/
ok 18 - master...

expecting success: 
	git checkout master &&
	git checkout other &&
	git rebase master &&
	git checkout - &&
	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/master"

done.
Previous HEAD position was 2cbb940... initial
Switched to branch 'master'
Switched to branch 'other'
done.
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/18b/.git/
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Switched to branch 'add_sub1'
Your branch is up-to-date with 'origin/add_sub1'.
ok 55 - #18: bare .git named by GIT_DIR has no worktree

expecting success: 
	setup_repo 19 unset "" true &&
	mkdir -p 19/sub/sub 19/wt/sub

Submodule path 'sub1': checked out '58630c04cd08e6914ad0ab5a3126bcfb71a3e6ca'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/19/.git/
First, rewinding head to replay your work on top of it...
ok 56 - #19: 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)"
	
Fast-forwarded other to master.
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
Switched to branch 'master'
ok 19 - "checkout -" works after a rebase A

expecting success: 
	git branch moodle master~1 &&
	git checkout master &&
	git checkout other &&
	git rebase master moodle &&
	git checkout - &&
	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/master"

Already on 'master'
ok 57 - #19: 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/
	
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule_update_repo/.) registered for path 'sub1'
Switched to branch 'other'
Cloning into 'sub1'...
ok 58 - #19: 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)"
	
done.
First, rewinding head to replay your work on top of it...
Fast-forwarded moodle to master.
ok 59 - #19: 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)"
	
Switched to branch 'master'
ok 20 - "checkout -" works after a rebase A B

expecting success: 
	git checkout master &&
	git checkout other &&
	git rebase -i master &&
	git checkout - &&
	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/master"

Submodule path 'sub1': checked out '3950f7ed37a2b5b8e95094de1b49ceba8eecb3d9'
fatal: reference is not a tree: 0123456789012345678901234567890123456789
Already on 'master'
Unable to checkout '0123456789012345678901234567890123456789' in submodule path 'sub1'
Switched to branch 'other'
ok 60 - #19: 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 27 - git read-tree -u --reset: 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
		)
	
ok 7 - git checkout: 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 61 - #19: 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/
	
Cloning into 'submodule_update'...
done.
Cloning into 'submodule_update'...
Switched to a new branch 'invalid_sub1'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
done.
ok 62 - #19: chdir_to_toplevel uses worktree (from subdir)

expecting success: 
	# Unlike case #16a.
	setup_repo 20a "$here/20a" "" unset &&
	mkdir -p 20a/.git/wt/sub &&
	try_case 20a/.git unset unset \
		"$here/20a/.git" "$here/20a" "$here/20a" .git/ 2>message &&
	try_case 20a/.git/wt unset unset \
		"$here/20a/.git" "$here/20a" "$here/20a" .git/wt/ &&
	try_case 20a/.git/wt/sub unset unset \
		"$here/20a/.git" "$here/20a" "$here/20a" .git/wt/sub/ &&
	! test -s message

Switched to a new branch 'no_submodule'
fatal: Needed a single revision
Branch no_submodule set up to track remote branch no_submodule from origin.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/20a/.git/
Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Switched to branch 'add_sub1'
Your branch is up-to-date with 'origin/add_sub1'.
ok 63 - #20a: core.worktree without GIT_DIR accepted (inside .git)

expecting success: 
	setup_repo 20b non-existent "" true &&
	mkdir -p 20b/.git/wt/sub &&
	(
		cd 20b/.git &&
		test_must_fail git status >/dev/null
	) 2>message &&
	grep "core.bare and core.worktree" message

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/20b/.git/
Rebasing (1/1)
warning: core.bare and core.worktree do not make sense
ok 64 - #20b/c: core.worktree and core.bare conflict

expecting success: 
	setup_repo 20d non-existent "" true &&
	mkdir -p 20d/.git/wt/sub &&
	(
		cd 20d/.git &&
		git config foo.bar value
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/20d/.git/
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t1013-read-tree-submodule/submodule_update_repo/.) registered for path 'sub1'
warning: core.bare and core.worktree do not make sense
ok 65 - #20d: core.worktree and core.bare OK when working tree not needed

expecting success: 
	setup_repo 21 non-existent "" unset &&
	mkdir -p 21/.git/wt/sub &&
	(
		cd 21/.git &&
		GIT_WORK_TREE="$here/21" &&
		export GIT_WORK_TREE &&
		git status >/dev/null
	) 2>message &&
	! test -s message


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/21/.git/
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 66 - #21: setup, core.worktree warns before overriding core.bare

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)"
	
Cloning into 'sub1'...
done.
Cloning into 'sub1'...
ok 67 - #21: 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/
	
done.
Submodule path 'sub1': checked out '58630c04cd08e6914ad0ab5a3126bcfb71a3e6ca'
ok 68 - #21: 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)"
	
Submodule path 'sub1': checked out '3950f7ed37a2b5b8e95094de1b49ceba8eecb3d9'
ok 28 - git read-tree -u --reset: modified submodule does not update submodule work tree from invalid commit

# still have 6 known breakage(s)
# passed all remaining 22 test(s)
1..28
ok 69 - #21: 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 8 - git checkout: 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
		)
	
*** t2014-switch.sh ***
Cloning into 'submodule_update'...
ok 70 - #21: 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.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2014-switch/.git/
expecting success: 
	echo Hello >file &&
	git add file &&
	test_tick &&
	git commit -m V1 &&
	echo Hello world >file &&
	git add file &&
	git checkout -b other

Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
[master (root-commit) 68a43dc] V1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
Successfully rebased and updated refs/heads/other.
ok 71 - #21: 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/
	
Switched to a new branch 'other'
M	file
ok 1 - setup

expecting success: 
	git diff --exit-code

ok 2 - check all changes are staged

expecting success: 
	git commit -m V2

Branch add_sub1 set up to track remote branch add_sub1 from origin.
Switched to branch 'master'
ok 21 - "checkout -" works after a rebase -i A

expecting success: 
	git branch foodle master~1 &&
	git checkout master &&
	git checkout other &&
	git rebase master foodle &&
	git checkout - &&
	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/master"

error: The following untracked working tree files would be overwritten by checkout:
	sub1
Please move or remove them before you can switch branches.
Aborting
[other c55967b] V2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 3 - second commit

expecting success: 
	git diff --cached --exit-code

ok 4 - check

# passed all 4 test(s)
1..4
Already on 'master'
Switched to branch 'other'
ok 9 - git checkout: 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
		)
	
*** t2015-checkout-unborn.sh ***
ok 72 - #21: chdir_to_toplevel uses worktree (from subdir)

expecting success: 
	# like case #6.

	setup_repo 22a "$here/22a/.git" "" unset &&
	setup_repo 22ab . "" unset &&
	mkdir -p 22a/.git/sub 22a/sub &&
	mkdir -p 22ab/.git/sub 22ab/sub &&
	try_case 22a/.git unset . \
		. "$here/22a/.git" "$here/22a/.git" "(null)" &&
	try_case 22a/.git unset "$here/22a/.git" \
		"$here/22a/.git" "$here/22a/.git" "$here/22a/.git" "(null)" &&
	try_case 22a/.git/sub unset .. \
		"$here/22a/.git" "$here/22a/.git" "$here/22a/.git" sub/ &&
	try_case 22a/.git/sub unset "$here/22a/.git" \
		"$here/22a/.git" "$here/22a/.git" "$here/22a/.git" sub/ &&

	try_case 22ab/.git unset . \
		. "$here/22ab/.git" "$here/22ab/.git" "(null)" &&
	try_case 22ab/.git unset "$here/22ab/.git" \
		"$here/22ab/.git" "$here/22ab/.git" "$here/22ab/.git" "(null)" &&
	try_case 22ab/.git/sub unset .. \
		"$here/22ab/.git" "$here/22ab/.git" "$here/22ab/.git" sub/ &&
	try_case 22ab/.git unset "$here/22ab/.git" \
		"$here/22ab/.git" "$here/22ab/.git" "$here/22ab/.git" "(null)"

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/22a/.git/
Cloning into 'submodule_update'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2015-checkout-unborn/.git/
expecting success: 
	mkdir parent &&
	(cd parent &&
	 git init &&
	 echo content >file &&
	 git add file &&
	 git commit -m base
	) &&
	git fetch parent master:origin

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2015-checkout-unborn/parent/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/22ab/.git/
done.
[master (root-commit) 0c1d62f] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
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.
First, rewinding head to replay your work on top of it...
t2013-checkout-submodule.sh: 159: cd: can't cd to sub1
Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
Fast-forwarded foodle to master.
From parent
 * [new branch]      master     -> origin
Switched to branch 'replace_file_with_sub1'
Your branch is up-to-date with 'origin/replace_file_with_sub1'.
ok 1 - setup

expecting success: 
	echo precious >expect &&
	echo precious >file &&
	test_must_fail git checkout -b new origin &&
	test_cmp expect file

error: The following untracked working tree files would be overwritten by checkout:
	file
Please move or remove them before you can switch branches.
Aborting
ok 2 - checkout from unborn preserves untracked files

expecting success: 
	echo precious >expect &&
	echo precious >file &&
	git add file &&
	test_must_fail git checkout -b new origin &&
	test_cmp expect file &&
	git show :file >file &&
	test_cmp expect file

Switched to branch 'master'
ok 22 - "checkout -" works after a rebase -i A B

error: Your local changes to the following files would be overwritten by checkout:
	file
Please, commit your changes or stash them before you can switch branches.
Aborting
# passed all 22 test(s)
1..22
ok 3 - checkout from unborn preserves index contents

expecting success: 
	echo content >file &&
	git add file &&
	git checkout -b new origin

*** t2016-checkout-patch.sh ***
Switched to a new branch 'new'
ok 4 - checkout from unborn merges identical index contents

expecting success: 
	git checkout --orphan newroot &&
	git checkout -b anothername &&
	test_must_fail git show-ref --verify refs/heads/newroot &&
	git symbolic-ref HEAD >actual &&
	echo refs/heads/anothername >expect &&
	test_cmp expect actual

Switched to a new branch 'newroot'
Switched to a new branch 'anothername'
fatal: 'refs/heads/newroot' - not a valid ref
ok 73 - #22a: core.worktree = GIT_DIR = .git dir

expecting success: 
	setup_repo 22b "$here/22b/.git/wt" "" unset &&
	setup_repo 22bb wt "" unset &&
	mkdir -p 22b/.git/sub 22b/sub 22b/.git/wt/sub 22b/wt/sub &&
	mkdir -p 22bb/.git/sub 22bb/sub 22bb/.git/wt 22bb/wt &&

	try_case 22b/.git unset . \
		. "$here/22b/.git/wt" "$here/22b/.git" "(null)" &&
	try_case 22b/.git unset "$here/22b/.git" \
		"$here/22b/.git" "$here/22b/.git/wt" "$here/22b/.git" "(null)" &&
	try_case 22b/.git/sub unset .. \
		.. "$here/22b/.git/wt" "$here/22b/.git/sub" "(null)" &&
	try_case 22b/.git/sub unset "$here/22b/.git" \
		"$here/22b/.git" "$here/22b/.git/wt" "$here/22b/.git/sub" "(null)" &&

	try_case 22bb/.git unset . \
		. "$here/22bb/.git/wt" "$here/22bb/.git" "(null)" &&
	try_case 22bb/.git unset "$here/22bb/.git" \
		"$here/22bb/.git" "$here/22bb/.git/wt" "$here/22bb/.git" "(null)" &&
	try_case 22bb/.git/sub unset .. \
		.. "$here/22bb/.git/wt" "$here/22bb/.git/sub" "(null)" &&
	try_case 22bb/.git/sub unset "$here/22bb/.git" \
		"$here/22bb/.git" "$here/22bb/.git/wt" "$here/22bb/.git/sub" "(null)"

ok 5 - checking out another branch from unborn state

expecting success: 
	test_create_repo empty &&
	(
		cd empty &&
		git symbolic-ref HEAD >expect &&
		test_must_fail git checkout &&
		git symbolic-ref HEAD >actual &&
		test_cmp expect actual
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2016-checkout-patch/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/22b/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2015-checkout-unborn/empty/.git/
expecting success: 
	mkdir dir &&
	echo parent > dir/foo &&
	echo dummy > bar &&
	git add bar dir/foo &&
	git commit -m initial &&
	test_tick &&
	test_commit second dir/foo head &&
	set_and_save_state bar bar_work bar_index &&
	save_head

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/22bb/.git/
fatal: You are on a branch yet to be born
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 6 - checking out in a newly created repo

# passed all 6 test(s)
1..6
[master (root-commit) 824b31b] initial
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 bar
 create mode 100644 dir/foo
[master 5f8a223] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
*** t2017-checkout-orphan.sh ***
ok 1 - setup

Cloning into 'sub1'...
expecting success: 
	set_and_save_state dir/foo work head &&
	(echo n; echo n) | git checkout -p &&
	verify_saved_state bar &&
	verify_saved_state dir/foo

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2017-checkout-orphan/.git/
expecting success: 
	echo "Initial" >"$TEST_FILE" &&
	git add "$TEST_FILE" &&
	git commit -m "First Commit" &&
	test_tick &&
	echo "State 1" >>"$TEST_FILE" &&
	git add "$TEST_FILE" &&
	test_tick &&
	git commit -m "Second Commit"

done.
[master (root-commit) a70f832] First Commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
[master f33e577] Second Commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 1 - Setup

expecting success: 
	git checkout --orphan alpha &&
	test_must_fail git rev-parse --verify HEAD &&
	test "refs/heads/alpha" = "$(git symbolic-ref HEAD)" &&
	test_tick &&
	git commit -m "Third Commit" &&
	test_must_fail git rev-parse --verify HEAD^ &&
	git diff-tree --quiet master alpha

Switched to a new branch 'alpha'
fatal: Needed a single revision
ok 74 - #22b: core.worktree child of .git, GIT_DIR=.git

expecting success: 
	setup_repo 22c "$here/22c" "" unset &&
	setup_repo 22cb .. "" unset &&
	mkdir -p 22c/.git/sub 22c/sub &&
	mkdir -p 22cb/.git/sub 22cb/sub &&

	try_case 22c/.git unset . \
		"$here/22c/.git" "$here/22c" "$here/22c" .git/ &&
	try_case 22c/.git unset "$here/22c/.git" \
		"$here/22c/.git" "$here/22c" "$here/22c" .git/ &&
	try_case 22c/.git/sub unset .. \
		"$here/22c/.git" "$here/22c" "$here/22c" .git/sub/ &&
	try_case 22c/.git/sub unset "$here/22c/.git" \
		"$here/22c/.git" "$here/22c" "$here/22c" .git/sub/ &&

	try_case 22cb/.git unset . \
		"$here/22cb/.git" "$here/22cb" "$here/22cb" .git/ &&
	try_case 22cb/.git unset "$here/22cb/.git" \
		"$here/22cb/.git" "$here/22cb" "$here/22cb" .git/ &&
	try_case 22cb/.git/sub unset .. \
		"$here/22cb/.git" "$here/22cb" "$here/22cb" .git/sub/ &&
	try_case 22cb/.git/sub unset "$here/22cb/.git" \
		"$here/22cb/.git" "$here/22cb" "$here/22cb" .git/sub/

[alpha (root-commit) 6f20c32] Third Commit
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+)
 create mode 100644 foo
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/22c/.git/
fatal: Needed a single revision
Submodule path 'sub1': checked out '3950f7ed37a2b5b8e95094de1b49ceba8eecb3d9'
ok 2 - --orphan creates a new orphan branch from HEAD

expecting success: 
	git checkout master &&
	git checkout --orphan beta master^ &&
	test_must_fail git rev-parse --verify HEAD &&
	test "refs/heads/beta" = "$(git symbolic-ref HEAD)" &&
	test_tick &&
	git commit -m "Fourth Commit" &&
	test_must_fail git rev-parse --verify HEAD^ &&
	git diff-tree --quiet master^ beta

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/22cb/.git/
Switched to branch 'master'
Switched to a new branch 'beta'
fatal: Needed a single revision
[beta (root-commit) 530edda] Fourth Commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
fatal: Needed a single revision
ok 3 - --orphan creates a new orphan branch from <start_point>

expecting success: 
	git checkout master &&
	test_must_fail git checkout --orphan new -b newer &&
	test refs/heads/master = "$(git symbolic-ref HEAD)"

ok 10 - git checkout: 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
		)
	
Switched to branch 'master'
fatal: -b, -B and --orphan are mutually exclusive
ok 4 - --orphan must be rejected with -b

expecting success: 
	git checkout master &&
	test_must_fail git checkout --orphan new -t master &&
	test refs/heads/master = "$(git symbolic-ref HEAD)"

Already on 'master'
fatal: '--orphan' cannot be used with '-t'
ok 5 - --orphan must be rejected with -t

expecting success: 
	git checkout master &&
	git config branch.autosetupmerge always &&
	git checkout --orphan gamma &&
	test -z "$(git config branch.gamma.merge)" &&
	test refs/heads/gamma = "$(git symbolic-ref HEAD)" &&
	test_must_fail git rev-parse --verify HEAD^

Already on 'master'
Cloning into 'submodule_update'...
Switched to a new branch 'gamma'
fatal: Needed a single revision
ok 6 - --orphan ignores branch.autosetupmerge

expecting success: 
	git checkout master &&
	git config --unset core.logAllRefUpdates &&
	git checkout --orphan delta &&
	test_must_fail git rev-parse --verify delta@{0} &&
	git commit -m Delta &&
	git rev-parse --verify delta@{0}

done.
Switched to branch 'master'
ok 75 - #22c: core.worktree = .git/.., GIT_DIR=.git

expecting success: 
	setup_repo 22 "$here/22" "" true &&
	(
		cd 22/.git &&
		GIT_DIR=. &&
		export GIT_DIR &&
		test_must_fail git status 2>result
	) &&
	(
		cd 22 &&
		GIT_DIR=.git &&
		export GIT_DIR &&
		test_must_fail git status 2>result
	) &&
	grep "core.bare and core.worktree" 22/.git/result &&
	grep "core.bare and core.worktree" 22/result

Switched to a new branch 'delta'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/22/.git/
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.
fatal: Needed a single revision
[delta (root-commit) 9beee35] Delta
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+)
 create mode 100644 foo
9beee35744aee191f8186ef0a6ab78f710cdd57c
ok 7 - --orphan makes reflog by default

expecting success: 
	git checkout master &&
	git config core.logAllRefUpdates false &&
	git checkout --orphan epsilon &&
	test_must_fail git rev-parse --verify epsilon@{0} &&
	git commit -m Epsilon &&
	test_must_fail git rev-parse --verify epsilon@{0}

diff --git a/bar b/bar
index 7780244..8c999e6 100644
--- a/bar
+++ b/bar
@@ -1 +1 @@
-bar_index
+bar_work
Discard this hunk from worktree [y,n,q,a,d,/,e,?]? 
Switched to branch 'master'
error: 8ed2e6719f8484ce01fa3ce133fe42d25c2441b8^{commit}: expected commit type, but the object dereferences to tree type
fatal: Needed a single revision
warning: core.bare and core.worktree do not make sense
diff --git a/dir/foo b/dir/foo
index 564b12f..b8f99f5 100644
--- a/dir/foo
+++ b/dir/foo
@@ -1 +1 @@
-head
+work
Discard this hunk from worktree [y,n,q,a,d,/,e,?]? 
warning: core.bare and core.worktree do not make sense
ok 76 - #22.2: core.worktree and core.bare conflict

expecting success: 
	setup_repo 23 non-existent "" true &&
	mkdir -p 23/sub/sub 23/wt/sub

Switched to a new branch 'epsilon'
Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
fatal: Needed a single revision
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/23/.git/
Switched to branch 'replace_directory_with_sub1'
Your branch is up-to-date with 'origin/replace_directory_with_sub1'.
[epsilon (root-commit) c5e7701] Epsilon
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+)
 create mode 100644 foo
ok 2 - saying "n" does nothing

fatal: Needed a single revision
ok 8 - --orphan does not make reflog when core.logAllRefUpdates = false

expecting success: 
	git checkout master &&
	git checkout -l --orphan zeta &&
	test_must_fail git rev-parse --verify zeta@{0} &&
	git commit -m Zeta &&
	git rev-parse --verify zeta@{0}

expecting success: 
	(echo n; echo y) | git checkout -p &&
	verify_saved_state bar &&
	verify_state dir/foo head head

ok 77 - #23: 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)"
	
Switched to branch 'master'
Switched to a new branch 'zeta'
fatal: Needed a single revision
[zeta (root-commit) 1b23595] Zeta
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+)
 create mode 100644 foo
1b235958474dccc5c8f228713c620d22e7d1825d
ok 9 - --orphan with -l makes reflog when core.logAllRefUpdates = false

expecting success: 
	git checkout master &&
	git checkout -l --orphan eta &&
	test_must_fail git rev-parse --verify eta@{0} &&
	git checkout master &&
	test_must_fail git rev-parse --verify eta@{0}

Switched to branch 'master'
Switched to a new branch 'eta'
fatal: Needed a single revision
ok 78 - #23: 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/
	
Switched to branch 'master'
fatal: Needed a single revision
ok 10 - giving up --orphan not committed when -l and core.logAllRefUpdates = false deletes reflog

expecting success: 
	git checkout master &&
	test_must_fail git checkout --orphan master &&
	test refs/heads/master = "$(git symbolic-ref HEAD)"

Already on 'master'
fatal: A branch named 'master' already exists.
ok 11 - --orphan is rejected with an existing name

expecting success: 
	git checkout master &&
	git reset --hard &&
	echo local >>"$TEST_FILE" &&
	cat "$TEST_FILE" >"$TEST_FILE.saved" &&
	test_must_fail git checkout --orphan new master^ &&
	test refs/heads/master = "$(git symbolic-ref HEAD)" &&
	test_cmp "$TEST_FILE" "$TEST_FILE.saved" &&
	git diff-index --quiet --cached HEAD &&
	git reset --hard

Already on 'master'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule_update_repo/.) registered for path 'sub1'
HEAD is now at f33e577 Second Commit
error: Your local changes to the following files would be overwritten by checkout:
	foo
Please, commit your changes or stash them before you can switch branches.
Aborting
ok 79 - #23: 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)"
	
HEAD is now at f33e577 Second Commit
ok 12 - --orphan refuses to switch if a merge is needed

expecting success: 
	git checkout master &&
	git checkout --orphan new &&
	test_must_fail git checkout --detach

Already on 'master'
Cloning into 'sub1'...
Switched to a new branch 'new'
fatal: You are on a branch yet to be born
ok 13 - cannot --detach on an unborn branch

# passed all 13 test(s)
1..13
done.
ok 80 - #23: 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)"
	
*** t2018-checkout-branch.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2018-checkout-branch/.git/
expecting success: 
	test_commit initial file1 &&
	HEAD1=$(git rev-parse --verify HEAD) &&

	test_commit change1 file1 &&
	HEAD2=$(git rev-parse --verify HEAD) &&

	git branch -m branch1

diff --git a/bar b/bar
index 7780244..8c999e6 100644
--- a/bar
+++ b/bar
@@ -1 +1 @@
-bar_index
+bar_work
Discard this hunk from worktree [y,n,q,a,d,/,e,?]? 
diff --git a/dir/foo b/dir/foo
index 564b12f..b8f99f5 100644
--- a/dir/foo
+++ b/dir/foo
@@ -1 +1 @@
-head
+work
Discard this hunk from worktree [y,n,q,a,d,/,e,?]? ok 81 - #23: 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/
	
Submodule path 'sub1': checked out '3950f7ed37a2b5b8e95094de1b49ceba8eecb3d9'
[master (root-commit) ee02a18] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file1

ok 3 - git checkout -p

expecting success: 
	set_state dir/foo work index &&
	(echo n; echo y) | git checkout -p &&
	verify_saved_state bar &&
	verify_state dir/foo index index

[master 5be17a9] change1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - setup

expecting success: 
	do_checkout branch2

ok 82 - #23: 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/
	
ok 11 - git checkout: 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
		)
	
Switched to a new branch 'branch2'
ok 2 - checkout -b to a new branch, set to HEAD

expecting success: 
	git checkout branch1 &&
	git branch -D branch2 &&

	do_checkout branch2 $HEAD1

Switched to branch 'branch1'
Deleted branch branch2 (was 5be17a9).
Switched to a new branch 'branch2'
Cloning into 'submodule_update'...
ok 3 - checkout -b to a new branch, set to an explicit ref

expecting success: 
	git checkout branch1 &&

	# clean up from previous test
	git branch -D branch2 &&

	setup_dirty_unmergeable &&
	test_must_fail do_checkout branch2 $HEAD1 &&
	test_dirty_unmergeable

ok 83 - #23: chdir_to_toplevel uses worktree (from subdir)

expecting success: 
	try_repo 24 unset unset unset gitfile true \
		"$here/24.git" "(null)" "$here/24" "(null)" \
		"$here/24.git" "(null)" "$here/24/sub" "(null)"

Switched to branch 'branch1'
Deleted branch branch2 (was ee02a18).
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/24/.git/
done.
error: Your local changes to the following files would be overwritten by checkout:
	file1
Please, commit your changes or stash them before you can switch branches.
Aborting
ok 4 - checkout -b to a new branch with unmergeable changes fails

expecting success: 
	# still dirty and on branch1
	do_checkout branch2 $HEAD1 "-f -b" &&
	test_must_fail test_dirty_unmergeable

Switched to a new branch 'branch2'
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 5 - checkout -f -b to a new branch with unmergeable changes discards changes

expecting success: 
	git checkout branch1 &&

	# clean up from previous test
	git branch -D branch2 &&

	setup_dirty_mergeable &&
	do_checkout branch2 $HEAD1 &&
	test_dirty_mergeable

ok 84 - #24: bare repo has no worktree (gitfile case)

expecting success: 
	try_repo 25 "$here/25" unset unset gitfile true \
		"$here/25.git" "$here/25" "$here/25" "(null)"  \
		"$here/25.git" "$here/25" "$here/25" "sub/" 2>message &&
	! test -s message

Switched to branch 'branch1'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/25/.git/
Deleted branch branch2 (was ee02a18).
Switched to a new branch 'branch2'
A	file2
ok 6 - checkout -b to a new branch preserves mergeable changes

expecting success: 
	# clean up from previous test
	git reset --hard &&

	git checkout branch1 &&

	# clean up from previous test
	git branch -D branch2 &&

	setup_dirty_mergeable &&
	do_checkout branch2 $HEAD1 "-f -b" &&
	test_must_fail test_dirty_mergeable

ok 85 - #25: GIT_WORK_TREE accepted if GIT_DIR unset (bare gitfile case)

expecting success: 
	try_repo 26 unset "$here/26/.git" unset gitfile true \
		"$here/26.git" "(null)" "$here/26" "(null)" \
		"$here/26.git" "(null)" "$here/26/sub" "(null)" &&
	try_repo 26b unset .git unset gitfile true \
		"$here/26b.git" "(null)" "$here/26b" "(null)" \
		"$here/26b.git" "(null)" "$here/26b/sub" "(null)"

HEAD is now at ee02a18 initial
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/26/.git/
Switched to branch 'branch1'
Deleted branch branch2 (was ee02a18).
diff --git a/bar b/bar
index 7780244..8c999e6 100644
--- a/bar
+++ b/bar
@@ -1 +1 @@
-bar_index
+bar_work
Discard this hunk from worktree [y,n,q,a,d,/,e,?]? 
Switched to a new branch 'branch2'
diff --git a/dir/foo b/dir/foo
index 9015a7a..b8f99f5 100644
--- a/dir/foo
+++ b/dir/foo
@@ -1 +1 @@
-index
+work
Discard this hunk from worktree [y,n,q,a,d,/,e,?]? Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule_update_repo/.) registered for path 'sub1'

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/26b/.git/
ok 7 - checkout -f -b to a new branch with mergeable changes discards changes

expecting success: 
	git reset --hard HEAD &&

	test_must_fail do_checkout branch2 $HEAD2

HEAD is now at ee02a18 initial
fatal: A branch named 'branch2' already exists.
ok 8 - checkout -b to an existing branch fails

expecting success: 
	git reset --hard HEAD &&
	git checkout branch1 &&
	git checkout branch2 &&
	echo  >expect "fatal: A branch named 'branch1' already exists." &&
	test_must_fail git checkout -b @{-1} 2>actual &&
	test_cmp expect actual

ok 4 - git checkout -p with staged changes

expecting success: 
	set_and_save_state dir/foo work head &&
	(echo n; echo y; echo n) | git checkout -p HEAD &&
	verify_saved_state bar &&
	verify_saved_state dir/foo

HEAD is now at ee02a18 initial
Switched to branch 'branch1'
ok 86 - #26: bare repo has no worktree (GIT_DIR -> gitfile case)

expecting success: 
	setup_repo 27 unset gitfile true &&
	mkdir -p 27/sub/sub 27/wt/sub

Cloning into 'sub1'...
Switched to branch 'branch2'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/27/.git/
ok 9 - checkout -b to @{-1} fails with the right branch name

expecting success: 
	git checkout branch1 &&

	do_checkout branch2 "" -B

ok 87 - #27: 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)"
	
Switched to branch 'branch1'
done.
Switched to and reset branch 'branch2'
ok 10 - checkout -B to an existing branch resets branch to HEAD

expecting success: 
	git checkout $(git rev-parse --verify HEAD) &&

	do_checkout branch2 "" -B

Note: checking out '5be17a9503605cbff49376bccdc74acb1ebd9160'.

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 5be17a9... change1
Switched to and reset branch 'branch2'
ok 88 - #27: 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/
	
ok 11 - checkout -B to an existing branch from detached HEAD resets branch to HEAD

Submodule path 'sub1': checked out '3950f7ed37a2b5b8e95094de1b49ceba8eecb3d9'
expecting success: 
	git checkout branch1 &&

	do_checkout branch2 $HEAD1 -B

Switched to branch 'branch1'
Switched to and reset branch 'branch2'
ok 12 - checkout -B to an existing branch with an explicit ref resets branch to that ref

expecting success: 
	git checkout branch1 &&

	setup_dirty_unmergeable &&
	test_must_fail do_checkout branch2 $HEAD1 -B &&
	test_dirty_unmergeable

Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
Switched to branch 'branch1'
warning: unable to rmdir sub1: Directory not empty
Switched to branch 'remove_sub1'
Your branch is up-to-date with 'origin/remove_sub1'.
error: Your local changes to the following files would be overwritten by checkout:
	file1
Please, commit your changes or stash them before you can switch branches.
Aborting
ok 13 - checkout -B to an existing branch with unmergeable changes fails

expecting success: 
	# still dirty and on branch1
	do_checkout branch2 $HEAD1 "-f -B" &&
	test_must_fail test_dirty_unmergeable

ok 89 - #27: 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)"
	
Switched to and reset branch 'branch2'
ok 14 - checkout -f -B to an existing branch with unmergeable changes discards changes

expecting success: 
	git checkout branch1 &&

	setup_dirty_mergeable &&
	do_checkout branch2 $HEAD1 -B &&
	test_dirty_mergeable

ok 12 - git checkout: 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
		)
	
Switched to branch 'branch1'
Switched to and reset branch 'branch2'
A	file2
ok 90 - #27: 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 15 - checkout -B to an existing branch preserves mergeable changes

expecting success: 
	# clean up from previous test
	git reset --hard &&

	git checkout branch1 &&

	setup_dirty_mergeable &&
	do_checkout branch2 $HEAD1 "-f -B" &&
	test_must_fail test_dirty_mergeable

HEAD is now at ee02a18 initial
Switched to branch 'branch1'
Cloning into 'submodule_update'...
diff --git a/bar b/bar
index 421376d..8c999e6 100644
--- a/bar
+++ b/bar
@@ -1 +1 @@
-dummy
+bar_work
Discard this hunk from index and worktree [y,n,q,a,d,/,e,?]? 
Switched to and reset branch 'branch2'
diff --git a/dir/foo b/dir/foo
index 564b12f..b8f99f5 100644
--- a/dir/foo
+++ b/dir/foo
@@ -1 +1 @@
-head
+work
error: patch failed: dir/foo:1
error: dir/foo: patch does not apply
Discard this hunk from index and worktree [y,n,q,a,d,/,e,?]? The selected hunks do not apply to the index!
Apply them to the worktree anyway? Nothing was applied.
done.
ok 16 - checkout -f -B to an existing branch with mergeable changes discards changes


expecting success: 
	git tag -f -m "First commit" initial initial &&
	git checkout -f change1 &&
	name=$(git describe) &&
	git checkout -b $name &&
	git diff --exit-code change1 &&
	echo "refs/heads/$name" >expect &&
	git symbolic-ref HEAD >actual &&
	test_cmp expect actual

ok 91 - #27: explicit GIT_WORK_TREE from nephew of worktree

Updated tag 'initial' (was ee02a18)
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/
	
Note: checking out 'change1'.

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 5be17a9... change1
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Switched to a new branch 'initial-1-g5be17a9'
ok 5 - git checkout -p HEAD with NO staged changes: abort

expecting success: 
	(echo n; echo y; echo y) | git checkout -p HEAD &&
	verify_saved_state bar &&
	verify_state dir/foo head head

ok 17 - checkout -b <describe>

expecting success: 
	git checkout branch1 &&
	git checkout -B branch1-scratch &&

	setup_dirty_mergeable &&
	git checkout -B branch1-scratch initial &&
	test_dirty_mergeable

Switched to branch 'branch1'
Switched to a new branch 'branch1-scratch'
ok 92 - #27: 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/
	
Reset branch 'branch1-scratch'
A	file2
ok 18 - checkout -B to the current branch works

# passed all 18 test(s)
1..18
*** t2019-checkout-ambiguous-ref.sh ***
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 93 - #27: chdir_to_toplevel uses worktree (from subdir)

expecting success: 
	setup_repo 28 "$here/28" gitfile true &&
	(
		cd 28 &&
		test_must_fail git status
	) 2>message &&
	grep "core.bare and core.worktree" message

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2019-checkout-ambiguous-ref/.git/
expecting success: 
	test_commit branch file &&
	git branch ambiguity &&
	git branch vagueness &&
	test_commit tag file &&
	git tag ambiguity &&
	git tag vagueness HEAD:file &&
	test_commit other file

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/28/.git/
[master (root-commit) c291a6e] branch
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
warning: core.bare and core.worktree do not make sense
ok 94 - #28: core.worktree and core.bare conflict (gitfile case)

expecting success: 
	setup_repo 29 non-existent gitfile true &&
	mkdir -p 29/sub/sub 29/wt/sub &&
	(
		cd 29 &&
		GIT_WORK_TREE="$here/29" &&
		export GIT_WORK_TREE &&
		git status
	) 2>message &&
	! test -s message

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/29/.git/
Cloning into 'sub1'...
[master a40f7cf] tag
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
done.
On branch master

Initial commit

nothing to commit (create/copy files and use "git add" to track)
ok 95 - #29: 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)"
	
[master 3b61e26] other
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - setup ambiguous refs

expecting success: 
	git checkout ambiguity >stdout 2>stderr

ok 2 - checkout ambiguous ref succeeds

expecting success: 
	grep "warning.*ambiguous" stderr

warning: refname 'ambiguity' is ambiguous.
ok 3 - checkout produces ambiguity warning

expecting success: 
	echo refs/heads/ambiguity >expect &&
	git symbolic-ref HEAD >actual &&
	test_cmp expect actual &&
	echo branch >expect &&
	test_cmp expect file

ok 96 - #29: 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/
	
ok 4 - checkout chooses branch over tag

expecting success: 
	test_i18ngrep "Switched to branch" stderr &&
	test_i18ngrep ! "^HEAD is now at" stderr

Submodule path 'sub1': checked out '3950f7ed37a2b5b8e95094de1b49ceba8eecb3d9'
Switched to branch 'ambiguity'
ok 5 - checkout reports switch to branch

expecting success: 
	git checkout vagueness >stdout 2>stderr &&
	test_set_prereq VAGUENESS_SUCCESS

ok 6 - checkout vague ref succeeds

expecting success: 
	grep "warning.*ambiguous" stderr

warning: refname 'vagueness' is ambiguous.
ok 7 - checkout produces ambiguity warning

expecting success: 
	echo refs/heads/vagueness >expect &&
	git symbolic-ref HEAD >actual &&
	test_cmp expect actual &&
	echo branch >expect &&
	test_cmp expect file

diff --git a/bar b/bar
index 421376d..8c999e6 100644
--- a/bar
+++ b/bar
@@ -1 +1 @@
-dummy
+bar_work
Discard this hunk from index and worktree [y,n,q,a,d,/,e,?]? 
diff --git a/dir/foo b/dir/foo
index 564b12f..b8f99f5 100644
--- a/dir/foo
+++ b/dir/foo
@@ -1 +1 @@
-head
+work
Discard this hunk from index and worktree [y,n,q,a,d,/,e,?]? ok 8 - checkout chooses branch over tag

error: patch failed: dir/foo:1
error: dir/foo: patch does not apply
expecting success: 
	test_i18ngrep "Switched to branch" stderr &&
	test_i18ngrep ! "^HEAD is now at" stderr

Switched to branch 'vagueness'
The selected hunks do not apply to the index!
Apply them to the worktree anyway? Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
ok 9 - checkout reports switch to branch

expecting success: 
	git init ambi &&
	(
		cd ambi &&
		echo a >a.c &&
		git add a.c &&
		echo b >a.c &&
		git checkout "*.c" &&
		echo a >expect &&
		test_cmp expect a.c
	)


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2019-checkout-ambiguous-ref/ambi/.git/
ok 97 - #29: 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 10 - wildcard ambiguation, paths win

expecting success: 
	git init ambi2 &&
	(
		cd ambi2 &&
		echo a >"*.c" &&
		git add . &&
		test_must_fail git show :"*.c" &&
		git show :"*.c" -- >actual &&
		echo a >expect &&
		test_cmp expect actual
	)

ok 6 - git checkout -p HEAD with NO staged changes: apply

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2019-checkout-ambiguous-ref/ambi2/.git/
expecting success: 
	set_state dir/foo index index &&
	# the third n is to get out in case it mistakenly does not apply
	(echo n; echo y; echo n) | git checkout -p HEAD &&
	verify_saved_state bar &&
	verify_state dir/foo head head

fatal: ambiguous argument ':*.c': both revision and filename
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
ok 11 - wildcard ambiguation, refs lose

warning: unable to rmdir sub1: Directory not empty
Switched to branch 'remove_sub1'
Your branch is up-to-date with 'origin/remove_sub1'.
# passed all 11 test(s)
1..11
ok 98 - #29: 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)"
	
*** t2020-checkout-detach.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2020-checkout-detach/.git/
expecting success: 
	test_commit one &&
	test_commit two &&
	test_commit three && git tag -d three &&
	test_commit four && git tag -d four &&
	git branch branch &&
	git tag tag

ok 13 - git checkout: 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
		)
	
ok 99 - #29: 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/
	
[master (root-commit) d79ce16] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
[master 139b20d] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two.t
Cloning into 'submodule_update'...
[master 7c7cd71] three
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 three.t
ok 100 - #29: 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/
	
Deleted tag 'three' (was 7c7cd71)
done.
[master fd8d77e] four
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 four.t
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Deleted tag 'four' (was fd8d77e)
ok 1 - setup

expecting success: 
	reset &&
	git checkout branch &&
	check_not_detached

diff --git a/bar b/bar
index 421376d..8c999e6 100644
--- a/bar
+++ b/bar
@@ -1 +1 @@
-dummy
+bar_work
Discard this hunk from index and worktree [y,n,q,a,d,/,e,?]? 
diff --git a/dir/foo b/dir/foo
index 564b12f..9015a7a 100644
--- a/dir/foo
+++ b/dir/foo
@@ -1 +1 @@
-head
+index
Discard this hunk from index and worktree [y,n,q,a,d,/,e,?]? ok 101 - #29: chdir_to_toplevel uses worktree (from subdir)

expecting success: 
	# Just like case #22.
	setup_repo 30 "$here/30" gitfile true &&
	(
		cd 30 &&
		test_must_fail env GIT_DIR=.git git status 2>result
	) &&
	grep "core.bare and core.worktree" 30/result

Already on 'master'
Switched to branch 'branch'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/30/.git/
ok 2 - checkout branch does not detach

expecting success: 
	reset &&
	git checkout tag &&
	check_detached


Switched to branch 'master'
warning: core.bare and core.worktree do not make sense
ok 102 - #30: core.worktree and core.bare conflict (gitfile version)

expecting success: 
	setup_repo 31 non-existent gitfile true &&
	mkdir -p 31/sub/sub 31/wt/sub

Note: checking out 'tag'.

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 fd8d77e... four
ok 3 - checkout tag detaches

expecting success: 
	reset &&
	git checkout refs/heads/branch &&
	check_detached

ok 7 - git checkout -p HEAD with change already staged

expecting success: 
	# the third n is to get out in case it mistakenly does not apply
	(echo n; echo y; echo n) | git checkout -p HEAD^ &&
	verify_saved_state bar &&
	verify_state dir/foo parent parent

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t1510-repo-setup/31/.git/
Switched to branch 'master'
ok 103 - #31: 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)"
	
Note: checking out 'refs/heads/branch'.

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 fd8d77e... four
ok 4 - checkout branch by full name detaches

expecting success: 
	reset &&
	git checkout branch^ &&
	check_detached

Switched to branch 'master'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule_update_repo/.) registered for path 'sub1'
Note: checking out 'branch^'.

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 7c7cd71... three
ok 5 - checkout non-ref detaches

expecting success: 
	reset &&
	git checkout branch^0 &&
	check_detached

Previous HEAD position was 7c7cd71... three
Switched to branch 'master'
Note: checking out 'branch^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 fd8d77e... four
ok 104 - #31: 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/
	
ok 6 - checkout ref^0 detaches

expecting success: 
	reset &&
	git checkout --detach branch &&
	check_detached

Switched to branch 'master'
Cloning into 'sub1'...
Note: checking out 'branch'.

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 fd8d77e... four
ok 7 - checkout --detach detaches

expecting success: 
	reset &&
	git checkout --detach &&
	check_detached

Switched to branch 'master'
done.
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 fd8d77e... four
ok 8 - checkout --detach without branch name

expecting success: 
	reset &&
	test_must_fail git checkout --detach one^{tree} &&
	check_not_detached

ok 105 - #31: 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)"
	
Switched to branch 'master'
fatal: Cannot switch branch to a non-commit 'one^{tree}'
ok 9 - checkout --detach errors out for non-commit

expecting success: 
	reset &&
	git checkout master &&
	test_must_fail git checkout --detach tag one.t &&
	check_not_detached

Already on 'master'
Submodule path 'sub1': checked out '3950f7ed37a2b5b8e95094de1b49ceba8eecb3d9'
Already on 'master'
fatal: git checkout: --detach does not take a path argument 'one.t'
ok 10 - checkout --detach errors out for extra argument

expecting success: 
	reset &&
	test_must_fail git checkout --detach -b newbranch tag &&
	check_not_detached

ok 106 - #31: 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)"
	
Already on 'master'
fatal: '--detach' cannot be used with '-b/-B/--orphan'
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
ok 11 - checkout --detached and -b are incompatible

expecting success: 
	reset &&
	git checkout one &&
	git checkout --detach two &&
	git diff --exit-code HEAD &&
	git diff --exit-code two

error: The following untracked working tree files would be overwritten by checkout:
	sub1/file1
	sub1/file2
Please move or remove them before you can switch branches.
Aborting
Already on 'master'
Note: checking out 'one'.

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 d79ce16... one
Previous HEAD position was d79ce16... one
HEAD is now at 139b20d... two
ok 107 - #31: 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/
	
diff --git b/bar a/bar
index 8c999e6..421376d 100644
--- b/bar
+++ a/bar
@@ -1 +1 @@
-bar_work
+dummy
Apply this hunk to index and worktree [y,n,q,a,d,/,e,?]? 
ok 12 - checkout --detach moves HEAD

expecting success: 
	reset &&
	git checkout --detach two &&
	echo content >orphan &&
	git add orphan &&
	git commit -a -m orphan1 &&
	echo new content >orphan &&
	git commit -a -m orphan2 &&
	orphan2=$(git rev-parse HEAD) &&
	git checkout master 2>stderr

diff --git b/dir/foo a/dir/foo
index 564b12f..9676f5b 100644
--- b/dir/foo
+++ a/dir/foo
@@ -1 +1 @@
-head
+parent
Apply this hunk to index and worktree [y,n,q,a,d,/,e,?]? ok 14 - git checkout: 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
		)
	
Previous HEAD position was 139b20d... two
Switched to branch 'master'
Note: checking out 'two'.

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 139b20d... two

[detached HEAD 61e8031] orphan1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 orphan
ok 8 - git checkout -p HEAD^

expecting success: 
	set_state dir/foo work index &&
	rm dir/foo &&
	(echo n; echo y) | git checkout -p &&
	verify_saved_state bar &&
	verify_state dir/foo index index

[detached HEAD bfea71d] orphan2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 108 - #31: 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/
	
Cloning into 'submodule_update'...
ok 13 - checkout warns on orphan commits

expecting success: 
	check_orphan_warning stderr "2 commits"

Warning: you are leaving 2 commits behind, not connected to
ok 14 - checkout warns on orphan commits: output

expecting success: 
	git checkout "$orphan2" &&
	git checkout HEAD^ 2>stderr

done.
Note: checking out 'bfea71df3731158d55fcf7b9d1ae214132b90e2b'.

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 bfea71d... orphan2
ok 15 - checkout warns orphaning 1 of 2 commits

expecting success: 
	check_orphan_warning stderr "1 commit"

Warning: you are leaving 1 commit behind, not connected to
ok 16 - checkout warns orphaning 1 of 2 commits: output

expecting success: 
	reset &&
	git checkout --detach two &&
	git checkout master 2>stderr

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  61e8031 orphan1

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> 61e8031

Switched to branch 'master'
ok 109 - #31: chdir_to_toplevel uses worktree (from subdir)

# passed all 109 test(s)
1..109
Note: checking out 'two'.

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 139b20d... two
ok 17 - checkout does not warn leaving ref tip

expecting success: 
	check_no_orphan_warning stderr

Previous HEAD position was 139b20d... two
ok 18 - checkout does not warn leaving ref tip

expecting success: 
	reset &&
	git checkout --detach HEAD^ &&
	git checkout master 2>stderr

Already on 'master'
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 7c7cd71... three
ok 19 - checkout does not warn leaving reachable commit

expecting success: 
	check_no_orphan_warning stderr

Previous HEAD position was 7c7cd71... three
ok 20 - checkout does not warn leaving reachable commit

expecting success: 
	reset &&
	git branch child master^ &&
	git config branch.child.remote . &&
	git config branch.child.merge refs/heads/master &&
	git checkout child^ &&
	git checkout child >stdout &&
	test_i18ncmp expect stdout

Already on 'master'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule_update_repo/.) registered for path 'sub1'
Note: checking out 'child^'.

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 139b20d... two
Previous HEAD position was 139b20d... two
Switched to branch 'child'
ok 21 - tracking count is accurate after orphan check

# passed all 21 test(s)
1..21
*** t2021-checkout-overwrite.sh ***
Cloning into 'sub1'...
diff --git a/bar b/bar
index 7780244..8c999e6 100644
--- a/bar
+++ b/bar
@@ -1 +1 @@
-bar_index
+bar_work
Discard this hunk from worktree [y,n,q,a,d,/,e,?]? 
diff --git a/dir/foo b/dir/foo
index 9015a7a..0000000
--- a/dir/foo
+++ /dev/null
deleted file mode 100644
@@ -1 +0,0 @@
-index
Discard deletion from worktree [y,n,q,a,d,/,?]? 
done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2021-checkout-overwrite/.git/
ok 9 - git checkout -p handles deletion

expecting success: 
	set_state dir/foo work head &&
	(echo y; echo n) | git checkout -p dir &&
	verify_saved_state bar &&
	verify_state dir/foo head head

expecting success: 

	mkdir -p a/b/c &&
	>a/b/c/d &&
	git add -A &&
	git commit -m base &&
	git tag start

[master (root-commit) d3df5e6] base
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 a/b/c/d
ok 1 - setup

expecting success: 

	git checkout -b file &&
	rm -rf a/b &&
	>a/b &&
	git add -A &&
	git commit -m "dir to file"

Switched to a new branch 'file'
Submodule path 'sub1': checked out '3950f7ed37a2b5b8e95094de1b49ceba8eecb3d9'
[file 6af47b3] dir to file
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename a/{b/c/d => b} (100%)
ok 2 - create a commit where dir a/b changed to file

expecting success: 

	git rm --cached a/b &&
	git commit -m "un-track the file" &&
	test_must_fail git checkout start &&
	test -f a/b

rm 'a/b'
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
[file 125e9d4] un-track the file
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 delete mode 100644 a/b
*** t2022-checkout-paths.sh ***
error: The following untracked working tree files would be overwritten by checkout:
	a/b
Please move or remove them before you can switch branches.
Aborting
ok 3 - checkout commit with dir must not remove untracked a/b

expecting success: 

	rm -rf a/b &&	# cleanup if previous test failed
	git checkout -f -b symlink start &&
	rm -rf a/b &&
	git add -A &&
	test_ln_s_add foo a/b &&
	git commit -m "dir to symlink"

Switched to a new branch 'symlink'
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.t2022-checkout-paths/.git/
prerequisite SYMLINKS ok
expecting success: 
	mkdir dir &&
	>dir/master &&
	echo common >dir/common &&
	git add dir/master dir/common &&
	test_tick && git commit -m "master has dir/master" &&
	git checkout -b next &&
	git mv dir/master dir/next0 &&
	echo next >dir/next1 &&
	git add dir &&
	test_tick && git commit -m "next has dir/next but not dir/master"

error: The following untracked working tree files would be overwritten by checkout:
	sub1/file1
	sub1/file2
Please move or remove them before you can switch branches.
Aborting
[symlink ff31168] dir to symlink
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
 create mode 120000 a/b
 delete mode 100644 a/b/c/d
ok 4 - create a commit where dir a/b changed to symlink

expecting success: 

	git rm --cached a/b &&
	git commit -m "un-track the symlink" &&
	test_must_fail git checkout start

[master (root-commit) de06282] master has dir/master
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
 create mode 100644 dir/common
 create mode 100644 dir/master
rm 'a/b'
Switched to a new branch 'next'
[symlink 78def2f] un-track the symlink
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 120000 a/b
error: The following untracked working tree files would be overwritten by checkout:
	a/b
Please move or remove them before you can switch branches.
Aborting
ok 5 - checkout commit with dir must not remove untracked a/b

expecting success: 

	test -h a/b

ok 6 - the symlink remained

# passed all 6 test(s)
1..6
[next 65d8465] next has dir/next but not dir/master
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
 rename dir/{master => next0} (100%)
 create mode 100644 dir/next1
ok 1 - setup

expecting success: 
	git checkout next &&
	git reset --hard &&
	rm dir/next0 &&
	cat dir/common >expect.common &&
	echo modified >expect.next1 &&
	cat expect.next1 >dir/next1 &&
	echo untracked >expect.next2 &&
	cat expect.next2 >dir/next2 &&

	git checkout master dir &&

	test_cmp expect.common dir/common &&
	test_path_is_file dir/master &&
	git diff --exit-code master dir/master &&

	test_path_is_missing dir/next0 &&
	test_cmp expect.next1 dir/next1 &&
	test_path_is_file dir/next2 &&
	test_must_fail git ls-files --error-unmatch dir/next2 &&
	test_cmp expect.next2 dir/next2

Already on 'next'
ok 15 - git checkout: 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
		)
	
HEAD is now at 65d8465 next has dir/next but not dir/master
*** t2023-checkout-m.sh ***
error: pathspec 'dir/next2' did not match any file(s) known to git.
Did you forget to 'git add'?
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2023-checkout-m/.git/
ok 2 - checking out paths out of a tree does not clobber unrelated paths

expecting success: 
	git checkout next &&
	git reset --hard &&

	cat dir/common >expect.common &&
	EMPTY_SHA1=$(git hash-object -w --stdin </dev/null) &&
	git rm dir/next0 &&
	cat >expect.next0 <<-EOF &&
	100644 $EMPTY_SHA1 1	dir/next0
	100644 $EMPTY_SHA1 2	dir/next0
	EOF
	git update-index --index-info <expect.next0 &&

	git checkout master dir &&

	test_cmp expect.common dir/common &&
	test_path_is_file dir/master &&
	git diff --exit-code master dir/master &&
	git ls-files -s dir/next0 >actual.next0 &&
	test_cmp expect.next0 actual.next0

expecting success: 
	test_tick &&
	test_commit both.txt both.txt initial &&
	git branch topic &&
	test_commit modified_in_master both.txt in_master &&
	test_commit added_in_master each.txt in_master &&
	git checkout topic &&
	test_commit modified_in_topic both.txt in_topic &&
	test_commit added_in_topic each.txt in_topic

diff --git a/dir/foo b/dir/foo
index 564b12f..b8f99f5 100644
--- a/dir/foo
+++ b/dir/foo
@@ -1 +1 @@
-head
+work
Already on 'next'
Discard this hunk from worktree [y,n,q,a,d,/,e,?]? A	dir/master
D	dir/next0
M	dir/next1

[master (root-commit) 7a8c5bf] both.txt
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 both.txt
HEAD is now at 65d8465 next has dir/next but not dir/master
rm 'dir/next0'
Cloning into 'submodule_update'...
ok 10 - path limiting works: dir

expecting success: 
	set_state dir/foo work head &&
	(echo y; echo n) | git checkout -p -- dir &&
	verify_saved_state bar &&
	verify_state dir/foo head head

[master dc44449] modified_in_master
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
done.
ok 3 - do not touch unmerged entries matching $path but not in $tree

expecting success: 
	git reset --hard &&
	echo one >file1 &&
	echo two >file2 &&
	git add file1 file2 &&
	git commit -m base &&
	echo modified >file1 &&
	test-chmtime =1000000000 file2 &&
	git update-index -q --refresh &&
	git checkout HEAD -- file1 file2 &&
	echo one >expect &&
	test_cmp expect file1 &&
	echo "1000000000	file2" >expect &&
	test-chmtime -v +0 file2 >actual &&
	test_cmp expect actual

[master 642a0cb] added_in_master
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 each.txt
HEAD is now at 65d8465 next has dir/next but not dir/master
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Switched to branch 'topic'
[next 709a6c8] base
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 file1
 create mode 100644 file2
[topic 33542d7] modified_in_topic
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 4 - do not touch files that are already up-to-date

# passed all 4 test(s)
1..4
[topic d46615c] added_in_topic
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 each.txt
ok 1 - setup

expecting success: 
    test_must_fail git merge master

*** t2024-checkout-dwim.sh ***
Merging:
d46615c added_in_topic
virtual master
found 1 common ancestor:
7a8c5bf both.txt
Auto-merging each.txt
CONFLICT (add/add): Merge conflict in each.txt
Auto-merging both.txt
CONFLICT (content): Merge conflict in both.txt
Automatic merge failed; fix conflicts and then commit the result.
ok 2 - git merge master

expecting success: 
	cp each.txt each.txt.conflicted &&
	echo resolved >each.txt &&
	git add each.txt &&
	git checkout -m -- each.txt &&
	clean_branchnames <each.txt >each.txt.cleaned &&
	clean_branchnames <each.txt.conflicted >each.txt.conflicted.cleaned &&
	test_cmp each.txt.conflicted.cleaned each.txt.cleaned

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2024-checkout-dwim/.git/
expecting success: 
	test_commit my_master &&
	git init repo_a &&
	(
		cd repo_a &&
		test_commit a_master &&
		git checkout -b foo &&
		test_commit a_foo &&
		git checkout -b bar &&
		test_commit a_bar
	) &&
	git init repo_b &&
	(
		cd repo_b &&
		test_commit b_master &&
		git checkout -b foo &&
		test_commit b_foo &&
		git checkout -b baz &&
		test_commit b_baz
	) &&
	git remote add repo_a repo_a &&
	git remote add repo_b repo_b &&
	git config remote.repo_b.fetch \
		"+refs/heads/*:refs/remotes/other_b/*" &&
	git fetch --all

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 3 - -m restores 2-way conflicted+resolved file

expecting success: 
	cp both.txt both.txt.conflicted &&
	echo resolved >both.txt &&
	git add both.txt &&
	git checkout -m -- both.txt &&
	clean_branchnames <both.txt >both.txt.cleaned &&
	clean_branchnames <both.txt.conflicted >both.txt.conflicted.cleaned &&
	test_cmp both.txt.conflicted.cleaned both.txt.cleaned

[master (root-commit) 93159a7] my_master
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 my_master.t
ok 4 - -m restores 3-way conflicted+resolved file

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2024-checkout-dwim/repo_a/.git/
# passed all 4 test(s)
1..4
[master (root-commit) 9480204] a_master
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a_master.t
*** t2025-worktree-add.sh ***
Cloning into 'sub1'...
Switched to a new branch 'foo'
done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2025-worktree-add/.git/
[foo ba3a763] a_foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a_foo.t
expecting success: 
	test_commit init

diff --git a/dir/foo b/dir/foo
index 564b12f..b8f99f5 100644
--- a/dir/foo
+++ b/dir/foo
@@ -1 +1 @@
-head
+work
Switched to a new branch 'bar'
Discard this hunk from worktree [y,n,q,a,d,/,e,?]? 
[master (root-commit) 2519212] init
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 init.t
ok 1 - setup

expecting success: 
	mkdir -p existing/subtree &&
	test_must_fail git worktree add --detach existing master

[bar 1901e7e] a_bar
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a_bar.t
fatal: 'existing' already exists
ok 2 - "add" an existing worktree

expecting success: 
	mkdir existing_empty &&
	git worktree add --detach existing_empty master

ok 11 - path limiting works: -- dir

expecting success: 
	# the third n is to get out in case it mistakenly does not apply
	(echo y; echo n; echo n) | git checkout -p HEAD^ -- dir &&
	verify_saved_state bar &&
	verify_state dir/foo parent parent

Preparing existing_empty (identifier existing_empty)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2024-checkout-dwim/repo_b/.git/
Submodule path 'sub1': checked out '3950f7ed37a2b5b8e95094de1b49ceba8eecb3d9'
HEAD is now at 2519212 init
ok 3 - "add" an existing empty worktree

expecting success: 
	test_must_fail git worktree add zere master &&
	! test -d zere &&
	! test -d .git/worktrees/zere

[master (root-commit) eb1360a] b_master
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 b_master.t
fatal: 'master' is already checked out at ''
ok 4 - "add" refuses to checkout locked branch

expecting success: 
	(
	cd existing_empty &&
	echo dirty >>init.t &&
	git checkout master -- init.t
	)

ok 5 - checking out paths not complaining about linked checkouts

expecting success: 
	git rev-parse HEAD >expect &&
	git worktree add --detach here master &&
	(
		cd here &&
		test_cmp ../init.t init.t &&
		test_must_fail git symbolic-ref HEAD &&
		git rev-parse HEAD >actual &&
		test_cmp ../expect actual &&
		git fsck
	)

Switched to a new branch 'foo'
Preparing here (identifier here)
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
HEAD is now at 2519212 init
Switched to branch 'replace_sub1_with_file'
Your branch is up-to-date with 'origin/replace_sub1_with_file'.
test_must_fail: command succeeded: git checkout replace_sub1_with_file
[foo 73c9fcf] b_foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 b_foo.t
fatal: ref HEAD is not a symbolic ref
not ok 16 - git checkout: 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
		)
	
Switched to a new branch 'baz'
ok 6 - "add" worktree

expecting success: 
	(
		mkdir sub &&
		cd sub &&
		git worktree add --detach here master &&
		cd here &&
		test_cmp ../../init.t init.t
	)

[baz a4f4a16] b_baz
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 b_baz.t
Preparing sub/here (identifier here1)
HEAD is now at 2519212 init
ok 7 - "add" worktree from a subdir

expecting success: 
	(
		cd here &&
		git worktree add --detach nested-here master &&
		cd nested-here &&
		git fsck
	)

Cloning into 'submodule_update'...
Preparing nested-here (identifier nested-here)
Fetching repo_a
HEAD is now at 2519212 init
done.
warning: no common commits
ok 8 - "add" from a linked checkout

expecting success: 
	git worktree add -b newmaster there master &&
	(
		cd there &&
		test_cmp ../init.t init.t &&
		git symbolic-ref HEAD >actual &&
		echo refs/heads/newmaster >expect &&
		test_cmp expect actual &&
		git fsck
	)

Preparing there (identifier there)
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
HEAD is now at 2519212 init
From repo_a
 * [new branch]      bar        -> repo_a/bar
 * [new branch]      foo        -> repo_a/foo
 * [new branch]      master     -> repo_a/master
 * [new tag]         a_bar      -> a_bar
 * [new tag]         a_foo      -> a_foo
 * [new tag]         a_master   -> a_master
Fetching repo_b
ok 9 - "add" worktree creating new branch

expecting success: 
	(
		cd here &&
		test_must_fail git checkout newmaster
	)

fatal: 'newmaster' is already checked out at '/«PKGBUILDDIR»/t/trash directory.t2025-worktree-add/there/'
ok 10 - die the same branch is already checked out

warning: no common commits
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: 
	head=$(git -C there rev-parse --git-path HEAD) &&
	ref=$(git -C there symbolic-ref HEAD) &&
	rm "$head" &&
	ln -s "$ref" "$head" &&
	test_must_fail git -C here checkout newmaster

From repo_b
 * [new branch]      baz        -> other_b/baz
diff --git b/dir/foo a/dir/foo
index 564b12f..9676f5b 100644
--- b/dir/foo
+++ a/dir/foo
@@ -1 +1 @@
-head
+parent
 * [new branch]      foo        -> other_b/foo
 * [new branch]      master     -> other_b/master
fatal: 'newmaster' is already checked out at '/«PKGBUILDDIR»/t/trash directory.t2025-worktree-add/there/'
 * [new tag]         b_baz      -> b_baz
Apply this hunk to index and worktree [y,n,q,a,d,/,e,?]? ok 11 - die the same branch is already checked out (symlink)

expecting success: 
	(
		cd here &&
		git worktree add --force anothernewmaster newmaster
	)

 * [new tag]         b_foo      -> b_foo
 * [new tag]         b_master   -> b_master
Preparing anothernewmaster (identifier anothernewmaster)
ok 1 - setup

expecting success: 
	git checkout -B master &&
	test_might_fail git branch -D xyzzy &&

	test_must_fail git checkout xyzzy &&
	test_must_fail git rev-parse --verify refs/heads/xyzzy &&
	test_branch master

HEAD is now at 2519212 init
ok 12 - not die the same branch is already checked out

expecting success: 
	(
		cd there &&
		git checkout newmaster
	)


Reset branch 'master'
error: branch 'xyzzy' not found.
Already on 'newmaster'
ok 13 - not die on re-checking out current branch

expecting success: 
	(
		git clone --bare . bare &&
		cd bare &&
		git worktree add -b bare-master ../there2 master
	)

error: pathspec 'xyzzy' did not match any file(s) known to git.
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into bare repository 'bare'...
fatal: Needed a single revision
ok 12 - path limiting works: HEAD^ -- dir

ok 2 - checkout of non-existing branch fails

expecting success: 
	git checkout -B master &&
	test_might_fail git branch -D foo &&

	test_must_fail git checkout foo &&
	test_must_fail git rev-parse --verify refs/heads/foo &&
	test_branch master

expecting success: 
	set_state dir/foo work head &&
	# the third n is to get out in case it mistakenly does not apply
	(echo y; echo n; echo n) | (cd dir && git checkout -p foo) &&
	verify_saved_state bar &&
	verify_state dir/foo head head

done.
Reset branch 'master'
error: branch 'foo' not found.
Preparing ../there2 (identifier there2)
error: pathspec 'foo' did not match any file(s) known to git.
fatal: Needed a single revision
HEAD is now at 2519212 init
ok 14 - "add" from a bare repo

expecting success: 
	(
		cd bare &&
		test_must_fail git checkout master
	)

ok 3 - checkout of branch from multiple remotes fails #1

expecting success: 
	git checkout -B master &&
	test_might_fail git branch -D bar &&

	git checkout bar &&
	test_branch bar &&
	test_cmp_rev remotes/repo_a/bar HEAD &&
	test_branch_upstream bar repo_a bar

fatal: This operation must be run in a work tree
Cloning into 'sub1'...
ok 15 - checkout from a bare repo without "add"

expecting success: 
	test_when_finished rm .git/info/grafts &&
	test_commit abc &&
	SHA1=`git rev-parse HEAD` &&
	test_commit def &&
	test_commit xyz &&
	echo "`git rev-parse HEAD` $SHA1" >.git/info/grafts &&
	cat >expected <<-\EOF &&
	xyz
	abc
	EOF
	git log --format=%s -2 >actual &&
	test_cmp expected actual &&
	git worktree add --detach grafted master &&
	git --git-dir=grafted/.git log --format=%s -2 >actual &&
	test_cmp expected actual

Reset branch 'master'
error: branch 'bar' not found.
[master 6d278e0] abc
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 abc.t
done.
Switched to a new branch 'bar'
Branch bar set up to track remote branch bar from repo_a.
[master 3c13a14] def
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 def.t
ok 4 - checkout of branch from a single remote succeeds #1

expecting success: 
	git checkout -B master &&
	test_might_fail git branch -D baz &&

	git checkout baz &&
	test_branch baz &&
	test_cmp_rev remotes/other_b/baz HEAD &&
	test_branch_upstream baz repo_b baz

Switched to and reset branch 'master'
[master a51b5be] xyz
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 xyz.t
error: branch 'baz' not found.
Submodule path 'sub1': checked out '3950f7ed37a2b5b8e95094de1b49ceba8eecb3d9'
Switched to a new branch 'baz'
Branch baz set up to track remote branch baz from repo_b.
Preparing grafted (identifier grafted)
HEAD is now at a51b5be xyz
ok 5 - checkout of branch from a single remote succeeds #2

expecting success: 
	git checkout -B master &&
	test_might_fail git branch -D bar &&

	test_must_fail git checkout --no-guess bar &&
	test_must_fail git rev-parse --verify refs/heads/bar &&
	test_branch master

Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
ok 16 - checkout with grafts

expecting success: 
	test_commit a &&
	test_commit b &&
	test_commit c &&
	git rev-parse HEAD~1 >expected &&
	git worktree add relhead HEAD~1 &&
	git -C relhead rev-parse HEAD >actual &&
	test_cmp expected actual

Switched to and reset branch 'master'
Deleted branch bar (was 1901e7e).
error: pathspec 'bar' did not match any file(s) known to git.
[master e9a6308] a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a.t
fatal: Needed a single revision
ok 6 - --no-guess suppresses branch auto-vivification

expecting success: 
	git checkout -B master &&
	git init repo_c &&
	(
		cd repo_c &&
		test_commit c_master &&
		git checkout -b bar &&
		test_commit c_bar &&
		git checkout -b spam &&
		test_commit c_spam
	) &&
	git init repo_d &&
	(
		cd repo_d &&
		test_commit d_master &&
		git checkout -b baz &&
		test_commit d_baz &&
		git checkout -b eggs &&
		test_commit d_eggs
	) &&
	git remote add repo_c repo_c &&
	git config remote.repo_c.fetch \
		"+refs/heads/*:refs/remotes/extra_dir/repo_c/extra_dir/*" &&
	git remote add repo_d repo_d &&
	git config remote.repo_d.fetch \
		"+refs/heads/*:refs/repo_d/*" &&
	git fetch --all

Reset branch 'master'
[master 15d3bfc] b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 b.t
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2024-checkout-dwim/repo_c/.git/
[master (root-commit) dc015ba] c_master
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c_master.t
[master 179a9e0] c
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c.t
Switched to branch 'replace_sub1_with_file'
Your branch is up-to-date with 'origin/replace_sub1_with_file'.
test_must_fail: command succeeded: git checkout replace_sub1_with_file
Switched to a new branch 'bar'
diff --git a/dir/foo b/dir/foo
index 564b12f..b8f99f5 100644
--- a/dir/foo
+++ b/dir/foo
@@ -1 +1 @@
-head
+work
Preparing relhead (identifier relhead)
Discard this hunk from worktree [y,n,q,a,d,/,e,?]? not ok 17 - git checkout: 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
		)
	

[bar a433ad7] c_bar
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c_bar.t
HEAD is now at 15d3bfc b
ok 17 - "add" from relative HEAD

expecting success: 
	git worktree add -b burble flornk &&
	test_cmp_rev HEAD burble

Switched to a new branch 'spam'
ok 13 - path limiting works: foo inside dir

expecting success: 
	verify_saved_head

Preparing flornk (identifier flornk)
ok 14 - none of this moved HEAD

[spam 1702b85] c_spam
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c_spam.t
# passed all 14 test(s)
1..14
HEAD is now at 179a9e0 c
Cloning into 'submodule_update'...
ok 18 - "add -b" with <branch> omitted

expecting success: 
	git worktree add --detach fishhook &&
	git rev-parse HEAD >expected &&
	git -C fishhook rev-parse HEAD >actual &&
	test_cmp expected actual &&
	test_must_fail git -C fishhook symbolic-ref HEAD

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2024-checkout-dwim/repo_d/.git/
*** t2026-worktree-prune.sh ***
Preparing fishhook (identifier fishhook)
done.
[master (root-commit) f130d8f] d_master
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 d_master.t
HEAD is now at 179a9e0 c
Switched to a new branch 'baz'
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2026-worktree-prune/.git/
expecting success: 
	git commit --allow-empty -m init

fatal: ref HEAD is not a symbolic ref
ok 19 - "add --detach" with <branch> omitted

expecting success: 
	git worktree add wiffle/bat &&
	test_cmp_rev HEAD bat

[master (root-commit) 1a6f08c] init
 Author: A U Thor <author@example.com>
ok 1 - initialize

expecting success: 
	git worktree prune &&
	test_must_fail git worktree prune abc

[baz aff1e77] d_baz
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 d_baz.t
usage: git worktree add [<options>] <path> [<branch>]
Preparing wiffle/bat (identifier bat)
   or: git worktree prune [<options>]

    -n, --dry-run         do not remove, show only
    -v, --verbose         report pruned objects
    --expire <expiry-date>
                          expire objects older than <time>

ok 2 - worktree prune on normal repo

expecting success: 
	mkdir .git/worktrees &&
	: >.git/worktrees/abc &&
	git worktree prune --verbose >actual &&
	cat >expect <<EOF &&
Removing worktrees/abc: not a valid directory
EOF
	test_i18ncmp expect actual &&
	! test -f .git/worktrees/abc &&
	! test -d .git/worktrees

Switched to a new branch 'eggs'
HEAD is now at 179a9e0 c
ok 3 - prune files inside $GIT_DIR/worktrees

expecting success: 
	mkdir -p .git/worktrees/def/abc &&
	: >.git/worktrees/def/def &&
	cat >expect <<EOF &&
Removing worktrees/def: gitdir file does not exist
EOF
	git worktree prune --verbose >actual &&
	test_i18ncmp expect actual &&
	! test -d .git/worktrees/def &&
	! test -d .git/worktrees

[eggs fea4556] d_eggs
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 d_eggs.t
ok 20 - "add" with <branch> omitted

expecting success: 
	test_commit c1 &&
	test_commit c2 &&
	git branch precious HEAD~1 &&
	test_must_fail git worktree add precious &&
	test_cmp_rev HEAD~1 precious &&
	test_path_is_missing precious

ok 4 - prune directories without gitdir

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 18b3dca] c1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c1.t
rm: cannot remove 'SANETESTD.1/x': Permission denied
prerequisite SANITY ok
expecting success: 
	mkdir -p .git/worktrees/def/abc &&
	: >.git/worktrees/def/def &&
	: >.git/worktrees/def/gitdir &&
	chmod u-r .git/worktrees/def/gitdir &&
	git worktree prune --verbose >actual &&
	test_i18ngrep "Removing worktrees/def: unable to read gitdir file" actual &&
	! test -d .git/worktrees/def &&
	! test -d .git/worktrees

Fetching repo_a
Removing worktrees/def: unable to read gitdir file (Permission denied)
ok 5 - prune directories with unreadable gitdir

expecting success: 
	mkdir -p .git/worktrees/def/abc &&
	: >.git/worktrees/def/def &&
	: >.git/worktrees/def/gitdir &&
	git worktree prune --verbose >actual &&
	test_i18ngrep "Removing worktrees/def: invalid gitdir file" actual &&
	! test -d .git/worktrees/def &&
	! test -d .git/worktrees

[master 423452d] c2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c2.t
Removing worktrees/def: invalid gitdir file
ok 6 - prune directories with invalid gitdir

expecting success: 
	mkdir -p .git/worktrees/def/abc &&
	: >.git/worktrees/def/def &&
	echo "$(pwd)"/nowhere >.git/worktrees/def/gitdir &&
	git worktree prune --verbose >actual &&
	test_i18ngrep "Removing worktrees/def: gitdir file points to non-existent location" actual &&
	! test -d .git/worktrees/def &&
	! test -d .git/worktrees

Fetching repo_b
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule_update_repo/.) registered for path 'sub1'
Removing worktrees/def: gitdir file points to non-existent location
ok 7 - prune directories with gitdir pointing to nowhere

expecting success: 
	test_when_finished rm -r .git/worktrees &&
	mkdir -p .git/worktrees/ghi &&
	: >.git/worktrees/ghi/locked &&
	git worktree prune &&
	test -d .git/worktrees/ghi

fatal: A branch named 'precious' already exists.
ok 8 - not prune locked checkout

expecting success: 
	test_when_finished rm -r .git/worktrees &&
	mkdir zz &&
	mkdir -p .git/worktrees/jlm &&
	echo "$(pwd)"/zz >.git/worktrees/jlm/gitdir &&
	rmdir zz &&
	git worktree prune --verbose --expire=2.days.ago &&
	test -d .git/worktrees/jlm

ok 21 - "add" auto-vivify does not clobber existing branch

expecting success: 
	git worktree add --detach mish/mash &&
	test_must_fail git rev-parse mash -- &&
	test_must_fail git -C mish/mash symbolic-ref HEAD

Preparing mish/mash (identifier mash)
Fetching repo_c
ok 9 - not prune recent checkouts

expecting success: 
	test_when_finished rm -r .git/worktrees &&
	git worktree add --detach "$PWD/nop" master &&
	git worktree prune &&
	test -d .git/worktrees/nop

Preparing /«PKGBUILDDIR»/t/trash directory.t2026-worktree-prune/nop (identifier nop)
HEAD is now at 423452d c2
warning: no common commits
fatal: bad revision 'mash'
HEAD is now at 1a6f08c init
Cloning into 'sub1'...
fatal: ref HEAD is not a symbolic ref
ok 22 - "add" no auto-vivify with --detach and <branch> omitted

expecting success: 
	test_must_fail git worktree add -b poodle -B poodle bamboo master

fatal: -b, -B, and --detach are mutually exclusive
ok 23 - "add" -b/-B mutually exclusive

expecting success: 
	test_must_fail git worktree add -b poodle --detach bamboo master

ok 10 - not prune proper checkouts

# passed all 10 test(s)
1..10
fatal: -b, -B, and --detach are mutually exclusive
ok 24 - "add" -b/--detach mutually exclusive

expecting success: 
	test_must_fail git worktree add -B poodle --detach bamboo master

fatal: -b, -B, and --detach are mutually exclusive
done.
ok 25 - "add" -B/--detach mutually exclusive

expecting success: 
	git clone --local here here-clone &&
	( cd here-clone && git fsck )

From repo_c
 * [new branch]      bar        -> extra_dir/repo_c/extra_dir/bar
 * [new branch]      master     -> extra_dir/repo_c/extra_dir/master
 * [new branch]      spam       -> extra_dir/repo_c/extra_dir/spam
 * [new tag]         c_bar      -> c_bar
 * [new tag]         c_master   -> c_master
 * [new tag]         c_spam     -> c_spam
*** t2030-unresolve-info.sh ***
Cloning into 'here-clone'...
Fetching repo_d
warning: no common commits
done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2030-unresolve-info/.git/
expecting success: 
	mkdir fi &&
	printf "a\0a" >binary &&
	git add binary &&
	test_commit initial fi/le first &&
	git branch side &&
	git branch another &&
	printf "a\0b" >binary &&
	git add binary &&
	test_commit second fi/le second &&
	git checkout side &&
	test_commit third fi/le third &&
	git branch add-add &&
	git checkout another &&
	test_commit fourth fi/le fourth &&
	git checkout add-add &&
	test_commit fifth add-differently &&
	git checkout master

ok 26 - local clone from linked checkout

# passed all 26 test(s)
1..26
From repo_d
 * [new branch]      baz        -> refs/repo_d/baz
 * [new branch]      eggs       -> refs/repo_d/eggs
 * [new branch]      master     -> refs/repo_d/master
 * [new tag]         d_baz      -> d_baz
 * [new tag]         d_eggs     -> d_eggs
 * [new tag]         d_master   -> d_master
Submodule path 'sub1': checked out '3950f7ed37a2b5b8e95094de1b49ceba8eecb3d9'
ok 7 - setup more remotes with unconventional refspecs

expecting success: 
	git checkout -B master &&
	test_might_fail git branch -D bar &&

	test_must_fail git checkout bar &&
	test_must_fail git rev-parse --verify refs/heads/bar &&
	test_branch master

[master (root-commit) 7b271e3] initial
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
 create mode 100644 binary
 create mode 100644 fi/le
Reset branch 'master'
error: branch 'bar' not found.
error: pathspec 'bar' did not match any file(s) known to git.
Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
fatal: Needed a single revision
ok 8 - checkout of branch from multiple remotes fails #2

expecting success: 
	git checkout -B master &&
	test_might_fail git branch -D baz &&

	test_must_fail git checkout baz &&
	test_must_fail git rev-parse --verify refs/heads/baz &&
	test_branch master

Switched to branch 'modify_sub1'
Your branch is up-to-date with 'origin/modify_sub1'.
[master 9a00f99] second
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 1 deletion(-)
Reset branch 'master'
*** t2050-git-dir-relative.sh ***
Deleted branch baz (was a4f4a16).
Switched to branch 'side'
error: pathspec 'baz' did not match any file(s) known to git.
fatal: Needed a single revision
ok 9 - checkout of branch from multiple remotes fails #3

expecting success: 
	git checkout -B master &&
	test_might_fail git branch -D spam &&

	git checkout spam &&
	test_branch spam &&
	test_cmp_rev refs/remotes/extra_dir/repo_c/extra_dir/spam HEAD &&
	test_branch_upstream spam repo_c spam

[side b18340d] third
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Reset branch 'master'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2050-git-dir-relative/.git/
error: branch 'spam' not found.
expecting success: 
mkdir -p .git/hooks &&
echo >.git/hooks/post-commit "#!/bin/sh
touch \"\${COMMIT_FILE}\"
echo Post commit hook was called." &&
chmod +x .git/hooks/post-commit
Switched to branch 'another'
Switched to a new branch 'spam'
Branch spam set up to track remote branch spam from repo_c.
ok 1 - Setting up post-commit hook

expecting success: 
echo initial >top &&
git add top &&
git commit -m initial &&
test -r "${COMMIT_FILE}"

[another cf4d985] fourth
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Post commit hook was called.
[master (root-commit) 53bb590] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 top
ok 2 - post-commit hook used ordinarily

Switched to branch 'add-add'
expecting success: 
echo changed >top &&
git --git-dir subdir/.git add top &&
git --git-dir subdir/.git commit -m topcommit &&
test -r "${COMMIT_FILE}"

ok 10 - checkout of branch from a single remote succeeds #3

expecting success: 
	git checkout -B master &&
	test_might_fail git branch -D eggs &&

	git checkout eggs &&
	test_branch eggs &&
	test_cmp_rev refs/repo_d/eggs HEAD &&
	test_branch_upstream eggs repo_d eggs

Switched to and reset branch 'master'
[add-add b851e77] fifth
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 add-differently
error: branch 'eggs' not found.
Post commit hook was called.
[master 5962bfb] topcommit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 3 - post-commit-hook created and used from top dir

Switched to branch 'master'
ok 1 - setup

expecting success: 
	prime_resolve_undo &&
	test_tick &&
	git commit -m merged &&
	echo committing keeps &&
	check_resolve_undo kept fi/le initial:fi/le second:fi/le third:fi/le &&
	git checkout second^0 &&
	echo switching clears &&
	check_resolve_undo cleared

expecting success: 
echo changed again >top &&
cd subdir &&
git --git-dir .git --work-tree .. add ../top &&
git --git-dir .git --work-tree .. commit -m subcommit &&
test -r "${COMMIT_FILE}"

Switched to a new branch 'eggs'
Branch eggs set up to track remote branch eggs from repo_d.
HEAD is now at 9a00f99 second
Note: checking out 'second^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 9a00f99... second
Post commit hook was called.
Merging:
9a00f99 second
virtual third^0
found 1 common ancestor:
7b271e3 initial
Auto-merging fi/le
CONFLICT (content): Merge conflict in fi/le
Automatic merge failed; fix conflicts and then commit the result.
merge does not leave anything
[master 412dccb] subcommit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 4 - post-commit-hook from sub dir

# passed all 4 test(s)
1..4
ok 11 - checkout of branch from a single remote succeeds #4

expecting success: 
	git checkout -B master &&
	test_might_fail git branch -D spam &&

	>spam &&
	test_must_fail git checkout spam &&
	test_must_fail git rev-parse --verify refs/heads/spam &&
	test_branch master

resolving records
Submodule path 'sub1': checked out '7cbf99584fb902eb4a95073485eaf1183cda68ff'
Switched to and reset branch 'master'
*** t2100-update-cache-badpath.sh ***
Deleted branch spam (was 1702b85).
error: pathspec 'spam' did not match any file(s) known to git.
[detached HEAD b3a51df] merged
 Author: A U Thor <author@example.com>
committing keeps
fatal: Needed a single revision
ok 18 - git checkout: 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
		)
	
ok 12 - checkout of branch with a file having the same name fails

expecting success: 
	git checkout -B master &&
	test_might_fail git branch -D spam &&

	>spam &&
	git checkout spam -- &&
	test_branch spam &&
	test_cmp_rev refs/remotes/extra_dir/repo_c/extra_dir/spam HEAD &&
	test_branch_upstream spam repo_c spam

Reset branch 'master'
error: branch 'spam' not found.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2100-update-cache-badpath/.git/
Switched to a new branch 'spam'
Branch spam set up to track remote branch spam from repo_c.
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

)
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  b3a51df merged

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> b3a51df

HEAD is now at 9a00f99... second
switching clears
ok 2 - add records switch clears

expecting success: 
	prime_resolve_undo &&
	test_tick &&
	git commit -m merged &&
	echo committing keeps &&
	check_resolve_undo kept fi/le initial:fi/le second:fi/le third:fi/le &&

	echo merge clears upfront &&
	test_must_fail git merge fourth^0 &&
	check_resolve_undo nuked &&

	git rm -f fi/le &&
	echo resolving records &&
	check_resolve_undo recorded fi/le initial:fi/le HEAD:fi/le fourth:fi/le &&

	git reset --hard &&
	echo resetting discards &&
	check_resolve_undo discarded

prerequisite SYMLINKS ok
Cloning into 'submodule_update'...
expecting success: git update-index --add -- path0 path1 path2/file2 path3/file3
HEAD is now at 9a00f99 second
HEAD is now at 9a00f99... second
ok 1 - git update-index --add to add various paths.

ok 13 - checkout <branch> -- succeeds, even if a file with the same name exists

expecting success: 

	git checkout master &&
	git branch strict &&
	git branch loose &&
	git commit --allow-empty -m "a bit more" &&

	test_config branch.strict.remote . &&
	test_config branch.loose.remote . &&
	test_config branch.strict.merge refs/heads/master &&
	test_config branch.loose.merge master &&

	git checkout strict | sed -e "s/strict/BRANCHNAME/g" >expect &&
	git checkout loose | sed -e "s/loose/BRANCHNAME/g" >actual &&

	test_cmp expect actual

Merging:
9a00f99 second
virtual third^0
found 1 common ancestor:
7b271e3 initial
Auto-merging fi/le
CONFLICT (content): Merge conflict in fi/le
Automatic merge failed; fix conflicts and then commit the result.
merge does not leave anything
done.
Switched to branch 'master'
expecting success: test_must_fail git update-index --add -- path0/file0
resolving records
error: 'path0/file0' appears as both a file and as a directory
error: path0/file0: cannot add to the index - missing --add option?
fatal: Unable to process path path0/file0
ok 2 - git update-index to add conflicting path path0/file0 should fail.

expecting success: test_must_fail git update-index --add -- path1/file1
error: 'path1/file1' appears as both a file and as a directory
error: path1/file1: cannot add to the index - missing --add option?
fatal: Unable to process path path1/file1
ok 3 - git update-index to add conflicting path path1/file1 should fail.

expecting success: test_must_fail git update-index --add -- path2
[master b3a488e] a bit more
 Author: A U Thor <author@example.com>
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
error: 'path2' appears as both a file and as a directory
error: path2: cannot add to the index - missing --add option?
fatal: Unable to process path path2
ok 4 - git update-index to add conflicting path path2 should fail.

expecting success: test_must_fail git update-index --add -- path3
[detached HEAD 70d285e] merged
 Author: A U Thor <author@example.com>
committing keeps
error: 'path3' appears as both a file and as a directory
error: path3: cannot add to the index - missing --add option?
fatal: Unable to process path path3
ok 5 - git update-index to add conflicting path path3 should fail.

# passed all 5 test(s)
1..5
Switched to branch 'strict'
merge clears upfront
Switched to branch 'loose'
Merging:
70d285e merged
virtual fourth^0
found 1 common ancestor:
7b271e3 initial
Auto-merging fi/le
CONFLICT (content): Merge conflict in fi/le
Automatic merge failed; fix conflicts and then commit the result.
*** t2101-update-index-reupdate.sh ***
fi/le: needs merge
rm 'fi/le'
resolving records
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2101-update-index-reupdate/.git/
ok 14 - loosely defined local base branch is reported correctly

expecting success: echo hello world >file1 &&
	 echo goodbye people >file2 &&
	 git update-index --add file1 file2 &&
	 git ls-files -s >current &&
	 cmp current expected
# passed all 14 test(s)
1..14
HEAD is now at 70d285e merged
resetting discards
ok 1 - update-index --add

expecting success: rm -f file1 &&
	echo hello everybody >file2 &&
	if git update-index --again
	then
		echo should have refused to remove file1
		exit 1
	else
		echo happy - failed as expected
	fi &&
	 git ls-files -s >current &&
	 cmp current expected
error: file1: does not exist and --remove not passed
fatal: Unable to process path file1
ok 3 - rm records reset clears

expecting success: 
	prime_resolve_undo &&
	test_tick &&
	git commit -m merged &&
	echo committing keeps &&
	check_resolve_undo kept fi/le initial:fi/le second:fi/le third:fi/le &&

	echo plumbing clear &&
	git update-index --clear-resolve-undo &&
	check_resolve_undo cleared

happy - failed as expected
ok 2 - update-index --again

expecting success: git update-index --remove --again &&
	 git ls-files -s >current &&
	 cmp current expected
HEAD is now at 70d285e merged
ok 3 - update-index --remove --again

expecting success: git commit -m initial
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule_update_repo/.) registered for path 'sub1'
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  70d285e merged

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> 70d285e

HEAD is now at 9a00f99... second
[master (root-commit) 70708ff] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file2
ok 4 - first commit

expecting success: mkdir -p dir1 &&
	echo hello world >dir1/file3 &&
	echo goodbye people >file2 &&
	git update-index --add file2 dir1/file3 &&
	echo hello everybody >file2 &&
	echo happy >dir1/file3 &&
	git update-index --again &&
	git ls-files -s >current &&
	cmp current expected
Merging:
9a00f99 second
virtual third^0
found 1 common ancestor:
7b271e3 initial
Auto-merging fi/le
CONFLICT (content): Merge conflict in fi/le
Automatic merge failed; fix conflicts and then commit the result.
merge does not leave anything
*** t2102-update-index-symlinks.sh ***
resolving records
ok 5 - update-index again

expecting success: echo not so happy >file2 &&
	(cd dir1 &&
	cat ../file2 >file3 &&
	git update-index --again
	) &&
	git ls-files -s >current &&
	cmp current expected
ok 6 - update-index --update from subdir

expecting success: echo very happy >file2 &&
	cat file2 >dir1/file3 &&
	git update-index --again dir1/ &&
	git ls-files -s >current &&
	cmp current expected
Cloning into 'sub1'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2102-update-index-symlinks/.git/
[detached HEAD 894de51] merged
 Author: A U Thor <author@example.com>
committing keeps
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
ok 7 - update-index --update with pathspec

# passed all 7 test(s)
1..7
done.
ok 1 - preparation

expecting success: 
printf new-file > symlink &&
git update-index symlink
ok 2 - modify the symbolic link

expecting success: 
case "`git ls-files --stage --cached symlink`" in
120000" "*symlink) echo pass;;
*) echo fail; git ls-files --stage --cached symlink; (exit 1);;
esac
*** t2103-update-index-ignore-missing.sh ***
plumbing clear
pass
ok 3 - the index entry must still be a symbolic link

# passed all 3 test(s)
1..3
ok 4 - plumbing clears

expecting success: 
	prime_resolve_undo &&
	git diff HEAD &&
	git checkout --conflict=merge fi/le &&
	echo checkout used the record and removed it &&
	check_resolve_undo removed &&
	echo the index and the work tree is unmerged again &&
	git diff >actual &&
	grep "^++<<<<<<<" actual

*** t2104-update-index-skip-worktree.sh ***
HEAD is now at 894de51 merged
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2103-update-index-ignore-missing/.git/
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  894de51 merged

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> 894de51

expecting success: 
	>one &&
	>two &&
	>three &&

	# need --add when adding
	test_must_fail git update-index one &&
	test -z "$(git ls-files)" &&
	git update-index --add one &&
	test zone = "z$(git ls-files)" &&

	# update-index is atomic
	echo 1 >one &&
	test_must_fail git update-index one two &&
	echo "M	one" >expect &&
	git diff-files --name-status >actual &&
	test_cmp expect actual &&

	git update-index --add one two three &&
	for i in one three two; do echo $i; done >expect &&
	git ls-files >actual &&
	test_cmp expect actual &&

	test_tick &&
	(
		test_create_repo xyzzy &&
		cd xyzzy &&
		>file &&
		git add file
		git commit -m "sub initial"
	) &&
	git add xyzzy &&

	test_tick &&
	git commit -m initial &&
	git tag initial

HEAD is now at 9a00f99... second
error: one: cannot add to the index - missing --add option?
fatal: Unable to process path one
Merging:
9a00f99 second
virtual third^0
found 1 common ancestor:
7b271e3 initial
Auto-merging fi/le
CONFLICT (content): Merge conflict in fi/le
Automatic merge failed; fix conflicts and then commit the result.
merge does not leave anything
Submodule path 'sub1': checked out '3950f7ed37a2b5b8e95094de1b49ceba8eecb3d9'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2104-update-index-skip-worktree/.git/
resolving records
expecting success: 
	mkdir sub &&
	touch ./1 ./2 sub/1 sub/2 &&
	git add 1 2 sub/1 sub/2 &&
	git ls-files -t | test_cmp expect.full -

error: two: cannot add to the index - missing --add option?
fatal: Unable to process path two
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
diff --git a/fi/le b/fi/le
index e019be0..8dca2f8 100644
--- a/fi/le
+++ b/fi/le
@@ -1 +1 @@
-second
+different
ok 1 - setup

expecting success: 
	test "$(test-index-version < .git/index)" = 2

Switched to branch 'invalid_sub1'
Your branch is up-to-date with 'origin/invalid_sub1'.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2103-update-index-ignore-missing/xyzzy/.git/
checkout used the record and removed it
ok 2 - index is at version 2

expecting success: 
	git update-index --skip-worktree 1 sub/1 &&
	git ls-files -t | test_cmp expect.skip -

the index and the work tree is unmerged again
ok 3 - update-index --skip-worktree

expecting success: 
	test "$(test-index-version < .git/index)" = 3

[master (root-commit) a40d181] sub initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file
ok 4 - index is at version 3 after having some skip-worktree entries

expecting success: 
	git ls-files -t | test_cmp expect.skip -

++<<<<<<< ours
ok 5 - add records checkout -m undoes

expecting success: 
	prime_resolve_undo &&
	git update-index --unresolve fi/le &&
	git ls-files -u >actual &&
	test_line_count = 3 actual

ok 5 - ls-files -t

expecting success: 
	git update-index --no-skip-worktree 1 sub/1 &&
	git ls-files -t | test_cmp expect.full -

HEAD is now at 9a00f99 second
[master (root-commit) ce14d7f] initial
 Author: A U Thor <author@example.com>
 4 files changed, 2 insertions(+)
 create mode 100644 one
 create mode 100644 three
 create mode 100644 two
 create mode 160000 xyzzy
ok 6 - update-index --no-skip-worktree

expecting success: 
	test "$(test-index-version < .git/index)" = 2

ok 7 - index version is back to 2 when there is no skip-worktree entry

ok 1 - basics

expecting success: 
	git reset --hard initial &&
	echo 2 >one &&
	test_must_fail git update-index --refresh &&
	echo 1 >one &&
	git update-index --refresh &&
	rm -f two &&
	test_must_fail git update-index --refresh &&
	git update-index --ignore-missing --refresh


HEAD is now at 9a00f99... second
# passed all 7 test(s)
1..7
HEAD is now at ce14d7f initial
Merging:
9a00f99 second
virtual third^0
found 1 common ancestor:
7b271e3 initial
Auto-merging fi/le
CONFLICT (content): Merge conflict in fi/le
Automatic merge failed; fix conflicts and then commit the result.
merge does not leave anything
one: needs update
*** t2105-update-index-gitfile.sh ***
two: needs update
resolving records
ok 2 - --ignore-missing --refresh

expecting success: 
	git reset --hard initial &&
	info=$(git ls-files -s one | sed -e "s/ 0	/ 1	/") &&
	git rm --cached one &&
	echo "$info" | git update-index --index-info &&
	test_must_fail git update-index --refresh &&
	git update-index --unmerged --refresh &&
	echo 2 >two &&
	test_must_fail git update-index --unmerged --refresh >actual &&
	grep two actual &&
	! grep one actual &&
	! grep three actual

HEAD is now at ce14d7f initial
rm 'one'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2105-update-index-gitfile/.git/
one: needs merge
expecting success: 
	mkdir sub1 &&
	(cd sub1 &&
	 git init &&
	 REAL="$(pwd)/.real" &&
	 mv .git "$REAL" &&
	 echo "gitdir: $REAL" >.git &&
	 test_commit first)

ok 6 - unmerge with plumbing

expecting success: 
	mkdir .git/rr-cache &&
	prime_resolve_undo &&
	echo record the resolution &&
	git rerere &&
	rerere_id=$(cd .git/rr-cache && echo */postimage) &&
	rerere_id=${rerere_id%/postimage} &&
	test -f .git/rr-cache/$rerere_id/postimage &&
	git checkout -m fi/le &&
	echo resurrect the conflict &&
	grep "^=======" fi/le &&
	echo reresolve the conflict &&
	git rerere &&
	test "z$(cat fi/le)" = zdifferent &&
	echo register the resolution again &&
	git add fi/le &&
	check_resolve_undo kept fi/le initial:fi/le second:fi/le third:fi/le &&
	test -z "$(git ls-files -u)" &&
	git rerere forget fi/le &&
	! test -f .git/rr-cache/$rerere_id/postimage &&
	tr "\0" "\n" <.git/MERGE_RR >actual &&
	echo "$rerere_id	fi/le" >expect &&
	test_cmp expect actual

two: needs update
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2105-update-index-gitfile/sub1/.git/
ok 3 - --unmerged --refresh

expecting success: 
	git reset --hard initial &&
	rm -f two &&
	test_must_fail git update-index --ignore-submodules --refresh

HEAD is now at 9a00f99 second
HEAD is now at ce14d7f initial
HEAD is now at 9a00f99... second
two: needs update
ok 4 - --ignore-submodules --refresh (1)

expecting success: 
	git reset --hard initial &&
	test_tick &&
	(
		cd xyzzy &&
		git commit -m "sub second" --allow-empty
	) &&
	test_must_fail git update-index --refresh &&
	test_must_fail git update-index --ignore-missing --refresh &&
	git update-index --ignore-submodules --refresh

[master (root-commit) 50e526b] first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 first.t
Recorded preimage for 'fi/le'
Merging:
9a00f99 second
virtual third^0
found 1 common ancestor:
7b271e3 initial
Auto-merging fi/le
CONFLICT (content): Merge conflict in fi/le
Automatic merge failed; fix conflicts and then commit the result.
merge does not leave anything
HEAD is now at ce14d7f initial
ok 1 - submodule with absolute .git file

expecting success: 
	git update-index --add -- sub1

ok 2 - add gitlink to absolute .git file

expecting success: 
	mkdir sub2 &&
	(cd sub2 &&
	 git init &&
	 mv .git .real &&
	 echo "gitdir: .real" >.git &&
	 test_commit first)

[master 66f0d66] sub second
 Author: A U Thor <author@example.com>
xyzzy: needs update
resolving records
xyzzy: needs update
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2105-update-index-gitfile/sub2/.git/
ok 5 - --ignore-submodules --refresh (2)

# passed all 5 test(s)
1..5
record the resolution
fatal: reference is not a tree: 0123456789012345678901234567890123456789
Unable to checkout '0123456789012345678901234567890123456789' in submodule path 'sub1'
[master (root-commit) 50e526b] first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 first.t
Recorded resolution for 'fi/le'.
ok 3 - submodule with relative .git file

*** t2106-update-index-assume-unchanged.sh ***
expecting success: 
	git update-index --add -- sub2

resurrect the conflict
ok 4 - add gitlink to relative .git file

=======
reresolve the conflict
# passed all 4 test(s)
1..4
Resolved 'fi/le' using previous resolution.
register the resolution again
ok 19 - git checkout: 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
		)
	
*** t2107-update-index-basic.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2106-update-index-assume-unchanged/.git/
expecting success: : >file &&
	 git add file &&
	 git commit -m initial &&
	 git branch other &&
	 echo upstream >file &&
	 git add file &&
	 git commit -m upstream
[master (root-commit) dc87216] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2107-update-index-basic/.git/
Updated preimage for 'fi/le'
Forgot resolution for fi/le
expecting success: 
	test_must_fail git update-index --nonsense 2>msg &&
	cat msg &&
	test -s msg

ok 7 - rerere and rerere forget

Cloning into 'submodule_update'...
expecting success: 
	rm -fr .git/rr-cache &&
	mkdir .git/rr-cache &&
	prime_resolve_undo &&
	echo record the resolution &&
	(cd fi && git rerere) &&
	rerere_id=$(cd .git/rr-cache && echo */postimage) &&
	rerere_id=${rerere_id%/postimage} &&
	test -f .git/rr-cache/$rerere_id/postimage &&
	(cd fi && git checkout -m le) &&
	echo resurrect the conflict &&
	grep "^=======" fi/le &&
	echo reresolve the conflict &&
	(cd fi && git rerere) &&
	test "z$(cat fi/le)" = zdifferent &&
	echo register the resolution again &&
	(cd fi && git add le) &&
	check_resolve_undo kept fi/le initial:fi/le second:fi/le third:fi/le &&
	test -z "$(git ls-files -u)" &&
	(cd fi && git rerere forget le) &&
	! test -f .git/rr-cache/$rerere_id/postimage &&
	tr "\0" "\n" <.git/MERGE_RR >actual &&
	echo "$rerere_id	fi/le" >expect &&
	test_cmp expect actual

[master 172d72c] upstream
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
error: unknown option 'nonsense'
usage: git update-index [<options>] [--] [<file>...]

    -q                    continue refresh even when index needs update
    --ignore-submodules   refresh: ignore submodules
    --add                 do not ignore new files
    --replace             let files replace directories and vice-versa
    --remove              notice files missing from worktree
    --unmerged            refresh even if index contains unmerged entries
    --refresh             refresh stat information
    --really-refresh      like --refresh, but ignore assume-unchanged setting
    --cacheinfo <mode>,<object>,<path>
                          add the specified entry to the index
    --chmod (+/-)x        override the executable bit of the listed files
    --assume-unchanged    mark files as "not changing"
    --no-assume-unchanged
                          clear assumed-unchanged bit
    --skip-worktree       mark files as "index-only"
    --no-skip-worktree    clear skip-worktree bit
    --info-only           add to index only; do not add content to object database
    --force-remove        remove named paths even if present in worktree
    -z                    with --stdin: input lines are terminated by null bytes
    --stdin               read list of paths to be updated from standard input
    --index-info          add entries from standard input to the index
    --unresolve           repopulate stages #2 and #3 for the listed paths
    -g, --again           only update entries that differ from HEAD
    --ignore-missing      ignore files missing from worktree
    --verbose             report actions to standard output
    --clear-resolve-undo  (for porcelains) forget saved unresolved conflicts
    --index-version <n>   write index in this format
    --split-index         enable or disable split index
    --untracked-cache     enable/disable untracked cache
    --force-untracked-cache
                          enable untracked cache without testing the filesystem

ok 1 - setup

expecting success: git reset --hard &&
	 git checkout other &&
	 echo dirt >file &&
	 git update-index --assume-unchanged file &&
	 test_must_fail git checkout master
HEAD is now at 9a00f99 second
ok 1 - update-index --nonsense fails

expecting success: 
	test_expect_code 129 git update-index --nonsense 2>err &&
	test_i18ngrep "[Uu]sage: git update-index" err

HEAD is now at 9a00f99... second
usage: git update-index [<options>] [--] [<file>...]
ok 2 - update-index --nonsense dumps usage

expecting success: 
	mkdir broken &&
	(
		cd broken &&
		git init &&
		>.git/index &&
		test_expect_code 129 git update-index -h >usage 2>&1
	) &&
	test_i18ngrep "[Uu]sage: git update-index" broken/usage

HEAD is now at 172d72c upstream
done.
Recorded preimage for 'fi/le'
Merging:
9a00f99 second
virtual third^0
found 1 common ancestor:
7b271e3 initial
Auto-merging fi/le
CONFLICT (content): Merge conflict in fi/le
Automatic merge failed; fix conflicts and then commit the result.
merge does not leave anything
Switched to branch 'other'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2107-update-index-basic/broken/.git/
Switched to a new branch 'invalid_sub1'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
error: Your local changes to the following files would be overwritten by checkout:
	file
Please, commit your changes or stash them before you can switch branches.
Aborting
ok 2 - do not switch branches with dirty file

usage: git update-index [<options>] [--] [<file>...]
ok 3 - update-index -h with corrupt index

expecting success: 
	test_must_fail git update-index --cacheinfo

# passed all 2 test(s)
1..2
resolving records
error: option 'cacheinfo' expects <mode>,<sha1>,<path>
usage: git update-index [<options>] [--] [<file>...]

    -q                    continue refresh even when index needs update
    --ignore-submodules   refresh: ignore submodules
    --add                 do not ignore new files
    --replace             let files replace directories and vice-versa
    --remove              notice files missing from worktree
    --unmerged            refresh even if index contains unmerged entries
    --refresh             refresh stat information
    --really-refresh      like --refresh, but ignore assume-unchanged setting
    --cacheinfo <mode>,<object>,<path>
                          add the specified entry to the index
    --chmod (+/-)x        override the executable bit of the listed files
    --assume-unchanged    mark files as "not changing"
    --no-assume-unchanged
                          clear assumed-unchanged bit
    --skip-worktree       mark files as "index-only"
    --no-skip-worktree    clear skip-worktree bit
    --info-only           add to index only; do not add content to object database
    --force-remove        remove named paths even if present in worktree
    -z                    with --stdin: input lines are terminated by null bytes
    --stdin               read list of paths to be updated from standard input
    --index-info          add entries from standard input to the index
    --unresolve           repopulate stages #2 and #3 for the listed paths
    -g, --again           only update entries that differ from HEAD
    --ignore-missing      ignore files missing from worktree
    --verbose             report actions to standard output
    --clear-resolve-undo  (for porcelains) forget saved unresolved conflicts
    --index-version <n>   write index in this format
    --split-index         enable or disable split index
    --untracked-cache     enable/disable untracked cache
    --force-untracked-cache
                          enable untracked cache without testing the filesystem

ok 4 - --cacheinfo complains of missing arguments

expecting success: 
	echo content >file &&
	git add file &&
	git rev-parse :file >expect &&
	test_must_fail git update-index --cacheinfo 100644 $_z40 file &&
	git rev-parse :file >actual &&
	test_cmp expect actual

*** t2200-add-update.sh ***
fatal: Needed a single revision
error: cache entry has null sha1: file
fatal: Unable to write new index file
Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
record the resolution
Recorded resolution for 'fi/le'.
Switched to branch 'valid_sub1'
Your branch is up-to-date with 'origin/valid_sub1'.
ok 5 - --cacheinfo does not accept blob null sha1

expecting success: 
	git init submodule &&
	(cd submodule && test_commit foo) &&
	git add submodule &&
	git rev-parse :submodule >expect &&
	test_must_fail git update-index --cacheinfo 160000 $_z40 submodule &&
	git rev-parse :submodule >actual &&
	test_cmp expect actual

resurrect the conflict
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2107-update-index-basic/submodule/.git/
=======
reresolve the conflict
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2200-add-update/.git/
expecting success: 
	echo initial >check &&
	echo initial >top &&
	echo initial >foo &&
	mkdir dir1 dir2 &&
	echo initial >dir1/sub1 &&
	echo initial >dir1/sub2 &&
	echo initial >dir2/sub3 &&
	git add check dir1 dir2 top foo &&
	test_tick &&
	git commit -m initial &&

	echo changed >check &&
	echo changed >top &&
	echo changed >dir2/sub3 &&
	rm -f dir1/sub1 &&
	echo other >dir2/other

Resolved 'fi/le' using previous resolution.
register the resolution again
[master (root-commit) ddd63c9] foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo.t
[master (root-commit) ec46c19] initial
 Author: A U Thor <author@example.com>
 6 files changed, 6 insertions(+)
 create mode 100644 check
 create mode 100644 dir1/sub1
 create mode 100644 dir1/sub2
 create mode 100644 dir2/sub3
 create mode 100644 foo
 create mode 100644 top
ok 1 - setup

expecting success: 
	git add -u dir1 dir2

error: cache entry has null sha1: submodule
fatal: Unable to write new index file
ok 2 - update

expecting success: 
	test "$(git ls-files dir1/sub1)" = ""

ok 6 - --cacheinfo does not accept gitlink null sha1

expecting success: 
	echo content >file &&
	git hash-object -w --stdin <file >expect &&

	git update-index --add --cacheinfo 100644 "$(cat expect)" file &&
	git rev-parse :file >actual &&
	test_cmp expect actual &&

	git update-index --add --cacheinfo "100644,$(cat expect),elif" &&
	git rev-parse :elif >actual &&
	test_cmp expect actual

ok 3 - update noticed a removal

expecting success: 
	test "$(git diff-files --name-status dir2/sub3)" = ""

Updated preimage for 'fi/le'
Forgot resolution for fi/le
ok 8 - rerere and rerere forget (subdirectory)

expecting success: 
	git checkout -f side &&
	printf "a\0c" >binary &&
	git commit -a -m binary &&
	test_must_fail git merge second &&
	git rerere forget binary

ok 4 - update touched correct path

expecting success: 
	test "$(git diff-files --name-status check)" = "M	check" &&
	test "$(git diff-files --name-status top)" = "M	top"

Previous HEAD position was 9a00f99... second
Switched to branch 'side'
ok 5 - update did not touch other tracked files

expecting success: 
	test "$(git ls-files dir2/other)" = ""

ok 6 - update did not touch untracked files

expecting success: 

	git ls-files -s |
	sed -e "s/ 0	/	/" >expect &&
	git ls-tree -r $(git write-tree) |
	sed -e "s/ blob / /" >current &&
	test_cmp expect current


[side 431a49e] binary
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
warning: Cannot merge binary files: binary (HEAD vs. second)
ok 7 - --cacheinfo mode,sha1,path (new syntax)

expecting success: 
	mkdir cleanup &&
	(
	cd cleanup &&
	mkdir worktree &&
	git init repo &&
	cd repo &&
	git config core.worktree ../../worktree &&
	# --refresh triggers late setup_work_tree,
	# active_cache_changed is zero, rollback_lock_file fails
	git update-index --refresh &&
	! test -f .git/index.lock
	)

Merging:
431a49e binary
virtual second
found 1 common ancestor:
7b271e3 initial
Auto-merging fi/le
CONFLICT (content): Merge conflict in fi/le
Auto-merging binary
CONFLICT (content): Merge conflict in binary
Automatic merge failed; fix conflicts and then commit the result.
warning: Cannot merge binary files: binary (ours vs. theirs)
error: Could not parse conflict hunks in 'binary'
ok 9 - rerere forget (binary)

expecting success: 
	git checkout -f master &&
	echo master >add-differently &&
	git add add-differently &&
	git commit -m "add differently" &&
	test_must_fail git merge fifth &&
	git rerere forget add-differently 2>actual &&
	test_i18ngrep "no remembered" actual

ok 7 - cache tree has not been corrupted

expecting success: 
	(
		cd dir1 &&
		echo more >sub2 &&
		git add -u sub2
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2107-update-index-basic/cleanup/repo/.git/
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule_update_repo/.) registered for path 'sub1'
Switched to branch 'master'
ok 8 - update from a subdirectory

expecting success: 

	test "$(git diff-files --name-status dir1)" = ""


ok 9 - change gets noticed

expecting success: 
	(
		cd dir1 &&
		echo even more >>sub2 &&
		git --literal-pathspecs add -u &&
		echo even more >>sub2 &&
		git add -u
	) &&
	: >expect &&
	git diff-files --name-only >actual &&
	test_cmp expect actual

ok 8 - .lock files cleaned up

[master 2aac45c] add differently
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 add-differently
# passed all 8 test(s)
1..8
Recorded preimage for 'add-differently'
Merging:
2aac45c add differently
virtual fifth
found 1 common ancestor:
7b271e3 initial
Auto-merging fi/le
CONFLICT (content): Merge conflict in fi/le
Auto-merging add-differently
CONFLICT (add/add): Merge conflict in add-differently
Automatic merge failed; fix conflicts and then commit the result.
ok 10 - non-qualified update in subdir updates from the root

expecting success: 

	rm foo &&
	test_ln_s_add top foo


error: no remembered resolution for add-differently
ok 10 - rerere forget (add-add conflict)

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

)
# passed all 10 test(s)
1..10
Cloning into 'sub1'...
prerequisite SYMLINKS ok
*** t2201-add-update-typechange.sh ***
ok 11 - replace a file with a symlink

expecting success: 

	git add -u &&
	test -z "$(git diff-files)"


ok 12 - add everything changed

expecting success: 

	touch check &&
	git add -u &&
	test -z "$(git diff-files)"


done.
*** t2202-add-addremove.sh ***
ok 13 - touch and then add -u

expecting success: 

	touch check &&
	git add check &&
	test -z "$(git diff-files)"


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2201-add-update-typechange/.git/
ok 14 - touch and then add explicitly

expecting success: 

	(
		echo "add 'check'" &&
		echo "remove 'top'"
	) >expect &&
	before=$(git ls-files -s check top) &&
	echo changed >>check &&
	rm -f top &&
	git add -n -u >actual &&
	after=$(git ls-files -s check top) &&

	test "$before" = "$after" &&
	test_i18ncmp expect actual


expecting success: 
	>xyzzy &&
	_empty=$(git hash-object --stdin <xyzzy) &&
	>yomin &&
	>caskly &&
	if test_have_prereq SYMLINKS; then
		ln -s frotz nitfol &&
		T_letter=T
	else
		printf %s frotz > nitfol &&
		T_letter=M
	fi &&
	mkdir rezrov &&
	>rezrov/bozbar &&
	git add caskly xyzzy yomin nitfol rezrov/bozbar &&

	test_tick &&
	git commit -m initial


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
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2202-add-addremove/.git/
ok 15 - add -n -u should not add but just report

expecting success: 
	git reset --hard &&
	one=$(echo 1 | git hash-object -w --stdin) &&
	two=$(echo 2 | git hash-object -w --stdin) &&
	three=$(echo 3 | git hash-object -w --stdin) &&
	{
		for path in path1 path2
		do
			echo "100644 $one 1	$path"
			echo "100644 $two 2	$path"
			echo "100644 $three 3	$path"
		done
		echo "100644 $one 1	path3"
		echo "100644 $one 1	path4"
		echo "100644 $one 3	path5"
		echo "100644 $one 3	path6"
	} |
	git update-index --index-info &&
	echo 3 >path1 &&
	echo 2 >path3 &&
	echo 2 >path5 &&

	# Fail to explicitly resolve removed paths with "git add"
	test_must_fail git add --no-all path4 &&
	test_must_fail git add --no-all path6 &&

	# "add -u" should notice removals no matter what stages
	# the index entries are in.
	git add -u &&
	git ls-files -s path1 path2 path3 path4 path5 path6 >actual &&
	{
		echo "100644 $three 0	path1"
		echo "100644 $two 0	path3"
		echo "100644 $two 0	path5"
	} >expect &&
	test_cmp expect actual

expecting success: 
	(
		echo .gitignore
		echo will-remove
	) >expect &&
	(
		echo actual
		echo expect
		echo ignored
	) >.gitignore &&
	git --literal-pathspecs add --all &&
	>will-remove &&
	git add --all &&
	test_tick &&
	git commit -m initial &&
	git ls-files >actual &&
	test_cmp expect actual

HEAD is now at ec46c19 initial
Submodule path 'sub1': checked out '3950f7ed37a2b5b8e95094de1b49ceba8eecb3d9'
[master (root-commit) 8dc0761] initial
 Author: A U Thor <author@example.com>
 5 files changed, 1 insertion(+)
 create mode 100644 caskly
 create mode 120000 nitfol
 create mode 100644 rezrov/bozbar
 create mode 100644 xyzzy
 create mode 100644 yomin
ok 1 - setup

expecting success: 
	rm -f xyzzy yomin nitfol caskly &&
	# caskly disappears (not a submodule)
	mkdir caskly &&
	# nitfol changes from symlink to regular
	>nitfol &&
	# rezrov/bozbar disappears
	rm -fr rezrov &&
	if test_have_prereq SYMLINKS; then
		ln -s xyzzy rezrov
	else
		printf %s xyzzy > rezrov
	fi &&
	# xyzzy disappears (not a submodule)
	mkdir xyzzy &&
	echo gnusto >xyzzy/bozbar &&
	# yomin gets replaced with a submodule
	mkdir yomin &&
	>yomin/yomin &&
	(
		cd yomin &&
		git init &&
		git add yomin &&
		git commit -m "sub initial"
	) &&
	yomin=$(GIT_DIR=yomin/.git git rev-parse HEAD) &&
	# yonk is added and then turned into a submodule
	# this should appear as T in diff-files and as A in diff-index
	>yonk &&
	git add yonk &&
	rm -f yonk &&
	mkdir yonk &&
	>yonk/yonk &&
	(
		cd yonk &&
		git init &&
		git add yonk &&
		git commit -m "sub initial"
	) &&
	yonk=$(GIT_DIR=yonk/.git git rev-parse HEAD) &&
	# zifmia is added and then removed
	# this should appear in diff-files but not in diff-index.
	>zifmia &&
	git add zifmia &&
	rm -f zifmia &&
	mkdir zifmia &&
	{
		git ls-tree -r HEAD |
		sed -e "s/^/:/" -e "
			/	caskly/{
				s/	caskly/ $_z40 D&/
				s/blob/000000/
			}
			/	nitfol/{
				s/	nitfol/ $_z40 $T_letter&/
				s/blob/100644/
			}
			/	rezrov.bozbar/{
				s/	rezrov.bozbar/ $_z40 D&/
				s/blob/000000/
			}
			/	xyzzy/{
				s/	xyzzy/ $_z40 D&/
				s/blob/000000/
			}
			/	yomin/{
			    s/	yomin/ $_z40 T&/
				s/blob/160000/
			}
		"
	} >expect &&
	{
		cat expect
		echo ":100644 160000 $_empty $_z40 T	yonk"
		echo ":100644 000000 $_empty $_z40 D	zifmia"
	} >expect-files &&
	{
		cat expect
		echo ":000000 160000 $_z40 $_z40 A	yonk"
	} >expect-index &&
	{
		echo "100644 $_empty 0	nitfol"
		echo "160000 $yomin 0	yomin"
		echo "160000 $yonk 0	yonk"
	} >expect-final

[master (root-commit) 50dd5d8] initial
 Author: A U Thor <author@example.com>
 2 files changed, 3 insertions(+)
 create mode 100644 .gitignore
 create mode 100644 will-remove
ok 1 - setup

expecting success: 
	(
		echo .gitignore
		echo not-ignored
		echo "M	.gitignore"
		echo "A	not-ignored"
		echo "D	will-remove"
	) >expect &&
	>ignored &&
	>not-ignored &&
	echo modification >>.gitignore &&
	rm -f will-remove &&
	git add --all &&
	git update-index --refresh &&
	git ls-files >actual &&
	git diff-index --name-status --cached HEAD >>actual &&
	test_cmp expect actual

fatal: unable to stat 'path4': No such file or directory
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2201-add-update-typechange/yomin/.git/
fatal: unable to stat 'path6': No such file or directory
[master (root-commit) 9da2848] sub initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 yomin
ok 16 - add -u resolves unmerged paths

expecting success: 
	test_must_fail git add -u non-existent &&
	! (git ls-files | grep "non-existent")

ok 2 - git add --all

expecting success: 
	git reset --hard &&
	echo >will-remove &&
	>will-not-be-added &&
	git add &&
	git diff-index --name-status --cached HEAD >actual &&
	>expect &&
	test_cmp expect actual

fatal: pathspec 'non-existent' did not match any files
ok 20 - git checkout: 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 17 - "add -u non-existent" should fail

HEAD is now at 50dd5d8 initial
# passed all 17 test(s)
1..17
Nothing specified, nothing added.
Maybe you wanted to say 'git add .'?
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2201-add-update-typechange/yonk/.git/
ok 3 - Just "git add" is a no-op

# passed all 3 test(s)
1..3
*** t2203-add-intent.sh ***
[master (root-commit) 9cc3160] sub initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 yonk
*** t2204-add-ignored.sh ***
Cloning into 'submodule_update'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2203-add-intent/.git/
done.
expecting success: 
	echo hello >file &&
	echo hello >elif &&
	git add -N file &&
	git add elif

ok 2 - modify

expecting success: 
	git diff-files --raw >actual &&
	test_cmp expect-files actual

ok 3 - diff-files

expecting success: 
	git diff-index --raw HEAD -- >actual &&
	test_cmp expect-index actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2204-add-ignored/.git/
ok 1 - intent to add

expecting success: 
	git ls-files -s file >actual &&
	empty=$(git hash-object --stdin </dev/null) &&
	echo "100644 $empty 0	file" >expect &&
	test_cmp expect actual

expecting success: 
	mkdir sub dir dir/sub &&
	echo sub >.gitignore &&
	echo ign >>.gitignore &&
	for p in . sub dir dir/sub
	do
		>"$p/ign" &&
		>"$p/file" || exit 1
	done

Switched to a new branch 'no_submodule'
ok 4 - diff-index

Branch no_submodule set up to track remote branch no_submodule from origin.
expecting success: 
	rm -f ".git/saved-index" &&
	cp -p ".git/index" ".git/saved-index" &&
	git add -u &&
	git ls-files -s >actual &&
	test_cmp expect-final actual

ok 1 - setup

expecting success: 
		rm -f .git/index &&
		git add "$i" &&
		git ls-files "$i" >out &&
		test -s out
	
ok 2 - check result of "add -N"

expecting success: 
	git add -u &&
	git ls-files -s file >actual &&
	git ls-files -s elif | sed -e "s/elif/file/" >expect &&
	test_cmp expect actual

ok 2 - no complaints for unignored file

expecting success: 
		rm -f .git/index &&
		git add "$i" &&
		git ls-files "$i" >out &&
		test -s out
	
ok 5 - add -u

expecting success: 
	if test -f ".git/saved-index"
	then
		rm -f ".git/index" &&
		mv ".git/saved-index" ".git/index"
	fi &&
	git commit -m "second" -a &&
	git ls-files -s >actual &&
	test_cmp expect-final actual &&
	rm -f .git/index &&
	git read-tree HEAD &&
	git ls-files -s >actual &&
	test_cmp expect-final actual

Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 3 - intent to add is just an ordinary empty blob

expecting success: 
	git add -N file elif &&
	empty=$(git hash-object --stdin </dev/null) &&
	git ls-files -s >actual &&
	! grep "$empty" actual

Switched to branch 'add_sub1'
Your branch is up-to-date with 'origin/add_sub1'.
ok 3 - no complaints for unignored dir/file

expecting success: 
		rm -f .git/index &&
		git add "$i" &&
		git ls-files "$i" >out &&
		test -s out
	
[master 0f3d2ce] second
 Author: A U Thor <author@example.com>
 5 files changed, 2 insertions(+)
 delete mode 100644 caskly
 rename xyzzy => nitfol (100%)
 delete mode 100644 rezrov/bozbar
 mode change 100644 => 160000 yomin
 create mode 160000 yonk
ok 4 - intent to add does not clobber existing paths

expecting success: 
	test_tick &&
	git commit -a -m initial &&
	git reset --hard &&

	echo xyzzy >rezrov &&
	echo frotz >nitfol &&
	git add rezrov &&
	git add -N nitfol &&
	git commit -m second &&
	test $(git ls-tree HEAD -- nitfol | wc -l) = 0 &&
	test $(git diff --name-only HEAD -- nitfol | wc -l) = 1

ok 4 - no complaints for unignored dir

expecting success: 
		rm -f .git/index &&
		git add "$i" &&
		git ls-files "$i" >out &&
		test -s out
	
[master (root-commit) 98bc6e7] initial
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 elif
 create mode 100644 file
ok 5 - no complaints for unignored d*

expecting success: 
		rm -f .git/index &&
		test_must_fail git add "$i" 2>err &&
		git ls-files "$i" >out &&
		! test -s out
	
ok 6 - commit -a

HEAD is now at 98bc6e7 initial
# passed all 6 test(s)
1..6
ok 6 - complaints for ignored ign

expecting success: 
		test_i18ngrep -e "Use -f if" err
	
Use -f if you really want to add them.
ok 7 - complaints for ignored ign output

expecting success: 
		rm -f .git/index &&
		test_must_fail git add "$i" file 2>err &&
		git ls-files "$i" >out &&
		! test -s out
	
ok 8 - complaints for ignored ign with unignored file

expecting success: 
		test_i18ngrep -e "Use -f if" err
	
[master 0b15181] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 rezrov
Use -f if you really want to add them.
ok 9 - complaints for ignored ign with unignored file output

expecting success: 
		rm -f .git/index &&
		test_must_fail git add "$i" 2>err &&
		git ls-files "$i" >out &&
		! test -s out
	
*** t2300-cd-to-toplevel.sh ***
ok 10 - complaints for ignored dir/ign

expecting success: 
		test_i18ngrep -e "Use -f if" err
	
ok 5 - i-t-a entry is simply ignored

expecting success: 
	git reset --hard &&
	echo bozbar >rezrov &&
	echo frotz >nitfol &&
	git add rezrov &&
	git add -N nitfol &&
	git commit -m partial rezrov

Use -f if you really want to add them.
ok 11 - complaints for ignored dir/ign output

expecting success: 
		rm -f .git/index &&
		test_must_fail git add "$i" file 2>err &&
		git ls-files "$i" >out &&
		! test -s out
	
HEAD is now at 0b15181 second
ok 12 - complaints for ignored dir/ign with unignored file

expecting success: 
		test_i18ngrep -e "Use -f if" err
	
Use -f if you really want to add them.
ok 13 - complaints for ignored dir/ign with unignored file output

expecting success: 
		rm -f .git/index &&
		test_must_fail git add "$i" 2>err &&
		git ls-files "$i" >out &&
		! test -s out
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t2300-cd-to-toplevel/.git/
[master 71ea372] partial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 6 - can commit with an unrelated i-t-a entry in index

expecting success: 
	git reset --hard &&
	: >nitfol &&
	git add -N nitfol &&
	git commit -a -m all

ok 14 - complaints for ignored dir/sub

expecting success: 
		test_i18ngrep -e "Use -f if" err
	
expecting success: 
		(
			cd 'repo' &&
			. "$(git --exec-path)"/git-sh-setup &&
			cd_to_toplevel &&
			[ "$(pwd -P)" = "$TOPLEVEL" ]
		)
	
Use -f if you really want to add them.
ok 15 - complaints for ignored dir/sub output

expecting success: 
		rm -f .git/index &&
		test_must_fail git add "$i" file 2>err &&
		git ls-files "$i" >out &&
		! test -s out
	
HEAD is now at 71ea372 partial
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 16 - complaints for ignored dir/sub with unignored file

expecting success: 
		test_i18ngrep -e "Use -f if" err
	
Use -f if you really want to add them.
ok 17 - complaints for ignored dir/sub with unignored file output

expecting success: 
		rm -f .git/index &&
		test_must_fail git add "$i" 2>err &&
		git ls-files "$i" >out &&
		! test -s out
	
[master 355d98b] all
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 nitfol
ok 7 - can "commit -a" with an i-t-a entry

expecting success: 
	git reset --hard &&
	mkdir dir &&
	: >dir/foo &&
	git add dir/foo &&
	git commit -m foo &&

	: >dir/bar &&
	git add -N dir/bar &&
	git diff --cached --name-only >actual &&
	echo dir/bar >expect &&
	test_cmp expect actual &&

	git write-tree >/dev/null &&

	git diff --cached --name-only >actual &&
	echo dir/bar >expect &&
	test_cmp expect actual

ok 1 - at physical root

expecting success: 
		(
			cd 'repo/sub/dir' &&
			. "$(git --exec-path)"/git-sh-setup &&
			cd_to_toplevel &&
			[ "$(pwd -P)" = "$TOPLEVEL" ]
		)
	
HEAD is now at 355d98b all
ok 18 - complaints for ignored dir/sub/ign

expecting success: 
		test_i18ngrep -e "Use -f if" err
	
Use -f if you really want to add them.
ok 19 - complaints for ignored dir/sub/ign output

expecting success: 
		rm -f .git/index &&
		test_must_fail git add "$i" file 2>err &&
		git ls-files "$i" >out &&
		! test -s out
	
ok 20 - complaints for ignored dir/sub/ign with unignored file

expecting success: 
		test_i18ngrep -e "Use -f if" err
	
[master de38f05] foo
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 dir/foo
Use -f if you really want to add them.
ok 21 - complaints for ignored dir/sub/ign with unignored file output

expecting success: 
		rm -f .git/index &&
		test_must_fail git add "$i" 2>err &&
		git ls-files "$i" >out &&
		! test -s out
	
ok 2 - at physical subdir

Cloning into 'sub1'...
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 22 - complaints for ignored sub/file

expecting success: 
		test_i18ngrep -e "Use -f if" err
	
Use -f if you really want to add them.
ok 23 - complaints for ignored sub/file output

expecting success: 
		rm -f .git/index &&
		test_must_fail git add "$i" file 2>err &&
		git ls-files "$i" >out &&
		! test -s out
	
done.
prerequisite SYMLINKS ok
expecting success: 
		(
			cd 'symrepo' &&
			. "$(git --exec-path)"/git-sh-setup &&
			cd_to_toplevel &&
			[ "$(pwd -P)" = "$TOPLEVEL" ]
		)
	
ok 24 - complaints for ignored sub/file with unignored file

expecting success: 
		test_i18ngrep -e "Use -f if" err
	
Use -f if you really want to add them.
ok 25 - complaints for ignored sub/file with unignored file output

expecting success: 
		rm -f .git/index &&
		test_must_fail git add "$i" 2>err &&
		git ls-files "$i" >out &&
		! test -s out
	
ok 8 - cache-tree invalidates i-t-a paths

# passed all 8 test(s)
1..8
ok 26 - complaints for ignored sub

expecting success: 
		test_i18ngrep -e "Use -f if" err
	
Use -f if you really want to add them.
ok 27 - complaints for ignored sub output

expecting success: 
		rm -f .git/index &&
		test_must_fail git add "$i" file 2>err &&
		git ls-files "$i" >out &&
		! test -s out
	
*** t3000-ls-files-others.sh ***
ok 3 - at symbolic root

ok 28 - complaints for ignored sub with unignored file

expecting success: 
		test_i18ngrep -e "Use -f if" err
	
expecting success: 
		(
			cd 'subdir-link' &&
			. "$(git --exec-path)"/git-sh-setup &&
			cd_to_toplevel &&
			[ "$(pwd -P)" = "$TOPLEVEL" ]
		)
	
Use -f if you really want to add them.
ok 29 - complaints for ignored sub with unignored file output

expecting success: 
		rm -f .git/index &&
		test_must_fail git add "$i" 2>err &&
		git ls-files "$i" >out &&
		! test -s out
	
ok 30 - complaints for ignored sub/file

expecting success: 
		test_i18ngrep -e "Use -f if" err
	
Use -f if you really want to add them.
ok 31 - complaints for ignored sub/file output

expecting success: 
		rm -f .git/index &&
		test_must_fail git add "$i" file 2>err &&
		git ls-files "$i" >out &&
		! test -s out
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3000-ls-files-others/.git/
Submodule path 'sub1': checked out '3950f7ed37a2b5b8e95094de1b49ceba8eecb3d9'
ok 32 - complaints for ignored sub/file with unignored file

expecting success: 
		test_i18ngrep -e "Use -f if" err
	
expecting success: 
	date >path0 &&
	if test_have_prereq SYMLINKS
	then
		ln -s xyzzy path1
	else
		date >path1
	fi &&
	mkdir path2 path3 path4 &&
	date >path2/file2 &&
	date >path2-junk &&
	date >path3/file3 &&
	date >path3-junk &&
	git update-index --add path3-junk path3/file3

Use -f if you really want to add them.
ok 33 - complaints for ignored sub/file with unignored file output

expecting success: 
		rm -f .git/index &&
		test_must_fail git add "$i" 2>err &&
		git ls-files "$i" >out &&
		! test -s out
	
ok 4 - at symbolic subdir

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

)
expecting success: 
		(
			cd 'internal-link' &&
			. "$(git --exec-path)"/git-sh-setup &&
			cd_to_toplevel &&
			[ "$(pwd -P)" = "$TOPLEVEL" ]
		)
	
prerequisite SYMLINKS ok
ok 34 - complaints for ignored sub/ign

expecting success: 
		test_i18ngrep -e "Use -f if" err
	
Use -f if you really want to add them.
ok 35 - complaints for ignored sub/ign output

expecting success: 
		rm -f .git/index &&
		test_must_fail git add "$i" file 2>err &&
		git ls-files "$i" >out &&
		! test -s out
	
ok 1 - setup 

expecting success: 
	cat >expected1 <<-\EOF &&
	expected1
	expected2
	expected3
	output
	path0
	path1
	path2-junk
	path2/file2
	EOF

	sed -e "s|path2/file2|path2/|" <expected1 >expected2 &&
	cp expected2 expected3 &&
	echo path4/ >>expected2

ok 36 - complaints for ignored sub/ign with unignored file

expecting success: 
		test_i18ngrep -e "Use -f if" err
	
Use -f if you really want to add them.
ok 37 - complaints for ignored sub/ign with unignored file output

expecting success: 
		rm -f .git/index &&
		(
			cd dir &&
			test_must_fail git add "$i" 2>err &&
			git ls-files "$i" >out &&
			! test -s out
		)
	
ok 5 - at internal symbolic subdir

ok 2 - setup: expected output

expecting success: 
	git ls-files --others >output &&
	test_cmp expected1 output

# passed all 5 test(s)
1..5
ok 3 - ls-files --others

expecting success: 
	git ls-files --others --directory >output &&
	test_cmp expected2 output

ok 38 - complaints for ignored sub in dir

expecting success: 
		(
			cd dir &&
			test_i18ngrep -e "Use -f if" err
		)
	
*** t3001-ls-files-others-exclude.sh ***
Use -f if you really want to add them.
ok 21 - git checkout -f: added submodule creates empty directory
ok 4 - ls-files --others --directory


expecting success: 
	git ls-files --others --directory --no-empty-directory >output &&
	test_cmp expected3 output

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
		)
	
ok 39 - complaints for ignored sub in dir output

expecting success: 
		rm -f .git/index &&
		(
			cd dir &&
			test_must_fail git add "$i" 2>err &&
			git ls-files "$i" >out &&
			! test -s out
		)
	
ok 5 - --no-empty-directory hides empty directory

expecting success: 
	git init super &&
	git init sub &&
	(
		cd sub &&
		>a &&
		git add a &&
		git commit -m sub &&
		git pack-refs --all
	) &&
	(
		cd super &&
		"$SHELL_PATH" "$TEST_DIRECTORY/../contrib/workdir/git-new-workdir" ../sub sub
		git ls-files --others --exclude-standard >../actual
	) &&
	echo sub/ >expect &&
	test_cmp expect actual

ok 40 - complaints for ignored sub/file in dir

expecting success: 
		(
			cd dir &&
			test_i18ngrep -e "Use -f if" err
		)
	
Use -f if you really want to add them.
ok 41 - complaints for ignored sub/file in dir output

expecting success: 
		rm -f .git/index &&
		(
			cd dir &&
			test_must_fail git add "$i" 2>err &&
			git ls-files "$i" >out &&
			! test -s out
		)
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3000-ls-files-others/super/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3000-ls-files-others/sub/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3001-ls-files-others-exclude/.git/
ok 42 - complaints for ignored sub/ign in dir

expecting success: 
		(
			cd dir &&
			test_i18ngrep -e "Use -f if" err
		)
	
Use -f if you really want to add them.
ok 43 - complaints for ignored sub/ign in dir output

expecting success: 
		rm -f .git/index &&
		(
			cd sub &&
			test_must_fail git add "$i" 2>err &&
			git ls-files "$i" >out &&
			! test -s out
		)
	
[master (root-commit) d111325] sub
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 a
ok 44 - complaints for ignored ign in sub

expecting success: 
		(
			cd sub &&
			test_i18ngrep -e "Use -f if" err
		)
	
Cloning into 'submodule_update'...
expecting success: git ls-files --others \
       --exclude=\*.6 \
       --exclude-per-directory=.gitignore \
       --exclude-from=.git/ignore \
       >output &&
     test_cmp expect output
Use -f if you really want to add them.
ok 45 - complaints for ignored ign in sub output

expecting success: 
		rm -f .git/index &&
		(
			cd sub &&
			test_must_fail git add "$i" 2>err &&
			git ls-files "$i" >out &&
			! test -s out
		)
	
ok 1 - git ls-files --others with various exclude options.

expecting success: git ls-files --others \
       --exclude=\*.6 \
       --exclude-per-directory=.gitignore \
       --exclude-from=.git/ignore \
       >output &&
     test_cmp expect output
ok 46 - complaints for ignored file in sub

expecting success: 
		(
			cd sub &&
			test_i18ngrep -e "Use -f if" err
		)
	
ok 2 - git ls-files --others with \r\n line endings.

expecting success: 
	git add $allignores &&
	git update-index --skip-worktree $allignores &&
	rm $allignores

Use -f if you really want to add them.
ok 47 - complaints for ignored file in sub output

done.
# passed all 47 test(s)
1..47
ok 3 - setup skip-worktree gitignore

expecting success: git ls-files --others \
       --exclude=\*.6 \
       --exclude-per-directory=.gitignore \
       --exclude-from=.git/ignore \
       >output &&
     test_cmp expect output
*** t3002-ls-files-dashpath.sh ***
ok 4 - git ls-files --others with various exclude options.

expecting success: 
	git checkout --ignore-skip-worktree-bits $allignores &&
	rm .git/index

Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
ok 6 - ls-files --others with symlinked submodule

ok 5 - restore gitignore

# passed all 6 test(s)
1..6
expecting success: test_cmp expect output
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 6 - git status honors core.excludesfile

expecting success: 

	git ls-files --others --exclude=one/ >output &&
	if grep "^one/" output
	then
		echo Ooops
		false
	else
		: happy
	fi


ok 7 - trailing slash in exclude allows directory match(1)

expecting success: 

	git ls-files --others --exclude=one/two/ >output &&
	if grep "^one/two/" output
	then
		echo Ooops
		false
	else
		: happy
	fi


Switched to branch 'add_sub1'
Your branch is up-to-date with 'origin/add_sub1'.
*** t3003-ls-files-exclude.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3002-ls-files-dashpath/.git/
ok 8 - trailing slash in exclude allows directory match (2)

expecting success: 

	>two &&
	git ls-files --others --exclude=two/ >output &&
	grep "^two" output


expecting success: echo frotz >path0 &&
	echo frotz >./-foo &&
	echo frotz >./--
ok 1 - setup

expecting success: git ls-files --others >output &&
     test_cmp output - <<EOF
--
-foo
output
path0
EOF

two
ok 9 - trailing slash in exclude forces directory match (1)

expecting success: 

	git ls-files --others --exclude=one/a.1/ >output &&
	grep "^one/a.1" output


ok 2 - git ls-files without path restriction.

expecting success: git ls-files --others path0 >output &&
	test_cmp output - <<EOF
path0
EOF

one/a.1
ok 10 - trailing slash in exclude forces directory match (2)

expecting success: 

	git ls-files --others --exclude="a.*" --exclude="!a.1" >output &&
	grep "^a.1" output

ok 3 - git ls-files with path restriction.

expecting success: git ls-files --others -- path0 >output &&
	test_cmp output - <<EOF
path0
EOF

a.1
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3003-ls-files-exclude/.git/
ok 11 - negated exclude matches can override previous ones

expecting success: 

	git ls-files --others --exclude="one" --exclude="!one/a.1" >output &&
	if grep "^one/a.1" output
	then
		false
	fi

expecting success: 
	echo content >file &&
	git add file &&
	git commit -m file &&
	echo modification >file

ok 4 - git ls-files with path restriction with --.

expecting success: git ls-files --others -- -- >output &&
	test_cmp output - <<EOF
--
EOF

ok 12 - excluded directory overrides content patterns

expecting success: 

	git ls-files --others --exclude="!one" --exclude="one/a.1" >output &&
	if grep "^one/a.1" output
	then
		false
	fi

ok 5 - git ls-files with path restriction with -- --.

expecting success: git ls-files --others -- >output &&
	test_cmp output - <<EOF
--
-foo
output
path0
EOF

ok 13 - negated directory doesn't affect content patterns

expecting success: 
	mkdir -p top/l1/l2 &&
	(
		cd top &&
		git init &&
		echo /.gitignore >.gitignore &&
		echo l1 >>.gitignore &&
		echo l2 >l1/.gitignore &&
		>l1/l2/l1
	)

[master (root-commit) e7079a7] file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 1 - create repo with file

expecting success: 
	echo 'file' >expect &&
	git ls-files --exclude-standard --cached >output &&
	test_cmp expect output

ok 6 - git ls-files with no path restriction.

# passed all 6 test(s)
1..6
ok 2 - ls-files output contains file (cached)

expecting success: 
	echo 'file' >expect &&
	git ls-files --exclude-standard --modified >output &&
	test_cmp expect output

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3001-ls-files-others-exclude/top/.git/
ok 14 - subdirectory ignore (setup)

expecting success: 
	(
		cd top &&
		git ls-files -o --exclude-standard
	) >actual &&
	>expect &&
	test_cmp expect actual

ok 3 - ls-files output contains file (modified)

expecting success: 
	echo file >.gitignore

ok 4 - add file to gitignore

expecting success: 
	echo 'file' >expect &&
	git ls-files --exclude-standard --cached >output &&
	test_cmp expect output

*** t3004-ls-files-basic.sh ***
ok 15 - subdirectory ignore (toplevel)

expecting success: 
	(
		cd top/l1/l2 &&
		git ls-files -o --exclude-standard
	) >actual &&
	>expect &&
	test_cmp expect actual

ok 5 - ls-files output contains file (cached)

expecting success: 
	echo 'file' >expect &&
	git ls-files --exclude-standard --modified >output &&
	test_cmp expect output

ok 16 - subdirectory ignore (l1/l2)

expecting success: 
	(
		cd top/l1 &&
		git ls-files -o --exclude-standard
	) >actual &&
	>expect &&
	test_cmp expect actual

ok 6 - ls-files output contains file (modified)

expecting success: 
	echo content >other-file &&
	git add other-file &&
	echo file >expect &&
	git ls-files -i --exclude-standard >output &&
	test_cmp expect output

ok 17 - subdirectory ignore (l1)

expecting success: 
	rm top/l1/l2/l1 &&
	rm top/l1/.gitignore

ok 18 - show/hide empty ignored directory (setup)

expecting success: 
	(
		cd top &&
		git ls-files -o -i --exclude l1 --directory
	) >actual &&
	echo l1/ >expect &&
	test_cmp expect actual

ok 7 - ls-files -i lists only tracked-but-ignored files

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 19 - show empty ignored directory with --directory

expecting success: 
	(
		cd top &&
		git ls-files -o -i --exclude l1 --directory --no-empty-directory
	) >actual &&
	>expect &&
	test_cmp expect actual

# passed all 7 test(s)
1..7
ok 20 - hide empty ignored directory with --no-empty-directory

expecting success: 
	> top/l1/tracked &&
	(
		cd top &&
		git add -f l1/tracked
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3004-ls-files-basic/.git/
*** t3005-ls-files-relative.sh ***
ok 21 - show/hide empty ignored sub-directory (setup)

expecting success: 
	(
		cd top &&
		git ls-files -o -i --exclude l1 --directory
	) >actual &&
	echo l1/l2/ >expect &&
	test_cmp expect actual

expecting success: 
	git ls-files >actual &&
	test_cmp empty actual

ok 22 - show empty ignored sub-directory with --directory

expecting success: 
	(
		cd top &&
		git ls-files -o -i --exclude l1 --directory --no-empty-directory
	) >actual &&
	>expect &&
	test_cmp expect actual

ok 1 - ls-files in empty repository

expecting success: 
	git ls-files doesnotexist >actual &&
	test_cmp empty actual

ok 23 - hide empty ignored sub-directory with --no-empty-directory

expecting success: 
	: >expect &&
	git ls-files -i -o --exclude "/three/a.3[abc]" >actual &&
	test_cmp expect actual

ok 2 - ls-files with nonexistent path

expecting success: 
	test_expect_code 129 git ls-files --nonsense 2>actual &&
	test_i18ngrep "[Uu]sage: git ls-files" actual

ok 24 - pattern matches prefix completely

expecting success: 
	cat <<\EOF >expect &&
a.1
one/a.1
one/two/a.1
three/a.1
EOF
	git ls-files -o -i --exclude "**/a.1" >actual &&
	test_cmp expect actual

usage: git ls-files [<options>] [<file>...]
ok 3 - ls-files with nonsense option

Cloning into 'sub1'...
expecting success: 
	mkdir broken &&
	(
		cd broken &&
		git init &&
		>.git/index &&
		test_expect_code 129 git ls-files -h >usage 2>&1
	) &&
	test_i18ngrep "[Uu]sage: git ls-files " broken/usage

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3005-ls-files-relative/.git/
ok 25 - ls-files with "**" patterns

expecting success: 
	: >expect &&
	git ls-files -o -i --exclude "one**a.1" >actual &&
	test_cmp expect actual

expecting success: 
	: >never-mind-me &&
	git add never-mind-me &&
	mkdir top &&
	(
		cd top &&
		mkdir sub &&
		x="x xa xbc xdef xghij xklmno" &&
		y=$(echo "$x" | tr x y) &&
		touch $x &&
		touch $y &&
		cd sub &&
		git add ../x*
	)

ok 26 - ls-files with "**" patterns and no slashes

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3004-ls-files-basic/broken/.git/
# passed all 26 test(s)
1..26
done.
usage: git ls-files [<options>] [<file>...]
ok 4 - ls-files -h in corrupt repository

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: 
	mkdir subs &&
	ln -s nosuch link &&
	ln -s ../nosuch subs/link &&
	git add link subs/link &&
	git ls-files -s link subs/link >expect &&
	git ls-files -s "$(pwd)/link" "$(pwd)/subs/link" >actual &&
	test_cmp expect actual &&

	(
		cd subs &&
		git ls-files -s link >../expect &&
		git ls-files -s "$(pwd)/link" >../actual
	) &&
	test_cmp expect actual

ok 1 - prepare

expecting success: 
	(
		cd top/sub &&
		cat >expect <<-EOF &&
		../../never-mind-me
		../x
		EOF
		git ls-files $(cat expect) >actual &&
		test_cmp expect actual
	)

*** t3006-ls-files-long.sh ***
ok 2 - ls-files with mixed levels

expecting success: 
	(
		cd top/sub &&
		for f in ../y*
		do
			echo "error: pathspec $sq$f$sq did not match any file(s) known to git."
		done >expect.err &&
		echo "Did you forget to ${sq}git add${sq}?" >>expect.err &&
		ls ../x* >expect.out &&
		test_must_fail git ls-files -c --error-unmatch ../[xy]* >actual.out 2>actual.err &&
		test_cmp expect.out actual.out &&
		test_cmp expect.err actual.err
	)

ok 3 - ls-files -c

expecting success: 
	(
		cd top/sub &&
		for f in ../x*
		do
			echo "error: pathspec $sq$f$sq did not match any file(s) known to git."
		done >expect.err &&
		echo "Did you forget to ${sq}git add${sq}?" >>expect.err &&
		ls ../y* >expect.out &&
		test_must_fail git ls-files -o --error-unmatch ../[xy]* >actual.out 2>actual.err &&
		test_cmp expect.out actual.out &&
		test_cmp expect.err actual.err
	)

ok 4 - ls-files -o

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3006-ls-files-long/.git/
# passed all 4 test(s)
1..4
expecting success: 
	p=filefilefilefilefilefilefilefile &&
	p=$p$p$p$p$p$p$p$p$p$p$p$p$p$p$p$p &&
	p=$p$p$p$p$p$p$p$p$p$p$p$p$p$p$p$p &&

	path_a=${p}_a &&
	path_z=${p}_z &&

	blob_a=$(echo frotz | git hash-object -w --stdin) &&
	blob_z=$(echo nitfol | git hash-object -w --stdin) &&

	pat="100644 %s 0\t%s\n"

ok 5 - ls-files with absolute paths to symlinks

Submodule path 'sub1': checked out '3950f7ed37a2b5b8e95094de1b49ceba8eecb3d9'
# passed all 5 test(s)
1..5
*** t3010-ls-files-killed-modified.sh ***
ok 1 - setup

expecting success: 
	printf "$pat" "$blob_a" "$path_a" |
	git update-index --add --index-info &&
	echo "$path_a" >expect &&
	git ls-files >actual &&
	test_cmp expect actual

*** t3020-ls-files-error-unmatch.sh ***
ok 2 - overly-long path by itself is not a problem

expecting success: 
	printf "$pat" "$blob_a" "$path_a" "$blob_z" "$path_z" |
	git update-index --add --index-info &&
	(
		echo "$path_a"
		echo "$path_z"
	) >expect &&
	git ls-files >actual &&
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3010-ls-files-killed-modified/.git/
ok 3 - overly-long path does not replace another by mistake

expecting success: 
	date >path0 &&
	test_ln_s_add xyzzy path1 &&
	mkdir path2 path3 pathx &&
	date >path2/file2 &&
	date >path3/file3 &&
	>pathx/ju &&
	: >path7 &&
	date >path8 &&
	: >path9 &&
	date >path10 &&
	git update-index --add -- path0 path?/file? pathx/ju path7 path8 path9 path10 &&
	git init submod1 &&
	git -C submod1 commit --allow-empty -m "empty 1" &&
	git init submod2 &&
	git -C submod2 commit --allow-empty -m "empty 2" &&
	git update-index --add submod[12] &&
	(
		cd submod1 &&
		git commit --allow-empty -m "empty 1 (updated)"
	) &&
	rm -fr path?	# leave path10 alone

# passed all 3 test(s)
1..3
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.t3020-ls-files-error-unmatch/.git/
prerequisite SYMLINKS ok
ok 22 - git checkout -f: 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 &&
			$command add_sub1 &&
			test_superproject_content origin/add_sub1 &&
			test_dir_is_empty sub1
		)
	
expecting success: 
	touch foo bar &&
	git update-index --add foo bar &&
	git commit -m "add foo bar"

*** t3030-merge-recursive.sh ***
[master (root-commit) 6436403] add foo bar
 Author: A U Thor <author@example.com>
 2 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 bar
 create mode 100644 foo
ok 1 - setup

expecting success: test_must_fail git ls-files --error-unmatch foo bar-does-not-match
error: pathspec 'bar-does-not-match' did not match any file(s) known to git.
Did you forget to 'git add'?
foo
ok 2 - git ls-files --error-unmatch should fail with unmatched path.

expecting success: git ls-files --error-unmatch foo bar
bar
foo
ok 3 - git ls-files --error-unmatch should succeed with matched paths.

# passed all 3 test(s)
1..3
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3030-merge-recursive/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3010-ls-files-killed-modified/submod1/.git/
expecting success: 

	echo hello >a &&
	o0=$(git hash-object a) &&
	cp a b &&
	cp a c &&
	mkdir d &&
	cp a d/e &&

	test_tick &&
	git add a b c d/e &&
	git commit -m initial &&
	c0=$(git rev-parse --verify HEAD) &&
	git branch side &&
	git branch df-1 &&
	git branch df-2 &&
	git branch df-3 &&
	git branch remove &&
	git branch submod &&
	git branch copy &&
	git branch rename &&
	git branch rename-ln &&

	echo hello >>a &&
	cp a d/e &&
	o1=$(git hash-object a) &&

	git add a d/e &&

	test_tick &&
	git commit -m "master modifies a and d/e" &&
	c1=$(git rev-parse --verify HEAD) &&
	( git ls-tree -r HEAD ; git ls-files -s ) >actual &&
	(
		echo "100644 blob $o1	a"
		echo "100644 blob $o0	b"
		echo "100644 blob $o0	c"
		echo "100644 blob $o1	d/e"
		echo "100644 $o1 0	a"
		echo "100644 $o0 0	b"
		echo "100644 $o0 0	c"
		echo "100644 $o1 0	d/e"
	) >expected &&
	test_cmp expected actual

*** t3031-merge-criscross.sh ***
[master (root-commit) 520e4d9] empty 1
 Author: A U Thor <author@example.com>
Cloning into 'submodule_update'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3010-ls-files-killed-modified/submod2/.git/
[master (root-commit) 28fb999] empty 2
 Author: A U Thor <author@example.com>
done.
[master (root-commit) 88eeecf] initial
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 a
 create mode 100644 b
 create mode 100644 c
 create mode 100644 d/e
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3031-merge-criscross/.git/
expecting success: 
	mkdir data &&

	# create a bunch of files
	n=1 &&
	while test $n -le 10
	do
		echo $n > data/$n &&
		n=$(($n+1)) ||
		return 1
	done &&

	# check them in
	git add data &&
	git commit -m A &&
	git branch A &&

	# a file in one branch
	git checkout -b B A &&
	git rm data/9 &&
	git add data &&
	git commit -m B &&

	# with a branch off of it
	git branch D &&

	# put some commits on D
	git checkout D &&
	echo testD > data/testD &&
	git add data &&
	git commit -m D &&

	# back up to the top, create another branch and cause
	# a rename conflict with the file we deleted earlier
	git checkout -b C A &&
	git mv data/9 data/new-9 &&
	git add data &&
	git commit -m C &&

	# with a branch off of it
	git branch E &&

	# put a commit on E
	git checkout E &&
	echo testE > data/testE &&
	git add data &&
	git commit -m E &&

	# now, merge E into B
	git checkout B &&
	test_must_fail git merge E &&
	# force-resolve
	git add data &&
	git commit -m F &&
	git branch F &&

	# and merge D into C
	git checkout C &&
	test_must_fail git merge D &&
	# force-resolve
	git add data &&
	git commit -m G &&
	git branch G

[master 2aaf502] empty 1 (updated)
 Author: A U Thor <author@example.com>
ok 1 - git update-index --add to add various paths.

expecting success: 
	date >path2 &&
	if test_have_prereq SYMLINKS
	then
		ln -s frotz path3 &&
		ln -s nitfol path5
	else
		date >path3 &&
		date >path5
	fi &&
	mkdir -p path0 path1 path6 pathx/ju &&
	date >path0/file0 &&
	date >path1/file1 &&
	date >path6/file6 &&
	date >path7 &&
	: >path8 &&
	: >path9 &&
	touch path10 &&
	>pathx/ju/nk &&
	cat >.expected <<-\EOF
	path0/file0
	path1/file1
	path2
	path3
	pathx/ju/nk
	EOF

Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
[master (root-commit) 93b0e99] A
 Author: A U Thor <author@example.com>
 10 files changed, 10 insertions(+)
 create mode 100644 data/1
 create mode 100644 data/10
 create mode 100644 data/2
 create mode 100644 data/3
 create mode 100644 data/4
 create mode 100644 data/5
 create mode 100644 data/6
 create mode 100644 data/7
 create mode 100644 data/8
 create mode 100644 data/9
ok 2 - git ls-files -k to show killed files.

expecting success: 
	git ls-files -k >.output &&
	test_cmp .expected .output

ok 3 - git ls-files -k output (w/o icase)

expecting success: 
	git -c core.ignorecase=true ls-files -k >.output &&
	test_cmp .expected .output

Branch add_sub1 set up to track remote branch add_sub1 from origin.
Switched to a new branch 'B'
ok 4 - git ls-files -k output (w/ icase)

expecting success: 
	git ls-files -m >.output

rm 'data/9'
Switched to branch 'add_sub1'
Your branch is up-to-date with 'origin/add_sub1'.
ok 5 - git ls-files -m to show modified files.

expecting success: 
	cat >.expected <<-\EOF &&
	path0
	path1
	path2/file2
	path3/file3
	path7
	path8
	pathx/ju
	submod1
	EOF
	test_cmp .expected .output

ok 6 - validate git ls-files -m output.

# passed all 6 test(s)
1..6
[B 3805c8a] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 data/9
Switched to branch 'D'
ok 23 - git checkout -f: 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
		)
	
*** t3032-merge-recursive-options.sh ***
[master b7f3e7f] master modifies a and d/e
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
[D ac028b1] D
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 data/testD
ok 1 - setup 1

expecting success: 

	rm -rf [abcd] &&
	git checkout side &&
	( git ls-tree -r HEAD ; git ls-files -s ) >actual &&
	(
		echo "100644 blob $o0	a"
		echo "100644 blob $o0	b"
		echo "100644 blob $o0	c"
		echo "100644 blob $o0	d/e"
		echo "100644 $o0 0	a"
		echo "100644 $o0 0	b"
		echo "100644 $o0 0	c"
		echo "100644 $o0 0	d/e"
	) >expected &&
	test_cmp expected actual &&

	echo goodbye >>a &&
	o2=$(git hash-object a) &&

	git add a &&

	test_tick &&
	git commit -m "side modifies a" &&
	c2=$(git rev-parse --verify HEAD) &&
	( git ls-tree -r HEAD ; git ls-files -s ) >actual &&
	(
		echo "100644 blob $o2	a"
		echo "100644 blob $o0	b"
		echo "100644 blob $o0	c"
		echo "100644 blob $o0	d/e"
		echo "100644 $o2 0	a"
		echo "100644 $o0 0	b"
		echo "100644 $o0 0	c"
		echo "100644 $o0 0	d/e"
	) >expected &&
	test_cmp expected actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3032-merge-recursive-options/.git/
Cloning into 'submodule_update'...
Switched to branch 'side'
Switched to a new branch 'C'
D	b
D	c
expecting success: 
	conflict_hunks () {
		sed $SED_OPTIONS -n -e "
			/^<<<</ b conflict
			b
			: conflict
			p
			/^>>>>/ b
			n
			b conflict
		" "$@"
	} &&

	cat <<-\EOF >text.txt &&
	    Hope, he says, cherishes the soul of him who lives in
	    justice and holiness and is the nurse of his age and the
	    companion of his journey;--hope which is mightiest to sway
	    the restless soul of man.

	How admirable are his words!  And the great blessing of riches, I do
	not say to every man, but to a good man, is, that he has had no
	occasion to deceive or to defraud others, either intentionally or
	unintentionally; and when he departs to the world below he is not in
	any apprehension about offerings due to the gods or debts which he owes
	to men.  Now to this peace of mind the possession of wealth greatly
	contributes; and therefore I say, that, setting one thing against
	another, of the many advantages which wealth has to give, to a man of
	sense this is in my opinion the greatest.

	Well said, Cephalus, I replied; but as concerning justice, what is
	it?--to speak the truth and to pay your debts--no more than this?  And
	even to this are there not exceptions?  Suppose that a friend when in
	his right mind has deposited arms with me and he asks for them when he
	is not in his right mind, ought I to give them back to him?  No one
	would say that I ought or that I should be right in doing so, any more
	than they would say that I ought always to speak the truth to one who
	is in his condition.

	You are quite right, he replied.

	But then, I said, speaking the truth and paying your debts is not a
	correct definition of justice.

	CEPHALUS - SOCRATES - POLEMARCHUS

	Quite correct, Socrates, if Simonides is to be believed, said
	Polemarchus interposing.

	I fear, said Cephalus, that I must go now, for I have to look after the
	sacrifices, and I hand over the argument to Polemarchus and the company.
	EOF
	git add text.txt &&
	test_tick &&
	git commit -m "Initial revision" &&

	git checkout -b remote &&
	sed -e "
			s/\.  /\. /g
			s/[?]  /? /g
			s/    /	/g
			s/--/---/g
			s/but as concerning/but as con cerning/
			/CEPHALUS - SOCRATES - POLEMARCHUS/ d
		" text.txt >text.txt+ &&
	mv text.txt+ text.txt &&
	git commit -a -m "Remove cruft" &&

	git checkout master &&
	sed -e "
			s/\(not in his right mind\),\(.*\)/\1;\2Q/
			s/Quite correct\(.*\)/It is too correct\1Q/
			s/unintentionally/un intentionally/
			/un intentionally/ s/$/Q/
			s/Polemarchus interposing./Polemarchus, interposing.Q/
			/justice and holiness/ s/$/Q/
			/pay your debts/ s/$/Q/
		" text.txt | q_to_cr >text.txt+ &&
	mv text.txt+ text.txt &&
	git commit -a -m "Clarify" &&
	git show-branch --all

done.
[C b51a628] C
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename data/{9 => new-9} (100%)
[master (root-commit) c1e95d9] Initial revision
 Author: A U Thor <author@example.com>
 1 file changed, 36 insertions(+)
 create mode 100644 text.txt
[side 4419332] side modifies a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Switched to a new branch 'replace_sub1_with_file'
Switched to a new branch 'remote'
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
Switched to branch 'E'
t2013-checkout-submodule.sh: 159: cd: can't cd to sub1
ok 2 - setup 2

expecting success: 

	rm -rf [abcd] &&
	git checkout df-1 &&
	( git ls-tree -r HEAD ; git ls-files -s ) >actual &&
	(
		echo "100644 blob $o0	a"
		echo "100644 blob $o0	b"
		echo "100644 blob $o0	c"
		echo "100644 blob $o0	d/e"
		echo "100644 $o0 0	a"
		echo "100644 $o0 0	b"
		echo "100644 $o0 0	c"
		echo "100644 $o0 0	d/e"
	) >expected &&
	test_cmp expected actual &&

	rm -f b && mkdir b && echo df-1 >b/c && git add b/c &&
	o3=$(git hash-object b/c) &&

	test_tick &&
	git commit -m "df-1 makes b/c" &&
	c3=$(git rev-parse --verify HEAD) &&
	( git ls-tree -r HEAD ; git ls-files -s ) >actual &&
	(
		echo "100644 blob $o0	a"
		echo "100644 blob $o3	b/c"
		echo "100644 blob $o0	c"
		echo "100644 blob $o0	d/e"
		echo "100644 $o0 0	a"
		echo "100644 $o3 0	b/c"
		echo "100644 $o0 0	c"
		echo "100644 $o0 0	d/e"
	) >expected &&
	test_cmp expected actual

[remote be82dcf] Remove cruft
 Author: A U Thor <author@example.com>
 1 file changed, 9 insertions(+), 10 deletions(-)
[E e659046] E
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 data/testE
Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
Switched to branch 'B'
Switched to branch 'master'
Switched to branch 'df-1'
D	b
D	c
D	d/e
Switched to branch 'replace_file_with_sub1'
Your branch is up-to-date with 'origin/replace_file_with_sub1'.
Merging:
3805c8a B
virtual E
found 1 common ancestor:
93b0e99 A
CONFLICT (rename/delete): data/new-9 deleted in HEAD and renamed in E. Version E of data/new-9 left in tree.
Automatic merge failed; fix conflicts and then commit the result.
[master 0ab7224] Clarify
 Author: A U Thor <author@example.com>
 1 file changed, 6 insertions(+), 6 deletions(-)
* [master] Clarify
 ! [remote] Remove cruft
--
 + [remote] Remove cruft
*  [master] Clarify
*+ [remote^] Initial revision
[B a5b97a6] F
 Author: A U Thor <author@example.com>
ok 1 - setup

expecting success: 
	git read-tree --reset -u HEAD &&
	test_must_fail git merge-recursive HEAD^ -- HEAD remote &&
	test_must_fail git update-index --refresh &&
	grep "<<<<<<" text.txt

[df-1 918ade1] df-1 makes b/c
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 1 deletion(-)
 delete mode 100644 b
 create mode 100644 b/c
Merging HEAD with remote
Merging:
0ab7224 Clarify
be82dcf Remove cruft
found 1 common ancestor:
c1e95d9 Initial revision
Auto-merging text.txt
Switched to branch 'C'
CONFLICT (content): Merge conflict in text.txt
text.txt: needs merge
<<<<<<< HEAD
<<<<<<< HEAD
Merging:
b51a628 C
virtual D
found 1 common ancestor:
93b0e99 A
CONFLICT (rename/delete): data/new-9 deleted in D and renamed in HEAD. Version HEAD of data/new-9 left in tree.
Automatic merge failed; fix conflicts and then commit the result.
ok 2 - naive merge fails

expecting success: 
	git read-tree --reset -u HEAD &&
	git merge-recursive --ignore-space-change HEAD^ -- HEAD remote

ok 3 - setup 3

expecting success: 

	rm -rf [abcd] &&
	git checkout df-2 &&
	( git ls-tree -r HEAD ; git ls-files -s ) >actual &&
	(
		echo "100644 blob $o0	a"
		echo "100644 blob $o0	b"
		echo "100644 blob $o0	c"
		echo "100644 blob $o0	d/e"
		echo "100644 $o0 0	a"
		echo "100644 $o0 0	b"
		echo "100644 $o0 0	c"
		echo "100644 $o0 0	d/e"
	) >expected &&
	test_cmp expected actual &&

	rm -f a && mkdir a && echo df-2 >a/c && git add a/c &&
	o4=$(git hash-object a/c) &&

	test_tick &&
	git commit -m "df-2 makes a/c" &&
	c4=$(git rev-parse --verify HEAD) &&
	( git ls-tree -r HEAD ; git ls-files -s ) >actual &&
	(
		echo "100644 blob $o4	a/c"
		echo "100644 blob $o0	b"
		echo "100644 blob $o0	c"
		echo "100644 blob $o0	d/e"
		echo "100644 $o4 0	a/c"
		echo "100644 $o0 0	b"
		echo "100644 $o0 0	c"
		echo "100644 $o0 0	d/e"
	) >expected &&
	test_cmp expected actual

[C 028c711] G
 Author: A U Thor <author@example.com>
Switched to branch 'df-2'
D	a
D	c
D	d/e
ok 1 - setup repo with criss-cross history

expecting success: 
	git merge F

Merging HEAD with remote
Merging:
0ab7224 Clarify
be82dcf Remove cruft
found 1 common ancestor:
c1e95d9 Initial revision
Auto-merging text.txt
ok 3 - --ignore-space-change makes merge succeed

expecting success: 
	git read-tree --reset -u HEAD &&
	test_must_fail git cherry-pick --no-commit remote &&
	git read-tree --reset -u HEAD &&
	test_must_fail git cherry-pick remote &&
	test_must_fail git update-index --refresh &&
	grep "<<<<<<" text.txt

Merging:
028c711 G
virtual F
found 2 common ancestors:
3805c8a B
b51a628 C
  Merging:
  3805c8a B
  b51a628 C
  found 1 common ancestor:
  93b0e99 A
Skipped data/new-9 (merged same as existing)
Merge made by the 'recursive' strategy.
error: could not apply be82dcf... Remove cruft
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
 data/testE | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 data/testE
Auto-merging text.txt
CONFLICT (content): Merge conflict in text.txt
ok 2 - recursive merge between F and G, causes segfault

# passed all 2 test(s)
1..2
[df-2 833bf24] df-2 makes a/c
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 1 deletion(-)
 delete mode 100644 a
 create mode 100644 a/c
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule_update_repo/.) registered for path 'sub1'
error: could not apply be82dcf... Remove cruft
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging text.txt
CONFLICT (content): Merge conflict in text.txt
text.txt: needs merge
<<<<<<< HEAD
<<<<<<< HEAD
ok 4 - naive cherry-pick fails

expecting success: 
	git read-tree --reset -u HEAD &&
	git cherry-pick --no-commit -Xignore-space-change remote

ok 4 - setup 4

*** t3033-merge-toplevel.sh ***
expecting success: 

	rm -rf [abcd] &&
	git checkout remove &&
	( git ls-tree -r HEAD ; git ls-files -s ) >actual &&
	(
		echo "100644 blob $o0	a"
		echo "100644 blob $o0	b"
		echo "100644 blob $o0	c"
		echo "100644 blob $o0	d/e"
		echo "100644 $o0 0	a"
		echo "100644 $o0 0	b"
		echo "100644 $o0 0	c"
		echo "100644 $o0 0	d/e"
	) >expected &&
	test_cmp expected actual &&

	rm -f b &&
	echo remove-conflict >a &&

	git add a &&
	git rm b &&
	o5=$(git hash-object a) &&

	test_tick &&
	git commit -m "remove removes b and modifies a" &&
	c5=$(git rev-parse --verify HEAD) &&
	( git ls-tree -r HEAD ; git ls-files -s ) >actual &&
	(
		echo "100644 blob $o5	a"
		echo "100644 blob $o0	c"
		echo "100644 blob $o0	d/e"
		echo "100644 $o5 0	a"
		echo "100644 $o0 0	c"
		echo "100644 $o0 0	d/e"
	) >expected &&
	test_cmp expected actual


Switched to branch 'remove'
D	b
D	c
D	d/e
Auto-merging text.txt
ok 5 - -Xignore-space-change makes cherry-pick succeed

expecting success: 
	q_to_cr <<-\EOF >expected &&
	    justice and holiness and is the nurse of his age and theQ
	EOF

	git read-tree --reset -u HEAD &&
	git merge-recursive --ignore-space-change HEAD^ -- HEAD remote &&
	grep "justice and holiness" text.txt >actual &&
	test_cmp expected actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3033-merge-toplevel/.git/
Merging HEAD with remote
Merging:
0ab7224 Clarify
be82dcf Remove cruft
found 1 common ancestor:
c1e95d9 Initial revision
Auto-merging text.txt
expecting success: 
	test_commit one &&
	git branch left &&
	git branch right &&
	test_commit two &&
	git checkout left &&
	test_commit three &&
	git checkout right &&
	test_commit four &&
	git checkout master

rm 'b'
ok 6 - --ignore-space-change: our w/s-only change wins

expecting success: 
	cat <<-\EOF >expected &&
	it?---to speak the truth and to pay your debts---no more than this? And
	EOF

	git read-tree --reset -u HEAD &&
	git merge-recursive --ignore-space-change HEAD^ -- HEAD remote &&
	grep "pay your debts" text.txt >actual &&
	test_cmp expected actual

Cloning into 'sub1'...
[master (root-commit) d79ce16] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
[remove 968f3e1] remove removes b and modifies a
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 2 deletions(-)
 delete mode 100644 b
Merging HEAD with remote
Merging:
0ab7224 Clarify
be82dcf Remove cruft
found 1 common ancestor:
c1e95d9 Initial revision
Auto-merging text.txt
done.
ok 7 - --ignore-space-change: their real change wins over w/s

expecting success: 
	cat <<-\EOF >expected1 &&
	Well said, Cephalus, I replied; but as con cerning justice, what is
	EOF
	q_to_cr <<-\EOF >expected2 &&
	un intentionally; and when he departs to the world below he is not inQ
	EOF

	git read-tree --reset -u HEAD &&
	git merge-recursive --ignore-space-change HEAD^ -- HEAD remote &&
	grep "Well said" text.txt >actual1 &&
	grep "when he departs" text.txt >actual2 &&
	test_cmp expected1 actual1 &&
	test_cmp expected2 actual2

ok 5 - setup 5

expecting success: 

	rm -rf [abcd] &&
	git checkout df-3 &&
	( git ls-tree -r HEAD ; git ls-files -s ) >actual &&
	(
		echo "100644 blob $o0	a"
		echo "100644 blob $o0	b"
		echo "100644 blob $o0	c"
		echo "100644 blob $o0	d/e"
		echo "100644 $o0 0	a"
		echo "100644 $o0 0	b"
		echo "100644 $o0 0	c"
		echo "100644 $o0 0	d/e"
	) >expected &&
	test_cmp expected actual &&

	rm -fr d && echo df-3 >d && git add d &&
	o6=$(git hash-object d) &&

	test_tick &&
	git commit -m "df-3 makes d" &&
	c6=$(git rev-parse --verify HEAD) &&
	( git ls-tree -r HEAD ; git ls-files -s ) >actual &&
	(
		echo "100644 blob $o0	a"
		echo "100644 blob $o0	b"
		echo "100644 blob $o0	c"
		echo "100644 blob $o6	d"
		echo "100644 $o0 0	a"
		echo "100644 $o0 0	b"
		echo "100644 $o0 0	c"
		echo "100644 $o6 0	d"
	) >expected &&
	test_cmp expected actual

Switched to branch 'df-3'
D	c
D	d/e
[master 139b20d] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two.t
Merging HEAD with remote
Merging:
0ab7224 Clarify
be82dcf Remove cruft
found 1 common ancestor:
c1e95d9 Initial revision
Auto-merging text.txt
ok 8 - --ignore-space-change: does not ignore new spaces

expecting success: 
	cat <<-\EOF >expected &&
	Well said, Cephalus, I replied; but as concerning justice, what is
	EOF

	git read-tree --reset -u HEAD &&
	git merge-recursive --ignore-all-space HEAD^ -- HEAD remote &&
	grep "Well said" text.txt >actual &&
	test_cmp expected actual

Switched to branch 'left'
[left 897c206] three
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 three.t
Merging HEAD with remote
Merging:
0ab7224 Clarify
be82dcf Remove cruft
found 1 common ancestor:
c1e95d9 Initial revision
Auto-merging text.txt
[df-3 9d284b3] df-3 makes d
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 1 deletion(-)
 create mode 100644 d
 delete mode 100644 d/e
ok 9 - --ignore-all-space drops their new spaces

expecting success: 
	q_to_cr <<-\EOF >expected &&
	un intentionally; and when he departs to the world below he is not inQ
	EOF

	git read-tree --reset -u HEAD &&
	git merge-recursive --ignore-all-space HEAD^ -- HEAD remote &&
	grep "when he departs" text.txt >actual &&
	test_cmp expected actual

Submodule path 'sub1': checked out '3950f7ed37a2b5b8e95094de1b49ceba8eecb3d9'
Switched to branch 'right'
Merging HEAD with remote
Merging:
0ab7224 Clarify
be82dcf Remove cruft
found 1 common ancestor:
c1e95d9 Initial revision
Auto-merging text.txt
ok 6 - setup 6

expecting success: 

	git checkout submod &&
	git rm d/e &&
	test_tick &&
	git commit -m "remove d/e" &&
	git update-index --add --cacheinfo 160000 $c1 d &&
	test_tick &&
	git commit -m "make d/ a submodule"

ok 10 - --ignore-all-space keeps our new spaces

expecting success: 
	q_to_cr <<-\EOF >expected &&
	<<<<<<< HEAD
	is not in his right mind; ought I to give them back to him?  No oneQ
	=======
	is not in his right mind, ought I to give them back to him? No one
	>>>>>>> remote
	EOF

	git read-tree --reset -u HEAD &&
	test_must_fail git merge-recursive --ignore-space-at-eol \
						 HEAD^ -- HEAD remote &&
	conflict_hunks text.txt >actual &&
	test_cmp expected actual

[right bd0edcc] four
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 four.t
Switched to branch 'master'
ok 1 - setup

expecting success: 
	t3033_reset &&
	git checkout --orphan test &&
	git rm -fr . &&
	test_must_fail git merge left right &&
	test_must_fail git rev-parse --verify HEAD &&
	git diff --quiet &&
	test_must_fail git rev-parse HEAD

Merging HEAD with remote
Merging:
0ab7224 Clarify
be82dcf Remove cruft
found 1 common ancestor:
c1e95d9 Initial revision
Auto-merging text.txt
CONFLICT (content): Merge conflict in text.txt
Switched to branch 'submod'
D	c
Reset branch 'master'
ok 11 - --ignore-space-at-eol

# passed all 11 test(s)
1..11
rm 'd/e'
[submod a09e90e] remove d/e
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 d/e
Switched to a new branch 'test'
*** t3040-subprojects-basic.sh ***
rm 'one.t'
rm 'two.t'
ok 24 - git checkout -f: 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
		)
	
fatal: Can merge only exactly one commit into empty head
[submod 8c3440b] make d/ a submodule
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 160000 d
ok 7 - setup 7

expecting success: 
	git checkout rename &&
	git mv a e &&
	git add e &&
	test_tick &&
	git commit -m "rename a->e" &&
	c7=$(git rev-parse --verify HEAD) &&
	git checkout rename-ln &&
	git mv a e &&
	test_ln_s_add e a &&
	test_tick &&
	git commit -m "rename a->e, symlink a->e" &&
	oln=`printf e | git hash-object --stdin`

fatal: Needed a single revision
Switched to branch 'rename'
D	c
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
HEAD
ok 2 - merge an octopus into void

expecting success: 
	t3033_reset &&
	git reset --hard one &&
	git merge left right &&
	# one is ancestor of three (left) and four (right)
	test_must_fail git rev-parse --verify HEAD^3 &&
	git rev-parse HEAD^1 HEAD^2 | sort >actual &&
	git rev-parse three four | sort >expect &&
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3040-subprojects-basic/.git/
Switched to and reset branch 'master'
expecting success: 
	: >Makefile &&
	git add Makefile &&
	git commit -m "Superproject created"

[rename 5dd9bd8] rename a->e
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename a => e (100%)
Cloning into 'submodule_update'...
[master (root-commit) 764c851] Superproject created
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 Makefile
ok 1 - setup: create superproject

expecting success: 
	mkdir sub1 &&
	( cd sub1 && git init && : >Makefile && git add * &&
	git commit -q -m "subproject 1" ) &&
	mkdir sub2 &&
	( cd sub2 && git init && : >Makefile && git add * &&
	git commit -q -m "subproject 2" ) &&
	git update-index --add sub1 &&
	git add sub2 &&
	git commit -q -m "subprojects added" &&
	git diff-tree --abbrev=5 HEAD^ HEAD |cut -d" " -f-3,5- >current &&
	git branch save HEAD &&
	cat >expected <<-\EOF &&
	:000000 160000 00000... A	sub1
	:000000 160000 00000... A	sub2
	EOF
	test_cmp expected current

HEAD is now at d79ce16 one
Switched to branch 'rename-ln'
D	c
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
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3040-subprojects-basic/sub1/.git/
done.
Fast-forwarding to: left
[rename-ln 7e1ee82] rename a->e, symlink a->e
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 1 deletion(-)
 rewrite a (100%)
 mode change 100644 => 120000
 copy a => e (100%)
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 8 - setup 8

expecting success: 
	git checkout copy &&
	cp a e &&
	git add e &&
	test_tick &&
	git commit -m "copy a->e"

Trying simple merge with right
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3040-subprojects-basic/sub2/.git/
Switched to branch 'copy'
D	c
Merge made by the 'octopus' strategy.
 four.t  | 1 +
 three.t | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 four.t
 create mode 100644 three.t
error: 8ed2e6719f8484ce01fa3ce133fe42d25c2441b8^{commit}: expected commit type, but the object dereferences to tree type
fatal: Needed a single revision
fatal: Needed a single revision
Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
[copy a40ced5] copy a->e
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 e
ok 9 - setup 9

expecting success: 

	rm -fr [abcd] &&
	git checkout -f "$c2" &&

	test_expect_code 1 git merge-recursive "$c0" -- "$c2" "$c1"

Switched to branch 'replace_directory_with_sub1'
Your branch is up-to-date with 'origin/replace_directory_with_sub1'.
Note: checking out '441933296d498d45ed4c5cbe9135259386a2e2b2'.

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 4419332... side modifies a
ok 3 - merge an octopus, fast-forward (ff)

expecting success: 
	t3033_reset &&
	git reset --hard one &&
	git merge --no-ff left right &&
	# one is ancestor of three (left) and four (right)
	test_must_fail git rev-parse --verify HEAD^4 &&
	git rev-parse HEAD^1 HEAD^2 HEAD^3 | sort >actual &&
	git rev-parse one three four | sort >expect &&
	test_cmp expect actual

Merging 441933296d498d45ed4c5cbe9135259386a2e2b2 with b7f3e7f677ef7001dcb4b810583c9259a210141d
Merging:
4419332 side modifies a
b7f3e7f master modifies a and d/e
found 1 common ancestor:
88eeecf initial
Auto-merging a
CONFLICT (content): Merge conflict in a
ok 10 - merge-recursive simple

expecting success: 

	git ls-files -s >actual &&
	(
		echo "100644 $o0 1	a"
		echo "100644 $o2 2	a"
		echo "100644 $o1 3	a"
		echo "100644 $o0 0	b"
		echo "100644 $o0 0	c"
		echo "100644 $o1 0	d/e"
	) >expected &&
	test_cmp expected actual


ok 2 - setup: create subprojects

expecting success: 
	git fsck --full

Reset branch 'master'
ok 11 - merge-recursive result

expecting success: 

	rm -fr [abcd] &&
	git checkout -f "$c1" &&

	test_must_fail git merge "$c5" &&
	test_must_fail git merge "$c5" 2> out &&
	test_i18ngrep "not possible because you have unmerged files" out &&
	git add -u &&
	test_must_fail git merge "$c5" 2> out &&
	test_i18ngrep "You have not concluded your merge" out &&
	rm -f .git/MERGE_HEAD &&
	test_must_fail git merge "$c5" 2> out &&
	test_i18ngrep "Your local changes to the following files would be overwritten by merge:" out

ok 3 - check if fsck ignores the subprojects

expecting success: 
	( cd sub1 &&
	echo "all:" >>Makefile &&
	echo "	true" >>Makefile &&
	git commit -q -a -m "make all" ) &&
	test_expect_code 1 git diff-files --exit-code

Previous HEAD position was 4419332... side modifies a
HEAD is now at b7f3e7f... master modifies a and d/e
HEAD is now at d79ce16 one
Merging:
b7f3e7f master modifies a and d/e
virtual 968f3e182d39cc5676d733434b2b1fcade6d5fdb
found 1 common ancestor:
88eeecf initial
Removing b
Auto-merging a
CONFLICT (content): Merge conflict in a
Automatic merge failed; fix conflicts and then commit the result.
error: merge is not possible because you have unmerged files.
:160000 160000 65699f11bfc3e34184d77077a7e59cb7f3bedb6c 0000000000000000000000000000000000000000 M	sub1
ok 4 - check if commit in a subproject detected

expecting success: 
	git commit -q -a -m "sub1 changed" &&
	test_expect_code 1 git diff-tree --exit-code HEAD^ HEAD

Fast-forwarding to: left
fatal: You have not concluded your merge (MERGE_HEAD exists).
:160000 160000 65699f11bfc3e34184d77077a7e59cb7f3bedb6c ebc9382fb121dda8bcdc4b53901aa9af919fd5f3 M	sub1
ok 5 - check if a changed subproject HEAD can be committed

expecting success: 
	test_expect_code 1 git diff-index --exit-code --cached save -- sub1

Merging:
b7f3e7f master modifies a and d/e
virtual 968f3e182d39cc5676d733434b2b1fcade6d5fdb
found 1 common ancestor:
88eeecf initial
error: Your local changes to the following files would be overwritten by merge:
Trying simple merge with right
ok 12 - fail if the index has unresolved entries

expecting success: 

	rm -fr [abcd] &&
	git checkout -f "$c1" &&

	test_expect_code 1 git merge-recursive "$c0" -- "$c1" "$c5"

:160000 160000 65699f11bfc3e34184d77077a7e59cb7f3bedb6c ebc9382fb121dda8bcdc4b53901aa9af919fd5f3 M	sub1
ok 6 - check if diff-index works for subproject elements

expecting success: 
	test_expect_code 1 git diff-tree --exit-code HEAD^ HEAD -- sub1

:160000 160000 65699f11bfc3e34184d77077a7e59cb7f3bedb6c ebc9382fb121dda8bcdc4b53901aa9af919fd5f3 M	sub1
ok 7 - check if diff-tree works for subproject elements

expecting success: 
	test_expect_code 1 git diff --exit-code HEAD^ HEAD

HEAD is now at b7f3e7f... master modifies a and d/e
Merge made by the 'octopus' strategy.
 four.t  | 1 +
 three.t | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 four.t
 create mode 100644 three.t
diff --git a/sub1 b/sub1
index 65699f1..ebc9382 160000
--- a/sub1
+++ b/sub1
@@ -1 +1 @@
-Subproject commit 65699f11bfc3e34184d77077a7e59cb7f3bedb6c
+Subproject commit ebc9382fb121dda8bcdc4b53901aa9af919fd5f3
ok 8 - check if git diff works for subproject elements

expecting success: 
	git ls-files -s >expected &&
	git clone -l -s . cloned &&
	( cd cloned && git ls-files -s ) >current &&
	test_cmp expected current

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule_update_repo/.) registered for path 'sub1'
Merging b7f3e7f677ef7001dcb4b810583c9259a210141d with 968f3e182d39cc5676d733434b2b1fcade6d5fdb
Merging:
b7f3e7f master modifies a and d/e
968f3e1 remove removes b and modifies a
found 1 common ancestor:
88eeecf initial
Removing b
Auto-merging a
CONFLICT (content): Merge conflict in a
ok 13 - merge-recursive remove conflict

expecting success: 

	git ls-files -s >actual &&
	(
		echo "100644 $o0 1	a"
		echo "100644 $o1 2	a"
		echo "100644 $o5 3	a"
		echo "100644 $o0 0	c"
		echo "100644 $o1 0	d/e"
	) >expected &&
	test_cmp expected actual


fatal: Needed a single revision
Cloning into 'cloned'...
ok 14 - merge-recursive remove conflict

expecting success: 
	rm -fr [abcd] &&
	git reset --hard &&
	git checkout -f "$c1" &&

	git merge-recursive "$c0" -- "$c1" "$c3"

done.
ok 4 - merge octopus, non-fast-forward (ff)

expecting success: 
	t3033_reset &&
	git merge left right &&
	# two (master) is not an ancestor of three (left) and four (right)
	test_must_fail git rev-parse --verify HEAD^4 &&
	git rev-parse HEAD^1 HEAD^2 HEAD^3 | sort >actual &&
	git rev-parse two three four | sort >expect &&
	test_cmp expect actual

HEAD is now at b7f3e7f master modifies a and d/e
ok 9 - check if clone works

expecting success: 
	git update-index --force-remove -- sub2 &&
	mv sub2 sub3 &&
	git add sub3 &&
	git commit -q -m "renaming a subproject" &&
	test_expect_code 1 git diff -M --name-status --exit-code HEAD^ HEAD

HEAD is now at b7f3e7f... master modifies a and d/e
Reset branch 'master'
Merging b7f3e7f677ef7001dcb4b810583c9259a210141d with 918ade1d06dd1c0da47b644356c64b1b2122e705
Merging:
b7f3e7f master modifies a and d/e
918ade1 df-1 makes b/c
found 1 common ancestor:
88eeecf initial
Adding b/c
Removing b to make room for subdirectory

Removing b
ok 15 - merge-recursive d/f simple

expecting success: 

	git ls-files -s >actual &&
	(
		echo "100644 $o1 0	a"
		echo "100644 $o3 0	b/c"
		echo "100644 $o0 0	c"
		echo "100644 $o1 0	d/e"
	) >expected &&
	test_cmp expected actual


ok 16 - merge-recursive result

expecting success: 

	rm -fr [abcd] &&
	git reset --hard &&
	git checkout -f "$c1" &&

	test_expect_code 1 git merge-recursive "$c0" -- "$c1" "$c4"

Cloning into 'sub1'...
HEAD is now at b7f3e7f master modifies a and d/e
R100	sub2	sub3
ok 10 - removing and adding subproject

expecting success: 
	git checkout save &&
	git diff-index --exit-code --raw --cached save -- sub1

HEAD is now at b7f3e7f... master modifies a and d/e
warning: unable to rmdir sub3: Directory not empty
Switched to branch 'save'
M	sub1
done.
Trying simple merge with left
Merging b7f3e7f677ef7001dcb4b810583c9259a210141d with 833bf240c9e2636a0e5eb3dd8f735d2a92181f22
Merging:
b7f3e7f master modifies a and d/e
833bf24 df-2 makes a/c
found 1 common ancestor:
88eeecf initial
Adding a/c
Removing a to make room for subdirectory

CONFLICT (modify/delete): a deleted in 833bf240c9e2636a0e5eb3dd8f735d2a92181f22 and modified in b7f3e7f677ef7001dcb4b810583c9259a210141d. Version b7f3e7f677ef7001dcb4b810583c9259a210141d of a left in tree at a~b7f3e7f677ef7001dcb4b810583c9259a210141d.
ok 11 - checkout in superproject

ok 17 - merge-recursive d/f conflict

expecting success: 

	git ls-files -s >actual &&
	(
		echo "100644 $o0 1	a"
		echo "100644 $o1 2	a"
		echo "100644 $o4 0	a/c"
		echo "100644 $o0 0	b"
		echo "100644 $o0 0	c"
		echo "100644 $o1 0	d/e"
	) >expected &&
	test_cmp expected actual


# passed all 11 test(s)
1..11
ok 18 - merge-recursive d/f conflict result

expecting success: 

	rm -fr [abcd] &&
	git reset --hard &&
	git checkout -f "$c4" &&

	test_expect_code 1 git merge-recursive "$c0" -- "$c4" "$c1"

Trying simple merge with right
error: 'a' appears as both a file and as a directory
error: a: cannot drop to stage #0
HEAD is now at b7f3e7f master modifies a and d/e
Previous HEAD position was b7f3e7f... master modifies a and d/e
HEAD is now at 833bf24... df-2 makes a/c
Merge made by the 'octopus' strategy.
 four.t  | 1 +
 three.t | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 four.t
 create mode 100644 three.t
*** t3050-subprojects-fetch.sh ***
Merging 833bf240c9e2636a0e5eb3dd8f735d2a92181f22 with b7f3e7f677ef7001dcb4b810583c9259a210141d
Merging:
833bf24 df-2 makes a/c
b7f3e7f master modifies a and d/e
found 1 common ancestor:
88eeecf initial
Adding a/c
CONFLICT (modify/delete): a deleted in 833bf240c9e2636a0e5eb3dd8f735d2a92181f22 and modified in b7f3e7f677ef7001dcb4b810583c9259a210141d. Version b7f3e7f677ef7001dcb4b810583c9259a210141d of a left in tree at a~b7f3e7f677ef7001dcb4b810583c9259a210141d_0.
ok 19 - merge-recursive d/f conflict the other way

expecting success: 

	git ls-files -s >actual &&
	(
		echo "100644 $o0 1	a"
		echo "100644 $o1 3	a"
		echo "100644 $o4 0	a/c"
		echo "100644 $o0 0	b"
		echo "100644 $o0 0	c"
		echo "100644 $o1 0	d/e"
	) >expected &&
	test_cmp expected actual


fatal: Needed a single revision
ok 20 - merge-recursive d/f conflict result the other way

expecting success: 

	rm -fr [abcd] &&
	git reset --hard &&
	git checkout -f "$c1" &&

	test_expect_code 1 git merge-recursive "$c0" -- "$c1" "$c6"

error: 'a' appears as both a file and as a directory
error: a: cannot drop to stage #0
HEAD is now at 833bf24 df-2 makes a/c
Submodule path 'sub1': checked out '3950f7ed37a2b5b8e95094de1b49ceba8eecb3d9'
ok 5 - merge octopus, fast-forward (does not ff)

expecting success: 
	t3033_reset &&
	git merge --no-ff left right &&
	test_must_fail git rev-parse --verify HEAD^4 &&
	git rev-parse HEAD^1 HEAD^2 HEAD^3 | sort >actual &&
	git rev-parse two three four | sort >expect &&
	test_cmp expect actual

Previous HEAD position was 833bf24... df-2 makes a/c
HEAD is now at b7f3e7f... master modifies a and d/e
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3050-subprojects-fetch/.git/
Reset branch 'master'
expecting success: 
	test_tick &&
	mkdir -p sub && (
		cd sub &&
		git init &&
		>subfile &&
		git add subfile &&
		git commit -m "subproject commit #1"
	) &&
	>mainfile &&
	git add sub mainfile &&
	test_tick &&
	git commit -m "superproject commit #1"

Merging b7f3e7f677ef7001dcb4b810583c9259a210141d with 9d284b3a95aea72df4581977e913e55da89d5e3d
Merging:
b7f3e7f master modifies a and d/e
9d284b3 df-3 makes d
found 1 common ancestor:
88eeecf initial
CONFLICT (modify/delete): d/e deleted in 9d284b3a95aea72df4581977e913e55da89d5e3d and modified in b7f3e7f677ef7001dcb4b810583c9259a210141d. Version b7f3e7f677ef7001dcb4b810583c9259a210141d of d/e left in tree.
CONFLICT (directory/file): There is a directory with name d in b7f3e7f677ef7001dcb4b810583c9259a210141d. Adding d as d~9d284b3a95aea72df4581977e913e55da89d5e3d
ok 21 - merge-recursive d/f conflict

expecting success: 

	git ls-files -s >actual &&
	(
		echo "100644 $o1 0	a"
		echo "100644 $o0 0	b"
		echo "100644 $o0 0	c"
		echo "100644 $o6 3	d"
		echo "100644 $o0 1	d/e"
		echo "100644 $o1 2	d/e"
	) >expected &&
	test_cmp expected actual


ok 22 - merge-recursive d/f conflict result

expecting success: 

	rm -fr [abcd] &&
	git reset --hard &&
	git checkout -f "$c6" &&

	test_expect_code 1 git merge-recursive "$c0" -- "$c6" "$c1"

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3050-subprojects-fetch/sub/.git/
error: 'd/e' appears as both a file and as a directory
error: d/e: cannot drop to stage #0
HEAD is now at b7f3e7f master modifies a and d/e
[master (root-commit) 4c0c877] subproject commit #1
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 subfile
Previous HEAD position was b7f3e7f... master modifies a and d/e
HEAD is now at 9d284b3... df-3 makes d
Trying simple merge with left
ok 25 - git checkout -f: 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
		)
	
Merging 9d284b3a95aea72df4581977e913e55da89d5e3d with b7f3e7f677ef7001dcb4b810583c9259a210141d
Merging:
9d284b3 df-3 makes d
b7f3e7f master modifies a and d/e
found 1 common ancestor:
88eeecf initial
CONFLICT (modify/delete): d/e deleted in 9d284b3a95aea72df4581977e913e55da89d5e3d and modified in b7f3e7f677ef7001dcb4b810583c9259a210141d. Version b7f3e7f677ef7001dcb4b810583c9259a210141d of d/e left in tree.
Removing d to make room for subdirectory

CONFLICT (file/directory): There is a directory with name d in b7f3e7f677ef7001dcb4b810583c9259a210141d. Adding d as d~9d284b3a95aea72df4581977e913e55da89d5e3d_0
ok 23 - merge-recursive d/f conflict

expecting success: 

	git ls-files -s >actual &&
	(
		echo "100644 $o1 0	a"
		echo "100644 $o0 0	b"
		echo "100644 $o0 0	c"
		echo "100644 $o6 2	d"
		echo "100644 $o0 1	d/e"
		echo "100644 $o1 3	d/e"
	) >expected &&
	test_cmp expected actual


[master (root-commit) 1226c2e] superproject commit #1
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
 create mode 100644 mainfile
 create mode 160000 sub
ok 1 - setup

expecting success: 
	git clone "file://$(pwd)/.git" cloned &&
	(git rev-parse HEAD; git ls-files -s) >expected &&
	(
		cd cloned &&
		(git rev-parse HEAD; git ls-files -s) >../actual
	) &&
	test_cmp expected actual

Trying simple merge with right
ok 24 - merge-recursive d/f conflict result

expecting success: 

	git reset --hard "$c2" &&
	git read-tree -m "$c0" "$c2" "$c1"


Cloning into 'cloned'...
error: 'd/e' appears as both a file and as a directory
error: d/e: cannot drop to stage #0
warning: unable to unlink d: Is a directory
Merge made by the 'octopus' strategy.
HEAD is now at 4419332 side modifies a
 four.t  | 1 +
 three.t | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 four.t
 create mode 100644 three.t
fatal: Needed a single revision
ok 25 - reset and 3-way merge

expecting success: 

	git reset --hard master &&
	git read-tree --prefix=M/ master &&
	git ls-files -s >actual &&
	(
		echo "100644 $o1 0	M/a"
		echo "100644 $o0 0	M/b"
		echo "100644 $o0 0	M/c"
		echo "100644 $o1 0	M/d/e"
		echo "100644 $o1 0	a"
		echo "100644 $o0 0	b"
		echo "100644 $o0 0	c"
		echo "100644 $o1 0	d/e"
	) >expected &&
	test_cmp expected actual &&

	git read-tree --prefix=a1/ master &&
	git ls-files -s >actual &&
	(
		echo "100644 $o1 0	M/a"
		echo "100644 $o0 0	M/b"
		echo "100644 $o0 0	M/c"
		echo "100644 $o1 0	M/d/e"
		echo "100644 $o1 0	a"
		echo "100644 $o1 0	a1/a"
		echo "100644 $o0 0	a1/b"
		echo "100644 $o0 0	a1/c"
		echo "100644 $o1 0	a1/d/e"
		echo "100644 $o0 0	b"
		echo "100644 $o0 0	c"
		echo "100644 $o1 0	d/e"
	) >expected &&
	test_cmp expected actual &&

	git read-tree --prefix=z/ master &&
	git ls-files -s >actual &&
	(
		echo "100644 $o1 0	M/a"
		echo "100644 $o0 0	M/b"
		echo "100644 $o0 0	M/c"
		echo "100644 $o1 0	M/d/e"
		echo "100644 $o1 0	a"
		echo "100644 $o1 0	a1/a"
		echo "100644 $o0 0	a1/b"
		echo "100644 $o0 0	a1/c"
		echo "100644 $o1 0	a1/d/e"
		echo "100644 $o0 0	b"
		echo "100644 $o0 0	c"
		echo "100644 $o1 0	d/e"
		echo "100644 $o1 0	z/a"
		echo "100644 $o0 0	z/b"
		echo "100644 $o0 0	z/c"
		echo "100644 $o1 0	z/d/e"
	) >expected &&
	test_cmp expected actual


HEAD is now at b7f3e7f master modifies a and d/e
ok 6 - merge octopus, non-fast-forward

expecting success: 
	t3033_reset &&
	git checkout --orphan test &&
	git rm -fr . &&
	git fetch . left right &&
	test_must_fail git merge FETCH_HEAD &&
	test_must_fail git rev-parse --verify HEAD &&
	git diff --quiet &&
	test_must_fail git rev-parse HEAD

Cloning into 'submodule_update'...
Reset branch 'master'
done.
Switched to a new branch 'test'
rm 'one.t'
rm 'two.t'
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 26 - reset and bind merge

expecting success: 
	(
		GIT_WORK_TREE="$PWD/ours-has-rename-work" &&
		export GIT_WORK_TREE &&
		GIT_INDEX_FILE="$PWD/ours-has-rename-index" &&
		export GIT_INDEX_FILE &&
		mkdir "$GIT_WORK_TREE" &&
		git read-tree -i -m $c7 &&
		git update-index --ignore-missing --refresh &&
		git merge-recursive $c0 -- $c7 $c3 &&
		git ls-files -s >actual-files
	) 2>actual-err &&
	>expected-err &&
	cat >expected-files <<-EOF &&
	100644 $o3 0	b/c
	100644 $o0 0	c
	100644 $o0 0	d/e
	100644 $o0 0	e
	EOF
	test_cmp expected-files actual-files &&
	test_cmp expected-err actual-err

ok 2 - clone

expecting success: 
	echo more >mainfile &&
	git update-index --force-remove sub &&
	mv sub/.git sub/.git-disabled &&
	git add sub/subfile mainfile &&
	mv sub/.git-disabled sub/.git &&
	test_tick &&
	git commit -m "superproject commit #2"

From .
 * branch            left       -> FETCH_HEAD
 * branch            right      -> FETCH_HEAD
Merging 5dd9bd8ddad823127f5e40fcbc297d40f91d9a53 with 918ade1d06dd1c0da47b644356c64b1b2122e705
Merging:
5dd9bd8 rename a->e
918ade1 df-1 makes b/c
found 1 common ancestor:
88eeecf initial
Skipped e (merged same as existing)
Adding b/c
Removing b to make room for subdirectory

Removing b
fatal: Can merge only exactly one commit into empty head
fatal: Needed a single revision
ok 27 - merge-recursive w/ empty work tree - ours has rename

expecting success: 
	(
		GIT_WORK_TREE="$PWD/theirs-has-rename-work" &&
		export GIT_WORK_TREE &&
		GIT_INDEX_FILE="$PWD/theirs-has-rename-index" &&
		export GIT_INDEX_FILE &&
		mkdir "$GIT_WORK_TREE" &&
		git read-tree -i -m $c3 &&
		git update-index --ignore-missing --refresh &&
		git merge-recursive $c0 -- $c3 $c7 &&
		git ls-files -s >actual-files
	) 2>actual-err &&
	>expected-err &&
	cat >expected-files <<-EOF &&
	100644 $o3 0	b/c
	100644 $o0 0	c
	100644 $o0 0	d/e
	100644 $o0 0	e
	EOF
	test_cmp expected-files actual-files &&
	test_cmp expected-err actual-err

fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
HEAD
ok 7 - merge FETCH_HEAD octopus into void

expecting success: 
	t3033_reset &&
	git reset --hard one &&
	git fetch . left right &&
	git merge FETCH_HEAD &&
	# one is ancestor of three (left) and four (right)
	test_must_fail git rev-parse --verify HEAD^3 &&
	git rev-parse HEAD^1 HEAD^2 | sort >actual &&
	git rev-parse three four | sort >expect &&
	test_cmp expect actual

[master 1548ecd] superproject commit #2
 Author: A U Thor <author@example.com>
 3 files changed, 1 insertion(+), 1 deletion(-)
 delete mode 160000 sub
 create mode 100644 sub/subfile
ok 3 - advance

expecting success: 
	(git rev-parse HEAD; git ls-files -s) >expected &&
	(
		cd cloned &&
		git pull &&
		(git rev-parse HEAD; git ls-files -s) >../actual
	) &&
	test_cmp expected actual

Switched to and reset branch 'master'
Merging 918ade1d06dd1c0da47b644356c64b1b2122e705 with 5dd9bd8ddad823127f5e40fcbc297d40f91d9a53
Merging:
918ade1 df-1 makes b/c
5dd9bd8 rename a->e
found 1 common ancestor:
88eeecf initial
Skipped e (merged same as existing)
Adding b/c
ok 28 - merge-recursive w/ empty work tree - theirs has rename

expecting success: 

	git reset --hard master &&
	git checkout -b rm &&
	git rm d/e &&
	git commit -mremoved-d/e &&
	git checkout master &&
	git merge -s recursive rm &&
	test_must_fail test -d d

HEAD is now at b7f3e7f master modifies a and d/e
HEAD is now at d79ce16 one
Switched to a new branch 'rm'
rm 'd/e'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule_update_repo/.) registered for path 'sub1'
[rm df61676] removed-d/e
 Author: A U Thor <author@example.com>
 1 file changed, 2 deletions(-)
 delete mode 100644 d/e
From .
 * branch            left       -> FETCH_HEAD
 * branch            right      -> FETCH_HEAD
From file:///«PKGBUILDDIR»/t/trash directory.t3050-subprojects-fetch/
   1226c2e..1548ecd  master     -> origin/master
Switched to branch 'master'
Updating b7f3e7f..df61676
Fast-forward
Updating 1226c2e..1548ecd
Fast-forward
 d/e | 2 --
 1 file changed, 2 deletions(-)
 delete mode 100644 d/e
ok 29 - merge removes empty directories

checking known breakage: 

	git checkout submod &&
	git merge remove

 mainfile    | 1 +
 sub         | 1 -
 sub/subfile | 0
 3 files changed, 1 insertion(+), 1 deletion(-)
 delete mode 160000 sub
 create mode 100644 sub/subfile
Switched to branch 'submod'
Fast-forwarding to: 897c20684b5db8602798bc55d628f0a264841fec
ok 4 - fetch

# passed all 4 test(s)
1..4
Merging:
8c3440b make d/ a submodule
virtual remove
found 1 common ancestor:
88eeecf initial
CONFLICT (file/directory): There is a directory with name d in remove. Adding d as d~HEAD
Removing b
Automatic merge failed; fix conflicts and then commit the result.
not ok 30 - merge-recursive simple w/submodule # TODO known breakage

checking known breakage: 

	git ls-files -s >actual &&
	(
		echo "100644 $o5 0	a"
		echo "100644 $o0 0	c"
		echo "160000 $c1 0	d"
	) >expected &&
	test_cmp expected actual

--- expected	2015-12-16 10:50:17.389564776 +0000
+++ actual	2015-12-16 10:50:17.389564776 +0000
@@ -1,3 +1,3 @@
 100644 9270c800bfe5f17f5e8972070a1910903eb00347 0	a
 100644 ce013625030ba8dba906f756967f9e9ca394464a 0	c
-160000 b7f3e7f677ef7001dcb4b810583c9259a210141d 0	d
+160000 b7f3e7f677ef7001dcb4b810583c9259a210141d 2	d
not ok 31 - merge-recursive simple w/submodule result # TODO known breakage

expecting success: 
	git checkout -f copy &&
	git merge rename &&
	( git ls-tree -r HEAD && git ls-files -s ) >actual &&
	(
		echo "100644 blob $o0	b"
		echo "100644 blob $o0	c"
		echo "100644 blob $o0	d/e"
		echo "100644 blob $o0	e"
		echo "100644 $o0 0	b"
		echo "100644 $o0 0	c"
		echo "100644 $o0 0	d/e"
		echo "100644 $o0 0	e"
	) >expected &&
	test_cmp expected actual

Trying simple merge with bd0edcc3f6e0375d96ab0d02fcc4c4a1fe1d8c5f
Cloning into 'sub1'...
Switched to branch 'copy'
Merge made by the 'octopus' strategy.
*** t3060-ls-files-with-tree.sh ***
 four.t  | 1 +
 three.t | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 four.t
 create mode 100644 three.t
fatal: Needed a single revision
Merging:
a40ced5 copy a->e
virtual rename
found 1 common ancestor:
88eeecf initial
Merge made by the 'recursive' strategy.
 a | 1 -
 1 file changed, 1 deletion(-)
 delete mode 100644 a
done.
ok 32 - merge-recursive copy vs. rename

checking known breakage: 

	git checkout -f rename &&
	git merge rename-ln &&
	( git ls-tree -r HEAD ; git ls-files -s ) >actual &&
	(
		echo "120000 blob $oln	a"
		echo "100644 blob $o0	b"
		echo "100644 blob $o0	c"
		echo "100644 blob $o0	d/e"
		echo "100644 blob $o0	e"
		echo "120000 $oln 0	a"
		echo "100644 $o0 0	b"
		echo "100644 $o0 0	c"
		echo "100644 $o0 0	d/e"
		echo "100644 $o0 0	e"
	) >expected &&
	test_cmp expected actual

ok 8 - merge FETCH_HEAD octopus fast-forward (ff)

expecting success: 
	t3033_reset &&
	git reset --hard one &&
	git fetch . left right &&
	git merge --no-ff FETCH_HEAD &&
	# one is ancestor of three (left) and four (right)
	test_must_fail git rev-parse --verify HEAD^4 &&
	git rev-parse HEAD^1 HEAD^2 HEAD^3 | sort >actual &&
	git rev-parse one three four | sort >expect &&
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3060-ls-files-with-tree/.git/
Switched to branch 'rename'
expecting success: 

	# The bug we are exercising requires a fair number of entries
	# in a sub-directory so that add_index_entry will trigger a
	# realloc.

	echo file >expected &&
	mkdir sub &&
	for n in 0 1 2 3 4 5
	do
		for m in 0 1 2 3 4 5 6 7 8 9
		do
			num=00$n$m &&
			>sub/file-$num &&
			echo file-$num >>expected ||
			return 1
		done
	done &&
	git add . &&
	git commit -m "add a bunch of files" &&

	# We remove them all so that we will have something to add
	# back with --with-tree and so that we will definitely be
	# under the realloc size to trigger the bug.
	rm -rf sub &&
	git commit -a -m "remove them all" &&

	# The bug also requires some entry before our directory so that
	# prune_path will modify the_index.cache

	mkdir a_directory_that_sorts_before_sub &&
	>a_directory_that_sorts_before_sub/file &&
	mkdir sub &&
	>sub/file &&
	git add .

Reset branch 'master'
Merging:
5dd9bd8 rename a->e
virtual rename-ln
found 1 common ancestor:
88eeecf initial
Merge made by the 'recursive' strategy.
HEAD is now at d79ce16 one
--- expected	2015-12-16 10:50:17.733564776 +0000
+++ actual	2015-12-16 10:50:17.729564776 +0000
@@ -1,9 +1,7 @@
-120000 blob 9cbe6ea56f225388ae614c419249bfc6d734cc30	a
 100644 blob ce013625030ba8dba906f756967f9e9ca394464a	b
 100644 blob ce013625030ba8dba906f756967f9e9ca394464a	c
 100644 blob ce013625030ba8dba906f756967f9e9ca394464a	d/e
 100644 blob ce013625030ba8dba906f756967f9e9ca394464a	e
-120000 9cbe6ea56f225388ae614c419249bfc6d734cc30 0	a
 100644 ce013625030ba8dba906f756967f9e9ca394464a 0	b
 100644 ce013625030ba8dba906f756967f9e9ca394464a 0	c
 100644 ce013625030ba8dba906f756967f9e9ca394464a 0	d/e
not ok 33 - merge-recursive rename vs. rename/symlink # TODO known breakage

expecting success: 
	git reset --hard HEAD &&
	git checkout -b main &&
	git rm -rf . &&

	echo "just a file" >sub1 &&
	mkdir -p sub2 &&
	echo content1 >sub2/file1 &&
	echo content2 >sub2/file2 &&
	echo content3 >sub2/file3 &&
	mkdir simple &&
	echo base >simple/bar &&
	git add -A &&
	test_tick &&
	git commit -m base &&

	git checkout -b other &&
	echo more >>simple/bar &&
	test_tick &&
	git commit -a -m changesimplefile &&

	git checkout main &&
	git rm sub1 &&
	git mv sub2 sub1 &&
	test_tick &&
	git commit -m changefiletodir &&

	test_tick &&
	git merge other

HEAD is now at f670565 Merge branch 'rename-ln' into rename
[master (root-commit) 5e23d69] add a bunch of files
 Author: A U Thor <author@example.com>
 61 files changed, 61 insertions(+)
 create mode 100644 expected
 create mode 100644 sub/file-0000
 create mode 100644 sub/file-0001
 create mode 100644 sub/file-0002
 create mode 100644 sub/file-0003
 create mode 100644 sub/file-0004
 create mode 100644 sub/file-0005
 create mode 100644 sub/file-0006
 create mode 100644 sub/file-0007
 create mode 100644 sub/file-0008
 create mode 100644 sub/file-0009
 create mode 100644 sub/file-0010
 create mode 100644 sub/file-0011
 create mode 100644 sub/file-0012
 create mode 100644 sub/file-0013
 create mode 100644 sub/file-0014
 create mode 100644 sub/file-0015
 create mode 100644 sub/file-0016
 create mode 100644 sub/file-0017
 create mode 100644 sub/file-0018
 create mode 100644 sub/file-0019
 create mode 100644 sub/file-0020
 create mode 100644 sub/file-0021
 create mode 100644 sub/file-0022
 create mode 100644 sub/file-0023
 create mode 100644 sub/file-0024
 create mode 100644 sub/file-0025
 create mode 100644 sub/file-0026
 create mode 100644 sub/file-0027
 create mode 100644 sub/file-0028
 create mode 100644 sub/file-0029
 create mode 100644 sub/file-0030
 create mode 100644 sub/file-0031
 create mode 100644 sub/file-0032
 create mode 100644 sub/file-0033
 create mode 100644 sub/file-0034
 create mode 100644 sub/file-0035
 create mode 100644 sub/file-0036
 create mode 100644 sub/file-0037
 create mode 100644 sub/file-0038
 create mode 100644 sub/file-0039
 create mode 100644 sub/file-0040
 create mode 100644 sub/file-0041
 create mode 100644 sub/file-0042
 create mode 100644 sub/file-0043
 create mode 100644 sub/file-0044
 create mode 100644 sub/file-0045
 create mode 100644 sub/file-0046
 create mode 100644 sub/file-0047
 create mode 100644 sub/file-0048
 create mode 100644 sub/file-0049
 create mode 100644 sub/file-0050
 create mode 100644 sub/file-0051
 create mode 100644 sub/file-0052
 create mode 100644 sub/file-0053
 create mode 100644 sub/file-0054
 create mode 100644 sub/file-0055
 create mode 100644 sub/file-0056
 create mode 100644 sub/file-0057
 create mode 100644 sub/file-0058
 create mode 100644 sub/file-0059
Switched to a new branch 'main'
From .
 * branch            left       -> FETCH_HEAD
 * branch            right      -> FETCH_HEAD
Submodule path 'sub1': checked out '3950f7ed37a2b5b8e95094de1b49ceba8eecb3d9'
rm 'b'
rm 'c'
rm 'd/e'
rm 'e'
[master 6e8ecd3] remove them all
 Author: A U Thor <author@example.com>
 60 files changed, 0 insertions(+), 0 deletions(-)
 delete mode 100644 sub/file-0000
 delete mode 100644 sub/file-0001
 delete mode 100644 sub/file-0002
 delete mode 100644 sub/file-0003
 delete mode 100644 sub/file-0004
 delete mode 100644 sub/file-0005
 delete mode 100644 sub/file-0006
 delete mode 100644 sub/file-0007
 delete mode 100644 sub/file-0008
 delete mode 100644 sub/file-0009
 delete mode 100644 sub/file-0010
 delete mode 100644 sub/file-0011
 delete mode 100644 sub/file-0012
 delete mode 100644 sub/file-0013
 delete mode 100644 sub/file-0014
 delete mode 100644 sub/file-0015
 delete mode 100644 sub/file-0016
 delete mode 100644 sub/file-0017
 delete mode 100644 sub/file-0018
 delete mode 100644 sub/file-0019
 delete mode 100644 sub/file-0020
 delete mode 100644 sub/file-0021
 delete mode 100644 sub/file-0022
 delete mode 100644 sub/file-0023
 delete mode 100644 sub/file-0024
 delete mode 100644 sub/file-0025
 delete mode 100644 sub/file-0026
 delete mode 100644 sub/file-0027
 delete mode 100644 sub/file-0028
 delete mode 100644 sub/file-0029
 delete mode 100644 sub/file-0030
 delete mode 100644 sub/file-0031
 delete mode 100644 sub/file-0032
 delete mode 100644 sub/file-0033
 delete mode 100644 sub/file-0034
 delete mode 100644 sub/file-0035
 delete mode 100644 sub/file-0036
 delete mode 100644 sub/file-0037
 delete mode 100644 sub/file-0038
 delete mode 100644 sub/file-0039
 delete mode 100644 sub/file-0040
 delete mode 100644 sub/file-0041
 delete mode 100644 sub/file-0042
 delete mode 100644 sub/file-0043
 delete mode 100644 sub/file-0044
 delete mode 100644 sub/file-0045
 delete mode 100644 sub/file-0046
 delete mode 100644 sub/file-0047
 delete mode 100644 sub/file-0048
 delete mode 100644 sub/file-0049
 delete mode 100644 sub/file-0050
 delete mode 100644 sub/file-0051
 delete mode 100644 sub/file-0052
 delete mode 100644 sub/file-0053
 delete mode 100644 sub/file-0054
 delete mode 100644 sub/file-0055
 delete mode 100644 sub/file-0056
 delete mode 100644 sub/file-0057
 delete mode 100644 sub/file-0058
 delete mode 100644 sub/file-0059
ok 1 - setup

expecting success: 
	# We have to run from a sub-directory to trigger prune_path
	# Then we finally get to run our --with-tree test
	(
		cd sub &&
		git ls-files --with-tree=HEAD~1 >../output
	)

ok 2 - git -ls-files --with-tree should succeed from subdir

expecting success: test_cmp expected output
Fast-forwarding to: 897c20684b5db8602798bc55d628f0a264841fec
ok 3 - git -ls-files --with-tree should add entries from named tree.
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.

# passed all 3 test(s)
1..3
warning: unable to rmdir sub1: Directory not empty
Switched to branch 'remove_sub1'
Your branch is up-to-date with 'origin/remove_sub1'.
[main 936a240] base
 Author: A U Thor <author@example.com>
 21 files changed, 41 insertions(+), 1 deletion(-)
 create mode 100644 actual
 create mode 100644 actual-err
 create mode 100644 actual-files
 rename b => a~b7f3e7f677ef7001dcb4b810583c9259a210141d (50%)
 rename c => a~b7f3e7f677ef7001dcb4b810583c9259a210141d_0 (50%)
 delete mode 100644 d/e
 create mode 100644 d~9d284b3a95aea72df4581977e913e55da89d5e3d
 create mode 100644 d~9d284b3a95aea72df4581977e913e55da89d5e3d_0
 create mode 100644 expected
 create mode 100644 expected-err
 create mode 100644 expected-files
 create mode 100644 ours-has-rename-index
 create mode 100644 ours-has-rename-work/b/c
 create mode 100644 out
 create mode 100644 simple/bar
 create mode 100644 sub1
 create mode 100644 sub2/file1
 create mode 100644 sub2/file2
 create mode 100644 sub2/file3
 create mode 100644 theirs-has-rename-index
 rename e => theirs-has-rename-work/e (100%)
Trying simple merge with bd0edcc3f6e0375d96ab0d02fcc4c4a1fe1d8c5f
*** t3070-wildmatch.sh ***
Switched to a new branch 'other'
Merge made by the 'octopus' strategy.
[other bae2f6d] changesimplefile
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 four.t  | 1 +
 three.t | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 four.t
 create mode 100644 three.t
fatal: Needed a single revision
Switched to branch 'main'
rm 'sub1'
ok 26 - git checkout -f: 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
		)
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3070-wildmatch/.git/
ok 9 - merge FETCH_HEAD octopus non-fast-forward (ff)

expecting success: 
	t3033_reset &&
	git fetch . left right &&
	git merge FETCH_HEAD &&
	# two (master) is not an ancestor of three (left) and four (right)
	test_must_fail git rev-parse --verify HEAD^4 &&
	git rev-parse HEAD^1 HEAD^2 HEAD^3 | sort >actual &&
	git rev-parse two three four | sort >expect &&
	test_cmp expect actual

expecting success: 
	    test-wildmatch wildmatch 'foo' 'foo'
	
[main 348ffc4] changefiletodir
 Author: A U Thor <author@example.com>
 4 files changed, 1 deletion(-)
 delete mode 100644 sub1
 rename {sub2 => sub1}/file1 (100%)
 rename {sub2 => sub1}/file2 (100%)
 rename {sub2 => sub1}/file3 (100%)
ok 1 - wildmatch:     match 'foo' 'foo'

expecting success: 
	    ! test-wildmatch wildmatch 'foo' 'bar'
	
Reset branch 'master'
ok 2 - wildmatch:  no match 'foo' 'bar'

expecting success: 
	    test-wildmatch wildmatch '' ''
	
ok 3 - wildmatch:     match '' ''

expecting success: 
	    test-wildmatch wildmatch 'foo' '???'
	
Merging:
348ffc4 changefiletodir
virtual other
found 1 common ancestor:
936a240 base
Skipped sub1/file3 (merged same as existing)
Skipped sub1/file2 (merged same as existing)
Skipped sub1/file1 (merged same as existing)
Merge made by the 'recursive' strategy.
ok 4 - wildmatch:     match 'foo' '???'

expecting success: 
	    ! test-wildmatch wildmatch 'foo' '??'
	
 simple/bar | 1 +
 1 file changed, 1 insertion(+)
ok 34 - merging with triple rename across D/F conflict

ok 5 - wildmatch:  no match 'foo' '??'

# still have 3 known breakage(s)
# passed all remaining 31 test(s)
expecting success: 
	    test-wildmatch wildmatch 'foo' '*'
	
1..34
ok 6 - wildmatch:     match 'foo' '*'

expecting success: 
	    test-wildmatch wildmatch 'foo' 'f*'
	
ok 7 - wildmatch:     match 'foo' 'f*'

expecting success: 
	    ! test-wildmatch wildmatch 'foo' '*f'
	
ok 8 - wildmatch:  no match 'foo' '*f'

expecting success: 
	    test-wildmatch wildmatch 'foo' '*foo*'
	
From .
 * branch            left       -> FETCH_HEAD
 * branch            right      -> FETCH_HEAD
Cloning into 'submodule_update'...
ok 9 - wildmatch:     match 'foo' '*foo*'

expecting success: 
	    test-wildmatch wildmatch 'foobar' '*ob*a*r*'
	
ok 10 - wildmatch:     match 'foobar' '*ob*a*r*'

expecting success: 
	    test-wildmatch wildmatch 'aaaaaaabababab' '*ab'
	
ok 11 - wildmatch:     match 'aaaaaaabababab' '*ab'

expecting success: 
	    test-wildmatch wildmatch 'foo*' 'foo\*'
	
ok 12 - wildmatch:     match 'foo*' 'foo\*'

expecting success: 
	    ! test-wildmatch wildmatch 'foobar' 'foo\*bar'
	
*** t3100-ls-tree-restrict.sh ***
done.
ok 13 - wildmatch:  no match 'foobar' 'foo\*bar'

expecting success: 
	    test-wildmatch wildmatch 'f\oo' 'f\\oo'
	
ok 14 - wildmatch:     match 'f\oo' 'f\\oo'

expecting success: 
	    test-wildmatch wildmatch 'ball' '*[al]?'
	
Trying simple merge with 897c20684b5db8602798bc55d628f0a264841fec
ok 15 - wildmatch:     match 'ball' '*[al]?'

expecting success: 
	    ! test-wildmatch wildmatch 'ten' '[ten]'
	
ok 16 - wildmatch:  no match 'ten' '[ten]'

expecting success: 
	    ! test-wildmatch wildmatch 'ten' '**[!te]'
	
ok 17 - wildmatch:  no match 'ten' '**[!te]'

expecting success: 
	    ! test-wildmatch wildmatch 'ten' '**[!ten]'
	
Trying simple merge with bd0edcc3f6e0375d96ab0d02fcc4c4a1fe1d8c5f
ok 18 - wildmatch:  no match 'ten' '**[!ten]'

expecting success: 
	    test-wildmatch wildmatch 'ten' 't[a-g]n'
	
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 19 - wildmatch:     match 'ten' 't[a-g]n'

expecting success: 
	    ! test-wildmatch wildmatch 'ten' 't[!a-g]n'
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3100-ls-tree-restrict/.git/
ok 20 - wildmatch:  no match 'ten' 't[!a-g]n'

expecting success: 
	    test-wildmatch wildmatch 'ton' 't[!a-g]n'
	
Merge made by the 'octopus' strategy.
expecting success: mkdir path2 path2/baz &&
     echo Hi >path0 &&
     test_ln_s_add path0 path1 &&
     test_ln_s_add ../path1 path2/bazbo &&
     echo Lo >path2/foo &&
     echo Mi >path2/baz/b &&
     find path? \( -type f -o -type l \) -print |
     xargs git update-index --add &&
     tree=`git write-tree` &&
     echo $tree
 four.t  | 1 +
 three.t | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 four.t
 create mode 100644 three.t
ok 21 - wildmatch:     match 'ton' 't[!a-g]n'

expecting success: 
	    test-wildmatch wildmatch 'ton' 't[^a-g]n'
	
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 22 - wildmatch:     match 'ton' 't[^a-g]n'

expecting success: 
	    test-wildmatch wildmatch 'a]b' 'a[]]b'
	
fatal: Needed a single revision
ok 23 - wildmatch:     match 'a]b' 'a[]]b'

expecting success: 
	    test-wildmatch wildmatch 'a-b' 'a[]-]b'
	
prerequisite SYMLINKS ok
ok 24 - wildmatch:     match 'a-b' 'a[]-]b'

expecting success: 
	    test-wildmatch wildmatch 'a]b' 'a[]-]b'
	
ok 25 - wildmatch:     match 'a]b' 'a[]-]b'

expecting success: 
	    ! test-wildmatch wildmatch 'aab' 'a[]-]b'
	
ok 26 - wildmatch:  no match 'aab' 'a[]-]b'

expecting success: 
	    test-wildmatch wildmatch 'aab' 'a[]a-]b'
	
ok 27 - wildmatch:     match 'aab' 'a[]a-]b'

expecting success: 
	    test-wildmatch wildmatch ']' ']'
	
ok 10 - merge FETCH_HEAD octopus fast-forward (does not ff)

expecting success: 
	t3033_reset &&
	git fetch . left right &&
	git merge --no-ff FETCH_HEAD &&
	test_must_fail git rev-parse --verify HEAD^4 &&
	git rev-parse HEAD^1 HEAD^2 HEAD^3 | sort >actual &&
	git rev-parse two three four | sort >expect &&
	test_cmp expect actual

ok 28 - wildmatch:     match ']' ']'

expecting success: 
	    ! test-wildmatch wildmatch 'foo/baz/bar' 'foo*bar'
	
ok 29 - wildmatch:  no match 'foo/baz/bar' 'foo*bar'

expecting success: 
	    ! test-wildmatch wildmatch 'foo/baz/bar' 'foo**bar'
	
Reset branch 'master'
ok 30 - wildmatch:  no match 'foo/baz/bar' 'foo**bar'

expecting success: 
	    ! test-wildmatch wildmatch 'foobazbar' 'foo**bar'
	
ok 31 - wildmatch:  no match 'foobazbar' 'foo**bar'

expecting success: 
	    test-wildmatch wildmatch 'foo/baz/bar' 'foo/**/bar'
	
a384d4f8dd786f29d6da4705dee4c2c0bc6b5049
ok 1 - setup

expecting success: git ls-tree $tree >current &&
     cat >expected <<\EOF &&
100644 blob X	path0
120000 blob X	path1
040000 tree X	path2
EOF
     test_output
ok 32 - wildmatch:     match 'foo/baz/bar' 'foo/**/bar'

expecting success: 
	    test-wildmatch wildmatch 'foo/baz/bar' 'foo/**/**/bar'
	
ok 33 - wildmatch:     match 'foo/baz/bar' 'foo/**/**/bar'

expecting success: 
	    test-wildmatch wildmatch 'foo/b/a/z/bar' 'foo/**/bar'
	
ok 34 - wildmatch:     match 'foo/b/a/z/bar' 'foo/**/bar'

expecting success: 
	    test-wildmatch wildmatch 'foo/b/a/z/bar' 'foo/**/**/bar'
	
ok 2 - ls-tree plain

expecting success: git ls-tree -r $tree >current &&
     cat >expected <<\EOF &&
100644 blob X	path0
120000 blob X	path1
100644 blob X	path2/baz/b
120000 blob X	path2/bazbo
100644 blob X	path2/foo
EOF
     test_output
ok 35 - wildmatch:     match 'foo/b/a/z/bar' 'foo/**/**/bar'

expecting success: 
	    test-wildmatch wildmatch 'foo/bar' 'foo/**/bar'
	
ok 36 - wildmatch:     match 'foo/bar' 'foo/**/bar'

expecting success: 
	    test-wildmatch wildmatch 'foo/bar' 'foo/**/**/bar'
	
ok 37 - wildmatch:     match 'foo/bar' 'foo/**/**/bar'

expecting success: 
	    ! test-wildmatch wildmatch 'foo/bar' 'foo?bar'
	
ok 3 - ls-tree recursive

expecting success: git ls-tree -r -t $tree >current &&
     cat >expected <<\EOF &&
100644 blob X	path0
120000 blob X	path1
040000 tree X	path2
040000 tree X	path2/baz
100644 blob X	path2/baz/b
120000 blob X	path2/bazbo
100644 blob X	path2/foo
EOF
     test_output
ok 38 - wildmatch:  no match 'foo/bar' 'foo?bar'

expecting success: 
	    ! test-wildmatch wildmatch 'foo/bar' 'foo[/]bar'
	
From .
 * branch            left       -> FETCH_HEAD
 * branch            right      -> FETCH_HEAD
ok 39 - wildmatch:  no match 'foo/bar' 'foo[/]bar'

expecting success: 
	    ! test-wildmatch wildmatch 'foo/bar' 'f[^eiu][^eiu][^eiu][^eiu][^eiu]r'
	
ok 40 - wildmatch:  no match 'foo/bar' 'f[^eiu][^eiu][^eiu][^eiu][^eiu]r'

expecting success: 
	    test-wildmatch wildmatch 'foo-bar' 'f[^eiu][^eiu][^eiu][^eiu][^eiu]r'
	
ok 41 - wildmatch:     match 'foo-bar' 'f[^eiu][^eiu][^eiu][^eiu][^eiu]r'

expecting success: 
	    test-wildmatch wildmatch 'foo' '**/foo'
	
ok 4 - ls-tree recursive with -t

expecting success: git ls-tree -r -d $tree >current &&
     cat >expected <<\EOF &&
040000 tree X	path2
040000 tree X	path2/baz
EOF
     test_output
ok 42 - wildmatch:     match 'foo' '**/foo'

expecting success: 
	    test-wildmatch wildmatch 'XXX/foo' '**/foo'
	
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 43 - wildmatch:     match 'XXX/foo' '**/foo'

expecting success: 
	    test-wildmatch wildmatch 'bar/baz/foo' '**/foo'
	
ok 44 - wildmatch:     match 'bar/baz/foo' '**/foo'

expecting success: 
	    ! test-wildmatch wildmatch 'bar/baz/foo' '*/foo'
	
ok 5 - ls-tree recursive with -d

expecting success: git ls-tree $tree path >current &&
     cat >expected <<\EOF &&
EOF
     test_output
ok 45 - wildmatch:  no match 'bar/baz/foo' '*/foo'

expecting success: 
	    ! test-wildmatch wildmatch 'foo/bar/baz' '**/bar*'
	
Trying simple merge with 897c20684b5db8602798bc55d628f0a264841fec
ok 46 - wildmatch:  no match 'foo/bar/baz' '**/bar*'

expecting success: 
	    test-wildmatch wildmatch 'deep/foo/bar/baz' '**/bar/*'
	
ok 6 - ls-tree filtered with path

expecting success: git ls-tree $tree path1 path0 >current &&
     cat >expected <<\EOF &&
100644 blob X	path0
120000 blob X	path1
EOF
     test_output
ok 47 - wildmatch:     match 'deep/foo/bar/baz' '**/bar/*'

expecting success: 
	    ! test-wildmatch wildmatch 'deep/foo/bar/baz/' '**/bar/*'
	
ok 48 - wildmatch:  no match 'deep/foo/bar/baz/' '**/bar/*'

expecting success: 
	    test-wildmatch wildmatch 'deep/foo/bar/baz/' '**/bar/**'
	
ok 49 - wildmatch:     match 'deep/foo/bar/baz/' '**/bar/**'

expecting success: 
	    ! test-wildmatch wildmatch 'deep/foo/bar' '**/bar/*'
	
Trying simple merge with bd0edcc3f6e0375d96ab0d02fcc4c4a1fe1d8c5f
ok 50 - wildmatch:  no match 'deep/foo/bar' '**/bar/*'

expecting success: 
	    test-wildmatch wildmatch 'deep/foo/bar/' '**/bar/**'
	
ok 7 - ls-tree filtered with path1 path0

expecting success: git ls-tree $tree path0/ >current &&
     cat >expected <<\EOF &&
EOF
     test_output
ok 51 - wildmatch:     match 'deep/foo/bar/' '**/bar/**'

expecting success: 
	    ! test-wildmatch wildmatch 'foo/bar/baz' '**/bar**'
	
ok 52 - wildmatch:  no match 'foo/bar/baz' '**/bar**'

expecting success: 
	    test-wildmatch wildmatch 'foo/bar/baz/x' '*/bar/**'
	
Merge made by the 'octopus' strategy.
ok 53 - wildmatch:     match 'foo/bar/baz/x' '*/bar/**'

expecting success: 
	    ! test-wildmatch wildmatch 'deep/foo/bar/baz/x' '*/bar/**'
	
ok 8 - ls-tree filtered with path0/

expecting success: git ls-tree $tree path2 >current &&
     cat >expected <<\EOF &&
040000 tree X	path2
EOF
     test_output
 four.t  | 1 +
 three.t | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 four.t
 create mode 100644 three.t
ok 54 - wildmatch:  no match 'deep/foo/bar/baz/x' '*/bar/**'

expecting success: 
	    test-wildmatch wildmatch 'deep/foo/bar/baz/x' '**/bar/*/*'
	
Cloning into 'sub1'...
ok 55 - wildmatch:     match 'deep/foo/bar/baz/x' '**/bar/*/*'

expecting success: 
	    ! test-wildmatch wildmatch 'acrt' 'a[c-c]st'
	
fatal: Needed a single revision
ok 56 - wildmatch:  no match 'acrt' 'a[c-c]st'

expecting success: 
	    test-wildmatch wildmatch 'acrt' 'a[c-c]rt'
	
ok 9 - ls-tree filtered with path2

expecting success: git ls-tree $tree path2/ >current &&
     cat >expected <<\EOF &&
040000 tree X	path2/baz
120000 blob X	path2/bazbo
100644 blob X	path2/foo
EOF
     test_output
ok 57 - wildmatch:     match 'acrt' 'a[c-c]rt'

expecting success: 
	    ! test-wildmatch wildmatch ']' '[!]-]'
	
ok 58 - wildmatch:  no match ']' '[!]-]'

expecting success: 
	    test-wildmatch wildmatch 'a' '[!]-]'
	
done.
ok 59 - wildmatch:     match 'a' '[!]-]'

expecting success: 
	    ! test-wildmatch wildmatch '' '\'
	
ok 10 - ls-tree filtered with path2/

expecting success: git ls-tree $tree path2/baz >current &&
     cat >expected <<\EOF &&
040000 tree X	path2/baz
EOF
     test_output
ok 60 - wildmatch:  no match '' '\'

expecting success: 
	    ! test-wildmatch wildmatch '\' '\'
	
ok 11 - merge FETCH_HEAD octopus non-fast-forward

ok 61 - wildmatch:  no match '\' '\'

expecting success: 
	    ! test-wildmatch wildmatch 'XXX/\' '*/\'
	
# passed all 11 test(s)
1..11
ok 62 - wildmatch:  no match 'XXX/\' '*/\'

expecting success: 
	    test-wildmatch wildmatch 'XXX/\' '*/\\'
	
ok 11 - ls-tree filtered with path2/baz

expecting success: git ls-tree $tree path2/bak >current &&
     cat >expected <<\EOF &&
EOF
     test_output
ok 63 - wildmatch:     match 'XXX/\' '*/\\'

expecting success: 
	    test-wildmatch wildmatch 'foo' 'foo'
	
ok 64 - wildmatch:     match 'foo' 'foo'

expecting success: 
	    test-wildmatch wildmatch '@foo' '@foo'
	
ok 65 - wildmatch:     match '@foo' '@foo'

expecting success: 
	    ! test-wildmatch wildmatch 'foo' '@foo'
	
ok 12 - ls-tree filtered with path2/bak

expecting success: git ls-tree -t $tree path2/bak >current &&
     cat >expected <<\EOF &&
040000 tree X	path2
EOF
     test_output
*** t3101-ls-tree-dirname.sh ***
ok 66 - wildmatch:  no match 'foo' '@foo'

expecting success: 
	    test-wildmatch wildmatch '[ab]' '\[ab]'
	
ok 67 - wildmatch:     match '[ab]' '\[ab]'

expecting success: 
	    test-wildmatch wildmatch '[ab]' '[[]ab]'
	
ok 13 - ls-tree -t filtered with path2/bak

ok 68 - wildmatch:     match '[ab]' '[[]ab]'

expecting success: git ls-tree $tree path2/baz path2/bazbo >current &&
     cat >expected <<\EOF &&
040000 tree X	path2/baz
120000 blob X	path2/bazbo
EOF
     test_output
expecting success: 
	    test-wildmatch wildmatch '[ab]' '[[:]ab]'
	
ok 69 - wildmatch:     match '[ab]' '[[:]ab]'

expecting success: 
	    ! test-wildmatch wildmatch '[ab]' '[[::]ab]'
	
ok 70 - wildmatch:  no match '[ab]' '[[::]ab]'

expecting success: 
	    test-wildmatch wildmatch '[ab]' '[[:digit]ab]'
	
ok 14 - ls-tree with one path a prefix of the other

ok 71 - wildmatch:     match '[ab]' '[[:digit]ab]'

# passed all 14 test(s)
1..14
expecting success: 
	    test-wildmatch wildmatch '[ab]' '[\[:]ab]'
	
Submodule path 'sub1': checked out '3950f7ed37a2b5b8e95094de1b49ceba8eecb3d9'
ok 72 - wildmatch:     match '[ab]' '[\[:]ab]'

expecting success: 
	    test-wildmatch wildmatch '?a?b' '\??\?b'
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3101-ls-tree-dirname/.git/
expecting success: 
	echo 111 >1.txt &&
	echo 222 >2.txt &&
	mkdir path0 path0/a path0/a/b path0/a/b/c &&
	echo 111 >path0/a/b/c/1.txt &&
	mkdir path1 path1/b path1/b/c &&
	echo 111 >path1/b/c/1.txt &&
	mkdir path2 &&
	echo 111 >path2/1.txt &&
	mkdir path3 &&
	echo 111 >path3/1.txt &&
	echo 222 >path3/2.txt &&
	find *.txt path* \( -type f -o -type l \) -print |
	xargs git update-index --add &&
	tree=`git write-tree` &&
	echo $tree

ok 73 - wildmatch:     match '?a?b' '\??\?b'

expecting success: 
	    test-wildmatch wildmatch 'abc' '\a\b\c'
	
ok 74 - wildmatch:     match 'abc' '\a\b\c'

expecting success: 
	    ! test-wildmatch wildmatch 'foo' ''
	
*** t3102-ls-tree-wildcards.sh ***
ok 75 - wildmatch:  no match 'foo' ''

expecting success: 
	    test-wildmatch wildmatch 'foo/bar/baz/to' '**/t[o]'
	
ok 76 - wildmatch:     match 'foo/bar/baz/to' '**/t[o]'

expecting success: 
	    test-wildmatch wildmatch 'a1B' '[[:alpha:]][[:digit:]][[:upper:]]'
	
ok 77 - wildmatch:     match 'a1B' '[[:alpha:]][[:digit:]][[:upper:]]'

expecting success: 
	    ! test-wildmatch wildmatch 'a' '[[:digit:][:upper:][:space:]]'
	
ok 78 - wildmatch:  no match 'a' '[[:digit:][:upper:][:space:]]'

expecting success: 
	    test-wildmatch wildmatch 'A' '[[:digit:][:upper:][:space:]]'
	
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
ok 79 - wildmatch:     match 'A' '[[:digit:][:upper:][:space:]]'

expecting success: 
	    test-wildmatch wildmatch '1' '[[:digit:][:upper:][:space:]]'
	
ok 80 - wildmatch:     match '1' '[[:digit:][:upper:][:space:]]'

expecting success: 
	    ! test-wildmatch wildmatch '1' '[[:digit:][:upper:][:spaci:]]'
	
ef2ea4d6de8ec0863f430e4cad7468ce74f60aa7
ok 1 - setup

expecting success: 
	git ls-tree $tree >current &&
	cat >expected <<\EOF &&
100644 blob X	1.txt
100644 blob X	2.txt
040000 tree X	path0
040000 tree X	path1
040000 tree X	path2
040000 tree X	path3
EOF
	test_output

ok 81 - wildmatch:  no match '1' '[[:digit:][:upper:][:spaci:]]'

expecting success: 
	    test-wildmatch wildmatch ' ' '[[:digit:][:upper:][:space:]]'
	
ok 82 - wildmatch:     match ' ' '[[:digit:][:upper:][:space:]]'

expecting success: 
	    ! test-wildmatch wildmatch '.' '[[:digit:][:upper:][:space:]]'
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3102-ls-tree-wildcards/.git/
ok 83 - wildmatch:  no match '.' '[[:digit:][:upper:][:space:]]'

expecting success: 
	    test-wildmatch wildmatch '.' '[[:digit:][:punct:][:space:]]'
	
ok 2 - ls-tree plain

expecting success: 
	git ls-tree -r $tree >current &&
	cat >expected <<\EOF &&
100644 blob X	1.txt
100644 blob X	2.txt
100644 blob X	path0/a/b/c/1.txt
100644 blob X	path1/b/c/1.txt
100644 blob X	path2/1.txt
100644 blob X	path3/1.txt
100644 blob X	path3/2.txt
EOF
	test_output

expecting success: 
	mkdir a aa "a[a]" &&
	touch a/one aa/two "a[a]/three" &&
	git add a/one aa/two "a[a]/three" &&
	git commit -m test

ok 84 - wildmatch:     match '.' '[[:digit:][:punct:][:space:]]'

expecting success: 
	    test-wildmatch wildmatch '5' '[[:xdigit:]]'
	
ok 85 - wildmatch:     match '5' '[[:xdigit:]]'

expecting success: 
	    test-wildmatch wildmatch 'f' '[[:xdigit:]]'
	
ok 86 - wildmatch:     match 'f' '[[:xdigit:]]'

expecting success: 
	    test-wildmatch wildmatch 'D' '[[:xdigit:]]'
	
ok 3 - ls-tree recursive

expecting success: 
	git ls-tree $tree 1.txt >current &&
	cat >expected <<\EOF &&
100644 blob X	1.txt
EOF
	test_output

ok 87 - wildmatch:     match 'D' '[[:xdigit:]]'

expecting success: 
	    test-wildmatch wildmatch '_' '[[:alnum:][:alpha:][:blank:][:cntrl:][:digit:][:graph:][:lower:][:print:][:punct:][:space:][:upper:][:xdigit:]]'
	
ok 88 - wildmatch:     match '_' '[[:alnum:][:alpha:][:blank:][:cntrl:][:digit:][:graph:][:lower:][:print:][:punct:][:space:][:upper:][:xdigit:]]'

expecting success: 
	    test-wildmatch wildmatch '_' '[[:alnum:][:alpha:][:blank:][:cntrl:][:digit:][:graph:][:lower:][:print:][:punct:][:space:][:upper:][:xdigit:]]'
	
warning: unable to rmdir sub1: Directory not empty
Switched to branch 'remove_sub1'
Your branch is up-to-date with 'origin/remove_sub1'.
ok 89 - wildmatch:     match '_' '[[:alnum:][:alpha:][:blank:][:cntrl:][:digit:][:graph:][:lower:][:print:][:punct:][:space:][:upper:][:xdigit:]]'

expecting success: 
	    test-wildmatch wildmatch '.' '[^[:alnum:][:alpha:][:blank:][:cntrl:][:digit:][:lower:][:space:][:upper:][:xdigit:]]'
	
ok 4 - ls-tree filter 1.txt

expecting success: 
	git ls-tree $tree path1/b/c/1.txt >current &&
	cat >expected <<\EOF &&
100644 blob X	path1/b/c/1.txt
EOF
	test_output

ok 90 - wildmatch:     match '.' '[^[:alnum:][:alpha:][:blank:][:cntrl:][:digit:][:lower:][:space:][:upper:][:xdigit:]]'

expecting success: 
	    test-wildmatch wildmatch '5' '[a-c[:digit:]x-z]'
	
[master (root-commit) dc06dd9] test
 Author: A U Thor <author@example.com>
 3 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 a/one
 create mode 100644 a[a]/three
 create mode 100644 aa/two
ok 1 - setup

expecting success: 
	cat >expect <<-\EOF &&
	100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391	a[a]/three
	EOF
	git ls-tree -r HEAD "a[a]" >actual &&
	test_cmp expect actual

ok 91 - wildmatch:     match '5' '[a-c[:digit:]x-z]'

expecting success: 
	    test-wildmatch wildmatch 'b' '[a-c[:digit:]x-z]'
	
ok 92 - wildmatch:     match 'b' '[a-c[:digit:]x-z]'

expecting success: 
	    test-wildmatch wildmatch 'y' '[a-c[:digit:]x-z]'
	
ok 5 - ls-tree filter path1/b/c/1.txt

expecting success: 
	git ls-tree $tree 1.txt path0/a/b/c/1.txt \
		path1/b/c/1.txt path2/1.txt path3/1.txt >current &&
	cat >expected <<\EOF &&
100644 blob X	1.txt
100644 blob X	path0/a/b/c/1.txt
100644 blob X	path1/b/c/1.txt
100644 blob X	path2/1.txt
100644 blob X	path3/1.txt
EOF
	test_output

ok 2 - ls-tree a[a] matches literally

expecting success: 
	cat >expect <<-\EOF &&
	100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391	../a[a]/three
	EOF
	( cd aa && git ls-tree -r HEAD "../a[a]"; ) >actual &&
	test_cmp expect actual

ok 93 - wildmatch:     match 'y' '[a-c[:digit:]x-z]'

expecting success: 
	    ! test-wildmatch wildmatch 'q' '[a-c[:digit:]x-z]'
	
ok 94 - wildmatch:  no match 'q' '[a-c[:digit:]x-z]'

expecting success: 
	    test-wildmatch wildmatch ']' '[\\-^]'
	
ok 95 - wildmatch:     match ']' '[\\-^]'

expecting success: 
	    ! test-wildmatch wildmatch '[' '[\\-^]'
	
ok 3 - ls-tree outside prefix
ok 6 - ls-tree filter all 1.txt files


expecting success: 
	git ls-tree $tree path3 path2 path0/a/b/c path1/b/c path0/a >current &&
	cat >expected <<\EOF &&
040000 tree X	path0/a/b/c
040000 tree X	path1/b/c
040000 tree X	path2
040000 tree X	path3
EOF
	test_output

checking known breakage: 
	git ls-files ":(exclude)a" "a*" >expect &&
	git ls-tree --name-only -r HEAD ":(exclude)a" "a*" >actual &&
	test_cmp expect actual

ok 96 - wildmatch:  no match '[' '[\\-^]'

expecting success: 
	    test-wildmatch wildmatch '-' '[\-_]'
	
ok 97 - wildmatch:     match '-' '[\-_]'

expecting success: 
	    test-wildmatch wildmatch ']' '[\]]'
	
fatal: :(exclude)a: pathspec magic not supported by this command: 'exclude'
not ok 4 - ls-tree does not yet support negated pathspec # TODO known breakage

ok 98 - wildmatch:     match ']' '[\]]'

expecting success: 
	    ! test-wildmatch wildmatch '\]' '[\]]'
	
# still have 1 known breakage(s)
# passed all remaining 3 test(s)
1..4
ok 7 - ls-tree filter directories

expecting success: 
	git ls-tree $tree 1.txt ./1.txt .//1.txt \
		path3/1.txt path3/./1.txt path3 path3// >current &&
	cat >expected <<\EOF &&
100644 blob X	1.txt
100644 blob X	path3/1.txt
100644 blob X	path3/2.txt
EOF
	test_output

ok 99 - wildmatch:  no match '\]' '[\]]'

expecting success: 
	    ! test-wildmatch wildmatch '\' '[\]]'
	
ok 100 - wildmatch:  no match '\' '[\]]'

expecting success: 
	    ! test-wildmatch wildmatch 'ab' 'a[]b'
	
ok 101 - wildmatch:  no match 'ab' 'a[]b'

expecting success: 
	    ! test-wildmatch wildmatch 'a[]b' 'a[]b'
	
ok 8 - ls-tree filter odd names

expecting success: 
	git ls-tree $tree 1.txt/ abc.txt \
		path3//23.txt path3/2.txt/// >current &&
	>expected &&
	test_output

*** t3103-ls-tree-misc.sh ***
ok 102 - wildmatch:  no match 'a[]b' 'a[]b'

expecting success: 
	    ! test-wildmatch wildmatch 'ab[' 'ab['
	
ok 103 - wildmatch:  no match 'ab[' 'ab['

expecting success: 
	    ! test-wildmatch wildmatch 'ab' '[!'
	
ok 104 - wildmatch:  no match 'ab' '[!'

expecting success: 
	    ! test-wildmatch wildmatch 'ab' '[-'
	
ok 9 - ls-tree filter missing files and extra slashes

expecting success: 
	git ls-tree $tree pa path3/a >current &&
	>expected &&
	test_output

ok 105 - wildmatch:  no match 'ab' '[-'

ok 27 - git checkout -f: removed submodule leaves submodule containing a .git directory alone

expecting success: 
	    test-wildmatch wildmatch '-' '[-]'
	
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 106 - wildmatch:     match '-' '[-]'

expecting success: 
	    ! test-wildmatch wildmatch '-' '[a-'
	
ok 10 - ls-tree filter is leading path match

expecting success: 
	(
		cd path0 &&
		git ls-tree --full-name $tree a
	) >current &&
	cat >expected <<\EOF &&
040000 tree X	path0/a
EOF
	test_output

ok 107 - wildmatch:  no match '-' '[a-'

expecting success: 
	    ! test-wildmatch wildmatch '-' '[!a-'
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3103-ls-tree-misc/.git/
ok 108 - wildmatch:  no match '-' '[!a-'

expecting success: 
	    test-wildmatch wildmatch '-' '[--A]'
	
expecting success: 
	mkdir a &&
	touch a/one &&
	git add a/one &&
	git commit -m test

ok 109 - wildmatch:     match '-' '[--A]'

expecting success: 
	    test-wildmatch wildmatch '5' '[--A]'
	
ok 11 - ls-tree --full-name

expecting success: 
	(
		cd path1/b/c &&
		git ls-tree --full-tree $tree
	) >current &&
	cat >expected <<\EOF &&
100644 blob X	1.txt
100644 blob X	2.txt
040000 tree X	path0
040000 tree X	path1
040000 tree X	path2
040000 tree X	path3
EOF
	test_output

ok 110 - wildmatch:     match '5' '[--A]'

expecting success: 
	    test-wildmatch wildmatch ' ' '[ --]'
	
ok 111 - wildmatch:     match ' ' '[ --]'

expecting success: 
	    test-wildmatch wildmatch '$' '[ --]'
	
ok 112 - wildmatch:     match '$' '[ --]'

expecting success: 
	    test-wildmatch wildmatch '-' '[ --]'
	
ok 12 - ls-tree --full-tree

expecting success: 
	(
		cd path3/ &&
		git ls-tree --full-tree -r $tree
	) >current &&
	cat >expected <<\EOF &&
100644 blob X	1.txt
100644 blob X	2.txt
100644 blob X	path0/a/b/c/1.txt
100644 blob X	path1/b/c/1.txt
100644 blob X	path2/1.txt
100644 blob X	path3/1.txt
100644 blob X	path3/2.txt
EOF
	test_output

ok 113 - wildmatch:     match '-' '[ --]'

expecting success: 
	    ! test-wildmatch wildmatch '0' '[ --]'
	
ok 114 - wildmatch:  no match '0' '[ --]'

expecting success: 
	    test-wildmatch wildmatch '-' '[---]'
	
[master (root-commit) 98c8a2e] test
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 a/one
ok 1 - setup

expecting success: 
	rm -f .git/objects/5f/cffbd6e4c5c5b8d81f5e9314b20e338e3ffff5 &&
	test_must_fail git ls-tree -r HEAD

ok 115 - wildmatch:     match '-' '[---]'

expecting success: 
	    test-wildmatch wildmatch '-' '[------]'
	
ok 116 - wildmatch:     match '-' '[------]'

ok 13 - ls-tree --full-tree -r

expecting success: 
	    ! test-wildmatch wildmatch 'j' '[a-e-n]'
	
expecting success: 
	git ls-tree --abbrev=5 $tree >current &&
	sed -e "s/ $_x05[0-9a-f]*	/ X	/" <current >check &&
	cat >expected <<\EOF &&
100644 blob X	1.txt
100644 blob X	2.txt
040000 tree X	path0
040000 tree X	path1
040000 tree X	path2
040000 tree X	path3
EOF
	test_cmp expected check

ok 117 - wildmatch:  no match 'j' '[a-e-n]'

expecting success: 
	    test-wildmatch wildmatch '-' '[a-e-n]'
	
error: Could not read 5fcffbd6e4c5c5b8d81f5e9314b20e338e3ffff5
ok 118 - wildmatch:     match '-' '[a-e-n]'

ok 2 - ls-tree fails with non-zero exit code on broken tree

expecting success: 
	    test-wildmatch wildmatch 'a' '[!------]'
	
ok 119 - wildmatch:     match 'a' '[!------]'

# passed all 2 test(s)
1..2
expecting success: 
	    ! test-wildmatch wildmatch '[' '[]-a]'
	
ok 14 - ls-tree --abbrev=5

expecting success: 
	git ls-tree --name-only $tree >current &&
	cat >expected <<\EOF &&
1.txt
2.txt
path0
path1
path2
path3
EOF
	test_output

ok 120 - wildmatch:  no match '[' '[]-a]'

expecting success: 
	    test-wildmatch wildmatch '^' '[]-a]'
	
Cloning into 'submodule_update'...
ok 121 - wildmatch:     match '^' '[]-a]'

expecting success: 
	    ! test-wildmatch wildmatch '^' '[!]-a]'
	
ok 122 - wildmatch:  no match '^' '[!]-a]'

expecting success: 
	    test-wildmatch wildmatch '[' '[!]-a]'
	
*** t3200-branch.sh ***
ok 15 - ls-tree --name-only

expecting success: 
	git ls-tree --name-only -r $tree >current &&
	cat >expected <<\EOF &&
1.txt
2.txt
path0/a/b/c/1.txt
path1/b/c/1.txt
path2/1.txt
path3/1.txt
path3/2.txt
EOF
	test_output

ok 123 - wildmatch:     match '[' '[!]-a]'

expecting success: 
	    test-wildmatch wildmatch '^' '[a^bc]'
	
ok 124 - wildmatch:     match '^' '[a^bc]'

expecting success: 
	    test-wildmatch wildmatch '-b]' '[a-]b]'
	
ok 16 - ls-tree --name-only -r

done.
ok 125 - wildmatch:     match '-b]' '[a-]b]'

expecting success: 
	    ! test-wildmatch wildmatch '\' '[\]'
	
# passed all 16 test(s)
1..16
ok 126 - wildmatch:  no match '\' '[\]'

expecting success: 
	    test-wildmatch wildmatch '\' '[\\]'
	
ok 127 - wildmatch:     match '\' '[\\]'

expecting success: 
	    ! test-wildmatch wildmatch '\' '[!\\]'
	
ok 128 - wildmatch:  no match '\' '[!\\]'

expecting success: 
	    test-wildmatch wildmatch 'G' '[A-\\]'
	
ok 129 - wildmatch:     match 'G' '[A-\\]'

expecting success: 
	    ! test-wildmatch wildmatch 'aaabbb' 'b*a'
	
*** t3201-branch-contains.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3200-branch/.git/
ok 130 - wildmatch:  no match 'aaabbb' 'b*a'

expecting success: 
	    ! test-wildmatch wildmatch 'aabcaa' '*ba*'
	
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 131 - wildmatch:  no match 'aabcaa' '*ba*'

expecting success: 
	    test-wildmatch wildmatch ',' '[,]'
	
expecting success: 
	echo Hello >A &&
	git update-index --add A &&
	git commit -m "Initial commit." &&
	echo World >>A &&
	git update-index --add A &&
	git commit -m "Second commit." &&
	HEAD=$(git rev-parse --verify HEAD)

ok 132 - wildmatch:     match ',' '[,]'

expecting success: 
	    test-wildmatch wildmatch ',' '[\\,]'
	
ok 133 - wildmatch:     match ',' '[\\,]'

expecting success: 
	    test-wildmatch wildmatch '\' '[\\,]'
	
ok 134 - wildmatch:     match '\' '[\\,]'

expecting success: 
	    test-wildmatch wildmatch '-' '[,-.]'
	
[master (root-commit) e9a85cb] Initial commit.
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 A
ok 135 - wildmatch:     match '-' '[,-.]'

expecting success: 
	    ! test-wildmatch wildmatch '+' '[,-.]'
	
ok 136 - wildmatch:  no match '+' '[,-.]'

expecting success: 
	    ! test-wildmatch wildmatch '-.]' '[,-.]'
	
ok 137 - wildmatch:  no match '-.]' '[,-.]'

expecting success: 
	    test-wildmatch wildmatch '2' '[\1-\3]'
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3201-branch-contains/.git/
ok 138 - wildmatch:     match '2' '[\1-\3]'

expecting success: 
	    test-wildmatch wildmatch '3' '[\1-\3]'
	
expecting success: 

	>file &&
	git add file &&
	test_tick &&
	git commit -m initial &&
	git branch side &&

	echo 1 >file &&
	test_tick &&
	git commit -a -m "second on master" &&

	git checkout side &&
	echo 1 >file &&
	test_tick &&
	git commit -a -m "second on side" &&

	git merge master


[master f8df8af] Second commit.
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 139 - wildmatch:     match '3' '[\1-\3]'

expecting success: 
	    ! test-wildmatch wildmatch '4' '[\1-\3]'
	
ok 140 - wildmatch:  no match '4' '[\1-\3]'

expecting success: 
	    test-wildmatch wildmatch '\' '[[-\]]'
	
ok 1 - prepare a trivial repository

expecting success: 
	test_might_fail git branch --man --help </dev/null >/dev/null 2>&1 &&
	test_path_is_missing .git/refs/heads/--help

ok 141 - wildmatch:     match '\' '[[-\]]'

expecting success: 
	    test-wildmatch wildmatch '[' '[[-\]]'
	
ok 142 - wildmatch:     match '[' '[[-\]]'

ok 2 - git branch --help should not have created a bogus branch

expecting success: 
	    test-wildmatch wildmatch ']' '[[-\]]'
	
expecting success: 
	mkdir broken &&
	(
		cd broken &&
		git init &&
		>.git/refs/heads/master &&
		test_expect_code 129 git branch -h >usage 2>&1
	) &&
	test_i18ngrep "[Uu]sage" broken/usage

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

expecting success: 
	    ! test-wildmatch wildmatch '-' '[[-\]]'
	
ok 144 - wildmatch:  no match '-' '[[-\]]'

expecting success: 
	    test-wildmatch wildmatch '-adobe-courier-bold-o-normal--12-120-75-75-m-70-iso8859-1' '-*-*-*-*-*-*-12-*-*-*-m-*-*-*'
	
ok 145 - wildmatch:     match '-adobe-courier-bold-o-normal--12-120-75-75-m-70-iso8859-1' '-*-*-*-*-*-*-12-*-*-*-m-*-*-*'

expecting success: 
	    ! test-wildmatch wildmatch '-adobe-courier-bold-o-normal--12-120-75-75-X-70-iso8859-1' '-*-*-*-*-*-*-12-*-*-*-m-*-*-*'
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3200-branch/broken/.git/
ok 146 - wildmatch:  no match '-adobe-courier-bold-o-normal--12-120-75-75-X-70-iso8859-1' '-*-*-*-*-*-*-12-*-*-*-m-*-*-*'

expecting success: 
	    ! test-wildmatch wildmatch '-adobe-courier-bold-o-normal--12-120-75-75-/-70-iso8859-1' '-*-*-*-*-*-*-12-*-*-*-m-*-*-*'
	
ok 147 - wildmatch:  no match '-adobe-courier-bold-o-normal--12-120-75-75-/-70-iso8859-1' '-*-*-*-*-*-*-12-*-*-*-m-*-*-*'

expecting success: 
	    test-wildmatch wildmatch 'XXX/adobe/courier/bold/o/normal//12/120/75/75/m/70/iso8859/1' 'XXX/*/*/*/*/*/*/12/*/*/*/m/*/*/*'
	
usage: git branch [<options>] [-r | -a] [--merged | --no-merged]
ok 3 - branch -h in broken repository

expecting success: 
	git branch abc && test_path_is_file .git/refs/heads/abc

[master c77a0a9] second on master
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 148 - wildmatch:     match 'XXX/adobe/courier/bold/o/normal//12/120/75/75/m/70/iso8859/1' 'XXX/*/*/*/*/*/*/12/*/*/*/m/*/*/*'

expecting success: 
	    ! test-wildmatch wildmatch 'XXX/adobe/courier/bold/o/normal//12/120/75/75/X/70/iso8859/1' 'XXX/*/*/*/*/*/*/12/*/*/*/m/*/*/*'
	
ok 4 - git branch abc should create a branch

Switched to branch 'side'
expecting success: 
	git branch a/b/c && test_path_is_file .git/refs/heads/a/b/c

ok 149 - wildmatch:  no match 'XXX/adobe/courier/bold/o/normal//12/120/75/75/X/70/iso8859/1' 'XXX/*/*/*/*/*/*/12/*/*/*/m/*/*/*'

expecting success: 
	    test-wildmatch wildmatch 'abcd/abcdefg/abcdefghijk/abcdefghijklmnop.txt' '**/*a*b*g*n*t'
	
ok 150 - wildmatch:     match 'abcd/abcdefg/abcdefghijk/abcdefghijklmnop.txt' '**/*a*b*g*n*t'

expecting success: 
	    ! test-wildmatch wildmatch 'abcd/abcdefg/abcdefghijk/abcdefghijklmnop.txtz' '**/*a*b*g*n*t'
	
ok 5 - git branch a/b/c should create a branch

expecting success: 
	test_must_fail git branch HEAD

ok 151 - wildmatch:  no match 'abcd/abcdefg/abcdefghijk/abcdefghijklmnop.txtz' '**/*a*b*g*n*t'

expecting success: 
	    ! test-wildmatch wildmatch 'foo' '*/*/*'
	
[side 5a0fd8a] second on side
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
fatal: it does not make sense to create 'HEAD' manually
ok 152 - wildmatch:  no match 'foo' '*/*/*'

ok 6 - git branch HEAD should fail

expecting success: 
	    ! test-wildmatch wildmatch 'foo/bar' '*/*/*'
	
expecting success: 
	GIT_COMMITTER_DATE="2005-05-26 23:30" \
	git branch -l d/e/f &&
	test_path_is_file .git/refs/heads/d/e/f &&
	test_path_is_file .git/logs/refs/heads/d/e/f &&
	test_cmp expect .git/logs/refs/heads/d/e/f

ok 153 - wildmatch:  no match 'foo/bar' '*/*/*'

expecting success: 
	    test-wildmatch wildmatch 'foo/bba/arr' '*/*/*'
	
Merging:
5a0fd8a second on side
virtual master
found 1 common ancestor:
1bd44cb initial
Merge made by the 'recursive' strategy.
ok 154 - wildmatch:     match 'foo/bba/arr' '*/*/*'

expecting success: 
	    ! test-wildmatch wildmatch 'foo/bb/aa/rr' '*/*/*'
	
ok 1 - setup

expecting success: 

	git branch --contains=master >actual &&
	{
		echo "  master" && echo "* side"
	} >expect &&
	test_cmp expect actual


ok 155 - wildmatch:  no match 'foo/bb/aa/rr' '*/*/*'

expecting success: 
	    test-wildmatch wildmatch 'foo/bb/aa/rr' '**/**/**'
	
ok 7 - git branch -l d/e/f should create a branch and a log

expecting success: 
	git branch -d d/e/f &&
	test_path_is_missing .git/refs/heads/d/e/f &&
	test_must_fail git reflog exists refs/heads/d/e/f

ok 156 - wildmatch:     match 'foo/bb/aa/rr' '**/**/**'

expecting success: 
	    test-wildmatch wildmatch 'abcXdefXghi' '*X*i'
	
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule_update_repo/.) registered for path 'sub1'
Deleted branch d/e/f (was f8df8af).
ok 2 - branch --contains=master

expecting success: 

	git branch --contains master >actual &&
	{
		echo "  master" && echo "* side"
	} >expect &&
	test_cmp expect actual


ok 157 - wildmatch:     match 'abcXdefXghi' '*X*i'

expecting success: 
	    ! test-wildmatch wildmatch 'ab/cXd/efXg/hi' '*X*i'
	
ok 8 - git branch -d d/e/f should delete a branch and a log

expecting success: 
	git branch j &&
	git branch -d j &&
	git branch j/k

ok 158 - wildmatch:  no match 'ab/cXd/efXg/hi' '*X*i'

expecting success: 
	    test-wildmatch wildmatch 'ab/cXd/efXg/hi' '*/*X*/*/*i'
	
ok 3 - branch --contains master

expecting success: 

	git branch --contains=side >actual &&
	{
		echo "* side"
	} >expect &&
	test_cmp expect actual


ok 159 - wildmatch:     match 'ab/cXd/efXg/hi' '*/*X*/*/*i'

expecting success: 
	    test-wildmatch wildmatch 'ab/cXd/efXg/hi' '**/*X*/**/*i'
	
Deleted branch j (was f8df8af).
ok 160 - wildmatch:     match 'ab/cXd/efXg/hi' '**/*X*/**/*i'

expecting success: 
	    test-wildmatch pathmatch 'foo' 'foo'
	
ok 4 - branch --contains=side

expecting success: 

	git branch --contains=master master >actual &&
	{
		echo "  master"
	} >expect &&
	test_cmp expect actual


ok 161 - pathmatch:     match 'foo' 'foo'

expecting success: 
	    ! test-wildmatch pathmatch 'foo' 'fo'
	
ok 9 - git branch j/k should work after branch j has been deleted

expecting success: 
	git branch l/m &&
	git branch -d l/m &&
	git branch l

ok 5 - branch --contains with pattern implies --list

expecting success: 

	git branch --merged >actual &&
	{
		echo "  master" &&
		echo "* side"
	} >expect &&
	test_cmp expect actual


ok 162 - pathmatch:  no match 'foo' 'fo'

expecting success: 
	    test-wildmatch pathmatch 'foo/bar' 'foo/bar'
	
ok 163 - pathmatch:     match 'foo/bar' 'foo/bar'

expecting success: 
	    test-wildmatch pathmatch 'foo/bar' 'foo/*'
	
ok 6 - side: branch --merged

ok 164 - pathmatch:     match 'foo/bar' 'foo/*'

expecting success: 

	git branch --merged=side master >actual &&
	{
		echo "  master"
	} >expect &&
	test_cmp expect actual


expecting success: 
	    test-wildmatch pathmatch 'foo/bba/arr' 'foo/*'
	
Deleted branch l/m (was f8df8af).
ok 165 - pathmatch:     match 'foo/bba/arr' 'foo/*'

expecting success: 
	    test-wildmatch pathmatch 'foo/bba/arr' 'foo/**'
	
Cloning into 'sub1'...
ok 10 - git branch l should work after branch l/m has been deleted

expecting success: 
	test_expect_code 128 git branch -m 2>err &&
	test_i18ngrep "branch name required" err

ok 166 - pathmatch:     match 'foo/bba/arr' 'foo/**'

expecting success: 
	    test-wildmatch pathmatch 'foo/bba/arr' 'foo*'
	
ok 7 - branch --merged with pattern implies --list

expecting success: 

	git branch --no-merged >actual &&
	>expect &&
	test_cmp expect actual


ok 167 - pathmatch:     match 'foo/bba/arr' 'foo*'

expecting success: 
	    test-wildmatch pathmatch 'foo/bba/arr' 'foo**'
	
fatal: branch name required
ok 11 - git branch -m dumps usage

expecting success: 
	git branch -l m &&
	git branch -m m m/m &&
	git reflog exists refs/heads/m/m

ok 168 - pathmatch:     match 'foo/bba/arr' 'foo**'

expecting success: 
	    test-wildmatch pathmatch 'foo/bba/arr' 'foo/*arr'
	
ok 8 - side: branch --no-merged

expecting success: 

	git checkout master &&
	git branch --merged >actual &&
	{
		echo "* master"
	} >expect &&
	test_cmp expect actual


ok 169 - pathmatch:     match 'foo/bba/arr' 'foo/*arr'

expecting success: 
	    test-wildmatch pathmatch 'foo/bba/arr' 'foo/**arr'
	
Switched to branch 'master'
done.
ok 170 - pathmatch:     match 'foo/bba/arr' 'foo/**arr'

expecting success: 
	    ! test-wildmatch pathmatch 'foo/bba/arr' 'foo/*z'
	
ok 171 - pathmatch:  no match 'foo/bba/arr' 'foo/*z'

expecting success: 
	    ! test-wildmatch pathmatch 'foo/bba/arr' 'foo/**z'
	
ok 9 - master: branch --merged

expecting success: 

	git branch --no-merged >actual &&
	{
		echo "  side"
	} >expect &&
	test_cmp expect actual


ok 172 - pathmatch:  no match 'foo/bba/arr' 'foo/**z'

expecting success: 
	    test-wildmatch pathmatch 'foo/bar' 'foo?bar'
	
ok 12 - git branch -m m m/m should work

expecting success: 
	git branch -l n/n &&
	git branch -m n/n n &&
	git reflog exists refs/heads/n

ok 10 - master: branch --no-merged

expecting success: 

	git branch --no-merged=master master >actual &&
	>expect &&
	test_cmp expect actual


ok 173 - pathmatch:     match 'foo/bar' 'foo?bar'

expecting success: 
	    test-wildmatch pathmatch 'foo/bar' 'foo[/]bar'
	
ok 174 - pathmatch:     match 'foo/bar' 'foo[/]bar'

expecting success: 
	    ! test-wildmatch pathmatch 'foo' '*/*/*'
	
ok 175 - pathmatch:  no match 'foo' '*/*/*'

expecting success: 
	    ! test-wildmatch pathmatch 'foo/bar' '*/*/*'
	
ok 11 - branch --no-merged with pattern implies --list

expecting success: 

	test_must_fail git branch --contains=master -d &&
	test_must_fail git branch --contains=master -m foo


ok 176 - pathmatch:  no match 'foo/bar' '*/*/*'

expecting success: 
	    test-wildmatch pathmatch 'foo/bba/arr' '*/*/*'
	
usage: git branch [<options>] [-r | -a] [--merged | --no-merged]
   or: git branch [<options>] [-l] [-f] <branch-name> [<start-point>]
   or: git branch [<options>] [-r] (-d | -D) <branch-name>...
   or: git branch [<options>] (-m | -M) [<old-branch>] <new-branch>

Generic options
    -v, --verbose         show hash and subject, give twice for upstream branch
    -q, --quiet           suppress informational messages
    -t, --track           set up tracking mode (see git-pull(1))
    --set-upstream        change upstream info
    -u, --set-upstream-to <upstream>
                          change the upstream info
    --unset-upstream      Unset the upstream info
    --color[=<when>]      use colored output
    -r, --remotes         act on remote-tracking branches
    --contains <commit>   print only branches that contain the commit
    --abbrev[=<n>]        use <n> digits to display SHA-1s

Specific git-branch actions:
    -a, --all             list both remote-tracking and local branches
    -d, --delete          delete fully merged branch
    -D                    delete branch (even if not merged)
    -m, --move            move/rename a branch and its reflog
    -M                    move/rename a branch, even if target exists
    --list                list branch names
    -l, --create-reflog   create the branch's reflog
    --edit-description    edit the description for the branch
ok 13 - git branch -m n/n n should work
    -f, --force           force creation, move/rename, deletion
    --no-merged <commit>
  print only not merged branches
    --merged <commit>expecting success: 
     print only merged branches
    --column[=<style>]	git branch o/o &&
    list branches in columns

	git branch o/p &&
	test_must_fail git branch -m o/o o

ok 177 - pathmatch:     match 'foo/bba/arr' '*/*/*'

expecting success: 
	    test-wildmatch pathmatch 'foo/bb/aa/rr' '*/*/*'
	
ok 178 - pathmatch:     match 'foo/bb/aa/rr' '*/*/*'

expecting success: 
	    test-wildmatch pathmatch 'abcXdefXghi' '*X*i'
	
usage: git branch [<options>] [-r | -a] [--merged | --no-merged]
   or: git branch [<options>] [-l] [-f] <branch-name> [<start-point>]
   or: git branch [<options>] [-r] (-d | -D) <branch-name>...
   or: git branch [<options>] (-m | -M) [<old-branch>] <new-branch>

Generic options
    -v, --verbose         show hash and subject, give twice for upstream branch
    -q, --quiet           suppress informational messages
    -t, --track           set up tracking mode (see git-pull(1))
    --set-upstream        change upstream info
    -u, --set-upstream-to <upstream>
                          change the upstream info
    --unset-upstream      Unset the upstream info
    --color[=<when>]      use colored output
    -r, --remotes         act on remote-tracking branches
    --contains <commit>   print only branches that contain the commit
    --abbrev[=<n>]        use <n> digits to display SHA-1s

Specific git-branch actions:
    -a, --all             list both remote-tracking and local branches
    -d, --delete          delete fully merged branch
    -D                    delete branch (even if not merged)
    -m, --move            move/rename a branch and its reflog
    -M                    move/rename a branch, even if target exists
    --list                list branch names
    -l, --create-reflog   create the branch's reflog
    --edit-description    edit the description for the branch
    -f, --force           force creation, move/rename, deletion
    --no-merged <commit>  print only not merged branches
    --merged <commit>     print only merged branches
    --column[=<style>]    list branches in columns

ok 12 - implicit --list conflicts with modification options

expecting success: 
	git branch --track topic master &&
	git branch zzz topic &&
	git checkout topic &&
	test_commit foo &&
	git branch --merged topic >actual &&
	cat >expect <<-\EOF &&
	  master
	* topic
	  zzz
	EOF
	test_cmp expect actual &&
	git branch --verbose --merged topic >actual &&
	cat >expect <<-\EOF &&
	  master c77a0a9 second on master
	* topic  2c939f4 [ahead 1] foo
	  zzz    c77a0a9 second on master
	EOF
	test_cmp expect actual

ok 179 - pathmatch:     match 'abcXdefXghi' '*X*i'

expecting success: 
	    test-wildmatch pathmatch 'ab/cXd/efXg/hi' '*/*X*/*/*i'
	
Branch topic set up to track local branch master.
ok 180 - pathmatch:     match 'ab/cXd/efXg/hi' '*/*X*/*/*i'

expecting success: 
	    test-wildmatch pathmatch 'ab/cXd/efXg/hi' '*Xg*i'
	
error: 'refs/heads/o/p' exists; cannot create 'refs/heads/o'
fatal: Branch rename failed
ok 14 - git branch -m o/o o should fail when o/p exists

expecting success: 
	git branch o/q &&
	test_must_fail git branch -m o/q o/p

ok 181 - pathmatch:     match 'ab/cXd/efXg/hi' '*Xg*i'

expecting success: 
	    ! test-wildmatch wildmatch 'a' '[A-Z]'
	
Submodule path 'sub1': checked out '3950f7ed37a2b5b8e95094de1b49ceba8eecb3d9'
ok 182 - wildmatch:  no match 'a' '[A-Z]'

expecting success: 
	    test-wildmatch wildmatch 'A' '[A-Z]'
	
ok 183 - wildmatch:     match 'A' '[A-Z]'

expecting success: 
	    ! test-wildmatch wildmatch 'A' '[a-z]'
	
Switched to branch 'topic'
Your branch is up-to-date with 'master'.
fatal: A branch named 'o/p' already exists.
ok 15 - git branch -m o/q o/p should fail when o/p exists

ok 184 - wildmatch:  no match 'A' '[a-z]'

expecting success: 
	git branch -M o/q o/p

expecting success: 
	    test-wildmatch wildmatch 'a' '[a-z]'
	
ok 185 - wildmatch:     match 'a' '[a-z]'

expecting success: 
	    ! test-wildmatch wildmatch 'a' '[[:upper:]]'
	
ok 186 - wildmatch:  no match 'a' '[[:upper:]]'

expecting success: 
	    test-wildmatch wildmatch 'A' '[[:upper:]]'
	
ok 16 - git branch -M o/q o/p should work when o/p exists

expecting success: 
	git branch o/q &&
	git branch -m -f o/q o/p

[topic 2c939f4] foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo.t
ok 187 - wildmatch:     match 'A' '[[:upper:]]'

expecting success: 
	    ! test-wildmatch wildmatch 'A' '[[:lower:]]'
	
ok 188 - wildmatch:  no match 'A' '[[:lower:]]'

expecting success: 
	    test-wildmatch wildmatch 'a' '[[:lower:]]'
	
ok 189 - wildmatch:     match 'a' '[[:lower:]]'

expecting success: 
	    ! test-wildmatch wildmatch 'A' '[B-Za]'
	
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
ok 17 - git branch -m -f o/q o/p should work when o/p exists

expecting success: 
	git branch q &&
	git branch r &&
	test_must_fail git branch -m q r/q

ok 190 - wildmatch:  no match 'A' '[B-Za]'

expecting success: 
	    test-wildmatch wildmatch 'a' '[B-Za]'
	
ok 191 - wildmatch:     match 'a' '[B-Za]'

expecting success: 
	    ! test-wildmatch wildmatch 'A' '[B-a]'
	
warning: unable to rmdir sub1: Directory not empty
ok 192 - wildmatch:  no match 'A' '[B-a]'

expecting success: 
	    test-wildmatch wildmatch 'a' '[B-a]'
	
Switched to branch 'replace_sub1_with_directory'
Your branch is up-to-date with 'origin/replace_sub1_with_directory'.
test_must_fail: command succeeded: git checkout -f replace_sub1_with_directory
ok 193 - wildmatch:     match 'a' '[B-a]'

expecting success: 
	    ! test-wildmatch wildmatch 'z' '[Z-y]'
	
ok 13 - branch --merged with --verbose

# passed all 13 test(s)
1..13
ok 194 - wildmatch:  no match 'z' '[Z-y]'

expecting success: 
	    test-wildmatch wildmatch 'Z' '[Z-y]'
	
ok 195 - wildmatch:     match 'Z' '[Z-y]'

expecting success: 
	    test-wildmatch iwildmatch 'a' '[A-Z]'
	
not ok 28 - git checkout -f: 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
		)
	
ok 196 - iwildmatch:    match 'a' '[A-Z]'

expecting success: 
	    test-wildmatch iwildmatch 'A' '[A-Z]'
	
*** t3202-show-branch-octopus.sh ***
ok 197 - iwildmatch:    match 'A' '[A-Z]'

expecting success: 
	    test-wildmatch iwildmatch 'A' '[a-z]'
	
ok 198 - iwildmatch:    match 'A' '[a-z]'

expecting success: 
	    test-wildmatch iwildmatch 'a' '[a-z]'
	
ok 199 - iwildmatch:    match 'a' '[a-z]'

expecting success: 
	    test-wildmatch iwildmatch 'a' '[[:upper:]]'
	
ok 200 - iwildmatch:    match 'a' '[[:upper:]]'

expecting success: 
	    test-wildmatch iwildmatch 'A' '[[:upper:]]'
	
error: 'refs/heads/r' exists; cannot create 'refs/heads/r/q'
fatal: Branch rename failed
ok 18 - git branch -m q r/q should fail when r exists

expecting success: 
	git branch bar &&
	git checkout -b foo &&
	test_must_fail git branch -M bar foo

ok 201 - iwildmatch:    match 'A' '[[:upper:]]'

expecting success: 
	    test-wildmatch iwildmatch 'A' '[[:lower:]]'
	
ok 202 - iwildmatch:    match 'A' '[[:lower:]]'

expecting success: 
	    test-wildmatch iwildmatch 'a' '[[:lower:]]'
	
ok 203 - iwildmatch:    match 'a' '[[:lower:]]'

expecting success: 
	    test-wildmatch iwildmatch 'A' '[B-Za]'
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3202-show-branch-octopus/.git/
ok 204 - iwildmatch:    match 'A' '[B-Za]'

expecting success: 
	    test-wildmatch iwildmatch 'a' '[B-Za]'
	
Switched to a new branch 'foo'
Cloning into 'submodule_update'...
expecting success: 

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

	for i in $numbers
	do
		git checkout -b branch$i master &&
		> file$i &&
		git add file$i &&
		test_tick &&
		git commit -m branch$i || return 1
	done


fatal: Cannot force update the current branch.
ok 19 - git branch -M foo bar should fail when bar is checked out

expecting success: 
	git checkout -b baz &&
	git branch bam &&
	git branch -M baz bam

ok 205 - iwildmatch:    match 'a' '[B-Za]'

expecting success: 
	    test-wildmatch iwildmatch 'A' '[B-a]'
	
ok 206 - iwildmatch:    match 'A' '[B-a]'

expecting success: 
	    test-wildmatch iwildmatch 'a' '[B-a]'
	
Switched to a new branch 'baz'
ok 207 - iwildmatch:    match 'a' '[B-a]'

expecting success: 
	    test-wildmatch iwildmatch 'z' '[Z-y]'
	
ok 208 - iwildmatch:    match 'z' '[Z-y]'

expecting success: 
	    test-wildmatch iwildmatch 'Z' '[Z-y]'
	
ok 209 - iwildmatch:    match 'Z' '[Z-y]'

[master (root-commit) 1bd44cb] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file
done.
# passed all 209 test(s)
1..209
ok 20 - git branch -M baz bam should succeed when baz is checked out

expecting success: 
	git checkout master &&
	git branch -M master

Switched to a new branch 'branch1'
Switched to branch 'master'
*** t3203-branch-output.sh ***
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 21 - git branch -M master should work when master is checked out

expecting success: 
	git checkout master &&
	git branch -M master master

[branch1 eabeb5d] branch1
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file1
Already on 'master'
Switched to a new branch 'branch2'
ok 22 - git branch -M master master should work when master is checked out

expecting success: 
	git checkout master &&
	git branch master2 &&
	git branch -M master2 master2

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3203-branch-output/.git/
expecting success: 
	echo content >file &&
	git add file &&
	git commit -m one &&
	echo content >>file &&
	git commit -a -m two

Already on 'master'
[branch2 b4fb685] branch2
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file2
[master (root-commit) d81e8eb] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
Switched to a new branch 'branch3'
ok 23 - git branch -M master2 master2 should work when master is checked out

expecting success: 
	git branch t &&
	test_path_is_file .git/refs/heads/t &&
	git branch -v -d t &&
	test_path_is_missing .git/refs/heads/t

[master e83f416] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 1 - make commits

expecting success: 
	git branch branch-one &&
	git branch branch-two HEAD^

Deleted branch t (was f8df8af).
ok 24 - git branch -v -d t should work

expecting success: 
	git branch t &&
	test_path_is_file .git/refs/heads/t &&
	git branch -v -m t s &&
	test_path_is_missing .git/refs/heads/t &&
	test_path_is_file .git/refs/heads/s &&
	git branch -d s

[branch3 8334722] branch3
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file3
ok 2 - make branches

expecting success: 
	git update-ref refs/remotes/origin/branch-one branch-one &&
	git update-ref refs/remotes/origin/branch-two branch-two &&
	git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/branch-one

Switched to a new branch 'branch4'
Deleted branch s (was f8df8af).
ok 25 - git branch -v -m t s should work

expecting success: 
	git branch t &&
	test_path_is_file .git/refs/heads/t &&
	test_must_fail git branch -m -d t s &&
	git branch -d t &&
	test_path_is_missing .git/refs/heads/t

ok 3 - make remote branches

expecting success: 
	git branch >actual &&
	test_cmp expect actual

[branch4 142d8e4] branch4
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file4
usage: git branch [<options>] [-r | -a] [--merged | --no-merged]
   or: git branch [<options>] [-l] [-f] <branch-name> [<start-point>]
   or: git branch [<options>] [-r] (-d | -D) <branch-name>...
   or: git branch [<options>] (-m | -M) [<old-branch>] <new-branch>

Generic options
    -v, --verbose         show hash and subject, give twice for upstream branch
    -q, --quiet           suppress informational messages
    -t, --track           set up tracking mode (see git-pull(1))
    --set-upstream        change upstream info
    -u, --set-upstream-to <upstream>
                          change the upstream info
    --unset-upstream      Unset the upstream info
    --color[=<when>]      use colored output
    -r, --remotes         act on remote-tracking branches
ok 4 - git branch shows local branches
    --contains <commit>   print only branches that contain the commit
    --abbrev
[=<n>]        use <n> digits to display SHA-1s

Specific git-branch actions:
    -aexpecting success: 
, --all             list both remote-tracking and local branches
    -d, --delete	git branch --list >actual &&
          delete fully merged branch
    -D                    delete branch (even if not merged)
    -m, --move	test_cmp expect actual
            move/rename a branch and its reflog
    -M                    move/rename a branch, even if target exists
    --list
                list branch names
    -l, --create-reflog   create the branch's reflog
    --edit-description    edit the description for the branch
    -f, --force           force creation, move/rename, deletion
    --no-merged <commit>  print only not merged branches
    --merged <commit>     print only merged branches
    --column[=<style>]    list branches in columns

Switched to a new branch 'branch5'
Deleted branch t (was f8df8af).
ok 26 - git branch -m -d t s should fail

expecting success: 
	git branch t &&
	test_path_is_file .git/refs/heads/t &&
	test_must_fail git branch --list -d t &&
	git branch -d t &&
	test_path_is_missing .git/refs/heads/t

ok 5 - git branch --list shows local branches

expecting success: 
	git branch --list branch* >actual &&
	test_cmp expect actual

usage: git branch [<options>] [-r | -a] [--merged | --no-merged]
   or: git branch [<options>] [-l] [-f] <branch-name> [<start-point>]
   or: git branch [<options>] [-r] (-d | -D) <branch-name>...
[branch5 c5402b6] branch5
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file5
   or: git branch [<options>] (-m | -M) [<old-branch>] <new-branch>

Generic options
    -v, --verbose         show hash and subject, give twice for upstream branch
    -q, --quiet           suppress informational messages
    -t, --track           set up tracking mode (see git-pull(1))
ok 6 - git branch --list pattern shows matching local branches

    --set-upstream        change upstream info
    -u, --set-upstream-to <upstream>
                          change the upstream info
    --unset-upstream      Unset the upstream info
    --color[=<when>]Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule_update_repo/.) registered for path 'sub1'
      use colored output
    -r, --remotes         act on remote-tracking branches
    --contains <commit>   print only branches that contain the commit
    --abbrev[=<n>]        use <n> digits to display SHA-1s

Specific git-branch actions:
    -a, --all             list both remote-tracking and local branches
    -d, --delete          delete fully merged branch
    -D                    delete branch (even if not merged)
    -m, --move            move/rename a branch and its reflog
    -M                    move/rename a branch, even if target exists
    --list                list branch names
    -l, --create-reflog   create the branch's reflog
    --edit-description    edit the description for the branch
    -f, --force           force creation, move/rename, deletion
    --no-merged <commit>  print only not merged branches
    --merged <commit>     print only merged branches
    --column[=<style>]    list branches in columns

expecting success: 
	git branch -r >actual &&
	test_cmp expect actual

Switched to a new branch 'branch6'
Deleted branch t (was f8df8af).
ok 27 - git branch --list -d t should fail

expecting success: 
	COLUMNS=81 git branch --column=column >actual &&
	cat >expected <<\EOF &&
  a/b/c     bam       foo       l       * master    n         o/p       r
  abc       bar       j/k       m/m       master2   o/o       q
EOF
	test_cmp expected actual

ok 7 - git branch -r shows remote branches

expecting success: 
	git branch -a >actual &&
	test_cmp expect actual

ok 8 - git branch -a shows local and remote branches

expecting success: 
	git branch -v >tmp &&
	awk "{print \$NF}" <tmp >actual &&
	test_cmp expect actual

ok 28 - git branch --column

expecting success: 
	long=this/is/a/part/of/long/branch/name &&
	long=z$long/$long/$long/$long &&
	test_when_finished "git branch -d $long" &&
	git branch $long &&
	COLUMNS=80 git branch --column=column >actual &&
	cat >expected <<EOF &&
  a/b/c
  abc
  bam
  bar
  foo
  j/k
  l
  m/m
* master
  master2
  n
  o/o
  o/p
  q
  r
  $long
EOF
	test_cmp expected actual

[branch6 d33aeab] branch6
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file6
Switched to a new branch 'branch7'
ok 9 - git branch -v shows branch summaries

expecting success: 
	git branch --list -v branch* >tmp &&
	awk "{print \$NF}" <tmp >actual &&
	test_cmp expect actual

ok 10 - git branch --list -v pattern shows branch summaries

expecting success: 
	test_must_fail git branch -v branch*

fatal: 'branch*' is not a valid branch name.
ok 11 - git branch -v pattern does not show branch summaries

expecting success: 
	cat >expect <<EOF &&
* (HEAD detached at $(git rev-parse --short HEAD^0))
  branch-one
  branch-two
  master
EOF
	git checkout HEAD^0 &&
	git branch >actual &&
	test_i18ncmp expect actual

[branch7 cb80438] branch7
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file7
Cloning into 'sub1'...
Deleted branch zthis/is/a/part/of/long/branch/name/this/is/a/part/of/long/branch/name/this/is/a/part/of/long/branch/name/this/is/a/part/of/long/branch/name (was f8df8af).
Switched to a new branch 'branch8'
ok 29 - git branch --column with an extremely long branch name

expecting success: 
	git config column.ui column &&
	git config column.branch "dense" &&
	COLUMNS=80 git branch >actual &&
	git config --unset column.branch &&
	git config --unset column.ui &&
	cat >expected <<\EOF &&
  a/b/c   bam   foo   l   * master    n     o/p   r
  abc     bar   j/k   m/m   master2   o/o   q
EOF
	test_cmp expected actual

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 e83f416... two
ok 12 - git branch shows detached HEAD properly

expecting success: 
	git checkout master &&
	cat >expect <<EOF &&
* (HEAD detached at $(git rev-parse --short HEAD^0))
  branch-one
  branch-two
  master
EOF
	git checkout --detach &&
	git branch >actual &&
	test_i18ncmp expect actual

done.
[branch8 c922302] branch8
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file8
Switched to branch 'master'
Switched to a new branch 'branch9'
ok 30 - git branch with column.*

expecting success: 
	test_must_fail git branch --column -v

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 e83f416... two
fatal: --column and --verbose are incompatible
ok 31 - git branch --column -v should fail

expecting success: 
	git config column.ui column &&
	COLUMNS=80 git branch -v | cut -c -10 | sed "s/ *$//" >actual &&
	git config --unset column.ui &&
	cat >expected <<\EOF &&
  a/b/c
  abc
  bam
  bar
  foo
  j/k
  l
  m/m
* master
  master2
  n
  o/o
  o/p
  q
  r
EOF
	test_cmp expected actual

[branch9 fabe124] branch9
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file9
ok 13 - git branch shows detached HEAD properly after checkout --detach

expecting success: 
	cat >expect <<EOF &&
* (HEAD detached from $(git rev-parse --short HEAD))
  branch-one
  branch-two
  master
EOF
	git reset --hard HEAD^1 &&
	git branch >actual &&
	test_i18ncmp expect actual

Switched to a new branch 'branch10'
HEAD is now at d81e8eb one
ok 32 - git branch -v with column.ui ignored

expecting success: 
	git branch -m q q2 &&
	git branch -m q2 q

[branch10 4d9b8be] branch10
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file10
ok 1 - setup

expecting success: 

	git show-branch $(for i in $numbers; do echo branch$i; done) > out &&
	test_cmp expect out


ok 14 - git branch shows detached HEAD properly after moving

expecting success: 
	cat >expect <<EOF &&
* (HEAD detached at fromtag)
  branch-one
  branch-two
  master
EOF
	git tag fromtag master &&
	git checkout fromtag &&
	git branch >actual &&
	test_i18ncmp expect actual

Submodule path 'sub1': checked out '3950f7ed37a2b5b8e95094de1b49ceba8eecb3d9'
ok 2 - show-branch with more than 8 branches

expecting success: 
	for i in $numbers; do
		git config --add showbranch.default branch$i
	done &&
	git show-branch >out &&
	test_cmp expect out

ok 33 - git branch -m q q2 without config should succeed

Previous HEAD position was d81e8eb... one
HEAD is now at e83f416... two
expecting success: 
	git branch -l s/s &&
	git reflog exists refs/heads/s/s &&
	git branch -l s/t &&
	git reflog exists refs/heads/s/t &&
	git branch -d s/t &&
	git branch -m s/s s &&
	git reflog exists refs/heads/s

ok 15 - git branch shows detached HEAD properly from tag

expecting success: 
	cat >expect <<EOF &&
* (HEAD detached from fromtag)
  branch-one
  branch-two
  master
EOF
	git reset --hard HEAD^1 &&
	git branch >actual &&
	test_i18ncmp expect actual

HEAD is now at d81e8eb one
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
ok 16 - git branch shows detached HEAD properly after moving from tag

# passed all 16 test(s)
1..16
Deleted branch s/t (was f8df8af).
*** t3210-pack-refs.sh ***
ok 34 - git branch -m s/s s should work when s/t is deleted

expecting success: 
	test $(git config branch.s.dummy) = Hello &&
	test_must_fail git config branch.s/s/dummy

ok 3 - show-branch with showbranch.default

error: invalid key: branch.s/s/dummy
ok 35 - config information was renamed, too

expecting success: 
	git branch target &&
	git symbolic-ref refs/heads/symref refs/heads/target &&
	echo "Deleted branch symref (was refs/heads/target)." >expect &&
	git branch -d symref >actual &&
	test_path_is_file .git/refs/heads/target &&
	test_path_is_missing .git/refs/heads/symref &&
	test_i18ncmp expect actual

# passed all 3 test(s)
1..3
warning: unable to rmdir sub1: Directory not empty
Switched to branch 'replace_sub1_with_directory'
Your branch is up-to-date with 'origin/replace_sub1_with_directory'.
test_must_fail: command succeeded: git checkout -f replace_sub1_with_directory
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3210-pack-refs/.git/
ok 36 - deleting a symref

expecting success: 
	git symbolic-ref refs/heads/dangling-symref nowhere &&
	test_path_is_file .git/refs/heads/dangling-symref &&
	echo "Deleted branch dangling-symref (was nowhere)." >expect &&
	git branch -d dangling-symref >actual &&
	test_path_is_missing .git/refs/heads/dangling-symref &&
	test_i18ncmp expect actual

*** t3211-peel-ref.sh ***
expecting success: 
	git config core.logallrefupdates true

not ok 29 - git checkout -f: 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
		)
	
ok 1 - enable reflogs

expecting success: echo Hello > A &&
     git update-index --add A &&
     git commit -m "Initial commit." &&
     HEAD=$(git rev-parse --verify HEAD)
ok 37 - deleting a dangling symref

expecting success: 
	git symbolic-ref refs/heads/self-reference refs/heads/self-reference &&
	test_path_is_file .git/refs/heads/self-reference &&
	echo "Deleted branch self-reference (was refs/heads/self-reference)." >expect &&
	git branch -d self-reference >actual &&
	test_path_is_missing .git/refs/heads/self-reference &&
	test_i18ncmp expect actual

[master (root-commit) 8c7f689] Initial commit.
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 A
ok 38 - deleting a self-referential symref

expecting success: 
	git symbolic-ref refs/heads/master2 refs/heads/master &&
	test_must_fail git branch -m master2 master3 &&
	git symbolic-ref refs/heads/master2 &&
	test_path_is_file .git/refs/heads/master &&
	test_path_is_missing .git/refs/heads/master3

ok 2 - prepare a trivial repository

expecting success: git branch a &&
     SHA1=`cat .git/refs/heads/a` &&
     echo "$SHA1 refs/heads/a" >expect &&
     git show-ref a >result &&
     test_cmp expect result
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3211-peel-ref/.git/
error: refname refs/heads/master2 is a symbolic ref, renaming it is not supported
fatal: Branch rename failed
expecting success: 
	test_commit base &&
	git tag -m annotated foo

refs/heads/master
ok 39 - renaming a symref is not allowed

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 - see if git show-ref works as expected

expecting success: git branch b &&
     git pack-refs --all &&
     rm -f .git/refs/heads/b &&
     echo "$SHA1 refs/heads/b" >expect &&
     git show-ref b >result &&
     test_cmp expect result
prerequisite SYMLINKS ok
expecting success: 
	git branch -l u &&
	mv .git/logs/refs/heads/u real-u &&
	ln -s real-u .git/logs/refs/heads/u &&
	test_must_fail git branch -m u v

[master (root-commit) d1ff1c9] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 base.t
error: reflog for refs/heads/u is a symlink
fatal: Branch rename failed
ok 40 - git branch -m u v should fail when the reflog for u is a symlink

expecting success: 
	git config remote.local.url . &&
	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
	(git show-ref -q refs/remotes/local/master || git fetch local) &&
	git branch --track my1 local/master &&
	test $(git config branch.my1.remote) = local &&
	test $(git config branch.my1.merge) = refs/heads/master

ok 4 - see if a branch still exists when packed

expecting success: 
     git branch c &&
     git pack-refs --all &&
     rm -f .git/refs/heads/c &&
     test_must_fail git branch c/d

ok 1 - create annotated tag in refs/tags

expecting success: 
	git update-ref refs/outside/foo refs/tags/foo

Cloning into 'submodule_update'...
ok 2 - create annotated tag outside of refs/tags

expecting success: 
	{
		print_ref "refs/heads/master" &&
		print_ref "refs/outside/foo" &&
		print_ref "refs/outside/foo^{}" &&
		print_ref "refs/tags/base" &&
		print_ref "refs/tags/foo" &&
		print_ref "refs/tags/foo^{}"
	} >expect

fatal: cannot lock ref 'refs/heads/c/d': 'refs/heads/c' exists; cannot create 'refs/heads/c/d'
ok 5 - git branch c/d should barf if branch c exists

expecting success: git branch e &&
     git pack-refs --all --prune &&
     echo "$SHA1 refs/heads/e" >expect &&
     git show-ref e >result &&
     test_cmp expect result
done.
ok 3 - set up expected show-ref output

expecting success: 
	git show-ref -d >actual &&
	test_cmp expect actual

ok 6 - see if a branch still exists after git pack-refs --prune

expecting success: 
     git branch f &&
     git pack-refs --all --prune &&
     ! test -f .git/refs/heads/f

ok 4 - refs are peeled outside of refs/tags (loose)

expecting success: 
	git pack-refs --all &&
	git show-ref -d >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.
From .
 * [new branch]      a/b/c      -> local/a/b/c
 * [new branch]      abc        -> local/abc
 * [new branch]      bam        -> local/bam
 * [new branch]      bar        -> local/bar
 * [new branch]      foo        -> local/foo
ok 7 - see if git pack-refs --prune remove ref files

expecting success: 
     git branch r/s/t &&
     git pack-refs --all --prune &&
     ! test -e .git/refs/heads/r

 * [new branch]      j/k        -> local/j/k
 * [new branch]      l          -> local/l
 * [new branch]      m/m        -> local/m/m
 * [new branch]      master     -> local/master
 * [new branch]      master2    -> local/master2
 * [new branch]      n          -> local/n
ok 5 - refs are peeled outside of refs/tags (packed)

expecting success: 
	# Git no longer writes without fully-peeled, so we just write our own
	# from scratch; we could also munge the existing file to remove the
	# fully-peeled bits, but that seems even more prone to failure,
	# especially if the format ever changes again. At least this way we
	# know we are emulating exactly what an older git would have written.
	{
		echo "# pack-refs with: peeled " &&
		print_ref "refs/heads/master" &&
		print_ref "refs/outside/foo" &&
		print_ref "refs/tags/base" &&
		print_ref "refs/tags/foo" &&
		echo "^$(git rev-parse "refs/tags/foo^{}")"
	} >tmp &&
	mv tmp .git/packed-refs

 * [new branch]      o/o        -> local/o/o
 * [new branch]      o/p        -> local/o/p
 * [new branch]      q          -> local/q
 * [new branch]      r          -> local/r
 * [new branch]      s          -> local/s
 * [new branch]      target     -> local/target
 * [new branch]      u          -> local/u
ok 8 - see if git pack-refs --prune removes empty dirs

expecting success: git branch g/h &&
     git pack-refs --all --prune &&
     git branch -d g/h &&
     git branch g &&
     git pack-refs --all &&
     git branch -d g
Branch my1 set up to track remote branch master from local.
Deleted branch g/h (was 8c7f689).
ok 6 - create old-style pack-refs without fully-peeled

expecting success: 
	git show-ref -d >actual &&
	test_cmp expect actual

ok 41 - test tracking setup via --track

expecting success: 
	git config remote.local.url . &&
	git config remote.local.fetch refs/heads/master:refs/remotes/local/master &&
	(git show-ref -q refs/remotes/local/master || git fetch local) &&
	git branch --track my4 local/master &&
	test $(git config branch.my4.remote) = local &&
	test $(git config branch.my4.merge) = refs/heads/master

ok 7 - refs are peeled outside of refs/tags (old packed)

expecting success: 
	git pack-refs --all &&
	cp .git/packed-refs fully-peeled &&
	git branch yadda &&
	git pack-refs --all &&
	git branch -d yadda &&
	test_cmp fully-peeled .git/packed-refs

Deleted branch g (was 8c7f689).
ok 9 - git branch g should work when git branch g/h has been deleted

expecting success: 
     git branch i &&
     git pack-refs --all --prune &&
     test_must_fail git branch i/j/k

Branch my4 set up to track remote branch master from local.
Deleted branch yadda (was d1ff1c9).
ok 42 - test tracking setup (non-wildcard, matching)

ok 8 - peeled refs survive deletion of packed ref

expecting success: 
	git config remote.local.url . &&
	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
	(git show-ref -q refs/remotes/local/master || git fetch local) &&
	git config remote.local.fetch refs/heads/s:refs/remotes/local/s &&
	test_must_fail git branch --track my5 local/master &&
	test_must_fail git config branch.my5.remote &&
	test_must_fail git config branch.my5.merge

fatal: cannot lock ref 'refs/heads/i/j/k': 'refs/heads/i' exists; cannot create 'refs/heads/i/j/k'
ok 10 - git branch i/j/k should barf if branch i exists

expecting success: git branch k/l &&
     git branch k/lm &&
     git branch -d k/l &&
     git branch k/l/m &&
     git branch -d k/l/m &&
     git branch -d k/lm &&
     git branch k
# passed all 8 test(s)
1..8
*** t3300-funny-names.sh ***
Deleted branch k/l (was 8c7f689).
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule_update_repo/.) registered for path 'sub1'
fatal: Cannot setup tracking information; starting point 'local/master' is not a branch.
ok 43 - tracking setup fails on non-matching refspec

expecting success: 
	git config branch.autosetupmerge true &&
	git config remote.local.url . &&
	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
	(git show-ref -q refs/remotes/local/master || git fetch local) &&
	git branch my3 local/master &&
	test $(git config branch.my3.remote) = local &&
	test $(git config branch.my3.merge) = refs/heads/master

Deleted branch k/l/m (was 8c7f689).
Deleted branch k/lm (was 8c7f689).
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3300-funny-names/.git/
ok 11 - test git branch k after branch k/l/m and k/lm have been deleted

expecting success: git branch n/o &&
     git branch n/op &&
     git branch -d n/o &&
     git branch n/o/p &&
     git branch -d n/op &&
     git pack-refs --all --prune &&
     git branch -d n/o/p &&
     git branch n
expecting success: 
	cat >"$p0" <<-\EOF &&
	1. A quick brown fox jumps over the lazy cat, oops dog.
	2. A quick brown fox jumps over the lazy cat, oops dog.
	3. A quick brown fox jumps over the lazy cat, oops dog.
	EOF

	{ cat "$p0" >"$p1" || :; } &&
	{ echo "Foo Bar Baz" >"$p2" || :; }

ok 1 - setup

expecting success: 
	git update-index --add "$p0" "$p2" &&
	t0=$(git write-tree)

Branch my3 set up to track remote branch master from local.
ok 2 - setup: populate index and tree

expecting success: 
	printf "%s\n" "just space" no-funny >expected &&
	git ls-files >current &&
	test_cmp expected current

Cloning into 'sub1'...
Deleted branch n/o (was 8c7f689).
ok 3 - ls-files prints space in filename verbatim

expecting success: 
	git update-index --add "$p1" &&
	t1=$(git write-tree)

ok 44 - test tracking setup via config

expecting success: 
	git config branch.autosetupmerge true &&
	git config remote.local.url . &&
	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
	(git show-ref -q refs/remotes/local/master || git fetch local) &&
	git branch --no-track my2 local/master &&
	git config branch.autosetupmerge false &&
	! test "$(git config branch.my2.remote)" = local &&
	! test "$(git config branch.my2.merge)" = refs/heads/master

ok 4 - setup: add funny filename

expecting success: 
	cat >expected <<-\EOF &&
	just space
	no-funny
	"tabs\t,\" (dq) and spaces"
	EOF
	git ls-files >current &&
	test_cmp expected current

Deleted branch n/op (was 8c7f689).
done.
ok 5 - ls-files quotes funny filename

expecting success: 
	cat >expected <<-\EOF &&
	just space
	no-funny
	tabs	," (dq) and spaces
	EOF
	git ls-files -z >ls-files.z &&
	perl -pe "y/\000/\012/" <ls-files.z >current &&
	test_cmp expected current

Deleted branch n/o/p (was 8c7f689).
ok 6 - ls-files -z does not quote funny filename

expecting success: 
	cat >expected <<-\EOF &&
	just space
	no-funny
	"tabs\t,\" (dq) and spaces"
	EOF
	git ls-tree -r $t1 >ls-tree &&
	sed -e "s/^[^	]*	//" <ls-tree >current &&
	test_cmp expected current

ok 12 - test git branch n after some branch deletion and pruning

expecting success: git branch q &&
	 git pack-refs --all --prune &&
	 git update-ref refs/heads/q refs/heads/q &&
	 ! test -f .git/refs/heads/q
ok 7 - ls-tree quotes funny filename

expecting success: 
	cat >expected <<-\EOF &&
	A	"tabs\t,\" (dq) and spaces"
	EOF
	git diff-index --name-status $t0 >current &&
	test_cmp expected current

ok 45 - test overriding tracking setup via --no-track

expecting success: 
	git config branch.autosetupmerge true &&
	git branch my6 s &&
	git config branch.autosetupmerge false &&
	test -z "$(git config branch.my6.remote)" &&
	test -z "$(git config branch.my6.merge)"

ok 13 - see if up-to-date packed refs are preserved

expecting success: 
	git tag foo &&
	git pack-refs --all --prune &&
	git show-ref >all-of-them &&
	git pack-refs &&
	git show-ref >again &&
	test_cmp all-of-them again

ok 8 - diff-index --name-status quotes funny filename

expecting success: 
	cat >expected <<-\EOF &&
	A	"tabs\t,\" (dq) and spaces"
	EOF
	git diff-tree --name-status $t0 $t1 >current &&
	test_cmp expected current

ok 9 - diff-tree --name-status quotes funny filename

expecting success: 
	cat >expected <<-\EOF &&
	A
	tabs	," (dq) and spaces
	EOF
	git diff-index -z --name-status $t0 >diff-index.z &&
	perl -pe "y/\000/\012/" <diff-index.z >current &&
	test_cmp expected current

ok 46 - no tracking without .fetch entries

expecting success: 
	git config remote.local.url . &&
	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
	(git show-ref -q refs/remotes/local/o/o || git fetch local) &&
	git branch --track my7 local/o/o &&
	test "$(git config branch.my7.remote)" = local &&
	test "$(git config branch.my7.merge)" = refs/heads/o/o

ok 10 - diff-index -z does not quote funny filename

Submodule path 'sub1': checked out '3950f7ed37a2b5b8e95094de1b49ceba8eecb3d9'
expecting success: 
	cat >expected <<-\EOF &&
	A
	tabs	," (dq) and spaces
	EOF
	git diff-tree -z --name-status $t0 $t1 >diff-tree.z &&
	perl -pe y/\\000/\\012/ <diff-tree.z >current &&
	test_cmp expected current

ok 14 - pack, prune and repack

expecting success: 
	git commit --allow-empty -m "soon to be garbage-collected" &&
	git pack-refs --all &&
	git reset --hard HEAD^ &&
	git reflog expire --expire=all --all &&
	git prune --expire=all &&
	git pack-refs --all 2>result &&
	test_cmp /dev/null result

[master c9de1f9] soon to be garbage-collected
 Author: A U Thor <author@example.com>
ok 11 - diff-tree -z does not quote funny filename

expecting success: 
	cat >expected <<-\EOF &&
	CNUM	no-funny	"tabs\t,\" (dq) and spaces"
	EOF
	git diff-tree -C --find-copies-harder --name-status $t0 $t1 >out &&
	sed -e "s/^C[0-9]*/CNUM/" <out >current &&
	test_cmp expected current

Branch my7 set up to track remote branch o/o from local.
HEAD is now at 8c7f689 Initial commit.
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
ok 12 - diff-tree --find-copies-harder quotes funny filename

expecting success: 
	git update-index --force-remove "$p0"

ok 47 - test tracking setup via --track but deeper

expecting success: 
	git branch -d my7 &&
	test -z "$(git config branch.my7.remote)" &&
	test -z "$(git config branch.my7.merge)"

ok 13 - setup: remove unfunny index entry

expecting success: 
	cat >expected <<-\EOF &&
	RNUM	no-funny	"tabs\t,\" (dq) and spaces"
	EOF
	git diff-index -M --name-status $t0 >out &&
	sed -e "s/^R[0-9]*/RNUM/" <out >current &&
	test_cmp expected current

Switched to branch 'replace_sub1_with_file'
Your branch is up-to-date with 'origin/replace_sub1_with_file'.
Deleted branch my7 (was f8df8af).
test_must_fail: command succeeded: git checkout -f replace_sub1_with_file
ok 14 - diff-tree -M quotes funny filename

expecting success: 
	cat >expected <<-\EOF &&
	diff --git a/no-funny "b/tabs\t,\" (dq) and spaces"
	similarity index NUM%
	rename from no-funny
	rename to "tabs\t,\" (dq) and spaces"
	EOF
	git diff-index -M -p $t0 >diff &&
	sed -e "s/index [0-9]*%/index NUM%/" <diff >current &&
	test_cmp expected current

ok 48 - test deleting branch deletes branch config

expecting success: 
	git branch my7 s &&
	sha1=$(git rev-parse my7 | cut -c 1-7) &&
	echo "Deleted branch my7 (was $sha1)." >expect &&
	git branch -d my7 >actual 2>&1 &&
	test_i18ncmp expect actual

not ok 30 - git checkout -f: 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 15 - explicit pack-refs with dangling packed reference

expecting success: 
	git checkout -b lamb &&
	git commit --allow-empty -m "future garbage" &&
	git pack-refs --all &&
	git reset --hard HEAD^ &&
	git checkout master &&
	git reflog expire --expire=all --all &&
	git prune --expire=all &&
	git branch -d lamb 2>result &&
	test_cmp /dev/null result

ok 15 - diff-index -M -p quotes funny filename

expecting success: 
	chmod +x "$p1"

ok 16 - setup: mode change

expecting success: 
	cat >expected <<-\EOF &&
	diff --git a/no-funny "b/tabs\t,\" (dq) and spaces"
	old mode 100644
	new mode 100755
	similarity index NUM%
	rename from no-funny
	rename to "tabs\t,\" (dq) and spaces"
	EOF
	git diff-index -M -p $t0 >diff &&
	sed -e "s/index [0-9]*%/index NUM%/" <diff >current &&
	test_cmp expected current

Switched to a new branch 'lamb'
ok 49 - test deleting branch without config

expecting success: 
	git branch --track my8 &&
	test "$(git config branch.my8.remote)" &&
	test "$(git config branch.my8.merge)"

ok 17 - diff-index -M -p with mode change quotes funny filename

expecting success: 
	cat >expected <<-\EOF &&
	 "tabs\t,\" (dq) and spaces"
	 1 file changed, 0 insertions(+), 0 deletions(-)
	EOF
	git diff-index -M -p $t0 >diff &&
	git apply --stat <diff >diffstat &&
	sed -e "s/|.*//" -e "s/ *\$//" <diffstat >current &&
	test_i18ncmp expected current

[lamb a36329c] future garbage
 Author: A U Thor <author@example.com>
Branch my8 set up to track local branch master.
ok 50 - test --track without .fetch entries

expecting success: 
	git config branch.autosetupmerge always &&
	git branch my9 HEAD^ &&
	git config branch.autosetupmerge false

HEAD is now at 8c7f689 Initial commit.
ok 18 - diffstat for rename quotes funny filename

expecting success: 
	cat >expected <<-\EOF &&
	0	0	"tabs\t,\" (dq) and spaces"
	EOF
	git diff-index -M -p $t0 >diff &&
	git apply --numstat <diff >current &&
	test_cmp expected current

Switched to branch 'master'
Cloning into 'submodule_update'...
ok 51 - branch from non-branch HEAD w/autosetupmerge=always

expecting success: 
	test_must_fail git branch --track my10 HEAD^

ok 19 - numstat for rename quotes funny filename

expecting success: 
	cat >expected <<-\EOF &&
	0	3	no-funny
	3	0	"tabs\t,\" (dq) and spaces"
	EOF
	git diff-index -p $t0 >diff &&
	git apply --numstat <diff >current &&
	test_cmp expected current

fatal: Cannot setup tracking information; starting point 'HEAD^' is not a branch.
ok 52 - branch from non-branch HEAD w/--track causes failure

expecting success: 
	git tag foobar &&
	test_must_fail git branch --track my11 foobar

done.
ok 20 - numstat without -M quotes funny filename

expecting success: 
	cat >expected <<-\EOF &&
	0	3	no-funny
	3	0	"tabs\t,\" (dq) and spaces"
	EOF
	git diff-index -p $t0 >git-diff &&
	sed -ne "/^[-+@]/p" <git-diff >diff &&
	git apply --numstat <diff >current &&
	test_cmp expected current

fatal: Cannot setup tracking information; starting point 'foobar' is not a branch.
ok 53 - branch from tag w/--track causes failure

expecting success: 
	test_must_fail git branch --set-upstream-to master a b c

fatal: too many branches to set new upstream
ok 54 - --set-upstream-to fails on multiple branches

expecting success: 
	git checkout HEAD^{} &&
	test_must_fail git branch --set-upstream-to master &&
	git checkout -

Deleted branch lamb (was 8c7f689).
ok 16 - delete ref with dangling packed version

expecting success: 
	git branch lamb &&
	git commit --allow-empty -m "future garbage" &&
	git pack-refs --all &&
	git reset --hard HEAD^ &&
	git reflog expire --expire=all --all &&
	git prune --expire=all &&
	git branch -d lamb 2>result &&
	test_cmp /dev/null result

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>

ok 21 - numstat for non-git rename diff quotes funny filename

HEAD is now at f8df8af... Second commit.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
# passed all 21 test(s)
1..21
fatal: could not set upstream of HEAD to master when it does not point to any branch.
[master 599ca3c] future garbage
 Author: A U Thor <author@example.com>
Switched to branch 'master'
ok 55 - --set-upstream-to fails on detached HEAD

expecting success: 
	test_must_fail git branch --set-upstream-to master does-not-exist

*** t3301-notes.sh ***
fatal: branch 'does-not-exist' does not exist
ok 56 - --set-upstream-to fails on a missing dst branch

expecting success: 
	test_must_fail git branch --set-upstream-to does-not-exist master

HEAD is now at 8c7f689 Initial commit.
error: the requested upstream branch 'does-not-exist' does not exist
hint: 
hint: If you are planning on basing your work on an upstream
hint: branch that already exists at the remote, you may need to
hint: run "git fetch" to retrieve it.
hint: 
hint: If you are planning to push out a new local branch that
hint: will track its remote counterpart, you may want to use
hint: "git push -u" to set the upstream config as you push.
ok 57 - --set-upstream-to fails on a missing src branch

expecting success: 
	test_must_fail git branch --set-upstream-to HEAD^{}

fatal: Cannot setup tracking information; starting point 'HEAD^{}' is not a branch.
ok 58 - --set-upstream-to fails on a non-ref

expecting success: 
	test_config branch.master.remote foo &&
	test_config branch.master.merge foo &&
	git branch my12 &&
	git branch --set-upstream-to my12 &&
	test "$(git config branch.master.remote)" = "." &&
	test "$(git config branch.master.merge)" = "refs/heads/my12"

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3301-notes/.git/
Deleted branch lamb (was 8c7f689).
ok 17 - delete ref while another dangling packed ref

expecting success: 
	git update-ref refs/top HEAD &&
	git pack-refs --all --prune &&
	grep refs/top .git/packed-refs &&
	test_path_is_missing .git/refs/top

Branch master set up to track local branch my12.
expecting success: 
	test_must_fail env MSG=3 git notes add

fatal: Failed to resolve 'HEAD' as a valid ref.
ok 1 - cannot annotate non-existing HEAD

expecting success: 
	test_commit 1st &&
	test_commit 2nd

8c7f6891379af9d7c4ac12bcd84cf032b212ff45 refs/top
ok 18 - pack ref directly below refs/

expecting success: 
	git config core.logallrefupdates false &&
	rm -rf .git/logs

ok 59 - use --set-upstream-to modify HEAD

expecting success: 
	git branch my13 &&
	git branch --set-upstream-to master my13 &&
	test "$(git config branch.my13.remote)" = "." &&
	test "$(git config branch.my13.merge)" = "refs/heads/master"

ok 19 - disable reflogs

expecting success: 
	git branch foo/bar/baz &&
	git pack-refs --all --prune &&
	test_path_is_missing .git/refs/heads/foo/bar/baz &&
	test_must_fail git reflog exists refs/heads/foo/bar/baz

[master (root-commit) 04ed9a0] 1st
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 1st.t
Branch my13 set up to track local branch master.
ok 20 - create packed foo/bar/baz branch

expecting success: 
	test_must_fail git branch foo &&
	test_must_fail git branch foo/bar

ok 60 - use --set-upstream-to modify a particular branch

expecting success: 
	test_must_fail git branch --unset-upstream i-dont-exist

[master 7a4ca6e] 2nd
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 2nd.t
fatal: cannot lock ref 'refs/heads/foo': 'refs/heads/foo/bar/baz' exists; cannot create 'refs/heads/foo'
fatal: Branch 'i-dont-exist' has no upstream information
ok 61 - --unset-upstream should fail if given a non-existent branch

expecting success: 
	git branch my14 &&
	test_config branch.master.remote foo &&
	test_config branch.master.merge foo &&
	git branch --set-upstream-to my14 &&
	git branch --unset-upstream &&
	test_must_fail git config branch.master.remote &&
	test_must_fail git config branch.master.merge &&
	# fail for a branch without upstream set
	test_must_fail git branch --unset-upstream

fatal: cannot lock ref 'refs/heads/foo/bar': 'refs/heads/foo/bar/baz' exists; cannot create 'refs/heads/foo/bar'
ok 2 - setup

ok 21 - notice d/f conflict with existing directory

expecting success: 
	test_must_fail env MSG=1 GIT_NOTES_REF=/ git notes show &&
	test_must_fail env MSG=2 GIT_NOTES_REF=/ git notes show

expecting success: 
	test_must_fail git branch foo 2>stderr &&
	grep refs/heads/foo/bar/baz stderr

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule_update_repo/.) registered for path 'sub1'
fatal: Refusing to show notes in / (outside of refs/notes/)
fatal: cannot lock ref 'refs/heads/foo': 'refs/heads/foo/bar/baz' exists; cannot create 'refs/heads/foo'
ok 22 - existing directory reports concrete ref

expecting success: 
	test_must_fail git branch foo/bar/baz/extra &&
	test_must_fail git branch foo/bar/baz/lots/of/extra/components

fatal: Refusing to show notes in / (outside of refs/notes/)
ok 3 - need valid notes ref

expecting success: 
	test_must_fail env MSG=1 GIT_NOTES_REF=refs/heads/bogus git notes add

fatal: cannot lock ref 'refs/heads/foo/bar/baz/extra': 'refs/heads/foo/bar/baz' exists; cannot create 'refs/heads/foo/bar/baz/extra'
fatal: Refusing to add notes in refs/heads/bogus (outside of refs/notes/)
ok 4 - refusing to add notes in refs/heads/

expecting success: 
	test_must_fail env MSG=1 GIT_NOTES_REF=refs/heads/bogus git notes edit

fatal: cannot lock ref 'refs/heads/foo/bar/baz/lots/of/extra/components': 'refs/heads/foo/bar/baz' exists; cannot create 'refs/heads/foo/bar/baz/lots/of/extra/components'
Branch master set up to track local branch my14.
ok 23 - notice d/f conflict with existing ref

expecting success: 
	LOCK=.git/packed-refs.lock &&
	>"$LOCK" &&
	test_when_finished "rm -f $LOCK" &&
	test_must_fail git pack-refs --all --prune

fatal: Refusing to edit notes in refs/heads/bogus (outside of refs/notes/)
ok 5 - refusing to edit notes in refs/remotes/

expecting success: 
	test_expect_code 1 git notes show

error: No note found for object 7a4ca6ee52a974a66cbaa78e33214535dff1d691.
ok 6 - handle empty notes gracefully

expecting success: 
	test_write_lines A B >expect &&
	git show -s --format="A%n%NB" >actual &&
	test_cmp expect actual

fatal: Branch 'master' has no upstream information
ok 7 - show non-existent notes entry with %N

expecting success: 
	MSG=b4 git notes add &&
	test_path_is_missing .git/NOTES_EDITMSG &&
	git ls-tree -r refs/notes/commits >actual &&
	test_line_count = 1 actual &&
	test "b4" = "$(git notes show)" &&
	git show HEAD^ &&
	test_must_fail git notes show HEAD^

ok 62 - test --unset-upstream on HEAD

expecting success: 
	test_must_fail git branch --unset-upstream a b c

Cloning into 'sub1'...
fatal: too many branches to unset upstream
b4
ok 63 - --unset-upstream should fail on multiple branches

expecting success: 
	git checkout HEAD^{} &&
	test_must_fail git branch --unset-upstream &&
	git checkout -

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 f8df8af... Second commit.
fatal: could not unset upstream of HEAD when it does not point to any branch.
done.
Switched to branch 'master'
ok 64 - --unset-upstream should fail on detached HEAD

expecting success: 
	git branch my15 &&
	git branch --set-upstream-to master my14 &&
	git branch --unset-upstream my14 &&
	test_must_fail git config branch.my14.remote &&
	test_must_fail git config branch.my14.merge

commit 04ed9a0bbe0285f41c913e2002cb09ef8449d4a6
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:13:13 2005 -0700

    1st

diff --git a/1st.t b/1st.t
new file mode 100644
index 0000000..2a5d015
--- /dev/null
+++ b/1st.t
@@ -0,0 +1 @@
+1st
error: No note found for object 04ed9a0bbe0285f41c913e2002cb09ef8449d4a6.
ok 8 - create notes

expecting success: 
	test_write_lines A b4 B >expect &&
	git show -s --format="A%n%NB" >actual &&
	test_cmp expect actual

Branch my14 set up to track local branch master.
ok 9 - show notes entry with %N

expecting success: 
	cat <<-EOF >expect &&
		a1d8fa6 refs/notes/commits@{0}: notes: Notes added by 'git notes add'
	EOF
	git reflog show refs/notes/commits >actual &&
	test_cmp expect actual

ok 10 - create reflog entry

expecting success: 
	MSG=b3 git notes edit &&
	test_path_is_missing .git/NOTES_EDITMSG &&
	git ls-tree -r refs/notes/commits >actual &&
	test_line_count = 1 actual &&
	test "b3" = "$(git notes show)" &&
	git show HEAD^ &&
	test_must_fail git notes show HEAD^

ok 65 - test --unset-upstream on a particular branch

expecting success: 
	git update-ref refs/remotes/origin/master HEAD &&
	git branch --set-upstream origin/master 2>actual &&
	test_when_finished git update-ref -d refs/remotes/origin/master &&
	test_when_finished git branch -d origin/master &&
	cat >expected <<EOF &&
The --set-upstream flag is deprecated and will be removed. Consider using --track or --set-upstream-to

If you wanted to make 'master' track 'origin/master', do this:

    git branch -d origin/master
    git branch --set-upstream-to origin/master
EOF
	test_cmp expected actual

b3
Branch origin/master set up to track local branch master.
Submodule path 'sub1': checked out '3950f7ed37a2b5b8e95094de1b49ceba8eecb3d9'
Deleted branch origin/master (was f8df8af).
ok 66 - --set-upstream shows message when creating a new branch that exists as remote-tracking

expecting success: 
	git branch --set-upstream master my13 2>actual &&
	test_when_finished git branch --unset-upstream master &&
	cat >expected <<EOF &&
The --set-upstream flag is deprecated and will be removed. Consider using --track or --set-upstream-to
EOF
	test_cmp expected actual

commit 04ed9a0bbe0285f41c913e2002cb09ef8449d4a6
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:13:13 2005 -0700

    1st

diff --git a/1st.t b/1st.t
new file mode 100644
index 0000000..2a5d015
--- /dev/null
+++ b/1st.t
@@ -0,0 +1 @@
+1st
error: No note found for object 04ed9a0bbe0285f41c913e2002cb09ef8449d4a6.
Branch master set up to track local branch my13.
ok 11 - edit existing notes

expecting success: 
	test_must_fail git notes add -m "b2" &&
	test_path_is_missing .git/NOTES_EDITMSG &&
	git ls-tree -r refs/notes/commits >actual &&
	test_line_count = 1 actual &&
	test "b3" = "$(git notes show)" &&
	git show HEAD^ &&
	test_must_fail git notes show HEAD^

error: Cannot add notes. Found existing notes for object 7a4ca6ee52a974a66cbaa78e33214535dff1d691. Use '-f' to overwrite existing notes
ok 67 - --set-upstream with two args only shows the deprecation message

expecting success: 
	git branch --set-upstream my13 2>actual &&
	test_when_finished git branch --unset-upstream my13 &&
	cat >expected <<EOF &&
The --set-upstream flag is deprecated and will be removed. Consider using --track or --set-upstream-to
EOF
	test_cmp expected actual

Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
Branch my13 set up to track local branch master.
ok 68 - --set-upstream with one arg only shows the deprecation message if the branch existed

expecting success: 
	git branch --set-upstream-to refs/heads/my13 my13 2>actual &&
	cat >expected <<-\EOF &&
	warning: Not setting branch my13 as its own upstream.
	EOF
	test_expect_code 1 git config branch.my13.remote &&
	test_expect_code 1 git config branch.my13.merge &&
	test_i18ncmp expected actual

commit 04ed9a0bbe0285f41c913e2002cb09ef8449d4a6
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:13:13 2005 -0700

    1st

diff --git a/1st.t b/1st.t
new file mode 100644
index 0000000..2a5d015
--- /dev/null
+++ b/1st.t
@@ -0,0 +1 @@
+1st
error: No note found for object 04ed9a0bbe0285f41c913e2002cb09ef8449d4a6.
ok 12 - cannot "git notes add -m" where notes already exists

expecting success: 
	git notes add -f -m "b1" &&
	test_path_is_missing .git/NOTES_EDITMSG &&
	git ls-tree -r refs/notes/commits >actual &&
	test_line_count = 1 actual &&
	test "b1" = "$(git notes show)" &&
	git show HEAD^ &&
	test_must_fail git notes show HEAD^

Overwriting existing notes for object 7a4ca6ee52a974a66cbaa78e33214535dff1d691
ok 69 - --set-upstream-to notices an error to set branch as own upstream

expecting success: 
	GIT_COMMITTER_DATE="2005-05-26 23:30" \
	git checkout -b g/h/i -l master &&
	test_path_is_file .git/refs/heads/g/h/i &&
	test_path_is_file .git/logs/refs/heads/g/h/i &&
	test_cmp expect .git/logs/refs/heads/g/h/i

Switched to a new branch 'g/h/i'
ok 70 - git checkout -b g/h/i -l should create a branch and a log

expecting success: 
	git checkout master &&
	git config --unset core.logAllRefUpdates &&
	git checkout -b alpha &&
	git rev-parse --verify alpha@{0}

Switched to branch 'master'
commit 04ed9a0bbe0285f41c913e2002cb09ef8449d4a6
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:13:13 2005 -0700

    1st

diff --git a/1st.t b/1st.t
new file mode 100644
index 0000000..2a5d015
--- /dev/null
+++ b/1st.t
@@ -0,0 +1 @@
+1st
Switched to branch 'replace_sub1_with_file'
Your branch is up-to-date with 'origin/replace_sub1_with_file'.
test_must_fail: command succeeded: git checkout -f replace_sub1_with_file
error: No note found for object 04ed9a0bbe0285f41c913e2002cb09ef8449d4a6.
ok 13 - can overwrite existing note with "git notes add -f -m"

expecting success: 
	MSG=b2 git notes add &&
	test_path_is_missing .git/NOTES_EDITMSG &&
	git ls-tree -r refs/notes/commits >actual &&
	test_line_count = 1 actual &&
	test "b2" = "$(git notes show)" &&
	git show HEAD^ &&
	test_must_fail git notes show HEAD^

Switched to a new branch 'alpha'
f8df8aff4293333c4bc59455238820f99ed48582
not ok 31 - git checkout -f: replace submodule containing a .git directory with a file must fail # TODO known breakage

ok 71 - checkout -b makes reflog by default

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
		)
	
expecting success: 
	git checkout master &&
	git config core.logAllRefUpdates false &&
	git checkout -b beta &&
	test_must_fail git rev-parse --verify beta@{0}

b2
Switched to branch 'master'
Switched to a new branch 'beta'
fatal: Needed a single revision
ok 72 - checkout -b does not make reflog when core.logAllRefUpdates = false

expecting success: 
	git checkout master &&
	git checkout -lb gamma &&
	git config --unset core.logAllRefUpdates &&
	git rev-parse --verify gamma@{0}

commit 04ed9a0bbe0285f41c913e2002cb09ef8449d4a6
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:13:13 2005 -0700

    1st

diff --git a/1st.t b/1st.t
new file mode 100644
index 0000000..2a5d015
--- /dev/null
+++ b/1st.t
@@ -0,0 +1 @@
+1st
Switched to branch 'master'
error: No note found for object 04ed9a0bbe0285f41c913e2002cb09ef8449d4a6.
ok 14 - add w/no options on existing note morphs into edit

expecting success: 
	MSG=b1 git notes add -f &&
	test_path_is_missing .git/NOTES_EDITMSG &&
	git ls-tree -r refs/notes/commits >actual &&
	test_line_count = 1 actual &&
	test "b1" = "$(git notes show)" &&
	git show HEAD^ &&
	test_must_fail git notes show HEAD^

Switched to a new branch 'gamma'
Overwriting existing notes for object 7a4ca6ee52a974a66cbaa78e33214535dff1d691
Cloning into 'submodule_update'...
f8df8aff4293333c4bc59455238820f99ed48582
ok 73 - checkout -b with -l makes reflog when core.logAllRefUpdates = false

expecting success: 
	git config branch.autosetupmerge true &&
	git config remote.ambi1.url lalala &&
	git config remote.ambi1.fetch refs/heads/lalala:refs/heads/master &&
	git config remote.ambi2.url lilili &&
	git config remote.ambi2.fetch refs/heads/lilili:refs/heads/master &&
	git branch all1 master &&
	test -z "$(git config branch.all1.merge)"

b1
done.
commit 04ed9a0bbe0285f41c913e2002cb09ef8449d4a6
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:13:13 2005 -0700

    1st

diff --git a/1st.t b/1st.t
new file mode 100644
index 0000000..2a5d015
--- /dev/null
+++ b/1st.t
@@ -0,0 +1 @@
+1st
error: Not tracking: ambiguous information for ref refs/heads/master
error: No note found for object 04ed9a0bbe0285f41c913e2002cb09ef8449d4a6.
ok 15 - can overwrite existing note with "git notes add -f"
fatal: Unable to create '/«PKGBUILDDIR»/t/trash directory.t3210-pack-refs/.git/packed-refs.lock': File exists.

If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.

expecting success: 
	cat >expect <<-EOF &&
		commit 7a4ca6ee52a974a66cbaa78e33214535dff1d691
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:14:13 2005 -0700

		${indent}2nd

		Notes:
		${indent}b1
	EOF
	! (git cat-file commit HEAD | grep b1) &&
	git log -1 >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 24 - timeout if packed-refs.lock exists

expecting success: 
	LOCK=.git/packed-refs.lock &&
	>"$LOCK" &&
	test_when_finished "wait; rm -f $LOCK" &&
	{
		( sleep 1 ; rm -f $LOCK ) &
	} &&
	git -c core.packedrefstimeout=3000 pack-refs --all --prune

ok 74 - avoid ambiguous track

expecting success: 
	git config remote.local.url . &&
	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
	git config branch.autosetuprebase local &&
	(git show-ref -q refs/remotes/local/o || git fetch local) &&
	git branch mybase &&
	git branch --track myr1 mybase &&
	test "$(git config branch.myr1.remote)" = . &&
	test "$(git config branch.myr1.merge)" = refs/heads/mybase &&
	test "$(git config branch.myr1.rebase)" = true

ok 16 - show notes

expecting success: 
	test_commit 3rd &&
	MSG="b3${LF}c3c3c3c3${LF}d3d3d3" git notes add &&
	cat >expect-multiline <<-EOF &&
		commit d07d62e5208f22eb5695e7eb47667dc8b9860290
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:15:13 2005 -0700

		${indent}3rd

		Notes:
		${indent}b3
		${indent}c3c3c3c3
		${indent}d3d3d3

	EOF
	cat expect >>expect-multiline &&
	git log -2 >actual &&
	test_cmp expect-multiline actual

[master d07d62e] 3rd
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 3rd.t
b3
c3c3c3c3
d3d3d3
ok 17 - show multi-line notes

expecting success: 
	test_commit 4th &&
	echo "xyzzy" >note5 &&
	git notes add -F note5 &&
	cat >expect-F <<-EOF &&
		commit 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:16:13 2005 -0700

		${indent}4th

		Notes:
		${indent}xyzzy

	EOF
	cat expect-multiline >>expect-F &&
	git log -3 >actual &&
	test_cmp expect-F actual

From .
 * [new branch]      all1       -> local/all1
 * [new branch]      alpha      -> local/alpha
 * [new branch]      beta       -> local/beta
 * [new branch]      g/h/i      -> local/g/h/i
 * [new branch]      gamma      -> local/gamma
 * [new branch]      my1        -> local/my1
 * [new branch]      my12       -> local/my12
 * [new branch]      my13       -> local/my13
 * [new branch]      my14       -> local/my14
 * [new branch]      my15       -> local/my15
 * [new branch]      my2        -> local/my2
 * [new branch]      my3        -> local/my3
 * [new branch]      my4        -> local/my4
 * [new branch]      my6        -> local/my6
 * [new branch]      my8        -> local/my8
 * [new branch]      my9        -> local/my9
[master 0f7aa3e] 4th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 4th.t
Branch myr1 set up to track local branch mybase by rebasing.
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 18 - show -F notes

expecting success: 
	echo "zyxxy" >note5 &&
	test_must_fail git notes add -F note5 &&
	git log -3 >actual &&
	test_cmp expect-F actual

error: Cannot add notes. Found existing notes for object 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11. Use '-f' to overwrite existing notes
ok 75 - autosetuprebase local on a tracked local branch

expecting success: 
	git config remote.local.url . &&
	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
	git config branch.autosetuprebase always &&
	(git show-ref -q refs/remotes/local/o || git fetch local) &&
	git branch mybase2 &&
	git branch --track myr2 mybase &&
	test "$(git config branch.myr2.remote)" = . &&
	test "$(git config branch.myr2.merge)" = refs/heads/mybase &&
	test "$(git config branch.myr2.rebase)" = true

ok 19 - Re-adding -F notes without -f fails

expecting success: 
	cat >expect <<-EOF &&
		commit 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11
		tree 05ac65288c4c4b3b709a020ae94b2ece2f2201ae
		parent d07d62e5208f22eb5695e7eb47667dc8b9860290
		author A U Thor <author@example.com> 1112912173 -0700
		committer C O Mitter <committer@example.com> 1112912173 -0700

		${indent}4th
	EOF
	git log -1 --pretty=raw >actual &&
	test_cmp expect actual

ok 20 - git log --pretty=raw does not show notes

expecting success: 
	cat >>expect <<-EOF &&

	Notes:
	${indent}xyzzy
	EOF
	git log -1 --pretty=raw --show-notes >actual &&
	test_cmp expect actual

ok 21 - git log --show-notes

expecting success: 
	git log -1 --no-notes >actual &&
	! grep xyzzy actual

ok 22 - git log --no-notes

expecting success: 
	git format-patch -1 --stdout >actual &&
	! grep xyzzy actual

Cloning into 'sub1'...
ok 23 - git format-patch does not show notes

expecting success: 
	git format-patch --show-notes -1 --stdout >actual &&
	grep xyzzy actual

    xyzzy
ok 24 - git format-patch --show-notes does show notes

expecting success: 
		git show $p >actual &&
		eval "$negate grep xyzzy actual"
	
done.
    xyzzy
ok 25 - git show  does show notes

expecting success: 
		git show $p >actual &&
		eval "$negate grep xyzzy actual"
	
From .
 * [new branch]      mybase     -> local/mybase
 * [new branch]      myr1       -> local/myr1
ok 26 - git show --pretty does not show notes

expecting success: 
		git show $p >actual &&
		eval "$negate grep xyzzy actual"
	
ok 27 - git show --pretty=raw does not show notes

expecting success: 
		git show $p >actual &&
		eval "$negate grep xyzzy actual"
	
ok 28 - git show --pretty=short does not show notes

expecting success: 
		git show $p >actual &&
		eval "$negate grep xyzzy actual"
	
Branch myr2 set up to track local branch mybase by rebasing.
ok 29 - git show --pretty=medium does not show notes

expecting success: 
		git show $p >actual &&
		eval "$negate grep xyzzy actual"
	
Submodule path 'sub1': checked out '3950f7ed37a2b5b8e95094de1b49ceba8eecb3d9'
ok 30 - git show --pretty=full does not show notes

expecting success: 
		git show $p >actual &&
		eval "$negate grep xyzzy actual"
	
ok 76 - autosetuprebase always on a tracked local branch

expecting success: 
	git config remote.local.url . &&
	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
	git config branch.autosetuprebase remote &&
	(git show-ref -q refs/remotes/local/o || git fetch local) &&
	git branch mybase3 &&
	git branch --track myr3 mybase2 &&
	test "$(git config branch.myr3.remote)" = . &&
	test "$(git config branch.myr3.merge)" = refs/heads/mybase2 &&
	! test "$(git config branch.myr3.rebase)" = true

ok 31 - git show --pretty=fuller does not show notes

expecting success: 
		git show $p >actual &&
		eval "$negate grep xyzzy actual"
	
ok 32 - git show --pretty=format:%s does not show notes

expecting success: 
		git show $p >actual &&
		eval "$negate grep xyzzy actual"
	
ok 33 - git show --oneline does not show notes

expecting success: 
	git notes --ref=alternate add -m alternate

Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
ok 34 - setup alternate notes ref

expecting success: 
	git log -1 --notes >actual &&
	grep xyzzy actual &&
	! grep alternate actual

Switched to branch 'modify_sub1'
Your branch is up-to-date with 'origin/modify_sub1'.
ok 25 - retry acquiring packed-refs.lock

# passed all 25 test(s)
1..25
    xyzzy
ok 35 - git log --notes shows default notes

expecting success: 
	git log -1 --notes=alternate >actual &&
	! grep xyzzy actual &&
	grep alternate actual

*** t3302-notes-index-expensive.sh ***
Notes (alternate):
    alternate
ok 36 - git log --notes=X shows only X

expecting success: 
	git log -1 --notes --notes=alternate >actual &&
	grep xyzzy actual &&
	grep alternate actual

    xyzzy
Notes (alternate):
    alternate
ok 37 - git log --notes --notes=X shows both

expecting success: 
	git log -1 --notes --notes=alternate \
		--no-notes --notes=alternate \
		>actual &&
	! grep xyzzy actual &&
	grep alternate actual

Notes (alternate):
    alternate
From .
 * [new branch]      mybase2    -> local/mybase2
ok 38 - git log --no-notes resets default state

expecting success: 
	git log -1 --notes --notes=alternate \
		--no-notes --notes \
		>actual &&
	grep xyzzy actual &&
	! grep alternate actual

 * [new branch]      myr2       -> local/myr2
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3302-notes-index-expensive/.git/
    xyzzy
ok 39 - git log --no-notes resets ref list

expecting success: 
	test_commit 5th &&
	git notes add -m spam -m "foo${LF}bar${LF}baz" &&
	cat >expect-m <<-EOF &&
		commit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:17:13 2005 -0700

		${indent}5th

		Notes:
		${indent}spam
		${indent}
		${indent}foo
		${indent}bar
		${indent}baz

	EOF
	cat expect-F >>expect-m &&
	git log -4 >actual &&
	test_cmp expect-m actual

expecting success: 
		mkdir "$count" &&
		(
			cd "$count" &&
			create_repo "$count"
		)
	
Branch myr3 set up to track local branch mybase2.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3302-notes-index-expensive/10/.git/
[master 7f9ad88] 5th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 5th.t
ok 77 - autosetuprebase remote on a tracked local branch

expecting success: 
	git config remote.local.url . &&
	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
	git config branch.autosetuprebase never &&
	(git show-ref -q refs/remotes/local/o || git fetch local) &&
	git branch mybase4 &&
	git branch --track myr4 mybase2 &&
	test "$(git config branch.myr4.remote)" = . &&
	test "$(git config branch.myr4.merge)" = refs/heads/mybase2 &&
	! test "$(git config branch.myr4.rebase)" = true

ok 40 - show -m notes

expecting success: 
	git notes add -f -F /dev/null &&
	cat >expect-rm-F <<-EOF &&
		commit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:17:13 2005 -0700

		${indent}5th

	EOF
	cat expect-F >>expect-rm-F &&
	git log -4 >actual &&
	test_cmp expect-rm-F actual &&
	test_must_fail git notes show

Overwriting existing notes for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361
Removing note for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361
error: No note found for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361.
ok 41 - remove note with add -f -F /dev/null

expecting success: 
	git notes add -m "" &&
	git log -4 >actual &&
	test_cmp expect-rm-F actual &&
	test_must_fail git notes show

Removing note for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361
Submodule path 'sub1': checked out '7cbf99584fb902eb4a95073485eaf1183cda68ff'
ok 1 - setup 10

expecting success: 
		(
			cd "$count" &&
			test_notes "$count"
		)
	
error: No note found for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361.
ok 42 - do not create empty note with -m ""

expecting success: 
	cat >expect-combine_m_and_F <<-EOF &&
		foo

		xyzzy

		bar

		zyxxy

		baz
	EOF
	echo "xyzzy" >note_a &&
	echo "zyxxy" >note_b &&
	git notes add -m "foo" -F note_a -m "bar" -F note_b -m "baz" &&
	git notes show >actual &&
	test_cmp expect-combine_m_and_F actual

From .
 * [new branch]      mybase3    -> local/mybase3
 * [new branch]      myr3       -> local/myr3
ok 2 - notes work

checking prerequisite: USR_BIN_TIME

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	test -x /usr/bin/time

)
prerequisite USR_BIN_TIME not satisfied
skipping test: notes timing with /usr/bin/time 
		(
			cd "$count" &&
			time_notes 100
		)
	
ok 3 # skip notes timing with /usr/bin/time (missing USR_BIN_TIME)

ok 32 - git checkout -f: 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
		)
	
checking prerequisite: EXPENSIVE

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

)
ok 43 - create note with combination of -m and -F

expecting success: 
	git notes remove HEAD^ &&
	git notes remove &&
	cat >expect-rm-remove <<-EOF &&
		commit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:17:13 2005 -0700

		${indent}5th

		commit 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:16:13 2005 -0700

		${indent}4th

	EOF
	cat expect-multiline >>expect-rm-remove &&
	git log -4 >actual &&
	test_cmp expect-rm-remove actual &&
	test_must_fail git notes show HEAD^

prerequisite EXPENSIVE not satisfied
skipping test: setup 100 
		mkdir "$count" &&
		(
			cd "$count" &&
			create_repo "$count"
		)
	
ok 4 # skip setup 100 (missing EXPENSIVE)

skipping test: notes work 
		(
			cd "$count" &&
			test_notes "$count"
		)
	
ok 5 # skip notes work (missing EXPENSIVE)

Removing note for object HEAD^
skipping test: notes timing with /usr/bin/time 
		(
			cd "$count" &&
			time_notes 100
		)
	
ok 6 # skip notes timing with /usr/bin/time (missing EXPENSIVE,USR_BIN_TIME of USR_BIN_TIME,EXPENSIVE)

skipping test: setup 1000 
		mkdir "$count" &&
		(
			cd "$count" &&
			create_repo "$count"
		)
	
ok 7 # skip setup 1000 (missing EXPENSIVE)

Removing note for object HEAD
skipping test: notes work 
		(
			cd "$count" &&
			test_notes "$count"
		)
	
ok 8 # skip notes work (missing EXPENSIVE)

Branch myr4 set up to track local branch mybase2.
skipping test: notes timing with /usr/bin/time 
		(
			cd "$count" &&
			time_notes 100
		)
	
ok 9 # skip notes timing with /usr/bin/time (missing EXPENSIVE,USR_BIN_TIME of USR_BIN_TIME,EXPENSIVE)

skipping test: setup 10000 
		mkdir "$count" &&
		(
			cd "$count" &&
			create_repo "$count"
		)
	
ok 10 # skip setup 10000 (missing EXPENSIVE)

skipping test: notes work 
		(
			cd "$count" &&
			test_notes "$count"
		)
	
ok 11 # skip notes work (missing EXPENSIVE)

skipping test: notes timing with /usr/bin/time 
		(
			cd "$count" &&
			time_notes 100
		)
	
ok 12 # skip notes timing with /usr/bin/time (missing EXPENSIVE,USR_BIN_TIME of USR_BIN_TIME,EXPENSIVE)

# passed all 12 test(s)
1..12
ok 78 - autosetuprebase never on a tracked local branch

expecting success: 
	git config remote.local.url . &&
	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
	git config branch.autosetuprebase local &&
	(git show-ref -q refs/remotes/local/master || git fetch local) &&
	git branch --track myr5 local/master &&
	test "$(git config branch.myr5.remote)" = local &&
	test "$(git config branch.myr5.merge)" = refs/heads/master &&
	! test "$(git config branch.myr5.rebase)" = true

error: No note found for object 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11.
ok 44 - remove note with "git notes remove"

expecting success: 
	git rev-parse --verify refs/notes/commits >before_commit &&
	test_must_fail git notes remove HEAD^ &&
	git rev-parse --verify refs/notes/commits >after_commit &&
	test_cmp before_commit after_commit

Object HEAD^ has no note
*** t3303-notes-subtrees.sh ***
Cloning into 'submodule_update'...
ok 45 - removing non-existing note should not create new commit

expecting success: 
	before=$(git rev-parse --verify refs/notes/commits) &&
	test_when_finished "git update-ref refs/notes/commits $before" &&

	# We have only two -- add another and make sure it stays
	git notes add -m "extra" &&
	git notes list HEAD >after-removal-expect &&
	git notes remove HEAD^^ HEAD^^^ &&
	git notes list | sed -e "s/ .*//" >actual &&
	test_cmp after-removal-expect actual

Branch myr5 set up to track remote branch master from local.
done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3303-notes-subtrees/.git/
Removing note for object HEAD^^
Removing note for object HEAD^^^
ok 79 - autosetuprebase local on a tracked remote branch

expecting success: 
	git config remote.local.url . &&
	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
	git config branch.autosetuprebase never &&
	(git show-ref -q refs/remotes/local/master || git fetch local) &&
	git branch --track myr6 local/master &&
	test "$(git config branch.myr6.remote)" = local &&
	test "$(git config branch.myr6.merge)" = refs/heads/master &&
	! test "$(git config branch.myr6.rebase)" = true

expecting success: 

	(
		nr=0 &&
		while [ $nr -lt $number_of_commits ]; do
			nr=$(($nr+1)) &&
			test_tick &&
			cat <<INPUT_END
commit refs/heads/master
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit #$nr
COMMIT

M 644 inline file
data <<EOF
file in commit #$nr
EOF

INPUT_END

		done &&
		test_tick &&
		cat <<INPUT_END
commit refs/notes/commits
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
no notes
COMMIT

deleteall

INPUT_END

	) |
	git fast-import --quiet &&
	git config core.notesRef refs/notes/commits

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 46 - removing more than one

expecting success: 
	before=$(git rev-parse --verify refs/notes/commits) &&
	test_when_finished "git update-ref refs/notes/commits $before" &&
	test_must_fail git notes remove HEAD^^ HEAD^^^ HEAD^ &&
	after=$(git rev-parse --verify refs/notes/commits) &&
	test "$before" = "$after"

Removing note for object HEAD^^
Removing note for object HEAD^^^
Object HEAD^ has no note
Branch myr6 set up to track remote branch master from local.
ok 47 - removing is atomic

expecting success: 
	before=$(git rev-parse --verify refs/notes/commits) &&
	test_when_finished "git update-ref refs/notes/commits $before" &&

	# We have only two -- add another and make sure it stays
	git notes add -m "extra" &&
	git notes list HEAD >after-removal-expect &&
	git notes remove --ignore-missing HEAD^^ HEAD^^^ HEAD^ &&
	git notes list | sed -e "s/ .*//" >actual &&
	test_cmp after-removal-expect actual

ok 80 - autosetuprebase never on a tracked remote branch

expecting success: 
	git config remote.local.url . &&
	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
	git config branch.autosetuprebase remote &&
	(git show-ref -q refs/remotes/local/master || git fetch local) &&
	git branch --track myr7 local/master &&
	test "$(git config branch.myr7.remote)" = local &&
	test "$(git config branch.myr7.merge)" = refs/heads/master &&
	test "$(git config branch.myr7.rebase)" = true

Removing note for object HEAD^^
Removing note for object HEAD^^^
Object HEAD^ has no note
ok 48 - removing with --ignore-missing

expecting success: 
	before=$(git rev-parse --verify refs/notes/commits) &&
	test_when_finished "git update-ref refs/notes/commits $before" &&
	test_must_fail git notes remove --ignore-missing HEAD^^ HEAD^^^ NO-SUCH-COMMIT &&
	after=$(git rev-parse --verify refs/notes/commits) &&
	test "$before" = "$after"

Branch myr7 set up to track remote branch master from local by rebasing.
Removing note for object HEAD^^
Removing note for object HEAD^^^
error: Failed to resolve 'NO-SUCH-COMMIT' as a valid ref.
ok 49 - removing with --ignore-missing but bogus ref

expecting success: 
	before=$(git rev-parse --verify refs/notes/commits) &&
	test_when_finished "git update-ref refs/notes/commits $before" &&

	# We have only two -- add another and make sure it stays
	git notes add -m "extra" &&
	git notes list HEAD >after-removal-expect &&
	git rev-parse HEAD^^ HEAD^^^ >input &&
	git notes remove --stdin <input &&
	git notes list | sed -e "s/ .*//" >actual &&
	test_cmp after-removal-expect actual

ok 81 - autosetuprebase remote on a tracked remote branch

expecting success: 
	git config remote.local.url . &&
	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
	git config branch.autosetuprebase remote &&
	(git show-ref -q refs/remotes/local/master || git fetch local) &&
	git branch --track myr8 local/master &&
	test "$(git config branch.myr8.remote)" = local &&
	test "$(git config branch.myr8.merge)" = refs/heads/master &&
	test "$(git config branch.myr8.rebase)" = true

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule_update_repo/.) registered for path 'sub1'
Removing note for object d07d62e5208f22eb5695e7eb47667dc8b9860290
Removing note for object 7a4ca6ee52a974a66cbaa78e33214535dff1d691
Branch myr8 set up to track remote branch master from local by rebasing.
ok 50 - remove reads from --stdin

expecting success: 
	before=$(git rev-parse --verify refs/notes/commits) &&
	test_when_finished "git update-ref refs/notes/commits $before" &&
	git rev-parse HEAD^^ HEAD^^^ HEAD^ >input &&
	test_must_fail git notes remove --stdin <input &&
	after=$(git rev-parse --verify refs/notes/commits) &&
	test "$before" = "$after"

ok 82 - autosetuprebase always on a tracked remote branch

expecting success: 
	git config --unset branch.autosetuprebase &&
	git config remote.local.url . &&
	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
	(git show-ref -q refs/remotes/local/master || git fetch local) &&
	git branch --track myr9 local/master &&
	test "$(git config branch.myr9.remote)" = local &&
	test "$(git config branch.myr9.merge)" = refs/heads/master &&
	test "z$(git config branch.myr9.rebase)" = z

Cloning into 'sub1'...
Removing note for object d07d62e5208f22eb5695e7eb47667dc8b9860290
Removing note for object 7a4ca6ee52a974a66cbaa78e33214535dff1d691
Object 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11 has no note
ok 51 - remove --stdin is also atomic

expecting success: 
	before=$(git rev-parse --verify refs/notes/commits) &&
	test_when_finished "git update-ref refs/notes/commits $before" &&

	# We have only two -- add another and make sure it stays
	git notes add -m "extra" &&
	git notes list HEAD >after-removal-expect &&
	git rev-parse HEAD^^ HEAD^^^ HEAD^ >input &&
	git notes remove --ignore-missing --stdin <input &&
	git notes list | sed -e "s/ .*//" >actual &&
	test_cmp after-removal-expect actual

Branch myr9 set up to track remote branch master from local.
done.
ok 83 - autosetuprebase unconfigured on a tracked remote branch

expecting success: 
	git config remote.local.url . &&
	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
	(git show-ref -q refs/remotes/local/o || git fetch local) &&
	git branch mybase10 &&
	git branch --track myr10 mybase2 &&
	test "$(git config branch.myr10.remote)" = . &&
	test "$(git config branch.myr10.merge)" = refs/heads/mybase2 &&
	test "z$(git config branch.myr10.rebase)" = z

Removing note for object d07d62e5208f22eb5695e7eb47667dc8b9860290
Removing note for object 7a4ca6ee52a974a66cbaa78e33214535dff1d691
Object 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11 has no note
ok 52 - removing with --stdin --ignore-missing

expecting success: 
	cat >expect <<-EOF &&
		c9c6af7f78bc47490dbf3e822cf2f3c24d4b9061 7a4ca6ee52a974a66cbaa78e33214535dff1d691
		c18dc024e14f08d18d14eea0d747ff692d66d6a3 d07d62e5208f22eb5695e7eb47667dc8b9860290
	EOF
	git notes list >actual &&
	test_cmp expect actual

ok 53 - list notes with "git notes list"

expecting success: 
	git notes >actual &&
	test_cmp expect actual

ok 54 - list notes with "git notes"

expecting success: 
	cat >expect <<-EOF &&
		c18dc024e14f08d18d14eea0d747ff692d66d6a3
	EOF
	git notes list HEAD^^ >actual &&
	test_cmp expect actual

ok 55 - list specific note with "git notes list <object>"

expecting success: 
	cat >expect <<-EOF &&
	EOF
	test_must_fail git notes list HEAD >actual &&
	test_cmp expect actual

Submodule path 'sub1': checked out '3950f7ed37a2b5b8e95094de1b49ceba8eecb3d9'
error: No note found for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361.
ok 56 - listing non-existing notes fails

expecting success: 
	cat >expect <<-EOF &&
		Initial set of notes

		More notes appended with git notes append
	EOF
	git notes add -m "Initial set of notes" &&
	git notes append -m "More notes appended with git notes append" &&
	git notes show >actual &&
	test_cmp expect actual

From .
 * [new branch]      mybase4    -> local/mybase4
 * [new branch]      myr4       -> local/myr4
 * [new branch]      myr5       -> local/myr5
 * [new branch]      myr6       -> local/myr6
 * [new branch]      myr7       -> local/myr7
 * [new branch]      myr8       -> local/myr8
 * [new branch]      myr9       -> local/myr9
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
ok 57 - append to existing note with "git notes append"

expecting success: 
	cat >expect_list <<-EOF &&
		c9c6af7f78bc47490dbf3e822cf2f3c24d4b9061 7a4ca6ee52a974a66cbaa78e33214535dff1d691
		4b6ad22357cc8a1296720574b8d2fbc22fab0671 7f9ad8836c775acb134c0a055fc55fb4cd1ba361
		c18dc024e14f08d18d14eea0d747ff692d66d6a3 d07d62e5208f22eb5695e7eb47667dc8b9860290
	EOF
	git notes list >actual &&
	test_cmp expect_list actual

Switched to branch 'invalid_sub1'
Your branch is up-to-date with 'origin/invalid_sub1'.
ok 58 - "git notes list" does not expand to "git notes list HEAD"

expecting success: 
	git notes append -m "" &&
	git notes show >actual &&
	test_cmp expect actual

Branch myr10 set up to track local branch mybase2.
ok 84 - autosetuprebase unconfigured on a tracked local branch

expecting success: 
	git config remote.local.url . &&
	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
	(git show-ref -q refs/remotes/local/master || git fetch local) &&
	git branch --no-track myr11 mybase2 &&
	test "z$(git config branch.myr11.remote)" = z &&
	test "z$(git config branch.myr11.merge)" = z &&
	test "z$(git config branch.myr11.rebase)" = z

ok 1 - setup: create 100 commits

expecting success: test_sha1_based "s|^..|&/|"
ok 59 - appending empty string does not change existing note

expecting success: 
	git notes remove HEAD &&
	test_must_fail git notes list HEAD &&
	git notes append -m "Initial set of notes${LF}${LF}More notes appended with git notes append" &&
	git notes show >actual &&
	test_cmp expect actual

Removing note for object HEAD
error: No note found for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361.
ok 60 - git notes append == add when there is no existing note

expecting success: 
	git notes remove HEAD &&
	test_must_fail git notes list HEAD &&
	git notes append -m "" &&
	test_must_fail git notes list HEAD

Removing note for object HEAD
ok 85 - autosetuprebase unconfigured on untracked local branch

expecting success: 
	git config remote.local.url . &&
	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
	(git show-ref -q refs/remotes/local/master || git fetch local) &&
	git branch --no-track myr12 local/master &&
	test "z$(git config branch.myr12.remote)" = z &&
	test "z$(git config branch.myr12.merge)" = z &&
	test "z$(git config branch.myr12.rebase)" = z

error: No note found for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361.
Removing note for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361
error: No note found for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361.
ok 61 - appending empty string to non-existing note does not create note

expecting success: 
	test_commit 6th &&
	GIT_NOTES_REF="refs/notes/other" git notes add -m "other note" &&
	cat >expect-not-other <<-EOF &&
		commit 2c125331118caba0ff8238b7f4958ac6e93fe39c
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:18:13 2005 -0700

		${indent}6th
	EOF
	cp expect-not-other expect-other &&
	cat >>expect-other <<-EOF

		Notes (other):
		${indent}other note
	EOF

[master 2c12533] 6th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 6th.t
ok 86 - autosetuprebase unconfigured on untracked remote branch

expecting success: 
	git config branch.autosetuprebase never &&
	git config remote.local.url . &&
	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
	(git show-ref -q refs/remotes/local/master || git fetch local) &&
	git branch --no-track myr13 mybase2 &&
	test "z$(git config branch.myr13.remote)" = z &&
	test "z$(git config branch.myr13.merge)" = z &&
	test "z$(git config branch.myr13.rebase)" = z

ok 62 - create other note on a different notes ref (setup)

expecting success: 
	git log -1 >actual &&
	test_cmp expect-not-other actual

ok 63 - Do not show note on other ref by default

expecting success: 
	GIT_NOTES_REF="refs/notes/other" git log -1 >actual &&
	test_cmp expect-other actual

ok 64 - Do show note when ref is given in GIT_NOTES_REF

expecting success: 
	test_config core.notesRef "refs/notes/other" &&
	git log -1 >actual &&
	test_cmp expect-other actual

ok 65 - Do show note when ref is given in core.notesRef config

expecting success: 
	test_config core.notesRef "refs/notes/other" &&
	GIT_NOTES_REF="refs/notes/wrong" git log -1 >actual &&
	test_cmp expect-not-other actual

ok 87 - autosetuprebase never on an untracked local branch

expecting success: 
	git config branch.autosetuprebase local &&
	git config remote.local.url . &&
	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
	(git show-ref -q refs/remotes/local/master || git fetch local) &&
	git branch --no-track myr14 mybase2 &&
	test "z$(git config branch.myr14.remote)" = z &&
	test "z$(git config branch.myr14.merge)" = z &&
	test "z$(git config branch.myr14.rebase)" = z

fatal: reference is not a tree: 0123456789012345678901234567890123456789
Unable to checkout '0123456789012345678901234567890123456789' in submodule path 'sub1'
ok 66 - Do not show note when core.notesRef is overridden

expecting success: 
	cat >expect-both <<-EOF &&
		commit 2c125331118caba0ff8238b7f4958ac6e93fe39c
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:18:13 2005 -0700

		${indent}6th

		Notes:
		${indent}order test

		Notes (other):
		${indent}other note

		commit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:17:13 2005 -0700

		${indent}5th

		Notes:
		${indent}replacement for deleted note
	EOF
	GIT_NOTES_REF=refs/notes/commits git notes add \
		-m"replacement for deleted note" HEAD^ &&
	GIT_NOTES_REF=refs/notes/commits git notes add -m"order test" &&
	test_unconfig core.notesRef &&
	test_config notes.displayRef "refs/notes/*" &&
	git log -2 >actual &&
	test_cmp expect-both actual

ok 33 - git checkout -f: 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
		)
	
ok 88 - autosetuprebase local on an untracked local branch

expecting success: 
	git config branch.autosetuprebase remote &&
	git config remote.local.url . &&
	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
	(git show-ref -q refs/remotes/local/master || git fetch local) &&
	git branch --no-track myr15 mybase2 &&
	test "z$(git config branch.myr15.remote)" = z &&
	test "z$(git config branch.myr15.merge)" = z &&
	test "z$(git config branch.myr15.rebase)" = z

ok 67 - Show all notes when notes.displayRef=refs/notes/*

expecting success: 
	test_config core.notesRef refs/notes/commits &&
	test_config notes.displayRef refs/notes/other &&
	git log -2 >actual &&
	test_cmp expect-both actual

Cloning into 'submodule_update'...
ok 89 - autosetuprebase remote on an untracked local branch

expecting success: 
	git config branch.autosetuprebase always &&
	git config remote.local.url . &&
	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
	(git show-ref -q refs/remotes/local/master || git fetch local) &&
	git branch --no-track myr16 mybase2 &&
	test "z$(git config branch.myr16.remote)" = z &&
	test "z$(git config branch.myr16.merge)" = z &&
	test "z$(git config branch.myr16.rebase)" = z

ok 68 - core.notesRef is implicitly in notes.displayRef

expecting success: 
	test_unconfig core.notesRef &&
	test_config notes.displayRef refs/notes/commits &&
	git config --add notes.displayRef refs/notes/other &&
	git log -2 >actual &&
	test_cmp expect-both actual

done.
ok 69 - notes.displayRef can be given more than once

expecting success: 
	cat >expect-both-reversed <<-EOF &&
		commit 2c125331118caba0ff8238b7f4958ac6e93fe39c
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:18:13 2005 -0700

		${indent}6th

		Notes (other):
		${indent}other note

		Notes:
		${indent}order test
	EOF
	test_config core.notesRef refs/notes/other &&
	test_config notes.displayRef refs/notes/commits &&
	git log -1 >actual &&
	test_cmp expect-both-reversed actual

Switched to a new branch 'invalid_sub1'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
ok 90 - autosetuprebase always on an untracked local branch

expecting success: 
	git config branch.autosetuprebase never &&
	git config remote.local.url . &&
	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
	(git show-ref -q refs/remotes/local/master || git fetch local) &&
	git branch --no-track myr17 local/master &&
	test "z$(git config branch.myr17.remote)" = z &&
	test "z$(git config branch.myr17.merge)" = z &&
	test "z$(git config branch.myr17.rebase)" = z

fatal: Needed a single revision
Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
ok 70 - notes.displayRef respects order

expecting success: 
	GIT_NOTES_DISPLAY_REF=refs/notes/commits:refs/notes/other \
		git log -2 >actual &&
	test_cmp expect-both actual

Switched to branch 'valid_sub1'
Your branch is up-to-date with 'origin/valid_sub1'.
ok 71 - GIT_NOTES_DISPLAY_REF works

expecting success: 
	cat >expect-none <<-EOF &&
		commit 2c125331118caba0ff8238b7f4958ac6e93fe39c
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:18:13 2005 -0700

		${indent}6th

		commit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:17:13 2005 -0700

		${indent}5th
	EOF
	test_config notes.displayRef "refs/notes/*" &&
	GIT_NOTES_REF= GIT_NOTES_DISPLAY_REF= git log -2 >actual &&
	test_cmp expect-none actual

ok 72 - GIT_NOTES_DISPLAY_REF overrides config

expecting success: 
	GIT_NOTES_REF= GIT_NOTES_DISPLAY_REF= git log --show-notes=* -2 >actual &&
	test_cmp expect-both actual

ok 91 - autosetuprebase never on an untracked remote branch

expecting success: 
	git config branch.autosetuprebase local &&
	git config remote.local.url . &&
	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
	(git show-ref -q refs/remotes/local/master || git fetch local) &&
	git branch --no-track myr18 local/master &&
	test "z$(git config branch.myr18.remote)" = z &&
	test "z$(git config branch.myr18.merge)" = z &&
	test "z$(git config branch.myr18.rebase)" = z

ok 73 - --show-notes=* adds to GIT_NOTES_DISPLAY_REF

expecting success: 
	cat >expect-commits <<-EOF &&
		commit 2c125331118caba0ff8238b7f4958ac6e93fe39c
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:18:13 2005 -0700

		${indent}6th

		Notes:
		${indent}order test
	EOF
	git log --no-standard-notes --show-notes=commits -1 >actual &&
	test_cmp expect-commits actual

ok 74 - --no-standard-notes

expecting success: 
	test_config notes.displayRef "refs/notes/*" &&
	git log --no-standard-notes --show-notes=commits \
		--standard-notes -2 >actual &&
	test_cmp expect-both actual

ok 75 - --standard-notes

expecting success: 
	git log --show-notes=other --show-notes=commits \
		 --no-standard-notes -1 >actual &&
	test_cmp expect-both-reversed actual

ok 92 - autosetuprebase local on an untracked remote branch

expecting success: 
	git config branch.autosetuprebase remote &&
	git config remote.local.url . &&
	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
	(git show-ref -q refs/remotes/local/master || git fetch local) &&
	git branch --no-track myr19 local/master &&
	test "z$(git config branch.myr19.remote)" = z &&
	test "z$(git config branch.myr19.merge)" = z &&
	test "z$(git config branch.myr19.rebase)" = z

ok 76 - --show-notes=ref accumulates

expecting success: 
	test_config core.notesRef refs/notes/other &&
	echo "Note on a tree" >expect &&
	git notes add -m "Note on a tree" HEAD: &&
	git notes show HEAD: >actual &&
	test_cmp expect actual &&
	echo "Note on a blob" >expect &&
	filename=$(git ls-tree --name-only HEAD | head -n1) &&
	git notes add -m "Note on a blob" HEAD:$filename &&
	git notes show HEAD:$filename >actual &&
	test_cmp expect actual &&
	echo "Note on a tag" >expect &&
	git tag -a -m "This is an annotated tag" foobar HEAD^ &&
	git notes add -m "Note on a tag" foobar &&
	git notes show foobar >actual &&
	test_cmp expect actual

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t2013-checkout-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 93 - autosetuprebase remote on an untracked remote branch

expecting success: 
	git config branch.autosetuprebase always &&
	git config remote.local.url . &&
	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
	(git show-ref -q refs/remotes/local/master || git fetch local) &&
	git branch --no-track myr20 local/master &&
	test "z$(git config branch.myr20.remote)" = z &&
	test "z$(git config branch.myr20.merge)" = z &&
	test "z$(git config branch.myr20.rebase)" = z

Cloning into 'sub1'...
ok 77 - Allow notes on non-commits (trees, blobs, tags)

expecting success: 
	cat >expect <<-EOF &&
		commit fb01e0ca8c33b6cc0c6451dde747f97df567cb5c
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:19:13 2005 -0700

		${indent}7th

		Notes:
		${indent}order test
	EOF
	test_commit 7th &&
	git notes add -C $(git notes list HEAD^) &&
	git log -1 >actual &&
	test_cmp expect actual &&
	test "$(git notes list HEAD)" = "$(git notes list HEAD^)"

ok 94 - autosetuprebase always on an untracked remote branch

expecting success: 
	git config branch.autosetupmerge always &&
	test_when_finished git checkout master &&
	git checkout HEAD^0 &&
	git branch my11 &&
	test -z "$(git config branch.my11.remote)" &&
	test -z "$(git config branch.my11.merge)"

done.
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 f8df8af... Second commit.
[master fb01e0c] 7th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 7th.t
Switched to branch 'master'
ok 95 - autosetuprebase always on detached HEAD

expecting success: 
	git config branch.autosetuprebase garbage &&
	test_must_fail git branch

error: Malformed value for branch.autosetuprebase
fatal: bad config variable 'branch.autosetuprebase' in file '.git/config' at line 20
ok 96 - detect misconfigured autosetuprebase (bad value)

expecting success: 
	git config --unset branch.autosetuprebase &&
	echo "[branch] autosetuprebase" >>.git/config &&
	test_must_fail git branch &&
	git config --unset branch.autosetuprebase

ok 78 - create note from other note with "git notes add -C"

expecting success: 
	test_commit 8th &&
	test_must_fail git notes add -C deadbeef &&
	test_must_fail git notes list HEAD

error: Missing value for 'branch.autosetuprebase'
fatal: bad config variable 'branch.autosetuprebase' in file '.git/config' at line 71
Submodule path 'sub1': checked out '3950f7ed37a2b5b8e95094de1b49ceba8eecb3d9'
ok 97 - detect misconfigured autosetuprebase (no value)

expecting success: 
	git checkout my9 &&
	git config --unset branch.my8.merge &&
	test_must_fail git branch -d my8

Switched to branch 'my9'
[master 9a4c31c] 8th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 8th.t
fatal: Failed to resolve 'deadbeef' as a valid ref.
error: The branch 'my8' is not fully merged.
If you are sure you want to delete it, run 'git branch -D my8'.
ok 98 - attempt to delete a branch without base and unmerged to HEAD

expecting success: 
	# we are on my9 which is the initial commit; traditionally
	# we would not have allowed deleting my8 that is not merged
	# to my9, but it is set to track master that already has my8
	git config branch.my8.merge refs/heads/master &&
	git branch -d my8

error: No note found for object 9a4c31c7f722b5d517e92c64e932dd751e1413bf.
ok 79 - create note from non-existing note with "git notes add -C" fails

expecting success: 
	commit=$(git rev-parse --verify HEAD) &&
	tree=$(git rev-parse --verify HEAD:) &&
	test_must_fail git notes add -C $commit &&
	test_must_fail git notes add -C $tree &&
	test_must_fail git notes list HEAD

warning: deleting branch 'my8' that has been merged to
         'refs/heads/master', but not yet merged to HEAD.
Deleted branch my8 (was f8df8af).
ok 99 - attempt to delete a branch merged to its base

expecting success: 
	git checkout master &&
	echo Third >>A &&
	git commit -m "Third commit" A &&
	git branch -t my10 my9 &&
	git branch -f my10 HEAD^ &&
	# we are on master which is at the third commit, and my10
	# is behind us, so traditionally we would have allowed deleting
	# it; but my10 is set to track my9 that is further behind.
	test_must_fail git branch -d my10

fatal: Cannot read note data from non-blob object '9a4c31c7f722b5d517e92c64e932dd751e1413bf'.
Switched to branch 'master'
fatal: Cannot read note data from non-blob object '37f6454412e4ed89ae47782f956ed0fb573892f6'.
error: No note found for object 9a4c31c7f722b5d517e92c64e932dd751e1413bf.
ok 80 - create note from non-blob with "git notes add -C" fails

expecting success: 
	cat >expect <<-EOF &&
		commit 9a4c31c7f722b5d517e92c64e932dd751e1413bf
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:20:13 2005 -0700

		${indent}8th

		Notes:
		${indent}This is a blob object
	EOF
	blob=$(echo "This is a blob object" | git hash-object -w --stdin) &&
	git notes add -C $blob &&
	git log -1 >actual &&
	test_cmp expect actual &&
	test "$(git notes list HEAD)" = "$blob"

ok 34 - git checkout -f: modified submodule does not update submodule work tree from invalid commit

[master 2eb8496] Third commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 2 - test notes in 2/38-fanout

expecting success: verify_notes
# still have 6 known breakage(s)
# passed all remaining 28 test(s)
1..34
Branch my10 set up to track local branch my9.
warning: not deleting branch 'my10' that is not yet merged to
         'refs/heads/my9', even though it is merged to HEAD.
error: The branch 'my10' is not fully merged.
If you are sure you want to delete it, run 'git branch -D my10'.
ok 100 - attempt to delete a branch merged to its base

expecting success: 
	git checkout master &&
	git --bare init myupstream.git &&
	git push myupstream.git master:refs/heads/frotz &&
	git remote add origin myupstream.git &&
	git fetch &&
	git branch --set-upstream master origin/frotz &&

	test "z$(git config branch.master.remote)" = "zorigin" &&
	test "z$(git config branch.master.merge)" = "zrefs/heads/frotz"


ok 3 - verify notes in 2/38-fanout

expecting success: test_sha1_based "s|^\(..\)\(..\)|\1/\2/|"
ok 81 - create note from blob with "git notes add -C" reuses blob id

expecting success: 
	cat >expect <<-EOF &&
		commit 2e0db4bc649e174d667a1cde19e725cf897a5bd2
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:21:13 2005 -0700

		${indent}9th

		Notes:
		${indent}yet another note
	EOF
	test_commit 9th &&
	MSG="yet another note" git notes add -c $(git notes list HEAD^^) &&
	git log -1 >actual &&
	test_cmp expect actual

Already on 'master'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3200-branch/myupstream.git/
[master 2e0db4b] 9th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 9th.t
yet another note
*** t3304-notes-mixed.sh ***
ok 82 - create note from other note with "git notes add -c"

expecting success: 
	test_commit 10th &&
	test_must_fail env MSG="yet another note" git notes add -c deadbeef &&
	test_must_fail git notes list HEAD

To myupstream.git
 * [new branch]      master -> frotz
[master 7c3b87a] 10th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 10th.t
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3304-notes-mixed/.git/
expecting success: 

	test_tick &&
	cat <<INPUT_END >input &&
commit refs/heads/master
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit #1
COMMIT

M 644 inline file
data <<EOF
file in commit #1
EOF

INPUT_END

	test_tick &&
	cat <<INPUT_END >>input &&
commit refs/heads/master
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit #2
COMMIT

M 644 inline file
data <<EOF
file in commit #2
EOF

INPUT_END
	git fast-import --quiet <input

fatal: Failed to resolve 'deadbeef' as a valid ref.
error: No note found for object 7c3b87ab368f81e11b1ea87b2ab99a71ccd25406.
ok 83 - create note from non-existing note with "git notes add -c" fails

expecting success: 
	cat >expect <<-EOF &&
		commit 2e0db4bc649e174d667a1cde19e725cf897a5bd2
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:21:13 2005 -0700

		${indent}9th

		Notes:
		${indent}yet another note
		${indent}
		${indent}yet another note
	EOF
	git notes append -C $(git notes list HEAD^) HEAD^ &&
	git log -1 HEAD^ >actual &&
	test_cmp expect actual

From myupstream
 * [new branch]      frotz      -> origin/frotz
ok 84 - append to note from other note with "git notes append -C"

expecting success: 
	cat >expect <<-EOF &&
		commit 7c3b87ab368f81e11b1ea87b2ab99a71ccd25406
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:22:13 2005 -0700

		${indent}10th

		Notes:
		${indent}other note
	EOF
	MSG="other note" git notes append -c $(git notes list HEAD^) &&
	git log -1 >actual &&
	test_cmp expect actual

The --set-upstream flag is deprecated and will be removed. Consider using --track or --set-upstream-to
Branch master set up to track remote branch frotz from origin.
ok 101 - use set-upstream on the current branch

expecting success: 
	write_script editor <<-\EOF &&
		echo "New contents" >"$1"
	EOF
	EDITOR=./editor git branch --edit-description &&
		write_script editor <<-\EOF &&
		git stripspace -s <"$1" >"EDITOR_OUTPUT"
	EOF
	EDITOR=./editor git branch --edit-description &&
	echo "New contents" >expect &&
	test_cmp EDITOR_OUTPUT expect

ok 1 - setup: create a couple of commits

expecting success: 

	commit1=$(git rev-parse refs/heads/master^) &&
	commit2=$(git rev-parse refs/heads/master) &&
	test_tick &&
	cat <<INPUT_END >input &&
commit refs/notes/commits
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
notes commit #1
COMMIT

N inline $commit1
data <<EOF
note for commit #1
EOF

N inline $commit2
data <<EOF
note for commit #2
EOF

INPUT_END
	test_tick &&
	cat <<INPUT_END >>input &&
commit refs/notes/commits
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
notes commit #2
COMMIT

M 644 inline foobar/non-note.txt
data <<EOF
A non-note in a notes tree
EOF

N inline $commit2
data <<EOF
edited note for commit #2
EOF

INPUT_END
	test_tick &&
	cat <<INPUT_END >>input &&
commit refs/notes/commits
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
notes commit #3
COMMIT

N inline $commit1
data <<EOF
edited note for commit #1
EOF

M 644 inline deadbeef
data <<EOF
non-note with SHA1-like name
EOF

M 644 inline de/adbeef
data <<EOF
another non-note with SHA1-like name
EOF

M 644 inline de/adbeefdeadbeefdeadbeefdeadbeefdeadbeef
data <<EOF
This is actually a valid note, albeit to a non-existing object.
It is needed in order to trigger the "mishandling" of the dead/beef non-note.
EOF

M 644 inline dead/beef
data <<EOF
yet another non-note with SHA1-like name
EOF

INPUT_END
	git fast-import --quiet <input &&
	git config core.notesRef refs/notes/commits

other note
ok 85 - create note from other note with "git notes append -c"

expecting success: 
	cat >expect <<-EOF &&
		commit 7c3b87ab368f81e11b1ea87b2ab99a71ccd25406
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:22:13 2005 -0700

		${indent}10th

		Notes:
		${indent}other note
		${indent}
		${indent}yet another note
	EOF
	MSG="yet another note" git notes append -c $(git notes list HEAD) &&
	git log -1 >actual &&
	test_cmp expect actual

ok 102 - use --edit-description

expecting success: 
	write_script editor <<-\EOF &&
		echo "New contents" >"$1"
	EOF
	test_must_fail env EDITOR=./editor git branch --edit-description no-such-branch

error: No branch named 'no-such-branch'.
yet another note
ok 103 - detect typo in branch name when using --edit-description

expecting success: 
	write_script editor <<-\EOF &&
		echo "New contents" >"$1"
	EOF
	git checkout --orphan unborn &&
	test_must_fail env EDITOR=./editor git branch --edit-description

Switched to a new branch 'unborn'
ok 86 - append to note from other note with "git notes append -c"

expecting success: 
	cat >expect <<-EOF &&
		commit a446fff8777efdc6eb8f4b7c8a5ff699484df0d5
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:23:13 2005 -0700

		${indent}11th

		Notes:
		${indent}other note
		${indent}
		${indent}yet another note
	EOF
	test_commit 11th &&
	git notes copy HEAD^ HEAD &&
	git log -1 >actual &&
	test_cmp expect actual &&
	test "$(git notes list HEAD)" = "$(git notes list HEAD^)"

error: No commit on branch 'unborn' yet.
ok 104 - refuse --edit-description on unborn branch for now

expecting success: 
	test_must_fail git branch --merged 0000000000000000000000000000000000000000

fatal: object '0000000000000000000000000000000000000000' does not point to a commit
ok 105 - --merged catches invalid object names

[master a446fff] 11th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 11th.t
expecting success: 
	rm -rf a b c d &&
	git init a &&
	(
		cd a &&
		test_commit a
	) &&
	git init b &&
	(
		cd b &&
		test_commit b
	) &&
	git init c &&
	(
		cd c &&
		test_commit c &&
		git remote add a ../a &&
		git remote add b ../b &&
		git fetch --all
	) &&
	git init d &&
	(
		cd d &&
		git remote add c ../c &&
		git config remote.c.fetch "+refs/remotes/*:refs/remotes/*" &&
		git fetch c &&
		git branch --track local/a/master remotes/a/master &&
		test "$(git config branch.local/a/master.remote)" = "c" &&
		test "$(git config branch.local/a/master.merge)" = "refs/remotes/a/master" &&
		git rev-parse --verify a >expect &&
		git rev-parse --verify local/a/master >actual &&
		test_cmp expect actual
	)

ok 2 - create a notes tree with both notes and non-notes

expecting success: 

	git log | grep "^    " > actual &&
	test_cmp expect actual

ok 3 - verify contents of notes

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3200-branch/a/.git/
expecting success: 

	git cat-file -p refs/notes/commits:foobar/non-note.txt > actual_nn1 &&
	test_cmp expect_nn1 actual_nn1 &&
	git cat-file -p refs/notes/commits:deadbeef > actual_nn2 &&
	test_cmp expect_nn2 actual_nn2 &&
	git cat-file -p refs/notes/commits:de/adbeef > actual_nn3 &&
	test_cmp expect_nn3 actual_nn3 &&
	git cat-file -p refs/notes/commits:dead/beef > actual_nn4 &&
	test_cmp expect_nn4 actual_nn4

[master (root-commit) ce450c7] a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a.t
ok 87 - copy note with "git notes copy"

expecting success: 
	test_must_fail git notes copy HEAD~2 HEAD &&
	git log -1 >actual &&
	test_cmp expect actual &&
	test "$(git notes list HEAD)" = "$(git notes list HEAD^)"

error: Cannot copy notes. Found existing notes for object a446fff8777efdc6eb8f4b7c8a5ff699484df0d5. Use '-f' to overwrite existing notes
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3200-branch/b/.git/
ok 4 - verify contents of non-notes

expecting success: 

	test_tick &&
	git notes add -f -m "foo bar"

Overwriting existing notes for object 5f8b8322f6a2c6d36eb6d42312d2393900ab7b81
ok 88 - prevent overwrite with "git notes copy"

expecting success: 
	cat >expect <<-EOF &&
		commit a446fff8777efdc6eb8f4b7c8a5ff699484df0d5
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:23:13 2005 -0700

		${indent}11th

		Notes:
		${indent}yet another note
		${indent}
		${indent}yet another note
	EOF
	git notes copy -f HEAD~2 HEAD &&
	git log -1 >actual &&
	test_cmp expect actual &&
	test "$(git notes list HEAD)" = "$(git notes list HEAD~2)"

ok 5 - git-notes preserves non-notes

expecting success: 

	git cat-file -p refs/notes/commits:foobar/non-note.txt > actual_nn1 &&
	test_cmp expect_nn1 actual_nn1 &&
	git cat-file -p refs/notes/commits:deadbeef > actual_nn2 &&
	test_cmp expect_nn2 actual_nn2 &&
	git cat-file -p refs/notes/commits:de/adbeef > actual_nn3 &&
	test_cmp expect_nn3 actual_nn3 &&
	git cat-file -p refs/notes/commits:dead/beef > actual_nn4 &&
	test_cmp expect_nn4 actual_nn4

[master (root-commit) 19acec0] b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 b.t
Overwriting existing notes for object a446fff8777efdc6eb8f4b7c8a5ff699484df0d5
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3200-branch/c/.git/
ok 6 - verify contents of non-notes after git-notes

ok 89 - allow overwrite with "git notes copy -f"

# passed all 6 test(s)
1..6
expecting success: 
	test_commit 12th &&
	test_commit 13th &&
	test_must_fail git notes copy HEAD^ HEAD

[master (root-commit) ea1ac38] c
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c.t
[master 65e263d] 12th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 12th.t
*** t3305-notes-fanout.sh ***
Fetching a
warning: no common commits
[master e871aa6] 13th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 13th.t
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3305-notes-fanout/.git/
error: Missing notes on source object 65e263ded02ae4e8839bc151095113737579dc12. Cannot copy.
ok 90 - cannot copy note from object without notes

expecting success: 
	cat >expect <<-EOF &&
		commit e871aa61182b1d95d0a6fb75445d891722863b6b
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:25:13 2005 -0700

		${indent}13th

		Notes:
		${indent}yet another note
		${indent}
		${indent}yet another note

		commit 65e263ded02ae4e8839bc151095113737579dc12
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:24:13 2005 -0700

		${indent}12th

		Notes:
		${indent}other note
		${indent}
		${indent}yet another note
	EOF
	(echo $(git rev-parse HEAD~3) $(git rev-parse HEAD^); \
	echo $(git rev-parse HEAD~2) $(git rev-parse HEAD)) |
	git notes copy --stdin &&
	git log -2 >actual &&
	test_cmp expect actual &&
	test "$(git notes list HEAD)" = "$(git notes list HEAD~2)" &&
	test "$(git notes list HEAD^)" = "$(git notes list HEAD~3)"

expecting success: 
	num_notes=300 &&
	i=0 &&
	while test $i -lt $num_notes
	do
		i=$(($i + 1)) &&
		test_tick &&
		echo "file for commit #$i" > file &&
		git add file &&
		git commit -q -m "commit #$i" &&
		git notes add -m "note #$i" || return 1
	done

From ../a
 * [new branch]      master     -> a/master
 * [new tag]         a          -> a
Fetching b
warning: no common commits
From ../b
 * [new branch]      master     -> b/master
 * [new tag]         b          -> b
ok 91 - git notes copy --stdin

expecting success: 
	cat >expect <<-EOF &&
		commit 4acf42e847e7fffbbf89ee365c20ac7caf40de89
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:27:13 2005 -0700

		${indent}15th

		commit 07c85d77059393ed0154b8c96906547a59dfcddd
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:26:13 2005 -0700

		${indent}14th
	EOF
	test_commit 14th &&
	test_commit 15th &&
	(echo $(git rev-parse HEAD~3) $(git rev-parse HEAD^); \
	echo $(git rev-parse HEAD~2) $(git rev-parse HEAD)) |
	git notes copy --for-rewrite=foo &&
	git log -2 >actual &&
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3200-branch/d/.git/
[master 07c85d7] 14th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 14th.t
[master 4acf42e] 15th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 15th.t
From ../c
 * [new ref]         a/master   -> a/master
 * [new ref]         b/master   -> b/master
 * [new tag]         a          -> a
 * [new tag]         b          -> b
Branch local/a/master set up to track remote ref refs/remotes/a/master.
ok 92 - git notes copy --for-rewrite (unconfigured)

expecting success: 
	cat >expect <<-EOF &&
		commit 4acf42e847e7fffbbf89ee365c20ac7caf40de89
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:27:13 2005 -0700

		${indent}15th

		Notes:
		${indent}yet another note
		${indent}
		${indent}yet another note

		commit 07c85d77059393ed0154b8c96906547a59dfcddd
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:26:13 2005 -0700

		${indent}14th

		Notes:
		${indent}other note
		${indent}
		${indent}yet another note
	EOF
	test_config notes.rewriteMode overwrite &&
	test_config notes.rewriteRef "refs/notes/*" &&
	(echo $(git rev-parse HEAD~3) $(git rev-parse HEAD^); \
	echo $(git rev-parse HEAD~2) $(git rev-parse HEAD)) |
	git notes copy --for-rewrite=foo &&
	git log -2 >actual &&
	test_cmp expect actual

ok 106 - tracking with unexpected .fetch refspec

# passed all 106 test(s)
1..106
ok 93 - git notes copy --for-rewrite (enabled)

expecting success: 
	test_config notes.rewrite.bar false &&
	echo $(git rev-parse HEAD~3) $(git rev-parse HEAD) |
	git notes copy --for-rewrite=bar &&
	git log -2 >actual &&
	test_cmp expect actual

ok 94 - git notes copy --for-rewrite (disabled)

expecting success: 
	cat >expect <<-EOF &&
		commit 4acf42e847e7fffbbf89ee365c20ac7caf40de89
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:27:13 2005 -0700

		${indent}15th

		Notes:
		${indent}a fresh note
	EOF
	git notes add -f -m"a fresh note" HEAD^ &&
	test_config notes.rewriteMode overwrite &&
	test_config notes.rewriteRef "refs/notes/*" &&
	echo $(git rev-parse HEAD^) $(git rev-parse HEAD) |
	git notes copy --for-rewrite=foo &&
	git log -1 >actual &&
	test_cmp expect actual

Overwriting existing notes for object 07c85d77059393ed0154b8c96906547a59dfcddd
*** t3306-notes-prune.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3306-notes-prune/.git/
ok 95 - git notes copy --for-rewrite (overwrite)

expecting success: 

	: > file1 &&
	git add file1 &&
	test_tick &&
	git commit -m 1st &&
	git notes add -m "Note #1" &&
	: > file2 &&
	git add file2 &&
	test_tick &&
	git commit -m 2nd &&
	git notes add -m "Note #2" &&
	: > file3 &&
	git add file3 &&
	test_tick &&
	git commit -m 3rd &&
	COMMIT_FILE=.git/objects/5e/e1c35e83ea47cd3cc4f8cbee0568915fbbbd29 &&
	test -f $COMMIT_FILE &&
	test-chmtime =+0 $COMMIT_FILE &&
	git notes add -m "Note #3"

expecting success: 
	test_config notes.rewriteMode ignore &&
	test_config notes.rewriteRef "refs/notes/*" &&
	echo $(git rev-parse HEAD^) $(git rev-parse HEAD) |
	git notes copy --for-rewrite=foo &&
	git log -1 >actual &&
	test_cmp expect actual

ok 4 - test notes in 2/2/36-fanout

expecting success: verify_notes
[master (root-commit) ab5f302] 1st
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file1
ok 5 - verify notes in 2/2/36-fanout

expecting success: test_sha1_based "s|^\(..\)\(..\)\(..\)|\1/\2/\3/|"
[master 08341ad] 2nd
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file2
ok 96 - git notes copy --for-rewrite (ignore)

expecting success: 
	cat >expect <<-EOF &&
		commit 4acf42e847e7fffbbf89ee365c20ac7caf40de89
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:27:13 2005 -0700

		${indent}15th

		Notes:
		${indent}a fresh note
		${indent}
		${indent}another fresh note
	EOF
	git notes add -f -m"another fresh note" HEAD^ &&
	test_config notes.rewriteMode concatenate &&
	test_config notes.rewriteRef "refs/notes/*" &&
	echo $(git rev-parse HEAD^) $(git rev-parse HEAD) |
	git notes copy --for-rewrite=foo &&
	git log -1 >actual &&
	test_cmp expect actual

Overwriting existing notes for object 07c85d77059393ed0154b8c96906547a59dfcddd
[master 5ee1c35] 3rd
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file3
ok 1 - setup: create a few commits with notes

expecting success: 

	git log > actual &&
	test_cmp expect actual

ok 2 - verify commits and notes

expecting success: 

	git reset --hard HEAD~1 &&
	git reflog expire --expire=now HEAD &&
	git gc --prune=now

HEAD is now at 08341ad 2nd
ok 97 - git notes copy --for-rewrite (append)

expecting success: 
	cat >expect <<-EOF &&
		commit 4acf42e847e7fffbbf89ee365c20ac7caf40de89
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:27:13 2005 -0700

		${indent}15th

		Notes:
		${indent}a fresh note
		${indent}
		${indent}another fresh note
		${indent}
		${indent}append 1
		${indent}
		${indent}append 2
	EOF
	git notes add -f -m"append 1" HEAD^ &&
	git notes add -f -m"append 2" HEAD^^ &&
	test_config notes.rewriteMode concatenate &&
	test_config notes.rewriteRef "refs/notes/*" &&
	(echo $(git rev-parse HEAD^) $(git rev-parse HEAD);
	echo $(git rev-parse HEAD^^) $(git rev-parse HEAD)) |
	git notes copy --for-rewrite=foo &&
	git log -1 >actual &&
	test_cmp expect actual

Overwriting existing notes for object 07c85d77059393ed0154b8c96906547a59dfcddd
Overwriting existing notes for object e871aa61182b1d95d0a6fb75445d891722863b6b
ok 98 - git notes copy --for-rewrite (append two to one)

expecting success: 
	git notes remove HEAD^ &&
	test_config notes.rewriteMode concatenate &&
	test_config notes.rewriteRef "refs/notes/*" &&
	echo $(git rev-parse HEAD^) $(git rev-parse HEAD) |
	git notes copy --for-rewrite=foo &&
	git log -1 >actual &&
	test_cmp expect actual

Removing note for object HEAD^
ok 3 - remove some commits

expecting success: 

	test_must_fail git cat-file -p 5ee1c35e83ea47cd3cc4f8cbee0568915fbbbd29 &&
	git cat-file -p 08341ad9e94faa089d60fd3f523affb25c6da189 &&
	git cat-file -p ab5f302035f2e7aaf04265f08b42034c23256e1f

fatal: Not a valid object name 5ee1c35e83ea47cd3cc4f8cbee0568915fbbbd29
tree aefde3a01f6e10d72fd4899ce14c8b2654d3eb45
parent ab5f302035f2e7aaf04265f08b42034c23256e1f
author A U Thor <author@example.com> 1112912053 -0700
committer C O Mitter <committer@example.com> 1112912053 -0700

2nd
tree ad24149d789e59d4b5f9ce41cda90110ca0f98b7
author A U Thor <author@example.com> 1112911993 -0700
committer C O Mitter <committer@example.com> 1112911993 -0700

1st
ok 4 - verify that commits are gone

expecting success: 

	git notes show 5ee1c35e83ea47cd3cc4f8cbee0568915fbbbd29 &&
	git notes show 08341ad9e94faa089d60fd3f523affb25c6da189 &&
	git notes show ab5f302035f2e7aaf04265f08b42034c23256e1f

Note #3
Note #2
Note #1
ok 5 - verify that notes are still present

expecting success: 

	git notes list > expect &&
	git notes prune -n &&
	git notes list > actual &&
	test_cmp expect actual

ok 99 - git notes copy --for-rewrite (append empty)

expecting success: 
	cat >expect <<-EOF &&
		commit 4acf42e847e7fffbbf89ee365c20ac7caf40de89
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:27:13 2005 -0700

		${indent}15th

		Notes:
		${indent}replacement note 1
	EOF
	test_config notes.rewriteMode concatenate &&
	test_config notes.rewriteRef "refs/notes/*" &&
	git notes add -f -m"replacement note 1" HEAD^ &&
	echo $(git rev-parse HEAD^) $(git rev-parse HEAD) |
	GIT_NOTES_REWRITE_MODE=overwrite git notes copy --for-rewrite=foo &&
	git log -1 >actual &&
	test_cmp expect actual

5ee1c35e83ea47cd3cc4f8cbee0568915fbbbd29
ok 6 - prune -n does not remove notes

expecting success: 


	git notes prune -n > actual &&
	test_cmp expect actual

ok 7 - prune -n lists prunable notes

expecting success: 

	git notes prune

ok 8 - prune notes

expecting success: 

	test_must_fail git notes show 5ee1c35e83ea47cd3cc4f8cbee0568915fbbbd29 &&
	git notes show 08341ad9e94faa089d60fd3f523affb25c6da189 &&
	git notes show ab5f302035f2e7aaf04265f08b42034c23256e1f

error: No note found for object 5ee1c35e83ea47cd3cc4f8cbee0568915fbbbd29.
Note #2
ok 100 - GIT_NOTES_REWRITE_MODE works

expecting success: 
	cat >expect <<-EOF &&
		commit 4acf42e847e7fffbbf89ee365c20ac7caf40de89
		Author: A U Thor <author@example.com>
		Date:   Thu Apr 7 15:27:13 2005 -0700

		${indent}15th

		Notes:
		${indent}replacement note 2
	EOF
	git notes add -f -m"replacement note 2" HEAD^ &&
	test_config notes.rewriteMode overwrite &&
	test_unconfig notes.rewriteRef &&
	echo $(git rev-parse HEAD^) $(git rev-parse HEAD) |
	GIT_NOTES_REWRITE_REF=refs/notes/commits:refs/notes/other \
		git notes copy --for-rewrite=foo &&
	git log -1 >actual &&
	test_cmp expect actual

Note #1
ok 9 - verify that notes are gone

expecting success: 

	git reset --hard HEAD~1 &&
	git reflog expire --expire=now HEAD &&
	git gc --prune=now

Overwriting existing notes for object 07c85d77059393ed0154b8c96906547a59dfcddd
HEAD is now at ab5f302 1st
ok 101 - GIT_NOTES_REWRITE_REF works

expecting success: 
	git notes add -f -m"replacement note 3" HEAD^ &&
	test_config notes.rewriteMode overwrite &&
	test_config notes.rewriteRef refs/notes/other &&
	echo $(git rev-parse HEAD^) $(git rev-parse HEAD) |
	GIT_NOTES_REWRITE_REF= git notes copy --for-rewrite=foo &&
	git log -1 >actual &&
	test_cmp expect actual

Overwriting existing notes for object 07c85d77059393ed0154b8c96906547a59dfcddd
ok 102 - GIT_NOTES_REWRITE_REF overrides config

expecting success: 
	test_must_fail git notes copy &&
	test_must_fail git notes copy one two three

error: too few parameters
usage: git notes copy [<options>] <from-object> <to-object>
   or: git notes copy --stdin [<from-object> <to-object>]...

    -f, --force           replace existing notes
    --stdin               read objects from stdin
    --for-rewrite <command>
                          load rewriting config for <command> (implies --stdin)

ok 10 - remove some commits

error: too many parameters
usage: git notes copy [<options>] <from-object> <to-object>
   or: git notes copy --stdin [<from-object> <to-object>]...

    -f, --force           replace existing notes
    --stdin               read objects from stdin
    --for-rewrite <command>
                          load rewriting config for <command> (implies --stdin)

expecting success: 

	git notes prune -v > actual &&
	test_cmp expect actual

ok 103 - git notes copy diagnoses too many or too few parameters

expecting success: 
	test_unconfig core.notesRef &&
	sane_unset GIT_NOTES_REF &&
	test "$(git notes --ref=refs/heads/master get-ref)" = "refs/notes/refs/heads/master"

ok 11 - prune -v notes

ok 104 - git notes get-ref expands refs/heads/master to refs/notes/refs/heads/master

expecting success: 
	test_unconfig core.notesRef &&
	sane_unset GIT_NOTES_REF &&
	test "$(git notes get-ref)" = "refs/notes/commits"

expecting success: 

	test_must_fail git notes show 5ee1c35e83ea47cd3cc4f8cbee0568915fbbbd29 &&
	test_must_fail git notes show 08341ad9e94faa089d60fd3f523affb25c6da189 &&
	git notes show ab5f302035f2e7aaf04265f08b42034c23256e1f

error: No note found for object 5ee1c35e83ea47cd3cc4f8cbee0568915fbbbd29.
ok 105 - git notes get-ref (no overrides)

expecting success: 
	test_config core.notesRef refs/notes/foo &&
	test "$(git notes get-ref)" = "refs/notes/foo"

error: No note found for object 08341ad9e94faa089d60fd3f523affb25c6da189.
Note #1
ok 12 - verify that notes are gone

# passed all 12 test(s)
1..12
ok 106 - git notes get-ref (core.notesRef)

expecting success: 
	test "$(GIT_NOTES_REF=refs/notes/bar git notes get-ref)" = "refs/notes/bar"

ok 107 - git notes get-ref (GIT_NOTES_REF)

expecting success: 
	test "$(GIT_NOTES_REF=refs/notes/bar git notes --ref=baz get-ref)" = "refs/notes/baz"

ok 108 - git notes get-ref (--ref)

expecting success: 
	test_unconfig core.notesRef &&
	test_commit 16th &&
	empty_blob=$(git hash-object -w /dev/null) &&
	echo "$empty_blob" >expect_empty

*** t3307-notes-man.sh ***
[master 21d0abc] 16th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 16th.t
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3307-notes-man/.git/
ok 109 - setup testing of empty notes

expecting success: 
		test_might_fail git notes remove HEAD &&
		MSG= git notes add &&
		test_must_fail git notes list HEAD
	
expecting success: 
	test_commit A &&
	test_commit B &&
	test_commit C

Object HEAD has no note
[master (root-commit) 0ddfaf1] A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 A.t

Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398
error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.
ok 110 - 'git notes add' removes empty note

expecting success: 
		test_might_fail git notes remove HEAD &&
		MSG= git notes add --allow-empty &&
		git notes list HEAD >actual &&
		test_cmp expect_empty actual
	
Object HEAD has no note
[master d9df450] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 B.t

ok 111 - 'git notes add --allow-empty' stores empty note

expecting success: 
		test_might_fail git notes remove HEAD &&
		MSG= git notes add -F /dev/null &&
		test_must_fail git notes list HEAD
	
Removing note for object HEAD
[master 35a8500] C
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 C.t
Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398
ok 1 - setup

expecting success: 
	cat <<-\EOF >expect &&
	    B

	Notes:
	    Acked-by: A C Ker <acker@example.com>
	EOF
	git notes add -m "Acked-by: A C Ker <acker@example.com>" B &&
	git show -s B^{commit} >log &&
	tail -n 4 log >actual &&
	test_cmp expect actual

error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.
ok 112 - 'git notes add -F /dev/null' removes empty note

expecting success: 
		test_might_fail git notes remove HEAD &&
		MSG= git notes add -F /dev/null --allow-empty &&
		git notes list HEAD >actual &&
		test_cmp expect_empty actual
	
Object HEAD has no note
ok 2 - example 1: notes to add an Acked-by line

expecting success: 
	cp "$TEST_DIRECTORY"/test-binary-1.png . &&
	git checkout B &&
	blob=$(git hash-object -w test-binary-1.png) &&
	git notes --ref=logo add -C "$blob" &&
	git notes --ref=logo copy B C &&
	git notes --ref=logo show C >actual &&
	test_cmp test-binary-1.png actual

ok 113 - 'git notes add -F /dev/null --allow-empty' stores empty note

expecting success: 
		test_might_fail git notes remove HEAD &&
		MSG= git notes add -m "" &&
		test_must_fail git notes list HEAD
	
Removing note for object HEAD
Note: checking out 'B'.

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 d9df450... B
Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398
error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.
ok 114 - 'git notes add -m ""' removes empty note

expecting success: 
		test_might_fail git notes remove HEAD &&
		MSG= git notes add -m "" --allow-empty &&
		git notes list HEAD >actual &&
		test_cmp expect_empty actual
	
Object HEAD has no note
ok 115 - 'git notes add -m "" --allow-empty' stores empty note

expecting success: 
		test_might_fail git notes remove HEAD &&
		MSG= git notes add -c "$empty_blob" &&
		test_must_fail git notes list HEAD
	
ok 3 - example 2: binary notes

Removing note for object HEAD
# passed all 3 test(s)
1..3

Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398
error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.
ok 116 - 'git notes add -c "$empty_blob"' removes empty note

expecting success: 
		test_might_fail git notes remove HEAD &&
		MSG= git notes add -c "$empty_blob" --allow-empty &&
		git notes list HEAD >actual &&
		test_cmp expect_empty actual
	
*** t3308-notes-merge.sh ***
Object HEAD has no note

ok 117 - 'git notes add -c "$empty_blob" --allow-empty' stores empty note

expecting success: 
		test_might_fail git notes remove HEAD &&
		MSG= git notes add -C "$empty_blob" &&
		test_must_fail git notes list HEAD
	
Removing note for object HEAD
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3308-notes-merge/.git/
expecting success: 
	test_commit 1st &&
	test_commit 2nd &&
	test_commit 3rd &&
	test_commit 4th &&
	test_commit 5th &&
	# Create notes on 4 first commits
	git config core.notesRef refs/notes/x &&
	git notes add -m "Notes on 1st commit" 1st &&
	git notes add -m "Notes on 2nd commit" 2nd &&
	git notes add -m "Notes on 3rd commit" 3rd &&
	git notes add -m "Notes on 4th commit" 4th

Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398
ok 6 - test notes in 2/2/2/34-fanout

expecting success: verify_notes
error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.
ok 118 - 'git notes add -C "$empty_blob"' removes empty note

expecting success: 
		test_might_fail git notes remove HEAD &&
		MSG= git notes add -C "$empty_blob" --allow-empty &&
		git notes list HEAD >actual &&
		test_cmp expect_empty actual
	
Object HEAD has no note
[master (root-commit) 04ed9a0] 1st
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 1st.t
ok 7 - verify notes in 2/2/2/34-fanout

expecting success: test_same_notes "s|^..|&/|" ""
ok 119 - 'git notes add -C "$empty_blob" --allow-empty' stores empty note

expecting success: 
		test_might_fail git notes remove HEAD &&
		MSG= git notes append &&
		test_must_fail git notes list HEAD
	
Removing note for object HEAD
[master 7a4ca6e] 2nd
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 2nd.t

Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398
error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.
ok 120 - 'git notes append' removes empty note

expecting success: 
		test_might_fail git notes remove HEAD &&
		MSG= git notes append --allow-empty &&
		git notes list HEAD >actual &&
		test_cmp expect_empty actual
	
Object HEAD has no note
[master d07d62e] 3rd
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 3rd.t

ok 121 - 'git notes append --allow-empty' stores empty note

expecting success: 
		test_might_fail git notes remove HEAD &&
		MSG= git notes append -F /dev/null &&
		test_must_fail git notes list HEAD
	
[master 0f7aa3e] 4th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 4th.t
Removing note for object HEAD
Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398
error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.
ok 122 - 'git notes append -F /dev/null' removes empty note

expecting success: 
		test_might_fail git notes remove HEAD &&
		MSG= git notes append -F /dev/null --allow-empty &&
		git notes list HEAD >actual &&
		test_cmp expect_empty actual
	
[master 7f9ad88] 5th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 5th.t
Object HEAD has no note
ok 123 - 'git notes append -F /dev/null --allow-empty' stores empty note

expecting success: 
		test_might_fail git notes remove HEAD &&
		MSG= git notes append -m "" &&
		test_must_fail git notes list HEAD
	
Removing note for object HEAD
Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398
error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.
ok 124 - 'git notes append -m ""' removes empty note

expecting success: 
		test_might_fail git notes remove HEAD &&
		MSG= git notes append -m "" --allow-empty &&
		git notes list HEAD >actual &&
		test_cmp expect_empty actual
	
Object HEAD has no note
ok 1 - setup

ok 125 - 'git notes append -m "" --allow-empty' stores empty note

expecting success: 
		test_might_fail git notes remove HEAD &&
		MSG= git notes append -c "$empty_blob" &&
		test_must_fail git notes list HEAD
	
Removing note for object HEAD
expecting success: 
	verify_notes x


Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398
error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.
ok 126 - 'git notes append -c "$empty_blob"' removes empty note

expecting success: 
		test_might_fail git notes remove HEAD &&
		MSG= git notes append -c "$empty_blob" --allow-empty &&
		git notes list HEAD >actual &&
		test_cmp expect_empty actual
	
Object HEAD has no note
ok 2 - verify initial notes (x)

expecting success: 
	test_must_fail git -c "core.notesRef=refs/notes/y" notes merge z


fatal: Cannot merge empty notes ref (refs/notes/z) into empty notes ref (refs/notes/y)
ok 3 - fail to merge empty notes ref into empty notes ref (z => y)

expecting success: 
	test_must_fail git -c "core.notesRef=refs/notes" notes merge x &&
	test_must_fail git -c "core.notesRef=refs/notes/" notes merge x &&
	mkdir -p .git/refs/notes/dir &&
	test_must_fail git -c "core.notesRef=refs/notes/dir" notes merge x &&
	test_must_fail git -c "core.notesRef=refs/notes/dir/" notes merge x &&
	test_must_fail git -c "core.notesRef=refs/heads/master" notes merge x &&
	test_must_fail git -c "core.notesRef=refs/notes/y:" notes merge x &&
	test_must_fail git -c "core.notesRef=refs/notes/y:foo" notes merge x &&
	test_must_fail git -c "core.notesRef=refs/notes/foo^{bar" notes merge x

fatal: Refusing to merge notes in refs/notes (outside of refs/notes/)
ok 127 - 'git notes append -c "$empty_blob" --allow-empty' stores empty note

expecting success: 
		test_might_fail git notes remove HEAD &&
		MSG= git notes append -C "$empty_blob" &&
		test_must_fail git notes list HEAD
	
fatal: Failed to resolve local notes ref 'refs/notes/'
Removing note for object HEAD
fatal: Failed to resolve local notes ref 'refs/notes/dir'
fatal: Failed to resolve local notes ref 'refs/notes/dir/'
Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398
fatal: Refusing to merge notes in refs/heads/master (outside of refs/notes/)
error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.
ok 128 - 'git notes append -C "$empty_blob"' removes empty note

expecting success: 
		test_might_fail git notes remove HEAD &&
		MSG= git notes append -C "$empty_blob" --allow-empty &&
		git notes list HEAD >actual &&
		test_cmp expect_empty actual
	
fatal: Failed to resolve local notes ref 'refs/notes/y:'
Object HEAD has no note
fatal: Failed to resolve local notes ref 'refs/notes/y:foo'
fatal: Failed to resolve local notes ref 'refs/notes/foo^{bar'
ok 4 - fail to merge into various non-notes refs

expecting success: 
	git config core.notesRef refs/notes/y &&
	test_must_fail git notes merge refs/notes &&
	test_must_fail git notes merge refs/notes/ &&
	test_must_fail git notes merge refs/notes/dir &&
	test_must_fail git notes merge refs/notes/dir/ &&
	test_must_fail git notes merge refs/heads/master &&
	test_must_fail git notes merge x: &&
	test_must_fail git notes merge x:foo &&
	test_must_fail git notes merge foo^{bar

ok 129 - 'git notes append -C "$empty_blob" --allow-empty' stores empty note

expecting success: 
		test_might_fail git notes remove HEAD &&
		MSG= git notes edit &&
		test_must_fail git notes list HEAD
	
fatal: Cannot merge empty notes ref (refs/notes/refs/notes) into empty notes ref (refs/notes/y)
Removing note for object HEAD
fatal: Failed to resolve remote notes ref 'refs/notes/'
fatal: Cannot merge empty notes ref (refs/notes/dir) into empty notes ref (refs/notes/y)
fatal: Failed to resolve remote notes ref 'refs/notes/dir/'
fatal: Cannot merge empty notes ref (refs/notes/refs/heads/master) into empty notes ref (refs/notes/y)

Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398
error: object 6c99d48c9905deea5d59d723468862362918626a is a tree, not a commit
fatal: Could not parse remote commit 6c99d48c9905deea5d59d723468862362918626a (refs/notes/x:)
error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.
ok 130 - 'git notes edit' removes empty note

expecting success: 
		test_might_fail git notes remove HEAD &&
		MSG= git notes edit --allow-empty &&
		git notes list HEAD >actual &&
		test_cmp expect_empty actual
	
fatal: Failed to resolve remote notes ref 'refs/notes/x:foo'
Object HEAD has no note
fatal: Failed to resolve remote notes ref 'refs/notes/foo^{bar'
ok 5 - fail to merge various non-note-trees

expecting success: 
	git config core.notesRef refs/notes/y &&
	git notes merge x &&
	verify_notes y &&
	# x and y should point to the same notes commit
	test "$(git rev-parse refs/notes/x)" = "$(git rev-parse refs/notes/y)"


ok 131 - 'git notes edit --allow-empty' stores empty note

expecting success: 
	test_commit 17th &&
	git log -1 >expect &&
	cat >>expect <<-EOF &&

		Notes:
	EOF
	git notes add -C "$empty_blob" --allow-empty &&
	git log -1 >actual &&
	test_cmp expect actual

[master 27a79f3] 17th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 17th.t
ok 6 - merge notes into empty notes ref (x => y)

expecting success: 
	git notes merge z &&
	# y should not change (still == x)
	test "$(git rev-parse refs/notes/x)" = "$(git rev-parse refs/notes/y)"

ok 7 - merge empty notes ref (z => y)

expecting success: 
	# Not touching notes to 1st commit
	git notes remove 2nd &&
	git notes append -m "More notes on 3rd commit" 3rd &&
	git notes add -f -m "New notes on 4th commit" 4th &&
	git notes add -m "Notes on 5th commit" 5th

Removing note for object 2nd
ok 132 - empty notes are displayed by git log

# passed all 132 test(s)
1..132
Overwriting existing notes for object 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11
ok 8 - change notes on other notes ref (y)

expecting success: 
	pre_state="$(git rev-parse refs/notes/y)" &&
	git notes merge y^ &&
	# y should not move
	test "$pre_state" = "$(git rev-parse refs/notes/y)"

Already up-to-date!
ok 9 - merge previous notes commit (y^ => y) => No-op

expecting success: 
	verify_notes y

ok 10 - verify changed notes on other notes ref (y)

expecting success: 
	verify_notes x

*** t3309-notes-merge-auto-resolve.sh ***
ok 11 - verify unchanged notes on original notes ref (x)

expecting success: 
	git notes merge -vvv x &&
	verify_notes y &&
	verify_notes x

One merge base found (bf2877f)
Merging remote commit bf2877f into local commit 21b8c5e with merge-base bf2877f
Already up-to-date!
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3309-notes-merge-auto-resolve/.git/
expecting success: 
	test_commit 1st &&
	test_commit 2nd &&
	test_commit 3rd &&
	test_commit 4th &&
	test_commit 5th &&
	test_commit 6th &&
	test_commit 7th &&
	test_commit 8th &&
	test_commit 9th &&
	test_commit 10th &&
	test_commit 11th &&
	test_commit 12th &&
	test_commit 13th &&
	test_commit 14th &&
	test_commit 15th

ok 12 - merge original notes (x) into changed notes (y) => No-op

[master (root-commit) 04ed9a0] 1st
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 1st.t
expecting success: 
	git config core.notesRef refs/notes/x &&
	git notes merge y &&
	verify_notes x &&
	verify_notes y &&
	# x and y should point to same the notes commit
	test "$(git rev-parse refs/notes/x)" = "$(git rev-parse refs/notes/y)"

Fast-forward
[master 7a4ca6e] 2nd
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 2nd.t
[master d07d62e] 3rd
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 3rd.t
ok 13 - merge changed (y) into original (x) => Fast-forward

expecting success: 
	# Prepare empty (but valid) notes ref (z)
	git config core.notesRef refs/notes/z &&
	git notes add -m "foo" &&
	git notes remove &&
	git notes >output_notes_z &&
	test_cmp /dev/null output_notes_z &&
	# Do the merge (z => y)
	git config core.notesRef refs/notes/y &&
	git notes merge z &&
	verify_notes y &&
	# y should no longer point to the same notes commit as x
	test "$(git rev-parse refs/notes/x)" != "$(git rev-parse refs/notes/y)"

[master 0f7aa3e] 4th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 4th.t
Removing note for object HEAD
[master 7f9ad88] 5th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 5th.t
[master 2c12533] 6th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 6th.t
ok 14 - merge empty notes ref (z => y)

[master fb01e0c] 7th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 7th.t
expecting success: 
	# Append to 1st commit notes
	git notes append -m "More notes on 1st commit" 1st &&
	# Add new notes to 2nd commit
	git notes add -m "New notes on 2nd commit" 2nd &&
	verify_notes y

[master 9a4c31c] 8th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 8th.t
ok 15 - change notes on other notes ref (y)

expecting success: 
	git config core.notesRef refs/notes/x &&
	git notes remove 3rd &&
	git notes append -m "More notes on 4th commit" 4th &&
	verify_notes x

[master 2e0db4b] 9th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 9th.t
Removing note for object 3rd
[master 7c3b87a] 10th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 10th.t
ok 16 - change notes on notes ref (x)

[master a446fff] 11th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 11th.t
expecting success: 
	git notes merge y &&
	verify_notes x &&
	verify_notes y

[master 65e263d] 12th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 12th.t
[master e871aa6] 13th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 13th.t
ok 17 - merge y into x => Non-conflicting 3-way merge

expecting success: 
	git config core.notesRef refs/notes/w &&
	# Add same note as refs/notes/y on 2nd commit
	git notes add -m "New notes on 2nd commit" 2nd &&
	# Add new note on 3rd commit (non-conflicting)
	git notes add -m "New notes on 3rd commit" 3rd &&
	# Verify state of notes on new, separate notes ref (w)
	verify_notes w

[master 07c85d7] 14th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 14th.t
[master 4acf42e] 15th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 15th.t
ok 18 - create notes on new, separate notes ref (w)

ok 1 - setup commits

expecting success: 
	git config core.notesRef refs/notes/x &&
	git notes merge w &&
	# Verify new state of notes on other notes ref (x)
	verify_notes x &&
	# Also verify that nothing changed on other notes refs (y and w)
	verify_notes y &&
	verify_notes w

ok 19 - merge w into x => Non-conflicting history-less merge

expecting success: 
	git config core.notesRef refs/notes/x &&
	git notes add -m "x notes on 6th commit" 6th &&
	git notes add -m "x notes on 7th commit" 7th &&
	git notes add -m "x notes on 8th commit" 8th &&
	git notes add -m "x notes on 9th commit" 9th &&
	git notes add -m "x notes on 10th commit" 10th &&
	git notes add -m "x notes on 11th commit" 11th &&
	git notes add -m "x notes on 12th commit" 12th &&
	git notes add -m "x notes on 13th commit" 13th &&
	git notes add -m "x notes on 14th commit" 14th &&
	git notes add -m "x notes on 15th commit" 15th

# passed all 19 test(s)
1..19
*** t3310-notes-merge-manual-resolve.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3310-notes-merge-manual-resolve/.git/
expecting success: 
	test_commit 1st &&
	test_commit 2nd &&
	test_commit 3rd &&
	test_commit 4th &&
	test_commit 5th

ok 8 - test same notes in no fanout and 2/38-fanout

expecting success: verify_notes
[master (root-commit) 04ed9a0] 1st
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 1st.t
ok 2 - setup merge base (x)

expecting success: verify_notes x x
ok 9 - verify same notes in no fanout and 2/38-fanout

expecting success: test_same_notes "s|^\(..\)\(..\)|\1/\2/|" ""
[master 7a4ca6e] 2nd
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 2nd.t
ok 3 - verify state of merge base (x)

expecting success: 
	git update-ref refs/notes/y refs/notes/x &&
	git config core.notesRef refs/notes/y &&
	git notes add -f -m "y notes on 3rd commit" 3rd &&
	git notes add -f -m "y notes on 4th commit" 4th &&
	git notes add -f -m "y notes on 5th commit" 5th &&
	git notes remove 6th &&
	git notes remove 7th &&
	git notes remove 8th &&
	git notes add -f -m "y notes on 12th commit" 12th &&
	git notes add -f -m "y notes on 13th commit" 13th &&
	git notes add -f -m "y notes on 14th commit" 14th &&
	git notes add -f -m "y notes on 15th commit" 15th

[master d07d62e] 3rd
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 3rd.t
[master 0f7aa3e] 4th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 4th.t
Removing note for object 6th
[master 7f9ad88] 5th
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 5th.t
ok 1 - setup commits

Removing note for object 7th
Removing note for object 8th
Overwriting existing notes for object 65e263ded02ae4e8839bc151095113737579dc12
expecting success: 
	git config core.notesRef refs/notes/x &&
	git notes add -m "x notes on 2nd commit" 2nd &&
	git notes add -m "x notes on 3rd commit" 3rd &&
	git notes add -m "x notes on 4th commit" 4th &&
	verify_notes x

Overwriting existing notes for object e871aa61182b1d95d0a6fb75445d891722863b6b
Overwriting existing notes for object 07c85d77059393ed0154b8c96906547a59dfcddd
Overwriting existing notes for object 4acf42e847e7fffbbf89ee365c20ac7caf40de89
ok 4 - setup local branch (y)

expecting success: verify_notes y y
ok 2 - setup merge base (x)

ok 5 - verify state of local branch (y)

expecting success: 
	git update-ref refs/notes/z refs/notes/x &&
	git config core.notesRef refs/notes/z &&
	git notes add -f -m "z notes on 2nd commit" 2nd &&
	git notes add -f -m "y notes on 4th commit" 4th &&
	git notes add -f -m "z notes on 5th commit" 5th &&
	git notes remove 6th &&
	git notes add -f -m "z notes on 8th commit" 8th &&
	git notes remove 9th &&
	git notes add -f -m "z notes on 11th commit" 11th &&
	git notes remove 12th &&
	git notes add -f -m "y notes on 14th commit" 14th &&
	git notes add -f -m "z notes on 15th commit" 15th

expecting success: 
	git update-ref refs/notes/y refs/notes/x &&
	git config core.notesRef refs/notes/y &&
	git notes add -f -m "y notes on 1st commit" 1st &&
	git notes remove 2nd &&
	git notes add -f -m "y notes on 3rd commit" 3rd &&
	git notes add -f -m "y notes on 4th commit" 4th &&
	verify_notes y

Removing note for object 2nd
Overwriting existing notes for object d07d62e5208f22eb5695e7eb47667dc8b9860290
Overwriting existing notes for object 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11
Removing note for object 6th
Overwriting existing notes for object 9a4c31c7f722b5d517e92c64e932dd751e1413bf
Removing note for object 9th
ok 3 - setup local branch (y)

Overwriting existing notes for object a446fff8777efdc6eb8f4b7c8a5ff699484df0d5
expecting success: 
	git update-ref refs/notes/z refs/notes/x &&
	git config core.notesRef refs/notes/z &&
	git notes add -f -m "z notes on 1st commit" 1st &&
	git notes add -f -m "z notes on 2nd commit" 2nd &&
	git notes remove 3rd &&
	git notes add -f -m "z notes on 4th commit" 4th &&
	verify_notes z

Removing note for object 12th
Overwriting existing notes for object 07c85d77059393ed0154b8c96906547a59dfcddd
Overwriting existing notes for object 4acf42e847e7fffbbf89ee365c20ac7caf40de89
ok 6 - setup remote branch (z)

Overwriting existing notes for object 7a4ca6ee52a974a66cbaa78e33214535dff1d691
expecting success: verify_notes z z
Removing note for object 3rd
Overwriting existing notes for object 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11
ok 7 - verify state of remote branch (z)

expecting success: 
	git config core.notesRef refs/notes/y &&
	test_must_fail git notes merge --strategy=foo z &&
	# Verify no changes (y)
	verify_notes y y

error: Unknown -s/--strategy: foo
usage: git notes merge [<options>] <notes-ref>
   or: git notes merge --commit [<options>]
   or: git notes merge --abort [<options>]

General options
    -v, --verbose         be more verbose
    -q, --quiet           be more quiet

Merge options
    -s, --strategy <strategy>
                          resolve notes conflicts using the given strategy (manual/ours/theirs/union/cat_sort_uniq)

Committing unmerged notes
    --commit              finalize notes merge by committing unmerged notes

Aborting notes merge resolution
    --abort               abort notes merge

ok 4 - setup remote branch (z)

ok 8 - merge z into y with invalid strategy => Fail/No changes

expecting success: 
	git config core.notesRef refs/notes/y &&
	test_must_fail git -c notes.mergeStrategy="foo" notes merge z &&
	# Verify no changes (y)
	verify_notes y y

error: unknown notes merge strategy foo
fatal: unable to parse 'notes.mergeStrategy' from command-line config
expecting success: 
	git update-ref refs/notes/m refs/notes/y &&
	git config core.notesRef refs/notes/m &&
	test_must_fail git notes merge z >output &&
	# Output should point to where to resolve conflicts
	grep -q "\\.git/NOTES_MERGE_WORKTREE" output &&
	# Inspect merge conflicts
	ls .git/NOTES_MERGE_WORKTREE >output_conflicts &&
	test_cmp expect_conflicts output_conflicts &&
	( for f in $(cat expect_conflicts); do
		test_cmp "expect_conflict_$f" ".git/NOTES_MERGE_WORKTREE/$f" ||
		exit 1
	done ) &&
	# Verify that current notes tree (pre-merge) has not changed (m == y)
	verify_notes y &&
	verify_notes m &&
	test "$(git rev-parse refs/notes/m)" = "$(cat pre_merge_y)"

ok 9 - merge z into y with invalid configuration option => Fail/No changes

expecting success: 
	git notes merge --strategy=ours z &&
	verify_notes y ours

Using local notes for 4acf42e847e7fffbbf89ee365c20ac7caf40de89
Using local notes for 65e263ded02ae4e8839bc151095113737579dc12
Using local notes for 7f9ad8836c775acb134c0a055fc55fb4cd1ba361
Using local notes for 9a4c31c7f722b5d517e92c64e932dd751e1413bf
ok 10 - merge z into y with "ours" strategy => Non-conflicting 3-way merge

expecting success: 
	git update-ref refs/notes/y refs/notes/y^1 &&
	# Verify pre-merge state
	verify_notes y y

ok 11 - reset to pre-merge state (y)

expecting success: 
	git -c notes.mergeStrategy="ours" notes merge z &&
	verify_notes y ours

ok 5 - merge z into m (== y) with default ("manual") resolver => Conflicting 3-way merge

Using local notes for 4acf42e847e7fffbbf89ee365c20ac7caf40de89
Using local notes for 65e263ded02ae4e8839bc151095113737579dc12
Using local notes for 7f9ad8836c775acb134c0a055fc55fb4cd1ba361
Using local notes for 9a4c31c7f722b5d517e92c64e932dd751e1413bf
expecting success: 
	git notes --ref z append -m "More z notes on 4th commit" 4th &&
	verify_notes z

ok 12 - merge z into y with "ours" configuration option => Non-conflicting 3-way merge

expecting success: 
	git update-ref refs/notes/y refs/notes/y^1 &&
	# Verify pre-merge state
	verify_notes y y

ok 6 - change notes in z

expecting success: 
	test -d .git/NOTES_MERGE_WORKTREE &&
	test_must_fail git notes merge z >output 2>&1 &&
	# Output should indicate what is wrong
	grep -q "\\.git/NOTES_MERGE_\\* exists" output

ok 7 - cannot do merge w/conflicts when previous merge is unfinished

expecting success: 
	git config core.notesRef refs/notes/w &&
	git notes add -m "w notes on 1st commit" 1st &&
	git notes add -m "x notes on 2nd commit" 2nd &&
	verify_notes w

ok 13 - reset to pre-merge state (y)

expecting success: 
	git -c notes.y.mergeStrategy="ours" notes merge z &&
	verify_notes y ours

Using local notes for 4acf42e847e7fffbbf89ee365c20ac7caf40de89
Using local notes for 65e263ded02ae4e8839bc151095113737579dc12
Using local notes for 7f9ad8836c775acb134c0a055fc55fb4cd1ba361
Using local notes for 9a4c31c7f722b5d517e92c64e932dd751e1413bf
ok 14 - merge z into y with "ours" per-ref configuration option => Non-conflicting 3-way merge

expecting success: 
	git update-ref refs/notes/y refs/notes/y^1 &&
	# Verify pre-merge state
	verify_notes y y

ok 8 - setup unrelated notes ref (w)

expecting success: 
	test -d .git/NOTES_MERGE_WORKTREE &&
	git notes merge x &&
	verify_notes w &&
	# Verify that other notes refs has not changed (x and y)
	verify_notes x &&
	verify_notes y

ok 15 - reset to pre-merge state (y)

expecting success: 
	git notes merge --strategy=theirs z &&
	verify_notes y theirs

Using remote notes for 4acf42e847e7fffbbf89ee365c20ac7caf40de89
Using remote notes for 65e263ded02ae4e8839bc151095113737579dc12
Using remote notes for 7f9ad8836c775acb134c0a055fc55fb4cd1ba361
Using remote notes for 9a4c31c7f722b5d517e92c64e932dd751e1413bf
ok 16 - merge z into y with "theirs" strategy => Non-conflicting 3-way merge

expecting success: 
	git update-ref refs/notes/y refs/notes/y^1 &&
	# Verify pre-merge state
	verify_notes y y

ok 17 - reset to pre-merge state (y)

expecting success: 
	git -c notes.mergeStrategy="ours" notes merge --strategy=theirs z &&
	verify_notes y theirs

ok 9 - can do merge without conflicts even if previous merge is unfinished (x => w)

expecting success: 
	test_must_fail git notes merge --commit --abort

Using remote notes for 4acf42e847e7fffbbf89ee365c20ac7caf40de89
Using remote notes for 65e263ded02ae4e8839bc151095113737579dc12
Using remote notes for 7f9ad8836c775acb134c0a055fc55fb4cd1ba361
Using remote notes for 9a4c31c7f722b5d517e92c64e932dd751e1413bf
error: cannot mix --commit, --abort or -s/--strategy
usage: git notes merge [<options>] <notes-ref>
   or: git notes merge --commit [<options>]
   or: git notes merge --abort [<options>]

General options
    -v, --verbose         be more verbose
    -q, --quiet           be more quiet

Merge options
    -s, --strategy <strategy>
                          resolve notes conflicts using the given strategy (manual/ours/theirs/union/cat_sort_uniq)

Committing unmerged notes
    --commit              finalize notes merge by committing unmerged notes

Aborting notes merge resolution
    --abort               abort notes merge

ok 10 - do not allow mixing --commit and --abort

expecting success: 
	test_must_fail git notes merge --commit --strategy theirs

error: cannot mix --commit, --abort or -s/--strategy
usage: git notes merge [<options>] <notes-ref>
   or: git notes merge --commit [<options>]
   or: git notes merge --abort [<options>]

General options
    -v, --verbose         be more verbose
    -q, --quiet           be more quiet

Merge options
    -s, --strategy <strategy>
                          resolve notes conflicts using the given strategy (manual/ours/theirs/union/cat_sort_uniq)

Committing unmerged notes
    --commit              finalize notes merge by committing unmerged notes

Aborting notes merge resolution
    --abort               abort notes merge

ok 11 - do not allow mixing --commit and --strategy

expecting success: 
	test_must_fail git notes merge --abort --strategy theirs

ok 18 - merge z into y with "theirs" strategy overriding configuration option "ours" => Non-conflicting 3-way merge

expecting success: 
	git update-ref refs/notes/y refs/notes/y^1 &&
	# Verify pre-merge state
	verify_notes y y

error: cannot mix --commit, --abort or -s/--strategy
usage: git notes merge [<options>] <notes-ref>
   or: git notes merge --commit [<options>]
   or: git notes merge --abort [<options>]

General options
    -v, --verbose         be more verbose
    -q, --quiet           be more quiet

Merge options
    -s, --strategy <strategy>
                          resolve notes conflicts using the given strategy (manual/ours/theirs/union/cat_sort_uniq)

Committing unmerged notes
    --commit              finalize notes merge by committing unmerged notes

Aborting notes merge resolution
    --abort               abort notes merge

ok 12 - do not allow mixing --abort and --strategy

expecting success: 
	# Resolve conflicts and finalize merge
	cat >.git/NOTES_MERGE_WORKTREE/$commit_sha1 <<EOF &&
y and z notes on 1st commit
EOF
	cat >.git/NOTES_MERGE_WORKTREE/$commit_sha4 <<EOF &&
y and z notes on 4th commit
EOF
	git notes merge --commit &&
	# No .git/NOTES_MERGE_* files left
	test_might_fail ls .git/NOTES_MERGE_* >output 2>/dev/null &&
	test_cmp /dev/null output &&
	# Merge commit has pre-merge y and pre-merge z as parents
	test "$(git rev-parse refs/notes/m^1)" = "$(cat pre_merge_y)" &&
	test "$(git rev-parse refs/notes/m^2)" = "$(cat pre_merge_z)" &&
	# Merge commit mentions the notes refs merged
	git log -1 --format=%B refs/notes/m > merge_commit_msg &&
	grep -q refs/notes/m merge_commit_msg &&
	grep -q refs/notes/z merge_commit_msg &&
	# Merge commit mentions conflicting notes
	grep -q "Conflicts" merge_commit_msg &&
	( for sha1 in $(cat expect_conflicts); do
		grep -q "$sha1" merge_commit_msg ||
		exit 1
	done ) &&
	# Verify contents of merge result
	verify_notes m &&
	# Verify that other notes refs has not changed (w, x, y and z)
	verify_notes w &&
	verify_notes x &&
	verify_notes y &&
	verify_notes z

ok 19 - reset to pre-merge state (y)

expecting success: 
	git notes merge --strategy=union z &&
	verify_notes y union

Concatenating local and remote notes for 4acf42e847e7fffbbf89ee365c20ac7caf40de89
Concatenating local and remote notes for 65e263ded02ae4e8839bc151095113737579dc12
Concatenating local and remote notes for 7f9ad8836c775acb134c0a055fc55fb4cd1ba361
Concatenating local and remote notes for 9a4c31c7f722b5d517e92c64e932dd751e1413bf
ok 20 - merge z into y with "union" strategy => Non-conflicting 3-way merge

expecting success: 
	git update-ref refs/notes/y refs/notes/y^1 &&
	# Verify pre-merge state
	verify_notes y y

ok 21 - reset to pre-merge state (y)

expecting success: 
	git -c notes.y.mergeStrategy="theirs" notes merge --strategy=union z &&
	verify_notes y union

Concatenating local and remote notes for 4acf42e847e7fffbbf89ee365c20ac7caf40de89
Concatenating local and remote notes for 65e263ded02ae4e8839bc151095113737579dc12
Concatenating local and remote notes for 7f9ad8836c775acb134c0a055fc55fb4cd1ba361
Concatenating local and remote notes for 9a4c31c7f722b5d517e92c64e932dd751e1413bf
ok 22 - merge z into y with "union" strategy overriding per-ref configuration => Non-conflicting 3-way merge

expecting success: 
	git update-ref refs/notes/y refs/notes/y^1 &&
	# Verify pre-merge state
	verify_notes y y

ok 23 - reset to pre-merge state (y)

expecting success: 
	git -c notes.y.mergeStrategy="union" -c notes.mergeStrategy="theirs" notes merge z &&
	verify_notes y union

Concatenating local and remote notes for 4acf42e847e7fffbbf89ee365c20ac7caf40de89
Concatenating local and remote notes for 65e263ded02ae4e8839bc151095113737579dc12
Concatenating local and remote notes for 7f9ad8836c775acb134c0a055fc55fb4cd1ba361
Concatenating local and remote notes for 9a4c31c7f722b5d517e92c64e932dd751e1413bf
ok 13 - finalize conflicting merge (z => m)

ok 24 - merge z into y with "union" per-ref overriding general configuration => Non-conflicting 3-way merge

expecting success: 
	git update-ref refs/notes/y refs/notes/y^1 &&
	# Verify pre-merge state
	verify_notes y y

expecting success: 
	git update-ref refs/notes/m refs/notes/y &&
	git config core.notesRef refs/notes/m &&
	test_must_fail git notes merge z >output &&
	# Output should point to where to resolve conflicts
	grep -q "\\.git/NOTES_MERGE_WORKTREE" output &&
	# Inspect merge conflicts
	ls .git/NOTES_MERGE_WORKTREE >output_conflicts &&
	test_cmp expect_conflicts output_conflicts &&
	( for f in $(cat expect_conflicts); do
		test_cmp "expect_conflict_$f" ".git/NOTES_MERGE_WORKTREE/$f" ||
		exit 1
	done ) &&
	# Verify that current notes tree (pre-merge) has not changed (m == y)
	verify_notes y &&
	verify_notes m &&
	test "$(git rev-parse refs/notes/m)" = "$(cat pre_merge_y)"

ok 25 - reset to pre-merge state (y)

expecting success: 
	test_must_fail git -c notes.z.mergeStrategy="union" notes merge z &&
	git notes merge --abort &&
	verify_notes y y

Auto-merging notes for 4acf42e847e7fffbbf89ee365c20ac7caf40de89
CONFLICT (content): Merge conflict in notes for object 4acf42e847e7fffbbf89ee365c20ac7caf40de89
Auto-merging notes for 65e263ded02ae4e8839bc151095113737579dc12
CONFLICT (delete/modify): Notes for object 65e263ded02ae4e8839bc151095113737579dc12 deleted in refs/notes/z and modified in refs/notes/y. Version from refs/notes/y left in tree.
Auto-merging notes for 7f9ad8836c775acb134c0a055fc55fb4cd1ba361
CONFLICT (add/add): Merge conflict in notes for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361
Auto-merging notes for 9a4c31c7f722b5d517e92c64e932dd751e1413bf
CONFLICT (delete/modify): Notes for object 9a4c31c7f722b5d517e92c64e932dd751e1413bf deleted in refs/notes/y and modified in refs/notes/z. Version from refs/notes/z left in tree.
Automatic notes merge failed. Fix conflicts in .git/NOTES_MERGE_WORKTREE and commit the result with 'git notes merge --commit', or abort the merge with 'git notes merge --abort'.
ok 26 - merge z into y with "manual" per-ref only checks specific ref configuration => Conflicting 3-way merge

expecting success: 
	git config core.notesRef refs/notes/z &&
	git notes merge --strategy=union y &&
	verify_notes z union2

ok 14 - redo merge of z into m (== y) with default ("manual") resolver => Conflicting 3-way merge

expecting success: 
	git notes merge --abort &&
	# No .git/NOTES_MERGE_* files left
	test_might_fail ls .git/NOTES_MERGE_* >output 2>/dev/null &&
	test_cmp /dev/null output &&
	# m has not moved (still == y)
	test "$(git rev-parse refs/notes/m)" = "$(cat pre_merge_y)" &&
	# Verify that other notes refs has not changed (w, x, y and z)
	verify_notes w &&
	verify_notes x &&
	verify_notes y &&
	verify_notes z

Concatenating local and remote notes for 4acf42e847e7fffbbf89ee365c20ac7caf40de89
Concatenating local and remote notes for 65e263ded02ae4e8839bc151095113737579dc12
Concatenating local and remote notes for 7f9ad8836c775acb134c0a055fc55fb4cd1ba361
Concatenating local and remote notes for 9a4c31c7f722b5d517e92c64e932dd751e1413bf
ok 27 - merge y into z with "union" strategy => Non-conflicting 3-way merge

expecting success: 
	git update-ref refs/notes/z refs/notes/z^1 &&
	# Verify pre-merge state
	verify_notes z z

ok 28 - reset to pre-merge state (z)

expecting success: 
	git notes merge --strategy=cat_sort_uniq y &&
	verify_notes z cat_sort_uniq

Concatenating unique lines in local and remote notes for 4acf42e847e7fffbbf89ee365c20ac7caf40de89
Concatenating unique lines in local and remote notes for 65e263ded02ae4e8839bc151095113737579dc12
Concatenating unique lines in local and remote notes for 7f9ad8836c775acb134c0a055fc55fb4cd1ba361
Concatenating unique lines in local and remote notes for 9a4c31c7f722b5d517e92c64e932dd751e1413bf
ok 29 - merge y into z with "cat_sort_uniq" strategy => Non-conflicting 3-way merge

expecting success: 
	git update-ref refs/notes/z refs/notes/z^1 &&
	# Verify pre-merge state
	verify_notes z z

ok 10 - test same notes in no fanout and 2/2/36-fanout

expecting success: verify_notes
ok 15 - abort notes merge

expecting success: 
	test_must_fail git notes merge z >output &&
	# Output should point to where to resolve conflicts
	grep -q "\\.git/NOTES_MERGE_WORKTREE" output &&
	# Inspect merge conflicts
	ls .git/NOTES_MERGE_WORKTREE >output_conflicts &&
	test_cmp expect_conflicts output_conflicts &&
	( for f in $(cat expect_conflicts); do
		test_cmp "expect_conflict_$f" ".git/NOTES_MERGE_WORKTREE/$f" ||
		exit 1
	done ) &&
	# Verify that current notes tree (pre-merge) has not changed (m == y)
	verify_notes y &&
	verify_notes m &&
	test "$(git rev-parse refs/notes/m)" = "$(cat pre_merge_y)"

ok 30 - reset to pre-merge state (z)

expecting success: 
	git -c notes.mergeStrategy="cat_sort_uniq" notes merge y &&
	verify_notes z cat_sort_uniq

ok 11 - verify same notes in no fanout and 2/2/36-fanout

expecting success: test_same_notes "s|^\(..\)\(..\)|\1/\2/|" "s|^..|&/|"
Concatenating unique lines in local and remote notes for 4acf42e847e7fffbbf89ee365c20ac7caf40de89
Concatenating unique lines in local and remote notes for 65e263ded02ae4e8839bc151095113737579dc12
Concatenating unique lines in local and remote notes for 7f9ad8836c775acb134c0a055fc55fb4cd1ba361
Concatenating unique lines in local and remote notes for 9a4c31c7f722b5d517e92c64e932dd751e1413bf
ok 31 - merge y into z with "cat_sort_uniq" strategy configuration option => Non-conflicting 3-way merge

# passed all 31 test(s)
1..31
ok 16 - redo merge of z into m (== y) with default ("manual") resolver => Conflicting 3-way merge

expecting success: 
	# Resolve one conflict
	cat >.git/NOTES_MERGE_WORKTREE/$commit_sha1 <<EOF &&
y and z notes on 1st commit
EOF
	# Remove another conflict
	rm .git/NOTES_MERGE_WORKTREE/$commit_sha4 &&
	# Remove a D/F conflict
	rm .git/NOTES_MERGE_WORKTREE/$commit_sha3 &&
	# Add a new note
	echo "new note on 5th commit" > .git/NOTES_MERGE_WORKTREE/$commit_sha5 &&
	# Finalize merge
	git notes merge --commit &&
	# No .git/NOTES_MERGE_* files left
	test_might_fail ls .git/NOTES_MERGE_* >output 2>/dev/null &&
	test_cmp /dev/null output &&
	# Merge commit has pre-merge y and pre-merge z as parents
	test "$(git rev-parse refs/notes/m^1)" = "$(cat pre_merge_y)" &&
	test "$(git rev-parse refs/notes/m^2)" = "$(cat pre_merge_z)" &&
	# Merge commit mentions the notes refs merged
	git log -1 --format=%B refs/notes/m > merge_commit_msg &&
	grep -q refs/notes/m merge_commit_msg &&
	grep -q refs/notes/z merge_commit_msg &&
	# Merge commit mentions conflicting notes
	grep -q "Conflicts" merge_commit_msg &&
	( for sha1 in $(cat expect_conflicts); do
		grep -q "$sha1" merge_commit_msg ||
		exit 1
	done ) &&
	# Verify contents of merge result
	verify_notes m &&
	# Verify that other notes refs has not changed (w, x, y and z)
	verify_notes w &&
	verify_notes x &&
	verify_notes y &&
	verify_notes z

*** t3311-notes-merge-fanout.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3311-notes-merge-fanout/.git/
expecting success: 
	git config core.notesRef refs/notes/x &&
	for i in 1 2 3 4 5
	do
		test_commit "commit$i" >/dev/null &&
		git notes add -m "notes for commit$i" || return 1
	done

ok 17 - add + remove notes in finalized merge (z => m)

expecting success: 
	git update-ref refs/notes/m refs/notes/y &&
	test_must_fail git notes merge z >output &&
	# Output should point to where to resolve conflicts
	grep -q "\\.git/NOTES_MERGE_WORKTREE" output &&
	# Inspect merge conflicts
	ls .git/NOTES_MERGE_WORKTREE >output_conflicts &&
	test_cmp expect_conflicts output_conflicts &&
	( for f in $(cat expect_conflicts); do
		test_cmp "expect_conflict_$f" ".git/NOTES_MERGE_WORKTREE/$f" ||
		exit 1
	done ) &&
	# Verify that current notes tree (pre-merge) has not changed (m == y)
	verify_notes y &&
	verify_notes m &&
	test "$(git rev-parse refs/notes/m)" = "$(cat pre_merge_y)"

ok 1 - setup a few initial commits with notes (notes ref: x)

ok 18 - redo merge of z into m (== y) with default ("manual") resolver => Conflicting 3-way merge

expecting success: 
	git update-ref refs/notes/m refs/notes/w &&
	verify_notes m &&
	test "$(git rev-parse refs/notes/m)" = "$(git rev-parse refs/notes/w)"

expecting success: 
	verify_notes x commit5 &&
	verify_no_fanout x

ok 19 - reset notes ref m to somewhere else (w)

expecting success: 
	# Resolve conflicts
	cat >.git/NOTES_MERGE_WORKTREE/$commit_sha1 <<EOF &&
y and z notes on 1st commit
EOF
	cat >.git/NOTES_MERGE_WORKTREE/$commit_sha4 <<EOF &&
y and z notes on 4th commit
EOF
	# Fail to finalize merge
	test_must_fail git notes merge --commit >output 2>&1 &&
	# .git/NOTES_MERGE_* must remain
	test -f .git/NOTES_MERGE_PARTIAL &&
	test -f .git/NOTES_MERGE_REF &&
	test -f .git/NOTES_MERGE_WORKTREE/$commit_sha1 &&
	test -f .git/NOTES_MERGE_WORKTREE/$commit_sha2 &&
	test -f .git/NOTES_MERGE_WORKTREE/$commit_sha3 &&
	test -f .git/NOTES_MERGE_WORKTREE/$commit_sha4 &&
	# Refs are unchanged
	test "$(git rev-parse refs/notes/m)" = "$(git rev-parse refs/notes/w)" &&
	test "$(git rev-parse refs/notes/y)" = "$(git rev-parse NOTES_MERGE_PARTIAL^1)" &&
	test "$(git rev-parse refs/notes/m)" != "$(git rev-parse NOTES_MERGE_PARTIAL^1)" &&
	# Mention refs/notes/m, and its current and expected value in output
	grep -q "refs/notes/m" output &&
	grep -q "$(git rev-parse refs/notes/m)" output &&
	grep -q "$(git rev-parse NOTES_MERGE_PARTIAL^1)" output &&
	# Verify that other notes refs has not changed (w, x, y and z)
	verify_notes w &&
	verify_notes x &&
	verify_notes y &&
	verify_notes z

ok 2 - sanity check (x)

expecting success: 
	git update-ref refs/notes/y refs/notes/x &&
	git config core.notesRef refs/notes/y &&
	i=5 &&
	while test $i -lt $num
	do
		i=$(($i + 1)) &&
		test_commit "commit$i" >/dev/null &&
		git notes add -m "notes for commit$i" || return 1
	done &&
	test "$(git rev-parse refs/notes/y)" != "$(git rev-parse refs/notes/x)" &&
	# Expected number of commits and notes
	test $(git rev-list HEAD | wc -l) = $num &&
	test $(git notes list | wc -l) = $num &&
	# 5 first notes unchanged
	verify_notes y commit5

ok 20 - fail to finalize conflicting merge if underlying ref has moved in the meantime (m != NOTES_MERGE_PARTIAL^1)

expecting success: 
	git notes merge --abort &&
	# No .git/NOTES_MERGE_* files left
	test_might_fail ls .git/NOTES_MERGE_* >output 2>/dev/null &&
	test_cmp /dev/null output &&
	# m has not moved (still == w)
	test "$(git rev-parse refs/notes/m)" = "$(git rev-parse refs/notes/w)" &&
	# Verify that other notes refs has not changed (w, x, y and z)
	verify_notes w &&
	verify_notes x &&
	verify_notes y &&
	verify_notes z

ok 21 - resolve situation by aborting the notes merge

expecting success: 
	git notes add -m foo HEAD &&
	git notes --ref=other add -m bar HEAD &&
	test_must_fail git notes merge refs/notes/other &&
	(
		cd .git/NOTES_MERGE_WORKTREE &&
		echo "foo" > $(git rev-parse HEAD) &&
		echo "bar" >> $(git rev-parse HEAD) &&
		git notes merge --commit
	) &&
	git notes show HEAD > actual_notes &&
	test_cmp expect_notes actual_notes

Auto-merging notes for 7f9ad8836c775acb134c0a055fc55fb4cd1ba361
CONFLICT (add/add): Merge conflict in notes for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361
Automatic notes merge failed. Fix conflicts in .git/NOTES_MERGE_WORKTREE and commit the result with 'git notes merge --commit', or abort the merge with 'git notes merge --abort'.
ok 22 - switch cwd before committing notes merge

# passed all 22 test(s)
1..22
*** t3320-notes-merge-worktrees.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3320-notes-merge-worktrees/.git/
expecting success: 
	test_commit tantrum

[master (root-commit) 02f8a63] tantrum
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 tantrum.t
ok 1 - setup commit

expecting success: 
	git config core.notesRef refs/notes/x &&
	git notes add -m "x notes on tantrum" tantrum

ok 2 - setup notes ref (x)

expecting success: 
	git update-ref refs/notes/y refs/notes/x &&
	git config core.notesRef refs/notes/y &&
	git notes remove tantrum

Removing note for object tantrum
ok 3 - setup local branch (y)

expecting success: 
	git update-ref refs/notes/z refs/notes/x &&
	git config core.notesRef refs/notes/z &&
	git notes add -f -m "conflicting notes on tantrum" tantrum

Overwriting existing notes for object 02f8a63df5a5eb7863e18dffcbc422a31a01d39e
ok 4 - setup remote branch (z)

expecting success: 
	git config core.notesRef refs/notes/x &&
	git notes add -f -m "more conflicting notes on tantrum" tantrum

Overwriting existing notes for object 02f8a63df5a5eb7863e18dffcbc422a31a01d39e
ok 5 - modify notes ref ourselves (x)

expecting success: 
	git worktree add -b newbranch worktree master &&
	git worktree add -b newbranch2 worktree2 master

Preparing worktree (identifier worktree)
HEAD is now at 02f8a63 tantrum
Preparing worktree2 (identifier worktree2)
HEAD is now at 02f8a63 tantrum
ok 6 - create some new worktrees

expecting success: 
	git config core.notesRef refs/notes/y &&
	test_must_fail git notes merge z &&
	echo "ref: refs/notes/y" >expect &&
	test_cmp .git/NOTES_MERGE_REF expect

Auto-merging notes for 02f8a63df5a5eb7863e18dffcbc422a31a01d39e
CONFLICT (delete/modify): Notes for object 02f8a63df5a5eb7863e18dffcbc422a31a01d39e deleted in refs/notes/y and modified in refs/notes/z. Version from refs/notes/z left in tree.
Automatic notes merge failed. Fix conflicts in .git/NOTES_MERGE_WORKTREE and commit the result with 'git notes merge --commit', or abort the merge with 'git notes merge --abort'.
ok 7 - merge z into y fails and sets NOTES_MERGE_REF

expecting success: 
	(
		cd worktree &&
		git config core.notesRef refs/notes/y &&
		test_must_fail git notes merge z 2>err &&
		grep "A notes merge into refs/notes/y is already in-progress at" err
	) &&
	test_path_is_missing .git/worktrees/worktree/NOTES_MERGE_REF

Auto-merging notes for 02f8a63df5a5eb7863e18dffcbc422a31a01d39e
CONFLICT (delete/modify): Notes for object 02f8a63df5a5eb7863e18dffcbc422a31a01d39e deleted in refs/notes/y and modified in refs/notes/z. Version from refs/notes/z left in tree.
fatal: A notes merge into refs/notes/y is already in-progress at /«PKGBUILDDIR»/t/trash directory.t3320-notes-merge-worktrees/
ok 8 - merge z into y while mid-merge in another workdir fails

expecting success: 
	(
		cd worktree2 &&
		git config core.notesRef refs/notes/x &&
		test_must_fail git notes merge z 2>&1 >out &&
		grep "Automatic notes merge failed" out &&
		grep -v "A notes merge into refs/notes/x is already in-progress in" out
	) &&
	echo "ref: refs/notes/x" >expect &&
	test_cmp .git/worktrees/worktree2/NOTES_MERGE_REF expect

Automatic notes merge failed. Fix conflicts in /«PKGBUILDDIR»/t/trash directory.t3320-notes-merge-worktrees/.git/worktrees/worktree2/NOTES_MERGE_WORKTREE and commit the result with 'git notes merge --commit', or abort the merge with 'git notes merge --abort'.
Auto-merging notes for 02f8a63df5a5eb7863e18dffcbc422a31a01d39e
CONFLICT (content): Merge conflict in notes for object 02f8a63df5a5eb7863e18dffcbc422a31a01d39e
Automatic notes merge failed. Fix conflicts in /«PKGBUILDDIR»/t/trash directory.t3320-notes-merge-worktrees/.git/worktrees/worktree2/NOTES_MERGE_WORKTREE and commit the result with 'git notes merge --commit', or abort the merge with 'git notes merge --abort'.
ok 9 - merge z into x while mid-merge on y succeeds

# passed all 9 test(s)
1..9
*** t3400-rebase.sh ***
ok 12 - test same notes in 2/38-fanout and 2/2/36-fanout

expecting success: verify_notes
ok 13 - verify same notes in 2/38-fanout and 2/2/36-fanout

expecting success: test_same_notes "s|^\(..\)\(..\)|\1/\2/|" "s|^\(..\)\(..\)\(..\)|\1/\2/\3/|"
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3400-rebase/.git/
expecting success: 
	git config core.logAllRefUpdates true &&
	echo First >A &&
	git update-index --add A &&
	git commit -m "Add A." &&
	git checkout -b force-3way &&
	echo Dummy >Y &&
	git update-index --add Y &&
	git commit -m "Add Y." &&
	git checkout -b filemove &&
	git reset --soft master &&
	mkdir D &&
	git mv A D/A &&
	git commit -m "Move A." &&
	git checkout -b my-topic-branch master &&
	echo Second >B &&
	git update-index --add B &&
	git commit -m "Add B." &&
	git checkout -f master &&
	echo Third >>A &&
	git update-index A &&
	git commit -m "Modify A." &&
	git checkout -b side my-topic-branch &&
	echo Side >>C &&
	git add C &&
	git commit -m "Add C" &&
	git checkout -f my-topic-branch &&
	git tag topic

[master (root-commit) e3d210d] Add A.
 Author: author@name <bogus@email@address>
 1 file changed, 1 insertion(+)
 create mode 100644 A
Switched to a new branch 'force-3way'
[force-3way 5d4eb99] Add Y.
 Author: author@name <bogus@email@address>
 1 file changed, 1 insertion(+)
 create mode 100644 Y
Switched to a new branch 'filemove'
[filemove c183ccc] Move A.
 Author: author@name <bogus@email@address>
 2 files changed, 1 insertion(+)
 rename A => D/A (100%)
 create mode 100644 Y
Switched to a new branch 'my-topic-branch'
[my-topic-branch e900024] Add B.
 Author: author@name <bogus@email@address>
 1 file changed, 1 insertion(+)
 create mode 100644 B
Switched to branch 'master'
[master c2488e4] Modify A.
 Author: author@name <bogus@email@address>
 1 file changed, 1 insertion(+)
Switched to a new branch 'side'
[side a5704a5] Add C
 Author: author@name <bogus@email@address>
 1 file changed, 1 insertion(+)
 create mode 100644 C
Switched to branch 'my-topic-branch'
ok 1 - prepare repository with topic branches

expecting success: 
	echo dirty >>A &&
	test_must_fail git rebase master

Cannot rebase: You have unstaged changes.
Please commit or stash them.
ok 2 - rebase on dirty worktree

expecting success: 
	git add A &&
	test_must_fail git rebase master

Cannot rebase: Your index contains uncommitted changes.
Please commit or stash them.
ok 3 - rebase on dirty cache

expecting success: 
	git reset --hard HEAD &&
	git rebase master

HEAD is now at e900024 Add B.
First, rewinding head to replay your work on top of it...
Applying: Add B.
ok 4 - rebase against master

expecting success: 
	test_when_finished "git branch -D torebase" &&
	git checkout -b torebase my-topic-branch^ &&
	upstream=$(git rev-parse ":/Add B") &&
	onto=$(git rev-parse ":/Add A") &&
	git rebase --onto $onto $upstream &&
	git reset --hard my-topic-branch^ &&
	git rebase --onto ":/Add A" ":/Add B" &&
	git checkout my-topic-branch

Switched to a new branch 'torebase'
First, rewinding head to replay your work on top of it...
HEAD is now at c2488e4 Modify A.
First, rewinding head to replay your work on top of it...
Switched to branch 'my-topic-branch'
Deleted branch torebase (was e3d210d).
ok 5 - rebase, with <onto> and <upstream> specified as :/quuxery

expecting success: 
	! (git log | grep "Author:" | grep "<>")

ok 6 - the rebase operation should not have destroyed author information

expecting success: 
	git log -1 |
	grep 'Author: author@name <bogus@email@address>'

Author: author@name <bogus@email@address>
ok 7 - the rebase operation should not have destroyed author information (2)

expecting success: 
	test $(git rev-parse HEAD@{1}) != $(git rev-parse my-topic-branch@{1})

ok 8 - HEAD was detached during rebase

expecting success: 
	git checkout -b topic side &&
	git rebase master

Switched to a new branch 'topic'
First, rewinding head to replay your work on top of it...
Applying: Add B.
Applying: Add C
ok 14 - test same notes in 2/2/2/34-fanout and 2/2/36-fanout

expecting success: verify_notes
ok 9 - rebase from ambiguous branch name

expecting success: 
	git checkout master &&
	git checkout HEAD^ &&
	git rebase @{-1} >expect.messages &&
	git merge-base master HEAD >expect.forkpoint &&

	git checkout master &&
	git checkout HEAD^ &&
	git rebase - >actual.messages &&
	git merge-base master HEAD >actual.forkpoint &&

	test_cmp expect.forkpoint actual.forkpoint &&
	# the next one is dubious---we may want to say "-",
	# instead of @{-1}, in the message
	test_i18ncmp expect.messages actual.messages

Switched to branch 'master'
ok 15 - verify same notes in 2/2/2/34-fanout and 2/2/36-fanout

expecting success: test_concatenated_notes "s|^..|&/|" ""
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 e3d210d... Add A.
Switched to branch 'master'
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 e3d210d... Add A.
ok 10 - rebase off of the previous branch using "-"

expecting success: 
	git checkout master &&
	git branch -D topic &&
	echo 1 >X &&
	git add X &&
	test_tick &&
	git commit -m prepare &&
	git checkout -b modechange HEAD^ &&
	echo 1 >X &&
	git add X &&
	test_chmod +x A &&
	test_tick &&
	git commit -m modechange &&
	GIT_TRACE=1 git rebase master

Switched to branch 'master'
Deleted branch topic (was 40940d9).
[master 8325629] prepare
 Author: author@name <bogus@email@address>
 1 file changed, 1 insertion(+)
 create mode 100644 X
Switched to a new branch 'modechange'
[modechange 0ba2367] modechange
 Author: author@name <bogus@email@address>
 2 files changed, 1 insertion(+)
 mode change 100644 => 100755 A
 create mode 100644 X
trace: exec: 'git-rebase' 'master'
trace: run_command: 'git-rebase' 'master'
trace: built-in: git 'rev-parse' '--parseopt' '--stuck-long' '--' 'master'
trace: built-in: git 'rev-parse' '--git-dir'
trace: built-in: git 'rev-parse' '--git-path' 'objects'
trace: built-in: git 'rev-parse' '--is-bare-repository'
trace: built-in: git 'rev-parse' '--show-toplevel'
trace: built-in: git 'config' '--bool' 'rebase.stat'
trace: built-in: git 'config' '--bool' 'rebase.autostash'
trace: built-in: git 'config' '--bool' 'rebase.autosquash'
trace: built-in: git 'rev-parse' '--verify' 'master^0'
trace: built-in: git 'rev-parse' '--verify' 'master^0'
trace: built-in: git 'symbolic-ref' '-q' 'HEAD'
trace: built-in: git 'rev-parse' '--verify' 'HEAD'
trace: built-in: git 'rev-parse' '--verify' 'HEAD'
trace: built-in: git 'update-index' '-q' '--ignore-submodules' '--refresh'
trace: built-in: git 'diff-files' '--quiet' '--ignore-submodules'
trace: built-in: git 'diff-index' '--cached' '--quiet' '--ignore-submodules' 'HEAD' '--'
trace: built-in: git 'merge-base' '8325629b58f36f47124fb4abf31078cfea42b707' '0ba23673033414af7af93cb53c38f1c7094c5738'
trace: built-in: git 'rev-parse' '--git-path' 'hooks/pre-rebase'
First, rewinding head to replay your work on top of it...
trace: built-in: git 'checkout' '-q' '8325629b58f36f47124fb4abf31078cfea42b707^0'
trace: built-in: git 'update-ref' 'ORIG_HEAD' '0ba23673033414af7af93cb53c38f1c7094c5738'
trace: built-in: git 'format-patch' '-k' '--stdout' '--full-index' '--cherry-pick' '--right-only' '--src-prefix=a/' '--dst-prefix=b/' '--no-renames' '--no-cover-letter' '8325629b58f36f47124fb4abf31078cfea42b707...0ba23673033414af7af93cb53c38f1c7094c5738'
trace: built-in: git 'am' '--rebasing' '--resolvemsg=
When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".
'
trace: run_command: 'mailsplit' '-d4' '-o.git/rebase-apply' '-b' '--'
trace: exec: 'git' 'mailsplit' '-d4' '-o.git/rebase-apply' '-b' '--'
trace: built-in: git 'mailsplit' '-d4' '-o.git/rebase-apply' '-b' '--'
trace: run_command: 'apply' '--index' '.git/rebase-apply/patch'
Applying: modechange
trace: run_command: 'apply' '--build-fake-ancestor=.git/rebase-apply/patch-merge-index' '.git/rebase-apply/patch'
trace: exec: 'git' 'apply' '--build-fake-ancestor=.git/rebase-apply/patch-merge-index' '.git/rebase-apply/patch'
trace: built-in: git 'apply' '--build-fake-ancestor=.git/rebase-apply/patch-merge-index' '.git/rebase-apply/patch'
trace: run_command: 'apply' '--cached' '.git/rebase-apply/patch'
Using index info to reconstruct a base tree...
trace: exec: 'git' 'apply' '--cached' '.git/rebase-apply/patch'
trace: built-in: git 'apply' '--cached' '.git/rebase-apply/patch'
trace: run_command: 'merge-recursive' '20d8b2c6c42a40f913517c72113d9d08e124064a' '--' '8325629b58f36f47124fb4abf31078cfea42b707' '98edf5feecb5ba7d79dcc596fc10fd9f643b58d8'
Falling back to patching base and 3-way merge...
trace: exec: 'git' 'merge-recursive' '20d8b2c6c42a40f913517c72113d9d08e124064a' '--' '8325629b58f36f47124fb4abf31078cfea42b707' '98edf5feecb5ba7d79dcc596fc10fd9f643b58d8'
trace: built-in: git 'merge-recursive' '20d8b2c6c42a40f913517c72113d9d08e124064a' '--' '8325629b58f36f47124fb4abf31078cfea42b707' '98edf5feecb5ba7d79dcc596fc10fd9f643b58d8'
Merging 8325629b58f36f47124fb4abf31078cfea42b707 with modechange
Merging:
8325629 prepare
virtual modechange
found 1 common ancestor:
virtual 20d8b2c6c42a40f913517c72113d9d08e124064a
trace: built-in: git 'rev-parse' 'HEAD'
trace: built-in: git 'update-ref' '-m' 'rebase finished: refs/heads/modechange onto 8325629b58f36f47124fb4abf31078cfea42b707' 'refs/heads/modechange' 'a91423eff77a40ef04d7b5fb440ee84be94ecfe7' '0ba23673033414af7af93cb53c38f1c7094c5738'
trace: built-in: git 'symbolic-ref' '-m' 'rebase finished: returning to refs/heads/modechange' 'HEAD' 'refs/heads/modechange'
trace: built-in: git 'gc' '--auto'
ok 11 - rebase a single mode change

expecting success: 
	test_config diff.renames copies &&
	git checkout filemove &&
	GIT_TRACE=1 git rebase force-3way

Switched to branch 'filemove'
trace: exec: 'git-rebase' 'force-3way'
trace: run_command: 'git-rebase' 'force-3way'
trace: built-in: git 'rev-parse' '--parseopt' '--stuck-long' '--' 'force-3way'
trace: built-in: git 'rev-parse' '--git-dir'
trace: built-in: git 'rev-parse' '--git-path' 'objects'
trace: built-in: git 'rev-parse' '--is-bare-repository'
trace: built-in: git 'rev-parse' '--show-toplevel'
trace: built-in: git 'config' '--bool' 'rebase.stat'
trace: built-in: git 'config' '--bool' 'rebase.autostash'
trace: built-in: git 'config' '--bool' 'rebase.autosquash'
trace: built-in: git 'rev-parse' '--verify' 'force-3way^0'
trace: built-in: git 'rev-parse' '--verify' 'force-3way^0'
trace: built-in: git 'symbolic-ref' '-q' 'HEAD'
trace: built-in: git 'rev-parse' '--verify' 'HEAD'
trace: built-in: git 'rev-parse' '--verify' 'HEAD'
trace: built-in: git 'update-index' '-q' '--ignore-submodules' '--refresh'
trace: built-in: git 'diff-files' '--quiet' '--ignore-submodules'
trace: built-in: git 'diff-index' '--cached' '--quiet' '--ignore-submodules' 'HEAD' '--'
trace: built-in: git 'merge-base' '5d4eb99128f86a2e83aea2875e89b83a89badfd4' 'c183cccb0ab8bad14e57d03de715e3b0f39111b3'
trace: built-in: git 'rev-parse' '--git-path' 'hooks/pre-rebase'
First, rewinding head to replay your work on top of it...
trace: built-in: git 'checkout' '-q' '5d4eb99128f86a2e83aea2875e89b83a89badfd4^0'
trace: built-in: git 'update-ref' 'ORIG_HEAD' 'c183cccb0ab8bad14e57d03de715e3b0f39111b3'
trace: built-in: git 'format-patch' '-k' '--stdout' '--full-index' '--cherry-pick' '--right-only' '--src-prefix=a/' '--dst-prefix=b/' '--no-renames' '--no-cover-letter' '5d4eb99128f86a2e83aea2875e89b83a89badfd4...c183cccb0ab8bad14e57d03de715e3b0f39111b3'
trace: built-in: git 'am' '--rebasing' '--resolvemsg=
When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".
'
trace: run_command: 'mailsplit' '-d4' '-o.git/rebase-apply' '-b' '--'
trace: exec: 'git' 'mailsplit' '-d4' '-o.git/rebase-apply' '-b' '--'
trace: built-in: git 'mailsplit' '-d4' '-o.git/rebase-apply' '-b' '--'
trace: run_command: 'apply' '--index' '.git/rebase-apply/patch'
Applying: Move A.
trace: run_command: 'apply' '--build-fake-ancestor=.git/rebase-apply/patch-merge-index' '.git/rebase-apply/patch'
trace: exec: 'git' 'apply' '--build-fake-ancestor=.git/rebase-apply/patch-merge-index' '.git/rebase-apply/patch'
trace: built-in: git 'apply' '--build-fake-ancestor=.git/rebase-apply/patch-merge-index' '.git/rebase-apply/patch'
trace: run_command: 'apply' '--cached' '.git/rebase-apply/patch'
Using index info to reconstruct a base tree...
trace: exec: 'git' 'apply' '--cached' '.git/rebase-apply/patch'
trace: built-in: git 'apply' '--cached' '.git/rebase-apply/patch'
trace: run_command: 'merge-recursive' '26395c6fe842cd8894b5dde87a6fb53cccfabc06' '--' '5d4eb99128f86a2e83aea2875e89b83a89badfd4' '78e552a7b7a67f48f6849a9b83cf37e7f338dcf6'
Falling back to patching base and 3-way merge...
trace: exec: 'git' 'merge-recursive' '26395c6fe842cd8894b5dde87a6fb53cccfabc06' '--' '5d4eb99128f86a2e83aea2875e89b83a89badfd4' '78e552a7b7a67f48f6849a9b83cf37e7f338dcf6'
trace: built-in: git 'merge-recursive' '26395c6fe842cd8894b5dde87a6fb53cccfabc06' '--' '5d4eb99128f86a2e83aea2875e89b83a89badfd4' '78e552a7b7a67f48f6849a9b83cf37e7f338dcf6'
Merging 5d4eb99128f86a2e83aea2875e89b83a89badfd4 with Move A.
Merging:
5d4eb99 Add Y.
virtual Move A.
found 1 common ancestor:
virtual 26395c6fe842cd8894b5dde87a6fb53cccfabc06
Skipped D/A (merged same as existing)
trace: built-in: git 'rev-parse' 'HEAD'
trace: built-in: git 'update-ref' '-m' 'rebase finished: refs/heads/filemove onto 5d4eb99128f86a2e83aea2875e89b83a89badfd4' 'refs/heads/filemove' '57cf4c544152a2a5870f1db451048ad5a281061d' 'c183cccb0ab8bad14e57d03de715e3b0f39111b3'
trace: built-in: git 'symbolic-ref' '-m' 'rebase finished: returning to refs/heads/filemove' 'HEAD' 'refs/heads/filemove'
trace: built-in: git 'gc' '--auto'
ok 12 - rebase is not broken by diff.renames

expecting success: 
	test_might_fail git rebase --abort &&
	git reset --hard &&
	git checkout modechange

No rebase in progress?
HEAD is now at 57cf4c5 Move A.
Switched to branch 'modechange'
ok 13 - setup: recover

expecting success: 
	>B &&
	test_must_fail git rebase topic 2>output.err >output.out &&
	grep "The following untracked working tree files would be overwritten by checkout:" output.err &&
	grep B output.err

error: The following untracked working tree files would be overwritten by checkout:
	B
ok 14 - Show verbose error when HEAD could not be detached

expecting success: 
	git checkout topic &&
	test_must_fail git rebase

Note: checking out 'topic'.

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 e900024... Add B.
You are not currently on a branch. Please specify which
branch you want to rebase against. See git-rebase(1) for details.

    git rebase <branch>

ok 15 - fail when upstream arg is missing and not on branch

expecting success: 
	git checkout -b no-config topic &&
	test_must_fail git rebase

Switched to a new branch 'no-config'
There is no tracking information for the current branch.
Please specify which branch you want to rebase against.
See git-rebase(1) for details

    git rebase <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=<remote>/<branch> no-config

ok 16 - fail when upstream arg is missing and not configured

expecting success: 
	git checkout -b default-base master &&
	git checkout -b default topic &&
	git config branch.default.remote . &&
	git config branch.default.merge refs/heads/default-base &&
	git rebase &&
	git rev-parse --verify default-base >expect &&
	git rev-parse default~1 >actual &&
	test_cmp expect actual &&
	git checkout default-base &&
	git reset --hard HEAD^ &&
	git checkout default &&
	git rebase &&
	git rev-parse --verify default-base >expect &&
	git rev-parse default~1 >actual &&
	test_cmp expect actual

Switched to a new branch 'default-base'
Switched to a new branch 'default'
ok 16 - test notes in no fanout concatenated with 2/38-fanout

expecting success: verify_concatenated_notes
First, rewinding head to replay your work on top of it...
Applying: Add B.
ok 17 - verify notes in no fanout concatenated with 2/38-fanout

expecting success: test_concatenated_notes "s|^\(..\)\(..\)|\1/\2/|" ""
Switched to branch 'default-base'
HEAD is now at c2488e4 Modify A.
Switched to branch 'default'
Your branch is ahead of 'default-base' by 2 commits.
  (use "git push" to publish your local commits)
First, rewinding head to replay your work on top of it...
Applying: Add B.
ok 17 - default to common base in @{upstream}s reflog if no upstream arg

expecting success: 
	git checkout default-base &&
	echo Amended >A &&
	git commit -a --no-edit --amend &&
	test_commit B B &&
	test_commit new_B B "New B" &&
	test_commit C C &&
	git checkout default &&
	git reset --hard default-base@{4} &&
	test_commit D D &&
	git cherry-pick -2 default-base^ &&
	test_commit final_B B "Final B" &&
	git rebase &&
	echo Amended >expect &&
	test_cmp A expect &&
	echo "Final B" >expect &&
	test_cmp B expect &&
	echo C >expect &&
	test_cmp C expect &&
	echo D >expect &&
	test_cmp D expect

Switched to branch 'default-base'
[default-base 3203a56] Modify A.
 Author: author@name <bogus@email@address>
 Date: Wed Dec 16 10:50:54 2015 +0000
 1 file changed, 1 insertion(+), 1 deletion(-)
[default-base c8c14cb] B
 Author: author@name <bogus@email@address>
 1 file changed, 1 insertion(+)
 create mode 100644 B
[default-base 8c32fb9] new_B
 Author: author@name <bogus@email@address>
 1 file changed, 1 insertion(+), 1 deletion(-)
[default-base 3b904b3] C
 Author: author@name <bogus@email@address>
 1 file changed, 1 insertion(+)
 create mode 100644 C
Switched to branch 'default'
Your branch and 'default-base' have diverged,
and have 2 and 4 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)
HEAD is now at c2488e4 Modify A.
[default f83ddfd] D
 Author: author@name <bogus@email@address>
 1 file changed, 1 insertion(+)
 create mode 100644 D
[default 3fb7129] B
 Author: author@name <bogus@email@address>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 B
[default 60f1ef0] new_B
 Author: author@name <bogus@email@address>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
[default e9c50ee] final_B
 Author: author@name <bogus@email@address>
 1 file changed, 1 insertion(+), 1 deletion(-)
First, rewinding head to replay your work on top of it...
Applying: D
Applying: final_B
ok 18 - cherry-picked commits and fork-point work together

expecting success: 
	git checkout -b quiet topic &&
	git rebase -q master >output.out 2>&1 &&
	test_must_be_empty output.out

Switched to a new branch 'quiet'
ok 19 - rebase -q is quiet

expecting success: 
	(
		echo "One"
		echo "TwoQ"
		echo "Three"
		echo "FQur"
		echo "Five"
	) | q_to_cr >CR &&
	git add CR &&
	test_tick &&
	git commit -a -m "A file with a line with CR" &&
	git tag file-with-cr &&
	git checkout HEAD^0 &&
	git rebase --onto HEAD^^ HEAD^ &&
	git diff --exit-code file-with-cr:CR HEAD:CR

[quiet 7f0fac0] A file with a line with CR
 Author: author@name <bogus@email@address>
 1 file changed, 5 insertions(+)
 create mode 100644 CR
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 7f0fac0... A file with a line with CR
First, rewinding head to replay your work on top of it...
Applying: A file with a line with CR
ok 20 - Rebase a commit that sprinkles CRs in

expecting success: 
	git config notes.rewrite.rebase true &&
	git config notes.rewriteRef "refs/notes/*" &&
	test_commit n1 &&
	test_commit n2 &&
	test_commit n3 &&
	git notes add -m"a note" n3 &&
	git rebase --onto n1 n2 &&
	test "a note" = "$(git notes show HEAD)"

[detached HEAD be74572] n1
 Author: author@name <bogus@email@address>
 1 file changed, 1 insertion(+)
 create mode 100644 n1.t
[detached HEAD 84e0eb9] n2
 Author: author@name <bogus@email@address>
 1 file changed, 1 insertion(+)
 create mode 100644 n2.t
ok 18 - test notes in no fanout concatenated with 2/2/36-fanout

expecting success: verify_concatenated_notes
[detached HEAD 24b0cc7] n3
 Author: author@name <bogus@email@address>
 1 file changed, 1 insertion(+)
 create mode 100644 n3.t
ok 19 - verify notes in no fanout concatenated with 2/2/36-fanout

expecting success: test_concatenated_notes "s|^\(..\)\(..\)|\1/\2/|" "s|^..|&/|"
First, rewinding head to replay your work on top of it...
Applying: n3
ok 21 - rebase can copy notes

expecting success: 
	git reset --hard n3 &&
	git rebase -m --onto n1 n2 &&
	test "a note" = "$(git notes show HEAD)"

HEAD is now at 24b0cc7 n3
First, rewinding head to replay your work on top of it...
Merging n1 with HEAD~0
Merging:
be74572 n1
24b0cc7 n3
found 1 common ancestor:
84e0eb9 n2
[detached HEAD 79c9138] n3
 Author: author@name <bogus@email@address>
 Date: Thu Apr 7 15:23:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 n3.t
Committed: 0001 n3
All done.
ok 22 - rebase -m can copy notes

expecting success: 
	git reset --hard &&

	>old.one && git add old.one && test_tick &&
	git commit --date="@12345 +0400" -m "Old one" &&
	>old.two && git add old.two && test_tick &&
	git commit --date="@23456 +0500" -m "Old two" &&
	>old.three && git add old.three && test_tick &&
	git commit --date="@34567 +0600" -m "Old three" &&

	git cat-file commit HEAD^^ >actual &&
	grep "author .* 12345 +0400$" actual &&
	git cat-file commit HEAD^ >actual &&
	grep "author .* 23456 +0500$" actual &&
	git cat-file commit HEAD >actual &&
	grep "author .* 34567 +0600$" actual &&

	git rebase --onto HEAD^^ HEAD^ &&

	git cat-file commit HEAD >actual &&
	grep "author .* 34567 +0600$" actual

HEAD is now at 79c9138 n3
[detached HEAD a7c4b9b] Old one
 Author: author@name <bogus@email@address>
 Date: Thu Jan 1 07:25:45 1970 +0400
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 old.one
[detached HEAD f788e42] Old two
 Author: author@name <bogus@email@address>
 Date: Thu Jan 1 11:30:56 1970 +0500
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 old.two
[detached HEAD 64f741c] Old three
 Author: author@name <bogus@email@address>
 Date: Thu Jan 1 15:36:07 1970 +0600
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 old.three
author author@name <bogus@email@address> 12345 +0400
author author@name <bogus@email@address> 23456 +0500
author author@name <bogus@email@address> 34567 +0600
First, rewinding head to replay your work on top of it...
Applying: Old three
author author@name <bogus@email@address> 34567 +0600
ok 23 - rebase commit with an ancient timestamp

# passed all 23 test(s)
1..23
*** t3402-rebase-merge.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3402-rebase-merge/.git/
expecting success: 
	git add original &&
	git commit -m"initial" &&
	git branch side &&
	echo "11 $T" >>original &&
	git commit -a -m"master updates a bit." &&

	echo "12 $T" >>original &&
	git commit -a -m"master updates a bit more." &&

	git checkout side &&
	(echo "0 $T" ; cat original) >renamed &&
	git add renamed &&
	git update-index --force-remove original &&
	git commit -a -m"side renames and edits." &&

	tr "[a-z]" "[A-Z]" <original >newfile &&
	git add newfile &&
	git commit -a -m"side edits further." &&
	git branch second-side &&

	tr "[a-m]" "[A-M]" <original >newfile &&
	rm -f original &&
	git commit -a -m"side edits once again." &&

	git branch test-rebase side &&
	git branch test-rebase-pick side &&
	git branch test-reference-pick side &&
	git branch test-conflicts side &&
	git checkout -b test-merge side

[master (root-commit) 232c141] initial
 Author: A U Thor <author@example.com>
 1 file changed, 20 insertions(+)
 create mode 100644 original
[master f335ad0] master updates a bit.
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+)
[master 42d45b9] master updates a bit more.
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+)
Switched to branch 'side'
[side 0cb1e65] side renames and edits.
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+)
 rename original => renamed (90%)
[side e531600] side edits further.
 Author: A U Thor <author@example.com>
 1 file changed, 20 insertions(+)
 create mode 100644 newfile
[side a2923b0] side edits once again.
 Author: A U Thor <author@example.com>
 1 file changed, 20 insertions(+), 20 deletions(-)
 rewrite newfile (100%)
Switched to a new branch 'test-merge'
ok 1 - setup

expecting success: 
	git merge -s recursive -m "reference merge" master

Merging:
a2923b0 side edits once again.
virtual master
found 1 common ancestor:
232c141 initial
Auto-merging renamed
Merge made by the 'recursive' strategy.
 renamed | 4 ++++
 1 file changed, 4 insertions(+)
ok 2 - reference merge

expecting success: 
	git checkout test-rebase &&
	GIT_TRACE=1 git rebase --merge master

Switched to branch 'test-rebase'
trace: exec: 'git-rebase' '--merge' 'master'
trace: run_command: 'git-rebase' '--merge' 'master'
trace: built-in: git 'rev-parse' '--parseopt' '--stuck-long' '--' '--merge' 'master'
trace: built-in: git 'rev-parse' '--git-dir'
trace: built-in: git 'rev-parse' '--git-path' 'objects'
trace: built-in: git 'rev-parse' '--is-bare-repository'
trace: built-in: git 'rev-parse' '--show-toplevel'
trace: built-in: git 'config' '--bool' 'rebase.stat'
trace: built-in: git 'config' '--bool' 'rebase.autostash'
trace: built-in: git 'config' '--bool' 'rebase.autosquash'
trace: built-in: git 'rev-parse' '--verify' 'master^0'
trace: built-in: git 'rev-parse' '--verify' 'master^0'
trace: built-in: git 'symbolic-ref' '-q' 'HEAD'
trace: built-in: git 'rev-parse' '--verify' 'HEAD'
trace: built-in: git 'rev-parse' '--verify' 'HEAD'
trace: built-in: git 'update-index' '-q' '--ignore-submodules' '--refresh'
trace: built-in: git 'diff-files' '--quiet' '--ignore-submodules'
trace: built-in: git 'diff-index' '--cached' '--quiet' '--ignore-submodules' 'HEAD' '--'
ok 1 - creating many notes with git-notes

expecting success: 
	git log | grep "^    " > output &&
	i=300 &&
	while test $i -gt 0
	do
		echo "    commit #$i" &&
		echo "    note #$i" &&
		i=$(($i - 1));
	done > expect &&
	test_cmp expect output

trace: built-in: git 'merge-base' '42d45b9f420b7ef2051635bde7f345c4e5bfca7d' 'a2923b0c540c74a0ac1fd0c72a459e572651df36'
trace: built-in: git 'rev-parse' '--git-path' 'hooks/pre-rebase'
First, rewinding head to replay your work on top of it...
trace: built-in: git 'checkout' '-q' '42d45b9f420b7ef2051635bde7f345c4e5bfca7d^0'
trace: built-in: git 'update-ref' 'ORIG_HEAD' 'a2923b0c540c74a0ac1fd0c72a459e572651df36'
trace: built-in: git 'rev-list' '--reverse' '--no-merges' '42d45b9f420b7ef2051635bde7f345c4e5bfca7d..a2923b0c540c74a0ac1fd0c72a459e572651df36'
trace: built-in: git 'rev-parse' '--verify' 'HEAD'
trace: built-in: git 'merge-recursive' '0cb1e651c350699ace50c63ffbdbf32b9ed8078b^' '--' '42d45b9f420b7ef2051635bde7f345c4e5bfca7d' '0cb1e651c350699ace50c63ffbdbf32b9ed8078b'
Merging master with HEAD~2
Merging:
42d45b9 master updates a bit more.
0cb1e65 side renames and edits.
found 1 common ancestor:
232c141 initial
Auto-merging renamed
trace: built-in: git 'ls-files' '-u'
trace: built-in: git 'diff-index' '--quiet' '--ignore-submodules' 'HEAD' '--'
trace: built-in: git 'commit' '--no-verify' '-C' '0cb1e651c350699ace50c63ffbdbf32b9ed8078b'
[detached HEAD 89eb30e] side renames and edits.
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:51:10 2015 +0000
 1 file changed, 2 insertions(+)
 rename original => renamed (92%)
trace: built-in: git 'rev-parse' 'HEAD^0'
Committed: 0001 ok 2 - many notes created correctly with git-notes

expecting success: 
	# Expect entire notes tree to have a fanout == 1
	git ls-tree -r --name-only refs/notes/commits |
	while read path
	do
		case "$path" in
		??/??????????????????????????????????????)
			: true
			;;
		*)
			echo "Invalid path \"$path\"" &&
			return 1
			;;
		esac
	done

ok 20 - test notes in 2/38-fanout concatenated with 2/2/36-fanout

expecting success: verify_concatenated_notes
trace: built-in: git 'log' '--format=%s' '-1' '0cb1e651c350699ace50c63ffbdbf32b9ed8078b'
side renames and edits.
trace: built-in: git 'rev-parse' '--verify' 'HEAD'
trace: built-in: git 'merge-recursive' 'e531600834d89d694cc350621d5a0677aad44705^' '--' '89eb30e386315c4d58c3e43fb331bddf9bdf2421' 'e531600834d89d694cc350621d5a0677aad44705'
ok 3 - many notes created with git-notes triggers fanout

expecting success: 
	num_notes=250 &&
	i=0 &&
	git rev-list HEAD |
	while test $i -lt $num_notes && read sha1
	do
		i=$(($i + 1)) &&
		test_tick &&
		git notes remove "$sha1" ||
		exit 1
	done

Merging master with HEAD~1
Merging:
89eb30e side renames and edits.
e531600 side edits further.
found 1 common ancestor:
0cb1e65 side renames and edits.
trace: built-in: git 'ls-files' '-u'
trace: built-in: git 'diff-index' '--quiet' '--ignore-submodules' 'HEAD' '--'
Removing note for object 854fb20b9d7dcaa80548bb9c8c3d8c3f6b0719d4
trace: built-in: git 'commit' '--no-verify' '-C' 'e531600834d89d694cc350621d5a0677aad44705'
Removing note for object 200fae4018757111c0a8a5a92f363f20be7decc3
ok 21 - verify notes in 2/38-fanout concatenated with 2/2/36-fanout

expecting success: test_concatenated_notes "s|^\(..\)\(..\)\(..\)|\1/\2/\3/|" "s|^\(..\)\(..\)|\1/\2/|"
[detached HEAD d9d8715] side edits further.
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:51:10 2015 +0000
 1 file changed, 20 insertions(+)
 create mode 100644 newfile
trace: built-in: git 'rev-parse' 'HEAD^0'
Removing note for object 7d219e25b693893b9d3808a38a0156a8fd225422
trace: built-in: git 'log' '--format=%s' '-1' 'e531600834d89d694cc350621d5a0677aad44705'
Committed: 0002 side edits further.
Removing note for object 8cae25a6a918d5f7e6d46fa93456a4c1251c6141
trace: built-in: git 'rev-parse' '--verify' 'HEAD'
trace: built-in: git 'merge-recursive' 'a2923b0c540c74a0ac1fd0c72a459e572651df36^' '--' 'd9d871548864e7143a5421b1e766c1911bf8fe12' 'a2923b0c540c74a0ac1fd0c72a459e572651df36'
Removing note for object 1d0676baebb69788e6c92a458e69b6f2398795f6
Merging master with HEAD~0
Merging:
d9d8715 side edits further.
a2923b0 side edits once again.
found 1 common ancestor:
e531600 side edits further.
trace: built-in: git 'ls-files' '-u'
Removing note for object 49564c28ac6df710aee85cba0cd6f926f6c7e453
trace: built-in: git 'diff-index' '--quiet' '--ignore-submodules' 'HEAD' '--'
Removing note for object 639a535bf80e6dd9d31bd60679de5bbf5f105d49
trace: built-in: git 'commit' '--no-verify' '-C' 'a2923b0c540c74a0ac1fd0c72a459e572651df36'
Removing note for object 624297b32f29ba1f4f943bd1991d9e28105d4b16
[detached HEAD 8952ce9] side edits once again.
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:51:10 2015 +0000
 1 file changed, 20 insertions(+), 20 deletions(-)
 rewrite newfile (100%)
trace: built-in: git 'rev-parse' 'HEAD^0'
Removing note for object 947e5312513a5f368ac9f1ac84fa95a82365027f
trace: built-in: git 'log' '--format=%s' '-1' 'a2923b0c540c74a0ac1fd0c72a459e572651df36'
Committed: 0003 side edits once again.
trace: built-in: git 'rev-parse' 'HEAD'
Removing note for object 08cadb1987ea288fcb9fc8e50ab2db73031aa687
trace: built-in: git 'update-ref' '-m' 'rebase finished: refs/heads/test-rebase onto 42d45b9f420b7ef2051635bde7f345c4e5bfca7d' 'refs/heads/test-rebase' '8952ce9264060558d3ef2e217d43d0c26a1ce7f8' 'a2923b0c540c74a0ac1fd0c72a459e572651df36'
Removing note for object 39820b7c24dfdc2ce40c5ecfff5571a80e4c5f47
trace: built-in: git 'symbolic-ref' '-m' 'rebase finished: returning to refs/heads/test-rebase' 'HEAD' 'refs/heads/test-rebase'
trace: built-in: git 'notes' 'copy' '--for-rewrite=rebase'
trace: built-in: git 'rev-parse' '--git-path' 'hooks/post-rewrite'
All done.
Removing note for object 5ee4152ac768ed7ad39636ac9fa6365abfe5b346
trace: built-in: git 'gc' '--auto'
ok 3 - rebase

expecting success: 
	test $PRE_REBASE = $(git rev-parse test-rebase@{1})

Removing note for object 385ea09d67fee0b88413bdc5aa9be3718938d022
ok 4 - test-rebase@{1} is pre rebase

expecting success: 
	git diff-tree -r test-rebase test-merge >difference &&
	if test -s difference
	then
		cat difference
		(exit 1)
	else
		echo happy
	fi

Removing note for object e900f033cef5fb6f4148c507e1c5f0bd6fabcf48
happy
ok 5 - merge and rebase should match

expecting success: 
	git reset --hard master &&
	git rebase --merge side

Removing note for object fd85b59dd4b733d5efad4949e55865798e32a2e8
HEAD is now at 42d45b9 master updates a bit more.
Removing note for object 9255f5214f6621e4e65172a3b451e1352f9c46d7
Removing note for object 7a4395a549bcabe028edf23408cfffcc11543e12
Removing note for object f324af807a75532bc567e84ff68621b9133830d2
Removing note for object e1e1a803687cc6b143e5940299a84400d94dec9a
Removing note for object 06af34e983844b389c7baed5f6e501c8185e990e
Removing note for object abe5beb280907a2887f37a860035436aed83ccf1
Removing note for object 0314f267e210671b1e3feff2f0af3d4935adf60a
Removing note for object c04519ee674bc0b92ac66cfba80e8f475b3fc386
Removing note for object b88db8824a2bf2dd452828b04c7d018bcb9589d5
Removing note for object a19f1a613ba01f69161de278f9ac914bdff88eab
First, rewinding head to replay your work on top of it...
Removing note for object a828af33c56b650725b709b5e3f701d8466e3b4a
Removing note for object 4b6ebf1f33b72a4dc49886fb89b0738530e6b634
Removing note for object e4f2d464bd3c5f85840d2e11af506f80f7f6e2a8
Removing note for object 580ab2e48c71a4ec87359b16b4b8590613676182
Merging side with HEAD~1
Merging:
a2923b0 side edits once again.
f335ad0 master updates a bit.
found 1 common ancestor:
232c141 initial
Auto-merging renamed
Removing note for object 7b6ec1d3969ea440bb83740f38cd69fdd5574793
Removing note for object ce60e6913571e1e6d20e03ec9c22db9a37bf8321
[detached HEAD 3d22544] master updates a bit.
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:51:10 2015 +0000
 1 file changed, 2 insertions(+)
Removing note for object 1c3fad1c59de999bb6e21f9d49f90cc143974a83
Committed: 0001 master updates a bit.
Removing note for object fc6c354c992b4bbc9be797b08db9589793d213bc
Removing note for object d1f96781fe35c3384553726974c6077f8e274315
Merging side with HEAD~0
Merging:
3d22544 master updates a bit.
42d45b9 master updates a bit more.
found 1 common ancestor:
f335ad0 master updates a bit.
Auto-merging renamed
Removing note for object 5414ccb72e8f8a134a93a5e1615430fa4c5cea2a
Removing note for object c3ba6ecef5ca2aa7ff04a0a65d2afa47f5e1de12
Removing note for object 4bcf332903c4766e6602eec79fbba41db694aeb9
[detached HEAD c541a1a] master updates a bit more.
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:51:10 2015 +0000
 1 file changed, 2 insertions(+)
Removing note for object 5b1f9f2c09a25aca558c9e0cb37e351d674c440d
Committed: 0002 master updates a bit more.
Removing note for object aac25280221d50de418b254851eece2dfebff969
Removing note for object c3705f05305eda98c99ee22de1e9e33c589097f8
All done.
Removing note for object 2d5e918dbc8c4892c24ba25ee2807f51f446611b
ok 6 - rebase the other way

expecting success: 
	git checkout -b conflicting master~2 &&
	echo "AB $T" >> original &&
	git commit -mconflicting original &&
	git rebase -Xtheirs master &&
	grep AB original &&
	! grep 11 original

Removing note for object 0408a5712291f0db8f45430c1b585cabe45b4224
Switched to a new branch 'conflicting'
Removing note for object 3a9c6fce2183d03bcb0551f8bf81a41ce8fbd534
[conflicting ff551a5] conflicting
Removing note for object 1f88e10aa3a1d395e0543bfa59bbf05220c71db4
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+)
Removing note for object 25ff66539025aa98823d9ee038f6cb4892bf1fb5
Removing note for object 0da364524c240e0089baa38f16c711b35240fd57
Removing note for object 7bc603c4f23e35a0d82d3921408eececb05d671e
Removing note for object 40578788b551ff0dd9b9eee4bf00244a3e82fae4
Removing note for object ba037d4f7b23d892ddf3fb69f65daa7b1ce04419
Removing note for object 16b1618654b1b2f2036e510294edaf37145f5e17
Removing note for object 4e775bd4d8a7ef0381e55414046717ae0bca2128
Removing note for object 93e4d12470610c01d9585b03d7c08326c6fb1a8f
Removing note for object 90e80cd3c184dac514093c22fbfcb0a3870040f6
Removing note for object e144c821ba6b3b44fcd1633895072636537c933a
First, rewinding head to replay your work on top of it...
Removing note for object 55f1721c25adc31182d341d82b7289c34ecd4eb2
Removing note for object 978493ba09b63142bcd98617c67fc6c970ca302c
Removing note for object 8b321a102e20a4bddca37566663b6ec9e246ac64
Removing note for object 29ccbf44f205cd5ff48aca4072d6fd845b6c4716
Merging master with HEAD~0
Merging:
42d45b9 master updates a bit more.
ff551a5 conflicting
found 1 common ancestor:
232c141 initial
Auto-merging original
Removing note for object 9a92477f30bbf5248212a031c3e910813b1a2db3
Removing note for object cc4ecd1f77a4e41df92a1d6597dd5122dc0b46a6
[detached HEAD 8784926] conflicting
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:51:13 2015 +0000
 1 file changed, 1 insertion(+), 3 deletions(-)
Removing note for object 963216b27d8d471c216f4c903c049e5ce5fdac47
Committed: 0001 conflicting
Removing note for object fbdbb1b550acb25e4ce7c3bc6f65cbc91de44241
Removing note for object f7f1084ed7006d8843433333ef5055b2adfb5bb1
Removing note for object c87766b583ae086abd511f9e88821d41da3896d5
All done.
Removing note for object 33be48ce21601027fb8cde3c6e2d187fcea55571
AB A quick brown fox
ok 7 - rebase -Xtheirs

expecting success: 
	git diff-tree -r test-rebase test-merge >difference &&
	if test -s difference
	then
		cat difference
		(exit 1)
	else
		echo happy
	fi

Removing note for object 8031f54641552a3ad7dd038675834eadba5d7a38
happy
ok 8 - merge and rebase should match

expecting success: 
	git reset --hard side &&
	git rebase --merge --onto master side^^ &&
	mb=$(git merge-base master HEAD) &&
	if test "$mb" = "$(git rev-parse master)"
	then
		echo happy
	else
		git show-branch
		(exit 1)
	fi &&
	f=$(git diff-tree --name-only HEAD^ HEAD) &&
	g=$(git diff-tree --name-only HEAD^^ HEAD^) &&
	case "$f,$g" in
	newfile,newfile)
		echo happy ;;
	*)
		echo "$f"
		echo "$g"
		(exit 1)
	esac

Removing note for object 5526de2cf7102d43882cad71a0575df9c3ce236c
Removing note for object 1db1e2a43118764daf9190e3cad8c1796a71b3b6
HEAD is now at a2923b0 side edits once again.
Removing note for object b50b64c167ee83ff8a9566e71c6461c148d30582
Removing note for object 95772a637e6cc1d320564d23e879c6567682f59a
Removing note for object 3c63c8dc7def3d6a4b22743c8ed09cef8d4147c2
Removing note for object fb69d1d419d3e88876b2e677bbf8ccd7da8f01d2
Removing note for object df866016f9cd23fe3a8d96f4bca6d5b6776b1095
Removing note for object ec9330714addd1f3f1325166e373cbec7798faa0
Removing note for object ddb1318c0e9b02d7f5ada5b57d5d99690db58347
Removing note for object 0f010abe8ac41027fdd82b5d97d8d20968230f38
Removing note for object 10c04d4b6d6192116238ab18357460223136c73a
First, rewinding head to replay your work on top of it...
Removing note for object 9045e926f3cdf5b6d1915b88cbf388bbde0ad31a
Removing note for object 226e5fdf42381dc26a88f4984821e99b4e404137
Removing note for object be34f41e8d8bacf2ea4f0872bfb8348284b34130
Removing note for object 4d97cd50b4de11a36634454d555b89816af10a17
Removing note for object 85e625d2d7fc35cadec822f54867c684b63a7d71
Merging master with HEAD~1
Merging:
42d45b9 master updates a bit more.
e531600 side edits further.
found 1 common ancestor:
0cb1e65 side renames and edits.
Skipped original (merged same as existing)
Removing note for object 90efba6c53df64c07ffc07e7ce2a4f23e352eb88
Removing note for object 469093795f6f0fe36312a14df3b7ab1ccc0c35bf
[detached HEAD a0b6d15] side edits further.
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:51:10 2015 +0000
 1 file changed, 20 insertions(+)
 create mode 100644 newfile
Removing note for object cba3d318fe07b42721e7593b17f1c449e5c2f240
Committed: 0001 side edits further.
Removing note for object 056cdb6bdb72c1534f49feab5010b194ccba9dc8
Removing note for object e0d990e2fd3338f16956b9a2e72e73045bd745ab
Merging master with HEAD~0
Merging:
a0b6d15 side edits further.
a2923b0 side edits once again.
found 1 common ancestor:
e531600 side edits further.
Skipped original (merged same as existing)
Removing note for object 1b2fedd64114e8ebf7d8471cda4c324dfffc3c85
Removing note for object 993c654ef73a0e4ed802c6b0e29745d2299508ee
[detached HEAD 4b3b7ba] side edits once again.
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:51:10 2015 +0000
 1 file changed, 20 insertions(+), 20 deletions(-)
 rewrite newfile (100%)
Removing note for object c31cd7d4c6dfae5e044e3c11bca7ed66d7197dcc
Committed: 0002 side edits once again.
Removing note for object 7fe600f3692b9d97dadde89a2f1d08a0ffcc3602
Removing note for object 2f59d1fb1cd8df54d4000e91c50d27c555c245a6
Removing note for object 0110473cfeb6a4894b0457b6aca75543797e0ed3
All done.
Removing note for object dbf4ab2a968e38fe629b73331d194678ebd14036
happy
Removing note for object f4c49ddff2b799959eeae06b6a640874beb60fd0
Removing note for object c1711837dcf0bcf93cccb7416ac28ef0cea04b50
happy
ok 9 - picking rebase

expecting success: 
	test_when_finished "rm -fr test-bin funny.was.run" &&
	mkdir test-bin &&
	cat >test-bin/git-merge-funny <<-EOF &&
	#!$SHELL_PATH
	case "\$1" in --opt) ;; *) exit 2 ;; esac
	shift &&
	>funny.was.run &&
	exec git merge-recursive "\$@"
	EOF
	chmod +x test-bin/git-merge-funny &&
	git reset --hard &&
	git checkout -b test-funny master^ &&
	test_commit funny &&
	(
		PATH=./test-bin:$PATH
		git rebase -s funny -Xopt master
	) &&
	test -f funny.was.run

Removing note for object 19e4e436c159d353664d6ecbc0e7f5b79b9d3d26
HEAD is now at 4b3b7ba side edits once again.
Removing note for object 2691dfa681eaf0e85480b0a3b77c998decf1c01a
Switched to a new branch 'test-funny'
Removing note for object f0f0538057240cc979517475b7cf8cb710f9899d
Removing note for object c0945c99795662e0e55e188d3ab36f599b92aa8c
Removing note for object a1591c0212bc193cd6c8b1e38fa214078fad6533
[test-funny 428eba9] funny
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 funny.t
Removing note for object 485e2fa969f41fe446bfcc690d40eef68cc9658c
Removing note for object 380fbe740d51646342dedd80455e677efeab2606
Removing note for object caf193eed10e30dd698b64dff9ba95806daafeae
Removing note for object 4f7bcc29fe25fd03d0afe5122d2f23a494c2de92
Removing note for object 9875586f495475e0e2fe207ca60195ab1e4940bb
Removing note for object bbadc53dcdce0f607d09db9e301f118cf237a5c9
Removing note for object b235894482a0797fcecfe914ca809bd3d255ae71
Removing note for object 93014e8e87513c4c558a587e1c7d2660634ab631
Removing note for object acbd6300f13fee70a9367c9309f0c146a3262b85
Removing note for object 8177b71f61145307c45925d05b6a26c93671d84b
Removing note for object 7add7e518355f216f1f6cddbcbe5f9fa4dc77d6b
First, rewinding head to replay your work on top of it...
Removing note for object 1ef81327895ea6e4f19fc4132285728f8ea9a61f
Removing note for object 73c20b17fe7874494e3c77c21275c898d56f193d
Removing note for object d8972d68d0e3db75ce9aaf8c54ba5abdc496b6fd
Removing note for object 9f89917ff75e84e3e858585f2da4319cec352d81
Merging master with HEAD~0
Merging:
42d45b9 master updates a bit more.
428eba9 funny
found 1 common ancestor:
f335ad0 master updates a bit.
Removing note for object 6a89826cac65ff99275d8901dc4c25e492982af3
Removing note for object 8bb15e65b3991d361f5c8b300993fb47ab5d84e8
[detached HEAD 2b88f1d] funny
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 funny.t
Removing note for object d16b7b8a64a6b7f041215854711b3bf2c72a77f0
Committed: 0001 funny
Removing note for object 4cfa50d5d4837bc47ddfb0a8304447534769c169
Removing note for object 14fdf2369ba07615c54aa799c639041cb0851572
Removing note for object d26fc2348f9457757a0f1d0d67e7bcfee25c7631
All done.
Removing note for object 0c2d2f03d0600d5eaccd2dbed6717274ba8d43a2
ok 10 - rebase -s funny -Xopt

expecting success: 
	git checkout second-side  &&
	tr "[A-Z]" "[a-z]" <newfile >tmp &&
	mv tmp newfile &&
	git commit -a -m"edit conflicting with side" &&
	tr "[d-f]" "[D-F]" <newfile >tmp &&
	mv tmp newfile &&
	git commit -a -m"another edit conflicting with side" &&
	test_must_fail git rebase --merge test-conflicts &&
	test_must_fail git rebase --skip &&
	git rebase --skip

Removing note for object 3c1d753e385fa868514c439438e94de3da1473c4
Switched to branch 'second-side'
Removing note for object cc8047bae109bb33b1b67a5e9c6198a0f71178e6
Removing note for object 5ae9ca25b6fc42e14aa0695a2678065afc3db3f4
[second-side 917af6a] edit conflicting with side
 Author: A U Thor <author@example.com>
 1 file changed, 20 insertions(+), 20 deletions(-)
 rewrite newfile (100%)
Removing note for object 989815f696ed2ee03e461bc4aedce119cccbdb67
Removing note for object 6742814c2a98f4c2de209034e9f06bfcf4b9e563
ok 22 - test notes in 2/2/36-fanout concatenated with 2/2/2/34-fanout

expecting success: verify_concatenated_notes
[second-side df146bb] another edit conflicting with side
 Author: A U Thor <author@example.com>
 1 file changed, 20 insertions(+), 20 deletions(-)
 rewrite newfile (100%)
Removing note for object 659c73affbf54496483ef3b88fb099872ff2c6c3
Removing note for object 4bb6de84877eb87d499d9ad9a8ee0ab3b3cc02e3
Removing note for object f7b11911f4739b270cb2147aeeef10454234817f
Removing note for object 4aa6bf04bdc1a050c658b9ed7a463285302531a5
Removing note for object 798b896992bd4432404bcc77476b5664a73a4fd5
ok 23 - verify notes in 2/2/36-fanout concatenated with 2/2/2/34-fanout

# passed all 23 test(s)
1..23
Removing note for object ff7d168602a59c57ece46da1fd8cc6f12c9de54b
Removing note for object 9f027ed6e69c7b0067303a3bf57977f0c90c693c
Removing note for object d726ae3816b7977b48b19bfdd1d1cb51b645b418
Removing note for object 048de3e70ecf601e0e3038f1435eb7a6591effc0
First, rewinding head to replay your work on top of it...
Removing note for object 61357f089446a216f83d1e926e2fa2bfea6c8e01
*** t3403-rebase-skip.sh ***
Removing note for object d44207e76cfdfa5f111a7a3ed6cad3989e627bdf
Removing note for object 2ad68764e49946ef164b5bccd452428096f61174
Removing note for object 13897d2b6067286c9904cbea9d03fff5755a46b3
Merging test-conflicts with HEAD~1
Merging:
a2923b0 side edits once again.
917af6a edit conflicting with side
found 1 common ancestor:
e531600 side edits further.
Auto-merging newfile
CONFLICT (content): Merge conflict in newfile

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3403-rebase-skip/.git/
Removing note for object 58ce609a332186c88af1324ae30ff11490c59595
expecting success: 
	echo hello > hello &&
	git add hello &&
	git commit -m "hello" &&
	git branch skip-reference &&

	echo world >> hello &&
	git commit -a -m "hello world" &&
	echo goodbye >> hello &&
	git commit -a -m "goodbye" &&

	git checkout -f skip-reference &&
	echo moo > hello &&
	git commit -a -m "we should skip this" &&
	echo moo > cow &&
	git add cow &&
	git commit -m "this should not be skipped" &&
	git branch pre-rebase skip-reference &&
	git branch skip-merge skip-reference
	
Removing note for object 43af7ee63538db2151a1341b71a9f77de73aee67
Removing note for object 9f9992f0edd96c5ea639acf77d9e5b34d7b5ee86
[master (root-commit) 7a95b69] hello
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 hello
Removing note for object 9e55ec3cc97444141551079f461c5166c4f490b8
Removing note for object 3284ff763e2cb720085cf0ce868f3e5fb92b489b
[master b68a7f2] hello world
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Removing note for object 9d7d752892d8e0e8b8f9f1978e5987388003f039
Removing note for object 97ebdcc0635a179a2a610c41edda8a79197757dd
[master cda9a63] goodbye
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Removing note for object 5de5ca14df95545379cb2c270977c7169b5d8e00
Switched to branch 'skip-reference'
Removing note for object 15ce6550074713a3779b0faee4c91c7788f2b8d0
[skip-reference 2827744] we should skip this
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Removing note for object 4c9c25c1c9231a38d7fd72574f0c18096fa08778
Merging test-conflicts with HEAD~0
Merging:
a2923b0 side edits once again.
df146bb another edit conflicting with side
found 1 common ancestor:
917af6a edit conflicting with side
Auto-merging newfile
CONFLICT (content): Merge conflict in newfile

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Removing note for object 1ab52ac18c59bff8c14a04b68b6ae1dc5d3500af
[skip-reference 5768055] this should not be skipped
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 cow
Removing note for object b5016129acfddf7f6b6c7b38b846c73904e8d730
Removing note for object 2604195b51dd30fdfb0735d7a75e28f6a83750d6
ok 1 - setup

expecting success: 
	test_must_fail git rebase master

Removing note for object 88647f9a79013152b0f22d19bf65a26428199dcd
Removing note for object eb172f669f5ab6afeff671a04ebbe1ff73b23b5b
Removing note for object f7fc92137d90956060ca13be2b51d606074e8bad
Removing note for object b8734aad512081134bb2d2c7beb30886a526750b
Removing note for object 3ced41967bcc7724cbe8b20fdb5dbb68d2d5b737
Removing note for object 2e27720e46e1a55de5d19437ff9efcc34dc4ea31
All done.
Removing note for object 82c68076b3ad95450772a3fcd5d637b4ce6c771b
ok 11 - rebase --skip works with two conflicts in a row

# passed all 11 test(s)
1..11
Removing note for object 4fe43a72413f0480b78c7d2f429190f260cf8322
Removing note for object 43d64298e033e7f2e13d8e481dd5daa0116e07ef
First, rewinding head to replay your work on top of it...
Removing note for object a648f0737cfa015e29f067edca76d783681c4a85
*** t3404-rebase-interactive.sh ***
Removing note for object 64fe931feaf50a6b1faa2cc2e33d193b7d1b84ca
Removing note for object 2ca4619fe11731a2b91f5dffc6f40ea568d16c9f
Applying: we should skip this
Removing note for object 8fc47225e1642ef62782a484248e5f9616fb1f44
Using index info to reconstruct a base tree...
M	hello
Removing note for object ca9a31a763907e395d7a4e18336933a56e26d2f6
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3404-rebase-interactive/.git/
Falling back to patching base and 3-way merge...
expecting success: 
	test_commit A file1 &&
	test_commit B file1 &&
	test_commit C file2 &&
	test_commit D file1 &&
	test_commit E file3 &&
	git checkout -b branch1 A &&
	test_commit F file4 &&
	test_commit G file1 &&
	test_commit H file5 &&
	git checkout -b branch2 F &&
	test_commit I file6 &&
	git checkout -b conflict-branch A &&
	test_commit one conflict &&
	test_commit two conflict &&
	test_commit three conflict &&
	test_commit four conflict &&
	git checkout -b no-conflict-branch A &&
	test_commit J fileJ &&
	test_commit K fileK &&
	test_commit L fileL &&
	test_commit M fileM &&
	git checkout -b no-ff-branch A &&
	test_commit N fileN &&
	test_commit O fileO &&
	test_commit P fileP

Removing note for object 907b908cd3d9b08d2622734acb5a609b4c28e725
Merging cda9a6367105450ba5ab87d3fe5be330613b3180 with we should skip this
Merging:
cda9a63 goodbye
virtual we should skip this
found 1 common ancestor:
virtual b4d01e9b0c4a9356736dfddf8830ba9a54f5271c
Auto-merging hello
CONFLICT (content): Merge conflict in hello
error: Failed to merge in the changes.
Patch failed at 0001 we should skip this
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

ok 2 - rebase with git am -3 (default)

expecting success: 
	test_must_fail git rebase -v --skip &&
	test_must_fail git rebase --skip -v

Removing note for object 5518deeb20ed2e51705967f65ab6bafc51724a6a
[master (root-commit) 6e62bf8] A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file1
Removing note for object 53d4c9839624d3781a7715bf748ca74b65e594ec
Removing note for object 8ec05e9f1292feb78fbddb75abdc832080e3c81a
Removing note for object 052dc1876538654b80b4b2accad5802c1ba2e989
[master 313fe96] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Removing note for object ab54081944bdc0c75584c0abb73e68a652cc1061
usage: git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] [<upstream>] [<branch>]
   or: git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] --root [<branch>]
   or: git-rebase --continue | --abort | --skip | --edit-todo

Available options are
    -v, --verbose         display a diffstat of what changed upstream
    -q, --quiet           be quiet. implies --no-stat
    --autostash           automatically stash/stash pop before and after
    --fork-point          use 'merge-base --fork-point' to refine upstream
    --onto ...            rebase onto given branch instead of upstream
    -p, --preserve-merges
                          try to recreate merges instead of ignoring them
    -s, --strategy ...    use the given merge strategy
    --no-ff               cherry-pick all commits, even if unchanged
    -m, --merge           use merging strategies to rebase
    -i, --interactive     let the user edit the list of commits to rebase
    -x, --exec ...        add exec lines after each commit of the editable list
    -k, --keep-empty	     preserve empty commits during rebase
    -f, --force-rebase    force rebase even if branch is up to date
    -X, --strategy-option ...
                          pass the argument through to the merge strategy
    --stat                display a diffstat of what changed upstream
    -n, --no-stat         do not show diffstat of what changed upstream
    --verify              allow pre-rebase hook to run
    --rerere-autoupdate   allow rerere to update index with resolved conflicts
    --root                rebase all reachable commits up to the root(s)
    --autosquash         move commits that begin with squash
                          move commits that begin with squash!/fixup! under -i
    --committer-date-is-author-date
                          passed to 'git am'
    --ignore-date         passed to 'git am'
    --whitespace ...      passed to 'git apply'
    --ignore-whitespace   passed to 'git apply'
    -C ...                passed to 'git apply'
    -S, --gpg-sign[=...]  GPG-sign commits

Actions:
    --continue            continue
    --abort               abort and check out the original branch
    --skip                skip current patch and continue
    --edit-todo           edit the todo list during an interactive rebase

Removing note for object ce5880a3135a30a6ddf964d6cd42ca46a282d214
[master d0f65f2] C
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file2
Removing note for object f6918e5940e3141d1673ca7df7e6cf0045dcaec0
Removing note for object 848b6059f11ca83d3d46366bf6530065ddd639a4
[master 0547e3f] D
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Removing note for object bea0c28c009f310c2ba45833c0e32d84a86215ce
Removing note for object 04fc9a8e454da77881614184c95bb931398584d5
usage: git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] [<upstream>] [<branch>]
   or: git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] --root [<branch>]
   or: git-rebase --continue | --abort | --skip | --edit-todo

Available options are
    -v, --verbose         display a diffstat of what changed upstream
    -q, --quiet           be quiet. implies --no-stat
    --autostash           automatically stash/stash pop before and after
    --fork-point          use 'merge-base --fork-point' to refine upstream
    --onto ...            rebase onto given branch instead of upstream
    -p, --preserve-merges
                          try to recreate merges instead of ignoring them
    -s, --strategy ...    use the given merge strategy
    --no-ff               cherry-pick all commits, even if unchanged
    -m, --merge           use merging strategies to rebase
    -i, --interactive     let the user edit the list of commits to rebase
    -x, --exec ...        add exec lines after each commit of the editable list
    -k, --keep-empty	     preserve empty commits during rebase
    -f, --force-rebase    force rebase even if branch is up to date
    -X, --strategy-option ...
                          pass the argument through to the merge strategy
    --stat                display a diffstat of what changed upstream
    -n, --no-stat         do not show diffstat of what changed upstream
    --verify              allow pre-rebase hook to run
    --rerere-autoupdate   allow rerere to update index with resolved conflicts
    --root                rebase all reachable commits up to the root(s)
    --autosquash         move commits that begin with squash
                          move commits that begin with squash!/fixup! under -i
    --committer-date-is-author-date
                          passed to 'git am'
    --ignore-date         passed to 'git am'
    --whitespace ...      passed to 'git apply'
    --ignore-whitespace   passed to 'git apply'
    -C ...                passed to 'git apply'
    -S, --gpg-sign[=...]  GPG-sign commits

Actions:
    --continue            continue
    --abort               abort and check out the original branch
    --skip                skip current patch and continue
    --edit-todo           edit the todo list during an interactive rebase

ok 3 - rebase --skip can not be used with other options

expecting success: 
	git rebase --skip
	
Removing note for object 05033398c05e56c4bee8b9fb5a9964b418c3fe53
[master 8f99a4f] E
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file3
Removing note for object 4338039a875b7a347faf47e0125b3bd521ec37b1
Removing note for object 53fb7902d8eb93a97c4c468e0a9ec26e02181094
Switched to a new branch 'branch1'
Removing note for object 492fb8bd8e511f684cf4814163968ba41f21bd6a
Removing note for object 34238bfe26b514f16d3642360e06e2f8caf93d01
[branch1 cfefd94] F
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file4
Removing note for object a662cb6d2bf390f731cb48b4b5b9fc255704bd51
Removing note for object 994bf981ffdb4aec475cf4698071f4e5bc9a5f5c
Removing note for object fd1833ffb225f021e6b780ade6719dedfdac03f7
[branch1 83751a6] G
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Applying: this should not be skipped
Removing note for object 1e008ec90a144c1a55d67d4182546f2a76f5aaf4
Removing note for object 28c48c82afe4d61f7ffb90a0d0525fcd12a6b733
Removing note for object b23a388efbde108d2ff7b49e7d713248f6b13934
[branch1 4373208] H
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file5
Removing note for object 7a18c00c2fd401cbd5a173627bf8a323fa5093b1
ok 4 - rebase --skip with am -3

expecting success: 
	test refs/heads/skip-reference = $(git symbolic-ref HEAD) &&
	git branch post-rebase &&
	git reset --hard pre-rebase &&
	test_must_fail git rebase master &&
	echo "hello" > hello &&
	git add hello &&
	git rebase --continue &&
	test refs/heads/skip-reference = $(git symbolic-ref HEAD) &&
	git reset --hard post-rebase

Removing note for object e141ba47d7bc5af5494826f331dcf478f515c832
Switched to a new branch 'branch2'
Removing note for object 501c5a2632fe9b5910bbd36b7e10f21939112cd5
HEAD is now at 5768055 this should not be skipped
Removing note for object fa72dea14c026dadb9a6a5478b1c66e1753d7387
[branch2 615be62] I
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file6
Removing note for object 3e8a170967bf4d0f1175761fb9e83fe457e1490c
Switched to a new branch 'conflict-branch'
Removing note for object 224d2db2986a7a1e23059bbd0c13d9f38d24b5ad
Removing note for object 69120f7a0bd6104a678d99f0622af9a5afeaa4a1
[conflict-branch b895952] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 conflict
Removing note for object 87317dba836b40f673606bc458cfcb32f6444b77
Removing note for object c3fe4ddece9187a9b48e2e8a1d91c36d68a361a5
[conflict-branch 766a798] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Removing note for object 37c6de9471b2b749fc14c943b27b4f49578bd709
Removing note for object 5604fa1ee57e2caed9fa477488e882ecbe760d4d
First, rewinding head to replay your work on top of it...
[conflict-branch 1eadf03] three
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Removing note for object 7dae2e0002c87a78e8f4bd9874ed40f0c63d5ac2
Removing note for object ce653ed06af737ed15666e87968d6d62150bdbc3
Removing note for object b8ccff7802b95043ac522363ef387d15b8024708
[conflict-branch f91a2b3] four
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Removing note for object 6e508180802c403e32d37352623fc7d430484fd4
Applying: we should skip this
Switched to a new branch 'no-conflict-branch'
Removing note for object 976918c7ebcbbfeaf6c7a4089093a4684c53d7a7
Using index info to reconstruct a base tree...
M	hello
Falling back to patching base and 3-way merge...
Removing note for object 6c422f13003f2cfc5be8d515711009c31c02b189
Merging cda9a6367105450ba5ab87d3fe5be330613b3180 with we should skip this
Merging:
cda9a63 goodbye
virtual we should skip this
found 1 common ancestor:
virtual b4d01e9b0c4a9356736dfddf8830ba9a54f5271c
Auto-merging hello
CONFLICT (content): Merge conflict in hello
error: Failed to merge in the changes.
Patch failed at 0001 we should skip this
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

[no-conflict-branch 808874f] J
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 fileJ
Removing note for object 9a04cd31480e2602f44a1e74c33ae5c605ac5147
Removing note for object 957391d2c69845865b4f122f079900fbf823c2b7
[no-conflict-branch 265b89e] K
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 fileK
Removing note for object 0cd299e45bb4709ea1cb36f7aa67ec00488a0b7e
Removing note for object c34b5de2070bd5f59dc615ed22a045fc24209d68
[no-conflict-branch 6b0f5e6] L
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 fileL
Removing note for object 679b38877386a772d1fb54e55b74973ff5fadf26
Removing note for object c426f6599dc64f513890687cee6659e9f2326e03
Removing note for object 32f64a7a74308a88f26076eb863d7e1cc25db7ed
Applying: we should skip this
Applying: this should not be skipped
[no-conflict-branch 3389558] M
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 fileM
Removing note for object c515cdc10146949a121ec7d5a333c757e4ef2504
Switched to a new branch 'no-ff-branch'
Removing note for object cfc4917130f2cc2681956507da1e1fe4b2f15527
Removing note for object 887a830a1766dc64123467ef38c1a1f809c2cefe
[no-ff-branch 53b4423] N
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 fileN
Removing note for object 34481f2ed4378c94bcdccfc1456e59d179e244a9
HEAD is now at 2f4126e this should not be skipped
ok 5 - rebase moves back to skip-reference

expecting success: git checkout -f skip-merge
Removing note for object 2eb6a7cd807a4293fd35648c75044216ccc6ae80
Switched to branch 'skip-merge'
ok 6 - checkout skip-merge

expecting success: 
	test_must_fail git rebase --merge master

[no-ff-branch cc47714] O
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 fileO
Removing note for object 172059174199b4e733e3223b94adfe1ba0214952
Removing note for object 2ea9f2ed864e157d1c0e6048777c57a0ac2e54d3
[no-ff-branch faef1a5] P
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 fileP
Removing note for object 95a216b87992cc1c0f9fbf9fcb8a79e1586d195c
ok 1 - setup

expecting success: 
	git checkout -b emptybranch master &&
	git commit --allow-empty -m "empty" &&
	git rebase --keep-empty -i HEAD~2 &&
	git log --oneline >actual &&
	test_line_count = 6 actual

Removing note for object c2a2268ec9f704fcc2a006504fc5ec7bfe76e94e
Switched to a new branch 'emptybranch'
Removing note for object 343c6341ea84792314deda891657ed8739e3fada
[emptybranch da33401] empty
 Author: A U Thor <author@example.com>
Removing note for object 849eb8f361d17186b71830fbe22b79586058eb74
Removing note for object 7835bffb91c2a59efb1bdabc64404985c235d09f
Removing note for object 0ef965de1ea8542ee31d00d15786e2b94410221e
Removing note for object b68e409dd76226bd14f7dcaddeb437f827a318e2
First, rewinding head to replay your work on top of it...
Removing note for object 988c9859a3b58b94be180a5a563aca9df5b79a37
Removing note for object 7b305811b52ca742180d3fd835f2bbae83c04eec
Removing note for object f131f5a4bc07b251f6e9267c9100610cb3ca5559
Removing note for object 83e55281b21b8461ac450f9ce29cf0939abf5cfc
Merging master with HEAD~1
Merging:
cda9a63 goodbye
2827744 we should skip this
found 1 common ancestor:
7a95b69 hello
Auto-merging hello
CONFLICT (content): Merge conflict in hello

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Removing note for object 601bc579d928b5220982f41ec9a3d732363bdaba
ok 7 - rebase with --merge

expecting success: 
	git rebase --skip

Removing note for object f4744725293c0fb2a7f9c9445fd24adc8f88d5b1
Removing note for object 8a835fbbd02d3ab4f84e6597549382bc195ff397
Removing note for object f391efbe8795fa919a06c97e7c233c331ffb0316
Removing note for object 0df0388f3e81567589dd986e41d615356de703d7
Removing note for object 8ac95266183ec39c83f380a140e3abac5f33725a
Removing note for object c4720417ad9d861573974413a6215765dfab901c
Removing note for object 8d4fc83d3fdb22818f90e6ea7d88979474f49f02
Removing note for object edbea587c93ce562ba9ab42ff6d308daf84894e8
Merging master with HEAD~0
Merging:
cda9a63 goodbye
5768055 this should not be skipped
found 1 common ancestor:
2827744 we should skip this
Removing note for object 450aa4b2a6e7238f5ef8a18930e9574ecc570ad0
Removing note for object 23567c85eb402f9b30792bfc0bbb82d295b498bb
[detached HEAD fad1bfd] this should not be skipped
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:51:17 2015 +0000
 1 file changed, 1 insertion(+)
 create mode 100644 cow
Removing note for object 5260386902a703f76811d1bf0a794cf9fb0ac999
Committed: 0002 this should not be skipped
Removing note for object 8021bdbd7fd57e8dcb8644b85909739ccfe98e36
Removing note for object 2d537957e4d7a68077c05cb626afadccd1328158
Removing note for object cee1681393ad01c2c9c6f3f701570ec46237453b
All done.
Removing note for object cbb9ea240225a17164edb02ffdbaf7e23b8a0786
ok 8 - rebase --skip with --merge

expecting success: 
	test -z "`git diff-tree skip-merge skip-reference`"

Removing note for object 392e37fca867d463085bd2345a112cdb157a8369
ok 9 - merge and reference trees equal

expecting success: 
	test refs/heads/skip-merge = $(git symbolic-ref HEAD)

ok 10 - moved back to branch correctly

Removing note for object d8793dcb744793954696daf2188c04060523a1c0
# passed all 10 test(s)
1..10
ok 4 - deleting most notes with git-notes

expecting success: 
	git log HEAD~250 | grep "^    " > output &&
	i=50 &&
	while test $i -gt 0
	do
		echo "    commit #$i" &&
		echo "    note #$i" &&
		i=$(($i - 1));
	done > expect &&
	test_cmp expect output

*** t3405-rebase-malformed.sh ***
Rebasing (2/2)
ok 5 - most notes deleted correctly with git-notes

expecting success: 
	# Expect entire notes tree to have a fanout == 0
	git ls-tree -r --name-only refs/notes/commits |
	while read path
	do
		case "$path" in
		????????????????????????????????????????)
			: true
			;;
		*)
			echo "Invalid path \"$path\"" &&
			return 1
			;;
		esac
	done

Successfully rebased and updated refs/heads/emptybranch.
ok 6 - deleting most notes triggers fanout consolidation

# passed all 6 test(s)
1..6
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3405-rebase-malformed/.git/
ok 2 - rebase --keep-empty

expecting success: 
	git checkout master &&
	(
	set_fake_editor &&
	FAKE_LINES="1 exec_>touch-one
		2 exec_>touch-two exec_false exec_>touch-three
		3 4 exec_>\"touch-file__name_with_spaces\";_>touch-after-semicolon 5" &&
	export FAKE_LINES &&
	test_must_fail git rebase -i A
	) &&
	test_path_is_file touch-one &&
	test_path_is_file touch-two &&
	test_path_is_missing touch-three " (should have stopped before)" &&
	test_cmp_rev C HEAD &&
	git rebase --continue &&
	test_path_is_file touch-three &&
	test_path_is_file "touch-file  name with spaces" &&
	test_path_is_file touch-after-semicolon &&
	test_cmp_rev master HEAD &&
	rm -f touch-*

expecting success: 

	>file1 &&
	>file2 &&
	git add file1 file2 &&
	test_tick &&
	git commit -m "Initial commit" &&
	git branch diff-in-message &&

	git checkout -b multi-line-subject &&
	cat F >file2 &&
	git add file2 &&
	test_tick &&
	git commit -F F &&

	git cat-file commit HEAD | sed -e "1,/^\$/d" >F0 &&

	git checkout diff-in-message &&
	echo "commit log message containing a diff" >G &&
	echo "" >>G &&
	cat G >file2 &&
	git add file2 &&
	git diff --cached >>G &&
	test_tick &&
	git commit -F G &&

	git cat-file commit HEAD | sed -e "1,/^\$/d" >G0 &&

	git checkout master &&

	echo One >file1 &&
	test_tick &&
	git add file1 &&
	git commit -m "Second commit"

Switched to branch 'master'
[master (root-commit) a8d727e] Initial commit
 Author: A U Thor <author@example.com>
 2 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file1
 create mode 100644 file2
Switched to a new branch 'multi-line-subject'
[multi-line-subject 5037af6] This is an example of a commit log message that does not  conform to git commit convention.
 Author: A U Thor <author@example.com>
 1 file changed, 5 insertions(+)
Switched to branch 'diff-in-message'
[diff-in-message 132c17c] commit log message containing a diff
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+)
Switched to branch 'master'
[master d5181bc] Second commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 1 - setup

expecting success: 

	git rebase master multi-line-subject &&
	git cat-file commit HEAD | sed -e "1,/^\$/d" >F1 &&

	test_cmp F0 F1 &&
	test_cmp F F0

First, rewinding head to replay your work on top of it...
Applying: This is an example of a commit log message
rebase -i script before editing:
pick 313fe96 B
pick d0f65f2 C
pick 0547e3f D
pick 8f99a4f E

ok 2 - rebase commit with multi-line subject

expecting success: 
	git rebase master diff-in-message &&
	git cat-file commit HEAD | sed -e "1,/^$/d" >G1 &&
	test_cmp G0 G1 &&
	test_cmp G G0

rebase -i script after editing:
pick 313fe96 B
exec >touch-one
pick d0f65f2 C
exec >touch-two
exec false
exec >touch-three
pick 0547e3f D
pick 8f99a4f E
exec >"touch-file  name with spaces"; >touch-after-semicolon
First, rewinding head to replay your work on top of it...
Rebasing (2/9)
Executing: >touch-one
Applying: commit log message containing a diff
*** t3406-rebase-message.sh ***
Rebasing (3/9)
ok 3 - rebase commit with diff in message

# passed all 3 test(s)
1..3
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3406-rebase-message/.git/
*** t3407-rebase-abort.sh ***
expecting success: 
	test_commit O fileO &&
	test_commit X fileX &&
	test_commit A fileA &&
	test_commit B fileB &&
	test_commit Y fileY &&

	git checkout -b topic O &&
	git cherry-pick A B &&
	test_commit Z fileZ &&
	git tag start

[master (root-commit) 3749684] O
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 fileO
Rebasing (4/9)
Executing: >touch-two
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3407-rebase-abort/.git/
expecting success: 
	mkdir -p "$work_dir" &&
	cd "$work_dir" &&
	git init &&
	echo a > a &&
	git add a &&
	git commit -m a &&
	git branch to-rebase &&

	echo b > a &&
	git commit -a -m b &&
	echo c > a &&
	git commit -a -m c &&

	git checkout to-rebase &&
	echo d > a &&
	git commit -a -m "merge should fail on this" &&
	echo e > a &&
	git commit -a -m "merge should fail on this, too" &&
	git branch pre-rebase

[master a2df67f] X
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 fileX
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3407-rebase-abort/test dir/.git/
Rebasing (5/9)
Executing: false
[master 9491ce3] A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 fileA
[master (root-commit) 16eae43] a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a
Execution failed: false
You can fix the problem, and then run

	git rebase --continue

[master 83a6553] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 fileB
[master 097245c] b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master e01197e] c
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 545b0d0] Y
Switched to branch 'to-rebase'
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 fileY
[to-rebase dae85a3] merge should fail on this
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'topic'
[to-rebase ec25acb] merge should fail on this, too
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - setup

expecting success: 
		cd "$work_dir" &&
		# Clean up the state from the previous one
		git reset --hard pre-rebase &&
		test_must_fail git rebase$type master &&
		test_path_is_dir "$dotest" &&
		git rebase --abort &&
		test $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&
		test ! -d "$dotest"
	
[topic 80ec5e8] A
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 fileA
HEAD is now at ec25acb merge should fail on this, too
[topic 4ff7882] B
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 fileB
[topic dd88760] Z
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 fileZ
Rebasing (6/9)
Executing: >touch-three
ok 1 - setup

expecting success: 
	git rebase -m master >report &&
	sed -n -e "/^Already applied: /p" \
		-e "/^Committed: /p" report >actual &&
	test_cmp expect actual

Rebasing (7/9)
First, rewinding head to replay your work on top of it...
Applying: merge should fail on this
Rebasing (8/9)
Using index info to reconstruct a base tree...
M	a
Falling back to patching base and 3-way merge...
Merging e01197edca8822c9901cc2c172848ba3acd44e68 with merge should fail on this
Merging:
e01197e c
virtual merge should fail on this
found 1 common ancestor:
virtual aaff74984cccd156a469afa7d9ab10e4777beb24
Auto-merging a
CONFLICT (content): Merge conflict in a
error: Failed to merge in the changes.
Patch failed at 0001 merge should fail on this
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Rebasing (9/9)
Executing: >"touch-file  name with spaces"; >touch-after-semicolon
Successfully rebased and updated refs/heads/master.
ok 2 - rebase --abort

expecting success: 
		cd "$work_dir" &&
		# Clean up the state from the previous one
		git reset --hard pre-rebase &&
		test_must_fail git rebase$type master &&
		test_path_is_dir "$dotest" &&
		test_must_fail git rebase --skip &&
		test $(git rev-parse HEAD) = $(git rev-parse master) &&
		git rebase --abort &&
		test $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&
		test ! -d "$dotest"
	
HEAD is now at ec25acb merge should fail on this, too
ok 3 - rebase -i with the exec command

expecting success: 
	git checkout master &&
	mkdir subdir && (cd subdir &&
	set_fake_editor &&
	FAKE_LINES="1 exec_>touch-subdir" \
		git rebase -i HEAD^
	) &&
	test_path_is_file touch-subdir &&
	rm -fr subdir

Already on 'master'
ok 2 - rebase -m

expecting success: 
	git rebase master >out &&
	test_i18ngrep "Current branch topic is up to date" out

First, rewinding head to replay your work on top of it...
Applying: merge should fail on this
Using index info to reconstruct a base tree...
M	a
Falling back to patching base and 3-way merge...
Merging e01197edca8822c9901cc2c172848ba3acd44e68 with merge should fail on this
Merging:
e01197e c
virtual merge should fail on this
found 1 common ancestor:
virtual aaff74984cccd156a469afa7d9ab10e4777beb24
Auto-merging a
CONFLICT (content): Merge conflict in a
error: Failed to merge in the changes.
Patch failed at 0001 merge should fail on this
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Current branch topic is up to date.
ok 3 - rebase against master twice

expecting success: 
	git rebase --force-rebase master >out &&
	test_i18ngrep "Current branch topic is up to date, rebase forced" out

Applying: merge should fail on this, too
rebase -i script before editing:
pick 8f99a4f E

Using index info to reconstruct a base tree...
M	a
rebase -i script after editing:
pick 8f99a4f E
exec >touch-subdir
Falling back to patching base and 3-way merge...
Merging e01197edca8822c9901cc2c172848ba3acd44e68 with merge should fail on this, too
Merging:
e01197e c
virtual merge should fail on this, too
found 1 common ancestor:
virtual f788de73cfc81f8d734fa7efc658cc63ca083f50
Auto-merging a
CONFLICT (content): Merge conflict in a
error: Failed to merge in the changes.
Patch failed at 0002 merge should fail on this, too
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Rebasing (2/2)
Executing: >touch-subdir
Current branch topic is up to date, rebase forced.
ok 4 - rebase against master twice with --force

expecting success: 
	git checkout topic^ &&
	git rebase master topic >out &&
	test_i18ngrep "Current branch topic is up to date" out

Note: checking out 'topic^'.

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 545b0d0... Y
Successfully rebased and updated refs/heads/master.
ok 3 - rebase --abort after --skip

expecting success: 
		cd "$work_dir" &&
		# Clean up the state from the previous one
		git reset --hard pre-rebase &&
		test_must_fail git rebase$type master &&
		test_path_is_dir "$dotest" &&
		echo c > a &&
		echo d >> a &&
		git add a &&
		test_must_fail git rebase --continue &&
		test $(git rev-parse HEAD) != $(git rev-parse master) &&
		git rebase --abort &&
		test $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&
		test ! -d "$dotest"
	
ok 4 - rebase -i with the exec command runs from tree root

expecting success: 
	git checkout master &&
	set_fake_editor &&
	test_must_fail env FAKE_LINES="exec_echo_foo_>file1 1" git rebase -i HEAD^ &&
	test_cmp_rev master^ HEAD &&
	git reset --hard &&
	git rebase --continue

HEAD is now at ec25acb merge should fail on this, too
Already on 'master'
First, rewinding head to replay your work on top of it...
Current branch topic is up to date.
ok 5 - rebase against master twice from another branch

expecting success: 
	git checkout topic^ &&
	git rebase topic >out &&
	test_i18ngrep "Fast-forwarded HEAD to topic" out

Note: checking out 'topic^'.

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 545b0d0... Y
Applying: merge should fail on this
Using index info to reconstruct a base tree...
M	a
Falling back to patching base and 3-way merge...
Merging e01197edca8822c9901cc2c172848ba3acd44e68 with merge should fail on this
Merging:
e01197e c
virtual merge should fail on this
found 1 common ancestor:
virtual aaff74984cccd156a469afa7d9ab10e4777beb24
Auto-merging a
CONFLICT (content): Merge conflict in a
error: Failed to merge in the changes.
Patch failed at 0001 merge should fail on this
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

rebase -i script before editing:
pick 8f99a4f E

rebase -i script after editing:
exec echo foo >file1
pick 8f99a4f E
Fast-forwarded HEAD to topic.
ok 6 - rebase fast-forward to master

expecting success: 
	git reset --hard start &&
        git rebase --stat master >diffstat.txt &&
        grep "^ fileX |  *1 +$" diffstat.txt

Applying: merge should fail on this
Applying: merge should fail on this, too
HEAD is now at dd88760 Z
Using index info to reconstruct a base tree...
M	a
Falling back to patching base and 3-way merge...
Merging 9103dd45867c5ccbb151fc0b0aff92ca67c06e01 with merge should fail on this, too
Merging:
9103dd4 merge should fail on this
virtual merge should fail on this, too
found 1 common ancestor:
virtual f788de73cfc81f8d734fa7efc658cc63ca083f50
Auto-merging a
CONFLICT (content): Merge conflict in a
error: Failed to merge in the changes.
Patch failed at 0002 merge should fail on this, too
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Rebasing (1/2)
Executing: echo foo >file1
Execution succeeded: echo foo >file1
but left changes to the index and/or the working tree
Commit or stash your changes, and then run

	git rebase --continue

HEAD is now at 0547e3f D
ok 4 - rebase --abort after --continue

expecting success: 
		cd "$work_dir" &&
		# Clean up the state from the previous one
		git reset --hard pre-rebase &&
		git reflog show to-rebase > reflog_before &&
		test_must_fail git rebase$type master &&
		git rebase --abort &&
		git reflog show to-rebase > reflog_after &&
		test_cmp reflog_before reflog_after &&
		rm reflog_before reflog_after
	
HEAD is now at ec25acb merge should fail on this, too
 fileX | 1 +
ok 7 - rebase --stat

expecting success: 
	git reset --hard start &&
        git config rebase.stat true &&
        git rebase master >diffstat.txt &&
        grep "^ fileX |  *1 +$" diffstat.txt

HEAD is now at dd88760 Z
Successfully rebased and updated refs/heads/master.
Rebasing (2/2)
First, rewinding head to replay your work on top of it...
ok 5 - rebase -i with the exec command checks tree cleanness

expecting success: 
	git checkout master &&
	test_when_finished "git rebase --abort" &&
	set_fake_editor &&
	test_must_fail env FAKE_LINES="exec_this-command-does-not-exist 1" \
	git rebase -i HEAD^ >actual 2>&1 &&
	! grep "Maybe git-rebase is broken" actual

Already on 'master'
Applying: merge should fail on this
Using index info to reconstruct a base tree...
M	a
Falling back to patching base and 3-way merge...
Merging e01197edca8822c9901cc2c172848ba3acd44e68 with merge should fail on this
Merging:
e01197e c
virtual merge should fail on this
found 1 common ancestor:
virtual aaff74984cccd156a469afa7d9ab10e4777beb24
Auto-merging a
CONFLICT (content): Merge conflict in a
error: Failed to merge in the changes.
Patch failed at 0001 merge should fail on this
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

 fileX | 1 +
ok 8 - rebase w/config rebase.stat

expecting success: 
	git reset --hard start &&
        git config rebase.stat true &&
        git rebase -n master >diffstat.txt &&
        ! grep "^ fileX |  *1 +$" diffstat.txt

HEAD is now at dd88760 Z
ok 5 - rebase --abort does not update reflog

expecting success: 
		cd "$work_dir" &&
		# Clean up the state from the previous one
		git reset --hard pre-rebase &&
		test_must_fail git rebase$type master &&
		test_must_fail git rebase -v --abort &&
		test_must_fail git rebase --abort -v &&
		git rebase --abort
	
HEAD is now at ec25acb merge should fail on this, too
ok 9 - rebase -n overrides config rebase.stat config

expecting success: 
	test_must_fail git rebase --onto invalid-ref HEAD HEAD 2>err &&
	test_i18ngrep "invalid-ref" err

First, rewinding head to replay your work on top of it...
Applying: merge should fail on this
Using index info to reconstruct a base tree...
M	a
Does not point to a valid commit: invalid-ref
ok 10 - rebase --onto outputs the invalid ref

Falling back to patching base and 3-way merge...
# passed all 10 test(s)
1..10
Merging e01197edca8822c9901cc2c172848ba3acd44e68 with merge should fail on this
Merging:
e01197e c
virtual merge should fail on this
found 1 common ancestor:
virtual aaff74984cccd156a469afa7d9ab10e4777beb24
Auto-merging a
CONFLICT (content): Merge conflict in a
error: Failed to merge in the changes.
Patch failed at 0001 merge should fail on this
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

*** t3408-rebase-multi-line.sh ***
usage: git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] [<upstream>] [<branch>]
   or: git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] --root [<branch>]
   or: git-rebase --continue | --abort | --skip | --edit-todo

Available options are
    -v, --verbose         display a diffstat of what changed upstream
    -q, --quiet           be quiet. implies --no-stat
    --autostash           automatically stash/stash pop before and after
    --fork-point          use 'merge-base --fork-point' to refine upstream
    --onto ...            rebase onto given branch instead of upstream
    -p, --preserve-merges
                          try to recreate merges instead of ignoring them
    -s, --strategy ...    use the given merge strategy
    --no-ff               cherry-pick all commits, even if unchanged
    -m, --merge           use merging strategies to rebase
    -i, --interactive     let the user edit the list of commits to rebase
    -x, --exec ...        add exec lines after each commit of the editable list
    -k, --keep-empty	     preserve empty commits during rebase
    -f, --force-rebase    force rebase even if branch is up to date
    -X, --strategy-option ...
                          pass the argument through to the merge strategy
    --stat                display a diffstat of what changed upstream
    -n, --no-stat         do not show diffstat of what changed upstream
    --verify              allow pre-rebase hook to run
    --rerere-autoupdate   allow rerere to update index with resolved conflicts
    --root                rebase all reachable commits up to the root(s)
    --autosquash         move commits that begin with squash
                          move commits that begin with squash!/fixup! under -i
    --committer-date-is-author-date
                          passed to 'git am'
    --ignore-date         passed to 'git am'
    --whitespace ...      passed to 'git apply'
    --ignore-whitespace   passed to 'git apply'
    -C ...                passed to 'git apply'
    -S, --gpg-sign[=...]  GPG-sign commits

Actions:
    --continue            continue
    --abort               abort and check out the original branch
    --skip                skip current patch and continue
    --edit-todo           edit the todo list during an interactive rebase

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3408-rebase-multi-line/.git/
ok 6 - rebase -i with exec of inexistent command

expecting success: 
	git checkout branch2 &&
	set_fake_editor &&
	git rebase -i F &&
	test "$(git symbolic-ref -q HEAD)" = "refs/heads/branch2" &&
	test $(git rev-parse I) = $(git rev-parse HEAD)

expecting success: 

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

	echo hello >file &&
	test_tick &&
	git commit -a -m "A sample commit log message that has a long
summary that spills over multiple lines.

But otherwise with a sane description." &&

	git branch side &&

	git reset --hard HEAD^ &&
	>elif &&
	git add elif &&
	test_tick &&
	git commit -m second


Switched to branch 'branch2'
[master (root-commit) 1bd44cb] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file
[master 1708bf0] A sample commit log message that has a long summary that spills over multiple lines.
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
usage: git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] [<upstream>] [<branch>]
   or: git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] --root [<branch>]
   or: git-rebase --continue | --abort | --skip | --edit-todo

Available options are
    -v, --verbose         display a diffstat of what changed upstream
    -q, --quiet           be quiet. implies --no-stat
    --autostash           automatically stash/stash pop before and after
    --fork-point          use 'merge-base --fork-point' to refine upstream
    --onto ...            rebase onto given branch instead of upstream
    -p, --preserve-merges
                          try to recreate merges instead of ignoring them
    -s, --strategy ...    use the given merge strategy
    --no-ff               cherry-pick all commits, even if unchanged
    -m, --merge           use merging strategies to rebase
    -i, --interactive     let the user edit the list of commits to rebase
    -x, --exec ...        add exec lines after each commit of the editable list
    -k, --keep-empty	     preserve empty commits during rebase
    -f, --force-rebase    force rebase even if branch is up to date
    -X, --strategy-option ...
                          pass the argument through to the merge strategy
    --stat                display a diffstat of what changed upstream
    -n, --no-stat         do not show diffstat of what changed upstream
    --verify              allow pre-rebase hook to run
    --rerere-autoupdate   allow rerere to update index with resolved conflicts
    --root                rebase all reachable commits up to the root(s)
    --autosquash         move commits that begin with squash
                          move commits that begin with squash!/fixup! under -i
    --committer-date-is-author-date
                          passed to 'git am'
    --ignore-date         passed to 'git am'
    --whitespace ...      passed to 'git apply'
    --ignore-whitespace   passed to 'git apply'
    -C ...                passed to 'git apply'
    -S, --gpg-sign[=...]  GPG-sign commits

Actions:
    --continue            continue
    --abort               abort and check out the original branch
    --skip                skip current patch and continue
    --edit-todo           edit the todo list during an interactive rebase

HEAD is now at 1bd44cb initial
[master e79e348] second
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 elif
ok 1 - setup

expecting success: 

	git checkout side &&
	git rebase master &&
	git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
	git cat-file commit side@{1} | sed -e "1,/^\$/d" >expect &&
	test_cmp expect actual


Switched to branch 'side'
ok 6 - rebase --abort can not be used with other options

expecting success: 
		cd "$work_dir" &&
		# Clean up the state from the previous one
		git reset --hard pre-rebase &&
		test_must_fail git rebase$type master &&
		test_path_is_dir "$dotest" &&
		git rebase --abort &&
		test $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&
		test ! -d "$dotest"
	
HEAD is now at ec25acb merge should fail on this, too
First, rewinding head to replay your work on top of it...
Applying: A sample commit log message that has a long
First, rewinding head to replay your work on top of it...
ok 2 - rebase

# passed all 2 test(s)
1..2
Merging master with HEAD~1
Merging:
e01197e c
dae85a3 merge should fail on this
found 1 common ancestor:
16eae43 a
Auto-merging a
CONFLICT (content): Merge conflict in a
*** t3409-rebase-preserve-merges.sh ***

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Successfully rebased and updated refs/heads/branch2.
Rebasing (1/1)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3409-rebase-preserve-merges/.git/
expecting success: echo First > A &&
	git add A &&
	git commit -m "Add A1" &&
	git checkout -b topic &&
	echo Second > B &&
	git add B &&
	git commit -m "Add B1" &&
	git checkout -f master &&
	echo Third >> A &&
	git commit -a -m "Modify A2" &&
	echo Fifth > B &&
	git add B &&
	git commit -m "Add different B" &&

	git clone ./. clone2 &&
	(
		cd clone2 &&
		git checkout -b topic origin/topic &&
		test_must_fail git merge origin/master &&
		echo Resolved >B &&
		git add B &&
		git commit -m "Merge origin/master into topic"
	) &&

	git clone ./. clone3 &&
	(
		cd clone3 &&
		git checkout -b topic2 origin/topic &&
		echo Sixth > A &&
		git commit -a -m "Modify A3" &&
		git checkout -b topic origin/topic &&
		git merge --no-ff topic2
	) &&

	git clone ./. clone4 &&
	(
		cd clone4 &&
		git checkout -b topic2 origin/topic &&
		echo Sixth > A &&
		git commit -a -m "Modify A3" &&
		git checkout -b topic origin/topic &&
		git merge --no-ff topic2
	) &&

	git checkout topic &&
	echo Fourth >> B &&
	git commit -a -m "Modify B2"

ok 7 - no changes are a nop

expecting success: 
	git checkout -b dead-end &&
	git rm file6 &&
	git commit -m "stop here" &&
	set_fake_editor &&
	git rebase -i F branch2 &&
	test "$(git symbolic-ref -q HEAD)" = "refs/heads/branch2" &&
	test $(git rev-parse I) = $(git rev-parse branch2) &&
	test $(git rev-parse I) = $(git rev-parse HEAD)

Switched to a new branch 'dead-end'
[master (root-commit) 346d4d3] Add A1
 Author: A U Thor <bogus_email_address>
 1 file changed, 1 insertion(+)
 create mode 100644 A
rm 'file6'
Switched to a new branch 'topic'
[dead-end f814f58] stop here
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 file6
ok 7 - rebase --merge --abort

expecting success: 
		cd "$work_dir" &&
		# Clean up the state from the previous one
		git reset --hard pre-rebase &&
		test_must_fail git rebase$type master &&
		test_path_is_dir "$dotest" &&
		test_must_fail git rebase --skip &&
		test $(git rev-parse HEAD) = $(git rev-parse master) &&
		git rebase --abort &&
		test $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&
		test ! -d "$dotest"
	
[topic 35ef8fc] Add B1
 Author: A U Thor <bogus_email_address>
 1 file changed, 1 insertion(+)
 create mode 100644 B
HEAD is now at ec25acb merge should fail on this, too
Switched to branch 'master'
[master 7f1cfaa] Modify A2
 Author: A U Thor <bogus_email_address>
 1 file changed, 1 insertion(+)
[master d915d90] Add different B
 Author: A U Thor <bogus_email_address>
 1 file changed, 1 insertion(+)
 create mode 100644 B
Cloning into 'clone2'...
done.
Switched to a new branch 'topic'
Branch topic set up to track remote branch topic from origin.
Merging:
35ef8fc Add B1
virtual origin/master
found 1 common ancestor:
346d4d3 Add A1
Auto-merging B
CONFLICT (add/add): Merge conflict in B
Automatic merge failed; fix conflicts and then commit the result.
First, rewinding head to replay your work on top of it...
[topic 3d822ea] Merge origin/master into topic
 Author: A U Thor <bogus_email_address>
Cloning into 'clone3'...
Merging master with HEAD~1
Merging:
e01197e c
dae85a3 merge should fail on this
found 1 common ancestor:
16eae43 a
Auto-merging a
CONFLICT (content): Merge conflict in a

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

done.
Switched to a new branch 'topic2'
Branch topic2 set up to track remote branch topic from origin.
[topic2 12ad584] Modify A3
 Author: A U Thor <bogus_email_address>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'topic'
Branch topic set up to track remote branch topic from origin.
Merging:
35ef8fc Add B1
virtual topic2
found 1 common ancestor:
35ef8fc Add B1
Merge made by the 'recursive' strategy.
 A | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'clone4'...
Merging master with HEAD~0
Merging:
e01197e c
ec25acb merge should fail on this, too
found 1 common ancestor:
dae85a3 merge should fail on this
Auto-merging a
CONFLICT (content): Merge conflict in a
done.

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Switched to a new branch 'topic2'
Branch topic2 set up to track remote branch topic from origin.
[topic2 12ad584] Modify A3
 Author: A U Thor <bogus_email_address>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'topic'
Rebasing (1/1)
Branch topic set up to track remote branch topic from origin.
Successfully rebased and updated refs/heads/branch2.
Merging:
35ef8fc Add B1
virtual topic2
found 1 common ancestor:
35ef8fc Add B1
Merge made by the 'recursive' strategy.
 A | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to branch 'topic'
ok 8 - test the [branch] option

expecting success: 
	git checkout -b test-onto branch2 &&
	set_fake_editor &&
	git rebase -i --onto branch1 F &&
	test "$(git symbolic-ref -q HEAD)" = "refs/heads/test-onto" &&
	test $(git rev-parse HEAD^) = $(git rev-parse branch1) &&
	test $(git rev-parse I) = $(git rev-parse branch2)

[topic 4904ad8] Modify B2
 Author: A U Thor <bogus_email_address>
 1 file changed, 1 insertion(+)
ok 1 - setup for merge-preserving rebase

expecting success: 
	(
	cd clone2 &&
	git fetch &&
	test_must_fail git rebase -p origin/topic &&
	test 2 = $(git ls-files B | wc -l) &&
	echo Resolved again > B &&
	test_must_fail git rebase --continue &&
	grep "^@@@ " .git/rebase-merge/patch &&
	git add B &&
	git rebase --continue &&
	test 1 = $(git rev-list --all --pretty=oneline | grep "Modify A" | wc -l) &&
	test 1 = $(git rev-list --all --pretty=oneline | grep "Add different" | wc -l) &&
	test 1 = $(git rev-list --all --pretty=oneline | grep "Merge origin" | wc -l)
	)

Switched to a new branch 'test-onto'
ok 8 - rebase --merge --abort after --skip

expecting success: 
		cd "$work_dir" &&
		# Clean up the state from the previous one
		git reset --hard pre-rebase &&
		test_must_fail git rebase$type master &&
		test_path_is_dir "$dotest" &&
		echo c > a &&
		echo d >> a &&
		git add a &&
		test_must_fail git rebase --continue &&
		test $(git rev-parse HEAD) != $(git rev-parse master) &&
		git rebase --abort &&
		test $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&
		test ! -d "$dotest"
	
HEAD is now at ec25acb merge should fail on this, too
From /«PKGBUILDDIR»/t/trash directory.t3409-rebase-preserve-merges/./.
   35ef8fc..4904ad8  topic      -> origin/topic
First, rewinding head to replay your work on top of it...
Merging master with HEAD~1
Merging:
e01197e c
dae85a3 merge should fail on this
found 1 common ancestor:
16eae43 a
Auto-merging a
CONFLICT (content): Merge conflict in a

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

[detached HEAD c98ce86] merge should fail on this
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:51:23 2015 +0000
 1 file changed, 1 insertion(+)
Committed: 0001 merge should fail on this
Merging master with HEAD~0
Merging:
c98ce86 merge should fail on this
ec25acb merge should fail on this, too
found 1 common ancestor:
dae85a3 merge should fail on this
Auto-merging a
CONFLICT (content): Merge conflict in a

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Rebasing (1/1)
Rebasing (1/1)
ok 9 - rebase --merge --abort after --continue

expecting success: 
		cd "$work_dir" &&
		# Clean up the state from the previous one
		git reset --hard pre-rebase &&
		git reflog show to-rebase > reflog_before &&
		test_must_fail git rebase$type master &&
		git rebase --abort &&
		git reflog show to-rebase > reflog_after &&
		test_cmp reflog_before reflog_after &&
		rm reflog_before reflog_after
	
HEAD is now at ec25acb merge should fail on this, too
Merging:
4904ad8 Modify B2
virtual d915d905e050bf21ba7c917a3161f95e5aa95153
found 1 common ancestor:
346d4d3 Add A1
Auto-merging B
CONFLICT (add/add): Merge conflict in B
Automatic merge failed; fix conflicts and then commit the result.
Error redoing merge 3d822ead1616303b3230240c894527b4995d06a5
First, rewinding head to replay your work on top of it...
B: needs merge
Merging master with HEAD~1
Merging:
e01197e c
dae85a3 merge should fail on this
found 1 common ancestor:
16eae43 a
Auto-merging a
CONFLICT (content): Merge conflict in a
You must edit all merge conflicts and then
mark them as resolved using git add

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

@@@ -1,1 -1,1 +1,1 @@@
ok 10 - rebase --merge --abort does not update reflog

expecting success: 
		cd "$work_dir" &&
		# Clean up the state from the previous one
		git reset --hard pre-rebase &&
		test_must_fail git rebase$type master &&
		test_must_fail git rebase -v --abort &&
		test_must_fail git rebase --abort -v &&
		git rebase --abort
	
HEAD is now at ec25acb merge should fail on this, too
[detached HEAD 0b16355] Merge origin/master into topic
 Author: A U Thor <bogus_email_address>
Rebasing (1/1)
First, rewinding head to replay your work on top of it...
Successfully rebased and updated refs/heads/test-onto.
Merging master with HEAD~1
Merging:
e01197e c
dae85a3 merge should fail on this
found 1 common ancestor:
16eae43 a
Auto-merging a
CONFLICT (content): Merge conflict in a

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

ok 9 - test --onto <branch>

expecting success: 
	git checkout branch1 &&
	git tag original-branch1 &&
	set_fake_editor &&
	git rebase -i branch2 &&
	test file6 = $(git diff --name-only original-branch1) &&
	test "$(git symbolic-ref -q HEAD)" = "refs/heads/branch1" &&
	test $(git rev-parse I) = $(git rev-parse branch2) &&
	test $(git rev-parse I) = $(git rev-parse HEAD~2)

Switched to branch 'branch1'
usage: git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] [<upstream>] [<branch>]
   or: git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] --root [<branch>]
   or: git-rebase --continue | --abort | --skip | --edit-todo

Available options are
    -v, --verbose         display a diffstat of what changed upstream
    -q, --quiet           be quiet. implies --no-stat
    --autostash           automatically stash/stash pop before and after
    --fork-point          use 'merge-base --fork-point' to refine upstream
    --onto ...            rebase onto given branch instead of upstream
    -p, --preserve-merges
                          try to recreate merges instead of ignoring them
    -s, --strategy ...    use the given merge strategy
    --no-ff               cherry-pick all commits, even if unchanged
    -m, --merge           use merging strategies to rebase
    -i, --interactive     let the user edit the list of commits to rebase
    -x, --exec ...        add exec lines after each commit of the editable list
    -k, --keep-empty	     preserve empty commits during rebase
    -f, --force-rebase    force rebase even if branch is up to date
    -X, --strategy-option ...
                          pass the argument through to the merge strategy
    --stat                display a diffstat of what changed upstream
    -n, --no-stat         do not show diffstat of what changed upstream
    --verify              allow pre-rebase hook to run
    --rerere-autoupdate   allow rerere to update index with resolved conflicts
    --root                rebase all reachable commits up to the root(s)
    --autosquash         move commits that begin with squash
                          move commits that begin with squash!/fixup! under -i
    --committer-date-is-author-date
                          passed to 'git am'
    --ignore-date         passed to 'git am'
    --whitespace ...      passed to 'git apply'
    --ignore-whitespace   passed to 'git apply'
    -C ...                passed to 'git apply'
    -S, --gpg-sign[=...]  GPG-sign commits

Actions:
    --continue            continue
    --abort               abort and check out the original branch
    --skip                skip current patch and continue
    --edit-todo           edit the todo list during an interactive rebase

usage: git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] [<upstream>] [<branch>]
   or: git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] --root [<branch>]
   or: git-rebase --continue | --abort | --skip | --edit-todo

Available options are
    -v, --verbose         display a diffstat of what changed upstream
    -q, --quiet           be quiet. implies --no-stat
    --autostash           automatically stash/stash pop before and after
    --fork-point          use 'merge-base --fork-point' to refine upstream
    --onto ...            rebase onto given branch instead of upstream
    -p, --preserve-merges
                          try to recreate merges instead of ignoring them
    -s, --strategy ...    use the given merge strategy
    --no-ff               cherry-pick all commits, even if unchanged
    -m, --merge           use merging strategies to rebase
    -i, --interactive     let the user edit the list of commits to rebase
    -x, --exec ...        add exec lines after each commit of the editable list
    -k, --keep-empty	     preserve empty commits during rebase
    -f, --force-rebase    force rebase even if branch is up to date
    -X, --strategy-option ...
                          pass the argument through to the merge strategy
    --stat                display a diffstat of what changed upstream
    -n, --no-stat         do not show diffstat of what changed upstream
    --verify              allow pre-rebase hook to run
    --rerere-autoupdate   allow rerere to update index with resolved conflicts
    --root                rebase all reachable commits up to the root(s)
    --autosquash         move commits that begin with squash
                          move commits that begin with squash!/fixup! under -i
    --committer-date-is-author-date
                          passed to 'git am'
    --ignore-date         passed to 'git am'
    --whitespace ...      passed to 'git apply'
    --ignore-whitespace   passed to 'git apply'
    -C ...                passed to 'git apply'
    -S, --gpg-sign[=...]  GPG-sign commits

Actions:
    --continue            continue
    --abort               abort and check out the original branch
    --skip                skip current patch and continue
    --edit-todo           edit the todo list during an interactive rebase

ok 11 - rebase --abort can not be used with other options

# passed all 11 test(s)
1..11
*** t3410-rebase-preserve-dropped-merges.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3410-rebase-preserve-dropped-merges/.git/
expecting success: 
	test_commit A file1 &&
	test_commit B file1 1 &&
	test_commit C file2 &&
	test_commit D file1 2 &&
	test_commit E file3 &&
	git checkout A &&
	test_commit F file4 &&
	test_commit G file1 3 &&
	test_commit H file5 &&
	git checkout F &&
	test_commit I file6

[master (root-commit) 6e62bf8] A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file1
Successfully rebased and updated refs/heads/topic.
[master 5c95b17] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Rebasing (1/2)
[master 7be4cc1] C
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file2
ok 2 - --continue works after a conflict

expecting success: 
	(
	cd clone3 &&
	git fetch &&
	git rebase -p origin/topic &&
	test 3 = $(git rev-list --all --pretty=oneline | grep "Modify A" | wc -l) &&
	test 1 = $(git rev-list --all --pretty=oneline | grep "Merge branch" | wc -l)
	)

[master 3d13cae] D
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
From /«PKGBUILDDIR»/t/trash directory.t3409-rebase-preserve-merges/./.
   35ef8fc..4904ad8  topic      -> origin/topic
[master 1fe5a44] E
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file3
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 6e62bf8... A
Rebasing (2/2)
[detached HEAD cfefd94] F
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file4
[detached HEAD 66ee775] G
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[detached HEAD 25e63b2] H
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file5
Previous HEAD position was 25e63b2... H
HEAD is now at cfefd94... F
[detached HEAD 615be62] I
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file6
ok 1 - setup

expecting success: 
	git checkout H &&
	test_must_fail git merge E &&
	test_commit L file1 23 &&
	git checkout I &&
	test_commit G2 file1 3 &&
	test_must_fail git merge E &&
	test_commit J file1 23 &&
	test_commit K file7 file7 &&
	git rebase -i -p L &&
	test $(git rev-parse HEAD^^) = $(git rev-parse L) &&
	test "23" = "$(cat file1)" &&
	test "I" = "$(cat file6)" &&
	test "file7" = "$(cat file7)"

Previous HEAD position was 615be62... I
HEAD is now at 25e63b2... H
Merging:
25e63b2 H
virtual E
found 1 common ancestor:
6e62bf8 A
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Automatic merge failed; fix conflicts and then commit the result.
[detached HEAD 70a312a] L
 Author: A U Thor <author@example.com>
Previous HEAD position was 70a312a... L
HEAD is now at 615be62... I
[detached HEAD 93b50ed] G2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Merging:
93b50ed G2
virtual E
found 1 common ancestor:
6e62bf8 A
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Automatic merge failed; fix conflicts and then commit the result.
[detached HEAD 6b192df] J
 Author: A U Thor <author@example.com>
[detached HEAD 273eec6] K
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file7
Successfully rebased and updated refs/heads/branch1.
Rebasing (1/2)
Rebasing (2/2)
ok 10 - rebase on top of a non-conflicting commit

expecting success: 
	test $(git rev-parse branch1@{1}) = $(git rev-parse original-branch1)

ok 11 - reflog for the branch shows state before rebase

expecting success: 
	set_fake_editor &&
	FAKE_LINES="2 1" git rebase -i HEAD~2 &&
	test H = $(git cat-file commit HEAD^ | sed -ne \$p) &&
	test G = $(git cat-file commit HEAD | sed -ne \$p)

Rebasing (1/2)
ok 3 - Add a few hundred commits w/notes to trigger fanout (x -> y)

expecting success: verify_fanout y
rebase -i script before editing:
ok 4 - notes tree has fanout (y)

expecting success: 
	git update-ref refs/notes/m refs/notes/y &&
	git config core.notesRef refs/notes/m &&
	git notes merge x &&
	test "$(git rev-parse refs/notes/m)" = "$(git rev-parse refs/notes/y)"

pick ae8f65e G
pick f5f5249 H

rebase -i script after editing:
pick f5f5249 H
pick ae8f65e G
Already up-to-date!
Rebasing (2/2)
ok 5 - No-op merge (already included) (x => y)

expecting success: 
	git update-ref refs/notes/m refs/notes/x &&
	git notes merge y &&
	test "$(git rev-parse refs/notes/m)" = "$(git rev-parse refs/notes/y)"

Fast-forward
Rebasing (1/2)
ok 6 - Fast-forward merge (y => x)

expecting success: 
	git update-ref refs/notes/z refs/notes/x &&
	git config core.notesRef refs/notes/z &&
	git notes add -f -m "new notes for commit2" commit2 &&
	git notes append -m "appended notes for commit3" commit3 &&
	git notes remove commit4 &&
	git notes remove commit5 &&
	verify_notes z commit5

Overwriting existing notes for object 94955c5cd7e5662c6ab40c323ecdfac458c47435
Removing note for object commit4
Removing note for object commit5
Rebasing (2/2)
ok 7 - change some of the initial 5 notes (x -> z)

expecting success: verify_no_fanout z
ok 8 - notes tree has no fanout (z)

expecting success: 
	git update-ref refs/notes/m refs/notes/z &&
	git config core.notesRef refs/notes/m &&
	git notes merge y &&
	verify_notes m commit5 &&
	# x/y/z unchanged
	verify_notes x commit5 &&
	verify_notes y commit5 &&
	verify_notes z commit5

Successfully rebased and updated refs/heads/topic.
ok 3 - rebase -p preserves no-ff merges

expecting success: 
	(
	cd clone4 &&
	git fetch &&
	git -c merge.log=1 rebase -p origin/topic &&
	echo >expected &&
	git log --format="%b" -1 >current &&
	test_cmp expected current
	)

Successfully rebased and updated refs/heads/branch1.
ok 12 - exchange two commits

expecting success: 
	git tag new-branch1 &&
	set_fake_editor &&
	test_must_fail git rebase -i master &&
	test "$(git rev-parse HEAD~3)" = "$(git rev-parse master)" &&
	test_cmp expect .git/rebase-merge/patch &&
	test_cmp expect2 file1 &&
	test "$(git diff --name-status |
		sed -n -e "/^U/s/^U[^a-z]*//p")" = file1 &&
	test 4 = $(grep -v "^#" < .git/rebase-merge/done | wc -l) &&
	test 0 = $(grep -c "^[^#]" < .git/rebase-merge/git-rebase-todo)

From /«PKGBUILDDIR»/t/trash directory.t3409-rebase-preserve-merges/./.
   35ef8fc..4904ad8  topic      -> origin/topic
ok 9 - successful merge without conflicts (y => z)

expecting success: verify_fanout m
ok 10 - notes tree still has fanout after merge (m)

expecting success: 
	git update-ref refs/notes/w refs/notes/y &&
	git config core.notesRef refs/notes/w &&
	git notes add -f -m "other notes for commit1" commit1 &&
	git notes add -f -m "other notes for commit3" commit3 &&
	git notes add -f -m "other notes for commit4" commit4 &&
	git notes remove commit5 &&
	verify_notes w commit5

Overwriting existing notes for object ef004cfa88883bb87e030b6196934dd90e3548d2
Overwriting existing notes for object e0851358fb6b4703f23d74ef964bc4491bec7ab9
Overwriting existing notes for object 157e8cc0aeac5befb302d276f2e706112bf6e413
Removing note for object commit5
ok 11 - introduce conflicting changes (y -> w)

expecting success: 
	git update-ref refs/notes/m refs/notes/w &&
	git config core.notesRef refs/notes/m &&
	git notes merge -s ours z &&
	verify_notes m commit5 &&
	# w/x/y/z unchanged
	verify_notes w commit5 &&
	verify_notes x commit5 &&
	verify_notes y commit5 &&
	verify_notes z commit5

Using local notes for 157e8cc0aeac5befb302d276f2e706112bf6e413
Using local notes for e0851358fb6b4703f23d74ef964bc4491bec7ab9
ok 12 - successful merge using "ours" strategy (z => w)

expecting success: verify_fanout m
Successfully rebased and updated detached HEAD.
ok 2 - skip same-resolution merges with -p

expecting success: 
	git checkout H &&
	test_must_fail git merge E &&
	test_commit L2 file1 23 &&
	git checkout I &&
	test_commit G3 file1 4 &&
	test_must_fail git merge E &&
	test_commit J2 file1 24 &&
	test_commit K2 file7 file7 &&
	test_must_fail git rebase -i -p L2 &&
	echo 234 > file1 &&
	git add file1 &&
	git rebase --continue &&
	test $(git rev-parse HEAD^^^) = $(git rev-parse L2) &&
	test "234" = "$(cat file1)" &&
	test "I" = "$(cat file6)" &&
	test "file7" = "$(cat file7)"

ok 13 - notes tree still has fanout after merge (m)

expecting success: 
	git update-ref refs/notes/m refs/notes/w &&
	git notes merge -s theirs z &&
	verify_notes m commit5 &&
	# w/x/y/z unchanged
	verify_notes w commit5 &&
	verify_notes x commit5 &&
	verify_notes y commit5 &&
	verify_notes z commit5

Warning: you are leaving 2 commits behind, not connected to
any of your branches:

  519f02c K
  e785c42 I

If you want to keep them by creating a new branch, this may be a good time
to do so with:

 git branch <new-branch-name> 519f02c

HEAD is now at 25e63b2... H
Merging:
25e63b2 H
virtual E
found 1 common ancestor:
6e62bf8 A
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Automatic merge failed; fix conflicts and then commit the result.
[detached HEAD 4c4dd24] L2
 Author: A U Thor <author@example.com>
Rebasing (1/2)
Using remote notes for 157e8cc0aeac5befb302d276f2e706112bf6e413
Using remote notes for e0851358fb6b4703f23d74ef964bc4491bec7ab9
Previous HEAD position was 4c4dd24... L2
HEAD is now at 615be62... I
Rebasing (1/4)
[detached HEAD 6e00aee] G3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Merging:
6e00aee G3
virtual E
found 1 common ancestor:
6e62bf8 A
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Automatic merge failed; fix conflicts and then commit the result.
[detached HEAD 4917c92] J2
 Author: A U Thor <author@example.com>
ok 14 - successful merge using "theirs" strategy (z => w)

expecting success: verify_fanout m
Rebasing (2/4)
[detached HEAD c670ef0] K2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file7
Rebasing (2/2)
ok 15 - notes tree still has fanout after merge (m)

expecting success: 
	git update-ref refs/notes/m refs/notes/w &&
	git notes merge -s union z &&
	verify_notes m commit5 &&
	# w/x/y/z unchanged
	verify_notes w commit5 &&
	verify_notes x commit5 &&
	verify_notes y commit5 &&
	verify_notes z commit5

Concatenating local and remote notes for 157e8cc0aeac5befb302d276f2e706112bf6e413
Concatenating local and remote notes for e0851358fb6b4703f23d74ef964bc4491bec7ab9
Rebasing (3/4)
ok 16 - successful merge using "union" strategy (z => w)

expecting success: verify_fanout m
Rebasing (4/4)
ok 17 - notes tree still has fanout after merge (m)

expecting success: 
	git update-ref refs/notes/m refs/notes/w &&
	git notes merge -s cat_sort_uniq z &&
	verify_notes m commit5 &&
	# w/x/y/z unchanged
	verify_notes w commit5 &&
	verify_notes x commit5 &&
	verify_notes y commit5 &&
	verify_notes z commit5

error: could not apply 5d18e54... G

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Auto-merging file1
CONFLICT (content): Merge conflict in file1
Could not apply 5d18e5414f663da21d1363c271f2d684aeda7b5b... G
Concatenating unique lines in local and remote notes for 157e8cc0aeac5befb302d276f2e706112bf6e413
Concatenating unique lines in local and remote notes for e0851358fb6b4703f23d74ef964bc4491bec7ab9
ok 13 - stop on conflicting pick

expecting success: 
	git rebase --abort &&
	test $(git rev-parse new-branch1) = $(git rev-parse HEAD) &&
	test "$(git symbolic-ref -q HEAD)" = "refs/heads/branch1" &&
	test_path_is_missing .git/rebase-merge

ok 18 - successful merge using "cat_sort_uniq" strategy (z => w)

expecting success: verify_fanout m
ok 19 - notes tree still has fanout after merge (m)

expecting success: 
	git update-ref refs/notes/m refs/notes/w &&
	test_must_fail git notes merge z

ok 14 - abort

expecting success: 
	git rm --cached file1 &&
	git commit -m "remove file in base" &&
	set_fake_editor &&
	test_must_fail git rebase -i master > output 2>&1 &&
	grep "The following untracked working tree files would be overwritten by checkout:" \
		output &&
	grep "file1" output &&
	test_path_is_missing .git/rebase-merge &&
	git reset --hard HEAD^

rm 'file1'
Auto-merging notes for 157e8cc0aeac5befb302d276f2e706112bf6e413
CONFLICT (delete/modify): Notes for object 157e8cc0aeac5befb302d276f2e706112bf6e413 deleted in refs/notes/z and modified in refs/notes/m. Version from refs/notes/m left in tree.
Auto-merging notes for e0851358fb6b4703f23d74ef964bc4491bec7ab9
CONFLICT (content): Merge conflict in notes for object e0851358fb6b4703f23d74ef964bc4491bec7ab9
Automatic notes merge failed. Fix conflicts in .git/NOTES_MERGE_WORKTREE and commit the result with 'git notes merge --commit', or abort the merge with 'git notes merge --abort'.
ok 20 - fails to merge using "manual" strategy (z => w)

expecting success: verify_fanout m
[branch1 2dd5570] remove file in base
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 file1
ok 21 - notes tree still has fanout after merge (m)

expecting success: 
	ls .git/NOTES_MERGE_WORKTREE >output_conflicts &&
	test_cmp expect_conflicts output_conflicts &&
	( for f in $(cat expect_conflicts); do
		test_cmp "expect_conflict_$f" ".git/NOTES_MERGE_WORKTREE/$f" ||
		exit 1
	done ) &&
	# Verify that current notes tree (pre-merge) has not changed (m == w)
	test "$(git rev-parse refs/notes/m)" = "$(git rev-parse refs/notes/w)"

ok 22 - verify conflict entries (with no fanout)

expecting success: 
	cat >.git/NOTES_MERGE_WORKTREE/$commit_sha3 <<EOF &&
other notes for commit3

appended notes for commit3
EOF
	git notes merge --commit &&
	verify_notes m commit5 &&
	# w/x/y/z unchanged
	verify_notes w commit5 &&
	verify_notes x commit5 &&
	verify_notes y commit5 &&
	verify_notes z commit5

Rebasing (1/4)
ok 23 - resolve and finalize merge (z => w)

expecting success: verify_fanout m
Successfully rebased and updated refs/heads/topic.
Rebasing (2/4)
ok 4 - rebase -p ignores merge.log config

# passed all 4 test(s)
1..4
ok 24 - notes tree still has fanout after merge (m)

# passed all 24 test(s)
1..24
error: could not apply 6e00aee... G3

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Auto-merging file1
CONFLICT (content): Merge conflict in file1
*** t3411-rebase-preserve-around-merges.sh ***
Could not pick 6e00aee07e42a4daf7ffd5d296964868ea26ad79
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3411-rebase-preserve-around-merges/.git/
expecting success: 
	test_commit A1 &&
	test_commit B1 &&
	test_commit C1 &&
	git reset --hard B1 &&
	test_commit D1 &&
	test_merge E1 C1 &&
	test_commit F1

[master (root-commit) 6fb0b66] A1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 A1.t
[master 37e5de5] B1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 B1.t
[detached HEAD ff7174a] G3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 9db6c33] C1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 C1.t
error: The following untracked working tree files would be overwritten by checkout:
	file1
HEAD is now at 5d18e54 G
ok 15 - abort with error when new base cannot be checked out

expecting success: 
	echo A > file7 &&
	git add file7 &&
	test_tick &&
	GIT_AUTHOR_NAME="Twerp Snog" git commit -m "different author" &&
	git tag twerp &&
	set_fake_editor &&
	git rebase -i --onto master HEAD^ &&
	git show HEAD | grep "^Author: Twerp Snog"

HEAD is now at 37e5de5 B1
[master 98f5076] D1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 D1.t
[branch1 2596307] different author
 Author: Twerp Snog <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file7
Rebasing (3/4)
Merging:
98f5076 D1
virtual C1
found 1 common ancestor:
37e5de5 B1
Merge made by the 'recursive' strategy.
 C1.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 C1.t
[master 0f3967e] F1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 F1.t
ok 1 - setup

expecting success: 
	FAKE_LINES="1 squash 4 2 3" git rebase -i -p B1 &&
	test "$(git rev-parse HEAD^2)" = "$(git rev-parse C1)" &&
	test "$(git rev-parse HEAD~2)" = "$(git rev-parse B1)" &&
	git tag E2

Rebasing (4/4)
*** t3412-rebase-root.sh ***
Rebasing (1/1)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3412-rebase-root/.git/
expecting success: 
	test_commit 1 A &&
	test_commit 2 A &&
	git symbolic-ref HEAD refs/heads/other &&
	rm .git/index &&
	test_commit 3 B &&
	test_commit 1b A 1 &&
	test_commit 4 B

[master (root-commit) c746ea0] 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 A
[master 46611ad] 2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
rebase -i script before editing:
pick 98f5076 D1
pick 9db6c33 C1
pick b855587 E1
pick 0f3967e F1

[other (root-commit) 2c64091] 3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 B
rebase -i script after editing:
pick 98f5076 D1
squash 0f3967e F1
pick 9db6c33 C1
pick b855587 E1
[other 1c4476a] 1b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 A
[other 41e7797] 4
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - prepare repository

expecting success: 
	git checkout -B fail other &&
	test_must_fail git rebase --onto master --root fail fail

Switched to a new branch 'fail'
Rebasing (1/4)
usage: git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] [<upstream>] [<branch>]
   or: git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] --root [<branch>]
   or: git-rebase --continue | --abort | --skip | --edit-todo

Available options are
    -v, --verbose         display a diffstat of what changed upstream
    -q, --quiet           be quiet. implies --no-stat
    --autostash           automatically stash/stash pop before and after
    --fork-point          use 'merge-base --fork-point' to refine upstream
    --onto ...            rebase onto given branch instead of upstream
    -p, --preserve-merges
                          try to recreate merges instead of ignoring them
    -s, --strategy ...    use the given merge strategy
    --no-ff               cherry-pick all commits, even if unchanged
    -m, --merge           use merging strategies to rebase
    -i, --interactive     let the user edit the list of commits to rebase
    -x, --exec ...        add exec lines after each commit of the editable list
    -k, --keep-empty	     preserve empty commits during rebase
    -f, --force-rebase    force rebase even if branch is up to date
    -X, --strategy-option ...
                          pass the argument through to the merge strategy
    --stat                display a diffstat of what changed upstream
    -n, --no-stat         do not show diffstat of what changed upstream
    --verify              allow pre-rebase hook to run
    --rerere-autoupdate   allow rerere to update index with resolved conflicts
    --root                rebase all reachable commits up to the root(s)
    --autosquash         move commits that begin with squash
                          move commits that begin with squash!/fixup! under -i
    --committer-date-is-author-date
                          passed to 'git am'
    --ignore-date         passed to 'git am'
    --whitespace ...      passed to 'git apply'
    --ignore-whitespace   passed to 'git apply'
    -C ...                passed to 'git apply'
    -S, --gpg-sign[=...]  GPG-sign commits

Actions:
    --continue            continue
    --abort               abort and check out the original branch
    --skip                skip current patch and continue
    --edit-todo           edit the todo list during an interactive rebase

ok 2 - rebase --root fails with too many args

expecting success: 
	mkdir -p .git/hooks &&
	cat >.git/hooks/pre-rebase <<EOF &&
#!$SHELL_PATH
echo "\$1,\$2" >.git/PRE-REBASE-INPUT
EOF
	chmod +x .git/hooks/pre-rebase

ok 3 - setup pre-rebase hook

expecting success: 
	git checkout -b work other &&
	git rebase --root --onto master &&
	git log --pretty=tformat:"%s" > rebased &&
	test_cmp expect rebased

Switched to a new branch 'work'
Successfully rebased and updated detached HEAD.
Rebasing (2/4)
First, rewinding head to replay your work on top of it...
ok 3 - keep different-resolution merges with -p

[detached HEAD 5d81168] D1
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 2 files changed, 2 insertions(+)
 create mode 100644 D1.t
 create mode 100644 F1.t
# passed all 3 test(s)
1..3
Applying: 3
Applying: 4
*** t3413-rebase-hook.sh ***
Rebasing (3/4)
ok 4 - rebase --root --onto <newbase>

expecting success: 
	test "z$(cat .git/PRE-REBASE-INPUT)" = z--root,

ok 5 - pre-rebase got correct input (1)

expecting success: 
	git branch work2 other &&
	git rebase --root --onto master work2 &&
	git log --pretty=tformat:"%s" > rebased2 &&
	test_cmp expect rebased2

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3413-rebase-hook/.git/
expecting success: 
	echo hello >file &&
	git add file &&
	test_tick &&
	git commit -m initial &&
	echo goodbye >file &&
	git add file &&
	test_tick &&
	git commit -m second &&
	git checkout -b side HEAD^ &&
	echo world >git &&
	git add git &&
	test_tick &&
	git commit -m side &&
	git checkout master &&
	git log --pretty=oneline --abbrev-commit --graph --all &&
	git branch test side

[master (root-commit) 6637599] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
Successfully rebased and updated refs/heads/branch1.
Author: Twerp Snog <author@example.com>
ok 16 - retain authorship

expecting success: 
	git reset --hard twerp &&
	echo B > file7 &&
	test_tick &&
	GIT_AUTHOR_NAME="Nitfol" git commit -m "nitfol" file7 &&
	echo "******************************" &&
	set_fake_editor &&
	FAKE_LINES="1 squash 2" EXPECT_HEADER_COUNT=2 \
		git rebase -i --onto master HEAD~2 &&
	test B = $(cat file7) &&
	test $(git rev-parse HEAD^) = $(git rev-parse master)

[master 20a11a4] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'side'
HEAD is now at 2596307 different author
Rebasing (4/4)
[branch1 b66532d] nitfol
 Author: Nitfol <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
******************************
[side c847452] side
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 git
Switched to branch 'master'
* c847452 side
| * 20a11a4 second
|/  
* 6637599 initial
First, rewinding head to replay your work on top of it...
ok 1 - setup

expecting success: 
	git checkout test &&
	git reset --hard side &&
	git rebase master &&
	test "z$(cat git)" = zworld

Switched to branch 'test'
HEAD is now at c847452 side
Applying: 3
Applying: 4
ok 6 - rebase --root --onto <newbase> <branch>

expecting success: 
	test "z$(cat .git/PRE-REBASE-INPUT)" = z--root,work2

ok 7 - pre-rebase got correct input (2)

expecting success: 
	git checkout -b work3 other &&
	git rebase -i --root --onto master &&
	git log --pretty=tformat:"%s" > rebased3 &&
	test_cmp expect rebased3

Successfully rebased and updated refs/heads/master.
Switched to a new branch 'work3'
First, rewinding head to replay your work on top of it...
ok 2 - squash F1 into D1

expecting success: 
	git checkout A1 &&
	test_commit G1 &&
	test_commit H1 &&
	test_commit I1 &&
	git checkout -b branch3 H1 &&
	test_commit J1 &&
	test_merge K1 I1 &&
	git checkout -b branch2 G1 &&
	test_commit L1 &&
	test_merge M1 K1 &&
	GIT_EDITOR=: git rebase -i -p E2 &&
	test "$(git rev-parse HEAD~3)" = "$(git rev-parse E2)" &&
	test "$(git rev-parse HEAD~2)" = "$(git rev-parse HEAD^2^2~2)" &&
	test "$(git rev-parse HEAD^2^1^1)" = "$(git rev-parse HEAD^2^2^1)"

Applying: side
Note: checking out 'A1'.

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 6fb0b66... A1
[detached HEAD f51c4db] G1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 G1.t
ok 2 - rebase

expecting success: 
	git checkout test &&
	git reset --hard side &&
	EDITOR=true git rebase -i master &&
	test "z$(cat git)" = zworld

Already on 'test'
[detached HEAD 8227962] H1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 H1.t
rebase -i script before editing:
pick 2596307 different author
pick b66532d nitfol

HEAD is now at c847452 side
rebase -i script after editing:
pick 2596307 different author
squash b66532d nitfol
[detached HEAD f56baeb] I1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 I1.t
Previous HEAD position was f56baeb... I1
Switched to a new branch 'branch3'
[branch3 904e05f] J1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 J1.t
Merging:
904e05f J1
virtual I1
found 1 common ancestor:
8227962 H1
Merge made by the 'recursive' strategy.
Rebasing (1/2)
 I1.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 I1.t
Switched to a new branch 'branch2'
[branch2 86c413d] L1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 L1.t
Merging:
86c413d L1
virtual K1
found 1 common ancestor:
f51c4db G1
Merge made by the 'recursive' strategy.
 H1.t | 1 +
 I1.t | 1 +
 J1.t | 1 +
 3 files changed, 3 insertions(+)
 create mode 100644 H1.t
 create mode 100644 I1.t
 create mode 100644 J1.t
Rebasing (2/2)
Rebasing (1/2)
[detached HEAD 92841b7] different author
 Author: Twerp Snog <author@example.com>
 Date: Thu Apr 7 15:33:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 file7
Successfully rebased and updated refs/heads/branch1.
Rebasing (2/2)
Rebasing (1/1)
ok 17 - squash

expecting success: 
	git show HEAD | grep "^Author: Twerp Snog"

Author: Twerp Snog <author@example.com>
ok 18 - retain authorship when squashing

expecting success: 
	HEAD=$(git rev-parse HEAD) &&
	set_fake_editor &&
	git rebase -i -p HEAD^ &&
	git update-index --refresh &&
	git diff-files --quiet &&
	git diff-index --quiet --cached HEAD -- &&
	test $HEAD = $(git rev-parse HEAD)

Successfully rebased and updated refs/heads/test.
Rebasing (1/1)
Rebasing (1/7)
ok 3 - rebase -i

expecting success: 
	mkdir -p .git/hooks &&
	cat >.git/hooks/pre-rebase <<EOF &&
#!$SHELL_PATH
echo "\$1,\$2" >.git/PRE-REBASE-INPUT
EOF
	chmod +x .git/hooks/pre-rebase

Successfully rebased and updated refs/heads/work3.
ok 4 - setup pre-rebase hook

expecting success: 
	git checkout test &&
	git reset --hard side &&
	git rebase master &&
	test "z$(cat git)" = zworld &&
	test "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,


Already on 'test'
ok 8 - rebase -i --root --onto <newbase>

expecting success: 
	test "z$(cat .git/PRE-REBASE-INPUT)" = z--root,

ok 9 - pre-rebase got correct input (3)

expecting success: 
	git branch work4 other &&
	git rebase -i --root --onto master work4 &&
	git log --pretty=tformat:"%s" > rebased4 &&
	test_cmp expect rebased4

HEAD is now at c847452 side
Rebasing (2/7)
First, rewinding head to replay your work on top of it...
Applying: side
Rebasing (3/7)
ok 5 - pre-rebase hook gets correct input (1)

expecting success: 
	git checkout test &&
	git reset --hard side &&
	git rebase master test &&
	test "z$(cat git)" = zworld &&
	test "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,test

Already on 'test'
HEAD is now at c847452 side
Rebasing (4/7)
First, rewinding head to replay your work on top of it...
Rebasing (1/2)
Applying: side
Successfully rebased and updated refs/heads/branch1.
ok 19 - -p handles "no changes" gracefully

checking known breakage: 
	git checkout H &&
	set_fake_editor &&
	FAKE_LINES="2 1" git rebase -i -p HEAD~2 &&
	test H = $(git cat-file commit HEAD^ | sed -ne \$p) &&
	test G = $(git cat-file commit HEAD | sed -ne \$p)

ok 6 - pre-rebase hook gets correct input (2)

expecting success: 
	git checkout test &&
	git reset --hard side &&
	git checkout master &&
	git rebase master test &&
	test "z$(cat git)" = zworld &&
	test "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,test

Note: checking out 'H'.

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 4373208... H
Already on 'test'
Rebasing (2/2)
Rebasing (5/7)
HEAD is now at c847452 side
Switched to branch 'master'
Rebasing (6/7)
First, rewinding head to replay your work on top of it...
Applying: side
ok 7 - pre-rebase hook gets correct input (3)

expecting success: 
	git checkout test &&
	git reset --hard side &&
	EDITOR=true git rebase -i master &&
	test "z$(cat git)" = zworld &&
	test "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,


Already on 'test'
HEAD is now at c847452 side
Rebasing (7/7)
rebase -i script before editing:
pick 83751a6 G
pick 4373208 H

rebase -i script after editing:
pick 4373208 H
pick 83751a6 G
Successfully rebased and updated refs/heads/work4.
Rebasing (1/2)
Rebasing (2/2)
ok 10 - rebase -i --root --onto <newbase> <branch>

expecting success: 
	test "z$(cat .git/PRE-REBASE-INPUT)" = z--root,work4

ok 11 - pre-rebase got correct input (4)

expecting success: 
	git checkout -b work5 other &&
	git rebase -i -p --root --onto master &&
	git log --pretty=tformat:"%s" > rebased5 &&
	test_cmp expect rebased5

Switched to a new branch 'work5'
Successfully rebased and updated detached HEAD.
Rebasing (1/1)
not ok 20 - exchange two commits with -p # TODO known breakage

expecting success: 
	git checkout -b to-be-preserved master^ &&
	: > unrelated-file &&
	git add unrelated-file &&
	test_tick &&
	git commit -m "unrelated" &&
	git checkout -b another-branch master &&
	echo B > file1 &&
	test_tick &&
	git commit -m J file1 &&
	test_tick &&
	git merge to-be-preserved &&
	echo C > file1 &&
	test_tick &&
	git commit -m K file1 &&
	echo D > file1 &&
	test_tick &&
	git commit -m L1 file1 &&
	git checkout HEAD^ &&
	echo 1 > unrelated-file &&
	test_tick &&
	git commit -m L2 unrelated-file &&
	test_tick &&
	git merge another-branch &&
	echo E > file1 &&
	test_tick &&
	git commit -m M file1 &&
	git checkout -b to-be-rebased &&
	test_tick &&
	set_fake_editor &&
	git rebase -i -p --onto branch1 master &&
	git update-index --refresh &&
	git diff-files --quiet &&
	git diff-index --quiet --cached HEAD -- &&
	test $(git rev-parse HEAD~6) = $(git rev-parse branch1) &&
	test $(git rev-parse HEAD~4^2) = $(git rev-parse to-be-preserved) &&
	test $(git rev-parse HEAD^^2^) = $(git rev-parse HEAD^^^) &&
	test $(git show HEAD~5:file1) = B &&
	test $(git show HEAD~3:file1) = C &&
	test $(git show HEAD:file1) = E &&
	test $(git show HEAD:unrelated-file) = 1

Previous HEAD position was 83751a6... G
Switched to a new branch 'to-be-preserved'
[to-be-preserved d5c01b6] unrelated
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 unrelated-file
Switched to a new branch 'another-branch'
[another-branch a9a73c1] J
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Merging:
a9a73c1 J
virtual to-be-preserved
found 1 common ancestor:
0547e3f D
Merge made by the 'recursive' strategy.
 unrelated-file | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 unrelated-file
[another-branch 03b537d] K
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[another-branch 3ea8fda] L1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
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 03b537d... K
[detached HEAD a41631e] L2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Merging:
a41631e L2
virtual another-branch
found 1 common ancestor:
03b537d K
Merge made by the 'recursive' strategy.
 file1 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
[detached HEAD 1289f52] M
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'to-be-rebased'
Successfully rebased and updated refs/heads/branch2.
Rebasing (1/2)
ok 3 - rebase two levels of merge

# passed all 3 test(s)
1..3
*** t3414-rebase-preserve-onto.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3414-rebase-preserve-onto/.git/
expecting success: 
	test_commit A1 &&
	test_commit B1 &&
	test_commit C1 &&
	test_commit D1 &&
	git reset --hard B1 &&
	test_commit E1 &&
	test_commit F1 &&
	test_merge G1 D1 &&
	git reset --hard A1 &&
	test_commit H1

Rebasing (2/2)
[master (root-commit) 6fb0b66] A1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 A1.t
[master 37e5de5] B1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 B1.t
Successfully rebased and updated refs/heads/test.
[master 9db6c33] C1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 C1.t
ok 8 - pre-rebase hook gets correct input (4)

expecting success: 
	git checkout test &&
	git reset --hard side &&
	EDITOR=true git rebase -i master test &&
	test "z$(cat git)" = zworld &&
	test "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,test

Already on 'test'
HEAD is now at c847452 side
[master d7157d8] D1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 D1.t
HEAD is now at 37e5de5 B1
[master b959d6c] E1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 E1.t
[master 81dc3a6] F1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 F1.t
Merging:
81dc3a6 F1
virtual D1
found 1 common ancestor:
37e5de5 B1
Merge made by the 'recursive' strategy.
 C1.t | 1 +
 D1.t | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 C1.t
 create mode 100644 D1.t
HEAD is now at 6fb0b66 A1
[master 4950a7c] H1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 H1.t
ok 1 - setup

expecting success: 
	git checkout G1 &&
	git rebase -p --onto H1 B1 &&
	test "$(git rev-parse HEAD^1^1^1)" = "$(git rev-parse H1)" &&
	test "$(git rev-parse HEAD^2^1^1)" = "$(git rev-parse H1)"

Note: checking out 'G1'.

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 52308dd... G1
Successfully rebased and updated refs/heads/work5.
Rebasing (1/7)
Rebasing (1/1)
Rebasing (2/7)
ok 12 - rebase -i -p with linear history

expecting success: 
	test "z$(cat .git/PRE-REBASE-INPUT)" = z--root,

ok 13 - pre-rebase got correct input (5)

expecting success: 
	git checkout other^ &&
	git checkout -b side &&
	test_commit 5 C &&
	git checkout other &&
	git merge side

Note: checking out 'other^'.

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 1c4476a... 1b
Switched to a new branch 'side'
[side 0c9a4e9] 5
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 C
Switched to branch 'other'
Merging:
41e7797 4
virtual side
found 1 common ancestor:
1c4476a 1b
Merge made by the 'recursive' strategy.
 C | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 C
ok 14 - set up merge history

Rebasing (3/7)
expecting success: 
	git checkout -b work6 other &&
	git rebase -i -p --root --onto master &&
	log_with_names work6 > rebased6 &&
	test_cmp expect-side rebased6

Switched to a new branch 'work6'
Successfully rebased and updated refs/heads/test.
Rebasing (1/5)
Rebasing (4/7)
Rebasing (2/5)
Rebasing (5/7)
ok 9 - pre-rebase hook gets correct input (5)

expecting success: 
	git checkout test &&
	git reset --hard side &&
	git checkout master &&
	EDITOR=true git rebase -i master test &&
	test "z$(cat git)" = zworld &&
	test "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,test

Already on 'test'
HEAD is now at c847452 side
Switched to branch 'master'
Successfully rebased and updated refs/heads/to-be-rebased.
Successfully rebased and updated refs/heads/test.
Successfully rebased and updated detached HEAD.
Rebasing (3/5)
Rebasing (6/7)
Rebasing (4/5)
Rebasing (1/4)
Rebasing (7/7)
Rebasing (5/5)
Rebasing (2/4)
Rebasing (1/1)
Rebasing (3/4)
Rebasing (4/4)
ok 10 - pre-rebase hook gets correct input (6)

expecting success: 
	mkdir -p .git/hooks &&
	cat >.git/hooks/pre-rebase <<EOF &&
#!$SHELL_PATH
false
EOF
	chmod +x .git/hooks/pre-rebase

ok 11 - setup pre-rebase hook that fails

expecting success: 
	git checkout test &&
	git reset --hard side &&
	test_must_fail git rebase master &&
	test "z$(git symbolic-ref HEAD)" = zrefs/heads/test &&
	test 0 = $(git rev-list HEAD...side | wc -l)

Already on 'test'
ok 2 - rebase from B1 onto H1

expecting success: 
	git checkout G1 &&
	git rebase -p --onto H1 E1 &&
	test "$(git rev-parse HEAD^1^1)" = "$(git rev-parse H1)" &&
	test "$(git rev-parse HEAD^2)" = "$(git rev-parse D1)"

ok 21 - preserve merges with -p

expecting success: 
	set_fake_editor &&
	FAKE_LINES="1 2 edit 3 4" git rebase -i -p HEAD~3 &&
	echo 2 > unrelated-file &&
	test_tick &&
	git commit -m L2-modified --amend unrelated-file &&
	git rebase --continue &&
	git update-index --refresh &&
	git diff-files --quiet &&
	git diff-index --quiet --cached HEAD -- &&
	test $(git show HEAD:unrelated-file) = 2

HEAD is now at c847452 side
Warning: you are leaving 5 commits behind, not connected to
any of your branches:

  ab2e25c G1
  eb95cad F1
  52202eb D1
  227fb12 E1
  9e481e9 C1

If you want to keep them by creating a new branch, this may be a good time
to do so with:

 git branch <new-branch-name> ab2e25c

HEAD is now at 52308dd... G1
The pre-rebase hook refused to rebase.
ok 12 - pre-rebase hook stops rebase (1)

expecting success: 
	git checkout test &&
	git reset --hard side &&
	test_must_fail env EDITOR=: git rebase -i master &&
	test "z$(git symbolic-ref HEAD)" = zrefs/heads/test &&
	test 0 = $(git rev-list HEAD...side | wc -l)

Already on 'test'
HEAD is now at c847452 side
Successfully rebased and updated refs/heads/work6.
ok 15 - rebase -i -p with merge

expecting success: 
	git symbolic-ref HEAD refs/heads/third &&
	rm .git/index &&
	rm A B C &&
	test_commit 6 D &&
	git checkout other &&
	git merge third

The pre-rebase hook refused to rebase.
[third (root-commit) 00ac2af] 6
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 D
ok 13 - pre-rebase hook stops rebase (2)

expecting success: 
	git checkout test &&
	git reset --hard side &&
	git rebase --no-verify master &&
	test "z$(git symbolic-ref HEAD)" = zrefs/heads/test &&
	test "z$(cat git)" = zworld

Already on 'test'
Switched to branch 'other'
HEAD is now at c847452 side
Merging:
ddb0186 Merge branch 'side' into other
virtual third
found 0 common ancestors:
Merge made by the 'recursive' strategy.
 D | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 D
ok 16 - set up second root and merge

expecting success: 
	git checkout -b work7 other &&
	git rebase -i -p --root --onto master &&
	log_with_names work7 > rebased7 &&
	test_cmp expect-third rebased7

Switched to a new branch 'work7'
rebase -i script before editing:
pick 09a6e6c L2
pick 234979f L1
pick 0613583 Merge branch 'another-branch' into HEAD
pick 786dfe2 M

rebase -i script after editing:
pick 09a6e6c L2
pick 234979f L1
edit 0613583 Merge branch 'another-branch' into HEAD
pick 786dfe2 M
First, rewinding head to replay your work on top of it...
Rebasing (1/2)
Applying: side
Rebasing (1/4)
ok 14 - rebase --no-verify overrides pre-rebase (1)

expecting success: 
	git checkout test &&
	git reset --hard side &&
	EDITOR=true git rebase --no-verify -i master &&
	test "z$(git symbolic-ref HEAD)" = zrefs/heads/test &&
	test "z$(cat git)" = zworld

Already on 'test'
HEAD is now at c847452 side
Stopped at 0613583cad9773f87b346e6ff5bf7a4351a324fc... Merge branch 'another-branch' into HEAD
You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

Rebasing (2/2)
Rebasing (2/4)
Rebasing (3/4)
[detached HEAD 2cd643a] L2-modified
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:41:13 2005 -0700
Successfully rebased and updated refs/heads/to-be-rebased.
Rebasing (1/1)
Rebasing (1/6)
Rebasing (4/4)
Rebasing (2/6)
ok 22 - edit ancestor with -p

expecting success: 
	test_tick &&
	set_fake_editor &&
	test_must_fail git rebase -i --onto new-branch1 HEAD^ &&
	echo resolved > file1 &&
	git add file1 &&
	FAKE_COMMIT_MESSAGE="chouette!" git rebase --continue &&
	test $(git rev-parse HEAD^) = $(git rev-parse new-branch1) &&
	git show HEAD | grep chouette

Successfully rebased and updated detached HEAD.
Rebasing (3/6)
ok 3 - rebase from E1 onto H1

expecting success: 
	git checkout G1 &&
	git rev-list --first-parent --pretty=oneline C1..G1 &&
	git rebase -p --onto H1 C1 &&
	test "$(git rev-parse HEAD^2^1)" = "$(git rev-parse H1)" &&
	test "$(git rev-parse HEAD^1)" = "$(git rev-parse F1)"

Warning: you are leaving 2 commits behind, not connected to
any of your branches:

  a6d9fc8 G1
  4d3dd7d F1

If you want to keep them by creating a new branch, this may be a good time
to do so with:

 git branch <new-branch-name> a6d9fc8

HEAD is now at 52308dd... G1
52308dd60394ebd5599b39fb69108f164975ed7a G1
81dc3a6494c9a0091f921c65194433ffa66d8dac F1
b959d6cc0d4f2d10f0d432e45cd5578c75065af5 E1
Successfully rebased and updated refs/heads/test.
Rebasing (4/6)
ok 15 - rebase --no-verify overrides pre-rebase (2)

# passed all 15 test(s)
1..15
*** t3415-rebase-autosquash.sh ***
Rebasing (1/1)
Rebasing (5/6)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3415-rebase-autosquash/.git/
expecting success: 
	echo 0 >file0 &&
	git add . &&
	test_tick &&
	git commit -m "initial commit" &&
	echo 0 >file1 &&
	echo 2 >file2 &&
	git add . &&
	test_tick &&
	git commit -m "first commit" &&
	git tag first-commit &&
	echo 3 >file3 &&
	git add . &&
	test_tick &&
	git commit -m "second commit" &&
	git tag base

[master (root-commit) d78c915] initial commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file0
error: could not apply c6647ba... M

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Auto-merging file1
CONFLICT (content): Merge conflict in file1
[master 244a0fe] first commit
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 file1
 create mode 100644 file2
Could not apply c6647ba3df6c51a16bb2ebeced967c904dfc9c30... M
[master f0c2a7e] second commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file3
ok 1 - setup

expecting success: 
	test_auto_fixup final-fixup-option --autosquash

HEAD is now at f0c2a7e second commit
Rebasing (6/6)
[master e17f730] fixup! first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Rebasing (1/2)
[detached HEAD 338a701] chouette!
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Rebasing (1/1)
Rebasing (2/2)
Rebasing (2/3)
[detached HEAD 9252710] first commit
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 2 files changed, 2 insertions(+)
 create mode 100644 file1
 create mode 100644 file2
Successfully rebased and updated refs/heads/to-be-rebased.
Successfully rebased and updated refs/heads/work7.
Rebasing (3/3)
ok 17 - rebase -i -p with two roots

expecting success: 
	mkdir -p .git/hooks &&
	cat >.git/hooks/pre-rebase <<EOF &&
#!$SHELL_PATH
false
EOF
	chmod +x .git/hooks/pre-rebase

    chouette!
ok 23 - --continue tries to commit

expecting success: 
	git reset --hard master@{1} &&
	test_tick &&
	set_fake_editor &&
	test_must_fail git rebase -v -i --onto new-branch1 HEAD^ &&
	echo resolved > file1 &&
	git add file1 &&
	git rebase --continue > output &&
	grep "^ file1 | 2 +-$" output

ok 18 - setup pre-rebase hook that fails

expecting success: 
	git checkout -b stops1 other &&
	test_must_fail git rebase --root --onto master &&
	test "z$(git symbolic-ref HEAD)" = zrefs/heads/stops1 &&
	test 0 = $(git rev-list other...stops1 | wc -l)

HEAD is now at 0547e3f D
Switched to a new branch 'stops1'
The pre-rebase hook refused to rebase.
Changes from 6e62bf890e21973b771e4e6fc28f5ade62edb4bc to 5d18e5414f663da21d1363c271f2d684aeda7b5b:
 file1 | 2 +-
 file4 | 1 +
 file5 | 1 +
 file6 | 1 +
 4 files changed, 4 insertions(+), 1 deletion(-)
 create mode 100644 file4
 create mode 100644 file5
 create mode 100644 file6
ok 19 - pre-rebase hook stops rebase

expecting success: 
	git checkout -b stops2 other &&
	test_must_fail git rebase --root --onto master &&
	test "z$(git symbolic-ref HEAD)" = zrefs/heads/stops2 &&
	test 0 = $(git rev-list other...stops2 | wc -l)

Successfully rebased and updated detached HEAD.
Switched to a new branch 'stops2'
ok 4 - rebase from C1 onto H1

# passed all 4 test(s)
1..4
*** t3416-rebase-onto-threedots.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3416-rebase-onto-threedots/.git/
expecting success: 
	test_commit A &&
	test_commit B &&
	git branch side &&
	test_commit C &&
	git branch topic &&
	git checkout side &&
	test_commit H &&
	git checkout master &&
	test_tick &&
	git merge H &&
	git tag D &&
	test_commit E &&
	git checkout topic &&
	test_commit F &&
	test_commit G &&
	git checkout side &&
	test_tick &&
	git merge C &&
	git tag I &&
	test_commit J &&
	test_commit K

The pre-rebase hook refused to rebase.
ok 20 - pre-rebase hook stops rebase -i

expecting success: 
	rm -f .git/hooks/pre-rebase

[master (root-commit) 0ddfaf1] A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 A.t
ok 21 - remove pre-rebase hook

expecting success: 
	git checkout master &&
	echo conflict > B &&
	git add B &&
	git commit -m conflict

Switched to branch 'master'
[master d9df450] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 B.t
[master f80eebe] conflict
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 B
ok 22 - set up a conflict

expecting success: 
	git checkout -b conflict1 other &&
	test_must_fail git rebase --root --onto master &&
	git ls-files -u | grep "B$"

Note: checking out '5d18e5414f663da21d1363c271f2d684aeda7b5b'.

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 5d18e54... G
Switched to a new branch 'conflict1'
[master 35a8500] C
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 C.t
Rebasing (1/1)
0547e3f1350de154b309493b84e37dcd3097c587
Switched to branch 'side'
error: could not apply 0547e3f... D

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Auto-merging file1
CONFLICT (content): Merge conflict in file1
[side e9f30f6] H
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 H.t
Switched to branch 'master'
Could not apply 0547e3f1350de154b309493b84e37dcd3097c587... D
First, rewinding head to replay your work on top of it...
Merging:
35a8500 C
virtual H
found 1 common ancestor:
d9df450 B
Merge made by the 'recursive' strategy.
 H.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 H.t
Successfully rebased and updated refs/heads/master.
Applying: 3
[master 0cd72fb] E
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 E.t
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Switched to branch 'topic'
ok 2 - auto fixup (option)

expecting success: 
	git config rebase.autosquash true &&
	test_auto_fixup final-fixup-config-true &&
	test_must_fail test_auto_fixup fixup-config-true-no --no-autosquash &&
	git config rebase.autosquash false &&
	test_must_fail test_auto_fixup final-fixup-config-false

Merging f80eebe4758487d08f8416d110739d8f485a2c1c with 3
Merging:
f80eebe conflict
virtual 3
found 1 common ancestor:
virtual 4b825dc642cb6eb9a060e54bf8d69288fbee4904
Auto-merging B
CONFLICT (add/add): Merge conflict in B
error: Failed to merge in the changes.
Patch failed at 0001 3
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

100644 9b1719f5cf069568785080a0bbabbe7c377e22ae 2	B
100644 00750edc07d6415dcc07ae0351e9397b0222b7ba 3	B
ok 23 - rebase --root with conflict (first part)

expecting success: 
	echo 3 > B &&
	git add B

[topic 0fb828b] F
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 F.t
HEAD is now at f0c2a7e second commit
ok 24 - fix the conflict

expecting success: 
	git rebase --continue &&
	git log --pretty=tformat:"%s" > conflict1 &&
	test_cmp expect-conflict conflict1

[master f84b6d6] fixup! first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[topic a08c965] G
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 G.t
Switched to branch 'side'
Merging:
e9f30f6 H
virtual C
found 1 common ancestor:
d9df450 B
Merge made by the 'recursive' strategy.
 C.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 C.t
Applying: 3
[side 9eed7bf] J
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 J.t
Applying: 4
Applying: 5
Applying: 6
[side 4d3c411] K
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 K.t
ok 1 - setup

expecting success: 
	git reset --hard &&
	git checkout topic &&
	git reset --hard G &&

	git rebase --onto master...topic F &&
	git rev-parse HEAD^1 >actual &&
	git rev-parse C^0 >expect &&
	test_cmp expect actual

HEAD is now at 4d3c411 K
Switched to branch 'topic'
ok 25 - rebase --root with conflict (second part)

expecting success: 
	git checkout -b conflict2 other &&
	test_must_fail git rebase -i --root --onto master &&
	git ls-files -u | grep "B$"

HEAD is now at a08c965 G
Switched to a new branch 'conflict2'
First, rewinding head to replay your work on top of it...
Applying: G
ok 2 - rebase --onto master...topic

expecting success: 
	git reset --hard &&
	git checkout topic &&
	git reset --hard G &&

	git rebase --onto master... F &&
	git rev-parse HEAD^1 >actual &&
	git rev-parse C^0 >expect &&
	test_cmp expect actual

HEAD is now at f576ef2 G
Already on 'topic'
HEAD is now at a08c965 G
Rebasing (2/3)
[detached HEAD 48456c1] first commit
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 2 files changed, 2 insertions(+)
 create mode 100644 file1
 create mode 100644 file2
First, rewinding head to replay your work on top of it...
Successfully rebased and updated refs/heads/to-be-rebased.
Rebasing (3/3)
 file1 | 2 +-
ok 24 - verbose flag is heeded, even after --continue

expecting success: 
	base=$(git rev-parse HEAD~4) &&
	set_fake_editor &&
	FAKE_COMMIT_AMEND="ONCE" FAKE_LINES="1 squash 2 squash 3 squash 4" \
		EXPECT_HEADER_COUNT=4 \
		git rebase -i $base &&
	test $base = $(git rev-parse HEAD^) &&
	test 1 = $(git show | grep ONCE | wc -l)

Applying: G
Rebasing (1/4)
ok 3 - rebase --onto master...

expecting success: 
	git reset --hard &&
	git checkout side &&
	git reset --hard K &&

	test_must_fail git rebase --onto master...side J

error: could not apply 2c64091... 3

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Auto-merging B
CONFLICT (add/add): Merge conflict in B
HEAD is now at f576ef2 G
Switched to branch 'side'
Could not apply 2c64091600777cfca4ad9dca6ec274f5a2554d69... 3
HEAD is now at 4d3c411 K
100644 9b1719f5cf069568785080a0bbabbe7c377e22ae 2	B
100644 00750edc07d6415dcc07ae0351e9397b0222b7ba 3	B
ok 26 - rebase -i --root with conflict (first part)

expecting success: 
	echo 3 > B &&
	git add B

ok 27 - fix the conflict

expecting success: 
	git rebase --continue &&
	git log --pretty=tformat:"%s" > conflict2 &&
	test_cmp expect-conflict conflict2

master...side: there are more than one merge bases
ok 4 - rebase --onto master...side

expecting success: 
	git reset --hard &&
	git checkout topic &&
	git reset --hard G &&
	set_fake_editor &&
	EXPECT_COUNT=1 git rebase -i --onto master...topic F &&
	git rev-parse HEAD^1 >actual &&
	git rev-parse C^0 >expect &&
	test_cmp expect actual

HEAD is now at 4d3c411 K
Switched to branch 'topic'
HEAD is now at a08c965 G
[detached HEAD 308ae33] 3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Rebasing (2/4)
rebase -i script before editing:
pick 615be62 I
pick 0626e8d H
pick 5d18e54 G
pick 1a47de6 D

rebase -i script after editing:
pick 615be62 I
squash 0626e8d H
squash 5d18e54 G
squash 1a47de6 D
Successfully rebased and updated refs/heads/master.
Rebasing (3/4)
Rebasing (2/4)
Rebasing (4/4)
Rebasing (1/1)
HEAD is now at f0c2a7e second commit
Rebasing (3/4)
[master 03041cb] fixup! first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Rebasing (4/4)
[detached HEAD 3363e4a] I
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:21:13 2005 -0700
 3 files changed, 3 insertions(+), 1 deletion(-)
 create mode 100644 file5
 create mode 100644 file6
Successfully rebased and updated refs/heads/to-be-rebased.
ok 25 - multi-squash only fires up editor once

expecting success: 
	git checkout -b multi-fixup E &&
	base=$(git rev-parse HEAD~4) &&
	set_fake_editor &&
	FAKE_COMMIT_AMEND="NEVER" FAKE_LINES="1 fixup 2 fixup 3 fixup 4" \
		git rebase -i $base &&
	test $base = $(git rev-parse HEAD^) &&
	test 0 = $(git show | grep NEVER | wc -l) &&
	git checkout to-be-rebased &&
	git branch -D multi-fixup

Switched to a new branch 'multi-fixup'
Successfully rebased and updated refs/heads/conflict2.
Successfully rebased and updated refs/heads/master.
Rebasing (3/3)
test_line_count: line count for actual != 3
ok 28 - rebase -i --root with conflict (second part)

03041cb fixup! first
f0c2a7e second commit
244a0fe first commit
d78c915 initial commit
expecting success: 
	git checkout -b conflict3 other &&
	test_must_fail git rebase -i -p --root --onto master &&
	git ls-files -u | grep "B$"

Switched to a new branch 'conflict3'
HEAD is now at f0c2a7e second commit
[master bee11d3] fixup! first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Successfully rebased and updated refs/heads/topic.
ok 5 - rebase -i --onto master...topic

expecting success: 
	git reset --hard &&
	git checkout topic &&
	git reset --hard G &&
	set_fake_editor &&
	EXPECT_COUNT=1 git rebase -i --onto master... F &&
	git rev-parse HEAD^1 >actual &&
	git rev-parse C^0 >expect &&
	test_cmp expect actual

HEAD is now at f576ef2 G
Already on 'topic'
HEAD is now at a08c965 G
rebase -i script before editing:
pick 313fe96 B
pick d0f65f2 C
pick 0547e3f D
pick 8f99a4f E

rebase -i script after editing:
pick 313fe96 B
fixup d0f65f2 C
fixup 0547e3f D
fixup 8f99a4f E
Successfully rebased and updated refs/heads/master.
Rebasing (2/4)
Rebasing (3/4)
Rebasing (1/1)
Rebasing (3/3)
test_line_count: line count for actual != 3
bee11d3 fixup! first
f0c2a7e second commit
244a0fe first commit
d78c915 initial commit
ok 3 - auto fixup (config)

expecting success: 
	test_auto_squash final-squash --autosquash

HEAD is now at f0c2a7e second commit
[master 19ce186] squash! first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Rebasing (4/4)
Rebasing (1/6)
[detached HEAD d5bfe99] B
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 3 files changed, 3 insertions(+), 1 deletion(-)
 create mode 100644 file2
 create mode 100644 file3
error: could not apply 2c64091... 3

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Auto-merging B
CONFLICT (add/add): Merge conflict in B
Could not pick 2c64091600777cfca4ad9dca6ec274f5a2554d69
100644 9b1719f5cf069568785080a0bbabbe7c377e22ae 2	B
100644 00750edc07d6415dcc07ae0351e9397b0222b7ba 3	B
ok 29 - rebase -i -p --root with conflict (first part)

expecting success: 
	echo 3 > B &&
	git add B

ok 30 - fix the conflict

expecting success: 
	git rebase --continue &&
	log_with_names conflict3 >out &&
	test_cmp expect-conflict-p out

Successfully rebased and updated refs/heads/multi-fixup.
Switched to branch 'to-be-rebased'
Deleted branch multi-fixup (was d5bfe99).
ok 26 - multi-fixup does not fire up editor

expecting success: 
	git checkout -b conflict-fixup conflict-branch &&
	base=$(git rev-parse HEAD~4) &&
	set_fake_editor &&
	test_must_fail env FAKE_LINES="1 fixup 3 fixup 4" git rebase -i $base &&
	echo three > conflict &&
	git add conflict &&
	FAKE_COMMIT_AMEND="ONCE" EXPECT_HEADER_COUNT=2 \
		git rebase --continue &&
	test $base = $(git rev-parse HEAD^) &&
	test 1 = $(git show | grep ONCE | wc -l) &&
	git checkout to-be-rebased &&
	git branch -D conflict-fixup

Switched to a new branch 'conflict-fixup'
[detached HEAD 308ae33] 3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Successfully rebased and updated refs/heads/topic.
Rebasing (2/6)
Rebasing (2/3)
Rebasing (3/6)
ok 6 - rebase -i --onto master...

expecting success: 
	git reset --hard &&
	git checkout side &&
	git reset --hard K &&

	test_must_fail git rebase -i --onto master...side J

HEAD is now at f576ef2 G
Switched to branch 'side'
HEAD is now at 4d3c411 K
[detached HEAD 9064ef2] first commit
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 2 files changed, 2 insertions(+)
 create mode 100644 file1
 create mode 100644 file2
Rebasing (3/3)
rebase -i script before editing:
pick b895952 one
pick 766a798 two
pick 1eadf03 three
pick f91a2b3 four

master...side: there are more than one merge bases
ok 7 - rebase -i --onto master...side

# passed all 7 test(s)
1..7
rebase -i script after editing:
pick b895952 one
fixup 1eadf03 three
fixup f91a2b3 four
Rebasing (4/6)
*** t3417-rebase-whitespace-fix.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3417-rebase-whitespace-fix/.git/
expecting success: 
	git commit --allow-empty -m "Initial empty commit" &&
	git add file && git commit -m first &&
	mv second file &&
	git add file &&	git commit -m second &&
	git rebase --whitespace=fix HEAD^^ &&
	git diff --exit-code HEAD^:file expect-first &&
	test_cmp file expect-second

[master (root-commit) 1ae0f74] Initial empty commit
 Author: A U Thor <author@example.com>
[master a4697b2] first
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+)
 create mode 100644 file
Rebasing (2/3)
[master 90ba557] second
 Author: A U Thor <author@example.com>
 1 file changed, 7 insertions(+)
Rebasing (5/6)
error: could not apply 1eadf03... three

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Auto-merging conflict
CONFLICT (content): Merge conflict in conflict

Could not apply 1eadf03e4079aebe25519a38e5142d033bdd2ec4... three

Current branch master is up to date, rebase forced.
First, rewinding head to replay your work on top of it...
Rebasing (6/6)
Applying: first
Applying: second
[detached HEAD 664f99b] one
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:22:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 conflict
ok 1 - blank line at end of file; extend at end of file

expecting success: 
	cp third file && git add file && git commit -m third &&
	git rebase --whitespace=fix HEAD^^ &&
	git diff --exit-code HEAD^:file expect-second &&
	test_cmp file expect-third

Rebasing (3/3)
[master 1cff6ab] third
 Author: A U Thor <author@example.com>
 1 file changed, 7 insertions(+)
[detached HEAD 3fcdd94] one
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:22:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 conflict
Successfully rebased and updated refs/heads/master.
Current branch master is up to date, rebase forced.
First, rewinding head to replay your work on top of it...
Successfully rebased and updated refs/heads/conflict-fixup.
ok 4 - auto squash (option)

expecting success: 
	git config rebase.autosquash true &&
	test_auto_squash final-squash-config-true &&
	test_must_fail test_auto_squash squash-config-true-no --no-autosquash &&
	git config rebase.autosquash false &&
	test_must_fail test_auto_squash final-squash-config-false

HEAD is now at f0c2a7e second commit
Applying: second
Switched to branch 'to-be-rebased'
Applying: third
Deleted branch conflict-fixup (was 3fcdd94).
ok 27 - commit message used after conflict

expecting success: 
	git checkout -b conflict-squash conflict-branch &&
	base=$(git rev-parse HEAD~4) &&
	set_fake_editor &&
	test_must_fail env FAKE_LINES="1 fixup 3 squash 4" git rebase -i $base &&
	echo three > conflict &&
	git add conflict &&
	FAKE_COMMIT_AMEND="TWICE" EXPECT_HEADER_COUNT=2 \
		git rebase --continue &&
	test $base = $(git rev-parse HEAD^) &&
	test 2 = $(git show | grep TWICE | wc -l) &&
	git checkout to-be-rebased &&
	git branch -D conflict-squash

[master a95a906] squash! first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'conflict-squash'
ok 2 - two blanks line at end of file; extend at end of file

expecting success: 
	git config core.whitespace "-blank-at-eol" &&
	git reset --hard HEAD^ &&
	cp third file && git add file && git commit -m third &&
	git rebase --whitespace=fix HEAD^^ &&
	git diff --exit-code HEAD^:file expect-second &&
	test_cmp file third

HEAD is now at f779f3d second
[master cd2db63] third
 Author: A U Thor <author@example.com>
 1 file changed, 7 insertions(+)
Current branch master is up to date, rebase forced.
First, rewinding head to replay your work on top of it...
Applying: second
Applying: third
Successfully rebased and updated refs/heads/conflict3.
ok 3 - same, but do not remove trailing spaces

expecting success: 
	git config core.whitespace "blank-at-eol" &&
	cp beginning file &&
	git commit -m beginning file &&
	for i in 1 2 3 4 5; do
		echo $i
	done >> file &&
	git commit -m more file	&&
	git rebase --whitespace=fix HEAD^^ &&
	test_cmp file expect-beginning

rebase -i script before editing:
pick b895952 one
pick 766a798 two
pick 1eadf03 three
pick f91a2b3 four

ok 31 - rebase -i -p --root with conflict (second part)

rebase -i script after editing:
# passed all 31 test(s)
1..31
pick b895952 one
fixup 1eadf03 three
squash f91a2b3 four
[master cb9feb8] beginning
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+), 13 deletions(-)
[master d39dae5] more
 Author: A U Thor <author@example.com>
 1 file changed, 5 insertions(+)
*** t3418-rebase-continue.sh ***
Rebasing (2/3)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3418-rebase-continue/.git/
expecting success: 
	test_commit "commit-new-file-F1" F1 1 &&
	test_commit "commit-new-file-F2" F2 2 &&

	git checkout -b topic HEAD^ &&
	test_commit "commit-new-file-F2-on-topic-branch" F2 22 &&

	git checkout master

Rebasing (2/3)
[master (root-commit) dac1376] commit-new-file-F1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 F1
Current branch master is up to date, rebase forced.
First, rewinding head to replay your work on top of it...
[detached HEAD 46676fa] first commit
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 2 files changed, 2 insertions(+)
 create mode 100644 file1
 create mode 100644 file2
[master 953b3db] commit-new-file-F2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 F2
error: could not apply 1eadf03... three

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Auto-merging conflict
CONFLICT (content): Merge conflict in conflict
Applying: beginning
Switched to a new branch 'topic'

Could not apply 1eadf03e4079aebe25519a38e5142d033bdd2ec4... three
Applying: more
[topic 24c5d85] commit-new-file-F2-on-topic-branch
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 F2

Switched to branch 'master'
Rebasing (3/3)
ok 1 - setup

expecting success: 
	rm -fr .git/rebase-* &&
	git reset --hard &&
	git checkout master &&

	FAKE_LINES="edit 1" git rebase -i HEAD^ &&
	test-chmtime =-60 F1 &&
	git rebase --continue

HEAD is now at 953b3db commit-new-file-F2
ok 4 - at beginning of file

Already on 'master'
# passed all 4 test(s)
1..4
*** t3419-rebase-patch-id.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3419-rebase-patch-id/.git/
expecting success: 
	git commit --allow-empty -m initial &&
	git tag root

[master (root-commit) 361b1af] initial
 Author: A U Thor <author@example.com>
[detached HEAD e169bcc] one
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:22:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 conflict
ok 1 - setup

expecting success: 
		rm -f .gitattributes &&
		git checkout -q -f master &&
		git reset --hard root &&
		count 500 >file &&
		git add file &&
		git commit -q -m initial &&
		git branch -f other &&

		scramble file &&
		git add file &&
		git commit -q -m 'change big file' &&

		git checkout -q other &&
		: >newfile &&
		git add newfile &&
		git commit -q -m 'add small file' &&

		git cherry-pick master >/dev/null 2>&1
	
HEAD is now at 361b1af initial
Rebasing (3/3)
rebase -i script before editing:
pick 953b3db commit-new-file-F2

rebase -i script after editing:
edit 953b3db commit-new-file-F2
[detached HEAD dc13e91] one
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:22:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 conflict
ok 2 - setup: 500 lines

expecting success: 
		echo 'file binary' >.gitattributes
	
ok 3 - setup attributes

expecting success: 
		git checkout -q master &&
		scramble file &&
		git add file &&
		git commit -q -m 'change big file again' &&
		git checkout -q other^{} &&
		git rebase master &&
		test_must_fail test -n "$(git rev-list master...HEAD~)"
	
Successfully rebased and updated refs/heads/conflict-squash.
Switched to branch 'to-be-rebased'
Rebasing (1/1)
Deleted branch conflict-squash (was dc13e91).
ok 28 - commit message retained after conflict

expecting success: 
	git checkout -b squash-fixup E &&
	base=$(git rev-parse HEAD~4) &&
	set_fake_editor &&
	FAKE_COMMIT_AMEND="ONCE" FAKE_LINES="1 fixup 2 squash 3 fixup 4" \
		EXPECT_HEADER_COUNT=4 \
		git rebase -i $base &&
	git cat-file commit HEAD | sed -e 1,/^\$/d > actual-squash-fixup &&
	test_cmp expect-squash-fixup actual-squash-fixup &&
	git checkout to-be-rebased &&
	git branch -D squash-fixup

Switched to a new branch 'squash-fixup'
Stopped at 953b3db31f61f8fc41bbcb85a1c76eadc748cf75... commit-new-file-F2
You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

First, rewinding head to replay your work on top of it...
Successfully rebased and updated refs/heads/master.
Applying: add small file
ok 4 - detect upstream patch

expecting success: 
		git branch -f squashed master &&
		git checkout -q -f squashed &&
		git reset -q --soft HEAD~2 &&
		git commit -q -m squashed &&
		git checkout -q other^{} &&
		test_must_fail git rebase squashed &&
		rm -rf .git/rebase-apply
	
Rebasing (1/1)
HEAD is now at f0c2a7e second commit
Successfully rebased and updated refs/heads/master.
[master fc8ff6e] squash! first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 2 - interactive rebase --continue works with touched file

expecting success: 
	rm -fr .git/rebase-* &&
	git reset --hard &&
	git checkout master &&

	test_must_fail git rebase --onto master master topic &&
	echo "Resolved" >F2 &&
	git add F2 &&
	test-chmtime =-60 F1 &&
	git rebase --continue

HEAD is now at 953b3db commit-new-file-F2
Already on 'master'
rebase -i script before editing:
pick 313fe96 B
pick d0f65f2 C
pick 0547e3f D
pick 8f99a4f E

rebase -i script after editing:
pick 313fe96 B
fixup d0f65f2 C
squash 0547e3f D
fixup 8f99a4f E
First, rewinding head to replay your work on top of it...
First, rewinding head to replay your work on top of it...
Applying: add small file
Applying: change big file
Applying: commit-new-file-F2-on-topic-branch
Using index info to reconstruct a base tree...
M	file
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Falling back to patching base and 3-way merge...
warning: Cannot merge binary files: file (90d4ba16fd331d9993e146bf21f97afadb644cfe vs. change big file)
Merging 90d4ba16fd331d9993e146bf21f97afadb644cfe with change big file
Merging:
90d4ba1 add small file
virtual change big file
found 1 common ancestor:
virtual e5dcc7c81f494dce9da11f93c6ea59bdc75c6013
Auto-merging file
CONFLICT (content): Merge conflict in file
error: Failed to merge in the changes.
Patch failed at 0002 change big file
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Rebasing (2/4)
Merging 953b3db31f61f8fc41bbcb85a1c76eadc748cf75 with commit-new-file-F2-on-topic-branch
Merging:
953b3db commit-new-file-F2
virtual commit-new-file-F2-on-topic-branch
found 1 common ancestor:
virtual 4b825dc642cb6eb9a060e54bf8d69288fbee4904
Auto-merging F2
CONFLICT (add/add): Merge conflict in F2
ok 5 - do not drop patch

error: Failed to merge in the changes.
Patch failed at 0001 commit-new-file-F2-on-topic-branch
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

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: setup: 50000 lines 
		rm -f .gitattributes &&
		git checkout -q -f master &&
		git reset --hard root &&
		count 50000 >file &&
		git add file &&
		git commit -q -m initial &&
		git branch -f other &&

		scramble file &&
		git add file &&
		git commit -q -m 'change big file' &&

		git checkout -q other &&
		: >newfile &&
		git add newfile &&
		git commit -q -m 'add small file' &&

		git cherry-pick master >/dev/null 2>&1
	
ok 6 # skip setup: 50000 lines (missing EXPENSIVE)

skipping test: setup attributes 
		echo 'file binary' >.gitattributes
	
ok 7 # skip setup attributes (missing EXPENSIVE)

skipping test: detect upstream patch 
		git checkout -q master &&
		scramble file &&
		git add file &&
		git commit -q -m 'change big file again' &&
		git checkout -q other^{} &&
		git rebase master &&
		test_must_fail test -n "$(git rev-list master...HEAD~)"
	
ok 8 # skip detect upstream patch (missing EXPENSIVE)

skipping test: do not drop patch 
		git branch -f squashed master &&
		git checkout -q -f squashed &&
		git reset -q --soft HEAD~2 &&
		git commit -q -m squashed &&
		git checkout -q other^{} &&
		test_must_fail git rebase squashed &&
		rm -rf .git/rebase-apply
	
ok 9 # skip do not drop patch (missing EXPENSIVE)

# passed all 9 test(s)
1..9
*** t3420-rebase-autostash.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3420-rebase-autostash/.git/
expecting success: 
	echo hello-world >file0 &&
	git add . &&
	test_tick &&
	git commit -m "initial commit" &&
	git checkout -b feature-branch &&
	echo another-hello >file1 &&
	echo goodbye >file2 &&
	git add . &&
	test_tick &&
	git commit -m "second commit" &&
	echo final-goodbye >file3 &&
	git add . &&
	test_tick &&
	git commit -m "third commit" &&
	git checkout -b unrelated-onto-branch master &&
	echo unrelated >file4 &&
	git add . &&
	test_tick &&
	git commit -m "unrelated commit" &&
	git checkout -b related-onto-branch master &&
	echo conflicting-change >file2 &&
	git add . &&
	test_tick &&
	git commit -m "related commit"

Applying: commit-new-file-F2-on-topic-branch
Rebasing (3/4)
[master (root-commit) bfa4f02] initial commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file0
Switched to a new branch 'feature-branch'
ok 3 - non-interactive rebase --continue works with touched file

expecting success: 
	test_config rerere.enabled true &&
	test_when_finished "test_might_fail git rebase --abort" &&
	git reset --hard commit-new-file-F2-on-topic-branch &&
	git checkout master &&
	rm -fr .git/rebase-* &&

	test_must_fail git rebase --onto master master topic &&
	echo "Resolved" >F2 &&
	git add F2 &&
	cp F2 F2.expected &&
	git rebase --continue &&

	git reset --hard commit-new-file-F2-on-topic-branch &&
	git checkout master &&
	test_must_fail git rebase --onto master master topic &&
	test_cmp F2.expected F2

[feature-branch 6fe95e2] second commit
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 file1
 create mode 100644 file2
HEAD is now at 24c5d85 commit-new-file-F2-on-topic-branch
Switched to branch 'master'
[feature-branch 0c4d2f1] third commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file3
Switched to a new branch 'unrelated-onto-branch'
Successfully rebased and updated refs/heads/master.
Rebasing (3/3)
[unrelated-onto-branch 4aede2f] unrelated commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file4
Switched to a new branch 'related-onto-branch'
test_line_count: line count for actual != 3
Rebasing (4/4)
fc8ff6e squash! first
f0c2a7e second commit
244a0fe first commit
d78c915 initial commit
HEAD is now at f0c2a7e second commit
[related-onto-branch c57d250] related commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file2
ok 1 - setup

expecting success: 
	test_config rebase.autostash true &&
	git reset --hard &&
	git checkout -b behind-feature-branch feature-branch~1 &&
	test_when_finished git branch -D behind-feature-branch &&
	echo dirty >>file1 &&
	git rebase feature-branch &&
	grep dirty file1 &&
	git checkout feature-branch

HEAD is now at c57d250 related commit
[master 336ee2b] squash! first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'behind-feature-branch'
First, rewinding head to replay your work on top of it...
[detached HEAD db81eb6] B
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 3 files changed, 3 insertions(+), 1 deletion(-)
 create mode 100644 file2
 create mode 100644 file3
Applying: commit-new-file-F2-on-topic-branch
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Merging 953b3db31f61f8fc41bbcb85a1c76eadc748cf75 with commit-new-file-F2-on-topic-branch
Merging:
953b3db commit-new-file-F2
virtual commit-new-file-F2-on-topic-branch
found 1 common ancestor:
virtual 4b825dc642cb6eb9a060e54bf8d69288fbee4904
Auto-merging F2
CONFLICT (add/add): Merge conflict in F2
Recorded preimage for 'F2'
error: Failed to merge in the changes.
Patch failed at 0001 commit-new-file-F2-on-topic-branch
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Successfully rebased and updated refs/heads/squash-fixup.
Switched to branch 'to-be-rebased'
Deleted branch squash-fixup (was db81eb6).
ok 29 - squash and fixup generate correct log messages

expecting success: 
	git checkout -b skip-comments E &&
	base=$(git rev-parse HEAD~4) &&
	set_fake_editor &&
	FAKE_COMMIT_AMEND="ONCE" FAKE_LINES="# 1 # squash 2 # squash 3 # squash 4 #" \
		EXPECT_HEADER_COUNT=4 \
		git rebase -i $base &&
	test $base = $(git rev-parse HEAD^) &&
	test 1 = $(git show | grep ONCE | wc -l) &&
	git checkout to-be-rebased &&
	git branch -D skip-comments

Switched to a new branch 'skip-comments'
Recorded resolution for 'F2'.
Applying: commit-new-file-F2-on-topic-branch
HEAD is now at 24c5d85 commit-new-file-F2-on-topic-branch
Switched to branch 'master'
Created autostash: 9a740dd
HEAD is now at 6fe95e2 second commit
First, rewinding head to replay your work on top of it...
Fast-forwarded behind-feature-branch to feature-branch.
First, rewinding head to replay your work on top of it...
Applying: commit-new-file-F2-on-topic-branch
Rebasing (3/3)
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Successfully rebased and updated refs/heads/master.
Merging 953b3db31f61f8fc41bbcb85a1c76eadc748cf75 with commit-new-file-F2-on-topic-branch
Merging:
953b3db commit-new-file-F2
virtual commit-new-file-F2-on-topic-branch
found 1 common ancestor:
virtual 4b825dc642cb6eb9a060e54bf8d69288fbee4904
Auto-merging F2
CONFLICT (add/add): Merge conflict in F2
Resolved 'F2' using previous resolution.
error: Failed to merge in the changes.
Patch failed at 0001 commit-new-file-F2-on-topic-branch
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

test_line_count: line count for actual != 3
336ee2b squash! first
f0c2a7e second commit
244a0fe first commit
d78c915 initial commit
ok 5 - auto squash (config)

expecting success: 
	git reset --hard base &&
	echo 1 >file1 &&
	git add -u &&
	test_tick &&
	git commit -m "squash! forst" &&
	git tag final-missquash &&
	test_tick &&
	git rebase --autosquash -i HEAD^^^ &&
	git log --oneline >actual &&
	test_line_count = 4 actual &&
	git diff --exit-code final-missquash &&
	test 0 = $(git rev-list final-missquash...HEAD | wc -l)

HEAD is now at f0c2a7e second commit
Applied autostash.
[master bdc406a] squash! forst
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
dirty
rebase -i script before editing:
pick 313fe96 B
pick d0f65f2 C
pick 0547e3f D
pick 8f99a4f E

Switched to branch 'feature-branch'
M	file1
rebase -i script after editing:
# comment
pick 313fe96 B
# comment
squash d0f65f2 C
# comment
squash 0547e3f D
# comment
squash 8f99a4f E
# comment
Deleted branch behind-feature-branch (was 0c4d2f1).
ok 2 - rebase: fast-forward rebase

expecting success: 
	test_config rebase.autostash true &&
	git reset --hard &&
	git checkout -b same-feature-branch feature-branch &&
	test_when_finished git branch -D same-feature-branch &&
	echo dirty >>file1 &&
	git rebase feature-branch &&
	grep dirty file1 &&
	git checkout feature-branch

ok 4 - non-interactive rebase --continue with rerere enabled

HEAD is now at 0c4d2f1 third commit
expecting success: 
	test_must_fail git rebase -v --continue &&
	test_must_fail git rebase --continue -v

Switched to a new branch 'same-feature-branch'
usage: git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] [<upstream>] [<branch>]
   or: git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] --root [<branch>]
   or: git-rebase --continue | --abort | --skip | --edit-todo

Available options are
    -v, --verbose         display a diffstat of what changed upstream
    -q, --quiet           be quiet. implies --no-stat
    --autostash           automatically stash/stash pop before and after
    --fork-point          use 'merge-base --fork-point' to refine upstream
    --onto ...            rebase onto given branch instead of upstream
    -p, --preserve-merges
                          try to recreate merges instead of ignoring them
    -s, --strategy ...    use the given merge strategy
    --no-ff               cherry-pick all commits, even if unchanged
    -m, --merge           use merging strategies to rebase
    -i, --interactive     let the user edit the list of commits to rebase
    -x, --exec ...        add exec lines after each commit of the editable list
    -k, --keep-empty	     preserve empty commits during rebase
    -f, --force-rebase    force rebase even if branch is up to date
    -X, --strategy-option ...
                          pass the argument through to the merge strategy
    --stat                display a diffstat of what changed upstream
    -n, --no-stat         do not show diffstat of what changed upstream
    --verify              allow pre-rebase hook to run
    --rerere-autoupdate   allow rerere to update index with resolved conflicts
    --root                rebase all reachable commits up to the root(s)
    --autosquash         move commits that begin with squash
                          move commits that begin with squash!/fixup! under -i
    --committer-date-is-author-date
                          passed to 'git am'
    --ignore-date         passed to 'git am'
    --whitespace ...      passed to 'git apply'
    --ignore-whitespace   passed to 'git apply'
    -C ...                passed to 'git apply'
    -S, --gpg-sign[=...]  GPG-sign commits

Actions:
    --continue            continue
    --abort               abort and check out the original branch
    --skip                skip current patch and continue
    --edit-todo           edit the todo list during an interactive rebase

Rebasing (2/4)
usage: git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] [<upstream>] [<branch>]
   or: git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] --root [<branch>]
   or: git-rebase --continue | --abort | --skip | --edit-todo

Available options are
    -v, --verbose         display a diffstat of what changed upstream
    -q, --quiet           be quiet. implies --no-stat
    --autostash           automatically stash/stash pop before and after
    --fork-point          use 'merge-base --fork-point' to refine upstream
    --onto ...            rebase onto given branch instead of upstream
    -p, --preserve-merges
                          try to recreate merges instead of ignoring them
    -s, --strategy ...    use the given merge strategy
    --no-ff               cherry-pick all commits, even if unchanged
    -m, --merge           use merging strategies to rebase
    -i, --interactive     let the user edit the list of commits to rebase
    -x, --exec ...        add exec lines after each commit of the editable list
    -k, --keep-empty	     preserve empty commits during rebase
    -f, --force-rebase    force rebase even if branch is up to date
    -X, --strategy-option ...
                          pass the argument through to the merge strategy
    --stat                display a diffstat of what changed upstream
    -n, --no-stat         do not show diffstat of what changed upstream
    --verify              allow pre-rebase hook to run
    --rerere-autoupdate   allow rerere to update index with resolved conflicts
    --root                rebase all reachable commits up to the root(s)
    --autosquash         move commits that begin with squash
                          move commits that begin with squash!/fixup! under -i
    --committer-date-is-author-date
                          passed to 'git am'
    --ignore-date         passed to 'git am'
    --whitespace ...      passed to 'git apply'
    --ignore-whitespace   passed to 'git apply'
    -C ...                passed to 'git apply'
    -S, --gpg-sign[=...]  GPG-sign commits

Actions:
    --continue            continue
    --abort               abort and check out the original branch
    --skip                skip current patch and continue
    --edit-todo           edit the todo list during an interactive rebase

ok 5 - rebase --continue can not be used with other options

expecting success: 
	rm -fr .git/rebase-* &&
	git reset --hard commit-new-file-F2-on-topic-branch &&
	test_commit "commit-new-file-F3-on-topic-branch" F3 32 &&
	test_when_finished "rm -fr test-bin funny.was.run" &&
	mkdir test-bin &&
	cat >test-bin/git-merge-funny <<-EOF &&
	#!$SHELL_PATH
	case "\$1" in --opt) ;; *) exit 2 ;; esac
	shift &&
	>funny.was.run &&
	exec git merge-recursive "\$@"
	EOF
	chmod +x test-bin/git-merge-funny &&
	(
		PATH=./test-bin:$PATH
		test_must_fail git rebase -s funny -Xopt master topic
	) &&
	test -f funny.was.run &&
	rm funny.was.run &&
	echo "Resolved" >F2 &&
	git add F2 &&
	(
		PATH=./test-bin:$PATH
		git rebase --continue
	) &&
	test -f funny.was.run

HEAD is now at 24c5d85 commit-new-file-F2-on-topic-branch
[topic 39de9a1] commit-new-file-F3-on-topic-branch
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 F3
Rebasing (3/4)
Created autostash: 37616bd
HEAD is now at 0c4d2f1 third commit
First, rewinding head to replay your work on top of it...
Current branch same-feature-branch is up to date.
Merging master with HEAD~1
Merging:
953b3db commit-new-file-F2
24c5d85 commit-new-file-F2-on-topic-branch
found 1 common ancestor:
dac1376 commit-new-file-F1
Auto-merging F2
CONFLICT (add/add): Merge conflict in F2
Resolved 'F2' using previous resolution.

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Successfully rebased and updated refs/heads/master.
Rebasing (3/3)
Rebasing (4/4)
ok 6 - misspelled auto squash

expecting success: 
	git reset --hard base &&
	echo 4 >file4 &&
	git add file4 &&
	test_tick &&
	git commit -m "first new commit" &&
	echo 1 >file1 &&
	git add -u &&
	test_tick &&
	git commit -m "squash! first" &&
	git tag final-multisquash &&
	test_tick &&
	git rebase --autosquash -i HEAD~4 &&
	git log --oneline >actual &&
	test_line_count = 4 actual &&
	git diff --exit-code final-multisquash &&
	test 1 = "$(git cat-file blob HEAD^^:file1)" &&
	test 2 = $(git cat-file commit HEAD^^ | grep first | wc -l) &&
	test 1 = $(git cat-file commit HEAD | grep first | wc -l)

HEAD is now at f0c2a7e second commit
Applied autostash.
dirty
[master 671d0de] first new commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file4
Switched to branch 'feature-branch'
M	file1
[detached HEAD 6396a51] commit-new-file-F2-on-topic-branch
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
Committed: 0001 Deleted branch same-feature-branch (was 0c4d2f1).
commit-new-file-F2-on-topic-branch
[master 1cded01] squash! first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[detached HEAD 97b27d8] B
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 3 files changed, 3 insertions(+), 1 deletion(-)
 create mode 100644 file2
 create mode 100644 file3
ok 3 - rebase: noop rebase

expecting success: 
		test_config rebase.autostash true &&
		git reset --hard &&
		git checkout -b rebased-feature-branch feature-branch &&
		test_when_finished git branch -D rebased-feature-branch &&
		test_when_finished git checkout feature-branch &&
		echo dirty >>file3 &&
		test_must_fail git rebase$type --no-autostash unrelated-onto-branch
	
Merging master with HEAD~0
Merging:
6396a51 commit-new-file-F2-on-topic-branch
39de9a1 commit-new-file-F3-on-topic-branch
found 1 common ancestor:
24c5d85 commit-new-file-F2-on-topic-branch
HEAD is now at 0c4d2f1 third commit
Switched to a new branch 'rebased-feature-branch'
[detached HEAD 07d5098] commit-new-file-F3-on-topic-branch
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 F3
Committed: 0002 commit-new-file-F3-on-topic-branch
Successfully rebased and updated refs/heads/skip-comments.
All done.
ok 6 - rebase --continue remembers merge strategy and options

expecting success: 
	rm -fr .git/rebase-* &&
	git reset --hard commit-new-file-F3-on-topic-branch &&
	git checkout master &&
	test_commit "commit-new-file-F3" F3 3 &&
	git config rerere.enabled true &&
	test_must_fail git rebase -m master topic &&
	echo "Resolved" >F2 &&
	git add F2 &&
	test_must_fail git rebase --continue &&
	echo "Resolved" >F3 &&
	git add F3 &&
	git rebase --continue &&
	git reset --hard topic@{1} &&
	test_must_fail git rebase -m --rerere-autoupdate master &&
	test "$(cat F2)" = "Resolved" &&
	test_must_fail git rebase --continue &&
	test "$(cat F3)" = "Resolved" &&
	git rebase --continue

Switched to branch 'to-be-rebased'
HEAD is now at 39de9a1 commit-new-file-F3-on-topic-branch
Deleted branch skip-comments (was 97b27d8).
ok 30 - squash ignores comments

expecting success: 
	git checkout -b skip-blank-lines E &&
	base=$(git rev-parse HEAD~4) &&
	set_fake_editor &&
	FAKE_COMMIT_AMEND="ONCE" FAKE_LINES="> 1 > squash 2 > squash 3 > squash 4 >" \
		EXPECT_HEADER_COUNT=4 \
		git rebase -i $base &&
	test $base = $(git rev-parse HEAD^) &&
	test 1 = $(git show | grep ONCE | wc -l) &&
	git checkout to-be-rebased &&
	git branch -D skip-blank-lines

Switched to branch 'master'
Cannot rebase: You have unstaged changes.
Please commit or stash them.
Switched to a new branch 'skip-blank-lines'
Switched to branch 'feature-branch'
M	file3
[master 2f543f5] commit-new-file-F3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 F3
Deleted branch rebased-feature-branch (was 0c4d2f1).
ok 4 - rebase: dirty worktree, --no-autostash

expecting success: 
		test_config rebase.autostash true &&
		git reset --hard &&
		git checkout -b rebased-feature-branch feature-branch &&
		test_when_finished git branch -D rebased-feature-branch &&
		echo dirty >>file3 &&
		git rebase$type unrelated-onto-branch &&
		grep unrelated file4 &&
		grep dirty file3 &&
		git checkout feature-branch
	
HEAD is now at 0c4d2f1 third commit
Switched to a new branch 'rebased-feature-branch'
First, rewinding head to replay your work on top of it...
Merging master with HEAD~1
Merging:
2f543f5 commit-new-file-F3
24c5d85 commit-new-file-F2-on-topic-branch
found 1 common ancestor:
dac1376 commit-new-file-F1
Auto-merging F2
CONFLICT (add/add): Merge conflict in F2
Resolved 'F2' using previous resolution.

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

[detached HEAD bc07c2e] commit-new-file-F2-on-topic-branch
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
Created autostash: cdca6ca
Committed: 0001 HEAD is now at 0c4d2f1 third commit
commit-new-file-F2-on-topic-branch
rebase -i script before editing:
pick 313fe96 B
pick d0f65f2 C
pick 0547e3f D
pick 8f99a4f E

Rebasing (2/4)
Merging master with HEAD~0
Merging:
bc07c2e commit-new-file-F2-on-topic-branch
39de9a1 commit-new-file-F3-on-topic-branch
found 1 common ancestor:
24c5d85 commit-new-file-F2-on-topic-branch
Auto-merging F3
CONFLICT (add/add): Merge conflict in F3
rebase -i script after editing:
Recorded preimage for 'F3'

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".


pick 313fe96 B

squash d0f65f2 C

squash 0547e3f D

squash 8f99a4f E

First, rewinding head to replay your work on top of it...
Applying: second commit
Applying: third commit
[detached HEAD 8cc2a0e] first commit
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 2 files changed, 2 insertions(+)
 create mode 100644 file1
 create mode 100644 file2
Recorded resolution for 'F3'.
[detached HEAD abfd4f5] commit-new-file-F3-on-topic-branch
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
Committed: 0002 commit-new-file-F3-on-topic-branch
Rebasing (3/4)
Rebasing (3/6)
All done.
HEAD is now at 39de9a1 commit-new-file-F3-on-topic-branch
Rebasing (4/4)
Applied autostash.
unrelated
dirty
Switched to branch 'feature-branch'
M	file3
Deleted branch rebased-feature-branch (was b607b14).
ok 5 - rebase: dirty worktree, non-conflicting rebase

expecting success: 
		test_config rebase.autostash true &&
		git reset --hard &&
		git checkout -b rebased-feature-branch feature-branch &&
		test_when_finished git branch -D rebased-feature-branch &&
		echo dirty >>file3 &&
		git add file3 &&
		git rebase$type unrelated-onto-branch &&
		grep unrelated file4 &&
		grep dirty file3 &&
		git checkout feature-branch
	
Rebasing (5/6)
HEAD is now at 0c4d2f1 third commit
First, rewinding head to replay your work on top of it...
Switched to a new branch 'rebased-feature-branch'
Merging master with HEAD~1
Merging:
2f543f5 commit-new-file-F3
24c5d85 commit-new-file-F2-on-topic-branch
found 1 common ancestor:
dac1376 commit-new-file-F1
Auto-merging F2
CONFLICT (add/add): Merge conflict in F2
Staged 'F2' using previous resolution.

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Rebasing (7/7)
[detached HEAD bc07c2e] commit-new-file-F2-on-topic-branch
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
Committed: 0001 commit-new-file-F2-on-topic-branch
Merging master with HEAD~0
Merging:
bc07c2e commit-new-file-F2-on-topic-branch
39de9a1 commit-new-file-F3-on-topic-branch
found 1 common ancestor:
24c5d85 commit-new-file-F2-on-topic-branch
Auto-merging F3
CONFLICT (add/add): Merge conflict in F3
Staged 'F3' using previous resolution.

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

[detached HEAD 97b27d8] B
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 3 files changed, 3 insertions(+), 1 deletion(-)
 create mode 100644 file2
 create mode 100644 file3
Created autostash: e9af673
HEAD is now at 0c4d2f1 third commit
First, rewinding head to replay your work on top of it...
Successfully rebased and updated refs/heads/skip-blank-lines.
[detached HEAD abfd4f5] commit-new-file-F3-on-topic-branch
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
Committed: 0002 commit-new-file-F3-on-topic-branch
Applying: second commit
Applying: third commit
All done.
Switched to branch 'to-be-rebased'
ok 7 - rebase --continue remembers --rerere-autoupdate

Deleted branch skip-blank-lines (was 97b27d8).
ok 31 - squash ignores blank lines

# passed all 7 test(s)
1..7
expecting success: 
	git checkout -b squash-works no-conflict-branch &&
	one=$(git rev-parse HEAD~3) &&
	set_fake_editor &&
	FAKE_LINES="1 squash 3 2" EXPECT_HEADER_COUNT=2 \
		git rebase -i HEAD~3 &&
	test $one = $(git rev-parse HEAD~2)

Switched to a new branch 'squash-works'
*** t3421-rebase-topology-linear.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3421-rebase-topology-linear/.git/
expecting success: 
	test_commit a &&
	test_commit b &&
	test_commit c &&
	git checkout b &&
	test_commit d &&
	test_commit e

[master (root-commit) ce450c7] a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a.t
Successfully rebased and updated refs/heads/master.
[master 020ea9b] b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 b.t
Applied autostash.
unrelated
dirty
[master d9ea348] c
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c.t
Switched to branch 'feature-branch'
M	file3
ok 7 - auto squash that matches 2 commits

expecting success: 
	git reset --hard base &&
	echo 1 >file1 &&
	git add -u &&
	test_tick &&
	git commit -m "squash! third" &&
	echo 4 >file4 &&
	git add file4 &&
	test_tick &&
	git commit -m "third commit" &&
	git tag final-presquash &&
	test_tick &&
	git rebase --autosquash -i HEAD~4 &&
	git log --oneline >actual &&
	test_line_count = 5 actual &&
	git diff --exit-code final-presquash &&
	test 0 = "$(git cat-file blob HEAD^^:file1)" &&
	test 1 = "$(git cat-file blob HEAD^:file1)" &&
	test 1 = $(git cat-file commit HEAD | grep third | wc -l) &&
	test 1 = $(git cat-file commit HEAD^ | grep third | wc -l)

Deleted branch rebased-feature-branch (was b607b14).
Note: checking out 'b'.

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 020ea9b... b
HEAD is now at f0c2a7e second commit
ok 6 - rebase: dirty index, non-conflicting rebase

expecting success: 
		test_config rebase.autostash true &&
		git reset --hard &&
		git checkout -b rebased-feature-branch feature-branch &&
		test_when_finished git branch -D rebased-feature-branch &&
		echo dirty >>file3 &&
		test_must_fail git rebase$type related-onto-branch &&
		test_path_is_file $dotest/autostash &&
		! grep dirty file3 &&
		rm -rf $dotest &&
		git reset --hard &&
		git checkout feature-branch
	
[detached HEAD 1bd0260] d
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 d.t
HEAD is now at 0c4d2f1 third commit
[master 3a205cd] squash! third
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'rebased-feature-branch'
[master 76ae28b] third commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file4
[detached HEAD 67a7211] e
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 e.t
ok 1 - setup

expecting success: 
		reset_rebase &&
		git rebase  c e &&
		test_cmp_rev c HEAD~2 &&
		test_linear_range 'd e' c..
	
No rebase in progress?
HEAD is now at 67a7211 e
rebase -i script before editing:
pick 265b89e K
pick 6b0f5e6 L
pick 3389558 M

rebase -i script after editing:
pick 265b89e K
squash 3389558 M
pick 6b0f5e6 L
First, rewinding head to replay your work on top of it...
Rebasing (2/3)
Created autostash: cdca6ca
HEAD is now at 0c4d2f1 third commit
Applying: d
Applying: e
First, rewinding head to replay your work on top of it...
ok 2 - simple rebase 

expecting success: 
		reset_rebase &&
		git rebase -m c e &&
		test_cmp_rev c HEAD~2 &&
		test_linear_range 'd e' c..
	
[detached HEAD 6a76a44] K
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:27:13 2005 -0700
 2 files changed, 2 insertions(+)
 create mode 100644 fileK
 create mode 100644 fileM
Applying: second commit
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Merging c57d2500845be9257e4e8523eba02ee67587d64e with second commit
Merging:
c57d250 related commit
virtual second commit
found 1 common ancestor:
virtual 4b825dc642cb6eb9a060e54bf8d69288fbee4904
Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
error: Failed to merge in the changes.
Patch failed at 0001 second commit
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

grep: file3: No such file or directory
No rebase in progress?
Rebasing (3/3)
HEAD is now at c57d250 related commit
HEAD is now at 7d728d6 e
Previous HEAD position was c57d250... related commit
Removing actual.rev
Removing expect.rev
Switched to branch 'feature-branch'
Deleted branch rebased-feature-branch (was 0c4d2f1).
ok 7 - rebase: conflicting rebase

expecting success: 
		test_config rebase.autostash true &&
		git reset --hard &&
		git checkout -b rebased-feature-branch feature-branch &&
		test_when_finished git branch -D rebased-feature-branch &&
		echo dirty >>file3 &&
		test_must_fail git rebase$type related-onto-branch &&
		test_path_is_file $dotest/autostash &&
		! grep dirty file3 &&
		echo "conflicting-plus-goodbye" >file2 &&
		git add file2 &&
		git rebase --continue &&
		test_path_is_missing $dotest/autostash &&
		grep dirty file3 &&
		git checkout feature-branch
	
HEAD is now at 0c4d2f1 third commit
Switched to a new branch 'rebased-feature-branch'
Successfully rebased and updated refs/heads/squash-works.
Successfully rebased and updated refs/heads/master.
Rebasing (4/4)
ok 32 - squash works as expected

expecting success: 
	git checkout -b interrupted-squash conflict-branch &&
	one=$(git rev-parse HEAD~3) &&
	set_fake_editor &&
	test_must_fail env FAKE_LINES="1 squash 3 2" git rebase -i HEAD~3 &&
	(echo one; echo two; echo four) > conflict &&
	git add conflict &&
	test_must_fail git rebase --continue &&
	echo resolved > conflict &&
	git add conflict &&
	git rebase --continue &&
	test $one = $(git rev-parse HEAD~2)

Switched to a new branch 'interrupted-squash'
First, rewinding head to replay your work on top of it...
ok 8 - auto squash that matches a commit after the squash

expecting success: 
	git reset --hard base &&
	echo 1 >file1 &&
	git add -u &&
	test_tick &&
	git commit -m "squash! $(git rev-parse --short HEAD^)" &&
	git tag final-shasquash &&
	test_tick &&
	git rebase --autosquash -i HEAD^^^ &&
	git log --oneline >actual &&
	test_line_count = 3 actual &&
	git diff --exit-code final-shasquash &&
	test 1 = "$(git cat-file blob HEAD^:file1)" &&
	test 1 = $(git cat-file commit HEAD^ | grep squash | wc -l)

Merging c with HEAD~1
Merging:
d9ea348 c
1bd0260 d
found 1 common ancestor:
020ea9b b
HEAD is now at f0c2a7e second commit
[detached HEAD 73a53c6] d
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 d.t
Committed: 0001 d
[master 2592f98] squash! 244a0fe
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Merging c with HEAD~0
Merging:
73a53c6 d
67a7211 e
found 1 common ancestor:
1bd0260 d
[detached HEAD 7d728d6] e
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:17:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 e.t
Committed: 0002 e
All done.
Created autostash: cdca6ca
HEAD is now at 0c4d2f1 third commit
ok 3 - simple rebase -m

expecting success: 
		reset_rebase &&
		git rebase -i c e &&
		test_cmp_rev c HEAD~2 &&
		test_linear_range 'd e' c..
	
First, rewinding head to replay your work on top of it...
Applying: second commit
No rebase in progress?
Using index info to reconstruct a base tree...
HEAD is now at 7d728d6 e
Falling back to patching base and 3-way merge...
Removing actual.rev
Removing expect.rev
Merging c57d2500845be9257e4e8523eba02ee67587d64e with second commit
Merging:
c57d250 related commit
virtual second commit
found 1 common ancestor:
virtual 4b825dc642cb6eb9a060e54bf8d69288fbee4904
Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
error: Failed to merge in the changes.
Patch failed at 0001 second commit
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

grep: file3: No such file or directory
rebase -i script before editing:
pick 766a798 two
pick 1eadf03 three
pick f91a2b3 four

rebase -i script after editing:
pick 766a798 two
squash f91a2b3 four
pick 1eadf03 three
Applying: second commit
Applying: third commit
Rebasing (2/3)
error: could not apply f91a2b3... four

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Auto-merging conflict
CONFLICT (content): Merge conflict in conflict

Could not apply f91a2b3a8b4c2fb71eba74bbf6661e6dd0b231fd... four

Rebasing (2/3)
Applied autostash.
dirty
Switched to branch 'feature-branch'
M	file3
Deleted branch rebased-feature-branch (was 51f2c81).
[detached HEAD ba6c8cf] first commit
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 2 files changed, 2 insertions(+)
 create mode 100644 file1
 create mode 100644 file2
ok 8 - rebase: --continue

expecting success: 
		test_config rebase.autostash true &&
		git reset --hard &&
		git checkout -b rebased-feature-branch feature-branch &&
		test_when_finished git branch -D rebased-feature-branch &&
		echo dirty >>file3 &&
		test_must_fail git rebase$type related-onto-branch &&
		test_path_is_file $dotest/autostash &&
		! grep dirty file3 &&
		git rebase --skip &&
		test_path_is_missing $dotest/autostash &&
		grep dirty file3 &&
		git checkout feature-branch
	
HEAD is now at 0c4d2f1 third commit
Switched to a new branch 'rebased-feature-branch'
Rebasing (1/2)
[detached HEAD 82f592b] two
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:23:13 2005 -0700
 1 file changed, 2 insertions(+)
Rebasing (3/3)
Rebasing (3/3)
Rebasing (2/2)
error: could not apply 1eadf03... three

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Auto-merging conflict
CONFLICT (content): Merge conflict in conflict
Could not apply 1eadf03e4079aebe25519a38e5142d033bdd2ec4... three
Created autostash: cdca6ca
HEAD is now at 0c4d2f1 third commit
First, rewinding head to replay your work on top of it...
[detached HEAD d5f0b37] three
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 3 deletions(-)
Applying: second commit
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Merging c57d2500845be9257e4e8523eba02ee67587d64e with second commit
Merging:
c57d250 related commit
error: Failed to merge in the changes.
virtual second commit
found 1 common ancestor:
virtual 4b825dc642cb6eb9a060e54bf8d69288fbee4904
Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
Patch failed at 0001 second commit
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

grep: file3: No such file or directory
Successfully rebased and updated refs/heads/interrupted-squash.
Rebasing (3/3)
ok 33 - interrupted squash works as expected

expecting success: 
	git checkout -b interrupted-squash2 conflict-branch &&
	one=$(git rev-parse HEAD~3) &&
	set_fake_editor &&
	test_must_fail env FAKE_LINES="3 squash 1 2" git rebase -i HEAD~3 &&
	(echo one; echo four) > conflict &&
	git add conflict &&
	test_must_fail git rebase --continue &&
	(echo one; echo two; echo four) > conflict &&
	git add conflict &&
	test_must_fail git rebase --continue &&
	echo resolved > conflict &&
	git add conflict &&
	git rebase --continue &&
	test $one = $(git rev-parse HEAD~2)

Switched to a new branch 'interrupted-squash2'
Applying: third commit
Successfully rebased and updated refs/heads/master.
Applied autostash.
dirty
Switched to branch 'feature-branch'
ok 9 - auto squash that matches a sha1

expecting success: 
	git reset --hard base &&
	echo 1 >file1 &&
	git add -u &&
	test_tick &&
	git commit -m "squash! $(git rev-parse --short=11 HEAD^)" &&
	git tag final-longshasquash &&
	test_tick &&
	git rebase --autosquash -i HEAD^^^ &&
	git log --oneline >actual &&
	test_line_count = 3 actual &&
	git diff --exit-code final-longshasquash &&
	test 1 = "$(git cat-file blob HEAD^:file1)" &&
	test 1 = $(git cat-file commit HEAD^ | grep squash | wc -l)

M	file3
Deleted branch rebased-feature-branch (was fa02356).
HEAD is now at f0c2a7e second commit
ok 9 - rebase: --skip

expecting success: 
		test_config rebase.autostash true &&
		git reset --hard &&
		git checkout -b rebased-feature-branch feature-branch &&
		test_when_finished git branch -D rebased-feature-branch &&
		echo dirty >>file3 &&
		test_must_fail git rebase$type related-onto-branch &&
		test_path_is_file $dotest/autostash &&
		! grep dirty file3 &&
		git rebase --abort &&
		test_path_is_missing $dotest/autostash &&
		grep dirty file3 &&
		git checkout feature-branch
	
Successfully rebased and updated detached HEAD.
HEAD is now at 0c4d2f1 third commit
[master 358ddef] squash! 244a0fe611d
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'rebased-feature-branch'
ok 4 - simple rebase -i

expecting success: 
		reset_rebase &&
		git rebase -p c e &&
		test_cmp_rev c HEAD~2 &&
		test_linear_range 'd e' c..
	
rebase -i script before editing:
pick 766a798 two
pick 1eadf03 three
pick f91a2b3 four

rebase -i script after editing:
pick f91a2b3 four
squash 766a798 two
pick 1eadf03 three
No rebase in progress?
HEAD is now at 7d728d6 e
Removing actual.rev
Removing expect.rev
Rebasing (1/3)
error: could not apply f91a2b3... four

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Auto-merging conflict
CONFLICT (content): Merge conflict in conflict
Created autostash: cdca6ca
Could not apply f91a2b3a8b4c2fb71eba74bbf6661e6dd0b231fd... four
HEAD is now at 0c4d2f1 third commit
First, rewinding head to replay your work on top of it...
Applying: second commit
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Merging c57d2500845be9257e4e8523eba02ee67587d64e with second commit
Merging:
c57d250 related commit
virtual second commit
found 1 common ancestor:
virtual 4b825dc642cb6eb9a060e54bf8d69288fbee4904
Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
error: Failed to merge in the changes.
Patch failed at 0001 second commit
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

grep: file3: No such file or directory
[detached HEAD 24cb541] four
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Rebasing (2/3)
Rebasing (2/3)
error: could not apply 766a798... two

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Auto-merging conflict
CONFLICT (content): Merge conflict in conflict

Could not apply 766a7986ddba629e2ea47f7642426eef74ae812d... two
Rebasing (1/2)
[detached HEAD 2fb404b] first commit
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 2 files changed, 2 insertions(+)
 create mode 100644 file1
 create mode 100644 file2

Rebasing (3/3)
Applied autostash.
dirty
Switched to branch 'feature-branch'
M	file3
Deleted branch rebased-feature-branch (was 0c4d2f1).
ok 10 - rebase: --abort

expecting success: 
		test_config rebase.autostash true &&
		git reset --hard &&
		git checkout -b rebased-feature-branch feature-branch &&
		test_when_finished git branch -D rebased-feature-branch &&
		echo dirty >file4 &&
		git add file4 &&
		git rebase$type unrelated-onto-branch &&
		test_path_is_missing $dotest &&
		git reset --hard &&
		grep unrelated file4 &&
		! grep dirty file4 &&
		git checkout feature-branch &&
		git stash pop &&
		grep dirty file4
	
Rebasing (2/2)
HEAD is now at 0c4d2f1 third commit
[detached HEAD fd1e6f3] four
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:25:13 2005 -0700
 1 file changed, 2 insertions(+)
Switched to a new branch 'rebased-feature-branch'
Rebasing (3/3)
error: could not apply 1eadf03... three

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Auto-merging conflict
CONFLICT (content): Merge conflict in conflict
Could not apply 1eadf03e4079aebe25519a38e5142d033bdd2ec4... three
[detached HEAD 9cc5563] three
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 3 deletions(-)
Created autostash: de4e47a
HEAD is now at 0c4d2f1 third commit
First, rewinding head to replay your work on top of it...
Rebasing (3/3)
Applying: second commit
Successfully rebased and updated refs/heads/interrupted-squash2.
Applying: third commit
ok 34 - interrupted squash works as expected (case 2)

expecting success: 
	echo unrelated > file7 &&
	git add file7 &&
	test_tick &&
	git commit -m "unrelated change" &&
	parent=$(git rev-parse HEAD^) &&
	test_tick &&
	set_fake_editor &&
	FAKE_LINES="edit 1" git rebase -i HEAD^ &&
	echo edited > file7 &&
	git add file7 &&
	FAKE_COMMIT_MESSAGE="chouette!" git rebase --continue &&
	test edited = $(git show HEAD:file7) &&
	git show HEAD | grep chouette &&
	test $parent = $(git rev-parse HEAD^)

[interrupted-squash2 639d3c3] unrelated change
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file7
Successfully rebased and updated refs/heads/master.
ok 10 - auto squash that matches longer sha1

expecting success: 
	test_auto_commit_flags fixup 1

HEAD is now at f0c2a7e second commit
[master ec3ac31] fixup! first commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Successfully rebased and updated detached HEAD.
Applying autostash resulted in conflicts.
Your changes are safe in the stash.
You can run "git stash pop" or "git stash drop" at any time.
HEAD is now at b607b14 third commit
unrelated
ok 5 - simple rebase -p

expecting success: 
		reset_rebase &&
		git rebase  b e &&
		test_cmp_rev e HEAD
	
Switched to branch 'feature-branch'
No rebase in progress?
HEAD is now at 7d728d6 e
rebase -i script before editing:
pick 639d3c3 unrelated change

rebase -i script after editing:
Removing actual.rev
Removing expect.rev
edit 639d3c3 unrelated change
Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual 28566cc718f43a597c158e8411c19d7048328a85
On branch feature-branch
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	new file:   file4

Rebasing (1/1)
Dropped refs/stash@{0} (de4e47a31ead4744c6d223df2e4638effc5ff8b7)
dirty
Stopped at 639d3c37b1c8d7e6453f4677e02a3b12e32f1765... unrelated change
Deleted branch rebased-feature-branch (was b607b14).
ok 11 - rebase: non-conflicting rebase, conflicting stash

expecting success: 
		test_config rebase.autostash true &&
		git reset --hard &&
		git checkout -b rebased-feature-branch feature-branch &&
		test_when_finished git branch -D rebased-feature-branch &&
		test_when_finished git checkout feature-branch &&
		echo dirty >>file3 &&
		test_must_fail git rebase$type --no-autostash unrelated-onto-branch
	
HEAD is now at 0c4d2f1 third commit
Current branch e is up to date.
Switched to a new branch 'rebased-feature-branch'
You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

ok 6 - rebase  is no-op if upstream is an ancestor

expecting success: 
		reset_rebase &&
		git rebase -m b e &&
		test_cmp_rev e HEAD
	
No rebase in progress?
HEAD is now at 67a7211 e
Removing actual.rev
Removing expect.rev
Cannot rebase: You have unstaged changes.
Please commit or stash them.
Switched to branch 'feature-branch'
M	file3
Deleted branch rebased-feature-branch (was 0c4d2f1).
ok 12 - rebase --merge: dirty worktree, --no-autostash

expecting success: 
		test_config rebase.autostash true &&
		git reset --hard &&
		git checkout -b rebased-feature-branch feature-branch &&
		test_when_finished git branch -D rebased-feature-branch &&
		echo dirty >>file3 &&
		git rebase$type unrelated-onto-branch &&
		grep unrelated file4 &&
		grep dirty file3 &&
		git checkout feature-branch
	
[detached HEAD 4d72f65] chouette!
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:47:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 file7
HEAD is now at 0c4d2f1 third commit
Switched to a new branch 'rebased-feature-branch'
Rebasing (2/3)
Rebasing (1/1)
Current branch e is up to date.
[detached HEAD 04a6f94] first commit
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 2 files changed, 2 insertions(+)
 create mode 100644 file1
 create mode 100644 file2
Successfully rebased and updated refs/heads/interrupted-squash2.
ok 7 - rebase -m is no-op if upstream is an ancestor

expecting success: 
		reset_rebase &&
		git rebase -i b e &&
		test_cmp_rev e HEAD
	
    chouette!
ok 35 - --continue tries to commit, even for "edit"

expecting success: 
	old=$(git rev-parse HEAD) &&
	test_tick &&
	set_fake_editor &&
	FAKE_LINES="edit 1" git rebase -i HEAD^ &&
	echo "edited again" > file7 &&
	git add file7 &&
	test_must_fail env FAKE_COMMIT_MESSAGE=" " git rebase --continue &&
	test $old = $(git rev-parse HEAD) &&
	git rebase --abort

No rebase in progress?
Rebasing (3/3)
HEAD is now at 67a7211 e
Removing actual.rev
Removing expect.rev
Created autostash: cdca6ca
HEAD is now at 0c4d2f1 third commit
First, rewinding head to replay your work on top of it...
Merging unrelated-onto-branch with HEAD~1
Merging:
4aede2f unrelated commit
6fe95e2 second commit
found 1 common ancestor:
bfa4f02 initial commit
[detached HEAD 54abd5c] second commit
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 2 files changed, 2 insertions(+)
 create mode 100644 file1
 create mode 100644 file2
Committed: 0001 rebase -i script before editing:
pick 4d72f65 chouette!

rebase -i script after editing:
edit 4d72f65 chouette!
second commit
Merging unrelated-onto-branch with HEAD~0
Merging:
54abd5c second commit
0c4d2f1 third commit
found 1 common ancestor:
6fe95e2 second commit
[detached HEAD b607b14] third commit
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 file3
Committed: 0002 third commit
Rebasing (1/1)
All done.
Stopped at 4d72f6579b9740891b223302a34a421d08bbf3a4... chouette!
You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

Successfully rebased and updated detached HEAD.
Rebasing (2/2)
ok 8 - rebase -i is no-op if upstream is an ancestor

expecting success: 
		reset_rebase &&
		git rebase -p b e &&
		test_cmp_rev e HEAD
	
Applied autostash.
unrelated
dirty
Switched to branch 'feature-branch'
M	file3
No rebase in progress?
Deleted branch rebased-feature-branch (was b607b14).
HEAD is now at 67a7211 e
ok 13 - rebase --merge: dirty worktree, non-conflicting rebase

expecting success: 
		test_config rebase.autostash true &&
		git reset --hard &&
		git checkout -b rebased-feature-branch feature-branch &&
		test_when_finished git branch -D rebased-feature-branch &&
		echo dirty >>file3 &&
		git add file3 &&
		git rebase$type unrelated-onto-branch &&
		grep unrelated file4 &&
		grep dirty file3 &&
		git checkout feature-branch
	
Aborting commit due to empty commit message.
Could not commit staged changes.
Removing actual.rev
Removing expect.rev
HEAD is now at 0c4d2f1 third commit
Switched to a new branch 'rebased-feature-branch'
Successfully rebased and updated refs/heads/master.
ok 11 - use commit --fixup

expecting success: 
	test_auto_commit_flags squash 2

HEAD is now at f0c2a7e second commit
ok 36 - aborted --continue does not squash commits after "edit"

expecting success: 
	test_tick &&
	set_fake_editor &&
	FAKE_LINES="edit 1" git rebase -i HEAD^ &&
	echo "edited again" > file7 &&
	git add file7 &&
	FAKE_COMMIT_MESSAGE="edited file7 again" git commit &&
	echo "and again" > file7 &&
	git add file7 &&
	test_tick &&
	test_must_fail env FAKE_COMMIT_MESSAGE="and again" git rebase --continue &&
	git rebase --abort

[master 56a0d48] squash! first commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Created autostash: e9af673
HEAD is now at 0c4d2f1 third commit
First, rewinding head to replay your work on top of it...
rebase -i script before editing:
pick 4d72f65 chouette!

rebase -i script after editing:
edit 4d72f65 chouette!
Merging unrelated-onto-branch with HEAD~1
Merging:
4aede2f unrelated commit
6fe95e2 second commit
found 1 common ancestor:
bfa4f02 initial commit
[detached HEAD 54abd5c] second commit
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 2 files changed, 2 insertions(+)
 create mode 100644 file1
 create mode 100644 file2
Committed: 0001 Rebasing (1/2)
second commit
Rebasing (1/1)
Merging unrelated-onto-branch with HEAD~0
Merging:
54abd5c second commit
0c4d2f1 third commit
found 1 common ancestor:
6fe95e2 second commit
[detached HEAD b607b14] third commit
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 file3
Stopped at 4d72f6579b9740891b223302a34a421d08bbf3a4... chouette!
Committed: 0002 third commit
All done.
You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

Rebasing (2/2)
Rebasing (2/3)
[detached HEAD c3f95ca] edited file7 again
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[detached HEAD ca39a78] first commit
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 2 files changed, 2 insertions(+)
 create mode 100644 file1
 create mode 100644 file2
Applied autostash.
unrelated
dirty
You have uncommitted changes in your working tree. Please, commit them
first and then run 'git rebase --continue' again.
Switched to branch 'feature-branch'
M	file3
Rebasing (3/3)
Deleted branch rebased-feature-branch (was b607b14).
ok 14 - rebase --merge: dirty index, non-conflicting rebase

expecting success: 
		test_config rebase.autostash true &&
		git reset --hard &&
		git checkout -b rebased-feature-branch feature-branch &&
		test_when_finished git branch -D rebased-feature-branch &&
		echo dirty >>file3 &&
		test_must_fail git rebase$type related-onto-branch &&
		test_path_is_file $dotest/autostash &&
		! grep dirty file3 &&
		rm -rf $dotest &&
		git reset --hard &&
		git checkout feature-branch
	
HEAD is now at 0c4d2f1 third commit
Switched to a new branch 'rebased-feature-branch'
ok 37 - auto-amend only edited commits after "edit"

expecting success: 
	test_tick &&
	test_when_finished "git rebase --abort || :" &&
	set_fake_editor &&
	test_must_fail env FAKE_LINES="1 exec_false" git rebase -i HEAD^ &&
	echo "edited again" > file7 &&
	git add file7 &&
	test_must_fail git rebase --continue 2>error &&
	grep "You have staged changes in your working tree." error

Created autostash: cdca6ca
HEAD is now at 0c4d2f1 third commit
First, rewinding head to replay your work on top of it...
rebase -i script before editing:
pick 4d72f65 chouette!

rebase -i script after editing:
pick 4d72f65 chouette!
exec false
Merging related-onto-branch with HEAD~1
Merging:
c57d250 related commit
6fe95e2 second commit
found 1 common ancestor:
bfa4f02 initial commit
Auto-merging file2
CONFLICT (add/add): Merge conflict in file2

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

grep: file3: No such file or directory
HEAD is now at c57d250 related commit
Previous HEAD position was c57d250... related commit
Switched to branch 'feature-branch'
Successfully rebased and updated detached HEAD.
Deleted branch rebased-feature-branch (was 0c4d2f1).
Rebasing (2/2)
Executing: false
ok 15 - rebase --merge: conflicting rebase

expecting success: 
		test_config rebase.autostash true &&
		git reset --hard &&
		git checkout -b rebased-feature-branch feature-branch &&
		test_when_finished git branch -D rebased-feature-branch &&
		echo dirty >>file3 &&
		test_must_fail git rebase$type related-onto-branch &&
		test_path_is_file $dotest/autostash &&
		! grep dirty file3 &&
		echo "conflicting-plus-goodbye" >file2 &&
		git add file2 &&
		git rebase --continue &&
		test_path_is_missing $dotest/autostash &&
		grep dirty file3 &&
		git checkout feature-branch
	
ok 9 - rebase -p is no-op if upstream is an ancestor

expecting success: 
		reset_rebase &&
		git rebase  -f b e &&
		! test_cmp_rev e HEAD &&
		test_cmp_rev b HEAD~2 &&
		test_linear_range 'd e' b..
	
Execution failed: false
You can fix the problem, and then run

	git rebase --continue

HEAD is now at 0c4d2f1 third commit
Switched to a new branch 'rebased-feature-branch'
No rebase in progress?
HEAD is now at 67a7211 e
Removing actual.rev
Removing expect.rev
You have staged changes in your working tree. If these changes are meant to be
Successfully rebased and updated refs/heads/master.
ok 12 - use commit --squash

expecting success: 
	test_auto_fixup_fixup fixup fixup

HEAD is now at f0c2a7e second commit
Current branch e is up to date, rebase forced.
[master f2259fa] fixup! first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 38 - clean error after failed "exec"

expecting success: 
	grandparent=$(git rev-parse HEAD~2) &&
	git checkout $(git rev-parse HEAD) &&
	test_tick &&
	set_fake_editor &&
	FAKE_LINES="2 1" git rebase -i HEAD~2 &&
	test $grandparent = $(git rev-parse HEAD~2)

First, rewinding head to replay your work on top of it...
[master a8ab281] fixup! fixup! first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Note: checking out '4d72f6579b9740891b223302a34a421d08bbf3a4'.

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 4d72f65... chouette!
Applying: d
Applying: e
Created autostash: cdca6ca
HEAD is now at 0c4d2f1 third commit
--- expect.rev	2015-12-16 10:52:57.925564796 +0000
+++ actual.rev	2015-12-16 10:52:57.941564796 +0000
@@ -1 +1 @@
-67a72118d5806fada2b50e3a56bde3a2b3e5bc77
+354afb0674237d49586fff12326488e8e1d7737f
First, rewinding head to replay your work on top of it...
ok 10 - rebase  -f rewrites even if upstream is an ancestor

expecting success: 
		reset_rebase &&
		git rebase -m -f b e &&
		! test_cmp_rev e HEAD &&
		test_cmp_rev b HEAD~2 &&
		test_linear_range 'd e' b..
	
Merging related-onto-branch with HEAD~1
Merging:
c57d250 related commit
6fe95e2 second commit
found 1 common ancestor:
bfa4f02 initial commit
Auto-merging file2
CONFLICT (add/add): Merge conflict in file2

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

grep: file3: No such file or directory
No rebase in progress?
HEAD is now at 354afb0 e
Removing actual.rev
Removing expect.rev
[detached HEAD 62edf38] second commit
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 file1
Committed: 0001 second commit
rebase -i script before editing:
pick 9cc5563 three
pick 4d72f65 chouette!

rebase -i script after editing:
pick 4d72f65 chouette!
pick 9cc5563 three
Merging related-onto-branch with HEAD~0
Merging:
62edf38 second commit
0c4d2f1 third commit
found 1 common ancestor:
6fe95e2 second commit
Current branch e is up to date, rebase forced.
First, rewinding head to replay your work on top of it...
[detached HEAD 51f2c81] third commit
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 file3
Committed: 0002 third commit
Merging b with HEAD~1
Merging:
020ea9b b
1bd0260 d
found 1 common ancestor:
020ea9b b
Could not execute editor
All done.
[detached HEAD ab4ddfd] d
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 d.t
Committed: 0001 d
Rebasing (1/2)
Merging b with HEAD~0
Merging:
ab4ddfd d
67a7211 e
found 1 common ancestor:
1bd0260 d
[detached HEAD 354afb0] e
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:17:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 e.t
Committed: 0002 e
All done.
--- expect.rev	2015-12-16 10:52:59.205564796 +0000
+++ actual.rev	2015-12-16 10:52:59.225564796 +0000
@@ -1 +1 @@
-67a72118d5806fada2b50e3a56bde3a2b3e5bc77
+354afb0674237d49586fff12326488e8e1d7737f
Applied autostash.
Rebasing (2/2)
ok 11 - rebase -m -f rewrites even if upstream is an ancestor

expecting success: 
		reset_rebase &&
		git rebase -i -f b e &&
		! test_cmp_rev e HEAD &&
		test_cmp_rev b HEAD~2 &&
		test_linear_range 'd e' b..
	
dirty
Switched to branch 'feature-branch'
M	file3
Deleted branch rebased-feature-branch (was 51f2c81).
No rebase in progress?
HEAD is now at 354afb0 e
ok 16 - rebase --merge: --continue

expecting success: 
		test_config rebase.autostash true &&
		git reset --hard &&
		git checkout -b rebased-feature-branch feature-branch &&
		test_when_finished git branch -D rebased-feature-branch &&
		echo dirty >>file3 &&
		test_must_fail git rebase$type related-onto-branch &&
		test_path_is_file $dotest/autostash &&
		! grep dirty file3 &&
		git rebase --skip &&
		test_path_is_missing $dotest/autostash &&
		grep dirty file3 &&
		git checkout feature-branch
	
Removing actual.rev
Removing expect.rev
HEAD is now at 0c4d2f1 third commit
Switched to a new branch 'rebased-feature-branch'
Successfully rebased and updated detached HEAD.
ok 39 - rebase a detached HEAD

expecting success: 

	mkdir -p .git/hooks &&
	PRE_COMMIT=.git/hooks/pre-commit &&
	echo "#!/bin/sh" > $PRE_COMMIT &&
	echo "test -z \"\$(git diff --cached --check)\"" >> $PRE_COMMIT &&
	chmod a+x $PRE_COMMIT &&
	echo "monde! " >> file1 &&
	test_tick &&
	test_must_fail git commit -m doesnt-verify file1 &&
	git commit -m doesnt-verify --no-verify file1 &&
	test_tick &&
	set_fake_editor &&
	FAKE_LINES=2 git rebase -i HEAD~2


[detached HEAD fd4dcb6] doesnt-verify
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Rebasing (2/4)
Created autostash: cdca6ca
HEAD is now at 0c4d2f1 third commit
First, rewinding head to replay your work on top of it...
Rebasing (1/2)
rebase -i script before editing:
pick 91efb7d three
pick fd4dcb6 doesnt-verify

rebase -i script after editing:
Merging related-onto-branch with HEAD~1
Merging:
c57d250 related commit
6fe95e2 second commit
found 1 common ancestor:
bfa4f02 initial commit
Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
pick fd4dcb6 doesnt-verify

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

grep: file3: No such file or directory
Rebasing (3/4)
Rebasing (2/2)
Rebasing (1/1)
[detached HEAD ab88726] first commit
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 2 files changed, 2 insertions(+)
 create mode 100644 file1
 create mode 100644 file2
Merging related-onto-branch with HEAD~0
Merging:
c57d250 related commit
0c4d2f1 third commit
found 1 common ancestor:
6fe95e2 second commit
[detached HEAD fa02356] third commit
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 file3
Committed: 0002 third commit
Successfully rebased and updated detached HEAD.
Rebasing (4/4)
ok 40 - rebase a commit violating pre-commit

expecting success: 

	rm -fr .git/hooks &&
	git reset --hard &&
	git checkout -b branch3 A &&

	(
		GIT_AUTHOR_NAME="Squashed Away" &&
		export GIT_AUTHOR_NAME &&
		>HEAD &&
		git add HEAD &&
		git commit -m "Add head" &&
		>BODY &&
		git add BODY &&
		git commit -m "Add body"
	) &&

	set_fake_editor &&
	FAKE_LINES="1 squash 2" git rebase -i to-be-rebased &&
	test "$(git show -s --pretty=format:%an)" = "Squashed Away"


All done.
HEAD is now at 00a6aa9 doesnt-verify
Warning: you are leaving 2 commits behind, not connected to
any of your branches:

  00a6aa9 doesnt-verify
  6da2d20 chouette!

If you want to keep them by creating a new branch, this may be a good time
to do so with:

 git branch <new-branch-name> 00a6aa9

Switched to a new branch 'branch3'
[branch3 8e8c11e] Add head
 Author: Squashed Away <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 HEAD
[branch3 da135e8] Add body
 Author: Squashed Away <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 BODY
Applied autostash.
dirty
Switched to branch 'feature-branch'
M	file3
Deleted branch rebased-feature-branch (was fa02356).
ok 17 - rebase --merge: --skip

expecting success: 
		test_config rebase.autostash true &&
		git reset --hard &&
		git checkout -b rebased-feature-branch feature-branch &&
		test_when_finished git branch -D rebased-feature-branch &&
		echo dirty >>file3 &&
		test_must_fail git rebase$type related-onto-branch &&
		test_path_is_file $dotest/autostash &&
		! grep dirty file3 &&
		git rebase --abort &&
		test_path_is_missing $dotest/autostash &&
		grep dirty file3 &&
		git checkout feature-branch
	
HEAD is now at 0c4d2f1 third commit
Switched to a new branch 'rebased-feature-branch'
rebase -i script before editing:
pick 8e8c11e Add head
pick da135e8 Add body

rebase -i script after editing:
pick 8e8c11e Add head
squash da135e8 Add body
Successfully rebased and updated detached HEAD.
Created autostash: cdca6ca
HEAD is now at 0c4d2f1 third commit
--- expect.rev	2015-12-16 10:53:03.149564796 +0000
+++ actual.rev	2015-12-16 10:53:03.169564796 +0000
@@ -1 +1 @@
-67a72118d5806fada2b50e3a56bde3a2b3e5bc77
+354afb0674237d49586fff12326488e8e1d7737f
Rebasing (1/2)
First, rewinding head to replay your work on top of it...
ok 12 - rebase -i -f rewrites even if upstream is an ancestor

checking known breakage: 
		reset_rebase &&
		git rebase -p -f b e &&
		! test_cmp_rev e HEAD &&
		test_cmp_rev b HEAD~2 &&
		test_linear_range 'd e' b..
	
Merging related-onto-branch with HEAD~1
Merging:
c57d250 related commit
6fe95e2 second commit
found 1 common ancestor:
bfa4f02 initial commit
Auto-merging file2
CONFLICT (add/add): Merge conflict in file2

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Successfully rebased and updated refs/heads/master.
grep: file3: No such file or directory
No rebase in progress?
HEAD is now at 354afb0 e
Rebasing (2/2)
Removing actual.rev
Removing expect.rev
ok 13 - fixup! fixup!

expecting success: 
	test_auto_fixup_fixup fixup squash

HEAD is now at f0c2a7e second commit
[master a1ad567] fixup! first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master ec0f8ee] fixup! squash! first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[detached HEAD 641d36b] Add head
 Author: Squashed Away <author@example.com>
 Date: Thu Apr 7 15:55:13 2005 -0700
 2 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 BODY
 create mode 100644 HEAD
Successfully rebased and updated refs/heads/branch3.
ok 41 - rebase with a file named HEAD in worktree

expecting success: 

	git checkout -b branch4 HEAD &&
	GIT_EDITOR=: git commit --amend \
		--author="Somebody else <somebody@else.com>" &&
	test $(git rev-parse branch3) != $(git rev-parse branch4) &&
	set_fake_editor &&
	git rebase -i branch3 &&
	test $(git rev-parse branch3) = $(git rev-parse branch4)


Switched to a new branch 'branch4'
[branch4 63e1539] Add head
 Author: Somebody else <somebody@else.com>
 Date: Thu Apr 7 15:55:13 2005 -0700
 2 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 BODY
 create mode 100644 HEAD
Applied autostash.
dirty
Switched to branch 'feature-branch'
M	file3
Deleted branch rebased-feature-branch (was 0c4d2f1).
ok 18 - rebase --merge: --abort

expecting success: 
		test_config rebase.autostash true &&
		git reset --hard &&
		git checkout -b rebased-feature-branch feature-branch &&
		test_when_finished git branch -D rebased-feature-branch &&
		echo dirty >file4 &&
		git add file4 &&
		git rebase$type unrelated-onto-branch &&
		test_path_is_missing $dotest &&
		git reset --hard &&
		grep unrelated file4 &&
		! grep dirty file4 &&
		git checkout feature-branch &&
		git stash pop &&
		grep dirty file4
	
HEAD is now at 0c4d2f1 third commit
Switched to a new branch 'rebased-feature-branch'
Could not execute editor
Rebasing (1/2)
Rebasing (2/2)
Rebasing (1/1)
Created autostash: de4e47a
HEAD is now at 0c4d2f1 third commit
First, rewinding head to replay your work on top of it...
Merging unrelated-onto-branch with HEAD~1
Merging:
4aede2f unrelated commit
6fe95e2 second commit
found 1 common ancestor:
bfa4f02 initial commit
[detached HEAD 54abd5c] second commit
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 2 files changed, 2 insertions(+)
 create mode 100644 file1
 create mode 100644 file2
Committed: 0001 second commit
Merging unrelated-onto-branch with HEAD~0
Merging:
54abd5c second commit
0c4d2f1 third commit
found 1 common ancestor:
6fe95e2 second commit
[detached HEAD b607b14] third commit
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 file3
Committed: 0002 third commit
All done.
Rebasing (2/4)
Applying autostash resulted in conflicts.
Your changes are safe in the stash.
You can run "git stash pop" or "git stash drop" at any time.
HEAD is now at b607b14 third commit
unrelated
Switched to branch 'feature-branch'
Successfully rebased and updated refs/heads/branch4.
ok 42 - do "noop" when there is nothing to cherry-pick

expecting success: 
	git checkout A &&
	mkdir sub &&
	(
		cd sub && git init && >elif &&
		git add elif && git commit -m "submodule initial"
	) &&
	echo 1 >file1 &&
	git add file1 sub &&
	test_tick &&
	git commit -m "One" &&
	echo 2 >file1 &&
	test_tick &&
	git commit -a -m "Two" &&
	(
		cd sub && echo 3 >elif &&
		git commit -a -m "submodule second"
	) &&
	test_tick &&
	set_fake_editor &&
	git commit -a -m "Three changes submodule"

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 6e62bf8... A
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3404-rebase-interactive/sub/.git/
Rebasing (3/4)
Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual 28566cc718f43a597c158e8411c19d7048328a85
[master (root-commit) 4a0bc3c] submodule initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 elif
Successfully rebased and updated detached HEAD.
On branch feature-branch
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	new file:   file4

[detached HEAD 53cff8c] One
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 160000 sub
Dropped refs/stash@{0} (de4e47a31ead4744c6d223df2e4638effc5ff8b7)
[detached HEAD 88cd197] Two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
not ok 13 - rebase -p -f rewrites even if upstream is an ancestor # TODO known breakage

expecting success: 
		reset_rebase &&
		git rebase  e b &&
		test_cmp_rev e HEAD
	
dirty
[master 19223c5] submodule second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[detached HEAD 6ebda46] first commit
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 2 files changed, 2 insertions(+)
 create mode 100644 file1
 create mode 100644 file2
Deleted branch rebased-feature-branch (was b607b14).
ok 19 - rebase --merge: non-conflicting rebase, conflicting stash

expecting success: 
		test_config rebase.autostash true &&
		git reset --hard &&
		git checkout -b rebased-feature-branch feature-branch &&
		test_when_finished git branch -D rebased-feature-branch &&
		test_when_finished git checkout feature-branch &&
		echo dirty >>file3 &&
		test_must_fail git rebase$type --no-autostash unrelated-onto-branch
	
[detached HEAD 583ddaf] Three changes submodule
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 43 - submodule rebase setup

expecting success: 
	set_fake_editor &&
	FAKE_LINES="1 squash 2 3" git rebase -i A

HEAD is now at 0c4d2f1 third commit
No rebase in progress?
Switched to a new branch 'rebased-feature-branch'
Rebasing (4/4)
HEAD is now at 67a7211 e
Removing actual.rev
Removing expect.rev
Cannot rebase: You have unstaged changes.
Please commit or stash them.
Switched to branch 'feature-branch'
M	file3
First, rewinding head to replay your work on top of it...
Deleted branch rebased-feature-branch (was 0c4d2f1).
ok 20 - rebase --interactive: dirty worktree, --no-autostash

expecting success: 
		test_config rebase.autostash true &&
		git reset --hard &&
		git checkout -b rebased-feature-branch feature-branch &&
		test_when_finished git branch -D rebased-feature-branch &&
		echo dirty >>file3 &&
		git rebase$type unrelated-onto-branch &&
		grep unrelated file4 &&
		grep dirty file3 &&
		git checkout feature-branch
	
Fast-forwarded b to e.
HEAD is now at 0c4d2f1 third commit
Switched to a new branch 'rebased-feature-branch'
ok 14 - rebase  fast-forwards from ancestor of upstream

expecting success: 
		reset_rebase &&
		git rebase -m e b &&
		test_cmp_rev e HEAD
	
No rebase in progress?
HEAD is now at 67a7211 e
Removing actual.rev
Removing expect.rev
rebase -i script before editing:
pick 53cff8c One
pick 88cd197 Two
pick 583ddaf Three changes submodule

rebase -i script after editing:
pick 53cff8c One
squash 88cd197 Two
pick 583ddaf Three changes submodule
First, rewinding head to replay your work on top of it...
Fast-forwarded b to e.
ok 15 - rebase -m fast-forwards from ancestor of upstream

expecting success: 
		reset_rebase &&
		git rebase -i e b &&
		test_cmp_rev e HEAD
	
Rebasing (2/3)
Created autostash: cdca6ca
HEAD is now at 0c4d2f1 third commit
No rebase in progress?
HEAD is now at 67a7211 e
Removing actual.rev
Removing expect.rev
[detached HEAD b385410] One
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:56:13 2005 -0700
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 160000 sub
Successfully rebased and updated refs/heads/master.
Rebasing (3/3)
ok 14 - fixup! squash!

expecting success: 
	test_auto_fixup_fixup squash squash

Successfully rebased and updated detached HEAD.
HEAD is now at f0c2a7e second commit
ok 44 - submodule rebase -i

expecting success: 
	git tag submodule-base &&
	git checkout HEAD^ &&
	(
		cd sub && git checkout HEAD^ && echo 4 >elif &&
		git add elif && git commit -m "submodule conflict"
	) &&
	git add sub &&
	test_tick &&
	git commit -m "Conflict in submodule" &&
	git tag submodule-topic

[master b3c0532] squash! first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Previous HEAD position was 19d4a27... Three changes submodule
HEAD is now at b385410... One
M	sub
[master 90b2119] squash! squash! first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
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 4a0bc3c... submodule initial
Rebasing (1/2)
[detached HEAD 074fb32] submodule conflict
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[detached HEAD cab564f] Conflict in submodule
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 45 - submodule conflict setup

expecting success: 
	set_fake_editor &&
	test_must_fail git rebase -i submodule-base &&
	git add sub &&
	git rebase --continue &&
	test $(git rev-parse submodule-base) != $(git rev-parse HEAD)

Could not execute editor
Rebasing (1/1)
Rebasing (2/2)
Rebasing (1/1)
warning: Failed to merge submodule sub (merge following commits not found)
error: could not apply cab564f... Conflict in submodule

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Auto-merging sub
CONFLICT (submodule): Merge conflict in sub
Could not apply cab564f66afad2bfd8d7f997b57a791e2879e0b3... Conflict in submodule
Successfully rebased and updated detached HEAD.
ok 16 - rebase -i fast-forwards from ancestor of upstream

expecting success: 
		reset_rebase &&
		git rebase -p e b &&
		test_cmp_rev e HEAD
	
[detached HEAD ef324b9] Conflict in submodule
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
No rebase in progress?
HEAD is now at 67a7211 e
Successfully rebased and updated refs/heads/rebased-feature-branch.
Removing actual.rev
Removing expect.rev
Rebasing (1/1)
Applied autostash.
unrelated
dirty
Switched to branch 'feature-branch'
M	file3
Deleted branch rebased-feature-branch (was b607b14).
ok 21 - rebase --interactive: dirty worktree, non-conflicting rebase

expecting success: 
		test_config rebase.autostash true &&
		git reset --hard &&
		git checkout -b rebased-feature-branch feature-branch &&
		test_when_finished git branch -D rebased-feature-branch &&
		echo dirty >>file3 &&
		git add file3 &&
		git rebase$type unrelated-onto-branch &&
		grep unrelated file4 &&
		grep dirty file3 &&
		git checkout feature-branch
	
Rebasing (2/4)
HEAD is now at 0c4d2f1 third commit
Switched to a new branch 'rebased-feature-branch'
Rebasing (3/4)
Rebasing (1/1)
[detached HEAD 0c6388e] first commit
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 2 files changed, 2 insertions(+)
 create mode 100644 file1
 create mode 100644 file2
Rebasing (4/4)
Created autostash: e9af673
Successfully rebased and updated detached HEAD.
HEAD is now at 0c4d2f1 third commit
ok 46 - rebase -i continue with only submodule staged

expecting success: 
	git checkout submodule-topic &&
	git reset --hard &&
	set_fake_editor &&
	test_must_fail git rebase -i submodule-base &&
	git reset &&
	git rebase --continue &&
	test $(git rev-parse submodule-base) = $(git rev-parse HEAD)

Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  ef324b9 Conflict in submodule

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> ef324b9

HEAD is now at cab564f... Conflict in submodule
HEAD is now at cab564f Conflict in submodule
Successfully rebased and updated detached HEAD.
Rebasing (1/2)
ok 17 - rebase -p fast-forwards from ancestor of upstream

expecting success: 
	git checkout c &&
	test_commit g &&
	revert h g &&
	git checkout d &&
	cherry_pick gp g &&
	test_commit i &&
	git checkout b &&
	test_commit f

Previous HEAD position was 67a7211... e
HEAD is now at d9ea348... c
[detached HEAD 5573dba] g
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 g.t
Removing g.t
Rebasing (2/2)
[detached HEAD 09e6546] h
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 g.t
Previous HEAD position was 09e6546... h
HEAD is now at 1bd0260... d
Rebasing (1/1)
warning: Failed to merge submodule sub (merge following commits not found)
error: could not apply cab564f... Conflict in submodule

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Auto-merging sub
CONFLICT (submodule): Merge conflict in sub
[detached HEAD 00eccdb] gp
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 g.t
[detached HEAD 3317c29] i
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 i.t
Could not apply cab564f66afad2bfd8d7f997b57a791e2879e0b3... Conflict in submodule
Unstaged changes after reset:
M	sub
Previous HEAD position was 3317c29... i
HEAD is now at 020ea9b... b
[detached HEAD 09e072f] f
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 f.t
ok 18 - setup of linear history for range selection tests

expecting success: 
		reset_rebase &&
		git rebase  h i &&
		test_cmp_rev h HEAD~2 &&
		test_linear_range 'd i' h..
	
Successfully rebased and updated refs/heads/master.
ok 15 - squash! squash!

expecting success: 
	test_auto_fixup_fixup squash fixup

No rebase in progress?
HEAD is now at 09e072f f
HEAD is now at f0c2a7e second commit
Removing actual.rev
Removing expect.rev
[master 9e62506] squash! first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master baa3050] squash! fixup! first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Rebasing (1/1)
First, rewinding head to replay your work on top of it...
Applying: d
Applying: i
ok 19 - rebase  drops patches in upstream

checking known breakage: 
		reset_rebase &&
		git rebase -m h i &&
		test_cmp_rev h HEAD~2 &&
		test_linear_range 'd i' h..
	
No rebase in progress?
HEAD is now at 5c158e9 i
Removing actual.rev
Removing expect.rev
Successfully rebased and updated refs/heads/rebased-feature-branch.
Could not execute editor
First, rewinding head to replay your work on top of it...
Merging h with HEAD~2
Merging:
09e6546 h
1bd0260 d
found 1 common ancestor:
020ea9b b
Applied autostash.
[detached HEAD e937a8e] d
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 d.t
Committed: 0001 unrelated
d
dirty
Successfully rebased and updated detached HEAD.
Switched to branch 'feature-branch'
M	file3
Merging h with HEAD~1
Merging:
e937a8e d
00eccdb gp
found 1 common ancestor:
1bd0260 d
Deleted branch rebased-feature-branch (was b607b14).
ok 47 - rebase -i continue with unstaged submodule

expecting success: 
	git checkout master &&
	git reset --hard &&
	test-chmtime =123456789 file3 &&
	git update-index --refresh &&
	HEAD=$(git rev-parse HEAD) &&
	set_fake_editor &&
	git rebase -i HEAD~4 &&
	test $HEAD = $(git rev-parse HEAD) &&
	MTIME=$(test-chmtime -v +0 file3 | sed s/[^0-9].*$//) &&
	test 123456789 = $MTIME

ok 22 - rebase --interactive: dirty index, non-conflicting rebase

expecting success: 
		test_config rebase.autostash true &&
		git reset --hard &&
		git checkout -b rebased-feature-branch feature-branch &&
		test_when_finished git branch -D rebased-feature-branch &&
		echo dirty >>file3 &&
		test_must_fail git rebase$type related-onto-branch &&
		test_path_is_file $dotest/autostash &&
		! grep dirty file3 &&
		rm -rf $dotest &&
		git reset --hard &&
		git checkout feature-branch
	
warning: unable to rmdir sub: Directory not empty
[detached HEAD 4a12efe] gp
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:18:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 g.t
Committed: 0002 HEAD is now at 0c4d2f1 third commit
Previous HEAD position was 19d4a27... Three changes submodule
Switched to branch 'master'
gp
Switched to a new branch 'rebased-feature-branch'
HEAD is now at 8f99a4f E
Merging h with HEAD~0
Merging:
4a12efe gp
3317c29 i
found 1 common ancestor:
00eccdb gp
[detached HEAD bbe8f41] i
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:19:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 i.t
Committed: 0003 i
All done.
--- expect.rev	2015-12-16 10:53:17.997564798 +0000
+++ actual.rev	2015-12-16 10:53:18.021564798 +0000
@@ -1 +1 @@
-09e6546083fde009871b0716b2797b792e65e541
+e937a8e882fbebb0b2205dd9459e6ecb99b2ab16
not ok 20 - rebase -m drops patches in upstream # TODO known breakage

expecting success: 
		reset_rebase &&
		git rebase -i h i &&
		test_cmp_rev h HEAD~2 &&
		test_linear_range 'd i' h..
	
No rebase in progress?
HEAD is now at bbe8f41 i
Removing actual.rev
Removing expect.rev
Created autostash: cdca6ca
HEAD is now at 0c4d2f1 third commit
Successfully rebased and updated refs/heads/master.
Rebasing (2/4)
Rebasing (3/4)
Rebasing (4/4)
ok 48 - avoid unnecessary reset

expecting success: 
	git checkout -b reword-branch master &&
	set_fake_editor &&
	FAKE_LINES="1 2 3 reword 4" FAKE_COMMIT_MESSAGE="E changed" git rebase -i A &&
	git show HEAD | grep "E changed" &&
	test $(git rev-parse master) != $(git rev-parse HEAD) &&
	test $(git rev-parse master^) = $(git rev-parse HEAD^) &&
	FAKE_LINES="1 2 reword 3 4" FAKE_COMMIT_MESSAGE="D changed" git rebase -i A &&
	git show HEAD^ | grep "D changed" &&
	FAKE_LINES="reword 1 2 3 4" FAKE_COMMIT_MESSAGE="B changed" git rebase -i A &&
	git show HEAD~3 | grep "B changed" &&
	FAKE_LINES="1 reword 2 3 4" FAKE_COMMIT_MESSAGE="C changed" git rebase -i A &&
	git show HEAD~2 | grep "C changed"

Switched to a new branch 'reword-branch'
Rebasing (1/2)
[detached HEAD f53dd90] first commit
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 2 files changed, 2 insertions(+)
 create mode 100644 file1
 create mode 100644 file2
Rebasing (1/2)
error: could not apply 6fe95e2... second commit

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
Could not apply 6fe95e2a50033c9952c2a4cd5192f814def900d6... second commit
grep: file3: No such file or directory
Rebasing (4/4)
HEAD is now at c57d250 related commit
Previous HEAD position was c57d250... related commit
Switched to branch 'feature-branch'
Deleted branch rebased-feature-branch (was 0c4d2f1).
Rebasing (2/2)
ok 23 - rebase --interactive: conflicting rebase

expecting success: 
		test_config rebase.autostash true &&
		git reset --hard &&
		git checkout -b rebased-feature-branch feature-branch &&
		test_when_finished git branch -D rebased-feature-branch &&
		echo dirty >>file3 &&
		test_must_fail git rebase$type related-onto-branch &&
		test_path_is_file $dotest/autostash &&
		! grep dirty file3 &&
		echo "conflicting-plus-goodbye" >file2 &&
		git add file2 &&
		git rebase --continue &&
		test_path_is_missing $dotest/autostash &&
		grep dirty file3 &&
		git checkout feature-branch
	
HEAD is now at 0c4d2f1 third commit
Switched to a new branch 'rebased-feature-branch'
rebase -i script before editing:
pick 313fe96 B
pick d0f65f2 C
pick 0547e3f D
pick 8f99a4f E

rebase -i script after editing:
pick 313fe96 B
pick d0f65f2 C
pick 0547e3f D
reword 8f99a4f E
Created autostash: cdca6ca
HEAD is now at 0c4d2f1 third commit
Rebasing (4/4)
[detached HEAD 40e71ef] E changed
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:17:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 file3
Successfully rebased and updated refs/heads/reword-branch.
    E changed
Successfully rebased and updated refs/heads/master.
ok 16 - squash! fixup!

expecting success: 
	git reset --hard base &&
	git config --add rebase.instructionFormat "[%an @ %ar] %s"  &&
	echo 2 >file1 &&
	git add -u &&
	test_tick &&
	git commit -m "squash! $(git rev-parse --short HEAD^)" &&
	echo 1 >file1 &&
	git add -u &&
	test_tick &&
	git commit -m "squash! $(git log -n 1 --format=%s HEAD~2)" &&
	git tag final-squash-instFmt &&
	test_tick &&
	git rebase --autosquash -i HEAD~4 &&
	git log --oneline >actual &&
	test_line_count = 3 actual &&
	git diff --exit-code final-squash-instFmt &&
	test 1 = "$(git cat-file blob HEAD^:file1)" &&
	test 2 = $(git cat-file commit HEAD^ | grep squash | wc -l)

Successfully rebased and updated detached HEAD.
HEAD is now at f0c2a7e second commit
Rebasing (1/2)
ok 21 - rebase -i drops patches in upstream

expecting success: 
		reset_rebase &&
		git rebase -p h i &&
		test_cmp_rev h HEAD~2 &&
		test_linear_range 'd i' h..
	
[master 8c2a608] squash! 244a0fe
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
error: could not apply 6fe95e2... second commit

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
[master ab98abd] squash! first commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
No rebase in progress?
Could not apply 6fe95e2a50033c9952c2a4cd5192f814def900d6... second commit
grep: file3: No such file or directory
HEAD is now at 5c158e9 i
Removing actual.rev
Removing expect.rev
[detached HEAD 62edf38] second commit
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 file1
rebase -i script before editing:
pick 313fe96 B
pick d0f65f2 C
pick 0547e3f D
pick 40e71ef E changed

rebase -i script after editing:
pick 313fe96 B
pick d0f65f2 C
reword 0547e3f D
pick 40e71ef E changed
Rebasing (2/2)
Rebasing (3/4)
[detached HEAD e733dfe] D changed
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
Successfully rebased and updated refs/heads/reword-branch.
Rebasing (4/4)
Rebasing (2/4)
Rebasing (1/2)
    D changed
Rebasing (3/4)
Rebasing (2/2)
[detached HEAD a066413] first commit
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 2 files changed, 2 insertions(+)
 create mode 100644 file1
 create mode 100644 file2
Successfully rebased and updated refs/heads/rebased-feature-branch.
Rebasing (4/4)
rebase -i script before editing:
pick 313fe96 B
pick d0f65f2 C
pick e733dfe D changed
pick 20cfbae E changed

rebase -i script after editing:
reword 313fe96 B
pick d0f65f2 C
pick e733dfe D changed
pick 20cfbae E changed
Applied autostash.
dirty
Switched to branch 'feature-branch'
M	file3
Rebasing (1/4)
Deleted branch rebased-feature-branch (was 51f2c81).
ok 24 - rebase --interactive: --continue

expecting success: 
		test_config rebase.autostash true &&
		git reset --hard &&
		git checkout -b rebased-feature-branch feature-branch &&
		test_when_finished git branch -D rebased-feature-branch &&
		echo dirty >>file3 &&
		test_must_fail git rebase$type related-onto-branch &&
		test_path_is_file $dotest/autostash &&
		! grep dirty file3 &&
		git rebase --skip &&
		test_path_is_missing $dotest/autostash &&
		grep dirty file3 &&
		git checkout feature-branch
	
HEAD is now at 0c4d2f1 third commit
Switched to a new branch 'rebased-feature-branch'
[detached HEAD e553464] B changed
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
Successfully rebased and updated detached HEAD.
Rebasing (2/4)
Rebasing (3/4)
Rebasing (4/4)
Created autostash: cdca6ca
HEAD is now at 0c4d2f1 third commit
ok 22 - rebase -p drops patches in upstream

expecting success: 
		reset_rebase &&
		git rebase  h gp &&
		test_cmp_rev h HEAD^ &&
		test_linear_range 'd' h..
	
Successfully rebased and updated refs/heads/master.
Successfully rebased and updated refs/heads/reword-branch.
No rebase in progress?
HEAD is now at 5c158e9 i
    B changed
Removing actual.rev
Removing expect.rev
ok 17 - autosquash with custom inst format

# passed all 17 test(s)
1..17
*** t3425-rebase-topology-merges.sh ***
First, rewinding head to replay your work on top of it...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3425-rebase-topology-merges/.git/
expecting success: 
	test_commit a &&
	test_commit b &&
	test_commit c &&
	git checkout b &&
	test_commit d &&
	test_commit e &&

	git checkout c &&
	test_commit g &&
	revert h g &&
	git checkout d &&
	cherry_pick gp g &&
	test_commit i &&
	git checkout b &&
	test_commit f &&

	git checkout d &&
	test_commit n &&
	test_commit o &&
	test_merge w e &&
	test_merge v c &&
	git checkout o &&
	test_commit z

Applying: d
[master (root-commit) ce450c7] a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a.t
[master 020ea9b] b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 b.t
Rebasing (1/2)
ok 23 - rebase  can drop last patch if in upstream

checking known breakage: 
		reset_rebase &&
		git rebase -m h gp &&
		test_cmp_rev h HEAD^ &&
		test_linear_range 'd' h..
	
[master d9ea348] c
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c.t
error: could not apply 6fe95e2... second commit

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
Note: checking out 'b'.

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 020ea9b... b
[detached HEAD 1bd0260] d
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 d.t
No rebase in progress?
Could not apply 6fe95e2a50033c9952c2a4cd5192f814def900d6... second commit
grep: file3: No such file or directory
HEAD is now at e937a8e d
Removing actual.rev
Removing expect.rev
rebase -i script before editing:
[detached HEAD 67a7211] e
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 e.t
pick e553464 B changed
pick a133a8b C
pick 63b49e9 D changed
pick b343f31 E changed

rebase -i script after editing:
pick e553464 B changed
reword a133a8b C
pick 63b49e9 D changed
pick b343f31 E changed
Previous HEAD position was 67a7211... e
HEAD is now at d9ea348... c
[detached HEAD 5573dba] g
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 g.t
Removing g.t
[detached HEAD 09e6546] h
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 g.t
Rebasing (2/2)
First, rewinding head to replay your work on top of it...
Previous HEAD position was 09e6546... h
HEAD is now at 1bd0260... d
[detached HEAD 00eccdb] gp
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 g.t
Rebasing (2/4)
Merging h with HEAD~1
Merging:
09e6546 h
1bd0260 d
found 1 common ancestor:
020ea9b b
[detached HEAD 3317c29] i
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 i.t
Previous HEAD position was 3317c29... i
[detached HEAD e937a8e] d
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 d.t
HEAD is now at 020ea9b... b
Committed: 0001 [detached HEAD ea24b26] C changed
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 file2
d
[detached HEAD 09e072f] f
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 f.t
Merging h with HEAD~0
Merging:
e937a8e d
00eccdb gp
found 1 common ancestor:
1bd0260 d
Previous HEAD position was 09e072f... f
HEAD is now at 1bd0260... d
Rebasing (3/4)
[detached HEAD 4a12efe] gp
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:18:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 g.t
Committed: 0002 [detached HEAD 35a5a4f] n
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 n.t
gp
All done.
[detached HEAD a60ff6b] o
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 o.t
--- expect.rev	2015-12-16 10:53:28.285564799 +0000
+++ actual.rev	2015-12-16 10:53:28.317564799 +0000
@@ -1 +1 @@
-09e6546083fde009871b0716b2797b792e65e541
+e937a8e882fbebb0b2205dd9459e6ecb99b2ab16
not ok 24 - rebase -m can drop last patch if in upstream # TODO known breakage

expecting success: 
		reset_rebase &&
		git rebase -i h gp &&
		test_cmp_rev h HEAD^ &&
		test_linear_range 'd' h..
	
Merging:
a60ff6b o
virtual e
found 1 common ancestor:
1bd0260 d
Merge made by the 'recursive' strategy.
 e.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 e.t
Rebasing (4/4)
Merging:
df2bcbf w
virtual c
found 1 common ancestor:
020ea9b b
Merge made by the 'recursive' strategy.
 c.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 c.t
No rebase in progress?
Previous HEAD position was 253142b... v
HEAD is now at a60ff6b... o
HEAD is now at 4a12efe gp
Removing actual.rev
Removing expect.rev
[detached HEAD 6fadda8] z
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 z.t
ok 1 - setup of non-linear-history

expecting success: 
		reset_rebase &&
		git rebase  e w &&
		test_cmp_rev e HEAD~2 &&
		test_linear_range 'n o' e..
	
Successfully rebased and updated refs/heads/reword-branch.
    C changed
ok 49 - reword

expecting success: 
	git config notes.rewrite.rebase true &&
	git config notes.rewriteRef "refs/notes/*" &&
	test_commit n1 &&
	test_commit n2 &&
	test_commit n3 &&
	git notes add -m"a note" n3 &&
	set_fake_editor &&
	git rebase -i --onto n1 n2 &&
	test "a note" = "$(git notes show HEAD)"

No rebase in progress?
HEAD is now at 6fadda8 z
[reword-branch 3704dac] n1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 n1.t
[reword-branch 04e6eaa] n2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 n2.t
[reword-branch e34fcfd] n3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 n3.t
First, rewinding head to replay your work on top of it...
Applying: n
Applying: o
Successfully rebased and updated refs/heads/rebased-feature-branch.
ok 2 - rebase  after merge from upstream

expecting success: 
		reset_rebase &&
		git rebase -m e w &&
		test_cmp_rev e HEAD~2 &&
		test_linear_range 'n o' e..
	
No rebase in progress?
Rebasing (1/1)
HEAD is now at 4cd4d2a o
Removing actual.rev
Removing expect.rev
Applied autostash.
dirty
Switched to branch 'feature-branch'
M	file3
Deleted branch rebased-feature-branch (was fa02356).
ok 25 - rebase --interactive: --skip

expecting success: 
		test_config rebase.autostash true &&
		git reset --hard &&
		git checkout -b rebased-feature-branch feature-branch &&
		test_when_finished git branch -D rebased-feature-branch &&
		echo dirty >>file3 &&
		test_must_fail git rebase$type related-onto-branch &&
		test_path_is_file $dotest/autostash &&
		! grep dirty file3 &&
		git rebase --abort &&
		test_path_is_missing $dotest/autostash &&
		grep dirty file3 &&
		git checkout feature-branch
	
HEAD is now at 0c4d2f1 third commit
Switched to a new branch 'rebased-feature-branch'
First, rewinding head to replay your work on top of it...
Rebasing (1/1)
Merging e with HEAD~1
Merging:
67a7211 e
35a5a4f n
found 1 common ancestor:
1bd0260 d
[detached HEAD 3b45f1e] n
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:21:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 n.t
Committed: 0001 n
Merging e with HEAD~0
Merging:
3b45f1e n
a60ff6b o
found 1 common ancestor:
35a5a4f n
[detached HEAD 4cd4d2a] o
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:22:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 o.t
Committed: 0002 o
All done.
ok 3 - rebase -m after merge from upstream

expecting success: 
		reset_rebase &&
		git rebase -i e w &&
		test_cmp_rev e HEAD~2 &&
		test_linear_range 'n o' e..
	
Created autostash: cdca6ca
HEAD is now at 0c4d2f1 third commit
No rebase in progress?
HEAD is now at 4cd4d2a o
Removing actual.rev
Removing expect.rev
Successfully rebased and updated detached HEAD.
ok 25 - rebase -i can drop last patch if in upstream

expecting success: 
		reset_rebase &&
		git rebase -p h gp &&
		test_cmp_rev h HEAD^ &&
		test_linear_range 'd' h..
	
No rebase in progress?
HEAD is now at e937a8e d
Removing actual.rev
Removing expect.rev
Rebasing (1/2)
error: could not apply 6fe95e2... second commit

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
Successfully rebased and updated refs/heads/reword-branch.
Could not apply 6fe95e2a50033c9952c2a4cd5192f814def900d6... second commit
grep: file3: No such file or directory
ok 50 - rebase -i can copy notes

expecting success: 
	git reset --hard n3 &&
	git notes add -m"an earlier note" n2 &&
	set_fake_editor &&
	GIT_NOTES_REWRITE_MODE=concatenate FAKE_LINES="1 fixup 2" git rebase -i n1 &&
	git notes show > output &&
	test_cmp expect output

HEAD is now at e34fcfd n3
Rebasing (1/2)
Rebasing (2/2)
Applied autostash.
dirty
Switched to branch 'feature-branch'
M	file3
Deleted branch rebased-feature-branch (was 0c4d2f1).
ok 26 - rebase --interactive: --abort

expecting success: 
		test_config rebase.autostash true &&
		git reset --hard &&
		git checkout -b rebased-feature-branch feature-branch &&
		test_when_finished git branch -D rebased-feature-branch &&
		echo dirty >file4 &&
		git add file4 &&
		git rebase$type unrelated-onto-branch &&
		test_path_is_missing $dotest &&
		git reset --hard &&
		grep unrelated file4 &&
		! grep dirty file4 &&
		git checkout feature-branch &&
		git stash pop &&
		grep dirty file4
	
HEAD is now at 0c4d2f1 third commit
Switched to a new branch 'rebased-feature-branch'
rebase -i script before editing:
pick 04e6eaa n2
pick e34fcfd n3

rebase -i script after editing:
pick 04e6eaa n2
fixup e34fcfd n3
Rebasing (1/1)
Rebasing (2/2)
[detached HEAD 88590ef] n2
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 16:01:13 2005 -0700
 2 files changed, 2 insertions(+)
 create mode 100644 n2.t
 create mode 100644 n3.t
Created autostash: de4e47a
HEAD is now at 0c4d2f1 third commit
Successfully rebased and updated refs/heads/reword-branch.
ok 51 - rebase -i can copy notes over a fixup

expecting success: 
	git symbolic-ref HEAD &&
	grandparent=$(git rev-parse HEAD~2) &&
	test_tick &&
	set_fake_editor &&
	FAKE_LINES="2 1" git rebase -i HEAD~2 HEAD^0 &&
	test $grandparent = $(git rev-parse HEAD~2) &&
	test_must_fail git symbolic-ref HEAD

refs/heads/reword-branch
Successfully rebased and updated detached HEAD.
ok 4 - rebase -i after merge from upstream

expecting success: 
		reset_rebase &&
		git rebase  d w &&
		test_cmp_rev d HEAD~3 &&
		test_linear_range 'e n o' d..
	
No rebase in progress?
HEAD is now at 4cd4d2a o
Removing actual.rev
Removing expect.rev
Rebasing (1/2)
rebase -i script before editing:
pick 3704dac n1
pick 88590ef n2

rebase -i script after editing:
pick 88590ef n2
pick 3704dac n1
Successfully rebased and updated detached HEAD.
Rebasing (2/2)
First, rewinding head to replay your work on top of it...
ok 26 - rebase -p can drop last patch if in upstream

expecting success: 
		reset_rebase &&
		git rebase  --onto f h i &&
		test_cmp_rev f HEAD~2 &&
		test_linear_range 'd i' f..
	
Applying: e
Applying: n
Applying: o
No rebase in progress?
Rebasing (1/2)
HEAD is now at e937a8e d
Removing actual.rev
Removing expect.rev
ok 5 - rebase  of non-linear history is linearized in place

expecting success: 
		reset_rebase &&
		git rebase -m d w &&
		test_cmp_rev d HEAD~3 &&
		test_linear_range 'e n o' d..
	
No rebase in progress?
Rebasing (2/2)
HEAD is now at 71b365a o
Removing actual.rev
Removing expect.rev
First, rewinding head to replay your work on top of it...
Applying: d
Successfully rebased and updated detached HEAD.
Applying: i
fatal: ref HEAD is not a symbolic ref
ok 52 - rebase while detaching HEAD

expecting success: 
	git checkout no-ff-branch &&
	git tag original-no-ff-branch &&
	set_fake_editor &&
	git rebase -i --no-ff A &&
	touch empty &&
	for p in 0 1 2
	do
		test ! $(git rev-parse HEAD~$p) = $(git rev-parse original-no-ff-branch~$p) &&
		git diff HEAD~$p original-no-ff-branch~$p > out &&
		test_cmp empty out
	done &&
	test $(git rev-parse HEAD~3) = $(git rev-parse original-no-ff-branch~3) &&
	git diff HEAD~3 original-no-ff-branch~3 > out &&
	test_cmp empty out

Warning: you are leaving 2 commits behind, not connected to
any of your branches:

  ff70b03 n1
  787ac91 n2

First, rewinding head to replay your work on top of it...
If you want to keep them by creating a new branch, this may be a good time
to do so with:

 git branch <new-branch-name> ff70b03

Switched to branch 'no-ff-branch'
ok 27 - rebase  --onto drops patches in upstream

checking known breakage: 
		reset_rebase &&
		git rebase -m --onto f h i &&
		test_cmp_rev f HEAD~2 &&
		test_linear_range 'd i' f..
	
Merging d with HEAD~2
Merging:
1bd0260 d
67a7211 e
found 1 common ancestor:
1bd0260 d
[detached HEAD 58e651c] e
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:17:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 e.t
No rebase in progress?
Committed: 0001 HEAD is now at bcc98eb i
e
Removing actual.rev
Removing expect.rev
Merging d with HEAD~1
Merging:
58e651c e
35a5a4f n
found 1 common ancestor:
1bd0260 d
[detached HEAD d7cd91e] n
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:21:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 n.t
Committed: 0002 n
Merging d with HEAD~0
Merging:
d7cd91e n
a60ff6b o
found 1 common ancestor:
35a5a4f n
[detached HEAD 71b365a] o
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:22:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 o.t
Committed: 0003 o
First, rewinding head to replay your work on top of it...
All done.
Successfully rebased and updated refs/heads/rebased-feature-branch.
Merging f with HEAD~2
Merging:
09e072f f
1bd0260 d
found 1 common ancestor:
020ea9b b
ok 6 - rebase -m of non-linear history is linearized in place

expecting success: 
		reset_rebase &&
		git rebase -i d w &&
		test_cmp_rev d HEAD~3 &&
		test_linear_range 'n o e' d..
	
[detached HEAD 1c3eee5] d
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 d.t
Committed: 0001 d
Merging f with HEAD~1
Merging:
1c3eee5 d
00eccdb gp
found 1 common ancestor:
1bd0260 d
No rebase in progress?
HEAD is now at 71b365a o
Removing actual.rev
Removing expect.rev
[detached HEAD 348de6f] gp
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:18:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 g.t
Committed: 0002 gp
Merging f with HEAD~0
Merging:
348de6f gp
3317c29 i
found 1 common ancestor:
00eccdb gp
Rebasing (1/3)
Applying autostash resulted in conflicts.
Your changes are safe in the stash.
You can run "git stash pop" or "git stash drop" at any time.
[detached HEAD 8a25459] i
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:19:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 i.t
Committed: 0003 HEAD is now at b607b14 third commit
unrelated
i
Switched to branch 'feature-branch'
All done.
--- expect.rev	2015-12-16 10:53:37.913564800 +0000
+++ actual.rev	2015-12-16 10:53:37.937564800 +0000
@@ -1 +1 @@
-09e072f8a9ef7b761fc545eb973e8013e674eb45
+1c3eee5a4db088a4573dc7e31a5817d3fc9323bd
not ok 28 - rebase -m --onto drops patches in upstream # TODO known breakage

expecting success: 
		reset_rebase &&
		git rebase -i --onto f h i &&
		test_cmp_rev f HEAD~2 &&
		test_linear_range 'd i' f..
	
No rebase in progress?
Rebasing (2/3)
HEAD is now at 8a25459 i
Removing actual.rev
Removing expect.rev
Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual 28566cc718f43a597c158e8411c19d7048328a85
On branch feature-branch
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	new file:   file4

Rebasing (3/3)
Dropped refs/stash@{0} (de4e47a31ead4744c6d223df2e4638effc5ff8b7)
dirty
Deleted branch rebased-feature-branch (was b607b14).
ok 27 - rebase --interactive: non-conflicting rebase, conflicting stash

expecting success: 
	test_when_finished "git reset --hard" &&
	echo uncommited-content >file0 &&
	(
		write_script abort-editor.sh <<-\EOF &&
			echo >"$1"
		EOF
		test_set_editor "$(pwd)/abort-editor.sh" &&
		test_must_fail git rebase -i --autostash HEAD^ &&
		rm -f abort-editor.sh
	) &&
	echo uncommited-content >expected &&
	test_cmp expected file0

Rebasing (3/3)
Created autostash: 99c0eda
HEAD is now at 0c4d2f1 third commit
Successfully rebased and updated refs/heads/no-ff-branch.
Rebasing (1/2)
Rebasing (2/2)
fatal: Could not open file .git/rebase-merge/done for reading: No such file or directory
Applied autostash.
Nothing to do
HEAD is now at 0c4d2f1 third commit
ok 28 - abort rebase -i with --autostash

# passed all 28 test(s)
1..28
ok 53 - always cherry-pick with --no-ff

expecting success: 
	git checkout -b funny A &&
	echo >>file1 &&
	test_tick &&
	git commit -a -m "end with slash\\" &&
	echo >>file1 &&
	test_tick &&
	git commit -a -m "something (\000) that looks like octal" &&
	echo >>file1 &&
	test_tick &&
	git commit -a -m "something (\n) that looks like a newline" &&
	echo >>file1 &&
	test_tick &&
	git commit -a -m "another commit"

Switched to a new branch 'funny'
*** t3426-rebase-submodule.sh ***
[funny 13ee0eb] end with slash\
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[funny 60f45db] something (\000) that looks like octal
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[funny 7c90f9c] something (\n) that looks like a newline
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3426-rebase-submodule/.git/
[funny 35e4229] another commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 54 - set up commits with funny messages

expecting success: 
	git rev-list A..funny >expect &&
	test_tick &&
	set_fake_editor &&
	FAKE_LINES="1 2 3 4" git rebase -i A &&
	git rev-list A.. >actual &&
	test_cmp expect actual

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
		)
	
Successfully rebased and updated detached HEAD.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3426-rebase-submodule/submodule_update_repo/.git/
[master (root-commit) 074a145] 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
ok 7 - rebase -i of non-linear history is linearized in place

expecting success: 
		reset_rebase &&
		git rebase  c w &&
		test_cmp_rev c HEAD~4 &&
		test_linear_range 'd e n o' c..
	
Switched to a new branch 'add_sub1'
No rebase in progress?
HEAD is now at ef67882 e
Removing actual.rev
Removing expect.rev
Cloning into 'sub1'...
done.
Successfully rebased and updated detached HEAD.
First, rewinding head to replay your work on top of it...
ok 29 - rebase -i --onto drops patches in upstream

expecting success: 
		reset_rebase &&
		git rebase -p --onto f h i &&
		test_cmp_rev f HEAD~2 &&
		test_linear_range 'd i' f..
	
Applying: d
[add_sub1 842f6ea] Add sub1
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
Applying: e
Switched to a new branch 'remove_sub1'
Applying: n
rebase -i script before editing:
pick 13ee0eb end with slash\
pick 60f45db something (\000) that looks like octal
pick 7c90f9c something (\n) that looks like a newline
pick 35e4229 another commit

Removing sub1
Removing .gitmodules
Applying: o
[remove_sub1 19ad290] Revert "Add sub1"
 Author: A U Thor <author@example.com>
 2 files changed, 5 deletions(-)
 delete mode 100644 .gitmodules
 delete mode 160000 sub1
rebase -i script after editing:
pick 13ee0eb end with slash\
pick 60f45db something (\000) that looks like octal
pick 7c90f9c something (\n) that looks like a newline
pick 35e4229 another commit
No rebase in progress?
Switched to a new branch 'modify_sub1'
HEAD is now at bcc98eb i
Removing actual.rev
Removing expect.rev
ok 8 - rebase  of non-linear history is linearized upstream

expecting success: 
		reset_rebase &&
		git rebase -m c w &&
		test_cmp_rev c HEAD~4 &&
		test_linear_range 'd e n o' c..
	
No rebase in progress?
HEAD is now at 9b42f8e o
Removing actual.rev
Removing expect.rev
Successfully rebased and updated refs/heads/funny.
Rebasing (4/4)
ok 55 - rebase-i history with funny messages

expecting success: 
	git checkout master &&
	git checkout -b execute &&
	test_commit one_exec main.txt one_exec &&
	test_commit two_exec main.txt two_exec &&
	test_commit three_exec main.txt three_exec

From /«PKGBUILDDIR»/t/trash directory.t3426-rebase-submodule/submodule_update_repo/.
   074a145..842f6ea  add_sub1   -> origin/add_sub1
 * [new branch]      modify_sub1 -> origin/modify_sub1
 * [new branch]      remove_sub1 -> origin/remove_sub1
Switched to branch 'master'
Switched to a new branch 'execute'
Switched to a new branch 'modifications'
[execute 925b01e] one_exec
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 main.txt
First, rewinding head to replay your work on top of it...
[modifications db5731a] modified file2 and added file3
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 file3
[execute 7f87cbe] two_exec
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Merging c with HEAD~3
Merging:
d9ea348 c
1bd0260 d
found 1 common ancestor:
020ea9b b
To /«PKGBUILDDIR»/t/trash directory.t3426-rebase-submodule/submodule_update_repo/.
 * [new branch]      modifications -> modifications
[execute f0f177e] three_exec
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 56 - prepare for rebase -i --exec

expecting success: 
	set_fake_editor &&
	git rebase -i --exec "git show HEAD" HEAD~2 >actual &&
	(
		FAKE_LINES="1 exec_git_show_HEAD 2 exec_git_show_HEAD" &&
		export FAKE_LINES &&
		git rebase -i HEAD~2 >expect
	) &&
	sed -e "1,9d" expect >expected &&
	test_cmp expected actual

[detached HEAD 9501b67] d
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 d.t
Committed: 0001 [modify_sub1 30f0f58] Modify sub1
 Author: A U Thor <author@example.com>
d
Switched to a new branch 'replace_sub1_with_directory'
Merging c with HEAD~2
Merging:
9501b67 d
67a7211 e
found 1 common ancestor:
1bd0260 d
[detached HEAD bf821a2] e
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:17:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 e.t
Committed: 0002 e
Merging c with HEAD~1
Merging:
bf821a2 e
35a5a4f n
found 1 common ancestor:
1bd0260 d
[detached HEAD cd1b620] n
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:21:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 n.t
Committed: 0003 n
Merging c with HEAD~0
Merging:
cd1b620 n
a60ff6b o
found 1 common ancestor:
35a5a4f n
Submodule path 'sub1': checked out '074a145e4bb5d727c9a29bb1b090a652fdf358a8'
[detached HEAD 9b42f8e] o
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:22:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 o.t
Previous HEAD position was 074a145... Base
Switched to branch 'modifications'
Committed: 0004 o
rm 'sub1'
All done.
Rebasing (1/2)
[replace_sub1_with_directory 8020129] 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
ok 9 - rebase -m of non-linear history is linearized upstream

expecting success: 
		reset_rebase &&
		git rebase -i c w &&
		test_cmp_rev c HEAD~4 &&
		test_linear_range 'd n o e' c..
	
Switched to a new branch 'replace_directory_with_sub1'
Removing sub1/file3
Removing sub1/file2
Removing sub1/file1
Adding sub1
[replace_directory_with_sub1 c4143a6] 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
Switched to a new branch 'replace_sub1_with_file'
rm 'sub1'
No rebase in progress?
HEAD is now at 9b42f8e o
[replace_sub1_with_file 8eb0678] Replace sub1 with file
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
Removing actual.rev
Removing expect.rev
Switched to a new branch 'replace_file_with_sub1'
Rebasing (2/2)
[replace_file_with_sub1 8cf1afb] Revert "Replace sub1 with file"
 Author: A U Thor <author@example.com>
 2 files changed, 5 insertions(+), 1 deletion(-)
 mode change 100644 => 160000 sub1
Switched to a new branch 'invalid_sub1'
[invalid_sub1 8c99924] Invalid sub1 commit
 Author: A U Thor <author@example.com>
Switched to a new branch 'valid_sub1'
[valid_sub1 d85626c] Revert "Invalid sub1 commit"
 Author: A U Thor <author@example.com>
Switched to branch 'master'
Cloning into 'submodule_update'...
done.
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Switched to a new branch 'ours'
[ours 5fdcce3] add_x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[ours bef8e39] Revert "add_x"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
First, rewinding head to replay your work on top of it...
Rebasing (1/4)
Applying: add_x
Applying: Revert "add_x"
Successfully rebased and updated detached HEAD.
Rebasing (2/4)
Rebasing (3/4)
ok 30 - rebase -p --onto drops patches in upstream

expecting success: 
		reset_rebase &&
		git rebase  --onto h f i &&
		test_cmp_rev h HEAD~3 &&
		test_linear_range 'd gp i' h..
	
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3426-rebase-submodule/submodule_update_repo/.) registered for path 'sub1'
Successfully rebased and updated refs/heads/execute.
No rebase in progress?
HEAD is now at bcc98eb i
Rebasing (4/4)
Removing actual.rev
Removing expect.rev
Cloning into 'sub1'...
done.
First, rewinding head to replay your work on top of it...
Submodule path 'sub1': checked out '074a145e4bb5d727c9a29bb1b090a652fdf358a8'
Applying: d
Applying: gp
Applying: i
ok 1 - git_rebase: 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 31 - rebase  --onto does not drop patches in onto

expecting success: 
		reset_rebase &&
		git rebase -m --onto h f i &&
		test_cmp_rev h HEAD~3 &&
		test_linear_range 'd gp i' h..
	
Cloning into 'submodule_update'...
No rebase in progress?
HEAD is now at bbe8f41 i
Removing actual.rev
Removing expect.rev
done.
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Switched to a new branch 'ours'
First, rewinding head to replay your work on top of it...
[ours a2fa43b] add_x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[ours 045f31c] Revert "add_x"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
Merging h with HEAD~2
Merging:
09e6546 h
1bd0260 d
found 1 common ancestor:
020ea9b b
[detached HEAD e937a8e] d
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 d.t
Committed: 0001 d
Merging h with HEAD~1
Merging:
e937a8e d
00eccdb gp
found 1 common ancestor:
1bd0260 d
[detached HEAD 4a12efe] gp
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:18:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 g.t
Successfully rebased and updated detached HEAD.
Successfully rebased and updated refs/heads/execute.
Committed: 0002 gp
ok 57 - running "git rebase -i --exec git show HEAD"

expecting success: 
	git reset --hard execute &&
	set_fake_editor &&
	git rebase --exec "git show HEAD" -i HEAD~2 >actual &&
	(
		FAKE_LINES="1 exec_git_show_HEAD 2 exec_git_show_HEAD" &&
		export FAKE_LINES &&
		git rebase -i HEAD~2 >expect
	) &&
	sed -e "1,9d" expect >expected &&
	test_cmp expected actual

Merging h with HEAD~0
Merging:
4a12efe gp
3317c29 i
found 1 common ancestor:
00eccdb gp
First, rewinding head to replay your work on top of it...
HEAD is now at f0f177e three_exec
ok 10 - rebase -i of non-linear history is linearized upstream

expecting success: 
		reset_rebase &&
		git rebase  c v &&
		test_cmp_rev c HEAD~4 &&
		test_linear_range 'd e n o' c..
	
[detached HEAD bbe8f41] i
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:19:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 i.t
Committed: 0003 i
Applying: add_x
All done.
Applying: Revert "add_x"
No rebase in progress?
HEAD is now at 7946025 e
ok 32 - rebase -m --onto does not drop patches in onto

expecting success: 
		reset_rebase &&
		git rebase -i --onto h f i &&
		test_cmp_rev h HEAD~3 &&
		test_linear_range 'd gp i' h..
	
Removing actual.rev
Removing expect.rev
No rebase in progress?
HEAD is now at bbe8f41 i
Removing actual.rev
Removing expect.rev
First, rewinding head to replay your work on top of it...
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3426-rebase-submodule/submodule_update_repo/.) registered for path 'sub1'
Applying: d
Applying: e
Applying: n
Applying: o
Cloning into 'sub1'...
ok 11 - rebase  of non-linear history with merges after upstream merge is linearized

expecting success: 
		reset_rebase &&
		git rebase -m c v &&
		test_cmp_rev c HEAD~4 &&
		test_linear_range 'd e n o' c..
	
done.
No rebase in progress?
HEAD is now at 9b42f8e o
Removing actual.rev
Removing expect.rev
Submodule path 'sub1': checked out '074a145e4bb5d727c9a29bb1b090a652fdf358a8'
ok 2 - git_rebase: 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
		)
	
First, rewinding head to replay your work on top of it...
Cloning into 'submodule_update'...
Rebasing (1/3)
Merging c with HEAD~3
Merging:
d9ea348 c
1bd0260 d
found 1 common ancestor:
020ea9b b
done.
[detached HEAD 9501b67] d
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 d.t
Switched to a new branch 'no_submodule'
Committed: 0001 Branch no_submodule set up to track remote branch no_submodule from origin.
d
Merging c with HEAD~2
Merging:
9501b67 d
67a7211 e
found 1 common ancestor:
1bd0260 d
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Switched to a new branch 'ours'
Rebasing (2/3)
[detached HEAD bf821a2] e
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:17:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 e.t
Committed: 0002 e
[ours febe0c8] add_x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Merging c with HEAD~1
Merging:
bf821a2 e
35a5a4f n
found 1 common ancestor:
1bd0260 d
[ours 4135000] Revert "add_x"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
[detached HEAD cd1b620] n
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:21:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 n.t
Committed: 0003 n
Rebasing (3/3)
Merging c with HEAD~0
Merging:
cd1b620 n
a60ff6b o
found 1 common ancestor:
35a5a4f n
[detached HEAD 9b42f8e] o
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:22:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 o.t
Committed: 0004 o
All done.
ok 12 - rebase -m of non-linear history with merges after upstream merge is linearized

expecting success: 
		reset_rebase &&
		git rebase -i c v &&
		test_cmp_rev c HEAD~4 &&
		test_linear_range 'd n o e' c..
	
First, rewinding head to replay your work on top of it...
error: The following untracked working tree files would be overwritten by checkout:
	sub1
Please move or remove them before you can switch branches.
Aborting
could not detach HEAD
ok 3 - git_rebase: 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
		)
	
No rebase in progress?
HEAD is now at 9b42f8e o
Removing actual.rev
Removing expect.rev
Cloning into 'submodule_update'...
done.
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.
t3426-rebase-submodule.sh: 159: cd: can't cd to sub1
Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
Successfully rebased and updated refs/heads/execute.
Switched to a new branch 'ours'
[ours 270697a] add_x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[ours 3698e38] Revert "add_x"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
First, rewinding head to replay your work on top of it...
Applying: add_x
Successfully rebased and updated detached HEAD.
Applying: Revert "add_x"
ok 33 - rebase -i --onto does not drop patches in onto

expecting success: 
		reset_rebase &&
		git rebase -p --onto h f i &&
		test_cmp_rev h HEAD~3 &&
		test_linear_range 'd gp i' h..
	
No rebase in progress?
Rebasing (1/4)
HEAD is now at bbe8f41 i
Removing actual.rev
Removing expect.rev
Rebasing (2/4)
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3426-rebase-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'sub1'...
done.
Successfully rebased and updated refs/heads/execute.
Rebasing (3/4)
ok 58 - running "git rebase --exec git show HEAD -i"

expecting success: 
	git reset --hard execute &&
	set_fake_editor &&
	git rebase -ix "git show HEAD" HEAD~2 >actual &&
	(
		FAKE_LINES="1 exec_git_show_HEAD 2 exec_git_show_HEAD" &&
		export FAKE_LINES &&
		git rebase -i HEAD~2 >expect
	) &&
	sed -e "1,9d" expect >expected &&
	test_cmp expected actual

HEAD is now at f0f177e three_exec
Rebasing (4/4)
Submodule path 'sub1': checked out '074a145e4bb5d727c9a29bb1b090a652fdf358a8'
ok 4 - git_rebase: 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
		)
	
Cloning into 'submodule_update'...
done.
Switched to a new branch 'replace_sub1_with_directory'
Rebasing (1/3)
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
error: 8ed2e6719f8484ce01fa3ce133fe42d25c2441b8^{commit}: expected commit type, but the object dereferences to tree type
fatal: Needed a single revision
Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
Switched to a new branch 'ours'
[ours 6ddc429] add_x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[ours b4fe484] Revert "add_x"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
Rebasing (2/3)
Rebasing (3/3)
First, rewinding head to replay your work on top of it...
Applying: add_x
Successfully rebased and updated detached HEAD.
Applying: Revert "add_x"
ok 13 - rebase -i of non-linear history with merges after upstream merge is linearized

expecting success: 
	reset_rebase &&
	git rebase -p d w &&
	test_cmp_rev w HEAD

No rebase in progress?
HEAD is now at 7946025 e
Removing actual.rev
Removing expect.rev
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3426-rebase-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'sub1'...
done.
Submodule path 'sub1': checked out '074a145e4bb5d727c9a29bb1b090a652fdf358a8'
ok 5 - git_rebase: 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
		)
	
Successfully rebased and updated refs/heads/execute.
Successfully rebased and updated detached HEAD.
Cloning into 'submodule_update'...
done.
ok 34 - rebase -p --onto does not drop patches in onto

expecting success: 
	git checkout c &&
	make_empty j &&
	git checkout d &&
	make_empty k &&
	test_commit l

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Warning: you are leaving 3 commits behind, not connected to
any of your branches:

  bbe8f41 i
  4a12efe gp
  e937a8e d

If you want to keep them by creating a new branch, this may be a good time
to do so with:

 git branch <new-branch-name> bbe8f41

HEAD is now at d9ea348... c
[detached HEAD 5b67321] j
 Author: A U Thor <author@example.com>
Previous HEAD position was 5b67321... j
HEAD is now at 1bd0260... d
Rebasing (1/4)
[detached HEAD 753370d] k
 Author: A U Thor <author@example.com>
[detached HEAD 49cf309] l
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 l.t
ok 35 - setup of linear history for empty commit tests

expecting success: 
		reset_rebase &&
		git rebase  c l &&
		test_cmp_rev c HEAD~2 &&
		test_linear_range 'd l' c..
	
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3426-rebase-submodule/submodule_update_repo/.) registered for path 'sub1'
No rebase in progress?
Rebasing (2/4)
HEAD is now at 49cf309 l
Removing actual.rev
Removing expect.rev
Cloning into 'sub1'...
done.
Rebasing (3/4)
First, rewinding head to replay your work on top of it...
Submodule path 'sub1': checked out '074a145e4bb5d727c9a29bb1b090a652fdf358a8'
Applying: d
Applying: l
Rebasing (4/4)
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
Switched to a new branch 'ours'
ok 36 - rebase  drops empty commit

expecting success: 
		reset_rebase &&
		git rebase -m c l &&
		test_cmp_rev c HEAD~2 &&
		test_linear_range 'd l' c..
	
[ours 0342b66] add_x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[ours 69cd195] Revert "add_x"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
No rebase in progress?
HEAD is now at ef60b8d l
Removing actual.rev
Removing expect.rev
Successfully rebased and updated refs/heads/execute.
ok 59 - running "git rebase -ix git show HEAD"

expecting success: 
	git reset --hard execute &&
	set_fake_editor &&
	git rebase -ix "git show HEAD; pwd" HEAD~2 >actual &&
	(
		FAKE_LINES="1 exec_git_show_HEAD;_pwd 2 exec_git_show_HEAD;_pwd" &&
		export FAKE_LINES &&
		git rebase -i HEAD~2 >expect
	) &&
	sed -e "1,9d" expect >expected &&
	test_cmp expected actual

HEAD is now at f0f177e three_exec
First, rewinding head to replay your work on top of it...
warning: unable to rmdir sub1: Directory not empty
First, rewinding head to replay your work on top of it...
Applying: add_x
Merging c with HEAD~2
Merging:
d9ea348 c
1bd0260 d
found 1 common ancestor:
020ea9b b
Applying: Revert "add_x"
[detached HEAD bd3422f] d
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 d.t
Committed: 0001 d
Merging c with HEAD~1
Merging:
bd3422f d
753370d k
found 1 common ancestor:
1bd0260 d
Already up-to-date!
Already applied: 0002 k
Merging c with HEAD~0
Merging:
bd3422f d
49cf309 l
found 1 common ancestor:
753370d k
ok 6 - git_rebase: 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
		)
	
[detached HEAD ef60b8d] l
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:21:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 l.t
Committed: 0003 l
All done.
Cloning into 'submodule_update'...
done.
ok 37 - rebase -m drops empty commit

expecting success: 
		reset_rebase &&
		git rebase -i c l &&
		test_cmp_rev c HEAD~2 &&
		test_linear_range 'd l' c..
	
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
No rebase in progress?
HEAD is now at ef60b8d l
Removing actual.rev
Removing expect.rev
Successfully rebased and updated detached HEAD.
ok 14 - rebase -p is no-op in non-linear history

expecting success: 
	reset_rebase &&
	git rebase -p e w &&
	test_cmp_rev w HEAD

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3426-rebase-submodule/submodule_update_repo/.) registered for path 'sub1'
No rebase in progress?
HEAD is now at df2bcbf w
Cloning into 'sub1'...
Removing actual.rev
Removing expect.rev
done.
Submodule path 'sub1': checked out '074a145e4bb5d727c9a29bb1b090a652fdf358a8'
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
Switched to a new branch 'ours'
[ours fedf4ce] add_x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Rebasing (1/2)
[ours 0b16de5] Revert "add_x"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
Rebasing (2/2)
Rebasing (1/1)
First, rewinding head to replay your work on top of it...
warning: unable to rmdir sub1: Directory not empty
Applying: add_x
Applying: Revert "add_x"
Successfully rebased and updated refs/heads/execute.
ok 7 - git_rebase: 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
		)
	
Cloning into 'submodule_update'...
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3426-rebase-submodule/submodule_update_repo/.) registered for path 'sub1'
Successfully rebased and updated detached HEAD.
ok 38 - rebase -i drops empty commit

expecting success: 
		reset_rebase &&
		git rebase -p c l &&
		test_cmp_rev c HEAD~2 &&
		test_linear_range 'd l' c..
	
Successfully rebased and updated detached HEAD.
Cloning into 'sub1'...
ok 15 - rebase -p is no-op when base inside second parent

checking known breakage: 
	reset_rebase &&
	git rebase -p --root w &&
	test_cmp_rev w HEAD

No rebase in progress?
done.
HEAD is now at ef60b8d l
Removing actual.rev
Removing expect.rev
No rebase in progress?
HEAD is now at df2bcbf w
Removing actual.rev
Removing expect.rev
Submodule path 'sub1': checked out '074a145e4bb5d727c9a29bb1b090a652fdf358a8'
Successfully rebased and updated refs/heads/execute.
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
ok 60 - rebase -ix with several <CMD>

expecting success: 
	git reset --hard execute &&
	set_fake_editor &&
	git rebase -i --exec "git show HEAD" --exec "pwd" HEAD~2 >actual &&
	(
		FAKE_LINES="1 exec_git_show_HEAD exec_pwd 2
				exec_git_show_HEAD exec_pwd" &&
		export FAKE_LINES &&
		git rebase -i HEAD~2 >expect
	) &&
	sed -e "1,11d" expect >expected &&
	test_cmp expected actual

HEAD is now at f0f177e three_exec
Switched to a new branch 'ours'
[ours 80ef12b] add_x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[ours 555c33a] Revert "add_x"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
First, rewinding head to replay your work on top of it...
error: The following untracked working tree files would be overwritten by checkout:
	sub1/file1
	sub1/file2
Please move or remove them before you can switch branches.
Aborting
could not detach HEAD
ok 8 - git_rebase: 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
		)
	
Cloning into 'submodule_update'...
done.
Switched to a new branch 'add_sub1'
Rebasing (1/2)
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Rebasing (2/2)
Rebasing (1/7)
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3426-rebase-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'sub1'...
done.
Rebasing (2/7)
Submodule path 'sub1': checked out '074a145e4bb5d727c9a29bb1b090a652fdf358a8'
Rebasing (3/7)
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
Switched to a new branch 'ours'
[ours 9b05df2] add_x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Rebasing (4/7)
[ours c38fe3f] Revert "add_x"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
Rebasing (5/7)
First, rewinding head to replay your work on top of it...
error: The following untracked working tree files would be overwritten by checkout:
	sub1/file1
	sub1/file2
Please move or remove them before you can switch branches.
Aborting
could not detach HEAD
Successfully rebased and updated detached HEAD.
ok 39 - rebase -p drops empty commit

expecting success: 
		reset_rebase &&
		git rebase  --keep-empty c l &&
		test_cmp_rev c HEAD~3 &&
		test_linear_range 'd k l' c..
	
ok 9 - git_rebase: 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
		)
	
Successfully rebased and updated refs/heads/execute.
No rebase in progress?
Rebasing (6/7)
HEAD is now at ef60b8d l
Removing actual.rev
Removing expect.rev
Cloning into 'submodule_update'...
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Rebasing (7/7)
First, rewinding head to replay your work on top of it...
[detached HEAD bd3422f] d
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 d.t
Already up-to-date!
[detached HEAD 6ecea8f] k
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:20:13 2005 -0700
[detached HEAD f90e7ce] l
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:21:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 l.t
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3426-rebase-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 40 - rebase  --keep-empty

checking known breakage: 
		reset_rebase &&
		git rebase -m --keep-empty c l &&
		test_cmp_rev c HEAD~3 &&
		test_linear_range 'd k l' c..
	
Cloning into 'sub1'...
No rebase in progress?
HEAD is now at f90e7ce l
Removing actual.rev
Removing expect.rev
done.
Submodule path 'sub1': checked out '074a145e4bb5d727c9a29bb1b090a652fdf358a8'
First, rewinding head to replay your work on top of it...
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
Merging c with HEAD~2
Merging:
d9ea348 c
1bd0260 d
found 1 common ancestor:
020ea9b b
Switched to a new branch 'ours'
[detached HEAD bd3422f] d
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 d.t
Committed: 0001 [ours e1f88dc] add_x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
d
Merging c with HEAD~1
Merging:
bd3422f d
753370d k
found 1 common ancestor:
1bd0260 d
Already up-to-date!
[ours 8d81b80] Revert "add_x"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
Already applied: 0002 k
Merging c with HEAD~0
Merging:
bd3422f d
49cf309 l
found 1 common ancestor:
753370d k
[detached HEAD ef60b8d] l
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:21:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 l.t
Committed: 0003 l
All done.
--- expect.rev	2015-12-16 10:54:10.453564804 +0000
+++ actual.rev	2015-12-16 10:54:10.485564804 +0000
@@ -1 +1 @@
-d9ea348e0fe8827f205c231ed0a5b8258841fd37
+020ea9b5b2051d958f4737afacdc8821a33ac9a9
not ok 41 - rebase -m --keep-empty # TODO known breakage

expecting success: 
		reset_rebase &&
		git rebase -i --keep-empty c l &&
		test_cmp_rev c HEAD~3 &&
		test_linear_range 'd k l' c..
	
First, rewinding head to replay your work on top of it...
Successfully rebased and updated refs/heads/execute.
Successfully rebased and updated detached HEAD.
ok 61 - rebase -ix with several instances of --exec

expecting success: 
	git reset --hard execute &&
	git checkout -b autosquash &&
	echo second >second.txt &&
	git add second.txt &&
	git commit -m "fixup! two_exec" &&
	echo bis >bis.txt &&
	git add bis.txt &&
	git commit -m "fixup! two_exec" &&
	set_fake_editor &&
	(
		git checkout -b autosquash_actual &&
		git rebase -i --exec "git show HEAD" --autosquash HEAD~4 >actual
	) &&
	git checkout autosquash &&
	(
		git checkout -b autosquash_expected &&
		FAKE_LINES="1 fixup 3 fixup 4 exec_git_show_HEAD 2 exec_git_show_HEAD" &&
		export FAKE_LINES &&
		git rebase -i HEAD~4 >expect
	) &&
	sed -e "1,13d" expect >expected &&
	test_cmp expected actual

No rebase in progress?
Applying: add_x
HEAD is now at f0f177e three_exec
--- expect.rev	2015-12-16 10:54:10.685564804 +0000
+++ actual.rev	2015-12-16 10:54:10.705564804 +0000
@@ -1 +1 @@
-df2bcbf6cf61eb2cff7270cb2481591f50190257
+9c7d2562716d5ad262798a2dc378a6f977240a94
not ok 16 - rebase -p --root on non-linear history is a no-op # TODO known breakage

expecting success: 
	reset_rebase &&
	git rebase -p z w &&
	test_cmp_rev z HEAD^ &&
	test_cmp_rev w^2 HEAD^2

HEAD is now at ef60b8d l
Switched to a new branch 'autosquash'
Applying: Revert "add_x"
Removing actual.rev
Removing expect.rev
[autosquash 1113b9e] fixup! two_exec
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 second.txt
[autosquash 1e7d195] fixup! two_exec
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bis.txt
test_must_fail: command succeeded: git_rebase replace_sub1_with_file
No rebase in progress?
Switched to a new branch 'autosquash_actual'
not ok 10 - git_rebase: 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
		)
	
HEAD is now at 9c7d256 w
Removing actual.rev
Removing expect.rev
Cloning into 'submodule_update'...
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3426-rebase-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'sub1'...
done.
Rebasing (1/3)
Rebasing (1/1)
Rebasing (2/3)
Submodule path 'sub1': checked out '074a145e4bb5d727c9a29bb1b090a652fdf358a8'
Rebasing (3/3)
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
Switched to a new branch 'ours'
[ours 08e65a3] add_x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[ours d4c2764] Revert "add_x"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
First, rewinding head to replay your work on top of it...
Applying: add_x
Applying: Revert "add_x"
test_must_fail: command succeeded: git_rebase replace_sub1_with_file
not ok 11 - git_rebase: 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
		)
	
Cloning into 'submodule_update'...
done.
Successfully rebased and updated detached HEAD.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Successfully rebased and updated detached HEAD.
ok 17 - rebase -p re-creates merge from side branch

expecting success: 
	reset_rebase &&
	git rebase -p c w &&
	test_cmp_rev c HEAD~4 &&
	test_cmp_rev HEAD^2^ HEAD~3 &&
	test_revision_subjects 'd n e o w' HEAD~3 HEAD~2 HEAD^2 HEAD^ HEAD

ok 42 - rebase -i --keep-empty

checking known breakage: 
		reset_rebase &&
		git rebase -p --keep-empty c l &&
		test_cmp_rev c HEAD~3 &&
		test_linear_range 'd k l' c..
	
No rebase in progress?
HEAD is now at 3547a5b w
Removing actual.rev
Removing expect.rev
No rebase in progress?
HEAD is now at f90e7ce l
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3426-rebase-submodule/submodule_update_repo/.) registered for path 'sub1'
Removing actual.rev
Removing expect.rev
Cloning into 'sub1'...
done.
Submodule path 'sub1': checked out '074a145e4bb5d727c9a29bb1b090a652fdf358a8'
Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
Switched to a new branch 'ours'
[ours 51d5ab2] add_x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Successfully rebased and updated refs/heads/autosquash_actual.
Switched to branch 'autosquash'
[ours af2f978] Revert "add_x"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
Switched to a new branch 'autosquash_expected'
Rebasing (1/3)
First, rewinding head to replay your work on top of it...
Applying: add_x
Applying: Revert "add_x"
Rebasing (1/5)
Rebasing (2/3)
Already up-to-date!
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:

    git commit --allow-empty

Otherwise, please use 'git reset'
interactive rebase in progress; onto d9ea348
Last commands done (2 commands done):
   pick 1bd0260 d
   pick 753370d k
Next command to do (1 remaining command):
   pick 49cf309 l
You are currently rebasing.

nothing to commit, working directory clean
Could not pick 753370ddaccf1cee7fe7a98997789c7c2de20f79
Rebasing (2/5)
not ok 43 - rebase -p --keep-empty # TODO known breakage

expecting success: 
		reset_rebase &&
		git rebase  --keep-empty j l &&
		test_cmp_rev j HEAD~3 &&
		test_linear_range 'd k l' j..
	
Submodule path 'sub1': checked out 'db5731a8aef3dc50ca88d60ef656a72ca69a9b58'
HEAD is now at 49cf309 l
Rebasing (3/5)
ok 12 - git_rebase: 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
		)
	
Cloning into 'submodule_update'...
First, rewinding head to replay your work on top of it...
done.
[detached HEAD 60768b3] d
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 d.t
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Already up-to-date!
Rebasing (4/5)
[detached HEAD 9a731c2] k
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:20:13 2005 -0700
[detached HEAD 5395ede] l
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:21:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 l.t
ok 44 - rebase  --keep-empty keeps empty even if already in upstream

checking known breakage: 
		reset_rebase &&
		git rebase -m --keep-empty j l &&
		test_cmp_rev j HEAD~3 &&
		test_linear_range 'd k l' j..
	
No rebase in progress?
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3426-rebase-submodule/submodule_update_repo/.) registered for path 'sub1'
HEAD is now at 5395ede l
Rebasing (5/5)
Removing actual.rev
Removing expect.rev
Cloning into 'sub1'...
done.
First, rewinding head to replay your work on top of it...
Merging j with HEAD~2
Merging:
5b67321 j
1bd0260 d
found 1 common ancestor:
020ea9b b
Submodule path 'sub1': checked out '074a145e4bb5d727c9a29bb1b090a652fdf358a8'
[detached HEAD 60768b3] d
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 d.t
Successfully rebased and updated refs/heads/autosquash_expected.
Committed: 0001 d
ok 62 - rebase -ix with --autosquash

expecting success: 
	git reset --hard execute &&
	set_fake_editor &&
	test_must_fail git rebase --exec "git show HEAD" HEAD~2 2>actual &&
	echo "The --exec option must be used with the --interactive option" >expected &&
	test_i18ncmp expected actual

HEAD is now at f0f177e three_exec
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
Merging j with HEAD~1
Merging:
60768b3 d
753370d k
found 1 common ancestor:
1bd0260 d
Already up-to-date!
Already applied: 0002 k
Switched to a new branch 'ours'
Merging j with HEAD~0
Merging:
60768b3 d
49cf309 l
found 1 common ancestor:
753370d k
[ours a53d6eb] add_x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 63 - rebase --exec without -i shows error message

expecting success: 
	git reset --hard execute &&
	set_fake_editor &&
	test_must_fail git rebase -i --exec 2>tmp &&
	sed -e "1d" tmp >actual &&
	test_must_fail git rebase -h >expected &&
	test_cmp expected actual &&
	git checkout master

[detached HEAD 1612308] l
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:21:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 l.t
Committed: 0003 HEAD is now at f0f177e three_exec
[ours acbc521] Revert "add_x"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
l
All done.
--- expect.rev	2015-12-16 10:54:19.257564805 +0000
+++ actual.rev	2015-12-16 10:54:19.285564805 +0000
@@ -1 +1 @@
-5b67321bb4e1ef5cbccc64d00cd3c3f7768ff359
+d9ea348e0fe8827f205c231ed0a5b8258841fd37
not ok 45 - rebase -m --keep-empty keeps empty even if already in upstream # TODO known breakage

checking known breakage: 
		reset_rebase &&
		git rebase -i --keep-empty j l &&
		test_cmp_rev j HEAD~3 &&
		test_linear_range 'd k l' j..
	
Switched to branch 'master'
ok 64 - rebase -i --exec without <CMD>

expecting success: 
	git checkout E &&
	set_fake_editor &&
	FAKE_LINES="3 1 2 5" git rebase -i --root &&
	test E = $(git cat-file commit HEAD | sed -ne \$p) &&
	test B = $(git cat-file commit HEAD^ | sed -ne \$p) &&
	test A = $(git cat-file commit HEAD^^ | sed -ne \$p) &&
	test C = $(git cat-file commit HEAD^^^ | sed -ne \$p) &&
	test 0 = $(git cat-file commit HEAD^^^ | grep -c ^parent\ )

Note: checking out 'E'.

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 8f99a4f... E
No rebase in progress?
HEAD is now at 1612308 l
Removing actual.rev
Removing expect.rev
First, rewinding head to replay your work on top of it...
Applying: add_x
Applying: Revert "add_x"
Successfully rebased and updated detached HEAD.
ok 18 - rebase -p re-creates internal merge

expecting success: 
	reset_rebase &&
	git rebase -p --onto c d w &&
	test_cmp_rev c HEAD~3 &&
	test_cmp_rev c HEAD^2^ &&
	test_revision_subjects 'n e o w' HEAD~2 HEAD^2 HEAD^ HEAD

rebase -i script before editing:
pick 6e62bf8 A
pick 313fe96 B
pick d0f65f2 C
pick 0547e3f D
pick 8f99a4f E

rebase -i script after editing:
pick d0f65f2 C
pick 6e62bf8 A
pick 313fe96 B
pick 8f99a4f E
No rebase in progress?
HEAD is now at a09c328 w
Removing actual.rev
Removing expect.rev
fatal: reference is not a tree: 0123456789012345678901234567890123456789
Unable to checkout '0123456789012345678901234567890123456789' in submodule path 'sub1'
Rebasing (1/2)
Rebasing (1/4)
ok 13 - git_rebase: 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
		)
	
Cloning into 'submodule_update'...
done.
Switched to a new branch 'invalid_sub1'
Rebasing (2/2)
Rebasing (2/4)
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
fatal: Needed a single revision
Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
Switched to a new branch 'ours'
Rebasing (3/4)
[ours 7e0d725] add_x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[ours 210e41c] Revert "add_x"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
Successfully rebased and updated detached HEAD.
Rebasing (4/4)
First, rewinding head to replay your work on top of it...
Rebasing (1/4)
Applying: add_x
ok 65 - rebase -i --root re-order and drop commits

expecting success: 
	git checkout A &&
	echo B >file7 &&
	git add file7 &&
	GIT_AUTHOR_NAME="Twerp Snog" git commit -m "different author" &&
	set_fake_editor &&
	FAKE_LINES="2" git rebase -i --root &&
	git cat-file commit HEAD | grep -q "^author Twerp Snog" &&
	git cat-file commit HEAD | grep -q "^different author$"

Applying: Revert "add_x"
Warning: you are leaving 4 commits behind, not connected to
any of your branches:

  1edede7 E
  0224ee0 B
  06f10b0 A
  897c57c C

If you want to keep them by creating a new branch, this may be a good time
to do so with:

 git branch <new-branch-name> 1edede7

HEAD is now at 6e62bf8... A
[detached HEAD c735815] different author
 Author: Twerp Snog <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file7
Successfully rebased and updated detached HEAD.
Rebasing (2/4)
--- expect.rev	2015-12-16 10:54:22.729564806 +0000
+++ actual.rev	2015-12-16 10:54:22.757564806 +0000
@@ -1 +1 @@
-5b67321bb4e1ef5cbccc64d00cd3c3f7768ff359
+d9ea348e0fe8827f205c231ed0a5b8258841fd37
not ok 46 - rebase -i --keep-empty keeps empty even if already in upstream # TODO known breakage

checking known breakage: 
		reset_rebase &&
		git rebase -p --keep-empty j l &&
		test_cmp_rev j HEAD~3 &&
		test_linear_range 'd k l' j..
	
No rebase in progress?
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3426-rebase-submodule/submodule_update_repo/.) registered for path 'sub1'
HEAD is now at 1612308 l
Removing actual.rev
Removing expect.rev
Cloning into 'sub1'...
done.
Rebasing (3/4)
rebase -i script before editing:
pick 6e62bf8 A
pick c735815 different author

rebase -i script after editing:
pick c735815 different author
Rebasing (4/4)
Submodule path 'sub1': checked out '074a145e4bb5d727c9a29bb1b090a652fdf358a8'
Rebasing (1/1)
ok 14 - git_rebase: 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
		)
	
Successfully rebased and updated detached HEAD.
Cloning into 'submodule_update'...
ok 66 - rebase -i --root retain root commit author and message

expecting success: 
	git checkout B &&
	set_fake_editor &&
	test_must_fail env FAKE_LINES="2" git rebase -i --root &&
	git cat-file commit HEAD | grep "^tree 4b825dc642cb" &&
	git rebase --abort

done.
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  8d3451d different author

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> 8d3451d

HEAD is now at 313fe96... B
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Switched to a new branch 'ours'
Rebasing (1/2)
[ours 34a6bfd] add_x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[ours 67eb987] Revert "add_x"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
Rebasing (2/2)
rebase -i script before editing:
pick 6e62bf8 A
pick 313fe96 B

rebase -i script after editing:
pick 313fe96 B
Rebasing (1/1)
error: could not apply 313fe96... B

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

CONFLICT (modify/delete): file1 deleted in HEAD and modified in 313fe96... B. Version 313fe96... B of file1 left in tree.
Successfully rebased and updated detached HEAD.
Could not apply 313fe965c0484313caa01fa597a77d2ad86d279e... B
tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
ok 19 - rebase -p can re-create two branches on onto

expecting success: 
	git checkout e &&
	test_merge u i

Warning: you are leaving 4 commits behind, not connected to
any of your branches:

  a53b63e w
  8d709cf o
  d0455e3 e
  712812d n

If you want to keep them by creating a new branch, this may be a good time
to do so with:

 git branch <new-branch-name> a53b63e

HEAD is now at 67a7211... e
Merging:
67a7211 e
virtual i
found 1 common ancestor:
1bd0260 d
Merge made by the 'recursive' strategy.
 g.t | 1 +
 i.t | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 g.t
 create mode 100644 i.t
Rebasing (1/2)
ok 20 - setup of non-linear-history for patch-equivalence tests

expecting success: 
	reset_rebase &&
	git rebase -p h u &&
	test_cmp_rev h HEAD~3 &&
	test_cmp_rev HEAD^2^ HEAD~2 &&
	test_revision_subjects 'd i e u' HEAD~2 HEAD^2 HEAD^ HEAD

ok 67 - rebase -i --root temporary sentinel commit

expecting success: 
	git checkout B &&
	set_fake_editor &&
	FAKE_LINES="1 fixup 2" git rebase -i --root &&
	test A = $(git cat-file commit HEAD | sed -ne \$p) &&
	test B = $(git show HEAD:file1) &&
	test 0 = $(git cat-file commit HEAD | grep -c ^parent\ )

HEAD is now at 313fe96... B
No rebase in progress?
HEAD is now at 9a9bb96 u
Removing actual.rev
Removing expect.rev
Successfully rebased and updated detached HEAD.
Rebasing (2/2)
--- expect.rev	2015-12-16 10:54:26.737564806 +0000
+++ actual.rev	2015-12-16 10:54:26.765564806 +0000
@@ -1 +1 @@
-5b67321bb4e1ef5cbccc64d00cd3c3f7768ff359
+d9ea348e0fe8827f205c231ed0a5b8258841fd37
not ok 47 - rebase -p --keep-empty keeps empty even if already in upstream # TODO known breakage

expecting success: 
	git checkout b &&
	revert m b &&
	git checkout --orphan disjoint &&
	git rm -rf . &&
	test_commit x &&
	test_commit y &&
	cherry_pick bp b

Warning: you are leaving 2 commits behind, not connected to
any of your branches:

  1612308 l
  60768b3 d

If you want to keep them by creating a new branch, this may be a good time
to do so with:

 git branch <new-branch-name> 1612308

HEAD is now at 020ea9b... b
Removing b.t
[detached HEAD 6db5543] m
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 b.t
rebase -i script before editing:
pick 6e62bf8 A
pick 313fe96 B

rebase -i script after editing:
pick 6e62bf8 A
fixup 313fe96 B
Switched to a new branch 'disjoint'
rm 'a.t'
[disjoint (root-commit) 059091f] x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 x.t
[disjoint be1e399] y
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 y.t
[disjoint b7cb922] bp
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 b.t
ok 48 - setup of linear history for test involving root

expecting success: 
		reset_rebase &&
		git rebase  --onto c --root y &&
		test_cmp_rev c HEAD~2 &&
		test_linear_range 'x y' c..
	
No rebase in progress?
Rebasing (1/2)
HEAD is now at b7cb922 bp
Removing actual.rev
Removing expect.rev
Rebasing (2/2)
[detached HEAD 833a03c] A
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 file1
First, rewinding head to replay your work on top of it...
Successfully rebased and updated detached HEAD.
Applying: x
Successfully rebased and updated refs/heads/ours.
Applying: y
Rebasing (1/4)
ok 68 - rebase -i --root fixup root commit

expecting success: 
	git reset --hard &&
	git checkout conflict-branch &&
	set_fake_editor &&
	test_must_fail git rebase --onto HEAD~2 HEAD~ &&
	test_must_fail git rebase --edit-todo &&
	git rebase --abort

HEAD is now at 833a03c A
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  833a03c A

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> 833a03c

Switched to branch 'conflict-branch'
ok 49 - rebase  --onto --root

checking known breakage: 
		reset_rebase &&
		git rebase -m --onto c --root y &&
		test_cmp_rev c HEAD~2 &&
		test_linear_range 'x y' c..
	
No rebase in progress?
Rebasing (2/4)
HEAD is now at 7e2f0ad y
Removing actual.rev
Removing expect.rev
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3426-rebase-submodule/submodule_update_repo/.) registered for path 'sub1'
First, rewinding head to replay your work on top of it...
Applying: four
Cloning into 'sub1'...
Using index info to reconstruct a base tree...
M	conflict
Falling back to patching base and 3-way merge...
done.
Merging 766a7986ddba629e2ea47f7642426eef74ae812d with four
Merging:
766a798 two
virtual four
found 1 common ancestor:
virtual 3d3da6c4fe4fab218d150e2af365b8b07d465a22
Auto-merging conflict
CONFLICT (content): Merge conflict in conflict
First, rewinding head to replay your work on top of it...
error: Failed to merge in the changes.
Patch failed at 0001 four
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

fatal: Could not parse object '059091f7a46406a1fbdb245bbd4ac0946f6d476e^'
Unknown exit code (128) from command: git-merge-recursive 059091f7a46406a1fbdb245bbd4ac0946f6d476e^ -- HEAD 059091f7a46406a1fbdb245bbd4ac0946f6d476e
Rebasing (3/4)
not ok 50 - rebase -m --onto --root # TODO known breakage

expecting success: 
		reset_rebase &&
		git rebase -i --onto c --root y &&
		test_cmp_rev c HEAD~2 &&
		test_linear_range 'x y' c..
	
The --edit-todo action can only be used during interactive rebase.
Submodule path 'sub1': checked out '074a145e4bb5d727c9a29bb1b090a652fdf358a8'
Rebasing (4/4)
HEAD is now at be1e399 y
ok 69 - rebase --edit-todo does not works on non-interactive rebase

expecting success: 
	git reset --hard &&
	git checkout no-conflict-branch^0 &&
	set_fake_editor &&
	FAKE_LINES="edit 1 2 3" git rebase -i HEAD~3 &&
	FAKE_LINES="2 1" git rebase --edit-todo &&
	git rebase --continue &&
	test M = $(git cat-file commit HEAD^ | sed -ne \$p) &&
	test L = $(git cat-file commit HEAD | sed -ne \$p)

ok 15 - git_rebase_interactive: 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
		)
	
HEAD is now at f91a2b3 four
Note: checking out 'no-conflict-branch^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 3389558... M
Cloning into 'submodule_update'...
done.
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Switched to a new branch 'ours'
[ours c1f1184] add_x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[ours f037890] Revert "add_x"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
rebase -i script before editing:
pick 265b89e K
pick 6b0f5e6 L
pick 3389558 M

Rebasing (1/2)
rebase -i script after editing:
edit 265b89e K
pick 6b0f5e6 L
pick 3389558 M
Stopped at 265b89e813d4962dde0806bd3409fbe29d6b97ec... K
You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

Successfully rebased and updated detached HEAD.
Rebasing (2/2)
Rebasing (1/3)
Rebasing (1/2)
ok 21 - rebase -p re-creates history around dropped commit matching upstream

expecting success: 
	reset_rebase &&
	git rebase -p --onto f h u &&
	test_cmp_rev f HEAD~3 &&
	test_cmp_rev HEAD^2^ HEAD~2 &&
	test_revision_subjects 'd i e u' HEAD~2 HEAD^2 HEAD^ HEAD

rebase -i script before editing:
pick 6b0f5e6 L
pick 3389558 M
rebase -i script after editing:
pick 3389558 M
pick 6b0f5e6 L
No rebase in progress?
HEAD is now at e5af6fe u
Removing actual.rev
Removing expect.rev
Successfully rebased and updated detached HEAD.
Rebasing (2/2)
Rebasing (2/3)
Rebasing (3/3)
ok 51 - rebase -i --onto --root

expecting success: 
		reset_rebase &&
		git rebase -p --onto c --root y &&
		test_cmp_rev c HEAD~2 &&
		test_linear_range 'x y' c..
	
Successfully rebased and updated detached HEAD.
No rebase in progress?
ok 70 - rebase --edit-todo can be used to modify todo

expecting success: 
	git reset --hard &&
	git branch -f branch-reflog-test H &&
	set_fake_editor &&
	git rebase -i --onto I F branch-reflog-test &&
	cat >expect <<-\EOF &&
	rebase -i (finish): returning to refs/heads/branch-reflog-test
	rebase -i (pick): H
	rebase -i (pick): G
	rebase -i (start): checkout I
	EOF
	git reflog -n4 HEAD |
	sed "s/[^:]*: //" >actual &&
	test_cmp expect actual

HEAD is now at 7e2f0ad y
Removing actual.rev
Removing expect.rev
HEAD is now at 2a67c35 L
Successfully rebased and updated refs/heads/ours.
Rebasing (1/4)
Rebasing (2/4)
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3426-rebase-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'sub1'...
done.
Rebasing (1/2)
Rebasing (1/2)
Rebasing (3/4)
Rebasing (2/2)
Rebasing (2/2)
Submodule path 'sub1': checked out '074a145e4bb5d727c9a29bb1b090a652fdf358a8'
Rebasing (4/4)
ok 16 - git_rebase_interactive: 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
		)
	
Cloning into 'submodule_update'...
done.
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Switched to a new branch 'ours'
[ours 425c0b3] add_x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[ours c39088c] Revert "add_x"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
Successfully rebased and updated refs/heads/branch-reflog-test.
Successfully rebased and updated detached HEAD.
ok 71 - rebase -i produces readable reflog

expecting success: 
	git reset --hard &&
	git checkout E^0 &&
	test_config core.commentchar "\\" &&
	write_script remove-all-but-first.sh <<-\EOF &&
	sed -e "2,\$s/^/\\\\/" "$1" >"$1.tmp" &&
	mv "$1.tmp" "$1"
	EOF
	test_set_editor "$(pwd)/remove-all-but-first.sh" &&
	git rebase -i B &&
	test B = $(git cat-file commit HEAD^ | sed -ne \$p)

HEAD is now at 230f509 H
Note: checking out 'E^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 8f99a4f... E
ok 52 - rebase -p --onto --root

expecting success: 
		reset_rebase &&
		git rebase  c y &&
		test_cmp_rev c HEAD~2 &&
		test_linear_range 'x y' c..
	
No rebase in progress?
HEAD is now at 7e2f0ad y
Removing actual.rev
Removing expect.rev
Successfully rebased and updated detached HEAD.
error: The following untracked working tree files would be overwritten by checkout:
	sub1
Please move or remove them before you can switch branches.
Aborting
could not detach HEAD
ok 17 - git_rebase_interactive: 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 22 - rebase -p --onto in merged history drops patches in upstream

expecting success: 
	reset_rebase &&
	git rebase -p --onto h f u &&
	test_cmp_rev h HEAD~3 &&
	test_cmp_rev HEAD^2~2 HEAD~2 &&
	test_revision_subjects 'd gp i e u' HEAD~2 HEAD^2^ HEAD^2 HEAD^ HEAD

Cloning into 'submodule_update'...
First, rewinding head to replay your work on top of it...
done.
No rebase in progress?
Applying: x
HEAD is now at 97f19d6 u
Removing actual.rev
Removing expect.rev
Applying: y
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.
t3426-rebase-submodule.sh: 159: cd: can't cd to sub1
Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
ok 53 - rebase  without --onto --root with disjoint history

checking known breakage: 
		reset_rebase &&
		git rebase -m c y &&
		test_cmp_rev c HEAD~2 &&
		test_linear_range 'x y' c..
	
Switched to a new branch 'ours'
[ours 2e8eaa1] add_x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
No rebase in progress?
[ours 6620ed2] Revert "add_x"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
HEAD is now at 7e2f0ad y
Removing actual.rev
Removing expect.rev
Successfully rebased and updated detached HEAD.
Rebasing (1/1)
ok 72 - rebase -i respects core.commentchar

expecting success: 
	test_when_finished "git branch -D torebase" &&
	git checkout -b torebase branch1 &&
	upstream=$(git rev-parse ":/J") &&
	onto=$(git rev-parse ":/A") &&
	git rebase --onto $onto $upstream &&
	git reset --hard branch1 &&
	git rebase --onto ":/A" ":/J" &&
	git checkout branch1

Previous HEAD position was d0f65f2... C
Switched to a new branch 'torebase'
First, rewinding head to replay your work on top of it...
fatal: Could not parse object '059091f7a46406a1fbdb245bbd4ac0946f6d476e^'
Unknown exit code (128) from command: git-merge-recursive 059091f7a46406a1fbdb245bbd4ac0946f6d476e^ -- HEAD 059091f7a46406a1fbdb245bbd4ac0946f6d476e
not ok 54 - rebase -m without --onto --root with disjoint history # TODO known breakage

expecting success: 
		reset_rebase &&
		git rebase -i c y &&
		test_cmp_rev c HEAD~2 &&
		test_linear_range 'x y' c..
	
First, rewinding head to replay your work on top of it...
HEAD is now at be1e399 y
Applying: different author
HEAD is now at 92841b7 different author
Rebasing (1/2)
Rebasing (1/5)
Rebasing (2/2)
First, rewinding head to replay your work on top of it...
Applying: different author
Switched to branch 'branch1'
Rebasing (2/5)
Deleted branch torebase (was 2d353ba).
ok 73 - rebase -i, with <onto> and <upstream> specified as :/quuxery

expecting success: 
	git checkout -b conflict-merge-use-theirs conflict-branch &&
	git reset --hard HEAD^ &&
	echo five >conflict &&
	echo Z >file1 &&
	git commit -a -m "one file conflict" &&
	EDITOR=true git rebase -i --strategy=recursive -Xours conflict-branch &&
	test $(git show conflict-branch:conflict) = $(cat conflict) &&
	test $(cat file1) = Z

Switched to a new branch 'conflict-merge-use-theirs'
Rebasing (1/2)
HEAD is now at 1eadf03 three
[conflict-merge-use-theirs e89ba71] one file conflict
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 2 deletions(-)
Successfully rebased and updated refs/heads/ours.
Rebasing (3/5)
Rebasing (2/2)
Rebasing (4/5)
Rebasing (5/5)
Rebasing (1/1)
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3426-rebase-submodule/submodule_update_repo/.) registered for path 'sub1'
Successfully rebased and updated detached HEAD.
Cloning into 'sub1'...
ok 55 - rebase -i without --onto --root with disjoint history

checking known breakage: 
		reset_rebase &&
		git rebase -p c y &&
		test_cmp_rev c HEAD~2 &&
		test_linear_range 'x y' c..
	
done.
No rebase in progress?
HEAD is now at 7e2f0ad y
Removing actual.rev
Removing expect.rev
Submodule path 'sub1': checked out '074a145e4bb5d727c9a29bb1b090a652fdf358a8'
ok 18 - git_rebase_interactive: replace tracked file with submodule creates empty directory

checking known breakage: 
		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
		)
	
Cloning into 'submodule_update'...
Successfully rebased and updated refs/heads/conflict-merge-use-theirs.
done.
Successfully rebased and updated detached HEAD.
ok 74 - rebase -i with --strategy and -X

expecting success: 
	current_head=$(git rev-parse HEAD) &&
	test_when_finished "git rebase --abort; git reset --hard $current_head; rm -f error" &&
	test_commit TO-REMOVE will-conflict old-content &&
	test_commit "\temp" will-conflict new-content dummy &&
	test_must_fail env EDITOR=true git rebase -i HEAD^ --onto HEAD^^ 2>error &&
	test_expect_code 1 grep  "	emp" error

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.
[conflict-merge-use-theirs 1b964f5] TO-REMOVE
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 will-conflict
ok 23 - rebase -p --onto in merged history does not drop patches in onto

expecting success: 
	git checkout gp &&
	test_merge s e &&
	git checkout e &&
	test_merge t gp

error: 8ed2e6719f8484ce01fa3ce133fe42d25c2441b8^{commit}: expected commit type, but the object dereferences to tree type
fatal: Needed a single revision
Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
Warning: you are leaving 5 commits behind, not connected to
any of your branches:

  c80436f u
  86b2452 e
  7637afd i
  45d528f d
  bfc420a gp

If you want to keep them by creating a new branch, this may be a good time
to do so with:

 git branch <new-branch-name> c80436f

HEAD is now at 00eccdb... gp
[conflict-merge-use-theirs 3cd95c3] \temp
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Merging:
00eccdb gp
virtual e
found 1 common ancestor:
1bd0260 d
Merge made by the 'recursive' strategy.
 e.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 e.t
Switched to a new branch 'ours'
Previous HEAD position was cd98db9... s
HEAD is now at 67a7211... e
[ours f355f48] add_x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Merging:
67a7211 e
virtual gp
found 1 common ancestor:
1bd0260 d
Merge made by the 'recursive' strategy.
 g.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 g.t
ok 24 - setup of non-linear-history for dropping whole side

checking known breakage: 
	reset_rebase &&
	git rebase -p h s &&
	test_cmp_rev h HEAD~2 &&
	test_linear_range 'd e' h..

[ours 43d5ecd] Revert "add_x"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
No rebase in progress?
Rebasing (1/1)
HEAD is now at cc19be7 t
Removing actual.rev
Removing expect.rev
Rebasing (1/1)
error: could not apply 3cd95c3... \temp

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

CONFLICT (modify/delete): will-conflict deleted in HEAD and modified in 3cd95c3... \temp. Version 3cd95c3... \temp of will-conflict left in tree.
Rebasing (1/2)
HEAD is now at 2b1a771 one file conflict
error: could not apply f355f48... add_x

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

CONFLICT (file/directory): There is a directory with name sub1 in f355f48... add_x. Adding sub1 as sub1~HEAD
ok 75 - rebase -i error on commits with \ in message

expecting success: 
	test_when_finished "git checkout master" &&
	git checkout --orphan collide &&
	git rm -rf . &&
	(
	unset test_tick &&
	test_commit collide1 collide &&
	test_commit --notick collide2 collide &&
	test_commit --notick collide3 collide
	)

Switched to a new branch 'collide'
rm 'conflict'
rm 'file1'
[collide (root-commit) 674fc94] collide1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 collide
Could not apply f355f48b939ed4ef6b223f4611d7438ebe5d91ff... add_x
Successfully rebased and updated detached HEAD.
not ok 19 - git_rebase_interactive: replace directory with submodule # TODO known breakage

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
		)
	
[collide 0b53f45] collide2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
--- expect.rev	2015-12-16 10:54:45.381564808 +0000
+++ actual.rev	2015-12-16 10:54:45.409564808 +0000
@@ -1 +1 @@
-d9ea348e0fe8827f205c231ed0a5b8258841fd37
+ce450c7fd6766cb1f2df873857da7b928ff743a8
not ok 56 - rebase -p without --onto --root with disjoint history # TODO known breakage

expecting success: 
		reset_rebase &&
		git rebase  --onto m --root bp &&
		test_cmp_rev m HEAD~2 &&
		test_linear_range 'x y' m..
	
[collide 6bcda37] collide3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'submodule_update'...
Switched to branch 'master'
ok 76 - short SHA-1 setup

expecting success: 
	test_when_finished "reset_rebase && git checkout master" &&
	git checkout collide &&
	(
	unset test_tick &&
	test_tick &&
	set_fake_editor &&
	FAKE_COMMIT_MESSAGE="collide2 ac4f2ee" \
	FAKE_LINES="reword 1 2" git rebase -i HEAD~2
	)

Switched to branch 'collide'
done.
No rebase in progress?
HEAD is now at d9ea348 c
Rebasing (1/3)
Removing actual.rev
Removing expect.rev
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
First, rewinding head to replay your work on top of it...
Rebasing (2/3)
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3426-rebase-submodule/submodule_update_repo/.) registered for path 'sub1'
Applying: x
Applying: y
Cloning into 'sub1'...
ok 57 - rebase  --onto --root drops patch in onto

checking known breakage: 
		reset_rebase &&
		git rebase -m --onto m --root bp &&
		test_cmp_rev m HEAD~2 &&
		test_linear_range 'x y' m..
	
done.
rebase -i script before editing:
pick 0b53f45 collide2
pick 6bcda37 collide3

rebase -i script after editing:
reword 0b53f45 collide2
pick 6bcda37 collide3
No rebase in progress?
Rebasing (3/3)
HEAD is now at 1daea3a y
Removing actual.rev
Removing expect.rev
Submodule path 'sub1': checked out '074a145e4bb5d727c9a29bb1b090a652fdf358a8'
Rebasing (1/2)
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
[detached HEAD 6bcda37f] collide2 ac4f2ee
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
First, rewinding head to replay your work on top of it...
Switched to a new branch 'ours'
[ours 2208125] add_x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
fatal: Could not parse object '059091f7a46406a1fbdb245bbd4ac0946f6d476e^'
Unknown exit code (128) from command: git-merge-recursive 059091f7a46406a1fbdb245bbd4ac0946f6d476e^ -- HEAD 059091f7a46406a1fbdb245bbd4ac0946f6d476e
Rebasing (2/2)
not ok 58 - rebase -m --onto --root drops patch in onto # TODO known breakage

expecting success: 
		reset_rebase &&
		git rebase -i --onto m --root bp &&
		test_cmp_rev m HEAD~2 &&
		test_linear_range 'x y' m..
	
[ours d88a208] Revert "add_x"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
Successfully rebased and updated refs/heads/collide.
HEAD is now at b7cb922 bp
No rebase in progress?
HEAD is now at fbe3cf5 collide3
Removing actual
Removing actual-squash-fixup
Removing actual.rev
Removing empty
Removing expect
Removing expect-squash-fixup
Removing expect.rev
Removing expect2
Removing expected
Removing fake-editor.sh
Removing out
Removing output
Removing remove-all-but-first.sh
Removing tmp
Removing touch-subdir
Switched to branch 'master'
ok 77 - short SHA-1 collide

expecting success: 
	git config core.abbrev 12 &&
	set_cat_todo_editor &&
	test_must_fail git rebase -i HEAD~4 >todo-list &&
	test 4 = $(grep -c "pick [0-9a-f]\{12,\}" todo-list)

Successfully rebased and updated detached HEAD.
Rebasing (1/2)
Rebasing (1/2)
not ok 25 - rebase -p drops merge commit when entire first-parent side is dropped # TODO known breakage

expecting success: 
	reset_rebase &&
	git rebase -p h t &&
	test_cmp_rev h HEAD~2 &&
	test_linear_range 'd e' h..

Could not execute editor
Rebasing (2/2)
ok 78 - respect core.abbrev

expecting success: 
	write_script dump-raw.sh <<-\EOF &&
		cat "$1"
	EOF
	test_set_editor "$(pwd)/dump-raw.sh" &&
	git rebase -i HEAD~4 >actual &&
	grep "^# Rebase ..* onto ..* ([0-9]" actual

No rebase in progress?
HEAD is now at df14409 s
Removing actual.rev
Removing expect.rev
Successfully rebased and updated refs/heads/master.
Rebasing (2/2)
# Rebase 6e62bf890e21..8f99a4f1fbbd onto 6e62bf890e21 (4 command(s))
ok 79 - todo count

expecting success: 
	git checkout --force branch2 &&
	git clean -f &&
	set_fake_editor &&
	FAKE_LINES="edit 1 2" git rebase -i A &&
	test_cmp_rev HEAD F &&
	test_path_is_missing file6 &&
	>file6 &&
	test_must_fail git rebase --continue &&
	test_cmp_rev HEAD F &&
	rm file6 &&
	git rebase --continue &&
	test_cmp_rev HEAD I

Switched to branch 'branch2'
Removing actual
Removing dump-raw.sh
Removing fake-editor.sh
Removing todo-list
Successfully rebased and updated refs/heads/ours.
Successfully rebased and updated detached HEAD.
Rebasing (1/2)
ok 20 - git_rebase_interactive: 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 59 - rebase -i --onto --root drops patch in onto

expecting success: 
		reset_rebase &&
		git rebase -p --onto m --root bp &&
		test_cmp_rev m HEAD~2 &&
		test_linear_range 'x y' m..
	
Cloning into 'submodule_update'...
No rebase in progress?
Rebasing (2/2)
HEAD is now at 1daea3a y
Removing actual.rev
Removing expect.rev
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
rebase -i script before editing:
pick cfefd94ba3b7 F
pick 615be62cadc1 I

rebase -i script after editing:
edit cfefd94ba3b7 F
pick 615be62cadc1 I
Stopped at cfefd94ba3b70dd16a43ce9aaf4340ce25d84cff... F
Rebasing (1/2)
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3426-rebase-submodule/submodule_update_repo/.) registered for path 'sub1'
You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

Cloning into 'sub1'...
done.
Submodule path 'sub1': checked out '074a145e4bb5d727c9a29bb1b090a652fdf358a8'
Rebasing (2/2)
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
Rebasing (1/2)
error: The following untracked working tree files would be overwritten by merge:
	file6
Please move or remove them before you can merge.
Aborting
Switched to a new branch 'ours'
Could not apply 615be62cadc1c85c6ac7d6974210b1aa1721c98f... I
[ours 033f30c] add_x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[ours 8e183fb] Revert "add_x"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
Successfully rebased and updated detached HEAD.
Rebasing (2/2)
ok 26 - rebase -p drops merge commit when entire second-parent side is dropped

expecting success: 
	git checkout n &&
	git merge --no-commit e &&
	git reset n . &&
	git commit -m r &&
	git reset --hard &&
	git clean -f &&
	git tag r

Warning: you are leaving 2 commits behind, not connected to
any of your branches:

  03b6df6 e
  c8a9e3b d

If you want to keep them by creating a new branch, this may be a good time
to do so with:

 git branch <new-branch-name> 03b6df6

HEAD is now at 35a5a4f... n
Automatic merge went well; stopped before committing as requested
Merging:
35a5a4f n
virtual e
found 1 common ancestor:
1bd0260 d
Rebasing (2/2)
[detached HEAD b5d7f15] r
 Author: A U Thor <author@example.com>
HEAD is now at b5d7f15 r
Removing actual.rev
Removing e.t
Removing expect.rev
ok 27 - setup of non-linear-history for empty commits

expecting success: 
	reset_rebase &&
	git rebase -p c r &&
	test_cmp_rev c HEAD~3 &&
	test_cmp_rev HEAD^2^ HEAD~2 &&
	test_revision_subjects 'd e n r' HEAD~2 HEAD^2 HEAD^ HEAD

Successfully rebased and updated refs/heads/branch2.
No rebase in progress?
HEAD is now at b5d7f15 r
ok 80 - rebase -i commits that overwrite untracked files (pick)

expecting success: 
	git checkout --force branch2 &&
	git clean -f &&
	git tag original-branch2 &&
	set_fake_editor &&
	FAKE_LINES="edit 1 squash 2" git rebase -i A &&
	test_cmp_rev HEAD F &&
	test_path_is_missing file6 &&
	>file6 &&
	test_must_fail git rebase --continue &&
	test_cmp_rev HEAD F &&
	rm file6 &&
	git rebase --continue &&
	test $(git cat-file commit HEAD | sed -ne \$p) = I &&
	git reset --hard original-branch2

Already on 'branch2'
Removing actual.rev
Removing expect.rev
Removing fake-editor.sh
Rebasing (1/2)
Rebasing (2/2)
rebase -i script before editing:
pick cfefd94ba3b7 F
pick 615be62cadc1 I

rebase -i script after editing:
edit cfefd94ba3b7 F
squash 615be62cadc1 I
Successfully rebased and updated detached HEAD.
ok 60 - rebase -p --onto --root drops patch in onto

expecting success: 
		reset_rebase &&
		git rebase  --onto m --root g &&
		test_cmp_rev m HEAD~2 &&
		test_linear_range 'c g' m..
	
Stopped at cfefd94ba3b70dd16a43ce9aaf4340ce25d84cff... F
No rebase in progress?
Rebasing (1/2)
HEAD is now at 1daea3a y
Removing actual.rev
Removing expect.rev
You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

Rebasing (1/4)
First, rewinding head to replay your work on top of it...
Applying: c
Applying: g
Rebasing (2/4)
Rebasing (2/2)
ok 61 - rebase  --onto --root with merge-base does not go to root

expecting success: 
		reset_rebase &&
		git rebase -m --onto m --root g &&
		test_cmp_rev m HEAD~2 &&
		test_linear_range 'c g' m..
	
error: The following untracked working tree files would be overwritten by merge:
	file6
Please move or remove them before you can merge.
Aborting
fatal: merging of trees eb689cc8eed0e8a6ed5383618d1f03cc48bd9f81 and f9b09c5f252e2ce55ab159967e1595879f4525bd failed

Could not apply 615be62cadc1c85c6ac7d6974210b1aa1721c98f... I
No rebase in progress?

HEAD is now at 9921398 g
Rebasing (3/4)
Removing actual.rev
Removing expect.rev
Successfully rebased and updated refs/heads/ours.
First, rewinding head to replay your work on top of it...
Rebasing (4/4)
Merging m with HEAD~1
Merging:
6db5543 m
d9ea348 c
found 1 common ancestor:
020ea9b b
ok 21 - git_rebase_interactive: 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
		)
	
Rebasing (2/2)
[detached HEAD 68cd74b] c
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 c.t
Committed: 0001 c
Merging m with HEAD~0
Merging:
68cd74b c
5573dba g
found 1 common ancestor:
d9ea348 c
[detached HEAD 9921398] g
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:18:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 g.t
Cloning into 'submodule_update'...
Committed: 0002 [detached HEAD 829ff9c6b267] F
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:18:13 2005 -0700
 2 files changed, 2 insertions(+)
 create mode 100644 file4
 create mode 100644 file6
g
All done.
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 62 - rebase -m --onto --root with merge-base does not go to root

expecting success: 
		reset_rebase &&
		git rebase -i --onto m --root g &&
		test_cmp_rev m HEAD~2 &&
		test_linear_range 'c g' m..
	
Successfully rebased and updated refs/heads/branch2.
HEAD is now at 615be62cadc1 I
ok 81 - rebase -i commits that overwrite untracked files (squash)

expecting success: 
	git checkout --force branch2 &&
	git clean -f &&
	set_fake_editor &&
	FAKE_LINES="edit 1 2" git rebase -i --no-ff A &&
	test $(git cat-file commit HEAD | sed -ne \$p) = F &&
	test_path_is_missing file6 &&
	>file6 &&
	test_must_fail git rebase --continue &&
	test $(git cat-file commit HEAD | sed -ne \$p) = F &&
	rm file6 &&
	git rebase --continue &&
	test $(git cat-file commit HEAD | sed -ne \$p) = I

Already on 'branch2'
No rebase in progress?
Removing actual.rev
Removing expect.rev
Removing fake-editor.sh
HEAD is now at 9921398 g
Removing actual.rev
Removing expect.rev
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3426-rebase-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'sub1'...
done.
Submodule path 'sub1': checked out '074a145e4bb5d727c9a29bb1b090a652fdf358a8'
rebase -i script before editing:
pick cfefd94ba3b7 F
pick 615be62cadc1 I

rebase -i script after editing:
edit cfefd94ba3b7 F
pick 615be62cadc1 I
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
Switched to a new branch 'ours'
[ours 818cac5] add_x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Rebasing (1/2)
Rebasing (1/2)
[ours a546463] Revert "add_x"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
Successfully rebased and updated detached HEAD.
Stopped at cfefd94ba3b70dd16a43ce9aaf4340ce25d84cff... F
ok 28 - rebase -p re-creates empty internal merge commit
You can amend the commit now, with


	git commit --amend 
expecting success: 

	reset_rebase &&
Once you are satisfied with your changes, run
	git rebase -p o r &&

	test_cmp_rev e HEAD^2 &&
	git rebase --continue
	test_cmp_rev o HEAD^ &&

	test_revision_subjects 'r' HEAD

No rebase in progress?
Rebasing (2/2)
HEAD is now at 40b3097 r
Removing actual.rev
Removing expect.rev
Rebasing (2/2)
error: The following untracked working tree files would be overwritten by merge:
	file6
Please move or remove them before you can merge.
Aborting
fatal: merging of trees eb689cc8eed0e8a6ed5383618d1f03cc48bd9f81 and f9b09c5f252e2ce55ab159967e1595879f4525bd failed
Could not apply 615be62cadc1c85c6ac7d6974210b1aa1721c98f... I
error: The following untracked working tree files would be overwritten by checkout:
	sub1/file1
	sub1/file2
Please move or remove them before you can switch branches.
Aborting
could not detach HEAD
ok 22 - git_rebase_interactive: 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
		)
	
Cloning into 'submodule_update'...
done.
Switched to a new branch 'add_sub1'
Rebasing (2/2)
Rebasing (1/1)
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Successfully rebased and updated refs/heads/branch2.
Successfully rebased and updated detached HEAD.
ok 82 - rebase -i commits that overwrite untracked files (no ff)

expecting success: 
	git checkout -b commit-to-skip &&
	for double in X 3 1
	do
		test_seq 5 | sed "s/$double/&&/" >seq &&
		git add seq &&
		test_tick &&
		git commit -m seq-$double
	done &&
	git tag seq-onto &&
	git reset --hard HEAD~2 &&
	git cherry-pick seq-onto &&
	set_fake_editor &&
	test_must_fail env FAKE_LINES= git rebase -i seq-onto &&
	test -d .git/rebase-merge &&
	git rebase --continue &&
	git diff --exit-code seq-onto &&
	test ! -d .git/rebase-merge &&
	test ! -f .git/CHERRY_PICK_HEAD

Switched to a new branch 'commit-to-skip'
ok 63 - rebase -i --onto --root with merge-base does not go to root

checking known breakage: 
		reset_rebase &&
		git rebase -p --onto m --root g &&
		test_cmp_rev m HEAD~2 &&
		test_linear_range 'c g' m..
	
[commit-to-skip 3432f3d6ff99] seq-X
 Author: A U Thor <author@example.com>
 1 file changed, 5 insertions(+)
 create mode 100644 seq
No rebase in progress?
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3426-rebase-submodule/submodule_update_repo/.) registered for path 'sub1'
HEAD is now at 9921398 g
[commit-to-skip f895dc6b2f00] seq-3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Removing actual.rev
Removing expect.rev
[commit-to-skip c172a6aa2bcb] seq-1
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+), 2 deletions(-)
HEAD is now at 3432f3d6ff99 seq-X
Cloning into 'sub1'...
Auto-merging seq
[commit-to-skip d410a93035fa] seq-1
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 16:17:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
done.
Submodule path 'sub1': checked out '074a145e4bb5d727c9a29bb1b090a652fdf358a8'
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
Switched to a new branch 'ours'
[ours e86d9e4] add_x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[ours ee77db3] Revert "add_x"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
Rebasing (1/2)
Rebasing (1/1)
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:

    git commit --allow-empty

Otherwise, please use 'git reset'
interactive rebase in progress; onto c172a6aa2bcb
Last command done (1 command done):
   pick d410a93035fa seq-1
No commands remaining.
You are currently rebasing branch 'commit-to-skip' on 'c172a6aa2bcb'.

Untracked files:
	fake-editor.sh
	sub/

nothing added to commit but untracked files present
Successfully rebased and updated detached HEAD.
Could not apply d410a93035fa2db46620ad76f61c1feef833358c... seq-1
Rebasing (2/2)
ok 29 - rebase -p re-creates empty merge commit

# still have 2 known breakage(s)
# passed all remaining 27 test(s)
1..29
*** t3500-cherry.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3500-cherry/.git/
expecting success: echo First > A &&
     git update-index --add A &&
     test_tick &&
     git commit -m "Add A." &&

     git checkout -b my-topic-branch &&

     echo Second > B &&
     git update-index --add B &&
     test_tick &&
     git commit -m "Add B." &&

     echo AnotherSecond > C &&
     git update-index --add C &&
     test_tick &&
     git commit -m "Add C." &&

     git checkout -f master &&
     rm -f B C &&

     echo Third >> A &&
     git update-index A &&
     test_tick &&
     git commit -m "Modify A." &&

     expr "$(echo $(git cherry master my-topic-branch) )" : "+ [^ ]* + .*"

error: The following untracked working tree files would be overwritten by checkout:
	sub1/file1
	sub1/file2
Please move or remove them before you can switch branches.
Aborting
could not detach HEAD
Rebasing (1/1)
[master (root-commit) 4655d1a] Add A.
 Author: A U Thor <bogus_email_address>
 1 file changed, 1 insertion(+)
 create mode 100644 A
Switched to a new branch 'my-topic-branch'
[my-topic-branch 75dd694] Add B.
 Author: A U Thor <bogus_email_address>
 1 file changed, 1 insertion(+)
 create mode 100644 B
[my-topic-branch c8d60d2] Add C.
 Author: A U Thor <bogus_email_address>
 1 file changed, 1 insertion(+)
 create mode 100644 C
Switched to branch 'master'
ok 23 - git_rebase_interactive: 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
		)
	
[master 90cb8ed] Modify A.
 Author: A U Thor <bogus_email_address>
 1 file changed, 1 insertion(+)
85
ok 1 - prepare repository with topic branch, and check cherry finds the 2 patches from there

expecting success: expr "$(echo $(git cherry master my-topic-branch my-topic-branch^1) )" : "+ [^ ]*"

42
ok 2 - check that cherry with limit returns only the top patch

expecting success: git cherry-pick my-topic-branch^0 &&
     echo $(git cherry master my-topic-branch) &&
     expr "$(echo $(git cherry master my-topic-branch) )" : "+ [^ ]* - .*"

[master 3a1a38a] Add C.
 Author: A U Thor <bogus_email_address>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 C
+ 75dd694131e593dac8cf8ea0a377f1b73a80c1ad - c8d60d26f42936e7a055747f5412d41a6bce7d77
85
ok 3 - cherry-pick one of the 2 patches, and check cherry recognized one and only one as new

# passed all 3 test(s)
1..3
Cloning into 'submodule_update'...
*** t3501-revert-cherry-pick.sh ***
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3501-revert-cherry-pick/.git/
expecting success: 

	for l in a b c d e f g h i j k l m n o
	do
		echo $l$l$l$l$l$l$l$l$l
	done >oops &&

	test_tick &&
	git add oops &&
	git commit -m initial &&
	git tag initial &&

	test_tick &&
	echo "Add extra line at the end" >>oops &&
	git commit -a -m added &&
	git tag added &&

	test_tick &&
	git mv oops spoo &&
	git commit -m rename1 &&
	git tag rename1 &&

	test_tick &&
	git checkout -b side initial &&
	git mv oops opos &&
	git commit -m rename2 &&
	git tag rename2

[master (root-commit) a242c62] initial
 Author: A U Thor <author@example.com>
 1 file changed, 15 insertions(+)
 create mode 100644 oops
[master 4399171] added
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master 31df260] rename1
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename oops => spoo (100%)
Switched to a new branch 'side'
[side f6d0551] rename2
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename oops => opos (100%)
ok 1 - setup

expecting success: 

	pos=$(git rev-parse HEAD) &&
	git diff --exit-code HEAD &&
	test_must_fail git cherry-pick --nonsense 2>msg &&
	git diff --exit-code HEAD "$pos" &&
	test_i18ngrep [Uu]sage: msg

Successfully rebased and updated detached HEAD.
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3426-rebase-submodule/submodule_update_repo/.) registered for path 'sub1'
usage: git cherry-pick [<options>] <commit-ish>...
ok 2 - cherry-pick --nonsense

expecting success: 

	pos=$(git rev-parse HEAD) &&
	git diff --exit-code HEAD &&
	test_must_fail git revert --nonsense 2>msg &&
	git diff --exit-code HEAD "$pos" &&
	test_i18ngrep [Uu]sage: msg

--- expect.rev	2015-12-16 10:55:05.257564811 +0000
+++ actual.rev	2015-12-16 10:55:05.293564811 +0000
@@ -1 +1 @@
-6db5543d43a2166fae6f6d320a0b715c6c1c4278
+020ea9b5b2051d958f4737afacdc8821a33ac9a9
not ok 64 - rebase -p --onto --root with merge-base does not go to root # TODO known breakage

expecting success: 
		reset_rebase &&
		git rebase  m bp &&
		test_cmp_rev m HEAD~2 &&
		test_linear_range 'x y' m..
	
usage: git revert [<options>] <commit-ish>...
ok 3 - revert --nonsense

expecting success: 

	git checkout rename2 &&
	git cherry-pick added &&
	test $(git rev-parse HEAD^) = $(git rev-parse rename2) &&
	test -f opos &&
	grep "Add extra line at the end" opos &&
	git reflog -1 | grep cherry-pick


Cloning into 'sub1'...
Note: checking out 'rename2'.

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 f6d0551... rename2
Auto-merging opos
No rebase in progress?
[detached HEAD 2da2754] added
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 1 file changed, 1 insertion(+)
done.
HEAD is now at 5573dba g
Removing actual.rev
Removing expect.rev
Add extra line at the end
2da2754 HEAD@{0}: cherry-pick: added
ok 4 - cherry-pick after renaming branch

expecting success: 

	git checkout rename1 &&
	git revert added &&
	test $(git rev-parse HEAD^) = $(git rev-parse rename1) &&
	test -f spoo &&
	! grep "Add extra line at the end" spoo &&
	git reflog -1 | grep revert


Successfully rebased and updated refs/heads/commit-to-skip.
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  2da2754 added

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> 2da2754

HEAD is now at 31df260... rename1
Auto-merging spoo
ok 83 - rebase --continue removes CHERRY_PICK_HEAD

expecting success: 
	rebase_setup_and_clean drop-test &&
	set_fake_editor &&
	FAKE_LINES="1 drop 2 3 drop 4 5" git rebase -i --root &&
	test E = $(git cat-file commit HEAD | sed -ne \$p) &&
	test C = $(git cat-file commit HEAD^ | sed -ne \$p) &&
	test A = $(git cat-file commit HEAD^^ | sed -ne \$p)

[detached HEAD 9990ddc] Revert "added"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
Switched to a new branch 'drop-test'
Submodule path 'sub1': checked out '074a145e4bb5d727c9a29bb1b090a652fdf358a8'
9990ddc HEAD@{0}: revert: Revert "added"
ok 5 - revert after renaming branch

expecting success: 
	git clone . copy &&
	(
		cd copy &&
		git checkout initial &&
		test-chmtime +40 oops &&
		git cherry-pick added
	)

Cloning into 'copy'...
done.
First, rewinding head to replay your work on top of it...
Note: checking out '9990ddca844ef3875d864da986dfd141d1a88865'.

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>

Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  9990ddc Revert "added"

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> 9990ddc

HEAD is now at a242c62... initial
Switched to a new branch 'ours'
Applying: x
[detached HEAD 096ed54] added
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 1 file changed, 1 insertion(+)
ok 6 - cherry-pick on stat-dirty working tree

expecting success: 

	echo content >extra_file &&
	git add extra_file &&
	test_must_fail git revert HEAD 2>errors &&
	test_i18ngrep "Your local changes would be overwritten by " errors


Applying: y
[ours 1297e2d] add_x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
error: Your local changes would be overwritten by revert.
ok 7 - revert forbidden on dirty working tree

expecting success: 
	git checkout --orphan unborn &&
	git rm --cached -r . &&
	rm -rf * &&
	git cherry-pick initial &&
	git diff --quiet initial &&
	! test_cmp_rev initial HEAD

Switched to a new branch 'unborn'
A	extra_file
[ours c2d4b84] Revert "add_x"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
rm 'extra_file'
rm 'spoo'
ok 65 - rebase  without --onto --root with disjoint history drops patch in onto

checking known breakage: 
		reset_rebase &&
		git rebase -m m bp &&
		test_cmp_rev m HEAD~2 &&
		test_linear_range 'x y' m..
	
[unborn (root-commit) 38e6d75] initial
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 15 insertions(+)
 create mode 100644 oops
--- expect.rev	2015-12-16 10:55:06.381564811 +0000
+++ actual.rev	2015-12-16 10:55:06.405564811 +0000
@@ -1 +1 @@
-a242c628eb0a8dc3b46a2304662d9ada7621ef18
+38e6d75e0aa3f58322a336b3c203eff724d10493
ok 8 - cherry-pick on unborn branch

expecting success: 
	git checkout unborn &&
	test_commit to-pick actual content &&
	git checkout master &&
	git cherry-pick - &&
	echo content >expect &&
	test_cmp expect actual

Already on 'unborn'
No rebase in progress?
HEAD is now at 1daea3a y
Removing actual.rev
Removing expect.rev
[unborn d9ba711] to-pick
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 actual
Switched to branch 'master'
Skipped spoo (merged same as existing)
[master 7c68b81] to-pick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:17:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 actual
ok 9 - cherry-pick "-" to pick from previous branch

expecting success: 
	test_create_repo afresh &&
	(
		cd afresh &&
		test_commit one &&
		test_commit two &&
		test_commit three &&
		test_must_fail git cherry-pick -
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3501-revert-cherry-pick/afresh/.git/
[master (root-commit) 26cc6ba] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
rebase -i script before editing:
pick 6e62bf890e21 A
pick 313fe965c048 B
pick d0f65f2f81ee C
pick 0547e3f1350d D
pick 8f99a4f1fbbd E

First, rewinding head to replay your work on top of it...
rebase -i script after editing:
pick 6e62bf890e21 A
drop 313fe965c048 B
pick d0f65f2f81ee C
drop 0547e3f1350d D
pick 8f99a4f1fbbd E
[master 776892e] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two.t
[master 6c11eb3] three
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 three.t
fatal: Could not parse object '059091f7a46406a1fbdb245bbd4ac0946f6d476e^'
Unknown exit code (128) from command: git-merge-recursive 059091f7a46406a1fbdb245bbd4ac0946f6d476e^ -- HEAD 059091f7a46406a1fbdb245bbd4ac0946f6d476e
not ok 66 - rebase -m without --onto --root with disjoint history drops patch in onto # TODO known breakage

expecting success: 
		reset_rebase &&
		git rebase -i m bp &&
		test_cmp_rev m HEAD~2 &&
		test_linear_range 'x y' m..
	
fatal: bad revision '@{-1}'
ok 10 - cherry-pick "-" is meaningless without checkout

expecting success: 
	git checkout -b side-branch &&
	test_commit change actual change &&
	git checkout master &&
	git cherry-pick -s - &&
	echo "Signed-off-by: C O Mitter <committer@example.com>" >expect &&
	git cat-file commit HEAD | grep ^Signed-off-by: >signoff &&
	test_cmp expect signoff &&
	echo change >expect &&
	test_cmp expect actual

Switched to a new branch 'side-branch'
[side-branch 94f7852] change
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to branch 'master'
Rebasing (1/5)
[master a524e05] change
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:18:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 11 - cherry-pick "-" works with arguments

HEAD is now at b7cb922 bp
# passed all 11 test(s)
1..11
Rebasing (1/2)
*** t3502-cherry-pick-merge.sh ***
Rebasing (2/5)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3502-cherry-pick-merge/.git/
expecting success: 

	>A &&
	>B &&
	git add A B &&
	git commit -m "Initial" &&
	git tag initial &&
	git branch side &&
	echo new line >A &&
	git commit -m "add line to A" A &&
	git tag a &&
	git checkout side &&
	echo new line >B &&
	git commit -m "add line to B" B &&
	git tag b &&
	git checkout master &&
	git merge side &&
	git tag c


Rebasing (3/5)
[master (root-commit) 5187294] Initial
 Author: A U Thor <author@example.com>
 2 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 A
 create mode 100644 B
Rebasing (2/2)
[master 5b8b26c] add line to A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Switched to branch 'side'
[side c813df8] add line to B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Switched to branch 'master'
Rebasing (4/5)
Merging:
5b8b26c add line to A
virtual side
found 1 common ancestor:
5187294 Initial
Merge made by the 'recursive' strategy.
Rebasing (5/5)
 B | 1 +
 1 file changed, 1 insertion(+)
ok 1 - setup

expecting success: 

	git reset --hard &&
	git checkout a^0 &&
	test_expect_code 128 git cherry-pick -m 1 b &&
	git diff --exit-code a --


HEAD is now at b3c7a2f Merge branch 'side'
Note: checking out 'a^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 5b8b26c... add line to A
error: Mainline was specified but commit c813df8b3c7dd1672db1b77b1a61a5915c26f98a is not a merge.
fatal: cherry-pick failed
ok 2 - cherry-pick a non-merge with -m should fail

expecting success: 

	git reset --hard &&
	git checkout a^0 &&
	test_must_fail git cherry-pick c &&
	git diff --exit-code a --


HEAD is now at 5b8b26c add line to A
HEAD is now at 5b8b26c... add line to A
error: Commit b3c7a2f1ae1559ca65c4dc90fe80ac5c05564eec is a merge but no -m option was given.
fatal: cherry-pick failed
ok 3 - cherry pick a merge without -m should fail

expecting success: 

	git reset --hard &&
	git checkout a^0 &&
	git cherry-pick -m 1 c &&
	git diff --exit-code c


HEAD is now at 5b8b26c add line to A
Successfully rebased and updated refs/heads/drop-test.
HEAD is now at 5b8b26c... add line to A
[detached HEAD 20e2535] Merge branch 'side'
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:55:08 2015 +0000
 1 file changed, 1 insertion(+)
ok 4 - cherry pick a merge (1)

expecting success: 

	git reset --hard &&
	git checkout b^0 &&
	git cherry-pick -m 2 c &&
	git diff --exit-code c


Switched to branch 'master'
Rebasing (1/2)
HEAD is now at 20e2535 Merge branch 'side'
Deleted branch drop-test (was 35c9e9467635).
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  20e2535 Merge branch 'side'

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> 20e2535

HEAD is now at c813df8... add line to B
[detached HEAD d87a442] Merge branch 'side'
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:55:08 2015 +0000
 1 file changed, 1 insertion(+)
ok 5 - cherry pick a merge (2)

expecting success: 

	git reset --hard &&
	git checkout b^0 &&
	test_must_fail git cherry-pick -m 3 c


HEAD is now at d87a442 Merge branch 'side'
No rebase in progress?
ok 84 - drop

expecting success: 
	test_config rebase.missingCommitsCheck ignore &&
	rebase_setup_and_clean missing-commit &&
	set_fake_editor &&
	FAKE_LINES="1 2 3 4" \
		git rebase -i --root 2>actual &&
	test D = $(git cat-file commit HEAD | sed -ne \$p) &&
	test_cmp expect actual

Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  d87a442 Merge branch 'side'

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> d87a442

HEAD is now at c813df8... add line to B
error: Commit b3c7a2f1ae1559ca65c4dc90fe80ac5c05564eec does not have parent 3
fatal: cherry-pick failed
ok 6 - cherry pick a merge relative to nonexistent parent should fail

expecting success: 

	git reset --hard &&
	git checkout c^0 &&
	test_must_fail git revert -m 1 b &&
	git diff --exit-code c


Switched to a new branch 'missing-commit'
HEAD is now at c813df8 add line to B
Previous HEAD position was c813df8... add line to B
HEAD is now at b3c7a2f... Merge branch 'side'
error: Mainline was specified but commit c813df8b3c7dd1672db1b77b1a61a5915c26f98a is not a merge.
fatal: revert failed
Rebasing (2/2)
ok 7 - revert a non-merge with -m should fail

expecting success: 

	git reset --hard &&
	git checkout c^0 &&
	test_must_fail git revert c &&
	git diff --exit-code c


HEAD is now at b3c7a2f Merge branch 'side'
HEAD is now at b3c7a2f... Merge branch 'side'
error: Commit b3c7a2f1ae1559ca65c4dc90fe80ac5c05564eec is a merge but no -m option was given.
fatal: revert failed
ok 8 - revert a merge without -m should fail

expecting success: 

	git reset --hard &&
	git checkout c^0 &&
	git revert -m 1 c &&
	git diff --exit-code a --


HEAD is now at b3c7a2f Merge branch 'side'
HEAD is now at b3c7a2f... Merge branch 'side'
[detached HEAD c58e01b] Revert "Merge branch 'side'"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
ok 9 - revert a merge (1)

expecting success: 

	git reset --hard &&
	git checkout c^0 &&
	git revert -m 2 c &&
	git diff --exit-code b --


HEAD is now at c58e01b Revert "Merge branch 'side'"
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  c58e01b Revert "Merge branch 'side'"

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> c58e01b

HEAD is now at b3c7a2f... Merge branch 'side'
[detached HEAD d747860] Revert "Merge branch 'side'"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
ok 10 - revert a merge (2)

expecting success: 

	git reset --hard &&
	git checkout c^0 &&
	test_must_fail git revert -m 3 c &&
	git diff --exit-code c


HEAD is now at d747860 Revert "Merge branch 'side'"
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  d747860 Revert "Merge branch 'side'"

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> d747860

HEAD is now at b3c7a2f... Merge branch 'side'
error: Commit b3c7a2f1ae1559ca65c4dc90fe80ac5c05564eec does not have parent 3
fatal: revert failed
ok 11 - revert a merge relative to nonexistent parent should fail

# passed all 11 test(s)
1..11
Successfully rebased and updated refs/heads/ours.
test_must_fail: command succeeded: git_rebase_interactive replace_sub1_with_file
*** t3503-cherry-pick-root.sh ***
not ok 24 - git_rebase_interactive: 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
		)
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3503-cherry-pick-root/.git/
expecting success: 

	echo first > file1 &&
	git add file1 &&
	test_tick &&
	git commit -m "first" &&

	git symbolic-ref HEAD refs/heads/second &&
	rm .git/index file1 &&
	echo second > file2 &&
	git add file2 &&
	test_tick &&
	git commit -m "second" &&

	git symbolic-ref HEAD refs/heads/third &&
	rm .git/index file2 &&
	echo third > file3 &&
	git add file3 &&
	test_tick &&
	git commit -m "third"


[master (root-commit) 0c72e4f] first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file1
Cloning into 'submodule_update'...
rebase -i script before editing:
pick 6e62bf890e21 A
pick 313fe965c048 B
pick d0f65f2f81ee C
pick 0547e3f1350d D
pick 8f99a4f1fbbd E

rebase -i script after editing:
pick 6e62bf890e21 A
pick 313fe965c048 B
pick d0f65f2f81ee C
pick 0547e3f1350d D
[second (root-commit) bbcd39a] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file2
done.
[third (root-commit) 4911fa6] third
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file3
ok 1 - setup

expecting success: 

	git checkout second^0 &&
	git cherry-pick master &&
	echo first >expect &&
	test_cmp expect file1


Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Note: checking out 'second^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 bbcd39a... second
[detached HEAD 3e6f574] first
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 file1
ok 2 - cherry-pick a root commit

expecting success: 

	git revert master &&
	test_path_is_missing file1


Removing file1
[detached HEAD 3eb7e0d] Revert "first"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 file1
ok 3 - revert a root commit

expecting success: 

	git cherry-pick --strategy=resolve master &&
	echo first >expect &&
	test_cmp expect file1


Rebasing (1/4)
Trying simple merge.
[detached HEAD 54587e2] first
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 file1
ok 4 - cherry-pick a root commit with an external strategy

expecting success: 

	git revert --strategy=resolve master &&
	test_path_is_missing file1


Successfully rebased and updated detached HEAD.
Removing file1
[detached HEAD a457399] Revert "first"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 file1
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3426-rebase-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 5 - revert a root commit with an external strategy

expecting success: 

	echo first >expect.file1 &&
	echo second >expect.file2 &&
	echo third >expect.file3 &&

	git checkout second^0 &&
	git cherry-pick master third &&

	test_cmp expect.file1 file1 &&
	test_cmp expect.file2 file2 &&
	test_cmp expect.file3 file3 &&
	git rev-parse --verify HEAD^^ &&
	test_must_fail git rev-parse --verify HEAD^^^


Warning: you are leaving 4 commits behind, not connected to
any of your branches:

  a457399 Revert "first"
  54587e2 first
  3eb7e0d Revert "first"
  3e6f574 first

If you want to keep them by creating a new branch, this may be a good time
to do so with:

 git branch <new-branch-name> a457399

HEAD is now at bbcd39a... second
ok 67 - rebase -i without --onto --root with disjoint history drops patch in onto

checking known breakage: 
		reset_rebase &&
		git rebase -p m bp &&
		test_cmp_rev m HEAD~2 &&
		test_linear_range 'x y' m..
	
[detached HEAD 3e6f574] first
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 file1
Rebasing (2/4)
[detached HEAD 2069bd1] third
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 file3
Cloning into 'sub1'...
bbcd39af5b7918b8e79c884f958eeddbace1fd46
fatal: Needed a single revision
ok 6 - cherry-pick two root commits

# passed all 6 test(s)
1..6
No rebase in progress?
done.
HEAD is now at 1daea3a y
*** t3504-cherry-pick-rerere.sh ***
Removing actual.rev
Removing expect.rev
Rebasing (3/4)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3504-cherry-pick-rerere/.git/
expecting success: 
	echo foo >foo &&
	git add foo && test_tick && git commit -q -m 1 &&
	echo foo-master >foo &&
	git add foo && test_tick && git commit -q -m 2 &&

	git checkout -b dev HEAD^ &&
	echo foo-dev >foo &&
	git add foo && test_tick && git commit -q -m 3 &&
	git config rerere.enabled true

Submodule path 'sub1': checked out '074a145e4bb5d727c9a29bb1b090a652fdf358a8'
Switched to a new branch 'dev'
Rebasing (4/4)
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
ok 1 - setup

expecting success: 
	test_must_fail git merge master

Recorded preimage for 'foo'
Merging:
9381111 3
virtual master
found 1 common ancestor:
61fb246 1
Auto-merging foo
CONFLICT (content): Merge conflict in foo
Automatic merge failed; fix conflicts and then commit the result.
ok 2 - conflicting merge

expecting success: 
	echo foo-dev >foo &&
	git add foo && test_tick && git commit -q -m 4 &&
	git reset --hard HEAD^ &&
	echo foo-dev >expect

Recorded resolution for 'foo'.
HEAD is now at 9381111 3
ok 3 - fixup

expecting success: 
	test_must_fail git cherry-pick master &&
	test_cmp expect foo

Switched to a new branch 'ours'
error: could not apply 802539e... 2
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Resolved 'foo' using previous resolution.
Auto-merging foo
CONFLICT (content): Merge conflict in foo
ok 4 - cherry-pick conflict

expecting success: 
	git config rerere.enabled false &&
	git reset --hard

[ours 928bd14] add_x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
HEAD is now at 9381111 3
ok 5 - reconfigure

expecting success: 
	test_must_fail git cherry-pick master &&
	test_must_fail test_cmp expect foo

error: could not apply 802539e... 2
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
Switched to branch 'master'
--- expect	2015-12-16 10:55:11.657564811 +0000
+++ foo	2015-12-16 10:55:11.825564811 +0000
@@ -1 +1,5 @@
+<<<<<<< HEAD
 foo-dev
+=======
+foo-master
+>>>>>>> 802539e... 2
ok 6 - cherry-pick conflict without rerere

[ours c593a29] Revert "add_x"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
Deleted branch missing-commit (was 679d6a25742c).
# passed all 6 test(s)
1..6
*** t3505-cherry-pick-empty.sh ***
No rebase in progress?
ok 85 - rebase -i respects rebase.missingCommitsCheck = ignore

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3505-cherry-pick-empty/.git/
expecting success: 
	test_config rebase.missingCommitsCheck warn &&
	rebase_setup_and_clean missing-commit &&
	set_fake_editor &&
	FAKE_LINES="1 2 3 4" \
		git rebase -i --root 2>actual &&
	test_cmp expect actual &&
	test D = $(git cat-file commit HEAD | sed -ne \$p)

expecting success: 

	echo first > file1 &&
	git add file1 &&
	test_tick &&
	git commit -m "first" &&

	git checkout -b empty-branch &&
	test_tick &&
	git commit --allow-empty -m "empty" &&

	echo third >> file1 &&
	git add file1 &&
	test_tick &&
	git commit --allow-empty-message -m "" &&

	git checkout master &&
	git checkout -b empty-branch2 &&
	test_tick &&
	git commit --allow-empty -m "empty"


Switched to a new branch 'missing-commit'
[master (root-commit) 0c72e4f] first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file1
Switched to a new branch 'empty-branch'
[empty-branch 7ade177] empty
 Author: A U Thor <author@example.com>
[empty-branch d632cfa] 
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Switched to branch 'master'
Switched to a new branch 'empty-branch2'
Rebasing (1/1)
[empty-branch2 a8bb6c8] empty
 Author: A U Thor <author@example.com>
ok 1 - setup

expecting success: 
	git checkout master &&
	test_expect_code 1 git cherry-pick empty-branch^

Switched to branch 'master'
Already up-to-date!
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:

    git commit --allow-empty

Otherwise, please use 'git reset'
On branch master
You are currently cherry-picking commit 7ade177.

nothing to commit, working directory clean
ok 2 - cherry-pick an empty commit

expecting success: 
	test ! -f .git/index.lock

ok 3 - index lockfile was removed

expecting success: 
	git checkout master &&
	test_expect_code 1 git cherry-pick empty-branch

Already on 'master'
Aborting commit due to empty commit message.
ok 4 - cherry-pick a commit with an empty message

expecting success: 
	test ! -f .git/index.lock

ok 5 - index lockfile was removed

expecting success: 
	git checkout -f master &&
	git cherry-pick --allow-empty-message empty-branch

Already on 'master'
[master 1cfda8e] 
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+)
ok 6 - cherry-pick a commit with an empty message with --allow-empty-message

expecting success: 
	git checkout master &&
	echo fourth >>file2 &&
	git add file2 &&
	git commit -m "fourth" &&
	test_must_fail git cherry-pick empty-branch2

Already on 'master'
[master 2908c33] fourth
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file2
Already up-to-date!
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:

    git commit --allow-empty

Otherwise, please use 'git reset'
On branch master
You are currently cherry-picking commit a8bb6c8.

nothing to commit, working directory clean
ok 7 - cherry pick an empty non-ff commit without --allow-empty

expecting success: 
	git checkout master &&
	git cherry-pick --allow-empty empty-branch2

Already on 'master'
Already up-to-date!
[master c1a200f] empty
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
ok 8 - cherry pick an empty non-ff commit with --allow-empty

expecting success: 
	git checkout master &&
	git cherry-pick --keep-redundant-commits HEAD^

Already on 'master'
rebase -i script before editing:
pick 6e62bf890e21 A
pick 313fe965c048 B
pick d0f65f2f81ee C
pick 0547e3f1350d D
pick 8f99a4f1fbbd E

[master 1ca5e4e] fourth
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
Rebasing (1/2)
ok 9 - cherry pick with --keep-redundant-commits

expecting success: 
	git checkout master &&
	git branch fork &&
	echo foo >file2 &&
	git add file2 &&
	test_tick &&
	git commit -m "add file2 on master" &&

	git checkout fork &&
	echo foo >file2 &&
	git add file2 &&
	test_tick &&
	git commit -m "add file2 on the side"

rebase -i script after editing:
pick 6e62bf890e21 A
pick 313fe965c048 B
pick d0f65f2f81ee C
pick 0547e3f1350d D
Already on 'master'
[master ed7ef72] add file2 on master
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to branch 'fork'
[fork 0d03d7c] add file2 on the side
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 10 - cherry-pick a commit that becomes no-op (prep)

expecting success: 
	git reset --hard &&
	git checkout fork^0 &&
	test_must_fail git cherry-pick master

HEAD is now at 0d03d7c add file2 on the side
Note: checking out 'fork^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 0d03d7c... add file2 on the side
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:

    git commit --allow-empty

Otherwise, please use 'git reset'
Rebasing (2/2)
HEAD detached at 0d03d7c
You are currently cherry-picking commit ed7ef72.

nothing to commit, working directory clean
ok 11 - cherry-pick a no-op without --keep-redundant

expecting success: 
	git reset --hard &&
	git checkout fork^0 &&
	git cherry-pick --keep-redundant-commits master &&
	git show -s --format=%s >actual &&
	echo "add file2 on master" >expect &&
	test_cmp expect actual

HEAD is now at 0d03d7c add file2 on the side
HEAD is now at 0d03d7c... add file2 on the side
[detached HEAD 8024402] add file2 on master
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:17:13 2005 -0700
ok 12 - cherry-pick a no-op with --keep-redundant

# passed all 12 test(s)
1..12
*** t3506-cherry-pick-ff.sh ***
Successfully rebased and updated detached HEAD.
Rebasing (1/4)
--- expect.rev	2015-12-16 10:55:13.993564812 +0000
+++ actual.rev	2015-12-16 10:55:14.021564812 +0000
@@ -1 +1 @@
-6db5543d43a2166fae6f6d320a0b715c6c1c4278
+ce450c7fd6766cb1f2df873857da7b928ff743a8
not ok 68 - rebase -p without --onto --root with disjoint history drops patch in onto # TODO known breakage

checking known breakage: 
		reset_rebase &&
		git rebase  --root c &&
		test_cmp_rev c HEAD
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3506-cherry-pick-ff/.git/
expecting success: 
	echo first > file1 &&
	git add file1 &&
	test_tick &&
	git commit -m "first" &&
	git tag first &&

	git checkout -b other &&
	echo second >> file1 &&
	git add file1 &&
	test_tick &&
	git commit -m "second" &&
	git tag second

[master (root-commit) 0c72e4f] first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file1
No rebase in progress?
Switched to a new branch 'other'
HEAD is now at 6db5543 m
Removing actual.rev
Removing expect.rev
[other 453a047] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Rebasing (2/4)
ok 1 - setup

expecting success: 
	git checkout master &&
	git reset --hard first &&
	test_tick &&
	git cherry-pick --ff second &&
	test "$(git rev-parse --verify HEAD)" = "$(git rev-parse --verify second)"

Switched to branch 'master'
HEAD is now at 0c72e4f first
ok 2 - cherry-pick using --ff fast forwards

expecting success: 
	git checkout master &&
	git reset --hard first &&
	test_tick &&
	git cherry-pick second &&
	test "$(git rev-parse --verify HEAD)" != "$(git rev-parse --verify second)"

Already on 'master'
HEAD is now at 0c72e4f first
Rebasing (3/4)
[master 43e4ff7] second
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 1 file changed, 1 insertion(+)
ok 3 - cherry-pick not using --ff does not fast forwards

expecting success: 
	git checkout master &&
	git reset --hard first &&
	echo new line >A &&
	git add A &&
	test_tick &&
	git commit -m "add line to A" A &&
	git tag A &&
	git checkout -b side first &&
	echo new line >B &&
	git add B &&
	test_tick &&
	git commit -m "add line to B" B &&
	git tag B &&
	git checkout master &&
	git merge side &&
	git tag C &&
	git checkout -b new A

Already on 'master'
HEAD is now at 0c72e4f first
[master e3ca70e] add line to A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 A
Switched to a new branch 'side'
Rebasing (4/4)
[side 5faaf2e] add line to B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 B
Switched to branch 'master'
Merging:
e3ca70e add line to A
virtual side
found 1 common ancestor:
0c72e4f first
Merge made by the 'recursive' strategy.
 B | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 B
Switched to a new branch 'new'
ok 4 - merge setup

expecting success: 
	git reset --hard A -- &&
	test_must_fail git cherry-pick --ff -m 1 B &&
	git diff --exit-code A --

HEAD is now at e3ca70e add line to A
error: Mainline was specified but commit 5faaf2e252b35c03c6bb69c9d78820cf1bdec73d is not a merge.
fatal: cherry-pick failed
ok 5 - cherry-pick a non-merge with --ff and -m should fail

expecting success: 
	git reset --hard A -- &&
	test_must_fail git cherry-pick --ff C &&
	git diff --exit-code A --

Switched to branch 'master'
HEAD is now at e3ca70e add line to A
Deleted branch missing-commit (was 679d6a25742c).
error: Commit 17345dd7218a0fc4dc087d5aacc6be7192e4fa2a is a merge but no -m option was given.
fatal: cherry-pick failed
Successfully rebased and updated refs/heads/ours.
ok 6 - cherry pick a merge with --ff but without -m should fail

expecting success: 
	git reset --hard A -- &&
	git cherry-pick --ff -m 1 C &&
	git diff --exit-code C &&
	test "$(git rev-parse --verify HEAD)" = "$(git rev-parse --verify C)"

test_must_fail: command succeeded: git_rebase_interactive replace_sub1_with_file
HEAD is now at e3ca70e add line to A
not ok 25 - git_rebase_interactive: 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 7 - cherry pick with --ff a merge (1)

expecting success: 
	git reset --hard B -- &&
	git cherry-pick --ff -m 2 C &&
	git diff --exit-code C &&
	test "$(git rev-parse --verify HEAD)" = "$(git rev-parse --verify C)"

No rebase in progress?
ok 86 - rebase -i respects rebase.missingCommitsCheck = warn

HEAD is now at 5faaf2e add line to B
Rebasing (1/3)
expecting success: 
	test_config rebase.missingCommitsCheck error &&
	rebase_setup_and_clean missing-commit &&
	set_fake_editor &&
	test_must_fail env FAKE_LINES="1 2 4" \
		git rebase -i --root 2>actual &&
	test_cmp expect actual &&
	cp .git/rebase-merge/git-rebase-todo.backup \
		.git/rebase-merge/git-rebase-todo &&
	FAKE_LINES="1 2 drop 3 4 drop 5" \
		git rebase --edit-todo &&
	git rebase --continue &&
	test D = $(git cat-file commit HEAD | sed -ne \$p) &&
	test B = $(git cat-file commit HEAD^ | sed -ne \$p)

Cloning into 'submodule_update'...
Switched to a new branch 'missing-commit'
ok 8 - cherry pick with --ff a merge (2)

expecting success: 
	git reset --hard B -- &&
	test_must_fail git cherry-pick --ff -m 3 C

done.
HEAD is now at 5faaf2e add line to B
error: Commit 17345dd7218a0fc4dc087d5aacc6be7192e4fa2a does not have parent 3
fatal: cherry-pick failed
ok 9 - cherry pick a merge relative to nonexistent parent with --ff should fail

expecting success: 
	git reset --hard first -- &&
	git rm file1 &&
	echo first >file2 &&
	git add file2 &&
	git commit --amend -m "file2" &&
	git cherry-pick --ff first &&
	test "$(git rev-parse --verify HEAD)" = "1df192cd8bc58a2b275d842cede4d221ad9000d1"

HEAD is now at 0c72e4f first
rm 'file1'
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
[new 1654ff9] file2
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 file2
Rebasing (2/3)
[new 1df192c] first
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 file1
ok 10 - cherry pick a root commit with --ff

expecting success: 
	git checkout --orphan unborn &&
	git rm --cached -r . &&
	rm -rf * &&
	git cherry-pick --ff first &&
	test_cmp_rev first HEAD

Switched to a new branch 'unborn'
rm 'file1'
rm 'file2'
ok 11 - cherry-pick --ff on unborn branch

# passed all 11 test(s)
1..11
Rebasing (3/3)
*** t3507-cherry-pick-conflict.sh ***
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3426-rebase-submodule/submodule_update_repo/.) registered for path 'sub1'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3507-cherry-pick-conflict/.git/
expecting success: 

	echo unrelated >unrelated &&
	git add unrelated &&
	test_commit initial foo a &&
	test_commit base foo b &&
	test_commit picked foo c &&
	test_commit --signoff picked-signed foo d &&
	git config advice.detachedhead false


Cloning into 'sub1'...
[master (root-commit) df2a63d] initial
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 foo
 create mode 100644 unrelated
done.
[master dc0113b] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
rebase -i script before editing:
pick 6e62bf890e21 A
pick 313fe965c048 B
pick d0f65f2f81ee C
pick 0547e3f1350d D
pick 8f99a4f1fbbd E

[master 7e6d412] picked
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
rebase -i script after editing:
pick 6e62bf890e21 A
pick 313fe965c048 B
pick 0547e3f1350d D
[master e4ca149] picked-signed
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Submodule path 'sub1': checked out '074a145e4bb5d727c9a29bb1b090a652fdf358a8'
ok 1 - setup

expecting success: 
	pristine_detach initial &&

	head=$(git rev-parse HEAD) &&
	test_must_fail git cherry-pick picked &&
	newhead=$(git rev-parse HEAD) &&

	test "$head" = "$newhead"

HEAD is now at df2a63d... initial
Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
error: could not apply 7e6d412... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
ok 2 - failed cherry-pick does not advance HEAD

expecting success: 
	pristine_detach initial &&

	picked=$(git rev-parse --short picked) &&
	cat <<-EOF >expected &&
	error: could not apply $picked... picked
	hint: after resolving the conflicts, mark the corrected paths
	hint: with 'git add <paths>' or 'git rm <paths>'
	hint: and commit the result with 'git commit'
	EOF
	test_must_fail git cherry-pick picked 2>actual &&

	test_i18ncmp expected actual

Switched to a new branch 'ours'
HEAD is now at df2a63d... initial
[ours 7f65b0a] add_x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Auto-merging foo
CONFLICT (content): Merge conflict in foo
ok 3 - advice from failed cherry-pick

expecting success: 
	pristine_detach initial &&

	picked=$(git rev-parse --short picked) &&
	cat <<-EOF >expected &&
	error: could not apply $picked... picked
	hint: after resolving the conflicts, mark the corrected paths
	hint: with 'git add <paths>' or 'git rm <paths>'
	EOF
	test_must_fail git cherry-pick --no-commit picked 2>actual &&

	test_i18ncmp expected actual

[ours 25b306c] Revert "add_x"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
HEAD is now at df2a63d... initial
Auto-merging foo
CONFLICT (content): Merge conflict in foo
ok 4 - advice from failed cherry-pick --no-commit

expecting success: 
	pristine_detach initial &&
	test_must_fail git cherry-pick picked &&
	test_cmp_rev picked CHERRY_PICK_HEAD

HEAD is now at df2a63d... initial
error: could not apply 7e6d412... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
ok 5 - failed cherry-pick sets CHERRY_PICK_HEAD

expecting success: 
	pristine_detach initial &&
	git cherry-pick base &&
	test_must_fail git rev-parse --verify CHERRY_PICK_HEAD

HEAD is now at df2a63d... initial
rebase -i script before editing:
pick 6e62bf890e21 A
pick 313fe965c048 B
pick d0f65f2f81ee C
pick 0547e3f1350d D
pick 8f99a4f1fbbd E
rebase -i script after editing:
pick 6e62bf890e21 A
pick 313fe965c048 B
drop d0f65f2f81ee C
pick 0547e3f1350d D
drop 8f99a4f1fbbd E
[detached HEAD 1832a43] base
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
fatal: Needed a single revision
ok 6 - successful cherry-pick does not set CHERRY_PICK_HEAD

expecting success: 
	pristine_detach initial &&
	git cherry-pick --no-commit base &&
	test_must_fail git rev-parse --verify CHERRY_PICK_HEAD

Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  1832a43 base

HEAD is now at df2a63d... initial
Successfully rebased and updated detached HEAD.
fatal: Needed a single revision
ok 7 - cherry-pick --no-commit does not set CHERRY_PICK_HEAD

expecting success: 
	pristine_detach initial &&
	echo foo > foo &&
	test_must_fail git cherry-pick base &&
	test_must_fail git rev-parse --verify CHERRY_PICK_HEAD

HEAD is now at df2a63d... initial
--- expect.rev	2015-12-16 10:55:18.069564812 +0000
+++ actual.rev	2015-12-16 10:55:18.089564812 +0000
@@ -1 +1 @@
-d9ea348e0fe8827f205c231ed0a5b8258841fd37
+8b0b08f11e6fffcd7a364144d5399bf69ae313f5
not ok 69 - rebase  --root on linear history is a no-op # TODO known breakage

checking known breakage: 
		reset_rebase &&
		git rebase -m --root c &&
		test_cmp_rev c HEAD
	
error: Your local changes to the following files would be overwritten by merge:
	foo
Please, commit your changes or stash them before you can merge.
Aborting
fatal: merging of trees 75f1922935cac91fa5dab32e9ead331c9fd5cdd2 and 22ce0a549a77230f9e811c1935707ad76e2b691b failed
fatal: Needed a single revision
ok 8 - cherry-pick w/dirty tree does not set CHERRY_PICK_HEAD

expecting success: 
	pristine_detach initial &&
	echo foo > foo &&
	test_must_fail git cherry-pick --strategy=resolve base &&
	test_must_fail git rev-parse --verify CHERRY_PICK_HEAD

HEAD is now at df2a63d... initial
No rebase in progress?
HEAD is now at 8b0b08f c
Removing actual.rev
Removing expect.rev
error: Entry 'foo' not uptodate. Cannot merge.
error: could not apply dc0113b... base
fatal: Needed a single revision
Rebasing (1/5)
ok 9 - cherry-pick --strategy=resolve w/dirty tree does not set CHERRY_PICK_HEAD

expecting success: 
	pristine_detach initial &&
	(
		GIT_CHERRY_PICK_HELP="and then do something else" &&
		export GIT_CHERRY_PICK_HELP &&
		test_must_fail git cherry-pick picked
	) &&
	test_must_fail git rev-parse --verify CHERRY_PICK_HEAD

HEAD is now at df2a63d... initial
error: could not apply 7e6d412... picked
and then do something else
Auto-merging foo
CONFLICT (content): Merge conflict in foo
fatal: Needed a single revision
ok 10 - GIT_CHERRY_PICK_HELP suppresses CHERRY_PICK_HEAD

expecting success: 
	pristine_detach initial &&

	test_must_fail git cherry-pick picked &&
	git reset &&

	test_must_fail git rev-parse --verify CHERRY_PICK_HEAD

HEAD is now at df2a63d... initial
error: could not apply 7e6d412... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Rebasing (1/2)
Rebasing (2/5)
Auto-merging foo
CONFLICT (content): Merge conflict in foo
Unstaged changes after reset:
M	foo
fatal: Needed a single revision
ok 11 - git reset clears CHERRY_PICK_HEAD

expecting success: 
	pristine_detach initial &&

	test_must_fail git cherry-pick picked &&
	test_must_fail git commit &&

	test_cmp_rev picked CHERRY_PICK_HEAD

HEAD is now at df2a63d... initial
error: could not apply 7e6d412... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
error: commit is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
U	foo
ok 12 - failed commit does not clear CHERRY_PICK_HEAD

expecting success: 
	pristine_detach initial &&

	test_must_fail git cherry-pick picked &&
	echo resolved >foo &&
	git add foo &&
	git update-index --refresh -q &&
	test_must_fail git diff-index --exit-code HEAD &&
	(
		GIT_EDITOR=false &&
		export GIT_EDITOR &&
		test_must_fail git commit
	) &&

	test_cmp_rev picked CHERRY_PICK_HEAD

HEAD is now at df2a63d... initial
error: could not apply 7e6d412... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Rebasing (2/2)
Rebasing (3/5)
Rebasing (4/5)
Auto-merging foo
CONFLICT (content): Merge conflict in foo
:100644 100644 78981922613b2afb6025042ff6bd878ac1994e85 2ab19ae607aabda796309682e0448237aab03047 M	foo
error: There was a problem with the editor 'false'.
Please supply the message using either -m or -F option.
ok 13 - cancelled commit does not clear CHERRY_PICK_HEAD

expecting success: 
	pristine_detach initial &&

	test_must_fail git cherry-pick picked &&
	echo resolved >foo &&
	git add foo &&
	git commit &&

	test_must_fail git rev-parse --verify CHERRY_PICK_HEAD

HEAD is now at df2a63d... initial
error: could not apply 7e6d412... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Rebasing (5/5)
Auto-merging foo
CONFLICT (content): Merge conflict in foo
Successfully rebased and updated refs/heads/missing-commit.
[detached HEAD 92e5b31] picked
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
fatal: Needed a single revision
ok 14 - successful commit clears CHERRY_PICK_HEAD

expecting success: 
	pristine_detach initial &&

	test_must_fail git cherry-pick picked &&

	test_must_fail git update-index --refresh -q &&
	test_must_fail git diff-index --exit-code HEAD

Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  92e5b31 picked

HEAD is now at df2a63d... initial
Switched to branch 'master'
Deleted branch missing-commit (was ebdcd5b7bc4d).
error: could not apply 7e6d412... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
foo: needs merge
:100644 100644 78981922613b2afb6025042ff6bd878ac1994e85 0000000000000000000000000000000000000000 M	foo
Rebasing (1/3)
ok 15 - failed cherry-pick produces dirty index

expecting success: 
	pristine_detach initial &&
	{
		git checkout base -- foo &&
		git ls-files --stage foo &&
		git checkout initial -- foo &&
		git ls-files --stage foo &&
		git checkout picked -- foo &&
		git ls-files --stage foo
	} > stages &&
	sed "
		1 s/ 0	/ 1	/
		2 s/ 0	/ 2	/
		3 s/ 0	/ 3	/
	" < stages > expected &&
	git read-tree -u --reset HEAD &&

	test_must_fail git cherry-pick picked &&
	git ls-files --stage --unmerged > actual &&

	test_cmp expected actual

HEAD is now at df2a63d... initial
No rebase in progress?
ok 87 - rebase -i respects rebase.missingCommitsCheck = error

expecting success: 
	rebase_setup_and_clean bad-cmd &&
	set_fake_editor &&
	test_must_fail env FAKE_LINES="1 2 3 bad 4 5" \
		git rebase -i --root 2>actual &&
	test_cmp expect actual &&
	FAKE_LINES="1 2 3 drop 4 5" git rebase --edit-todo &&
	git rebase --continue &&
	test E = $(git cat-file commit HEAD | sed -ne \$p) &&
	test C = $(git cat-file commit HEAD^ | sed -ne \$p)

Switched to a new branch 'bad-cmd'
error: could not apply 7e6d412... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Rebasing (2/3)
Auto-merging foo
CONFLICT (content): Merge conflict in foo
ok 16 - failed cherry-pick registers participants in index

expecting success: 
	pristine_detach initial &&
	cat <<-EOF > expected &&
	<<<<<<< HEAD
	a
	=======
	c
	>>>>>>> objid picked
	EOF

	test_must_fail git cherry-pick picked &&

	sed "s/[a-f0-9]*\.\.\./objid/" foo > actual &&
	test_cmp expected actual

HEAD is now at df2a63d... initial
error: could not apply 7e6d412... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
ok 17 - failed cherry-pick describes conflict in work tree

expecting success: 
	pristine_detach initial &&
	git config merge.conflictstyle diff3 &&
	cat <<-EOF > expected &&
	<<<<<<< HEAD
	a
	||||||| parent of objid picked
	b
	=======
	c
	>>>>>>> objid picked
	EOF

	test_must_fail git cherry-pick picked &&

	sed "s/[a-f0-9]*\.\.\./objid/" foo > actual &&
	test_cmp expected actual

HEAD is now at df2a63d... initial
error: could not apply 7e6d412... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Rebasing (3/3)
Auto-merging foo
CONFLICT (content): Merge conflict in foo
ok 18 - diff3 -m style

expecting success: 
	git config --unset merge.conflictstyle &&
	pristine_detach initial &&
	cat <<-EOF > expected &&
	<<<<<<< HEAD
	a
	=======
	b
	>>>>>>> parent of objid picked
	EOF
	{
		git checkout picked -- foo &&
		git ls-files --stage foo &&
		git checkout initial -- foo &&
		git ls-files --stage foo &&
		git checkout base -- foo &&
		git ls-files --stage foo
	} > stages &&
	sed "
		1 s/ 0	/ 1	/
		2 s/ 0	/ 2	/
		3 s/ 0	/ 3	/
	" < stages > expected-stages &&
	git read-tree -u --reset HEAD &&

	head=$(git rev-parse HEAD) &&
	test_must_fail git revert picked &&
	newhead=$(git rev-parse HEAD) &&
	git ls-files --stage --unmerged > actual-stages &&

	test "$head" = "$newhead" &&
	test_must_fail git update-index --refresh -q &&
	test_must_fail git diff-index --exit-code HEAD &&
	test_cmp expected-stages actual-stages &&
	sed "s/[a-f0-9]*\.\.\./objid/" foo > actual &&
	test_cmp expected actual

HEAD is now at df2a63d... initial
error: could not revert 7e6d412... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
foo: needs merge
:100644 100644 78981922613b2afb6025042ff6bd878ac1994e85 0000000000000000000000000000000000000000 M	foo
Successfully rebased and updated refs/heads/ours.
ok 19 - revert also handles conflicts sanely

expecting success: 
	pristine_detach initial &&
	test_must_fail git revert picked &&
	test_cmp_rev picked REVERT_HEAD

HEAD is now at df2a63d... initial
rebase -i script before editing:
pick 6e62bf890e21 A
pick 313fe965c048 B
pick d0f65f2f81ee C
pick 0547e3f1350d D
pick 8f99a4f1fbbd E

error: could not revert 7e6d412... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
rebase -i script after editing:
pick 6e62bf890e21 A
pick 313fe965c048 B
pick d0f65f2f81ee C
badcmd 0547e3f1350d D
pick 8f99a4f1fbbd E
ok 20 - failed revert sets REVERT_HEAD

expecting success: 
	pristine_detach base &&
	git revert base &&
	test_must_fail git rev-parse --verify CHERRY_PICK_HEAD &&
	test_must_fail git rev-parse --verify REVERT_HEAD

Previous HEAD position was df2a63d... initial
HEAD is now at dc0113b... base
[detached HEAD 7bd02ff] Revert "base"
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
fatal: Needed a single revision
fatal: Needed a single revision
ok 21 - successful revert does not set REVERT_HEAD

expecting success: 
	pristine_detach base &&
	git revert --no-commit base &&
	test_must_fail git rev-parse --verify CHERRY_PICK_HEAD &&
	test_cmp_rev base REVERT_HEAD

Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  7bd02ff Revert "base"

HEAD is now at dc0113b... base
fatal: Needed a single revision
ok 22 - revert --no-commit sets REVERT_HEAD

expecting success: 
	pristine_detach base &&
	echo foo > foo &&
	test_must_fail git revert base &&
	test_must_fail git rev-parse --verify CHERRY_PICK_HEAD &&
	test_must_fail git rev-parse --verify REVERT_HEAD

HEAD is now at dc0113b... base
Submodule path 'sub1': checked out 'db5731a8aef3dc50ca88d60ef656a72ca69a9b58'
error: Your local changes to the following files would be overwritten by merge:
	foo
Please, commit your changes or stash them before you can merge.
Aborting
fatal: merging of trees 22ce0a549a77230f9e811c1935707ad76e2b691b and 75f1922935cac91fa5dab32e9ead331c9fd5cdd2 failed
fatal: Needed a single revision
fatal: Needed a single revision
ok 23 - revert w/dirty tree does not set REVERT_HEAD

expecting success: 
	pristine_detach initial &&
	(
		GIT_CHERRY_PICK_HELP="and then do something else" &&
		GIT_REVERT_HELP="and then do something else, again" &&
		export GIT_CHERRY_PICK_HELP GIT_REVERT_HELP &&
		test_must_fail git revert picked
	) &&
	test_must_fail git rev-parse --verify CHERRY_PICK_HEAD &&
	test_cmp_rev picked REVERT_HEAD

Previous HEAD position was dc0113b... base
HEAD is now at df2a63d... initial
rebase -i script before editing:
error: could not revert 7e6d412... picked
and then do something else
Auto-merging foo
CONFLICT (content): Merge conflict in foo
ok 26 - git_rebase_interactive: 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
		)
	
pick 6e62bf890e21 A
pick 313fe965c048 B
pick d0f65f2f81ee C
badcmd 0547e3f1350d D
pick 8f99a4f1fbbd E
fatal: Needed a single revision
rebase -i script after editing:
pick 6e62bf890e21 A
pick 313fe965c048 B
pick d0f65f2f81ee C
pick 8f99a4f1fbbd E
ok 24 - GIT_CHERRY_PICK_HELP does not suppress REVERT_HEAD

expecting success: 
	pristine_detach initial &&
	test_must_fail git revert picked &&
	git reset &&
	test_must_fail git rev-parse --verify REVERT_HEAD

HEAD is now at df2a63d... initial
error: could not revert 7e6d412... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
Cloning into 'submodule_update'...
Unstaged changes after reset:
M	foo
fatal: Needed a single revision
ok 25 - git reset clears REVERT_HEAD

expecting success: 
	pristine_detach initial &&
	test_must_fail git revert picked &&
	test_must_fail git commit &&
	test_cmp_rev picked REVERT_HEAD

Successfully rebased and updated detached HEAD.
done.
HEAD is now at df2a63d... initial
--- expect.rev	2015-12-16 10:55:22.121564813 +0000
+++ actual.rev	2015-12-16 10:55:22.137564813 +0000
@@ -1 +1 @@
-d9ea348e0fe8827f205c231ed0a5b8258841fd37
+8b0b08f11e6fffcd7a364144d5399bf69ae313f5
not ok 70 - rebase -m --root on linear history is a no-op # TODO known breakage

checking known breakage: 
		reset_rebase &&
		git rebase -i --root c &&
		test_cmp_rev c HEAD
	
error: could not revert 7e6d412... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
error: commit is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
U	foo
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 26 - failed commit does not clear REVERT_HEAD

expecting success: 
	pristine_detach initial &&
	git config merge.conflictstyle diff3 &&
	cat <<-EOF > expected &&
	<<<<<<< HEAD
	a
	||||||| objid picked
	c
	=======
	b
	>>>>>>> parent of objid picked
	EOF

	test_must_fail git revert picked &&

	sed "s/[a-f0-9]*\.\.\./objid/" foo > actual &&
	test_cmp expected actual

HEAD is now at df2a63d... initial
No rebase in progress?
Rebasing (1/4)
HEAD is now at 8b0b08f c
Removing actual.rev
Removing expect.rev
error: could not revert 7e6d412... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
ok 27 - revert conflict, diff3 -m style

expecting success: 
	pristine_detach initial &&
	test_must_fail git cherry-pick -s picked &&
	test_i18ngrep -e "Signed-off-by" .git/MERGE_MSG

HEAD is now at df2a63d... initial
error: could not apply 7e6d412... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
Signed-off-by: C O Mitter <committer@example.com>
ok 28 - failed cherry-pick does not forget -s

expecting success: 
	pristine_detach initial &&
	test_must_fail git cherry-pick -s picked-signed &&
	git commit -a -s &&
	test $(git show -s |grep -c "Signed-off-by") = 1

HEAD is now at df2a63d... initial
Rebasing (2/4)
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3426-rebase-submodule/submodule_update_repo/.) registered for path 'sub1'
error: could not apply e4ca149... picked-signed
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
[detached HEAD 999e376] picked-signed
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 6 insertions(+)
ok 29 - commit after failed cherry-pick does not add duplicated -s

expecting success: 
	pristine_detach initial &&
	test_must_fail git cherry-pick picked &&

	git commit -a -s &&

	# Do S-o-b and Conflicts appear in the right order?
	cat <<-\EOF >expect &&
	Signed-off-by: C O Mitter <committer@example.com>
	# Conflicts:
	EOF
	grep -e "^# Conflicts:" -e ^Signed-off-by <.git/COMMIT_EDITMSG >actual &&
	test_cmp expect actual &&

	cat <<-\EOF >expected &&
	picked

	Signed-off-by: C O Mitter <committer@example.com>
	EOF

	git show -s --pretty=format:%B >actual &&
	test_cmp expected actual

Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  999e376 picked-signed

HEAD is now at df2a63d... initial
Cloning into 'sub1'...
error: could not apply 7e6d412... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
Rebasing (3/4)
[detached HEAD 8b21ac3] picked
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 6 insertions(+)
done.
ok 30 - commit after failed cherry-pick adds -s at the right place

expecting success: 
	pristine_detach initial &&
	test_must_fail git cherry-pick picked &&

	# emulate old-style conflicts block
	mv .git/MERGE_MSG .git/MERGE_MSG+ &&
	sed -e "/^# Conflicts:/,\$s/^# *//" <.git/MERGE_MSG+ >.git/MERGE_MSG &&

	git commit -a &&
	git commit --amend -s &&

	# Do S-o-b and Conflicts appear in the right order?
	cat <<-\EOF >expect &&
	Signed-off-by: C O Mitter <committer@example.com>
	Conflicts:
	EOF
	grep -e "^Conflicts:" -e ^Signed-off-by <.git/COMMIT_EDITMSG >actual &&
	test_cmp expect actual

Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  8b21ac3 picked

HEAD is now at df2a63d... initial
error: could not apply 7e6d412... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
Rebasing (4/4)
[detached HEAD 55f1fbc] picked
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 6 insertions(+)
Submodule path 'sub1': checked out '074a145e4bb5d727c9a29bb1b090a652fdf358a8'
[detached HEAD 8032828] picked
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 6 insertions(+)
ok 31 - commit --amend -s places the sign-off at the right place

# passed all 31 test(s)
1..31
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
*** t3508-cherry-pick-many-commits.sh ***
Switched to a new branch 'ours'
Successfully rebased and updated refs/heads/bad-cmd.
[ours 1693a1f] add_x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3508-cherry-pick-many-commits/.git/
expecting success: 
	echo first > file1 &&
	git add file1 &&
	test_tick &&
	git commit -m "first" &&
	git tag first &&

	git checkout -b other &&
	for val in second third fourth
	do
		echo $val >> file1 &&
		git add file1 &&
		test_tick &&
		git commit -m "$val" &&
		git tag $val
	done

[ours c9badea] Revert "add_x"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
Switched to branch 'master'
Rebasing (1/3)
[master (root-commit) 0c72e4f] first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file1
Deleted branch bad-cmd (was 02c7f5fbebec).
Switched to a new branch 'other'
[other 453a047] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
No rebase in progress?
ok 88 - static check of bad command

expecting success: 
	rebase_setup_and_clean indented-comment &&
	write_script add-indent.sh <<-\EOF &&
	(
		# Turn single spaces into space/tab mix
		sed "1s/ /	/g; 2s/ /  /g; 3s/ / 	/g" "$1"
		printf "\n\t# comment\n #more\n\t # comment\n"
	) >$1.new
	mv "$1.new" "$1"
	EOF
	test_set_editor "$(pwd)/add-indent.sh" &&
	git rebase -i HEAD^^^ &&
	test E = $(git cat-file commit HEAD | sed -ne \$p)

Switched to a new branch 'indented-comment'
[other e85abe2] third
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Rebasing (2/3)
[other 94d3184] fourth
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 1 - setup

expecting success: 
	git checkout -f master &&
	git reset --hard first &&
	test_tick &&
	git cherry-pick first..fourth &&
	git diff --quiet other &&
	git diff --quiet HEAD other &&
	check_head_differs_from fourth

Switched to branch 'master'
HEAD is now at 0c72e4f first
[master 9589776] second
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 1 file changed, 1 insertion(+)
[master 7ef563c] third
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+)
Rebasing (3/3)
[master 105ac0a] fourth
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
--- expect.rev	2015-12-16 10:55:24.433564813 +0000
+++ actual.rev	2015-12-16 10:55:24.461564813 +0000
@@ -1 +1 @@
-105ac0ac93120eb93ecb7cd789e973cec9c3d19a
+94d3184b3f0dcfebb393faf5a122dc429d775538
ok 2 - cherry-pick first..fourth works

expecting success: 
	git checkout -f first &&
	test_commit one &&
	test_commit two &&
	test_commit three &&
	git checkout -f master &&
	git reset --hard first &&
	git cherry-pick three one two &&
	git diff --quiet three &&
	git diff --quiet HEAD three &&
	test "$(git log --reverse --format=%s first..)" = "three
one
two"

Note: checking out 'first'.

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 0c72e4f... first
[detached HEAD 08ada56] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
[detached HEAD 556e4fe] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two.t
[detached HEAD a4e9322] three
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 three.t
Previous HEAD position was a4e9322... three
Switched to branch 'master'
HEAD is now at 0c72e4f first
[master 124d016] three
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:20:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 three.t
Rebasing (1/2)
[master 6e6e64d] one
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:18:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
[master 54c7896] two
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:19:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 two.t
ok 3 - cherry-pick three one two works

expecting success: 
	git checkout -f master &&
	git reset --hard first &&
	test_must_fail git cherry-pick three one two:

Already on 'master'
HEAD is now at 0c72e4f first
fatal: two:: can't cherry-pick a tree
ok 4 - cherry-pick three one two: fails

expecting success: 
	cat <<-\EOF >expected &&
	[master OBJID] second
	 Author: A U Thor <author@example.com>
	 Date: Thu Apr 7 15:14:13 2005 -0700
	 1 file changed, 1 insertion(+)
	[master OBJID] third
	 Author: A U Thor <author@example.com>
	 Date: Thu Apr 7 15:15:13 2005 -0700
	 1 file changed, 1 insertion(+)
	[master OBJID] fourth
	 Author: A U Thor <author@example.com>
	 Date: Thu Apr 7 15:16:13 2005 -0700
	 1 file changed, 1 insertion(+)
	EOF

	git checkout -f master &&
	git reset --hard first &&
	test_tick &&
	git cherry-pick first..fourth >actual &&
	sed -e "s/$_x05[0-9a-f][0-9a-f]/OBJID/" <actual >actual.fuzzy &&
	test_line_count -ge 3 actual.fuzzy &&
	test_i18ncmp expected actual.fuzzy

Already on 'master'
Rebasing (3/3)
Rebasing (2/2)
HEAD is now at 0c72e4f first
Successfully rebased and updated refs/heads/indented-comment.
Switched to branch 'master'
Deleted branch indented-comment (was 8f99a4f1fbbd).
ok 5 - output to keep user entertained during multi-pick

expecting success: 
	git checkout -f master &&
	git reset --hard first &&
	test_tick &&
	git cherry-pick --strategy resolve first..fourth &&
	git diff --quiet other &&
	git diff --quiet HEAD other &&
	check_head_differs_from fourth

Already on 'master'
HEAD is now at 0c72e4f first
No rebase in progress?
ok 89 - tabs and spaces are accepted in the todolist

expecting success: 
	rebase_setup_and_clean bad-sha &&
	set_fake_editor &&
	test_must_fail env FAKE_LINES="1 2 edit fakesha 3 4 5 #" \
		git rebase -i --root 2>actual &&
	test_cmp expect actual &&
	FAKE_LINES="1 2 4 5 6" git rebase --edit-todo &&
	git rebase --continue &&
	test E = $(git cat-file commit HEAD | sed -ne \$p)

Switched to a new branch 'bad-sha'
Trying simple merge.
[master 48c207c] second
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 1 file changed, 1 insertion(+)
Trying simple merge.
[master 9dcf789] third
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+)
Trying simple merge.
Successfully rebased and updated detached HEAD.
[master 1f7167d] fourth
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
--- expect.rev	2015-12-16 10:55:26.105564813 +0000
+++ actual.rev	2015-12-16 10:55:26.125564813 +0000
@@ -1 +1 @@
-d9ea348e0fe8827f205c231ed0a5b8258841fd37
+8b0b08f11e6fffcd7a364144d5399bf69ae313f5
not ok 71 - rebase -i --root on linear history is a no-op # TODO known breakage

checking known breakage: 
		reset_rebase &&
		git rebase -p --root c &&
		test_cmp_rev c HEAD
	
--- expect.rev	2015-12-16 10:55:26.177564813 +0000
+++ actual.rev	2015-12-16 10:55:26.197564813 +0000
@@ -1 +1 @@
-1f7167d07ce0b08f26e0fc6f5479aa2c2d6d103c
+94d3184b3f0dcfebb393faf5a122dc429d775538
ok 6 - cherry-pick --strategy resolve first..fourth works

expecting success: 
	cat <<-\EOF >expected &&
	Trying simple merge.
	[master OBJID] second
	 Author: A U Thor <author@example.com>
	 Date: Thu Apr 7 15:14:13 2005 -0700
	 1 file changed, 1 insertion(+)
	Trying simple merge.
	[master OBJID] third
	 Author: A U Thor <author@example.com>
	 Date: Thu Apr 7 15:15:13 2005 -0700
	 1 file changed, 1 insertion(+)
	Trying simple merge.
	[master OBJID] fourth
	 Author: A U Thor <author@example.com>
	 Date: Thu Apr 7 15:16:13 2005 -0700
	 1 file changed, 1 insertion(+)
	EOF

	git checkout -f master &&
	git reset --hard first &&
	test_tick &&
	git cherry-pick --strategy resolve first..fourth >actual &&
	sed -e "s/$_x05[0-9a-f][0-9a-f]/OBJID/" <actual >actual.fuzzy &&
	test_i18ncmp expected actual.fuzzy

Already on 'master'
HEAD is now at 0c72e4f first
No rebase in progress?
HEAD is now at 8b0b08f c
Removing actual.rev
Removing expect.rev
ok 7 - output during multi-pick indicates merge strategy

expecting success: 
	git checkout -f master &&
	git reset --hard first &&
	test_tick &&
	git cherry-pick --ff first..fourth &&
	git diff --quiet other &&
	git diff --quiet HEAD other &&
	check_head_equals fourth

Already on 'master'
rebase -i script before editing:
pick 6e62bf890e21 A
pick 313fe965c048 B
pick d0f65f2f81ee C
pick 0547e3f1350d D
pick 8f99a4f1fbbd E

HEAD is now at 0c72e4f first
rebase -i script after editing:
pick 6e62bf890e21 A
pick 313fe965c048 B
edit XXXXXXX False commit
pick d0f65f2f81ee C
pick 0547e3f1350d D
pick 8f99a4f1fbbd E
# comment
ok 8 - cherry-pick --ff first..fourth works

expecting success: 
	git checkout -f master &&
	git reset --hard first &&
	test_tick &&
	git cherry-pick -n first..fourth &&
	git diff --quiet other &&
	git diff --cached --quiet other &&
	git diff --quiet HEAD first

Already on 'master'
HEAD is now at 0c72e4f first
Successfully rebased and updated refs/heads/ours.
ok 9 - cherry-pick -n first..fourth works

expecting success: 
	git checkout -f master &&
	git reset --hard fourth &&
	test_tick &&
	git revert first..fourth &&
	git diff --quiet first &&
	git diff --cached --quiet first &&
	git diff --quiet HEAD first

Already on 'master'
HEAD is now at 94d3184 fourth
[master 9fd86ee] Revert "fourth"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
[master bcb892c] Revert "third"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
[master 6e2dda4] Revert "second"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
ok 10 - revert first..fourth works

expecting success: 
	git checkout -f master &&
	git reset --hard fourth &&
	test_tick &&
	git revert ^first fourth &&
	git diff --quiet first &&
	git diff --cached --quiet first &&
	git diff --quiet HEAD first

rebase -i script before editing:
pick 6e62bf890e21 A
pick 313fe965c048 B
edit XXXXXXX False commit
pick d0f65f2f81ee C
pick 0547e3f1350d D
pick 8f99a4f1fbbd E
Already on 'master'
HEAD is now at 94d3184 fourth
rebase -i script after editing:
pick 6e62bf890e21 A
pick 313fe965c048 B
pick d0f65f2f81ee C
pick 0547e3f1350d D
pick 8f99a4f1fbbd E
[master e6761b3] Revert "fourth"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
[master 4940ca7] Revert "third"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
[master e06156e] Revert "second"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
Rebasing (1/3)
ok 11 - revert ^first fourth works

expecting success: 
	git checkout -f master &&
	git reset --hard fourth &&
	test_tick &&
	git revert fourth fourth~1 fourth~2 &&
	git diff --quiet first &&
	git diff --cached --quiet first &&
	git diff --quiet HEAD first

Already on 'master'
HEAD is now at 94d3184 fourth
fatal: reference is not a tree: 0123456789012345678901234567890123456789
Unable to checkout '0123456789012345678901234567890123456789' in submodule path 'sub1'
[master 8d9417a] Revert "fourth"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
[master 210e986] Revert "third"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
[master f77c534] Revert "second"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
ok 27 - git_rebase_interactive: 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
		)
	
Rebasing (1/5)
Rebasing (2/3)
ok 12 - revert fourth fourth~1 fourth~2 works

expecting success: 
	git checkout -f master &&
	git reset --hard first &&
	test_tick &&
	git cherry-pick -3 fourth &&
	git diff --quiet other &&
	git diff --quiet HEAD other &&
	check_head_differs_from fourth

Already on 'master'
HEAD is now at 0c72e4f first
Cloning into 'submodule_update'...
[master 0b92961] second
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 1 file changed, 1 insertion(+)
[master e4ba54b] third
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+)
done.
Rebasing (2/5)
[master bb3aa41] fourth
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
Switched to a new branch 'invalid_sub1'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
--- expect.rev	2015-12-16 10:55:28.545564813 +0000
+++ actual.rev	2015-12-16 10:55:28.565564813 +0000
@@ -1 +1 @@
-bb3aa416a03ed973f577f397bffb6d20153403b2
+94d3184b3f0dcfebb393faf5a122dc429d775538
ok 13 - cherry-pick -3 fourth works

expecting success: 
	git checkout -f master &&
	git reset --hard first &&
	test_tick &&
	git rev-list --reverse first..fourth | git cherry-pick --stdin &&
	git diff --quiet other &&
	git diff --quiet HEAD other &&
	check_head_differs_from fourth

Already on 'master'
fatal: Needed a single revision
Rebasing (3/3)
HEAD is now at 0c72e4f first
Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
[master 026fdf1] second
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 1 file changed, 1 insertion(+)
Switched to a new branch 'ours'
Rebasing (3/5)
[master 56d3171] third
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+)
[ours 3a47820] add_x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master 2cef6d1] fourth
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
[ours 611dc03] Revert "add_x"
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
--- expect.rev	2015-12-16 10:55:28.917564814 +0000
+++ actual.rev	2015-12-16 10:55:28.937564814 +0000
@@ -1 +1 @@
-2cef6d1fb27ea4336278384a858288280fb8ade8
+94d3184b3f0dcfebb393faf5a122dc429d775538
ok 14 - cherry-pick --stdin works

# passed all 14 test(s)
1..14
Rebasing (4/5)
*** t3509-cherry-pick-merge-df.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3509-cherry-pick-merge-df/.git/
expecting success: 
	mkdir a &&
	>a/f &&
	git add a &&
	git commit -m a

[master (root-commit) 280b87e] a
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 a/f
ok 1 - Initialize repository

expecting success: 
	mkdir b &&
	test_ln_s_add ../a b/a &&
	git commit -m b &&

	git checkout -b branch &&
	rm b/a &&
	git mv a b/a &&
	test_ln_s_add b/a a &&
	git commit -m swap &&

	>f1 &&
	git add f1 &&
	git commit -m f1

Rebasing (5/5)
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
[master f07fbae] b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 120000 b/a
Switched to a new branch 'branch'
[branch d09d594] swap
 Author: A U Thor <author@example.com>
 3 files changed, 1 insertion(+), 1 deletion(-)
 create mode 120000 a
 delete mode 120000 b/a
 rename {a => b/a}/f (100%)
Successfully rebased and updated refs/heads/bad-sha.
[branch 061b051] f1
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 f1
ok 2 - Setup rename across paths each below D/F conflicts

expecting success: 
	git reset --hard &&
	git checkout master^0 &&
	git cherry-pick branch

HEAD is now at 061b051 f1
Switched to branch 'master'
Deleted branch bad-sha (was 2d2e3f3b9c17).
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 f07fbae... b
Adding b/a
Adding a/f
[detached HEAD 48468c5] f1
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:55:29 2015 +0000
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 f1
ok 3 - Cherry-pick succeeds with rename across D/F conflicts

expecting success: 
	git checkout --orphan nick-testcase &&
	git rm -rf . &&

	>empty &&
	git add empty &&
	git commit -m "Empty file" &&

	git checkout -b simple &&
	mv empty file &&
	mkdir empty &&
	mv file empty &&
	git add empty/file &&
	git commit -m "Empty file under empty dir" &&

	echo content >newfile &&
	git add newfile &&
	git commit -m "New file"

Switched to a new branch 'nick-testcase'
No rebase in progress?
ok 90 - static check of bad SHA-1

expecting success: 
	git checkout -b with-crlf &&
	write_script add-crs.sh <<-\EOF &&
	sed -e "s/\$/Q/" <"$1" | tr Q "\\015" >"$1".new &&
	mv -f "$1".new "$1"
	EOF
	(
		test_set_editor "$(pwd)/add-crs.sh" &&
		git rebase -i HEAD^
	)

rm 'a/f'
rm 'b/a'
rm 'f1'
Switched to a new branch 'with-crlf'
[nick-testcase (root-commit) 65872b1] Empty file
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 empty
Switched to a new branch 'simple'
Rebasing (1/2)
[simple ca3760f] Empty file under empty dir
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename empty => empty/file (100%)
[simple c1754ff] New file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 newfile
ok 4 - Setup rename with file on one side matching directory name on other

expecting success: 
	git reset --hard &&
	git checkout -q nick-testcase^0 &&
	git cherry-pick --strategy=resolve simple

HEAD is now at c1754ff New file
Trying simple merge.
Simple merge failed, trying Automatic merge.
Successfully rebased and updated detached HEAD.
Rebasing (2/2)
--- expect.rev	2015-12-16 10:55:30.597564814 +0000
+++ actual.rev	2015-12-16 10:55:30.617564814 +0000
@@ -1 +1 @@
-d9ea348e0fe8827f205c231ed0a5b8258841fd37
+8b0b08f11e6fffcd7a364144d5399bf69ae313f5
not ok 72 - rebase -p --root on linear history is a no-op # TODO known breakage

expecting success: 
		reset_rebase &&
		git rebase  -f --root c &&
		! test_cmp_rev a HEAD~2 &&
		test_linear_range 'a b c' HEAD
	
[detached HEAD 7582122] New file
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:55:30 2015 +0000
 1 file changed, 1 insertion(+)
 create mode 100644 newfile
ok 5 - Cherry-pick succeeds with was_a_dir/file -> was_a_dir (resolve)

expecting success: 
	git reset --hard &&
	git checkout -q nick-testcase^0 &&
	git cherry-pick --strategy=recursive simple

HEAD is now at 7582122 New file
Adding empty
No rebase in progress?
[detached HEAD 7582122] New file
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:55:30 2015 +0000
 1 file changed, 1 insertion(+)
 create mode 100644 newfile
ok 6 - Cherry-pick succeeds with was_a_dir/file -> was_a_dir (recursive)

expecting success: 
	git reset --hard &&
	git checkout --orphan mergeme &&
	git rm -rf . &&

	mkdir sub &&
	mkdir othersub &&
	echo content > sub/file &&
	echo foo > othersub/whatever &&
	git add -A &&
	git commit -m "Common commit" &&

	git rm -rf othersub &&
	git mv sub/file othersub &&
	git commit -m "Commit to merge" &&

	git checkout -b newhead mergeme~1 &&
	>independent-change &&
	git add independent-change &&
	git commit -m "Completely unrelated change"

HEAD is now at 8b0b08f c
HEAD is now at 7582122 New file
Removing actual.rev
Removing expect.rev
Switched to a new branch 'mergeme'
rm 'empty'
rm 'newfile'
[mergeme (root-commit) d73e9a2] Common commit
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 othersub/whatever
 create mode 100644 sub/file
rm 'othersub/whatever'
[mergeme 281f78c] Commit to merge
 Author: A U Thor <author@example.com>
 2 files changed, 1 deletion(-)
 rename sub/file => othersub (100%)
 delete mode 100644 othersub/whatever
Switched to a new branch 'newhead'
Rebasing (1/1)
[newhead 6facc39] Completely unrelated change
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 independent-change
ok 7 - Setup rename with file on one side matching different dirname on other

expecting success: 
	git reset --hard &&
	git checkout -q newhead^0 &&
	git cherry-pick --strategy=resolve mergeme

HEAD is now at 6facc39 Completely unrelated change
Trying simple merge.
Simple merge failed, trying Automatic merge.
Adding othersub
[detached HEAD 733659b] Commit to merge
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:55:31 2015 +0000
 2 files changed, 1 deletion(-)
 rename sub/file => othersub (100%)
 delete mode 100644 othersub/whatever
ok 8 - Cherry-pick with rename to different D/F conflict succeeds (resolve)

expecting success: 
	git reset --hard &&
	git checkout -q newhead^0 &&
	git cherry-pick --strategy=recursive mergeme

HEAD is now at 733659b Commit to merge
Removing othersub/whatever
Skipped othersub (merged same as existing)
[detached HEAD 733659b] Commit to merge
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:55:31 2015 +0000
 2 files changed, 1 deletion(-)
 rename sub/file => othersub (100%)
 delete mode 100644 othersub/whatever
ok 9 - Cherry-pick with rename to different D/F conflict succeeds (recursive)

# passed all 9 test(s)
1..9
*** t3510-cherry-pick-sequence.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3510-cherry-pick-sequence/.git/
Rebasing (1/3)
expecting success: 
	git config advice.detachedhead false &&
	echo unrelated >unrelated &&
	git add unrelated &&
	test_commit initial foo a &&
	test_commit base foo b &&
	test_commit unrelatedpick unrelated reallyunrelated &&
	test_commit picked foo c &&
	test_commit anotherpick foo d &&
	test_commit yetanotherpick foo e &&
	pristine_detach initial &&
	test_commit conflicting unrelated

[master (root-commit) df2a63d] initial
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 foo
 create mode 100644 unrelated
[master dc0113b] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Successfully rebased and updated refs/heads/ours.
Rebasing (2/3)
[master 24c5742] unrelatedpick
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master fdc0b12] picked
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Successfully rebased and updated refs/heads/with-crlf.
[master 965fed4] anotherpick
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 91 - editor saves as CR/LF

# still have 1 known breakage(s)
# passed all remaining 90 test(s)
1..91
Rebasing (3/3)
[master 55c7d12] yetanotherpick
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
HEAD is now at df2a63d... initial
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3426-rebase-submodule/submodule_update_repo/.) registered for path 'sub1'
[detached HEAD d520364] conflicting
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - setup

expecting success: 
	pristine_detach initial &&
	test_expect_code 1 git cherry-pick -s base..anotherpick &&
	test_path_is_dir .git/sequencer &&
	test_path_is_file .git/sequencer/head &&
	test_path_is_file .git/sequencer/todo &&
	test_path_is_file .git/sequencer/opts

Previous HEAD position was d520364... conflicting
HEAD is now at df2a63d... initial
Cloning into 'sub1'...
[detached HEAD 2fa73e8] unrelatedpick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
error: could not apply fdc0b12... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
done.
ok 2 - cherry-pick persists data on failure

expecting success: 
	pristine_detach initial &&
	test_must_fail git cherry-pick base..anotherpick &&
	test_cmp_rev picked CHERRY_PICK_HEAD &&
	# "oops, I forgot that these patches rely on the change from base"
	git checkout HEAD foo &&
	git cherry-pick base &&
	git cherry-pick picked &&
	git cherry-pick --continue &&
	git diff --exit-code anotherpick

*** t3511-cherry-pick-x.sh ***
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  2fa73e8 unrelatedpick

HEAD is now at df2a63d... initial
[detached HEAD 7fdfeeb] unrelatedpick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3511-cherry-pick-x/.git/
error: could not apply fdc0b12... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
expecting success: 
	git config advice.detachedhead false &&
	echo unrelated >unrelated &&
	git add unrelated &&
	test_commit initial foo a &&
	test_commit "$mesg_one_line" foo b mesg-one-line &&
	git reset --hard initial &&
	test_commit "$mesg_no_footer" foo b mesg-no-footer &&
	git reset --hard initial &&
	test_commit "$mesg_broken_footer" foo b mesg-broken-footer &&
	git reset --hard initial &&
	test_commit "$mesg_with_footer" foo b mesg-with-footer &&
	git reset --hard initial &&
	test_commit "$mesg_with_footer_sob" foo b mesg-with-footer-sob &&
	git reset --hard initial &&
	test_commit "$mesg_with_cherry_footer" foo b mesg-with-cherry-footer &&
	git reset --hard initial &&
	test_config commit.cleanup verbatim &&
	test_commit "$mesg_unclean" foo b mesg-unclean &&
	test_unconfig commit.cleanup &&
	pristine_detach initial &&
	test_commit conflicting unrelated

Submodule path 'sub1': checked out '074a145e4bb5d727c9a29bb1b090a652fdf358a8'
[master (root-commit) df2a63d] initial
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 foo
 create mode 100644 unrelated
[detached HEAD 28eafda] base
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
[detached HEAD 4a5cd69] picked
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
[master d18d4f3] base: commit message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 28 - git_rebase_interactive: modified submodule does not update submodule work tree from invalid commit

HEAD is now at df2a63d initial
[detached HEAD 49d5115] anotherpick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:17:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
# still have 5 known breakage(s)
# passed all remaining 23 test(s)
1..28
ok 3 - cherry-pick mid-cherry-pick-sequence

expecting success: 
	pristine_detach initial &&
	test_expect_code 128 git cherry-pick -s -m 1 --strategy=recursive -X patience -X ours initial..anotherpick &&
	test_path_is_dir .git/sequencer &&
	test_path_is_file .git/sequencer/head &&
	test_path_is_file .git/sequencer/todo &&
	test_path_is_file .git/sequencer/opts &&
	echo "true" >expect &&
	git config --file=.git/sequencer/opts --get-all options.signoff >actual &&
	test_cmp expect actual &&
	echo "1" >expect &&
	git config --file=.git/sequencer/opts --get-all options.mainline >actual &&
	test_cmp expect actual &&
	echo "recursive" >expect &&
	git config --file=.git/sequencer/opts --get-all options.strategy >actual &&
	test_cmp expect actual &&
	cat >expect <<-\EOF &&
	patience
	ours
	EOF
	git config --file=.git/sequencer/opts --get-all options.strategy-option >actual &&
	test_cmp expect actual

[master e073909] base: commit message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Warning: you are leaving 4 commits behind, not connected to
any of your branches:

  49d5115 anotherpick
  4a5cd69 picked
  28eafda base
  7fdfeeb unrelatedpick

HEAD is now at df2a63d... initial
HEAD is now at df2a63d initial
error: Mainline was specified but commit dc0113b541050fbc624688af31e35b1d246f20fc is not a merge.
fatal: cherry-pick failed
[master f12344d] base: commit message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
HEAD is now at df2a63d initial
*** t3512-cherry-pick-submodule.sh ***
ok 4 - cherry-pick persists opts correctly

expecting success: 
	pristine_detach initial &&
	git cherry-pick initial..picked &&
	test_path_is_missing .git/sequencer

[master 3838485] base: commit message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
HEAD is now at df2a63d... initial
HEAD is now at df2a63d initial
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3512-cherry-pick-submodule/.git/
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
		)
	
[master d60edf0] base: commit message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3512-cherry-pick-submodule/submodule_update_repo/.git/
[detached HEAD 86ee3fa] base
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
HEAD is now at df2a63d initial
[master (root-commit) 57f6a20] 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
[detached HEAD 2b8ae83] unrelatedpick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
[master d7a875c] base: commit message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'add_sub1'
[detached HEAD a222ac0] picked
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 5 - cherry-pick cleans up sequencer state upon success

expecting success: 
	pristine_detach initial &&
	git cherry-pick --quit

Successfully rebased and updated detached HEAD.
HEAD is now at df2a63d initial
Warning: you are leaving 3 commits behind, not connected to
any of your branches:

  a222ac0 picked
  2b8ae83 unrelatedpick
  86ee3fa base

HEAD is now at df2a63d... initial
--- expect.rev	2015-12-16 10:55:34.637564814 +0000
+++ actual.rev	2015-12-16 10:55:34.661564814 +0000
@@ -1 +1 @@
-ce450c7fd6766cb1f2df873857da7b928ff743a8
+060c4193c2500f886c89b8fa8d63916f8aa4d912
ok 6 - --quit does not complain when no cherry-pick is in progress

expecting success: 
	pristine_detach initial &&
	test_must_fail git cherry-pick --abort

[master 860e94a] base: commit message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 73 - rebase  -f --root on linear history causes re-write

expecting success: 
		reset_rebase &&
		git rebase -m -f --root c &&
		! test_cmp_rev a HEAD~2 &&
		test_linear_range 'a b c' HEAD
	
HEAD is now at df2a63d... initial
HEAD is now at df2a63d... initial
error: no cherry-pick or revert in progress
fatal: cherry-pick failed
ok 7 - --abort requires cherry-pick in progress

expecting success: 
	pristine_detach initial &&
	test_expect_code 1 git cherry-pick base..picked &&
	git cherry-pick --quit &&
	test_path_is_missing .git/sequencer

Cloning into 'sub1'...
HEAD is now at df2a63d... initial
No rebase in progress?
[detached HEAD 823a98f] conflicting
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
done.
HEAD is now at 8b0b08f c
Removing actual.rev
Removing expect.rev
ok 1 - setup

expecting success: 
	pristine_detach initial &&
	sha1=`git rev-parse mesg-one-line^0` &&
	git cherry-pick -x mesg-one-line &&
	cat <<-EOF >expect &&
		$mesg_one_line

		(cherry picked from commit $sha1)
	EOF
	git log -1 --pretty=format:%B >actual &&
	test_cmp expect actual

[detached HEAD 7fdfeeb] unrelatedpick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
error: could not apply fdc0b12... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
Previous HEAD position was 823a98f... conflicting
HEAD is now at df2a63d... initial
ok 8 - --quit cleans up sequencer state

expecting success: 
	pristine_detach initial &&
	cat >expect <<-\EOF &&
	OBJID
	:100644 100644 OBJID OBJID M	unrelated
	OBJID
	:000000 100644 OBJID OBJID A	foo
	:000000 100644 OBJID OBJID A	unrelated
	EOF
	test_expect_code 1 git cherry-pick base..picked &&
	git cherry-pick --quit &&
	test_path_is_missing .git/sequencer &&
	test_must_fail git update-index --refresh &&
	{
		git rev-list HEAD |
		git diff-tree --root --stdin |
		sed "s/$_x40/OBJID/g"
	} >actual &&
	test_cmp expect actual

Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  7fdfeeb unrelatedpick

HEAD is now at df2a63d... initial
[detached HEAD 6970a53] base: commit message
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 2 - cherry-pick -x inserts blank line after one line subject

expecting success: 
	pristine_detach initial &&
	git cherry-pick -s mesg-one-line &&
	cat <<-EOF >expect &&
		$mesg_one_line

		Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>
	EOF
	git log -1 --pretty=format:%B >actual &&
	test_cmp expect actual

[detached HEAD 7fdfeeb] unrelatedpick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
error: could not apply fdc0b12... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  6970a53 base: commit message

[add_sub1 b282722] Add sub1
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
HEAD is now at df2a63d... initial
foo: needs merge
Switched to a new branch 'remove_sub1'
ok 9 - --quit keeps HEAD and conflicted index intact

expecting success: 
	pristine_detach initial &&
	test_expect_code 1 git cherry-pick base..anotherpick &&
	git cherry-pick --abort &&
	test_path_is_missing .git/sequencer &&
	test_cmp_rev initial HEAD &&
	git update-index --refresh &&
	git diff-index --exit-code HEAD

Removing sub1
Removing .gitmodules
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  7fdfeeb unrelatedpick

HEAD is now at df2a63d... initial
[remove_sub1 e5fad96] Revert "Add sub1"
 Author: A U Thor <author@example.com>
 2 files changed, 5 deletions(-)
 delete mode 100644 .gitmodules
 delete mode 160000 sub1
[detached HEAD 0fda2e1] base: commit message
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 3 - cherry-pick -s inserts blank line after one line subject

expecting success: 
	pristine_detach initial &&
	git cherry-pick -s mesg-broken-footer &&
	cat <<-EOF >expect &&
		$mesg_broken_footer

		Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>
	EOF
	git log -1 --pretty=format:%B >actual &&
	test_cmp expect actual

Switched to a new branch 'modify_sub1'
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  0fda2e1 base: commit message

HEAD is now at df2a63d... initial
[detached HEAD 7fdfeeb] unrelatedpick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
error: could not apply fdc0b12... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
[detached HEAD 1f3e51f] base: commit message
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 10 - --abort to cancel multiple cherry-pick

expecting success: 
	pristine_detach initial &&
	test_expect_code 1 git cherry-pick picked &&
	git cherry-pick --abort &&
	test_path_is_missing .git/sequencer &&
	test_cmp_rev initial HEAD &&
	git update-index --refresh &&
	git diff-index --exit-code HEAD

ok 4 - cherry-pick -s inserts blank line after non-conforming footer

expecting success: 
	pristine_detach initial &&
	sha1=`git rev-parse mesg-no-footer^0` &&
	git cherry-pick -x mesg-no-footer &&
	cat <<-EOF >expect &&
		$mesg_no_footer

		(cherry picked from commit $sha1)
	EOF
	git log -1 --pretty=format:%B >actual &&
	test_cmp expect actual

HEAD is now at df2a63d... initial
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  1f3e51f base: commit message

HEAD is now at df2a63d... initial
error: could not apply fdc0b12... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
[detached HEAD 6f42e54] base: commit message
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 5 - cherry-pick -x inserts blank line when conforming footer not found

expecting success: 
	pristine_detach initial &&
	git cherry-pick -s mesg-no-footer &&
	cat <<-EOF >expect &&
		$mesg_no_footer

		Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>
	EOF
	git log -1 --pretty=format:%B >actual &&
	test_cmp expect actual

From /«PKGBUILDDIR»/t/trash directory.t3512-cherry-pick-submodule/submodule_update_repo/.
   57f6a20..b282722  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'
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  6f42e54 base: commit message

HEAD is now at df2a63d... initial
ok 11 - --abort to cancel single cherry-pick

expecting success: 
	pristine_detach anotherpick &&
	test_expect_code 1 git revert base..picked &&
	git cherry-pick --abort &&
	test_path_is_missing .git/sequencer &&
	test_cmp_rev anotherpick HEAD &&
	git update-index --refresh &&
	git diff-index --exit-code HEAD

Previous HEAD position was df2a63d... initial
HEAD is now at 965fed4... anotherpick
[modifications c43e232] modified file2 and added file3
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 file3
Rebasing (1/3)
[detached HEAD 32d2dda] base: commit message
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 6 - cherry-pick -s inserts blank line when conforming footer not found

expecting success: 
	pristine_detach initial &&
	sha1=`git rev-parse mesg-no-footer^0` &&
	git cherry-pick -x -s mesg-no-footer &&
	cat <<-EOF >expect &&
		$mesg_no_footer

		(cherry picked from commit $sha1)
		Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>
	EOF
	git log -1 --pretty=format:%B >actual &&
	test_cmp expect actual

error: could not revert fdc0b12... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  32d2dda base: commit message

HEAD is now at df2a63d... initial
To /«PKGBUILDDIR»/t/trash directory.t3512-cherry-pick-submodule/submodule_update_repo/.
 * [new branch]      modifications -> modifications
[modify_sub1 ba7b358] Modify sub1
 Author: A U Thor <author@example.com>
ok 12 - cherry-pick --abort to cancel multiple revert

expecting success: 
	pristine_detach anotherpick &&
	test_expect_code 1 git revert base..picked &&
	git revert --abort &&
	test_path_is_missing .git/sequencer &&
	test_cmp_rev anotherpick HEAD

Switched to a new branch 'replace_sub1_with_directory'
HEAD is now at 965fed4... anotherpick
[detached HEAD adaaef8] base: commit message
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
Rebasing (2/3)
ok 7 - cherry-pick -x -s inserts blank line when conforming footer not found

expecting success: 
	pristine_detach initial &&
	git cherry-pick -s mesg-with-footer &&
	cat <<-EOF >expect &&
		$mesg_with_footer
		Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>
	EOF
	git log -1 --pretty=format:%B >actual &&
	test_cmp expect actual

error: could not revert fdc0b12... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  adaaef8 base: commit message

HEAD is now at df2a63d... initial
ok 13 - revert --abort works, too

expecting success: 
	pristine_detach anotherpick &&
	test_expect_code 1 git revert picked &&
	git revert --abort &&
	test_path_is_missing .git/sequencer &&
	test_cmp_rev anotherpick HEAD &&
	git update-index --refresh &&
	git diff-index --exit-code HEAD

HEAD is now at 965fed4... anotherpick
[detached HEAD b62bd75] base: commit message
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:17:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 8 - cherry-pick -s adds sob when last sob doesnt match committer

expecting success: 
	pristine_detach initial &&
	sha1=`git rev-parse mesg-with-footer^0` &&
	git cherry-pick -x -s mesg-with-footer &&
	cat <<-EOF >expect &&
		$mesg_with_footer
		(cherry picked from commit $sha1)
		Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>
	EOF
	git log -1 --pretty=format:%B >actual &&
	test_cmp expect actual

error: could not revert fdc0b12... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  b62bd75 base: commit message

HEAD is now at df2a63d... initial
Rebasing (3/3)
Submodule path 'sub1': checked out '57f6a203156c10b7060ff028d0d3e3aa4963c720'
ok 14 - --abort to cancel single revert

expecting success: 
	pristine_detach unrelatedpick &&
	echo changed >expect &&
	test_expect_code 1 git cherry-pick picked..yetanotherpick &&
	echo changed >unrelated &&
	git cherry-pick --abort &&
	test_cmp expect unrelated

Previous HEAD position was 57f6a20... Base
Switched to branch 'modifications'
[detached HEAD 94e740a] base: commit message
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:17:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
rm 'sub1'
Previous HEAD position was 965fed4... anotherpick
HEAD is now at 24c5742... unrelatedpick
ok 9 - cherry-pick -x -s adds sob when last sob doesnt match committer

expecting success: 
	pristine_detach initial &&
	git cherry-pick -s mesg-with-footer-sob &&
	cat <<-EOF >expect &&
		$mesg_with_footer_sob
	EOF
	git log -1 --pretty=format:%B >actual &&
	test_cmp expect actual

Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  94e740a base: commit message

[replace_sub1_with_directory 7e47a07] 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 df2a63d... initial
error: could not apply 965fed4... anotherpick
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
Switched to a new branch 'replace_directory_with_sub1'
ok 15 - --abort keeps unrelated change, easy case

expecting success: 
	pristine_detach initial &&
	echo changed >expect &&
	test_expect_code 1 git cherry-pick base..anotherpick &&
	echo changed >unrelated &&
	test_must_fail git cherry-pick --abort &&
	test_cmp expect unrelated &&
	git rev-list HEAD >log &&
	test_line_count = 2 log &&
	test_must_fail git update-index --refresh &&

	git checkout unrelated &&
	git cherry-pick --abort &&
	test_cmp_rev initial HEAD

Removing sub1/file3
Removing sub1/file2
Removing sub1/file1
Adding sub1
[replace_directory_with_sub1 908e9ff] 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
[detached HEAD a836c16] base: commit message
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:18:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
Previous HEAD position was 24c5742... unrelatedpick
HEAD is now at df2a63d... initial
Switched to a new branch 'replace_sub1_with_file'
ok 10 - cherry-pick -s refrains from adding duplicate trailing sob

expecting success: 
	pristine_detach initial &&
	sha1=`git rev-parse mesg-with-footer-sob^0` &&
	git cherry-pick -x -s mesg-with-footer-sob &&
	cat <<-EOF >expect &&
		$mesg_with_footer_sob
		(cherry picked from commit $sha1)
		Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>
	EOF
	git log -1 --pretty=format:%B >actual &&
	test_cmp expect actual

rm 'sub1'
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  a836c16 base: commit message

HEAD is now at df2a63d... initial
[replace_sub1_with_file 63b0e86] Replace sub1 with file
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
[detached HEAD 7fdfeeb] unrelatedpick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
error: could not apply fdc0b12... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
Switched to a new branch 'replace_file_with_sub1'
error: Entry 'unrelated' not uptodate. Cannot merge.
fatal: Could not reset index file to revision 'df2a63d8a410bba7d3f608203e12bb371c76d4a8'.
fatal: cherry-pick failed
[replace_file_with_sub1 762bd68] Revert "Replace sub1 with file"
 Author: A U Thor <author@example.com>
 2 files changed, 5 insertions(+), 1 deletion(-)
 mode change 100644 => 160000 sub1
foo: needs merge
unrelated: needs update
[detached HEAD 2d6e386] base: commit message
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:18:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'invalid_sub1'
ok 11 - cherry-pick -x -s adds sob even when trailing sob exists for committer

expecting success: 
	pristine_detach initial &&
	sha1=`git rev-parse mesg-with-cherry-footer^0` &&
	git cherry-pick -x mesg-with-cherry-footer &&
	cat <<-EOF >expect &&
		$mesg_with_cherry_footer
		(cherry picked from commit $sha1)
	EOF
	git log -1 --pretty=format:%B >actual &&
	test_cmp expect actual

[invalid_sub1 09415f0] Invalid sub1 commit
 Author: A U Thor <author@example.com>
Switched to a new branch 'valid_sub1'
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  2d6e386 base: commit message

HEAD is now at df2a63d... initial
ok 16 - --abort refuses to clobber unrelated change, harder case

expecting success: 
	pristine_detach initial &&
	test_expect_code 1 git cherry-pick base..picked &&
	test_path_is_dir .git/sequencer &&
	echo "resolved" >foo &&
	git add foo &&
	git commit &&
	{
		git rev-list HEAD |
		git diff-tree --root --stdin |
		sed "s/$_x40/OBJID/g"
	} >actual &&
	cat >expect <<-\EOF &&
	OBJID
	:100644 100644 OBJID OBJID M	foo
	OBJID
	:100644 100644 OBJID OBJID M	unrelated
	OBJID
	:000000 100644 OBJID OBJID A	foo
	:000000 100644 OBJID OBJID A	unrelated
	EOF
	test_cmp expect actual

[valid_sub1 083d433] Revert "Invalid sub1 commit"
 Author: A U Thor <author@example.com>
HEAD is now at df2a63d... initial
Switched to branch 'master'
[detached HEAD 7b5eb6d] base: commit message
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:19:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'submodule_update'...
ok 12 - cherry-pick -x treats "(cherry picked from..." line as part of footer

expecting success: 
	pristine_detach initial &&
	git cherry-pick -s mesg-with-cherry-footer &&
	cat <<-EOF >expect &&
		$mesg_with_cherry_footer
		Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>
	EOF
	git log -1 --pretty=format:%B >actual &&
	test_cmp expect actual

[detached HEAD 7fdfeeb] unrelatedpick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
done.
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  7b5eb6d base: commit message

HEAD is now at df2a63d... initial
error: could not apply fdc0b12... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
[detached HEAD 94e48e3] picked
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
[detached HEAD b468a7b] base: commit message
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:19:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 17 - cherry-pick still writes sequencer state when one commit is left

expecting success: 
	pristine_detach initial &&
	test_expect_code 1 git cherry-pick base..picked &&
	git cherry-pick --abort &&
	test_path_is_missing .git/sequencer &&
	test_cmp_rev initial HEAD &&
	git update-index --refresh &&
	git diff-index --exit-code HEAD

ok 13 - cherry-pick -s treats "(cherry picked from..." line as part of footer

expecting success: 
	pristine_detach initial &&
	sha1=`git rev-parse mesg-with-cherry-footer^0` &&
	git cherry-pick -x -s mesg-with-cherry-footer &&
	cat <<-EOF >expect &&
		$mesg_with_cherry_footer
		(cherry picked from commit $sha1)
		Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>
	EOF
	git log -1 --pretty=format:%B >actual &&
	test_cmp expect actual

Branch add_sub1 set up to track remote branch add_sub1 from origin.
Warning: you are leaving 2 commits behind, not connected to
any of your branches:

  94e48e3 picked
  7fdfeeb unrelatedpick

HEAD is now at df2a63d... initial
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  b468a7b base: commit message

HEAD is now at df2a63d... initial
[no_submodule 765b2ab] Add sub1
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:55:35 2015 +0000
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
[detached HEAD 7fdfeeb] unrelatedpick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
error: could not apply fdc0b12... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
[detached HEAD c7c741c] base: commit message
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:19:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 14 - cherry-pick -x -s treats "(cherry picked from..." line as part of footer

expecting success: 
	pristine_detach initial &&
	printf "$mesg_unclean" >expect &&
	git log -1 --pretty=format:%B mesg-unclean >actual &&
	test_cmp expect actual &&
	git cherry-pick mesg-unclean &&
	git log -1 --pretty=format:%B >actual &&
	test_cmp expect actual

Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  c7c741c base: commit message

HEAD is now at df2a63d... initial
ok 18 - --abort after last commit in sequence

expecting success: 
	pristine_detach initial &&
	test_expect_code 1 git cherry-pick base..anotherpick &&
	test-chmtime -v +0 .git/sequencer >expect &&
	test_expect_code 128 git cherry-pick unrelatedpick &&
	test-chmtime -v +0 .git/sequencer >actual &&
	test_cmp expect actual

HEAD is now at df2a63d... initial
[detached HEAD 7a2ed43] base: commit message
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:20:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
[detached HEAD 7fdfeeb] unrelatedpick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
Successfully rebased and updated detached HEAD.
error: could not apply fdc0b12... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
ok 15 - cherry-pick preserves commit message

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3512-cherry-pick-submodule/submodule_update_repo/.) registered for path 'sub1'
# passed all 15 test(s)
1..15
error: cherry-pick is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: cherry-pick failed
ok 19 - cherry-pick does not implicitly stomp an existing operation

expecting success: 
	pristine_detach initial &&
	test_expect_code 128 git cherry-pick --continue

--- expect.rev	2015-12-16 10:55:38.617564815 +0000
+++ actual.rev	2015-12-16 10:55:38.641564815 +0000
@@ -1 +1 @@
-ce450c7fd6766cb1f2df873857da7b928ff743a8
+060c4193c2500f886c89b8fa8d63916f8aa4d912
ok 74 - rebase -m -f --root on linear history causes re-write

expecting success: 
		reset_rebase &&
		git rebase -i -f --root c &&
		! test_cmp_rev a HEAD~2 &&
		test_linear_range 'a b c' HEAD
	
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  7fdfeeb unrelatedpick

HEAD is now at df2a63d... initial
*** t3513-revert-submodule.sh ***
error: no cherry-pick or revert in progress
fatal: cherry-pick failed
ok 20 - --continue complains when no cherry-pick is in progress

expecting success: 
	pristine_detach initial &&
	test_expect_code 1 git cherry-pick base..anotherpick &&
	test_expect_code 128 git cherry-pick --continue

Cloning into 'sub1'...
HEAD is now at df2a63d... initial
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3513-revert-submodule/.git/
No rebase in progress?
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
		)
	
done.
HEAD is now at 8b0b08f c
Removing actual.rev
Removing expect.rev
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3513-revert-submodule/submodule_update_repo/.git/
[detached HEAD 7fdfeeb] unrelatedpick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
error: could not apply fdc0b12... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
[master (root-commit) 0bb19bc] 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: commit is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
U	foo
ok 21 - --continue complains when there are unresolved conflicts

expecting success: 
	pristine_detach initial &&
	echo c >expect &&
	test_must_fail git cherry-pick picked &&
	echo c >foo &&
	git add foo &&
	git cherry-pick --continue &&

	test_cmp expect foo &&
	test_cmp_rev initial HEAD^ &&
	git diff --exit-code HEAD &&
	test_must_fail git rev-parse --verify CHERRY_PICK_HEAD

Switched to a new branch 'add_sub1'
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  7fdfeeb unrelatedpick

HEAD is now at df2a63d... initial
Submodule path 'sub1': checked out '57f6a203156c10b7060ff028d0d3e3aa4963c720'
error: could not apply fdc0b12... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
[detached HEAD e71cb7f] picked
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'sub1'...
fatal: Needed a single revision
ok 1 - git cherry-pick: added submodule creates empty directory

ok 22 - --continue of single cherry-pick

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
		)
	
expecting success: 
	pristine_detach initial &&
	echo resolved >expect &&
	echo "Revert \"picked\"" >expect.msg &&
	test_must_fail git revert picked &&
	echo resolved >foo &&
	git add foo &&
	git cherry-pick --continue &&

	git diff --exit-code HEAD &&
	test_cmp expect foo &&
	test_cmp_rev initial HEAD^ &&
	git diff-tree -s --pretty=tformat:%s HEAD >msg &&
	test_cmp expect.msg msg &&
	test_must_fail git rev-parse --verify CHERRY_PICK_HEAD &&
	test_must_fail git rev-parse --verify REVERT_HEAD

done.
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  e71cb7f picked

HEAD is now at df2a63d... initial
error: could not revert fdc0b12... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
Cloning into 'submodule_update'...
[detached HEAD cc9ea52] Revert "picked"
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
done.
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
[add_sub1 7f8e3e4] Add sub1
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
fatal: Needed a single revision
fatal: Needed a single revision
ok 23 - --continue of single revert

expecting success: 
	pristine_detach initial &&
	echo d >expect &&
	cat >expect.log <<-\EOF &&
	OBJID
	:100644 100644 OBJID OBJID M	foo
	OBJID
	:100644 100644 OBJID OBJID M	foo
	OBJID
	:100644 100644 OBJID OBJID M	unrelated
	OBJID
	:000000 100644 OBJID OBJID A	foo
	:000000 100644 OBJID OBJID A	unrelated
	EOF
	test_must_fail git cherry-pick base..anotherpick &&
	echo c >foo &&
	git add foo &&
	git cherry-pick --continue &&
	{
		git rev-list HEAD |
		git diff-tree --root --stdin |
		sed "s/$_x40/OBJID/g"
	} >actual.log &&
	test_cmp expect foo &&
	test_cmp expect.log actual.log

Switched to a new branch 'remove_sub1'
Removing sub1
Removing .gitmodules
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  cc9ea52 Revert "picked"

HEAD is now at df2a63d... initial
[remove_sub1 032850b] Revert "Add sub1"
 Author: A U Thor <author@example.com>
 2 files changed, 5 deletions(-)
 delete mode 100644 .gitmodules
 delete mode 160000 sub1
[no_submodule 1ac14ba] Add sub1
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:55:35 2015 +0000
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
Switched to a new branch 'modify_sub1'
[detached HEAD 7fdfeeb] unrelatedpick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
error: could not apply fdc0b12... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
[detached HEAD 5044b0c] picked
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
Rebasing (1/3)
[detached HEAD c034138] anotherpick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:17:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 24 - --continue after resolving conflicts

expecting success: 
	pristine_detach initial &&
	test_expect_code 1 git cherry-pick base..anotherpick &&
	echo "c" >foo &&
	git add foo &&
	git commit &&
	git cherry-pick --continue &&
	test_path_is_missing .git/sequencer &&
	{
		git rev-list HEAD |
		git diff-tree --root --stdin |
		sed "s/$_x40/OBJID/g"
	} >actual &&
	cat >expect <<-\EOF &&
	OBJID
	:100644 100644 OBJID OBJID M	foo
	OBJID
	:100644 100644 OBJID OBJID M	foo
	OBJID
	:100644 100644 OBJID OBJID M	unrelated
	OBJID
	:000000 100644 OBJID OBJID A	foo
	:000000 100644 OBJID OBJID A	unrelated
	EOF
	test_cmp expect actual

Warning: you are leaving 3 commits behind, not connected to
any of your branches:

  c034138 anotherpick
  5044b0c picked
  7fdfeeb unrelatedpick

HEAD is now at df2a63d... initial
[detached HEAD 7fdfeeb] unrelatedpick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3512-cherry-pick-submodule/submodule_update_repo/.) registered for path 'sub1'
error: could not apply fdc0b12... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
Rebasing (2/3)
[detached HEAD 5044b0c] picked
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
[detached HEAD c034138] anotherpick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:17:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
From /«PKGBUILDDIR»/t/trash directory.t3513-revert-submodule/submodule_update_repo/.
   0bb19bc..7f8e3e4  add_sub1   -> origin/add_sub1
 * [new branch]      modify_sub1 -> origin/modify_sub1
 * [new branch]      remove_sub1 -> origin/remove_sub1
Cloning into 'sub1'...
ok 25 - --continue after resolving conflicts and committing

expecting success: 
	pristine_detach conflicting &&
	test_must_fail git cherry-pick initial..picked &&

	test_cmp_rev unrelatedpick CHERRY_PICK_HEAD &&
	git checkout HEAD -- unrelated &&
	test_must_fail git cherry-pick --continue 2>msg &&
	test_i18ngrep "The previous cherry-pick is now empty" msg

Switched to a new branch 'modifications'
Warning: you are leaving 3 commits behind, not connected to
any of your branches:

  c034138 anotherpick
  5044b0c picked
  7fdfeeb unrelatedpick

HEAD is now at d520364... conflicting
done.
[modifications e9b3677] modified file2 and added file3
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 file3
Rebasing (3/3)
[detached HEAD 5ca81a4] base
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
error: could not apply 24c5742... unrelatedpick
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging unrelated
CONFLICT (content): Merge conflict in unrelated
To /«PKGBUILDDIR»/t/trash directory.t3513-revert-submodule/submodule_update_repo/.
 * [new branch]      modifications -> modifications
[modify_sub1 29cf699] Modify sub1
 Author: A U Thor <author@example.com>
HEAD detached from d520364
You are currently cherry-picking commit 24c5742.

Untracked files:
	actual.rev
	expect.rev
	msg

nothing added to commit but untracked files present
Submodule path 'sub1': checked out '57f6a203156c10b7060ff028d0d3e3aa4963c720'
The previous cherry-pick is now empty, possibly due to conflict resolution.
ok 26 - --continue asks for help after resolving patch to nil

expecting success: 
	pristine_detach conflicting &&
	test_must_fail git cherry-pick initial..picked &&

	git checkout HEAD -- unrelated &&
	test_must_fail git cherry-pick --continue &&
	git reset &&
	git cherry-pick --continue &&

	git rev-list initial..HEAD >commits &&
	test_line_count = 3 commits

Switched to a new branch 'replace_sub1_with_directory'
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  5ca81a4 base

HEAD is now at d520364... conflicting
[detached HEAD 5ca81a4] base
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
error: could not apply 24c5742... unrelatedpick
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging unrelated
CONFLICT (content): Merge conflict in unrelated
ok 2 - git cherry-pick: 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
		)
	
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:

    git commit --allow-empty

If you wish to skip this commit, use:

    git reset

Then "git cherry-pick --continue" will resume cherry-picking
the remaining commits.
HEAD detached from d520364
You are currently cherry-picking commit 24c5742.

nothing to commit, working directory clean
[detached HEAD 38f047b] picked
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
Submodule path 'sub1': checked out '0bb19bc669768d58723d7c38bcfd024bd815cd4c'
ok 27 - follow advice and skip nil patch

expecting success: 
	pristine_detach initial &&
	test_expect_code 1 git cherry-pick -x base..anotherpick &&
	echo "c" >foo &&
	git add foo &&
	git commit &&
	git cherry-pick --continue &&
	test_path_is_missing .git/sequencer &&
	git cat-file commit HEAD >anotherpick_msg &&
	git cat-file commit HEAD~1 >picked_msg &&
	git cat-file commit HEAD~2 >unrelatedpick_msg &&
	git cat-file commit HEAD~3 >initial_msg &&
	test_must_fail grep "cherry picked from" initial_msg &&
	grep "cherry picked from" unrelatedpick_msg &&
	grep "cherry picked from" picked_msg &&
	grep "cherry picked from" anotherpick_msg

Cloning into 'submodule_update'...
Previous HEAD position was 0bb19bc... Base
Switched to branch 'modifications'
Warning: you are leaving 2 commits behind, not connected to
any of your branches:

  38f047b picked
  5ca81a4 base

HEAD is now at df2a63d... initial
rm 'sub1'
done.
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
[replace_sub1_with_directory 4539b82] 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
[detached HEAD 2828f02] unrelatedpick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
error: could not apply fdc0b12... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
Switched to a new branch 'replace_directory_with_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Removing sub1/file3
Removing sub1/file2
Removing sub1/file1
Adding sub1
[detached HEAD d8292ab] picked
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
error: The following untracked working tree files would be overwritten by merge:
	sub1
Please move or remove them before you can merge.
Aborting
fatal: merging of trees ec38489b3f8eda08fda17055ad272abc24bdf929 and 049d868ee4b8688b25072b0a7b8a6ab5b35f2b35 failed
[replace_directory_with_sub1 edf2cd7] 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
Switched to a new branch 'replace_sub1_with_file'
[detached HEAD c799fab] anotherpick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:17:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
rm 'sub1'
ok 3 - git cherry-pick: 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
		)
	
[replace_sub1_with_file f8179b2] Replace sub1 with file
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
Switched to a new branch 'replace_file_with_sub1'
(cherry picked from commit 24c574226938b210285578b30b436ec6119f7a7d)
(cherry picked from commit fdc0b12b2eb6de44c0df7d41b045ab2b44b6c37c)
(cherry picked from commit 965fed4c41239668ada422bca0c600444cc00e82)
ok 28 - --continue respects opts

expecting success: 
	pristine_detach initial &&
	test_must_fail git cherry-pick -x picked &&
	echo c >foo &&
	git add foo &&
	git cherry-pick --continue &&
	test_path_is_missing .git/sequencer &&
	git cat-file commit HEAD >msg &&
	grep "cherry picked from" msg

Cloning into 'submodule_update'...
[replace_file_with_sub1 c015349] Revert "Replace sub1 with file"
 Author: A U Thor <author@example.com>
 2 files changed, 5 insertions(+), 1 deletion(-)
 mode change 100644 => 160000 sub1
Warning: you are leaving 3 commits behind, not connected to
any of your branches:

  c799fab anotherpick
  d8292ab picked
  2828f02 unrelatedpick

HEAD is now at df2a63d... initial
Switched to a new branch 'invalid_sub1'
done.
error: could not apply fdc0b12... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
[invalid_sub1 c03262f] Invalid sub1 commit
 Author: A U Thor <author@example.com>
Switched to a new branch 'valid_sub1'
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.
[detached HEAD 39a7845] picked
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
[valid_sub1 bd3d79a] Revert "Invalid sub1 commit"
 Author: A U Thor <author@example.com>
t3512-cherry-pick-submodule.sh: 159: cd: can't cd to sub1
(cherry picked from commit fdc0b12b2eb6de44c0df7d41b045ab2b44b6c37c)
ok 29 - --continue of single-pick respects -x

expecting success: 
	pristine_detach initial &&
	test_must_fail git cherry-pick -x picked anotherpick &&
	echo c >foo &&
	git add foo &&
	git cherry-pick --continue &&
	test_path_is_missing .git/sequencer &&
	git cat-file commit HEAD^ >msg &&
	picked=$(git rev-parse --verify picked) &&
	grep "cherry picked from.*$picked" msg

Switched to branch 'master'
Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  39a7845 picked

HEAD is now at df2a63d... initial
Cloning into 'submodule_update'...
[replace_sub1_with_file 36a3ec5] Revert "Replace sub1 with file"
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:55:37 2015 +0000
 2 files changed, 5 insertions(+), 1 deletion(-)
 mode change 100644 => 160000 sub1
error: could not apply fdc0b12... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
done.
Successfully rebased and updated detached HEAD.
[detached HEAD 39a7845] picked
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
--- expect.rev	2015-12-16 10:55:42.589564815 +0000
+++ actual.rev	2015-12-16 10:55:42.609564815 +0000
@@ -1 +1 @@
-ce450c7fd6766cb1f2df873857da7b928ff743a8
+060c4193c2500f886c89b8fa8d63916f8aa4d912
[detached HEAD 2d285b6] anotherpick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:17:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 75 - rebase -i -f --root on linear history causes re-write

expecting success: 
		reset_rebase &&
		git rebase -p -f --root c &&
		! test_cmp_rev a HEAD~2 &&
		test_linear_range 'a b c' HEAD
	
Branch add_sub1 set up to track remote branch add_sub1 from origin.
(cherry picked from commit fdc0b12b2eb6de44c0df7d41b045ab2b44b6c37c)
ok 30 - --continue respects -x in first commit in multi-pick

checking known breakage: 
	pristine_detach initial &&
	test_expect_code 1 git cherry-pick --signoff base..anotherpick &&
	echo "c" >foo &&
	git add foo &&
	git commit &&
	git cherry-pick --continue &&
	test_path_is_missing .git/sequencer &&
	git cat-file commit HEAD >anotherpick_msg &&
	git cat-file commit HEAD~1 >picked_msg &&
	git cat-file commit HEAD~2 >unrelatedpick_msg &&
	git cat-file commit HEAD~3 >initial_msg &&
	test_must_fail grep "Signed-off-by:" initial_msg &&
	grep "Signed-off-by:" unrelatedpick_msg &&
	test_must_fail grep "Signed-off-by:" picked_msg &&
	grep "Signed-off-by:" anotherpick_msg

Warning: you are leaving 2 commits behind, not connected to
any of your branches:

  2d285b6 anotherpick
  39a7845 picked

HEAD is now at df2a63d... initial
Switched to branch 'add_sub1'
Your branch is up-to-date with 'origin/add_sub1'.
Removing sub1
Removing .gitmodules
No rebase in progress?
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3512-cherry-pick-submodule/submodule_update_repo/.) registered for path 'sub1'
[add_sub1 d3643ce] Revert "Add sub1"
 Author: A U Thor <author@example.com>
 1 file changed, 4 deletions(-)
 delete mode 100644 .gitmodules
HEAD is now at 8b0b08f c
[detached HEAD 2fa73e8] unrelatedpick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
error: could not apply fdc0b12... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
Removing actual.rev
Removing expect.rev
[detached HEAD b731a42] picked
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
[detached HEAD d813686] anotherpick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:17:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
[add_sub1 eabaaa9] Revert "Revert "Add sub1""
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
Cloning into 'sub1'...
done.
Signed-off-by: C O Mitter <committer@example.com>
Signed-off-by: C O Mitter <committer@example.com>
test_must_fail: command succeeded: grep Signed-off-by: picked_msg
not ok 31 - --signoff is automatically propagated to resolved conflict # TODO known breakage

checking known breakage: 
	pristine_detach initial &&
	test_must_fail git cherry-pick -s picked anotherpick &&
	echo c >foo &&
	git add foo &&
	git cherry-pick --continue &&

	git diff --exit-code HEAD &&
	test_cmp_rev initial HEAD^^ &&
	git cat-file commit HEAD^ >msg &&
	! grep Signed-off-by: msg

Warning: you are leaving 3 commits behind, not connected to
any of your branches:

  d813686 anotherpick
  b731a42 picked
  2fa73e8 unrelatedpick

HEAD is now at df2a63d... initial
error: could not apply fdc0b12... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
Submodule path 'sub1': checked out '57f6a203156c10b7060ff028d0d3e3aa4963c720'
[detached HEAD d14bdfd] picked
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3513-revert-submodule/submodule_update_repo/.) registered for path 'sub1'
[detached HEAD 9bb17c7] anotherpick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:17:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
Signed-off-by: C O Mitter <committer@example.com>
not ok 32 - --signoff dropped for implicit commit of resolution, multi-pick case # TODO known breakage

checking known breakage: 
	pristine_detach initial &&
	test_must_fail git cherry-pick -s picked &&
	echo c >foo &&
	git add foo &&
	git cherry-pick --continue &&

	git diff --exit-code HEAD &&
	test_cmp_rev initial HEAD^ &&
	git cat-file commit HEAD >msg &&
	! grep Signed-off-by: msg

ok 4 - git cherry-pick: replace tracked file with submodule creates empty directory

checking known breakage: 
		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
		)
	
Cloning into 'sub1'...
Warning: you are leaving 2 commits behind, not connected to
any of your branches:

  9bb17c7 anotherpick
  d14bdfd picked

HEAD is now at df2a63d... initial
done.
error: could not apply fdc0b12... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
Cloning into 'submodule_update'...
[detached HEAD d14bdfd] picked
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
done.
Signed-off-by: C O Mitter <committer@example.com>
not ok 33 - sign-off needs to be reaffirmed after conflict resolution, single-pick case # TODO known breakage

expecting success: 
	pristine_detach initial &&
	test_expect_code 1 git cherry-pick base..anotherpick &&
	echo "resolved" >foo &&
	git add foo &&
	git commit &&
	sed "s/pick /pick/" .git/sequencer/todo >new_sheet &&
	cp new_sheet .git/sequencer/todo &&
	test_expect_code 128 git cherry-pick --continue

Submodule path 'sub1': checked out '0bb19bc669768d58723d7c38bcfd024bd815cd4c'
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.
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  d14bdfd picked

HEAD is now at df2a63d... initial
error: 8ed2e6719f8484ce01fa3ce133fe42d25c2441b8^{commit}: expected commit type, but the object dereferences to tree type
fatal: Needed a single revision
Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
[detached HEAD 7fdfeeb] unrelatedpick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
error: could not apply fdc0b12... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
Removing sub1/file3
Removing sub1/file2
Removing sub1/file1
Adding sub1
ok 1 - git_revert: 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
		)
	
Rebasing (1/3)
[replace_sub1_with_directory 55e8368] Revert "Replace sub1 with directory"
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:55:37 2015 +0000
 4 files changed, 4 insertions(+), 3 deletions(-)
 delete mode 100644 sub1/file1
 delete mode 100644 sub1/file2
 delete mode 100644 sub1/file3
[detached HEAD 94e48e3] picked
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
error: Could not parse line 1.
fatal: Unusable instruction sheet: .git/sequencer/todo
ok 34 - malformed instruction sheet 1

expecting success: 
	pristine_detach initial &&
	test_expect_code 1 git cherry-pick base..anotherpick &&
	echo "resolved" >foo &&
	git add foo &&
	git commit &&
	sed "s/pick/revert/" .git/sequencer/todo >new_sheet &&
	cp new_sheet .git/sequencer/todo &&
	test_expect_code 128 git cherry-pick --continue

Directory sub1 doesn't exist. 
not ok 5 - git cherry-pick: replace directory with submodule # TODO known breakage

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
		)
	
Warning: you are leaving 2 commits behind, not connected to
any of your branches:

  94e48e3 picked
  7fdfeeb unrelatedpick

HEAD is now at df2a63d... initial
Cloning into 'submodule_update'...
[detached HEAD 7fdfeeb] unrelatedpick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
error: could not apply fdc0b12... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
Cloning into 'submodule_update'...
done.
[detached HEAD 94e48e3] picked
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
done.
error: Cannot revert during a cherry-pick
error: Could not parse line 1.
fatal: Unusable instruction sheet: .git/sequencer/todo
Rebasing (2/3)
ok 35 - malformed instruction sheet 2

expecting success: 
	pristine_detach initial &&
	test_expect_code 128 git cherry-pick base..base

Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Warning: you are leaving 2 commits behind, not connected to
any of your branches:

  94e48e3 picked
  7fdfeeb unrelatedpick

HEAD is now at df2a63d... initial
Branch add_sub1 set up to track remote branch add_sub1 from origin.
fatal: empty commit set passed
ok 36 - empty commit set

expecting success: 
	pristine_detach initial &&
	test_expect_code 1 git cherry-pick base..anotherpick &&
	echo "resolved" >foo &&
	git add foo &&
	git commit &&
	sed "s/pick \([0-9a-f]*\)/pick $_r10/" .git/sequencer/todo >new_sheet &&
	cp new_sheet .git/sequencer/todo &&
	test_expect_code 128 git cherry-pick --continue

HEAD is now at df2a63d... initial
Switched to branch 'add_sub1'
Your branch is up-to-date with 'origin/add_sub1'.
Removing sub1
Removing .gitmodules
[detached HEAD 7fdfeeb] unrelatedpick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
[add_sub1 491c076] Revert "Add sub1"
 Author: A U Thor <author@example.com>
 1 file changed, 4 deletions(-)
 delete mode 100644 .gitmodules
error: could not apply fdc0b12... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
Rebasing (3/3)
[detached HEAD 94e48e3] picked
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
error: Could not parse line 1.
fatal: Unusable instruction sheet: .git/sequencer/todo
ok 37 - malformed instruction sheet 3

expecting success: 
	pristine_detach initial &&
	test_expect_code 1 git cherry-pick base..anotherpick &&
	echo "c" >foo &&
	git add foo &&
	git commit &&
	sed "s/pick \([0-9a-f]*\)/pick 	 \1 	/" .git/sequencer/todo >new_sheet &&
	cp new_sheet .git/sequencer/todo &&
	git cherry-pick --continue

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3512-cherry-pick-submodule/submodule_update_repo/.) registered for path 'sub1'
[add_sub1 da29731] Revert "Revert "Add sub1""
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
Warning: you are leaving 2 commits behind, not connected to
any of your branches:

  94e48e3 picked
  7fdfeeb unrelatedpick

HEAD is now at df2a63d... initial
[detached HEAD 7fdfeeb] unrelatedpick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'sub1'...
error: could not apply fdc0b12... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
[detached HEAD 5044b0c] picked
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
done.
[detached HEAD c034138] anotherpick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:17:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 38 - instruction sheet, fat-fingers version

expecting success: 
	pristine_detach initial &&
	test_expect_code 1 git cherry-pick base..anotherpick &&
	echo "c" >foo &&
	git add foo &&
	git commit &&
	cut -d" " -f1,2 .git/sequencer/todo >new_sheet &&
	cp new_sheet .git/sequencer/todo &&
	git cherry-pick --continue &&
	test_path_is_missing .git/sequencer &&
	git rev-list HEAD >commits &&
	test_line_count = 4 commits

Warning: you are leaving 3 commits behind, not connected to
any of your branches:

  c034138 anotherpick
  5044b0c picked
  7fdfeeb unrelatedpick

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3513-revert-submodule/submodule_update_repo/.) registered for path 'sub1'
HEAD is now at df2a63d... initial
Submodule path 'sub1': checked out '57f6a203156c10b7060ff028d0d3e3aa4963c720'
[detached HEAD 7fdfeeb] unrelatedpick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
error: could not apply fdc0b12... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging foo
CONFLICT (content): Merge conflict in foo
[detached HEAD 5044b0c] picked
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'sub1'...
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
Removing sub1
Removing .gitmodules
[add_sub1 70244c4] Revert "Add sub1"
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:55:35 2015 +0000
 1 file changed, 4 deletions(-)
 delete mode 100644 .gitmodules
done.
[detached HEAD c034138] anotherpick
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:17:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 39 - commit descriptions in insn sheet are optional

# still have 3 known breakage(s)
# passed all remaining 36 test(s)
1..39
ok 6 - git cherry-pick: 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
		)
	
*** t3600-rm.sh ***
Submodule path 'sub1': checked out '0bb19bc669768d58723d7c38bcfd024bd815cd4c'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3600-rm/.git/
expecting success: touch -- foo bar baz 'space embedded' -q &&
     git add -- foo bar baz 'space embedded' -q &&
     git commit -m 'add normal files'
Cloning into 'submodule_update'...
[master (root-commit) afd08b3] add normal files
 Author: A U Thor <author@example.com>
 5 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 -q
 create mode 100644 bar
 create mode 100644 baz
 create mode 100644 foo
 create mode 100644 space embedded
ok 1 - Initialize test directory

expecting success: 
     git add -- 'tab	embedded' 'newline
embedded' &&
     git commit -m 'add files with tabs and newlines'

done.
ok 2 - git_revert: 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
		)
	
[master 7bd88f9] add files with tabs and newlines
 Author: A U Thor <author@example.com>
 2 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 "newline\nembedded"
 create mode 100644 "tab\tembedded"
ok 2 - add files with funny names

expecting success: [ -f foo ] && git ls-files --error-unmatch foo
foo
ok 3 - Pre-check that foo exists and is in index before git rm foo

expecting success: git rm --cached foo
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
rm 'foo'
ok 4 - Test that git rm foo succeeds

expecting success: echo content >foo &&
     git add foo &&
     git rm --cached foo
rm 'foo'
ok 5 - Test that git rm --cached foo succeeds if the index matches the file

expecting success: echo content >foo &&
     git add foo &&
     git commit -m foo &&
     echo "other content" >foo &&
     git rm --cached foo
Cloning into 'submodule_update'...
[master 0869436] foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
rm 'foo'
ok 6 - Test that git rm --cached foo succeeds if the index matches the file

expecting success: 
     echo content >foo &&
     git add foo &&
     git commit -m foo --allow-empty &&
     echo "other content" >foo &&
     git add foo &&
     echo "yet another content" >foo &&
     test_must_fail git rm --cached foo

done.
[master 972a418] foo
 Author: A U Thor <author@example.com>
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
error: the following file has staged content different from both the
file and the HEAD:
    foo
(use -f to force removal)
ok 7 - Test that git rm --cached foo fails if the index matches neither the file nor HEAD

expecting success: echo content >foo &&
     git add foo &&
     git commit -m foo --allow-empty &&
     echo "other content" >foo &&
     git add foo &&
     echo "yet another content" >foo &&
     git rm --cached -f foo
Successfully rebased and updated detached HEAD.
[master 1c4d095] foo
 Author: A U Thor <author@example.com>
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3512-cherry-pick-submodule/submodule_update_repo/.) registered for path 'sub1'
rm 'foo'
ok 8 - Test that git rm --cached -f foo works in case where --cached only did not

expecting success: [ -f foo ] && test_must_fail git ls-files --error-unmatch foo
--- expect.rev	2015-12-16 10:55:47.013564816 +0000
+++ actual.rev	2015-12-16 10:55:47.041564816 +0000
@@ -1 +1 @@
-ce450c7fd6766cb1f2df873857da7b928ff743a8
+060c4193c2500f886c89b8fa8d63916f8aa4d912
error: pathspec 'foo' did not match any file(s) known to git.
Did you forget to 'git add'?
ok 9 - Post-check that foo exists but is not in index after git rm foo

expecting success: [ -f bar ] && git ls-files --error-unmatch bar
bar
ok 10 - Pre-check that bar exists and is in index before "git rm bar"

expecting success: git rm bar
error: The following untracked working tree files would be overwritten by checkout:
	sub1
Please move or remove them before you can switch branches.
Aborting
rm 'bar'
ok 11 - Test that "git rm bar" succeeds

expecting success: ! [ -f bar ] && test_must_fail git ls-files --error-unmatch bar
ok 76 - rebase -p -f --root on linear history causes re-write

# still have 20 known breakage(s)
# passed all remaining 56 test(s)
1..76
error: pathspec 'bar' did not match any file(s) known to git.
Did you forget to 'git add'?
ok 12 - Post-check that bar does not exist and is not in index after "git rm -f bar"

expecting success: git rm -- -q
rm '-q'
ok 13 - Test that "git rm -- -q" succeeds (remove a file that looks like an option)

expecting success: git rm -f 'space embedded' 'tab	embedded' 'newline
embedded'
ok 3 - git_revert: 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
		)
	
rm 'newline
embedded'
rm 'space embedded'
rm 'tab	embedded'
ok 14 - Test that "git rm -f" succeeds with embedded space, tab, or newline characters.

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

)
Cloning into 'sub1'...
rm: cannot remove 'SANETESTD.1/x': Permission denied
prerequisite SANITY ok
expecting success: 
	chmod a-w . &&
	test_must_fail git rm -f baz &&
	chmod 775 .

fatal: git rm: 'baz': Permission denied
rm 'baz'
ok 15 - Test that "git rm -f" fails if its rm fails

expecting success: git ls-files --error-unmatch baz
*** t3700-add.sh ***
Cloning into 'submodule_update'...
baz
ok 16 - When the rm in "git rm -f" fails, it should not remove the file from the index

expecting success: 
	git rm --ignore-unmatch nonexistent

done.
ok 17 - Remove nonexistent file with --ignore-unmatch

expecting success: 
	echo frotz > test-file &&
	git add test-file &&
	git commit -m "add file for rm test" &&
	git rm test-file > rm-output &&
	test `grep "^rm " rm-output | wc -l` = 1 &&
	rm -f test-file rm-output &&
	git commit -m "remove file from rm test"

done.
[master 543f062] add file for rm test
 Author: A U Thor <author@example.com>
 7 files changed, 1 insertion(+), 1 deletion(-)
 delete mode 100644 -q
 delete mode 100644 bar
 delete mode 100644 foo
 delete mode 100644 "newline\nembedded"
 delete mode 100644 space embedded
 delete mode 100644 "tab\tembedded"
 create mode 100644 test-file
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3700-add/.git/
expecting success: touch foo && git add foo
Switched to a new branch 'replace_sub1_with_file'
ok 1 - Test of git add

expecting success: git ls-files foo | grep foo
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
[master 1953a01] remove file from rm test
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 test-file
ok 18 - "rm" command printed

expecting success: 
	echo frotz > test-file &&
	git add test-file &&
	git commit -m "add file for rm --quiet test" &&
	git rm --quiet test-file > rm-output &&
	test `wc -l < rm-output` = 0 &&
	rm -f test-file rm-output &&
	git commit -m "remove file from rm --quiet test"

foo
ok 2 - Post-check that foo is in the index

expecting success: touch -- -q && git add -- -q
t3513-revert-submodule.sh: 159: cd: can't cd to sub1
ok 3 - Test that "git add -- -q" works

expecting success: git config core.filemode 0 &&
	 echo foo >xfoo1 &&
	 chmod 755 xfoo1 &&
	 git add xfoo1 &&
	 case "`git ls-files --stage xfoo1`" in
	 100644" "*xfoo1) echo pass;;
	 *) echo fail; git ls-files --stage xfoo1; (exit 1);;
	 esac
[master beff0cc] add file for rm --quiet test
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 test-file
Submodule path 'sub1': checked out '57f6a203156c10b7060ff028d0d3e3aa4963c720'
Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
pass
ok 4 - git add: Test that executable bit is not used if core.filemode=0

[master ce5f9b9] remove file from rm --quiet test
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 test-file
expecting success: 
	rm -f xfoo1 &&
	test_ln_s_add foo xfoo1 &&
	case "`git ls-files --stage xfoo1`" in
	120000" "*xfoo1) echo pass;;
	*) echo fail; git ls-files --stage xfoo1; (exit 1);;
	esac

ok 19 - "rm" command suppressed with --quiet

expecting success: 
	git add foo baz &&
	git ls-files --error-unmatch foo baz

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

)
baz
foo
prerequisite SYMLINKS ok
Switched to branch 'replace_file_with_sub1'
ok 20 - Re-add foo and baz

expecting success: 
	echo >>foo &&
	test_must_fail git rm foo baz &&
	test -f foo &&
	test -f baz &&
	git ls-files --error-unmatch foo baz

Your branch is up-to-date with 'origin/replace_file_with_sub1'.
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
error: the following file has staged content different from both the
file and the HEAD:
    foo
(use -f to force removal)
baz
foo
ok 21 - Modify foo -- rm should refuse

expecting success: 
	git rm -f foo baz &&
	test ! -f foo &&
	test ! -f baz &&
	test_must_fail git ls-files --error-unmatch foo &&
	test_must_fail git ls-files --error-unmatch bar

pass
ok 5 - git add: filemode=0 should not get confused by symlink

expecting success: git config core.filemode 0 &&
	 echo foo >xfoo2 &&
	 chmod 755 xfoo2 &&
	 git update-index --add xfoo2 &&
	 case "`git ls-files --stage xfoo2`" in
	 100644" "*xfoo2) echo pass;;
	 *) echo fail; git ls-files --stage xfoo2; (exit 1);;
	 esac
rm 'baz'
rm 'foo'
[replace_file_with_sub1 20e4c02] Revert "Revert "Replace sub1 with file""
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
error: pathspec 'foo' did not match any file(s) known to git.
Did you forget to 'git add'?
error: pathspec 'bar' did not match any file(s) known to git.
Did you forget to 'git add'?
ok 22 - Modified foo -- rm -f should work

expecting success: 
	echo frotz >foo &&
	git checkout HEAD -- baz &&
	git add foo baz &&
	git ls-files --error-unmatch foo baz

pass
ok 6 - git update-index --add: Test that executable bit is not used...

expecting success: 
	rm -f xfoo2 &&
	test_ln_s_add foo xfoo2 &&
	case "`git ls-files --stage xfoo2`" in
	120000" "*xfoo2) echo pass;;
	*) echo fail; git ls-files --stage xfoo2; (exit 1);;
	esac

baz
foo
ok 23 - Re-add foo and baz for HEAD tests

expecting success: 
	test_must_fail git rm foo baz &&
	test -f foo &&
	test -f baz &&
	git ls-files --error-unmatch foo baz

Removing sub1
Removing .gitmodules
pass
ok 7 - git add: filemode=0 should not get confused by symlink

expecting success: git config core.filemode 0 &&
	 test_ln_s_add xfoo2 xfoo3 &&	# runs git update-index --add
	 case "`git ls-files --stage xfoo3`" in
	 120000" "*xfoo3) echo pass;;
	 *) echo fail; git ls-files --stage xfoo3; (exit 1);;
	 esac
error: the following file has changes staged in the index:
    foo
(use --cached to keep the file, or -f to force removal)
[add_sub1 aeca116] Revert "Add sub1"
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:55:35 2015 +0000
 1 file changed, 4 deletions(-)
 delete mode 100644 .gitmodules
baz
foo
ok 24 - foo is different in index from HEAD -- rm should refuse

expecting success: 
	git rm -f foo baz &&
	test ! -f foo &&
	test ! -f baz &&
	test_must_fail git ls-files --error-unmatch foo &&
	test_must_fail git ls-files --error-unmatch baz

[replace_file_with_sub1 ea643f5] Revert "Revert "Revert "Replace sub1 with file"""
 Author: A U Thor <author@example.com>
 2 files changed, 5 insertions(+), 1 deletion(-)
 mode change 100644 => 160000 sub1
rm 'baz'
rm 'foo'
pass
ok 8 - git update-index --add: Test that executable bit is not used...

expecting success: 
	echo "*.ig" >.gitignore &&
	mkdir c.if d.ig &&
	>a.ig && >b.if &&
	>c.if/c.if && >c.if/c.ig &&
	>d.ig/d.if && >d.ig/d.ig

error: pathspec 'foo' did not match any file(s) known to git.
Did you forget to 'git add'?
ok 9 - .gitignore test setup

expecting success: 
	git add . &&
	! (git ls-files | grep "\\.ig")

error: pathspec 'baz' did not match any file(s) known to git.
Did you forget to 'git add'?
ok 25 - but with -f it should work.

expecting success: 
	>empty &&
	git add empty &&
	echo content >empty &&
	test_must_fail git rm --cached empty

error: the following file has staged content different from both the
file and the HEAD:
    empty
(use -f to force removal)
ok 26 - refuse to remove cached empty file with modifications

expecting success: 
	echo content >intent-to-add &&
	git add -N intent-to-add &&
	git rm --cached intent-to-add

ok 10 - .gitignore is honored

expecting success: 
	test_must_fail git add a.?? &&
	! (git ls-files | grep "\\.ig")

The following paths are ignored by one of your .gitignore files:
a.ig
Use -f if you really want to add them.
rm 'intent-to-add'
ok 27 - remove intent-to-add file without --force

expecting success: 
	mkdir -p frotz &&
	echo qfwfq >frotz/nitfol &&
	git add frotz &&
	git commit -m "subdir test"

ok 11 - error out when attempting to add ignored ones without -f

expecting success: 
	test_must_fail git add d.?? &&
	! (git ls-files | grep "\\.ig")

The following paths are ignored by one of your .gitignore files:
d.ig
Use -f if you really want to add them.
ok 12 - error out when attempting to add ignored ones without -f

expecting success: 
	touch a.if &&
	test_must_fail git add a.?? &&
	! (git ls-files | grep "\\.ig") &&
	(git ls-files | grep a.if)

The following paths are ignored by one of your .gitignore files:
a.ig
Use -f if you really want to add them.
[master 9485eff] subdir test
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
 rename baz => empty (100%)
 create mode 100644 frotz/nitfol
ok 28 - Recursive test setup

expecting success: 
	test_must_fail git rm frotz &&
	test -d frotz &&
	test -f frotz/nitfol

ok 7 - git cherry-pick: 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
		)
	
fatal: not removing 'frotz' recursively without -r
ok 29 - Recursive without -r fails

expecting success: 
	echo qfwfq >>frotz/nitfol &&
	test_must_fail git rm -r frotz &&
	test -d frotz &&
	test -f frotz/nitfol

a.if
ok 13 - error out when attempting to add ignored ones but add others

expecting success: 
	git add -f a.?? &&
	git ls-files --error-unmatch a.ig

error: the following file has local modifications:
    frotz/nitfol
(use --cached to keep the file, or -f to force removal)
ok 30 - Recursive with -r but dirty

expecting success: 
	git rm -f -r frotz &&
	! test -f frotz/nitfol &&
	! test -d frotz

a.ig
ok 14 - add ignored ones with -f

expecting success: 
	git add -f d.??/* &&
	git ls-files --error-unmatch d.ig/d.if d.ig/d.ig

rm 'frotz/nitfol'
ok 31 - Recursive with -r -f

expecting success: 
	test_must_fail git rm nonexistent

fatal: pathspec 'nonexistent' did not match any files
ok 32 - Remove nonexistent file returns nonzero exit status

expecting success: 
	mkdir repo &&
	(cd repo &&
	 git init &&
	 echo something > somefile &&
	 git add somefile &&
	 git commit -m "add a file" &&
	 (cd .. &&
	  git --git-dir=repo/.git --work-tree=repo rm somefile) &&
	test_must_fail git ls-files --error-unmatch somefile)

d.ig/d.if
d.ig/d.ig
ok 15 - add ignored ones with -f

expecting success: 
	rm -f .git/index &&
	git add -f d.?? &&
	git ls-files --error-unmatch d.ig/d.if d.ig/d.ig

d.ig/d.if
d.ig/d.ig
ok 16 - add ignored ones with -f

expecting success: 

	rm -f .git/index &&
	mkdir -p sub/dir &&
	echo "!dir/a.*" >sub/.gitignore &&
	>sub/a.ig &&
	>sub/dir/a.ig &&
	git add sub/dir &&
	git ls-files --error-unmatch sub/dir/a.ig &&
	rm -f .git/index &&
	(
		cd sub/dir &&
		git add .
	) &&
	git ls-files --error-unmatch sub/dir/a.ig

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3600-rm/repo/.git/
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3513-revert-submodule/submodule_update_repo/.) registered for path 'sub1'
sub/dir/a.ig
[master (root-commit) 42e2206] add a file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 somefile
Cloning into 'submodule_update'...
rm 'somefile'
sub/dir/a.ig
ok 17 - .gitignore with subdirectory

error: pathspec 'somefile' did not match any file(s) known to git.
Did you forget to 'git add'?
ok 33 - Call "rm" from outside the work tree

expecting success: 

	git reset --hard &&
	test-chmtime -86400 frotz/nitfol &&
	git rm frotz/nitfol &&
	test ! -f frotz/nitfol


expecting success: 
	rm -f .git/index &&
	git add 1/2/a 1/3/b 1/2/c

ok 18 - check correct prefix detection

expecting success: 
	for s in 1 2 3
	do
		echo $s > stage$s
		echo "100755 $(git hash-object -w stage$s) $s	file"
		echo "120000 $(printf $s | git hash-object -w -t blob --stdin) $s	symlink"
	done | git update-index --index-info &&
	git config core.filemode 0 &&
	git config core.symlinks 0 &&
	echo new > file &&
	echo new > symlink &&
	git add file symlink &&
	git ls-files --stage | grep "^100755 .* 0	file$" &&
	git ls-files --stage | grep "^120000 .* 0	symlink$"

HEAD is now at 9485eff subdir test
done.
rm 'frotz/nitfol'
ok 34 - refresh index before checking if it is up-to-date

expecting success: 
	git reset -q --hard &&
	test_when_finished "rm -f .git/index.lock && git reset -q --hard" &&
	i=0 &&
	while test $i -lt 12000
	do
	    echo "100644 1234567890123456789012345678901234567890 0	some-file-$i"
	    i=$(( $i + 1 ))
	done | git update-index --index-info &&
	git rm -n "some-file-*" | : &&
	test_path_is_missing .git/index.lock

Cloning into 'sub1'...
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
done.
100755 3e757656cf36eca53338e520d134963a44f793f8 0	file
120000 3e757656cf36eca53338e520d134963a44f793f8 0	symlink
ok 19 - git add with filemode=0, symlinks=0, and unmerged entries

expecting success: 
	git rm --cached -f file symlink &&
	(
		echo "100644 $(git hash-object -w stage1) 1	file"
		echo "100755 $(git hash-object -w stage2) 2	file"
		echo "100644 $(printf 1 | git hash-object -w -t blob --stdin) 1	symlink"
		echo "120000 $(printf 2 | git hash-object -w -t blob --stdin) 2	symlink"
	) | git update-index --index-info &&
	git config core.filemode 0 &&
	git config core.symlinks 0 &&
	echo new > file &&
	echo new > symlink &&
	git add file symlink &&
	git ls-files --stage | grep "^100755 .* 0	file$" &&
	git ls-files --stage | grep "^120000 .* 0	symlink$"

rm 'file'
rm 'symlink'
Submodule path 'sub1': checked out '0bb19bc669768d58723d7c38bcfd024bd815cd4c'
100755 3e757656cf36eca53338e520d134963a44f793f8 0	file
120000 3e757656cf36eca53338e520d134963a44f793f8 0	symlink
ok 20 - git add with filemode=0, symlinks=0 prefers stage 2 over stage 1

expecting success: 
	>foo && git add foo && git commit -a -m "commit all" &&
	test -z "`git diff-index HEAD -- foo`" &&
	git read-tree HEAD &&
	case "`git diff-index HEAD -- foo`" in
	:100644" "*"M	foo") echo pass;;
	*) echo fail; (exit 1);;
	esac &&
	git add --refresh -- foo &&
	test -z "`git diff-index HEAD -- foo`"

[master (root-commit) 4fa5403] commit all
 Author: A U Thor <author@example.com>
 6 files changed, 2 insertions(+)
 create mode 100644 1/2/a
 create mode 100644 1/2/c
 create mode 100644 1/3/b
 create mode 100755 file
 create mode 100644 foo
 create mode 120000 symlink
pass
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3512-cherry-pick-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 4 - git_revert: replace tracked file with submodule creates empty directory

checking known breakage: 
		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
		)
	
ok 21 - git add --refresh

expecting success: 
	git reset --hard &&
	echo >foo && echo >bar && echo >baz &&
	git add foo bar baz && H=$(git rev-parse :foo) && git rm -f foo &&
	echo "100644 $H 3	foo" | git update-index --index-info &&
	test-chmtime -60 bar baz &&
	>expect &&
	git add --refresh bar >actual &&
	test_cmp expect actual &&

	git diff-files --name-only >actual &&
	! grep bar actual&&
	grep baz actual

HEAD is now at 4fa5403 commit all
rm 'foo'
Cloning into 'submodule_update'...
Cloning into 'sub1'...
done.
done.
baz
ok 22 - git add --refresh with pathspec

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

)
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.
rm: cannot remove 'SANETESTD.1/x': Permission denied
prerequisite SANITY ok
expecting success: 
	git reset --hard &&
	date >foo1 &&
	date >foo2 &&
	chmod 0 foo2 &&
	test_must_fail git add --verbose . &&
	! ( git ls-files foo1 | grep foo1 )

error: 8ed2e6719f8484ce01fa3ce133fe42d25c2441b8^{commit}: expected commit type, but the object dereferences to tree type
fatal: Needed a single revision
HEAD is now at 4fa5403 commit all
Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
error: open("foo2"): Permission denied
error: unable to index file foo2
fatal: adding files failed
add '-q'
add '.gitignore'
add 'a.if'
add 'actual'
add 'b.if'
add 'c.if/c.if'
add 'expect'
add 'foo1'
ok 23 - git add should fail atomically upon an unreadable file

Submodule path 'sub1': checked out '57f6a203156c10b7060ff028d0d3e3aa4963c720'
expecting success: 
	git reset --hard &&
	date >foo1 &&
	date >foo2 &&
	chmod 0 foo2 &&
	test_must_fail git add --verbose --ignore-errors . &&
	git ls-files foo1 | grep foo1

Switched to branch 'replace_directory_with_sub1'
Your branch is up-to-date with 'origin/replace_directory_with_sub1'.
HEAD is now at 4fa5403 commit all
Adding sub1/file3
Adding sub1/file2
Adding sub1/file1
Removing sub1
[replace_directory_with_sub1 c6d6823] Revert "Revert "Replace sub1 with directory""
 Author: A U Thor <author@example.com>
 4 files changed, 3 insertions(+), 4 deletions(-)
 create mode 100644 sub1/file1
 create mode 100644 sub1/file2
 create mode 100644 sub1/file3
error: open("foo2"): Permission denied
error: unable to index file foo2
add '-q'
add '.gitignore'
add 'a.if'
add 'actual'
add 'b.if'
add 'c.if/c.if'
add 'expect'
add 'foo1'
add 'stage1'
add 'stage2'
add 'stage3'
add 'sub/.gitignore'
add 'sub/dir/a.ig'
add 'xfoo1'
add 'xfoo2'
add 'xfoo3'
foo1
ok 24 - git add --ignore-errors

expecting success: 
	git config add.ignore-errors 1 &&
	git reset --hard &&
	date >foo1 &&
	date >foo2 &&
	chmod 0 foo2 &&
	test_must_fail git add --verbose . &&
	git ls-files foo1 | grep foo1

Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
error: refusing to lose untracked file at 'sub1/file2'
error: refusing to lose untracked file at 'sub1/file1'
Adding sub1/file3
Adding sub1/file2
Adding sub1/file1
Removing sub1
HEAD is now at 4fa5403 commit all
Removing sub1/file3
Removing sub1/file2
Removing sub1/file1
Adding sub1
[add_sub1 0fa322b] Replace sub1 with directory
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:55:37 2015 +0000
 4 files changed, 3 insertions(+), 4 deletions(-)
 create mode 100644 sub1/file1
 create mode 100644 sub1/file2
 create mode 100644 sub1/file3
test_must_fail: command succeeded: git cherry-pick replace_sub1_with_directory
error: open("foo2"): Permission denied
error: unable to index file foo2
add 'a.ig'
add 'c.if/c.ig'
add 'd.ig/d.if'
add 'd.ig/d.ig'
add 'foo1'
add 'sub/a.ig'
[replace_directory_with_sub1 58b29cc] Revert "Revert "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
foo1
ok 25 - git add (add.ignore-errors)

not ok 8 - git cherry-pick: 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
		)
	
expecting success: 
	git config add.ignore-errors 0 &&
	git reset --hard &&
	date >foo1 &&
	date >foo2 &&
	chmod 0 foo2 &&
	test_must_fail git add --verbose . &&
	! ( git ls-files foo1 | grep foo1 )

Directory sub1 doesn't exist. 
HEAD is now at 4fa5403 commit all
not ok 5 - git_revert: replace directory with submodule # TODO known breakage

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
		)
	
error: open("foo2"): Permission denied
error: unable to index file foo2
fatal: adding files failed
add 'foo1'
ok 26 - git add (add.ignore-errors = false)

expecting success: 
       git config add.ignore-errors 1 &&
       git reset --hard &&
       date >foo1 &&
       date >foo2 &&
       chmod 0 foo2 &&
       test_must_fail git add --verbose --no-ignore-errors . &&
       ! ( git ls-files foo1 | grep foo1 ) &&
       git config add.ignore-errors 0

Cloning into 'submodule_update'...
HEAD is now at 4fa5403 commit all
Cloning into 'submodule_update'...
error: open("foo2"): Permission denied
error: unable to index file foo2
fatal: adding files failed
add 'foo1'
done.
ok 27 - --no-ignore-errors overrides config

done.
expecting success: 
	git reset --hard &&
	touch fo\[ou\]bar foobar &&
	git add 'fo\[ou\]bar' &&
	git ls-files fo\[ou\]bar | fgrep fo\[ou\]bar &&
	! ( git ls-files foobar | grep foobar )

Switched to a new branch 'add_sub1'
HEAD is now at 4fa5403 commit all
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
fo[ou]bar
ok 28 - git add 'fo\[ou\]bar' ignores foobar

expecting success: 
	git reset --hard &&
	H=$(git rev-parse :1/2/a) &&
	(
		echo "100644 $H 1	track-this"
		echo "100644 $H 3	track-this"
	) | git update-index --index-info &&
	echo track-this >>.gitignore &&
	echo resolved >track-this &&
	git add track-this

HEAD is now at 4fa5403 commit all
ok 29 - git add to resolve conflicts on otherwise ignored path

expecting success: 
	test_must_fail git add non-existent &&
	! (git ls-files | grep "non-existent")

fatal: pathspec 'non-existent' did not match any files
ok 30 - "add non-existent" should fail

expecting success: 
	rm -fr empty &&
	git init empty &&
	(
		cd empty &&
		git add -A . &&
		git add -A
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3700-add/empty/.git/
ok 31 - git add -A on empty repo does not error out

expecting success: 
	rm -fr empty &&
	git init empty &&
	(
		cd empty &&
		git add .
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3700-add/empty/.git/
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3512-cherry-pick-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 32 - "git add ." in empty repo

expecting success: 
	echo new >>track-this &&
	git add --dry-run track-this >actual 2>&1 &&
	echo "add 'track-this'" | test_cmp - actual

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3513-revert-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 33 - git add --dry-run of existing changed file

expecting success: 
	echo ignored-file >>.gitignore &&
	test_must_fail git add --dry-run track-this ignored-file >actual 2>&1

ok 34 - git add --dry-run of non-existing file

expecting success: 
	echo "fatal: pathspec 'ignored-file' did not match any files" >expect &&
	test_i18ncmp expect actual

ok 35 - git add --dry-run of an existing file output

expecting success: 
	test_must_fail git add --dry-run --ignore-missing track-this ignored-file >actual.out 2>actual.err

ok 36 - git add --dry-run --ignore-missing of non-existing file

expecting success: 
	test_i18ncmp expect.out actual.out &&
	test_i18ncmp expect.err actual.err

ok 37 - git add --dry-run --ignore-missing of non-existing file output

# passed all 37 test(s)
1..37
Cloning into 'sub1'...
Cloning into 'sub1'...
*** t3701-add-interactive.sh ***
done.
done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3701-add-interactive/.git/
expecting success: 
	echo content >file &&
	git add file &&
	echo more >>file &&
	echo lines >>file

ok 1 - setup (initial)

expecting success: 
	git add -i </dev/null >output &&
	grep "+1/-0 *+2/-0 file" output

Submodule path 'sub1': checked out '57f6a203156c10b7060ff028d0d3e3aa4963c720'
Submodule path 'sub1': checked out '0bb19bc669768d58723d7c38bcfd024bd815cd4c'
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
warning: unable to rmdir sub1: Directory not empty
Switched to branch 'remove_sub1'
Your branch is up-to-date with 'origin/remove_sub1'.
error: refusing to lose untracked file at 'sub1/file2'
error: refusing to lose untracked file at 'sub1/file1'
Adding sub1/file3
Adding sub1/file2
Adding sub1/file1
Removing sub1
[remove_sub1 85d98c3] Revert "Revert "Add sub1""
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
[add_sub1 9eb1143] Replace sub1 with directory
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:55:37 2015 +0000
 4 files changed, 3 insertions(+), 4 deletions(-)
 create mode 100644 sub1/file1
 create mode 100644 sub1/file2
 create mode 100644 sub1/file3
test_must_fail: command succeeded: git cherry-pick replace_sub1_with_directory
not ok 9 - git cherry-pick: 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
		)
	
Removing sub1
Removing .gitmodules
[remove_sub1 8ed1132] Revert "Revert "Revert "Add sub1"""
 Author: A U Thor <author@example.com>
 1 file changed, 4 deletions(-)
 delete mode 100644 .gitmodules
Cloning into 'submodule_update'...
ok 6 - git_revert: 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
		)
	
  1:        +1/-0        +2/-0 file
ok 2 - status works (initial)

expecting success: 
cat >expected <<EOF
new file mode 100644
index 0000000..d95f3ad
--- /dev/null
+++ b/file
@@ -0,0 +1 @@
+content
EOF

done.
ok 3 - setup expected

expecting success: 
	(echo d; echo 1) | git add -i >output &&
	sed -ne "/new file/,/content/p" <output >diff &&
	test_cmp expected diff

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Cloning into 'submodule_update'...
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3512-cherry-pick-submodule/submodule_update_repo/.) registered for path 'sub1'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3513-revert-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'sub1'...
done.
Cloning into 'sub1'...
ok 4 - diff works (initial)

expecting success: 
	git add file &&
	(echo r; echo 1) | git add -i &&
	git ls-files >output &&
	! grep . output

done.
Submodule path 'sub1': checked out '57f6a203156c10b7060ff028d0d3e3aa4963c720'
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
[add_sub1 dd43fb8] Replace sub1 with file
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:55:37 2015 +0000
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
test_must_fail: command succeeded: git cherry-pick replace_sub1_with_file
Submodule path 'sub1': checked out '0bb19bc669768d58723d7c38bcfd024bd815cd4c'
not ok 10 - git cherry-pick: 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
		)
	
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
Cloning into 'submodule_update'...
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
warning: unable to rmdir sub1: Directory not empty
Switched to branch 'remove_sub1'
Your branch is up-to-date with 'origin/remove_sub1'.
[remove_sub1 e97db67] Revert "Revert "Add sub1""
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
           staged     unstaged path
  1:        +3/-0      nothing file

*** 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> Removing sub1
Removing .gitmodules
           staged     unstaged path
  1:        +3/-0      nothing [f]ile
Revert>>            staged     unstaged path
* 1:        +3/-0      nothing [f]ile
Revert>> 
[remove_sub1 80859e9] Revert "Revert "Revert "Add sub1"""
 Author: A U Thor <author@example.com>
 1 file changed, 4 deletions(-)
 delete mode 100644 .gitmodules
rm 'file'
reverted one path

*** 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.
ok 5 - revert works (initial)

expecting success: 
	echo baseline >file &&
	git add file &&
	git commit -m commit &&
	echo content >>file &&
	git add file &&
	echo more >>file &&
	echo lines >>file

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3512-cherry-pick-submodule/submodule_update_repo/.) registered for path 'sub1'
[master (root-commit) ee05f70] commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 6 - setup (commit)

expecting success: 
	git add -i </dev/null >output &&
	grep "+1/-0 *+2/-0 file" output

ok 7 - git_revert: 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
		)
	
Cloning into 'sub1'...
done.
Cloning into 'submodule_update'...
Submodule path 'sub1': checked out '57f6a203156c10b7060ff028d0d3e3aa4963c720'
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
[add_sub1 b3ec22d] Replace sub1 with file
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:55:37 2015 +0000
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
test_must_fail: command succeeded: git cherry-pick replace_sub1_with_file
  1:        +1/-0        +2/-0 file
ok 7 - status works (commit)

expecting success: 
cat >expected <<EOF
index 180b47c..b6f2c08 100644
--- a/file
+++ b/file
@@ -1 +1,2 @@
 baseline
+content
EOF

ok 8 - setup expected

expecting success: 
	(echo d; echo 1) | git add -i >output &&
	sed -ne "/^index/,/content/p" <output >diff &&
	test_cmp expected diff

not ok 11 - git cherry-pick: replace submodule containing a .git directory with a file must fail # TODO known breakage

checking known breakage: 
		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
		)
	
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3513-revert-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'submodule_update'...
Cloning into 'sub1'...
done.
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Submodule path 'sub1': checked out '0bb19bc669768d58723d7c38bcfd024bd815cd4c'
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3512-cherry-pick-submodule/submodule_update_repo/.) registered for path 'sub1'
error: The following untracked working tree files would be overwritten by checkout:
	sub1/file1
	sub1/file2
Please move or remove them before you can switch branches.
Aborting
ok 9 - diff works (commit)

expecting success: 
	git add file &&
	(echo r; echo 1) | git add -i &&
	git add -i </dev/null >output &&
	grep "unchanged *+3/-0 file" output

Cloning into 'sub1'...
ok 8 - git_revert: 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
		)
	
done.
Cloning into 'submodule_update'...
Submodule path 'sub1': checked out '57f6a203156c10b7060ff028d0d3e3aa4963c720'
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:

    git commit --allow-empty

Otherwise, please use 'git reset'
On branch add_sub1
Your branch is up-to-date with 'origin/add_sub1'.
You are currently cherry-picking commit ba7b358.

Changes to be committed:
	modified:   sub1

not ok 12 - git cherry-pick: modified submodule does not update submodule work tree # TODO known breakage

checking known breakage: 
		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
		)
	
           staged     unstaged path
  1:        +3/-0      nothing file

*** 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
Cloning into 'submodule_update'...
What now>            staged     unstaged path
  1:        +3/-0      nothing [f]ile
Revert>>            staged     unstaged path
* 1:        +3/-0      nothing [f]ile
Revert>> 
reverted one path

*** 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.
done.
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3513-revert-submodule/submodule_update_repo/.) registered for path 'sub1'
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Cloning into 'sub1'...
done.
ok 35 - choking "git rm" should not let it die with cruft

expecting success: 
	mkdir -p dir/subdir/subsubdir &&
	echo content >dir/subdir/subsubdir/file &&
	git add dir/subdir/subsubdir/file &&
	git rm -f dir/subdir/subsubdir/file &&
	! test -d dir

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3512-cherry-pick-submodule/submodule_update_repo/.) registered for path 'sub1'
Submodule path 'sub1': checked out '0bb19bc669768d58723d7c38bcfd024bd815cd4c'
rm 'dir/subdir/subsubdir/file'
ok 36 - rm removes subdirectories recursively

expecting success: 
	mkdir submod &&
	git update-index --add --cacheinfo 160000 $(git rev-parse HEAD) submod &&
	git config -f .gitmodules submodule.sub.url ./. &&
	git config -f .gitmodules submodule.sub.path submod &&
	git submodule init &&
	git add .gitmodules &&
	git commit -m "add submodule" &&
	git rm submod &&
	test ! -e submod &&
	git status -s -uno --ignore-submodules=none > actual &&
	test_cmp expect actual &&
	test_must_fail git config -f .gitmodules submodule.sub.url &&
	test_must_fail git config -f .gitmodules submodule.sub.path

Cloning into 'sub1'...
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
  1:    unchanged        +3/-0 file
ok 10 - revert works (commit)

expecting success: 
cat >expected <<EOF
EOF

done.
ok 11 - setup expected

expecting success: 
	>fake_editor.sh &&
	chmod a+x fake_editor.sh &&
	test_set_editor "$(pwd)/fake_editor.sh"

ok 12 - setup fake editor

expecting success: 
	(echo e; echo a) | git add -p &&
	git diff > diff &&
	test_cmp expected diff

error: The following untracked working tree files would be overwritten by checkout:
	sub1/file1
	sub1/file2
Please move or remove them before you can switch branches.
Aborting
Submodule path 'sub1': checked out '57f6a203156c10b7060ff028d0d3e3aa4963c720'
Submodule 'sub' (/«PKGBUILDDIR»/t/trash directory.t3600-rm/.) registered for path 'submod'
[master 1695754] add submodule
 Author: A U Thor <author@example.com>
 2 files changed, 4 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 submod
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
rm 'submod'
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:

    git commit --allow-empty

Otherwise, please use 'git reset'
On branch add_sub1
Your branch is up-to-date with 'origin/add_sub1'.
You are currently cherry-picking commit 09415f0.

Changes to be committed:
	modified:   sub1

ok 37 - rm removes empty submodules from work tree

expecting success: 
	git reset --hard &&
	git submodule update &&
	rm -rf submod &&
	git rm submod &&
	git status -s -uno --ignore-submodules=none > actual &&
	test_cmp expect actual &&
	test_must_fail git config -f .gitmodules submodule.sub.url &&
	test_must_fail git config -f .gitmodules submodule.sub.path

ok 9 - git_revert: 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
		)
	
not ok 13 - git cherry-pick: modified submodule does not update submodule work tree to invalid commit # TODO known breakage

checking known breakage: 
		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
		)
	
HEAD is now at 1695754 add submodule
Cloning into 'submodule_update'...
Cloning into 'submodule_update'...
done.
done.
Cloning into 'submod'...
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
diff --git a/file b/file
index 180b47c..f910ae9 100644
--- a/file
+++ b/file
@@ -1 +1,4 @@
 baseline
+content
+more
+lines
Switched to a new branch 'invalid_sub1'
Stage this hunk [y,n,q,a,d,/,e,?]? Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
done.
fatal: Needed a single revision
Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:

    git commit --allow-empty

Otherwise, please use 'git reset'
On branch invalid_sub1
Your branch is up-to-date with 'origin/invalid_sub1'.
You are currently cherry-picking commit 083d433.

Changes to be committed:
	modified:   sub1


not ok 14 - git cherry-pick: modified submodule does not update submodule work tree from invalid commit # TODO known breakage

ok 13 - dummy edit works

expecting success: 
cat >patch <<EOF
@@ -1,1 +1,4 @@
 this
+patch
-does not
 apply
EOF

ok 14 - setup patch

expecting success: 
	echo "#!$SHELL_PATH" >fake_editor.sh &&
	cat >>fake_editor.sh <<\EOF &&
mv -f "$1" oldpatch &&
mv -f patch "$1"
EOF
	chmod a+x fake_editor.sh &&
	test_set_editor "$(pwd)/fake_editor.sh"

# still have 8 known breakage(s)
# passed all remaining 6 test(s)
1..14
Submodule path 'submod': checked out '9485eff4ef4a8297ed1ff19aa3d53200258359eb'
ok 15 - setup fake editor

expecting success: 
	git reset &&
	(echo e; echo n; echo d) | git add -p >output &&
	grep "hunk does not apply" output

rm 'submod'
Unstaged changes after reset:
M	file
ok 38 - rm removes removed submodule from index and .gitmodules

expecting success: 
	git reset --hard &&
	git submodule update &&
	git rm submod &&
	test ! -d submod &&
	git status -s -uno --ignore-submodules=none > actual &&
	test_cmp expect actual &&
	test_must_fail git config -f .gitmodules submodule.sub.url &&
	test_must_fail git config -f .gitmodules submodule.sub.path

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3513-revert-submodule/submodule_update_repo/.) registered for path 'sub1'
HEAD is now at 1695754 add submodule
*** t3702-add-edit.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3702-add-edit/.git/
Cloning into 'sub1'...
expecting success: 

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


done.
[master (root-commit) e055285] initial
 Author: A U Thor <author@example.com>
 1 file changed, 11 insertions(+)
 create mode 100644 file
ok 1 - setup

expecting success: 

	cp second-part file &&
	git add -e &&
	test_cmp second-part file &&
	test_cmp orig-patch expected-patch &&
	git diff --cached > out &&
	test_cmp out expected


ok 2 - add -e

expecting success: 
	git reset --hard &&
	echo change >>file &&
	test_must_fail env GIT_EDITOR=false git add -e &&
	test_expect_code 1 git diff --exit-code

HEAD is now at e055285 initial
error: There was a problem with the editor 'false'.
fatal: editing patch failed
Submodule path 'sub1': checked out '0bb19bc669768d58723d7c38bcfd024bd815cd4c'
diff --git a/file b/file
index b9834b5..cce9ee2 100644
--- a/file
+++ b/file
@@ -9,3 +9,4 @@ for he waxed under welkin, in wealth he throve,
 till before him the folk, both far and near,
 who house by the whale-path, heard his mandate,
 gave him gifts:  a good king he!
+change
ok 3 - add -e notices editor failure

Submodule path 'submod': checked out '9485eff4ef4a8297ed1ff19aa3d53200258359eb'
# passed all 3 test(s)
1..3
*** t3703-add-magic-pathspec.sh ***
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
Switched to branch 'replace_sub1_with_file'
Your branch is up-to-date with 'origin/replace_sub1_with_file'.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3703-add-magic-pathspec/.git/
expecting success: 
	mkdir sub anothersub &&
	: >sub/foo &&
	: >anothersub/foo

ok 1 - setup

expecting success: 
	cat >expected <<-EOF &&
	add 'anothersub/foo'
	add 'expected'
	add 'sub/actual'
	add 'sub/foo'
	EOF
	(cd sub && git add -n :/ >actual) &&
	test_cmp expected sub/actual

[replace_sub1_with_file 7360caa] Revert "Replace sub1 with file"
 Author: A U Thor <author@example.com>
 2 files changed, 5 insertions(+), 1 deletion(-)
 mode change 100644 => 160000 sub1
rm 'submod'
error: patch failed: file:1
error: file: patch does not apply
ok 2 - add :/

expecting success: 
	(cd sub && git add -n :/anothersub >actual) &&
	test_cmp expected sub/actual

Stage this hunk [y,n,q,a,d,/,e,?]? Your edited hunk does not apply. Edit again (saying "no" discards!) [y/n]? @@ -1 +1,4 @@
ok 16 - bad edit rejected

expecting success: 
cat >patch <<EOF
this patch
is garbage
EOF

ok 17 - setup patch

expecting success: 
	git reset &&
	(echo e; echo n; echo d) | git add -p >output &&
	grep "hunk does not apply" output

ok 39 - rm removes work tree of unmodified submodules

ok 3 - add :/anothersub

expecting success: 
	git reset --hard &&
	git submodule update &&
	git rm submod/ &&
	test ! -d submod &&
	git status -s -uno --ignore-submodules=none > actual &&
	test_cmp expect actual

expecting success: 
	(cd sub && test_must_fail git add -n :/non-existent)

Unstaged changes after reset:
M	file
fatal: pathspec ':/non-existent' did not match any files
ok 4 - add :/non-existent

HEAD is now at 1695754 add submodule
expecting success: 
	: >":(icase)ha" &&
	test_must_fail git add -n ":(icase)ha" &&
	git add -n "./:(icase)ha"

fatal: pathspec ':(icase)ha' did not match any files
[replace_sub1_with_file 52c92ca] Revert "Revert "Replace sub1 with file""
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
test_must_fail: command succeeded: git_revert replace_sub1_with_file
add ':(icase)ha'
ok 5 - a file with the same (long) magic name exists

expecting success: 
	: >":/bar" &&
	test_must_fail git add -n :/bar &&
	git add -n "./:/bar"

fatal: pathspec ':/bar' did not match any files
not ok 10 - git_revert: 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
		)
	
add ':/bar'
ok 6 - a file with the same (short) magic name exists

# passed all 6 test(s)
1..6
*** t3800-mktag.sh ***
Cloning into 'submodule_update'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3800-mktag/.git/
expecting success: 
	echo Hello >A &&
	git update-index --add A &&
	git commit -m "Initial commit" &&
	head=$(git rev-parse --verify HEAD)

done.
[master (root-commit) 14b8edb] Initial commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 A
ok 1 - setup

expecting success: 
		( test_must_fail git mktag <tag.sig 2>message ) &&
		grep "$expect" message
	
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
error: wanna fool me ? you obviously got the size wrong !
ok 2 - Tag object length check

expecting success: 
		( test_must_fail git mktag <tag.sig 2>message ) &&
		grep "$expect" message
	
error: char0: does not start with "object "
ok 3 - "object" line label check

expecting success: 
		( test_must_fail git mktag <tag.sig 2>message ) &&
		grep "$expect" message
	
error: char7: could not get SHA1 hash
ok 4 - "object" line SHA1 check

expecting success: 
		( test_must_fail git mktag <tag.sig 2>message ) &&
		grep "$expect" message
	
Submodule path 'submod': checked out '9485eff4ef4a8297ed1ff19aa3d53200258359eb'
error: char47: could not find "\ntype "
ok 5 - "type" line label check

expecting success: 
		( test_must_fail git mktag <tag.sig 2>message ) &&
		grep "$expect" message
	
error: char48: could not find next "\n"
ok 6 - "type" line eol check

expecting success: 
		( test_must_fail git mktag <tag.sig 2>message ) &&
		grep "$expect" message
	
error: char57: no "tag " found
ok 7 - "tag" line label check #1

expecting success: 
		( test_must_fail git mktag <tag.sig 2>message ) &&
		grep "$expect" message
	
error: char87: no "tag " found
ok 8 - "tag" line label check #2

expecting success: 
		( test_must_fail git mktag <tag.sig 2>message ) &&
		grep "$expect" message
	
error: char53: type too long
ok 9 - "type" line type-name length check

expecting success: 
		( test_must_fail git mktag <tag.sig 2>message ) &&
		grep "$expect" message
	
rm 'submod'
error: char7: could not verify object 779e9b33986b1c2670fff52c5067603117b3e895
ok 10 - verify object (SHA1/type) check

expecting success: 
		( test_must_fail git mktag <tag.sig 2>message ) &&
		grep "$expect" message
	
ok 40 - rm removes a submodule with a trailing /

expecting success: 
	test_must_fail git rm empty/

error: char67: could not verify tag name
ok 11 - verify tag-name check

fatal: pathspec 'empty/' did not match any files
ok 41 - rm fails when given a file with a trailing /

expecting success: 
	git rm -r frotz/

expecting success: 
		( test_must_fail git mktag <tag.sig 2>message ) &&
		grep "$expect" message
	
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3513-revert-submodule/submodule_update_repo/.) registered for path 'sub1'
rm 'frotz/nitfol'
ok 42 - rm succeeds when given a directory with a trailing /

expecting success: 
	git reset --hard &&
	git submodule update &&
	(cd submod &&
		git checkout HEAD^
	) &&
	test_must_fail git rm submod &&
	test -d submod &&
	test -f submod/.git &&
	git status -s -uno --ignore-submodules=none > actual &&
	test_cmp expect.modified actual &&
	git rm -f submod &&
	test ! -d submod &&
	git status -s -uno --ignore-submodules=none > actual &&
	test_cmp expect actual &&
	test_must_fail git config -f .gitmodules submodule.sub.url &&
	test_must_fail git config -f .gitmodules submodule.sub.path

error: char70: could not find "tagger "
ok 12 - "tagger" line label check #1

expecting success: 
		( test_must_fail git mktag <tag.sig 2>message ) &&
		grep "$expect" message
	
HEAD is now at 1695754 add submodule
error: char70: could not find "tagger "
ok 13 - "tagger" line label check #2

expecting success: 
		( test_must_fail git mktag <tag.sig 2>message ) &&
		grep "$expect" message
	
error: char77: missing tagger name
ok 14 - disallow missing tag author name

expecting success: 
		( test_must_fail git mktag <tag.sig 2>message ) &&
		grep "$expect" message
	
warning: recount: unexpected line: this patch

fatal: corrupt patch at line 6
error: char77: malformed tagger field
Stage this hunk [y,n,q,a,d,/,e,?]? Your edited hunk does not apply. Edit again (saying "no" discards!) [y/n]? @@ -1 +1,4 @@
ok 15 - disallow malformed tagger

ok 18 - garbage edit rejected

expecting success: 
cat >patch <<EOF
@@ -1,0 +1,0 @@
 baseline
+content
+newcontent
+lines
EOF

expecting success: git mktag <tag.sig >.git/refs/tags/mytag 2>message
ok 19 - setup patch

expecting success: 
cat >expected <<EOF
diff --git a/file b/file
index b5dd6c9..f910ae9 100644
--- a/file
+++ b/file
@@ -1,4 +1,4 @@
 baseline
 content
-newcontent
+more
 lines
EOF

ok 16 - allow empty tag email

Cloning into 'sub1'...
ok 20 - setup expected

expecting success: 
	(echo e; echo n; echo d) | git add -p &&
	git diff >output &&
	test_cmp expected output

expecting success: 
		( test_must_fail git mktag <tag.sig 2>message ) &&
		grep "$expect" message
	
error: char77: malformed tagger field
ok 17 - disallow spaces in tag email

done.
expecting success: 
		( test_must_fail git mktag <tag.sig 2>message ) &&
		grep "$expect" message
	
error: char107: missing tag timestamp
ok 18 - disallow missing tag timestamp

expecting success: 
		( test_must_fail git mktag <tag.sig 2>message ) &&
		grep "$expect" message
	
error: char107: missing tag timestamp
ok 19 - detect invalid tag timestamp1

expecting success: 
		( test_must_fail git mktag <tag.sig 2>message ) &&
		grep "$expect" message
	
error: char111: malformed tag timestamp
ok 20 - detect invalid tag timestamp2

expecting success: 
		( test_must_fail git mktag <tag.sig 2>message ) &&
		grep "$expect" message
	
error: char118: malformed tag timezone
ok 21 - detect invalid tag timezone1

expecting success: 
		( test_must_fail git mktag <tag.sig 2>message ) &&
		grep "$expect" message
	
error: char118: malformed tag timezone
ok 22 - detect invalid tag timezone2

Submodule path 'submod': checked out '9485eff4ef4a8297ed1ff19aa3d53200258359eb'
expecting success: 
		( test_must_fail git mktag <tag.sig 2>message ) &&
		grep "$expect" message
	
Submodule path 'sub1': checked out '0bb19bc669768d58723d7c38bcfd024bd815cd4c'
Previous HEAD position was 9485eff... subdir test
HEAD is now at ce5f9b9... remove file from rm --quiet test
error: char118: malformed tag timezone
ok 23 - detect invalid tag timezone3

expecting success: 
		( test_must_fail git mktag <tag.sig 2>message ) &&
		grep "$expect" message
	
error: char124: trailing garbage in tag header
ok 24 - detect invalid header entry

expecting success: git mktag <tag.sig >.git/refs/tags/mytag 2>message
ok 25 - create valid tag

expecting success: git tag -l | grep mytag
mytag
ok 26 - check mytag

Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
# passed all 26 test(s)
1..26
*** t3900-i18n-commit.sh ***
error: the following file has local modifications:
    submod
(use --cached to keep the file, or -f to force removal)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3900-i18n-commit/.git/
expecting success: 
	: >F &&
	git add F &&
	T=$(git write-tree) &&
	C=$(git commit-tree $T <"$TEST_DIRECTORY"/t3900/1-UTF-8.txt) &&
	git update-ref HEAD $C &&
	git tag C0

Switched to branch 'replace_sub1_with_file'
Your branch is up-to-date with 'origin/replace_sub1_with_file'.
diff --git a/file b/file
index 180b47c..f910ae9 100644
--- a/file
+++ b/file
@@ -1 +1,4 @@
 baseline
+content
+more
+lines
Stage this hunk [y,n,q,a,d,/,e,?]? ok 1 - setup

expecting success: 
	E=$(git cat-file commit C0 | sed -ne "s/^encoding //p") &&
	test z = "z$E"

ok 2 - no encoding header for base case

expecting success: 
	echo UTF-16 >F &&
	test_must_fail git commit -a -F "$TEST_DIRECTORY"/t3900/UTF-16.txt

[replace_sub1_with_file afc167c] Revert "Replace sub1 with file"
 Author: A U Thor <author@example.com>
 2 files changed, 5 insertions(+), 1 deletion(-)
 mode change 100644 => 160000 sub1
rm 'submod'
error: a NUL byte in commit log message not allowed.
fatal: failed to write commit object
ok 3 - UTF-16 refused because of NULs

expecting success: 
	test_when_finished "rm -f $HOME/stderr $HOME/invalid" &&
	echo "UTF-8 characters" >F &&
	printf "Commit message\n\nInvalid surrogate:\355\240\200\n" \
		>"$HOME/invalid" &&
	git commit -a -F "$HOME/invalid" 2>"$HOME"/stderr &&
	grep "did not conform" "$HOME"/stderr


[master a7735cf] Commit message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Warning: commit message did not conform to UTF-8.
ok 21 - real edit works

expecting success: 
	git reset &&
	echo file >.gitignore &&
	echo changed >file &&
	echo y | git add -p file &&
	git diff >output &&
	git reset &&
	git commit -am commit &&
	git diff >expected &&
	test_cmp expected output &&
	git reset --hard HEAD^

ok 43 - rm of a populated submodule with different HEAD fails unless forced

expecting success: 
	git reset --hard &&
	git submodule update &&
	git rm --cached submod &&
	test -d submod &&
	test -f submod/.git &&
	git status -s -uno >actual &&
	test_cmp expect.cached actual &&
	git config -f .gitmodules submodule.sub.url &&
	git config -f .gitmodules submodule.sub.path

ok 4 - UTF-8 invalid characters refused

expecting success: 
	test_when_finished "rm -f $HOME/stderr $HOME/invalid" &&
	rm -f "$HOME/stderr" "$HOME/invalid" &&
	echo "UTF-8 overlong" >F &&
	printf "\340\202\251ommit message\n\nThis is not a space:\300\240\n" \
		>"$HOME/invalid" &&
	git commit -a -F "$HOME/invalid" 2>"$HOME"/stderr &&
	grep "did not conform" "$HOME"/stderr

Unstaged changes after reset:
M	file
HEAD is now at 1695754 add submodule
[master 013969a] à‚©ommit message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Warning: commit message did not conform to UTF-8.
ok 5 - UTF-8 overlong sequences rejected

expecting success: 
	test_when_finished "rm -f $HOME/stderr $HOME/invalid" &&
	echo "UTF-8 non-character 1" >F &&
	printf "Commit message\n\nNon-character:\364\217\277\276\n" \
		>"$HOME/invalid" &&
	git commit -a -F "$HOME/invalid" 2>"$HOME"/stderr &&
	grep "did not conform" "$HOME"/stderr

[master a473097] Commit message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Warning: commit message did not conform to UTF-8.
ok 6 - UTF-8 non-characters refused

expecting success: 
	test_when_finished "rm -f $HOME/stderr $HOME/invalid" &&
	echo "UTF-8 non-character 2." >F &&
	printf "Commit message\n\nNon-character:\357\267\220\n" \
		>"$HOME/invalid" &&
	git commit -a -F "$HOME/invalid" 2>"$HOME"/stderr &&
	grep "did not conform" "$HOME"/stderr

[replace_sub1_with_file 551f765] Revert "Revert "Replace sub1 with file""
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
test_must_fail: command succeeded: git_revert replace_sub1_with_file
not ok 11 - git_revert: replace submodule containing a .git directory with a file must fail # TODO known breakage

checking known breakage: 
		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
		)
	
[master 5e7fb2c] Commit message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Warning: commit message did not conform to UTF-8.
ok 7 - UTF-8 non-characters refused

expecting success: 
		git config i18n.commitencoding $H &&
		git checkout -b $H C0 &&
		echo $H >F &&
		git commit -a -F "$TEST_DIRECTORY"/t3900/$H.txt
	
Switched to a new branch 'ISO8859-1'
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 8 - ISO8859-1 setup

expecting success: 
		git config i18n.commitencoding $H &&
		git checkout -b $H C0 &&
		echo $H >F &&
		git commit -a -F "$TEST_DIRECTORY"/t3900/$H.txt
	
Cloning into 'submodule_update'...
Switched to a new branch 'eucJP'
done.
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 9 - eucJP setup

expecting success: 
		git config i18n.commitencoding $H &&
		git checkout -b $H C0 &&
		echo $H >F &&
		git commit -a -F "$TEST_DIRECTORY"/t3900/$H.txt
	
Switched to a new branch 'ISO-2022-JP'
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Submodule path 'submod': checked out '9485eff4ef4a8297ed1ff19aa3d53200258359eb'
[ISO-2022-JP 77e161f] $B$O$l$R$[$U(B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 10 - ISO-2022-JP setup

expecting success: 
		E=$(git cat-file commit ISO8859-1 | sed -ne "s/^encoding //p") &&
		test "z$E" = "zISO8859-1"
	
ok 11 - check encoding header for ISO8859-1

expecting success: 
		E=$(git cat-file commit eucJP | sed -ne "s/^encoding //p") &&
		test "z$E" = "zeucJP"
	
ok 12 - check encoding header for eucJP

expecting success: 
		E=$(git cat-file commit ISO-2022-JP | sed -ne "s/^encoding //p") &&
		test "z$E" = "zISO-2022-JP"
	
ok 13 - check encoding header for ISO-2022-JP

expecting success: 
	git config --unset-all i18n.commitencoding &&
	if Z=$(git config --get-all i18n.commitencoding)
	then
		echo Oops, should have failed.
		false
	else
		test z = "z$Z"
	fi &&
	git config i18n.commitencoding UTF-8

ok 14 - config to remove customization

expecting success: 
	compare_with ISO8859-1 "$TEST_DIRECTORY"/t3900/1-UTF-8.txt

ok 15 - ISO8859-1 should be shown in UTF-8 now

expecting success: 
		compare_with eucJP "$TEST_DIRECTORY"/t3900/2-UTF-8.txt
	
rm 'submod'
ok 16 - eucJP should be shown in UTF-8 now

expecting success: 
		compare_with ISO-2022-JP "$TEST_DIRECTORY"/t3900/2-UTF-8.txt
	
./.
submod
ok 17 - ISO-2022-JP should be shown in UTF-8 now

expecting success: 
	git config --unset-all i18n.commitencoding &&
	if Z=$(git config --get-all i18n.commitencoding)
	then
		echo Oops, should have failed.
		false
	else
		test z = "z$Z"
	fi

ok 44 - rm --cached leaves work tree of populated submodules and .gitmodules alone

expecting success: 
	git reset --hard &&
	git submodule update &&
	git rm -n submod &&
	test -f submod/.git &&
	git diff-index --exit-code HEAD

HEAD is now at 1695754 add submodule
ok 18 - config to add customization

expecting success: 
		git config i18n.commitencoding ISO8859-1 &&
		compare_with ISO8859-1 "$TEST_DIRECTORY"/t3900/ISO8859-1.txt
	
ok 19 - ISO8859-1 should be shown in itself now

expecting success: 
		git config i18n.commitencoding eucJP &&
		compare_with eucJP "$TEST_DIRECTORY"/t3900/eucJP.txt
	
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3513-revert-submodule/submodule_update_repo/.) registered for path 'sub1'
diff --git a/file b/file
index 180b47c..5ea2ed4 100644
--- a/file
+++ b/file
@@ -1 +1 @@
-baseline
+changed
Stage this hunk [y,n,q,a,d,/,e,?]? 
ok 20 - eucJP should be shown in itself now

expecting success: 
		git config i18n.commitencoding ISO-2022-JP &&
		compare_with ISO-2022-JP "$TEST_DIRECTORY"/t3900/ISO-2022-JP.txt
	
ok 21 - ISO-2022-JP should be shown in itself now

expecting success: 
	git config i18n.logoutputencoding UTF-8

Unstaged changes after reset:
M	file
ok 22 - config to tweak customization

expecting success: 
	compare_with ISO8859-1 "$TEST_DIRECTORY"/t3900/1-UTF-8.txt

[master 7bdb1be] commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 23 - ISO8859-1 should be shown in UTF-8 now

expecting success: 
		compare_with eucJP "$TEST_DIRECTORY"/t3900/2-UTF-8.txt
	
Cloning into 'sub1'...
ok 24 - eucJP should be shown in UTF-8 now

expecting success: 
		compare_with ISO-2022-JP "$TEST_DIRECTORY"/t3900/2-UTF-8.txt
	
HEAD is now at ee05f70 commit
ok 22 - skip files similarly as commit -a

checking prerequisite: FILEMODE

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	test "$(git config --bool core.filemode)" = true

)
ok 25 - ISO-2022-JP should be shown in UTF-8 now

expecting success: 
			compare_with eucJP "$TEST_DIRECTORY"/t3900/eucJP.txt $ICONV
		
prerequisite FILEMODE ok
expecting success: 
	git reset --hard &&
	echo content >>file &&
	chmod +x file &&
	printf "n\\ny\\n" | git add -p &&
	git show :file | grep content &&
	git diff file | grep "new mode"

ok 26 - eucJP should be shown in eucJP now

expecting success: 
			compare_with ISO-2022-JP "$TEST_DIRECTORY"/t3900/eucJP.txt $ICONV
		
done.
HEAD is now at ee05f70 commit
ok 27 - ISO-2022-JP should be shown in eucJP now

expecting success: 
			compare_with eucJP "$TEST_DIRECTORY"/t3900/ISO-2022-JP.txt $ICONV
		
ok 28 - eucJP should be shown in ISO-2022-JP now

expecting success: 
			compare_with ISO-2022-JP "$TEST_DIRECTORY"/t3900/ISO-2022-JP.txt $ICONV
		
rm 'submod'
ok 29 - ISO-2022-JP should be shown in ISO-2022-JP now

expecting success: 
		compare_with "--encoding=none ISO8859-1" "$TEST_DIRECTORY"/t3900/ISO8859-1.txt
	
ok 45 - rm --dry-run does not touch the submodule or .gitmodules

expecting success: 
	git reset --hard &&
	git submodule update &&
	git rm .gitmodules &&
	git rm submod >actual 2>actual.err &&
	! test -s actual.err &&
	! test -d submod &&
	! test -f submod/.git &&
	git status -s -uno >actual &&
	test_cmp expect.both_deleted actual

HEAD is now at 1695754 add submodule
ok 30 - No conversion with ISO8859-1

Submodule path 'sub1': checked out '0bb19bc669768d58723d7c38bcfd024bd815cd4c'
expecting success: 
		compare_with "--encoding=none eucJP" "$TEST_DIRECTORY"/t3900/eucJP.txt
	
ok 31 - No conversion with eucJP

expecting success: 
		compare_with "--encoding=none ISO-2022-JP" "$TEST_DIRECTORY"/t3900/ISO-2022-JP.txt
	
ok 32 - No conversion with ISO-2022-JP

expecting success: 
		git config i18n.commitencoding $H &&
		git checkout -b $H-$flag C0 &&
		echo $H >>F &&
		git commit -a -F "$TEST_DIRECTORY"/t3900/$H.txt &&
		test_tick &&
		echo intermediate stuff >>G &&
		git add G &&
		git commit -a -m "intermediate commit" &&
		test_tick &&
		echo $H $flag >>F &&
		git commit -a --$flag HEAD~1 &&
		E=$(git cat-file commit eucJP-fixup |
			sed -ne "s/^encoding //p") &&
		test "z$E" = "z$H" &&
		git config --unset-all i18n.commitencoding &&
		git rebase --autosquash -i HEAD^^^ &&
		git log --oneline >actual &&
		test_line_count = 3 actual
	
Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
Switched to a new branch 'eucJP-fixup'
[eucJP-fixup 1e74231] $B$O$l$R$[$U(B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Switched to branch 'modify_sub1'
Your branch is up-to-date with 'origin/modify_sub1'.
[eucJP-fixup ec100b6] intermediate commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 G
On branch modify_sub1
Your branch is up-to-date with 'origin/modify_sub1'.
Changes to be committed:
	modified:   sub1

[eucJP-fixup 5ba43ca] fixup! $B$O$l$R$[$U(B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
not ok 12 - git_revert: modified submodule does not update submodule work tree # TODO known breakage

checking known breakage: 
		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
		)
	
rm '.gitmodules'
Cloning into 'submodule_update'...
done.
diff --git a/file b/file
index 180b47c..b6f2c08
--- a/file
+++ b/file
old mode 100644
new mode 100755
Stage mode change [y,n,q,a,d,/,j,J,g,?]? @@ -1 +1,2 @@
 baseline
+content
Stage this hunk [y,n,q,a,d,/,K,g,e,?]? 
ok 46 - rm does not complain when no .gitmodules file is found

expecting success: 
	git reset --hard &&
	git submodule update &&
	git config -f .gitmodules foo.bar true &&
	test_must_fail git rm submod >actual 2>actual.err &&
	test -s actual.err &&
	test -d submod &&
	test -f submod/.git &&
	git diff-files --quiet -- submod &&
	git add .gitmodules &&
	git rm submod >actual 2>actual.err &&
	! test -s actual.err &&
	! test -d submod &&
	! test -f submod/.git &&
	git status -s -uno >actual &&
	test_cmp expect actual

content
HEAD is now at 1695754 add submodule
new mode 100755
ok 23 - patch does not affect mode

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
expecting success: 
	git reset --hard &&
	echo content >>file &&
	chmod +x file &&
	printf "y\\nn\\n" | git add -p &&
	git diff --cached file | grep "new mode" &&
	git diff          file | grep "+content"

HEAD is now at ee05f70 commit
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3513-revert-submodule/submodule_update_repo/.) registered for path 'sub1'
Submodule path 'submod': checked out '9485eff4ef4a8297ed1ff19aa3d53200258359eb'
Cloning into 'sub1'...
done.
Rebasing (2/3)
ok 47 - rm will error out on a modified .gitmodules file unless staged

expecting success: 
	git reset --hard &&
	git submodule update &&
	git config -f .gitmodules --remove-section submodule.sub &&
	git add .gitmodules &&
	echo "warning: Could not find section in .gitmodules where path=submod" >expect.err &&
	git rm submod >actual 2>actual.err &&
	test_i18ncmp expect.err actual.err &&
	! test -d submod &&
	! test -f submod/.git &&
	git status -s -uno >actual &&
	test_cmp expect actual

Submodule path 'sub1': checked out '0bb19bc669768d58723d7c38bcfd024bd815cd4c'
diff --git a/file b/file
index 180b47c..b6f2c08
--- a/file
+++ b/file
old mode 100644
new mode 100755
Stage mode change [y,n,q,a,d,/,j,J,g,?]? @@ -1 +1,2 @@
 baseline
+content
Stage this hunk [y,n,q,a,d,/,K,g,e,?]? HEAD is now at 1695754 add submodule

new mode 100755
+content
ok 24 - stage mode but not hunk

expecting success: 
	git reset --hard &&
	echo content >>file &&
	chmod +x file &&
	printf "y\\ny\\n" | git add -p &&
	git diff --cached file | grep "new mode" &&
	git diff --cached file | grep "+content" &&
	test -z "$(git diff file)"

Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
HEAD is now at ee05f70 commit
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.
[detached HEAD a39295a] ¤Ϥì¤ҤۤÕ
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:56:04 2015 +0000
 1 file changed, 2 insertions(+)
Switched to branch 'invalid_sub1'
Your branch is up-to-date with 'origin/invalid_sub1'.
On branch invalid_sub1
Your branch is up-to-date with 'origin/invalid_sub1'.
Changes to be committed:
	modified:   sub1

not ok 13 - git_revert: modified submodule does not update submodule work tree to invalid commit # TODO known breakage

checking known breakage: 
		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
		)
	
Cloning into 'submodule_update'...
Rebasing (3/3)
Submodule path 'submod': checked out '9485eff4ef4a8297ed1ff19aa3d53200258359eb'
done.
Switched to a new branch 'invalid_sub1'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
fatal: Needed a single revision
Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
ok 48 - rm issues a warning when section is not found in .gitmodules

expecting success: 
	git reset --hard &&
	git submodule update &&
	(cd submod &&
		echo X >empty
	) &&
	test_must_fail git rm submod &&
	test -d submod &&
	test -f submod/.git &&
	git status -s -uno --ignore-submodules=none > actual &&
	test_cmp expect.modified actual &&
	git rm -f submod &&
	test ! -d submod &&
	git status -s -uno --ignore-submodules=none > actual &&
	test_cmp expect actual

Switched to branch 'valid_sub1'
Your branch is up-to-date with 'origin/valid_sub1'.
HEAD is now at 1695754 add submodule
On branch valid_sub1
Your branch is up-to-date with 'origin/valid_sub1'.
Changes to be committed:
	modified:   sub1

diff --git a/file b/file
index 180b47c..b6f2c08
--- a/file
+++ b/file
old mode 100644
new mode 100755
Stage mode change [y,n,q,a,d,/,j,J,g,?]? @@ -1 +1,2 @@
 baseline
+content
Stage this hunk [y,n,q,a,d,/,K,g,e,?]? not ok 14 - git_revert: modified submodule does not update submodule work tree from invalid commit # TODO known breakage


# still have 6 known breakage(s)
# passed all remaining 8 test(s)
1..14
new mode 100755
+content
ok 25 - stage mode and hunk

expecting success: 
	git reset --hard &&
	test_chmod +x file &&
	echo content >>file

HEAD is now at ee05f70 commit
ok 26 - setup again

expecting success: 
cat >patch <<EOF
index 180b47c..b6f2c08 100644
--- a/file
+++ b/file
@@ -1,2 +1,4 @@
+firstline
 baseline
 content
+lastline
EOF

ok 27 - setup patch

expecting success: 
cat >expected <<EOF
diff --git a/file b/file
index b6f2c08..61b9053 100755
--- a/file
+++ b/file
@@ -1,2 +1,4 @@
+firstline
 baseline
 content
+lastline
EOF

ok 28 - setup expected

expecting success: 
	git commit -am "clear local changes" &&
	git apply patch &&
	(echo s; echo y; echo y) | git add -p file &&
	git diff --cached > diff &&
	test_cmp expected diff

[master 6975544] clear local changes
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 mode change 100644 => 100755 file
*** t3901-i18n-patch.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3901-i18n-patch/.git/
expecting success: 
	git config i18n.commitencoding UTF-8 &&

	# use UTF-8 in author and committer name to match the
	# i18n.commitencoding settings
	. "$TEST_DIRECTORY"/t3901-utf8.txt &&

	test_tick &&
	echo "$GIT_AUTHOR_NAME" >mine &&
	git add mine &&
	git commit -s -m "Initial commit" &&

	test_tick &&
	echo Hello world >mine &&
	git add mine &&
	git commit -s -m "Second on main" &&

	# the first commit on the side branch is UTF-8
	test_tick &&
	git checkout -b side master^ &&
	echo Another file >yours &&
	git add yours &&
	git commit -s -m "Second on side" &&

	if test_have_prereq !MINGW
	then
		# the second one on the side branch is ISO-8859-1
		git config i18n.commitencoding ISO8859-1 &&
		# use author and committer name in ISO-8859-1 to match it.
		. "$TEST_DIRECTORY"/t3901-8859-1.txt
	fi &&
	test_tick &&
	echo Yet another >theirs &&
	git add theirs &&
	git commit -s -m "Third on side" &&

	# Back to default
	git config i18n.commitencoding UTF-8

Submodule path 'submod': checked out '9485eff4ef4a8297ed1ff19aa3d53200258359eb'
[master (root-commit) a751cb4] Initial commit
 Author: Áéí óú <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 mine
[master 1abbfe5] Second on main
 Author: Áéí óú <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'side'
[side 907dc52] Second on side
 Author: Áéí óú <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 yours
[side 717f610] Third on side
 1 file changed, 1 insertion(+)
 create mode 100644 theirs
ok 1 - setup

expecting success: 
	git config i18n.logoutputencoding ISO8859-1 &&

	git format-patch --stdout master..HEAD^ >out-l1 &&
	git format-patch --stdout HEAD^ >out-l2 &&
	grep "^Content-Type: text/plain; charset=ISO8859-1" out-l1 &&
	grep "^From: =?ISO8859-1?q?=C1=E9=ED=20=F3=FA?=" out-l1 &&
	grep "^Content-Type: text/plain; charset=ISO8859-1" out-l2 &&
	grep "^From: =?ISO8859-1?q?=C1=E9=ED=20=F3=FA?=" out-l2

Content-Type: text/plain; charset=ISO8859-1
From: =?ISO8859-1?q?=C1=E9=ED=20=F3=FA?= <author@example.com>
Content-Type: text/plain; charset=ISO8859-1
From: =?ISO8859-1?q?=C1=E9=ED=20=F3=FA?= <author@example.com>
ok 2 - format-patch output (ISO-8859-1)

expecting success: 
	git config i18n.logoutputencoding UTF-8 &&

	git format-patch --stdout master..HEAD^ >out-u1 &&
	git format-patch --stdout HEAD^ >out-u2 &&
	grep "^Content-Type: text/plain; charset=UTF-8" out-u1 &&
	grep "^From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?=" out-u1 &&
	grep "^Content-Type: text/plain; charset=UTF-8" out-u2 &&
	grep "^From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?=" out-u2

error: the following file has local modifications:
    submod
(use --cached to keep the file, or -f to force removal)
Successfully rebased and updated refs/heads/eucJP-fixup.
Content-Type: text/plain; charset=UTF-8
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
Content-Type: text/plain; charset=UTF-8
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
ok 3 - format-patch output (UTF-8)

expecting success: 
	# We want the result of rebase in UTF-8
	git config i18n.commitencoding UTF-8 &&

	# The test is about logoutputencoding not affecting the
	# final outcome -- it is used internally to generate the
	# patch and the log.

	git config i18n.logoutputencoding UTF-8 &&

	# The result will be committed by GIT_COMMITTER_NAME --
	# we want UTF-8 encoded name.
	. "$TEST_DIRECTORY"/t3901-utf8.txt &&
	git checkout -b test &&
	git rebase master &&

	check_encoding 2

ok 33 - commit --fixup with eucJP encoding

expecting success: 
		git config i18n.commitencoding $H &&
		git checkout -b $H-$flag C0 &&
		echo $H >>F &&
		git commit -a -F "$TEST_DIRECTORY"/t3900/$H.txt &&
		test_tick &&
		echo intermediate stuff >>G &&
		git add G &&
		git commit -a -m "intermediate commit" &&
		test_tick &&
		echo $H $flag >>F &&
		git commit -a --$flag HEAD~1 &&
		E=$(git cat-file commit ISO-2022-JP-squash |
			sed -ne "s/^encoding //p") &&
		test "z$E" = "z$H" &&
		git config --unset-all i18n.commitencoding &&
		git rebase --autosquash -i HEAD^^^ &&
		git log --oneline >actual &&
		test_line_count = 3 actual
	
Switched to a new branch 'test'
Switched to a new branch 'ISO-2022-JP-squash'
[ISO-2022-JP-squash 753f579] $B$O$l$R$[$U(B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[ISO-2022-JP-squash 47f8cfb] intermediate commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 G
diff --git a/file b/file
index b6f2c08..61b9053 100755
--- a/file
+++ b/file
@@ -1,2 +1,4 @@
+firstline
 baseline
 content
+lastline
Stage this hunk [y,n,q,a,d,/,s,e,?]? Split into 2 hunks.
@@ -1,2 +1,3 @@
+firstline
 baseline
 content
Stage this hunk [y,n,q,a,d,/,j,J,g,e,?]? @@ -1,2 +2,3 @@
 baseline
 content
+lastline
Stage this hunk [y,n,q,a,d,/,K,g,e,?]? rm 'submod'
[ISO-2022-JP-squash 51d9f7b] squash! $B$O$l$R$[$U(B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)

ok 49 - rm of a populated submodule with modifications fails unless forced

expecting success: 
	git reset --hard &&
	git submodule update &&
	(cd submod &&
		echo X >untracked
	) &&
	test_must_fail git rm submod &&
	test -d submod &&
	test -f submod/.git &&
	git status -s -uno --ignore-submodules=none > actual &&
	test_cmp expect.modified actual &&
	git rm -f submod &&
	test ! -d submod &&
	git status -s -uno --ignore-submodules=none > actual &&
	test_cmp expect actual

ok 29 - add first line works

expecting success: 
cat >expected <<EOF
diff --git a/non-empty b/non-empty
deleted file mode 100644
index d95f3ad..0000000
--- a/non-empty
+++ /dev/null
@@ -1 +0,0 @@
-content
EOF

HEAD is now at 1695754 add submodule
ok 30 - setup expected

expecting success: 
	git reset --hard &&
	echo content >non-empty &&
	git add non-empty &&
	git commit -m non-empty &&
	rm non-empty &&
	echo y | git add -p non-empty &&
	git diff --cached >diff &&
	test_cmp expected diff

HEAD is now at 6975544 clear local changes
[master 2d72712] non-empty
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 non-empty
First, rewinding head to replay your work on top of it...
Applying: Second on side
Applying: Third on side
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
Submodule path 'submod': checked out '9485eff4ef4a8297ed1ff19aa3d53200258359eb'
ok 4 - rebase (U/U)

expecting success: 
	git config i18n.commitencoding UTF-8 &&
	git config i18n.logoutputencoding ISO8859-1 &&
	. "$TEST_DIRECTORY"/t3901-utf8.txt &&

	git reset --hard side &&
	git rebase master &&

	check_encoding 2

HEAD is now at 717f610 Third on side
First, rewinding head to replay your work on top of it...
error: the following file has local modifications:
    submod
(use --cached to keep the file, or -f to force removal)
Applying: Second on side
Applying: Third on side
diff --git a/non-empty b/non-empty
index d95f3ad..0000000
--- a/non-empty
+++ /dev/null
deleted file mode 100644
@@ -1 +0,0 @@
-content
Stage deletion [y,n,q,a,d,/,?]? 
ok 31 - deleting a non-empty file

expecting success: 
cat >expected <<EOF
diff --git a/empty b/empty
deleted file mode 100644
index e69de29..0000000
EOF

ok 32 - setup expected

expecting success: 
	git reset --hard &&
	> empty &&
	git add empty &&
	git commit -m empty &&
	rm empty &&
	echo y | git add -p empty &&
	git diff --cached >diff &&
	test_cmp expected diff

From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
HEAD is now at 2d72712 non-empty
Rebasing (2/3)
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
[master 03697f4] empty
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 empty
rm 'submod'
ok 5 - rebase (U/L)

expecting success: 
	# In this test we want ISO-8859-1 encoded commits as the result
	git config i18n.commitencoding ISO8859-1 &&
	git config i18n.logoutputencoding ISO8859-1 &&
	. "$TEST_DIRECTORY"/t3901-8859-1.txt &&

	git reset --hard side &&
	git rebase master &&

	check_encoding 2 8859

ok 50 - rm of a populated submodule with untracked files fails unless forced

expecting success: 
	git reset --hard &&
	git submodule update &&
	git checkout -b branch1 &&
	echo 1 >nitfol &&
	git add nitfol &&
	git commit -m "added nitfol 1" &&
	git checkout -b branch2 master &&
	echo 2 >nitfol &&
	git add nitfol &&
	git commit -m "added nitfol 2" &&
	git checkout -b conflict1 master &&
	(cd submod &&
		git fetch &&
		git checkout branch1
	) &&
	git add submod &&
	git commit -m "submod 1" &&
	git checkout -b conflict2 master &&
	(cd submod &&
		git checkout branch2
	) &&
	git add submod &&
	git commit -m "submod 2"

HEAD is now at 1695754 add submodule
HEAD is now at 717f610 Third on side
[detached HEAD c92118f] $B$O$l$R$[$U(B
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 1 file changed, 2 insertions(+)
Rebasing (3/3)
First, rewinding head to replay your work on top of it...
Applying: Second on side
Applying: Third on side
Submodule path 'submod': checked out '9485eff4ef4a8297ed1ff19aa3d53200258359eb'
Switched to a new branch 'branch1'
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
encoding ISO8859-1
[branch1 4923133] added nitfol 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 nitfol
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
encoding ISO8859-1
ok 6 - rebase (L/L)

expecting success: 
	# This is pathological -- use UTF-8 as intermediate form
	# to get ISO-8859-1 results.
	git config i18n.commitencoding ISO8859-1 &&
	git config i18n.logoutputencoding UTF-8 &&
	. "$TEST_DIRECTORY"/t3901-8859-1.txt &&

	git reset --hard side &&
	git rebase master &&

	check_encoding 2 8859

Switched to a new branch 'branch2'
HEAD is now at 717f610 Third on side
[branch2 0c2b8c4] added nitfol 2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 nitfol
Switched to a new branch 'conflict1'
diff --git a/empty b/empty
index e69de29..0000000
deleted file mode 100644
Stage deletion [y,n,q,a,d,/,?]? 
ok 33 - deleting an empty file

expecting success: 
	git reset --hard &&
	for i in 10 20 30 40 50 60
	do
		echo $i
	done >test &&
	git add test &&
	test_tick &&
	git commit -m test &&

	for i in 10 15 20 21 22 23 24 30 40 50 60
	do
		echo $i
	done >test

HEAD is now at 03697f4 empty
From /«PKGBUILDDIR»/t/trash directory.t3600-rm/.
 * [new branch]      branch1    -> origin/branch1
 * [new branch]      branch2    -> origin/branch2
 * [new branch]      conflict1  -> origin/conflict1
Previous HEAD position was 9485eff... subdir test
[master cc3bc7c] test
 Author: A U Thor <author@example.com>
 1 file changed, 6 insertions(+)
 create mode 100644 test
ok 34 - split hunk setup

expecting success: 
	# Split, say Edit and do nothing.  Then:
	#
	# 1. Broken version results in a patch that does not apply and
	# only takes [y/n] (edit again) so the first q is discarded
	# and then n attempts to discard the edit. Repeat q enough
	# times to get out.
	#
	# 2. Correct version applies the (not)edited version, and asks
	#    about the next hunk, against which we say q and program
	#    exits.
	printf "%s\n" s e     q n q q |
	EDITOR=: git add -p &&
	git diff >actual &&
	! grep "^+15" actual

Switched to a new branch 'branch1'
Branch branch1 set up to track remote branch branch1 from origin.
First, rewinding head to replay your work on top of it...
[conflict1 6005f49] submod 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'conflict2'
M	submod
Switched to a new branch 'branch2'
Branch branch2 set up to track remote branch branch2 from origin.
Applying: Second on side
Applying: Third on side
[conflict2 eec8665] submod 2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 51 - setup submodule conflict

expecting success: 
	git checkout conflict1 &&
	git reset --hard &&
	git submodule update &&
	test_must_fail git merge conflict2 &&
	git rm submod &&
	test ! -d submod &&
	git status -s -uno --ignore-submodules=none > actual &&
	test_cmp expect actual

Switched to branch 'conflict1'
M	submod
HEAD is now at 6005f49 submod 1
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
encoding ISO8859-1
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
encoding ISO8859-1
ok 7 - rebase (L/U)

expecting success: 
	# Both the commitencoding and logoutputencoding is set to UTF-8.

	git config i18n.commitencoding UTF-8 &&
	git config i18n.logoutputencoding UTF-8 &&
	. "$TEST_DIRECTORY"/t3901-utf8.txt &&

	git reset --hard master &&
	git cherry-pick side^ &&
	git cherry-pick side &&
	git revert HEAD &&

	check_encoding 3

HEAD is now at 1abbfe5 Second on main
[test 226e420] Second on side
 Author: Áéí óú <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 yours
[test 0c82aa3] Third on side
 Author: Áéí óú <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 theirs
Removing theirs
[test 267f566] Revert "Third on side"
 Author: Áéí óú <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 theirs
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
Submodule path 'submod': checked out '492313343b85607dcf366f7827373b63ab5ff557'
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
warning: Failed to merge submodule submod (merge following commits not found)
Merging:
6005f49 submod 1
virtual conflict2
found 1 common ancestor:
1695754 add submodule
Auto-merging submod
CONFLICT (submodule): Merge conflict in submod
diff --git a/test b/test
index 0889435..26b5645 100644
--- a/test
+++ b/test
@@ -1,5 +1,10 @@
 10
+15
 20
+21
+22
+23
+24
 30
 40
 50
Stage this hunk [y,n,q,a,d,/,s,e,?]? Split into 2 hunks.
@@ -1,2 +1,3 @@
 10
+15
 20
Stage this hunk [y,n,q,a,d,/,j,J,g,e,?]? From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
Automatic merge failed; fix conflicts and then commit the result.
submod: needs merge
@@ -2,4 +3,8 @@
 20
+21
+22
+23
+24
 30
 40
 50
Stage this hunk [y,n,q,a,d,/,K,g,e,?]? ok 8 - cherry-pick(U/U)

expecting success: 
	# Both the commitencoding and logoutputencoding is set to ISO-8859-1

	git config i18n.commitencoding ISO8859-1 &&
	git config i18n.logoutputencoding ISO8859-1 &&
	. "$TEST_DIRECTORY"/t3901-8859-1.txt &&

	git reset --hard master &&
	git cherry-pick side^ &&
	git cherry-pick side &&
	git revert HEAD &&

	check_encoding 3 8859


HEAD is now at 1abbfe5 Second on main
ok 35 - split hunk "add -p (edit)"

checking known breakage: 
	cat >test <<-\EOF &&
	5
	10
	20
	21
	30
	31
	40
	50
	60
	EOF
	git reset &&
	# test sequence is s(plit), n(o), y(es), e(dit)
	# q n q q is there to make sure we exit at the end.
	printf "%s\n" s n y e   q n q q |
	EDITOR=: git add -p 2>error &&
	test_must_be_empty error &&
	git diff >actual &&
	! grep "^+31" actual

Successfully rebased and updated refs/heads/ISO-2022-JP-squash.
Unstaged changes after reset:
M	test
[test e1b2855] Second on side
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 yours
ok 34 - commit --squash with ISO-2022-JP encoding

# passed all 34 test(s)
1..34
rm 'submod'
[test 37f31da] Third on side
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 theirs
ok 52 - rm removes work tree of unmodified conflicted submodule

expecting success: 
	git checkout conflict1 &&
	git reset --hard &&
	git submodule update &&
	(cd submod &&
		git checkout HEAD^
	) &&
	test_must_fail git merge conflict2 &&
	test_must_fail git rm submod &&
	test -d submod &&
	test -f submod/.git &&
	git status -s -uno --ignore-submodules=none > actual &&
	test_cmp expect.conflict actual &&
	git rm -f submod &&
	test ! -d submod &&
	git status -s -uno --ignore-submodules=none > actual &&
	test_cmp expect actual &&
	test_must_fail git config -f .gitmodules submodule.sub.url &&
	test_must_fail git config -f .gitmodules submodule.sub.path

Removing theirs
Already on 'conflict1'
M	.gitmodules
D	submod
*** t3902-quoted.sh ***
[test 2f88e21] Revert "Third on side"
 1 file changed, 1 deletion(-)
 delete mode 100644 theirs
HEAD is now at 6005f49 submod 1
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
encoding ISO8859-1
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3902-quoted/.git/
encoding ISO8859-1
expecting success: 

	mkdir "$FN" &&
	for_each_name "echo initial >\"\$name\"" &&
	git add . &&
	git commit -q -m Initial &&

	for_each_name "echo second >\"\$name\"" &&
	git commit -a -m Second &&

	for_each_name "echo modified >\"\$name\""


From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
encoding ISO8859-1
ok 9 - cherry-pick(L/L)

expecting success: 
	# Commitencoding is set to UTF-8 but logoutputencoding is ISO-8859-1

	git config i18n.commitencoding UTF-8 &&
	git config i18n.logoutputencoding ISO8859-1 &&
	. "$TEST_DIRECTORY"/t3901-utf8.txt &&

	git reset --hard master &&
	git cherry-pick side^ &&
	git cherry-pick side &&
	git revert HEAD &&

	check_encoding 3

HEAD is now at 1abbfe5 Second on main
[master f5776ef] Second
 Author: A U Thor <author@example.com>
 11 files changed, 11 insertions(+), 11 deletions(-)
ok 1 - setup

expecting success: 
cat >expect.quoted <<\EOF &&
Name
"Name and a\nLF"
"Name and an\tHT"
"Name\""
With SP in it
"\346\277\261\351\207\216\t\347\264\224"
"\346\277\261\351\207\216\n\347\264\224"
"\346\277\261\351\207\216 \347\264\224"
"\346\277\261\351\207\216\"\347\264\224"
"\346\277\261\351\207\216/file"
"\346\277\261\351\207\216\347\264\224"
EOF

cat >expect.raw <<\EOF
Name
"Name and a\nLF"
"Name and an\tHT"
"Name\""
With SP in it
"濱野\t純"
"濱野\n純"
濱野 純
"濱野\"純"
濱野/file
濱野純
EOF

ok 2 - setup expected files

expecting success: 

	git ls-files >current && test_cmp expect.quoted current


[test 226e420] Second on side
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 yours
ok 3 - check fully quoted output from ls-files

expecting success: 

	git diff --name-only >current &&
	test_cmp expect.quoted current


ok 4 - check fully quoted output from diff-files

expecting success: 

	git diff --name-only HEAD >current &&
	test_cmp expect.quoted current


ok 5 - check fully quoted output from diff-index

expecting success: 

	git diff --name-only HEAD^ HEAD >current &&
	test_cmp expect.quoted current


[test 0c82aa3] Third on side
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 theirs
ok 6 - check fully quoted output from diff-tree

expecting success: 

	git ls-tree --name-only -r HEAD >current &&
	test_cmp expect.quoted current


Removing theirs
ok 7 - check fully quoted output from ls-tree

expecting success: 

	git config --bool core.quotepath false


[test 267f566] Revert "Third on side"
 1 file changed, 1 deletion(-)
 delete mode 100644 theirs
ok 8 - setting core.quotepath

expecting success: 

	git ls-files >current && test_cmp expect.raw current


ok 9 - check fully quoted output from ls-files

expecting success: 

	git diff --name-only >current &&
	test_cmp expect.raw current


From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
ok 10 - check fully quoted output from diff-files

expecting success: 

	git diff --name-only HEAD >current &&
	test_cmp expect.raw current


Submodule path 'submod': checked out '492313343b85607dcf366f7827373b63ab5ff557'
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
ok 11 - check fully quoted output from diff-index

expecting success: 

	git diff --name-only HEAD^ HEAD >current &&
	test_cmp expect.raw current


Previous HEAD position was 4923133... added nitfol 1
HEAD is now at 1695754... add submodule
ok 12 - check fully quoted output from diff-tree

expecting success: 

	git ls-tree --name-only -r HEAD >current &&
	test_cmp expect.raw current


From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
warning: Failed to merge submodule submod (merge following commits not found)
ok 13 - check fully quoted output from ls-tree

Merging:
6005f49 submod 1
virtual conflict2
found 1 common ancestor:
1695754 add submodule
Auto-merging submod
CONFLICT (submodule): Merge conflict in submod
Automatic merge failed; fix conflicts and then commit the result.
ok 10 - cherry-pick(U/L)

expecting success: 
	# Again, the commitencoding is set to ISO-8859-1 but
	# logoutputencoding is set to UTF-8.

	git config i18n.commitencoding ISO8859-1 &&
	git config i18n.logoutputencoding UTF-8 &&
	. "$TEST_DIRECTORY"/t3901-8859-1.txt &&

	git reset --hard master &&
	git cherry-pick side^ &&
	git cherry-pick side &&
	git revert HEAD &&

	check_encoding 3 8859

# passed all 13 test(s)
1..13
diff --git a/test b/test
index 0889435..47ab15d 100644
--- a/test
+++ b/test
@@ -1,6 +1,9 @@
+5
 10
 20
+21
 30
+31
 40
 50
 60
Stage this hunk [y,n,q,a,d,/,s,e,?]? Split into 3 hunks.
@@ -1,2 +1,3 @@
+5
 10
 20
Stage this hunk [y,n,q,a,d,/,j,J,g,e,?]? @@ -1,3 +2,4 @@
 10
 20
+21
 30
Stage this hunk [y,n,q,a,d,/,K,j,J,g,e,?]? @@ -3,4 +5,5 @@
 30
+31
 40
 50
 60
Stage this hunk [y,n,q,a,d,/,K,g,e,?]? submod: needs merge
Your edited hunk does not apply. Edit again (saying "no" discards!) [y/n]? Your edited hunk does not apply. Edit again (saying "no" discards!) [y/n]? @@ -1,2 +1,3 @@
+5
 10
 20
Stage this hunk [y,n,q,a,d,/,j,J,g,e,?]? *** t3903-stash.sh ***
HEAD is now at 1abbfe5 Second on main

'error' is not empty, it contains:
error: patch failed: test:1
error: test: patch does not apply
not ok 36 - split hunk "add -p (no, yes, edit)" # TODO known breakage

expecting success: 
	git reset --hard &&
	test_commit conflict &&
	test_commit non-conflict &&
	git checkout -b side &&
	test_commit side conflict.t &&
	git checkout master &&
	test_commit master conflict.t &&
	test_must_fail git merge side &&
	echo changed >non-conflict.t &&
	echo y | git add -p >output &&
	! grep a/conflict.t output &&
	cat >expected <<-\EOF &&
	* Unmerged path conflict.t
	diff --git a/non-conflict.t b/non-conflict.t
	index f766221..5ea2ed4 100644
	--- a/non-conflict.t
	+++ b/non-conflict.t
	@@ -1 +1 @@
	-non-conflict
	+changed
	EOF
	git diff --cached >diff &&
	test_cmp expected diff

[test e1b2855] Second on side
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 yours
HEAD is now at cc3bc7c test
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3903-stash/.git/
[test 37f31da] Third on side
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 theirs
expecting success: 
	echo 1 > file &&
	git add file &&
	echo unrelated >other-file &&
	git add other-file &&
	test_tick &&
	git commit -m initial &&
	echo 2 > file &&
	git add file &&
	echo 3 > file &&
	test_tick &&
	git stash &&
	git diff-files --quiet &&
	git diff-index --cached --quiet HEAD

error: the following file has local modifications:
    submod
(use --cached to keep the file, or -f to force removal)
[master 818933d] conflict
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 conflict.t
Removing theirs
[test 2f88e21] Revert "Third on side"
 1 file changed, 1 deletion(-)
 delete mode 100644 theirs
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
submod: needs merge
encoding ISO8859-1
[master d77cb5a] non-conflict
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 non-conflict.t
[master (root-commit) fe7e97b] initial
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 file
 create mode 100644 other-file
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
encoding ISO8859-1
Switched to a new branch 'side'
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
encoding ISO8859-1
ok 11 - cherry-pick(L/U)

expecting success: 
	git config i18n.commitencoding UTF-8 &&
	git config i18n.logoutputencoding UTF-8 &&
	. "$TEST_DIRECTORY"/t3901-utf8.txt &&

	git reset --hard side &&
	git rebase --merge master &&

	check_encoding 2

[side 516c7bd] side
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to branch 'master'
HEAD is now at 717f610 Third on side
rm 'submod'
[master 94fe62c] master
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 53 - rm of a conflicted populated submodule with different HEAD fails unless forced

expecting success: 
	git checkout conflict1 &&
	git reset --hard &&
	git submodule update &&
	(cd submod &&
		echo X >empty
	) &&
	test_must_fail git merge conflict2 &&
	test_must_fail git rm submod &&
	test -d submod &&
	test -f submod/.git &&
	git status -s -uno --ignore-submodules=none > actual &&
	test_cmp expect.conflict actual &&
	git rm -f submod &&
	test ! -d submod &&
	git status -s -uno --ignore-submodules=none > actual &&
	test_cmp expect actual &&
	test_must_fail git config -f .gitmodules submodule.sub.url &&
	test_must_fail git config -f .gitmodules submodule.sub.path

warning: refname 'side' is ambiguous.
Already on 'conflict1'
warning: refname 'side' is ambiguous.
M	.gitmodules
D	submod
Merging:
94fe62c master
virtual side
found 1 common ancestor:
d77cb5a non-conflict
Auto-merging conflict.t
CONFLICT (content): Merge conflict in conflict.t
Automatic merge failed; fix conflicts and then commit the result.
HEAD is now at 6005f49 submod 1
Saved working directory and index state WIP on master: fe7e97b initial
HEAD is now at fe7e97b initial
First, rewinding head to replay your work on top of it...
ok 1 - stash some dirty working directory

expecting success: 
	test $(git rev-parse stash^) = $(git rev-parse HEAD) &&
	git diff stash^2..stash > output &&
	test_cmp output expect

ok 2 - parents of stash

expecting success: 
	test_must_fail git stash apply stash@{1} &&
	echo 1 >expect &&
	test_cmp expect file

Merging master with HEAD~1
Merging:
1abbfe5 Second on main
907dc52 Second on side
found 1 common ancestor:
a751cb4 Initial commit
[detached HEAD 226e420] Second on side
 Author: Áéí óú <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 yours
Committed: 0001 Second on side
fatal: Log for 'stash' only has 1 entries.
ok 3 - applying bogus stash does nothing

expecting success: 
	echo 4 >other-file &&
	git stash apply &&
	echo 3 >expect &&
	test_cmp expect file

Merging master with HEAD~0
Merging:
226e420 Second on side
717f610 Third on side
found 1 common ancestor:
907dc52 Second on side
Submodule path 'submod': checked out '492313343b85607dcf366f7827373b63ab5ff557'
warning: Failed to merge submodule submod (merge following commits not found)
Merging:
6005f49 submod 1
virtual conflict2
found 1 common ancestor:
1695754 add submodule
Auto-merging submod
CONFLICT (submodule): Merge conflict in submod
[detached HEAD 0c82aa3] Third on side
 Author: Áéí óú <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 theirs
Committed: 0002 Automatic merge failed; fix conflicts and then commit the result.
submod: needs merge
Third on side
All done.
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
ignoring unmerged: conflict.t
Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual d74e5012f311ddb74ee390126e4df2c1391cc04b
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
ok 12 - rebase --merge (U/U)

expecting success: 
	git config i18n.commitencoding UTF-8 &&
	git config i18n.logoutputencoding ISO8859-1 &&
	. "$TEST_DIRECTORY"/t3901-utf8.txt &&

	git reset --hard side &&
	git rebase --merge master &&

	check_encoding 2

On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   file
	modified:   other-file

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	expect
	output

no changes added to commit (use "git add" and/or "git commit -a")
ok 37 - patch mode ignores unmerged entries

ok 4 - apply does not need clean working directory

expecting success: 
	git reset --hard &&
	echo 4 >file &&
	test_must_fail git stash apply &&
	echo 4 >expect &&
	test_cmp expect file

# still have 1 known breakage(s)
# passed all remaining 36 test(s)
1..37
HEAD is now at fe7e97b initial
HEAD is now at 717f610 Third on side
*** t3904-stash-patch.sh ***
error: the following file has local modifications:
    submod
(use --cached to keep the file, or -f to force removal)
submod: needs merge
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3904-stash-patch/.git/
expecting success: 
	mkdir dir &&
	echo parent > dir/foo &&
	echo dummy > bar &&
	echo committed > HEAD &&
	git add bar dir/foo HEAD &&
	git commit -m initial &&
	test_tick &&
	test_commit second dir/foo head &&
	echo index > dir/foo &&
	git add dir/foo &&
	set_and_save_state bar bar_work bar_index &&
	save_head

[master (root-commit) 4f3b8f0] initial
 Author: A U Thor <author@example.com>
 3 files changed, 3 insertions(+)
 create mode 100644 HEAD
 create mode 100644 bar
 create mode 100644 dir/foo
error: Your local changes to the following files would be overwritten by merge:
	file
Please, commit your changes or stash them before you can merge.
Aborting
fatal: merging of trees d74e5012f311ddb74ee390126e4df2c1391cc04b and f6c9c9b59dd8c043d13843653b20f8896e77561b failed
Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual d74e5012f311ddb74ee390126e4df2c1391cc04b
ok 5 - apply does not clobber working directory changes

expecting success: 
	git reset --hard &&
	echo 5 >other-file &&
	git add other-file &&
	test_tick &&
	git commit -m other-file &&
	git stash apply &&
	test 3 = $(cat file) &&
	test 1 = $(git show :file) &&
	test 1 = $(git show HEAD:file)

First, rewinding head to replay your work on top of it...
HEAD is now at fe7e97b initial
[master afb85ba] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
rm 'submod'
[master 4db481e] other-file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 54 - rm of a conflicted populated submodule with modifications fails unless forced

expecting success: 
	git checkout conflict1 &&
	git reset --hard &&
	git submodule update &&
	(cd submod &&
		echo X >untracked
	) &&
	test_must_fail git merge conflict2 &&
	test_must_fail git rm submod &&
	test -d submod &&
	test -f submod/.git &&
	git status -s -uno --ignore-submodules=none > actual &&
	test_cmp expect.conflict actual &&
	git rm -f submod &&
	test ! -d submod &&
	git status -s -uno --ignore-submodules=none > actual &&
	test_cmp expect actual

Merging master with HEAD~1
Merging:
1abbfe5 Second on main
907dc52 Second on side
found 1 common ancestor:
a751cb4 Initial commit
Already on 'conflict1'
M	.gitmodules
D	submod
ok 1 - setup

expecting success: 
	set_state HEAD HEADfile_work HEADfile_index &&
	set_state dir/foo work index &&
	(echo n; echo n; echo n) | test_must_fail git stash save -p &&
	verify_state HEAD HEADfile_work HEADfile_index &&
	verify_saved_state bar &&
	verify_state dir/foo work index

HEAD is now at 6005f49 submod 1
[detached HEAD 226e420] Second on side
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 yours
Committed: 0001 Second on side
Merging master with HEAD~0
Merging:
226e420 Second on side
717f610 Third on side
found 1 common ancestor:
907dc52 Second on side
[detached HEAD 0c82aa3] Third on side
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 theirs
Committed: 0002 Third on side
Merging Updated upstream with Stashed changes
Merging:
virtual Updated upstream
virtual Stashed changes
found 1 common ancestor:
virtual d74e5012f311ddb74ee390126e4df2c1391cc04b
All done.
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   file

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	expect
	output

no changes added to commit (use "git add" and/or "git commit -a")
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
ok 6 - apply stashed changes

expecting success: 
	git reset --hard HEAD^ &&
	echo 6 > other-file &&
	git add other-file &&
	test_tick &&
	git commit -m other-file &&
	git stash apply --index &&
	test 3 = $(cat file) &&
	test 2 = $(git show :file) &&
	test 1 = $(git show HEAD:file)

From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
ok 13 - rebase --merge (U/L)

expecting success: 
	# In this test we want ISO-8859-1 encoded commits as the result
	git config i18n.commitencoding ISO8859-1 &&
	git config i18n.logoutputencoding ISO8859-1 &&
	. "$TEST_DIRECTORY"/t3901-8859-1.txt &&

	git reset --hard side &&
	git rebase --merge master &&

	check_encoding 2 8859

HEAD is now at fe7e97b initial
HEAD is now at 717f610 Third on side
[master da68008] other-file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Submodule path 'submod': checked out '492313343b85607dcf366f7827373b63ab5ff557'
warning: Failed to merge submodule submod (merge following commits not found)
Merging:
6005f49 submod 1
virtual conflict2
found 1 common ancestor:
1695754 add submodule
Auto-merging submod
CONFLICT (submodule): Merge conflict in submod
Automatic merge failed; fix conflicts and then commit the result.
submod: needs merge
First, rewinding head to replay your work on top of it...
Merging Updated upstream with Stashed changes
Merging:
virtual Updated upstream
virtual Stashed changes
found 1 common ancestor:
virtual d74e5012f311ddb74ee390126e4df2c1391cc04b
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	modified:   file

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   file

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	expect
	output

ok 7 - apply stashed changes (including index)

expecting success: 
	git reset --hard HEAD &&
	mkdir subdir &&
	(
		cd subdir &&
		git stash apply
	)

Merging master with HEAD~1
Merging:
1abbfe5 Second on main
907dc52 Second on side
found 1 common ancestor:
a751cb4 Initial commit
HEAD is now at da68008 other-file
[detached HEAD e1b2855] Second on side
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 yours
Committed: 0001 Second on side
error: the following file has local modifications:
    submod
(use --cached to keep the file, or -f to force removal)
Merging master with HEAD~0
Merging:
e1b2855 Second on side
717f610 Third on side
found 1 common ancestor:
907dc52 Second on side
submod: needs merge
[detached HEAD 37f31da] Third on side
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 theirs
Committed: 0002 Third on side
diff --git a/HEAD b/HEAD
index d0fe822..e74fca5 100644
--- a/HEAD
+++ b/HEAD
@@ -1 +1 @@
-committed
+HEADfile_work
Stash this hunk [y,n,q,a,d,/,e,?]? 
Merging Updated upstream with Stashed changes
Merging:
virtual Updated upstream
virtual Stashed changes
found 1 common ancestor:
virtual d74e5012f311ddb74ee390126e4df2c1391cc04b
All done.
diff --git a/bar b/bar
index 421376d..8c999e6 100644
--- a/bar
+++ b/bar
@@ -1 +1 @@
-dummy
+bar_work
Stash this hunk [y,n,q,a,d,/,e,?]? 
diff --git a/dir/foo b/dir/foo
index 564b12f..b8f99f5 100644
--- a/dir/foo
+++ b/dir/foo
@@ -1 +1 @@
-head
+work
Stash this hunk [y,n,q,a,d,/,e,?]? 
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
encoding ISO8859-1
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   ../file

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	../expect
	../output

no changes added to commit (use "git add" and/or "git commit -a")
ok 8 - unstashing in a subdirectory

expecting success: 
	test_must_fail git stash drop --foo

No changes selected
rm 'submod'
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
encoding ISO8859-1
ok 14 - rebase --merge (L/L)

expecting success: 
	# This is pathological -- use UTF-8 as intermediate form
	# to get ISO-8859-1 results.
	git config i18n.commitencoding ISO8859-1 &&
	git config i18n.logoutputencoding UTF-8 &&
	. "$TEST_DIRECTORY"/t3901-8859-1.txt &&

	git reset --hard side &&
	git rebase --merge master &&

	check_encoding 2 8859

ok 55 - rm of a conflicted populated submodule with untracked files fails unless forced

expecting success: 
	git checkout conflict1 &&
	git reset --hard &&
	git submodule update &&
	(cd submod &&
		rm .git &&
		cp -R ../.git/modules/sub .git &&
		GIT_WORK_TREE=. git config --unset core.worktree
	) &&
	test_must_fail git merge conflict2 &&
	test_must_fail git rm submod &&
	test -d submod &&
	test -d submod/.git &&
	git status -s -uno --ignore-submodules=none > actual &&
	test_cmp expect.conflict actual &&
	test_must_fail git rm -f submod &&
	test -d submod &&
	test -d submod/.git &&
	git status -s -uno --ignore-submodules=none > actual &&
	test_cmp expect.conflict actual &&
	git merge --abort &&
	rm -rf submod

Already on 'conflict1'
M	.gitmodules
D	submod
HEAD is now at 6005f49 submod 1
ok 2 - saying "n" does nothing

expecting success: 
	(echo y; echo n; echo y) | git stash save -p &&
	verify_state HEAD committed HEADfile_index &&
	verify_saved_state bar &&
	verify_state dir/foo head index &&
	git reset --hard &&
	git stash apply &&
	verify_state HEAD HEADfile_work committed &&
	verify_state bar dummy dummy &&
	verify_state dir/foo work head

HEAD is now at 717f610 Third on side
unknown option: --foo
ok 9 - stash drop complains of extra options

expecting success: 
	git reset --hard &&
	git stash list > stashlist1 &&
	echo 7 > file &&
	git stash &&
	git stash drop &&
	git stash list > stashlist2 &&
	test_cmp stashlist1 stashlist2 &&
	git stash apply &&
	test 3 = $(cat file) &&
	test 1 = $(git show :file) &&
	test 1 = $(git show HEAD:file)

HEAD is now at da68008 other-file
First, rewinding head to replay your work on top of it...
Merging master with HEAD~1
Merging:
1abbfe5 Second on main
907dc52 Second on side
found 1 common ancestor:
a751cb4 Initial commit
Submodule path 'submod': checked out '492313343b85607dcf366f7827373b63ab5ff557'
[detached HEAD e1b2855] Second on side
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 yours
Committed: 0001 Second on side
Merging master with HEAD~0
Merging:
e1b2855 Second on side
717f610 Third on side
found 1 common ancestor:
907dc52 Second on side
warning: Failed to merge submodule submod (merge following commits not found)
Merging:
6005f49 submod 1
virtual conflict2
found 1 common ancestor:
1695754 add submodule
Auto-merging submod
CONFLICT (submodule): Merge conflict in submod
[detached HEAD 37f31da] Third on side
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 theirs
Committed: 0002 Automatic merge failed; fix conflicts and then commit the result.
error: the following submodule (or one of its nested submodules)
uses a .git directory:
    submod
Third on side
(use 'rm -rf' if you really want to remove it including all of its history)
submod: needs merge
Saved working directory and index state WIP on master: da68008 other-file
HEAD is now at da68008 other-file
All done.
error: the following submodule (or one of its nested submodules)
uses a .git directory:
    submod
(use 'rm -rf' if you really want to remove it including all of its history)
submod: needs merge
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
encoding ISO8859-1
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
encoding ISO8859-1
ok 15 - rebase --merge (L/U)

expecting success: 
	# Apply UTF-8 patches with UTF-8 commitencoding
	git config i18n.commitencoding UTF-8 &&
	. "$TEST_DIRECTORY"/t3901-utf8.txt &&

	git reset --hard master &&
	git am out-u1 out-u2 &&

	check_encoding 2

ok 56 - rm of a conflicted populated submodule with a .git directory fails even when forced

expecting success: 
	git checkout conflict1 &&
	git reset --hard &&
	test_must_fail git merge conflict2 &&
	git rm submod &&
	test ! -d submod &&
	git status -s -uno --ignore-submodules=none > actual &&
	test_cmp expect actual

HEAD is now at 1abbfe5 Second on main
Already on 'conflict1'
D	submod
HEAD is now at 6005f49 submod 1
Applying: Second on side
warning: Failed to merge submodule submod (not checked out)
Merging:
6005f49 submod 1
virtual conflict2
found 1 common ancestor:
1695754 add submodule
Auto-merging submod
CONFLICT (submodule): Merge conflict in submod
Automatic merge failed; fix conflicts and then commit the result.
Applying: Third on side
submod: needs merge
rm 'submod'
Dropped refs/stash@{0} (9ec52be752d802128e13f2c0eba8a81f3a69d9fa)
ok 57 - rm of a conflicted unpopulated submodule succeeds

expecting success: 
	git checkout -f master &&
	git reset --hard &&
	git submodule update &&
	(cd submod &&
		rm .git &&
		cp -R ../.git/modules/sub .git &&
		GIT_WORK_TREE=. git config --unset core.worktree
	) &&
	test_must_fail git rm submod &&
	test -d submod &&
	test -d submod/.git &&
	git status -s -uno --ignore-submodules=none > actual &&
	! test -s actual &&
	test_must_fail git rm -f submod &&
	test -d submod &&
	test -d submod/.git &&
	git status -s -uno --ignore-submodules=none > actual &&
	! test -s actual &&
	rm -rf submod

diff --git a/HEAD b/HEAD
index d0fe822..e74fca5 100644
--- a/HEAD
+++ b/HEAD
@@ -1 +1 @@
-committed
+HEADfile_work
Switched to branch 'master'
Stash this hunk [y,n,q,a,d,/,e,?]? From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
HEAD is now at 1695754 add submodule

diff --git a/bar b/bar
index 421376d..8c999e6 100644
--- a/bar
+++ b/bar
@@ -1 +1 @@
-dummy
+bar_work
Stash this hunk [y,n,q,a,d,/,e,?]? 
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
diff --git a/dir/foo b/dir/foo
index 564b12f..b8f99f5 100644
--- a/dir/foo
+++ b/dir/foo
@@ -1 +1 @@
-head
+work
Stash this hunk [y,n,q,a,d,/,e,?]? ok 16 - am (U/U)

expecting success: 
	# Apply ISO-8859-1 patches with ISO-8859-1 commitencoding
	git config i18n.commitencoding ISO8859-1 &&
	. "$TEST_DIRECTORY"/t3901-8859-1.txt &&

	git reset --hard master &&
	git am out-l1 out-l2 &&

	check_encoding 2 8859


HEAD is now at 1abbfe5 Second on main
Applying: Second on side
Saved working directory and index state WIP on master: afb85ba second
Applying: Third on side
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
encoding ISO8859-1
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
encoding ISO8859-1
ok 17 - am (L/L)

expecting success: 
	# Apply ISO-8859-1 patches with UTF-8 commitencoding
	git config i18n.commitencoding UTF-8 &&
	. "$TEST_DIRECTORY"/t3901-utf8.txt &&
	git reset --hard master &&

	# am specifies --utf8 by default.
	git am out-l1 out-l2 &&

	check_encoding 2

Merging Updated upstream with Stashed changes
Merging:
virtual Updated upstream
virtual Stashed changes
found 1 common ancestor:
virtual d74e5012f311ddb74ee390126e4df2c1391cc04b
HEAD is now at afb85ba second
HEAD is now at 1abbfe5 Second on main
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   file

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	expect
	output
	stashlist1
	stashlist2

no changes added to commit (use "git add" and/or "git commit -a")
Applying: Second on side
ok 10 - drop top stash

expecting success: 
	git reset --hard &&
	echo 8 > file &&
	git stash &&
	echo 9 > file &&
	git stash &&
	git stash drop stash@{1} &&
	test 2 = $(git stash list | wc -l) &&
	git stash apply &&
	test 9 = $(cat file) &&
	test 1 = $(git show :file) &&
	test 1 = $(git show HEAD:file) &&
	git reset --hard &&
	git stash drop &&
	git stash apply &&
	test 3 = $(cat file) &&
	test 1 = $(git show :file) &&
	test 1 = $(git show HEAD:file)

Submodule path 'submod': checked out '9485eff4ef4a8297ed1ff19aa3d53200258359eb'
HEAD is now at da68008 other-file
Applying: Third on side
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual 933b7810e0d844b5ea1fdca8c598255ba6838976
error: the following submodule (or one of its nested submodules)
uses a .git directory:
    submod
(use 'rm -rf' if you really want to remove it including all of its history)
ok 18 - am (U/L)

expecting success: 
	# Apply ISO-8859-1 patches with UTF-8 commitencoding
	git config i18n.commitencoding UTF-8 &&
	. "$TEST_DIRECTORY"/t3901-utf8.txt &&

	git reset --hard master &&
	git am --no-utf8 out-l1 out-l2 2>err &&

	# commit-tree will warn that the commit message does not contain valid UTF-8
	# as mailinfo did not convert it
	grep "did not conform" err &&

	check_encoding 2

HEAD is now at 1abbfe5 Second on main
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   HEAD
	modified:   dir/foo

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	_head
	_index_bar
	_worktree_bar

no changes added to commit (use "git add" and/or "git commit -a")
error: the following submodule (or one of its nested submodules)
uses a .git directory:
    submod
(use 'rm -rf' if you really want to remove it including all of its history)
Applying: Second on side
ok 3 - git stash -p

expecting success: 
	set_state HEAD HEADfile_work HEADfile_index &&
	set_state bar bar_work bar_index &&
	set_state dir/foo work index &&
	(echo y; echo n; echo y) | git stash save -p --no-keep-index &&
	verify_state HEAD committed committed &&
	verify_state bar bar_work dummy &&
	verify_state dir/foo head head &&
	git reset --hard &&
	git stash apply --index &&
	verify_state HEAD HEADfile_work HEADfile_index &&
	verify_state bar dummy bar_index &&
	verify_state dir/foo work index

Applying: Third on side
ok 58 - rm of a populated submodule with a .git directory fails even when forced

expecting success: 
	git reset --hard &&
	git submodule update &&
	(cd submod &&
		git update-index --add --cacheinfo 160000 $(git rev-parse HEAD) subsubmod &&
		git config -f .gitmodules submodule.sub.url ../. &&
		git config -f .gitmodules submodule.sub.path subsubmod &&
		git submodule init &&
		git add .gitmodules &&
		git commit -m "add subsubmodule" &&
		git submodule update subsubmod
	) &&
	git commit -a -m "added deep submodule"

Warning: commit message did not conform to UTF-8.
Warning: commit message did not conform to UTF-8.
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
HEAD is now at 1695754 add submodule
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
ok 19 - am --no-utf8 (U/L)

Saved working directory and index state WIP on master: da68008 other-file
expecting success: 
	# Apply UTF-8 patches with ISO-8859-1 commitencoding
	git config i18n.commitencoding ISO8859-1 &&
	. "$TEST_DIRECTORY"/t3901-8859-1.txt &&

	git reset --hard master &&
	# mailinfo will re-code the commit message to the charset specified by
	# i18n.commitencoding
	git am out-u1 out-u2 &&

	check_encoding 2 8859

HEAD is now at da68008 other-file
HEAD is now at 1abbfe5 Second on main
Applying: Second on side
Applying: Third on side
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
encoding ISO8859-1
From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?= <author@example.com>
encoding ISO8859-1
ok 20 - am (L/U)

# passed all 20 test(s)
1..20
*** t3905-stash-include-untracked.sh ***
Submodule path 'submod': checked out '9485eff4ef4a8297ed1ff19aa3d53200258359eb'
Saved working directory and index state WIP on master: da68008 other-file
HEAD is now at da68008 other-file
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3905-stash-include-untracked/.git/
expecting success: 
	echo 1 > file &&
	git add file &&
	test_tick &&
	git commit -m initial &&
	echo 2 > file &&
	git add file &&
	echo 3 > file &&
	test_tick &&
	echo 1 > file2 &&
	echo 1 > HEAD &&
	mkdir untracked &&
	echo untracked >untracked/untracked &&
	git stash --include-untracked &&
	git diff-files --quiet &&
	git diff-index --cached --quiet HEAD

[master (root-commit) 777c62c] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
Dropped stash@{1} (4cddf9fb477532997652a8afc01954426f91eba3)
Submodule 'sub' (/«PKGBUILDDIR»/t/trash directory.t3600-rm/.) registered for path 'subsubmod'
[detached HEAD b8a0c92] add subsubmodule
 Author: A U Thor <author@example.com>
 2 files changed, 4 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 subsubmod
diff --git a/HEAD b/HEAD
index d0fe822..e74fca5 100644
--- a/HEAD
+++ b/HEAD
@@ -1 +1 @@
-committed
+HEADfile_work
Stash this hunk [y,n,q,a,d,/,e,?]? 
diff --git a/bar b/bar
index 421376d..8c999e6 100644
--- a/bar
+++ b/bar
@@ -1 +1 @@
-dummy
+bar_work
Stash this hunk [y,n,q,a,d,/,e,?]? 
diff --git a/dir/foo b/dir/foo
index 564b12f..b8f99f5 100644
--- a/dir/foo
+++ b/dir/foo
@@ -1 +1 @@
-head
+work
Stash this hunk [y,n,q,a,d,/,e,?]? 
Saved working directory and index state WIP on master: 777c62c initial
HEAD is now at 777c62c initial
Saved working directory and index state WIP on master: afb85ba second
Cloning into 'subsubmod'...
ok 1 - stash save --include-untracked some dirty working directory

expecting success: 
	git status --porcelain >actual &&
	test_cmp expect actual

Unstaged changes after reset:
M	bar
Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual 770d5dd741b05b1e8b8a782bea5b55d3cf4c1603
ok 2 - stash save --include-untracked cleaned the untracked files

expecting success: 
	test_path_is_missing file2 &&
	test_path_is_missing untracked &&
	test_path_is_missing HEAD &&
	git diff HEAD stash^3 -- HEAD file2 untracked >actual &&
	test_cmp expect.diff actual &&
	git ls-tree --name-only stash^3: >actual &&
	test_cmp expect.lstree actual

done.
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   file

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	expect
	output
	stashlist1
	stashlist2

no changes added to commit (use "git add" and/or "git commit -a")
ok 3 - stash save --include-untracked stashed the untracked files

expecting success: 
	test_must_fail git stash --patch --include-untracked

HEAD is now at afb85ba second
HEAD is now at da68008 other-file
Can't use --patch and --include-untracked or --all at the same time
ok 4 - stash save --patch --include-untracked fails

expecting success: 
	test_must_fail git stash --patch --all

Submodule path 'subsubmod': checked out '9485eff4ef4a8297ed1ff19aa3d53200258359eb'
[master f2c98b4] added deep submodule
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 59 - setup subsubmodule

expecting success: 
	git rm submod &&
	test ! -d submod &&
	git status -s -uno --ignore-submodules=none > actual &&
	test_cmp expect actual

Can't use --patch and --include-untracked or --all at the same time
ok 5 - stash save --patch --all fails

expecting success: 
	git stash pop &&
	git status --porcelain >actual &&
	test_cmp expect actual &&
	test "1" = "$(cat file2)" &&
	test untracked = "$(cat untracked/untracked)"

Dropped refs/stash@{0} (777679267d781043d87582428a71327b965c3c13)
Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual 933b7810e0d844b5ea1fdca8c598255ba6838976
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	modified:   HEAD
	modified:   bar
	modified:   dir/foo

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   HEAD
	modified:   bar
	modified:   dir/foo

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	_head
	_index_bar
	_worktree_bar

ok 4 - git stash -p --no-keep-index

expecting success: 
	set_state HEAD HEADfile_work HEADfile_index &&
	set_state bar bar_work bar_index &&
	set_state dir/foo work index &&
	(echo y; echo n; echo y) | git stash save --no-keep-index -p &&
	verify_state HEAD committed committed &&
	verify_state dir/foo head head &&
	verify_state bar bar_work dummy &&
	git reset --hard &&
	git stash apply --index &&
	verify_state HEAD HEADfile_work HEADfile_index &&
	verify_state bar dummy bar_index &&
	verify_state dir/foo work index

rm 'submod'
ok 60 - rm recursively removes work tree of unmodified submodules

expecting success: 
	git reset --hard &&
	git submodule update --recursive &&
	(cd submod/subsubmod &&
		git checkout HEAD^
	) &&
	test_must_fail git rm submod &&
	test -d submod &&
	test -f submod/.git &&
	git status -s -uno --ignore-submodules=none > actual &&
	test_cmp expect.modified actual &&
	git rm -f submod &&
	test ! -d submod &&
	git status -s -uno --ignore-submodules=none > actual &&
	test_cmp expect actual

HEAD is now at f2c98b4 added deep submodule
Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual f27c6ae26adb8396d3861976ba268f87ad8afa0b
Merging Updated upstream with Stashed changes
Merging:
virtual Updated upstream
virtual Stashed changes
found 1 common ancestor:
virtual d74e5012f311ddb74ee390126e4df2c1391cc04b
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   file

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	HEAD
	expect
	file2
	untracked/

no changes added to commit (use "git add" and/or "git commit -a")
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   file

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	expect
	output
	stashlist1
	stashlist2

no changes added to commit (use "git add" and/or "git commit -a")
Dropped refs/stash@{0} (0a7d204f1703777538511f544d27630f4eca5b11)
ok 11 - drop middle stash

expecting success: 
	git reset --hard &&
	git stash pop &&
	test 3 = $(cat file) &&
	test 1 = $(git show :file) &&
	test 1 = $(git show HEAD:file) &&
	test 0 = $(git stash list | wc -l)

HEAD is now at da68008 other-file
ok 6 - stash pop after save --include-untracked leaves files untracked again

expecting success: 
	echo 4 > file3 &&
	git add file3 &&
	test_tick &&
	git stash -u

Merging Updated upstream with Stashed changes
Merging:
virtual Updated upstream
virtual Stashed changes
found 1 common ancestor:
virtual d74e5012f311ddb74ee390126e4df2c1391cc04b
Submodule path 'submod': checked out 'b8a0c921dcc839efabe43622eb13cf23a5c760f7'
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   file

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	expect
	output
	stashlist1
	stashlist2

no changes added to commit (use "git add" and/or "git commit -a")
Dropped refs/stash@{0} (a43ba8d1b2a394093a0266779d336b4592afa616)
Saved working directory and index state WIP on master: 777c62c initial
HEAD is now at 777c62c initial
ok 7 - stash save -u dirty index

expecting success: 
	git stash pop --index &&
	git diff --cached >actual &&
	test_cmp expect actual

ok 12 - stash pop

expecting success: 
	echo foo > file &&
	git commit file -m first &&
	echo bar > file &&
	echo bar2 > file2 &&
	git add file2 &&
	git stash &&
	echo baz > file &&
	git commit file -m second &&
	git stash branch stashbranch &&
	test refs/heads/stashbranch = $(git symbolic-ref HEAD) &&
	test $(git rev-parse HEAD) = $(git rev-parse master^) &&
	git diff --cached > output &&
	test_cmp output expect &&
	git diff > output &&
	test_cmp output expect1 &&
	git add file &&
	git commit -m alternate\ second &&
	git diff master..stashbranch > output &&
	test_cmp output expect2 &&
	test 0 = $(git stash list | wc -l)

Submodule path 'submod/subsubmod': checked out '9485eff4ef4a8297ed1ff19aa3d53200258359eb'
[master ce675cf] first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Previous HEAD position was 9485eff... subdir test
HEAD is now at ce5f9b9... remove file from rm --quiet test
Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual f27c6ae26adb8396d3861976ba268f87ad8afa0b
diff --git a/HEAD b/HEAD
index d0fe822..e74fca5 100644
--- a/HEAD
+++ b/HEAD
@@ -1 +1 @@
-committed
+HEADfile_work
Stash this hunk [y,n,q,a,d,/,e,?]? On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	new file:   file3

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   file

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	expect


diff --git a/bar b/bar
index 421376d..8c999e6 100644
--- a/bar
+++ b/bar
@@ -1 +1 @@
-dummy
+bar_work
Stash this hunk [y,n,q,a,d,/,e,?]? 
Dropped refs/stash@{0} (d531845c34afd9e73a5059048aeaaaf9bdbf02ff)
diff --git a/dir/foo b/dir/foo
index 564b12f..b8f99f5 100644
--- a/dir/foo
+++ b/dir/foo
@@ -1 +1 @@
-head
+work
Stash this hunk [y,n,q,a,d,/,e,?]? 
Saved working directory and index state WIP on master: ce675cf first
ok 8 - stash save --include-untracked dirty index got stashed

HEAD is now at ce675cf first
expecting success: 
	echo 1 > file5 &&
	git stash save --include-untracked --quiet > .git/stash-output.out 2>&1 &&
	test_line_count = 0 .git/stash-output.out &&
	rm -f .git/stash-output.out

Saved working directory and index state WIP on master: afb85ba second
[master 662e8e5] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Unstaged changes after reset:
M	bar
HEAD is now at afb85ba second
error: the following file has local modifications:
    submod
(use --cached to keep the file, or -f to force removal)
Switched to a new branch 'stashbranch'
Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual 4ef46cf585089766e6044653b0d8f66d6f10af57
On branch stashbranch
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	new file:   file2

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   file

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	expect
	expect1
	expect2
	output
	stashlist1
	stashlist2

Dropped refs/stash@{0} (d64e0e36da535def9a27ffff1d9cc23a66b62fb0)
Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual 933b7810e0d844b5ea1fdca8c598255ba6838976
ok 9 - stash save --include-untracked -q is quiet

expecting success: 
	rm -f file &&
	git stash save --include-untracked &&
	echo 1 > expect &&
	test_cmp file expect

On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	modified:   HEAD
	modified:   bar
	modified:   dir/foo

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   HEAD
	modified:   bar
	modified:   dir/foo

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	_head
	_index_bar
	_worktree_bar

rm 'submod'
ok 61 - rm of a populated nested submodule with different nested HEAD fails unless forced

expecting success: 
	git reset --hard &&
	git submodule update --recursive &&
	(cd submod/subsubmod &&
		echo X >empty
	) &&
	test_must_fail git rm submod &&
	test -d submod &&
	test -f submod/.git &&
	git status -s -uno --ignore-submodules=none > actual &&
	test_cmp expect.modified actual &&
	git rm -f submod &&
	test ! -d submod &&
	git status -s -uno --ignore-submodules=none > actual &&
	test_cmp expect actual

ok 5 - git stash --no-keep-index -p

expecting success: 
	verify_saved_head

[stashbranch d3a23d9] alternate second
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 file2
HEAD is now at f2c98b4 added deep submodule
ok 6 - none of this moved HEAD

checking known breakage: 
	git reset --hard &&
	cat >test <<-\EOF &&
	aaa
	bbb
	ccc
	EOF
	git add test &&
	git commit -m "initial" &&
	cat >test <<-\EOF &&
	aaa
	added line 1
	bbb
	added line 2
	ccc
	EOF
	printf "%s\n" s n y q |
	test_might_fail git stash -p 2>error &&
	! test_must_be_empty error &&
	grep "added line 1" test &&
	! grep "added line 2" test

HEAD is now at afb85ba second
[master 1a1d104] initial
 Author: A U Thor <author@example.com>
 1 file changed, 3 insertions(+)
 create mode 100644 test
ok 13 - stash branch

expecting success: 
	echo foo > file &&
	git stash &&
	git stash apply -q > output.out 2>&1 &&
	test_must_be_empty output.out

Saved working directory and index state WIP on master: 777c62c initial
HEAD is now at 777c62c initial
ok 10 - stash save --include-untracked removed files

expecting success: 
	git stash pop &&
	test_path_is_missing file

Submodule path 'submod': checked out 'b8a0c921dcc839efabe43622eb13cf23a5c760f7'
Saved working directory and index state WIP on stashbranch: d3a23d9 alternate second
HEAD is now at d3a23d9 alternate second
Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual f27c6ae26adb8396d3861976ba268f87ad8afa0b
Removing file
On branch master
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	deleted:    file

no changes added to commit (use "git add" and/or "git commit -a")
Dropped refs/stash@{0} (0fe2ec27acd9fc86eb08e4840c3d194b1a902734)
ok 11 - stash save --include-untracked removed files got stashed

expecting success: 
	echo ignored > ignored &&
	mkdir ignored.d &&
	echo ignored >ignored.d/untracked &&
	git stash -u &&
	test -s ignored &&
	test -s ignored.d/untracked &&
	test -s .gitignore

Submodule path 'submod/subsubmod': checked out '9485eff4ef4a8297ed1ff19aa3d53200258359eb'
ok 14 - apply -q is quiet

expecting success: 
	git stash save --quiet > output.out 2>&1 &&
	test_must_be_empty output.out

diff --git a/test b/test
index 1802a74..515ff88 100644
--- a/test
+++ b/test
@@ -1,3 +1,5 @@
 aaa
+added line 1
 bbb
+added line 2
 ccc
Stash this hunk [y,n,q,a,d,/,s,e,?]? Split into 2 hunks.
@@ -1,2 +1,3 @@
 aaa
+added line 1
 bbb
Stash this hunk [y,n,q,a,d,/,j,J,g,e,?]? @@ -2,2 +3,3 @@
 bbb
+added line 2
 ccc
Stash this hunk [y,n,q,a,d,/,K,g,e,?]? 
Saved working directory and index state WIP on master: 777c62c initial
HEAD is now at 777c62c initial
ok 12 - stash save --include-untracked respects .gitignore

expecting success: 
	echo 4 > file4 &&
	git stash -u &&
	test_path_is_missing file4

Saved working directory and index state WIP on master: 1a1d104 initial
'error' is not empty, it contains:
error: patch failed: test:1
error: test: patch does not apply
Cannot remove worktree changes
ok 15 - save -q is quiet

expecting success: 
	git stash pop -q > output.out 2>&1 &&
	test_must_be_empty output.out

added line 1
added line 2
not ok 7 - stash -p with split hunk # TODO known breakage

# still have 1 known breakage(s)
# passed all remaining 6 test(s)
1..7
*** t3906-stash-submodule.sh ***
error: the following file has local modifications:
    submod
(use --cached to keep the file, or -f to force removal)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3906-stash-submodule/.git/
checking known breakage: 
		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
		)
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3906-stash-submodule/submodule_update_repo/.git/
[master (root-commit) 61c2806] 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
Switched to a new branch 'add_sub1'
ok 16 - pop -q is quiet

expecting success: 
	echo foo > file &&
	git add file &&
	git stash save --quiet &&
	git stash pop -q --index > output.out 2>&1 &&
	test foo = "$(git show :file)" &&
	test_must_be_empty output.out

Saved working directory and index state WIP on master: 777c62c initial
HEAD is now at 777c62c initial
ok 13 - stash save -u can stash with only untracked files different

expecting success: 
	git stash -a &&
	test_path_is_missing ignored &&
	test_path_is_missing ignored.d &&
	test_path_is_missing .gitignore

rm 'submod'
ok 62 - rm of a populated nested submodule with nested modifications fails unless forced

expecting success: 
	git reset --hard &&
	git submodule update --recursive &&
	(cd submod/subsubmod &&
		echo X >untracked
	) &&
	test_must_fail git rm submod &&
	test -d submod &&
	test -f submod/.git &&
	git status -s -uno --ignore-submodules=none > actual &&
	test_cmp expect.modified actual &&
	git rm -f submod &&
	test ! -d submod &&
	git status -s -uno --ignore-submodules=none > actual &&
	test_cmp expect actual

Cloning into 'sub1'...
HEAD is now at f2c98b4 added deep submodule
done.
[add_sub1 9a0f58a] Add sub1
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
Saved working directory and index state WIP on master: 777c62c initial
HEAD is now at 777c62c initial
Switched to a new branch 'remove_sub1'
ok 14 - stash save --all does not respect .gitignore

expecting success: 
	git stash pop &&
	test -s ignored &&
	test -s ignored.d/untracked &&
	test -s .gitignore

Removing sub1
Removing .gitmodules
[remove_sub1 004ee8c] Revert "Add sub1"
 Author: A U Thor <author@example.com>
 2 files changed, 5 deletions(-)
 delete mode 100644 .gitmodules
 delete mode 160000 sub1
Submodule path 'submod': checked out 'b8a0c921dcc839efabe43622eb13cf23a5c760f7'
Switched to a new branch 'modify_sub1'
ok 17 - pop -q --index works and is quiet

expecting success: 
	git stash &&
	git stash drop -q > output.out 2>&1 &&
	test_must_be_empty output.out

Merging Version stash was based on with Version stash was based on
Merging:
virtual Version stash was based on
virtual Version stash was based on
found 1 common ancestor:
virtual f27c6ae26adb8396d3861976ba268f87ad8afa0b
Already up-to-date!
On branch master
nothing to commit, working directory clean
Dropped refs/stash@{0} (237dbb933d97e03cdd270bc30c51e573dcf9a6ca)
Submodule path 'submod/subsubmod': checked out '9485eff4ef4a8297ed1ff19aa3d53200258359eb'
ok 15 - stash save --all is stash poppable

# passed all 15 test(s)
1..15
From /«PKGBUILDDIR»/t/trash directory.t3906-stash-submodule/submodule_update_repo/.
   61c2806..9a0f58a  add_sub1   -> origin/add_sub1
 * [new branch]      modify_sub1 -> origin/modify_sub1
 * [new branch]      remove_sub1 -> origin/remove_sub1
*** t3910-mac-os-precompose.sh ***
Switched to a new branch 'modifications'
[modifications b623f9c] modified file2 and added file3
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 file3
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t3910-mac-os-precompose/.git/
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

)
Saved working directory and index state WIP on stashbranch: d3a23d9 alternate second
prerequisite UTF8_NFD_TO_NFC not satisfied
HEAD is now at d3a23d9 alternate second
1..0 # SKIP filesystem does not corrupt utf-8
*** t4000-diff-format.sh ***
To /«PKGBUILDDIR»/t/trash directory.t3906-stash-submodule/submodule_update_repo/.
 * [new branch]      modifications -> modifications
[modify_sub1 57efae9] Modify sub1
 Author: A U Thor <author@example.com>
Switched to a new branch 'replace_sub1_with_directory'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4000-diff-format/.git/
expecting success: 
	git update-index --add path0 path1

ok 1 - update-index --add two files with and without +x.

expecting success: 
	git diff-files -p >actual

ok 2 - git diff-files -p after editing work tree.

ok 18 - drop -q is quiet

expecting success: 
	compare_diff_patch expected actual

expecting success: 
	echo bar3 > file &&
	echo bar4 > file2 &&
	git add file2 &&
	git stash -k &&
	test bar,bar4 = $(cat file),$(cat file2)

ok 3 - validate git diff-files -p output.

expecting success: 
	git diff-files -s >actual 2>err &&
	test_must_be_empty actual &&
	test_must_be_empty err

ok 4 - git diff-files -s after editing work tree

expecting success: 
	git diff-files --no-patch >actual 2>err &&
	test_must_be_empty actual &&
	test_must_be_empty err

ok 5 - git diff-files --no-patch as synonym for -s

expecting success: 
	git diff-files --no-patch --patch >actual &&
	compare_diff_patch expected actual

error: the following file has local modifications:
    submod
(use --cached to keep the file, or -f to force removal)
ok 6 - git diff-files --no-patch --patch shows the patch

expecting success: 
	git diff-files --no-patch --patch-with-raw >actual &&
	grep -q "^:100644 100755 .* 0000000000000000000000000000000000000000 M	path0\$" actual &&
	tail -n +4 actual >actual-patch &&
	compare_diff_patch expected actual-patch

ok 7 - git diff-files --no-patch --patch-with-raw shows the patch and raw data

expecting success: 
	git diff-files --patch --no-patch >actual 2>err &&
	test_must_be_empty actual &&
	test_must_be_empty err

ok 8 - git diff-files --patch --no-patch does not show the patch

# passed all 8 test(s)
1..8
Submodule path 'sub1': checked out '61c28065465efb3e256cc3dff7fc62fe1ccc400c'
*** t4001-diff-rename.sh ***
Previous HEAD position was 61c2806... Base
Switched to branch 'modifications'
rm 'sub1'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4001-diff-rename/.git/
[replace_sub1_with_directory cb4c3ad] 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
Saved working directory and index state WIP on stashbranch: d3a23d9 alternate second
expecting success: git update-index --add path0
Switched to a new branch 'replace_directory_with_sub1'
ok 1 - update-index --add a file.

expecting success: tree=$(git write-tree) && echo $tree
HEAD is now at d3a23d9 alternate second
Removing sub1/file3
Removing sub1/file2
Removing sub1/file1
Adding sub1
1b20f13cbc54b85aaafd1cf0e2e74bb6c6dd01ea
ok 2 - write that tree.

expecting success: git update-index --add --remove path0 path1
ok 19 - stash -k

expecting success: 
	echo bar33 > file &&
	echo bar44 > file2 &&
	git add file2 &&
	git stash --no-keep-index &&
	test bar,bar2 = $(cat file),$(cat file2)

rm 'submod'
[replace_directory_with_sub1 12d7ce2] 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 3 - renamed and edited the file.

expecting success: git diff-index -p -M $tree >current
ok 63 - rm of a populated nested submodule with nested untracked files fails unless forced

expecting success: 
	git reset --hard &&
	git submodule update --recursive &&
	(cd submod/subsubmod &&
		rm .git &&
		cp -R ../../.git/modules/sub/modules/sub .git &&
		GIT_WORK_TREE=. git config --unset core.worktree
	) &&
	test_must_fail git rm submod &&
	test -d submod &&
	test -d submod/subsubmod/.git &&
	git status -s -uno --ignore-submodules=none > actual &&
	! test -s actual &&
	test_must_fail git rm -f submod &&
	test -d submod &&
	test -d submod/subsubmod/.git &&
	git status -s -uno --ignore-submodules=none > actual &&
	! test -s actual &&
	rm -rf submod

Switched to a new branch 'replace_sub1_with_file'
ok 4 - git diff-index -p -M after rename and editing.

HEAD is now at f2c98b4 added deep submodule
expecting success: compare_diff_patch current expected
rm 'sub1'
ok 5 - validate the output.

expecting success: 
	cp path1 another-path &&
	git add another-path &&
	git commit -m 1 &&
	git rm path1 &&
	mkdir subdir &&
	git mv another-path subdir/path1 &&
	git status | test_i18ngrep "renamed: .*path1 -> subdir/path1"
[replace_sub1_with_file a888eec] Replace sub1 with file
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
[master (root-commit) 16abca3] 1
 Author: A U Thor <author@example.com>
 2 files changed, 32 insertions(+)
 create mode 100644 another-path
 create mode 100644 path1
Switched to a new branch 'replace_file_with_sub1'
rm 'path1'
[replace_file_with_sub1 e21e8e0] Revert "Replace sub1 with file"
 Author: A U Thor <author@example.com>
 2 files changed, 5 insertions(+), 1 deletion(-)
 mode change 100644 => 160000 sub1
	renamed:    path1 -> subdir/path1
ok 6 - favour same basenames over different ones

expecting success: 
	git show HEAD:path1 | sed "s/15/16/" > subdir/path1 &&
	git status | test_i18ngrep "renamed: .*path1 -> subdir/path1"
Switched to a new branch 'invalid_sub1'
	renamed:    path1 -> subdir/path1
ok 7 - favour same basenames even with minor differences

expecting success: 
	git reset --hard &&
	for i in 0 1 2 3 4 5 6 7 8 9;
	do
		for j in 0 1 2 3 4 5 6 7 8 9;
		do
			echo "$i$j" >"path$i$j"
		done
	done &&
	git add "path??" &&
	test_tick &&
	git commit -m "hundred" &&
	(cat path1; echo new) >new-path &&
	echo old >>path1 &&
	git add new-path path1 &&
	git diff -l 4 -C -C --cached --name-status >actual 2>actual.err &&
	sed -e "s/^\([CM]\)[0-9]*	/\1	/" actual >actual.munged &&
	cat >expect <<-EOF &&
	C	path1	new-path
	M	path1
	EOF
	test_cmp expect actual.munged &&
	grep warning actual.err

[invalid_sub1 9444c6d] Invalid sub1 commit
 Author: A U Thor <author@example.com>
HEAD is now at 16abca3 1
Switched to a new branch 'valid_sub1'
[valid_sub1 edb7655] Revert "Invalid sub1 commit"
 Author: A U Thor <author@example.com>
Saved working directory and index state WIP on stashbranch: d3a23d9 alternate second
HEAD is now at d3a23d9 alternate second
Switched to branch 'master'
ok 20 - stash --no-keep-index

expecting success: 
	echo bar5 > file &&
	echo bar6 > file2 &&
	git add file2 &&
	test_must_fail git stash --invalid-option &&
	test_must_fail git stash save --invalid-option &&
	test bar5,bar6 = $(cat file),$(cat file2) &&
	git stash -- -message-starting-with-dash &&
	test bar,bar2 = $(cat file),$(cat file2)

Cloning into 'submodule_update'...
Submodule path 'submod': checked out 'b8a0c921dcc839efabe43622eb13cf23a5c760f7'
done.
error: unknown option for 'stash save': --invalid-option
       To provide a message, use git stash save -- '--invalid-option'
usage: git stash list [<options>]
   or: git stash show [<stash>]
   or: git stash drop [-q|--quiet] [<stash>]
   or: git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]
   or: git stash branch <branchname> [<stash>]
   or: git stash [save [--patch] [-k|--[no-]keep-index] [-q|--quiet]
		       [-u|--include-untracked] [-a|--all] [<message>]]
   or: git stash clear
[master 39576eb] hundred
 Author: A U Thor <author@example.com>
 100 files changed, 100 insertions(+)
 create mode 100644 path00
 create mode 100644 path01
 create mode 100644 path02
 create mode 100644 path03
 create mode 100644 path04
 create mode 100644 path05
 create mode 100644 path06
 create mode 100644 path07
 create mode 100644 path08
 create mode 100644 path09
 create mode 100644 path10
 create mode 100644 path11
 create mode 100644 path12
 create mode 100644 path13
 create mode 100644 path14
 create mode 100644 path15
 create mode 100644 path16
 create mode 100644 path17
 create mode 100644 path18
 create mode 100644 path19
 create mode 100644 path20
 create mode 100644 path21
 create mode 100644 path22
 create mode 100644 path23
 create mode 100644 path24
 create mode 100644 path25
 create mode 100644 path26
 create mode 100644 path27
 create mode 100644 path28
 create mode 100644 path29
 create mode 100644 path30
 create mode 100644 path31
 create mode 100644 path32
 create mode 100644 path33
 create mode 100644 path34
 create mode 100644 path35
 create mode 100644 path36
 create mode 100644 path37
 create mode 100644 path38
 create mode 100644 path39
 create mode 100644 path40
 create mode 100644 path41
 create mode 100644 path42
 create mode 100644 path43
 create mode 100644 path44
 create mode 100644 path45
 create mode 100644 path46
 create mode 100644 path47
 create mode 100644 path48
 create mode 100644 path49
 create mode 100644 path50
 create mode 100644 path51
 create mode 100644 path52
 create mode 100644 path53
 create mode 100644 path54
 create mode 100644 path55
 create mode 100644 path56
 create mode 100644 path57
 create mode 100644 path58
 create mode 100644 path59
 create mode 100644 path60
 create mode 100644 path61
 create mode 100644 path62
 create mode 100644 path63
 create mode 100644 path64
 create mode 100644 path65
 create mode 100644 path66
 create mode 100644 path67
 create mode 100644 path68
 create mode 100644 path69
 create mode 100644 path70
 create mode 100644 path71
 create mode 100644 path72
 create mode 100644 path73
 create mode 100644 path74
 create mode 100644 path75
 create mode 100644 path76
 create mode 100644 path77
 create mode 100644 path78
 create mode 100644 path79
 create mode 100644 path80
 create mode 100644 path81
 create mode 100644 path82
 create mode 100644 path83
 create mode 100644 path84
 create mode 100644 path85
 create mode 100644 path86
 create mode 100644 path87
 create mode 100644 path88
 create mode 100644 path89
 create mode 100644 path90
 create mode 100644 path91
 create mode 100644 path92
 create mode 100644 path93
 create mode 100644 path94
 create mode 100644 path95
 create mode 100644 path96
 create mode 100644 path97
 create mode 100644 path98
 create mode 100644 path99
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Branch add_sub1 set up to track remote branch add_sub1 from origin.
warning: only found copies from modified paths due to too many files.
warning: you may want to set your diff.renameLimit variable to at least 102 and retry the command.
ok 8 - setup for many rename source candidates

expecting success: 
	mkdir -p a/b/ &&
	: >a/b/c &&
	git add a/b/c &&
	git commit -m "create a/b/c" &&
	mkdir -p c/b/ &&
	git mv a/b/c c/b/a &&
	git commit -m "a/b/c -> c/b/a" &&
	git diff -M --summary HEAD^ HEAD >output &&
	test_i18ngrep " a/b/c => c/b/a " output &&
	git diff -M --stat HEAD^ HEAD >output &&
	test_i18ngrep " a/b/c => c/b/a " output

error: unknown option for 'stash save': --invalid-option
usage: git stash list [<options>]
   or: git stash show [<stash>]
   or: git stash drop [-q|--quiet] [<stash>]
   or: git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]
   or: git stash branch <branchname> [<stash>]
   or: git stash [save [--patch] [-k|--[no-]keep-index] [-q|--quiet]
		       [-u|--include-untracked] [-a|--all] [<message>]]
   or: git stash clear
       To provide a message, use git stash save -- '--invalid-option'
[master 7add406] create a/b/c
 Author: A U Thor <author@example.com>
 3 files changed, 18 insertions(+)
 create mode 100644 a/b/c
 create mode 100644 new-path
Submodule path 'submod/subsubmod': checked out '9485eff4ef4a8297ed1ff19aa3d53200258359eb'
[master ac6ddf7] a/b/c -> c/b/a
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename a/b/c => c/b/a (100%)
 rename a/b/c => c/b/a (100%)
 a/b/c => c/b/a | 0
ok 9 - rename pretty print with nothing in common

expecting success: 
	mkdir -p c/d &&
	git mv c/b/a c/d/e &&
	git commit -m "c/b/a -> c/d/e" &&
	git diff -M --summary HEAD^ HEAD >output &&
	test_i18ngrep " c/{b/a => d/e} " output &&
	git diff -M --stat HEAD^ HEAD >output &&
	test_i18ngrep " c/{b/a => d/e} " output

[master 07e840a] c/b/a -> c/d/e
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename c/{b/a => d/e} (100%)
 rename c/{b/a => d/e} (100%)
 c/{b/a => d/e} | 0
ok 10 - rename pretty print with common prefix

expecting success: 
	mkdir d &&
	git mv c/d/e d/e &&
	git commit -m "c/d/e -> d/e" &&
	git diff -M --summary HEAD^ HEAD >output &&
	test_i18ngrep " {c/d => d}/e " output &&
	git diff -M --stat HEAD^ HEAD >output &&
	test_i18ngrep " {c/d => d}/e " output

Saved working directory and index state WIP on no_submodule: 61c2806 Base
Saved working directory and index state On stashbranch: -message-starting-with-dash
[master d5311be] c/d/e -> d/e
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename {c/d => d}/e (100%)
HEAD is now at 61c2806 Base
HEAD is now at d3a23d9 alternate second
ok 21 - stash --invalid-option

expecting success: 
	git reset --hard &&
	echo new >file3 &&
	git add file3 &&
	git stash save "added file" &&
	! test -r file3 &&
	git stash apply &&
	test new = "$(cat file3)"

 rename {c/d => d}/e (100%)
HEAD is now at d3a23d9 alternate second
 {c/d => d}/e | 0
ok 11 - rename pretty print with common suffix

expecting success: 
	mkdir d/f &&
	git mv d/e d/f/e &&
	git commit -m "d/e -> d/f/e" &&
	git diff -M --summary HEAD^ HEAD >output &&
	test_i18ngrep " d/{ => f}/e " output &&
	git diff -M --stat HEAD^ HEAD >output &&
	test_i18ngrep " d/{ => f}/e " output

[master 2ebe98d] d/e -> d/f/e
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename d/{ => f}/e (100%)
 rename d/{ => f}/e (100%)
 d/{ => f}/e | 0
ok 12 - rename pretty print with common prefix and suffix

expecting success: 
	mkdir d/f/f &&
	git mv d/f/e d/f/f/e &&
	git commit -m "d/f/e d/f/f/e" &&
	git diff -M --summary HEAD^ HEAD >output &&
	test_i18ngrep " d/f/{ => f}/e " output &&
	git diff -M --stat HEAD^ HEAD >output &&
	test_i18ngrep " d/f/{ => f}/e " output

[master 242b719] d/f/e d/f/f/e
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename d/f/{ => f}/e (100%)
error: the following submodule (or one of its nested submodules)
uses a .git directory:
    submod
(use 'rm -rf' if you really want to remove it including all of its history)
Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual ec38489b3f8eda08fda17055ad272abc24bdf929
 rename d/f/{ => f}/e (100%)
 d/f/{ => f}/e | 0
ok 13 - rename pretty print common prefix and suffix overlap

# passed all 13 test(s)
1..13
On branch no_submodule
Your branch is up-to-date with 'origin/no_submodule'.
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	new file:   .gitmodules

Saved working directory and index state On stashbranch: added file
HEAD is now at d3a23d9 alternate second
*** t4002-diff-basic.sh ***
Submodule sub1 is not populated
error: the following submodule (or one of its nested submodules)
uses a .git directory:
    submod
(use 'rm -rf' if you really want to remove it including all of its history)
not ok 1 - git_stash: added submodule creates empty directory # TODO known breakage

checking known breakage: 
		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
		)
	
Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual 900fec698da3cabc83135ee0b8e2bd7f99a28ab4
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4002-diff-basic/.git/
expecting success: git update-index --add $p &&
	    git update-index --add Z/$p
On branch stashbranch
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	new file:   file3

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	expect
	expect1
	expect2
	output
	output.out
	stashlist1
	stashlist2

ok 22 - stash an added file

expecting success: 
	git reset --hard &&
	git rm file &&
	echo bar7 >file &&
	git stash save "rm then recreate" &&
	test bar = "$(cat file)" &&
	git stash apply &&
	test bar7 = "$(cat file)"

ok 1 - adding test file NN and Z/NN

expecting success: git update-index --add $p &&
	    git update-index --add Z/$p
HEAD is now at d3a23d9 alternate second
Cloning into 'submodule_update'...
ok 64 - rm of a populated nested submodule with a nested .git directory fails even when forced

expecting success: 
	git commit -m "submodule removal" submod &&
	git checkout HEAD^ &&
	git submodule update &&
	git checkout -q HEAD^ 2>actual &&
	git checkout -q master 2>actual &&
	test_i18ngrep "^warning: unable to rmdir submod:" actual &&
	git status -s submod >actual &&
	echo "?? submod/" >expected &&
	test_cmp expected actual &&
	rm -rf submod &&
	git status -s -uno --ignore-submodules=none > actual &&
	! test -s actual

ok 2 - adding test file ND and Z/ND

expecting success: git update-index --add $p &&
	    git update-index --add Z/$p
rm 'file'
[master 0d1f1c5] submodule removal
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 160000 submod
done.
ok 3 - adding test file NM and Z/NM

expecting success: git update-index --add $p &&
	    git update-index --add Z/$p
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 f2c98b4... added deep submodule
ok 4 - adding test file DN and Z/DN

expecting success: git update-index --add $p &&
	    git update-index --add Z/$p
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
ok 5 - adding test file DD and Z/DD

expecting success: git update-index --add $p &&
	    git update-index --add Z/$p
ok 6 - adding test file DM and Z/DM

expecting success: git update-index --add $p &&
	    git update-index --add Z/$p
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 7 - adding test file MN and Z/MN

expecting success: git update-index --add $p &&
	    git update-index --add Z/$p
ok 8 - adding test file MD and Z/MD

expecting success: git update-index --add $p &&
	    git update-index --add Z/$p
ok 9 - adding test file MM and Z/MM

expecting success: git update-index --add SS
ok 10 - adding test file SS

expecting success: git update-index --add TT
Saved working directory and index state On stashbranch: rm then recreate
ok 11 - adding test file TT

expecting success: tree_O=$(git write-tree)
HEAD is now at d3a23d9 alternate second
ok 12 - prepare initial tree

expecting success: git update-index --remove $to_remove
ok 13 - change in branch A (removal)

expecting success: git update-index MD
ok 14 - change in branch A (modification)

expecting success: git update-index MM
ok 15 - change in branch A (modification)

expecting success: git update-index MN
Submodule path 'submod': checked out 'b8a0c921dcc839efabe43622eb13cf23a5c760f7'
ok 16 - change in branch A (modification)

expecting success: git update-index Z/MD
ok 17 - change in branch A (modification)

expecting success: git update-index Z/MM
warning: unable to rmdir submod: Directory not empty
ok 18 - change in branch A (modification)

expecting success: git update-index Z/MN
ok 19 - change in branch A (modification)

expecting success: git update-index --add AN
ok 20 - change in branch A (addition)

expecting success: git update-index --add AA
ok 65 - checking out a commit after submodule removal needs manual updates

expecting success: 
	rm -rf d &&
	mkdir d &&
	>d/f &&
	git add d &&
	rm -rf d &&
	>d &&
	git rm d/f &&
	test_must_fail git rev-parse --verify :d/f &&
	test_path_is_file d

ok 21 - change in branch A (addition)

expecting success: git update-index --add Z/AN
Saved working directory and index state WIP on no_submodule: 61c2806 Base
ok 22 - change in branch A (addition)

expecting success: git update-index --add Z/AA
HEAD is now at 61c2806 Base
rm 'd/f'
ok 23 - change in branch A (addition)

expecting success: git update-index --add LL &&
     git update-index SS
Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual 900fec698da3cabc83135ee0b8e2bd7f99a28ab4
fatal: Needed a single revision
ok 66 - rm of d/f when d has become a non-directory

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: 
	rm -rf d &&
	mkdir d &&
	>d/f &&
	git add d &&
	rm -rf d &&
	ln -s nonexistent d &&
	git rm d/f &&
	test_must_fail git rev-parse --verify :d/f &&
	test -h d &&
	test_path_is_missing d

--- expect	2015-12-16 10:56:33.565564821 +0000
+++ actual	2015-12-16 10:56:34.197564821 +0000
@@ -2,5 +2,3 @@
 expect
 file1
 file2
-
-sub1:
ok 24 - change in branch A (addition)

expecting success: git update-index TT
On branch stashbranch
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   file

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	expect
	expect1
	expect2
	output
	output.out
	stashlist1
	stashlist2

no changes added to commit (use "git add" and/or "git commit -a")
not ok 2 - git_stash: added submodule leaves existing empty directory alone # TODO known breakage

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
		)
	
ok 23 - stash rm then recreate

expecting success: 
	git reset --hard &&
	git rm file &&
	echo file >.gitignore &&
	git stash save "rm and ignore" &&
	test bar = "$(cat file)" &&
	test file = "$(cat .gitignore)" &&
	git stash apply &&
	! test -r file &&
	test file = "$(cat .gitignore)"

ok 25 - change in branch A (edit)

rm 'd/f'
expecting success: git update-index --add DF/DF
fatal: Needed a single revision
HEAD is now at d3a23d9 alternate second
ok 67 - rm of d/f when d has become a dangling symlink

expecting success: 
	rm -rf d &&
	>d &&
	git add d &&
	rm -f d &&
	mkdir d &&
	>d/f &&
	test_must_fail git rm d &&
	git rev-parse --verify :d &&
	test_path_is_file d/f

ok 26 - change in branch A (change file to directory)

expecting success: tree_A=$(git write-tree)
rm 'file'
ok 27 - recording branch A tree

fatal: git rm: 'd': Is a directory
rm 'd'
expecting success: git read-tree $tree_O &&
     git checkout-index -a
Cloning into 'submodule_update'...
e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
ok 68 - rm of file when it has become a directory

expecting success: 
	rm -rf d e &&
	mkdir e &&
	echo content >e/f &&
	ln -s e d &&
	git add -A e d &&
	git commit -m "symlink d to e, e/f exists" &&
	test_must_fail git rm d/f &&
	git rev-parse --verify :d &&
	git rev-parse --verify :e/f &&
	test -h d &&
	test_path_is_file e/f

done.
ok 28 - reading original tree and checking out

expecting success: git update-index --remove DD MD ND Z/DD Z/MD Z/ND
[master e886c3a] symlink d to e, e/f exists
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 120000 d
 create mode 100644 e/f
ok 29 - change in branch B (removal)

expecting success: git update-index DM
fatal: pathspec 'd/f' did not match any files
ok 30 - change in branch B (modification)

expecting success: git update-index MM
9cbe6ea56f225388ae614c419249bfc6d734cc30
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
d95f3ad14dee633a758d2e331151e950dd13e4ed
ok 69 - rm across a symlinked leading path (no index)

checking known breakage: 
	rm -rf d e &&
	mkdir d &&
	echo content >d/f &&
	git add -A e d &&
	git commit -m "d/f exists" &&
	mv d e &&
	ln -s e d &&
	test_must_fail git rm d/f &&
	git rev-parse --verify :d/f &&
	test -h d &&
	test_path_is_file e/f

ok 31 - change in branch B (modification)

expecting success: git update-index NM
ok 32 - change in branch B (modification)

expecting success: git update-index Z/DM
ok 33 - change in branch B (modification)

expecting success: git update-index Z/MM
[master a236894] d/f exists
 Author: A U Thor <author@example.com>
 2 files changed, 1 deletion(-)
 delete mode 120000 d
 rename {e => d}/f (100%)
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 34 - change in branch B (modification)

expecting success: git update-index Z/NM
ok 35 - change in branch B (modification)

expecting success: git update-index --add NA
rm 'd/f'
test_must_fail: command succeeded: git rm d/f
not ok 70 - rm across a symlinked leading path (w/ index) # TODO known breakage

expecting success: 
	>bar.txt &&
	>foo.txt &&
	git add bar.txt foo.txt

ok 36 - change in branch B (addition)

expecting success: git update-index --add AA
error: Untracked working tree file 'sub1' would be overwritten by merge.
ok 71 - setup for testing rm messages

expecting success: 
	cat >expect <<-\EOF &&
	error: the following files have staged content different from both the
	file and the HEAD:
	    bar.txt
	    foo.txt
	(use -f to force removal)
	EOF
	echo content1 >foo.txt &&
	echo content1 >bar.txt &&
	test_must_fail git rm foo.txt bar.txt 2>actual &&
	test_i18ncmp expect actual

ok 37 - change in branch B (addition)

expecting success: git update-index --add Z/NA
ok 72 - rm files with different staged content

expecting success: 
	cat >expect <<-\EOF &&
	error: the following files have staged content different from both the
	file and the HEAD:
	    bar.txt
	    foo.txt
	EOF
	echo content2 >foo.txt &&
	echo content2 >bar.txt &&
	test_must_fail git -c advice.rmhints=false rm foo.txt bar.txt 2>actual &&
	test_i18ncmp expect actual

Saved working directory and index state On stashbranch: rm and ignore
ok 38 - change in branch B (addition)

expecting success: git update-index --add Z/AA
HEAD is now at d3a23d9 alternate second
ok 73 - rm files with different staged content without hints

ok 39 - change in branch B (addition)

expecting success: 
	cat >expect <<-\EOF &&
	error: the following file has local modifications:
	    foo.txt
	(use --cached to keep the file, or -f to force removal)
	EOF
	git commit -m "testing rm 3" &&
	echo content3 >foo.txt &&
	test_must_fail git rm foo.txt 2>actual &&
	test_i18ncmp expect actual

ok 3 - git_stash: added submodule doesn't remove untracked unignored file with same name

checking known breakage: 
		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
		)
	
expecting success: git update-index --add LL &&
     git update-index SS
[master aaaff46] testing rm 3
 Author: A U Thor <author@example.com>
 3 files changed, 1 deletion(-)
 create mode 100644 bar.txt
 delete mode 100644 d/f
 create mode 100644 foo.txt
ok 40 - change in branch B (addition and modification)

expecting success: git update-index TT
ok 74 - rm file with local modification

expecting success: 
	cat >expect <<-\EOF &&
	error: the following file has local modifications:
	    bar.txt
	EOF
	echo content4 >bar.txt &&
	test_must_fail git -c advice.rmhints=false rm bar.txt 2>actual &&
	test_i18ncmp expect actual

Cloning into 'submodule_update'...
ok 41 - change in branch B (modification)

expecting success: git update-index --add DF
ok 75 - rm file with local modification without hints

expecting success: 
	cat >expect <<-\EOF &&
	error: the following file has changes staged in the index:
	    foo.txt
	(use --cached to keep the file, or -f to force removal)
	EOF
	git reset --hard &&
	echo content5 >foo.txt &&
	git add foo.txt &&
	test_must_fail git rm foo.txt 2>actual &&
	test_i18ncmp expect actual

ok 42 - change in branch B (addition of a file to conflict with directory)

expecting success: tree_B=$(git write-tree)
HEAD is now at aaaff46 testing rm 3
ok 43 - recording branch B tree

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
done.
ok 76 - rm file with changes in the index

expecting success: 
	cat >expect <<-\EOF &&
	error: the following file has changes staged in the index:
	    foo.txt
	EOF
	test_must_fail git -c advice.rmhints=false rm foo.txt 2>actual &&
	test_i18ncmp expect actual

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 77 - rm file with changes in the index without hints

expecting success: 
	cat >expect <<-\EOF &&
	error: the following file has staged content different from both the
	file and the HEAD:
	    foo1.txt
	(use -f to force removal)
	error: the following file has changes staged in the index:
	    bar1.txt
	(use --cached to keep the file, or -f to force removal)
	EOF
	echo content >foo1.txt &&
	git add foo1.txt &&
	echo content6 >foo1.txt &&
	echo content6 >bar1.txt &&
	git add bar1.txt &&
	test_must_fail git rm bar1.txt foo1.txt 2>actual &&
	test_i18ncmp expect actual

Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual 900fec698da3cabc83135ee0b8e2bd7f99a28ab4
Removing file
t3906-stash-submodule.sh: 159: cd: can't cd to sub1
Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
On branch stashbranch
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	deleted:    file

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	.gitignore
	expect
	expect1
	expect2
	output
	output.out
	stashlist1
	stashlist2

no changes added to commit (use "git add" and/or "git commit -a")
ok 78 - rm files with two different errors

ok 24 - stash rm and ignore

expecting success: 
	git reset --hard &&
	git rm file &&
	echo file >.gitignore &&
	git add .gitignore &&
	git stash save "rm and ignore (stage .gitignore)" &&
	test bar = "$(cat file)" &&
	! test -r .gitignore &&
	git stash apply &&
	! test -r file &&
	test file = "$(cat .gitignore)"

# still have 1 known breakage(s)
# passed all remaining 77 test(s)
1..78
ok 44 - keep contents of 3 trees for easy access

HEAD is now at d3a23d9 alternate second
rm 'file'
expecting success: git diff-tree $tree_O $tree_A >.test-a &&
     cmp -s .test-a .test-plain-OA
ok 45 - diff-tree of known trees.

expecting success: git diff-tree -r $tree_O $tree_A >.test-a &&
     cmp -s .test-a .test-recursive-OA
ok 46 - diff-tree of known trees.

expecting success: git diff-tree $tree_O $tree_B >.test-a &&
     cmp -s .test-a .test-plain-OB
ok 47 - diff-tree of known trees.

expecting success: git diff-tree -r $tree_O $tree_B >.test-a &&
     cmp -s .test-a .test-recursive-OB
ok 48 - diff-tree of known trees.

expecting success: git diff-tree $tree_A $tree_B >.test-a &&
     cmp -s .test-a .test-plain-AB
ok 49 - diff-tree of known trees.

expecting success: git diff-tree -r $tree_A $tree_B >.test-a &&
     cmp -s .test-a .test-recursive-AB
ok 50 - diff-tree of known trees.

expecting success: echo $tree_A $tree_B | git diff-tree --stdin > .test-a &&
     echo $tree_A $tree_B > .test-plain-ABx &&
     cat .test-plain-AB >> .test-plain-ABx &&
     cmp -s .test-a .test-plain-ABx
*** t4003-diff-rename-1.sh ***
ok 51 - diff-tree --stdin of known trees.

expecting success: echo $tree_A $tree_B | git diff-tree -r --stdin > .test-a &&
     echo $tree_A $tree_B > .test-recursive-ABx &&
     cat .test-recursive-AB >> .test-recursive-ABx &&
     cmp -s .test-a .test-recursive-ABx
ok 52 - diff-tree --stdin of known trees.

expecting success: git read-tree $tree_A &&
     git diff-index --cached $tree_O >.test-a &&
     cmp -s .test-a .test-recursive-OA
ok 53 - diff-cache O with A in cache

expecting success: git read-tree $tree_B &&
     git diff-index --cached $tree_O >.test-a &&
     cmp -s .test-a .test-recursive-OB
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4003-diff-rename-1/.git/
expecting success: cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
     echo frotz >rezrov &&
    git update-index --add COPYING rezrov &&
    tree=$(git write-tree) &&
    echo $tree
ok 54 - diff-cache O with B in cache

expecting success: git read-tree $tree_B &&
     git diff-index --cached $tree_A >.test-a &&
     cmp -s .test-a .test-recursive-AB
Saved working directory and index state On stashbranch: rm and ignore (stage .gitignore)
Saved working directory and index state WIP on replace_sub1_with_file: a888eec Replace sub1 with file
ok 55 - diff-cache A with B in cache

expecting success: rm -fr Z [A-Z][A-Z] &&
     git read-tree $tree_A &&
     git checkout-index -f -a &&
     git read-tree --reset $tree_O &&
     test_must_fail git update-index --refresh -q &&
     git diff-files >.test-a &&
     cmp_diff_files_output .test-a .test-recursive-OA
HEAD is now at a888eec Replace sub1 with file
HEAD is now at d3a23d9 alternate second
6fb637967044b5d0edaa623ea9befe44d6843c70
ok 1 - prepare reference tree

expecting success: sed -e s/HOWEVER/However/ <COPYING >COPYING.1 &&
    sed -e s/GPL/G.P.L/g <COPYING >COPYING.2 &&
    rm -f COPYING &&
    git update-index --add --remove COPYING COPYING.?
ok 2 - prepare work tree

DD: needs update
DM: needs update
DN: needs update
MD: needs update
MM: needs update
MN: needs update
SS: needs update
TT: needs update
Z/DD: needs update
Z/DM: needs update
Z/DN: needs update
Z/MD: needs update
Z/MM: needs update
Z/MN: needs update
expecting success: compare_diff_patch current expected
ok 3 - validate output from rename/copy detection (#1)

expecting success: mv COPYING.2 COPYING &&
     git update-index --add --remove COPYING COPYING.1 COPYING.2
ok 56 - diff-files with O in cache and A checked out

expecting success: rm -fr Z [A-Z][A-Z] &&
     git read-tree $tree_B &&
     git checkout-index -f -a &&
     git read-tree --reset $tree_O &&
     test_must_fail git update-index --refresh -q &&
     git diff-files >.test-a &&
     cmp_diff_files_output .test-a .test-recursive-OB
ok 4 - prepare work tree again

expecting success: compare_diff_patch current expected
ok 5 - validate output from rename/copy detection (#2)

expecting success: cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
     git update-index --add --remove COPYING COPYING.1
DD: needs update
DM: needs update
MD: needs update
MM: needs update
ND: needs update
NM: needs update
SS: needs update
TT: needs update
Z/DD: needs update
Z/DM: needs update
Z/MD: needs update
Z/MM: needs update
Z/ND: needs update
Z/NM: needs update
ok 6 - prepare work tree once again

Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual 900fec698da3cabc83135ee0b8e2bd7f99a28ab4
Removing file
ok 57 - diff-files with O in cache and B checked out

expecting success: rm -fr Z [A-Z][A-Z] &&
     git read-tree $tree_B &&
     git checkout-index -f -a &&
     git read-tree --reset $tree_A &&
     test_must_fail git update-index --refresh -q &&
     git diff-files >.test-a &&
     cmp_diff_files_output .test-a .test-recursive-AB
expecting success: compare_diff_patch current expected
Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual 716b2ce749fd56f6e38215e9e05141a7e4f988f9
ok 7 - validate output from rename/copy detection (#3)

# passed all 7 test(s)
1..7
On branch stashbranch
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	new file:   .gitignore

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	deleted:    file

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	expect
	expect1
	expect2
	output
	output.out
	stashlist1
	stashlist2

ok 25 - stash rm and ignore (stage .gitignore)

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

)
*** t4004-diff-rename-symlink.sh ***
On branch replace_sub1_with_file
Your branch is up-to-date with 'origin/replace_sub1_with_file'.
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   .gitmodules
	deleted:    sub1

no changes added to commit (use "git add" and/or "git commit -a")
prerequisite SYMLINKS ok
expecting success: 
	git reset --hard &&
	rm file &&
	ln -s file2 file &&
	git stash save "file to symlink" &&
	test -f file &&
	test bar = "$(cat file)" &&
	git stash apply &&
	case "$(ls -l file)" in *" file -> file2") :;; *) false;; esac

AA: needs update
AN: needs update
DF/DF: needs update
MD: needs update
MM: needs update
MN: needs update
ND: needs update
NM: needs update
TT: needs update
Z/AA: needs update
Z/AN: needs update
Z/MD: needs update
Z/MM: needs update
Z/MN: needs update
Z/ND: needs update
Z/NM: needs update
HEAD is now at d3a23d9 alternate second
'actual' is not empty, it contains:
:100644 100644 1b52e94c4a64cb0f66e5ac63bf7612443af0bb91 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 M	.gitmodules
:160000 100644 61c28065465efb3e256cc3dff7fc62fe1ccc400c d95f3ad14dee633a758d2e331151e950dd13e4ed T	sub1
ok 58 - diff-files with A in cache and B checked out

expecting success: git diff-tree $tree_O $tree_A >.test-a &&
    git diff-tree -R $tree_A $tree_O >.test-b &&
    cmp -s .test-a .test-b
not ok 4 - git_stash: replace tracked file with submodule creates empty directory # TODO known breakage

checking known breakage: 
		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
		)
	
ok 59 - diff-tree O A == diff-tree -R A O

expecting success: git diff-tree -r $tree_O $tree_A >.test-a &&
    git diff-tree -r -R $tree_A $tree_O >.test-b &&
    cmp -s .test-a .test-b
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4004-diff-rename-symlink/.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

)
ok 60 - diff-tree -r O A == diff-tree -r -R A O

expecting success: git diff-tree $tree_B $tree_A >.test-a &&
    git diff-tree -R $tree_A $tree_B >.test-b &&
    cmp -s .test-a .test-b
prerequisite SYMLINKS ok
expecting success: echo xyzzy | tr -d \\012 >yomin &&
     ln -s xyzzy frotz &&
    git update-index --add frotz yomin &&
    tree=$(git write-tree) &&
    echo $tree
Cloning into 'submodule_update'...
ok 61 - diff-tree B A == diff-tree -R A B

expecting success: git diff-tree -r $tree_B $tree_A >.test-a &&
    git diff-tree -r -R $tree_A $tree_B >.test-b &&
    cmp -s .test-a .test-b
e8a7292168115b2c189b56bd500aa179ca8d69ba
ok 1 - prepare reference tree

expecting success: mv frotz rezrov &&
     rm -f yomin &&
     ln -s xyzzy nitfol &&
     ln -s xzzzy bozbar &&
    git update-index --add --remove frotz rezrov nitfol bozbar yomin
ok 62 - diff-tree -r B A == diff-tree -r -R A B

expecting success: test_must_fail git diff --no-index -- MN - < NN |
        grep -v "^index" | sed "s#/-#/NN#" >.test-a &&
    test_must_fail git diff --no-index -- MN NN |
        grep -v "^index" >.test-b &&
    test_cmp .test-a .test-b
done.
ok 2 - prepare work tree

expecting success: 
    GIT_DIFF_OPTS=--unified=0 git diff-index -C -p e8a7292168115b2c189b56bd500aa179ca8d69ba >current &&
    cat >expected <<\EOF
diff --git a/bozbar b/bozbar
new file mode 120000
--- /dev/null
+++ b/bozbar
@@ -0,0 +1 @@
+xzzzy
\ No newline at end of file
diff --git a/frotz b/nitfol
similarity index 100%
copy from frotz
copy to nitfol
diff --git a/frotz b/rezrov
similarity index 100%
rename from frotz
rename to rezrov
diff --git a/yomin b/yomin
deleted file mode 100644
--- a/yomin
+++ /dev/null
@@ -1 +0,0 @@
-xyzzy
\ No newline at end of file
EOF

ok 63 - diff can read from stdin

# passed all 63 test(s)
1..63
ok 3 - setup diff output

expecting success: compare_diff_patch current expected
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 4 - validate diff output

# passed all 4 test(s)
1..4
error: 8ed2e6719f8484ce01fa3ce133fe42d25c2441b8^{commit}: expected commit type, but the object dereferences to tree type
fatal: Needed a single revision
*** t4005-diff-rename-2.sh ***
Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
Saved working directory and index state On stashbranch: file to symlink
*** t4006-diff-mode.sh ***
HEAD is now at d3a23d9 alternate second
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4005-diff-rename-2/.git/
expecting success: cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
     echo frotz >rezrov &&
    git update-index --add COPYING rezrov &&
    tree=$(git write-tree) &&
    echo $tree
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4006-diff-mode/.git/
expecting success: 
	echo frotz >rezrov &&
	git update-index --add rezrov &&
	tree=$(git write-tree) &&
	echo $tree

5189e2f1ba2c164fa2006e4f8f4e4ec56f15291e
ok 1 - setup

expecting success: 
	test_chmod +x rezrov &&
	git diff-index $tree >current &&
	sed -e "$sed_script" <current >check &&
	echo ":100644 100755 X X M	rezrov" >expected &&
	test_cmp expected check

6fb637967044b5d0edaa623ea9befe44d6843c70
ok 1 - prepare reference tree

expecting success: sed -e s/HOWEVER/However/ <COPYING >COPYING.1 &&
    sed -e s/GPL/G.P.L/g <COPYING >COPYING.2 &&
    rm -f COPYING &&
    git update-index --add --remove COPYING COPYING.?
ok 2 - chmod

expecting success: 
	git commit -m rezrov &&
	printf "\00\01\02\03\04\05\06" >binbin &&
	git add binbin &&
	git commit -m binbin

ok 2 - prepare work tree

[master (root-commit) 75c0872] rezrov
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100755 rezrov
expecting success: compare_diff_raw current expected
ok 3 - validate output from rename/copy detection (#1)

[master 2feb340] binbin
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 binbin
expecting success: mv COPYING.2 COPYING &&
     git update-index --add --remove COPYING COPYING.1 COPYING.2
ok 3 - prepare binary file

Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual 900fec698da3cabc83135ee0b8e2bd7f99a28ab4
# passed all 3 test(s)
1..3
ok 4 - prepare work tree again

*** t4007-rename-3.sh ***
expecting success: compare_diff_raw current expected
On branch stashbranch
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	typechange: file

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	expect
	expect1
	expect2
	output
	output.out
	stashlist1
	stashlist2

no changes added to commit (use "git add" and/or "git commit -a")
ok 26 - stash file to symlink

ok 5 - validate output from rename/copy detection (#2)

expecting success: cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
     git update-index --add --remove COPYING COPYING.1
expecting success: 
	git reset --hard &&
	git rm file &&
	ln -s file2 file &&
	git stash save "file to symlink (stage rm)" &&
	test -f file &&
	test bar = "$(cat file)" &&
	git stash apply &&
	case "$(ls -l file)" in *" file -> file2") :;; *) false;; esac

Saved working directory and index state WIP on replace_sub1_with_directory: cb4c3ad Replace sub1 with directory
ok 6 - prepare work tree once again

HEAD is now at d3a23d9 alternate second
rm 'file'
HEAD is now at cb4c3ad Replace sub1 with directory
expecting success: compare_diff_raw current expected
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4007-rename-3/.git/
expecting success: 
	mkdir path0 path1 &&
	cp "$TEST_DIRECTORY"/diff-lib/COPYING path0/COPYING &&
	git update-index --add path0/COPYING &&
	tree=$(git write-tree) &&
	echo $tree

ok 7 - validate output from rename/copy detection (#3)

# passed all 7 test(s)
1..7
4be42c354151eb32b60e6ab9d4cf0e5e1eda3bc3
ok 1 - prepare reference tree

expecting success: 
	cp path0/COPYING path1/COPYING &&
	git update-index --add --remove path0/COPYING path1/COPYING

*** t4008-diff-break-rewrite.sh ***
ok 2 - prepare work tree

expecting success: 
	git diff-index -C --find-copies-harder $tree >current &&
	compare_diff_raw current expected

ok 3 - copy detection

expecting success: 
	git diff-index -C --find-copies-harder --cached $tree >current &&
	compare_diff_raw current expected

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4008-diff-break-rewrite/.git/
expecting success: 
	cat "$TEST_DIRECTORY"/diff-lib/README >file0 &&
	cat "$TEST_DIRECTORY"/diff-lib/COPYING >file1 &&
	git update-index --add file0 file1 &&
	git tag reference $(git write-tree)

ok 4 - copy detection, cached

expecting success: 
	git diff-index -C --find-copies-harder $tree path1 >current &&
	compare_diff_raw current expected

ok 1 - setup

expecting success: 
	sed -e "s/git/GIT/" file0 >file1 &&
	rm -f file0 &&
	git update-index --remove file0 file1

ok 5 - copy, limited to a subtree

expecting success: 
	rm -f path0/COPYING &&
	git update-index --remove path0/COPYING

Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual b64bc44aa739f7a1a28a62c47ce8151ca1dad650
Removing sub1/file3
Removing sub1/file2
Removing sub1/file1
Adding sub1
ok 6 - tweak work tree

ok 2 - change file1 with copy-edit of file0 and remove file0

expecting success: 
	git diff-index -B --cached reference >current &&
	cat >expect <<-\EOF &&
	:100644 000000 548142c327a6790ff8821d67c2ee1eff7a656b52 0000000000000000000000000000000000000000 D	file0
	:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 2fbedd0b5d4b8126e4750c3bee305e8ff79f80ec M100	file1
	EOF
	compare_diff_raw expect current

Saved working directory and index state On stashbranch: file to symlink (stage rm)
expecting success: 
	git diff-index -C --find-copies-harder $tree >current &&
	compare_diff_raw current expected

HEAD is now at d3a23d9 alternate second
On branch replace_sub1_with_directory
Your branch is up-to-date with 'origin/replace_sub1_with_directory'.
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   .gitmodules
	deleted:    sub1/file1
	deleted:    sub1/file2
	deleted:    sub1/file3

no changes added to commit (use "git add" and/or "git commit -a")
ok 7 - rename detection

expecting success: 
	git diff-index -C --find-copies-harder $tree path1 >current &&
	compare_diff_raw current expected

ok 3 - run diff with -B (#1)

expecting success: 
	git diff-index -B -M reference >current &&
	cat >expect <<-\EOF &&
	:100644 100644 548142c327a6790ff8821d67c2ee1eff7a656b52 2fbedd0b5d4b8126e4750c3bee305e8ff79f80ec R100	file0	file1
	EOF
	compare_diff_raw expect current

'actual' is not empty, it contains:
:100644 100644 1b52e94c4a64cb0f66e5ac63bf7612443af0bb91 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 M	.gitmodules
:000000 100644 0000000000000000000000000000000000000000 587be6b4c3f93f93c489c0111bba5596147a26cb A	sub1/file1
:000000 100644 0000000000000000000000000000000000000000 b68025345d5301abad4d9ec9166f455243a0d746 A	sub1/file2
:000000 100644 0000000000000000000000000000000000000000 587be6b4c3f93f93c489c0111bba5596147a26cb A	sub1/file3
ok 8 - rename, limited to a subtree

not ok 5 - git_stash: replace directory with submodule # TODO known breakage

checking known breakage: 
		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
		)
	
# passed all 8 test(s)
1..8
ok 4 - run diff with -B and -M (#2)

expecting success: 
	rm -f file0 file1 &&
	git read-tree -m reference &&
	git checkout-index -f -u -a &&
	mv file0 tmp &&
	mv file1 file0 &&
	mv tmp file1 &&
	git update-index file0 file1

*** t4009-diff-rename-4.sh ***
Cloning into 'submodule_update'...
ok 5 - swap file0 and file1

expecting success: 
	git diff-index -B reference >current &&
	cat >expect <<-\EOF &&
	:100644 100644 548142c327a6790ff8821d67c2ee1eff7a656b52 6ff87c4664981e4397625791c8ea3bbb5f2279a3 M100	file0
	:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 548142c327a6790ff8821d67c2ee1eff7a656b52 M100	file1
	EOF
	compare_diff_raw expect current

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4009-diff-rename-4/.git/
done.
expecting success: cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
     echo frotz >rezrov &&
    git update-index --add COPYING rezrov &&
    tree=$(git write-tree) &&
    echo $tree
Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual 900fec698da3cabc83135ee0b8e2bd7f99a28ab4
ok 6 - run diff with -B (#3)

expecting success: 
	git diff-index -B -M reference >current &&
	cat >expect <<-\EOF &&
	:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 6ff87c4664981e4397625791c8ea3bbb5f2279a3 R100	file1	file0
	:100644 100644 548142c327a6790ff8821d67c2ee1eff7a656b52 548142c327a6790ff8821d67c2ee1eff7a656b52 R100	file0	file1
	EOF
	compare_diff_raw expect current

6fb637967044b5d0edaa623ea9befe44d6843c70
ok 1 - prepare reference tree

expecting success: sed -e s/HOWEVER/However/ <COPYING >COPYING.1 &&
    sed -e s/GPL/G.P.L/g <COPYING >COPYING.2 &&
    rm -f COPYING &&
    git update-index --add --remove COPYING COPYING.?
On branch stashbranch
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	typechange: file

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	expect
	expect1
	expect2
	output
	output.out
	stashlist1
	stashlist2

no changes added to commit (use "git add" and/or "git commit -a")
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 7 - run diff with -B and -M (#4)

expecting success: 
	rm -f file0 &&
	test_ln_s_add frotz file0 &&
	git update-index file1

ok 27 - stash file to symlink (stage rm)

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

)
expecting success: 
	git reset --hard &&
	rm file &&
	ln -s file2 file &&
	git add file &&
	git stash save "file to symlink (full stage)" &&
	test -f file &&
	test bar = "$(cat file)" &&
	git stash apply &&
	case "$(ls -l file)" in *" file -> file2") :;; *) false;; esac

prerequisite SYMLINKS ok
ok 2 - prepare work tree

HEAD is now at d3a23d9 alternate second
ok 8 - make file0 into something completely different

expecting success: 
	git diff-index -B reference >current &&
	cat >expect <<-\EOF &&
	:100644 120000 548142c327a6790ff8821d67c2ee1eff7a656b52 67be421f88824578857624f7b3dc75e99a8a1481 T	file0
	:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 548142c327a6790ff8821d67c2ee1eff7a656b52 M100	file1
	EOF
	compare_diff_raw expect current

expecting success: compare_diff_raw_z current expected
ok 3 - validate output from rename/copy detection (#1)

expecting success: mv COPYING.2 COPYING &&
     git update-index --add --remove COPYING COPYING.1 COPYING.2
ok 9 - run diff with -B (#5)

expecting success: 
	git diff-index -B -M reference >current &&

	# file0 changed from regular to symlink.  file1 is the same as the preimage
	# of file0.  Because the change does not make file0 disappear, file1 is
	# denoted as a copy of file0
	cat >expect <<-\EOF &&
	:100644 120000 548142c327a6790ff8821d67c2ee1eff7a656b52 67be421f88824578857624f7b3dc75e99a8a1481 T	file0
	:100644 100644 548142c327a6790ff8821d67c2ee1eff7a656b52 548142c327a6790ff8821d67c2ee1eff7a656b52 C	file0	file1
	EOF
	compare_diff_raw expect current

ok 4 - prepare work tree again

expecting success: compare_diff_raw_z current expected
ok 10 - run diff with -B -M (#6)

expecting success: 
	git diff-index -M reference >current &&

	# This should not mistake file0 as the copy source of new file1
	# due to type differences.
	cat >expect <<-\EOF &&
	:100644 120000 548142c327a6790ff8821d67c2ee1eff7a656b52 67be421f88824578857624f7b3dc75e99a8a1481 T	file0
	:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 548142c327a6790ff8821d67c2ee1eff7a656b52 M	file1
	EOF
	compare_diff_raw expect current

ok 5 - validate output from rename/copy detection (#2)

expecting success: cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
     git update-index --add --remove COPYING COPYING.1
ok 11 - run diff with -M (#7)

expecting success: 
	rm -f file0 file1 &&
	git read-tree -m reference &&
	git checkout-index -f -u -a &&
	sed -e "s/git/GIT/" file0 >file1 &&
	sed -e "s/git/GET/" file0 >file2 &&
	rm -f file0 &&
	git update-index --add --remove file0 file1 file2

ok 6 - prepare work tree once again

expecting success: compare_diff_raw_z current expected
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3906-stash-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 7 - validate output from rename/copy detection (#3)

ok 12 - file1 edited to look like file0 and file0 rename-edited to file2

expecting success: 
	git diff-index -B reference >current &&
	cat >expect <<-\EOF &&
	:100644 000000 548142c327a6790ff8821d67c2ee1eff7a656b52 0000000000000000000000000000000000000000 D	file0
	:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 2fbedd0b5d4b8126e4750c3bee305e8ff79f80ec M100	file1
	:000000 100644 0000000000000000000000000000000000000000 69a939f651686f56322566e2fd76715947a24162 A	file2
	EOF
	compare_diff_raw expect current

# passed all 7 test(s)
1..7
*** t4010-diff-pathspec.sh ***
ok 13 - run diff with -B (#8)

expecting success: 
	git diff-index -B -C reference >current &&
	cat >expect <<-\EOF &&
	:100644 100644 548142c327a6790ff8821d67c2ee1eff7a656b52 2fbedd0b5d4b8126e4750c3bee305e8ff79f80ec C095	file0	file1
	:100644 100644 548142c327a6790ff8821d67c2ee1eff7a656b52 69a939f651686f56322566e2fd76715947a24162 R095	file0	file2
	EOF
	compare_diff_raw expect current

Saved working directory and index state On stashbranch: file to symlink (full stage)
HEAD is now at d3a23d9 alternate second
ok 14 - run diff with -B -C (#9)

Cloning into 'sub1'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4010-diff-pathspec/.git/
# passed all 14 test(s)
1..14
expecting success: echo frotz >file0 &&
     mkdir path1 &&
     echo rezrov >path1/file1 &&
     git update-index --add file0 path1/file1 &&
     tree=$(git write-tree) &&
     echo "$tree" &&
     echo nitfol >file0 &&
     echo yomin >path1/file1 &&
     git update-index file0 path1/file1
*** t4011-diff-symlink.sh ***
done.
6b4658eda9b6c5385f027bc54abf3276b6effd05
ok 1 - setup

expecting success: git diff-index --cached $tree -- path >current &&
     compare_diff_raw current expected
ok 2 - limit to path should show nothing

expecting success: git diff-index --cached $tree -- path1 >current &&
     compare_diff_raw current expected
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4011-diff-symlink/.git/
expecting success: 
	cat >expected <<-\EOF &&
	diff --git a/frotz b/frotz
	new file mode 120000
	index 0000000..7c465af
	--- /dev/null
	+++ b/frotz
	@@ -0,0 +1 @@
	+xyzzy
	\ No newline at end of file
	diff --git a/nitfol b/nitfol
	new file mode 100644
	index 0000000..7c465af
	--- /dev/null
	+++ b/nitfol
	@@ -0,0 +1 @@
	+xyzzy
	EOF

	# the empty tree
	git update-index &&
	tree=$(git write-tree) &&

	test_ln_s_add xyzzy frotz &&
	echo xyzzy >nitfol &&
	git update-index --add nitfol &&
	GIT_DIFF_OPTS=--unified=0 git diff-index -M -p $tree >current &&
	compare_diff_patch expected current

ok 3 - limit to path1 should show path1/file1

expecting success: git diff-index --cached $tree -- path1/ >current &&
     compare_diff_raw current expected
Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual 900fec698da3cabc83135ee0b8e2bd7f99a28ab4
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
ok 4 - limit to path1/ should show path1/file1

expecting success: git diff-index --cached $tree -- "*file1" >current &&
     compare_diff_raw current expected
On branch stashbranch
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	typechange: file

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	expect
	expect1
	expect2
	output
	output.out
	stashlist1
	stashlist2

no changes added to commit (use "git add" and/or "git commit -a")
Submodule path 'sub1': checked out '61c28065465efb3e256cc3dff7fc62fe1ccc400c'
ok 28 - stash file to symlink (full stage)

expecting success: 
	git reset --hard &&
	test_ln_s_add file filelink &&
	git commit -m "Add symlink" &&
	rm filelink &&
	cp file filelink &&
	git stash save "symlink to file"

HEAD is now at d3a23d9 alternate second
ok 5 - "*file1" should show path1/file1

ok 1 - diff new symlink and file

expecting success: 
	tree=$(git write-tree) &&
	git update-index frotz nitfol &&
	test -z "$(git diff-index --name-only $tree)"

expecting success: git diff-index --cached $tree -- file0 >current &&
     compare_diff_raw current expected
[stashbranch f202a25] Add symlink
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 120000 filelink
ok 6 - limit to file0 should show file0

ok 2 - diff unchanged symlink and file

expecting success: 
	cat >expected <<-\EOF &&
	diff --git a/frotz b/frotz
	deleted file mode 120000
	index 7c465af..0000000
	--- a/frotz
	+++ /dev/null
	@@ -1 +0,0 @@
	-xyzzy
	\ No newline at end of file
	diff --git a/nitfol b/nitfol
	deleted file mode 100644
	index 7c465af..0000000
	--- a/nitfol
	+++ /dev/null
	@@ -1 +0,0 @@
	-xyzzy
	EOF
	mv frotz frotz2 &&
	mv nitfol nitfol2 &&
	git diff-index -M -p $tree >current &&
	compare_diff_patch expected current

expecting success: git diff-index --cached $tree -- file0/ >current &&
     compare_diff_raw current expected
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
warning: unable to rmdir sub1: Directory not empty
ok 7 - limit to file0/ should emit nothing.

expecting success: 
	tree2=$(git write-tree) &&
	echo "$tree2" &&
	git diff-tree -r --name-only $tree $tree2 -- pa path1/a >current &&
	>expected &&
	test_cmp expected current

ok 3 - diff removed symlink and file

expecting success: 
	>expected &&
	rm -f frotz nitfol &&
	echo xyzzy >nitfol &&
	test-chmtime +10 nitfol &&
	if test_have_prereq SYMLINKS
	then
		ln -s xyzzy frotz
	else
		printf xyzzy >frotz
		# the symlink property propagates from the index
	fi &&
	git diff-index -M -p $tree >current &&
	compare_diff_patch expected current &&

	>expected &&
	git diff-index -M -p -w $tree >current &&
	compare_diff_patch expected current

54d8765b122f32157e847ce3924180cb2ec778fc
ok 8 - diff-tree pathspec

expecting success: 
	git diff-tree --name-only $EMPTY_TREE $tree -- "f*" >result &&
	echo file0 >expected &&
	test_cmp expected result

ok 9 - diff-tree with wildcard shows dir also matches

expecting success: 
	git diff-tree -r --name-only $EMPTY_TREE $tree -- "*file1" >result &&
	echo path1/file1 >expected &&
	test_cmp expected result

ok 10 - diff-tree -r with wildcard

expecting success: 
	git diff-tree --name-only $tree $tree2 -- "path1/f*" >result &&
	echo path1 >expected &&
	test_cmp expected result

ok 11 - diff-tree with wildcard shows dir also matches

expecting success: 
	git diff-tree -r --name-only $tree $tree2 -- "path1/*file1" >result &&
	echo path1/file1 >expected &&
	test_cmp expected result

ok 4 - diff identical, but newly created symlink and file

expecting success: 
	cat >expected <<-\EOF &&
	diff --git a/frotz b/frotz
	index 7c465af..df1db54 120000
	--- a/frotz
	+++ b/frotz
	@@ -1 +1 @@
	-xyzzy
	\ No newline at end of file
	+yxyyz
	\ No newline at end of file
	diff --git a/nitfol b/nitfol
	index 7c465af..df1db54 100644
	--- a/nitfol
	+++ b/nitfol
	@@ -1 +1 @@
	-xyzzy
	+yxyyz
	EOF
	rm -f frotz &&
	if test_have_prereq SYMLINKS
	then
		ln -s yxyyz frotz
	else
		printf yxyyz >frotz
		# the symlink property propagates from the index
	fi &&
	echo yxyyz >nitfol &&
	git diff-index -M -p $tree >current &&
	compare_diff_patch expected current

ok 12 - diff-tree -r with wildcard from beginning

expecting success: 
	git diff-tree -r --name-only $tree $tree2 -- "path1/f*" >result &&
	echo path1/file1 >expected &&
	test_cmp expected result

ok 13 - diff-tree -r with wildcard

expecting success: 
	test_tick &&
	git init submod &&
	( cd submod && test_commit first; ) &&
	git add submod &&
	git commit -m first &&
	( cd submod && test_commit second; ) &&
	git add submod &&
	git commit -m second

ok 5 - diff different symlink and file

expecting success: 
	ln -s narf pinky &&
	ln -s take\ over brain &&
	test_must_fail git diff --no-index pinky brain >output 2>output.err &&
	grep narf output &&
	! test -s output.err

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4010-diff-pathspec/submod/.git/
-narf
ok 6 - diff symlinks with non-existing targets

expecting success: 
	echo "*.bin diff=bin" >>.gitattributes &&
	echo content >file.bin &&
	ln -s file.bin link.bin &&
	git add -N file.bin link.bin

[master (root-commit) 1e96f59] first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 first.t
ok 7 - setup symlinks with attributes

expecting success: 
	cat >expect <<-\EOF &&
	diff --git a/file.bin b/file.bin
	index e69de29..d95f3ad 100644
	Binary files a/file.bin and b/file.bin differ
	diff --git a/link.bin b/link.bin
	index e69de29..dce41ec 120000
	--- a/link.bin
	+++ b/link.bin
	@@ -0,0 +1 @@
	+file.bin
	\ No newline at end of file
	EOF
	git config diff.bin.binary true &&
	git diff file.bin link.bin >actual &&
	test_cmp expect actual

[master (root-commit) f9d7654] first
 Author: A U Thor <author@example.com>
 3 files changed, 3 insertions(+)
 create mode 100644 file0
 create mode 100644 path1/file1
 create mode 160000 submod
Saved working directory and index state On stashbranch: symlink to file
ok 8 - symlinks do not respect userdiff config by path

# passed all 8 test(s)
1..8
HEAD is now at f202a25 Add symlink
Saved working directory and index state WIP on add_sub1: 9a0f58a Add sub1
ok 29 - stash symlink to file

expecting success: 
	test -h filelink &&
	case "$(ls -l filelink)" in *" filelink -> file") :;; *) false;; esac

[master 1bf6dc5] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 second.t
ok 30 - this must have re-created the symlink

expecting success: 
	git stash apply &&
	! test -h filelink &&
	test bar = "$(cat file)"

HEAD is now at 9a0f58a Add sub1
*** t4012-diff-binary.sh ***
[master f1afec5] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 14 - setup submodules

expecting success: 
	git diff --name-only HEAD^ HEAD submod >expect &&
	git diff --name-only HEAD^ HEAD submod/ >actual &&
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4012-diff-binary/.git/
ok 15 - diff-tree ignores trailing slash on submodule path

expecting success: 
	mkdir path2 &&
	echo rezrov >path2/file1 &&
	git update-index --add path2/file1 &&
	tree3=$(git write-tree) &&
	git diff --name-only $tree $tree3 -- "path2*1" "path1*1" >actual &&
	cat <<-\EOF >expect &&
	path1/file1
	path2/file1
	EOF
	test_cmp expect actual

expecting success: 
	echo AIT >a && echo BIT >b && echo CIT >c && echo DIT >d &&
	git update-index --add a b c d &&
	echo git >a &&
	cat "$TEST_DIRECTORY"/test-binary-1.png >b &&
	echo git >c &&
	cat b b >d

ok 1 - prepare repository

expecting success: 
	git diff >diff &&
	git apply --stat --summary <diff >current &&
	test_i18ncmp expected current

ok 16 - diff multiple wildcard pathspecs

expecting success: 
	git diff --name-only HEAD^ submod >expect &&
	git diff --name-only HEAD^ submod/ >actual &&
	test_cmp expect actual

ok 2 - apply --stat output for binary file change

expecting success: 
	tail -n 1 expected >expect &&
	git diff --shortstat >current &&
	test_i18ncmp expect current

Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual bf49a42d6fce288540f83c8f1df1958f7bea8e81
ok 3 - diff --shortstat output for binary file change

expecting success: 
	echo " 1 file changed, 0 insertions(+), 0 deletions(-)" >expected &&
	git diff --shortstat -- b >current &&
	test_i18ncmp expected current

ok 4 - diff --shortstat output for binary file change only

expecting success: 
	git diff >diff &&
	git apply --numstat <diff >current &&
	test_cmp expect.binary-numstat current

ok 17 - diff-cache ignores trailing slash on submodule path

Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual 476fc70e7da8bb0e6f4447299d15809b677ad6d9
Removing sub1
Removing .gitmodules
# passed all 17 test(s)
1..17
On branch stashbranch
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	typechange: filelink

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	expect
	expect1
	expect2
	output
	output.out
	stashlist1
	stashlist2

no changes added to commit (use "git add" and/or "git commit -a")
ok 5 - apply --numstat notices binary file change

ok 31 - unstash must re-create the file

expecting success: 
	git diff --binary >diff &&
	git apply --numstat <diff >current &&
	test_cmp expect.binary-numstat current

expecting success: 
	git reset --hard &&
	git rm filelink &&
	cp file filelink &&
	git stash save "symlink to file (stage rm)"

HEAD is now at f202a25 Add symlink
On branch add_sub1
Your branch is up-to-date with 'origin/add_sub1'.
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	deleted:    .gitmodules

no changes added to commit (use "git add" and/or "git commit -a")
rm 'filelink'
*** t4013-diff-various.sh ***
'actual' is not empty, it contains:
ok 6 - apply --numstat understands diff --binary format

:000000 100644 0000000000000000000000000000000000000000 1b52e94c4a64cb0f66e5ac63bf7612443af0bb91 A	.gitmodules
:000000 160000 0000000000000000000000000000000000000000 61c28065465efb3e256cc3dff7fc62fe1ccc400c A	sub1
expecting success: 
	git diff >output &&
	sed -e "s/-CIT/xCIT/" <output >broken &&
	test_must_fail git apply --stat --summary broken 2>detected &&
	detected=$(cat detected) &&
	detected=$(expr "$detected" : "fatal.*at line \\([0-9]*\\)\$") &&
	detected=$(sed -ne "${detected}p" broken) &&
	test "$detected" = xCIT

not ok 6 - git_stash: removed submodule leaves submodule directory and its contents in place # TODO known breakage

checking known breakage: 
		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 7 - apply detecting corrupt patch correctly

expecting success: 
	git diff --binary | sed -e "s/-CIT/xCIT/" >broken &&
	test_must_fail git apply --stat --summary broken 2>detected &&
	detected=$(cat detected) &&
	detected=$(expr "$detected" : "fatal.*at line \\([0-9]*\\)\$") &&
	detected=$(sed -ne "${detected}p" broken) &&
	test "$detected" = xCIT

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4013-diff-various/.git/
expecting success: 

	GIT_AUTHOR_DATE="2006-06-26 00:00:00 +0000" &&
	GIT_COMMITTER_DATE="2006-06-26 00:00:00 +0000" &&
	export GIT_AUTHOR_DATE GIT_COMMITTER_DATE &&

	mkdir dir &&
	mkdir dir2 &&
	for i in 1 2 3; do echo $i; done >file0 &&
	for i in A B; do echo $i; done >dir/sub &&
	cat file0 >file2 &&
	git add file0 file2 dir/sub &&
	git commit -m Initial &&

	git branch initial &&
	git branch side &&

	GIT_AUTHOR_DATE="2006-06-26 00:01:00 +0000" &&
	GIT_COMMITTER_DATE="2006-06-26 00:01:00 +0000" &&
	export GIT_AUTHOR_DATE GIT_COMMITTER_DATE &&

	for i in 4 5 6; do echo $i; done >>file0 &&
	for i in C D; do echo $i; done >>dir/sub &&
	rm -f file2 &&
	git update-index --remove file0 file2 dir/sub &&
	git commit -m "Second${LF}${LF}This is the second commit." &&

	GIT_AUTHOR_DATE="2006-06-26 00:02:00 +0000" &&
	GIT_COMMITTER_DATE="2006-06-26 00:02:00 +0000" &&
	export GIT_AUTHOR_DATE GIT_COMMITTER_DATE &&

	for i in A B C; do echo $i; done >file1 &&
	git add file1 &&
	for i in E F; do echo $i; done >>dir/sub &&
	git update-index dir/sub &&
	git commit -m Third &&

	GIT_AUTHOR_DATE="2006-06-26 00:03:00 +0000" &&
	GIT_COMMITTER_DATE="2006-06-26 00:03:00 +0000" &&
	export GIT_AUTHOR_DATE GIT_COMMITTER_DATE &&

	git checkout side &&
	for i in A B C; do echo $i; done >>file0 &&
	for i in 1 2; do echo $i; done >>dir/sub &&
	cat dir/sub >file3 &&
	git add file3 &&
	git update-index file0 dir/sub &&
	git commit -m Side &&

	GIT_AUTHOR_DATE="2006-06-26 00:04:00 +0000" &&
	GIT_COMMITTER_DATE="2006-06-26 00:04:00 +0000" &&
	export GIT_AUTHOR_DATE GIT_COMMITTER_DATE &&

	git checkout master &&
	git pull -s ours . side &&

	GIT_AUTHOR_DATE="2006-06-26 00:05:00 +0000" &&
	GIT_COMMITTER_DATE="2006-06-26 00:05:00 +0000" &&
	export GIT_AUTHOR_DATE GIT_COMMITTER_DATE &&

	for i in A B C; do echo $i; done >>file0 &&
	for i in 1 2; do echo $i; done >>dir/sub &&
	git update-index file0 dir/sub &&

	mkdir dir3 &&
	cp dir/sub dir3/sub &&
	test-chmtime +1 dir3/sub &&

	git config log.showroot false &&
	git commit --amend &&

	GIT_AUTHOR_DATE="2006-06-26 00:06:00 +0000" &&
	GIT_COMMITTER_DATE="2006-06-26 00:06:00 +0000" &&
	export GIT_AUTHOR_DATE GIT_COMMITTER_DATE &&
	git checkout -b rearrange initial &&
	for i in B A; do echo $i; done >dir/sub &&
	git add dir/sub &&
	git commit -m "Rearranged lines in dir/sub" &&
	git checkout master &&

	git show-branch

Cloning into 'submodule_update'...
ok 8 - apply detecting corrupt patch correctly

expecting success: git commit -a -m initial
[master (root-commit) 444ac55] Initial
 Author: A U Thor <author@example.com>
 3 files changed, 8 insertions(+)
 create mode 100644 dir/sub
 create mode 100644 file0
 create mode 100644 file2
[master (root-commit) 2963df4] initial
 Author: A U Thor <author@example.com>
 4 files changed, 2 insertions(+)
 create mode 100644 a
 create mode 100644 b
 create mode 100644 c
 create mode 100644 d
ok 9 - initial commit

expecting success: 
	echo AIT >a && mv b e && echo CIT >c && cat e >d &&
	git update-index --add --remove a b c d e &&
	tree0=$(git write-tree) &&
	git diff --cached --binary >current &&
	git apply --stat --summary current

done.
Saved working directory and index state On stashbranch: symlink to file (stage rm)
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
[master 1bde4ae] Second
 Author: A U Thor <author@example.com>
 3 files changed, 5 insertions(+), 3 deletions(-)
 delete mode 100644 file2
HEAD is now at f202a25 Add symlink
ok 32 - stash symlink to file (stage rm)

 a |    2 +-
 b |  Bin
 c |    2 +-
 d |  Bin
 e |  Bin
 5 files changed, 2 insertions(+), 2 deletions(-)
 delete mode 100644 b
 create mode 100644 e
ok 10 - diff-index with --binary

expecting success: 
	git reset --hard &&
	git apply --binary --index <current &&
	tree1=$(git write-tree) &&
	test "$tree1" = "$tree0"

expecting success: 
	test -h filelink &&
	case "$(ls -l filelink)" in *" filelink -> file") :;; *) false;; esac

ok 33 - this must have re-created the symlink

expecting success: 
	git stash apply &&
	! test -h filelink &&
	test bar = "$(cat file)"

HEAD is now at 2963df4 initial
ok 11 - apply binary patch

expecting success: 
	echo Q | q_to_nul >binary &&
	(: hide error code from diff, which just indicates differences
	 git diff --binary --no-index /dev/null binary >current ||
	 true
	) &&
	rm binary &&
	git apply --binary <current &&
	echo Q >expected &&
	nul_to_q <binary >actual &&
	test_cmp expected actual

[master 9a6d494] Third
 Author: A U Thor <author@example.com>
 2 files changed, 5 insertions(+)
 create mode 100644 file1
Switched to branch 'side'
ok 12 - diff --no-index with binary creation

expecting success: 
	printf "\01\00%1024d" 1 >binfile &&
	git add binfile &&
	i=0 &&
	while test $i -lt 10000; do
		echo $i &&
		i=$(($i + 1))
	done >textfile &&
	git add textfile &&
	git diff --cached --stat binfile textfile >output &&
	grep " | " output >actual &&
	test_cmp expect actual

[side c7a2ab9] Side
 Author: A U Thor <author@example.com>
 3 files changed, 9 insertions(+)
 create mode 100644 file3
Switched to branch 'master'
Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual bf49a42d6fce288540f83c8f1df1958f7bea8e81
From .
 * branch            side       -> FETCH_HEAD
On branch stashbranch
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	typechange: filelink

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	expect
	expect1
	expect2
	output
	output.out
	stashlist1
	stashlist2

no changes added to commit (use "git add" and/or "git commit -a")
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3906-stash-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 34 - unstash must re-create the file

expecting success: 
	git reset --hard &&
	rm filelink &&
	cp file filelink &&
	git add filelink &&
	git stash save "symlink to file (full stage)"

Merge made by the 'ours' strategy.
HEAD is now at f202a25 Add symlink
[master 59d314a] Merge branch 'side'
 Author: A U Thor <author@example.com>
 Date: Mon Jun 26 00:04:00 2006 +0000
Cloning into 'sub1'...
Switched to a new branch 'rearrange'
done.
[rearrange cd4e72f] Rearranged lines in dir/sub
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to branch 'master'
! [initial] Initial
 * [master] Merge branch 'side'
  ! [rearrange] Rearranged lines in dir/sub
   ! [side] Side
----
  +  [rearrange] Rearranged lines in dir/sub
 -   [master] Merge branch 'side'
 * + [side] Side
 *   [master^] Third
 *   [master~2] Second
+*++ [initial] Initial
ok 1 - setup

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 2 - git diff-tree initial

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Saved working directory and index state On stashbranch: symlink to file (full stage)
ok 3 - git diff-tree -r initial

HEAD is now at f202a25 Add symlink
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 35 - stash symlink to file (full stage)

Submodule path 'sub1': checked out '61c28065465efb3e256cc3dff7fc62fe1ccc400c'
expecting success: 
	test -h filelink &&
	case "$(ls -l filelink)" in *" filelink -> file") :;; *) false;; esac

ok 36 - this must have re-created the symlink

expecting success: 
	git stash apply &&
	! test -h filelink &&
	test bar = "$(cat file)"

ok 4 - git diff-tree -r --abbrev initial

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 5 - git diff-tree -r --abbrev=4 initial

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
ok 6 - git diff-tree --root initial

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 7 - git diff-tree --root --abbrev initial

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 8 - git diff-tree --root -r initial

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
warning: unable to rmdir sub1: Directory not empty
Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual bf49a42d6fce288540f83c8f1df1958f7bea8e81
ok 9 - git diff-tree --root -r --abbrev initial

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 10 - git diff-tree --root -r --abbrev=4 initial

On branch stashbranch
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	typechange: filelink

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	expect
	expect1
	expect2
	output
	output.out
	stashlist1
	stashlist2

no changes added to commit (use "git add" and/or "git commit -a")
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 37 - unstash must re-create the file

checking known breakage: 
	git reset --hard &&
	mkdir dir &&
	echo foo >dir/file &&
	git add dir/file &&
	git commit -m "Add file in dir" &&
	rm -fr dir &&
	echo bar >dir &&
	git stash save "directory to file" &&
	test -d dir &&
	test foo = "$(cat dir/file)" &&
	test_must_fail git stash apply &&
	test bar = "$(cat dir)" &&
	git reset --soft HEAD^

HEAD is now at f202a25 Add symlink
ok 11 - git diff-tree -p initial

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 12 - git diff-tree --root -p initial

[stashbranch 36c53af] Add file in dir
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 dir/file
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 13 - git diff-tree --patch-with-stat initial

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 13 - diff --stat with binary files and big change count

# passed all 13 test(s)
1..13
ok 14 - git diff-tree --root --patch-with-stat initial

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
*** t4014-format-patch.sh ***
ok 15 - git diff-tree --patch-with-raw initial

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Saved working directory and index state WIP on add_sub1: 9a0f58a Add sub1
ok 16 - git diff-tree --root --patch-with-raw initial

HEAD is now at 9a0f58a Add sub1
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4014-format-patch/.git/
ok 17 - git diff-tree --pretty initial

expecting success: 

	for i in 1 2 3 4 5 6 7 8 9 10; do echo "$i"; done >file &&
	cat file >elif &&
	git add file elif &&
	test_tick &&
	git commit -m Initial &&
	git checkout -b side &&

	for i in 1 2 5 6 A B C 7 8 9 10; do echo "$i"; done >file &&
	test_chmod +x elif &&
	test_tick &&
	git commit -m "Side changes #1" &&

	for i in D E F; do echo "$i"; done >>file &&
	git update-index file &&
	test_tick &&
	git commit -m "Side changes #2" &&
	git tag C2 &&

	for i in 5 6 1 2 3 A 4 B C 7 8 9 10 D E F; do echo "$i"; done >file &&
	git update-index file &&
	test_tick &&
	git commit -m "Side changes #3 with \\n backslash-n in it." &&

	git checkout master &&
	git diff-tree -p C2 | git apply --index &&
	test_tick &&
	git commit -m "Master accepts moral equivalent of #2"


expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 18 - git diff-tree --pretty --root initial

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
[master (root-commit) e27066e] Initial
 Author: A U Thor <author@example.com>
 2 files changed, 20 insertions(+)
 create mode 100644 elif
 create mode 100644 file
ok 19 - git diff-tree --pretty -p initial

Switched to a new branch 'side'
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Saved working directory and index state On stashbranch: directory to file
HEAD is now at 36c53af Add file in dir
ok 20 - git diff-tree --pretty --stat initial

[side 1135adf] Side changes #1
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 elif
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 21 - git diff-tree --pretty --summary initial

[side fd00575] Side changes #2
 Author: A U Thor <author@example.com>
 1 file changed, 6 insertions(+), 2 deletions(-)
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 22 - git diff-tree --pretty --stat --summary initial

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual 476fc70e7da8bb0e6f4447299d15809b677ad6d9
Removing sub1
Removing .gitmodules
[side 18ed22a] Side changes #3 with \n backslash-n in it.
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+), 2 deletions(-)
ok 23 - git diff-tree --pretty --root -p initial

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Switched to branch 'master'
On branch add_sub1
Your branch is up-to-date with 'origin/add_sub1'.
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	deleted:    .gitmodules

no changes added to commit (use "git add" and/or "git commit -a")
ok 24 - git diff-tree --pretty --root --stat initial

'actual' is not empty, it contains:
:000000 100644 0000000000000000000000000000000000000000 1b52e94c4a64cb0f66e5ac63bf7612443af0bb91 A	.gitmodules
:000000 160000 0000000000000000000000000000000000000000 61c28065465efb3e256cc3dff7fc62fe1ccc400c A	sub1
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
[master 2e66419] Master accepts moral equivalent of #2
 Author: A U Thor <author@example.com>
 1 file changed, 6 insertions(+), 2 deletions(-)
ok 1 - setup

expecting success: 

	git format-patch --stdout master..side >patch0 &&
	cnt=$(grep "^From " patch0 | wc -l) &&
	test $cnt = 3


Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual 4f1019d02d9c10f9b5c1ece0778b2d50a0fcc259
Removing dir/file
ok 25 - git diff-tree --pretty --root --summary initial

not ok 7 - git_stash: removed submodule leaves submodule containing a .git directory alone # TODO known breakage

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
		)
	
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 2 - format-patch --ignore-if-in-upstream

expecting success: 

	git format-patch --stdout \
		--ignore-if-in-upstream master..side >patch1 &&
	cnt=$(grep "^From " patch1 | wc -l) &&
	test $cnt = 2


ok 26 - git diff-tree --pretty --root --summary -r initial

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
On branch stashbranch
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	deleted:    dir/file

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	expect
	expect1
	expect2
	output
	output.out
	stashlist1
	stashlist2

no changes added to commit (use "git add" and/or "git commit -a")
test_must_fail: command succeeded: git stash apply
not ok 38 - stash directory to file # TODO known breakage

checking known breakage: 
	git reset --hard &&
	rm file &&
	mkdir file &&
	echo foo >file/file &&
	git stash save "file to directory" &&
	test -f file &&
	test bar = "$(cat file)" &&
	git stash apply &&
	test -f file/file &&
	test foo = "$(cat file/file)"

ok 3 - format-patch --ignore-if-in-upstream

expecting success: 
	git tag -a v1 -m tag side &&
	git tag -a v2 -m tag master &&
	git format-patch --stdout --ignore-if-in-upstream v2..v1 >patch1 &&
	cnt=$(grep "^From " patch1 | wc -l) &&
	test $cnt = 2

ok 27 - git diff-tree --pretty --root --stat --summary initial

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
HEAD is now at 36c53af Add file in dir
ok 28 - git diff-tree --pretty --patch-with-stat initial

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 4 - format-patch --ignore-if-in-upstream handles tags

expecting success: 

	git checkout -b slave master &&
	echo "Another line" >>file &&
	test_tick &&
	git commit -am "Slave change #1" &&
	echo "Yet another line" >>file &&
	test_tick &&
	git commit -am "Slave change #2" &&
	git checkout -b merger master &&
	test_tick &&
	git merge --no-ff slave &&
	cnt=$(git format-patch -3 --stdout | grep "^From " | wc -l) &&
	test $cnt = 3

Cloning into 'submodule_update'...
ok 29 - git diff-tree --pretty --root --patch-with-stat initial

Switched to a new branch 'slave'
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
[slave 350e112] Slave change #1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 30 - git diff-tree --pretty --patch-with-raw initial

done.
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
[slave 065c933] Slave change #2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 31 - git diff-tree --pretty --root --patch-with-raw initial

Switched to a new branch 'merger'
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Merging:
2e66419 Master accepts moral equivalent of #2
virtual slave
found 1 common ancestor:
2e66419 Master accepts moral equivalent of #2
Merge made by the 'recursive' strategy.
 file | 2 ++
 1 file changed, 2 insertions(+)
ok 32 - git diff-tree --pretty=oneline initial

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 5 - format-patch doesn't consider merge commits

expecting success: 

	git checkout -b rebuild-0 master &&
	git am -3 patch0 &&
	cnt=$(git rev-list master.. | wc -l) &&
	test $cnt = 2

ok 33 - git diff-tree --pretty=oneline --root initial

Switched to a new branch 'rebuild-0'
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 34 - git diff-tree --pretty=oneline -p initial

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Applying: Side changes #1
Saved working directory and index state On stashbranch: file to directory
ok 35 - git diff-tree --pretty=oneline --root -p initial

Applying: Side changes #2
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
HEAD is now at 36c53af Add file in dir
Using index info to reconstruct a base tree...
M	file
Falling back to patching base and 3-way merge...
ok 36 - git diff-tree --pretty=oneline --patch-with-stat initial

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Merging 65fd934a9794ce9ab6e5c2574ed909ee8b0d4a42 with Side changes #2
Merging:
65fd934 Side changes #1
virtual Side changes #2
found 1 common ancestor:
virtual 8359489d93991065cdaa748bd96dcb831b3d60ca
No changes -- Patch already applied.
Applying: Side changes #3 with \n backslash-n in it.
ok 37 - git diff-tree --pretty=oneline --root --patch-with-stat initial

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 38 - git diff-tree --pretty=oneline --patch-with-raw initial

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3906-stash-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 6 - format-patch result applies

expecting success: 

	git checkout -b rebuild-1 master &&
	git am -3 patch1 &&
	cnt=$(git rev-list master.. | wc -l) &&
	test $cnt = 2

Switched to a new branch 'rebuild-1'
ok 39 - git diff-tree --pretty=oneline --root --patch-with-raw initial

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 40 - git diff-tree --pretty side

Applying: Side changes #1
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual 4f1019d02d9c10f9b5c1ece0778b2d50a0fcc259
Removing file
Applying: Side changes #3 with \n backslash-n in it.
ok 41 - git diff-tree --pretty -p side

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
On branch stashbranch
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	deleted:    file

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	expect
	expect1
	expect2
	output
	output.out
	stashlist1
	stashlist2

no changes added to commit (use "git add" and/or "git commit -a")
Cloning into 'sub1'...
not ok 39 - stash file to directory # TODO known breakage

expecting success: 
	git stash clear &&
	test_when_finished "git reset --hard HEAD" &&
	git reset --hard &&
	echo foo >> file &&
	STASH_ID=$(git stash create) &&
	git reset --hard &&
	git stash branch stash-branch ${STASH_ID} &&
	test_when_finished "git reset --hard HEAD && git checkout master && git branch -D stash-branch" &&
	test $(git ls-files --modified | wc -l) -eq 1

ok 42 - git diff-tree --pretty --patch-with-stat side

ok 7 - format-patch --ignore-if-in-upstream result applies

expecting success: 

	git cat-file commit side | grep "^Side .* with .* backslash-n"


expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Side changes #3 with \n backslash-n in it.
ok 8 - commit did not screw up the log message

expecting success: 

	grep "^Subject: .*Side changes #3 with .* backslash-n" patch0 &&
	grep "^Subject: .*Side changes #3 with .* backslash-n" patch1


Subject: [PATCH 3/3] Side changes #3 with \n backslash-n in it.
done.
ok 43 - git diff-tree master

Subject: [PATCH 2/2] Side changes #3 with \n backslash-n in it.
ok 9 - format-patch did not screw up the log message

expecting success: 

	git cat-file commit rebuild-1 | grep "^Side .* with .* backslash-n"


expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Side changes #3 with \n backslash-n in it.
ok 10 - replay did not screw up the log message

expecting success: 

	git config format.headers "To: R E Cipient <rcipient@example.com>
" &&
	git config --add format.headers "Cc: S E Cipient <scipient@example.com>
" &&
	git format-patch --stdout master..side > patch2 &&
	sed -e "/^\$/q" patch2 > hdrs2 &&
	grep "^To: R E Cipient <rcipient@example.com>\$" hdrs2 &&
	grep "^Cc: S E Cipient <scipient@example.com>\$" hdrs2


ok 44 - git diff-tree -p master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 45 - git diff-tree -p -m master

To: R E Cipient <rcipient@example.com>
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Cc: S E Cipient <scipient@example.com>
ok 11 - extra headers

expecting success: 

	git config --replace-all format.headers "To: R E Cipient <rcipient@example.com>" &&
	git config --add format.headers "Cc: S E Cipient <scipient@example.com>" &&
	git format-patch --stdout master..side >patch3 &&
	sed -e "/^\$/q" patch3 > hdrs3 &&
	grep "^To: R E Cipient <rcipient@example.com>\$" hdrs3 &&
	grep "^Cc: S E Cipient <scipient@example.com>\$" hdrs3


HEAD is now at 36c53af Add file in dir
ok 46 - git diff-tree -c master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Submodule path 'sub1': checked out '61c28065465efb3e256cc3dff7fc62fe1ccc400c'
ok 47 - git diff-tree -c --abbrev master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
To: R E Cipient <rcipient@example.com>
Cc: S E Cipient <scipient@example.com>
ok 12 - extra headers without newlines

expecting success: 

	git config --replace-all format.headers "To: R E Cipient <rcipient@example.com>" &&
	git config --add format.headers "To: S E Cipient <scipient@example.com>" &&
	git format-patch --stdout master..side > patch4 &&
	sed -e "/^\$/q" patch4 > hdrs4 &&
	grep "^To: R E Cipient <rcipient@example.com>,\$" hdrs4 &&
	grep "^ *S E Cipient <scipient@example.com>\$" hdrs4

ok 48 - git diff-tree --cc master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
ok 49 - git diff-tree -c --stat master

To: R E Cipient <rcipient@example.com>,
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
    S E Cipient <scipient@example.com>
ok 13 - extra headers with multiple To:s

expecting success: 

	git config --replace-all format.headers "Cc: R E Cipient <rcipient@example.com>" &&
	git format-patch --cc="S E Cipient <scipient@example.com>" --stdout master..side | sed -e "/^\$/q" >patch5 &&
	grep "^Cc: R E Cipient <rcipient@example.com>,\$" patch5 &&
	grep "^ *S E Cipient <scipient@example.com>\$" patch5

error: Untracked working tree file 'sub1/file1' would be overwritten by merge.
ok 50 - git diff-tree --cc --stat master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Cc: R E Cipient <rcipient@example.com>,
    S E Cipient <scipient@example.com>
ok 14 - additional command line cc (ascii)

checking known breakage: 

	git config --replace-all format.headers "Cc: R E Cipient <rcipient@example.com>" &&
	git format-patch --cc="S. E. Cipient <scipient@example.com>" --stdout master..side | sed -e "/^\$/q" >patch5 &&
	grep "^Cc: R E Cipient <rcipient@example.com>,\$" patch5 &&
	grep "^ *\"S. E. Cipient\" <scipient@example.com>\$" patch5

ok 51 - git diff-tree -c --stat --summary master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Cc: R E Cipient <rcipient@example.com>,
not ok 15 - additional command line cc (rfc822) # TODO known breakage

expecting success: 

	git config --unset-all format.headers &&
	git format-patch --add-header="Cc: R E Cipient <rcipient@example.com>" --stdout master..side | sed -e "/^\$/q" >patch6 &&
	grep "^Cc: R E Cipient <rcipient@example.com>\$" patch6

ok 52 - git diff-tree --cc --stat --summary master

HEAD is now at 36c53af Add file in dir
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 8 - git_stash: 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 53 - git diff-tree -c --stat --summary side

Cc: R E Cipient <rcipient@example.com>
ok 16 - command line headers

expecting success: 

	git config --replace-all format.headers "Cc: R E Cipient <rcipient@example.com>" &&
	git format-patch --add-header="Cc: S E Cipient <scipient@example.com>" --stdout master..side | sed -e "/^\$/q" >patch7 &&
	grep "^Cc: R E Cipient <rcipient@example.com>,\$" patch7 &&
	grep "^ *S E Cipient <scipient@example.com>\$" patch7

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 54 - git diff-tree --cc --stat --summary side

Cc: R E Cipient <rcipient@example.com>,
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
    S E Cipient <scipient@example.com>
ok 17 - configuration headers and command line headers

expecting success: 

	git config --unset-all format.headers &&
	git format-patch --to="R E Cipient <rcipient@example.com>" --stdout master..side | sed -e "/^\$/q" >patch8 &&
	grep "^To: R E Cipient <rcipient@example.com>\$" patch8

ok 55 - git diff-tree --cc --patch-with-stat master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
To: R E Cipient <rcipient@example.com>
ok 18 - command line To: header (ascii)

checking known breakage: 

	git format-patch --to="R. E. Cipient <rcipient@example.com>" --stdout master..side | sed -e "/^\$/q" >patch8 &&
	grep "^To: \"R. E. Cipient\" <rcipient@example.com>\$" patch8

ok 56 - git diff-tree --cc --patch-with-stat --summary master

Cloning into 'submodule_update'...
not ok 19 - command line To: header (rfc822) # TODO known breakage

checking known breakage: 

	git format-patch --to="R Ä Cipient <rcipient@example.com>" --stdout master..side | sed -e "/^\$/q" >patch8 &&
	grep "^To: =?UTF-8?q?R=20=C3=84=20Cipient?= <rcipient@example.com>\$" patch8

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Switched to a new branch 'stash-branch'
not ok 20 - command line To: header (rfc2047) # TODO known breakage

expecting success: 

	git config format.to "R E Cipient <rcipient@example.com>" &&
	git format-patch --stdout master..side | sed -e "/^\$/q" >patch9 &&
	grep "^To: R E Cipient <rcipient@example.com>\$" patch9

ok 57 - git diff-tree --cc --patch-with-stat --summary side

done.
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual 4f1019d02d9c10f9b5c1ece0778b2d50a0fcc259
ok 58 - git log master

To: R E Cipient <rcipient@example.com>
ok 21 - configuration To: header (ascii)

checking known breakage: 

	git config format.to "R. E. Cipient <rcipient@example.com>" &&
	git format-patch --stdout master..side | sed -e "/^\$/q" >patch9 &&
	grep "^To: \"R. E. Cipient\" <rcipient@example.com>\$" patch9

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
On branch stash-branch
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   file

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	expect
	expect1
	expect2
	output
	output.out
	stashlist1
	stashlist2

no changes added to commit (use "git add" and/or "git commit -a")
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 59 - git log -p master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
not ok 22 - configuration To: header (rfc822) # TODO known breakage

checking known breakage: 

	git config format.to "R Ä Cipient <rcipient@example.com>" &&
	git format-patch --stdout master..side | sed -e "/^\$/q" >patch9 &&
	grep "^To: =?UTF-8?q?R=20=C3=84=20Cipient?= <rcipient@example.com>\$" patch9

HEAD is now at 36c53af Add file in dir
ok 60 - git log --root master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Switched to branch 'master'
not ok 23 - configuration To: header (rfc2047) # TODO known breakage

expecting success: 

	git config --replace-all format.to \
		"R E Cipient <rcipient@example.com>" &&
	git format-patch --no-to --stdout master..side |
	sed -e "/^\$/q" >patch10 &&
	check_patch patch10 &&
	! grep "^To: R E Cipient <rcipient@example.com>\$" patch10

Deleted branch stash-branch (was 36c53af).
HEAD is now at 662e8e5 second
ok 61 - git log --root -p master

ok 40 - stash branch - no stashes on stack, stash-like argument

expecting success: 
	git stash clear &&
	test_when_finished "git reset --hard HEAD" &&
	git reset --hard &&
	echo foo >> file &&
	git stash &&
	test_when_finished "git stash drop" &&
	echo bar >> file &&
	STASH_ID=$(git stash create) &&
	git reset --hard &&
	git stash branch stash-branch ${STASH_ID} &&
	test_when_finished "git reset --hard HEAD && git checkout master && git branch -D stash-branch" &&
	test $(git ls-files --modified | wc -l) -eq 1

From: A U Thor <author@example.com>
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Date: Thu, 7 Apr 2005 15:14:13 -0700
Subject: [PATCH 1/3] Side changes #1
ok 24 - --no-to overrides config.to

expecting success: 

	git config --replace-all format.to \
		"Someone <someone@out.there>" &&
	git format-patch --no-to --to="Someone Else <else@out.there>" \
		--stdout master..side |
	sed -e "/^\$/q" >patch11 &&
	check_patch patch11 &&
	! grep "^To: Someone <someone@out.there>\$" patch11 &&
	grep "^To: Someone Else <else@out.there>\$" patch11

ok 62 - git log --patch-with-stat master

From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:14:13 -0700
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Subject: [PATCH 1/3] Side changes #1
To: Someone Else <else@out.there>
ok 25 - --no-to and --to replaces config.to

expecting success: 

	git config --replace-all format.cc \
		"C E Cipient <rcipient@example.com>" &&
	git format-patch --no-cc --stdout master..side |
	sed -e "/^\$/q" >patch12 &&
	check_patch patch12 &&
	! grep "^Cc: C E Cipient <rcipient@example.com>\$" patch12

ok 63 - git log --root --patch-with-stat master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:14:13 -0700
Subject: [PATCH 1/3] Side changes #1
HEAD is now at 662e8e5 second
ok 26 - --no-cc overrides config.cc

expecting success: 

	git config --replace-all format.headers \
		"Header1: B E Cipient <rcipient@example.com>" &&
	git format-patch --no-add-header --stdout master..side |
	sed -e "/^\$/q" >patch13 &&
	check_patch patch13 &&
	! grep "^Header1: B E Cipient <rcipient@example.com>\$" patch13

ok 64 - git log --root --patch-with-stat --summary master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3906-stash-submodule/submodule_update_repo/.) registered for path 'sub1'
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:14:13 -0700
Subject: [PATCH 1/3] Side changes #1
ok 27 - --no-add-header overrides config.headers

ok 65 - git log --root -c --patch-with-stat --summary master

expecting success: 

	rm -rf patches/ &&
	git checkout side &&
	git format-patch -o patches/ master &&
	ls patches/0001-Side-changes-1.patch patches/0002-Side-changes-2.patch patches/0003-Side-changes-3-with-n-backslash-n-in-it.patch

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Switched to branch 'side'
patches/0001-Side-changes-1.patch
patches/0002-Side-changes-2.patch
patches/0003-Side-changes-3-with-n-backslash-n-in-it.patch
ok 66 - git log --root --cc --patch-with-stat --summary master

patches/0001-Side-changes-1.patch
patches/0002-Side-changes-2.patch
patches/0003-Side-changes-3-with-n-backslash-n-in-it.patch
ok 28 - multiple files

expecting success: 
	rm -fr patches &&
	git format-patch -o patches --cover-letter --reroll-count 4 master..side >list &&
	! grep -v "^patches/v4-000[0-3]-" list &&
	sed -n -e "/^Subject: /p" $(cat list) >subjects &&
	! grep -v "^Subject: \[PATCH v4 [0-3]/3\] " subjects

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Cloning into 'sub1'...
ok 67 - git log -p --first-parent master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 29 - reroll count

expecting success: 
	rm -fr patches &&
	git format-patch -o patches --cover-letter -v4 master..side >list &&
	! grep -v "^patches/v4-000[0-3]-" list &&
	sed -n -e "/^Subject: /p" $(cat list) >subjects &&
	! grep -v "^Subject: \[PATCH v4 [0-3]/3\] " subjects

ok 68 - git log -m -p --first-parent master

done.
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 30 - reroll count (-v)

expecting success: 
	git checkout side &&
	check_threading expect.no-threading master

ok 69 - git log -m -p master

Already on 'side'
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 31 - no threading

expecting success: 
	check_threading expect.thread --thread master

ok 70 - git log -SF master

Saved working directory and index state WIP on master: 662e8e5 second
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
HEAD is now at 662e8e5 second
ok 32 - thread

expecting success: 
	check_threading expect.in-reply-to --in-reply-to="<test.message>" \
		--thread master

ok 71 - git log -S F master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Submodule path 'sub1': checked out '61c28065465efb3e256cc3dff7fc62fe1ccc400c'
ok 33 - thread in-reply-to

expecting success: 
	check_threading expect.cover-letter --cover-letter --thread master

ok 72 - git log -SF -p master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 34 - thread cover-letter

expecting success: 
	check_threading expect.cl-irt --cover-letter \
		--in-reply-to="<test.message>" --thread master

ok 73 - git log -SF master --max-count=0

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
ok 35 - thread cover-letter in-reply-to

expecting success: 
	check_threading expect.cl-irt --cover-letter \
		--in-reply-to="<test.message>" --thread=shallow master

ok 74 - git log -SF master --max-count=1

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 75 - git log -SF master --max-count=2

ok 36 - thread explicit shallow

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
expecting success: 
	check_threading expect.deep --thread=deep master

ok 76 - git log -GF master

ok 37 - thread deep

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
expecting success: 
	check_threading expect.deep-irt  --thread=deep \
		--in-reply-to="<test.message>" master

error: Untracked working tree file 'sub1/file1' would be overwritten by merge.
ok 77 - git log -GF -p master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
HEAD is now at 662e8e5 second
ok 38 - thread deep in-reply-to

expecting success: 
	check_threading expect.deep-cl --cover-letter --thread=deep master

ok 78 - git log -GF -p --pickaxe-all master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 39 - thread deep cover-letter

ok 79 - git log --decorate --all

expecting success: 
	check_threading expect.deep-cl-irt --cover-letter \
		--in-reply-to="<test.message>" --thread=deep master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 40 - thread deep cover-letter in-reply-to

expecting success: 
	test_config format.thread true &&
	check_threading expect.thread master

ok 80 - git log --decorate=full --all

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 81 - git rev-list --parents HEAD

ok 9 - git_stash: replace submodule containing a .git directory with a directory must fail

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
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 41 - thread via config

expecting success: 
	test_config format.thread deep &&
	check_threading expect.deep master

ok 82 - git rev-list --children HEAD

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Switched to a new branch 'stash-branch'
Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual 3a18f644551a5809421ac2e8f6cc40181a075c5d
ok 42 - thread deep via config

expecting success: 
	test_config format.thread deep &&
	check_threading expect.thread --thread master

ok 83 - git whatchanged master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 84 - git whatchanged -p master
On branch stash-branch
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   file

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	expect
	expect1
	expect2
	output
	output.out
	stashlist1
	stashlist2

no changes added to commit (use "git add" and/or "git commit -a")

ok 43 - thread config + override

expecting success: 
	test_config format.thread deep &&
	check_threading expect.no-threading --no-thread master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Cloning into 'submodule_update'...
ok 85 - git whatchanged --root master

HEAD is now at 662e8e5 second
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 44 - thread config + --no-thread

expecting success: 

	rm -rf patches/ &&
	git checkout side &&
	for i in 5 6 1 2 3 A 4 B C 7 8 9 10 D E F; do echo "$i"; done >>file &&
	git update-index file &&
	git commit -m "This is an excessively long subject line for a message due to the habit some projects have of not having a short, one-line subject at the start of the commit message, but rather sticking a whole paragraph right at the start as the only thing in the commit message. It had better not become the filename for the patch." &&
	git format-patch -o patches/ master..side &&
	ls patches/0004-This-is-an-excessively-long-subject-line-for-a-messa.patch

Switched to branch 'master'
Deleted branch stash-branch (was 662e8e5).
ok 86 - git whatchanged --root -p master

done.
Already on 'side'
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
[side 422768b] This is an excessively long subject line for a message due to the habit some projects have of not having a short, one-line subject at the start of the commit message, but rather sticking a whole paragraph right at the start as the only thing in the commit message. It had better not become the filename for the patch.
 Author: A U Thor <author@example.com>
 1 file changed, 16 insertions(+)
ok 87 - git whatchanged --patch-with-stat master

Switched to a new branch 'add_sub1'
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Branch add_sub1 set up to track remote branch add_sub1 from origin.
patches/0001-Side-changes-1.patch
patches/0002-Side-changes-2.patch
patches/0003-Side-changes-3-with-n-backslash-n-in-it.patch
patches/0004-This-is-an-excessively-long-subject-line-for-a-messa.patch
patches/0004-This-is-an-excessively-long-subject-line-for-a-messa.patch
ok 45 - excessive subject

expecting success: 

	git mv file foo &&
	git commit -m foo &&
	git format-patch --cover-letter -1 &&
	check_patch 0000-cover-letter.patch &&
	! grep "file => foo .* 0 *\$" 0000-cover-letter.patch &&
	git format-patch --cover-letter -1 -M &&
	grep "file => foo .* 0 *\$" 0000-cover-letter.patch


ok 88 - git whatchanged --root --patch-with-stat master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
[side ea84707] foo
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename file => foo (100%)
0000-cover-letter.patch
0001-foo.patch
ok 89 - git whatchanged --root --patch-with-stat --summary master

From: C O Mitter <committer@example.com>
Date: Thu, 7 Apr 2005 15:20:13 -0700
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Subject: [PATCH] *** SUBJECT HERE ***
Dropped refs/stash@{0} (90a7151c6262ada0d49b23f5711b8ace33eea7f2)
0000-cover-letter.patch
0001-foo.patch
 file => foo | 0
ok 46 - cover-letter inherits diff options

expecting success: 

	git format-patch --cover-letter -2 &&
	sed -e "1,/A U Thor/d" -e "/^\$/q" < 0000-cover-letter.patch > output &&
	test_cmp expect output


ok 90 - git whatchanged --root -c --patch-with-stat --summary master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
0000-cover-letter.patch
0001-This-is-an-excessively-long-subject-line-for-a-messa.patch
0002-foo.patch
HEAD is now at 662e8e5 second
ok 41 - stash branch - stashes on stack, stash-like argument

expecting success: 
	git stash clear &&
	test_when_finished "git reset --hard HEAD" &&
	git reset --hard &&
	echo foo >> file &&
	git stash &&
	test_when_finished "git stash drop" &&
	echo bar >> file &&
	STASH_ID=$(git stash create) &&
	git reset --hard &&
	cat >expected <<-EOF &&
	 file | 1 +
	 1 file changed, 1 insertion(+)
	EOF
	git stash show ${STASH_ID} >actual &&
	test_i18ncmp expected actual

ok 47 - shortlog of cover-letter wraps overly-long onelines

expecting success: 

	git format-patch -U4 -2 &&
	sed -e "1,/^diff/d" -e "/^+5/q" \
		<0001-This-is-an-excessively-long-subject-line-for-a-messa.patch \
		>output &&
	test_cmp expect output


ok 91 - git whatchanged --root --cc --patch-with-stat --summary master

0001-This-is-an-excessively-long-subject-line-for-a-messa.patch
0002-foo.patch
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 48 - format-patch respects -U

expecting success: 

	git format-patch -p -2 &&
	sed -e "1,/^\$/d" -e "/^+5/q" < 0001-This-is-an-excessively-long-subject-line-for-a-messa.patch > output &&
	test_cmp expect output


ok 92 - git whatchanged -SF master

0001-This-is-an-excessively-long-subject-line-for-a-messa.patch
0002-foo.patch
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 49 - format-patch -p suppresses stat

expecting success: 
	filename=$(
		rm -rf sub &&
		mkdir -p sub/dir &&
		cd sub/dir &&
		git format-patch -1
	) &&
	case "$filename" in
	0*)
		;; # ok
	*)
		echo "Oops? $filename"
		false
		;;
	esac &&
	test -f "$filename"

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3906-stash-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 93 - git whatchanged -SF -p master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
HEAD is now at 662e8e5 second
ok 50 - format-patch from a subdirectory (1)

expecting success: 
	filename=$(
		rm -rf sub &&
		mkdir -p sub/dir &&
		cd sub/dir &&
		git format-patch -1 -o ..
	) &&
	case "$filename" in
	../0*)
		;; # ok
	*)
		echo "Oops? $filename"
		false
		;;
	esac &&
	basename=$(expr "$filename" : ".*/\(.*\)") &&
	test -f "sub/$basename"

ok 94 - git log --patch-with-stat master -- dir/

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 51 - format-patch from a subdirectory (2)

expecting success: 
	rm -f 0* &&
	filename=$(
		rm -rf sub &&
		mkdir -p sub/dir &&
		cd sub/dir &&
		git format-patch -1 -o "$TRASH_DIRECTORY"
	) &&
	basename=$(expr "$filename" : ".*/\(.*\)") &&
	test -f "$basename"

ok 95 - git whatchanged --patch-with-stat master -- dir/

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Cloning into 'sub1'...
ok 52 - format-patch from a subdirectory (3)

expecting success: 
	git format-patch -1 --stdout --in-reply-to "baz@foo.bar" > patch8 &&
	grep "^In-Reply-To: <baz@foo.bar>" patch8 &&
	grep "^References: <baz@foo.bar>" patch8

ok 96 - git log --patch-with-stat --summary master -- dir/

In-Reply-To: <baz@foo.bar>
References: <baz@foo.bar>
ok 53 - format-patch --in-reply-to

expecting success: 
	git format-patch -1 --signoff --stdout >out &&
	grep "^Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>" out

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
done.
Signed-off-by: C O Mitter <committer@example.com>
ok 54 - format-patch --signoff

expecting success: 
	git notes --ref test add -m "test message" HEAD &&
	git format-patch -1 --signoff --stdout --notes=test >out &&
	# Three dashes must come after S-o-b
	! sed "/^Signed-off-by: /q" out | grep "test message" &&
	sed "1,/^Signed-off-by: /d" out | grep "test message" &&
	# Notes message must come after three dashes
	! sed "/^---$/q" out | grep "test message" &&
	sed "1,/^---$/d" out | grep "test message"

ok 97 - git whatchanged --patch-with-stat --summary master -- dir/

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 98 - git show initial

    test message
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
    test message
ok 55 - format-patch --notes --signoff

expecting success: 
	test_must_fail git format-patch --name-only 2> output &&
	test_i18ncmp expect.name-only output &&
	test_must_fail git format-patch --name-status 2> output &&
	test_i18ncmp expect.name-status output &&
	test_must_fail git format-patch --check 2> output &&
	test_i18ncmp expect.check output
ok 99 - git show --root initial

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Saved working directory and index state WIP on master: 662e8e5 second
ok 100 - git show side

ok 56 - options no longer allowed for format-patch

expecting success: 
	git format-patch --numstat --stdout master..side > output &&
	test 6 = $(grep "^diff --git a/" output | wc -l)
HEAD is now at 662e8e5 second
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Submodule path 'sub1': checked out '61c28065465efb3e256cc3dff7fc62fe1ccc400c'
ok 57 - format-patch --numstat should produce a patch

expecting success: 
	git format-patch master..side -- file 2>error &&
	! grep "Use .--" error

ok 101 - git show master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
0001-Side-changes-2.patch
0002-Side-changes-3-with-n-backslash-n-in-it.patch
0003-This-is-an-excessively-long-subject-line-for-a-messa.patch
0004-foo.patch
ok 58 - format-patch -- <path>

expecting success: 
	git format-patch --ignore-if-in-upstream HEAD

ok 102 - git show -c master

ok 59 - format-patch --ignore-if-in-upstream HEAD

expecting success: 
	git format-patch --stdout --signature="my sig" -1 >output &&
	grep "my sig" output

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
my sig
ok 60 - format-patch --signature

expecting success: 
	git config format.signature "config sig" &&
	git format-patch --stdout -1 >output &&
	grep "config sig" output

ok 103 - git show -m master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
config sig
ok 61 - format-patch with format.signature config

expecting success: 
	git config format.signature "config sig" &&
	git format-patch --stdout --signature="overrides" -1 >output &&
	! grep "config sig" output &&
	grep "overrides" output

ok 104 - git show --first-parent master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 105 - git show --stat side

overrides
ok 62 - format-patch --signature overrides format.signature

expecting success: 
	git config format.signature "config sig" &&
	git format-patch --stdout --signature="my sig" --no-signature \
		-1 >output &&
	check_patch output &&
	! grep "config sig" output &&
	! grep "my sig" output &&
	! grep "^-- \$" output

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
From: A U Thor <author@example.com>
ok 106 - git show --stat --summary side

Date: Thu, 7 Apr 2005 15:20:13 -0700
Subject: [PATCH] foo
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 63 - format-patch --no-signature ignores format.signature

HEAD is now at 662e8e5 second
expecting success: 
	git config --unset-all format.signature &&
	git format-patch --stdout --signature="my sig" --cover-letter \
		-1 >output &&
	grep "my sig" output &&
	test 2 = $(grep "my sig" output | wc -l)

ok 107 - git show --patch-with-stat side

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
my sig
my sig
ok 64 - format-patch --signature --cover-letter

expecting success: 
	git config format.signature "" &&
	git format-patch --stdout -1 >output &&
	check_patch output &&
	! grep "^-- \$" output

ok 108 - git show --patch-with-raw side

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:20:13 -0700
ok 109 - git show --patch-with-stat --summary side

Subject: [PATCH] foo
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 65 - format.signature="" suppresses signatures

expecting success: 
	git config --unset-all format.signature &&
	git format-patch --stdout --no-signature -1 >output &&
	check_patch output &&
	! grep "^-- \$" output

ok 110 - git format-patch --stdout initial..side

From: A U Thor <author@example.com>
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Date: Thu, 7 Apr 2005 15:20:13 -0700
Subject: [PATCH] foo
Saved working directory and index state WIP on add_sub1: 9a0f58a Add sub1
ok 66 - format-patch --no-signature suppresses signatures

expecting success: 
	git format-patch --stdout --signature="" -1 >output &&
	check_patch output &&
	! grep "^-- \$" output

HEAD is now at 9a0f58a Add sub1
ok 111 - git format-patch --stdout initial..master^

From: A U Thor <author@example.com>
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Date: Thu, 7 Apr 2005 15:20:13 -0700
Subject: [PATCH] foo
ok 67 - format-patch --signature="" suppresses signatures

expecting success: 
	cat >mail-signature <<-\EOF

	Test User <test.email@kernel.org>
	http://git.kernel.org/cgit/git/git.git

	git.kernel.org/?p=git/git.git;a=summary

	EOF

--- expect	2015-12-16 10:56:50.061564823 +0000
+++ actual	2015-12-16 10:56:50.753564823 +0000
@@ -4,5 +4,3 @@
 file2
 
 sub1:
-file1
-file2
ok 68 - prepare mail-signature input

expecting success: 
	git format-patch --stdout --signature-file=mail-signature -1 >output &&
	check_patch output &&
	sed -e "1,/^-- \$/d" <output >actual &&
	{
		cat mail-signature && echo
	} >expect &&
	test_cmp expect actual

ok 112 - git format-patch --stdout initial..master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
From: A U Thor <author@example.com>
Submodule sub1 is not populated
Date: Thu, 7 Apr 2005 15:20:13 -0700
Subject: [PATCH] foo
not ok 10 - git_stash: 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 69 - --signature-file=file works

expecting success: 
	test_config format.signaturefile mail-signature &&
	git format-patch --stdout -1 >output &&
	check_patch output &&
	sed -e "1,/^-- \$/d" <output >actual &&
	{
		cat mail-signature && echo
	} >expect &&
	test_cmp expect actual

ok 113 - git format-patch --stdout --no-numbered initial..master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:20:13 -0700
Subject: [PATCH] foo
ok 114 - git format-patch --stdout --numbered initial..master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 70 - format.signaturefile works

expecting success: 
	test_config format.signaturefile mail-signature &&
	git format-patch --stdout --no-signature -1 >output &&
	check_patch output &&
	! grep "^-- \$" output

ok 115 - git format-patch --attach --stdout initial..side

Cloning into 'submodule_update'...
Dropped refs/stash@{0} (90a7151c6262ada0d49b23f5711b8ace33eea7f2)
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:20:13 -0700
Subject: [PATCH] foo
ok 116 - git format-patch --attach --stdout --suffix=.diff initial..side

done.
ok 71 - --no-signature suppresses format.signaturefile 

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
expecting success: 
	cat >other-mail-signature <<-\EOF &&
	Use this other signature instead of mail-signature.
	EOF
	test_config format.signaturefile mail-signature &&
	git format-patch --stdout \
			--signature-file=other-mail-signature -1 >output &&
	check_patch output &&
	sed -e "1,/^-- \$/d" <output >actual &&
	{
		cat other-mail-signature && echo
	} >expect &&
	test_cmp expect actual

HEAD is now at 662e8e5 second
ok 42 - stash show format defaults to --stat

expecting success: 
	git stash clear &&
	test_when_finished "git reset --hard HEAD" &&
	git reset --hard &&
	echo foo >> file &&
	git stash &&
	test_when_finished "git stash drop" &&
	echo bar >> file &&
	STASH_ID=$(git stash create) &&
	git reset --hard &&
	echo "1	0	file" >expected &&
	git stash show --numstat ${STASH_ID} >actual &&
	test_cmp expected actual

ok 117 - git format-patch --attach --stdout initial..master^

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:20:13 -0700
Subject: [PATCH] foo
ok 72 - --signature-file overrides format.signaturefile

expecting success: 
	test_config format.signaturefile mail-signature &&
	git format-patch --stdout --signature="my sig" -1 >output &&
	check_patch output &&
	grep "my sig" output

ok 118 - git format-patch --attach --stdout initial..master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:20:13 -0700
Subject: [PATCH] foo
HEAD is now at 662e8e5 second
my sig
ok 119 - git format-patch --inline --stdout initial..side

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 73 - --signature overrides format.signaturefile

checking prerequisite: TTY

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	test_have_prereq PERL &&

	# Reading from the pty master seems to get stuck _sometimes_
	# on Mac OS X 10.5.0, using Perl 5.10.0 or 5.8.9.
	#
	# Reproduction recipe: run
	#
	#	i=0
	#	while ./test-terminal.perl echo hi $i
	#	do
	#		: $((i = $i + 1))
	#	done
	#
	# After 2000 iterations or so it hangs.
	# https://rt.cpan.org/Ticket/Display.html?id=65692
	#
	test "$(uname -s)" != Darwin &&

	perl "$TEST_DIRECTORY"/test-terminal.perl \
		sh -c "test -t 1 && test -t 2"

)
ok 120 - git format-patch --inline --stdout initial..master^

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 121 - git format-patch --inline --stdout --numbered-files initial..master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 122 - git format-patch --inline --stdout initial..master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3906-stash-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 123 - git format-patch --inline --stdout --subject-prefix=TESTCASE initial..master

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 124 - git config format.subjectprefix DIFFERENT_PREFIX

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 125 - git format-patch --inline --stdout initial..master^^

Saved working directory and index state WIP on master: 662e8e5 second
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
HEAD is now at 662e8e5 second
Cloning into 'sub1'...
ok 126 - git format-patch --stdout --cover-letter -n initial..master^

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
prerequisite TTY ok
expecting success: 
	rm -f pager_used &&
	test_terminal env GIT_PAGER="wc >pager_used" git format-patch --stdout --all &&
	test_path_is_file pager_used

done.
ok 127 - git diff --abbrev initial..side

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 128 - git diff -r initial..side

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 129 - git diff --stat initial..side

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 130 - git diff -r --stat initial..side

Submodule path 'sub1': checked out '61c28065465efb3e256cc3dff7fc62fe1ccc400c'
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 131 - git diff initial..side

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
HEAD is now at 662e8e5 second
ok 132 - git diff --patch-with-stat initial..side

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
ok 133 - git diff --patch-with-raw initial..side

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 134 - git diff --patch-with-stat -r initial..side

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 74 - format-patch --stdout paginates

expecting success: 
	rm -f pager_used &&
	test_terminal env GIT_PAGER="wc >pager_used" git --no-pager format-patch --stdout --all &&
	test_terminal env GIT_PAGER="wc >pager_used" git -c "pager.format-patch=false" format-patch --stdout --all &&
	test_path_is_missing pager_used &&
	test_path_is_missing .git/pager_used

ok 135 - git diff --patch-with-raw -r initial..side

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 136 - git diff --name-status dir2 dir

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 137 - git diff --no-index --name-status dir2 dir

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 138 - git diff --no-index --name-status -- dir2 dir

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 139 - git diff --no-index dir dir3

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 140 - git diff master master^ side

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
Dropped refs/stash@{0} (90a7151c6262ada0d49b23f5711b8ace33eea7f2)
ok 141 - git diff --dirstat master~1 master~2

expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 142 - git diff --dirstat initial rearrange

HEAD is now at 662e8e5 second
expecting success: 
		{
			echo "\$ git $cmd"
			git $cmd |
			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
			echo "\$"
		} >"$actual" &&
		if test -f "$expect"
		then
			case $cmd in
			*format-patch* | *-stat*)
				test_i18ncmp "$expect" "$actual";;
			*)
				test_cmp "$expect" "$actual";;
			esac &&
			rm -f "$actual"
		else
			# this is to help developing new tests.
			cp "$actual" "$expect"
			false
		fi
	
ok 43 - stash show - stashes on stack, stash-like argument

expecting success: 
	git stash clear &&
	test_when_finished "git reset --hard HEAD" &&
	git reset --hard &&
	echo foo >> file &&
	git stash &&
	test_when_finished "git stash drop" &&
	echo bar >> file &&
	STASH_ID=$(git stash create) &&
	git reset --hard &&
	cat >expected <<-EOF &&
	diff --git a/file b/file
	index 7601807..935fbd3 100644
	--- a/file
	+++ b/file
	@@ -1 +1,2 @@
	 baz
	+bar
	EOF
	git stash show -p ${STASH_ID} >actual &&
	test_cmp expected actual

From e27066e74e2522a272f220d17767ef6cab999734 Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:13:13 -0700
Subject: [PATCH 01/12] Initial
Header1: B E Cipient <rcipient@example.com>
To: Someone <someone@out.there>
Cc: C E Cipient <rcipient@example.com>

---
 elif | 10 ++++++++++
 file | 10 ++++++++++
 2 files changed, 20 insertions(+)
 create mode 100644 elif
 create mode 100644 file

diff --git a/elif b/elif
new file mode 100644
index 0000000..f00c965
--- /dev/null
+++ b/elif
@@ -0,0 +1,10 @@
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
diff --git a/file b/file
new file mode 100644
index 0000000..f00c965
--- /dev/null
+++ b/file
@@ -0,0 +1,10 @@
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
-- 
2.6.4


From 1135adfeed86678c55e1aad7c568046ee8215660 Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:14:13 -0700
Subject: [PATCH 02/12] Side changes #1
Header1: B E Cipient <rcipient@example.com>
To: Someone <someone@out.there>
Cc: C E Cipient <rcipient@example.com>

---
ok 143 - git diff --dirstat-by-file initial rearrange

 elif | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 elif

diff --git a/elif b/elif
old mode 100644
new mode 100755
expecting success: 
	test_must_fail git log -S

-- 
2.6.4


From fd00575a8382ce27c62b83730a40bcff1dc2f25f Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:15:13 -0700
Subject: [PATCH 03/12] Side changes #2
Header1: B E Cipient <rcipient@example.com>
To: Someone <someone@out.there>
Cc: C E Cipient <rcipient@example.com>

---
 file | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/file b/file
index f00c965..e5895ff 100644
--- a/file
+++ b/file
@@ -1,10 +1,14 @@
 1
 2
-3
-4
 5
 6
+A
+B
+C
 7
 8
 9
 10
+D
+E
+F
-- 
2.6.4


From 18ed22aae56367787c36a882bd61281e07994f11 Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:16:13 -0700
Subject: [PATCH 04/12] Side changes #3 with \n backslash-n in it.
Header1: B E Cipient <rcipient@example.com>
To: Someone <someone@out.there>
Cc: C E Cipient <rcipient@example.com>

---
 file | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/file b/file
index e5895ff..40f36c6 100644
--- a/file
+++ b/file
@@ -1,8 +1,10 @@
-1
-2
 5
 6
+1
+2
+3
 A
+4
 B
 C
 7
-- 
2.6.4


From 2e66419311bb9e77e5d67b8ea7019aaddfb581f1 Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:17:13 -0700
Subject: [PATCH 05/12] Master accepts moral equivalent of #2
Header1: B E Cipient <rcipient@example.com>
To: Someone <someone@out.there>
Cc: C E Cipient <rcipient@example.com>

---
 file | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/file b/file
index f00c965..e5895ff 100644
--- a/file
+++ b/file
@@ -1,10 +1,14 @@
 1
 2
-3
-4
 5
 6
+A
+B
+C
 7
 8
 9
 10
+D
+E
+F
-- 
2.6.4


From 350e11281bd1c6490ea045bbbc060879d406b458 Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:18:13 -0700
Subject: [PATCH 06/12] Slave change #1
Header1: B E Cipient <rcipient@example.com>
To: Someone <someone@out.there>
Cc: C E Cipient <rcipient@example.com>

---
 file | 1 +
 1 file changed, 1 insertion(+)

diff --git a/file b/file
index e5895ff..3cb93e8 100644
--- a/file
+++ b/file
@@ -12,3 +12,4 @@ C
 D
 E
 F
+Another line
-- 
2.6.4


From 065c933ac908ac046fbe3293f1c083118e6cc8f9 Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:19:13 -0700
Subject: [PATCH 07/12] Slave change #2
Header1: B E Cipient <rcipient@example.com>
To: Someone <someone@out.there>
Cc: C E Cipient <rcipient@example.com>

---
 file | 1 +
 1 file changed, 1 insertion(+)

diff --git a/file b/file
index 3cb93e8..b43af10 100644
--- a/file
+++ b/file
@@ -13,3 +13,4 @@ D
 E
 F
 Another line
+Yet another line
-- 
2.6.4


From 422768ba4254e7abbeb467b6fe254472207e3d1f Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:20:13 -0700
Subject: [PATCH 08/12] This is an excessively long subject line for a message
 due to the habit some projects have of not having a short, one-line subject
 at the start of the commit message, but rather sticking a whole paragraph
 right at the start as the only thing in the commit message. It had better not
 become the filename for the patch.
Header1: B E Cipient <rcipient@example.com>
To: Someone <someone@out.there>
Cc: C E Cipient <rcipient@example.com>

---
 file | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

fatal: Option 'S' requires a value
diff --git a/file b/file
index 40f36c6..2dc5c23 100644
--- a/file
+++ b/file
@@ -14,3 +14,19 @@ C
 D
 E
 F
+5
ok 144 - log -S requires an argument
+6

+1
+2
+3
+A
+4
+B
+C
expecting success: 
	echo ref: refs/heads/unborn >.git/HEAD &&
	git diff --cached >result &&
	test_cmp "$TEST_DIRECTORY/t4013/diff.diff_--cached" result

+7
+8
+9
+10
+D
+E
+F
-- 
2.6.4


From 65fd934a9794ce9ab6e5c2574ed909ee8b0d4a42 Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:14:13 -0700
Subject: [PATCH 09/12] Side changes #1
Header1: B E Cipient <rcipient@example.com>
To: Someone <someone@out.there>
Cc: C E Cipient <rcipient@example.com>

---
 elif | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 elif

diff --git a/elif b/elif
old mode 100644
new mode 100755
-- 
2.6.4


From 701bcbf78ada10c743c100a390d319cbda0fb047 Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:20:13 -0700
Subject: [PATCH 10/12] Notes added by 'git notes add'
Header1: B E Cipient <rcipient@example.com>
To: Someone <someone@out.there>
Cc: C E Cipient <rcipient@example.com>

---
 ea84707526e90d423e619b6b32bd3f6b55088d02 | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 ea84707526e90d423e619b6b32bd3f6b55088d02

diff --git a/ea84707526e90d423e619b6b32bd3f6b55088d02 b/ea84707526e90d423e619b6b32bd3f6b55088d02
new file mode 100644
index 0000000..da5a1d5
--- /dev/null
+++ b/ea84707526e90d423e619b6b32bd3f6b55088d02
@@ -0,0 +1 @@
+test message
-- 
2.6.4


From ea84707526e90d423e619b6b32bd3f6b55088d02 Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:20:13 -0700
Subject: [PATCH 11/12] foo
Header1: B E Cipient <rcipient@example.com>
To: Someone <someone@out.there>
Cc: C E Cipient <rcipient@example.com>

---
 file | 32 --------------------------------
 foo  | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 32 deletions(-)
 delete mode 100644 file
 create mode 100644 foo

diff --git a/file b/file
deleted file mode 100644
index 2dc5c23..0000000
--- a/file
+++ /dev/null
@@ -1,32 +0,0 @@
-5
-6
-1
-2
-3
-A
-4
-B
-C
-7
-8
-9
-10
-D
-E
-F
-5
-6
-1
-2
-3
-A
-4
-B
-C
-7
-8
-9
-10
-D
-E
-F
diff --git a/foo b/foo
new file mode 100644
index 0000000..2dc5c23
--- /dev/null
+++ b/foo
@@ -0,0 +1,32 @@
+5
+6
+1
+2
+3
+A
+4
+B
+C
+7
+8
+9
+10
+D
+E
+F
+5
+6
+1
+2
+3
+A
+4
+B
+C
+7
+8
+9
+10
+D
+E
+F
-- 
2.6.4


From 8bf542ef94c579d3eee1a3cf5062c983cb6d25eb Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:16:13 -0700
Subject: [PATCH 12/12] Side changes #3 with \n backslash-n in it.
Header1: B E Cipient <rcipient@example.com>
To: Someone <someone@out.there>
Cc: C E Cipient <rcipient@example.com>

---
 file | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/file b/file
index e5895ff..40f36c6 100644
--- a/file
+++ b/file
@@ -1,8 +1,10 @@
-1
-2
 5
 6
+1
+2
+3
 A
+4
 B
 C
 7
-- 
2.6.4

ok 145 - diff --cached on unborn branch

expecting success: 
	git diff --cached -- file0 >result &&
	test_cmp "$TEST_DIRECTORY/t4013/diff.diff_--cached_--_file0" result

ok 146 - diff --cached -- file on unborn branch

expecting success: 
	cat >expect <<-\EOF &&
	Side
	Third
	Second
	EOF
	git rev-list master | git diff-tree --stdin --format=%s -s >actual &&
	test_cmp expect actual

Saved working directory and index state WIP on add_sub1: 9a0f58a Add sub1
HEAD is now at 9a0f58a Add sub1
ok 147 - diff-tree --stdin with log formatting

# passed all 147 test(s)
1..147
--- expect	2015-12-16 10:56:52.761564824 +0000
+++ actual	2015-12-16 10:56:53.553564824 +0000
@@ -4,5 +4,3 @@
 file2
 
 sub1:
-file1
-file2
HEAD is now at 662e8e5 second
*** t4015-diff-whitespace.sh ***
diff: sub1/.git: No such file or directory
not ok 11 - git_stash: replace submodule containing a .git directory with a file must fail # TODO known breakage

checking known breakage: 
		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
		)
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4015-diff-whitespace/.git/
expecting success: 
	cat <<-\EOF >x &&
	do {
	   nothing;
	} while (0);
	EOF
	git update-index --add x &&

	cat <<-\EOF >x &&
	do
	{
	   nothing;
	}
	while (0);
	EOF

	cat <<-\EOF >expect &&
	diff --git a/x b/x
	index adf3937..6edc172 100644
	--- a/x
	+++ b/x
	@@ -1,3 +1,5 @@
	-do {
	+do
	+{
	    nothing;
	-} while (0);
	+}
	+while (0);
	EOF

	git diff >out &&
	test_cmp expect out &&

	git diff -w >out &&
	test_cmp expect out &&

	git diff -b >out &&
	test_cmp expect out

Cloning into 'submodule_update'...
ok 1 - Ray Lehtiniemi's example

expecting success: 
	tr Q "\015" <<-\EOF >x &&
	whitespace at beginning
	whitespace change
	whitespace in the middle
	whitespace at end
	unchanged line
	CR at endQ
	EOF

	git update-index x &&

	tr "_" " " <<-\EOF >x &&
	_	whitespace at beginning
	whitespace 	 change
	white space in the middle
	whitespace at end__
	unchanged line
	CR at end
	EOF

	tr "Q_" "\015 " <<-\EOF >expect &&
	diff --git a/x b/x
	index d99af23..22d9f73 100644
	--- a/x
	+++ b/x
	@@ -1,6 +1,6 @@
	-whitespace at beginning
	-whitespace change
	-whitespace in the middle
	-whitespace at end
	+ 	whitespace at beginning
	+whitespace 	 change
	+white space in the middle
	+whitespace at end__
	 unchanged line
	-CR at endQ
	+CR at end
	EOF

	git diff >out &&
	test_cmp expect out &&

	>expect &&
	git diff -w >out &&
	test_cmp expect out &&

	git diff -w -b >out &&
	test_cmp expect out &&

	git diff -w --ignore-space-at-eol >out &&
	test_cmp expect out &&

	git diff -w -b --ignore-space-at-eol >out &&
	test_cmp expect out &&


	tr "Q_" "\015 " <<-\EOF >expect &&
	diff --git a/x b/x
	index d99af23..22d9f73 100644
	--- a/x
	+++ b/x
	@@ -1,6 +1,6 @@
	-whitespace at beginning
	+_	whitespace at beginning
	 whitespace 	 change
	-whitespace in the middle
	+white space in the middle
	 whitespace at end__
	 unchanged line
	 CR at end
	EOF
	git diff -b >out &&
	test_cmp expect out &&

	git diff -b --ignore-space-at-eol >out &&
	test_cmp expect out &&

	tr "Q_" "\015 " <<-\EOF >expect &&
	diff --git a/x b/x
	index d99af23..22d9f73 100644
	--- a/x
	+++ b/x
	@@ -1,6 +1,6 @@
	-whitespace at beginning
	-whitespace change
	-whitespace in the middle
	+_	whitespace at beginning
	+whitespace 	 change
	+white space in the middle
	 whitespace at end__
	 unchanged line
	 CR at end
	EOF
	git diff --ignore-space-at-eol >out &&
	test_cmp expect out

done.
Saved working directory and index state WIP on master: 662e8e5 second
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
HEAD is now at 662e8e5 second
From e27066e74e2522a272f220d17767ef6cab999734 Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:13:13 -0700
Subject: [PATCH 01/12] Initial
Header1: B E Cipient <rcipient@example.com>
To: Someone <someone@out.there>
Cc: C E Cipient <rcipient@example.com>

---
 elif | 10 ++++++++++
 file | 10 ++++++++++
 2 files changed, 20 insertions(+)
 create mode 100644 elif
 create mode 100644 file

diff --git a/elif b/elif
new file mode 100644
index 0000000..f00c965
--- /dev/null
+++ b/elif
@@ -0,0 +1,10 @@
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
diff --git a/file b/file
new file mode 100644
index 0000000..f00c965
--- /dev/null
+++ b/file
@@ -0,0 +1,10 @@
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
-- 
2.6.4


From 1135adfeed86678c55e1aad7c568046ee8215660 Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:14:13 -0700
Subject: [PATCH 02/12] Side changes #1
Header1: B E Cipient <rcipient@example.com>
To: Someone <someone@out.there>
Cc: C E Cipient <rcipient@example.com>

---
 elif | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 elif

diff --git a/elif b/elif
old mode 100644
new mode 100755
-- 
2.6.4


From fd00575a8382ce27c62b83730a40bcff1dc2f25f Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:15:13 -0700
Subject: [PATCH 03/12] Side changes #2
Header1: B E Cipient <rcipient@example.com>
To: Someone <someone@out.there>
Cc: C E Cipient <rcipient@example.com>

---
 file | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/file b/file
index f00c965..e5895ff 100644
--- a/file
+++ b/file
@@ -1,10 +1,14 @@
 1
 2
-3
-4
 5
 6
+A
+B
+C
 7
 8
 9
 10
+D
+E
+F
-- 
2.6.4


From 18ed22aae56367787c36a882bd61281e07994f11 Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:16:13 -0700
Subject: [PATCH 04/12] Side changes #3 with \n backslash-n in it.
Header1: B E Cipient <rcipient@example.com>
To: Someone <someone@out.there>
Cc: C E Cipient <rcipient@example.com>

---
 file | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/file b/file
index e5895ff..40f36c6 100644
--- a/file
+++ b/file
@@ -1,8 +1,10 @@
-1
-2
 5
 6
+1
+2
+3
 A
+4
 B
 C
 7
-- 
2.6.4


From 2e66419311bb9e77e5d67b8ea7019aaddfb581f1 Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:17:13 -0700
Subject: [PATCH 05/12] Master accepts moral equivalent of #2
Header1: B E Cipient <rcipient@example.com>
To: Someone <someone@out.there>
Cc: C E Cipient <rcipient@example.com>

---
 file | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/file b/file
index f00c965..e5895ff 100644
--- a/file
+++ b/file
@@ -1,10 +1,14 @@
 1
 2
-3
-4
 5
 6
+A
+B
+C
 7
 8
 9
 10
+D
+E
+F
-- 
2.6.4


From 350e11281bd1c6490ea045bbbc060879d406b458 Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:18:13 -0700
Subject: [PATCH 06/12] Slave change #1
Header1: B E Cipient <rcipient@example.com>
To: Someone <someone@out.there>
Cc: C E Cipient <rcipient@example.com>

---
 file | 1 +
 1 file changed, 1 insertion(+)

diff --git a/file b/file
index e5895ff..3cb93e8 100644
--- a/file
+++ b/file
@@ -12,3 +12,4 @@ C
 D
 E
 F
+Another line
-- 
2.6.4


From 065c933ac908ac046fbe3293f1c083118e6cc8f9 Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:19:13 -0700
Subject: [PATCH 07/12] Slave change #2
Header1: B E Cipient <rcipient@example.com>
To: Someone <someone@out.there>
Cc: C E Cipient <rcipient@example.com>

---
 file | 1 +
 1 file changed, 1 insertion(+)

diff --git a/file b/file
index 3cb93e8..b43af10 100644
--- a/file
+++ b/file
@@ -13,3 +13,4 @@ D
 E
 F
 Another line
+Yet another line
-- 
2.6.4


From 422768ba4254e7abbeb467b6fe254472207e3d1f Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:20:13 -0700
Subject: [PATCH 08/12] This is an excessively long subject line for a message
 due to the habit some projects have of not having a short, one-line subject
 at the start of the commit message, but rather sticking a whole paragraph
 right at the start as the only thing in the commit message. It had better not
 become the filename for the patch.
Header1: B E Cipient <rcipient@example.com>
To: Someone <someone@out.there>
Cc: C E Cipient <rcipient@example.com>

---
 file | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/file b/file
index 40f36c6..2dc5c23 100644
--- a/file
+++ b/file
@@ -14,3 +14,19 @@ C
 D
 E
 F
+5
+6
+1
+2
+3
+A
+4
+B
+C
+7
+8
+9
+10
+D
+E
+F
-- 
2.6.4


From 65fd934a9794ce9ab6e5c2574ed909ee8b0d4a42 Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:14:13 -0700
Subject: [PATCH 09/12] Side changes #1
Header1: B E Cipient <rcipient@example.com>
To: Someone <someone@out.there>
Cc: C E Cipient <rcipient@example.com>

---
 elif | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 elif

diff --git a/elif b/elif
old mode 100644
new mode 100755
-- 
2.6.4


From 701bcbf78ada10c743c100a390d319cbda0fb047 Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:20:13 -0700
Subject: [PATCH 10/12] Notes added by 'git notes add'
Header1: B E Cipient <rcipient@example.com>
To: Someone <someone@out.there>
Cc: C E Cipient <rcipient@example.com>

---
 ea84707526e90d423e619b6b32bd3f6b55088d02 | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 ea84707526e90d423e619b6b32bd3f6b55088d02

diff --git a/ea84707526e90d423e619b6b32bd3f6b55088d02 b/ea84707526e90d423e619b6b32bd3f6b55088d02
new file mode 100644
index 0000000..da5a1d5
--- /dev/null
+++ b/ea84707526e90d423e619b6b32bd3f6b55088d02
@@ -0,0 +1 @@
+test message
-- 
2.6.4


From ea84707526e90d423e619b6b32bd3f6b55088d02 Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:20:13 -0700
Subject: [PATCH 11/12] foo
Header1: B E Cipient <rcipient@example.com>
To: Someone <someone@out.there>
Cc: C E Cipient <rcipient@example.com>

---
 file | 32 --------------------------------
 foo  | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 32 deletions(-)
 delete mode 100644 file
 create mode 100644 foo

diff --git a/file b/file
deleted file mode 100644
index 2dc5c23..0000000
--- a/file
+++ /dev/null
@@ -1,32 +0,0 @@
-5
-6
-1
-2
-3
-A
-4
-B
-C
-7
-8
-9
-10
-D
-E
-F
-5
-6
-1
-2
-3
-A
-4
-B
-C
-7
-8
-9
-10
-D
-E
-F
diff --git a/foo b/foo
new file mode 100644
index 0000000..2dc5c23
--- /dev/null
+++ b/foo
@@ -0,0 +1,32 @@
+5
+6
+1
+2
+3
+A
+4
+B
+C
+7
+8
+9
+10
+D
+E
+F
+5
+6
+1
+2
+3
+A
+4
+B
+C
+7
+8
+9
+10
+D
+E
+F
-- 
2.6.4


From 8bf542ef94c579d3eee1a3cf5062c983cb6d25eb Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Thu, 7 Apr 2005 15:16:13 -0700
Subject: [PATCH 12/12] Side changes #3 with \n backslash-n in it.
Header1: B E Cipient <rcipient@example.com>
To: Someone <someone@out.there>
Cc: C E Cipient <rcipient@example.com>

---
 file | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/file b/file
index e5895ff..40f36c6 100644
--- a/file
+++ b/file
@@ -1,8 +1,10 @@
-1
-2
 5
 6
+1
+2
+3
 A
+4
 B
 C
 7
-- 
2.6.4

ok 2 - another test, without options

expecting success: 
	test_seq 5 >x &&
	git update-index x &&
	test_seq 5 | sed "/3/i\\
" >x &&
	git diff --ignore-blank-lines >out &&
	>expect &&
	test_cmp out expect

ok 75 - format-patch --stdout pagination can be disabled

expecting success: 
	rm -rf patches/ &&
	echo content >>file &&
	for i in one two three; do echo $i; done >msg &&
	git add file &&
	git commit -F msg &&
	git format-patch -o patches -1 &&
	grep ^Subject: patches/0001-one.patch >actual &&
	echo "Subject: [PATCH] one two three" >expect &&
	test_cmp expect actual

ok 3 - ignore-blank-lines: only new lines

expecting success: 
	test_seq 5 >x &&
	git update-index x &&
	test_seq 5 | sed "/3/i\\
 " >x &&
	git diff -w --ignore-blank-lines >out &&
	>expect &&
	test_cmp out expect

[side 4342c39] one two three
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
patches/0001-one.patch
ok 76 - format-patch handles multi-line subjects

expecting success: 
	rm -rf patches/ &&
	echo content >>file &&
	for i in en två tre; do echo $i; done >msg &&
	git add file &&
	git commit -F msg &&
	git format-patch -o patches -1 &&
	grep ^Subject: patches/0001-en.patch >actual &&
	echo "Subject: [PATCH] =?UTF-8?q?en=20tv=C3=A5=20tre?=" >expect &&
	test_cmp expect actual

ok 4 - ignore-blank-lines: only new lines with space

expecting success: 
	cat <<-\EOF >x &&
	1
	2

	3
	4
	5

	6
	7
	EOF
	git update-index x &&
	cat <<-\EOF >x &&
	change

	1
	2
	3
	4
	5
	6

	7
	EOF
	git diff --inter-hunk-context=100 --ignore-blank-lines >out.tmp &&
	cat <<-\EOF >expected &&
	diff --git a/x b/x
	--- a/x
	+++ b/x
	@@ -1,6 +1,7 @@
	+change
	+
	 1
	 2
	-
	 3
	 4
	 5
	EOF
	compare_diff_patch expected out.tmp

[side c3fe626] en två tre
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
patches/0001-en.patch
ok 77 - format-patch handles multi-line encoded subjects

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3906-stash-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 5 - ignore-blank-lines: after change

expecting success: 
	cat <<-\EOF >x &&
	1
	2

	3
	4
	5
	6
	7
	EOF
	git update-index x &&
	cat <<-\EOF >x &&

	1
	2
	3
	4
	5

	6
	7
	change
	EOF
	git diff --inter-hunk-context=100 --ignore-blank-lines >out.tmp &&
	cat <<-\EOF >expected &&
	diff --git a/x b/x
	--- a/x
	+++ b/x
	@@ -4,5 +4,7 @@
	 3
	 4
	 5
	+
	 6
	 7
	+change
	EOF
	compare_diff_patch expected out.tmp

expecting success: 
	echo content >>file &&
	git add file &&
	git commit -m "$M512" &&
	git format-patch --stdout -1 >patch &&
	sed -n "/^Subject/p; /^ /p; /^$/q" <patch >subject &&
	test_cmp expect subject

HEAD is now at 662e8e5 second
[side 196b076] foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 6 - ignore-blank-lines: before change

expecting success: 
	cat <<-\EOF >x &&
	1
	2
	3
	4
	5


	6
	7
	8
	9
	10
	EOF
	git update-index x &&
	cat <<-\EOF >x &&
	change
	1
	2

	3
	4
	5
	6
	7
	8

	9
	10
	change
	EOF
	git diff --ignore-blank-lines >out.tmp &&
	cat <<-\EOF >expected &&
	diff --git a/x b/x
	--- a/x
	+++ b/x
	@@ -1,5 +1,7 @@
	+change
	 1
	 2
	+
	 3
	 4
	 5
	@@ -8,5 +8,7 @@
	 6
	 7
	 8
	+
	 9
	 10
	+change
	EOF
	compare_diff_patch expected out.tmp

ok 78 - format-patch wraps extremely long subject (ascii)

expecting success: 
	rm -rf patches/ &&
	echo content >>file &&
	git add file &&
	git commit -m "$M512" &&
	git format-patch --stdout -1 >patch &&
	sed -n "/^Subject/p; /^ /p; /^$/q" <patch >subject &&
	test_cmp expect subject

[side 8e667a9] föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar föö bar
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Cloning into 'sub1'...
ok 7 - ignore-blank-lines: between changes

expecting success: 
	test_seq 10 >x &&
	git update-index x &&
	cat <<-\EOF >x &&
	change
	1
	2

	3
	4
	5

	6
	7
	8
	9

	10
	change
	EOF
	git diff --inter-hunk-context=2 --ignore-blank-lines >out.tmp &&
	cat <<-\EOF >expected &&
	diff --git a/x b/x
	--- a/x
	+++ b/x
	@@ -1,10 +1,15 @@
	+change
	 1
	 2
	+
	 3
	 4
	 5
	+
	 6
	 7
	 8
	 9
	+
	 10
	+change
	EOF
	compare_diff_patch expected out.tmp

ok 79 - format-patch wraps extremely long subject (rfc2047)

expecting success: 
	check_author "Foo B. Bar"

done.
ok 8 - ignore-blank-lines: between changes (with interhunkctx)

expecting success: 
	test_seq 10 >x &&
	git update-index x &&
	cat <<-\EOF >x &&
	change
	1
	2
	3

	4

	5

	6


	7

	8
	9
	10
	change
	EOF
	git diff --inter-hunk-context=4 --ignore-blank-lines >out.tmp &&
	cat <<-\EOF >expected &&
	diff --git a/x b/x
	--- a/x
	+++ b/x
	@@ -1,3 +1,4 @@
	+change
	 1
	 2
	 3
	@@ -8,3 +15,4 @@
	 8
	 9
	 10
	+change
	EOF
	compare_diff_patch expected out.tmp

[side d9c8bfb] author-check
 Author: Foo B. Bar <author@example.com>
 1 file changed, 1 insertion(+)
ok 80 - format-patch quotes dot in from-headers

expecting success: 
	check_author "Foo \"The Baz\" Bar"

[side 318775b] author-check
 Author: Foo "The Baz" Bar <author@example.com>
 1 file changed, 1 insertion(+)
ok 9 - ignore-blank-lines: scattered spaces

expecting success: 
	test_seq 6 >x &&
	git update-index x &&
	cat <<-\EOF >x &&
	change
	1
	2
	3

	4

	5

	6
	change
	EOF
	git diff --inter-hunk-context=4 --ignore-blank-lines >out.tmp &&
	cat <<-\EOF >expected &&
	diff --git a/x b/x
	--- a/x
	+++ b/x
	@@ -1,6 +1,11 @@
	+change
	 1
	 2
	 3
	+
	 4
	+
	 5
	+
	 6
	+change
	EOF
	compare_diff_patch expected out.tmp

ok 81 - format-patch quotes double-quote in from-headers

expecting success: 
	check_author "Föo Bar"

Submodule path 'sub1': checked out '61c28065465efb3e256cc3dff7fc62fe1ccc400c'
[side e88cec2] author-check
 Author: Föo Bar <author@example.com>
 1 file changed, 1 insertion(+)
ok 10 - ignore-blank-lines: spaces coalesce

expecting success: 
	test_seq 16 >x &&
	git update-index x &&
	cat <<-\EOF >x &&
	change
	1
	2

	3
	4
	5
	change
	6
	7
	8

	9
	10
	11
	change
	12
	13
	14

	15
	16
	change
	EOF
	git diff --ignore-blank-lines >out.tmp &&
	cat <<-\EOF >expected &&
	diff --git a/x b/x
	--- a/x
	+++ b/x
	@@ -1,8 +1,11 @@
	+change
	 1
	 2
	+
	 3
	 4
	 5
	+change
	 6
	 7
	 8
	@@ -9,8 +13,11 @@
	 9
	 10
	 11
	+change
	 12
	 13
	 14
	+
	 15
	 16
	+change
	EOF
	compare_diff_patch expected out.tmp

Dropped refs/stash@{0} (90a7151c6262ada0d49b23f5711b8ace33eea7f2)
ok 82 - format-patch uses rfc2047-encoded from-headers when necessary

expecting success: 
	check_author "Föo B. Bar"

Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
HEAD is now at 662e8e5 second
ok 11 - ignore-blank-lines: mix changes and blank lines

expecting success: 
	# This is indented with SP HT SP.
	echo " 	 foo();" >x &&
	git diff --check | grep "space before tab in indent"

[side 2596f4d] author-check
 Author: Föo B. Bar <author@example.com>
 1 file changed, 1 insertion(+)
ok 44 - stash show -p - stashes on stack, stash-like argument

expecting success: 
	git stash clear &&
	test_when_finished "git reset --hard HEAD" &&
	git reset --hard &&
	echo foo >> file &&
	STASH_ID=$(git stash create) &&
	git reset --hard &&
	echo "1	0	file" >expected &&
	git stash show --numstat ${STASH_ID} >actual &&
	test_cmp expected actual

x:1: space before tab in indent.
ok 12 - check mixed spaces and tabs in indent

expecting success: 
	# This is indented with HT SP HT.
	echo "	 	foo();" >x &&
	git diff --check | grep "space before tab in indent"

x:1: space before tab in indent.
ok 13 - check mixed tabs and spaces in indent

expecting success: 
	git commit -m "snapshot" &&
	echo "foo();" >x &&
	git diff --check

ok 83 - rfc2047-encoded from-headers leave no rfc822 specials

expecting success: 
	check_author "foo_bar_foo_bar_foo_bar_foo_bar_foo_bar_foo_bar_foo_bar_foo_bar_"

[master (root-commit) f53209a] snapshot
 Author: A U Thor <author@example.com>
 1 file changed, 16 insertions(+)
 create mode 100644 x
ok 14 - check with no whitespace errors

expecting success: 
	echo "foo(); " >x &&
	test_must_fail git diff --check

[side 51d829b] author-check
 Author: foo_bar_foo_bar_foo_bar_foo_bar_foo_bar_foo_bar_foo_bar_foo_bar_ <author@example.com>
 1 file changed, 1 insertion(+)
x:1: trailing whitespace.
+foo(); 
ok 15 - check with trailing whitespace

expecting success: 
	# indent has space followed by hard tab
	echo " 	foo();" >x &&
	test_must_fail git diff --check

x:1: space before tab in indent.
+ 	foo();
ok 16 - check with space before tab in indent

expecting success: 
	git checkout x &&
	git diff --check --exit-code

ok 84 - format-patch wraps moderately long from-header (ascii)

expecting success: 
	check_author "Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar"

HEAD is now at 662e8e5 second
ok 17 - --check and --exit-code are not exclusive

expecting success: 
	git diff --check --quiet

No local changes to save
ok 18 - --check and --quiet are not exclusive

expecting success: 
	echo "foo();" >x &&
	git add x &&
	git diff --cached --check

[side ad9cfec] author-check
 Author: Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar <author@example.com>
 1 file changed, 1 insertion(+)
--- expect	2015-12-16 10:56:55.389564824 +0000
+++ actual	2015-12-16 10:56:55.697564824 +0000
@@ -1,3 +1,4 @@
+M  sub1
 actual
 expect
 file1
ok 85 - format-patch wraps extremely long from-header (ascii)

ok 19 - check staged with no whitespace errors

expecting success: 
	echo "foo(); " >x &&
	git add x &&
	test_must_fail git diff --cached --check

expecting success: 
	check_author "Foo.Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar"

not ok 12 - git_stash: modified submodule does not update submodule work tree # TODO known breakage

checking known breakage: 
		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
		)
	
x:1: trailing whitespace.
+foo(); 
ok 20 - check staged with trailing whitespace

expecting success: 
	# indent has space followed by hard tab
	echo " 	foo();" >x &&
	git add x &&
	test_must_fail git diff --cached --check

[side 2aca603] author-check
 Author: Foo.Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar <author@example.com>
 1 file changed, 1 insertion(+)
x:1: space before tab in indent.
+ 	foo();
ok 21 - check staged with space before tab in indent

expecting success: 
	echo "foo();" >x &&
	git add x &&
	git diff-index --check HEAD

ok 86 - format-patch wraps extremely long from-header (rfc822)

expecting success: 
	check_author "Foö Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar"

ok 22 - check with no whitespace errors (diff-index)

expecting success: 
	echo "foo(); " >x &&
	git add x &&
	test_must_fail git diff-index --check HEAD

x:1: trailing whitespace.
+foo(); 
ok 23 - check with trailing whitespace (diff-index)

expecting success: 
	# indent has space followed by hard tab
	echo " 	foo();" >x &&
	git add x &&
	test_must_fail git diff-index --check HEAD

[side 1cfc6db] author-check
 Author: Foö Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar Foo Bar <author@example.com>
 1 file changed, 1 insertion(+)
Cloning into 'submodule_update'...
x:1: space before tab in indent.
+ 	foo();
ok 87 - format-patch wraps extremely long from-header (rfc2047)

ok 24 - check with space before tab in indent (diff-index)

expecting success: 
	echo "foo();" >x &&
	git add x &&
	git diff-index --cached --check HEAD

expecting success: 
	echo content >>file &&
	git add file &&
	git commit -m "header with . in it" &&
	git format-patch -k -1 --stdout >patch &&
	grep ^Subject: patch >actual &&
	test_cmp expect actual

done.
HEAD is now at 662e8e5 second
ok 25 - check staged with no whitespace errors (diff-index)

expecting success: 
	echo "foo(); " >x &&
	git add x &&
	test_must_fail git diff-index --cached --check HEAD

[side 99b693e] header with . in it
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
x:1: trailing whitespace.
+foo(); 
ok 26 - check staged with trailing whitespace (diff-index)

expecting success: 
	# indent has space followed by hard tab
	echo " 	foo();" >x &&
	git add x &&
	test_must_fail git diff-index --cached --check HEAD

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 88 - subject lines do not have 822 atom-quoting

expecting success: 
	git format-patch -n -1 --stdout --subject-prefix=PREFIX >patch &&
	grep ^Subject: patch >actual &&
	test_cmp expect actual

x:1: space before tab in indent.
+ 	foo();
ok 27 - check staged with space before tab in indent (diff-index)

expecting success: 
	echo "foo();" >x &&
	git commit -m "new commit" x &&
	git diff-tree --check HEAD^ HEAD

ok 89 - subject prefixes have space prepended

expecting success: 
	git format-patch -n -1 --stdout --subject-prefix= >patch &&
	grep ^Subject: patch >actual &&
	test_cmp expect actual

[master 7d883b5] new commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 16 deletions(-)
ok 28 - check with no whitespace errors (diff-tree)

expecting success: 
	echo "foo(); " >x &&
	git commit -m "another commit" x &&
	test_must_fail git diff-tree --check HEAD^ HEAD

ok 90 - empty subject prefix does not have extra space

expecting success: 
	test_must_fail git format-patch -1 --stdout --from=foo >patch

fatal: invalid ident line: foo
ok 91 - --from=ident notices bogus ident

expecting success: 
	git format-patch -1 --stdout --from="Me <me@example.com>" >patch &&
	cat >expect <<-\EOF &&
	From: Me <me@example.com>

	From: A U Thor <author@example.com>

	EOF
	sed -ne "/^From:/p; /^$/p; /^---$/q" <patch >patch.head &&
	test_cmp expect patch.head

[master 09c49eb] another commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
x:1: trailing whitespace.
+foo(); 
ok 29 - check with trailing whitespace (diff-tree)

expecting success: 
	# indent has space followed by hard tab
	echo " 	foo();" >x &&
	git commit -m "yet another" x &&
	test_must_fail git diff-tree --check HEAD^ HEAD

ok 92 - --from=ident replaces author

expecting success: 
	git format-patch -1 --stdout --from >patch &&
	cat >expect <<-\EOF &&
	From: C O Mitter <committer@example.com>

	From: A U Thor <author@example.com>

	EOF
	sed -ne "/^From:/p; /^$/p; /^---$/q" <patch >patch.head &&
	test_cmp expect patch.head

[master f191bcd] yet another
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
HEAD is now at 662e8e5 second
ok 45 - stash show - no stashes on stack, stash-like argument

expecting success: 
	git stash clear &&
	test_when_finished "git reset --hard HEAD" &&
	git reset --hard &&
	echo foo >> file &&
	STASH_ID=$(git stash create) &&
	git reset --hard &&
	cat >expected <<-EOF &&
	diff --git a/file b/file
	index 7601807..71b52c4 100644
	--- a/file
	+++ b/file
	@@ -1 +1,2 @@
	 baz
	+foo
	EOF
	git stash show -p ${STASH_ID} >actual &&
	test_cmp expected actual

ok 93 - --from uses committer ident

expecting success: 
	git format-patch -1 --stdout --from="A U Thor <author@example.com>" >patch &&
	cat >expect <<-\EOF &&
	From: A U Thor <author@example.com>

	EOF
	sed -ne "/^From:/p; /^$/p; /^---$/q" <patch >patch.head &&
	test_cmp expect patch.head

x:1: space before tab in indent.
+ 	foo();
ok 30 - check with space before tab in indent (diff-tree)

expecting success: 
	git config core.whitespace "-trailing-space" &&
	echo "foo ();   " >x &&
	git diff --check

ok 31 - check trailing whitespace (trailing-space: off)

expecting success: 
	git config core.whitespace "trailing-space" &&
	echo "foo ();   " >x &&
	test_must_fail git diff --check

ok 94 - --from omits redundant in-body header

expecting success: 
	GIT_AUTHOR_NAME="éxötìc" test_commit exotic &&
	test_when_finished "git reset --hard HEAD^" &&
	git format-patch -1 --stdout --from >patch &&
	cat >expect <<-\EOF &&
	From: C O Mitter <committer@example.com>
	Content-Type: text/plain; charset=UTF-8

	From: éxötìc <author@example.com>

	EOF
	sed -ne "/^From:/p; /^$/p; /^Content-Type/p; /^---$/q" <patch >patch.head &&
	test_cmp expect patch.head

x:1: trailing whitespace.
+foo ();   
ok 32 - check trailing whitespace (trailing-space: on)

expecting success: 
	# indent contains space followed by HT
	git config core.whitespace "-space-before-tab" &&
	echo " 	foo ();" >x &&
	git diff --check

[side e59bbbf] exotic
 Author: éxötìc <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 exotic.t
ok 33 - check space before tab in indent (space-before-tab: off)

expecting success: 
	# indent contains space followed by HT
	git config core.whitespace "space-before-tab" &&
	echo " 	foo ();   " >x &&
	test_must_fail git diff --check

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t3906-stash-submodule/submodule_update_repo/.) registered for path 'sub1'
x:1: trailing whitespace, space before tab in indent.
+ 	foo ();   
ok 34 - check space before tab in indent (space-before-tab: on)

expecting success: 
	git config core.whitespace "-indent-with-non-tab" &&
	echo "        foo ();" >x &&
	git diff --check

HEAD is now at 662e8e5 second
ok 35 - check spaces as indentation (indent-with-non-tab: off)

expecting success: 
	git config core.whitespace "indent-with-non-tab" &&
	echo "        foo ();" >x &&
	test_must_fail git diff --check

HEAD is now at 99b693e header with . in it
ok 95 - in-body headers trigger content encoding

expecting success: 
	append_signoff </dev/null >actual &&
	cat <<\EOF | sed "s/EOL$//" >expected &&
4:Subject: [PATCH] EOL
8:
9:Signed-off-by: C O Mitter <committer@example.com>
EOF
	test_cmp expected actual

x:1: indent with spaces.
+        foo ();
ok 36 - check spaces as indentation (indent-with-non-tab: on)

expecting success: 
	git config core.whitespace "indent-with-non-tab,tabwidth=9" &&
	git diff --check

ok 37 - ditto, but tabwidth=9

expecting success: 
	git config core.whitespace "indent-with-non-tab" &&
	echo "	                foo ();" >x &&
	test_must_fail git diff --check

Cloning into 'sub1'...
ok 96 - signoff: commit with no body

expecting success: 
	echo subject | append_signoff >actual &&
	cat >expected <<\EOF &&
4:Subject: [PATCH] subject
8:
9:Signed-off-by: C O Mitter <committer@example.com>
EOF
	test_cmp expected actual

x:1: indent with spaces.
+	                foo ();
ok 38 - check tabs and spaces as indentation (indent-with-non-tab: on)

expecting success: 
	git config core.whitespace "indent-with-non-tab,tabwidth=10" &&
	test_must_fail git diff --check

x:1: indent with spaces.
+	                foo ();
ok 39 - ditto, but tabwidth=10

expecting success: 
	git config core.whitespace "indent-with-non-tab,tabwidth=20" &&
	git diff --check

done.
ok 97 - signoff: commit with only subject

expecting success: 
	printf subject | append_signoff >actual &&
	cat >expected <<\EOF &&
4:Subject: [PATCH] subject
8:
9:Signed-off-by: C O Mitter <committer@example.com>
EOF
	test_cmp expected actual

ok 40 - ditto, but tabwidth=20

expecting success: 
	git config core.whitespace "-tab-in-indent" &&
	echo "	foo ();" >x &&
	git diff --check

ok 41 - check tabs as indentation (tab-in-indent: off)

expecting success: 
	git config core.whitespace "tab-in-indent" &&
	echo "	foo ();" >x &&
	test_must_fail git diff --check

x:1: tab in indent.
+	foo ();
ok 42 - check tabs as indentation (tab-in-indent: on)

expecting success: 
	git config core.whitespace "tab-in-indent" &&
	echo "	                foo ();" >x &&
	test_must_fail git diff --check

ok 98 - signoff: commit with only subject that does not end with NL

expecting success: 
	append_signoff <<\EOF >actual &&
subject

body
EOF
	cat >expected <<\EOF &&
4:Subject: [PATCH] subject
8:
10:
11:Signed-off-by: C O Mitter <committer@example.com>
EOF
	test_cmp expected actual

x:1: tab in indent.
+	                foo ();
ok 43 - check tabs and spaces as indentation (tab-in-indent: on)

expecting success: 
	git config core.whitespace "tab-in-indent,tabwidth=1" &&
	test_must_fail git diff --check

HEAD is now at 662e8e5 second
x:1: tab in indent.
+	                foo ();
ok 44 - ditto, but tabwidth=1 (must be irrelevant)

expecting success: 
	git config core.whitespace "tab-in-indent,indent-with-non-tab" &&
	echo "foo ();" >x &&
	test_must_fail git diff --check

ok 99 - signoff: no existing signoffs

expecting success: 
	printf "subject\n\nbody" | append_signoff >actual &&
	cat >expected <<\EOF &&
4:Subject: [PATCH] subject
8:
10:
11:Signed-off-by: C O Mitter <committer@example.com>
EOF
	test_cmp expected actual

Submodule path 'sub1': checked out '61c28065465efb3e256cc3dff7fc62fe1ccc400c'
fatal: cannot enforce both tab-in-indent and indent-with-non-tab
ok 45 - check tab-in-indent and indent-with-non-tab conflict

expecting success: 
	git config --unset core.whitespace &&
	echo "x whitespace" >.gitattributes &&
	echo "	  foo ();" >x &&
	git diff --check &&
	rm -f .gitattributes

ok 100 - signoff: no existing signoffs and no trailing NL

expecting success: 
	append_signoff <<\EOF >actual &&
subject

body

Signed-off-by: my@house
EOF
	cat >expected <<\EOF &&
4:Subject: [PATCH] subject
8:
10:
11:Signed-off-by: my@house
12:Signed-off-by: C O Mitter <committer@example.com>
EOF
	test_cmp expected actual

ok 46 - check tab-in-indent excluded from wildcard whitespace attribute

expecting success: 
	echo "" >x &&
	echo "foo(); " >>x &&
	git diff --check | grep "x:2:"

x:2: trailing whitespace.
ok 47 - line numbers in --check output are correct

expecting success: 
	echo "foo();" >x &&
	echo "" >>x &&
	git diff --check | grep "new blank line"

Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
x:2: new blank line at EOF.
ok 48 - checkdiff detects new trailing blank lines (1)

expecting success: 
	{ echo a; echo b; echo; echo; } >x &&
	git add x &&
	{ echo a; echo; echo; echo; echo; } >x &&
	git diff --check | grep "new blank line"

ok 101 - signoff: some random signoff

expecting success: 
	append_signoff <<\EOF >actual &&
subject

body

Signed-off-by: my@house
(cherry picked from commit da39a3ee5e6b4b0d3255bfef95601890afd80709)
Tested-by: Some One <someone@example.com>
Bug: 1234
EOF
	cat >expected <<\EOF &&
4:Subject: [PATCH] subject
8:
10:
11:Signed-off-by: my@house
15:Signed-off-by: C O Mitter <committer@example.com>
EOF
	test_cmp expected actual

x:2: new blank line at EOF.
ok 49 - checkdiff detects new trailing blank lines (2)

expecting success: 
	git checkout x &&
	mv x y &&
	(
		echo "/* This is new */" &&
		echo "" &&
		cat y
	) >x &&
	git diff --check

HEAD is now at 662e8e5 second
ok 46 - stash show -p - no stashes on stack, stash-like argument

expecting success: 
	git stash clear &&
	test_when_finished "git reset --hard HEAD && git stash clear" &&
	git reset --hard &&
	echo foo > file &&
	git stash &&
	echo bar > file &&
	git stash &&
	test_must_fail git stash drop $(git rev-parse stash@{0}) &&
	git stash pop &&
	test bar = "$(cat file)" &&
	git reset --hard HEAD

ok 102 - signoff: misc conforming footer elements

expecting success: 
	append_signoff <<\EOF >actual &&
subject

body
Fooled-by-me: my@house
EOF
	cat >expected <<\EOF &&
4:Subject: [PATCH] subject
8:
11:
12:Signed-off-by: C O Mitter <committer@example.com>
EOF
	test_cmp expected actual

ok 50 - checkdiff allows new blank lines

expecting success: 
	git reset --hard &&
	echo >x "hello world" &&
	git add x &&
	git commit -m "hello 1" &&
	echo >x "hello  world" &&
	git diff -b >actual &&
	test_cmp expect actual

HEAD is now at f191bcd yet another
ok 103 - signoff: some random signoff-alike

expecting success: 
	append_signoff <<\EOF >actual &&
subject

I want to mention about Signed-off-by: here.
EOF
	cat >expected <<\EOF &&
4:Subject: [PATCH] subject
8:
9:I want to mention about Signed-off-by: here.
10:
11:Signed-off-by: C O Mitter <committer@example.com>
EOF
	test_cmp expected actual

[master 4c159fb] hello 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
No local changes to save
ok 51 - whitespace-only changes not reported

expecting success: 
	git reset --hard &&
	for i in 1 2 3 4 5 6 7 8 9; do echo "$i$i$i$i$i$i"; done >x &&
	git add x &&
	git commit -m "base" &&
	sed -e "5s/^/ /" x >z &&
	git rm x &&
	git add z &&
	git diff -w -M --cached |
	sed -e "/^similarity index /s/[0-9][0-9]*/NUM/" >actual &&
	test_cmp expect actual

HEAD is now at 4c159fb hello 1
ok 104 - signoff: not really a signoff

expecting success: 
	append_signoff <<\EOF >actual &&
subject

My unfortunate
Signed-off-by: example happens to be wrapped here.
EOF
	cat >expected <<\EOF &&
4:Subject: [PATCH] subject
8:
10:Signed-off-by: example happens to be wrapped here.
11:
12:Signed-off-by: C O Mitter <committer@example.com>
EOF
	test_cmp expected actual

--- expect	2015-12-16 10:56:57.417564824 +0000
+++ actual	2015-12-16 10:56:57.745564824 +0000
@@ -1,3 +1,4 @@
+M  sub1
 actual
 expect
 file1
HEAD is now at 662e8e5 second
not ok 13 - git_stash: modified submodule does not update submodule work tree to invalid commit # TODO known breakage

checking known breakage: 
		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
		)
	
[master 3985915] base
 Author: A U Thor <author@example.com>
 1 file changed, 9 insertions(+), 1 deletion(-)
ok 105 - signoff: not really a signoff (2)

expecting success: 
	append_signoff <<\EOF >actual &&
subject

Signed-off-by: my@house
Signed-off-by: your@house

A lot of houses.
EOF
	cat >expected <<\EOF &&
4:Subject: [PATCH] subject
8:
9:Signed-off-by: my@house
10:Signed-off-by: your@house
11:
13:
14:Signed-off-by: C O Mitter <committer@example.com>
EOF
	test_cmp expected actual

rm 'x'
ok 52 - whitespace-only changes reported across renames

expecting success: 
	git reset --hard &&
	>empty &&
	git add empty &&
	git commit -m empty &&
	git mv empty void &&
	git diff -w --cached -M >current &&
	test_cmp expected current

ok 106 - signoff: valid S-o-b paragraph in the middle

expecting success: 
	append_signoff <<\EOF >actual &&
subject

body

Signed-off-by: C O Mitter <committer@example.com>
EOF
	cat >expected <<\EOF &&
4:Subject: [PATCH] subject
8:
10:
11:Signed-off-by: C O Mitter <committer@example.com>
EOF
	test_cmp expected actual

HEAD is now at 3985915 base
Cloning into 'submodule_update'...
[master 8fa61fa] empty
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 empty
done.
ok 107 - signoff: the same signoff at the end

expecting success: 
	printf "subject\n\nSigned-off-by: C O Mitter <committer@example.com>" |
		append_signoff >actual &&
	cat >expected <<\EOF &&
4:Subject: [PATCH] subject
8:
9:Signed-off-by: C O Mitter <committer@example.com>
EOF
	test_cmp expected actual

ok 53 - rename empty

expecting success: 

	git reset --hard &&
	echo >x hello &&
	git commit -m "one side" x &&
	git checkout HEAD^ &&
	echo >x goodbye &&
	git commit -m "the other side" x &&
	git config core.autocrlf true &&
	test_must_fail git merge master &&

	git diff | sed -e "1,/^@@@/d" >actual &&
	! grep "^-" actual


HEAD is now at 8fa61fa empty
Switched to a new branch 'invalid_sub1'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
[master 891d385] one side
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 9 deletions(-)
ok 108 - signoff: the same signoff at the end, no trailing NL

expecting success: 
	append_signoff <<\EOF >actual &&
subject

body

Signed-off-by: C O Mitter <committer@example.com>
Signed-off-by: my@house
EOF
	cat >expected <<\EOF &&
4:Subject: [PATCH] subject
8:
10:
11:Signed-off-by: C O Mitter <committer@example.com>
12:Signed-off-by: my@house
EOF
	test_cmp expected actual

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 8fa61fa... empty
fatal: Needed a single revision
[detached HEAD 80425b8] the other side
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 9 deletions(-)
Saved working directory and index state WIP on master: 662e8e5 second
Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
ok 109 - signoff: the same signoff NOT at the end

expecting success: 
	append_signoff <<\EOF >actual &&
subject

body

Tested-by: my@house
Some Trash
Signed-off-by: C O Mitter <committer@example.com>
EOF
	cat >expected <<\EOF &&
4:Subject: [PATCH] subject
8:
10:
13:Signed-off-by: C O Mitter <committer@example.com>
14:
15:Signed-off-by: C O Mitter <committer@example.com>
EOF
	test_cmp expected actual

HEAD is now at 662e8e5 second
Merging:
80425b8 the other side
virtual master
found 1 common ancestor:
8fa61fa empty
Auto-merging x
CONFLICT (content): Merge conflict in x
Automatic merge failed; fix conflicts and then commit the result.
ok 54 - combined diff with autocrlf conversion

expecting success: 
	git config color.diff always &&
	git config color.diff.plain normal &&
	git config color.diff.meta bold &&
	git config color.diff.frag cyan &&
	git config color.diff.func normal &&
	git config color.diff.old red &&
	git config color.diff.new green &&
	git config color.diff.commit yellow &&
	git config color.diff.whitespace blue &&

	git config core.autocrlf false

ok 110 - signoff: detect garbage in non-conforming footer

expecting success: 
	append_signoff <<\EOF >actual &&
subject

body

Reviewed-id: Noone
Tested-by: my@house
Change-id: Ideadbeef
Signed-off-by: C O Mitter <committer@example.com>
Bug: 1234
EOF
	cat >expected <<\EOF &&
4:Subject: [PATCH] subject
8:
10:
14:Signed-off-by: C O Mitter <committer@example.com>
EOF
	test_cmp expected actual

ok 111 - signoff: footer begins with non-signoff without @ sign

expecting success: 
	test_unconfig color.ui &&
	git format-patch --stdout -1 >expect &&
	test_config color.ui always &&
	git format-patch --stdout -1 >actual &&
	test_cmp expect actual

No local changes to save
ok 55 - setup diff colors

expecting success: 
	git config core.whitespace blank-at-eol &&
	git reset --hard &&
	echo "test" >x &&
	git commit -m "initial" x &&
	echo "{NTN}" | tr "NT" "\n\t" >>x &&
	git -c color.diff=always diff | test_decode_color >current &&

	cat >expected <<-\EOF &&
	<BOLD>diff --git a/x b/x<RESET>
	<BOLD>index 9daeafb..2874b91 100644<RESET>
	<BOLD>--- a/x<RESET>
	<BOLD>+++ b/x<RESET>
	<CYAN>@@ -1 +1,4 @@<RESET>
	 test<RESET>
	<GREEN>+<RESET><GREEN>{<RESET>
	<GREEN>+<RESET><BLUE>	<RESET>
	<GREEN>+<RESET><GREEN>}<RESET>
	EOF

	test_cmp expected current

--- expect	2015-12-16 10:56:58.349564824 +0000
+++ actual	2015-12-16 10:56:58.661564824 +0000
@@ -1,3 +1,4 @@
+M  sub1
 actual
 expect
 file1
ok 112 - format patch ignores color.ui

expecting success: 
	git checkout rebuild-1 &&
	test_config branch.rebuild-1.description hello &&
	git format-patch --stdout --cover-letter master >actual &&
	grep hello actual >/dev/null

HEAD is now at 80425b8 the other side
Switched to branch 'rebuild-1'
not ok 14 - git_stash: modified submodule does not update submodule work tree from invalid commit # TODO known breakage

[detached HEAD 40507f1] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
# still have 11 known breakage(s)
# passed all remaining 3 test(s)
1..14
ok 56 - diff that introduces a line with only tabs

expecting success: 
	git reset --hard &&
	{
		echo "0. blank-at-eol " &&
		echo "1. blank-at-eol "
	} >x &&
	git commit -a --allow-empty -m preimage &&
	{
		echo "0. blank-at-eol " &&
		echo "1. still-blank-at-eol " &&
		echo "2. and a new line "
	} >x &&

	git -c color.diff=always diff |
	test_decode_color >current &&

	cat >expected <<-\EOF &&
	<BOLD>diff --git a/x b/x<RESET>
	<BOLD>index d0233a2..700886e 100644<RESET>
	<BOLD>--- a/x<RESET>
	<BOLD>+++ b/x<RESET>
	<CYAN>@@ -1,2 +1,3 @@<RESET>
	 0. blank-at-eol <RESET>
	<RED>-1. blank-at-eol <RESET>
	<GREEN>+<RESET><GREEN>1. still-blank-at-eol<RESET><BLUE> <RESET>
	<GREEN>+<RESET><GREEN>2. and a new line<RESET><BLUE> <RESET>
	EOF

	test_cmp expected current

HEAD is now at 40507f1 initial
ok 113 - cover letter using branch description (1)

expecting success: 
	git checkout rebuild-1 &&
	test_config branch.rebuild-1.description hello &&
	git format-patch --stdout --cover-letter rebuild-1~2..rebuild-1 >actual &&
	grep hello actual >/dev/null

Saved working directory and index state WIP on master: 662e8e5 second
Already on 'rebuild-1'
[detached HEAD b9e4e4b] preimage
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+), 1 deletion(-)
HEAD is now at 662e8e5 second
ok 57 - diff that introduces and removes ws breakages

expecting success: 
	git reset --hard &&
	{
		echo "0. blank-at-eol " &&
		echo "1. blank-at-eol "
	} >x &&
	git commit -a --allow-empty -m preimage &&
	{
		echo "0. blank-at-eol " &&
		echo "1. still-blank-at-eol " &&
		echo "2. and a new line "
	} >x &&

	git -c color.diff=always diff --ws-error-highlight=default,old |
	test_decode_color >current &&

	cat >expected <<-\EOF &&
	<BOLD>diff --git a/x b/x<RESET>
	<BOLD>index d0233a2..700886e 100644<RESET>
	<BOLD>--- a/x<RESET>
	<BOLD>+++ b/x<RESET>
	<CYAN>@@ -1,2 +1,3 @@<RESET>
	 0. blank-at-eol <RESET>
	<RED>-<RESET><RED>1. blank-at-eol<RESET><BLUE> <RESET>
	<GREEN>+<RESET><GREEN>1. still-blank-at-eol<RESET><BLUE> <RESET>
	<GREEN>+<RESET><GREEN>2. and a new line<RESET><BLUE> <RESET>
	EOF

	test_cmp expected current &&

	git -c color.diff=always diff --ws-error-highlight=all |
	test_decode_color >current &&

	cat >expected <<-\EOF &&
	<BOLD>diff --git a/x b/x<RESET>
	<BOLD>index d0233a2..700886e 100644<RESET>
	<BOLD>--- a/x<RESET>
	<BOLD>+++ b/x<RESET>
	<CYAN>@@ -1,2 +1,3 @@<RESET>
	 <RESET>0. blank-at-eol<RESET><BLUE> <RESET>
	<RED>-<RESET><RED>1. blank-at-eol<RESET><BLUE> <RESET>
	<GREEN>+<RESET><GREEN>1. still-blank-at-eol<RESET><BLUE> <RESET>
	<GREEN>+<RESET><GREEN>2. and a new line<RESET><BLUE> <RESET>
	EOF

	test_cmp expected current &&

	git -c color.diff=always diff --ws-error-highlight=none |
	test_decode_color >current &&

	cat >expected <<-\EOF &&
	<BOLD>diff --git a/x b/x<RESET>
	<BOLD>index d0233a2..700886e 100644<RESET>
	<BOLD>--- a/x<RESET>
	<BOLD>+++ b/x<RESET>
	<CYAN>@@ -1,2 +1,3 @@<RESET>
	 0. blank-at-eol <RESET>
	<RED>-1. blank-at-eol <RESET>
	<GREEN>+1. still-blank-at-eol <RESET>
	<GREEN>+2. and a new line <RESET>
	EOF

	test_cmp expected current

*** t4016-diff-quote.sh ***
HEAD is now at b9e4e4b preimage
ok 114 - cover letter using branch description (2)

expecting success: 
	git checkout rebuild-1 &&
	test_config branch.rebuild-1.description hello &&
	git format-patch --stdout --cover-letter ^master rebuild-1 >actual &&
	grep hello actual >/dev/null

Already on 'rebuild-1'
[detached HEAD 683bf9e] preimage
 Author: A U Thor <author@example.com>
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4016-diff-quote/.git/
ok 115 - cover letter using branch description (3)

expecting success: 
	git checkout rebuild-1 &&
	test_config branch.rebuild-1.description hello &&
	git format-patch --stdout --cover-letter master.. >actual &&
	grep hello actual >/dev/null

expecting success: 
	echo P0.0 >"$P0.0" &&
	echo P0.1 >"$P0.1" &&
	echo P0.2 >"$P0.2" &&
	echo P0.3 >"$P0.3" &&
	echo P1.0 >"$P1.0" &&
	echo P1.2 >"$P1.2" &&
	echo P1.3 >"$P1.3" &&
	git add . &&
	git commit -m initial &&
	git mv "$P0.0" "R$P0.0" &&
	git mv "$P0.1" "R$P1.0" &&
	git mv "$P0.2" "R$P2.0" &&
	git mv "$P0.3" "R$P3.0" &&
	git mv "$P1.0" "R$P0.1" &&
	git mv "$P1.2" "R$P2.1" &&
	git mv "$P1.3" "R$P3.1" &&
	:

ok 58 - the same with --ws-error-highlight

Already on 'rebuild-1'
# passed all 58 test(s)
1..58
[master (root-commit) 9ee9585] initial
 Author: A U Thor <author@example.com>
 7 files changed, 7 insertions(+)
 create mode 100644 "pathname\twith HT.0"
 create mode 100644 "pathname\twith HT.2"
 create mode 100644 "pathname\twith HT.3"
 create mode 100644 pathname.0
 create mode 100644 pathname.1
 create mode 100644 pathname.2
 create mode 100644 pathname.3
'a2fb5a9e4a882b58f0ca0b0eaae00863c2217bb8' is not a stash reference
ok 116 - cover letter using branch description (4)

expecting success: 
	git checkout rebuild-1 &&
	test_config branch.rebuild-1.description hello &&
	git format-patch --stdout --cover-letter -2 HEAD >actual &&
	grep hello actual >/dev/null

Already on 'rebuild-1'
*** t4017-diff-retval.sh ***
ok 1 - setup

expecting success: 
cat >expect <<\EOF
 rename pathname.1 => "Rpathname\twith HT.0" (100%)
 rename pathname.3 => "Rpathname\nwith LF.0" (100%)
 rename "pathname\twith HT.3" => "Rpathname\nwith LF.1" (100%)
 rename pathname.2 => Rpathname with SP.0 (100%)
 rename "pathname\twith HT.2" => Rpathname with SP.1 (100%)
 rename pathname.0 => Rpathname.0 (100%)
 rename "pathname\twith HT.0" => Rpathname.1 (100%)
EOF

ok 117 - cover letter using branch description (5)

expecting success: 
	git checkout rebuild-1 &&
	test_config branch.rebuild-1.description hello &&
	git format-patch --stdout --cover-letter -2 >actual &&
	grep hello actual >/dev/null

ok 2 - setup expected files

expecting success: 
	git diff --summary -M HEAD >actual &&
	test_cmp expect actual

Already on 'rebuild-1'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4017-diff-retval/.git/
ok 3 - git diff --summary -M HEAD

expecting success: 
	cat >expect <<-\EOF &&
	0	0	pathname.1 => "Rpathname\twith HT.0"
	0	0	pathname.3 => "Rpathname\nwith LF.0"
	0	0	"pathname\twith HT.3" => "Rpathname\nwith LF.1"
	0	0	pathname.2 => Rpathname with SP.0
	0	0	"pathname\twith HT.2" => Rpathname with SP.1
	0	0	pathname.0 => Rpathname.0
	0	0	"pathname\twith HT.0" => Rpathname.1
	EOF
	git diff --numstat -M HEAD >actual &&
	test_cmp expect actual

expecting success: 
	echo "1 " >a &&
	git add . &&
	git commit -m zeroth &&
	echo 1 >a &&
	git add . &&
	git commit -m first &&
	echo 2 >b &&
	git add . &&
	git commit -a -m second

ok 4 - git diff --numstat -M HEAD

expecting success: 
	cat >expect <<-\EOF &&
	 pathname.1 => "Rpathname\twith HT.0"            | 0
	 pathname.3 => "Rpathname\nwith LF.0"            | 0
	 "pathname\twith HT.3" => "Rpathname\nwith LF.1" | 0
	 pathname.2 => Rpathname with SP.0               | 0
	 "pathname\twith HT.2" => Rpathname with SP.1    | 0
	 pathname.0 => Rpathname.0                       | 0
	 "pathname\twith HT.0" => Rpathname.1            | 0
	 7 files changed, 0 insertions(+), 0 deletions(-)
	EOF
	git diff --stat -M HEAD >actual &&
	test_i18ncmp expect actual

[master (root-commit) fa2d71b] zeroth
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a
ok 118 - cover letter using branch description (6)

expecting success: 
	git format-patch --stdout --cover-letter >actual &&
	test_line_count = 0 actual

ok 5 - git diff --stat -M HEAD

# passed all 5 test(s)
1..5
ok 119 - cover letter with nothing

expecting success: 
	mkdir -p tmp &&
	test_when_finished "rm -rf tmp;
		git config --unset format.coverletter" &&

	git config format.coverletter auto &&
	git format-patch -o tmp -1 >list &&
	test_line_count = 1 list &&
	git format-patch -o tmp -2 >list &&
	test_line_count = 3 list

Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual 3a18f644551a5809421ac2e8f6cc40181a075c5d
[master 5703903] first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
*** t4018-diff-funcname.sh ***
[master d5c0988] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 b
ok 1 - setup

expecting success: 
	git diff --quiet -w HEAD^^ HEAD^

On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   file

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	actual
	expect
	expect1
	expect2
	expected
	output
	output.out
	stashlist1
	stashlist2

no changes added to commit (use "git add" and/or "git commit -a")
ok 2 - git diff --quiet -w  HEAD^^ HEAD^

expecting success: 
	test_must_fail git diff --quiet HEAD^^ HEAD^

Dropped refs/stash@{0} (a2fb5a9e4a882b58f0ca0b0eaae00863c2217bb8)
ok 3 - git diff --quiet HEAD^^ HEAD^

expecting success: 
	test_must_fail git diff --quiet -w HEAD^ HEAD

ok 120 - cover letter auto

expecting success: 
	mkdir -p tmp &&
	test_when_finished "rm -rf tmp;
		git config --unset format.coverletter" &&

	git config format.coverletter auto &&
	git format-patch -o tmp --cover-letter -1 >list &&
	test_line_count = 2 list &&
	git format-patch -o tmp --cover-letter -2 >list &&
	test_line_count = 3 list &&
	git format-patch -o tmp --no-cover-letter -1 >list &&
	test_line_count = 1 list &&
	git format-patch -o tmp --no-cover-letter -2 >list &&
	test_line_count = 2 list

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4018-diff-funcname/.git/
ok 4 - git diff --quiet -w  HEAD^ HEAD

expecting success: 
	test_expect_code 1 git diff-tree --exit-code HEAD^ HEAD

HEAD is now at 662e8e5 second
expecting success: 
	# a non-trivial custom pattern
	git config diff.custom1.funcname "!static
!String
[^ 	].*s.*" &&

	# a custom pattern which matches to end of line
	git config diff.custom2.funcname "......Beer\$" &&

	# alternation in pattern
	git config diff.custom3.funcname "Beer$" &&
	git config diff.custom3.xfuncname "^[ 	]*((public|static).*)$" &&

	# for regexp compilation tests
	echo A >A.java &&
	echo B >B.java

:000000 100644 0000000000000000000000000000000000000000 0cfbf08886fca9a91cb753ec8734c84fcbe52c9f A	b
ok 5 - git diff-tree HEAD^ HEAD

expecting success: 
	git diff-tree --exit-code HEAD^ HEAD -- a

HEAD is now at 662e8e5 second
ok 6 - git diff-tree HEAD^ HEAD -- a

expecting success: 
	test_expect_code 1 git diff-tree --exit-code HEAD^ HEAD -- b

:000000 100644 0000000000000000000000000000000000000000 0cfbf08886fca9a91cb753ec8734c84fcbe52c9f A	b
ok 7 - git diff-tree HEAD^ HEAD -- b

expecting success: 
	echo $(git rev-parse HEAD) | test_expect_code 1 git diff-tree --exit-code --stdin

ok 1 - setup

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
d5c09883f5e6fa412d113f10f916986d43ec4776
:000000 100644 0000000000000000000000000000000000000000 0cfbf08886fca9a91cb753ec8734c84fcbe52c9f A	b
ok 8 - echo HEAD | git diff-tree --stdin

expecting success: 
	git diff-tree --exit-code HEAD HEAD

diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
-A
+B
ok 2 - builtin ada pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index --word-diff \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
ok 9 - git diff-tree HEAD HEAD

expecting success: 
	git diff-files --exit-code

diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
[-A-]{+B+}
ok 10 - git diff-files

expecting success: 
	git diff-index --exit-code --cached HEAD

ok 3 - builtin ada wordRegex pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
ok 11 - git diff-index --cached HEAD

expecting success: 
	test_expect_code 1 git diff-index --exit-code --cached HEAD^

ok 121 - cover letter auto user override

diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
-A
+B
# still have 5 known breakage(s)
# passed all remaining 116 test(s)
1..121
:000000 100644 0000000000000000000000000000000000000000 0cfbf08886fca9a91cb753ec8734c84fcbe52c9f A	b
ok 12 - git diff-index --cached HEAD^

expecting success: 
	echo text >>b &&
	echo 3 >c &&
	git add . &&
	test_expect_code 1 git diff-index --exit-code --cached HEAD^

ok 4 - builtin bibtex pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index --word-diff \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
ok 47 - stash drop - fail early if specified stash is not a stash reference

expecting success: 
	git stash clear &&
	test_when_finished "git reset --hard HEAD && git stash clear" &&
	git reset --hard &&
	echo foo > file &&
	git stash &&
	echo bar > file &&
	git stash &&
	test_must_fail git stash pop $(git rev-parse stash@{0}) &&
	git stash pop &&
	test bar = "$(cat file)" &&
	git reset --hard HEAD

diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
[-A-]{+B+}
ok 5 - builtin bibtex wordRegex pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
:000000 100644 0000000000000000000000000000000000000000 6ba94de6433d6530a0fb55e5e6da01023a4bc9e3 A	b
:000000 100644 0000000000000000000000000000000000000000 00750edc07d6415dcc07ae0351e9397b0222b7ba A	c
ok 13 - git diff-index --cached HEAD^

expecting success: 
	git commit -m "text in b" &&
	test_expect_code 1 git diff-tree -p --exit-code -Stext HEAD^ HEAD -- b

diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
-A
+B
ok 6 - builtin cpp pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index --word-diff \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
[master a1c3517] text in b
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 c
diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
[-A-]{+B+}
diff --git a/b b/b
index 0cfbf08..6ba94de 100644
--- a/b
+++ b/b
@@ -1 +1,2 @@
 2
+text
ok 14 - git diff-tree -Stext HEAD^ HEAD -- b

expecting success: 
	git diff-tree -p --exit-code -Snot-found HEAD^ HEAD -- b

ok 7 - builtin cpp wordRegex pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
*** t4019-diff-wserror.sh ***
ok 15 - git diff-tree -Snot-found HEAD^ HEAD -- b

expecting success: 
	echo 3 >>c &&
	test_expect_code 1 git diff-files --exit-code

diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
-A
+B
:100644 100644 00750edc07d6415dcc07ae0351e9397b0222b7ba 0000000000000000000000000000000000000000 M	c
ok 16 - git diff-files

expecting success: 
	git update-index c &&
	test_expect_code 1 git diff-index --exit-code --cached HEAD

ok 8 - builtin csharp pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index --word-diff \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
HEAD is now at 662e8e5 second
diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
[-A-]{+B+}
ok 9 - builtin csharp wordRegex pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
:100644 100644 00750edc07d6415dcc07ae0351e9397b0222b7ba a5c8806279fa7d6b7d04418a47e21b7e89ab18f8 M	c
ok 17 - git diff-index --cached HEAD

expecting success: 

	git diff --check --exit-code


diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
-A
+B
ok 18 - --check --exit-code returns 0 for no difference

expecting success: 

	echo "good" > a &&
	test_expect_code 1 git diff --check --exit-code


ok 10 - builtin fortran pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index --word-diff \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4019-diff-wserror/.git/
ok 19 - --check --exit-code returns 1 for a clean difference

expecting success: 

	echo "bad   " >> a &&
	test_expect_code 3 git diff --check --exit-code


diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
[-A-]{+B+}
expecting success: 

	git config diff.color.whitespace "blue reverse" &&
	>F &&
	git add F &&
	echo "         Eight SP indent" >>F &&
	echo " 	HT and SP indent" >>F &&
	echo "With trailing SP " >>F &&
	echo "Carriage ReturnQ" | tr Q "\015" >>F &&
	echo "No problem" >>F &&
	echo >>F


a:2: trailing whitespace.
+bad   
ok 11 - builtin fortran wordRegex pattern compiles

ok 20 - --check --exit-code returns 3 for a dirty difference

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
expecting success: 

	test_expect_code 2 git --no-pager diff --check


a:2: trailing whitespace.
+bad   
ok 21 - --check with --no-pager returns 2 for dirty difference

expecting success: 
	echo "" >>a &&
	test_expect_code 2 git --no-pager diff --check


diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
-A
+B
ok 1 - setup

a:2: trailing whitespace.
+bad   
a:3: new blank line at EOF.
ok 22 - check should test not just the last line

expecting success: 
	git reset --hard &&
	git checkout HEAD^ &&
	echo binary >>b &&
	git commit -m "side" b &&
	test_must_fail git merge master &&
	git add b &&
	test_expect_code 2 git --no-pager diff --cached --check >test.out &&
	test 3 = $(grep "conflict marker" test.out | wc -l) &&
	git reset --hard

ok 12 - builtin fountain pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index --word-diff \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
expecting success: 

	prepare_output &&

	grep Eight normal >/dev/null &&
	grep HT error >/dev/null &&
	grep With error >/dev/null &&
	grep Return error >/dev/null &&
	grep No normal >/dev/null


diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
[-A-]{+B+}
HEAD is now at a1c3517 text in b
ok 13 - builtin fountain wordRegex pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
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 d5c0988... second
diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
-A
+B
ok 14 - builtin html pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index --word-diff \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
[detached HEAD aa9a665] side
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 2 - default

expecting success: 

	test_might_fail git config --unset core.whitespace &&
	echo "F whitespace" >.gitattributes &&
	prepare_output &&

	grep Eight error >/dev/null &&
	grep HT error >/dev/null &&
	grep With error >/dev/null &&
	grep Return error >/dev/null &&
	grep No normal >/dev/null


diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
[-A-]{+B+}
ok 15 - builtin html wordRegex pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
Merging:
aa9a665 side
virtual master
found 1 common ancestor:
d5c0988 second
Auto-merging b
CONFLICT (content): Merge conflict in b
Automatic merge failed; fix conflicts and then commit the result.
diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
-A
+B
ok 16 - builtin java pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index --word-diff \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
[-A-]{+B+}
ok 3 - default (attribute)

expecting success: 

	git config core.whitespace "tabwidth=10" &&
	echo "F whitespace" >.gitattributes &&
	prepare_output &&

	grep Eight normal >/dev/null &&
	grep HT error >/dev/null &&
	grep With error >/dev/null &&
	grep Return error >/dev/null &&
	grep No normal >/dev/null


ok 17 - builtin java wordRegex pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
HEAD is now at aa9a665 side
Saved working directory and index state WIP on master: 662e8e5 second
ok 23 - check detects leftover conflict markers

diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
-A
+B
expecting success: 
	git reset --hard &&
	echo ">>>>>>> boo" >>b &&
	echo "======" >>a &&
	git diff --check a &&
	test_expect_code 2 git diff --check b &&
	git reset --hard &&
	echo ">>>>>>>> boo" >>b &&
	echo "========" >>a &&
	git diff --check &&
	echo "b conflict-marker-size=8" >.gitattributes &&
	test_expect_code 2 git diff --check b &&
	git diff --check a &&
	git reset --hard

ok 18 - builtin matlab pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index --word-diff \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
HEAD is now at 662e8e5 second
HEAD is now at aa9a665 side
diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
[-A-]{+B+}
ok 19 - builtin matlab wordRegex pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
b:3: leftover conflict marker
diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
-A
+B
ok 4 - default, tabwidth=10 (attribute)

expecting success: 

	test_might_fail git config --unset core.whitespace &&
	echo "F -whitespace" >.gitattributes &&
	prepare_output &&

	grep Eight normal >/dev/null &&
	grep HT normal >/dev/null &&
	grep With normal >/dev/null &&
	grep Return normal >/dev/null &&
	grep No normal >/dev/null


ok 20 - builtin objc pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index --word-diff \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
HEAD is now at aa9a665 side
diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
[-A-]{+B+}
ok 21 - builtin objc wordRegex pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
b:3: leftover conflict marker
diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
-A
+B
ok 5 - no check (attribute)
ok 22 - builtin pascal pattern compiles


expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index --word-diff \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
expecting success: 

	git config core.whitespace "tabwidth=10" &&
	echo "F -whitespace" >.gitattributes &&
	prepare_output &&

	grep Eight normal >/dev/null &&
	grep HT normal >/dev/null &&
	grep With normal >/dev/null &&
	grep Return normal >/dev/null &&
	grep No normal >/dev/null


HEAD is now at aa9a665 side
ok 24 - check honors conflict marker length

diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
[-A-]{+B+}
# passed all 24 test(s)
1..24
ok 23 - builtin pascal wordRegex pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
-A
+B
ok 24 - builtin perl pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index --word-diff \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
*** t4020-diff-external.sh ***
ok 6 - no check, tabwidth=10 (attribute), must be irrelevant

expecting success: 

	rm -f .gitattributes &&
	git config core.whitespace -trail &&
	prepare_output &&

	grep Eight normal >/dev/null &&
	grep HT error >/dev/null &&
	grep With normal >/dev/null &&
	grep Return normal >/dev/null &&
	grep No normal >/dev/null


diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
[-A-]{+B+}
ok 25 - builtin perl wordRegex pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
-A
+B
ok 26 - builtin php pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index --word-diff \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4020-diff-external/.git/
diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
[-A-]{+B+}
ok 7 - without -trail

expecting success: 

	test_might_fail git config --unset core.whitespace &&
	echo "F whitespace=-trail" >.gitattributes &&
	prepare_output &&

	grep Eight normal >/dev/null &&
	grep HT error >/dev/null &&
	grep With normal >/dev/null &&
	grep Return normal >/dev/null &&
	grep No normal >/dev/null


ok 27 - builtin php wordRegex pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
expecting success: 

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

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

	test_tick &&
	echo third >file

diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
-A
+B
Saved working directory and index state WIP on master: 662e8e5 second
ok 28 - builtin python pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index --word-diff \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
HEAD is now at 662e8e5 second
diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
[-A-]{+B+}
[master (root-commit) b6d2089] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 29 - builtin python wordRegex pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
-A
+B
ok 30 - builtin ruby pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index --word-diff \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
ok 8 - without -trail (attribute)

expecting success: 

	rm -f .gitattributes &&
	git config core.whitespace -space &&
	prepare_output &&

	grep Eight normal >/dev/null &&
	grep HT normal >/dev/null &&
	grep With error >/dev/null &&
	grep Return error >/dev/null &&
	grep No normal >/dev/null


[master f3562cd] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - setup

diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
[-A-]{+B+}
expecting success: 

	GIT_EXTERNAL_DIFF=echo git diff | {
		read path oldfile oldhex oldmode newfile newhex newmode &&
		test "z$path" = zfile &&
		test "z$oldmode" = z100644 &&
		test "z$newhex" = "z$_z40" &&
		test "z$newmode" = z100644 &&
		oh=$(git rev-parse --verify HEAD:file) &&
		test "z$oh" = "z$oldhex"
	}


ok 31 - builtin ruby wordRegex pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
-A
+B
ok 2 - GIT_EXTERNAL_DIFF environment

expecting success: 

	GIT_EXTERNAL_DIFF=echo git log -p -1 HEAD |
	grep "^diff --git a/file b/file"


ok 32 - builtin tex pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index --word-diff \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
diff --git a/file b/file
ok 3 - GIT_EXTERNAL_DIFF environment should apply only to diff

expecting success: 

	GIT_EXTERNAL_DIFF=echo git diff --no-ext-diff |
	grep "^diff --git a/file b/file"


diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
[-A-]{+B+}
ok 9 - without -space

expecting success: 

	test_might_fail git config --unset core.whitespace &&
	echo "F whitespace=-space" >.gitattributes &&
	prepare_output &&

	grep Eight normal >/dev/null &&
	grep HT normal >/dev/null &&
	grep With error >/dev/null &&
	grep Return error >/dev/null &&
	grep No normal >/dev/null


diff --git a/file b/file
ok 33 - builtin tex wordRegex pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
ok 4 - GIT_EXTERNAL_DIFF environment and --no-ext-diff

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

)
diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
-A
+B
ok 34 - builtin custom1 pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index --word-diff \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
prerequisite SYMLINKS ok
expecting success: 
	rm -f file &&
	ln -s elif file &&
	GIT_EXTERNAL_DIFF=echo git diff  | {
		read path oldfile oldhex oldmode newfile newhex newmode &&
		test "z$path" = zfile &&
		test "z$oldmode" = z100644 &&
		test "z$newhex" = "z$_z40" &&
		test "z$newmode" = z120000 &&
		oh=$(git rev-parse --verify HEAD:file) &&
		test "z$oh" = "z$oldhex"
	} &&
	GIT_EXTERNAL_DIFF=echo git diff --no-ext-diff >actual &&
	git diff >expect &&
	test_cmp expect actual

diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
[-A-]{+B+}
ok 35 - builtin custom1 wordRegex pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
ok 10 - without -space (attribute)

expecting success: 

	rm -f .gitattributes &&
	git config core.whitespace indent,-trailing,-space &&
	prepare_output &&

	grep Eight error >/dev/null &&
	grep HT normal >/dev/null &&
	grep With normal >/dev/null &&
	grep Return normal >/dev/null &&
	grep No normal >/dev/null


diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
-A
+B
'a2fb5a9e4a882b58f0ca0b0eaae00863c2217bb8' is not a stash reference
ok 36 - builtin custom2 pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index --word-diff \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
[-A-]{+B+}
ok 37 - builtin custom2 wordRegex pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
ok 5 - typechange diff

expecting success: 
	git reset --hard &&
	echo third >file &&
	test_config diff.external echo &&
	git diff | {
		read path oldfile oldhex oldmode newfile newhex newmode &&
		test "z$path" = zfile &&
		test "z$oldmode" = z100644 &&
		test "z$newhex" = "z$_z40" &&
		test "z$newmode" = z100644 &&
		oh=$(git rev-parse --verify HEAD:file) &&
		test "z$oh" = "z$oldhex"
	}

diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
-A
+B
ok 38 - builtin custom3 pattern compiles

expecting success: 
		echo "*.java diff=$p" >.gitattributes &&
		test_expect_code 1 git diff --no-index --word-diff \
			A.java B.java 2>msg &&
		test_i18ngrep ! fatal msg &&
		test_i18ngrep ! error msg
	
HEAD is now at f3562cd second
ok 11 - with indent-non-tab only

expecting success: 

	test_might_fail git config --unset core.whitespace &&
	echo "F whitespace=indent,-trailing,-space" >.gitattributes &&
	prepare_output &&

	grep Eight error >/dev/null &&
	grep HT normal >/dev/null &&
	grep With normal >/dev/null &&
	grep Return normal >/dev/null &&
	grep No normal >/dev/null


diff --git a/A.java b/B.java
index f70f10e..223b783 100644
--- a/A.java
+++ b/B.java
@@ -1 +1 @@
[-A-]{+B+}
ok 39 - builtin custom3 wordRegex pattern compiles

expecting success: 
	echo "*.java diff=java" >.gitattributes &&
	test_config diff.java.funcname "!static" &&
	test_expect_code 128 git diff --no-index A.java B.java 2>msg &&
	test_i18ngrep ": Last expression must not be negated:" msg

fatal: Last expression must not be negated: !static
ok 6 - diff.external

expecting success: 
	test_config diff.external echo &&
	git log -p -1 HEAD |
	grep "^diff --git a/file b/file"

ok 12 - with indent-non-tab only (attribute)

ok 40 - last regexp must not be negated

expecting success: 

	rm -f .gitattributes &&
	git config core.whitespace indent,tabwidth=10,-trailing,-space &&
	prepare_output &&

	grep Eight normal >/dev/null &&
	grep HT normal >/dev/null &&
	grep With normal >/dev/null &&
	grep Return normal >/dev/null &&
	grep No normal >/dev/null


expecting success: 
	for i in $diffpatterns
	do
		echo "$i-* diff=$i"
	done > .gitattributes &&

	# add all test files to the index
	(
		cd "$TEST_DIRECTORY"/t4018 &&
		git --git-dir="$TRASH_DIRECTORY/.git" add .
	) &&

	# place modified files in the worktree
	for i in $(git ls-files)
	do
		sed -e "s/ChangeMe/IWasChanged/" <"$TEST_DIRECTORY/t4018/$i" >"$i" || return 1
	done

diff --git a/file b/file
ok 7 - diff.external should apply only to diff

expecting success: 
	test_config diff.external echo &&
	git diff --no-ext-diff |
	grep "^diff --git a/file b/file"

Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual 3a18f644551a5809421ac2e8f6cc40181a075c5d
diff --git a/file b/file
ok 13 - with indent-non-tab only, tabwidth=10

expecting success: 

	test_might_fail git config --unset core.whitespace &&
	echo "F whitespace=indent,-trailing,-space,tabwidth=10" >.gitattributes &&
	prepare_output &&

	grep Eight normal >/dev/null &&
	grep HT normal >/dev/null &&
	grep With normal >/dev/null &&
	grep Return normal >/dev/null &&
	grep No normal >/dev/null


ok 8 - diff.external and --no-ext-diff

expecting success: 
	git reset --hard &&
	echo third >file &&

	git config diff.parrot.command echo &&

	echo >.gitattributes "file diff=parrot" &&

	git diff | {
		read path oldfile oldhex oldmode newfile newhex newmode &&
		test "z$path" = zfile &&
		test "z$oldmode" = z100644 &&
		test "z$newhex" = "z$_z40" &&
		test "z$newmode" = z100644 &&
		oh=$(git rev-parse --verify HEAD:file) &&
		test "z$oh" = "z$oldhex"
	}


On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   file

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	actual
	expect
	expect1
	expect2
	expected
	output
	output.out
	stashlist1
	stashlist2

no changes added to commit (use "git add" and/or "git commit -a")
HEAD is now at f3562cd second
Dropped refs/stash@{0} (a2fb5a9e4a882b58f0ca0b0eaae00863c2217bb8)
ok 14 - with indent-non-tab only, tabwidth=10 (attribute)
ok 9 - diff attribute


expecting success: 

	git log -p -1 HEAD |
	grep "^diff --git a/file b/file"


expecting success: 

	rm -f .gitattributes &&
	git config core.whitespace cr-at-eol &&
	prepare_output &&

	grep Eight normal >/dev/null &&
	grep HT error >/dev/null &&
	grep With error >/dev/null &&
	grep Return normal >/dev/null &&
	grep No normal >/dev/null


HEAD is now at 662e8e5 second
diff --git a/file b/file
ok 10 - diff attribute should apply only to diff

expecting success: 

	git diff --no-ext-diff |
	grep "^diff --git a/file b/file"


HEAD is now at 662e8e5 second
diff --git a/file b/file
ok 11 - diff attribute and --no-ext-diff

expecting success: 

	git config --unset diff.parrot.command &&
	git config diff.color.command echo &&

	echo >.gitattributes "file diff=color" &&

	git diff | {
		read path oldfile oldhex oldmode newfile newhex newmode &&
		test "z$path" = zfile &&
		test "z$oldmode" = z100644 &&
		test "z$newhex" = "z$_z40" &&
		test "z$newmode" = z100644 &&
		oh=$(git rev-parse --verify HEAD:file) &&
		test "z$oh" = "z$oldhex"
	}


ok 15 - with cr-at-eol

expecting success: 

	test_might_fail git config --unset core.whitespace &&
	echo "F whitespace=trailing,cr-at-eol" >.gitattributes &&
	prepare_output &&

	grep Eight normal >/dev/null &&
	grep HT error >/dev/null &&
	grep With error >/dev/null &&
	grep Return normal >/dev/null &&
	grep No normal >/dev/null


ok 12 - diff attribute

expecting success: 

	git log -p -1 HEAD |
	grep "^diff --git a/file b/file"


diff --git a/file b/file
ok 13 - diff attribute should apply only to diff

expecting success: 

	git diff --no-ext-diff |
	grep "^diff --git a/file b/file"


ok 41 - setup hunk header tests

diff --git a/file b/file
ok 14 - diff attribute and --no-ext-diff

expecting success: 
	>.gitattributes &&
	test_config diff.external "echo ext-global" &&
	GIT_EXTERNAL_DIFF="echo ext-env" git diff | grep ext-env

ok 48 - stash pop - fail early if specified stash is not a stash reference

expecting success: 
	git stash clear &&
	echo bar5 > file &&
	echo bar6 > file2 &&
	git add file2 &&
	git stash &&
	test_must_fail git rev-parse --quiet --verify does-not-exist &&
	test_must_fail git stash drop does-not-exist &&
	test_must_fail git stash drop does-not-exist@{0} &&
	test_must_fail git stash pop does-not-exist &&
	test_must_fail git stash pop does-not-exist@{0} &&
	test_must_fail git stash apply does-not-exist &&
	test_must_fail git stash apply does-not-exist@{0} &&
	test_must_fail git stash show does-not-exist &&
	test_must_fail git stash show does-not-exist@{0} &&
	test_must_fail git stash branch tmp does-not-exist &&
	test_must_fail git stash branch tmp does-not-exist@{0} &&
	git stash drop

expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 README >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
ok 16 - with cr-at-eol (attribute)

expecting success: 

	rm -f .gitattributes &&
	test_must_fail git diff --check >output &&
	grep "new blank line at" output &&
	grep "trailing whitespace" output


ext-env file /tmp/waF5kd_file e019be006cf33489e2d0177a3837a2384eddebc5 100644 file 0000000000000000000000000000000000000000 100644
F:6: new blank line at EOF.
@@ -3,3 +3,3 @@ How to write RIGHT test cases
ok 15 - GIT_EXTERNAL_DIFF trumps diff.external

expecting success: 
	test_config diff.foo.command "echo ext-attribute" &&
	test_config diff.external "echo ext-global" &&
	echo "file diff=foo" >.gitattributes &&
	GIT_EXTERNAL_DIFF="echo ext-env" git diff | grep ext-attribute

diff --git a/README b/README
index 283e01c..a55b544 100644
--- a/README
+++ b/README
@@ -3,3 +3,3 @@ How to write RIGHT test cases
 
-Insert the word "ChangeMe" (exactly this form) at a distance of
+Insert the word "IWasChanged" (exactly this form) at a distance of
 at least two lines from the line that must appear in the hunk header.
ok 42 - hunk header: README

F:3: trailing whitespace.
F:4: trailing whitespace.
ok 17 - trailing empty lines (1)

expecting success: 

	echo "F -whitespace" >.gitattributes &&
	git diff --check >output &&
	! test -s output


expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 cpp-c++-function >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
ok 18 - trailing empty lines (2)

expecting success: 

	printf "a\nb\n" > G &&
	git add G &&
	printf "x\nx\nx\na\nb\nc\n\n" > G &&
	[ "$(git diff --check -- G)" = "G:7: new blank line at EOF." ]


@@ -2,3 +2,3 @@ Item RIGHT::DoSomething( Args with_spaces )
diff --git a/cpp-c++-function b/cpp-c++-function
index 9ee6bbe..7bb7443 100644
--- a/cpp-c++-function
+++ b/cpp-c++-function
@@ -2,3 +2,3 @@ Item RIGHT::DoSomething( Args with_spaces )
 {
-	ChangeMe;
+	IWasChanged;
 }
ok 43 - hunk header: cpp-c++-function

expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 cpp-class-constructor >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
ext-attribute file /tmp/JSu7Ie_file e019be006cf33489e2d0177a3837a2384eddebc5 100644 file 0000000000000000000000000000000000000000 100644
ok 19 - checkdiff shows correct line number for trailing blank lines

expecting success: 
	test_might_fail git config --unset core.whitespace &&
	rm -f .gitattributes &&
	echo AAAQ | tr Q "\015" >G &&
	git add G &&
	echo BBBQ | tr Q "\015" >>G &&
	git diff --color G | tr "\015" Q >output &&
	grep "BBB.*${blue_grep}Q" output &&
	grep "AAA.*\[mQ" output


@@ -2,3 +2,3 @@ Item::Item(int RIGHT)
diff --git a/cpp-class-constructor b/cpp-class-constructor
index ec4f115..1c9fd01 100644
--- a/cpp-class-constructor
+++ b/cpp-class-constructor
@@ -2,3 +2,3 @@ Item::Item(int RIGHT)
 {
-	ChangeMe;
+	IWasChanged;
 }
ok 44 - hunk header: cpp-class-constructor

expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 cpp-class-constructor-mem-init >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
ok 16 - attributes trump GIT_EXTERNAL_DIFF and diff.external

expecting success: 
	echo >.gitattributes "file -diff" &&
	git diff | grep Binary

Binary files a/file and b/file differ
ok 17 - no diff with -diff

expecting success: 
	echo >.gitattributes "file diff" &&
	git diff >actual &&
	test_cmp "$TEST_DIRECTORY"/t4020/diff.NUL actual

@@ -3,3 +3,3 @@ Item::Item(int RIGHT) :
diff --git a/cpp-class-constructor-mem-init b/cpp-class-constructor-mem-init
index 49a69f3..ffaf335 100644
--- a/cpp-class-constructor-mem-init
+++ b/cpp-class-constructor-mem-init
@@ -3,3 +3,3 @@ Item::Item(int RIGHT) :
 {
-	ChangeMe;
+	IWasChanged;
 }
ok 45 - hunk header: cpp-class-constructor-mem-init

+BBBQ
expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 cpp-class-definition >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
 AAAQ
ok 20 - do not color trailing cr in context

expecting success: 
	{ echo a; echo b; echo; echo; } >x &&
	git add x &&
	{ echo a; echo; echo; echo; echo c; echo; echo; echo; echo; } >x &&
	git diff --color x >output &&
	cnt=$($grep_a "${blue_grep}" output | wc -l) &&
	test $cnt = 2

ok 18 - force diff with "diff"

expecting success: 
	echo anotherfile > file2 &&
	git add file2 &&
	git commit -m "added 2nd file" &&
	echo modified >file2 &&
	GIT_EXTERNAL_DIFF=echo git diff

@@ -2,3 +2,3 @@ class RIGHT
diff --git a/cpp-class-definition b/cpp-class-definition
index 11b61da..d624df1 100644
--- a/cpp-class-definition
+++ b/cpp-class-definition
@@ -2,3 +2,3 @@ class RIGHT
 {
-	int ChangeMe;
+	int IWasChanged;
 };
ok 46 - hunk header: cpp-class-definition

expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 cpp-class-definition-derived >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
[master 314ec38] added 2nd file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file2
ok 21 - color new trailing blank lines

# passed all 21 test(s)
1..21
@@ -3,3 +3,3 @@ class RIGHT :
file /tmp/xk8DKc_file e019be006cf33489e2d0177a3837a2384eddebc5 100644 file 0000000000000000000000000000000000000000 100644
diff --git a/cpp-class-definition-derived b/cpp-class-definition-derived
index 3b98cd0..b4d6116 100644
--- a/cpp-class-definition-derived
+++ b/cpp-class-definition-derived
@@ -3,3 +3,3 @@ class RIGHT :
 {
-	int ChangeMe;
+	int IWasChanged;
 };
file2 /tmp/HHvBfd_file2 abc9fa522731419e7eaa3d472e3cb3d99e475c49 100644 file2 0000000000000000000000000000000000000000 100644
ok 47 - hunk header: cpp-class-definition-derived

ok 19 - GIT_EXTERNAL_DIFF with more than one changed files

expecting success: 
	write_script external-diff.sh <<-\EOF &&
	echo $GIT_DIFF_PATH_COUNTER of $GIT_DIFF_PATH_TOTAL >>counter.txt
	EOF
	>counter.txt &&
	cat >expect <<-\EOF &&
	1 of 2
	2 of 2
	EOF
	GIT_EXTERNAL_DIFF=./external-diff.sh git diff &&
	test_cmp expect counter.txt

expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 cpp-class-destructor >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
*** t4021-format-patch-numbered.sh ***
@@ -2,3 +2,3 @@ RIGHT::~RIGHT()
diff --git a/cpp-class-destructor b/cpp-class-destructor
index 5487665..54af7a9 100644
--- a/cpp-class-destructor
+++ b/cpp-class-destructor
@@ -2,3 +2,3 @@ RIGHT::~RIGHT()
 {
-	ChangeMe;
+	IWasChanged;
 }
ok 48 - hunk header: cpp-class-destructor

ok 20 - GIT_EXTERNAL_DIFF path counter/total

expecting success: 
	touch file.ext &&
	git add file.ext &&
	echo with extension > file.ext &&
	GIT_EXTERNAL_DIFF=echo git diff file.ext | grep ......_file\.ext &&
	git update-index --force-remove file.ext &&
	rm file.ext

expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 cpp-function-returning-global-type >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
@@ -2,3 +2,3 @@ ::Item get::it::RIGHT()
diff --git a/cpp-function-returning-global-type b/cpp-function-returning-global-type
index 1084d59..1b57ca1 100644
--- a/cpp-function-returning-global-type
+++ b/cpp-function-returning-global-type
@@ -2,3 +2,3 @@ ::Item get::it::RIGHT()
 {
-	ChangeMe;
+	IWasChanged;
 }
ok 49 - hunk header: cpp-function-returning-global-type

expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 cpp-function-returning-nested >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
file.ext /tmp/GvI4hb_file.ext e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 file.ext 0000000000000000000000000000000000000000 100644
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4021-format-patch-numbered/.git/
expecting success: 

	echo A > file &&
	git add file &&
	git commit -m First &&

	echo B >> file &&
	git commit -a -m Second &&

	echo C >> file &&
	git commit -a -m Third


ok 21 - GIT_EXTERNAL_DIFF generates pretty paths

@@ -2,3 +2,3 @@ get::Item get::it::RIGHT()
expecting success: 
	test_config core.autocrlf true &&
	GIT_EXTERNAL_DIFF=./fake-diff.sh git diff &&
	test $(wc -l < crlfed.txt) = $(cat crlfed.txt | keep_only_cr | wc -c)

diff --git a/cpp-function-returning-nested b/cpp-function-returning-nested
index d9750aa..83df216 100644
--- a/cpp-function-returning-nested
+++ b/cpp-function-returning-nested
@@ -2,3 +2,3 @@ get::Item get::it::RIGHT()
 {
-	ChangeMe;
+	IWasChanged;
 }
ok 50 - hunk header: cpp-function-returning-nested

expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 cpp-function-returning-pointer >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
[master (root-commit) 43a9573] First
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
@@ -2,3 +2,3 @@ const char *get_it_RIGHT(char *ptr)
diff --git a/cpp-function-returning-pointer b/cpp-function-returning-pointer
index ef15657..1339209 100644
--- a/cpp-function-returning-pointer
+++ b/cpp-function-returning-pointer
@@ -2,3 +2,3 @@ const char *get_it_RIGHT(char *ptr)
 {
-	ChangeMe;
+	IWasChanged;
 }
ok 51 - hunk header: cpp-function-returning-pointer

Saved working directory and index state WIP on master: 662e8e5 second
[master cffcb6d] Second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 cpp-function-returning-reference >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
HEAD is now at 662e8e5 second
ok 22 - external diff with autocrlf = true

expecting success: 
	test_config core.autocrlf true &&
	git add file &&
	git update-index --assume-unchanged file &&
	echo second >file &&
	git diff --cached >actual &&
	test_cmp "$TEST_DIRECTORY"/t4020/diff.NUL actual

@@ -2,3 +2,3 @@ string& get::it::RIGHT(char *ptr)
diff --git a/cpp-function-returning-reference b/cpp-function-returning-reference
index 01b051d..735bf10 100644
--- a/cpp-function-returning-reference
+++ b/cpp-function-returning-reference
@@ -2,3 +2,3 @@ string& get::it::RIGHT(char *ptr)
 {
-	ChangeMe;
+	IWasChanged;
 }
[master 7d9a228] Third
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 1 - setup

expecting success: 
	git format-patch --stdout HEAD~1 >patch0.single &&
	test_single_no_numbered patch0.single

ok 52 - hunk header: cpp-function-returning-reference

expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 cpp-gnu-style-function >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
@@ -3,3 +3,3 @@ RIGHT(int arg)
ok 2 - single patch defaults to no numbers

expecting success: 

	git format-patch --stdout HEAD~2 >patch0.multiple &&
	test_numbered patch0.multiple


diff --git a/cpp-gnu-style-function b/cpp-gnu-style-function
index 08c7c75..8aa213e 100644
--- a/cpp-gnu-style-function
+++ b/cpp-gnu-style-function
@@ -3,3 +3,3 @@ RIGHT(int arg)
 {
-	ChangeMe;
+	IWasChanged;
 }
ok 53 - hunk header: cpp-gnu-style-function

expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 cpp-namespace-definition >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
Subject: [PATCH 1/2] Second
Subject: [PATCH 2/2] Third
ok 3 - multiple patch defaults to numbered

expecting success: 

	git format-patch --numbered --stdout HEAD~1 >patch1 &&
	test_single_numbered patch1


@@ -2,3 +2,3 @@ namespace RIGHT
diff --git a/cpp-namespace-definition b/cpp-namespace-definition
index 6749980..151ab14 100644
--- a/cpp-namespace-definition
+++ b/cpp-namespace-definition
@@ -2,3 +2,3 @@ namespace RIGHT
 {
-	ChangeMe;
+	IWasChanged;
 }
ok 23 - diff --cached

expecting success: 
	git update-index --no-assume-unchanged file &&
	rm -f file* &&
	git reset --hard

ok 54 - hunk header: cpp-namespace-definition

expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 cpp-operator-definition >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
Subject: [PATCH 1/1] Third
ok 4 - Use --numbered

expecting success: 

	git config format.numbered true &&
	git format-patch --stdout HEAD~2 >patch2 &&
	test_numbered patch2


@@ -2,3 +2,3 @@ Value operator+(Value LEFT, Value RIGHT)
fatal: ambiguous argument 'does-not-exist': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
diff --git a/cpp-operator-definition b/cpp-operator-definition
index 1acd827..fc88630 100644
--- a/cpp-operator-definition
+++ b/cpp-operator-definition
@@ -2,3 +2,3 @@ Value operator+(Value LEFT, Value RIGHT)
 {
-	ChangeMe;
+	IWasChanged;
 }
ok 55 - hunk header: cpp-operator-definition

HEAD is now at 314ec38 added 2nd file
ok 24 - clean up crlf leftovers

expecting success: 
	git init sub &&
	( cd sub && test_commit sub1 ) &&
	git add sub &&
	test_tick &&
	git commit -m "add submodule" &&
	( cd sub && test_commit sub2 ) &&
	write_script gather_pre_post.sh <<-\EOF &&
	echo "$1 $4" # path, mode
	cat "$2" # old file
	cat "$5" # new file
	EOF
	GIT_EXTERNAL_DIFF=./gather_pre_post.sh git diff >actual &&
	cat >expected <<-EOF &&
	sub 160000
	Subproject commit $(git rev-parse HEAD:sub)
	Subproject commit $(cd sub && git rev-parse HEAD)
	EOF
	test_cmp expected actual

expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 cpp-skip-access-specifiers >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
Subject: [PATCH 1/2] Second
Subject: [PATCH 2/2] Third
ok 5 - format.numbered = true

expecting success: 

	git format-patch --stdout HEAD^ > patch3 &&
	test_single_numbered patch3


@@ -6,3 +6,3 @@ class RIGHT : public Baseclass
diff --git a/cpp-skip-access-specifiers b/cpp-skip-access-specifiers
index 4d4a9db..ebd6f42 100644
--- a/cpp-skip-access-specifiers
+++ b/cpp-skip-access-specifiers
@@ -6,3 +6,3 @@ class RIGHT : public Baseclass
 	void DoSomething();
-	int ChangeMe;
+	int IWasChanged;
 };
ok 56 - hunk header: cpp-skip-access-specifiers

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4020-diff-external/sub/.git/
expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 cpp-skip-comment-block >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
Subject: [PATCH 1/1] Third
ok 6 - format.numbered && single patch

expecting success: 

	git format-patch --no-numbered --stdout HEAD~2 >patch4 &&
	test_no_numbered patch4


@@ -7,3 +7,3 @@ struct item RIGHT(int i)
diff --git a/cpp-skip-comment-block b/cpp-skip-comment-block
index 3800b99..94419d1 100644
--- a/cpp-skip-comment-block
+++ b/cpp-skip-comment-block
@@ -7,3 +7,3 @@ struct item RIGHT(int i)
 {
-	ChangeMe;
+	IWasChanged;
 }
ok 57 - hunk header: cpp-skip-comment-block

[master (root-commit) e2fb92c] sub1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 sub1.t
expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 cpp-skip-labels >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
ok 7 - format.numbered && --no-numbered

expecting success: 

	git format-patch --keep-subject --stdout HEAD^ >patch4a &&
	grep "^Subject: Third" patch4a


@@ -6,3 +6,3 @@ void RIGHT (void)
fatal: ambiguous argument 'does-not-exist@{0}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
diff --git a/cpp-skip-labels b/cpp-skip-labels
index b9c10ab..3a5ccc4 100644
--- a/cpp-skip-labels
+++ b/cpp-skip-labels
@@ -6,3 +6,3 @@ void RIGHT (void)
 
-	ChangeMe;
+	IWasChanged;
 }
ok 58 - hunk header: cpp-skip-labels

Subject: Third
ok 8 - format.numbered && --keep-subject

expecting success: 

	git config format.numbered auto &&
	git format-patch --stdout HEAD~2 > patch5 &&
	test_numbered patch5


expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 cpp-struct-definition >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
[master bcd8781] add submodule
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 160000 sub
@@ -7,3 +7,3 @@ struct RIGHT {
diff --git a/cpp-struct-definition b/cpp-struct-definition
index 521c59f..636b51b 100644
--- a/cpp-struct-definition
+++ b/cpp-struct-definition
@@ -7,3 +7,3 @@ struct RIGHT {
 
-	int ChangeMe;
+	int IWasChanged;
 };
ok 59 - hunk header: cpp-struct-definition

Subject: [PATCH 1/2] Second
expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 cpp-struct-single-line >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
Subject: [PATCH 2/2] Third
ok 9 - format.numbered = auto

expecting success: 

	git format-patch --stdout HEAD^ > patch6 &&
	test_single_no_numbered patch6


[master 6a9164c] sub2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 sub2.t
@@ -6,2 +6,2 @@ struct RIGHT_iterator_tag {};
diff --git a/cpp-struct-single-line b/cpp-struct-single-line
index a0de5fb..ef36f0e 100644
--- a/cpp-struct-single-line
+++ b/cpp-struct-single-line
@@ -6,2 +6,2 @@ struct RIGHT_iterator_tag {};
 
-int ChangeMe;
+int IWasChanged;
ok 10 - format.numbered = auto && single patch

ok 60 - hunk header: cpp-struct-single-line

expecting success: 

	git format-patch --no-numbered --stdout HEAD~2 > patch7 &&
	test_no_numbered patch7


expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 cpp-template-function-definition >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
fatal: ambiguous argument 'does-not-exist': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
@@ -2,3 +2,3 @@ template<class T> int RIGHT(T arg)
ok 11 - format.numbered = auto && --no-numbered

expecting success: 

	git format-patch --start-number 3 --numbered --stdout HEAD~1 > patch8 &&
	grep "^Subject: \[PATCH 3/3\]" patch8

diff --git a/cpp-template-function-definition b/cpp-template-function-definition
index 0cdf5ba..18f812d 100644
--- a/cpp-template-function-definition
+++ b/cpp-template-function-definition
@@ -2,3 +2,3 @@ template<class T> int RIGHT(T arg)
 {
-	ChangeMe;
+	IWasChanged;
 }
ok 61 - hunk header: cpp-template-function-definition

expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 cpp-union-definition >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
Subject: [PATCH 3/3] Third
ok 12 - --start-number && --numbered

@@ -2,3 +2,3 @@ union RIGHT {
# passed all 12 test(s)
1..12
diff --git a/cpp-union-definition b/cpp-union-definition
index 7ec94df..f67e5e0 100644
--- a/cpp-union-definition
+++ b/cpp-union-definition
@@ -2,3 +2,3 @@ union RIGHT {
 	double v;
-	int ChangeMe;
+	int IWasChanged;
 };
ok 62 - hunk header: cpp-union-definition

expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 cpp-void-c-function >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
ok 25 - submodule diff

# passed all 25 test(s)
1..25
@@ -2,3 +2,3 @@ void RIGHT (void)
diff --git a/cpp-void-c-function b/cpp-void-c-function
index 153081e..7ce1087 100644
--- a/cpp-void-c-function
+++ b/cpp-void-c-function
@@ -2,3 +2,3 @@ void RIGHT (void)
 {
-	ChangeMe;
+	IWasChanged;
 }
ok 63 - hunk header: cpp-void-c-function

*** t4022-diff-rewrite.sh ***
expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 custom1-pattern >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
fatal: ambiguous argument 'does-not-exist@{0}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
@@ -9,3 +9,3 @@ int special, RIGHT;
diff --git a/custom1-pattern b/custom1-pattern
index e8fd59f..9d9e960 100644
--- a/custom1-pattern
+++ b/custom1-pattern
@@ -9,3 +9,3 @@ int special, RIGHT;
 			System.out.print(x + " bottles of beer on the wall "
-				+ x + " bottles of beer\n" // ChangeMe
+				+ x + " bottles of beer\n" // IWasChanged
 				+ "Take one down, pass it around, " + (x - 1)
*** t4023-diff-rename-typechange.sh ***
ok 64 - hunk header: custom1-pattern

expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 custom2-match-to-end-of-line >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
@@ -5,3 +5,3 @@ RIGHT_Beer
diff --git a/custom2-match-to-end-of-line b/custom2-match-to-end-of-line
index f88ac31..7cf2919 100644
--- a/custom2-match-to-end-of-line
+++ b/custom2-match-to-end-of-line
@@ -5,3 +5,3 @@ RIGHT_Beer
 	{
-		System.out.print("ChangeMe");
+		System.out.print("IWasChanged");
 	}
ok 65 - hunk header: custom2-match-to-end-of-line

expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 custom3-alternation-in-pattern >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4022-diff-rewrite/.git/
expecting success: 

	cat "$TEST_DIRECTORY"/../COPYING >test &&
	git add test &&
	tr \
	  "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" \
	  "nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM" \
	  <"$TEST_DIRECTORY"/../COPYING >test &&
	echo "to be deleted" >test2 &&
	git add test2


@@ -9,3 +9,3 @@ public static void main(String RIGHT[])
fatal: ambiguous argument 'does-not-exist': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
diff --git a/custom3-alternation-in-pattern b/custom3-alternation-in-pattern
index 5f3769c..818aa3d 100644
--- a/custom3-alternation-in-pattern
+++ b/custom3-alternation-in-pattern
@@ -9,3 +9,3 @@ public static void main(String RIGHT[])
 			System.out.print(x + " bottles of beer on the wall "
-				+ x + " bottles of beer\n" // ChangeMe
+				+ x + " bottles of beer\n" // IWasChanged
 				+ "Take one down, pass it around, " + (x - 1)
ok 66 - hunk header: custom3-alternation-in-pattern

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4023-diff-rename-typechange/.git/
expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 fountain-scene >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
expecting success: 

	rm -f foo bar &&
	cat "$TEST_DIRECTORY"/../COPYING >foo &&
	test_ln_s_add linklink bar &&
	git add foo &&
	git commit -a -m Initial &&
	git tag one &&

	git rm -f foo bar &&
	cat "$TEST_DIRECTORY"/../COPYING >bar &&
	test_ln_s_add linklink foo &&
	git add bar &&
	git commit -a -m Second &&
	git tag two &&

	git rm -f foo bar &&
	cat "$TEST_DIRECTORY"/../COPYING >foo &&
	git add foo &&
	git commit -a -m Third &&
	git tag three &&

	mv foo bar &&
	test_ln_s_add linklink foo &&
	git add bar &&
	git commit -a -m Fourth &&
	git tag four &&

	# This is purely for sanity check

	git rm -f foo bar &&
	cat "$TEST_DIRECTORY"/../COPYING >foo &&
	cat "$TEST_DIRECTORY"/../Makefile >bar &&
	git add foo bar &&
	git commit -a -m Fifth &&
	git tag five &&

	git rm -f foo bar &&
	cat "$TEST_DIRECTORY"/../Makefile >foo &&
	cat "$TEST_DIRECTORY"/../COPYING >bar &&
	git add foo bar &&
	git commit -a -m Sixth &&
	git tag six


@@ -3,2 +3,2 @@ EXT. STREET RIGHT OUTSIDE - DAY
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 1 - setup

expecting success: 

	actual=$(git diff-files -B --summary test) &&
	verbose expr "$actual" : " rewrite test ([0-9]*%)$"


diff --git a/fountain-scene b/fountain-scene
index 6b3257d..3514c47 100644
--- a/fountain-scene
+++ b/fountain-scene
@@ -3,2 +3,2 @@ EXT. STREET RIGHT OUTSIDE - DAY
 CHARACTER
-You didn't say the magic phrase, "ChangeMe".
+You didn't say the magic phrase, "IWasChanged".
ok 67 - hunk header: fountain-scene

expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 java-class-member-function >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
prerequisite SYMLINKS ok
19
ok 2 - detect rewrite

expecting success: 

	rm test2 &&
	git diff -- test2 >actual &&
	test_cmp expect actual

@@ -5,3 +5,3 @@ public static void main(String RIGHT[])
diff --git a/java-class-member-function b/java-class-member-function
index 298bc7a..d50e1e9 100644
--- a/java-class-member-function
+++ b/java-class-member-function
@@ -5,3 +5,3 @@ public static void main(String RIGHT[])
 	{
-		System.out.print("ChangeMe");
+		System.out.print("IWasChanged");
 	}
ok 68 - hunk header: java-class-member-function

expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 perl-skip-end-of-heredoc >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
ok 3 - show deletion diff without -D

expecting success: 

	git diff -D -- test2 >actual &&
	test_cmp expect actual

fatal: ambiguous argument 'does-not-exist@{0}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
@@ -6,3 +6,3 @@ sub RIGHTwithheredocument {
diff --git a/perl-skip-end-of-heredoc b/perl-skip-end-of-heredoc
index c22d39b..b5d7cbd 100644
--- a/perl-skip-end-of-heredoc
+++ b/perl-skip-end-of-heredoc
@@ -6,3 +6,3 @@ sub RIGHTwithheredocument {
 	# to pad it out
-	print "ChangeMe\n";
+	print "IWasChanged\n";
 }
ok 4 - suppress deletion diff with -D

[master (root-commit) 682a539] Initial
 Author: A U Thor <author@example.com>
 2 files changed, 361 insertions(+)
 create mode 120000 bar
 create mode 100644 foo
expecting success: 

	git diff -B -- test >actual &&
	grep "Linus Torvalds" actual

ok 69 - hunk header: perl-skip-end-of-heredoc

expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 perl-skip-forward-decl >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
-			Linus Torvalds
ok 5 - show deletion diff with -B

expecting success: 

	git diff -B -D -- test >actual &&
	grep -v "Linus Torvalds" actual

@@ -9,2 +9,2 @@ package RIGHT;
rm 'bar'
rm 'foo'
diff --git a/perl-skip-forward-decl b/perl-skip-forward-decl
index a98cb8b..a0a297b 100644
--- a/perl-skip-forward-decl
+++ b/perl-skip-forward-decl
@@ -9,2 +9,2 @@ package RIGHT;
 
-# ChangeMe
+# IWasChanged
ok 70 - hunk header: perl-skip-forward-decl

expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 perl-skip-sub-in-pod >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
diff --git a/test b/test
dissimilarity index 98%
index 536e555..189438f 100644
--- a/test
+++ b/test
@@ -?,? +1,360 @@
+
+ Abgr gung gur bayl inyvq irefvba bs gur TCY nf sne nf guvf cebwrpg
+ vf pbaprearq vf _guvf_ cnegvphyne irefvba bs gur yvprafr (vr i2, abg
+ i2.2 be i3.k be jungrire), hayrff rkcyvpvgyl bgurejvfr fgngrq.
+
+ UBJRIRE, va beqre gb nyybj n zvtengvba gb TCYi3 vs gung frrzf yvxr
+ n tbbq vqrn, V nyfb nfx gung crbcyr vaibyirq jvgu gur cebwrpg znxr
+ gurve cersreraprf xabja. Va cnegvphyne, vs lbh gehfg zr gb znxr gung
+ qrpvfvba, lbh zvtug abgr fb va lbhe pbclevtug zrffntr, vr fbzrguvat
+ yvxr
+
+	Guvf svyr vf yvprafrq haqre gur TCY i2, be n yngre irefvba
+	ng gur qvfpergvba bs Yvahf.
+
+  zvtug nibvq vffhrf. Ohg jr pna nyfb whfg qrpvqr gb flapuebavmr naq
+  pbagnpg nyy pbclevtug ubyqref ba erpbeq vs/jura gur bppnfvba nevfrf.
+
+			Yvahf Gbeinyqf
+
+----------------------------------------
+
+		    TAH TRARENY CHOYVP YVPRAFR
+		       Irefvba 2, Whar 1991
+
+ Pbclevtug (P) 1989, 1991 Serr Fbsgjner Sbhaqngvba, Vap.,
+ 51 Senaxyva Fgerrg, Svsgu Sybbe, Obfgba, ZN 02110-1301 HFN
+ Rirelbar vf crezvggrq gb pbcl naq qvfgevohgr ireongvz pbcvrf
+ bs guvf yvprafr qbphzrag, ohg punatvat vg vf abg nyybjrq.
+
+			    Cernzoyr
+
+  Gur yvprafrf sbe zbfg fbsgjner ner qrfvtarq gb gnxr njnl lbhe
+serrqbz gb funer naq punatr vg.  Ol pbagenfg, gur TAH Trareny Choyvp
+Yvprafr vf vagraqrq gb thnenagrr lbhe serrqbz gb funer naq punatr serr
+fbsgjner--gb znxr fher gur fbsgjner vf serr sbe nyy vgf hfref.  Guvf
+Trareny Choyvp Yvprafr nccyvrf gb zbfg bs gur Serr Fbsgjner
+Sbhaqngvba'f fbsgjner naq gb nal bgure cebtenz jubfr nhgubef pbzzvg gb
+hfvat vg.  (Fbzr bgure Serr Fbsgjner Sbhaqngvba fbsgjner vf pbirerq ol
+gur TAH Yrffre Trareny Choyvp Yvprafr vafgrnq.)  Lbh pna nccyl vg gb
+lbhe cebtenzf, gbb.
+
+  Jura jr fcrnx bs serr fbsgjner, jr ner ersreevat gb serrqbz, abg
+cevpr.  Bhe Trareny Choyvp Yvprafrf ner qrfvtarq gb znxr fher gung lbh
+unir gur serrqbz gb qvfgevohgr pbcvrf bs serr fbsgjner (naq punetr sbe
+guvf freivpr vs lbh jvfu), gung lbh erprvir fbhepr pbqr be pna trg vg
+vs lbh jnag vg, gung lbh pna punatr gur fbsgjner be hfr cvrprf bs vg
+va arj serr cebtenzf; naq gung lbh xabj lbh pna qb gurfr guvatf.
+
+  Gb cebgrpg lbhe evtugf, jr arrq gb znxr erfgevpgvbaf gung sbeovq
+nalbar gb qral lbh gurfr evtugf be gb nfx lbh gb fheeraqre gur evtugf.
+Gurfr erfgevpgvbaf genafyngr gb pregnva erfcbafvovyvgvrf sbe lbh vs lbh
+qvfgevohgr pbcvrf bs gur fbsgjner, be vs lbh zbqvsl vg.
+
+  Sbe rknzcyr, vs lbh qvfgevohgr pbcvrf bs fhpu n cebtenz, jurgure
+tengvf be sbe n srr, lbh zhfg tvir gur erpvcvragf nyy gur evtugf gung
+lbh unir.  Lbh zhfg znxr fher gung gurl, gbb, erprvir be pna trg gur
+fbhepr pbqr.  Naq lbh zhfg fubj gurz gurfr grezf fb gurl xabj gurve
+evtugf.
+
+  Jr cebgrpg lbhe evtugf jvgu gjb fgrcf: (1) pbclevtug gur fbsgjner, naq
+(2) bssre lbh guvf yvprafr juvpu tvirf lbh yrtny crezvffvba gb pbcl,
+qvfgevohgr naq/be zbqvsl gur fbsgjner.
+
+  Nyfb, sbe rnpu nhgube'f cebgrpgvba naq bhef, jr jnag gb znxr pregnva
+gung rirelbar haqrefgnaqf gung gurer vf ab jneenagl sbe guvf serr
+fbsgjner.  Vs gur fbsgjner vf zbqvsvrq ol fbzrbar ryfr naq cnffrq ba, jr
+jnag vgf erpvcvragf gb xabj gung jung gurl unir vf abg gur bevtvany, fb
+gung nal ceboyrzf vagebqhprq ol bguref jvyy abg ersyrpg ba gur bevtvany
+nhgubef' erchgngvbaf.
+
+  Svanyyl, nal serr cebtenz vf guerngrarq pbafgnagyl ol fbsgjner
+cngragf.  Jr jvfu gb nibvq gur qnatre gung erqvfgevohgbef bs n serr
+cebtenz jvyy vaqvivqhnyyl bognva cngrag yvprafrf, va rssrpg znxvat gur
+cebtenz cebcevrgnel.  Gb cerirag guvf, jr unir znqr vg pyrne gung nal
+cngrag zhfg or yvprafrq sbe rirelbar'f serr hfr be abg yvprafrq ng nyy.
+
+  Gur cerpvfr grezf naq pbaqvgvbaf sbe pbclvat, qvfgevohgvba naq
+zbqvsvpngvba sbyybj.
+
+		    TAH TRARENY CHOYVP YVPRAFR
+   GREZF NAQ PBAQVGVBAF SBE PBCLVAT, QVFGEVOHGVBA NAQ ZBQVSVPNGVBA
+
+  0. Guvf Yvprafr nccyvrf gb nal cebtenz be bgure jbex juvpu pbagnvaf
+n abgvpr cynprq ol gur pbclevtug ubyqre fnlvat vg znl or qvfgevohgrq
+haqre gur grezf bs guvf Trareny Choyvp Yvprafr.  Gur "Cebtenz", orybj,
+ersref gb nal fhpu cebtenz be jbex, naq n "jbex onfrq ba gur Cebtenz"
+zrnaf rvgure gur Cebtenz be nal qrevingvir jbex haqre pbclevtug ynj:
+gung vf gb fnl, n jbex pbagnvavat gur Cebtenz be n cbegvba bs vg,
+rvgure ireongvz be jvgu zbqvsvpngvbaf naq/be genafyngrq vagb nabgure
+ynathntr.  (Urervansgre, genafyngvba vf vapyhqrq jvgubhg yvzvgngvba va
+gur grez "zbqvsvpngvba".)  Rnpu yvprafrr vf nqqerffrq nf "lbh".
+
+Npgvivgvrf bgure guna pbclvat, qvfgevohgvba naq zbqvsvpngvba ner abg
+pbirerq ol guvf Yvprafr; gurl ner bhgfvqr vgf fpbcr.  Gur npg bs
+ehaavat gur Cebtenz vf abg erfgevpgrq, naq gur bhgchg sebz gur Cebtenz
+vf pbirerq bayl vs vgf pbagragf pbafgvghgr n jbex onfrq ba gur
+Cebtenz (vaqrcraqrag bs univat orra znqr ol ehaavat gur Cebtenz).
+Jurgure gung vf gehr qrcraqf ba jung gur Cebtenz qbrf.
+
+  1. Lbh znl pbcl naq qvfgevohgr ireongvz pbcvrf bs gur Cebtenz'f
+fbhepr pbqr nf lbh erprvir vg, va nal zrqvhz, cebivqrq gung lbh
+pbafcvphbhfyl naq nccebcevngryl choyvfu ba rnpu pbcl na nccebcevngr
+pbclevtug abgvpr naq qvfpynvzre bs jneenagl; xrrc vagnpg nyy gur
+abgvprf gung ersre gb guvf Yvprafr naq gb gur nofrapr bs nal jneenagl;
+naq tvir nal bgure erpvcvragf bs gur Cebtenz n pbcl bs guvf Yvprafr
+nybat jvgu gur Cebtenz.
+
+Lbh znl punetr n srr sbe gur culfvpny npg bs genafsreevat n pbcl, naq
+lbh znl ng lbhe bcgvba bssre jneenagl cebgrpgvba va rkpunatr sbe n srr.
+
+  2. Lbh znl zbqvsl lbhe pbcl be pbcvrf bs gur Cebtenz be nal cbegvba
+bs vg, guhf sbezvat n jbex onfrq ba gur Cebtenz, naq pbcl naq
+qvfgevohgr fhpu zbqvsvpngvbaf be jbex haqre gur grezf bs Frpgvba 1
+nobir, cebivqrq gung lbh nyfb zrrg nyy bs gurfr pbaqvgvbaf:
+
+    n) Lbh zhfg pnhfr gur zbqvsvrq svyrf gb pneel cebzvarag abgvprf
+    fgngvat gung lbh punatrq gur svyrf naq gur qngr bs nal punatr.
+
+    o) Lbh zhfg pnhfr nal jbex gung lbh qvfgevohgr be choyvfu, gung va
+    jubyr be va cneg pbagnvaf be vf qrevirq sebz gur Cebtenz be nal
+    cneg gurerbs, gb or yvprafrq nf n jubyr ng ab punetr gb nyy guveq
+    cnegvrf haqre gur grezf bs guvf Yvprafr.
+
+    p) Vs gur zbqvsvrq cebtenz abeznyyl ernqf pbzznaqf vagrenpgviryl
+    jura eha, lbh zhfg pnhfr vg, jura fgnegrq ehaavat sbe fhpu
+    vagrenpgvir hfr va gur zbfg beqvanel jnl, gb cevag be qvfcynl na
+    naabhaprzrag vapyhqvat na nccebcevngr pbclevtug abgvpr naq n
+    abgvpr gung gurer vf ab jneenagl (be ryfr, fnlvat gung lbh cebivqr
+    n jneenagl) naq gung hfref znl erqvfgevohgr gur cebtenz haqre
+    gurfr pbaqvgvbaf, naq gryyvat gur hfre ubj gb ivrj n pbcl bs guvf
+    Yvprafr.  (Rkprcgvba: vs gur Cebtenz vgfrys vf vagrenpgvir ohg
+    qbrf abg abeznyyl cevag fhpu na naabhaprzrag, lbhe jbex onfrq ba
+    gur Cebtenz vf abg erdhverq gb cevag na naabhaprzrag.)
+
+Gurfr erdhverzragf nccyl gb gur zbqvsvrq jbex nf n jubyr.  Vs
+vqragvsvnoyr frpgvbaf bs gung jbex ner abg qrevirq sebz gur Cebtenz,
+naq pna or ernfbanoyl pbafvqrerq vaqrcraqrag naq frcnengr jbexf va
+gurzfryirf, gura guvf Yvprafr, naq vgf grezf, qb abg nccyl gb gubfr
+frpgvbaf jura lbh qvfgevohgr gurz nf frcnengr jbexf.  Ohg jura lbh
+qvfgevohgr gur fnzr frpgvbaf nf cneg bs n jubyr juvpu vf n jbex onfrq
+ba gur Cebtenz, gur qvfgevohgvba bs gur jubyr zhfg or ba gur grezf bs
+guvf Yvprafr, jubfr crezvffvbaf sbe bgure yvprafrrf rkgraq gb gur
+ragver jubyr, naq guhf gb rnpu naq rirel cneg ertneqyrff bs jub jebgr vg.
+
+Guhf, vg vf abg gur vagrag bs guvf frpgvba gb pynvz evtugf be pbagrfg
+lbhe evtugf gb jbex jevggra ragveryl ol lbh; engure, gur vagrag vf gb
+rkrepvfr gur evtug gb pbageby gur qvfgevohgvba bs qrevingvir be
+pbyyrpgvir jbexf onfrq ba gur Cebtenz.
+
+Va nqqvgvba, zrer nttertngvba bs nabgure jbex abg onfrq ba gur Cebtenz
+jvgu gur Cebtenz (be jvgu n jbex onfrq ba gur Cebtenz) ba n ibyhzr bs
+n fgbentr be qvfgevohgvba zrqvhz qbrf abg oevat gur bgure jbex haqre
+gur fpbcr bs guvf Yvprafr.
+
+  3. Lbh znl pbcl naq qvfgevohgr gur Cebtenz (be n jbex onfrq ba vg,
+haqre Frpgvba 2) va bowrpg pbqr be rkrphgnoyr sbez haqre gur grezf bs
+Frpgvbaf 1 naq 2 nobir cebivqrq gung lbh nyfb qb bar bs gur sbyybjvat:
+
+    n) Nppbzcnal vg jvgu gur pbzcyrgr pbeerfcbaqvat znpuvar-ernqnoyr
+    fbhepr pbqr, juvpu zhfg or qvfgevohgrq haqre gur grezf bs Frpgvbaf
+    1 naq 2 nobir ba n zrqvhz phfgbznevyl hfrq sbe fbsgjner vagrepunatr; be,
+
+    o) Nppbzcnal vg jvgu n jevggra bssre, inyvq sbe ng yrnfg guerr
+    lrnef, gb tvir nal guveq cnegl, sbe n punetr ab zber guna lbhe
+    pbfg bs culfvpnyyl cresbezvat fbhepr qvfgevohgvba, n pbzcyrgr
+    znpuvar-ernqnoyr pbcl bs gur pbeerfcbaqvat fbhepr pbqr, gb or
+    qvfgevohgrq haqre gur grezf bs Frpgvbaf 1 naq 2 nobir ba n zrqvhz
+    phfgbznevyl hfrq sbe fbsgjner vagrepunatr; be,
+
+    p) Nppbzcnal vg jvgu gur vasbezngvba lbh erprvirq nf gb gur bssre
+    gb qvfgevohgr pbeerfcbaqvat fbhepr pbqr.  (Guvf nygreangvir vf
+    nyybjrq bayl sbe abapbzzrepvny qvfgevohgvba naq bayl vs lbh
+    erprvirq gur cebtenz va bowrpg pbqr be rkrphgnoyr sbez jvgu fhpu
+    na bssre, va nppbeq jvgu Fhofrpgvba o nobir.)
+
+Gur fbhepr pbqr sbe n jbex zrnaf gur cersreerq sbez bs gur jbex sbe
+znxvat zbqvsvpngvbaf gb vg.  Sbe na rkrphgnoyr jbex, pbzcyrgr fbhepr
+pbqr zrnaf nyy gur fbhepr pbqr sbe nyy zbqhyrf vg pbagnvaf, cyhf nal
+nffbpvngrq vagresnpr qrsvavgvba svyrf, cyhf gur fpevcgf hfrq gb
+pbageby pbzcvyngvba naq vafgnyyngvba bs gur rkrphgnoyr.  Ubjrire, nf n
+fcrpvny rkprcgvba, gur fbhepr pbqr qvfgevohgrq arrq abg vapyhqr
+nalguvat gung vf abeznyyl qvfgevohgrq (va rvgure fbhepr be ovanel
+sbez) jvgu gur znwbe pbzcbaragf (pbzcvyre, xreary, naq fb ba) bs gur
+bcrengvat flfgrz ba juvpu gur rkrphgnoyr ehaf, hayrff gung pbzcbarag
+vgfrys nppbzcnavrf gur rkrphgnoyr.
+
+Vs qvfgevohgvba bs rkrphgnoyr be bowrpg pbqr vf znqr ol bssrevat
+npprff gb pbcl sebz n qrfvtangrq cynpr, gura bssrevat rdhvinyrag
+npprff gb pbcl gur fbhepr pbqr sebz gur fnzr cynpr pbhagf nf
+qvfgevohgvba bs gur fbhepr pbqr, rira gubhtu guveq cnegvrf ner abg
+pbzcryyrq gb pbcl gur fbhepr nybat jvgu gur bowrpg pbqr.
+
+  4. Lbh znl abg pbcl, zbqvsl, fhoyvprafr, be qvfgevohgr gur Cebtenz
+rkprcg nf rkcerffyl cebivqrq haqre guvf Yvprafr.  Nal nggrzcg
+bgurejvfr gb pbcl, zbqvsl, fhoyvprafr be qvfgevohgr gur Cebtenz vf
+ibvq, naq jvyy nhgbzngvpnyyl grezvangr lbhe evtugf haqre guvf Yvprafr.
+Ubjrire, cnegvrf jub unir erprvirq pbcvrf, be evtugf, sebz lbh haqre
+guvf Yvprafr jvyy abg unir gurve yvprafrf grezvangrq fb ybat nf fhpu
+cnegvrf erznva va shyy pbzcyvnapr.
+
+  5. Lbh ner abg erdhverq gb npprcg guvf Yvprafr, fvapr lbh unir abg
+fvtarq vg.  Ubjrire, abguvat ryfr tenagf lbh crezvffvba gb zbqvsl be
+qvfgevohgr gur Cebtenz be vgf qrevingvir jbexf.  Gurfr npgvbaf ner
+cebuvovgrq ol ynj vs lbh qb abg npprcg guvf Yvprafr.  Gurersber, ol
+zbqvslvat be qvfgevohgvat gur Cebtenz (be nal jbex onfrq ba gur
+Cebtenz), lbh vaqvpngr lbhe npprcgnapr bs guvf Yvprafr gb qb fb, naq
+nyy vgf grezf naq pbaqvgvbaf sbe pbclvat, qvfgevohgvat be zbqvslvat
+gur Cebtenz be jbexf onfrq ba vg.
+
+  6. Rnpu gvzr lbh erqvfgevohgr gur Cebtenz (be nal jbex onfrq ba gur
+Cebtenz), gur erpvcvrag nhgbzngvpnyyl erprvirf n yvprafr sebz gur
+bevtvany yvprafbe gb pbcl, qvfgevohgr be zbqvsl gur Cebtenz fhowrpg gb
+gurfr grezf naq pbaqvgvbaf.  Lbh znl abg vzcbfr nal shegure
+erfgevpgvbaf ba gur erpvcvragf' rkrepvfr bs gur evtugf tenagrq urerva.
+Lbh ner abg erfcbafvoyr sbe rasbepvat pbzcyvnapr ol guveq cnegvrf gb
+guvf Yvprafr.
+
+  7. Vs, nf n pbafrdhrapr bs n pbheg whqtzrag be nyyrtngvba bs cngrag
+vasevatrzrag be sbe nal bgure ernfba (abg yvzvgrq gb cngrag vffhrf),
+pbaqvgvbaf ner vzcbfrq ba lbh (jurgure ol pbheg beqre, nterrzrag be
+bgurejvfr) gung pbagenqvpg gur pbaqvgvbaf bs guvf Yvprafr, gurl qb abg
+rkphfr lbh sebz gur pbaqvgvbaf bs guvf Yvprafr.  Vs lbh pnaabg
+qvfgevohgr fb nf gb fngvfsl fvzhygnarbhfyl lbhe boyvtngvbaf haqre guvf
+Yvprafr naq nal bgure cregvarag boyvtngvbaf, gura nf n pbafrdhrapr lbh
+znl abg qvfgevohgr gur Cebtenz ng nyy.  Sbe rknzcyr, vs n cngrag
+yvprafr jbhyq abg crezvg eblnygl-serr erqvfgevohgvba bs gur Cebtenz ol
+nyy gubfr jub erprvir pbcvrf qverpgyl be vaqverpgyl guebhtu lbh, gura
+gur bayl jnl lbh pbhyq fngvfsl obgu vg naq guvf Yvprafr jbhyq or gb
+ersenva ragveryl sebz qvfgevohgvba bs gur Cebtenz.
+
+Vs nal cbegvba bs guvf frpgvba vf uryq vainyvq be harasbeprnoyr haqre
+nal cnegvphyne pvephzfgnapr, gur onynapr bs gur frpgvba vf vagraqrq gb
+nccyl naq gur frpgvba nf n jubyr vf vagraqrq gb nccyl va bgure
+pvephzfgnaprf.
+
+Vg vf abg gur checbfr bs guvf frpgvba gb vaqhpr lbh gb vasevatr nal
+cngragf be bgure cebcregl evtug pynvzf be gb pbagrfg inyvqvgl bs nal
+fhpu pynvzf; guvf frpgvba unf gur fbyr checbfr bs cebgrpgvat gur
+vagrtevgl bs gur serr fbsgjner qvfgevohgvba flfgrz, juvpu vf
+vzcyrzragrq ol choyvp yvprafr cenpgvprf.  Znal crbcyr unir znqr
+trarebhf pbagevohgvbaf gb gur jvqr enatr bs fbsgjner qvfgevohgrq
+guebhtu gung flfgrz va eryvnapr ba pbafvfgrag nccyvpngvba bs gung
+flfgrz; vg vf hc gb gur nhgube/qbabe gb qrpvqr vs ur be fur vf jvyyvat
+gb qvfgevohgr fbsgjner guebhtu nal bgure flfgrz naq n yvprafrr pnaabg
+vzcbfr gung pubvpr.
+
+Guvf frpgvba vf vagraqrq gb znxr gubebhtuyl pyrne jung vf oryvrirq gb
+or n pbafrdhrapr bs gur erfg bs guvf Yvprafr.
+
+  8. Vs gur qvfgevohgvba naq/be hfr bs gur Cebtenz vf erfgevpgrq va
+pregnva pbhagevrf rvgure ol cngragf be ol pbclevtugrq vagresnprf, gur
+bevtvany pbclevtug ubyqre jub cynprf gur Cebtenz haqre guvf Yvprafr
+znl nqq na rkcyvpvg trbtencuvpny qvfgevohgvba yvzvgngvba rkpyhqvat
+gubfr pbhagevrf, fb gung qvfgevohgvba vf crezvggrq bayl va be nzbat
+pbhagevrf abg guhf rkpyhqrq.  Va fhpu pnfr, guvf Yvprafr vapbecbengrf
+gur yvzvgngvba nf vs jevggra va gur obql bs guvf Yvprafr.
+
+  9. Gur Serr Fbsgjner Sbhaqngvba znl choyvfu erivfrq naq/be arj irefvbaf
+bs gur Trareny Choyvp Yvprafr sebz gvzr gb gvzr.  Fhpu arj irefvbaf jvyy
+or fvzvyne va fcvevg gb gur cerfrag irefvba, ohg znl qvssre va qrgnvy gb
+nqqerff arj ceboyrzf be pbapreaf.
+
+Rnpu irefvba vf tvira n qvfgvathvfuvat irefvba ahzore.  Vs gur Cebtenz
+fcrpvsvrf n irefvba ahzore bs guvf Yvprafr juvpu nccyvrf gb vg naq "nal
+yngre irefvba", lbh unir gur bcgvba bs sbyybjvat gur grezf naq pbaqvgvbaf
+rvgure bs gung irefvba be bs nal yngre irefvba choyvfurq ol gur Serr
+Fbsgjner Sbhaqngvba.  Vs gur Cebtenz qbrf abg fcrpvsl n irefvba ahzore bs
+guvf Yvprafr, lbh znl pubbfr nal irefvba rire choyvfurq ol gur Serr Fbsgjner
+Sbhaqngvba.
+
+  10. Vs lbh jvfu gb vapbecbengr cnegf bs gur Cebtenz vagb bgure serr
+cebtenzf jubfr qvfgevohgvba pbaqvgvbaf ner qvssrerag, jevgr gb gur nhgube
+gb nfx sbe crezvffvba.  Sbe fbsgjner juvpu vf pbclevtugrq ol gur Serr
+Fbsgjner Sbhaqngvba, jevgr gb gur Serr Fbsgjner Sbhaqngvba; jr fbzrgvzrf
+znxr rkprcgvbaf sbe guvf.  Bhe qrpvfvba jvyy or thvqrq ol gur gjb tbnyf
+bs cerfreivat gur serr fgnghf bs nyy qrevingvirf bs bhe serr fbsgjner naq
+bs cebzbgvat gur funevat naq erhfr bs fbsgjner trarenyyl.
+
+			    AB JNEENAGL
+
+  11. ORPNHFR GUR CEBTENZ VF YVPRAFRQ SERR BS PUNETR, GURER VF AB JNEENAGL
+SBE GUR CEBTENZ, GB GUR RKGRAG CREZVGGRQ OL NCCYVPNOYR YNJ.  RKPRCG JURA
+BGUREJVFR FGNGRQ VA JEVGVAT GUR PBCLEVTUG UBYQREF NAQ/BE BGURE CNEGVRF
+CEBIVQR GUR CEBTENZ "NF VF" JVGUBHG JNEENAGL BS NAL XVAQ, RVGURE RKCERFFRQ
+BE VZCYVRQ, VAPYHQVAT, OHG ABG YVZVGRQ GB, GUR VZCYVRQ JNEENAGVRF BS
+ZREPUNAGNOVYVGL NAQ SVGARFF SBE N CNEGVPHYNE CHECBFR.  GUR RAGVER EVFX NF
+GB GUR DHNYVGL NAQ CRESBEZNAPR BS GUR CEBTENZ VF JVGU LBH.  FUBHYQ GUR
+CEBTENZ CEBIR QRSRPGVIR, LBH NFFHZR GUR PBFG BS NYY ARPRFFNEL FREIVPVAT,
+ERCNVE BE PBEERPGVBA.
+
+  12. VA AB RIRAG HAYRFF ERDHVERQ OL NCCYVPNOYR YNJ BE NTERRQ GB VA JEVGVAT
+JVYY NAL PBCLEVTUG UBYQRE, BE NAL BGURE CNEGL JUB ZNL ZBQVSL NAQ/BE
+ERQVFGEVOHGR GUR CEBTENZ NF CREZVGGRQ NOBIR, OR YVNOYR GB LBH SBE QNZNTRF,
+VAPYHQVAT NAL TRARENY, FCRPVNY, VAPVQRAGNY BE PBAFRDHRAGVNY QNZNTRF NEVFVAT
+BHG BS GUR HFR BE VANOVYVGL GB HFR GUR CEBTENZ (VAPYHQVAT OHG ABG YVZVGRQ
+GB YBFF BS QNGN BE QNGN ORVAT ERAQRERQ VANPPHENGR BE YBFFRF FHFGNVARQ OL
+LBH BE GUVEQ CNEGVRF BE N SNVYHER BS GUR CEBTENZ GB BCRENGR JVGU NAL BGURE
+CEBTENZF), RIRA VS FHPU UBYQRE BE BGURE CNEGL UNF ORRA NQIVFRQ BS GUR
+CBFFVOVYVGL BS FHPU QNZNTRF.
+
+		     RAQ BS GREZF NAQ PBAQVGVBAF
+
+	    Ubj gb Nccyl Gurfr Grezf gb Lbhe Arj Cebtenzf
+
+  Vs lbh qrirybc n arj cebtenz, naq lbh jnag vg gb or bs gur terngrfg
+cbffvoyr hfr gb gur choyvp, gur orfg jnl gb npuvrir guvf vf gb znxr vg
+serr fbsgjner juvpu rirelbar pna erqvfgevohgr naq punatr haqre gurfr grezf.
+
+  Gb qb fb, nggnpu gur sbyybjvat abgvprf gb gur cebtenz.  Vg vf fnsrfg
+gb nggnpu gurz gb gur fgneg bs rnpu fbhepr svyr gb zbfg rssrpgviryl
+pbairl gur rkpyhfvba bs jneenagl; naq rnpu svyr fubhyq unir ng yrnfg
+gur "pbclevtug" yvar naq n cbvagre gb jurer gur shyy abgvpr vf sbhaq.
+
+    <bar yvar gb tvir gur cebtenz'f anzr naq n oevrs vqrn bs jung vg qbrf.>
+    Pbclevtug (P) <lrne>  <anzr bs nhgube>
+
+    Guvf cebtenz vf serr fbsgjner; lbh pna erqvfgevohgr vg naq/be zbqvsl
+    vg haqre gur grezf bs gur TAH Trareny Choyvp Yvprafr nf choyvfurq ol
+    gur Serr Fbsgjner Sbhaqngvba; rvgure irefvba 2 bs gur Yvprafr, be
+    (ng lbhe bcgvba) nal yngre irefvba.
+
+    Guvf cebtenz vf qvfgevohgrq va gur ubcr gung vg jvyy or hfrshy,
+    ohg JVGUBHG NAL JNEENAGL; jvgubhg rira gur vzcyvrq jneenagl bs
+    ZREPUNAGNOVYVGL be SVGARFF SBE N CNEGVPHYNE CHECBFR.  Frr gur
+    TAH Trareny Choyvp Yvprafr sbe zber qrgnvyf.
+
+    Lbh fubhyq unir erprvirq n pbcl bs gur TAH Trareny Choyvp Yvprafr nybat
+    jvgu guvf cebtenz; vs abg, jevgr gb gur Serr Fbsgjner Sbhaqngvba, Vap.,
+    51 Senaxyva Fgerrg, Svsgu Sybbe, Obfgba, ZN 02110-1301 HFN.
+
+Nyfb nqq vasbezngvba ba ubj gb pbagnpg lbh ol ryrpgebavp naq cncre znvy.
+
+Vs gur cebtenz vf vagrenpgvir, znxr vg bhgchg n fubeg abgvpr yvxr guvf
+jura vg fgnegf va na vagrenpgvir zbqr:
+
+    Tabzbivfvba irefvba 69, Pbclevtug (P) lrne anzr bs nhgube
+    Tabzbivfvba pbzrf jvgu NOFBYHGRYL AB JNEENAGL; sbe qrgnvyf glcr `fubj j'.
+    Guvf vf serr fbsgjner, naq lbh ner jrypbzr gb erqvfgevohgr vg
+    haqre pregnva pbaqvgvbaf; glcr `fubj p' sbe qrgnvyf.
+
+Gur ulcbgurgvpny pbzznaqf `fubj j' naq `fubj p' fubhyq fubj gur nccebcevngr
+cnegf bs gur Trareny Choyvp Yvprafr.  Bs pbhefr, gur pbzznaqf lbh hfr znl
+or pnyyrq fbzrguvat bgure guna `fubj j' naq `fubj p'; gurl pbhyq rira or
+zbhfr-pyvpxf be zrah vgrzf--jungrire fhvgf lbhe cebtenz.
+
+Lbh fubhyq nyfb trg lbhe rzcyblre (vs lbh jbex nf n cebtenzzre) be lbhe
+fpubby, vs nal, gb fvta n "pbclevtug qvfpynvzre" sbe gur cebtenz, vs
+arprffnel.  Urer vf n fnzcyr; nygre gur anzrf:
+
+  Lblbqlar, Vap., urerol qvfpynvzf nyy pbclevtug vagrerfg va gur cebtenz
+  `Tabzbivfvba' (juvpu znxrf cnffrf ng pbzcvyref) jevggra ol Wnzrf Unpxre.
+
+  <fvtangher bs Gl Pbba>, 1 Ncevy 1989
+  Gl Pbba, Cerfvqrag bs Ivpr
+
+Guvf Trareny Choyvp Yvprafr qbrf abg crezvg vapbecbengvat lbhe cebtenz vagb
+cebcevrgnel cebtenzf.  Vs lbhe cebtenz vf n fhoebhgvar yvoenel, lbh znl
+pbafvqre vg zber hfrshy gb crezvg yvaxvat cebcevrgnel nccyvpngvbaf jvgu gur
+yvoenel.  Vs guvf vf jung lbh jnag gb qb, hfr gur TAH Yrffre Trareny
+Choyvp Yvprafr vafgrnq bs guvf Yvprafr.
ok 6 - suppress deletion diff with -B -D

expecting success: 
	test_seq 1 99 >seq &&
	printf 100 >>seq &&
	git add seq &&
	git commit seq -m seq

@@ -15,3 +15,3 @@ =head1 SYNOPSIS_RIGHT
diff --git a/perl-skip-sub-in-pod b/perl-skip-sub-in-pod
index e39f024..63b38e7 100644
--- a/perl-skip-sub-in-pod
+++ b/perl-skip-sub-in-pod
@@ -15,3 +15,3 @@ =head1 SYNOPSIS_RIGHT
 
-	ChangeMe;
+	IWasChanged;
 
ok 71 - hunk header: perl-skip-sub-in-pod

expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 perl-sub-definition >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
[master c3ebfbc] Second
 Author: A U Thor <author@example.com>
 2 files changed, 0 insertions(+), 0 deletions(-)
 rename foo => bar (100%)
 rename bar => foo (100%)
fatal: ambiguous argument 'does-not-exist': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
@@ -2,3 +2,3 @@ sub RIGHT {
diff --git a/perl-sub-definition b/perl-sub-definition
index a507d1f..63603be 100644
--- a/perl-sub-definition
+++ b/perl-sub-definition
@@ -2,3 +2,3 @@ sub RIGHT {
 	my ($n) = @_;
-	print "ChangeMe";
+	print "IWasChanged";
 }
[master (root-commit) 47f6ff1] seq
 Author: A U Thor <author@example.com>
 1 file changed, 100 insertions(+)
 create mode 100644 seq
ok 72 - hunk header: perl-sub-definition

ok 7 - prepare a file that ends with an incomplete line

expecting success: 
	test_seq 1 5 >seq &&
	test_seq 9331 9420 >>seq &&
	test_seq 96 100 >>seq

expecting success: 
		test_when_finished 'cat actual' &&	# for debugging only
		git diff -U1 perl-sub-definition-kr-brace >actual &&
		grep '@@ .* @@.*RIGHT' actual
	
rm 'bar'
rm 'foo'
@@ -2,3 +2,3 @@ sub RIGHT
diff --git a/perl-sub-definition-kr-brace b/perl-sub-definition-kr-brace
index 330b3df..99672aa 100644
--- a/perl-sub-definition-kr-brace
+++ b/perl-sub-definition-kr-brace
@@ -2,3 +2,3 @@ sub RIGHT
 {
-	print "ChangeMe\n";
+	print "IWasChanged\n";
 }
ok 73 - hunk header: perl-sub-definition-kr-brace

ok 8 - rewrite the middle 90% of sequence file and terminate with newline

expecting success: 
	git diff -B seq >res &&
	grep "dissimilarity index" res

# passed all 73 test(s)
1..73
[master 52df914] Third
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename bar => foo (100%)
dissimilarity index 92%
ok 9 - confirm that sequence file is considered a rewrite

expecting success: 
	git diff seq >res &&
	grep "^\\\\ " res &&
	! grep "^..*\\\\ " res

\ No newline at end of file
ok 10 - no newline at eof is on its own line without -B

expecting success: 
	git diff -B seq >res &&
	grep "^\\\\ " res &&
	! grep "^..*\\\\ " res

fatal: ambiguous argument 'does-not-exist@{0}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
*** t4024-diff-optimize-common.sh ***
\ No newline at end of file
ok 11 - no newline at eof is on its own line with -B

[master ea69a8e] Fourth
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 360 deletions(-)
 copy foo => bar (100%)
 rewrite foo (100%)
 mode change 100644 => 120000
# passed all 11 test(s)
1..11
rm 'bar'
rm 'foo'
*** t4025-hunk-header.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4024-diff-optimize-common/.git/
expecting success: 

	for n in $sample
	do
		( zs $n ; echo a ) >file-a$n &&
		( echo b; zs $n; echo ) >file-b$n &&
		( printf c; zs $n ) >file-c$n &&
		( echo d; zs $n ) >file-d$n &&

		git add file-a$n file-b$n file-c$n file-d$n &&

		( zs $n ; echo A ) >file-a$n &&
		( echo B; zs $n; echo ) >file-b$n &&
		( printf C; zs $n ) >file-c$n &&
		( echo D; zs $n ) >file-d$n &&

		expect_pattern $n || return 1

	done >expect

fatal: ambiguous argument 'does-not-exist': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4025-hunk-header/.git/
[master 50aa4fa] Fifth
 Author: A U Thor <author@example.com>
 2 files changed, 2574 insertions(+), 360 deletions(-)
 rewrite bar (98%)
 copy bar => foo (100%)
expecting success: 

	(
		echo "A $NS"
		for c in B C D E F G H I J K
		do
			echo "  $c"
		done
		echo "L  $NS"
		for c in M N O P Q R S T U V
		do
			echo "  $c"
		done
	) >file &&
	git add file &&

	sed -e "/^  [EP]/s/$/ modified/" <file >file+ &&
	mv file+ file


rm 'bar'
rm 'foo'
ok 1 - setup

expecting success: 

	git diff | sed -n -e "s/^.*@@//p" >actual &&
	(
		echo " A $N$N$N$N$N$N$N$N$N2"
		echo " L  $N$N$N$N$N$N$N$N$N1"
	) >expected &&
	test_cmp actual expected


fatal: ambiguous argument 'does-not-exist@{0}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
ok 2 - hunk header truncation with an overly long line

# passed all 2 test(s)
1..2
[master c9b55da] Sixth
 Author: A U Thor <author@example.com>
 2 files changed, 0 insertions(+), 0 deletions(-)
 rename foo => bar (100%)
 rename bar => foo (100%)
ok 1 - setup

expecting success: 

	git diff-tree five six -r --name-status -B -M | sort >actual &&
	{
		echo "R100	foo	bar"
		echo "R100	bar	foo"
	} | sort >expect &&
	test_cmp expect actual


*** t4026-color.sh ***
ok 2 - cross renames to be detected for regular files

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

	git diff-tree one two -r --name-status -B -M | sort >actual &&
	{
		echo "R100	foo	bar"
		echo "R100	bar	foo"
	} | sort >expect &&
	test_cmp expect actual


expecting success: 
	color "reset" "[m"

ok 1 - setup

expecting success: 

	for n in $sample
	do
		git diff -U0 file-?$n
	done | zc >actual &&
	test_cmp expect actual


ok 1 - reset

expecting success: 
	color "bold red" "[1;31m"

Dropped refs/stash@{0} (27c159a96e83849bd414180cddb19b9e9c9ca123)
ok 2 - attribute before color name

expecting success: 
	color "red bold" "[1;31m"

ok 3 - cross renames to be detected for typechange

expecting success: 

	git diff-tree three four -r --name-status -B -M | sort >actual &&
	{
		# see -B -M (#6) in t4008
		echo "C100	foo	bar"
		echo "T100	foo"
	} | sort >expect &&
	test_cmp expect actual


ok 3 - color name before attribute

expecting success: 
	color "ul blue red" "[4;34;41m"

ok 49 - ref with non-existent reflog

expecting success: 
	git stash clear &&
	test_must_fail git stash drop stash@{0} &&
	echo bar5 > file &&
	echo bar6 > file2 &&
	git add file2 &&
	git stash &&
	test_must_fail git stash drop stash@{1} &&
	test_must_fail git stash pop stash@{1} &&
	test_must_fail git stash apply stash@{1} &&
	test_must_fail git stash show stash@{1} &&
	test_must_fail git stash branch tmp stash@{1} &&
	git stash drop

ok 4 - attr fg bg

expecting success: 
	color "blue ul red" "[4;34;41m"

ok 5 - fg attr bg

expecting success: 
	color "blue red ul" "[4;34;41m"

ok 4 - moves and renames

ok 6 - fg bg attr

expecting success: 
	color "blue bold dim ul blink reverse" "[1;2;4;5;7;34m"

# passed all 4 test(s)
1..4
ok 2 - diff -U0

ok 7 - fg bg attr...

expecting success: 
	color "nobold nodim noul noblink noreverse" "[22;24;25;27m"

# passed all 2 test(s)
1..2
ok 8 - attr negation

expecting success: 
	color "254 255 bold dim ul blink reverse" "[1;2;4;5;7;38;5;254;48;5;255m"

ok 9 - long color specification

expecting success: 
	color \
	  "#ffffff #ffffff bold nobold dim nodim ul noul blink noblink reverse noreverse" \
	  "[1;2;4;5;7;22;24;25;27;38;2;255;255;255;48;2;255;255;255m"

*** t4027-diff-submodule.sh ***
ok 10 - absurdly long color specification

expecting success: 
	color "0 7" "[30;47m"

*** t4028-format-patch-mime-headers.sh ***
ok 11 - 0-7 are aliases for basic ANSI color names

expecting success: 
	color "254 bold 255" "[1;38;5;254;48;5;255m"

ok 12 - 256 colors

expecting success: 
	color "#ff00ff black" "[38;2;255;0;255;40m"

ok 13 - 24-bit colors

expecting success: 
	color "normal black" "[40m"

ok 14 - "normal" yields no color at all"

expecting success: 
	color "-1 black" "[40m"

ok 15 - -1 is a synonym for "normal"

expecting success: 
	invalid_color "-2"

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4027-diff-submodule/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4028-format-patch-mime-headers/.git/
error: invalid color value: -2
fatal: unable to parse default color value
ok 16 - color too small

expecting success: 
	invalid_color "256"

expecting success: 
	test_tick &&
	test_create_repo sub &&
	(
		cd sub &&
		echo hello >world &&
		git add world &&
		git commit -m submodule
	) &&

	test_tick &&
	echo frotz >nitfol &&
	git add nitfol sub &&
	git commit -m superproject &&

	(
		cd sub &&
		echo goodbye >world &&
		git add world &&
		git commit -m "submodule #2"
	) &&

	set x $(
		cd sub &&
		git rev-list HEAD
	) &&
	echo ":160000 160000 $3 $_z40 M	sub" >expect &&
	subtip=$3 subprev=$2

expecting success: 
	echo content >file &&
	git add file &&
	git commit -m one &&
	echo more >>file &&
	git commit -a -m "two

	utf-8 body: ñ"

error: invalid color value: 256
fatal: unable to parse default color value
ok 17 - color too big

expecting success: 
	invalid_color "3X"

fatal: ambiguous argument 'stash@{0}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
error: invalid color value: 3X
fatal: unable to parse default color value
ok 18 - extra character after color number

expecting success: 
	invalid_color "redX"

error: invalid color value: redX
fatal: unable to parse default color value
ok 19 - extra character after color name

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4027-diff-submodule/sub/.git/
expecting success: 
	invalid_color "dimX"

[master (root-commit) 7a1704f] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
error: invalid color value: dimX
fatal: unable to parse default color value
ok 20 - extra character after attribute

expecting success: 
	git config color.diff.nosuchslotwilleverbedefined white &&
	git diff --color

[master 2e13c47] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 1 - create commit with utf-8 body

expecting success: 
	rm -f 0001-two.patch &&
	git format-patch HEAD^ &&
	grep -i "content-type: text/plain; charset=utf-8" 0001-two.patch

[master (root-commit) 4431e0b] submodule
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 world
ok 21 - unknown color slots are ignored (diff)

expecting success: 
	git config color.branch.nosuchslotwilleverbedefined white &&
	git branch -a

0001-two.patch
Content-Type: text/plain; charset=UTF-8
ok 2 - patch has mime headers

expecting success: 
	rm -f 0001-two.patch &&
	git config format.headers "x-foo: bar" &&
	git format-patch HEAD^ &&
	grep -i "x-foo: bar" 0001-two.patch &&
	grep -i "content-type: text/plain; charset=utf-8" 0001-two.patch

ok 22 - unknown color slots are ignored (branch)

expecting success: 
	git config color.status.nosuchslotwilleverbedefined white &&
	{ git status; ret=$?; } &&
	case $ret in 0|1) : ok ;; *) false ;; esac

[master (root-commit) 5b035b6] superproject
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 nitfol
 create mode 160000 sub
On branch master

Initial commit

nothing to commit (create/copy files and use "git add" to track)
ok 23 - unknown color slots are ignored (status)

# passed all 23 test(s)
1..23
0001-two.patch
x-foo: bar
[master 2dd69d6] submodule #2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Content-Type: text/plain; charset=UTF-8
ok 3 - patch has mime and extra headers

*** t4029-diff-trailing-space.sh ***
# passed all 3 test(s)
1..3
ok 1 - setup

expecting success: 
	git diff --raw --abbrev=40 HEAD >actual &&
	test_cmp expect actual

ok 2 - git diff --raw HEAD

expecting success: 
	git diff-index --raw HEAD >actual.index &&
	test_cmp expect actual.index

*** t4030-diff-textconv.sh ***
ok 3 - git diff-index --raw HEAD

expecting success: 
	git diff-files --raw >actual.files &&
	test_cmp expect actual.files

ok 4 - git diff-files --raw

expecting success: 
	git diff HEAD >actual &&
	sed -e "1,/^@@/d" actual >actual.body &&
	expect_from_to >expect.body $subtip $subprev &&
	test_cmp expect.body actual.body

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4029-diff-trailing-space/.git/
expecting success: printf "\nx\n" > f &&
     git add f &&
     git commit -q -m. f &&
     printf "\ny\n" > f &&
     git config --bool diff.suppressBlankEmpty true &&
     git diff f > actual &&
     test_cmp exp actual &&
     perl -i.bak -p -e "s/^\$/ /" exp &&
     git config --bool diff.suppressBlankEmpty false &&
     git diff f > actual &&
     test_cmp exp actual &&
     git config --bool --unset diff.suppressBlankEmpty &&
     git diff f > actual &&
     test_cmp exp actual
     
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4030-diff-textconv/.git/
ok 5 - git diff HEAD

expecting success: 
	echo >>sub/world &&
	git diff HEAD >actual &&
	sed -e "1,/^@@/d" actual >actual.body &&
	expect_from_to >expect.body $subtip $subprev-dirty &&
	test_cmp expect.body actual.body

Saved working directory and index state WIP on master: 662e8e5 second
expecting success: 
	printf "\\0\\n" >file &&
	git add file &&
	git commit -m one &&
	printf "\\01\\n" >>file &&
	git add file &&
	git commit -m two

HEAD is now at 662e8e5 second
ok 6 - git diff HEAD with dirty submodule (work tree)

expecting success: 
	(
		cd sub &&
		git reset --hard &&
		echo >>world &&
		git add world
	) &&
	git diff HEAD >actual &&
	sed -e "1,/^@@/d" actual >actual.body &&
	expect_from_to >expect.body $subtip $subprev-dirty &&
	test_cmp expect.body actual.body

[master (root-commit) 07f68c9] one
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file
HEAD is now at 2dd69d6 submodule #2
[master 8e1f9d4] two
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
ok 1 - setup binary file with history

expecting success: 
	git diff HEAD^ HEAD >diff &&
	find_diff <diff >actual &&
	test_cmp expect.binary actual

ok 1 - diff honors config option, diff.suppressBlankEmpty

ok 7 - git diff HEAD with dirty submodule (index)

expecting success: 
	(
		cd sub &&
		git reset --hard &&
		git clean -qfdx &&
		>cruft
	) &&
	git diff HEAD >actual &&
	sed -e "1,/^@@/d" actual >actual.body &&
	expect_from_to >expect.body $subtip $subprev-dirty &&
	test_cmp expect.body actual.body

ok 2 - file is considered binary by porcelain

expecting success: 
	git diff-tree -p HEAD^ HEAD >diff &&
	find_diff <diff >actual &&
	test_cmp expect.binary actual

# passed all 1 test(s)
1..1
fatal: Log for 'stash' only has 1 entries.
HEAD is now at 2dd69d6 submodule #2
ok 3 - file is considered binary by plumbing

*** t4031-diff-rewrite-binary.sh ***
expecting success: 
	echo file diff=foo >.gitattributes &&
	git config diff.foo.textconv "\"$(pwd)\""/hexdump &&
	git config diff.fail.textconv false

ok 4 - setup textconv filters

expecting success: 
	git diff HEAD^ HEAD >diff &&
	find_diff <diff >actual &&
	test_cmp expect.text actual

ok 8 - git diff HEAD with dirty submodule (untracked)

expecting success: 
	git commit -m "x" sub &&
	echo >>sub/world &&
	git diff HEAD >actual &&
	sed -e "1,/^@@/d" actual >actual.body &&
	expect_from_to >expect.body $subprev $subprev-dirty &&
	test_cmp expect.body actual.body &&
	git diff --ignore-submodules HEAD >actual2 &&
	! test -s actual2 &&
	git diff --ignore-submodules=untracked HEAD >actual3 &&
	sed -e "1,/^@@/d" actual3 >actual3.body &&
	expect_from_to >expect.body $subprev $subprev-dirty &&
	test_cmp expect.body actual3.body &&
	git diff --ignore-submodules=dirty HEAD >actual4 &&
	! test -s actual4

[master e6ee575] x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
fatal: Log for 'stash' only has 1 entries.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4031-diff-rewrite-binary/.git/
expecting success: 
	make_file "\\0" &&
	git add file &&
	make_file "\\01"

ok 5 - diff produces text

expecting success: 
	git show HEAD >diff &&
	find_diff <diff >actual &&
	test_cmp expect.text actual

ok 1 - create binary file with changes

expecting success: 
	git diff >diff &&
	grep "Binary files a/file and b/file differ" diff

Binary files a/file and b/file differ
ok 2 - vanilla diff is binary

expecting success: 
	git diff -B >diff &&
	grep "dissimilarity index" diff &&
	grep "Binary files a/file and b/file differ" diff

fatal: Log for 'stash' only has 1 entries.
ok 6 - show commit produces text

expecting success: 
	git diff-tree -p HEAD^ HEAD >diff &&
	find_diff <diff >actual &&
	test_cmp expect.binary actual

ok 9 - git diff HEAD with dirty submodule (work tree, refs match)

expecting success: 
	git config diff.ignoreSubmodules all &&
	git diff HEAD >actual &&
	! test -s actual &&
	git config submodule.subname.ignore none &&
	git config submodule.subname.path sub &&
	git diff HEAD >actual &&
	sed -e "1,/^@@/d" actual >actual.body &&
	expect_from_to >expect.body $subprev $subprev-dirty &&
	test_cmp expect.body actual.body &&
	git config submodule.subname.ignore all &&
	git diff HEAD >actual2 &&
	! test -s actual2 &&
	git config submodule.subname.ignore untracked &&
	git diff HEAD >actual3 &&
	sed -e "1,/^@@/d" actual3 >actual3.body &&
	expect_from_to >expect.body $subprev $subprev-dirty &&
	test_cmp expect.body actual3.body &&
	git config submodule.subname.ignore dirty &&
	git diff HEAD >actual4 &&
	! test -s actual4 &&
	git diff HEAD --ignore-submodules=none >actual &&
	sed -e "1,/^@@/d" actual >actual.body &&
	expect_from_to >expect.body $subprev $subprev-dirty &&
	test_cmp expect.body actual.body &&
	git config --remove-section submodule.subname &&
	git config --unset diff.ignoreSubmodules

dissimilarity index 99%
Binary files a/file and b/file differ
ok 3 - rewrite diff is binary

expecting success: 
	git diff -B --binary >diff &&
	grep "dissimilarity index" diff &&
	grep "GIT binary patch" diff

ok 7 - diff-tree produces binary

expecting success: 
	git log -1 -p >log &&
	find_diff <log >actual &&
	test_cmp expect.text actual

dissimilarity index 99%
GIT binary patch
ok 4 - rewrite diff can show binary patch

expecting success: 
	git diff -B --numstat --summary >diff &&
	grep -e "-	-	" diff &&
	grep " rewrite file" diff

-	-	file
 rewrite file (99%)
ok 5 - rewrite diff --numstat shows binary changes

expecting success: 
	git diff -B --stat --summary >diff &&
	grep "Bin" diff &&
	test_i18ngrep "0 insertions.*0 deletions" diff &&
	grep " rewrite file" diff

 file | Bin 902 -> 902 bytes
fatal: Log for 'stash' only has 1 entries.
 1 file changed, 0 insertions(+), 0 deletions(-)
 rewrite file (99%)
ok 8 - log produces text

expecting success: 
	git format-patch --no-binary --stdout HEAD^ >patch &&
	find_diff <patch >actual &&
	test_cmp expect.binary actual

ok 6 - diff --stat counts binary rewrite as 0 lines

expecting success: 
	echo file diff=foo >.gitattributes &&
	git config diff.foo.textconv "\"$(pwd)\""/dump

ok 7 - setup textconv

expecting success: 
	git diff -B >diff &&
	grep "dissimilarity index" diff &&
	grep "^-61" diff &&
	grep "^-0" diff

ok 9 - format-patch produces binary

expecting success: 
	git reset --soft HEAD^ &&
	git status -v >diff &&
	find_diff <diff >actual &&
	test_cmp expect.text actual &&
	git reset --soft HEAD@{1}

fatal: Log for 'stash' only has 1 entries.
dissimilarity index 99%
-61
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
ok 8 - rewrite diff respects textconv

# passed all 8 test(s)
1..8
ok 10 - status -v produces text

expecting success: 
	git show HEAD:file >actual &&
	printf "\\0\\n\\01\\n" >expect &&
	test_cmp expect actual

*** t4032-diff-inter-hunk-context.sh ***
ok 10 - git diff HEAD with dirty submodule (work tree, refs match) [.git/config]

expecting success: 
	git config diff.ignoreSubmodules dirty &&
	git diff HEAD >actual &&
	! test -s actual &&
	git config --add -f .gitmodules submodule.subname.ignore none &&
	git config --add -f .gitmodules submodule.subname.path sub &&
	git diff HEAD >actual &&
	sed -e "1,/^@@/d" actual >actual.body &&
	expect_from_to >expect.body $subprev $subprev-dirty &&
	test_cmp expect.body actual.body &&
	git config -f .gitmodules submodule.subname.ignore all &&
	git config -f .gitmodules submodule.subname.path sub &&
	git diff HEAD >actual2 &&
	! test -s actual2 &&
	git config -f .gitmodules submodule.subname.ignore untracked &&
	git diff HEAD >actual3 &&
	sed -e "1,/^@@/d" actual3 >actual3.body &&
	expect_from_to >expect.body $subprev $subprev-dirty &&
	test_cmp expect.body actual3.body &&
	git config -f .gitmodules submodule.subname.ignore dirty &&
	git diff HEAD >actual4 &&
	! test -s actual4 &&
	git config submodule.subname.ignore none &&
	git config submodule.subname.path sub &&
	git diff HEAD >actual &&
	sed -e "1,/^@@/d" actual >actual.body &&
	expect_from_to >expect.body $subprev $subprev-dirty &&
	test_cmp expect.body actual.body &&
	git config --remove-section submodule.subname &&
	git config --remove-section -f .gitmodules submodule.subname &&
	git config --unset diff.ignoreSubmodules &&
	rm .gitmodules

ok 11 - show blob produces binary

expecting success: 
	git show --textconv HEAD:file >actual &&
	printf "0\\n1\\n" >expect &&
	test_cmp expect actual

ok 12 - show --textconv blob produces text

expecting success: 
	git show --no-textconv HEAD:file >actual &&
	printf "\\0\\n\\01\\n" >expect &&
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4032-diff-inter-hunk-context/.git/
ok 13 - show --no-textconv blob produces binary

expecting success: 
	echo one >expect &&
	git log --root --format=%s -G0 >actual &&
	test_cmp expect actual

Dropped refs/stash@{0} (27c159a96e83849bd414180cddb19b9e9c9ca123)
ok 50 - invalid ref of the form stash@{n}, n >= N

expecting success: 
		test 2 = 2
	
expecting success: 
	git stash clear &&
	echo foo >file &&
	git add file &&
	git commit -m initial &&
	echo bar >file &&
	git stash &&
	test_must_fail git stash branch master stash@{0} &&
	git rev-parse stash@{0} --

ok 1 - diff -U0, 1 common line: count hunks (2)

expecting success: 
		git diff -U0 f1 | grep -v '^index ' >actual &&
		test_cmp expected.f1.0.2 actual
	
ok 14 - grep-diff (-G) operates on textconv data (add)

expecting success: 
	echo two >expect &&
	git log --root --format=%s -G1 >actual &&
	test_cmp expect actual

ok 2 - diff -U0, 1 common line: check output

expecting success: 
		test 2 = 2
	
ok 3 - diff -U0 --inter-hunk-context=0, 1 common line: count hunks (2)

expecting success: 
		git diff -U0 --inter-hunk-context=0 f1 | grep -v '^index ' >actual &&
		test_cmp expected.f1.0.2 actual
	
ok 15 - grep-diff (-G) operates on textconv data (modification)

expecting success: 
	echo one >expect &&
	git log --root --format=%s -S0 >actual &&
	test_cmp expect actual

ok 4 - diff -U0 --inter-hunk-context=0, 1 common line: check output

expecting success: 
		test 1 = 1
	
ok 5 - diff -U0 --inter-hunk-context=1, 1 common line: count hunks (1)

expecting success: 
		git diff -U0 --inter-hunk-context=1 f1 | grep -v '^index ' >actual &&
		test_cmp expected.f1.0.1 actual
	
[master 47d5e0e] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 6 - diff -U0 --inter-hunk-context=1, 1 common line: check output

ok 11 - git diff HEAD with dirty submodule (work tree, refs match) [.gitmodules]

expecting success: 
	(
		cd sub &&
		git reset --hard &&
		echo >>world &&
		git add world
	) &&
	git diff HEAD >actual &&
	sed -e "1,/^@@/d" actual >actual.body &&
	expect_from_to >expect.body $subprev $subprev-dirty &&
	test_cmp expect.body actual.body

expecting success: 
		test 1 = 1
	
ok 7 - diff -U0 --inter-hunk-context=2, 1 common line: count hunks (1)

expecting success: 
		git diff -U0 --inter-hunk-context=2 f1 | grep -v '^index ' >actual &&
		test_cmp expected.f1.0.1 actual
	
HEAD is now at 2dd69d6 submodule #2
ok 16 - pickaxe (-S) operates on textconv data (add)
ok 8 - diff -U0 --inter-hunk-context=2, 1 common line: check output


expecting success: 
	echo two >expect &&
	git log --root --format=%s -S1 >actual &&
	test_cmp expect actual

expecting success: 
		test 1 = 1
	
ok 9 - diff -U1, 1 common line: count hunks (1)

ok 12 - git diff HEAD with dirty submodule (index, refs match)

expecting success: 
	(
		cd sub &&
		git reset --hard &&
		git clean -qfdx &&
		>cruft
	) &&
	git diff HEAD >actual &&
	sed -e "1,/^@@/d" actual >actual.body &&
	expect_from_to >expect.body $subprev $subprev-dirty &&
	test_cmp expect.body actual.body &&
	git diff --ignore-submodules=all HEAD >actual2 &&
	! test -s actual2 &&
	git diff --ignore-submodules=untracked HEAD >actual3 &&
	! test -s actual3 &&
	git diff --ignore-submodules=dirty HEAD >actual4 &&
	! test -s actual4

HEAD is now at 2dd69d6 submodule #2
ok 17 - pickaxe (-S) operates on textconv data (modification)

expecting success: 
		test 2 = 2
	
ok 10 - diff -U0, 2 common lines: count hunks (2)

expecting success: 
	echo file diff=fail >.gitattributes &&
	git diff --stat HEAD^ HEAD >actual &&
	test_i18ncmp expect.stat actual &&

	head -n1 <expect.stat >expect.line1 &&
	head -n1 <actual >actual.line1 &&
	test_cmp expect.line1 actual.line1

expecting success: 
		test 2 = 2
	
ok 11 - diff -U0 --inter-hunk-context=0, 2 common lines: count hunks (2)

expecting success: 
		test 2 = 2
	
ok 18 - diffstat does not run textconv

ok 12 - diff -U0 --inter-hunk-context=1, 2 common lines: count hunks (2)

expecting success: 
	rm -f file &&
	test_ln_s_add frotz file &&
	git commit -m typechange &&
	git show >diff &&
	find_diff <diff >actual &&
	test_cmp expect.typechange 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

)
expecting success: 
		test 1 = 1
	
ok 13 - diff -U0 --inter-hunk-context=2, 2 common lines: count hunks (1)

prerequisite SYMLINKS ok
expecting success: 
		test 1 = 1
	
ok 14 - diff -U1, 2 common lines: count hunks (1)

[master 89c1766] typechange
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rewrite file (100%)
 mode change 100644 => 120000
ok 13 - git diff HEAD with dirty submodule (untracked, refs match)

expecting success: 
	git config submodule.subname.ignore all &&
	git config submodule.subname.path sub &&
	git diff HEAD >actual2 &&
	! test -s actual2 &&
	git config submodule.subname.ignore untracked &&
	git diff HEAD >actual3 &&
	! test -s actual3 &&
	git config submodule.subname.ignore dirty &&
	git diff HEAD >actual4 &&
	! test -s actual4 &&
	git diff --ignore-submodules=none HEAD >actual &&
	sed -e "1,/^@@/d" actual >actual.body &&
	expect_from_to >expect.body $subprev $subprev-dirty &&
	test_cmp expect.body actual.body &&
	git config --remove-section submodule.subname

Saved working directory and index state WIP on master: 47d5e0e initial
expecting success: 
		test 2 = 2
	
ok 15 - diff -U1, 3 common lines: count hunks (2)

ok 19 - textconv does not act on symlinks

HEAD is now at 47d5e0e initial
expecting success: 
		test 2 = 2
	
# passed all 19 test(s)
1..19
ok 16 - diff -U1 --inter-hunk-context=0, 3 common lines: count hunks (2)

expecting success: 
		test 1 = 1
	
ok 17 - diff -U1 --inter-hunk-context=1, 3 common lines: count hunks (1)

expecting success: 
		test 1 = 1
	
ok 18 - diff -U1 --inter-hunk-context=2, 3 common lines: count hunks (1)

*** t4033-diff-patience.sh ***
ok 14 - git diff HEAD with dirty submodule (untracked, refs match) [.git/config]

expecting success: 
	git config --add -f .gitmodules submodule.subname.ignore all &&
	git config --add -f .gitmodules submodule.subname.path sub &&
	git diff HEAD >actual2 &&
	! test -s actual2 &&
	git config -f .gitmodules submodule.subname.ignore untracked &&
	git diff HEAD >actual3 &&
	! test -s actual3 &&
	git config -f .gitmodules submodule.subname.ignore dirty &&
	git diff HEAD >actual4 &&
	! test -s actual4 &&
	git config submodule.subname.ignore none &&
	git config submodule.subname.path sub &&
	git diff HEAD >actual &&
	sed -e "1,/^@@/d" actual >actual.body &&
	expect_from_to >expect.body $subprev $subprev-dirty &&
	test_cmp expect.body actual.body &&
	git config --remove-section submodule.subname &&
	git config --remove-section -f .gitmodules submodule.subname &&
	rm .gitmodules

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4033-diff-patience/.git/
expecting success: 
		test_must_fail git diff --no-index "--$STRATEGY" file1 file2 > output &&
		test_cmp expect output
	
fatal: A branch named 'master' already exists.
expecting success: 
		test 2 = 2
	
ok 19 - diff -U3, 9 common lines: count hunks (2)

ok 1 - patience diff

expecting success: 
		mv file2 expect &&
		git apply < output &&
		test_cmp expect file2
	
expecting success: 
		test 2 = 2
	
ok 20 - diff -U3 --inter-hunk-context=2, 9 common lines: count hunks (2)

baeaed7e0e8746d0ca3c109ae52a0a49cc2043d6
--
ok 51 - stash branch should not drop the stash if the branch exists

expecting success: 
	git stash clear &&
	echo 1 >subdir/subfile1 &&
	echo 2 >subdir/subfile2 &&
	git add subdir/subfile1 &&
	git commit -m subdir &&
	(
		cd subdir &&
		echo x >subfile1 &&
		echo x >../file &&
		git status >../expect &&
		git stash &&
		sane_unset GIT_MERGE_VERBOSITY &&
		git stash apply
	) |
	sed -e 1,2d >actual && # drop "Saved..." and "HEAD is now..."
	test_i18ncmp expect actual

expecting success: 
		test 1 = 1
	
ok 21 - diff -U3 --inter-hunk-context=3, 9 common lines: count hunks (1)

ok 2 - patience diff output is valid

# passed all 21 test(s)
1..21
expecting success: 
		test_must_fail git diff --no-index "--$STRATEGY" uniq1 uniq2 > output &&
		test_cmp expect output
	
ok 3 - completely different files

# passed all 3 test(s)
1..3
*** t4034-diff-words.sh ***
*** t4035-diff-quiet.sh ***
ok 15 - git diff HEAD with dirty submodule (untracked, refs match) [.gitmodules]

expecting success: 
	git diff HEAD^..HEAD >actual &&
	sed -e "1,/^@@/d" actual >actual.body &&
	expect_from_to >expect.body $subtip $subprev &&
	test_cmp expect.body actual.body &&
	git diff --ignore-submodules=dirty HEAD^..HEAD >actual &&
	sed -e "1,/^@@/d" actual >actual.body &&
	expect_from_to >expect.body $subtip $subprev &&
	test_cmp expect.body actual.body &&
	git diff --ignore-submodules HEAD^..HEAD >actual &&
	! test -s actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4034-diff-words/.git/
[master 307367e] subdir
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 subdir/subfile1
expecting success: 
	git config diff.color.old red &&
	git config diff.color.new green &&
	git config diff.color.func magenta

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4035-diff-quiet/.git/
expecting success: 
	echo 1 >a &&
	git add . &&
	git commit -m first &&
	echo 2 >b &&
	git add . &&
	git commit -a -m second &&
	mkdir -p test-outside/repo && (
		cd test-outside/repo &&
		git init &&
		echo "1 1" >a &&
		git add . &&
		git commit -m 1
	) &&
	mkdir -p test-outside/non/git && (
		cd test-outside/non/git &&
		echo "1 1" >a &&
		echo "1 1" >matching-file &&
		echo "1 1 " >trailing-space &&
		echo "1   1" >extra-space &&
		echo "2" >never-match
	)

ok 16 - git diff between submodule commits

expecting success: 
	git diff HEAD^..HEAD >actual &&
	sed -e "1,/^@@/d" actual >actual.body &&
	expect_from_to >expect.body $subtip $subprev &&
	test_cmp expect.body actual.body &&
	git config submodule.subname.ignore dirty &&
	git config submodule.subname.path sub &&
	git diff HEAD^..HEAD >actual &&
	sed -e "1,/^@@/d" actual >actual.body &&
	expect_from_to >expect.body $subtip $subprev &&
	test_cmp expect.body actual.body &&
	git config submodule.subname.ignore all &&
	git diff HEAD^..HEAD >actual &&
	! test -s actual &&
	git diff --ignore-submodules=dirty HEAD^..HEAD >actual &&
	sed -e "1,/^@@/d" actual >actual.body &&
	expect_from_to >expect.body $subtip $subprev &&
	git config --remove-section submodule.subname

ok 1 - setup

expecting success: 
	cp pre.simple pre &&
	cp post.simple post

ok 2 - set up pre and post with runs of whitespace

expecting success: 
	cat >expect <<-\EOF &&
		<BOLD>diff --git a/pre b/post<RESET>
		<BOLD>index 330b04f..5ed8eff 100644<RESET>
		<BOLD>--- a/pre<RESET>
		<BOLD>+++ b/post<RESET>
		<CYAN>@@ -1,3 +1,7 @@<RESET>
		<RED>h(4)<RESET><GREEN>h(4),hh[44]<RESET>

		a = b + c<RESET>

		<GREEN>aa = a<RESET>

		<GREEN>aeff = aeff * ( aaa )<RESET>
	EOF
	word_diff --color-words &&
	word_diff --word-diff=color &&
	word_diff --color --word-diff=color

[master (root-commit) 91030ca] first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a
[master db16475] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 b
ok 3 - word diff with runs of whitespace

expecting success: 
	sed s/#.*$// >expect <<-\EOF &&
		diff --git a/pre b/post
		index 330b04f..5ed8eff 100644
		--- a/pre
		+++ b/post
		@@ -1,3 +1,7 @@
		-h(4)
		+h(4),hh[44]
		~
		 # significant space
		~
		 a = b + c
		~
		~
		+aa = a
		~
		~
		+aeff = aeff * ( aaa )
		~
	EOF
	word_diff --word-diff=porcelain

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4035-diff-quiet/test-outside/repo/.git/
ok 4 - --word-diff=porcelain

expecting success: 
	cat >expect <<-\EOF &&
		diff --git a/pre b/post
		index 330b04f..5ed8eff 100644
		--- a/pre
		+++ b/post
		@@ -1,3 +1,7 @@
		[-h(4)-]{+h(4),hh[44]+}

		a = b + c

		{+aa = a+}

		{+aeff = aeff * ( aaa )+}
	EOF
	word_diff --word-diff=plain &&
	word_diff --word-diff=plain --no-color

[master (root-commit) 237b932] 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a
ok 17 - git diff between submodule commits [.git/config]

expecting success: 
	git diff HEAD^..HEAD >actual &&
	sed -e "1,/^@@/d" actual >actual.body &&
	expect_from_to >expect.body $subtip $subprev &&
	test_cmp expect.body actual.body &&
	git config --add -f .gitmodules submodule.subname.ignore dirty &&
	git config --add -f .gitmodules submodule.subname.path sub &&
	git diff HEAD^..HEAD >actual &&
	sed -e "1,/^@@/d" actual >actual.body &&
	expect_from_to >expect.body $subtip $subprev &&
	test_cmp expect.body actual.body &&
	git config -f .gitmodules submodule.subname.ignore all &&
	git diff HEAD^..HEAD >actual &&
	! test -s actual &&
	git config submodule.subname.ignore dirty &&
	git config submodule.subname.path sub &&
	git diff  HEAD^..HEAD >actual &&
	sed -e "1,/^@@/d" actual >actual.body &&
	expect_from_to >expect.body $subtip $subprev &&
	git config --remove-section submodule.subname &&
	git config --remove-section -f .gitmodules submodule.subname &&
	rm .gitmodules

ok 1 - setup

expecting success: 
	test_expect_code 1 git diff-tree --quiet HEAD^ HEAD >cnt &&
	test_line_count = 0 cnt

ok 5 - --word-diff=plain

expecting success: 
	cat >expect <<-\EOF &&
		<BOLD>diff --git a/pre b/post<RESET>
		<BOLD>index 330b04f..5ed8eff 100644<RESET>
		<BOLD>--- a/pre<RESET>
		<BOLD>+++ b/post<RESET>
		<CYAN>@@ -1,3 +1,7 @@<RESET>
		<RED>[-h(4)-]<RESET><GREEN>{+h(4),hh[44]+}<RESET>

		a = b + c<RESET>

		<GREEN>{+aa = a+}<RESET>

		<GREEN>{+aeff = aeff * ( aaa )+}<RESET>
	EOF
	word_diff --word-diff=plain --color

ok 2 - git diff-tree HEAD^ HEAD

expecting success: 
	test_expect_code 0 git diff-tree --quiet HEAD^ HEAD -- a >cnt &&
	test_line_count = 0 cnt

ok 6 - --word-diff=plain --color
ok 3 - git diff-tree HEAD^ HEAD -- a


expecting success: 
	test_expect_code 1 git diff-tree --quiet HEAD^ HEAD -- b >cnt &&
	test_line_count = 0 cnt

expecting success: 
	cat >expect <<-\EOF &&
		<BOLD>diff --git a/pre b/post<RESET>
		<BOLD>index 330b04f..5ed8eff 100644<RESET>
		<BOLD>--- a/pre<RESET>
		<BOLD>+++ b/post<RESET>
		<CYAN>@@ -1 +1 @@<RESET>
		<RED>h(4)<RESET><GREEN>h(4),hh[44]<RESET>
		<CYAN>@@ -3,0 +4,4 @@<RESET> <RESET><MAGENTA>a = b + c<RESET>

		<GREEN>aa = a<RESET>

		<GREEN>aeff = aeff * ( aaa )<RESET>
	EOF
	word_diff --color-words --unified=0

ok 4 - git diff-tree HEAD^ HEAD -- b

expecting success: 
	echo $(git rev-parse HEAD) |
	test_expect_code 1 git diff-tree --quiet --stdin >cnt &&
	test_line_count = 1 cnt

ok 7 - word diff without context

expecting success: 
	cp expect.letter-runs-are-words expect &&
	word_diff --color-words="[a-z]+"

ok 5 - echo HEAD | git diff-tree --stdin

expecting success: 
	test_expect_code 0 git diff-tree --quiet HEAD HEAD >cnt &&
	test_line_count = 0 cnt

ok 8 - word diff with a regular expression

expecting success: 
	git config diff.testdriver.wordRegex "[^[:space:]]" &&
	cat <<-\EOF >.gitattributes
		pre diff=testdriver
		post diff=testdriver
	EOF

ok 9 - set up a diff driver

expecting success: 
	cp expect.letter-runs-are-words expect &&
	word_diff --color-words="[a-z]+"

ok 6 - git diff-tree HEAD HEAD

expecting success: 
	test_expect_code 0 git diff-files --quiet >cnt &&
	test_line_count = 0 cnt

ok 7 - git diff-files

expecting success: 
	test_expect_code 0 git diff-index --quiet --cached HEAD >cnt &&
	test_line_count = 0 cnt

ok 10 - option overrides .gitattributes

expecting success: 
	cp expect.non-whitespace-is-word expect &&
	word_diff --color-words

ok 8 - git diff-index --cached HEAD

expecting success: 
	test_expect_code 1 git diff-index --quiet --cached HEAD^ >cnt &&
	test_line_count = 0 cnt

ok 18 - git diff between submodule commits [.gitmodules]

expecting success: 
	: >empty &&
	rm -rf sub/* sub/.git &&
	git diff > actual.empty &&
	test_cmp empty actual.empty

ok 11 - use regex supplied by driver

expecting success: 
	git config diff.wordRegex "[[:alnum:]]+"

ok 9 - git diff-index --cached HEAD^

expecting success: 
	echo text >>b &&
	echo 3 >c &&
	git add . &&
	test_expect_code 1 git diff-index --quiet --cached HEAD^ >cnt &&
	test_line_count = 0 cnt

ok 12 - set up diff.wordRegex option

expecting success: 
	cp expect.letter-runs-are-words expect &&
	word_diff --color-words="[a-z]+"

ok 19 - git diff (empty submodule dir)

expecting success: 

	# 39 efs
	c=fffffffffffffffffffffffffffffffffffffff &&
	(
		echo "000000 $_z40 0	sub" &&
		echo "160000 1$c 1	sub" &&
		echo "160000 2$c 2	sub" &&
		echo "160000 3$c 3	sub"
	) | git update-index --index-info &&
	echo >expect.nosub 'diff --cc sub
index 2ffffff,3ffffff..0000000
--- a/sub
+++ b/sub
@@@ -1,1 -1,1 +1,1 @@@
- Subproject commit 2fffffffffffffffffffffffffffffffffffffff
 -Subproject commit 3fffffffffffffffffffffffffffffffffffffff
++Subproject commit 0000000000000000000000000000000000000000' &&

	hh=$(git rev-parse HEAD) &&
	sed -e "s/$_z40/$hh/" expect.nosub >expect.withsub


ok 13 - command-line overrides config

expecting success: 
	cat >expect <<-\EOF &&
		<BOLD>diff --git a/pre b/post<RESET>
		<BOLD>index 330b04f..5ed8eff 100644<RESET>
		<BOLD>--- a/pre<RESET>
		<BOLD>+++ b/post<RESET>
		<CYAN>@@ -1,3 +1,7 @@<RESET>
		h(4),<GREEN>{+hh+}<RESET>[44]

		a = b + c<RESET>

		<GREEN>{+aa = a+}<RESET>

		<GREEN>{+aeff = aeff * ( aaa+}<RESET> )
	EOF
	word_diff --color --word-diff-regex="[a-z]+"

ok 10 - git diff-index --cached HEAD^

expecting success: 
	git commit -m "text in b" &&
	test_expect_code 1 git diff-tree --quiet -Stext HEAD^ HEAD -- b >cnt &&
	test_line_count = 0 cnt

ok 20 - conflicted submodule setup

expecting success: 
	rm -fr sub && mkdir sub &&
	git diff >actual &&
	test_cmp expect.nosub actual

ok 14 - command-line overrides config: --word-diff-regex

expecting success: 
	cp expect.non-whitespace-is-word expect &&
	word_diff --color-words

[master 3bb5297] text in b
 Author: A U Thor <author@example.com>
 9 files changed, 8 insertions(+)
 create mode 100644 c
 create mode 100644 cnt
 create mode 100644 test-outside/non/git/a
 create mode 100644 test-outside/non/git/extra-space
 create mode 100644 test-outside/non/git/matching-file
 create mode 100644 test-outside/non/git/never-match
 create mode 100644 test-outside/non/git/trailing-space
 create mode 160000 test-outside/repo
ok 21 - combined (empty submodule)

expecting success: 
	rm -fr sub &&
	git clone --no-checkout . sub &&
	git diff >actual &&
	test_cmp expect.withsub actual

ok 15 - .gitattributes override config

expecting success: 
	test_unconfig diff.testdriver.wordRegex

ok 11 - git diff-tree -Stext HEAD^ HEAD -- b

expecting success: 
	test_expect_code 0 git diff-tree --quiet -Snot-found HEAD^ HEAD -- b >cnt &&
	test_line_count = 0 cnt

ok 16 - setup: remove diff driver regex

expecting success: 
	cat >expect <<-\EOF &&
		<BOLD>diff --git a/pre b/post<RESET>
		<BOLD>index 330b04f..5ed8eff 100644<RESET>
		<BOLD>--- a/pre<RESET>
		<BOLD>+++ b/post<RESET>
		<CYAN>@@ -1,3 +1,7 @@<RESET>
		h(4),<GREEN>hh[44<RESET>]

		a = b + c<RESET>

		<GREEN>aa = a<RESET>

		<GREEN>aeff = aeff * ( aaa<RESET> )
	EOF
	word_diff --color-words

Cloning into 'sub'...
ok 12 - git diff-tree -Snot-found HEAD^ HEAD -- b

expecting success: 
	echo 3 >>c &&
	test_expect_code 1 git diff-files --quiet >cnt &&
	test_line_count = 0 cnt

ok 13 - git diff-files

expecting success: 
	git update-index c &&
	test_expect_code 1 git diff-index --quiet --cached HEAD >cnt &&
	test_line_count = 0 cnt

ok 17 - use configured regex

expecting success: 
	echo "aaa (aaa)" >pre &&
	echo "aaa (aaa) aaa" >post &&
	cat >expect <<-\EOF &&
		<BOLD>diff --git a/pre b/post<RESET>
		<BOLD>index c29453b..be22f37 100644<RESET>
		<BOLD>--- a/pre<RESET>
		<BOLD>+++ b/post<RESET>
		<CYAN>@@ -1 +1 @@<RESET>
		aaa (aaa) <GREEN>aaa<RESET>
	EOF
	word_diff --color-words="a+"

done.
ok 18 - test parsing words for newline

expecting success: 
	echo "(:" >pre &&
	echo "(" >post &&
	cat >expect <<-\EOF &&
		<BOLD>diff --git a/pre b/post<RESET>
		<BOLD>index 289cb9d..2d06f37 100644<RESET>
		<BOLD>--- a/pre<RESET>
		<BOLD>+++ b/post<RESET>
		<CYAN>@@ -1 +1 @@<RESET>
		(<RED>:<RESET>
	EOF
	word_diff --color-words=.

ok 14 - git diff-index --cached HEAD

expecting success: 
	(
		cd test-outside/repo &&
		test_expect_code 0 git diff --quiet a ../non/git/matching-file &&
		test_expect_code 1 git diff --quiet a ../non/git/extra-space
	)

ok 22 - combined (with submodule)

ok 52 - stash apply shows status same as git status (relative to current directory)

expecting success: 
	git stash clear &&
	git reset --hard &&
	echo file-not-a-ref > HEAD &&
	git add HEAD &&
	test_tick &&
	git stash &&
	git diff-files --quiet &&
	git diff-index --cached --quiet HEAD &&
	test "$(git rev-parse stash^)" = "$(git rev-parse HEAD)" &&
	git diff stash^..stash > output &&
	test_cmp output expect

# passed all 22 test(s)
1..22
ok 15 - git diff, one file outside repo

expecting success: 
	(
		GIT_CEILING_DIRECTORIES="$TRASH_DIRECTORY/test-outside" &&
		export GIT_CEILING_DIRECTORIES &&
		cd test-outside/non/git &&
		test_expect_code 0 git diff --quiet a matching-file &&
		test_expect_code 1 git diff --quiet a extra-space
	)

ok 19 - test when words are only removed at the end

expecting success: 
	echo "(:" >pre &&
	echo "(" >post &&
	cat >expect <<-\EOF &&
		diff --git a/pre b/post
		index 289cb9d..2d06f37 100644
		--- a/pre
		+++ b/post
		@@ -1 +1 @@
		-(:
		+(
	EOF
	word_diff --word-diff=plain --word-diff=none

ok 16 - git diff, both files outside repo

expecting success: 
	(
		cd test-outside/repo &&
		test_expect_code 0 git diff --quiet --ignore-space-at-eol a ../non/git/trailing-space &&
		test_expect_code 1 git diff --quiet --ignore-space-at-eol a ../non/git/extra-space
	)

ok 20 - --word-diff=none

expecting success: 
	test_unconfig diff.wordregex

*** t4036-format-patch-signer-mime.sh ***
ok 21 - unset default driver

expecting success: 
		cp "$TEST_DIRECTORY/t4034/ada/pre" \
			"$TEST_DIRECTORY/t4034/ada/post" \
			"$TEST_DIRECTORY/t4034/ada/expect" . &&
		echo "* diff=ada" >.gitattributes &&
		word_diff --color-words
	
ok 17 - git diff --ignore-space-at-eol, one file outside repo

expecting success: 
	(
		GIT_CEILING_DIRECTORIES="$TRASH_DIRECTORY/test-outside" &&
		export GIT_CEILING_DIRECTORIES &&
		cd test-outside/non/git &&
		test_expect_code 0 git diff --quiet --ignore-space-at-eol a trailing-space &&
		test_expect_code 1 git diff --quiet --ignore-space-at-eol a extra-space
	)

ok 18 - git diff --ignore-space-at-eol, both files outside repo

expecting success: 
	(
		cd test-outside/repo &&
		test_expect_code 0 git diff --quiet --ignore-all-space a ../non/git/trailing-space &&
		test_expect_code 0 git diff --quiet --ignore-all-space a ../non/git/extra-space &&
		test_expect_code 1 git diff --quiet --ignore-all-space a ../non/git/never-match
	)

ok 22 - diff driver 'ada'

expecting success: 
		cp "$TEST_DIRECTORY/t4034/bibtex/pre" \
			"$TEST_DIRECTORY/t4034/bibtex/post" \
			"$TEST_DIRECTORY/t4034/bibtex/expect" . &&
		echo "* diff=bibtex" >.gitattributes &&
		word_diff --color-words
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4036-format-patch-signer-mime/.git/
HEAD is now at 307367e subdir
ok 23 - diff driver 'bibtex'

expecting success: 
		cp "$TEST_DIRECTORY/t4034/cpp/pre" \
			"$TEST_DIRECTORY/t4034/cpp/post" \
			"$TEST_DIRECTORY/t4034/cpp/expect" . &&
		echo "* diff=cpp" >.gitattributes &&
		word_diff --color-words
	
expecting success: 

	>F &&
	git add F &&
	git commit -m initial &&
	echo new line >F &&

	test_tick &&
	git commit -m "This adds some lines to F" F


ok 19 - git diff --ignore-all-space, one file outside repo

expecting success: 
	(
		GIT_CEILING_DIRECTORIES="$TRASH_DIRECTORY/test-outside" &&
		export GIT_CEILING_DIRECTORIES &&
		cd test-outside/non/git &&
		test_expect_code 0 git diff --quiet --ignore-all-space a trailing-space &&
		test_expect_code 0 git diff --quiet --ignore-all-space a extra-space &&
		test_expect_code 1 git diff --quiet --ignore-all-space a never-match
	)

ok 24 - diff driver 'cpp'

expecting success: 
		cp "$TEST_DIRECTORY/t4034/csharp/pre" \
			"$TEST_DIRECTORY/t4034/csharp/post" \
			"$TEST_DIRECTORY/t4034/csharp/expect" . &&
		echo "* diff=csharp" >.gitattributes &&
		word_diff --color-words
	
[master (root-commit) c7dd3a8] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 F
ok 20 - git diff --ignore-all-space, both files outside repo

expecting success: 
	test-chmtime +10 a &&
	echo modified >>b &&
	test_expect_code 1 git diff --quiet

[master c3d100a] This adds some lines to F
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 1 - setup

expecting success: 

	git format-patch --stdout -1 >output &&
	! grep Content-Type output


ok 21 - git diff --quiet ignores stat-change only entries

ok 25 - diff driver 'csharp'

expecting success: 
		cp "$TEST_DIRECTORY/t4034/fortran/pre" \
			"$TEST_DIRECTORY/t4034/fortran/post" \
			"$TEST_DIRECTORY/t4034/fortran/expect" . &&
		echo "* diff=fortran" >.gitattributes &&
		word_diff --color-words
	
# passed all 21 test(s)
1..21
ok 2 - format normally

expecting success: 

	git format-patch -s --stdout -1 >output &&
	! grep Content-Type output


ok 3 - format with signoff without funny signer name

expecting success: 

	GIT_COMMITTER_NAME="はまの ふにおう" \
	git format-patch -s --stdout -1 >output &&
	grep Content-Type output


ok 26 - diff driver 'fortran'

expecting success: 
		cp "$TEST_DIRECTORY/t4034/html/pre" \
			"$TEST_DIRECTORY/t4034/html/post" \
			"$TEST_DIRECTORY/t4034/html/expect" . &&
		echo "* diff=html" >.gitattributes &&
		word_diff --color-words
	
*** t4037-diff-r-t-dirs.sh ***
Content-Type: text/plain; charset=UTF-8
ok 4 - format with non ASCII signer name

expecting success: 

	GIT_COMMITTER_NAME="はまの ふにおう" \
	git format-patch -s --stdout -1 --attach >output &&
	test $(grep -ci ^MIME-Version: output) = 1


ok 27 - diff driver 'html'

expecting success: 
		cp "$TEST_DIRECTORY/t4034/java/pre" \
			"$TEST_DIRECTORY/t4034/java/post" \
			"$TEST_DIRECTORY/t4034/java/expect" . &&
		echo "* diff=java" >.gitattributes &&
		word_diff --color-words
	
ok 5 - attach and signoff do not duplicate mime headers

# passed all 5 test(s)
1..5
ok 28 - diff driver 'java'

expecting success: 
		cp "$TEST_DIRECTORY/t4034/matlab/pre" \
			"$TEST_DIRECTORY/t4034/matlab/post" \
			"$TEST_DIRECTORY/t4034/matlab/expect" . &&
		echo "* diff=matlab" >.gitattributes &&
		word_diff --color-words
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4037-diff-r-t-dirs/.git/
*** t4038-diff-combined.sh ***
expecting success: 
	mkdir dc dr dt &&
	>dc/1 &&
	>dr/2 &&
	>dt/3 &&
	>fc &&
	>fr &&
	>ft &&
	git add . &&
	test_tick &&
	git commit -m initial &&

	rm -fr dt dr ft fr &&
	mkdir da ft &&
	for p in dc/1 da/4 dt ft/5 fc
	do
		echo hello >$p || exit
	done &&
	git add -u &&
	git add . &&
	test_tick &&
	git commit -m second

ok 29 - diff driver 'matlab'

expecting success: 
		cp "$TEST_DIRECTORY/t4034/objc/pre" \
			"$TEST_DIRECTORY/t4034/objc/post" \
			"$TEST_DIRECTORY/t4034/objc/expect" . &&
		echo "* diff=objc" >.gitattributes &&
		word_diff --color-words
	
ok 30 - diff driver 'objc'

expecting success: 
		cp "$TEST_DIRECTORY/t4034/pascal/pre" \
			"$TEST_DIRECTORY/t4034/pascal/post" \
			"$TEST_DIRECTORY/t4034/pascal/expect" . &&
		echo "* diff=pascal" >.gitattributes &&
		word_diff --color-words
	
[master (root-commit) 26fc746] initial
 Author: A U Thor <author@example.com>
 6 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 dc/1
 create mode 100644 dr/2
 create mode 100644 dt/3
 create mode 100644 fc
 create mode 100644 fr
 create mode 100644 ft
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4038-diff-combined/.git/
Saved working directory and index state WIP on master: 307367e subdir
expecting success: 
	>file &&
	git add file &&
	test_tick &&
	git commit -m initial &&

	git branch withone &&
	git branch sansone &&

	git checkout withone &&
	setup_helper one withone sidewithone &&

	git checkout sansone &&
	setup_helper "" sansone sidesansone

ok 31 - diff driver 'pascal'

expecting success: 
		cp "$TEST_DIRECTORY/t4034/perl/pre" \
			"$TEST_DIRECTORY/t4034/perl/post" \
			"$TEST_DIRECTORY/t4034/perl/expect" . &&
		echo "* diff=perl" >.gitattributes &&
		word_diff --color-words
	
HEAD is now at 307367e subdir
ok 32 - diff driver 'perl'

expecting success: 
		cp "$TEST_DIRECTORY/t4034/php/pre" \
			"$TEST_DIRECTORY/t4034/php/post" \
			"$TEST_DIRECTORY/t4034/php/expect" . &&
		echo "* diff=php" >.gitattributes &&
		word_diff --color-words
	
[master (root-commit) 1bd44cb] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file
[master 25e238e] second
 Author: A U Thor <author@example.com>
 9 files changed, 5 insertions(+)
 create mode 100644 da/4
 delete mode 100644 dr/2
 create mode 100644 dt
 delete mode 100644 dt/3
 delete mode 100644 fr
 delete mode 100644 ft
 create mode 100644 ft/5
ok 1 - setup

expecting success: 
	git diff-tree -r -t --name-status HEAD^ HEAD >actual &&
	test_cmp expect actual

ok 33 - diff driver 'php'

expecting success: 
		cp "$TEST_DIRECTORY/t4034/python/pre" \
			"$TEST_DIRECTORY/t4034/python/post" \
			"$TEST_DIRECTORY/t4034/python/expect" . &&
		echo "* diff=python" >.gitattributes &&
		word_diff --color-words
	
ok 53 - stash where working directory contains "HEAD" file

expecting success: 
	test_must_fail git stash store foo

Switched to branch 'withone'
ok 2 - verify

# passed all 2 test(s)
1..2
ok 34 - diff driver 'python'

expecting success: 
		cp "$TEST_DIRECTORY/t4034/ruby/pre" \
			"$TEST_DIRECTORY/t4034/ruby/post" \
			"$TEST_DIRECTORY/t4034/ruby/expect" . &&
		echo "* diff=ruby" >.gitattributes &&
		word_diff --color-words
	
[withone 61ad3a5] withone
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+)
*** t4039-diff-assume-unchanged.sh ***
ok 35 - diff driver 'ruby'

expecting success: 
		cp "$TEST_DIRECTORY/t4034/tex/pre" \
			"$TEST_DIRECTORY/t4034/tex/post" \
			"$TEST_DIRECTORY/t4034/tex/expect" . &&
		echo "* diff=tex" >.gitattributes &&
		word_diff --color-words
	
Switched to branch 'sidewithone'
fatal: foo: not a valid SHA1
ok 36 - diff driver 'tex'

expecting success: 
	cat >expect <<-\EOF &&
	diff --git a/pre b/post
	index a1a53b5..bc8fe6d 100644
	--- a/pre
	+++ b/post
	@@ -1,3 +1,3 @@
	a

	[-b-]{+c+}
	EOF
	cat >pre <<-\EOF &&
	a

	b
	EOF
	cat >post <<-\EOF &&
	a

	c
	EOF
	test_config diff.suppress-blank-empty true &&
	word_diff --word-diff=plain

Cannot update refs/stash with foo
ok 54 - store called with invalid commit

expecting success: 
	git stash clear &&
	git reset --hard &&
	echo quux >bazzy &&
	git add bazzy &&
	STASH_ID=$(git stash create) &&
	git reset --hard &&
	! grep quux bazzy &&
	git stash store -m quuxery $STASH_ID &&
	test $(cat .git/refs/stash) = $STASH_ID &&
	git reflog --format=%H stash| grep $STASH_ID &&
	git stash pop &&
	grep quux bazzy

[sidewithone 04e7a65] sidewithone
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4039-diff-assume-unchanged/.git/
Merging:
04e7a65 sidewithone
virtual withone
found 1 common ancestor:
1bd44cb initial
Auto-merging file
CONFLICT (content): Merge conflict in file
Automatic merge failed; fix conflicts and then commit the result.
expecting success: 
	echo zero > zero &&
	git add zero &&
	git commit -m zero &&
	echo one > one &&
	echo two > two &&
	git add one two &&
	git commit -m onetwo &&
	git update-index --assume-unchanged one &&
	echo borked >> one &&
	test "$(git ls-files -v one)" = "h one"

ok 37 - word-diff with diff.sbe

expecting success: 
	cat >expect <<-\EOF &&
	diff --git a/pre b/post
	index 7bf316e..3dd0303 100644
	--- a/pre
	+++ b/post
	@@ -1 +1 @@
	a a [-a-]{+ab+} a a
	EOF
	printf "%s" "a a a a a" >pre &&
	printf "%s" "a a ab a a" >post &&
	word_diff --word-diff=plain

[sidewithone 70465e9] merge withone into sidewithone
 Author: A U Thor <author@example.com>
[master (root-commit) 611a2fd] zero
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 zero
ok 38 - word-diff with no newline at EOF

expecting success: 
	echo "a b; c" >a.tex &&
	echo "a b; c" >z.txt &&
Switched to branch 'sansone'
	git add a.tex z.txt &&
	git commit -minitial &&

	# modify both
	echo "a bx; c" >a.tex &&
	echo "a bx; c" >z.txt &&
	git commit -mmodified -a

[master (root-commit) 7aa1298] initial
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 a.tex
 create mode 100644 z.txt
[master e134be2] onetwo
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 one
 create mode 100644 two
[sansone e4cdba2] sansone
 Author: A U Thor <author@example.com>
 1 file changed, 3 insertions(+)
HEAD is now at 307367e subdir
ok 1 - setup

expecting success: 
	git diff-index HEAD^ -- one | grep -q 5626abf0f72e58d7a153368ba57db4c673c0e171

Switched to branch 'sidesansone'
[master 913be25] modified
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 2 deletions(-)
ok 39 - setup history with two files

expecting success: 
	echo "*.tex diff=tex" >.gitattributes &&
	test_config diff.tex.wordRegex "[a-z]+|." &&
	cat >expect <<-\EOF &&
		diff --git a/a.tex b/a.tex
		--- a/a.tex
		+++ b/a.tex
		@@ -1 +1 @@
		a [-b-]{+bx+}; c
		diff --git a/z.txt b/z.txt
		--- a/z.txt
		+++ b/z.txt
		@@ -1 +1 @@
		a [-b;-]{+bx;+} c
	EOF
	git diff --word-diff HEAD~ >actual &&
	compare_diff_patch expect actual

ok 2 - diff-index does not examine assume-unchanged entries

expecting success: 
	rm one &&
	test -z "$(git diff-files -- one)"

ok 3 - diff-files does not examine assume-unchanged entries

expecting success: 
	echo content >exec &&
	chmod +x exec &&
	git add exec &&
	git commit -m exec &&
	git update-index --assume-unchanged exec &&
	>expect &&
	git diff-files --find-copies-harder -- exec >actual &&
	test_cmp expect actual

[sidesansone d31bb1b] sidesansone
 Author: A U Thor <author@example.com>
 1 file changed, 3 insertions(+)
Merging:
d31bb1b sidesansone
virtual sansone
found 1 common ancestor:
1bd44cb initial
Auto-merging file
CONFLICT (content): Merge conflict in file
Automatic merge failed; fix conflicts and then commit the result.
ok 40 - wordRegex for the first file does not apply to the second

[master 1f9d5c2] exec
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100755 exec
# passed all 40 test(s)
1..40
ok 4 - find-copies-harder is not confused by mode bits

[sidesansone a02eb57] merge sansone into sidesansone
 Author: A U Thor <author@example.com>
ok 1 - setup

expecting success: 
	git show sidewithone -- >sidewithone &&
	verify_helper sidewithone

# passed all 4 test(s)
1..4
*** t4040-whitespace-status.sh ***
*** t4041-diff-submodule-option.sh ***
ok 2 - check combined output (1)

expecting success: 
	git show sidesansone -- >sidesansone &&
	verify_helper sidesansone

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4040-whitespace-status/.git/
expecting success: 
	mkdir a b &&
	echo >c &&
	echo >a/d &&
	echo >b/e &&
	git add . &&
	test_tick &&
	git commit -m initial &&
	echo " " >a/d &&
	test_tick &&
	git commit -a -m second &&
	echo "  " >a/d &&
	echo " " >b/e &&
	git add a/d

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4041-diff-submodule-option/.git/
HEAD is now at 307367e subdir
grep: bazzy: No such file or directory
[master (root-commit) b80f2e3] initial
 Author: A U Thor <author@example.com>
 3 files changed, 3 insertions(+)
 create mode 100644 a/d
 create mode 100644 b/e
 create mode 100644 c
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4041-diff-submodule-option/sm1/.git/
ok 3 - check combined output (2)

expecting success: 
	>file &&
	git add file &&
	git commit --amend -C HEAD &&
	git show >out &&
	grep "diff --cc file" out

[master 13a0478] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[sidesansone 3fd518e] merge sansone into sidesansone
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:19:13 2005 -0700
ok 1 - setup

expecting success: 
	test_must_fail git diff --exit-code HEAD^ HEAD &&
	test_must_fail git diff-tree --exit-code HEAD^ HEAD

diff --cc file
ok 4 - diagnose truncated file

expecting success: 
	blob=$(echo file | git hash-object --stdin -w) &&
	base_tree=$(echo "100644 blob $blob	file" | git mktree) &&
	trees= &&
	for i in $(test_seq 1 40)
	do
		blob=$(echo file$i | git hash-object --stdin -w) &&
		trees="$trees$(echo "100644 blob $blob	file" | git mktree)$LF"
	done

diff --git a/a/d b/a/d
index 8b13789..8d1c8b6 100644
--- a/a/d
+++ b/a/d
@@ -1 +1 @@
-
+ 
:040000 040000 13061aad4970f02b314943ec46981e9ef332cae2 ac592974c686387705f2617b895d6585cc0a0d46 M	a
ok 2 - diff-tree --exit-code

expecting success: 
	git diff -b --exit-code HEAD^ HEAD &&
	git diff-tree -b -p --exit-code HEAD^ HEAD &&
	git diff-tree -b --exit-code HEAD^ HEAD

f7a049d0b388a9dc92adada4e0f83e8fc9497671
:040000 040000 13061aad4970f02b314943ec46981e9ef332cae2 ac592974c686387705f2617b895d6585cc0a0d46 M	a
ok 3 - diff-tree -b --exit-code

expecting success: 
	test_must_fail git diff --cached --exit-code HEAD &&
	test_must_fail git diff-index --cached --exit-code HEAD

diff --git a/a/d b/a/d
index 8d1c8b6..1a4baf5 100644
--- a/a/d
+++ b/a/d
@@ -1 +1 @@
- 
+  
:100644 100644 8d1c8b69c3fce7bea45c73efd06983e3c419a92f 1a4baf536d705b9c814847cb7a708a0e63d5b976 M	a/d
expecting success: 
	git add sm1 &&
	git diff-index -p --submodule=log HEAD >actual &&
	cat >expected <<-EOF &&
	Submodule sm1 0000000...$head1 (new submodule)
	EOF
	test_cmp expected actual

ok 4 - diff-index --cached --exit-code

expecting success: 
	git diff -b --cached --exit-code HEAD &&
	git diff-index -b -p --cached --exit-code HEAD

ok 5 - diff-index -b -p --cached --exit-code

expecting success: 
	test_must_fail git diff --exit-code HEAD &&
	test_must_fail git diff-index --exit-code HEAD

ok 1 - added submodule

diff --git a/a/d b/a/d
index 8d1c8b6..1a4baf5 100644
--- a/a/d
+++ b/a/d
@@ -1 +1 @@
- 
+  
diff --git a/b/e b/b/e
index 8b13789..8d1c8b6 100644
--- a/b/e
+++ b/b/e
@@ -1 +1 @@
-
+ 
expecting success: 
	git config diff.submodule log &&
	git add sm1 &&
	git diff --cached >actual &&
	cat >expected <<-EOF &&
	Submodule sm1 0000000...$head1 (new submodule)
	EOF
	git config --unset diff.submodule &&
	test_cmp expected actual

:100644 100644 8d1c8b69c3fce7bea45c73efd06983e3c419a92f 1a4baf536d705b9c814847cb7a708a0e63d5b976 M	a/d
:100644 100644 8b137891791fe96927ad78e64b0aad7bded08bdc 0000000000000000000000000000000000000000 M	b/e
ok 6 - diff-index --exit-code

expecting success: 
	git diff -b --exit-code HEAD &&
	git diff-index -b -p --exit-code HEAD

ok 7 - diff-index -b -p --exit-code

expecting success: 
	test_must_fail git diff --exit-code &&
	test_must_fail git diff-files --exit-code

diff --git a/b/e b/b/e
index 8b13789..8d1c8b6 100644
--- a/b/e
+++ b/b/e
@@ -1 +1 @@
-
+ 
:100644 100644 8b137891791fe96927ad78e64b0aad7bded08bdc 0000000000000000000000000000000000000000 M	b/e
ok 8 - diff-files --exit-code

expecting success: 
	git diff -b --exit-code &&
	git diff-files -b -p --exit-code

ok 2 - added submodule, set diff.submodule

expecting success: 
	test_config diff.submodule log &&
	git add sm1 &&
	git diff --submodule=short --cached >actual &&
	cat >expected <<-EOF &&
	diff --git a/sm1 b/sm1
	new file mode 160000
	index 0000000..$head1
	--- /dev/null
	+++ b/sm1
	@@ -0,0 +1 @@
	+Subproject commit $fullhead1
	EOF
	test_cmp expected actual

ok 9 - diff-files -b -p --exit-code

expecting success: 
	git reset --hard &&
	rm a/d &&
	echo x >>b/e &&
	test_must_fail git diff-files --diff-filter=M --quiet

Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual 13419d0b4f5b097f61dde4c911de99a154f8286f
HEAD is now at 13a0478 second
ok 10 - diff-files --diff-filter --quiet

expecting success: 
	git commit -a -m "worktree state" &&
	test_must_fail git diff-tree --diff-filter=M --quiet HEAD^ HEAD

On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	new file:   bazzy

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	actual
	expect
	expect1
	expect2
	expected
	output
	output.out
	stashlist1
	stashlist2
	subdir/subfile2

ok 3 - --submodule=short overrides diff.submodule

expecting success: 
	test_config diff.submodule log &&
	git diff-index -p HEAD >actual &&
	cat >expected <<-EOF &&
	diff --git a/sm1 b/sm1
	new file mode 160000
	index 0000000..$head1
	--- /dev/null
	+++ b/sm1
	@@ -0,0 +1 @@
	+Subproject commit $fullhead1
	EOF
	test_cmp expected actual

[master c0a31dc] worktree state
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 1 deletion(-)
 delete mode 100644 a/d
Dropped refs/stash@{0} (f7a049d0b388a9dc92adada4e0f83e8fc9497671)
ok 11 - diff-tree --diff-filter --quiet

# passed all 11 test(s)
1..11
quux
ok 55 - store updates stash ref and reflog

expecting success: 
	git stash clear &&
	echo pig >file &&
	git stash &&
	stamp=$(git log -g --format="%cd" -1 refs/stash) &&
	test_tick &&
	echo cow >file &&
	git stash &&
	git stash apply "stash@{$stamp}" &&
	grep pig file

ok 4 - diff.submodule does not affect plumbing

*** t4042-diff-textconv-caching.sh ***
expecting success: 
	git diff-index -p --submodule=log HEAD >actual &&
	cat >expected <<-EOF &&
	Submodule sm1 $head1..$head2:
	  > Add foo3 ($added foo3)
	EOF
	test_cmp expected actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4042-diff-textconv-caching/.git/
expecting success: 
	echo foo content 1 >foo.bin &&
	echo bar content 1 >bar.bin &&
	git add . &&
	git commit -m one &&
	echo foo content 2 >foo.bin &&
	echo bar content 2 >bar.bin &&
	git commit -a -m two &&
	echo "*.bin diff=magic" >.gitattributes &&
	git config diff.magic.textconv ./helper &&
	git config diff.magic.cachetextconv true

ok 5 - modified submodule(forward)

expecting success: 
	git diff --submodule=log >actual &&
	cat >expected <<-EOF &&
	Submodule sm1 $head1..$head2:
	  > Add foo3 ($added foo3)
	EOF
	test_cmp expected actual

[master (root-commit) be80702] one
 Author: A U Thor <author@example.com>
 3 files changed, 5 insertions(+)
 create mode 100644 bar.bin
 create mode 100644 foo.bin
 create mode 100755 helper
ok 6 - modified submodule(forward)

expecting success: 
	git diff --submodule >actual &&
	cat >expected <<-EOF &&
	Submodule sm1 $head1..$head2:
	  > Add foo3 ($added foo3)
	EOF
	test_cmp expected actual

[master 9ee9421] two
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 2 deletions(-)
ok 1 - setup

expecting success: 
	git diff HEAD^ HEAD >actual &&
	test_cmp expect actual

ok 7 - modified submodule(forward) --submodule

expecting success: 
	git diff --submodule=short >actual &&
	cat >expected <<-EOF &&
	diff --git a/sm1 b/sm1
	index $head1..$head2 160000
	--- a/sm1
	+++ b/sm1
	@@ -1 +1 @@
	-Subproject commit $fullhead1
	+Subproject commit $fullhead2
	EOF
	test_cmp expected actual

ok 8 - modified submodule(forward) --submodule=short

expecting success: 
	git diff-index -p --submodule=log HEAD >actual &&
	cat >expected <<-EOF &&
	Submodule sm1 $head2..$head3 (rewind):
	  < Add foo3 ($added foo3)
	  < Add foo2 ($added foo2)
	EOF
	test_cmp expected actual

ok 9 - modified submodule(backward)

ok 2 - first textconv works

expecting success: 
	git diff HEAD^ HEAD >actual &&
	test_cmp expect actual

Saved working directory and index state WIP on master: 307367e subdir
ok 3 - cached textconv produces same output

HEAD is now at 307367e subdir
expecting success: 
	rm -f helper.out &&
	git diff HEAD^ HEAD >actual &&
	test_cmp expect actual &&
	! test -r helper.out

ok 4 - cached textconv does not run helper

expecting success: 
	echo other >other &&
	git config diff.magic.textconv "./helper other" &&
	git diff HEAD^ HEAD >actual &&
	test_cmp expect actual

expecting success: 
	git diff-index -p --submodule=log HEAD >actual &&
	cat >expected <<-EOF &&
	Submodule sm1 $head2...$head4:
	  > Add foo5 ($added foo5)
	  > Add foo4 ($added foo4)
	  < Add foo3 ($added foo3)
	  < Add foo2 ($added foo2)
	EOF
	test_cmp expected actual

ok 10 - modified submodule(backward and forward)

expecting success: 
	git diff --submodule=log --cached >actual &&
	cat >expected <<-EOF &&
	Submodule sm1 $head4...0000000 (submodule deleted)
	diff --git a/sm1 b/sm1
	new file mode 100644
	index 0000000..$head5
	--- /dev/null
	+++ b/sm1
	@@ -0,0 +1 @@
	+sm1
	EOF
	test_cmp expected actual

ok 5 - changing textconv invalidates cache

expecting success: 
	git config diff.moremagic.textconv ./helper &&
	echo foo.bin diff=moremagic >>.gitattributes &&
	git diff HEAD^ HEAD >actual &&
	test_cmp expect actual

ok 11 - typechanged submodule(submodule->blob), --cached

expecting success: 
	git diff --submodule=log >actual &&
	cat >expected <<-EOF &&
	diff --git a/sm1 b/sm1
	deleted file mode 100644
	index $head5..0000000
	--- a/sm1
	+++ /dev/null
	@@ -1 +0,0 @@
	-sm1
	Submodule sm1 0000000...$head4 (new submodule)
	EOF
	test_cmp expected actual

ok 12 - typechanged submodule(submodule->blob)

ok 6 - switching diff driver produces correct results

expecting success: 
	git log --no-walk -p refs/notes/textconv/magic HEAD

expecting success: 
	git diff-index -p --submodule=log HEAD >actual &&
	cat >expected <<-EOF &&
	Submodule sm1 $head4...0000000 (submodule deleted)
	diff --git a/sm1 b/sm1
	new file mode 100644
	index 0000000..$head5
	--- /dev/null
	+++ b/sm1
	@@ -0,0 +1 @@
	+sm1
	EOF
	test_cmp expected actual

commit bf03ec3f8e6895abce6e8356b0890eb22a8f785d
Author: A U Thor <author@example.com>
Date:   Wed Dec 16 10:57:14 2015 +0000

    ./helper other

diff --git a/1345db2c9189a61ef9932f66b656afc986bee58f b/1345db2c9189a61ef9932f66b656afc986bee58f
new file mode 100644
index 0000000..01b25c5
--- /dev/null
+++ b/1345db2c9189a61ef9932f66b656afc986bee58f
@@ -0,0 +1,2 @@
+converted: other
+converted: foo content 2
diff --git a/28283d51eeb71548ff81d02404b90103b494b983 b/28283d51eeb71548ff81d02404b90103b494b983
new file mode 100644
index 0000000..dcd63a4
--- /dev/null
+++ b/28283d51eeb71548ff81d02404b90103b494b983
@@ -0,0 +1,2 @@
+converted: other
+converted: bar content 2
diff --git a/d5b9fe314e6004caf906e730045d20689167b3fb b/d5b9fe314e6004caf906e730045d20689167b3fb
new file mode 100644
index 0000000..7ef0353
--- /dev/null
+++ b/d5b9fe314e6004caf906e730045d20689167b3fb
@@ -0,0 +1,2 @@
+converted: other
+converted: foo content 1
diff --git a/fcf91668044fda4a569b9374589b26dada7adc49 b/fcf91668044fda4a569b9374589b26dada7adc49
new file mode 100644
index 0000000..5ead606
--- /dev/null
+++ b/fcf91668044fda4a569b9374589b26dada7adc49
@@ -0,0 +1,2 @@
+converted: other
+converted: bar content 1

commit 9ee9421f60f37b0ed7ac1ff2cb8b972e95ee969b
Author: A U Thor <author@example.com>
Date:   Wed Dec 16 10:57:13 2015 +0000

    two

diff --git a/bar.bin b/bar.bin
index fcf9166..28283d5 100644
--- a/bar.bin
+++ b/bar.bin
@@ -1,2 +1,2 @@
 converted: other
-converted: bar content 1
+converted: bar content 2
ok 13 - typechanged submodule(submodule->blob)

diff --git a/foo.bin b/foo.bin
index d5b9fe3..1345db2 100644
--- a/foo.bin
+++ b/foo.bin
@@ -1 +1 @@
-converted: foo content 1
+converted: foo content 2
ok 7 - log notes cache and still use cache for -p

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4041-diff-submodule-option/sm1/.git/
Saved working directory and index state WIP on master: 307367e subdir
# passed all 7 test(s)
1..7
HEAD is now at 307367e subdir
*** t4043-diff-rename-binary.sh ***
expecting success: 
	git diff-index -p --submodule=log HEAD >actual &&
	cat >expected <<-EOF &&
	Submodule sm1 $head4...$head6 (commits not present)
	EOF
	test_cmp expected actual

ok 14 - nonexistent commit

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4043-diff-rename-binary/.git/
expecting success: 
	git diff-index -p --submodule=log HEAD >actual &&
	cat >expected <<-EOF &&
	diff --git a/sm1 b/sm1
	deleted file mode 100644
	index $head5..0000000
	--- a/sm1
	+++ /dev/null
	@@ -1 +0,0 @@
	-sm1
	Submodule sm1 0000000...$head6 (new submodule)
	EOF
	test_cmp expected actual

expecting success: 
	git init &&
	echo foo > foo &&
	echo "barQ" | q_to_nul > bar &&
	git add . &&
	git commit -m "Initial commit"

ok 15 - typechanged submodule(blob->submodule)

Reinitialized existing Git repository in /«PKGBUILDDIR»/t/trash directory.t4043-diff-rename-binary/.git/
expecting success: 
	git diff-index -p --submodule=log HEAD >actual &&
	cat >expected <<-EOF &&
	EOF
	test_cmp expected actual

ok 5 - setup for --cc --raw

expecting success: 
	four_trees=$(echo "$trees" | sed -e 4q) &&
	git diff --cc --raw $four_trees $base_tree >out &&
	# Check for four leading colons in the output:
	grep "^::::[^:]" out

Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual 13419d0b4f5b097f61dde4c911de99a154f8286f
::::100644 100644 100644 100644 100644 6c493ff... 7c8ac2f... bfd6a65... f73f309... e212970... MMMM	file
ok 6 - check --cc --raw with four trees

expecting success: 
	git diff --cc --raw $trees $base_tree >out &&
	# Check for forty leading colons in the output:
	grep "^::::::::::::::::::::::::::::::::::::::::[^:]" out

[master (root-commit) 660817d] Initial commit
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
 create mode 100644 bar
 create mode 100644 foo
ok 1 - prepare repository

expecting success: 
	mkdir sub &&
	git mv bar foo sub/ &&
	git commit -m "Moved to sub/"

ok 16 - submodule is up to date

expecting success: 
	echo new > sm1/new-file &&
	git diff-index -p --submodule=log HEAD >actual &&
	cat >expected <<-EOF &&
	Submodule sm1 contains untracked content
	EOF
	test_cmp expected actual

[master 7985a86] Moved to sub/
 Author: A U Thor <author@example.com>
 2 files changed, 0 insertions(+), 0 deletions(-)
 rename bar => sub/bar (100%)
 rename foo => sub/foo (100%)
ok 2 - move the files into a "sub" directory

On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	new file:   bazzy

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   file

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	actual
	expect
	expect1
	expect2
	expected
	output
	output.out
	stashlist1
	stashlist2
	subdir/subfile2

expecting success: 
	git show -C -C --raw --binary --numstat >patch-with-stat &&
	tail -n 11 patch-with-stat >current &&
	test_cmp expected current

::::::::::::::::::::::::::::::::::::::::100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 100644 6c493ff... 7c8ac2f... bfd6a65... 4806cb9... 8d80099... c52d680... efe3974... 2050b92... 07205b5... e1aa36f... dd63810... d7a00d8... b5ac9e5... c76bce1... 1d22d08... 1b22815... 10a5e40... e78cb60... 1b9d597... e4c0bb4... 536442d... 9e692b7... 02e835e... 4bed7f0... ae12143... 7202624... 4c12e08... 33b3d68... a633d0e... a1d5983... c1288dc... eb6edd8... 769381d... 9089a6c... 83be741... 3a76ef8... 67335ff... 834f228... 62e8e47... f73f309... e212970... MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM	file
ok 7 - check --cc --raw with forty trees

expecting success: 
	git checkout master &&
	>test &&
	git add test &&
	git commit -m initial &&

	tr -d Q <<-\EOF >test &&
	always coalesce
	eol space coalesce Q
	space  change coalesce
	all spa ces coalesce
	eol spaces Q
	space  change
	all spa ces
	EOF
	git commit -m "test space change" -a &&

	git checkout -b side HEAD^ &&
	tr -d Q <<-\EOF >test &&
	always coalesce
	eol space coalesce
	space change coalesce
	all spaces coalesce
	eol spaces
	space change
	all spaces
	EOF
	git commit -m "test other space changes" -a &&

	test_must_fail git merge master &&
	tr -d Q <<-\EOF >test &&
	eol spaces Q
	space  change
	all spa ces
	EOF
	git commit -m merged -a

pig
ok 56 - handle stash specification with spaces

expecting success: 
	git stash clear &&
	git reset --hard &&
	echo index >file &&
	git add file &&
	echo working >file &&
	git stash

ok 17 - submodule contains untracked content

expecting success: 
	git diff-index -p --ignore-submodules=untracked --submodule=log HEAD >actual &&
	! test -s actual

Switched to branch 'master'
ok 3 - git show -C -C report renames

# passed all 3 test(s)
1..3
ok 18 - submodule contains untracked content (untracked ignored)

expecting success: 
	git diff-index -p --ignore-submodules=dirty --submodule=log HEAD >actual &&
	! test -s actual

[master ac9d179] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 test
ok 19 - submodule contains untracked content (dirty ignored)

expecting success: 
	git diff-index -p --ignore-submodules=all --submodule=log HEAD >actual &&
	! test -s actual

*** t4044-diff-index-unique-abbrev.sh ***
ok 20 - submodule contains untracked content (all ignored)

expecting success: 
	echo new > sm1/foo6 &&
	git diff-index -p --submodule=log HEAD >actual &&
	cat >expected <<-EOF &&
	Submodule sm1 contains untracked content
	Submodule sm1 contains modified content
	EOF
	test_cmp expected actual

[master c5936ee] test space change
 Author: A U Thor <author@example.com>
 1 file changed, 7 insertions(+)
Switched to a new branch 'side'
ok 21 - submodule contains untracked and modifed content

expecting success: 
	echo new > sm1/foo6 &&
	git diff-index -p --ignore-submodules=untracked --submodule=log HEAD >actual &&
	cat >expected <<-EOF &&
	Submodule sm1 contains modified content
	EOF
	test_cmp expected actual

[side 29c6253] test other space changes
 Author: A U Thor <author@example.com>
 1 file changed, 7 insertions(+)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4044-diff-index-unique-abbrev/.git/
HEAD is now at 307367e subdir
Merging:
29c6253 test other space changes
virtual master
found 1 common ancestor:
ac9d179 initial
Auto-merging test
CONFLICT (content): Merge conflict in test
Automatic merge failed; fix conflicts and then commit the result.
ok 22 - submodule contains untracked and modifed content (untracked ignored)

expecting success: 
	echo new > sm1/foo6 &&
	git diff-index -p --ignore-submodules=dirty --submodule=log HEAD >actual &&
	! test -s actual

expecting success: 
	echo 4827 > foo &&
	git add foo &&
	git commit -m "initial" &&
	git cat-file -p HEAD: > actual &&
	test_cmp expect_initial actual &&
	echo 11742 > foo &&
	git commit -a -m "update" &&
	git cat-file -p HEAD: > actual &&
	test_cmp expect_update actual

ok 23 - submodule contains untracked and modifed content (dirty ignored)

expecting success: 
	echo new > sm1/foo6 &&
	git diff-index -p --ignore-submodules --submodule=log HEAD >actual &&
	! test -s actual

[side 373c494] merged
 Author: A U Thor <author@example.com>
ok 8 - setup combined ignore spaces

expecting success: 
	git show >actual.tmp &&
	sed -e "1,/^@@@/d" < actual.tmp >actual &&
	tr -d Q <<-\EOF >expected &&
	--always coalesce
	- eol space coalesce
	- space change coalesce
	- all spaces coalesce
	- eol spaces
	- space change
	- all spaces
	 -eol space coalesce Q
	 -space  change coalesce
	 -all spa ces coalesce
	+ eol spaces Q
	+ space  change
	+ all spa ces
	EOF
	compare_diff_patch expected actual

ok 24 - submodule contains untracked and modifed content (all ignored)

expecting success: 
	rm -f sm1/new-file &&
	git diff-index -p --submodule=log HEAD >actual &&
	cat >expected <<-EOF &&
	Submodule sm1 contains modified content
	EOF
	test_cmp expected actual

[master (root-commit) 6fff2f1] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
ok 9 - check combined output (no ignore space)

expecting success: 
	git show --ignore-space-at-eol >actual.tmp &&
	sed -e "1,/^@@@/d" < actual.tmp >actual &&
	tr -d Q <<-\EOF >expected &&
	--always coalesce
	--eol space coalesce
	- space change coalesce
	- all spaces coalesce
	 -space  change coalesce
	 -all spa ces coalesce
	  eol spaces Q
	- space change
	- all spaces
	+ space  change
	+ all spa ces
	EOF
	compare_diff_patch expected actual

ok 25 - submodule contains modifed content

[master 5531150] update
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - setup

expecting success: 
	git diff HEAD^..HEAD | grep index > actual &&
	test_cmp expect actual

expecting success: 
	git diff-index -p --submodule=log HEAD >actual &&
	cat >expected <<-EOF &&
	Submodule sm1 $head6..$head8:
	  > change
	EOF
	test_cmp expected actual

ok 10 - check combined output (ignore space at eol)

expecting success: 
	git show -b >actual.tmp &&
	sed -e "1,/^@@@/d" < actual.tmp >actual &&
	tr -d Q <<-\EOF >expected &&
	--always coalesce
	--eol space coalesce
	--space change coalesce
	- all spaces coalesce
	 -all spa ces coalesce
	  eol spaces Q
	  space  change
	- all spaces
	+ all spa ces
	EOF
	compare_diff_patch expected actual

ok 2 - diff does not produce ambiguous index line

# passed all 2 test(s)
1..2
ok 26 - submodule is modified

expecting success: 
	echo new > sm1/new-file &&
	git diff-index -p --submodule=log HEAD >actual &&
	cat >expected <<-EOF &&
	Submodule sm1 contains untracked content
	Submodule sm1 $head6..$head8:
	  > change
	EOF
	test_cmp expected actual

*** t4045-diff-relative.sh ***
ok 11 - check combined output (ignore space change)

expecting success: 
	git show -w >actual.tmp &&
	sed -e "1,/^@@@/d" < actual.tmp >actual &&
	tr -d Q <<-\EOF >expected &&
	--always coalesce
	--eol space coalesce
	--space change coalesce
	--all spaces coalesce
	  eol spaces Q
	  space  change
	  all spa ces
	EOF
	compare_diff_patch expected actual

ok 27 - modified submodule contains untracked content

expecting success: 
	git diff-index -p --ignore-submodules=untracked --submodule=log HEAD >actual &&
	cat >expected <<-EOF &&
	Submodule sm1 $head6..$head8:
	  > change
	EOF
	test_cmp expected actual

ok 12 - check combined output (ignore all spaces)

expecting success: 
	>test &&
	git add test &&
	git commit -m initial &&
	test_seq 4 >test &&
	git commit -a -m empty1 &&
	git branch side1 &&
	git checkout HEAD^ &&
	test_seq 5 >test &&
	git commit -a -m empty2 &&
	test_must_fail git merge side1 &&
	>test &&
	git commit -a -m merge &&
	git show >actual.tmp &&
	sed -e "1,/^@@@/d" < actual.tmp >actual &&
	tr -d Q <<-\EOF >expected &&
	--1
	--2
	--3
	--4
	- 5
	EOF
	compare_diff_patch expected actual

ok 28 - modified submodule contains untracked content (untracked ignored)

expecting success: 
	git diff-index -p --ignore-submodules=dirty --submodule=log HEAD >actual &&
	cat >expected <<-EOF &&
	Submodule sm1 $head6..$head8:
	  > change
	EOF
	test_cmp expected actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4045-diff-relative/.git/
[side ca25ef5] initial
 Author: A U Thor <author@example.com>
 1 file changed, 3 deletions(-)
expecting success: 
	git commit --allow-empty -m empty &&
	echo content >file1 &&
	mkdir subdir &&
	echo other content >subdir/file2 &&
	git add . &&
	git commit -m one

ok 29 - modified submodule contains untracked content (dirty ignored)

expecting success: 
	git diff-index -p --ignore-submodules=all --submodule=log HEAD >actual &&
	! test -s actual

[master (root-commit) ok 30 - modified submodule contains untracked content (all ignored)

b0830fc] empty
 Author: A U Thor <author@example.com>
expecting success: 
	echo modification >> sm1/foo6 &&
	git diff-index -p --submodule=log HEAD >actual &&
	cat >expected <<-EOF &&
	Submodule sm1 contains untracked content
	Submodule sm1 contains modified content
	Submodule sm1 $head6..$head8:
	  > change
	EOF
	test_cmp expected actual

Saved working directory and index state WIP on master: 307367e subdir
[side 2f38b7d] empty1
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+)
HEAD is now at 307367e subdir
ok 57 - setup stash with index and worktree changes

expecting success: 
	cat >expect <<-EOF &&
	stash@{0}

	diff --git a/file b/file
	index 257cc56..d26b33d 100644
	--- a/file
	+++ b/file
	@@ -1 +1 @@
	-foo
	+working
	EOF
	git stash list --format=%gd -p >actual &&
	test_cmp expect actual

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 ca25ef5... initial
ok 31 - modified submodule contains untracked and modifed content

expecting success: 
	echo modification >> sm1/foo6 &&
	git diff-index -p --ignore-submodules=untracked --submodule=log HEAD >actual &&
	cat >expected <<-EOF &&
	Submodule sm1 contains modified content
	Submodule sm1 $head6..$head8:
	  > change
	EOF
	test_cmp expected actual

[master cf283fb] one
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 file1
 create mode 100644 subdir/file2
ok 1 - setup

expecting success: 
	git diff -p --relative=subdir/ HEAD^ >actual &&
	test_cmp expected actual

[detached HEAD a65ae3c] empty2
 Author: A U Thor <author@example.com>
 1 file changed, 5 insertions(+)
ok 2 - -p --relative=subdir/

expecting success: 
	git diff -p --relative=subdir HEAD^ >actual &&
	test_cmp expected actual

ok 32 - modified submodule contains untracked and modifed content (untracked ignored)

expecting success: 
	echo modification >> sm1/foo6 &&
	git diff-index -p --ignore-submodules=dirty --submodule=log HEAD >actual &&
	cat >expected <<-EOF &&
	Submodule sm1 $head6..$head8:
	  > change
	EOF
	test_cmp expected actual

Merging:
a65ae3c empty2
virtual side1
found 1 common ancestor:
ca25ef5 initial
Auto-merging test
CONFLICT (content): Merge conflict in test
Automatic merge failed; fix conflicts and then commit the result.
ok 3 - -p --relative=subdir

expecting success: 
	git diff -p --relative=sub HEAD^ >actual &&
	test_cmp expected actual

ok 33 - modified submodule contains untracked and modifed content (dirty ignored)

expecting success: 
	echo modification >> sm1/foo6 &&
	git diff-index -p --ignore-submodules --submodule=log HEAD >actual &&
	! test -s actual

[detached HEAD 8ab2551] merge
 Author: A U Thor <author@example.com>
ok 4 - -p --relative=sub

ok 34 - modified submodule contains untracked and modifed content (all ignored)

expecting success: 
	rm -f sm1/new-file &&
	git diff-index -p --submodule=log HEAD >actual &&
	cat >expected <<-EOF &&
	Submodule sm1 contains modified content
	Submodule sm1 $head6..$head8:
	  > change
	EOF
	test_cmp expected actual

expecting success: 
	echo '1	0	file2' >expected &&
	git diff --numstat --relative=subdir/ HEAD^ >actual &&
	test_cmp expected actual

ok 5 - --numstat --relative=subdir/

expecting success: 
	echo '1	0	file2' >expected &&
	git diff --numstat --relative=subdir HEAD^ >actual &&
	test_cmp expected actual

ok 58 - stash list implies --first-parent -m

expecting success: 
	cat >expect <<-\EOF &&
	stash@{0}

	diff --cc file
	index 257cc56,9015a7a..d26b33d
	--- a/file
	+++ b/file
	@@@ -1,1 -1,1 +1,1 @@@
	- foo
	 -index
	++working
	EOF
	git stash list --format=%gd -p --cc >actual &&
	test_cmp expect actual

ok 6 - --numstat --relative=subdir

ok 35 - modified submodule contains modifed content

ok 13 - combine diff coalesce simple

expecting success: 
	>test &&
	git add test &&
	git commit -m initial --allow-empty &&
	cat <<-\EOF >test &&
	3
	1
	2
	3
	4
	EOF
	git commit -a -m empty1 &&
	git branch -f side1 &&
	git checkout HEAD^ &&
	cat <<-\EOF >test &&
	1
	3
	5
	4
	EOF
	git commit -a -m empty2 &&
	git branch -f side2 &&
	test_must_fail git merge side1 &&
	>test &&
	git commit -a -m merge &&
	git show >actual.tmp &&
	sed -e "1,/^@@@/d" < actual.tmp >actual &&
	tr -d Q <<-\EOF >expected &&
	 -3
	--1
	 -2
	--3
	- 5
	--4
	EOF
	compare_diff_patch expected actual &&
	git checkout -f side1 &&
	test_must_fail git merge side2 &&
	>test &&
	git commit -a -m merge &&
	git show >actual.tmp &&
	sed -e "1,/^@@@/d" < actual.tmp >actual &&
	tr -d Q <<-\EOF >expected &&
	- 3
	--1
	- 2
	--3
	 -5
	--4
	EOF
	compare_diff_patch expected actual

expecting success: 
	echo '1	0	dir/file2' >expected &&
	git diff --numstat --relative=sub HEAD^ >actual &&
	test_cmp expected actual

expecting success: 
	git diff-index -p --submodule=log HEAD >actual &&
	cat >expected <<-EOF &&
	Submodule sm1 $head6...0000000 (submodule deleted)
	EOF
	test_cmp expected actual

ok 7 - --numstat --relative=sub

expecting success: 
	git diff --stat --relative=subdir/ HEAD^ >actual &&
	test_i18ncmp expected actual

[detached HEAD 567514d] initial
 Author: A U Thor <author@example.com>
ok 36 - deleted submodule

ok 8 - --stat --relative=subdir/

expecting success: 
	git diff --stat --relative=subdir HEAD^ >actual &&
	test_i18ncmp expected actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4041-diff-submodule-option/sm2/.git/
[detached HEAD edcd94a] empty1
 Author: A U Thor <author@example.com>
 1 file changed, 5 insertions(+)
ok 9 - --stat --relative=subdir

expecting success: 
	git diff --stat --relative=sub HEAD^ >actual &&
	test_i18ncmp expected actual

ok 10 - --stat --relative=sub

Previous HEAD position was edcd94a... empty1
HEAD is now at 567514d... initial
expecting success: 
	git diff --no-abbrev --raw --relative=subdir/ HEAD^ >actual &&
	test_cmp expected actual

ok 59 - stash list --cc shows combined diff

ok 11 - --raw --relative=subdir/

expecting success: 
	git diff --no-abbrev --raw --relative=subdir HEAD^ >actual &&
	test_cmp expected actual

# still have 2 known breakage(s)
# passed all remaining 57 test(s)
1..59
[detached HEAD 4e10910] empty2
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+)
ok 12 - --raw --relative=subdir

expecting success: 
	git diff --no-abbrev --raw --relative=sub HEAD^ >actual &&
	test_cmp expected actual

expecting success: 
	git diff-index -p --submodule=log HEAD >actual &&
	cat >expected <<-EOF &&
	Submodule sm1 $head6...0000000 (submodule deleted)
	Submodule sm2 0000000...$head7 (new submodule)
	EOF
	test_cmp expected actual

ok 13 - --raw --relative=sub

Merging:
4e10910 empty2
virtual side1
found 1 common ancestor:
567514d initial
Auto-merging test
CONFLICT (content): Merge conflict in test
Automatic merge failed; fix conflicts and then commit the result.
# passed all 13 test(s)
1..13
ok 37 - multiple submodules

expecting success: 
	git diff-index -p --submodule=log HEAD sm2 >actual &&
	cat >expected <<-EOF &&
	Submodule sm2 0000000...$head7 (new submodule)
	EOF
	test_cmp expected actual

[detached HEAD 2f37ae9] merge
 Author: A U Thor <author@example.com>
*** t4046-diff-unmerged.sh ***
ok 38 - path filter

expecting success: 
	git diff-index -p --submodule=log HEAD^ >actual &&
	cat >expected <<-EOF &&
	Submodule sm1 $head6...0000000 (submodule deleted)
	Submodule sm2 0000000...$head7 (new submodule)
	EOF
	test_cmp expected actual

*** t4047-diff-dirstat.sh ***
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  2f37ae9 merge

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> 2f37ae9

Switched to branch 'side1'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4046-diff-unmerged/.git/
ok 39 - given commit

expecting success: 
	git diff-index -p --submodule HEAD^ >actual &&
	cat >expected <<-EOF &&
	Submodule sm1 $head6...0000000 (submodule deleted)
	Submodule sm2 0000000...$head7 (new submodule)
	EOF
	test_cmp expected actual

expecting success: 
	for i in 0 1 2 3
	do
		blob=$(echo $i | git hash-object --stdin) &&
		eval "blob$i=$blob" &&
		eval "m$i=\"100644 \$blob$i $i\"" || return 1
	done &&
	paths= &&
	for b in o x
	do
		for o in o x
		do
			for t in o x
			do
				path="$b$o$t" &&
				case "$path" in ooo) continue ;; esac
				paths="$paths$path " &&
				p="	$path" &&
				case "$b" in x) echo "$m1$p" ;; esac &&
				case "$o" in x) echo "$m2$p" ;; esac &&
				case "$t" in x) echo "$m3$p" ;; esac ||
				return 1
			done
		done
	done >ls-files-s.expect &&
	git update-index --index-info <ls-files-s.expect &&
	git ls-files -s >ls-files-s.actual &&
	test_cmp ls-files-s.expect ls-files-s.actual

Merging:
edcd94a empty1
virtual side2
found 1 common ancestor:
567514d initial
Auto-merging test
CONFLICT (content): Merge conflict in test
Automatic merge failed; fix conflicts and then commit the result.
[side1 33886e5] merge
 Author: A U Thor <author@example.com>
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4047-diff-dirstat/.git/
ok 40 - given commit --submodule

expecting success: 
	mkdir unchanged &&
	mkdir changed &&
	mkdir rearranged &&
	mkdir src &&
	mkdir src/copy &&
	mkdir src/copy/unchanged &&
	mkdir src/copy/changed &&
	mkdir src/copy/rearranged &&
	mkdir src/move &&
	mkdir src/move/unchanged &&
	mkdir src/move/changed &&
	mkdir src/move/rearranged &&
	cat <<EOF >unchanged/text &&
unchanged       line #0
unchanged       line #1
unchanged       line #2
unchanged       line #3
unchanged       line #4
unchanged       line #5
unchanged       line #6
unchanged       line #7
unchanged       line #8
unchanged       line #9
EOF
	cat <<EOF >changed/text &&
changed         line #0
changed         line #1
changed         line #2
changed         line #3
changed         line #4
changed         line #5
changed         line #6
changed         line #7
changed         line #8
changed         line #9
EOF
	cat <<EOF >rearranged/text &&
rearranged      line #0
rearranged      line #1
rearranged      line #2
rearranged      line #3
rearranged      line #4
rearranged      line #5
rearranged      line #6
rearranged      line #7
rearranged      line #8
rearranged      line #9
EOF
	cat <<EOF >src/copy/unchanged/text &&
copy  unchanged line #0
copy  unchanged line #1
copy  unchanged line #2
copy  unchanged line #3
copy  unchanged line #4
copy  unchanged line #5
copy  unchanged line #6
copy  unchanged line #7
copy  unchanged line #8
copy  unchanged line #9
EOF
	cat <<EOF >src/copy/changed/text &&
copy    changed line #0
copy    changed line #1
copy    changed line #2
copy    changed line #3
copy    changed line #4
copy    changed line #5
copy    changed line #6
copy    changed line #7
copy    changed line #8
copy    changed line #9
EOF
	cat <<EOF >src/copy/rearranged/text &&
copy rearranged line #0
copy rearranged line #1
copy rearranged line #2
copy rearranged line #3
copy rearranged line #4
copy rearranged line #5
copy rearranged line #6
copy rearranged line #7
copy rearranged line #8
copy rearranged line #9
EOF
	cat <<EOF >src/move/unchanged/text &&
move  unchanged line #0
move  unchanged line #1
move  unchanged line #2
move  unchanged line #3
move  unchanged line #4
move  unchanged line #5
move  unchanged line #6
move  unchanged line #7
move  unchanged line #8
move  unchanged line #9
EOF
	cat <<EOF >src/move/changed/text &&
move    changed line #0
move    changed line #1
move    changed line #2
move    changed line #3
move    changed line #4
move    changed line #5
move    changed line #6
move    changed line #7
move    changed line #8
move    changed line #9
EOF
	cat <<EOF >src/move/rearranged/text &&
move rearranged line #0
move rearranged line #1
move rearranged line #2
move rearranged line #3
move rearranged line #4
move rearranged line #5
move rearranged line #6
move rearranged line #7
move rearranged line #8
move rearranged line #9
EOF
	git add . &&
	git commit -m "initial" &&
	mkdir dst &&
	mkdir dst/copy &&
	mkdir dst/copy/unchanged &&
	mkdir dst/copy/changed &&
	mkdir dst/copy/rearranged &&
	mkdir dst/move &&
	mkdir dst/move/unchanged &&
	mkdir dst/move/changed &&
	mkdir dst/move/rearranged &&
	cat <<EOF >changed/text &&
CHANGED XXXXXXX line #0
changed         line #1
changed         line #2
changed         line #3
changed         line #4
changed         line #5
changed         line #6
changed         line #7
changed         line #8
changed         line #9
EOF
	cat <<EOF >rearranged/text &&
rearranged      line #1
rearranged      line #0
rearranged      line #2
rearranged      line #3
rearranged      line #4
rearranged      line #5
rearranged      line #6
rearranged      line #7
rearranged      line #8
rearranged      line #9
EOF
	cat <<EOF >dst/copy/unchanged/text &&
copy  unchanged line #0
copy  unchanged line #1
copy  unchanged line #2
copy  unchanged line #3
copy  unchanged line #4
copy  unchanged line #5
copy  unchanged line #6
copy  unchanged line #7
copy  unchanged line #8
copy  unchanged line #9
EOF
	cat <<EOF >dst/copy/changed/text &&
copy XXXCHANGED line #0
copy    changed line #1
copy    changed line #2
copy    changed line #3
copy    changed line #4
copy    changed line #5
copy    changed line #6
copy    changed line #7
copy    changed line #8
copy    changed line #9
EOF
	cat <<EOF >dst/copy/rearranged/text &&
copy rearranged line #1
copy rearranged line #0
copy rearranged line #2
copy rearranged line #3
copy rearranged line #4
copy rearranged line #5
copy rearranged line #6
copy rearranged line #7
copy rearranged line #8
copy rearranged line #9
EOF
	cat <<EOF >dst/move/unchanged/text &&
move  unchanged line #0
move  unchanged line #1
move  unchanged line #2
move  unchanged line #3
move  unchanged line #4
move  unchanged line #5
move  unchanged line #6
move  unchanged line #7
move  unchanged line #8
move  unchanged line #9
EOF
	cat <<EOF >dst/move/changed/text &&
move XXXCHANGED line #0
move    changed line #1
move    changed line #2
move    changed line #3
move    changed line #4
move    changed line #5
move    changed line #6
move    changed line #7
move    changed line #8
move    changed line #9
EOF
	cat <<EOF >dst/move/rearranged/text &&
move rearranged line #1
move rearranged line #0
move rearranged line #2
move rearranged line #3
move rearranged line #4
move rearranged line #5
move rearranged line #6
move rearranged line #7
move rearranged line #8
move rearranged line #9
EOF
	git add . &&
	git rm -r src/move/unchanged &&
	git rm -r src/move/changed &&
	git rm -r src/move/rearranged &&
	git commit -m "changes"

expecting success: 
	git diff-index -p --submodule=short HEAD^ >actual &&
	cat >expected <<-EOF &&
	diff --git a/sm1 b/sm1
	deleted file mode 160000
	index $head6..0000000
	--- a/sm1
	+++ /dev/null
	@@ -1 +0,0 @@
	-Subproject commit $fullhead6
	diff --git a/sm2 b/sm2
	new file mode 160000
	index 0000000..$head7
	--- /dev/null
	+++ b/sm2
	@@ -0,0 +1 @@
	+Subproject commit $fullhead7
	EOF
	test_cmp expected actual

ok 1 - setup

expecting success: 
	for path in $paths
	do
		>"$path" &&
		echo ":000000 100644 $_z40 $_z40 U	$path"
	done >diff-files-0.expect &&
	git diff-files -0 >diff-files-0.actual &&
	test_cmp diff-files-0.expect diff-files-0.actual

ok 14 - combine diff coalesce tricky

checking known breakage: 
	>test &&
	git add test &&
	git commit -m initial --allow-empty &&
	cat <<-\EOF >test &&
	3
	1
	2
	3
	4
	EOF
	git commit -a -m empty1 &&
	git checkout -B side1 &&
	git checkout HEAD^ &&
	cat <<-\EOF >test &&
	1
	3
	7
	5
	4
	EOF
	git commit -a -m empty2 &&
	git branch -f side2 &&
	git checkout HEAD^ &&
	cat <<-\EOF >test &&
	3
	1
	6
	5
	4
	EOF
	git commit -a -m empty3 &&
	>test &&
	git add test &&
	TREE=$(git write-tree) &&
	COMMIT=$(git commit-tree -p HEAD -p side1 -p side2 -m merge $TREE) &&
	git show $COMMIT >actual.tmp &&
	sed -e "1,/^@@@/d" < actual.tmp >actual &&
	tr -d Q <<-\EOF >expected &&
	-- 3
	---1
	-  6
	 - 2
	 --3
	  -7
	- -5
	---4
	EOF
	compare_diff_patch expected actual

ok 41 - given commit --submodule=short
ok 2 - diff-files -0


expecting success: 
	(cd sm2 &&
	 REAL="$(pwd)/../.real" &&
	 mv .git "$REAL"
	 echo "gitdir: $REAL" >.git)

expecting success: 
	for path in $paths
	do
		>"$path" &&
		echo ":000000 100644 $_z40 $_z40 U	$path" &&
		case "$path" in
		x??) echo ":100644 100644 $blob1 $_z40 M	$path"
		esac
	done >diff-files-1.expect &&
	git diff-files -1 >diff-files-1.actual &&
	test_cmp diff-files-1.expect diff-files-1.actual

ok 42 - setup .git file for sm2

expecting success: 
	git diff --submodule HEAD^ >actual &&
	cat >expected <<-EOF &&
	Submodule sm1 $head6...0000000 (submodule deleted)
	Submodule sm2 0000000...$head7 (new submodule)
	EOF
	test_cmp expected actual

ok 3 - diff-files -1

expecting success: 
	for path in $paths
	do
		>"$path" &&
		echo ":000000 100644 $_z40 $_z40 U	$path" &&
		case "$path" in
		?x?) echo ":100644 100644 $blob2 $_z40 M	$path"
		esac
	done >diff-files-2.expect &&
	git diff-files -2 >diff-files-2.actual &&
	test_cmp diff-files-2.expect diff-files-2.actual &&
	git diff-files >diff-files-default-2.actual &&
	test_cmp diff-files-2.expect diff-files-default-2.actual

[side1 562f35c] initial
 Author: A U Thor <author@example.com>
ok 4 - diff-files -2

expecting success: 
	for path in $paths
	do
		>"$path" &&
		echo ":000000 100644 $_z40 $_z40 U	$path" &&
		case "$path" in
		??x) echo ":100644 100644 $blob3 $_z40 M	$path"
		esac
	done >diff-files-3.expect &&
	git diff-files -3 >diff-files-3.actual &&
	test_cmp diff-files-3.expect diff-files-3.actual

ok 43 - diff --submodule with .git file

expecting success: 
	mkdir sub_alt &&
	(cd sub_alt &&
		git init &&
		echo a >a &&
		git add a &&
		git commit -m a
	) &&
	mkdir super &&
	(cd super &&
		git clone -s ../sub_alt sub &&
		git init &&
		git add sub &&
		git commit -m "sub a"
	) &&
	(cd sub_alt &&
		sha1_before=$(git rev-parse --short HEAD)
		echo b >b &&
		git add b &&
		git commit -m b &&
		sha1_after=$(git rev-parse --short HEAD) &&
		{
			echo "Submodule sub $sha1_before..$sha1_after:" &&
			echo "  > b"
		} >../expected
	) &&
	(cd super &&
		(cd sub &&
			git fetch &&
			git checkout origin/master
		) &&
		git diff --submodule > ../actual
	) &&
	test_cmp expected actual

[side1 f31b6a2] empty1
 Author: A U Thor <author@example.com>
 1 file changed, 5 insertions(+)
ok 5 - diff-files -3

# passed all 5 test(s)
1..5
Reset branch 'side1'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4041-diff-submodule-option/sub_alt/.git/
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 562f35c... initial
*** t4048-diff-combined-binary.sh ***
[master (root-commit) b7442a0] a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a
[detached HEAD 0cc2d14] empty2
 Author: A U Thor <author@example.com>
 1 file changed, 5 insertions(+)
Cloning into 'sub'...
[master (root-commit) 642b2b1] initial
 Author: A U Thor <author@example.com>
 9 files changed, 90 insertions(+)
 create mode 100644 changed/text
 create mode 100644 rearranged/text
 create mode 100644 src/copy/changed/text
 create mode 100644 src/copy/rearranged/text
 create mode 100644 src/copy/unchanged/text
 create mode 100644 src/move/changed/text
 create mode 100644 src/move/rearranged/text
 create mode 100644 src/move/unchanged/text
 create mode 100644 unchanged/text
Previous HEAD position was 0cc2d14... empty2
HEAD is now at 562f35c... initial
done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4048-diff-combined-binary/.git/
[detached HEAD 22de592] empty3
 Author: A U Thor <author@example.com>
 1 file changed, 5 insertions(+)
expecting success: 
	echo oneQ1 | q_to_nul >binary &&
	git add binary &&
	git commit -m one &&
	echo twoQ2 | q_to_nul >binary &&
	git commit -a -m two &&
	git checkout -b branch-binary HEAD^ &&
	echo threeQ3 | q_to_nul >binary &&
	git commit -a -m three &&
	test_must_fail git merge master &&
	echo resolvedQhooray | q_to_nul >binary &&
	git commit -a -m resolved

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4041-diff-submodule-option/super/.git/
[master (root-commit) d9c5753] sub a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 160000 sub
[master (root-commit) cf4ba8c] one
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 binary
--- .tmp-1	2015-12-16 10:57:17.441564826 +0000
+++ .tmp-2	2015-12-16 10:57:17.449564826 +0000
@@ -1,8 +1,9 @@
 -- 3
 ---1
 -  6
+-  5
  - 2
  --3
   -7
-- -5
+  -5
 ---4
rm 'src/move/unchanged/text'
not ok 15 - combine diff coalesce three parents # TODO known breakage

expecting success: 
	git commit -m initial --allow-empty &&
	cat <<-\EOF >test &&
	1
	2
	3
	4
	EOF
	git add test &&
	git commit -a -m side1 &&
	git checkout -B side1 &&
	git checkout HEAD^ &&
	cat <<-\EOF >test &&
	0
	1
	2
	3
	4modified
	EOF
	git add test &&
	git commit -m side2 &&
	git branch -f side2 &&
	test_must_fail git merge --no-commit side1 &&
	cat <<-\EOF >test &&
	1
	2
	3
	4modified
	EOF
	git add test &&
	git commit -a -m merge &&
	git diff-tree -c -p HEAD >actual.tmp &&
	sed -e "1,/^@@@/d" < actual.tmp >actual &&
	tr -d Q <<-\EOF >expected &&
	- 0
	  1
	  2
	  3
	 -4
	 +4modified
	EOF
	compare_diff_patch expected actual

[master b4bc018] two
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
[master 8e02ef5] b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 b
Switched to a new branch 'branch-binary'
rm 'src/move/changed/text'
[detached HEAD 78a948b] initial
 Author: A U Thor <author@example.com>
 1 file changed, 5 deletions(-)
rm 'src/move/rearranged/text'
[detached HEAD dd67d51] side1
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+)
[branch-binary 70b1d4f] three
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
Switched to and reset branch 'side1'
warning: Cannot merge binary files: binary (HEAD vs. master)
Merging:
70b1d4f three
virtual master
found 1 common ancestor:
cf4ba8c one
Auto-merging binary
CONFLICT (content): Merge conflict in binary
Automatic merge failed; fix conflicts and then commit the result.
[master dbac4a7] changes
 Author: A U Thor <author@example.com>
 8 files changed, 34 insertions(+), 4 deletions(-)
 create mode 100644 dst/copy/changed/text
 create mode 100644 dst/copy/rearranged/text
 create mode 100644 dst/copy/unchanged/text
 rename {src => dst}/move/changed/text (90%)
 rename {src => dst}/move/rearranged/text (100%)
 rename {src => dst}/move/unchanged/text (100%)
ok 1 - setup

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 78a948b... initial
From /«PKGBUILDDIR»/t/trash directory.t4041-diff-submodule-option/super/../sub_alt
   b7442a0..8e02ef5  master     -> origin/master
expecting success: 
	git diff --numstat HEAD^..HEAD >actual_diff_stat &&
	test_cmp expect_diff_stat actual_diff_stat &&
	git diff --numstat -M HEAD^..HEAD >actual_diff_stat_M &&
	test_cmp expect_diff_stat_M actual_diff_stat_M &&
	git diff --numstat -C -C HEAD^..HEAD >actual_diff_stat_CC &&
	test_cmp expect_diff_stat_CC actual_diff_stat_CC

[branch-binary f698d69] resolved
 Author: A U Thor <author@example.com>
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>

ok 1 - setup binary merge conflict

HEAD is now at 8e02ef5... b
[detached HEAD bb8b62e] side2
 Author: A U Thor <author@example.com>
 1 file changed, 5 insertions(+)
expecting success: 
	git show --format=%s -m >actual &&
	test_cmp expect actual

ok 2 - diff -m indicates binary-ness

expecting success: 
	git show --format=%s -c >actual &&
	test_cmp expect actual

Merging:
bb8b62e side2
virtual side1
found 1 common ancestor:
78a948b initial
Auto-merging test
CONFLICT (content): Merge conflict in test
Automatic merge failed; fix conflicts and then commit the result.
ok 44 - diff --submodule with objects referenced by alternates

# passed all 44 test(s)
1..44
ok 3 - diff -c indicates binary-ness

ok 2 - sanity check setup (--numstat)

expecting success: 
	git show --format=%s --cc >actual &&
	test_cmp expect actual

expecting success: 
	test_must_fail git show --dirstat10 &&
	test_must_fail git show --dirstat10,files &&
	test_must_fail git show -X=20 &&
	test_must_fail git show -X=20,cumulative

ok 4 - diff --cc indicates binary-ness

expecting success: 
	git checkout master &&
	test_commit one text &&
	test_commit two text &&
	git checkout -b branch-text HEAD^ &&
	test_commit three text &&
	test_must_fail git merge master &&
	test_commit resolved text &&
	echo text -diff >.gitattributes

fatal: unrecognized argument: --dirstat10
[detached HEAD 9dfd023] merge
 Author: A U Thor <author@example.com>
Switched to branch 'master'
fatal: unrecognized argument: --dirstat10,files
fatal: Failed to parse --dirstat/-X option parameter:
  Unknown dirstat parameter '=20'

fatal: Failed to parse --dirstat/-X option parameter:
  Unknown dirstat parameter '=20'

ok 3 - various ways to misspell --dirstat

expecting success: 
	git diff --dirstat HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

ok 16 - combine diff missing delete bug

expecting success: 
	# create a directory and a file that sort differently in trees
	# versus byte-wise (implied "/" sorts after ".")
	git checkout -f master &&
	mkdir foo &&
	echo base >foo/one &&
	echo base >foo/two &&
	echo base >foo.ext &&
	git add foo foo.ext &&
	git commit -m base &&

	# one side modifies a file in the directory, along with the root
	# file...
	echo master >foo/one &&
	echo master >foo.ext &&
	git commit -a -m master &&

	# the other side modifies the other file in the directory
	git checkout -b other HEAD^ &&
	echo other >foo/two &&
	git commit -a -m other &&

	# And now we merge. The files in the subdirectory will resolve cleanly,
	# meaning that a combined diff will not find them interesting. But it
	# will find the tree itself interesting, because it had to be merged.
	git checkout master &&
	git merge other &&

	printf "MM\tfoo\n" >expect &&
	git diff-tree -c --name-status -t HEAD >actual.tmp &&
	sed 1d <actual.tmp >actual &&
	test_cmp expect actual

[master 1faaaad] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 text
*** t4049-diff-stat-count.sh ***
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  9dfd023 merge

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> 9dfd023

Switched to branch 'master'
[master 02b756c] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master eeef54b] base
 Author: A U Thor <author@example.com>
 3 files changed, 3 insertions(+)
 create mode 100644 foo.ext
 create mode 100644 foo/one
 create mode 100644 foo/two
ok 4 - vanilla --dirstat

expecting success: 
	git diff -X HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git diff -X -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git diff -X -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4049-diff-stat-count/.git/
[master d5b0bfd] master
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 2 deletions(-)
Switched to a new branch 'branch-text'
expecting success: 
	>a &&
	>b &&
	>c &&
	>d &&
	git add a b c d &&
	git commit -m initial

Switched to a new branch 'other'
[master (root-commit) 9c6d7e0] initial
 Author: A U Thor <author@example.com>
 4 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 a
 create mode 100644 b
 create mode 100644 c
 create mode 100644 d
[branch-text a8b2e7e] three
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - setup

expecting success: 
	git reset --hard &&
	test_chmod +x b d &&
	echo a >a &&
	echo c >c &&
	cat >expect <<-\EOF &&
	 a | 1 +
	 b | 0
	 ...
	 4 files changed, 2 insertions(+)
	EOF
	git diff --stat --stat-count=2 HEAD >actual &&
	test_i18ncmp expect actual

[other 387c20f] other
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 5 - vanilla -X

expecting success: 
	git diff --dirstat=changes,noncumulative,3 HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git diff --dirstat=changes,noncumulative,3 -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git diff --dirstat=changes,noncumulative,3 -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

Switched to branch 'master'
HEAD is now at 9c6d7e0 initial
Merging:
a8b2e7e three
virtual master
found 1 common ancestor:
1faaaad one
Auto-merging text
CONFLICT (content): Merge conflict in text
Automatic merge failed; fix conflicts and then commit the result.
Merging:
d5b0bfd master
virtual other
found 1 common ancestor:
eeef54b base
Merge made by the 'recursive' strategy.
 foo/two | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 2 - mode-only change show as a 0-line change

expecting success: 
	git reset --hard &&
	echo a >a &&
	echo c >c &&
	cat "$TEST_DIRECTORY"/test-binary-1.png >d &&
	cat >expect <<-\EOF &&
	 a | 1 +
	 c | 1 +
	 ...
	 3 files changed, 2 insertions(+)
	EOF
	git diff --stat --stat-count=2 >actual &&
	test_i18ncmp expect actual

[branch-text a124132] resolved
 Author: A U Thor <author@example.com>
HEAD is now at 9c6d7e0 initial
ok 17 - combine diff gets tree sorting right

ok 5 - setup non-binary with binary attribute

expecting success: 
	git show --format=%s -m >actual &&
	test_cmp expect actual

# still have 1 known breakage(s)
# passed all remaining 16 test(s)
1..17
ok 6 - explicit defaults: --dirstat=changes,noncumulative,3

expecting success: 
	git diff -Xchanges,noncumulative,3 HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git diff -Xchanges,noncumulative,3 -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git diff -Xchanges,noncumulative,3 -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

ok 6 - diff -m respects binary attribute

ok 3 - binary changes do not count in lines

expecting success: 
	git reset --hard &&
	echo a >a &&
	echo b >b &&
	git ls-files -s a >x &&
	git rm -f d &&
	for stage in 1 2 3
	do
		sed -e "s/ 0	a/ $stage	d/" x
	done |
	git update-index --index-info &&
	echo d >d &&
	cat >expect <<-\EOF &&
	 a | 1 +
	 b | 1 +
	 ...
	 3 files changed, 3 insertions(+)
	EOF
	git diff --stat --stat-count=2 >actual &&
	test_i18ncmp expect actual

expecting success: 
	git show --format=%s -c >actual &&
	test_cmp expect actual

HEAD is now at 9c6d7e0 initial
ok 7 - diff -c respects binary attribute

expecting success: 
	git show --format=%s --cc >actual &&
	test_cmp expect actual

rm 'd'
ok 8 - diff --cc respects binary attribute

expecting success: 
	echo "text diff=upcase" >.gitattributes &&
	git config diff.upcase.textconv "tr a-z A-Z <"

ok 7 - explicit defaults: -Xchanges,noncumulative,3

expecting success: 
	git diff --dirstat=files,10,cumulative,changes,noncumulative,3 HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git diff --dirstat=files,10,cumulative,changes,noncumulative,3 -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git diff --dirstat=files,10,cumulative,changes,noncumulative,3 -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC &&
	git diff --dirstat=files --dirstat=10 --dirstat=cumulative --dirstat=changes --dirstat=noncumulative -X3 HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git diff --dirstat=files --dirstat=10 --dirstat=cumulative --dirstat=changes --dirstat=noncumulative -X3 -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git diff --dirstat=files --dirstat=10 --dirstat=cumulative --dirstat=changes --dirstat=noncumulative -X3 -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

ok 9 - setup textconv attribute

expecting success: 
	git show --format=%s -m >actual &&
	test_cmp expect actual

ok 4 - exclude unmerged entries from total file count

# passed all 4 test(s)
1..4
*** t4050-diff-histogram.sh ***
ok 10 - diff -m respects textconv attribute

expecting success: 
	git show --format=%s -c >actual &&
	test_cmp expect actual

*** t4051-diff-function-context.sh ***
ok 11 - diff -c respects textconv attribute

expecting success: 
	git show --format=%s --cc >actual &&
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4050-diff-histogram/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4051-diff-function-context/.git/
expecting success: 
		test_must_fail git diff --no-index "--$STRATEGY" file1 file2 > output &&
		test_cmp expect output
	
ok 12 - diff --cc respects textconv attribute

expecting success: 
	git add hello.c &&
	test_tick &&
	git commit -m initial &&

	grep -v Classic <hello.c >hello.c.new &&
	mv hello.c.new hello.c

expecting success: 
	git diff-tree HEAD -c -p >full &&
	tail -n +2 full >actual &&
	test_cmp expect actual

ok 8 - later options override earlier options:
ok 1 - histogram diff


expecting success: 
		mv file2 expect &&
		git apply < output &&
		test_cmp expect file2
	
expecting success: 
	git -c diff.dirstat=files,cumulative,50 diff --dirstat=changes,noncumulative,3 HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git -c diff.dirstat=files,cumulative,50 diff --dirstat=changes,noncumulative,3 -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git -c diff.dirstat=files,cumulative,50 diff --dirstat=changes,noncumulative,3 -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

ok 13 - diff-tree plumbing does not respect textconv

expecting success: 
	git reset --hard HEAD^ &&
	test_must_fail git merge master &&
	git diff >actual &&
	test_cmp expect actual

ok 2 - histogram diff output is valid

[master (root-commit) 552df3d] initial
 Author: A U Thor <author@example.com>
 1 file changed, 30 insertions(+)
 create mode 100644 hello.c
expecting success: 
		test_must_fail git diff --no-index "--$STRATEGY" uniq1 uniq2 > output &&
		test_cmp expect output
	
HEAD is now at a8b2e7e three
ok 1 - setup

expecting success: 
	git diff -U0 -W >actual &&
	compare_diff_patch actual expected

ok 3 - completely different files

# passed all 3 test(s)
1..3
Merging:
a8b2e7e three
virtual master
found 1 common ancestor:
1faaaad one
Auto-merging text
CONFLICT (content): Merge conflict in text
Automatic merge failed; fix conflicts and then commit the result.
*** t4052-stat-output.sh ***
ok 2 - diff -U0 -W

ok 9 - non-defaults in config overridden by explicit defaults on command line

expecting success: 
	git diff -W >actual &&
	compare_diff_patch actual expected

expecting success: 
	git diff --dirstat=0 HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git diff --dirstat=0 -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git diff --dirstat=0 -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

ok 14 - diff --cc respects textconv on worktree file

# passed all 14 test(s)
1..14
ok 3 - diff -W

# passed all 3 test(s)
1..3
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4052-stat-output/.git/
*** t4053-diff-no-index.sh ***
ok 10 - --dirstat=0

*** t4054-diff-bogus-tree.sh ***
expecting success: 
	git diff -X0 HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git diff -X0 -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git diff -X0 -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

expecting success: 
	>"$name" &&
	git add "$name" &&
	git commit -m message &&
	echo a >"$name" &&
	git commit -m message "$name"

[master (root-commit) 47a20a3] message
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4053-diff-no-index/.git/
[master 1dcbe54] message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 1 - preparation

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4054-diff-bogus-tree/.git/
expecting success: 
		git $cmd $args >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
expecting success: 
	mkdir a &&
	mkdir b &&
	echo 1 >a/1 &&
	echo 2 >a/2 &&
	git init repo &&
	echo 1 >repo/a &&
	mkdir -p non/git &&
	echo 1 >non/git/a &&
	echo 1 >non/git/b

ok 11 - -X0

expecting success: 
	git -c diff.dirstat=0 diff --dirstat HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git -c diff.dirstat=0 diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git -c diff.dirstat=0 diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

expecting success: 
	bogus_tree=$(
		printf "100644 fooQQQQQQQQQQQQQQQQQQQQQ" |
		q_to_nul |
		git hash-object -w --stdin -t tree
	)

ok 2 - format-patch: small change with long name gives more space to the name

ok 1 - create bogus tree

expecting success: 
	echo bar >foo &&
	git add foo &&
	good_tree=$(git write-tree) &&
	blob=$(git rev-parse :foo)

expecting success: 
		git $cmd $args --stat=40 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4053-diff-no-index/repo/.git/
ok 1 - setup

expecting success: 
	test_expect_code 1 git diff --no-index a b >cnt &&
	test_line_count = 14 cnt

ok 3 - format-patch --stat=width: a long name is given more room when the bar is short

expecting success: 
		git $cmd $args --stat-width=40 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
ok 2 - git diff --no-index directories

expecting success: 
	(
		cd repo &&
		test_expect_code 0 git diff --no-index a ../non/git/a &&
		test_expect_code 0 git diff --no-index ../non/git/a ../non/git/b
	)

ok 2 - create tree with matching file

expecting success: 
	echo ":000000 100644 $_z40 $_z40 A	foo" >expect &&
	git diff-tree $empty_tree $bogus_tree >actual &&
	test_cmp expect actual

ok 3 - raw diff shows null sha1 (addition)

expecting success: 
	echo ":100644 000000 $_z40 $_z40 D	foo" >expect &&
	git diff-tree $bogus_tree $empty_tree >actual &&
	test_cmp expect actual

ok 4 - format-patch --stat-width=width with long name

ok 3 - git diff --no-index relative path outside repo

expecting success: 
	(
		cd repo &&
		echo broken >.git/index &&
		git diff --no-index a ../non/git/a
	)

expecting success: 
		git $cmd $args --stat=60,30 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
ok 12 - diff.dirstat=0

ok 4 - raw diff shows null sha1 (removal)
ok 4 - git diff --no-index with broken index


expecting success: 
	git diff --dirstat=0 --cumulative HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git diff --dirstat=0 --cumulative -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git diff --dirstat=0 --cumulative -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

expecting success: 
	echo ":100644 100644 $blob $_z40 M	foo" >expect &&
	git diff-tree $good_tree $bogus_tree >actual &&
	test_cmp expect actual

expecting success: 
	(
		cd repo &&
		git diff ../non/git/a ../non/git/b
	)

ok 5 - git diff outside repo with broken index

expecting success: 
	(
		GIT_CEILING_DIRECTORIES=$TRASH_DIRECTORY/non &&
		export GIT_CEILING_DIRECTORIES &&
		cd non/git &&
		test_must_fail git diff --no-index a 2>actual.err &&
		echo "usage: git diff --no-index <path> <path>" >expect.err &&
		test_cmp expect.err actual.err
	)

ok 5 - format-patch --stat=...,name-width with long name

expecting success: 
		git $cmd $args --stat-name-width=30 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
ok 5 - raw diff shows null sha1 (modification)

expecting success: 
	echo ":100644 100644 $_z40 $blob M	foo" >expect &&
	git diff-tree $bogus_tree $good_tree >actual &&
	test_cmp expect actual

ok 6 - git diff --no-index executed outside repo gives correct error message

expecting success: 
	(
		cd repo &&
		echo in-repo >a &&
		echo non-repo >../non/git/a &&
		mkdir sub &&
		echo sub-repo >sub/a &&

		test_must_fail git diff --no-index sub/a ../non/git/a >expect &&
		test_must_fail git diff --no-index sub/a ../non/git/ >actual &&
		test_cmp expect actual &&

		test_must_fail git diff --no-index a ../non/git/a >expect &&
		test_must_fail git diff --no-index a ../non/git/ >actual &&
		test_cmp expect actual &&

		test_must_fail git diff --no-index ../non/git/a a >expect &&
		test_must_fail git diff --no-index ../non/git a >actual &&
		test_cmp expect actual
	)

ok 6 - raw diff shows null sha1 (other direction)

expecting success: 
	echo ":100644 100644 $_z40 $blob M	foo" >expect &&
	git diff-tree -R $good_tree $bogus_tree >actual &&
	test_cmp expect actual

ok 6 - format-patch --stat-name-width with long name

expecting success: 
		git $cmd $args >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
ok 7 - raw diff shows null sha1 (reverse)

expecting success: 
	echo ":100644 100644 $_z40 $blob M	foo" >expect &&
	git diff-index $bogus_tree >actual &&
	test_cmp expect actual

ok 7 - diff: small change with long name gives more space to the name

ok 8 - raw diff shows null sha1 (index)

expecting success: 
	test_must_fail git diff-tree -p $empty_tree $bogus_tree

expecting success: 
		git $cmd $args --stat=40 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
ok 13 - --dirstat=0 --cumulative

expecting success: 
	git diff --dirstat=0,cumulative HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git diff --dirstat=0,cumulative -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git diff --dirstat=0,cumulative -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

fatal: unable to read 0000000000000000000000000000000000000000
ok 9 - patch fails due to bogus sha1 (addition)

expecting success: 
	test_must_fail git diff-tree -p $bogus_tree $empty_tree

fatal: unable to read 0000000000000000000000000000000000000000
ok 10 - patch fails due to bogus sha1 (removal)

expecting success: 
	test_must_fail git diff-tree -p $good_tree $bogus_tree

ok 8 - diff --stat=width: a long name is given more room when the bar is short

expecting success: 
		git $cmd $args --stat-width=40 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
fatal: unable to read 0000000000000000000000000000000000000000
ok 11 - patch fails due to bogus sha1 (modification)

expecting success: 
	test_must_fail git diff-tree -p $bogus_tree $good_tree

ok 7 - diff D F and diff F D

expecting success: 
	(
		cd non/git &&
		mkdir d e e/sub &&
		echo 1 >d/sub &&
		echo 2 >e/sub/file &&
		printf "D\td/sub\nA\te/sub/file\n" >expect &&
		test_must_fail git diff --no-index --name-status d e >actual &&
		test_cmp expect actual
	)

fatal: unable to read 0000000000000000000000000000000000000000
ok 12 - patch fails due to bogus sha1 (other direction)

expecting success: 
	test_must_fail git diff-tree -R -p $good_tree $bogus_tree

ok 9 - diff --stat-width=width with long name

expecting success: 
		git $cmd $args --stat=60,30 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
fatal: unable to read 0000000000000000000000000000000000000000
ok 8 - turning a file into a directory

ok 13 - patch fails due to bogus sha1 (reverse)

expecting success: 
	test_must_fail git diff-index -p $bogus_tree

# passed all 8 test(s)
1..8
fatal: unable to read 0000000000000000000000000000000000000000
ok 14 - patch fails due to bogus sha1 (index)

ok 10 - diff --stat=...,name-width with long name

expecting success: 
		git $cmd $args --stat-name-width=30 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
# passed all 14 test(s)
1..14
ok 14 - --dirstat=0,cumulative

expecting success: 
	git diff -X0,cumulative HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git diff -X0,cumulative -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git diff -X0,cumulative -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

*** t4055-diff-context.sh ***
*** t4056-diff-order.sh ***
ok 11 - diff --stat-name-width with long name

expecting success: 
		git $cmd $args >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
ok 12 - show: small change with long name gives more space to the name

expecting success: 
		git $cmd $args --stat=40 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
ok 15 - -X0,cumulative

expecting success: 
	git -c diff.dirstat=0,cumulative diff --dirstat HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git -c diff.dirstat=0,cumulative diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git -c diff.dirstat=0,cumulative diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4055-diff-context/.git/
ok 13 - show --stat=width: a long name is given more room when the bar is short

expecting success: 
		git $cmd $args --stat-width=40 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4056-diff-order/.git/
expecting success: 
	cat >template <<-\EOF &&
	firstline
	b
	c
	d
	e
	f
	preline
	TARGET
	postline
	i
	j
	k
	l
	m
	n
	EOF
	sed "/TARGET/d" >x <template &&
	git update-index --add x &&
	git commit -m initial &&

	sed "s/TARGET/ADDED/" >x <template &&
	git update-index --add x &&
	git commit -m next &&

	sed "s/TARGET/MODIFIED/" >x <template

expecting success: 
	mkdir c &&
	create_files 1 &&
	create_files 2 &&

	cat >order_file_1 <<-\EOF &&
	*Makefile
	*.txt
	*.h
	EOF

	cat >order_file_2 <<-\EOF &&
	*Makefile
	*.h
	*.c
	EOF

	cat >expect_none <<-\EOF &&
	a.h
	b.c
	c/Makefile
	d.txt
	EOF

	cat >expect_1 <<-\EOF &&
	c/Makefile
	d.txt
	a.h
	b.c
	EOF

	cat >expect_2 <<-\EOF
	c/Makefile
	a.h
	b.c
	d.txt
	EOF

ok 14 - show --stat-width=width with long name

expecting success: 
		git $cmd $args --stat=60,30 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
[master (root-commit) aedcee2] initial
 Author: A U Thor <author@example.com>
 1 file changed, 14 insertions(+)
 create mode 100644 x
ok 15 - show --stat=...,name-width with long name

expecting success: 
		git $cmd $args --stat-name-width=30 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
[master (root-commit) 521916c] 1
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 a.h
 create mode 100644 b.c
 create mode 100644 c/Makefile
 create mode 100644 d.txt
ok 16 - diff.dirstat=0,cumulative

expecting success: 
	git -c diff.dirstat=0 diff --dirstat=cumulative HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git -c diff.dirstat=0 diff --dirstat=cumulative -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git -c diff.dirstat=0 diff --dirstat=cumulative -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

ok 16 - show --stat-name-width with long name

expecting success: 
		git $cmd $args >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
[master 7551237] next
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 1 - setup

expecting success: 
	git diff >output &&
	! grep "^ d" output &&
	grep "^ e" output &&
	grep "^ j" output &&
	! grep "^ k" output

ok 17 - log: small change with long name gives more space to the name

expecting success: 
		git $cmd $args --stat=40 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
[master 1a42c18] 2
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+), 4 deletions(-)
 e
 j
ok 1 - setup

expecting success: 
	git diff --name-only HEAD^..HEAD >actual &&
	test_cmp expect_none actual

ok 18 - log --stat=width: a long name is given more room when the bar is short

expecting success: 
		git $cmd $args --stat-width=40 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
ok 2 - the default number of context lines is 3

expecting success: 
	git log -1 -p >output &&
	! grep firstline output &&
	git config diff.context 8 &&
	git log -1 -p >output &&
	grep "^ firstline" output

ok 17 - diff.dirstat=0 & --dirstat=cumulative

ok 2 - no order (=tree object order)

expecting success: 
	rm -f bogus_file &&
	test_must_fail git diff -Obogus_file --name-only HEAD^..HEAD

ok 19 - log --stat-width=width with long name

expecting success: 
	git diff --dirstat-by-file HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git diff --dirstat-by-file -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git diff --dirstat-by-file -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

expecting success: 
		git $cmd $args --stat=60,30 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
fatal: failed to read orderfile 'bogus_file': No such file or directory
ok 3 - missing orderfile

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 20 - log --stat=...,name-width with long name

expecting success: 
		git $cmd $args --stat-name-width=30 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
 firstline
ok 3 - diff.context honored by "log"

expecting success: 
	git config diff.context 8 &&
	git log -U4 -1 >output &&
	! grep "^ firstline" output

rm: cannot remove 'SANETESTD.1/x': Permission denied
ok 21 - log --stat-name-width with long name

expecting success: 
	>abcd &&
	git add abcd &&
	git commit -m message &&
	i=0 &&
	while test $i -lt 1000
	do
		echo $i && i=$(($i + 1))
	done >abcd &&
	git commit -m message abcd

prerequisite SANITY ok
expecting success: 
	>unreadable_file &&
	chmod -r unreadable_file &&
	test_must_fail git diff -Ounreadable_file --name-only HEAD^..HEAD

ok 4 - The -U option overrides diff.context

expecting success: 
	git config diff.context 8 &&
	git diff >output &&
	grep "^ firstline" output

fatal: failed to read orderfile 'unreadable_file': Permission denied
ok 4 - unreadable orderfile

ok 18 - --dirstat-by-file

expecting success: 
		git diff -Oorder_file_$i --name-only HEAD^..HEAD >actual &&
		test_cmp expect_$i actual
	
expecting success: 
	git diff --dirstat=files HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git diff --dirstat=files -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git diff --dirstat=files -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

[master 9ab632c] message
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 abcd
ok 5 - orderfile using option (1)

 firstline
ok 5 - diff.context honored by "diff"

expecting success: 
	git config diff.context 8 &&
	git diff-files -p >output &&
	! grep "^ firstline" output

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

)
prerequisite PIPE ok
expecting success: 
		rm -f order_fifo &&
		mkfifo order_fifo &&
		{
			cat order_file_$i >order_fifo &
		} &&
		git diff -O order_fifo --name-only HEAD^..HEAD >actual &&
		wait &&
		test_cmp expect_$i actual
	
ok 6 - plumbing not affected

expecting success: 
	git config diff.context no &&
	test_must_fail git diff 2>output &&
	test_i18ngrep "bad numeric config value" output

ok 19 - --dirstat=files

expecting success: 
	git -c diff.dirstat=files diff --dirstat HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git -c diff.dirstat=files diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git -c diff.dirstat=files diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

ok 6 - orderfile is fifo (1)

expecting success: 
		git -c diff.orderfile=order_file_$i diff --name-only HEAD^..HEAD >actual &&
		test_cmp expect_$i actual
	
fatal: bad numeric config value 'no' for 'diff.context': invalid unit
ok 7 - non-integer config parsing

expecting success: 
	git config diff.context -1 &&
	test_must_fail git diff 2>output &&
	test_i18ngrep "bad config variable" output

ok 7 - orderfile using config (1)

expecting success: 
		git -c diff.orderfile=order_file_$i diff -O/dev/null --name-only HEAD^..HEAD >actual &&
		test_cmp expect_none actual
	
fatal: bad config variable 'diff.context' in file '.git/config' at line 7
ok 8 - negative integer config parsing

expecting success: 
	git config diff.context 0 &&
	git diff >output &&
	grep "^-ADDED" output &&
	grep "^+MODIFIED" output

[master 1a2a572] message
 Author: A U Thor <author@example.com>
 1 file changed, 1000 insertions(+)
ok 22 - preparation for big change tests

ok 8 - cancelling configured orderfile (1)

expecting success: 
		git diff -Oorder_file_$i --name-only HEAD^..HEAD >actual &&
		test_cmp expect_$i actual
	
expecting success: 
		COLUMNS=200 git $cmd $args >output &&
		grep " | " output >actual &&
		test_cmp "$expect" actual
	
ok 9 - orderfile using option (2)

expecting success: 
		rm -f order_fifo &&
		mkfifo order_fifo &&
		{
			cat order_file_$i >order_fifo &
		} &&
		git diff -O order_fifo --name-only HEAD^..HEAD >actual &&
		wait &&
		test_cmp expect_$i actual
	
-ADDED
+MODIFIED
ok 20 - diff.dirstat=files

ok 9 - -U0 is valid, so is diff.context=0

# passed all 9 test(s)
1..9
expecting success: 
	git diff --dirstat-by-file=10 HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git diff --dirstat-by-file=10 -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git diff --dirstat-by-file=10 -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

ok 23 - format-patch ignores COLUMNS (big change)

expecting success: 
		COLUMNS=200 git $cmd $args --graph >output &&
		grep " | " output >actual &&
		test_cmp "$expect-graph" actual
	
ok 10 - orderfile is fifo (2)

expecting success: 
		git -c diff.orderfile=order_file_$i diff --name-only HEAD^..HEAD >actual &&
		test_cmp expect_$i actual
	
*** t4057-diff-combined-paths.sh ***
ok 11 - orderfile using config (2)

expecting success: 
		git -c diff.orderfile=order_file_$i diff -O/dev/null --name-only HEAD^..HEAD >actual &&
		test_cmp expect_none actual
	
ok 24 - format-patch --graph ignores COLUMNS (big change)

expecting success: 
		COLUMNS=200 git $cmd $args >output &&
		grep " | " output >actual &&
		test_cmp "$expect" actual
	
ok 12 - cancelling configured orderfile (2)

expecting success: 
	git checkout -b tmp HEAD~ &&
	create_files 3 &&
	git checkout master &&
	git merge --no-commit -s ours tmp &&
	create_files 5

ok 21 - --dirstat-by-file=10

expecting success: 
	git diff --dirstat=files,10 HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git diff --dirstat=files,10 -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git diff --dirstat=files,10 -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

ok 25 - diff respects COLUMNS (big change)

expecting success: 
		COLUMNS=200 git $cmd $args >output &&
		grep " | " output >actual &&
		test_cmp "$expect" actual
	
Switched to a new branch 'tmp'
ok 26 - show respects COLUMNS (big change)

expecting success: 
		COLUMNS=200 git $cmd $args >output &&
		grep " | " output >actual &&
		test_cmp "$expect" actual
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4057-diff-combined-paths/.git/
[tmp 29ca6c3] 3
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+), 4 deletions(-)
expecting success: 
	for i in $(test_seq 1 9)
	do
		echo $i >$i.txt	&&
		git add $i.txt
	done &&
	git commit -m "init" &&
	git checkout -b side &&
	for i in $(test_seq 2 9)
	do
		echo $i/2 >>$i.txt
	done &&
	git commit -a -m "side 2-9" &&
	git checkout master &&
	echo 1/2 >1.txt &&
	git commit -a -m "master 1" &&
	git merge side &&
	>diffc.expect &&
	diffc_verify

ok 27 - log respects COLUMNS (big change)

expecting success: 
		COLUMNS=200 git $cmd $args --graph >output &&
		grep " | " output >actual &&
		test_cmp "$expect-graph" actual
	
Switched to branch 'master'
ok 22 - --dirstat=files,10

expecting success: 
	git -c diff.dirstat=10,files diff --dirstat HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git -c diff.dirstat=10,files diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git -c diff.dirstat=10,files diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

ok 28 - log --graph respects COLUMNS (big change)

expecting success: 
		COLUMNS=40 git $cmd $args >output &&
		grep " | " output >actual &&
		test_cmp "$expect" actual
	
Automatic merge went well; stopped before committing as requested
ok 29 - format-patch ignores not enough COLUMNS (big change)

expecting success: 
		COLUMNS=40 git $cmd $args --graph >output &&
		grep " | " output >actual &&
		test_cmp "$expect-graph" actual
	
[master b150b57] 5
 Author: A U Thor <author@example.com>
ok 13 - setup for testing combine-diff order

expecting success: 
	git diff --name-only HEAD HEAD^ HEAD^2 >actual &&
	test_cmp expect_none actual

ok 23 - diff.dirstat=10,files

expecting success: 
	git diff --dirstat-by-file --cumulative HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git diff --dirstat-by-file --cumulative -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git diff --dirstat-by-file --cumulative -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

ok 30 - format-patch --graph ignores not enough COLUMNS (big change)

expecting success: 
		COLUMNS=40 git $cmd $args >output &&
		grep " | " output >actual &&
		test_cmp "$expect" actual
	
ok 14 - combine-diff: no order (=tree object order)

expecting success: 
		git diff -Oorder_file_$i --name-only HEAD HEAD^ HEAD^2 >actual &&
		test_cmp expect_$i actual
	
ok 31 - diff respects not enough COLUMNS (big change)

expecting success: 
		COLUMNS=40 git $cmd $args >output &&
		grep " | " output >actual &&
		test_cmp "$expect" actual
	
ok 15 - combine-diff: orderfile using option (1)

expecting success: 
		git diff -Oorder_file_$i --name-only HEAD HEAD^ HEAD^2 >actual &&
		test_cmp expect_$i actual
	
[master (root-commit) 305ffc2] init
 Author: A U Thor <author@example.com>
 9 files changed, 9 insertions(+)
 create mode 100644 1.txt
 create mode 100644 2.txt
 create mode 100644 3.txt
 create mode 100644 4.txt
 create mode 100644 5.txt
 create mode 100644 6.txt
 create mode 100644 7.txt
 create mode 100644 8.txt
 create mode 100644 9.txt
ok 16 - combine-diff: orderfile using option (2)

ok 32 - show respects not enough COLUMNS (big change)

expecting success: 
		COLUMNS=40 git $cmd $args >output &&
		grep " | " output >actual &&
		test_cmp "$expect" actual
	
# passed all 16 test(s)
1..16
ok 24 - --dirstat-by-file --cumulative

expecting success: 
	git diff --dirstat=files,cumulative HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git diff --dirstat=files,cumulative -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git diff --dirstat=files,cumulative -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

Switched to a new branch 'side'
ok 33 - log respects not enough COLUMNS (big change)

expecting success: 
		COLUMNS=40 git $cmd $args --graph >output &&
		grep " | " output >actual &&
		test_cmp "$expect-graph" actual
	
ok 34 - log --graph respects not enough COLUMNS (big change)

*** t4058-diff-duplicates.sh ***
expecting success: 
		git -c diff.statGraphWidth=26 $cmd $args >output &&
		grep " | " output >actual &&
		test_cmp "$expect" actual
	
[side 16279df] side 2-9
 Author: A U Thor <author@example.com>
 8 files changed, 8 insertions(+)
ok 25 - --dirstat=files,cumulative

expecting success: 
	git -c diff.dirstat=cumulative,files diff --dirstat HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git -c diff.dirstat=cumulative,files diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git -c diff.dirstat=cumulative,files diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

Switched to branch 'master'
ok 35 - format-patch ignores statGraphWidth config

expecting success: 
		git -c diff.statGraphWidth=26 $cmd $args --graph >output &&
		grep " | " output >actual &&
		test_cmp "$expect-graph" actual
	
[master 02ba9b4] master 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 36 - format-patch --graph ignores statGraphWidth config

expecting success: 
		git -c diff.statGraphWidth=26 $cmd $args >output &&
		grep " | " output >actual &&
		test_cmp "$expect" actual
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4058-diff-duplicates/.git/
expecting success: 
	blob_one=$(echo one | git hash-object -w --stdin) &&
	blob_two=$(echo two | git hash-object -w --stdin) &&
	inner_one_a=$(make_tree \
		100644 inner $blob_one
	) &&
	inner_one_b=$(make_tree \
		100644 inner $blob_two \
		100644 inner $blob_two \
		100644 inner $blob_two
	) &&
	outer_one=$(make_tree \
		040000 outer $inner_one_a \
		040000 outer $inner_one_b
	) &&
	inner_two=$(make_tree \
		100644 inner $blob_one \
		100644 inner $blob_two \
		100644 inner $blob_two \
		100644 inner $blob_two
	) &&
	outer_two=$(make_tree \
		040000 outer $inner_two
	) &&
	git tag one $outer_one &&
	git tag two $outer_two

Merging:
02ba9b4 master 1
virtual side
found 1 common ancestor:
305ffc2 init
Merge made by the 'recursive' strategy.
ok 37 - diff respects statGraphWidth config

expecting success: 
		git -c diff.statGraphWidth=26 $cmd $args >output &&
		grep " | " output >actual &&
		test_cmp "$expect" actual
	
ok 26 - diff.dirstat=cumulative,files

 2.txt | 1 +
 3.txt | 1 +
 4.txt | 1 +
 5.txt | 1 +
 6.txt | 1 +
 7.txt | 1 +
 8.txt | 1 +
 9.txt | 1 +
 8 files changed, 8 insertions(+)
expecting success: 
	git diff --dirstat=files,cumulative,10 HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git diff --dirstat=files,cumulative,10 -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git diff --dirstat=files,cumulative,10 -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

ok 1 - trivial merge - combine-diff empty

expecting success: 
	git checkout side &&
	for i in $(test_seq 2 9)
	do
		echo $i/3 >>$i.txt
	done &&
	echo "4side" >>4.txt &&
	git commit -a -m "side 2-9 +4" &&
	git checkout master &&
	for i in $(test_seq 1 9)
	do
		echo $i/3 >>$i.txt
	done &&
	echo "4master" >>4.txt &&
	git commit -a -m "master 1-9 +4" &&
	test_must_fail git merge side &&
	cat <<-\EOF >4.txt &&
	4
	4/2
	4/3
	4master
	4side
	EOF
	git add 4.txt &&
	git commit -m "merge side (2)" &&
	echo 4.txt >diffc.expect &&
	diffc_verify

ok 38 - show respects statGraphWidth config

expecting success: 
		git -c diff.statGraphWidth=26 $cmd $args >output &&
		grep " | " output >actual &&
		test_cmp "$expect" actual
	
Switched to branch 'side'
ok 39 - log respects statGraphWidth config

expecting success: 
		git -c diff.statGraphWidth=26 $cmd $args --graph >output &&
		grep " | " output >actual &&
		test_cmp "$expect-graph" actual
	
ok 27 - --dirstat=files,cumulative,10

expecting success: 
	git -c diff.dirstat=10,cumulative,files diff --dirstat HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git -c diff.dirstat=10,cumulative,files diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git -c diff.dirstat=10,cumulative,files diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

ok 40 - log --graph respects statGraphWidth config

[side 56db98d] side 2-9 +4
 Author: A U Thor <author@example.com>
 8 files changed, 9 insertions(+)
expecting success: 
		git $cmd $args --stat=40 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
Switched to branch 'master'
ok 41 - format-patch --stat=width with big change

expecting success: 
		git $cmd $args --stat-width=40 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
ok 42 - format-patch --stat-width=width with big change

expecting success: 
		git $cmd $args --stat-graph-width=26 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
[master 3d0a7bc] master 1-9 +4
 Author: A U Thor <author@example.com>
 9 files changed, 10 insertions(+)
ok 28 - diff.dirstat=10,cumulative,files

expecting success: 
	git diff --dirstat=files,cumulative,16.7 HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git diff --dirstat=files,cumulative,16.7 -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git diff --dirstat=files,cumulative,16.7 -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

Merging:
3d0a7bc master 1-9 +4
virtual side
found 1 common ancestor:
16279df side 2-9
Auto-merging 4.txt
CONFLICT (content): Merge conflict in 4.txt
Automatic merge failed; fix conflicts and then commit the result.
ok 1 - create trees with duplicate entries

expecting success: 
	{
		printf ":000000 100644 $_z40 $blob_two A\touter/inner\n" &&
		printf ":000000 100644 $_z40 $blob_two A\touter/inner\n" &&
		printf ":000000 100644 $_z40 $blob_two A\touter/inner\n" &&
		printf ":100644 000000 $blob_two $_z40 D\touter/inner\n" &&
		printf ":100644 000000 $blob_two $_z40 D\touter/inner\n" &&
		printf ":100644 000000 $blob_two $_z40 D\touter/inner\n"
	} >expect &&
	git diff-tree -r --no-abbrev one two >actual &&
	test_cmp expect actual

ok 43 - format-patch --stat-graph-width with big change

expecting success: 
		git $cmd $args --stat-width=40 --graph >output &&
		grep " | " output >actual &&
		test_cmp expect-graph actual
	
ok 2 - diff-tree between trees

expecting success: 
	# same expectation as above, since we disable rename detection
	git diff-tree -M -r --no-abbrev one two >actual &&
	test_cmp expect actual

warning: skipping rename detection, detected duplicate destination 'outer/inner'
ok 3 - diff-tree with renames

[master 7b1ae75] merge side (2)
 Author: A U Thor <author@example.com>
ok 44 - format-patch --stat-width=width --graph with big change

expecting success: 
		git $cmd $args --stat-graph-width=26 --graph >output &&
		grep " | " output >actual &&
		test_cmp expect-graph actual
	
# passed all 3 test(s)
1..3
ok 2 - only one trully conflicting path

expecting success: 
	git checkout side &&
	for i in $(test_seq 5 9)
	do
		echo $i/4 >>$i.txt
	done &&
	git commit -a -m "side 5-9" &&
	git checkout master &&
	for i in $(test_seq 1 3)
	do
		echo $i/4 >>$i.txt
	done &&
	git commit -a -m "master 1-3 +4hello" &&
	git merge side &&
	echo "Hello World" >4hello.txt &&
	git add 4hello.txt &&
	git commit --amend &&
	echo 4hello.txt >diffc.expect &&
	diffc_verify

ok 29 - --dirstat=files,cumulative,16.7

expecting success: 
	git -c diff.dirstat=16.7,cumulative,files diff --dirstat HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git -c diff.dirstat=16.7,cumulative,files diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git -c diff.dirstat=16.7,cumulative,files diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

*** t4100-apply-stat.sh ***
ok 45 - format-patch --stat-graph-width --graph with big change

expecting success: 
		git $cmd $args --stat=40 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
Switched to branch 'side'
ok 46 - diff --stat=width with big change

expecting success: 
		git $cmd $args --stat-width=40 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
[side 731c14c] side 5-9
 Author: A U Thor <author@example.com>
 5 files changed, 5 insertions(+)
ok 47 - diff --stat-width=width with big change

expecting success: 
		git $cmd $args --stat-graph-width=26 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
Switched to branch 'master'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4100-apply-stat/.git/
ok 30 - diff.dirstat=16.7,cumulative,files

expecting success: 
	git -c diff.dirstat=16.70,cumulative,files diff --dirstat HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git -c diff.dirstat=16.70,cumulative,files diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git -c diff.dirstat=16.70,cumulative,files diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

expecting success: 
		git apply --stat --summary \
			<"$TEST_DIRECTORY/t4100/t-apply-$num.patch" >current &&
		test_i18ncmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
	
ok 48 - diff --stat-graph-width with big change

expecting success: 
		git $cmd $args --stat=40 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
ok 1 - rename

expecting success: 
		sed -e "$UNC" <"$TEST_DIRECTORY/t4100/t-apply-$num.patch" |
		git apply --recount --stat --summary >current &&
		test_i18ncmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
	
[master 65cb8a2] master 1-3 +4hello
 Author: A U Thor <author@example.com>
 3 files changed, 3 insertions(+)
ok 2 - rename with recount

ok 49 - show --stat=width with big change

expecting success: 
		git apply --stat --summary \
			<"$TEST_DIRECTORY/t4100/t-apply-$num.patch" >current &&
		test_i18ncmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
	
expecting success: 
		git $cmd $args --stat-width=40 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
ok 3 - copy
ok 31 - diff.dirstat=16.70,cumulative,files


expecting success: 
		sed -e "$UNC" <"$TEST_DIRECTORY/t4100/t-apply-$num.patch" |
		git apply --recount --stat --summary >current &&
		test_i18ncmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
	
expecting success: 
	git diff --dirstat=files,cumulative,27.2 HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git diff --dirstat=files,cumulative,27.2 -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git diff --dirstat=files,cumulative,27.2 -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

Merging:
65cb8a2 master 1-3 +4hello
virtual side
found 1 common ancestor:
56db98d side 2-9 +4
Merge made by the 'recursive' strategy.
 5.txt | 1 +
 6.txt | 1 +
 7.txt | 1 +
 8.txt | 1 +
 9.txt | 1 +
 5 files changed, 5 insertions(+)
ok 50 - show --stat-width=width with big change

expecting success: 
		git $cmd $args --stat-graph-width=26 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
ok 4 - copy with recount

expecting success: 
		git apply --stat --summary \
			<"$TEST_DIRECTORY/t4100/t-apply-$num.patch" >current &&
		test_i18ncmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
	
ok 5 - rewrite

expecting success: 
		sed -e "$UNC" <"$TEST_DIRECTORY/t4100/t-apply-$num.patch" |
		git apply --recount --stat --summary >current &&
		test_i18ncmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
	
ok 51 - show --stat-graph-width with big change

expecting success: 
		git $cmd $args --stat=40 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
[master 720e400] Merge branch 'side'
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:57:22 2015 +0000
ok 6 - rewrite with recount

expecting success: 
		git apply --stat --summary \
			<"$TEST_DIRECTORY/t4100/t-apply-$num.patch" >current &&
		test_i18ncmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
	
ok 52 - log --stat=width with big change

expecting success: 
		git $cmd $args --stat-width=40 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
ok 3 - merge introduces new file

expecting success: 
	git checkout side &&
	for i in $(test_seq 5 9)
	do
		echo $i/5 >>$i.txt
	done &&
	git commit -a -m "side 5-9" &&
	git checkout master &&
	for i in $(test_seq 1 3)
	do
		echo $i/4 >>$i.txt
	done &&
	git commit -a -m "master 1-3" &&
	git merge side &&
	git rm 4.txt &&
	git commit --amend &&
	echo 4.txt >diffc.expect &&
	diffc_verify

ok 7 - mode

ok 32 - --dirstat=files,cumulative,27.2

expecting success: 
		sed -e "$UNC" <"$TEST_DIRECTORY/t4100/t-apply-$num.patch" |
		git apply --recount --stat --summary >current &&
		test_i18ncmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
	
expecting success: 
	git diff --dirstat=files,cumulative,27.09 HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git diff --dirstat=files,cumulative,27.09 -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git diff --dirstat=files,cumulative,27.09 -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

ok 53 - log --stat-width=width with big change

expecting success: 
		git $cmd $args --stat-graph-width=26 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
ok 8 - mode with recount

expecting success: 
		git apply --stat --summary \
			<"$TEST_DIRECTORY/t4100/t-apply-$num.patch" >current &&
		test_i18ncmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
	
Switched to branch 'side'
ok 9 - non git (1)

expecting success: 
		sed -e "$UNC" <"$TEST_DIRECTORY/t4100/t-apply-$num.patch" |
		git apply --recount --stat --summary >current &&
		test_i18ncmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
	
ok 54 - log --stat-graph-width with big change

expecting success: 
		git $cmd $args --stat-width=40 --graph >output &&
		grep " | " output >actual &&
		test_cmp expect-graph actual
	
ok 10 - non git (1) with recount

expecting success: 
		git apply --stat --summary \
			<"$TEST_DIRECTORY/t4100/t-apply-$num.patch" >current &&
		test_i18ncmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
	
ok 55 - log --stat-width=width --graph with big change

expecting success: 
		git $cmd $args --stat-graph-width=26 --graph >output &&
		grep " | " output >actual &&
		test_cmp expect-graph actual
	
ok 11 - non git (2)

expecting success: 
		sed -e "$UNC" <"$TEST_DIRECTORY/t4100/t-apply-$num.patch" |
		git apply --recount --stat --summary >current &&
		test_i18ncmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
	
[side 840d11d] side 5-9
 Author: A U Thor <author@example.com>
 5 files changed, 5 insertions(+)
ok 33 - --dirstat=files,cumulative,27.09

ok 12 - non git (2) with recount

expecting success: 
		git apply --stat --summary \
			<"$TEST_DIRECTORY/t4100/t-apply-$num.patch" >current &&
		test_i18ncmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
	
expecting success: 
	git diff --dirstat=lines HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git diff --dirstat=lines -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git diff --dirstat=lines -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

ok 56 - log --stat-graph-width --graph with big change

expecting success: 
	cp abcd aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &&
	git add aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &&
	git commit -m message

Switched to branch 'master'
ok 13 - non git (3)

expecting success: 
		sed -e "$UNC" <"$TEST_DIRECTORY/t4100/t-apply-$num.patch" |
		git apply --recount --stat --summary >current &&
		test_i18ncmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
	
ok 14 - non git (3) with recount

expecting success: 
		git apply --stat --summary \
			<"$TEST_DIRECTORY/t4100/t-apply-$num.patch" >current &&
		test_i18ncmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
	
ok 15 - incomplete (1)

expecting success: 
		sed -e "$UNC" <"$TEST_DIRECTORY/t4100/t-apply-$num.patch" |
		git apply --recount --stat --summary >current &&
		test_i18ncmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
	
[master 16ab217] message
 Author: A U Thor <author@example.com>
 1 file changed, 1000 insertions(+)
 create mode 100644 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
ok 57 - preparation for long filename tests

[master b6354e2] master 1-3
 Author: A U Thor <author@example.com>
 3 files changed, 3 insertions(+)
expecting success: 
		git $cmd $args --stat-width=60 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
ok 16 - incomplete (1) with recount

expecting success: 
		git apply --stat --summary \
			<"$TEST_DIRECTORY/t4100/t-apply-$num.patch" >current &&
		test_i18ncmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
	
ok 17 - incomplete (2)

expecting success: 
		sed -e "$UNC" <"$TEST_DIRECTORY/t4100/t-apply-$num.patch" |
		git apply --recount --stat --summary >current &&
		test_i18ncmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
	
Merging:
b6354e2 master 1-3
virtual side
found 1 common ancestor:
731c14c side 5-9
Merge made by the 'recursive' strategy.
ok 34 - --dirstat=lines

expecting success: 
	git -c diff.dirstat=lines diff --dirstat HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git -c diff.dirstat=lines diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git -c diff.dirstat=lines diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

ok 58 - format-patch --stat=width with big change is more balanced

expecting success: 
		git $cmd $args --stat-width=60 --graph >output &&
		grep " | " output >actual &&
		test_cmp expect-graph actual
	
 5.txt | 1 +
 6.txt | 1 +
 7.txt | 1 +
 8.txt | 1 +
 9.txt | 1 +
 5 files changed, 5 insertions(+)
ok 18 - incomplete (2) with recount

# passed all 18 test(s)
1..18
rm '4.txt'
ok 59 - format-patch --stat=width --graph with big change is balanced

expecting success: 
		git $cmd $args --stat-width=60 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
*** t4101-apply-nonl.sh ***
[master 2ab37d4] Merge branch 'side'
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:57:22 2015 +0000
ok 4 - merge removed a file

ok 60 - diff --stat=width with big change is more balanced

expecting success: 
		git $cmd $args --stat-width=60 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
# passed all 4 test(s)
1..4
ok 35 - diff.dirstat=lines

expecting success: 
	git diff --dirstat=lines,0 HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git diff --dirstat=lines,0 -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git diff --dirstat=lines,0 -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

ok 61 - show --stat=width with big change is more balanced

expecting success: 
		git $cmd $args --stat-width=60 >output &&
		grep " | " output >actual &&
		test_cmp expect actual
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4101-apply-nonl/.git/
ok 62 - log --stat=width with big change is more balanced

expecting success: 
		git $cmd $args --stat-width=60 --graph >output &&
		grep " | " output >actual &&
		test_cmp expect-graph actual
	
*** t4102-apply-rename.sh ***
expecting success: 
	git apply <"$TEST_DIRECTORY"/t4101/diff.$i-$j &&
	test_cmp frotz.$j frotz
    
ok 63 - log --stat=width --graph with big change is balanced

ok 1 - apply diff between 0 and 1

expecting success: 
	git apply <"$TEST_DIRECTORY"/t4101/diff.$i-$j &&
	test_cmp frotz.$j frotz
    
ok 36 - --dirstat=lines,0

expecting success: 
	git -c diff.dirstat=0,lines diff --dirstat HEAD^..HEAD >actual_diff_dirstat &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	git -c diff.dirstat=0,lines diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	git -c diff.dirstat=0,lines diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC

expecting success: 
		COLUMNS=200 git $cmd $args >output &&
		grep " | " output >actual &&
		test_cmp "$expect" actual
	
ok 2 - apply diff between 0 and 2

expecting success: 
	git apply <"$TEST_DIRECTORY"/t4101/diff.$i-$j &&
	test_cmp frotz.$j frotz
    
ok 3 - apply diff between 0 and 3
ok 64 - format-patch ignores COLUMNS (long filename)


expecting success: 
		COLUMNS=200 git $cmd $args --graph >output &&
		grep " | " output >actual &&
		test_cmp "$expect-graph" actual
	
expecting success: 
	git apply <"$TEST_DIRECTORY"/t4101/diff.$i-$j &&
	test_cmp frotz.$j frotz
    
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4102-apply-rename/.git/
ok 4 - apply diff between 1 and 0

expecting success: 
	git apply <"$TEST_DIRECTORY"/t4101/diff.$i-$j &&
	test_cmp frotz.$j frotz
    
expecting success: git update-index --add foo
ok 65 - format-patch --graph ignores COLUMNS (long filename)

expecting success: 
		COLUMNS=200 git $cmd $args >output &&
		grep " | " output >actual &&
		test_cmp "$expect" actual
	
ok 5 - apply diff between 1 and 2

expecting success: 
	git apply <"$TEST_DIRECTORY"/t4101/diff.$i-$j &&
	test_cmp frotz.$j frotz
    
ok 1 - setup

expecting success: git apply --index --stat --summary --apply test-patch
ok 37 - diff.dirstat=0,lines

expecting success: 
	test_must_fail git diff --dirstat=future_param,lines,0 HEAD^..HEAD >actual_diff_dirstat 2>actual_error &&
	test_debug "cat actual_error" &&
	test_cmp /dev/null actual_diff_dirstat &&
	test_i18ngrep -q "future_param" actual_error &&
	test_i18ngrep -q "\--dirstat" actual_error

ok 6 - apply diff between 1 and 3

ok 66 - diff respects COLUMNS (long filename)

expecting success: 
		COLUMNS=200 git $cmd $args >output &&
		grep " | " output >actual &&
		test_cmp "$expect" actual
	
expecting success: 
	git apply <"$TEST_DIRECTORY"/t4101/diff.$i-$j &&
	test_cmp frotz.$j frotz
    
 bar |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename foo => bar (47%)
ok 2 - apply

checking prerequisite: FILEMODE

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	test "$(git config --bool core.filemode)" = true

)
ok 7 - apply diff between 2 and 0

expecting success: 
	git apply <"$TEST_DIRECTORY"/t4101/diff.$i-$j &&
	test_cmp frotz.$j frotz
    
ok 38 - --dirstat=future_param,lines,0 should fail loudly

expecting success: 
	test_must_fail git diff --dirstat=dummy1,cumulative,2dummy HEAD^..HEAD >actual_diff_dirstat 2>actual_error &&
	test_debug "cat actual_error" &&
	test_cmp /dev/null actual_diff_dirstat &&
	test_i18ngrep -q "dummy1" actual_error &&
	test_i18ngrep -q "2dummy" actual_error &&
	test_i18ngrep -q "\--dirstat" actual_error

ok 67 - show respects COLUMNS (long filename)

expecting success: 
		COLUMNS=200 git $cmd $args >output &&
		grep " | " output >actual &&
		test_cmp "$expect" actual
	
prerequisite FILEMODE ok
expecting success: test -f bar && ls -l bar | grep "^-..x......"
-rwxrwxr-x 1 buildd buildd 12 Dec 16 10:57 bar
ok 3 - validate

expecting success: git apply -R --index --stat --summary --apply test-patch &&
     test "$(cat foo)" = "This is foo"
ok 8 - apply diff between 2 and 1

expecting success: 
	git apply <"$TEST_DIRECTORY"/t4101/diff.$i-$j &&
	test_cmp frotz.$j frotz
    
 foo |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename bar => foo (47%)
ok 68 - log respects COLUMNS (long filename)

expecting success: 
		COLUMNS=200 git $cmd $args --graph >output &&
		grep " | " output >actual &&
		test_cmp "$expect-graph" actual
	
ok 4 - apply reverse

expecting success: git apply --index --stat --summary --apply test-patch &&
     test "$(cat bar)" = "This is bar" && test "$(cat foo)" = "This is foo"
ok 39 - --dirstat=dummy1,cumulative,2dummy should report both unrecognized parameters

expecting success: 
	git -c diff.dirstat=future_param,0,lines diff --dirstat HEAD^..HEAD >actual_diff_dirstat 2>actual_error &&
	test_debug "cat actual_error" &&
	test_cmp expect_diff_dirstat actual_diff_dirstat &&
	test_i18ngrep -q "future_param" actual_error &&
	test_i18ngrep -q "diff\\.dirstat" actual_error &&

	git -c diff.dirstat=future_param,0,lines diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M 2>actual_error &&
	test_debug "cat actual_error" &&
	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
	test_i18ngrep -q "future_param" actual_error &&
	test_i18ngrep -q "diff\\.dirstat" actual_error &&

	git -c diff.dirstat=future_param,0,lines diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC 2>actual_error &&
	test_debug "cat actual_error" &&
	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC &&
	test_i18ngrep -q "future_param" actual_error &&
	test_i18ngrep -q "diff\\.dirstat" actual_error

ok 9 - apply diff between 2 and 3

expecting success: 
	git apply <"$TEST_DIRECTORY"/t4101/diff.$i-$j &&
	test_cmp frotz.$j frotz
    
 bar |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 copy foo => bar (47%)
ok 69 - log --graph respects COLUMNS (long filename)

ok 5 - apply copy

ok 10 - apply diff between 3 and 0

expecting success: 
		COLUMNS=1 git $cmd $args >output &&
		grep " | " output >actual &&
		test_cmp "$expect" actual
	
expecting success: 
	git apply <"$TEST_DIRECTORY"/t4101/diff.$i-$j &&
	test_cmp frotz.$j frotz
    
# passed all 5 test(s)
1..5
ok 11 - apply diff between 3 and 1

expecting success: 
	git apply <"$TEST_DIRECTORY"/t4101/diff.$i-$j &&
	test_cmp frotz.$j frotz
    
ok 70 - format-patch ignores prefix greater than COLUMNS (big change)

*** t4103-apply-binary.sh ***
expecting success: 
		COLUMNS=1 git $cmd $args --graph >output &&
		grep " | " output >actual &&
		test_cmp "$expect-graph" actual
	
ok 12 - apply diff between 3 and 2

# passed all 12 test(s)
1..12
ok 71 - format-patch --graph ignores prefix greater than COLUMNS (big change)

expecting success: 
		COLUMNS=1 git $cmd $args >output &&
		grep " | " output >actual &&
		test_cmp "$expect" actual
	
*** t4104-apply-boundary.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4103-apply-binary/.git/
ok 72 - diff respects prefix greater than COLUMNS (big change)

ok 40 - diff.dirstat=future_param,0,lines should warn, but still work

expecting success: 
	git diff --shortstat --dirstat=changes HEAD^..HEAD >out &&
	grep " dst/copy/changed/$" out >actual_diff_shortstat_dirstat_changes &&
	test_line_count = 1 actual_diff_shortstat_dirstat_changes &&

	git diff --shortstat --dirstat=lines HEAD^..HEAD >out &&
	grep " dst/copy/changed/$" out >actual_diff_shortstat_dirstat_lines &&
	test_line_count = 1 actual_diff_shortstat_dirstat_lines &&

	git diff --shortstat --dirstat=files HEAD^..HEAD >out &&
	grep " dst/copy/changed/$" out >actual_diff_shortstat_dirstat_files &&
	test_line_count = 1 actual_diff_shortstat_dirstat_files

expecting success: 
		COLUMNS=1 git $cmd $args >output &&
		grep " | " output >actual &&
		test_cmp "$expect" actual
	
expecting success: 
	cat >file1 <<-\EOF &&
	A quick brown fox jumps over the lazy dog.
	A tiny little penguin runs around in circles.
	There is a flag with Linux written on it.
	A slow black-and-white panda just sits there,
	munching on his bamboo.
	EOF
	cat file1 >file2 &&
	cat file1 >file4 &&

	git update-index --add --remove file1 file2 file4 &&
	git commit -m "Initial Version" 2>/dev/null &&

	git checkout -b binary &&
	perl -pe "y/x/\000/" <file1 >file3 &&
	cat file3 >file4 &&
	git add file2 &&
	perl -pe "y/\000/v/" <file3 >file1 &&
	rm -f file2 &&
	git update-index --add --remove file1 file2 file3 file4 &&
	git commit -m "Second Version" &&

	git diff-tree -p master binary >B.diff &&
	git diff-tree -p -C master binary >C.diff &&

	git diff-tree -p --binary master binary >BF.diff &&
	git diff-tree -p --binary -C master binary >CF.diff &&

	git diff-tree -p --full-index master binary >B-index.diff &&
	git diff-tree -p -C --full-index master binary >C-index.diff &&

	git diff-tree -p --binary --no-prefix master binary -- file3 >B0.diff &&

	git init other-repo &&
	(
		cd other-repo &&
		git fetch .. master &&
		git reset --hard FETCH_HEAD
	)

ok 73 - show respects prefix greater than COLUMNS (big change)

expecting success: 
		COLUMNS=1 git $cmd $args >output &&
		grep " | " output >actual &&
		test_cmp "$expect" actual
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4104-apply-boundary/.git/
ok 74 - log respects prefix greater than COLUMNS (big change)

[master (root-commit) 8f514b2] Initial Version
 Author: A U Thor <author@example.com>
 3 files changed, 15 insertions(+)
 create mode 100644 file1
 create mode 100644 file2
 create mode 100644 file4
expecting success: 
		COLUMNS=1 git $cmd $args --graph >output &&
		grep " | " output >actual &&
		test_cmp "$expect-graph" actual
	
expecting success: 
	for i in b c d e f g h i j k l m n o p q r s t u v w x y
	do
		echo $i
	done >victim &&
	cat victim >original &&
	git update-index --add victim &&

	# add to the head
	for i in 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
	do
		echo $i
	done >victim &&
	cat victim >add-a-expect &&
	git diff victim >add-a-patch.with &&
	git diff --unified=0 >add-a-patch.without &&

	# insert at line two
	for i in b a c d e f g h i j k l m n o p q r s t u v w x y
	do
		echo $i
	done >victim &&
	cat victim >insert-a-expect &&
	git diff victim >insert-a-patch.with &&
	git diff --unified=0 >insert-a-patch.without &&

	# modify at the head
	for i in a c d e f g h i j k l m n o p q r s t u v w x y
	do
		echo $i
	done >victim &&
	cat victim >mod-a-expect &&
	git diff victim >mod-a-patch.with &&
	git diff --unified=0 >mod-a-patch.without &&

	# remove from the head
	for i in c d e f g h i j k l m n o p q r s t u v w x y
	do
		echo $i
	done >victim &&
	cat victim >del-a-expect &&
	git diff victim >del-a-patch.with &&
	git diff --unified=0 >del-a-patch.without &&

	# add to the tail
	for i in 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
	do
		echo $i
	done >victim &&
	cat victim >add-z-expect &&
	git diff victim >add-z-patch.with &&
	git diff --unified=0 >add-z-patch.without &&

	# modify at the tail
	for i in b c d e f g h i j k l m n o p q r s t u v w x z
	do
		echo $i
	done >victim &&
	cat victim >mod-z-expect &&
	git diff victim >mod-z-patch.with &&
	git diff --unified=0 >mod-z-patch.without &&

	# remove from the tail
	for i in b c d e f g h i j k l m n o p q r s t u v w x
	do
		echo $i
	done >victim &&
	cat victim >del-z-expect &&
	git diff victim >del-z-patch.with &&
	git diff --unified=0 >del-z-patch.without

	# done

Switched to a new branch 'binary'
ok 41 - --shortstat --dirstat should output only one dirstat

ok 75 - log --graph respects prefix greater than COLUMNS (big change)

# passed all 41 test(s)
1..41
expecting success: 
	git checkout -b branch HEAD^^ &&
	COLUMNS=100 git merge --stat --no-ff master^ >output &&
	grep " | " output >actual &&
	test_cmp expect actual

Switched to a new branch 'branch'
[binary e4a83a6] Second Version
 Author: A U Thor <author@example.com>
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename file2 => file3 (57%)
*** t4105-apply-fuzz.sh ***
ok 76 - merge --stat respects COLUMNS (big change)

expecting success: 
	COLUMNS=100 git merge --stat --no-ff master >output &&
	grep " | " output >actual &&
	test_cmp expect actual

ok 77 - merge --stat respects COLUMNS (long filename)

# passed all 77 test(s)
1..77
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4105-apply-fuzz/.git/
expecting success: 

	for i in 1 2 3 4 5 6 7 8 9 10 11 12
	do
		echo $i
	done >file &&
	git update-index --add file &&
	for i in 1 2 3 4 5 6 7 a b c d e 8 9 10 11 12
	do
		echo $i
	done >file &&
	cat file >expect &&
	git diff >O0.diff &&

	sed -e "s/@@ -5,6 +5,11 @@/@@ -2,6 +2,11 @@/" >O1.diff O0.diff &&
	sed -e "s/@@ -5,6 +5,11 @@/@@ -7,6 +7,11 @@/" >O2.diff O0.diff &&
	sed -e "s/@@ -5,6 +5,11 @@/@@ -19,6 +19,11 @@/" >O3.diff O0.diff &&

	sed -e "s/^ 5/ S/" >F0.diff O0.diff &&
	sed -e "s/^ 5/ S/" >F1.diff O1.diff &&
	sed -e "s/^ 5/ S/" >F2.diff O2.diff &&
	sed -e "s/^ 5/ S/" >F3.diff O3.diff


*** t4106-apply-stdin.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4103-apply-binary/other-repo/.git/
ok 1 - setup

expecting success: 
			cat original >victim &&
			git update-index victim &&
			git apply --index add-a-patch.with &&
			test_cmp add-a-expect victim
		
ok 1 - setup

expecting success: 
		git checkout-index -f -q -u file &&
		git apply O0.diff &&
		test_cmp expect file
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4106-apply-stdin/.git/
ok 2 - apply add-a-patch with context

expecting success: 
			cat original >victim &&
			git update-index victim &&
			git apply --index add-z-patch.with &&
			test_cmp add-z-expect victim
		
expecting success: 
	echo hello >text &&
	git add text &&
	echo goodbye >text &&
	git diff >patch

ok 2 - unmodified patch

expecting success: 
		git checkout-index -f -q -u file &&
		git apply O1.diff &&
		test_cmp expect file
	
ok 1 - setup

expecting success: 
	echo "1	1	text" >expect &&
	git apply --numstat - <patch >actual &&
	test_cmp expect actual

ok 3 - apply add-z-patch with context

expecting success: 
			cat original >victim &&
			git update-index victim &&
			git apply --index insert-a-patch.with &&
			test_cmp insert-a-expect victim
		
From ..
 * branch            master     -> FETCH_HEAD
ok 3 - minus offset

expecting success: 
		git checkout-index -f -q -u file &&
		git apply O2.diff &&
		test_cmp expect file
	
ok 2 - git apply --numstat - < patch

expecting success: 
	for i in 1 2; do echo "1	1	text"; done >expect &&
	git apply --numstat - < patch patch >actual &&
	test_cmp expect actual

ok 3 - git apply --numstat - < patch patch

HEAD is now at 8f514b2 Initial Version
ok 4 - apply insert-a-patch with context

expecting success: 
			cat original >victim &&
			git update-index victim &&
			git apply --index mod-a-patch.with &&
			test_cmp mod-a-expect victim
		
ok 4 - plus offset

expecting success: 
		git checkout-index -f -q -u file &&
		git apply O3.diff &&
		test_cmp expect file
	
ok 1 - setup

expecting success: git checkout master &&
	 git apply --stat --summary B.diff
# passed all 3 test(s)
1..3
Switched to branch 'master'
*** t4107-apply-ignore-whitespace.sh ***
 file1 |    4 ++--
 file2 |    5 -----
 file3 |  Bin
 file4 |  Bin
 4 files changed, 2 insertions(+), 7 deletions(-)
 delete mode 100644 file2
 create mode 100644 file3
ok 2 - stat binary diff -- should not fail.

expecting success: 
	 git checkout master &&
	 git apply --stat -p0 B0.diff

ok 5 - apply mod-a-patch with context

expecting success: 
			cat original >victim &&
			git update-index victim &&
			git apply --index mod-z-patch.with &&
			test_cmp mod-z-expect victim
		
ok 5 - big offset

expecting success: 
		git checkout-index -f -q -u file &&
		git apply -C2 F0.diff &&
		test_cmp expect file
	
Already on 'master'
Context reduced to (2/2) to apply fragment at 6
ok 6 - fuzz with no offset

 file3 |  Bin
 1 file changed, 0 insertions(+), 0 deletions(-)
expecting success: 
		git checkout-index -f -q -u file &&
		git apply -C2 F1.diff &&
		test_cmp expect file
	
ok 3 - stat binary -p0 diff -- should not fail.

expecting success: git checkout master &&
	 git apply --stat --summary C.diff
ok 6 - apply mod-z-patch with context

expecting success: 
			cat original >victim &&
			git update-index victim &&
			git apply --index del-a-patch.with &&
			test_cmp del-a-expect victim
		
Already on 'master'
Context reduced to (2/2) to apply fragment at 6
ok 7 - fuzz with minus offset

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4107-apply-ignore-whitespace/.git/
expecting success: 
		git checkout-index -f -q -u file &&
		git apply -C2 F2.diff &&
		test_cmp expect file
	
 file1 |    4 ++--
 file3 |  Bin
 file4 |  Bin
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename file2 => file3 (57%)
ok 4 - stat binary diff (copy) -- should not fail.

expecting success: git checkout master &&
	 test_must_fail git apply --check B.diff
ok 7 - apply del-a-patch with context

expecting success: 
			cat original >victim &&
			git update-index victim &&
			git apply --index del-z-patch.with &&
			test_cmp del-z-expect victim
		
Already on 'master'
Context reduced to (2/2) to apply fragment at 6
error: cannot apply binary patch to 'file3' without full index line
error: file3: patch does not apply
error: cannot apply binary patch to 'file4' without full index line
error: file4: patch does not apply
ok 8 - fuzz with plus offset

expecting success: 
		git checkout-index -f -q -u file &&
		git apply -C2 F3.diff &&
		test_cmp expect file
	
ok 5 - check binary diff -- should fail.

expecting success: git checkout master &&
	 test_must_fail git apply --check C.diff
expecting success: 
	git apply patch1.patch

ok 8 - apply del-z-patch with context

expecting success: 
			cat original >victim &&
			git update-index victim &&
			git apply --index --unidiff-zero add-a-patch.without &&
			test_cmp add-a-expect victim
		
Already on 'master'
ok 1 - file creation

expecting success: 
	test_must_fail git apply patch2.patch

Context reduced to (2/2) to apply fragment at 6
ok 9 - fuzz with big offset

error: cannot apply binary patch to 'file2' without full index line
error: file2: patch does not apply
error: cannot apply binary patch to 'file4' without full index line
error: file4: patch does not apply
error: patch failed: main.c:10
error: main.c: patch does not apply
ok 6 - check binary diff (copy) -- should fail.

expecting success: 
	git checkout master &&
	test_must_fail git apply --check --allow-binary-replacement B.diff

ok 2 - patch2 fails (retab)

expecting success: 
	git apply --ignore-whitespace patch2.patch

# passed all 9 test(s)
1..9
ok 3 - patch2 applies with --ignore-whitespace

expecting success: 
	git apply -R --ignore-space-change patch2.patch

Already on 'master'
ok 9 - apply add-a-patch without context

expecting success: 
			cat original >victim &&
			git update-index victim &&
			git apply --index --unidiff-zero add-z-patch.without &&
			test_cmp add-z-expect victim
		
ok 4 - patch2 reverse applies with --ignore-space-change

error: cannot apply binary patch to 'file3' without full index line
error: file3: patch does not apply
error: cannot apply binary patch to 'file4' without full index line
error: file4: patch does not apply
ok 7 - check incomplete binary diff with replacement -- should fail.

expecting success: 
	 git checkout master &&
	 test_must_fail git apply --check --allow-binary-replacement C.diff

*** t4108-apply-threeway.sh ***
expecting success: 
	git apply patch2.patch &&
	test_cmp main.c.final main.c

Already on 'master'
ok 10 - apply add-z-patch without context
ok 5 - patch2 applies (apply.ignorewhitespace = change)


expecting success: 
	test_must_fail git apply patch3.patch

expecting success: 
			cat original >victim &&
			git update-index victim &&
			git apply --index --unidiff-zero insert-a-patch.without &&
			test_cmp insert-a-expect victim
		
error: patch failed: main.c:10
error: cannot apply binary patch to 'file2' without full index line
error: file2: patch does not apply
error: cannot apply binary patch to 'file4' without full index line
error: file4: patch does not apply
error: main.c: patch does not apply
ok 8 - check incomplete binary diff with replacement (copy) -- should fail.

expecting success: git checkout master &&
	 git apply --check --allow-binary-replacement BF.diff
ok 6 - patch3 fails (missing string at EOL)

expecting success: 
	test_must_fail git apply patch4.patch

error: patch failed: main.c:21
error: main.c: patch does not apply
Already on 'master'
ok 7 - patch4 fails (missing EOL at EOF)

expecting success: 
	test_must_fail git apply patch5.patch

ok 11 - apply insert-a-patch without context

expecting success: 
			cat original >victim &&
			git update-index victim &&
			git apply --index --unidiff-zero mod-a-patch.without &&
			test_cmp mod-a-expect victim
		
error: patch failed: main.c:2
error: main.c: patch does not apply
ok 8 - patch5 fails (leading whitespace differences matter)

ok 9 - check binary diff with replacement.

expecting success: 
	rm -f main.c &&
	git apply patch1.patch

expecting success: git checkout master &&
	 git apply --check --allow-binary-replacement CF.diff
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4108-apply-threeway/.git/
Already on 'master'
ok 9 - re-create file (with --ignore-whitespace)

expecting success: 
	test_must_fail git apply --no-ignore-whitespace patch5.patch

expecting success: 
	test_tick &&
	create_file >one 1 2 3 4 5 6 7 &&
	cat one >two &&
	git add one two &&
	git commit -m initial &&

	git branch side &&

	test_tick &&
	create_file >one 1 two 3 4 5 six 7 &&
	create_file >two 1 two 3 4 5 6 7 &&
	git commit -a -m master &&

	git checkout side &&
	create_file >one 1 2 3 4 five 6 7 &&
	create_file >two 1 2 3 4 five 6 7 &&
	git commit -a -m side &&

	git checkout master

ok 10 - check binary diff with replacement (copy).

expecting success: do_reset &&
error: patch failed: main.c:2
error: main.c: patch does not apply
	 test_must_fail git apply B.diff
ok 10 - patch5 fails (--no-ignore-whitespace)

ok 12 - apply mod-a-patch without context

expecting success: 
			cat original >victim &&
			git update-index victim &&
			git apply --index --unidiff-zero mod-z-patch.without &&
			test_cmp mod-z-expect victim
		
# passed all 10 test(s)
1..10
HEAD is now at 8f514b2 Initial Version
[master (root-commit) acfd9ea] initial
 Author: A U Thor <author@example.com>
 2 files changed, 14 insertions(+)
 create mode 100644 one
 create mode 100644 two
ok 13 - apply mod-z-patch without context

expecting success: 
			cat original >victim &&
			git update-index victim &&
			git apply --index --unidiff-zero del-a-patch.without &&
			test_cmp del-a-expect victim
		
*** t4109-apply-multifrag.sh ***
Already on 'master'
error: cannot apply binary patch to 'file3' without full index line
error: file3: patch does not apply
error: cannot apply binary patch to 'file4' without full index line
error: file4: patch does not apply
ok 11 - apply binary diff -- should fail.

expecting success: do_reset &&
	 test_must_fail git apply --index B.diff
ok 14 - apply del-a-patch without context

expecting success: 
			cat original >victim &&
			git update-index victim &&
			git apply --index --unidiff-zero del-z-patch.without &&
			test_cmp del-z-expect victim
		
HEAD is now at 8f514b2 Initial Version
[master d66dc78] master
 Author: A U Thor <author@example.com>
 2 files changed, 3 insertions(+), 3 deletions(-)
Already on 'master'
Switched to branch 'side'
error: cannot apply binary patch to 'file3' without full index line
error: file3: patch does not apply
error: cannot apply binary patch to 'file4' without full index line
error: file4: patch does not apply
ok 15 - apply del-z-patch without context

ok 12 - apply binary diff -- should fail.

expecting success: do_reset &&
	 test_must_fail git apply C.diff
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4109-apply-multifrag/.git/
expecting success: 
		cat original >victim &&
		git update-index victim &&
		git apply --unidiff-zero --index add-a-ng.without &&
		test_cmp add-a-expect victim
	
[side 3dc6c9f] side
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 2 deletions(-)
HEAD is now at 8f514b2 Initial Version
Switched to branch 'master'
ok 1 - setup

expecting success: 
	git diff side^ side >P.diff &&

	# should fail to apply
	git reset --hard &&
	git checkout master^0 &&
	test_must_fail git apply --index P.diff &&
	# should leave things intact
	git diff-files --exit-code &&
	git diff-index --exit-code --cached HEAD

expecting success: 
	git apply patch1.patch patch2.patch &&
	test_cmp "$TEST_DIRECTORY/t4109/expect-1" main.c

patch1.patch:28: new blank line at EOF.
+
Already on 'master'
patch2.patch:58: new blank line at EOF.
+
warning: 2 lines add whitespace errors.
ok 16 - apply non-git add-a-patch without context

ok 1 - git apply (1)

error: cannot apply binary patch to 'file2' without full index line
error: file2: patch does not apply
error: cannot apply binary patch to 'file4' without full index line
error: file4: patch does not apply
expecting success: 
	git apply patch1.patch patch2.patch patch3.patch &&
	test_cmp "$TEST_DIRECTORY/t4109/expect-2" main.c

ok 13 - apply binary diff (copy) -- should fail.

expecting success: do_reset &&
	 test_must_fail git apply --index C.diff
expecting success: 
		cat original >victim &&
		git update-index victim &&
		git apply --unidiff-zero --index add-z-ng.without &&
		test_cmp add-z-expect victim
	
patch1.patch:28: new blank line at EOF.
+
HEAD is now at d66dc78 master
patch2.patch:58: new blank line at EOF.
+
warning: 2 lines add whitespace errors.
ok 2 - git apply (2)

expecting success: 
	git apply patch1.patch patch4.patch &&
	test_cmp "$TEST_DIRECTORY/t4109/expect-3" main.c

HEAD is now at 8f514b2 Initial Version
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>

patch1.patch:28: new blank line at EOF.
+
HEAD is now at d66dc78... master
warning: 1 line adds whitespace errors.
ok 17 - apply non-git add-z-patch without context

ok 3 - git apply (3)

error: patch failed: one:2
error: one: patch does not apply
error: patch failed: two:2
Already on 'master'
expecting success: 
		cat original >victim &&
		git update-index victim &&
		git apply --unidiff-zero --index insert-a-ng.without &&
		test_cmp insert-a-expect victim
	
error: two: patch does not apply
# passed all 3 test(s)
1..3
error: cannot apply binary patch to 'file2' without full index line
error: file2: patch does not apply
error: cannot apply binary patch to 'file4' without full index line
error: file4: patch does not apply
ok 14 - apply binary diff (copy) -- should fail.

expecting success: 
	do_reset &&
	git apply B-index.diff

ok 2 - apply without --3way

expecting success: 
	# Merging side should be similar to applying this patch
	git diff ...side >P.diff &&

	# The corresponding conflicted merge
	git reset --hard &&
	git checkout master^0 &&
	test_must_fail git merge --no-commit side &&
	git ls-files -s >expect.ls &&
	git diff HEAD | sanitize_conflicted_diff >expect.diff &&

	# should fail to apply
	git reset --hard &&
	git checkout master^0 &&
	test_must_fail git apply --index --3way P.diff &&
	git ls-files -s >actual.ls &&
	git diff HEAD | sanitize_conflicted_diff >actual.diff &&

	# The result should resemble the corresponding merge
	test_cmp expect.ls actual.ls &&
	test_cmp expect.diff actual.diff

*** t4110-apply-scan.sh ***
HEAD is now at 8f514b2 Initial Version
ok 18 - apply non-git insert-a-patch without context

expecting success: 
		cat original >victim &&
		git update-index victim &&
		git apply --unidiff-zero --index mod-a-ng.without &&
		test_cmp mod-a-expect victim
	
Already on 'master'
HEAD is now at d66dc78 master
HEAD is now at d66dc78... master
ok 15 - apply binary diff with full-index

expecting success: 
	do_reset &&
	git apply C-index.diff

ok 19 - apply non-git mod-a-patch without context

expecting success: 
		cat original >victim &&
		git update-index victim &&
		git apply --unidiff-zero --index mod-z-ng.without &&
		test_cmp mod-z-expect victim
	
Merging:
d66dc78 master
virtual side
found 1 common ancestor:
acfd9ea initial
Auto-merging two
Auto-merging one
CONFLICT (content): Merge conflict in one
Automatic merge failed; fix conflicts and then commit the result.
HEAD is now at 8f514b2 Initial Version
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4110-apply-scan/.git/
expecting success: 
	git apply \
		"$TEST_DIRECTORY/t4110/patch1.patch" \
		"$TEST_DIRECTORY/t4110/patch2.patch" \
		"$TEST_DIRECTORY/t4110/patch3.patch" \
		"$TEST_DIRECTORY/t4110/patch4.patch" \
		"$TEST_DIRECTORY/t4110/patch5.patch" &&
	test_cmp new.txt "$TEST_DIRECTORY/t4110/expect"

Already on 'master'
ok 20 - apply non-git mod-z-patch without context

ok 16 - apply binary diff with full-index (copy)

expecting success: 
	(cd other-repo &&
	 do_reset &&
	 test_must_fail git apply ../B-index.diff)

ok 1 - git apply scan

expecting success: 
		cat original >victim &&
		git update-index victim &&
		git apply --unidiff-zero --index del-a-ng.without &&
		test_cmp del-a-expect victim
	
# passed all 1 test(s)
1..1
HEAD is now at d66dc78 master
HEAD is now at 8f514b2 Initial Version
HEAD is now at d66dc78... master
ok 21 - apply non-git del-a-patch without context

*** t4111-apply-subdir.sh ***
Already on 'master'
error: patch failed: one:2
Falling back to three-way merge...
Applied patch to 'one' with conflicts.
error: patch failed: two:2
Falling back to three-way merge...
Applied patch to 'two' cleanly.
U one
expecting success: 
		cat original >victim &&
		git update-index victim &&
		git apply --unidiff-zero --index del-z-ng.without &&
		test_cmp del-z-expect victim
	
error: missing binary patch data for 'file3'
error: binary patch does not apply to 'file3'
error: file3: patch does not apply
error: missing binary patch data for 'file4'
error: binary patch does not apply to 'file4'
error: file4: patch does not apply
ok 17 - apply full-index binary diff in new repo

expecting success: do_reset &&
	 git apply BF.diff
ok 3 - apply with --3way

expecting success: 
	git config rerere.enabled true &&

	# Merging side should be similar to applying this patch
	git diff ...side >P.diff &&

	# The corresponding conflicted merge
	git reset --hard &&
	git checkout master^0 &&
	test_must_fail git merge --no-commit side &&

	# Manually resolve and record the resolution
	create_file 1 two 3 4 five six 7 >one &&
	git rerere &&
	cat one >expect &&

	# should fail to apply
	git reset --hard &&
	git checkout master^0 &&
	test_must_fail git apply --index --3way P.diff &&

	# but rerere should have replayed the recorded resolution
	test_cmp expect one

HEAD is now at 8f514b2 Initial Version
ok 22 - apply non-git del-z-patch without context

expecting success: 

	>file &&
	git add file &&
	echo aaa >file &&
	git diff >patch &&
	git add file &&
	echo bbb >file &&
	git add file &&
	test_must_fail git apply --check patch


Already on 'master'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4111-apply-subdir/.git/
ok 18 - apply binary diff without replacement.

expecting success: do_reset &&
	 git apply CF.diff
expecting success: 
	cat >patch <<-\EOF &&
	diff file.orig file
	--- a/file.orig
	+++ b/file
	@@ -1 +1,2 @@
	 1
	+2
	EOF
	patch="$(pwd)/patch" &&

	echo 1 >preimage &&
	printf "%s\n" 1 2 >postimage &&
	echo 3 >other &&

	test_tick &&
	git commit --allow-empty -m basis

HEAD is now at d66dc78 master
HEAD is now at 8f514b2 Initial Version
[master (root-commit) 2fa880c] basis
 Author: A U Thor <author@example.com>
HEAD is now at d66dc78... master
ok 1 - setup

expecting success: 
	reset_subdir() {
		git reset &&
		mkdir -p sub/dir/b &&
		mkdir -p objects &&
		cp "$1" file &&
		cp "$1" objects/file &&
		cp "$1" sub/dir/file &&
		cp "$1" sub/dir/b/file &&
		git add file sub/dir/file sub/dir/b/file objects/file &&
		cp "$2" file &&
		cp "$2" sub/dir/file &&
		cp "$2" sub/dir/b/file &&
		cp "$2" objects/file &&
		test_might_fail git update-index --refresh -q
	}

ok 2 - setup: subdir

expecting success: 
	cp postimage expected &&
	reset_subdir other preimage &&
	(
		cd sub/dir &&
		git apply "$patch"
	) &&
	test_cmp expected sub/dir/file

error: patch failed: file:0
error: file: patch does not apply
ok 23 - two lines

expecting success: 
	{ echo a; echo b; echo c; echo d; } >file &&
	git add file &&
	echo e >>file &&
	git diff >patch &&
	>file &&
	test_must_fail git apply patch

Already on 'master'
Recorded preimage for 'one'
Merging:
d66dc78 master
virtual side
found 1 common ancestor:
acfd9ea initial
Auto-merging two
Auto-merging one
CONFLICT (content): Merge conflict in one
Automatic merge failed; fix conflicts and then commit the result.
ok 19 - apply binary diff without replacement (copy).

expecting success: do_reset &&
	 git apply --allow-binary-replacement --index BF.diff &&
	 test -z "$(git diff --name-status binary)"
Recorded resolution for 'one'.
error: patch failed: file:2
error: file: patch does not apply
ok 24 - apply patch with 3 context lines matching at end

HEAD is now at 8f514b2 Initial Version
# passed all 24 test(s)
1..24
Already on 'master'
HEAD is now at d66dc78 master
HEAD is now at d66dc78... master
error: patch failed: one:2
*** t4112-apply-renames.sh ***
ok 20 - apply binary diff.

expecting success: do_reset &&
	 git apply --allow-binary-replacement --index CF.diff &&
	 test -z "$(git diff --name-status binary)"
Falling back to three-way merge...
Applied patch to 'one' with conflicts.
error: patch failed: two:2
Falling back to three-way merge...
Applied patch to 'two' cleanly.
U one
Resolved 'one' using previous resolution.
ok 4 - apply with --3way with rerere enabled

expecting success: 
	git reset --hard &&

	git checkout -b adder &&
	create_file 1 2 3 4 5 6 7 >three &&
	create_file 1 2 3 4 5 6 7 >four &&
	git add three four &&
	git commit -m "add three and four" &&

	git checkout -b another adder^ &&
	create_file 1 2 3 4 5 6 7 >three &&
	create_file 1 2 3 four 5 6 7 >four &&
	git add three four &&
	git commit -m "add three and four" &&

	# Merging another should be similar to applying this patch
	git diff adder...another >P.diff &&

	git checkout adder^0 &&
	test_must_fail git merge --no-commit another &&
	git ls-files -s >expect.ls &&
	git diff HEAD | sanitize_conflicted_diff >expect.diff

file: needs update
objects/file: needs update
sub/dir/b/file: needs update
sub/dir/file: needs update
HEAD is now at 8f514b2 Initial Version
ok 3 - apply from subdir of toplevel

expecting success: 
	cp postimage expected &&
	cp other expected.working &&
	reset_subdir preimage other &&
	(
		cd sub/dir &&
		git apply --cached "$patch"
	) &&
	git show :sub/dir/file >actual &&
	test_cmp expected actual &&
	test_cmp expected.working sub/dir/file

HEAD is now at d66dc78 master
Already on 'master'
Switched to a new branch 'adder'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4112-apply-renames/.git/
ok 21 - apply binary diff (copy).

expecting success: 
	do_reset &&
	git apply -p0 --index B0.diff &&
	test -z "$(git diff --name-status binary -- file3)"

[adder 14bc0a0] add three and four
 Author: A U Thor <author@example.com>
 2 files changed, 14 insertions(+)
 create mode 100644 four
 create mode 100644 three
HEAD is now at 8f514b2 Initial Version
Switched to a new branch 'another'
Already on 'master'
expecting success: git apply --check patch
ok 1 - check rename/copy patch

expecting success: git apply --index patch
ok 22 - apply binary -p0 diff

[another 1dc7db6] add three and four
 Author: A U Thor <author@example.com>
 2 files changed, 14 insertions(+)
 create mode 100644 four
 create mode 100644 three
file: needs update
objects/file: needs update
sub/dir/b/file: needs update
sub/dir/file: needs update
# passed all 22 test(s)
1..22
ok 2 - apply rename/copy patch

# passed all 2 test(s)
1..2
ok 4 - apply --cached from subdir of toplevel

expecting success: 
	cp postimage expected &&
	reset_subdir preimage other &&
	(
		cd sub/dir &&
		test_must_fail git apply --index "$patch"
	) &&
	reset_subdir other preimage &&
	(
		cd sub/dir &&
		test_must_fail git apply --index "$patch"
	) &&
	reset_subdir preimage preimage &&
	(
		cd sub/dir &&
		git apply --index "$patch"
	) &&
	git show :sub/dir/file >actual &&
	test_cmp expected actual &&
	test_cmp expected sub/dir/file

Note: checking out 'adder^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 14bc0a0... add three and four
*** t4113-apply-ending.sh ***
*** t4114-apply-typechange.sh ***
Recorded preimage for 'four'
Merging:
14bc0a0 add three and four
virtual another
found 1 common ancestor:
d66dc78 master
Auto-merging four
CONFLICT (add/add): Merge conflict in four
Automatic merge failed; fix conflicts and then commit the result.
ok 5 - apply -3 with add/add conflict setup

expecting success: 
	# should fail to apply ...
	git reset --hard &&
	git checkout adder^0 &&
	test_must_fail git apply --index --3way P.diff &&
	# ... and leave conflicts in the index and in the working tree
	git ls-files -s >actual.ls &&
	git diff HEAD | sanitize_conflicted_diff >actual.diff &&

	# The result should resemble the corresponding merge
	test_cmp expect.ls actual.ls &&
	test_cmp expect.diff actual.diff

HEAD is now at 14bc0a0 add three and four
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4114-apply-typechange/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4113-apply-ending/.git/
HEAD is now at 14bc0a0... add three and four
expecting success: 
	echo "hello world" > foo &&
	echo "hi planet" > bar &&
	git update-index --add foo bar &&
	git commit -m initial &&
	git branch initial &&
	rm -f foo &&
	test_ln_s_add bar foo &&
	git commit -m "foo symlinked to bar" &&
	git branch foo-symlinked-to-bar &&
	git rm -f foo &&
	echo "how far is the sun?" > foo &&
	git update-index --add foo &&
	git commit -m "foo back to file" &&
	git branch foo-back-to-file &&
	printf "\0" > foo &&
	git update-index foo &&
	git commit -m "foo becomes binary" &&
	git branch foo-becomes-binary &&
	rm -f foo &&
	git update-index --remove foo &&
	mkdir foo &&
	echo "if only I knew" > foo/baz &&
	git update-index --add foo/baz &&
	git commit -m "foo becomes a directory" &&
	git branch "foo-becomes-a-directory" &&
	echo "hello world" > foo/baz &&
	git update-index foo/baz &&
	git commit -m "foo/baz is the original foo" &&
	git branch foo-baz-renamed-from-foo
	
Falling back to three-way merge...
Applied patch to 'four' with conflicts.
Falling back to three-way merge...
Applied patch to 'three' cleanly.
U four
file: needs update
objects/file: needs update
sub/dir/b/file: needs update
sub/dir/file: needs update
expecting success: git update-index --add file
error: sub/dir/file: does not match index
ok 1 - setup

expecting success: test_must_fail git apply --index test-patch
[master (root-commit) 333ccaf] initial
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 bar
 create mode 100644 foo
ok 6 - apply -3 with add/add conflict

expecting success: 
	# should fail to apply ...
	git reset --hard &&
	git checkout adder^0 &&
	echo >>four &&
	cat four >four.save &&
	cat three >three.save &&
	git ls-files -s >expect.ls &&
	test_must_fail git apply --index --3way P.diff &&
	# ... and should not touch anything
	git ls-files -s >actual.ls &&
	test_cmp expect.ls actual.ls &&
	test_cmp four.save four &&
	test_cmp three.save three

error: patch failed: file:1
error: file: patch does not apply
ok 2 - apply at the end

HEAD is now at 14bc0a0 add three and four
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

)
expecting success: test_must_fail git apply --index test-patch
prerequisite SYMLINKS ok
HEAD is now at 14bc0a0... add three and four
error: patch failed: file:1
error: file: patch does not apply
ok 3 - apply at the beginning

# passed all 3 test(s)
1..3
Falling back to three-way merge...
error: four: does not match index
error: cannot read the current contents of 'four'
error: four: patch does not apply
Falling back to three-way merge...
Applied patch to 'three' cleanly.
[master ce7cf76] foo symlinked to bar
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
 rewrite foo (100%)
 mode change 100644 => 120000
*** t4115-apply-symlink.sh ***
file: needs update
objects/file: needs update
sub/dir/b/file: needs update
sub/dir/file: needs update
ok 7 - apply -3 with add/add conflict (dirty working tree)

rm 'foo'
error: sub/dir/file: does not match index
# passed all 7 test(s)
1..7
[master 5a7a5a6] foo back to file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
 rewrite foo (100%)
 mode change 120000 => 100644
*** t4116-apply-reverse.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4115-apply-symlink/.git/
expecting success: 

	test_ln_s_add path1/path2/path3/path4/path5 link1 &&
	git commit -m initial &&

	git branch side &&

	rm -f link? &&

	test_ln_s_add htap6 link1 &&
	git commit -m second &&

	git diff-tree -p HEAD^ HEAD >patch  &&
	git apply --stat --summary patch


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
[master d63d559] foo becomes binary
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4116-apply-reverse/.git/
[master (root-commit) cc52925] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 120000 link1
expecting success: 

	for i in a b c d e f g h i j k l m n; do echo $i; done >file1 &&
	perl -pe "y/ijk/\\000\\001\\002/" <file1 >file2 &&

	git add file1 file2 &&
	git commit -m initial &&
	git tag initial &&

	for i in a b c g h i J K L m o n p q; do echo $i; done >file1 &&
	perl -pe "y/mon/\\000\\001\\002/" <file1 >file2 &&

	git commit -a -m second &&
	git tag second &&

	git diff --binary initial second >patch


ok 5 - apply --index from subdir of toplevel

expecting success: 
	(
		cd sub/dir &&
		test_must_fail git apply <<-EOF
		--- sub/dir/file
		+++ sub/dir/file
		@@ -1,0 +1,0 @@
		--- file_in_root
		+++ file_in_root
		@@ -1,0 +1,0 @@
		EOF
	)

fatal: corrupt patch at line 4
ok 6 - apply half-broken patch from subdir of toplevel

expecting success: 
	cp postimage expected &&
	cp preimage .git/file &&
	cp preimage .git/objects/file &&
	(
		cd .git &&
		git apply "$patch"
	) &&
	test_cmp expected .git/file

[master 8bab871] foo becomes a directory
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
 delete mode 100644 foo
 create mode 100644 foo/baz
[master ce3697d] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master (root-commit) 46a88f1] initial
 Author: A U Thor <author@example.com>
 2 files changed, 14 insertions(+)
 create mode 100644 file1
 create mode 100644 file2
ok 7 - apply from .git dir

expecting success: 
	cp postimage expected &&
	cp preimage .git/file &&
	cp preimage .git/objects/file &&
	(
		cd .git/objects &&
		git apply "$patch"
	) &&
	test_cmp expected .git/objects/file

 link1 |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - setup

expecting success: 

	git checkout side &&
	git apply patch &&
	git diff-files -p >patched &&
	test_cmp patch patched


[master 3da8641] foo/baz is the original foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 8 - apply from subdir of .git dir

expecting success: 
	cp postimage expected &&
	cp other expected.working &&
	cp other .git/file &&
	reset_subdir preimage other &&
	(
		cd .git &&
		git apply --cached "$patch"
	) &&
	git show :file >actual &&
	test_cmp expected actual &&
	test_cmp expected.working file &&
	test_cmp expected.working .git/file

Switched to branch 'side'
ok 1 - setup repository and commits

expecting success: 
	git checkout -f initial &&
	git diff-tree -M -p HEAD foo-baz-renamed-from-foo > patch &&
	git apply --index < patch
	
[master 3b1287e] second
 Author: A U Thor <author@example.com>
 2 files changed, 6 insertions(+), 6 deletions(-)
Switched to branch 'initial'
ok 2 - apply symlink patch

expecting success: 

	git checkout -f side &&
	git apply --index patch &&
	git diff-index --cached -p HEAD >patched &&
	test_cmp patch patched


ok 1 - setup

expecting success: 

	T0=$(git rev-parse "second^{tree}") &&
	git reset --hard initial &&
	git apply --index --binary patch &&
	T1=$(git write-tree) &&
	test "$T0" = "$T1"

Already on 'side'
ok 2 - file renamed from foo to foo/baz

expecting success: 
	git checkout -f foo-baz-renamed-from-foo &&
	git diff-tree -M -p HEAD initial > patch &&
	git apply --index < patch
	
Switched to branch 'foo-baz-renamed-from-foo'
HEAD is now at 46a88f1 initial
ok 3 - apply --index symlink patch

# passed all 3 test(s)
1..3
ok 3 - file renamed from foo/baz to foo

expecting success: 
	git checkout -f foo-becomes-a-directory &&
	git diff-tree -p HEAD initial > patch &&
	git apply --index < patch
	
ok 2 - apply in forward

expecting success: 

	git reset --hard second &&
	git apply --reverse --binary --index patch &&
	git diff >diff &&
	test_cmp /dev/null diff


Switched to branch 'foo-becomes-a-directory'
HEAD is now at 3b1287e second
*** t4117-apply-reject.sh ***
file: needs update
objects/file: needs update
sub/dir/b/file: needs update
sub/dir/file: needs update
ok 4 - directory becomes file

expecting success: 
	git checkout -f initial &&
	git diff-tree -p HEAD foo-becomes-a-directory > patch &&
	git apply --index < patch
	
ok 3 - apply in reverse

expecting success: 

	git archive --format=tar --prefix=initial/ initial | $TAR xf - &&
	(
		cd initial && git init && git add .
	) &&

	git archive --format=tar --prefix=second/ second | $TAR xf - &&
	(
		cd second && git init && git add .
	)


ok 9 - apply --cached from .git dir

expecting success: 
	cp postimage expected &&
	cp preimage expected.subdir &&
	cp other .git/file &&
	cp other .git/objects/file &&
	reset_subdir preimage other &&
	(
		cd .git/objects &&
		git apply --cached "$patch"
	) &&
	git show :file >actual &&
	git show :objects/file >actual.subdir &&
	test_cmp expected actual &&
	test_cmp expected.subdir actual.subdir

Switched to branch 'initial'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4116-apply-reverse/initial/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4117-apply-reject/.git/
ok 5 - file becomes directory

expecting success: 
	git checkout -f initial &&
	git diff-tree -p HEAD foo-symlinked-to-bar > patch &&
	git apply --index < patch
	
expecting success: 
	for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
	do
		echo $i
	done >file1 &&
	cat file1 >saved.file1 &&
	git update-index --add file1 &&
	git commit -m initial &&

	for i in 1 2 A B 4 5 6 7 8 9 10 11 12 C 13 14 15 16 17 18 19 20 D 21
	do
		echo $i
	done >file1 &&
	git diff >patch.1 &&
	cat file1 >clean &&

	for i in 1 E 2 3 4 5 6 7 8 9 10 11 12 C 13 14 15 16 17 18 19 20 F 21
	do
		echo $i
	done >expected &&

	mv file1 file2 &&
	git update-index --add --remove file1 file2 &&
	git diff -M HEAD >patch.2 &&

	rm -f file1 file2 &&
	mv saved.file1 file1 &&
	git update-index --add --remove file1 file2 &&

	for i in 1 E 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 F 21
	do
		echo $i
	done >file1 &&

	cat file1 >saved.file1

Already on 'initial'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4116-apply-reverse/second/.git/
ok 6 - file becomes symlink

expecting success: 
	git checkout -f foo-symlinked-to-bar &&
	git diff-tree -p HEAD foo-back-to-file > patch &&
	git apply --index < patch
	
[master (root-commit) 29e40cf] initial
 Author: A U Thor <author@example.com>
 1 file changed, 21 insertions(+)
 create mode 100644 file1
ok 4 - setup separate repository lacking postimage

expecting success: 

	T0=$(git rev-parse "second^{tree}") &&
	(
		cd initial &&
		git apply --index --binary ../patch &&
		T1=$(git write-tree) &&
		test "$T0" = "$T1"
	)

Switched to branch 'foo-symlinked-to-bar'
file: needs update
objects/file: needs update
sub/dir/b/file: needs update
sub/dir/file: needs update
ok 5 - apply in forward without postimage

expecting success: 

	T0=$(git rev-parse "initial^{tree}") &&
	(
		cd second &&
		git apply --index --binary --reverse ../patch &&
		T1=$(git write-tree) &&
		test "$T0" = "$T1"
	)

ok 7 - symlink becomes file

expecting success: 
	git checkout -f foo-becomes-binary &&
	git diff-tree -p --binary HEAD foo-symlinked-to-bar > patch &&
	git apply --index < patch
	
Switched to branch 'foo-becomes-binary'
ok 1 - setup

expecting success: 
	test_when_finished "cat saved.file1 >file1" &&
	git diff >patch.0 &&
	git checkout file1 &&
	test_must_fail git apply --reject --3way patch.0 &&
	git diff --exit-code

ok 10 - apply --cached from subdir of .git dir

# passed all 10 test(s)
1..10
ok 6 - apply in reverse without postimage

expecting success: 
	sed "s/a/a /" < file1 > file1.new &&
	mv file1.new file1 &&
	git diff | git apply --reverse --whitespace=error

fatal: --reject and --3way cannot be used together.
ok 8 - binary file becomes symlink

expecting success: 
	git checkout -f foo-symlinked-to-bar &&
	git diff-tree -p --binary HEAD foo-becomes-binary > patch &&
	git apply --index < patch
	
*** t4118-apply-empty-context.sh ***
ok 7 - reversing a whitespace introduction

ok 2 - apply --reject is incompatible with --3way

expecting success: 

	test_must_fail git apply patch.1 &&
	test_cmp file1 saved.file1

Switched to branch 'foo-symlinked-to-bar'
# passed all 7 test(s)
1..7
error: patch failed: file1:1
error: file1: patch does not apply
ok 3 - apply without --reject should fail

expecting success: 

	test_must_fail git apply --verbose patch.1 &&
	test_cmp file1 saved.file1

Checking patch file1...
error: while searching for:
1
2
3
4
5
6

error: patch failed: file1:1
error: file1: patch does not apply
ok 4 - apply without --reject should fail

expecting success: 

	cat saved.file1 >file1 &&
	rm -f file1.rej file2.rej &&

	test_must_fail git apply --reject patch.1 &&
	test_cmp file1 expected &&

	cat file1.rej &&
	test_path_is_missing file2.rej

ok 9 - symlink becomes binary file

expecting success: 
	git checkout -f foo-symlinked-to-bar &&
	git diff-tree -p HEAD foo-becomes-a-directory > patch &&
	git apply --index < patch
	
Checking patch file1...
error: while searching for:
1
2
3
4
5
6

error: patch failed: file1:1
error: while searching for:
18
19
20
21

error: patch failed: file1:18
Already on 'foo-symlinked-to-bar'
Applying patch file1 with 2 rejects...
Rejected hunk #1.
Hunk #2 applied cleanly.
Rejected hunk #3.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4118-apply-empty-context/.git/
diff a/file1 b/file1	(rejected hunks)
@@ -1,6 +1,7 @@
 1
 2
-3
+A
+B
 4
 5
 6
@@ -18,4 +20,5 @@
 18
 19
 20
+D
 21
ok 5 - apply with --reject should fail but update the file

expecting success: 

	cat saved.file1 >file1 &&
	rm -f file1.rej file2.rej file2 &&

	test_must_fail git apply --reject patch.2 >rejects &&
	test_path_is_missing file1 &&
	test_cmp file2 expected &&

	cat file2.rej &&
	test_path_is_missing file1.rej


*** t4119-apply-config.sh ***
expecting success: 
	{
		echo; echo;
		echo A; echo B; echo C;
		echo;
	} >file1 &&
	cat file1 >file1.orig &&
	{
		cat file1 &&
		echo Q | tr -d "\\012"
	} >file2 &&
	cat file2 >file2.orig &&
	git add file1 file2 &&
	sed -e "/^B/d" <file1.orig >file1 &&
	cat file1 > file2 &&
	echo Q | tr -d "\\012" >>file2 &&
	cat file1 >file1.mods &&
	cat file2 >file2.mods &&
	git diff |
	sed -e "s/^ \$//" >diff.output

Checking patch file1 => file2...
error: while searching for:
1
2
3
4
5
6

error: patch failed: file1:1
error: while searching for:
18
19
20
21
ok 10 - symlink becomes directory

expecting success: 
	git checkout -f foo-becomes-a-directory &&
	git diff-tree -p HEAD foo-symlinked-to-bar > patch &&
	git apply --index < patch
	

error: patch failed: file1:18
Applying patch file1 => file2 with 2 rejects...
Rejected hunk #1.
Hunk #2 applied cleanly.
Rejected hunk #3.
diff a/file2 b/file2	(rejected hunks)
@@ -1,6 +1,7 @@
 1
 2
-3
+A
+B
 4
 5
 6
@@ -18,4 +20,5 @@
 18
 19
 20
+D
 21
ok 6 - apply with --reject should fail but update the file

expecting success: 

	cat saved.file1 >file1 &&
	rm -f file1.rej file2.rej file2 &&

	test_must_fail git apply --reject --verbose patch.2 >rejects &&
	test_path_is_missing file1 &&
	test_cmp file2 expected &&

	cat file2.rej &&
	test_path_is_missing file1.rej


Switched to branch 'foo-becomes-a-directory'
Checking patch file1 => file2...
error: while searching for:
1
2
3
4
5
6

error: patch failed: file1:1
error: while searching for:
18
19
20
21

error: patch failed: file1:18
Applying patch file1 => file2 with 2 rejects...
Rejected hunk #1.
Hunk #2 applied cleanly.
Rejected hunk #3.
diff a/file2 b/file2	(rejected hunks)
@@ -1,6 +1,7 @@
 1
 2
-3
+A
+B
 4
 5
 6
@@ -18,4 +20,5 @@
 18
 19
 20
+D
 21
ok 7 - the same test with --verbose

expecting success: 

	git cat-file -p HEAD:file1 >file1 &&
	rm -f file?.rej file2 &&

	git apply --verbose patch.1 &&

	test_cmp file1 clean

ok 11 - directory becomes symlink

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4119-apply-config/.git/
# passed all 11 test(s)
1..11
ok 1 - setup

expecting success: 

	git apply --numstat diff.output >actual &&
	{
		echo "0	1	file1" &&
		echo "0	1	file2"
	} >expect &&
	test_cmp expect actual


expecting success: 
	mkdir sub &&
	echo A >sub/file1 &&
	cp sub/file1 saved &&
	git add sub/file1 &&
	echo "B " >sub/file1 &&
	git diff >patch.file

Checking patch file1...
Applied patch file1 cleanly.
ok 2 - apply --numstat

expecting success: 

	cat file1.orig >file1 &&
	cat file2.orig >file2 &&
	git update-index file1 file2 &&
	git apply --index diff.output &&
	test_cmp file1.mods file1 &&
	test_cmp file2.mods file2

ok 8 - apply cleanly with --verbose

# passed all 8 test(s)
1..8
*** t4120-apply-popt.sh ***
ok 1 - setup

*** t4121-apply-diffs.sh ***
expecting success: 

	rm -f sub/file1 &&
	cp saved sub/file1 &&
	git update-index --refresh &&

	git apply --whitespace=strip patch.file &&
	check_result sub/file1

ok 3 - apply --apply

# passed all 3 test(s)
1..3
patch.file:7: trailing whitespace.
B 
warning: 1 line applied after fixing whitespace errors.
*** t4122-apply-symlink-inside.sh ***
B
Happy
ok 2 - apply --whitespace=strip

expecting success: 

	rm -f sub/file1 &&
	cp saved sub/file1 &&
	git update-index --refresh &&

	git config apply.whitespace strip &&
	git apply patch.file &&
	check_result sub/file1

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4120-apply-popt/.git/
expecting success: 
	mkdir sub &&
	echo A >sub/file1 &&
	cp sub/file1 file1.saved &&
	git add sub/file1 &&
	echo B >sub/file1 &&
	git diff >patch.file &&
	git checkout -- sub/file1 &&
	git mv sub süb &&
	echo B >süb/file1 &&
	git diff >patch.escaped &&
	grep "[\]" patch.escaped &&
	rm süb/file1 &&
	rmdir süb

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4121-apply-diffs/.git/
expecting success: git add file &&
	git commit -q -m 1 &&
	git checkout -b test &&
	mv file file.tmp &&
	echo 0 >file &&
	cat file.tmp >>file &&
	rm file.tmp &&
	git commit -a -q -m 2 &&
	echo 9 >>file &&
	git commit -a -q -m 3 &&
	git checkout master
patch.file:7: trailing whitespace.
B 
warning: 1 line applied after fixing whitespace errors.
B
Happy
ok 3 - apply --whitespace=strip from config

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4122-apply-symlink-inside/.git/
expecting success: 

	cd "$D" &&
	git config --unset-all apply.whitespace &&
	rm -f sub/file1 &&
	cp saved sub/file1 &&
	git update-index --refresh &&

	cd sub &&
	git apply --whitespace=strip ../patch.file &&
	check_result file1

expecting success: 

	mkdir -p arch/i386/boot arch/x86_64 &&
	test_write_lines 1 2 3 4 5 >arch/i386/boot/Makefile &&
	test_ln_s_add ../i386/boot arch/x86_64/boot &&
	git add . &&
	test_tick &&
	git commit -m initial &&
	git branch test &&

	rm arch/x86_64/boot &&
	mkdir arch/x86_64/boot &&
	test_write_lines 2 3 4 5 6 >arch/x86_64/boot/Makefile &&
	git add . &&
	test_tick &&
	git commit -a -m second &&

	git format-patch --binary -1 --stdout >test.patch


Switched to a new branch 'test'
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
diff --git "a/s\303\274b/file1" "b/s\303\274b/file1"
--- "a/s\303\274b/file1"
+++ "b/s\303\274b/file1"
sub/../patch.file:7: trailing whitespace.
B 
warning: 1 line applied after fixing whitespace errors.
ok 1 - setup

expecting success: 
	cp file1.saved file1 &&
	git apply -p2 patch.file

B
Happy
ok 4 - apply --whitespace=strip in subdir

expecting success: 

	cd "$D" &&
	git config apply.whitespace strip &&
	rm -f sub/file1 &&
	cp saved sub/file1 &&
	git update-index --refresh &&

	cd sub &&
	git apply ../patch.file &&
	check_result file1

ok 2 - apply git diff with -p2

expecting success: 
	cp file1.saved file1 &&
	test_must_fail git apply --stat -p3 patch.file 2>err &&
	test_i18ngrep "removing 3 leading" err

Switched to branch 'master'
fatal: git diff header lacks filename information when removing 3 leading pathname components (line 5)
ok 1 - setup

expecting success: ( git diff test~2 test~1; git diff test~1 test~0 )| git apply
ok 3 - apply with too large -p

expecting success: 
	cat >patch.quotes <<-\EOF &&
	diff -u "a/"sub/file1 "b/"sub/file1
	--- "a/"sub/file1
	+++ "b/"sub/file1
	@@ -1 +1 @@
	-A
	+B
	EOF
	echo B >expected &&

	cp file1.saved file1 &&
	git apply -p2 patch.quotes &&
	test_cmp expected file1

[master (root-commit) f9acfaa] initial
 Author: A U Thor <author@example.com>
 2 files changed, 6 insertions(+)
 create mode 100644 arch/i386/boot/Makefile
 create mode 120000 arch/x86_64/boot
sub/../patch.file:7: trailing whitespace.
B 
warning: 1 line applied after fixing whitespace errors.
B
Happy
ok 5 - apply --whitespace=strip from config in subdir

expecting success: 

	cd "$D" &&
	git config apply.whitespace strip &&
	rm -f sub/file1 &&
	cp saved sub/file1 &&
	git update-index --refresh &&

	cd sub &&
	git apply ../gpatch.file &&
	check_result file1

ok 4 - apply (-p2) traditional diff with funny filenames

expecting success: 
	cp file1.saved file1 &&
	test_must_fail git apply --stat -p3 patch.escaped 2>err &&
	test_i18ngrep "removing 3 leading" err

ok 2 - check if contextually independent diffs for the same file apply

fatal: git diff header lacks filename information when removing 3 leading pathname components (line 5)
ok 5 - apply with too large -p and fancy filename

# passed all 2 test(s)
1..2
expecting success: 
	cat >patch.chmod <<-\EOF &&
	diff --git a/sub/file1 b/sub/file1
	old mode 100644
	new mode 100755
	EOF
	test_chmod -x file1 &&
	git apply --index -p2 patch.chmod &&
	case $(git ls-files -s file1) in 100755*) : good;; *) false;; esac

sub/file1:5: trailing whitespace.
B 
warning: 1 line applied after fixing whitespace errors.
[master e8e99d5] second
 Author: A U Thor <author@example.com>
 2 files changed, 5 insertions(+), 1 deletion(-)
 delete mode 120000 arch/x86_64/boot
 create mode 100644 arch/x86_64/boot/Makefile
B
Happy
ok 6 - same in subdir but with traditional patch input

expecting success: 

	cd "$D" &&
	git config apply.whitespace strip &&
	rm -f sub/file1 &&
	cp saved sub/file1 &&
	git update-index --refresh &&

	cd sub &&
	git apply ../gpatch-sub.file &&
	check_result file1

*** t4123-apply-shrink.sh ***
ok 1 - setup

expecting success: 

	git checkout test &&
	git diff --exit-code test &&
	git diff --exit-code --cached test &&
	git apply --index test.patch


ok 6 - apply (-p2) diff, mode change only

checking prerequisite: FILEMODE

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	test "$(git config --bool core.filemode)" = true

)
Switched to branch 'test'
prerequisite FILEMODE ok
expecting success: 
	test -x file1

sub/file1:5: trailing whitespace.
B 
ok 7 - file mode was changed

expecting success: 
	cat >patch.rename <<-\EOF &&
	diff --git a/sub/file1 b/sub/file2
	similarity index 100%
	rename from sub/file1
	rename to sub/file2
	EOF
	echo A >expected &&

	cp file1.saved file1 &&
	rm -f file2 &&
	git apply -p2 patch.rename &&
	test_cmp expected file2

warning: 1 line applied after fixing whitespace errors.
B
Happy
ok 7 - same but with traditional patch input of depth 1

expecting success: 

	cd "$D" &&
	git config apply.whitespace strip &&
	rm -f sub/file1 &&
	cp saved sub/file1 &&
	git update-index --refresh &&

	cd sub &&
	git apply ../gpatch-ab-sub.file &&
	check_result file1

ok 8 - apply (-p2) diff, rename

ok 2 - apply

expecting success: 

	git diff --exit-code master &&
	git diff --exit-code --cached master &&
	test_tick &&
	git commit -m replay &&
	T1=$(git rev-parse "master^{tree}") &&
	T2=$(git rev-parse "HEAD^{tree}") &&
	test "z$T1" = "z$T2"


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4123-apply-shrink/.git/
# passed all 8 test(s)
1..8
expecting success: 

	git add F &&
	mv F G &&
	sed -e "s/1/11/" -e "s/999999/9/" -e "s/H/HH/" <G >F &&
	git diff >patch &&
	sed -e "/^\$/d" <G >F &&
	git add F


sub/file1:5: trailing whitespace.
B 
warning: 1 line applied after fixing whitespace errors.
*** t4124-apply-ws-rule.sh ***
B
Happy
ok 8 - same but with traditional patch input of depth 2

expecting success: 

	cd "$D" &&
	git config apply.whitespace strip &&
	rm -f sub/file1 &&
	cp saved sub/file1 &&
	git update-index --refresh &&

	git apply -p0 gpatch-sub.file &&
	check_result sub/file1

[test 66a4bdc] replay
 Author: A U Thor <author@example.com>
 2 files changed, 5 insertions(+), 1 deletion(-)
 delete mode 120000 arch/x86_64/boot
 create mode 100644 arch/x86_64/boot/Makefile
ok 1 - setup

ok 3 - check result

expecting success: 

	if git apply --index patch
	then
		echo Oops, should not have succeeded
		false
	else
		status=$?
		echo "Status was $status"
		if test -f .git/index.lock
		then
			echo Oops, should not have crashed
			false
		fi
	fi

expecting success: 
	git reset --hard &&
	mkdir -p arch/x86_64/dir &&
	>arch/x86_64/dir/file &&
	git add arch/x86_64/dir/file &&
	echo line >arch/x86_64/dir/file &&
	git diff >patch &&
	git reset --hard &&

	mkdir arch/i386/dir &&
	>arch/i386/dir/file &&
	ln -s ../i386/dir arch/x86_64/dir &&

	test_must_fail git apply patch &&
	test_must_fail git apply --cached patch &&
	test_must_fail git apply --index patch


error: patch failed: F:14
error: F: patch does not apply
Status was 1
ok 2 - apply should fail gracefully

gpatch-sub.file:5: trailing whitespace.
B 
# passed all 2 test(s)
1..2
warning: 1 line applied after fixing whitespace errors.
HEAD is now at 66a4bdc replay
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4124-apply-ws-rule/.git/
B
Happy
ok 9 - same but with traditional patch input of depth 1

expecting success: 

	cd "$D" &&
	git config apply.whitespace strip &&
	rm -f sub/file1 &&
	cp saved sub/file1 &&
	git update-index --refresh &&

	git apply gpatch-ab-sub.file &&
	check_result sub/file1

*** t4125-apply-ws-fuzz.sh ***
expecting success: 

	>file &&
	git add file &&
	prepare_test_file >file &&
	git diff-files -p >patch &&
	>target &&
	git add target


gpatch-ab-sub.file:5: trailing whitespace.
B 
warning: 1 line applied after fixing whitespace errors.
HEAD is now at 66a4bdc replay
B
Happy
ok 10 - same but with traditional patch input of depth 2

expecting success: 
	cd "$D" &&
	git config apply.whitespace strip &&
	cat >.gitattributes <<-EOF &&
	/* whitespace=blank-at-eol
	sub/* whitespace=-blank-at-eol
	EOF
	rm -f sub/file1 &&
	cp saved sub/file1 &&
	git update-index --refresh &&

	cd sub &&
	git apply ../gpatch.file &&
	echo "B " >expect &&
	test_cmp expect file1

ok 1 - setup

expecting success: 

	apply_patch --whitespace=nowarn &&
	test_cmp file target


error: affected file 'arch/x86_64/dir/file' is beyond a symbolic link
ok 2 - whitespace=nowarn, default rule

expecting success: 

	apply_patch --whitespace=warn &&
	test_cmp file target


error: arch/x86_64/dir/file: does not exist in index
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4125-apply-ws-fuzz/.git/
<stdin>:8: space before tab in indent.
 	A SP and a HT (@%).
<stdin>:9: space before tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: space before tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: space before tab in indent.
        	Eight SP and a HT (@#%).
<stdin>:14: space before tab in indent.
       	 Seven SP, a HT and a SP (@%).
warning: squelched expecting success: 

	>file &&
	git add file &&

	# file-0 is full of whitespace breakages
	for l in a bb c d eeee f ggg h
	do
		echo "$l "
	done >file-0 &&

	# patch-0 creates a whitespace broken file
	cat file-0 >file &&
	git diff >patch-0 &&
	git add file &&

	# file-1 is still full of whitespace breakages,
	# but has one line updated, without fixing any
	# whitespaces.
	# patch-1 records that change.
	sed -e "s/d/D/" file-0 >file-1 &&
	cat file-1 >file &&
	git diff >patch-1 &&

	# patch-all is the effect of both patch-0 and patch-1
	>file &&
	git add file &&
	cat file-1 >file &&
	git diff >patch-all &&

	# patch-2 is the same as patch-1 but is based
	# on a version that already has whitespace fixed,
	# and does not introduce whitespace breakages.
	sed -e "s/ \$//" patch-1 >patch-2 &&

	# If all whitespace breakages are fixed the contents
	# should look like file-fixed
	sed -e "s/ \$//" file-1 >file-fixed


error: arch/x86_64/dir/file: does not exist in index
5 whitespace errors
warning: 10 lines add whitespace errors.
ok 4 - do not read from beyond symbolic link

expecting success: 

	rm -rf arch/i386/dir arch/x86_64/dir &&
	git reset --hard &&
	ln -s ../i386/dir arch/x86_64/dir &&
	git add arch/x86_64/dir &&
	git diff HEAD >add_symlink.patch &&
	git reset --hard &&

	mkdir arch/x86_64/dir &&
	>arch/x86_64/dir/file &&
	git add arch/x86_64/dir/file &&
	git diff HEAD >add_file.patch &&
	git diff -R HEAD >del_file.patch &&
	git reset --hard &&
	rm -fr arch/x86_64/dir &&

	cat add_symlink.patch add_file.patch >patch &&
	cat add_symlink.patch del_file.patch >tricky_del &&

	mkdir arch/i386/dir

ok 3 - whitespace=warn, default rule

expecting success: 

	test_must_fail apply_patch --whitespace=error-all &&
	! test -s target


ok 11 - in subdir with traditional patch input

<stdin>:8: space before tab in indent.
 	A SP and a HT (@%).
<stdin>:9: space before tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: space before tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: space before tab in indent.
        	Eight SP and a HT (@#%).
# passed all 11 test(s)
1..11
<stdin>:14: space before tab in indent.
       	 Seven SP, a HT and a SP (@%).
<stdin>:15: space before tab in indent.
        	 Eight SP, a HT and a SP (@#%).
<stdin>:17: space before tab in indent.
               	Fifteen SP and a HT (@#%).
<stdin>:19: space before tab in indent.
                	Sixteen SP and a HT (@#%=).
<stdin>:21: trailing whitespace.
A line with a (!) trailing SP 
<stdin>:22: trailing whitespace.
A line with a (!) trailing HT	
fatal: 10 lines add whitespace errors.
ok 4 - whitespace=error-all, default rule

expecting success: 

	git config core.whitespace -trailing,-space-before,-indent &&
	apply_patch --whitespace=error-all &&
	test_cmp file target


HEAD is now at 66a4bdc replay
*** t4126-apply-empty.sh ***
ok 5 - whitespace=error-all, no rule

expecting success: 

	git config --unset core.whitespace &&
	echo "target -whitespace" >.gitattributes &&
	apply_patch --whitespace=error-all &&
	test_cmp file target


HEAD is now at 66a4bdc replay
ok 6 - whitespace=error-all, no rule (attribute)

expecting success: 

	git config core.whitespace -trailing,-space,-indent,tab &&
	rm -f .gitattributes &&
	test_fix % &&
	sed -e "s/_/ /g" -e "s/>/	/" <<-\EOF >expect &&
		An_SP in an ordinary line>and a HT.
		________A HT (%).
		________A SP and a HT (@%).
		_________A SP, a HT and a SP (@%).
		_______Seven SP.
		________Eight SP (#).
		________Seven SP and a HT (@%).
		________________Eight SP and a HT (@#%).
		_________Seven SP, a HT and a SP (@%).
		_________________Eight SP, a HT and a SP (@#%).
		_______________Fifteen SP (#).
		________________Fifteen SP and a HT (@#%).
		________________Sixteen SP (#=).
		________________________Sixteen SP and a HT (@#%=).
		_____a__Five SP, a non WS, two SP.
		A line with a (!) trailing SP_
		A line with a (!) trailing HT>
	EOF
	test_cmp expect target


ok 1 - setup

expecting success: 

	>file &&
	git add file &&

	# Baseline.  Applying without fixing any whitespace
	# breakages.
	git apply --whitespace=nowarn patch-0 &&
	git apply --whitespace=nowarn patch-1 &&

	# The result should obviously match.
	test_cmp file-1 file

<stdin>:7: tab in indent.
	A HT (%).
<stdin>:8: tab in indent.
 	A SP and a HT (@%).
<stdin>:9: tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: tab in indent.
        	Eight SP and a HT (@#%).
warning: squelched 4 whitespace errors
warning: 9 lines applied after fixing whitespace errors.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4126-apply-empty/.git/
ok 2 - nofix

expecting success: 

	>file &&
	git add file &&

	# The first application will munge the context lines
	# the second patch depends on.  We should be able to
	# adjust and still apply.
	git apply --whitespace=fix patch-0 &&
	git apply --whitespace=fix patch-1 &&

	test_cmp file-fixed file

expecting success: 
	>empty &&
	git add empty &&
	test_tick &&
	git commit -m initial &&
	for i in a b c d e
	do
		echo $i
	done >empty &&
	cat empty >expect &&
	git diff |
	sed -e "/^diff --git/d" \
	    -e "/^index /d" \
	    -e "s|a/empty|empty.orig|" \
	    -e "s|b/empty|empty|" >patch0 &&
	sed -e "s|empty|missing|" patch0 >patch1 &&
	>empty &&
	git update-index --refresh

HEAD is now at 66a4bdc replay
ok 5 - do not follow symbolic link (setup)

ok 7 - spaces inserted by tab-in-indent

expecting success: 

	# same input creates a confusing symbolic link
	test_must_fail git apply patch 2>error-wt &&
	test_i18ngrep "beyond a symbolic link" error-wt &&
	test_path_is_missing arch/x86_64/dir &&
	test_path_is_missing arch/i386/dir/file &&

	test_must_fail git apply --index patch 2>error-ix &&
	test_i18ngrep "beyond a symbolic link" error-ix &&
	test_path_is_missing arch/x86_64/dir &&
	test_path_is_missing arch/i386/dir/file &&
	test_must_fail git ls-files --error-unmatch arch/x86_64/dir &&
	test_must_fail git ls-files --error-unmatch arch/i386/dir &&

	test_must_fail git apply --cached patch 2>error-ct &&
	test_i18ngrep "beyond a symbolic link" error-ct &&
	test_must_fail git ls-files --error-unmatch arch/x86_64/dir &&
	test_must_fail git ls-files --error-unmatch arch/i386/dir &&

	>arch/i386/dir/file &&
	git add arch/i386/dir/file &&

	test_must_fail git apply tricky_del &&
	test_path_is_file arch/i386/dir/file &&

	test_must_fail git apply --index tricky_del &&
	test_path_is_file arch/i386/dir/file &&
	test_must_fail git ls-files --error-unmatch arch/x86_64/dir &&
	git ls-files --error-unmatch arch/i386/dir &&

	test_must_fail git apply --cached tricky_del &&
	test_must_fail git ls-files --error-unmatch arch/x86_64/dir &&
	git ls-files --error-unmatch arch/i386/dir

expecting success: 
					git config core.whitespace "$rule" &&
					test_fix "$tt$ts$ti$th"
				
patch-0:6: trailing whitespace.
a 
patch-0:7: trailing whitespace.
bb 
patch-0:8: trailing whitespace.
c 
patch-0:9: trailing whitespace.
d 
patch-0:10: trailing whitespace.
eeee 
warning: squelched 3 whitespace errors
warning: 8 lines applied after fixing whitespace errors.
[master (root-commit) e3f79fd] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 empty
patch-1:6: trailing whitespace.
a 
patch-1:7: trailing whitespace.
bb 
patch-1:8: trailing whitespace.
c 
patch-1:10: trailing whitespace.
D 
patch-1:11: trailing whitespace.
eeee 
warning: squelched 2 whitespace errors
warning: 1 line applied after fixing whitespace errors.
ok 3 - withfix (forward)

expecting success: 

	>file &&
	git add file &&

	# Now we have a whitespace breakages on our side.
	git apply --whitespace=nowarn patch-0 &&

	# And somebody sends in a patch based on image
	# with whitespace already fixed.
	git apply --whitespace=fix patch-2 &&

	# The result should accept the whitespace fixed
	# postimage.  But the line with "h" is beyond context
	# horizon and left unfixed.

	sed -e /h/d file-fixed >fixed-head &&
	sed -e /h/d file >file-head &&
	test_cmp fixed-head file-head &&

	sed -n -e /h/p file-fixed >fixed-tail &&
	sed -n -e /h/p file >file-tail &&

	! test_cmp fixed-tail file-tail


error: affected file 'arch/x86_64/dir/file' is beyond a symbolic link
ok 1 - setup

expecting success: 
	git reset --hard &&
	rm -f missing &&
	git apply patch0 &&
	test_cmp expect empty

error: affected file 'arch/x86_64/dir/file' is beyond a symbolic link
ok 8 - rule=-trailing,-space,-indent,-tab

expecting success: 
					git config core.whitespace "$rule,tabwidth=16" &&
					test_fix "$tt$ts$ti16$th"
				
error: pathspec 'arch/x86_64/dir' did not match any file(s) known to git.
Did you forget to 'git add'?
HEAD is now at e3f79fd initial
error: pathspec 'arch/i386/dir' did not match any file(s) known to git.
Did you forget to 'git add'?
--- fixed-tail	2015-12-16 10:57:30.277564828 +0000
+++ file-tail	2015-12-16 10:57:30.285564828 +0000
@@ -1 +1 @@
-h
+h 
ok 4 - withfix (backward)

ok 2 - apply empty

expecting success: 
	git reset --hard &&
	rm -f missing &&
	git apply --index patch0 &&
	test_cmp expect empty &&
	git diff --exit-code

error: affected file 'arch/x86_64/dir/file' is beyond a symbolic link
# passed all 4 test(s)
1..4
ok 9 - rule=-trailing,-space,-indent,-tab,tabwidth=16

expecting success: 
					git config --unset core.whitespace &&
					echo "target whitespace=$rule" >.gitattributes &&
					test_fix "$tt$ts$ti$th"
				
error: pathspec 'arch/x86_64/dir' did not match any file(s) known to git.
Did you forget to 'git add'?
HEAD is now at e3f79fd initial
error: pathspec 'arch/i386/dir' did not match any file(s) known to git.
Did you forget to 'git add'?
*** t4127-apply-same-fn.sh ***
error: arch/x86_64/dir/file: No such file or directory
ok 3 - apply --index empty

expecting success: 
	git reset --hard &&
	rm -f missing &&
	git apply patch1 &&
	test_cmp expect missing

ok 10 - rule=-trailing,-space,-indent,-tab (attributes)

expecting success: 
					echo "target whitespace=$rule,tabwidth=16" >.gitattributes &&
					test_fix "$tt$ts$ti16$th"
				
error: arch/x86_64/dir/file: does not exist in index
HEAD is now at e3f79fd initial
error: pathspec 'arch/x86_64/dir' did not match any file(s) known to git.
Did you forget to 'git add'?
ok 4 - apply create

expecting success: 
	git reset --hard &&
	rm -f missing &&
	git apply --index patch1 &&
	test_cmp expect missing &&
	git diff --exit-code

arch/i386/dir/file
ok 11 - rule=-trailing,-space,-indent,-tab,tabwidth=16 (attributes)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4127-apply-same-fn/.git/
error: arch/x86_64/dir/file: does not exist in index
expecting success: 
					git config core.whitespace "$rule" &&
					test_fix "$tt$ts$ti$th"
				
HEAD is now at e3f79fd initial
expecting success: 
	for i in a b c d e f g h i j k l m
	do
		echo $i
	done >same_fn &&
	cp same_fn other_fn &&
	git add same_fn other_fn &&
	git commit -m initial

error: pathspec 'arch/x86_64/dir' did not match any file(s) known to git.
Did you forget to 'git add'?
arch/i386/dir/file
ok 6 - do not follow symbolic link (same input)

<stdin>:7: tab in indent.
	A HT (%).
<stdin>:8: tab in indent.
 	A SP and a HT (@%).
<stdin>:9: tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: tab in indent.
        	Eight SP and a HT (@#%).
warning: sexpecting success: 

	# existing symbolic link
	git reset --hard &&
	ln -s ../i386/dir arch/x86_64/dir &&
	git add arch/x86_64/dir &&

	test_must_fail git apply add_file.patch 2>error-wt-add &&
	test_i18ngrep "beyond a symbolic link" error-wt-add &&
	test_path_is_missing arch/i386/dir/file &&

	mkdir arch/i386/dir &&
	>arch/i386/dir/file &&
	test_must_fail git apply del_file.patch 2>error-wt-del &&
	test_i18ngrep "beyond a symbolic link" error-wt-del &&
	test_path_is_file arch/i386/dir/file &&
	rm arch/i386/dir/file &&

	test_must_fail git apply --index add_file.patch 2>error-ix-add &&
	test_i18ngrep "beyond a symbolic link" error-ix-add &&
quelched 4	test_path_is_missing arch/i386/dir/file &&
 whitespace errors
	test_must_fail git ls-files --error-unmatch arch/i386/dir &&
warning: 9 lines applied after fixing whitespace errors.

	test_must_fail git apply --cached add_file.patch 2>error-ct-file &&
	test_i18ngrep "beyond a symbolic link" error-ct-file &&
	test_must_fail git ls-files --error-unmatch arch/i386/dir

ok 5 - apply --index create

# passed all 5 test(s)
1..5
HEAD is now at 66a4bdc replay
[master (root-commit) 0df5d9d] initial
 Author: A U Thor <author@example.com>
 2 files changed, 26 insertions(+)
 create mode 100644 other_fn
 create mode 100644 same_fn
ok 1 - setup

expecting success: 
	modify "s/^d/z/" same_fn &&
	git diff > patch0 &&
	git add same_fn &&
	modify "s/^i/y/" same_fn &&
	git diff >> patch0 &&
	cp same_fn same_fn2 &&
	git reset --hard &&
	git apply patch0 &&
	test_cmp same_fn same_fn2

ok 12 - rule=-trailing,-space,-indent,tab

expecting success: 
					git config core.whitespace "$rule,tabwidth=16" &&
					test_fix "$tt$ts$ti16$th"
				
*** t4128-apply-root.sh ***
error: affected file 'arch/x86_64/dir/file' is beyond a symbolic link
<stdin>:7: tab in indent.
	A HT (%).
<stdin>:8: tab in indent.
 	A SP and a HT (@%).
<stdin>:9: tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: tab in indent.
        	Eight SP and a HT (@#%).
warning: squelched 4 whitespace errors
warning: 9 lines applied after fixing whitespace errors.
error: reading from 'arch/x86_64/dir/file' beyond a symbolic link
error: affected file 'arch/x86_64/dir/file' is beyond a symbolic link
ok 13 - rule=-trailing,-space,-indent,tab,tabwidth=16

expecting success: 
					git config --unset core.whitespace &&
					echo "target whitespace=$rule" >.gitattributes &&
					test_fix "$tt$ts$ti$th"
				
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4128-apply-root/.git/
error: pathspec 'arch/i386/dir' did not match any file(s) known to git.
Did you forget to 'git add'?
HEAD is now at 0df5d9d initial
expecting success: 

	mkdir -p some/sub/dir &&
	echo Hello > some/sub/dir/file &&
	git add some/sub/dir/file &&
	git commit -m initial &&
	git tag initial


<stdin>:7: tab in indent.
	A HT (%).
<stdin>:8: tab in indent.
 	A SP and a HT (@%).
<stdin>:9: tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: tab in indent.
        	Eight SP and a HT (@#%).
warning: squelched 4 whitespace errors
warning: 9 lines applied after fixing whitespace errors.
error: affected file 'arch/x86_64/dir/file' is beyond a symbolic link
error: pathspec 'arch/i386/dir' did not match any file(s) known to git.
Did you forget to 'git add'?
ok 7 - do not follow symbolic link (existing)

ok 2 - apply same filename with independent changes

expecting success: 
	git reset --hard &&
	modify "s/^d/z/" same_fn &&
	git diff > patch0 &&
	git add same_fn &&
	modify "s/^e/y/" same_fn &&
	git diff >> patch0 &&
	cp same_fn same_fn2 &&
	git reset --hard &&
	git apply patch0 &&
	test_cmp same_fn same_fn2

# passed all 7 test(s)
1..7
HEAD is now at 0df5d9d initial
ok 14 - rule=-trailing,-space,-indent,tab (attributes)

expecting success: 
					echo "target whitespace=$rule,tabwidth=16" >.gitattributes &&
					test_fix "$tt$ts$ti16$th"
				
[master (root-commit) 8b65bdb] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 some/sub/dir/file
<stdin>:7: tab in indent.
	A HT (%).
<stdin>:8: tab in indent.
 	A SP and a HT (@%).
<stdin>:9: tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: tab in indent.
        	Eight SP and a HT (@#%).
warning: squelched 4 whitespace errors
warning: 9 lines applied after fixing whitespace errors.
ok 1 - setup

expecting success: 

	git apply --directory=some/sub -p3 --index patch &&
	test Bello = $(git show :some/sub/dir/file) &&
	test Bello = $(cat some/sub/dir/file)


*** t4129-apply-samemode.sh ***
ok 15 - rule=-trailing,-space,-indent,tab,tabwidth=16 (attributes)

ok 2 - apply --directory -p (1)

expecting success: 
					git config core.whitespace "$rule" &&
					test_fix "$tt$ts$ti$th"
				
expecting success: 

	git reset --hard initial &&
	git apply --directory=some/sub/ -p3 --index patch &&
	test Bello = $(git show :some/sub/dir/file) &&
	test Bello = $(cat some/sub/dir/file)


HEAD is now at 8b65bdb initial
<stdin>:11: indent with spaces.
        Eight SP (#).
<stdin>:16: indent with spaces.
               Fifteen SP (#).
<stdin>:18: indent with spaces.
                Sixteen SP (#=).
warning: 7 lines applied after fixing whitespace errors.
HEAD is now at 0df5d9d initial
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4129-apply-samemode/.git/
ok 3 - apply --directory -p (2) 

expecting success: 
	git reset --hard initial &&
	git apply --directory=some/sub/dir/ --index patch &&
	test content = $(git show :some/sub/dir/newfile) &&
	test content = $(cat some/sub/dir/newfile)

ok 3 - apply same filename with overlapping changes

expecting success: 
	git reset --hard &&
	git mv same_fn new_fn &&
	modify "s/^d/z/" new_fn &&
	git add new_fn &&
	git diff -M --cached > patch1 &&
	modify "s/^e/y/" new_fn &&
	git diff >> patch1 &&
	cp new_fn new_fn2 &&
	git reset --hard &&
	git apply --index patch1 &&
	test_cmp new_fn new_fn2

expecting success: 
	echo original >file &&
	git add file &&
	test_tick &&
	git commit -m initial &&
	git tag initial &&
	echo modified >file &&
	git diff --stat -p >patch-0.txt &&
	chmod +x file &&
	git diff --stat -p >patch-1.txt

ok 16 - rule=-trailing,-space,indent,-tab

expecting success: 
					git config core.whitespace "$rule,tabwidth=16" &&
					test_fix "$tt$ts$ti16$th"
				
HEAD is now at 8b65bdb initial
HEAD is now at 0df5d9d initial
<stdin>:18: indent with spaces.
                Sixteen SP (#=).
warning: 2 lines applied after fixing whitespace errors.
ok 4 - apply --directory (new file)

[master (root-commit) e950771] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
expecting success: 
	git reset --hard initial &&
	git apply -p2 --directory=some/sub/dir/ --index patch &&
	test content = $(git show :some/sub/dir/newfile2) &&
	test content = $(cat some/sub/dir/newfile2)

HEAD is now at 8b65bdb initial
ok 17 - rule=-trailing,-space,indent,-tab,tabwidth=16

expecting success: 
					git config --unset core.whitespace &&
					echo "target whitespace=$rule" >.gitattributes &&
					test_fix "$tt$ts$ti$th"
				
ok 1 - setup

checking prerequisite: FILEMODE

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	test "$(git config --bool core.filemode)" = true

)
ok 5 - apply --directory -p (new file)

<stdin>:11: indent with spaces.
        Eight SP (#).
<stdin>:16: indent with spaces.
               Fifteen SP (#).
<stdin>:18: indent with spaces.
                Sixteen SP (#=).
warning: 7 lines applied after fixing whitespace errors.
expecting success: 
	git reset --hard initial &&
	echo content >some/sub/dir/delfile &&
	git add some/sub/dir/delfile &&
	git apply --directory=some/sub/dir/ --index patch &&
	! (git ls-files | grep delfile)

HEAD is now at 0df5d9d initial
prerequisite FILEMODE ok
expecting success: 
	git reset --hard &&
	chmod +x file &&
	git apply patch-0.txt &&
	test -x file

HEAD is now at 8b65bdb initial
ok 18 - rule=-trailing,-space,indent,-tab (attributes)

expecting success: 
					echo "target whitespace=$rule,tabwidth=16" >.gitattributes &&
					test_fix "$tt$ts$ti16$th"
				
ok 4 - apply same new filename after rename

expecting success: 
	git reset --hard &&
	git mv same_fn new_fn &&
	modify "s/^d/z/" new_fn &&
	git add new_fn &&
	git diff -M --cached > patch1 &&
	git mv new_fn same_fn &&
	modify "s/^e/y/" same_fn &&
	git diff >> patch1 &&
	git reset --hard &&
	test_must_fail git apply patch1

HEAD is now at e950771 initial
<stdin>:18: indent with spaces.
                Sixteen SP (#=).
warning: 2 lines applied after fixing whitespace errors.
warning: file has type 100755, expected 100644
ok 2 - same mode (no index)

HEAD is now at 0df5d9d initial
ok 6 - apply --directory (delete file)

expecting success: 
	git reset --hard &&
	chmod +x file &&
	git add file &&
	git apply --index patch-0.txt &&
	test -x file &&
	git diff --exit-code

expecting success: 
	git reset --hard initial &&
	git apply --directory=some/sub/dir/ --index patch &&
	test content = $(git show :some/sub/dir/quotefile) &&
	test content = $(cat some/sub/dir/quotefile)

HEAD is now at 8b65bdb initial
HEAD is now at e950771 initial
ok 19 - rule=-trailing,-space,indent,-tab,tabwidth=16 (attributes)

expecting success: 
					git config core.whitespace "$rule" &&
					test_fix "$tt$ts$ti$th"
				
warning: file has type 100755, expected 100644
ok 7 - apply --directory (quoted filename)

<stdin>:8: space before tab in indent.
 	A SP and a HT (@%).
<stdin>:9: space before tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: space before tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: space before tab in indent.
        	Eight SP and a HT (@#%).
<stdin>:14: space before tab in indent.
       	 Seven SP, a HT and a SP (@%).
warning: squelched 3 whitespace errors
warning: 8 lines applied after fixing whitespace errors.
ok 3 - same mode (with index)

expecting success: 
	git reset --hard &&
	chmod +x file &&
	git add file &&
	git apply --cached patch-0.txt &&
	git ls-files -s file | grep "^100755"

# passed all 7 test(s)
1..7
HEAD is now at e950771 initial
ok 20 - rule=-trailing,space,-indent,-tab

expecting success: 
					git config core.whitespace "$rule,tabwidth=16" &&
					test_fix "$tt$ts$ti16$th"
				
HEAD is now at 0df5d9d initial
*** t4130-apply-criss-cross-rename.sh ***
error: path same_fn has been renamed/deleted
ok 5 - apply same old filename after rename -- should fail.

expecting success: 
	git reset --hard &&
	git mv same_fn new_fn &&
	modify "s/^d/z/" new_fn &&
	git add new_fn &&
	git diff -M --cached > patch1 &&
	git commit -m "a rename" &&
	git mv other_fn same_fn &&
	modify "s/^e/y/" same_fn &&
	git add same_fn &&
	git diff -M --cached >> patch1 &&
	modify "s/^g/x/" same_fn &&
	git diff >> patch1 &&
	git reset --hard HEAD^ &&
	git apply patch1

warning: file has type 100755, expected 100644
<stdin>:8: space before tab in indent.
 	A SP and a HT (@%).
<stdin>:9: space before tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: space before tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: space before tab in indent.
        	Eight SP and a HT (@#%).
<stdin>:14: space before tab in indent.
       	 Seven SP, a HT and a SP (@%).
warning: squelched 3 whitespace errors
warning: 8 lines applied after fixing whitespace errors.
100755 2e0996000b7e9019eabcad29391bf0f5c7702f0b 0	file
ok 4 - same mode (index only)

expecting success: 
	git reset --hard &&
	git apply patch-1.txt &&
	test -x file

HEAD is now at 0df5d9d initial
HEAD is now at e950771 initial
ok 5 - mode update (no index)

ok 21 - rule=-trailing,space,-indent,-tab,tabwidth=16

expecting success: 
					git config --unset core.whitespace &&
					echo "target whitespace=$rule" >.gitattributes &&
					test_fix "$tt$ts$ti$th"
				
expecting success: 
	git reset --hard &&
	git apply --index patch-1.txt &&
	test -x file &&
	git diff --exit-code

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4130-apply-criss-cross-rename/.git/
expecting success: 
	create_file file1 "File1 contents" &&
	create_file file2 "File2 contents" &&
	create_file file3 "File3 contents" &&
	git add file1 file2 file3 &&
	git commit -m 1

HEAD is now at e950771 initial
<stdin>:8: space before tab in indent.
 	A SP and a HT (@%).
<stdin>:9: space before tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: space before tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: space before tab in indent.
        	Eight SP and a HT (@#%).
<stdin>:14: space before tab in indent.
       	 Seven SP, a HT and a SP (@%).
warning: squelched 3 whitespace errors
warning: 8 lines applied after fixing whitespace errors.
[master 3d24079] a rename
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename same_fn => new_fn (92%)
ok 6 - mode update (with index)

expecting success: 
	git reset --hard &&
	git apply --cached patch-1.txt &&
	git ls-files -s file | grep "^100755"

ok 22 - rule=-trailing,space,-indent,-tab (attributes)

expecting success: 
					echo "target whitespace=$rule,tabwidth=16" >.gitattributes &&
					test_fix "$tt$ts$ti16$th"
				
HEAD is now at e950771 initial
<stdin>:8: space before tab in indent.
 	A SP and a HT (@%).
<stdin>:9: space before tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: space before tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: space before tab in indent.
        	Eight SP and a HT (@#%).
<stdin>:14: space before tab in indent.
       	 Seven SP, a HT and a SP (@%).
warning: squelched 3 whitespace errors
warning: 8 lines applied after fixing whitespace errors.
[master (root-commit) 1b8e00e] 1
 Author: A U Thor <author@example.com>
 3 files changed, 303 insertions(+)
 create mode 100644 file1
 create mode 100644 file2
 create mode 100644 file3
ok 1 - setup

expecting success: 
	mv file1 tmp &&
	mv file2 file1 &&
	mv tmp file2 &&
	cp file1 file1-swapped &&
	cp file2 file2-swapped

100755 2e0996000b7e9019eabcad29391bf0f5c7702f0b 0	file
ok 7 - mode update (index only)

# passed all 7 test(s)
1..7
ok 2 - criss-cross rename

expecting success: 
	git diff -M -B > diff &&
	git reset --hard


ok 23 - rule=-trailing,space,-indent,-tab,tabwidth=16 (attributes)

HEAD is now at 0df5d9d initial
expecting success: 
					git config core.whitespace "$rule" &&
					test_fix "$tt$ts$ti$th"
				
*** t4131-apply-fake-ancestor.sh ***
ok 6 - apply A->B (rename), C->A (rename), A->A -- should pass.

# passed all 6 test(s)
1..6
<stdin>:7: tab in indent.
	A HT (%).
<stdin>:8: space before tab in indent.
 	A SP and a HT (@%).
<stdin>:9: space before tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: space before tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: space before tab in indent.
        	Eight SP and a HT (@#%).
warning: squelched 4 whitespace errors
warning: 9 lines applied after fixing whitespace errors.
HEAD is now at 1b8e00e 1
ok 3 - diff -M -B

expecting success: 
	git apply diff &&
	test_cmp file1 file1-swapped &&
	test_cmp file2 file2-swapped

ok 4 - apply

expecting success: 
	git reset --hard &&
	mv file1 tmp &&
	mv file2 file1 &&
	mv file3 file2 &&
	mv tmp file3 &&
	cp file1 file1-swapped &&
	cp file2 file2-swapped &&
	cp file3 file3-swapped

ok 24 - rule=-trailing,space,-indent,tab

expecting success: 
					git config core.whitespace "$rule,tabwidth=16" &&
					test_fix "$tt$ts$ti16$th"
				
*** t4132-apply-removal.sh ***
HEAD is now at 1b8e00e 1
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4131-apply-fake-ancestor/.git/
expecting success: 
	test_commit 1 &&
	test_commit 2 &&
	mkdir sub &&
	test_commit 3 sub/3.t &&
	test_commit 4

<stdin>:7: tab in indent.
	A HT (%).
<stdin>:8: space before tab in indent.
 	A SP and a HT (@%).
<stdin>:9: space before tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: space before tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: space before tab in indent.
        	Eight SP and a HT (@#%).
warning: squelched 4 whitespace errors
warning: 9 lines applied after fixing whitespace errors.
ok 5 - criss-cross rename

expecting success: 
	git diff -M -B > diff &&
	git reset --hard

ok 25 - rule=-trailing,space,-indent,tab,tabwidth=16

[master (root-commit) d0dcf97] 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 1.t
expecting success: 
					git config --unset core.whitespace &&
					echo "target whitespace=$rule" >.gitattributes &&
					test_fix "$tt$ts$ti$th"
				
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4132-apply-removal/.git/
expecting success: 
	cat <<-EOF >c &&
	diff -ruN a/file b/file
	--- a/file	TS0
	+++ b/file	TS1
	@@ -0,0 +1 @@
	+something
	EOF

	cat <<-EOF >d &&
	diff -ruN a/file b/file
	--- a/file	TS0
	+++ b/file	TS1
	@@ -1 +0,0 @@
	-something
	EOF

	timeWest="1982-09-16 07:00:00.000000000 -0800" &&
	 timeGMT="1982-09-16 15:00:00.000000000 +0000" &&
	timeEast="1982-09-17 00:00:00.000000000 +0900" &&

	epocWest="1969-12-31 16:00:00.000000000 -0800" &&
	 epocGMT="1970-01-01 00:00:00.000000000 +0000" &&
	epocEast="1970-01-01 09:00:00.000000000 +0900" &&
	epocWest2="1969-12-31 16:00:00 -08:00" &&

	sed -e "s/TS0/$epocWest/" -e "s/TS1/$timeWest/" <c >createWest.patch &&
	sed -e "s/TS0/$epocEast/" -e "s/TS1/$timeEast/" <c >createEast.patch &&
	sed -e "s/TS0/$epocGMT/" -e "s/TS1/$timeGMT/" <c >createGMT.patch &&

	sed -e "s/TS0/$timeWest/" -e "s/TS1/$timeWest/" <c >addWest.patch &&
	sed -e "s/TS0/$timeEast/" -e "s/TS1/$timeEast/" <c >addEast.patch &&
	sed -e "s/TS0/$timeGMT/" -e "s/TS1/$timeGMT/" <c >addGMT.patch &&

	sed -e "s/TS0/$timeWest/" -e "s/TS1/$timeWest/" <d >emptyWest.patch &&
	sed -e "s/TS0/$timeEast/" -e "s/TS1/$timeEast/" <d >emptyEast.patch &&
	sed -e "s/TS0/$timeGMT/" -e "s/TS1/$timeGMT/" <d >emptyGMT.patch &&

	sed -e "s/TS0/$timeWest/" -e "s/TS1/$epocWest/" <d >removeWest.patch &&
	sed -e "s/TS0/$timeEast/" -e "s/TS1/$epocEast/" <d >removeEast.patch &&
	sed -e "s/TS0/$timeGMT/" -e "s/TS1/$epocGMT/" <d >removeGMT.patch &&
	sed -e "s/TS0/$timeWest/" -e "s/TS1/$epocWest2/" <d >removeWest2.patch &&

	echo something >something &&
	>empty

HEAD is now at 1b8e00e 1
ok 6 - diff -M -B

expecting success: 
	git apply diff &&
	test_cmp file1 file1-swapped &&
	test_cmp file2 file2-swapped &&
	test_cmp file3 file3-swapped

<stdin>:7: tab in indent.
	A HT (%).
<stdin>:8: space before tab in indent.
 	A SP and a HT (@%).
<stdin>:9: space before tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: space before tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: space before tab in indent.
        	Eight SP and a HT (@#%).
warning: squelched 4 whitespace errors
warning: 9 lines applied after fixing whitespace errors.
ok 7 - apply

# passed all 7 test(s)
1..7
[master 82335b2] 2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 2.t
ok 26 - rule=-trailing,space,-indent,tab (attributes)

expecting success: 
					echo "target whitespace=$rule,tabwidth=16" >.gitattributes &&
					test_fix "$tt$ts$ti16$th"
				
*** t4133-apply-filenames.sh ***
<stdin>:7: tab in indent.
	A HT (%).
<stdin>:8: space before tab in indent.
 	A SP and a HT (@%).
<stdin>:9: space before tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: space before tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: space before tab in indent.
        	Eight SP and a HT (@#%).
warning: squelched 4 whitespace errors
warning: 9 lines applied after fixing whitespace errors.
ok 1 - setup

expecting success: 
		rm -f file .git/index &&
		case "$patch" in
		create*)
			# must be able to create
			git apply --index $patch &&
			test_cmp file something &&
			# must notice the file is already there
			>file &&
			git add file &&
			test_must_fail git apply $patch
			;;
		add*)
			# must be able to create or patch
			git apply $patch &&
			test_cmp file something &&
			>file &&
			git apply $patch &&
			test_cmp file something
			;;
		empty*)
			# must leave an empty file
			cat something >file &&
			git add file &&
			git apply --index $patch &&
			test -f file &&
			test_cmp empty file
			;;
		remove*)
			# must remove the file
			cat something >file &&
			git add file &&
			git apply --index $patch &&
			! test -f file
			;;
		esac
	
[master 0015c90] 3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 sub/3.t
ok 27 - rule=-trailing,space,-indent,tab,tabwidth=16 (attributes)

ok 2 - test addEast.patch

expecting success: 
					git config core.whitespace "$rule" &&
					test_fix "$tt$ts$ti$th"
				
expecting success: 
		rm -f file .git/index &&
		case "$patch" in
		create*)
			# must be able to create
			git apply --index $patch &&
			test_cmp file something &&
			# must notice the file is already there
			>file &&
			git add file &&
			test_must_fail git apply $patch
			;;
		add*)
			# must be able to create or patch
			git apply $patch &&
			test_cmp file something &&
			>file &&
			git apply $patch &&
			test_cmp file something
			;;
		empty*)
			# must leave an empty file
			cat something >file &&
			git add file &&
			git apply --index $patch &&
			test -f file &&
			test_cmp empty file
			;;
		remove*)
			# must remove the file
			cat something >file &&
			git add file &&
			git apply --index $patch &&
			! test -f file
			;;
		esac
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4133-apply-filenames/.git/
<stdin>:8: space before tab in indent.
 	A SP and a HT (@%).
<stdin>:9: space before tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:11: indent with spaces.
        Eight SP (#).
<stdin>:12: space before tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: space before tab in indent.
        	Eight SP and a HT (@#%).
warning: squelched 6 whitespace errors
warning: 11 lines applied after fixing whitespace errors.
expecting success: 
	cat > bad1.patch <<EOF &&
diff --git a/f b/f
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/f-blah
@@ -0,0 +1 @@
+1
EOF
	cat > bad2.patch <<EOF
diff --git a/f b/f
deleted file mode 100644
index d00491f..0000000
--- b/f-blah
+++ /dev/null
@@ -1 +0,0 @@
-1
EOF

ok 3 - test addGMT.patch

expecting success: 
		rm -f file .git/index &&
		case "$patch" in
		create*)
			# must be able to create
			git apply --index $patch &&
			test_cmp file something &&
			# must notice the file is already there
			>file &&
			git add file &&
			test_must_fail git apply $patch
			;;
		add*)
			# must be able to create or patch
			git apply $patch &&
			test_cmp file something &&
			>file &&
			git apply $patch &&
			test_cmp file something
			;;
		empty*)
			# must leave an empty file
			cat something >file &&
			git add file &&
			git apply --index $patch &&
			test -f file &&
			test_cmp empty file
			;;
		remove*)
			# must remove the file
			cat something >file &&
			git add file &&
			git apply --index $patch &&
			! test -f file
			;;
		esac
	
[master 8d74a78] 4
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 4.t
ok 1 - setup

expecting success: 
	test_must_fail git apply bad1.patch 2>err &&
	test_i18ngrep "inconsistent new filename" err &&
	test_must_fail git apply bad2.patch 2>err &&
	test_i18ngrep "inconsistent old filename" err

ok 1 - setup

expecting success: 
	git checkout 2 &&
	echo "A" > 1.t &&
	git diff > 1.patch &&
	git reset --hard &&
	git checkout 1 &&
	git apply --build-fake-ancestor 1.ancestor 1.patch

ok 28 - rule=-trailing,space,indent,-tab

expecting success: 
					git config core.whitespace "$rule,tabwidth=16" &&
					test_fix "$tt$ts$ti16$th"
				
fatal: git apply: bad git-diff - inconsistent new filename on line 5
Note: checking out '2'.

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 82335b2... 2
ok 4 - test addWest.patch

expecting success: 
		rm -f file .git/index &&
		case "$patch" in
		create*)
			# must be able to create
			git apply --index $patch &&
			test_cmp file something &&
			# must notice the file is already there
			>file &&
			git add file &&
			test_must_fail git apply $patch
			;;
		add*)
			# must be able to create or patch
			git apply $patch &&
			test_cmp file something &&
			>file &&
			git apply $patch &&
			test_cmp file something
			;;
		empty*)
			# must leave an empty file
			cat something >file &&
			git add file &&
			git apply --index $patch &&
			test -f file &&
			test_cmp empty file
			;;
		remove*)
			# must remove the file
			cat something >file &&
			git add file &&
			git apply --index $patch &&
			! test -f file
			;;
		esac
	
<stdin>:8: space before tab in indent.
 	A SP and a HT (@%).
<stdin>:9: space before tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: space before tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: space before tab in indent.
        	Eight SP and a HT (@#%).
<stdin>:14: space before tab in indent.
       	 Seven SP, a HT and a SP (@%).
warning: squelched 4 whitespace errors
warning: 9 lines applied after fixing whitespace errors.
fatal: git apply: bad git-diff - inconsistent old filename on line 4
ok 2 - apply diff with inconsistent filenames in headers

# passed all 2 test(s)
1..2
HEAD is now at 82335b2 2
*** t4134-apply-submodule.sh ***
ok 29 - rule=-trailing,space,indent,-tab,tabwidth=16

expecting success: 
					git config --unset core.whitespace &&
					echo "target whitespace=$rule" >.gitattributes &&
					test_fix "$tt$ts$ti$th"
				
error: file: already exists in working directory
ok 5 - test createEast.patch

expecting success: 
		rm -f file .git/index &&
		case "$patch" in
		create*)
			# must be able to create
			git apply --index $patch &&
			test_cmp file something &&
			# must notice the file is already there
			>file &&
			git add file &&
			test_must_fail git apply $patch
			;;
		add*)
			# must be able to create or patch
			git apply $patch &&
			test_cmp file something &&
			>file &&
			git apply $patch &&
			test_cmp file something
			;;
		empty*)
			# must leave an empty file
			cat something >file &&
			git add file &&
			git apply --index $patch &&
			test -f file &&
			test_cmp empty file
			;;
		remove*)
			# must remove the file
			cat something >file &&
			git add file &&
			git apply --index $patch &&
			! test -f file
			;;
		esac
	
Previous HEAD position was 82335b2... 2
HEAD is now at d0dcf97... 1
<stdin>:8: space before tab in indent.
 	A SP and a HT (@%).
<stdin>:9: space before tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:11: indent with spaces.
        Eight SP (#).
<stdin>:12: space before tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: space before tab in indent.
        	Eight SP and a HT (@#%).
warning: squelched 6 whitespace errors
warning: 11 lines applied after fixing whitespace errors.
ok 2 - apply --build-fake-ancestor

expecting success: 
	git checkout 3 &&
	echo "C" > sub/3.t &&
	git diff > 3.patch &&
	git reset --hard &&
	git checkout 4 &&
	(
		cd sub &&
		git apply --build-fake-ancestor 3.ancestor ../3.patch &&
		test -f 3.ancestor
	) &&
	git apply --build-fake-ancestor 3.ancestor 3.patch &&
	test_cmp sub/3.ancestor 3.ancestor

error: file: already exists in working directory
Previous HEAD position was d0dcf97... 1
ok 6 - test createGMT.patch

expecting success: 
		rm -f file .git/index &&
		case "$patch" in
		create*)
			# must be able to create
			git apply --index $patch &&
			test_cmp file something &&
			# must notice the file is already there
			>file &&
			git add file &&
			test_must_fail git apply $patch
			;;
		add*)
			# must be able to create or patch
			git apply $patch &&
			test_cmp file something &&
			>file &&
			git apply $patch &&
			test_cmp file something
			;;
		empty*)
			# must leave an empty file
			cat something >file &&
			git add file &&
			git apply --index $patch &&
			test -f file &&
			test_cmp empty file
			;;
		remove*)
			# must remove the file
			cat something >file &&
			git add file &&
			git apply --index $patch &&
			! test -f file
			;;
		esac
	
HEAD is now at 0015c90... 3
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4134-apply-submodule/.git/
ok 30 - rule=-trailing,space,indent,-tab (attributes)

expecting success: 
					echo "target whitespace=$rule,tabwidth=16" >.gitattributes &&
					test_fix "$tt$ts$ti16$th"
				
expecting success: 
	cat > create-sm.patch <<EOF &&
diff --git a/dir/sm b/dir/sm
new file mode 160000
index 0000000..0123456
--- /dev/null
+++ b/dir/sm
@@ -0,0 +1 @@
+Subproject commit 0123456789abcdef0123456789abcdef01234567
EOF
	cat > remove-sm.patch <<EOF
diff --git a/dir/sm b/dir/sm
deleted file mode 160000
index 0123456..0000000
--- a/dir/sm
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 0123456789abcdef0123456789abcdef01234567
EOF

<stdin>:8: space before tab in indent.
 	A SP and a HT (@%).
<stdin>:9: space before tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: space before tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: space before tab in indent.
        	Eight SP and a HT (@#%).
<stdin>:14: space before tab in indent.
       	 Seven SP, a HT and a SP (@%).
warning: squelched 4 whitespace errors
warning: 9 lines applied after fixing whitespace errors.
ok 1 - setup

expecting success: 
	git apply --index create-sm.patch &&
	test -d dir/sm &&
	git apply --index remove-sm.patch &&
	test \! -d dir

error: file: already exists in working directory
ok 7 - test createWest.patch

expecting success: 
		rm -f file .git/index &&
		case "$patch" in
		create*)
			# must be able to create
			git apply --index $patch &&
			test_cmp file something &&
			# must notice the file is already there
			>file &&
			git add file &&
			test_must_fail git apply $patch
			;;
		add*)
			# must be able to create or patch
			git apply $patch &&
			test_cmp file something &&
			>file &&
			git apply $patch &&
			test_cmp file something
			;;
		empty*)
			# must leave an empty file
			cat something >file &&
			git add file &&
			git apply --index $patch &&
			test -f file &&
			test_cmp empty file
			;;
		remove*)
			# must remove the file
			cat something >file &&
			git add file &&
			git apply --index $patch &&
			! test -f file
			;;
		esac
	
HEAD is now at 0015c90 3
ok 2 - removing a submodule also removes all leading subdirectories

Previous HEAD position was 0015c90... 3
ok 31 - rule=-trailing,space,indent,-tab,tabwidth=16 (attributes)

HEAD is now at 8d74a78... 4
# passed all 2 test(s)
1..2
expecting success: 
					git config core.whitespace "$rule" &&
					test_fix "$tt$ts$ti$th"
				
ok 8 - test emptyEast.patch

expecting success: 
		rm -f file .git/index &&
		case "$patch" in
		create*)
			# must be able to create
			git apply --index $patch &&
			test_cmp file something &&
			# must notice the file is already there
			>file &&
			git add file &&
			test_must_fail git apply $patch
			;;
		add*)
			# must be able to create or patch
			git apply $patch &&
			test_cmp file something &&
			>file &&
			git apply $patch &&
			test_cmp file something
			;;
		empty*)
			# must leave an empty file
			cat something >file &&
			git add file &&
			git apply --index $patch &&
			test -f file &&
			test_cmp empty file
			;;
		remove*)
			# must remove the file
			cat something >file &&
			git add file &&
			git apply --index $patch &&
			! test -f file
			;;
		esac
	
<stdin>:21: trailing whitespace.
A line with a (!) trailing SP 
<stdin>:22: trailing whitespace.
A line with a (!) trailing HT	
warning: 2 lines applied after fixing whitespace errors.
*** t4135-apply-weird-filenames.sh ***
ok 3 - apply --build-fake-ancestor in a subdirectory

# passed all 3 test(s)
1..3
ok 9 - test emptyGMT.patch

expecting success: 
		rm -f file .git/index &&
		case "$patch" in
		create*)
			# must be able to create
			git apply --index $patch &&
			test_cmp file something &&
			# must notice the file is already there
			>file &&
			git add file &&
			test_must_fail git apply $patch
			;;
		add*)
			# must be able to create or patch
			git apply $patch &&
			test_cmp file something &&
			>file &&
			git apply $patch &&
			test_cmp file something
			;;
		empty*)
			# must leave an empty file
			cat something >file &&
			git add file &&
			git apply --index $patch &&
			test -f file &&
			test_cmp empty file
			;;
		remove*)
			# must remove the file
			cat something >file &&
			git add file &&
			git apply --index $patch &&
			! test -f file
			;;
		esac
	
ok 32 - rule=trailing,-space,-indent,-tab

expecting success: 
					git config core.whitespace "$rule,tabwidth=16" &&
					test_fix "$tt$ts$ti16$th"
				
*** t4136-apply-check.sh ***
<stdin>:21: trailing whitespace.
A line with a (!) trailing SP 
<stdin>:22: trailing whitespace.
A line with a (!) trailing HT	
warning: 2 lines applied after fixing whitespace errors.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4135-apply-weird-filenames/.git/
ok 10 - test emptyWest.patch

expecting success: 
		rm -f file .git/index &&
		case "$patch" in
		create*)
			# must be able to create
			git apply --index $patch &&
			test_cmp file something &&
			# must notice the file is already there
			>file &&
			git add file &&
			test_must_fail git apply $patch
			;;
		add*)
			# must be able to create or patch
			git apply $patch &&
			test_cmp file something &&
			>file &&
			git apply $patch &&
			test_cmp file something
			;;
		empty*)
			# must leave an empty file
			cat something >file &&
			git add file &&
			git apply --index $patch &&
			test -f file &&
			test_cmp empty file
			;;
		remove*)
			# must remove the file
			cat something >file &&
			git add file &&
			git apply --index $patch &&
			! test -f file
			;;
		esac
	
expecting success: 
	vector=$TEST_DIRECTORY/t4135 &&

	test_tick &&
	git commit --allow-empty -m preimage &&
	git tag preimage &&

	reset_preimage() {
		git checkout -f preimage^0 &&
		git read-tree -u --reset HEAD &&
		git update-index --refresh
	} &&

	test_when_finished "rm -f \"tab	embedded.txt\"" &&
	test_when_finished "rm -f '\"quoteembedded\".txt'" &&
	if touch -- "tab	embedded.txt" '"quoteembedded".txt'
	then
		test_set_prereq FUNNYNAMES
	fi

[master (root-commit) 9cf544c] preimage
 Author: A U Thor <author@example.com>
ok 33 - rule=trailing,-space,-indent,-tab,tabwidth=16

expecting success: 
					git config --unset core.whitespace &&
					echo "target whitespace=$rule" >.gitattributes &&
					test_fix "$tt$ts$ti$th"
				
ok 11 - test removeEast.patch

expecting success: 
		rm -f file .git/index &&
		case "$patch" in
		create*)
			# must be able to create
			git apply --index $patch &&
			test_cmp file something &&
			# must notice the file is already there
			>file &&
			git add file &&
			test_must_fail git apply $patch
			;;
		add*)
			# must be able to create or patch
			git apply $patch &&
			test_cmp file something &&
			>file &&
			git apply $patch &&
			test_cmp file something
			;;
		empty*)
			# must leave an empty file
			cat something >file &&
			git add file &&
			git apply --index $patch &&
			test -f file &&
			test_cmp empty file
			;;
		remove*)
			# must remove the file
			cat something >file &&
			git add file &&
			git apply --index $patch &&
			! test -f file
			;;
		esac
	
ok 1 - setup

expecting success: 
		echo postimage >expected &&
		reset_preimage &&
		rm -f 'postimage.txt' &&
		git apply -v "$vector"/'git-plain.diff' &&
		test_cmp expected 'postimage.txt'
	
<stdin>:21: trailing whitespace.
A line with a (!) trailing SP 
<stdin>:22: trailing whitespace.
A line with a (!) trailing HT	
warning: 2 lines applied after fixing whitespace errors.
Note: checking out 'preimage^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>

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4136-apply-check/.git/
HEAD is now at 9cf544c... preimage
ok 12 - test removeGMT.patch

expecting success: 
		rm -f file .git/index &&
		case "$patch" in
		create*)
			# must be able to create
			git apply --index $patch &&
			test_cmp file something &&
			# must notice the file is already there
			>file &&
			git add file &&
			test_must_fail git apply $patch
			;;
		add*)
			# must be able to create or patch
			git apply $patch &&
			test_cmp file something &&
			>file &&
			git apply $patch &&
			test_cmp file something
			;;
		empty*)
			# must leave an empty file
			cat something >file &&
			git add file &&
			git apply --index $patch &&
			test -f file &&
			test_cmp empty file
			;;
		remove*)
			# must remove the file
			cat something >file &&
			git add file &&
			git apply --index $patch &&
			! test -f file
			;;
		esac
	
expecting success: 
	test_commit 1

ok 34 - rule=trailing,-space,-indent,-tab (attributes)

expecting success: 
					echo "target whitespace=$rule,tabwidth=16" >.gitattributes &&
					test_fix "$tt$ts$ti16$th"
				
ok 13 - test removeWest.patch

expecting success: 
		rm -f file .git/index &&
		case "$patch" in
		create*)
<stdin>:21: trailing whitespace.
A line with a (!) trailing SP 
<stdin>:22: trailing whitespace.
A line with a (!) trailing HT	
			# must be able to create
			git apply --index $patch &&
			test_cmp file something &&
			# must notice the file is already there
			>file &&
			git add file &&
			test_must_fail git apply $patch
			;;
		add*)
			# must be able to create or patch
			git apply $patch &&
			test_cmp file something &&
			>file &&
			git apply $patch &&
			test_cmp file something
			;;
		empty*)
			# must leave an empty file
			cat something >file &&
			git add file &&
			git apply --index $patch &&
			test -f file &&
			test_cmp empty file
			;;
		remove*)
warning: 			# must remove the file
2 lines applied after fixing whitespace errors.
			cat something >file &&
			git add file &&
			git apply --index $patch &&
			! test -f file
			;;
		esac
	
[master (root-commit) d0dcf97] 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 1.t
Checking patch postimage.txt...
Applied patch postimage.txt cleanly.
ok 2 - plain, git-style file creation patch

expecting success: 
		echo postimage >expected &&
		reset_preimage &&
		echo preimage >'postimage.txt' &&
		git apply -v "$vector"/'diff-plain.diff' &&
		test_cmp expected 'postimage.txt'
	
ok 1 - setup

expecting success: 
	test_must_fail git apply --check - <<-\EOF
	I am not a patch
	I look nothing like a patch
	git apply must fail
	EOF

fatal: unrecognized input
ok 2 - apply --check exits non-zero with unrecognized input

expecting success: 
	cat >input <<-\EOF &&
	diff --get a/1 b/1
	index 6696ea4..606eddd 100644
	--- a/1
	+++ b/1
	@@ -1,1 +1,1 @@
	 1
	EOF
	test_must_fail git apply --stat input &&
	test_must_fail git apply --check input

ok 14 - test removeWest2.patch

HEAD is now at 9cf544c... preimage
# passed all 14 test(s)
1..14
fatal: corrupt patch at line 7
ok 35 - rule=trailing,-space,-indent,-tab,tabwidth=16 (attributes)

expecting success: 
					git config core.whitespace "$rule" &&
					test_fix "$tt$ts$ti$th"
				
fatal: corrupt patch at line 7
ok 3 - apply exits non-zero with no-op patch

# passed all 3 test(s)
1..3
Checking patch postimage.txt...
Applied patch postimage.txt cleanly.
*** t4137-apply-submodule.sh ***
<stdin>:7: tab in indent.
	A HT (%).
ok 3 - plain, traditional patch

expecting success: 
		echo postimage >expected &&
		reset_preimage &&
		rm -f 'postimage.txt' &&
		git apply -v "$vector"/'add-plain.diff' &&
		test_cmp expected 'postimage.txt'
	
<stdin>:8: tab in indent.
 	A SP and a HT (@%).
<stdin>:9: tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: tab in indent.
        	Eight SP and a HT (@#%).
warning: squelched 6 whitespace errors
warning: 11 lines applied after fixing whitespace errors.
HEAD is now at 9cf544c... preimage
*** t4138-apply-ws-expansion.sh ***
ok 36 - rule=trailing,-space,-indent,tab

expecting success: 
					git config core.whitespace "$rule,tabwidth=16" &&
					test_fix "$tt$ts$ti16$th"
				
Checking patch postimage.txt...
Applied patch postimage.txt cleanly.
ok 4 - plain, traditional file creation patch

expecting success: 
		echo postimage >expected &&
		reset_preimage &&
		rm -f 'post image.txt' &&
		git apply -v "$vector"/'git-with spaces.diff' &&
		test_cmp expected 'post image.txt'
	
<stdin>:7: tab in indent.
	A HT (%).
<stdin>:8: tab in indent.
 	A SP and a HT (@%).
<stdin>:9: tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: tab in indent.
        	Eight SP and a HT (@#%).
warning: squelched 6 whitespace errors
warning: 11 lines applied after fixing whitespace errors.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/.git/
HEAD is now at 9cf544c... preimage
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
		)
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4138-apply-ws-expansion/.git/
expecting success: 
	#
	## create test-N, patchN.patch, expect-N files
	#

	# test 1
	printf "\t%s\n" 1 2 3 4 5 6 >before &&
	printf "\t%s\n" 1 2 3 >after &&
	printf "%64s\n" a b c >>after &&
	printf "\t%s\n" 4 5 6 >>after &&
	git diff --no-index before after |
		sed -e "s/before/test-1/" -e "s/after/test-1/" >patch1.patch &&
	printf "%64s\n" 1 2 3 4 5 6 >test-1 &&
	printf "%64s\n" 1 2 3 a b c 4 5 6 >expect-1 &&

	# test 2
	printf "\t%s\n" a b c d e f >before &&
	printf "\t%s\n" a b c >after &&
	n=10 &&
	x=1 &&
	while test $x -lt $n
	do
		printf "%63s%d\n" "" $x >>after
		x=$(( $x + 1 ))
	done &&
	printf "\t%s\n" d e f >>after &&
	git diff --no-index before after |
		sed -e "s/before/test-2/" -e "s/after/test-2/" >patch2.patch &&
	printf "%64s\n" a b c d e f >test-2 &&
	printf "%64s\n" a b c >expect-2 &&
	x=1 &&
	while test $x -lt $n
	do
		printf "%63s%d\n" "" $x >>expect-2
		x=$(( $x + 1 ))
	done &&
	printf "%64s\n" d e f >>expect-2 &&

	# test 3
	printf "\t%s\n" a b c d e f >before &&
	printf "\t%s\n" a b c >after &&
	n=100 &&
	x=0 &&
	while test $x -lt $n
	do
		printf "%63s%02d\n" "" $x >>after
		x=$(( $x + 1 ))
	done &&
	printf "\t%s\n" d e f >>after &&
	git diff --no-index before after |
	sed -e "s/before/test-3/" -e "s/after/test-3/" >patch3.patch &&
	printf "%64s\n" a b c d e f >test-3 &&
	printf "%64s\n" a b c >expect-3 &&
	x=0 &&
	while test $x -lt $n
	do
		printf "%63s%02d\n" "" $x >>expect-3
		x=$(( $x + 1 ))
	done &&
	printf "%64s\n" d e f >>expect-3 &&

	# test 4
	>before &&
	x=0 &&
	while test $x -lt 50
	do
		printf "\t%02d\n" $x >>before
		x=$(( $x + 1 ))
	done &&
	cat before >after &&
	printf "%64s\n" a b c >>after &&
	while test $x -lt 100
	do
		printf "\t%02d\n" $x >>before
		printf "\t%02d\n" $x >>after
		x=$(( $x + 1 ))
	done &&
	git diff --no-index before after |
	sed -e "s/before/test-4/" -e "s/after/test-4/" >patch4.patch &&
	>test-4 &&
	x=0 &&
	while test $x -lt 50
	do
		printf "%63s%02d\n" "" $x >>test-4
		x=$(( $x + 1 ))
	done &&
	cat test-4 >expect-4 &&
	printf "%64s\n" a b c >>expect-4 &&
	while test $x -lt 100
	do
		printf "%63s%02d\n" "" $x >>test-4
		printf "%63s%02d\n" "" $x >>expect-4
		x=$(( $x + 1 ))
	done &&

	git config core.whitespace tab-in-indent,tabwidth=63 &&
	git config apply.whitespace fix


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/submodule_update_repo/.git/
ok 37 - rule=trailing,-space,-indent,tab,tabwidth=16

expecting success: 
					git config --unset core.whitespace &&
					echo "target whitespace=$rule" >.gitattributes &&
					test_fix "$tt$ts$ti$th"
				
Checking patch post image.txt...
Applied patch post image.txt cleanly.
ok 5 - with spaces, git-style file creation patch

expecting success: 
		echo postimage >expected &&
		reset_preimage &&
		echo preimage >'post image.txt' &&
		git apply -v "$vector"/'diff-with spaces.diff' &&
		test_cmp expected 'post image.txt'
	
<stdin>:7: tab in indent.
	A HT (%).
<stdin>:8: tab in indent.
 	A SP and a HT (@%).
<stdin>:9: tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: tab in indent.
        	Eight SP and a HT (@#%).
warning: squelched 6 whitespace errors
warning: 11 lines applied after fixing whitespace errors.
HEAD is now at 9cf544c... preimage
[master (root-commit) 613068f] 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
Checking patch post image.txt...
Applied patch post image.txt cleanly.
ok 38 - rule=trailing,-space,-indent,tab (attributes)

expecting success: 
					echo "target whitespace=$rule,tabwidth=16" >.gitattributes &&
					test_fix "$tt$ts$ti16$th"
				
ok 6 - with spaces, traditional patch

expecting success: 
		echo postimage >expected &&
		reset_preimage &&
		rm -f 'post image.txt' &&
		git apply -v "$vector"/'add-with spaces.diff' &&
		test_cmp expected 'post image.txt'
	
Switched to a new branch 'add_sub1'
<stdin>:7: tab in indent.
	A HT (%).
<stdin>:8: tab in indent.
 	A SP and a HT (@%).
<stdin>:9: tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: tab in indent.
        	Eight SP and a HT (@#%).
warning: squelched 6 whitespace errors
warning: 11 lines applied after fixing whitespace errors.
HEAD is now at 9cf544c... preimage
ok 39 - rule=trailing,-space,-indent,tab,tabwidth=16 (attributes)

expecting success: 
					git config core.whitespace "$rule" &&
					test_fix "$tt$ts$ti$th"
				
ok 1 - setup

expecting success: 
		git apply patch$t.patch &&
		test_cmp test-$t expect-$t
	
Checking patch post image.txt...
Applied patch post image.txt cleanly.
patch1.patch:6: tab in indent.
	1
patch1.patch:7: tab in indent.
	2
patch1.patch:8: tab in indent.
	3
patch1.patch:12: tab in indent.
	4
patch1.patch:13: tab in indent.
	5
warning: squelched 1 whitespace error
warning: 6 lines add whitespace errors.
ok 7 - with spaces, traditional file creation patch

ok 2 - apply with ws expansion (t=$t)

expecting success: 
		git apply patch$t.patch &&
		test_cmp test-$t expect-$t
	
<stdin>:11: indent with spaces.
        Eight SP (#).
<stdin>:16: indent with spaces.
               Fifteen SP (#).
<stdin>:18: indent with spaces.
                Sixteen SP (#=).
<stdin>:21: trailing whitespace.
A line with a (!) trailing SP 
<stdin>:22: trailing whitespace.
A line with a (!) trailing HT	
expecting success: 
		echo postimage >expected &&
		reset_preimage &&
		rm -f 'post	image.txt' &&
		git apply -v "$vector"/'git-with tab.diff' &&
		test_cmp expected 'post	image.txt'
	
warning: 9 lines applied after fixing whitespace errors.
patch2.patch:6: tab in indent.
	a
patch2.patch:7: tab in indent.
	b
patch2.patch:8: tab in indent.
	c
patch2.patch:18: tab in indent.
	d
patch2.patch:19: tab in indent.
	e
warning: squelched 1 whitespace error
warning: 6 lines add whitespace errors.
HEAD is now at 9cf544c... preimage
ok 3 - apply with ws expansion (t=$t)

expecting success: 
		git apply patch$t.patch &&
		test_cmp test-$t expect-$t
	
patch3.patch:6: tab in indent.
	a
patch3.patch:7: tab in indent.
	b
patch3.patch:8: tab in indent.
	c
patch3.patch:109: tab in indent.
	d
patch3.patch:110: tab in indent.
	e
warning: squelched 1 whitespace error
warning: 6 lines add whitespace errors.
ok 4 - apply with ws expansion (t=$t)

expecting success: 
		git apply patch$t.patch &&
		test_cmp test-$t expect-$t
	
ok 40 - rule=trailing,-space,indent,-tab

expecting success: 
					git config core.whitespace "$rule,tabwidth=16" &&
					test_fix "$tt$ts$ti16$th"
				
patch4.patch:6: tab in indent.
	47
patch4.patch:7: tab in indent.
	48
patch4.patch:8: tab in indent.
	49
patch4.patch:12: tab in indent.
	50
patch4.patch:13: tab in indent.
	51
warning: squelched 1 whitespace error
wChecking patch "post\timage.txt"...
arning: 6 lines add whitespace errors.
Applied patch "post\timage.txt" cleanly.
ok 5 - apply with ws expansion (t=$t)

ok 8 - with tab, git-style file creation patch

<stdin>:18: indent with spaces.
                Sixteen SP (#=).
<stdin>:21: trailing whitespace.
A line with a (!) trailing SP 
<stdin>:22: trailing whitespace.
A line with a (!) trailing HT	
warning: 4 lines applied after fixing whitespace errors.
expecting success: 
		echo postimage >expected &&
		reset_preimage &&
		echo preimage >'post	image.txt' &&
		git apply -v "$vector"/'diff-with tab.diff' &&
		test_cmp expected 'post	image.txt'
	
# passed all 5 test(s)
1..5
HEAD is now at 9cf544c... preimage
Cloning into 'sub1'...
*** t4139-apply-escape.sh ***
ok 41 - rule=trailing,-space,indent,-tab,tabwidth=16

expecting success: 
					git config --unset core.whitespace &&
					echo "target whitespace=$rule" >.gitattributes &&
					test_fix "$tt$ts$ti$th"
				
done.
Checking patch "post\timage.txt"...
Applied patch "post\timage.txt" cleanly.
ok 9 - with tab, traditional patch

expecting success: 
		echo postimage >expected &&
		reset_preimage &&
		rm -f 'post	image.txt' &&
		git apply -v "$vector"/'add-with tab.diff' &&
		test_cmp expected 'post	image.txt'
	
<stdin>:11: indent with spaces.
        Eight SP (#).
<stdin>:16: indent with spaces.
               Fifteen SP (#).
<stdin>:18: indent with spaces.
                Sixteen SP (#=).
<stdin>:21: trailing whitespace.
A line with a (!) trailing SP 
<stdin>:22: trailing whitespace.
A line with a (!) trailing HT	
warning: 9 lines applied after fixing whitespace errors.
HEAD is now at 9cf544c... preimage
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4139-apply-escape/.git/
ok 42 - rule=trailing,-space,indent,-tab (attributes)

expecting success: 
					echo "target whitespace=$rule,tabwidth=16" >.gitattributes &&
					test_fix "$tt$ts$ti16$th"
				
Checking patch "post\timage.txt"...
expecting success: 
	mkdir inside &&
	mv .git inside/ &&
	cd inside

Applied patch "post\timage.txt" cleanly.
<stdin>:18: indent with spaces.
                Sixteen SP (#=).
<stdin>:21: trailing whitespace.
A line with a (!) trailing SP 
<stdin>:22: trailing whitespace.
A line with a (!) trailing HT	
warning: 4 lines applied after fixing whitespace errors.
ok 10 - with tab, traditional file creation patch

expecting success: 
		echo postimage >expected &&
		reset_preimage &&
		rm -f 'post\image.txt' &&
		git apply -v "$vector"/'git-with backslash.diff' &&
		test_cmp expected 'post\image.txt'
	
ok 1 - bump git repo one level down

expecting success: 
	mkpatch_add ../foo >patch &&
	test_must_fail git apply patch &&
	test_path_is_missing ../foo

HEAD is now at 9cf544c... preimage
fatal: invalid path '../foo'
ok 2 - cannot create file containing ..

expecting success: 
	mkpatch_add ../foo >patch &&
	git apply --unsafe-paths patch &&
	test_path_is_file ../foo

ok 43 - rule=trailing,-space,indent,-tab,tabwidth=16 (attributes)

expecting success: 
					git config core.whitespace "$rule" &&
					test_fix "$tt$ts$ti$th"
				
ok 3 - can create file containing .. with --unsafe-paths

expecting success: 
	mkpatch_add ../foo >patch &&
	test_must_fail git apply --index patch &&
	test_path_is_missing ../foo

<stdin>:8: space before tab in indent.
 	A SP and a HT (@%).
<stdin>:9: space before tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: space before tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: space before tab in indent.
        	Eight SP and a HT (@#%).
<stdin>:14: space before tab in indent.
       	 Seven SP, a HT and a SP (@%).
warning: squelched 5 whitespace errors
warning: 10 lines applied after fixing whitespace errors.
Checking patch "post\\image.txt"...
Applied patch "post\\image.txt" cleanly.
ok 11 - with backslash, git-style file creation patch

fatal: invalid path '../foo'
expecting success: 
		echo postimage >expected &&
		reset_preimage &&
		echo preimage >'post\image.txt' &&
		git apply -v "$vector"/'diff-with backslash.diff' &&
		test_cmp expected 'post\image.txt'
	
ok 4 - cannot create file containing .. (index)

expecting success: 
	mkpatch_add ../foo >patch &&
	test_must_fail git apply --index --unsafe-paths patch &&
	test_path_is_missing ../foo

HEAD is now at 9cf544c... preimage
ok 44 - rule=trailing,space,-indent,-tab

expecting success: 
					git config core.whitespace "$rule,tabwidth=16" &&
					test_fix "$tt$ts$ti16$th"
				
fatal: invalid path '../foo'
ok 5 - cannot create file containing .. with --unsafe-paths (index)

expecting success: 
	mkpatch_del ../foo >patch &&
	test_must_fail git apply patch &&
	test_path_is_file ../foo

[add_sub1 c54d28b] Add sub1
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
fatal: invalid path '../foo'
<stdin>:8: space before tab in indent.
 	A SP and a HT (@%).
<stdin>:9: space before tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: space before tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: space before tab in indent.
        	Eight SP and a HT (@#%).
<stdin>:14: space before tab in indent.
       	 Seven SP, a HT and a SP (@%).
ok 6 - cannot delete file containing ..

expecting success: 
	mkpatch_del ../foo >patch &&
	git apply --unsafe-paths patch &&
	test_path_is_missing ../foo

warning: squelched 5 whitespace errors
warning: 10 lines applied after fixing whitespace errors.
Checking patch "post\\image.txt"...
Applied patch "post\\image.txt" cleanly.
Switched to a new branch 'remove_sub1'
ok 7 - can delete file containing .. with --unsafe-paths

expecting success: 
	mkpatch_del ../foo >patch &&
	test_must_fail git apply --index patch &&
	test_path_is_file ../foo

ok 12 - with backslash, traditional patch

expecting success: 
		echo postimage >expected &&
		reset_preimage &&
		rm -f 'post\image.txt' &&
		git apply -v "$vector"/'add-with backslash.diff' &&
		test_cmp expected 'post\image.txt'
	
error: ../foo: does not exist in index
ok 8 - cannot delete file containing .. (index)

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

)
Removing sub1
Removing .gitmodules
HEAD is now at 9cf544c... preimage
ok 45 - rule=trailing,space,-indent,-tab,tabwidth=16

expecting success: 
					git config --unset core.whitespace &&
					echo "target whitespace=$rule" >.gitattributes &&
					test_fix "$tt$ts$ti$th"
				
prerequisite SYMLINKS ok
expecting success: 
	{
		mkpatch_symlink tmp .. &&
		mkpatch_add tmp/foo ../foo
	} >patch &&
	test_must_fail git apply patch &&
	test_path_is_missing tmp &&
	test_path_is_missing ../foo

[remove_sub1 777ff38] Revert "Add sub1"
 Author: A U Thor <author@example.com>
 2 files changed, 5 deletions(-)
 delete mode 100644 .gitmodules
 delete mode 160000 sub1
<stdin>:8: space before tab in indent.
 	A SP and a HT (@%).
<stdin>:9: space before tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: space before tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: space before tab in indent.
        	Eight SP and a HT (@#%).
<stdin>:14: space before tab in indent.
       	 Seven SP, a HT and a SP (@%).
warning: squelched 5 whitespace errors
warning: 10 lines applied after fixing whitespace errors.
Checking patch "post\\image.txt"...
Applied patch "post\\image.txt" cleanly.
ok 13 - with backslash, traditional file creation patch

error: affected file 'tmp/foo' is beyond a symbolic link
ok 9 - symlink escape via ..

expecting success: 
		echo postimage >expected &&
		reset_preimage &&
		rm -f '"postimage".txt' &&
		git apply -v "$vector"/'git-with quote.diff' &&
		test_cmp expected '"postimage".txt'
	
expecting success: 
	{
		mkpatch_symlink tmp .. &&
		mkpatch_add tmp/foo ../foo
	} >patch &&
	test_must_fail git apply --index patch &&
	test_path_is_missing tmp &&
	test_path_is_missing ../foo

Switched to a new branch 'modify_sub1'
HEAD is now at 9cf544c... preimage
ok 46 - rule=trailing,space,-indent,-tab (attributes)

expecting success: 
					echo "target whitespace=$rule,tabwidth=16" >.gitattributes &&
					test_fix "$tt$ts$ti16$th"
				
<stdin>:8: space before tab in indent.
 	A SP and a HT (@%).
<stdin>:9: space before tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: space before tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: space before tab in indent.
        	Eight SP and a HT (@#%).
<stdin>:14: space before tab in indent.
       	 Seven SP, a HT and a SP (@%).
warning: squelched 5 whitespace errors
warning: 10 lines applied after fixing whitespace errors.
error: affected file 'tmp/foo' is beyond a symbolic link
ok 10 - symlink escape via .. (index)

expecting success: 
	{
		mkpatch_symlink tmp "$(pwd)" &&
		mkpatch_add tmp/foo ../foo
	} >patch &&
	test_must_fail git apply patch &&
	test_path_is_missing tmp &&
	test_path_is_missing ../foo

Checking patch "\"postimage\".txt"...
Applied patch "\"postimage\".txt" cleanly.
ok 14 - with quote, git-style file creation patch

checking known breakage: 
		echo postimage >expected &&
		reset_preimage &&
		echo preimage >'"postimage".txt' &&
		git apply -v "$vector"/'diff-with quote.diff' &&
		test_cmp expected '"postimage".txt'
	
ok 47 - rule=trailing,space,-indent,-tab,tabwidth=16 (attributes)

expecting success: 
					git config core.whitespace "$rule" &&
					test_fix "$tt$ts$ti$th"
				
HEAD is now at 9cf544c... preimage
error: affected file 'tmp/foo' is beyond a symbolic link
ok 11 - symlink escape via absolute path

expecting success: 
	{
		mkpatch_symlink tmp "$(pwd)" &&
		mkpatch_add tmp/foo ../foo
	} >patch &&
	test_must_fail git apply --index patch &&
	test_path_is_missing tmp &&
	test_path_is_missing ../foo

<stdin>:7: tab in indent.
	A HT (%).
<stdin>:8: space before tab in indent.
 	A SP and a HT (@%).
<stdin>:9: space before tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: space before tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: space before tab in indent.
        	Eight SP and a HT (@#%).
warning: squelched 6 whitespace errors
warning: 11 lines applied after fixing whitespace errors.
Checking patch postimage...
error: postimage: No such file or directory
not ok 15 - with quote, traditional patch # TODO known breakage

expecting success: 
		echo postimage >expected &&
		reset_preimage &&
		rm -f '"postimage".txt' &&
		git apply -v "$vector"/'add-with quote.diff' &&
		test_cmp expected '"postimage".txt'
	
error: affected file 'tmp/foo' is beyond a symbolic link
HEAD is now at 9cf544c... preimage
ok 12 - symlink escape via absolute path (index)

ok 48 - rule=trailing,space,-indent,tab

expecting success: 
					git config core.whitespace "$rule,tabwidth=16" &&
					test_fix "$tt$ts$ti16$th"
				
# passed all 12 test(s)
1..12
<stdin>:7: tab in indent.
	A HT (%).
<stdin>:8: space before tab in indent.
 	A SP and a HT (@%).
<stdin>:9: space before tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: space before tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: space before tab in indent.
        	Eight SP and a HT (@#%).
warning: squelched 6 whitespace errors
warning: 11 lines applied after fixing whitespace errors.
Checking patch "\"postimage\".txt"...
Applied patch "\"postimage\".txt" cleanly.
*** t4150-am.sh ***
ok 16 - with quote, traditional file creation patch

expecting success: 
	echo postimage >expected &&
	reset_preimage &&
	rm -f postimage.txt &&
	git apply -v "$vector/damaged.diff" &&
	test_cmp expected postimage.txt

HEAD is now at 9cf544c... preimage
ok 49 - rule=trailing,space,-indent,tab,tabwidth=16

expecting success: 
					git config --unset core.whitespace &&
					echo "target whitespace=$rule" >.gitattributes &&
					test_fix "$tt$ts$ti$th"
				
<stdin>:7: tab in indent.
	A HT (%).
<stdin>:8: space before tab in indent.
 	A SP and a HT (@%).
<stdin>:9: space before tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: space before tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: space before tab in indent.
        	Eight SP and a HT (@#%).
warning: squelched 6 whitespace errors
warning: 11 lines applied after fixing whitespace errors.
Checking patch postimage.txt...
Applied patch postimage.txt cleanly.
ok 17 - whitespace-damaged traditional patch

expecting success: 
	echo postimage >expected &&
	reset_preimage &&
	rm -f "post image.txt" &&
	git apply "$vector/funny-tz.diff" &&
	test_cmp expected "post image.txt"

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4150-am/.git/
From /«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/submodule_update_repo/.
   613068f..c54d28b  add_sub1   -> origin/add_sub1
 * [new branch]      modify_sub1 -> origin/modify_sub1
HEAD is now at 9cf544c... preimage
 * [new branch]      remove_sub1 -> origin/remove_sub1
expecting success: 
	cat >msg <<-\EOF &&
	second

	Lorem ipsum dolor sit amet, consectetuer sadipscing elitr, sed diam nonumy
	eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
	voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita
	kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem
	ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
	tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At
	vero eos et accusam et justo duo dolores et ea rebum.

	EOF
	qz_to_tab_space <<-\EOF >>msg &&
	QDuis autem vel eum iriure dolor in hendrerit in vulputate velit
	Qesse molestie consequat, vel illum dolore eu feugiat nulla facilisis
	Qat vero eros et accumsan et iusto odio dignissim qui blandit
	Qpraesent luptatum zzril delenit augue duis dolore te feugait nulla
	Qfacilisi.
	EOF
	cat >>msg <<-\EOF &&

	Lorem ipsum dolor sit amet,
	consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut
	laoreet dolore magna aliquam erat volutpat.

	  git
	  ---
	  +++

	Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit
	lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure
	dolor in hendrerit in vulputate velit esse molestie consequat, vel illum
	dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio
	dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te
	feugait nulla facilisi.
	EOF

	cat >failmail <<-\EOF &&
	From foo@example.com Fri May 23 10:43:49 2008
	From:	foo@example.com
	To:	bar@example.com
	Subject: Re: [RFC/PATCH] git-foo.sh
	Date:	Fri, 23 May 2008 05:23:42 +0200

	Sometimes we have to find out that there's nothing left.

	EOF

	cat >pine <<-\EOF &&
	From MAILER-DAEMON Fri May 23 10:43:49 2008
	Date: 23 May 2008 05:23:42 +0200
	From: Mail System Internal Data <MAILER-DAEMON@example.com>
	Subject: DON'T DELETE THIS MESSAGE -- FOLDER INTERNAL DATA
	Message-ID: <foo-0001@example.com>

	This text is part of the internal format of your mail folder, and is not
	a real message.  It is created automatically by the mail system software.
	If deleted, important folder data will be lost, and it will be re-created
	with the data reset to initial values.

	EOF

	cat >scissors-msg <<-\EOF &&
	Test git-am with scissors line

	This line should be included in the commit message.
	EOF

	cat - scissors-msg >no-scissors-msg <<-\EOF &&
	This line should not be included in the commit message with --scissors enabled.

	 - - >8 - - remove everything above this line - - >8 - -

	EOF

	signoff="Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>"

ok 50 - rule=trailing,space,-indent,tab (attributes)

expecting success: 
					echo "target whitespace=$rule,tabwidth=16" >.gitattributes &&
					test_fix "$tt$ts$ti16$th"
				
Switched to a new branch 'modifications'
<stdin>:7: tab in indent.
	A HT (%).
<stdin>:8: space before tab in indent.
 	A SP and a HT (@%).
<stdin>:9: space before tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: space before tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: space before tab in indent.
        	Eight SP and a HT (@#%).
ok 1 - setup: messages

warning: squelched 6 whitespace errors
warning: 11 lines applied after fixing whitespace errors.
expecting success: 
	echo hello >file &&
	git add file &&
	test_tick &&
	git commit -m first &&
	git tag first &&

	echo world >>file &&
	git add file &&
	test_tick &&
	git commit -s -F msg &&
	git tag second &&

	git format-patch --stdout first >patch1 &&
	{
		echo "Message-Id: <1226501681-24923-1-git-send-email-bda@mnsspb.ru>" &&
		echo "X-Fake-Field: Line One" &&
		echo "X-Fake-Field: Line Two" &&
		echo "X-Fake-Field: Line Three" &&
		git format-patch --stdout first | sed -e "1d"
	} > patch1.eml &&
	{
		echo "X-Fake-Field: Line One" &&
		echo "X-Fake-Field: Line Two" &&
		echo "X-Fake-Field: Line Three" &&
		git format-patch --stdout first | sed -e "1d"
	} | append_cr >patch1-crlf.eml &&
	{
		printf "%255s\\n" ""
		echo "X-Fake-Field: Line One" &&
		echo "X-Fake-Field: Line Two" &&
		echo "X-Fake-Field: Line Three" &&
		git format-patch --stdout first | sed -e "1d"
	} > patch1-ws.eml &&
	{
		sed -ne "1p" msg &&
		echo &&
		echo "From: $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>" &&
		echo "Date: $GIT_AUTHOR_DATE" &&
		echo &&
		sed -e "1,2d" msg &&
		echo &&
		echo "Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>" &&
		echo "---" &&
		git diff-tree --no-commit-id --stat -p second
	} >patch1-stgit.eml &&
	mkdir stgit-series &&
	cp patch1-stgit.eml stgit-series/patch &&
	{
		echo "# This series applies on GIT commit $(git rev-parse first)" &&
		echo "patch"
	} >stgit-series/series &&
	{
		echo "# HG changeset patch" &&
		echo "# User $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>" &&
		echo "# Date $test_tick 25200" &&
		echo "#      $(git show --pretty="%aD" -s second)" &&
		echo "# Node ID $_z40" &&
		echo "# Parent  $_z40" &&
		cat msg &&
		echo &&
		echo "Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>" &&
		echo &&
		git diff-tree --no-commit-id -p second
	} >patch1-hg.eml &&


	echo scissors-file >scissors-file &&
	git add scissors-file &&
	git commit -F scissors-msg &&
	git tag scissors &&
	git format-patch --stdout scissors^ >scissors-patch.eml &&
	git reset --hard HEAD^ &&

	echo no-scissors-file >no-scissors-file &&
	git add no-scissors-file &&
	git commit -F no-scissors-msg &&
	git tag no-scissors &&
	git format-patch --stdout no-scissors^ >no-scissors-patch.eml &&
	git reset --hard HEAD^ &&

	sed -n -e "3,\$p" msg >file &&
	git add file &&
	test_tick &&
	git commit -m third &&

	git format-patch --stdout first >patch2	&&

	git checkout -b lorem &&
	sed -n -e "11,\$p" msg >file &&
	head -n 9 msg >>file &&
	test_tick &&
	git commit -a -m "moved stuff" &&

	echo goodbye >another &&
	git add another &&
	test_tick &&
	git commit -m "added another file" &&

	git format-patch --stdout master >lorem-move.patch &&
	git format-patch --no-prefix --stdout master >lorem-zero.patch &&

	git checkout -b rename &&
	git mv file renamed &&
	git commit -m "renamed a file" &&

	git format-patch -M --stdout lorem >rename.patch &&

	git reset --soft lorem^ &&
	git commit -m "renamed a file and added another" &&

	git format-patch -M --stdout lorem^ >rename-add.patch &&

	# reset time
	sane_unset test_tick &&
	test_tick

ok 18 - traditional patch with colon in timezone

expecting success: 
	echo postimage >expected &&
	reset_preimage &&
	rm -f "post image.txt" &&
	git apply "$vector/damaged-tz.diff" &&
	test_cmp expected "post image.txt"

HEAD is now at 9cf544c... preimage
[modifications 5cc407e] modified file2 and added file3
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 file3
[master (root-commit) 6b2d93f] first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 51 - rule=trailing,space,-indent,tab,tabwidth=16 (attributes)

expecting success: 
					git config core.whitespace "$rule" &&
					test_fix "$tt$ts$ti$th"
				
ok 19 - traditional, whitespace-damaged, colon in timezone

<stdin>:8: space before tab in indent.
 	A SP and a HT (@%).
<stdin>:9: space before tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:11: indent with spaces.
        Eight SP (#).
<stdin>:12: space before tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: space before tab in indent.
        	Eight SP and a HT (@#%).
warning: squelched 8 whitespace errors
warning: 13 lines applied after fixing whitespace errors.
# still have 1 known breakage(s)
# passed all remaining 18 test(s)
1..19
[master e01c0d3] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
*** t4151-am-abort.sh ***
To /«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/submodule_update_repo/.
 * [new branch]      modifications -> modifications
ok 52 - rule=trailing,space,indent,-tab

expecting success: 
					git config core.whitespace "$rule,tabwidth=16" &&
					test_fix "$tt$ts$ti16$th"
				
<stdin>:8: space before tab in indent.
 	A SP and a HT (@%).
<stdin>:9: space before tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: space before tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: space before tab in indent.
        	Eight SP and a HT (@#%).
<stdin>:14: space before tab in indent.
       	 Seven SP, a HT and a SP (@%).
warning: squelched 6 whitespace errors
warning: 11 lines applied after fixing whitespace errors.
[modify_sub1 c3f5ae9] Modify sub1
 Author: A U Thor <author@example.com>
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4151-am-abort/.git/
Switched to a new branch 'replace_sub1_with_directory'
expecting success: 
	for i in a b c d e f g
	do
		echo $i
	done >file-1 &&
	cp file-1 file-2 &&
	test_tick &&
	git add file-1 file-2 &&
	git commit -m initial &&
	git tag initial &&
	git format-patch --stdout --root initial >initial.patch &&
	for i in 2 3 4 5 6
	do
		echo $i >>file-1 &&
		echo $i >otherfile-$i &&
		git add otherfile-$i &&
		test_tick &&
		git commit -a -m $i || return 1
	done &&
	git format-patch --no-numbered initial &&
	git checkout -b side initial &&
	echo local change >file-2-expect

ok 53 - rule=trailing,space,indent,-tab,tabwidth=16

expecting success: 
					git config --unset core.whitespace &&
					echo "target whitespace=$rule" >.gitattributes &&
					test_fix "$tt$ts$ti$th"
				
<stdin>:8: space before tab in indent.
 	A SP and a HT (@%).
<stdin>:9: space before tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:11: indent with spaces.
        Eight SP (#).
<stdin>:12: space before tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: space before tab in indent.
        	Eight SP and a HT (@#%).
warning: squelched 8 whitespace errors
warning: 13 lines applied after fixing whitespace errors.
[master (root-commit) 1732241] initial
 Author: A U Thor <author@example.com>
 2 files changed, 14 insertions(+)
 create mode 100644 file-1
 create mode 100644 file-2
ok 54 - rule=trailing,space,indent,-tab (attributes)

expecting success: 
					echo "target whitespace=$rule,tabwidth=16" >.gitattributes &&
					test_fix "$tt$ts$ti16$th"
				
<stdin>:8: space before tab in indent.
 	A SP and a HT (@%).
<stdin>:9: space before tab in indent.
 	 A SP, a HT and a SP (@%).
<stdin>:12: space before tab in indent.
       	Seven SP and a HT (@%).
<stdin>:13: space before tab in indent.
        	Eight SP and a HT (@#%).
<stdin>:14: space before tab in indent.
       	 Seven SP, a HT and a SP (@%).
warning: squelched 6 whitespace errors
warning: 11 lines applied after fixing whitespace errors.
[master 97332d5] Test git-am with scissors line
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 scissors-file
[master a485f10] 2
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 otherfile-2
ok 55 - rule=trailing,space,indent,-tab,tabwidth=16 (attributes)

expecting success: 
	>target &&
	create_patch >patch-file &&
	git apply --whitespace=fix patch-file &&
	grep "newline$" target &&
	grep "^$" target

[master b72e0d7] 3
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 otherfile-3
patch-file:8: trailing whitespace.
A line with trailing whitespace and no newline 
warning: 1 line applied after fixing whitespace errors.
HEAD is now at e01c0d3 second
A line with trailing whitespace and no newline

ok 56 - trailing whitespace & no newline at the end of file

expecting success: 
	test_might_fail git config --unset core.whitespace &&
	rm -f .gitattributes &&

	{ echo a; echo b; echo c; } >one &&
	git add one &&
	{ echo a; echo b; echo c; } >expect &&
	{ cat expect; echo; } >one &&
	git diff -- one >patch &&

	git checkout one &&
	git apply --whitespace=fix patch &&
	test_cmp expect one

[master 902f0be] This line should not be included in the commit message with --scissors enabled.
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 no-scissors-file
[master f1dbda2] 4
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 otherfile-4
[master 73a4960] 5
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 otherfile-5
HEAD is now at e01c0d3 second
Submodule path 'sub1': checked out '613068f76d422f07de14d59bca708cacb8bb3c5b'
patch:9: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
ok 57 - blank at EOF with --whitespace=fix (1)

expecting success: 
	{ echo a; echo b; echo c; } >one &&
	git add one &&
	{ echo a; echo c; } >expect &&
	{ cat expect; echo; echo; } >one &&
	git diff -- one >patch &&

	git checkout one &&
	git apply --whitespace=fix patch &&
	test_cmp expect one

Previous HEAD position was 613068f... Base
Switched to branch 'modifications'
[master 87a053c] 6
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 otherfile-6
rm 'sub1'
[master 9ecb9b7] third
 Author: A U Thor <author@example.com>
 1 file changed, 28 insertions(+), 2 deletions(-)
 rewrite file (100%)
patch:9: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
ok 58 - blank at EOF with --whitespace=fix (2)

expecting success: 
	{ echo a; echo b; echo; } >one &&
	git add one &&
	{ echo a; echo c; echo; } >expect &&
	{ cat expect; echo; echo; } >one &&
	git diff -- one >patch &&

	git checkout one &&
	git apply --whitespace=fix patch &&
	test_cmp expect one

0001-2.patch
0002-3.patch
0003-4.patch
0004-5.patch
0005-6.patch
Switched to a new branch 'lorem'
[replace_sub1_with_directory 9cf761c] 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
Switched to a new branch 'side'
ok 1 - setup

expecting success: 

		git reset --hard initial &&
		cp file-2-expect file-2 &&

		test_must_fail git am$with3 000[1245]-*.patch &&
		git log --pretty=tformat:%s >actual &&
		for i in 3 2 initial
		do
			echo $i
		done >expect &&
		test_cmp expect actual
	
Switched to a new branch 'replace_directory_with_sub1'
[lorem 310b007] moved stuff
 Author: A U Thor <author@example.com>
 1 file changed, 9 insertions(+), 8 deletions(-)
patch:9: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
HEAD is now at 1732241 initial
ok 59 - blank at EOF with --whitespace=fix (3)

expecting success: 
	{ echo a; echo b; echo; echo; echo; echo; echo; echo d; } >one &&
	git add one &&
	{ echo a; echo c; echo; echo; echo; echo; echo; echo; echo d; } >expect &&
	cp expect one &&
	git diff -- one >patch &&

	git checkout one &&
	git apply --whitespace=fix patch &&
	test_cmp expect one

Removing sub1/file3
Removing sub1/file2
Removing sub1/file1
Adding sub1
[replace_directory_with_sub1 a255a0a] 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
[lorem 5adb50d] added another file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 another
Applying: 2
Switched to a new branch 'replace_sub1_with_file'
rm 'sub1'
Applying: 3
ok 60 - blank at end of hunk, not at EOF with --whitespace=fix

expecting success: 
	{ echo a; echo b; echo c; } >one &&
	git add one &&
	echo >>one &&
	cat one >expect &&
	git diff -- one >patch &&

	git checkout one &&
	git apply --whitespace=warn patch 2>error &&
	test_cmp expect one &&
	grep "new blank line at EOF" error

Switched to a new branch 'rename'
Applying: 5
[replace_sub1_with_file 5d247d3] Replace sub1 with file
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
error: patch failed: file-1:8
error: file-1: patch does not apply
Patch failed at 0003 5
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Switched to a new branch 'replace_file_with_sub1'
ok 2 - am stops at a patch that does not apply

expecting success: 
		test_must_fail git am$with3 --skip >output &&
		test_i18ngrep "^Applying" output >output.applying &&
		test_i18ngrep "^Applying: 6$" output.applying &&
		test_i18ncmp file-2-expect file-2 &&
		test ! -f .git/MERGE_RR
	
[rename 9b77aec] renamed a file
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename file => renamed (100%)
patch:9: new blank line at EOF.
ok 61 - blank at EOF with --whitespace=warn

expecting success: 
	{ echo a; echo b; echo c; } >one &&
	git add one &&
	cat one >expect &&
	echo >>one &&
	git diff -- one >patch &&

	git checkout one &&
	test_must_fail git apply --whitespace=error patch 2>error &&
	test_cmp expect one &&
	grep "new blank line at EOF" error

[replace_file_with_sub1 d682f08] Revert "Replace sub1 with file"
 Author: A U Thor <author@example.com>
 2 files changed, 5 insertions(+), 1 deletion(-)
 mode change 100644 => 160000 sub1
error: patch failed: file-1:9
error: file-1: patch does not apply
[rename 1312087] renamed a file and added another
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
 create mode 100644 another
 rename file => renamed (100%)
Applying: 6
Switched to a new branch 'invalid_sub1'
ok 3 - am --skip continue after failed am

expecting success: 
		git am --abort &&
		git rev-parse HEAD >actual &&
		git rev-parse initial >expect &&
		test_cmp expect actual &&
		test_cmp file-2-expect file-2 &&
		git diff-index --exit-code --cached HEAD &&
		test ! -f .git/MERGE_RR
	
patch:9: new blank line at EOF.
ok 62 - blank at EOF with --whitespace=error

expecting success: 
	{ echo a; echo b; echo c; } >one &&
	git add one &&
	echo "   " >>one &&
	cat one >expect &&
	git diff -- one >patch &&

	git checkout one &&
	git apply --whitespace=warn patch 2>error &&
	test_cmp expect one &&
	grep "new blank line at EOF" error

ok 2 - setup

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout first &&
	test_tick &&
	git am <patch1 &&
	test_path_is_missing .git/rebase-apply &&
	git diff --exit-code second &&
	test "$(git rev-parse second)" = "$(git rev-parse HEAD)" &&
	test "$(git rev-parse second^)" = "$(git rev-parse HEAD^)"

[invalid_sub1 63eb9c5] Invalid sub1 commit
 Author: A U Thor <author@example.com>
HEAD is now at 1312087 renamed a file and added another
Switched to a new branch 'valid_sub1'
Note: checking out 'first'.

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 6b2d93f... first
ok 4 - am --abort goes back after failed am

expecting success: 

		git reset --hard initial &&
		cp file-2-expect file-2 &&

		test_must_fail git am$with3 000[1245]-*.patch &&
		git log --pretty=tformat:%s >actual &&
		for i in 3 2 initial
		do
			echo $i
		done >expect &&
		test_cmp expect actual
	
patch:9: new blank line at EOF.
ok 63 - blank but not empty at EOF

expecting success: 
	{ echo; echo; echo; echo; } >one &&
	git add one &&
	{ echo b; } >>one &&
	git diff -- one >patch &&

	git checkout one &&
	{ echo a; echo; } >one &&
	cp one expect &&
	test_must_fail git apply --whitespace=fix patch &&
	test_cmp one expect &&
	test_must_fail git apply --ignore-space-change --whitespace=fix patch &&
	test_cmp one expect

[valid_sub1 c892ac8] Revert "Invalid sub1 commit"
 Author: A U Thor <author@example.com>
Applying: second
HEAD is now at 1732241 initial
Switched to branch 'master'
error: patch failed: one:2
error: one: patch does not apply
Cloning into 'submodule_update'...
Applying: 2
error: patch failed: one:2
error: one: patch does not apply
ok 64 - applying beyond EOF requires one non-blank context line

expecting success: 
	for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16; do
		echo; echo; echo; echo;
	done >one &&
	git add one &&
	echo a >>one &&
	git diff -- one >patch &&

	>one &&
	test_must_fail git apply --whitespace=fix patch &&
	test_must_fail git apply --ignore-space-change --whitespace=fix patch

Applying: 3
ok 3 - am applies patch correctly

expecting success: 
	test_when_finished "rm -f dirtyfile" &&
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout first &&
	echo dirtyfile >dirtyfile &&
	git add dirtyfile &&
	test_must_fail git am patch1 &&
	test_path_is_dir .git/rebase-apply &&
	test_cmp_rev first HEAD

done.
error: patch failed: one:62
error: one: patch does not apply
Applying: 5
HEAD is now at e01c0d3 second
error: patch failed: one:62
error: one: patch does not apply
ok 65 - tons of blanks at EOF should not apply

expecting success: 
	echo a >one &&
	echo >>one &&
	git add one &&
	echo b >>one &&
	cp one expect &&
	git diff -- one >patch &&
	echo a >one &&
	cp one saved-one &&
	test_must_fail git apply patch &&
	git apply --whitespace=fix patch &&
	test_cmp one expect &&
	mv saved-one one &&
	git apply --ignore-space-change --whitespace=fix patch &&
	test_cmp one expect

Using index info to reconstruct a base tree...
M	file-1
Previous HEAD position was e01c0d3... second
HEAD is now at 6b2d93f... first
Falling back to patching base and 3-way merge...
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Merging 62dd7f8e745eca53801cbb61754d79ec4c45ba45 with 5
Merging:
62dd7f8 3
virtual 5
found 1 common ancestor:
virtual 2e4b8a989c579cac9d3cc1897320a3e27805d080
Auto-merging file-1
CONFLICT (content): Merge conflict in file-1
error: Failed to merge in the changes.
Patch failed at 0003 5
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
error: patch failed: one:1
error: one: patch does not apply
fatal: Dirty index: cannot apply patches (dirty: dirtyfile)
ok 5 - am -3 stops at a patch that does not apply

expecting success: 
		test_must_fail git am$with3 --skip >output &&
		test_i18ngrep "^Applying" output >output.applying &&
		test_i18ngrep "^Applying: 6$" output.applying &&
		test_i18ncmp file-2-expect file-2 &&
		test ! -f .git/MERGE_RR
	
ok 66 - missing blank line at end with --whitespace=fix

expecting success: 
	{ echo a; echo; echo b; echo c; } >one &&
	cp one no-blank-lines &&
	{ echo; echo; } >>one &&
	git add one &&
	echo d >>one &&
	cp one expect &&
	echo >>one &&
	git diff -- one >patch &&
	cp no-blank-lines one &&
	test_must_fail git apply patch &&
	git apply --whitespace=fix patch &&
	test_cmp one expect &&
	mv no-blank-lines one &&
	test_must_fail git apply patch &&
	git apply --ignore-space-change --whitespace=fix patch &&
	test_cmp one expect

Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 4 - am fails if index is dirty

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout first &&
	git am patch1.eml &&
	test_path_is_missing .git/rebase-apply &&
	git diff --exit-code second &&
	test "$(git rev-parse second)" = "$(git rev-parse HEAD)" &&
	test "$(git rev-parse second^)" = "$(git rev-parse HEAD^)"

HEAD is now at 6b2d93f first
HEAD is now at 6b2d93f... first
error: patch failed: one:4
error: one: patch does not apply
patch:10: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
error: Failed to merge in the changes.
error: patch failed: one:4
error: one: patch does not apply
Applying: second
Applying: 6
patch:10: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
ok 6 - am -3 --skip continue after failed am -3

expecting success: 
		git am --abort &&
		git rev-parse HEAD >actual &&
		git rev-parse initial >expect &&
		test_cmp expect actual &&
		test_cmp file-2-expect file-2 &&
		git diff-index --exit-code --cached HEAD &&
		test ! -f .git/MERGE_RR
	
ok 67 - two missing blank lines at end with --whitespace=fix

expecting success: 
	{ echo a; echo; } >one &&
	git add one &&
	{ echo b; echo a; echo; } >one &&
	cp one expect &&
	git diff -- one >patch &&
	echo a >one &&
	test_must_fail git apply patch &&
	git apply --whitespace=fix patch &&
	test_cmp one expect

error: patch failed: one:1
error: one: patch does not apply
ok 68 - missing blank line at end, insert before end, --whitespace=fix

expecting success: 
	{ echo a; echo b; echo c; } >one &&
	cp one no-blank-lines &&
	for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16; do
		echo; echo; echo; echo;
	done >>one &&
	git add one &&
	echo a >one &&
	cp one expect &&
	git diff -- one >patch &&
	cp no-blank-lines one &&
	test_must_fail git apply patch &&
	git apply --whitespace=fix patch &&
	test_cmp one expect &&
	mv no-blank-lines one &&
	git apply --ignore-space-change --whitespace=fix patch &&
	test_cmp one expect

ok 5 - am applies patch e-mail not in a mbox

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout first &&
	git am patch1-crlf.eml &&
	test_path_is_missing .git/rebase-apply &&
	git diff --exit-code second &&
	test "$(git rev-parse second)" = "$(git rev-parse HEAD)" &&
	test "$(git rev-parse second^)" = "$(git rev-parse HEAD^)"

ok 7 - am --abort goes back after failed am -3

expecting success: 
	git reset --hard initial &&
	test_must_fail git am -3 0003-*.patch &&
	test 3 -eq $(git ls-files -u | wc -l) &&
	test 4 = "$(cat otherfile-4)" &&
	git am --skip &&
	test_cmp_rev initial HEAD &&
	test -z "$(git ls-files -u)" &&
	test_path_is_missing otherfile-4

HEAD is now at e01c0d3 second
HEAD is now at 1732241 initial
error: patch failed: one:1
error: one: patch does not apply
Previous HEAD position was e01c0d3... second
HEAD is now at 6b2d93f... first
Applying: 4
ok 69 - shrink file with tons of missing blanks at end of file

expecting success: 
	{ echo a; echo b; } >one &&
	git add one &&
	{ echo c; echo d; } >>one &&
	git diff -- one >patch &&

	echo a >one &&
	test_must_fail git apply patch &&
	test_must_fail git apply --whitespace=fix patch &&
	test_must_fail git apply --ignore-space-change --whitespace=fix patch

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/submodule_update_repo/.) registered for path 'sub1'
Applying: second
Using index info to reconstruct a base tree...
M	file-1
Falling back to patching base and 3-way merge...
Merging 173224155bab91289a50bec3cabc98e0bad94bf2 with 4
Merging:
1732241 initial
virtual 4
found 1 common ancestor:
virtual ca28a003e7272ffcb030f00a3e373a07e49ce912
Auto-merging file-1
CONFLICT (content): Merge conflict in file-1
error: Failed to merge in the changes.
Patch failed at 0001 4
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
error: patch failed: one:1
error: one: patch does not apply
error: patch failed: one:1
error: one: patch does not apply
error: patch failed: one:1
error: one: patch does not apply
ok 70 - missing blanks at EOF must only match blank lines

expecting success: 
	git add one &&
	echo d >>one &&
	git diff -- one >patch &&
	{ echo a; echo b; echo c; } >one &&
	cp one expect &&
	{ echo; echo d; } >>expect &&
	git add one &&

	git apply --whitespace=fix patch &&
	test_cmp one expect

ok 6 - am applies patch e-mail not in a mbox with CRLF

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout first &&
	git am patch1-ws.eml &&
	test_path_is_missing .git/rebase-apply &&
	git diff --exit-code second &&
	test "$(git rev-parse second)" = "$(git rev-parse HEAD)" &&
	test "$(git rev-parse second^)" = "$(git rev-parse HEAD^)"

Cloning into 'sub1'...
HEAD is now at e01c0d3 second
patch:8: trailing whitespace.
		      
warning: 1 line adds whitespace errors.
ok 8 - am -3 --skip removes otherfile-4

expecting success: 
	git reset --hard initial &&
	test_must_fail git am -3 0003-*.patch &&
	test 3 -eq $(git ls-files -u | wc -l) &&
	test 4 = "$(cat otherfile-4)" &&
	git am --abort &&
	test_cmp_rev initial HEAD &&
	test -z $(git ls-files -u) &&
	test_path_is_missing otherfile-4

ok 71 - missing blank line should match context line with spaces

expecting success: 
	git add one &&
	echo d >>one &&
	cp one expect &&
	git diff -- one >patch &&
	{ echo a; echo b; echo c; } >one &&
	git add one &&

	git checkout-index -f one &&
	git apply --ignore-space-change --whitespace=fix patch &&
	test_cmp one expect

Previous HEAD position was e01c0d3... second
HEAD is now at 6b2d93f... first
HEAD is now at 1732241 initial
Applying: second
done.
Applying: 4
Using index info to reconstruct a base tree...
M	file-1
Falling back to patching base and 3-way merge...
patch:8: trailing whitespace.
		      
warning: 1 line adds whitespace errors.
ok 72 - same, but with the --ignore-space-option

expecting success: 
	git config core.whitespace cr-at-eol &&
	printf "a\r\n" >one &&
	printf "b\r\n" >>one &&
	printf "c\r\n" >>one &&
	cp one save-one &&
	printf "                 \r\n" >>one &&
	git add one &&
	printf "d\r\n" >>one &&
	cp one expect &&
	git diff -- one >patch &&
	mv save-one one &&

	git apply --ignore-space-change --whitespace=fix patch &&
	test_cmp one expect

Merging 173224155bab91289a50bec3cabc98e0bad94bf2 with 4
Merging:
1732241 initial
virtual 4
found 1 common ancestor:
virtual ca28a003e7272ffcb030f00a3e373a07e49ce912
Auto-merging file-1
CONFLICT (content): Merge conflict in file-1
error: Failed to merge in the changes.
Patch failed at 0001 4
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
ok 7 - am applies patch e-mail with preceding whitespace

expecting success: 
	rm -fr .git/rebase-apply &&
	git checkout -f first &&
	git am patch1-stgit.eml &&
	test_path_is_missing .git/rebase-apply &&
	git diff --exit-code second &&
	test_cmp_rev second HEAD &&
	test_cmp_rev second^ HEAD^

Previous HEAD position was e01c0d3... second
patch:8: trailing whitespace.
                 
warning: 1 line adds whitespace errors.
HEAD is now at 6b2d93f... first
ok 73 - same, but with CR-LF line endings && cr-at-eol set

expecting success: 
	git config --unset core.whitespace &&
	printf "a\r\n" >one &&
	printf "b\r\n" >>one &&
	printf "c\r\n" >>one &&
	cp one save-one &&
	printf "                 \r\n" >>one &&
	git add one &&
	cp one expect &&
	printf "d\r\n" >>one &&
	git diff -- one >patch &&
	mv save-one one &&
	echo d >>expect &&

	git apply --ignore-space-change --whitespace=fix patch &&
	test_cmp one expect

ok 9 - am -3 --abort removes otherfile-4

expecting success: 
	test_must_fail git am 0004-*.patch &&
	test_commit unrelated &&
	git rev-parse HEAD >expect &&
	git am --abort &&
	git rev-parse HEAD >actual &&
	test_cmp expect actual

Applying: second
Submodule path 'sub1': checked out '613068f76d422f07de14d59bca708cacb8bb3c5b'
Applying: 5
error: patch failed: file-1:8
error: file-1: patch does not apply
Patch failed at 0001 5
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
patch:6: trailing whitespace.
b
patch:7: trailing whitespace.
c
patch:8: trailing whitespace.
                 
patch:9: trailing whitespace.
d
warning: 4 lines add whitespace errors.
ok 74 - same, but with CR-LF line endings && cr-at-eol unset

expecting success: 
	qz_to_tab_space >preimage <<-\EOF &&
	QQa
	QQb
	QQc
	ZZZZZZZZZZZZZZZZd
	QQe
	QQf
	QQg
	EOF
	qz_to_tab_space >patch <<-\EOF &&
	diff --git a/preimage b/preimage
	--- a/preimage
	+++ b/preimage
	@@ -1,7 +1,6 @@
	 QQa
	 QQb
	 QQc
	-QQd
	 QQe
	 QQf
	 QQg
	EOF
	git -c core.whitespace=tab-in-indent apply --whitespace=fix patch

patch:5: tab in indent.
		a
patch:6: tab in indent.
		b
patch:7: tab in indent.
		c
patch:9: tab in indent.
		e
patch:10: tab in indent.
		f
warning: squelched 1 whitespace error
warning: 6 lines add whitespace errors.
ok 75 - whitespace=fix to expand

expecting success: 
	git config core.whitespace blank-at-eol &&
	>used &&
	>unused &&
	git add used unused &&
	echo "used" >used &&
	echo "unused " >unused &&
	git diff-files -p used unused >patch &&
	git apply --include=used --stat --whitespace=error <patch

[side f386b22] unrelated
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 unrelated.t
ok 8 - am applies stgit patch

expecting success: 
	rm -fr .git/rebase-apply &&
	git checkout -f first &&
	git am --patch-format=stgit <patch1-stgit.eml &&
	test_path_is_missing .git/rebase-apply &&
	git diff --exit-code second &&
	test_cmp_rev second HEAD &&
	test_cmp_rev second^ HEAD^

 used |    1 +
 1 file changed, 1 insertion(+)
ok 76 - whitespace check skipped for excluded paths

error: You seem to have moved HEAD since the last 'am' failure.
Not rewinding to ORIG_HEAD
# passed all 76 test(s)
1..76
Previous HEAD position was e01c0d3... second
HEAD is now at 6b2d93f... first
ok 1 - apply_index: added submodule creates empty directory
ok 10 - am --abort will keep the local commits intact


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
		)
	
expecting success: 
	git reset --hard initial &&
	echo dirtyfile >dirtyfile &&
	cp dirtyfile dirtyfile.expected &&
	git add dirtyfile &&
	test_must_fail git am 0001-*.patch &&
	test_cmp_rev initial HEAD &&
	test_path_is_file dirtyfile &&
	test_cmp dirtyfile.expected dirtyfile &&
	git am --abort &&
	test_cmp_rev initial HEAD &&
	test_path_is_file dirtyfile &&
	test_cmp dirtyfile.expected dirtyfile

Applying: second
*** t4152-am-subjects.sh ***
HEAD is now at 1732241 initial
fatal: Dirty index: cannot apply patches (dirty: dirtyfile)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4152-am-subjects/.git/
expecting success: 
	test_commit baseline file

Cloning into 'submodule_update'...
ok 9 - am --patch-format=stgit applies stgit patch

expecting success: 
	rm -fr .git/rebase-apply &&
	git checkout -f first &&
	git am stgit-series/series &&
	test_path_is_missing .git/rebase-apply &&
	git diff --exit-code second &&
	test_cmp_rev second HEAD &&
	test_cmp_rev second^ HEAD^

Previous HEAD position was e01c0d3... second
HEAD is now at 6b2d93f... first
[master (root-commit) 2f64c43] baseline
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 11 - am --abort will keep dirty index intact

expecting success: 
	git checkout -f --orphan orphan &&
	git reset &&
	rm -f otherfile-4 &&
	test_must_fail git am -3 0003-*.patch &&
	test 2 -eq $(git ls-files -u | wc -l) &&
	test 4 = "$(cat otherfile-4)"

ok 1 - setup baseline commit

expecting success: 
		git reset --hard baseline &&
		echo $type >file &&
		git commit -a -m "$subject" &&
		git format-patch -1 --stdout >$type.patch &&
		git format-patch -1 --stdout -k >$type-k.patch
	
Applying: second
Switched to a new branch 'orphan'
done.
HEAD is now at 2f64c43 baseline
[master 5d59063] short subject
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'no_submodule'
Applying: 4
Branch no_submodule set up to track remote branch no_submodule from origin.
Using index info to reconstruct a base tree...
A	file-1
ok 2 - create patches with short subject

expecting success: 
		git reset --hard baseline &&
		echo $type >file &&
		git commit -a -m "$subject" &&
		git format-patch -1 --stdout >$type.patch &&
		git format-patch -1 --stdout -k >$type-k.patch
	
Falling back to patching base and 3-way merge...
error: refusing to lose untracked file at 'file-1'
Merging 4b825dc642cb6eb9a060e54bf8d69288fbee4904 with 4
Merging:
virtual 4b825dc642cb6eb9a060e54bf8d69288fbee4904
virtual 4
found 1 common ancestor:
virtual ca28a003e7272ffcb030f00a3e373a07e49ce912
CONFLICT (modify/delete): file-1 deleted in 4b825dc642cb6eb9a060e54bf8d69288fbee4904 and modified in 4. Version 4 of file-1 left in tree.
error: Failed to merge in the changes.
Patch failed at 0001 4
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
HEAD is now at 2f64c43 baseline
ok 10 - am applies stgit series

expecting success: 
	rm -fr .git/rebase-apply &&
	git checkout -f first &&
	git am patch1-hg.eml &&
	test_path_is_missing .git/rebase-apply &&
	git diff --exit-code second &&
	test_cmp_rev second HEAD &&
	test_cmp_rev second^ HEAD^

Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 12 - am -3 stops on conflict on unborn branch

expecting success: 
	test_path_is_dir .git/rebase-apply &&
	echo tmpfile >tmpfile &&
	git add tmpfile &&
	git am --skip &&
	test -z "$(git ls-files)" &&
	test_path_is_missing otherfile-4 &&
	test_path_is_missing tmpfile

[master 512ba33] this is a long subject that is virtually guaranteed to require wrapping via format-patch if it is all going to appear on a single line
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Previous HEAD position was e01c0d3... second
HEAD is now at 6b2d93f... first
ok 3 - create patches with long subject

expecting success: 
		git reset --hard baseline &&
		echo $type >file &&
		git commit -a -m "$subject" &&
		git format-patch -1 --stdout >$type.patch &&
		git format-patch -1 --stdout -k >$type-k.patch
	
Applying: second
ok 13 - am -3 --skip clears index on unborn branch

expecting success: 
	git checkout -f --orphan orphan &&
	git reset &&
	rm -f otherfile-4 file-1 &&
	test_must_fail git am -3 0003-*.patch &&
	test 2 -eq $(git ls-files -u | wc -l) &&
	test 4 = "$(cat otherfile-4)" &&
	git am --abort &&
	test -z "$(git ls-files -u)" &&
	test_path_is_missing otherfile-4

HEAD is now at 2f64c43 baseline
Switched to a new branch 'orphan'
[master 230e818] this is a long subject that is virtually guaranteed to require wrapping via format-patch if it is all going to appear on a single line
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Applying: 4
ok 4 - create patches with multiline subject

expecting success: 
	check_subject short

Using index info to reconstruct a base tree...
A	file-1
ok 11 - am applies hg patch

expecting success: 
	rm -fr .git/rebase-apply &&
	git checkout -f first &&
	git am --patch-format=hg <patch1-hg.eml &&
	test_path_is_missing .git/rebase-apply &&
	git diff --exit-code second &&
	test_cmp_rev second HEAD &&
	test_cmp_rev second^ HEAD^

HEAD is now at 2f64c43 baseline
Falling back to patching base and 3-way merge...
Merging 4b825dc642cb6eb9a060e54bf8d69288fbee4904 with 4
Merging:
virtual 4b825dc642cb6eb9a060e54bf8d69288fbee4904
virtual 4
found 1 common ancestor:
virtual ca28a003e7272ffcb030f00a3e373a07e49ce912
CONFLICT (modify/delete): file-1 deleted in 4b825dc642cb6eb9a060e54bf8d69288fbee4904 and modified in 4. Version 4 of file-1 left in tree.
error: Failed to merge in the changes.
Previous HEAD position was e01c0d3... second
HEAD is now at 6b2d93f... first
Patch failed at 0001 4
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Applying: short subject
Applying: second
ok 14 - am -3 --abort removes otherfile-4 on unborn branch

expecting success: 
	git checkout -f --orphan orphan &&
	git reset &&
	rm -f otherfile-4 otherfile-2 file-1 file-2 &&
	test_must_fail git am -3 initial.patch 0003-*.patch &&
	test 3 -eq $(git ls-files -u | wc -l) &&
	test 4 = "$(cat otherfile-4)" &&
	git am --abort &&
	test -z "$(git ls-files -u)" &&
	test_path_is_missing otherfile-4 &&
	test_path_is_missing file-1 &&
	test_path_is_missing file-2 &&
	test 0 -eq $(git log --oneline 2>/dev/null | wc -l) &&
	test refs/heads/orphan = "$(git symbolic-ref HEAD)"

Switched to a new branch 'orphan'
ok 5 - short subject preserved (format-patch | am)

expecting success: 
	check_subject short-k

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/submodule_update_repo/.) registered for path 'sub1'
HEAD is now at 2f64c43 baseline
Applying: initial
ok 12 - am --patch-format=hg applies hg patch

expecting success: 
	test_when_finished "rm -f .git/hooks/applypatch-msg" &&
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout first &&
	mkdir -p .git/hooks &&
	write_script .git/hooks/applypatch-msg <<-\EOF &&
	cat "$1" >actual-msg &&
	echo hook-message >"$1"
	EOF
	git am patch1 &&
	test_path_is_missing .git/rebase-apply &&
	git diff --exit-code second &&
	echo hook-message >expected &&
	git log -1 --format=format:%B >actual &&
	test_cmp expected actual &&
	git log -1 --format=format:%B second >expected &&
	test_cmp expected actual-msg

Applying: short subject
applying to an empty history
Applying: 4
HEAD is now at e01c0d3 second
Using index info to reconstruct a base tree...
M	file-1
Previous HEAD position was e01c0d3... second
HEAD is now at 6b2d93f... first
Falling back to patching base and 3-way merge...
ok 6 - short subject preserved (format-patch -k | am)

expecting success: 
	check_subject short-k -k

Cloning into 'sub1'...
Merging 03bb45fd85708b41f253ab78115ebc9daa5bfaa7 with 4
Merging:
03bb45f initial
virtual 4
found 1 common ancestor:
virtual ca28a003e7272ffcb030f00a3e373a07e49ce912
Auto-merging file-1
CONFLICT (content): Merge conflict in file-1
error: Failed to merge in the changes.
Patch failed at 0002 4
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
HEAD is now at 2f64c43 baseline
Applying: short subject
Applying: hook-message
done.
ok 7 - short subject preserved (format-patch -k | am -k)

expecting success: 
	check_subject long

ok 15 - am -3 --abort on unborn branch removes applied commits

expecting success: 
	git checkout -f --orphan orphan &&
	git reset &&
	test_must_fail git am 0004-*.patch &&
	test_commit unrelated2 &&
	git rev-parse HEAD >expect &&
	git am --abort &&
	git rev-parse HEAD >actual &&
	test_cmp expect actual

HEAD is now at 2f64c43 baseline
Switched to a new branch 'orphan'
ok 13 - am with applypatch-msg hook

expecting success: 
	test_when_finished "rm -f .git/hooks/applypatch-msg" &&
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout first &&
	mkdir -p .git/hooks &&
	write_script .git/hooks/applypatch-msg <<-\EOF &&
	exit 1
	EOF
	test_must_fail git am patch1 &&
	test_path_is_dir .git/rebase-apply &&
	git diff --exit-code first &&
	test_cmp_rev first HEAD

Applying: this is a long subject that is virtually guaranteed to require wrapping via format-patch if it is all going to appear on a single line
HEAD is now at fa25691 hook-message
Applying: 5
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  fa25691 hook-message

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> fa25691

HEAD is now at 6b2d93f... first
error: file-1: does not exist in index
Patch failed at 0001 5
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
ok 8 - long subject preserved (format-patch | am)

expecting success: 
	check_subject long-k

Submodule path 'sub1': checked out '613068f76d422f07de14d59bca708cacb8bb3c5b'
HEAD is now at 2f64c43 baseline
[orphan (root-commit) 823805c] unrelated2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 unrelated2.t
Applying: this is a long subject that is virtually guaranteed to require wrapping via format-patch if it is all going to appear on a single line
error: You seem to have moved HEAD since the last 'am' failure.
Not rewinding to ORIG_HEAD
ok 16 - am --abort on unborn branch will keep local commits intact

expecting success: 
	git checkout -f --orphan skip-stat-info &&
	git reset &&
	test_commit skip-should-be-untouched &&
	test-chmtime =0 skip-should-be-untouched.t &&
	git update-index --refresh &&
	git diff-files --exit-code --quiet &&
	test_must_fail git am 0001-*.patch &&
	git am --skip &&
	git diff-files --exit-code --quiet

ok 14 - am with failing applypatch-msg hook

expecting success: 
	test_when_finished "rm -f .git/hooks/pre-applypatch" &&
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout first &&
	mkdir -p .git/hooks &&
	write_script .git/hooks/pre-applypatch <<-\EOF &&
	git diff first >diff.actual
	exit 0
	EOF
	git am patch1 &&
	test_path_is_missing .git/rebase-apply &&
	git diff --exit-code second &&
	test_cmp_rev second HEAD &&
	git diff first..second >diff.expected &&
	test_cmp diff.expected diff.actual

Switched to a new branch 'skip-stat-info'
ok 9 - long subject preserved (format-patch -k | am)

expecting success: 
	check_subject long-k -k

HEAD is now at 6b2d93f first
HEAD is now at 2f64c43 baseline
HEAD is now at 6b2d93f... first
ok 2 - apply_index: 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
		)
	
[skip-stat-info (root-commit) 2297a89] skip-should-be-untouched
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 skip-should-be-untouched.t
Applying: this is a long subject that is virtually guaranteed to require wrapping via format-patch if it is all going to appear on a single line
Applying: second
ok 10 - long subject preserved (format-patch -k | am -k)

expecting success: 
	check_subject multiline

HEAD is now at 2f64c43 baseline
Applying: 2
error: file-1: does not exist in index
Patch failed at 0001 2
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Cloning into 'submodule_update'...
Applying: this is a long subject that is virtually guaranteed to require wrapping via format-patch if it is all going to appear on a single line
ok 17 - am --skip leaves index stat info alone

ok 15 - am with pre-applypatch hook

expecting success: 
	test_when_finished "rm -f .git/hooks/pre-applypatch" &&
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout first &&
	mkdir -p .git/hooks &&
	write_script .git/hooks/pre-applypatch <<-\EOF &&
	exit 1
	EOF
	test_must_fail git am patch1 &&
	test_path_is_dir .git/rebase-apply &&
	git diff --exit-code second &&
	test_cmp_rev first HEAD

expecting success: 
	git checkout -f --orphan abort-stat-info &&
	git reset &&
	test_commit abort-should-be-untouched &&
	test-chmtime =0 abort-should-be-untouched.t &&
	git update-index --refresh &&
	git diff-files --exit-code --quiet &&
	test_must_fail git am 0001-*.patch &&
	git am --abort &&
	git diff-files --exit-code --quiet

done.
HEAD is now at e01c0d3 second
Switched to a new branch 'abort-stat-info'
Previous HEAD position was e01c0d3... second
HEAD is now at 6b2d93f... first
ok 11 - multiline subject unwrapped (format-patch | am)

expecting success: 
	check_subject multiline-k

Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
[abort-stat-info (root-commit) 3038985] abort-should-be-untouched
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 abort-should-be-untouched.t
HEAD is now at 2f64c43 baseline
Applying: second
Applying: this is a long subject that is virtually guaranteed to require wrapping via format-patch if it is all going to appear on a single line
Branch add_sub1 set up to track remote branch add_sub1 from origin.
error: sub1: already exists in working directory
Applying: 2
ok 16 - am with failing pre-applypatch hook

expecting success: 
	test_when_finished "rm -f .git/hooks/post-applypatch" &&
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout first &&
	mkdir -p .git/hooks &&
	write_script .git/hooks/post-applypatch <<-\EOF &&
	git rev-parse HEAD >head.actual
	git diff second >diff.actual
	exit 0
	EOF
	git am patch1 &&
	test_path_is_missing .git/rebase-apply &&
	test_cmp_rev second HEAD &&
	git rev-parse second >head.expected &&
	test_cmp head.expected head.actual &&
	git diff second >diff.expected &&
	test_cmp diff.expected diff.actual

error: file-1: does not exist in index
Patch failed at 0001 2
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
ok 12 - multiline subject unwrapped (format-patch -k | am)

expecting success: 
	check_subject multiline-k -k

HEAD is now at 6b2d93f first
HEAD is now at 2f64c43 baseline
HEAD is now at 6b2d93f... first
ok 3 - apply_index: 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 18 - am --abort leaves index stat info alone

# passed all 18 test(s)
1..18
Applying: this is a long subject that is virtually guaranteed
Applying: second
Cloning into 'submodule_update'...
*** t4153-am-resume-override-opts.sh ***
ok 13 - multiline subject preserved (format-patch -k | am -k)

# passed all 13 test(s)
1..13
done.
*** t4200-rerere.sh ***
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.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4153-am-resume-override-opts/.git/
ok 17 - am with post-applypatch hook

expecting success: 
	test_when_finished "rm -f .git/hooks/post-applypatch" &&
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout first &&
	mkdir -p .git/hooks &&
	write_script .git/hooks/post-applypatch <<-\EOF &&
	git rev-parse HEAD >head.actual
	exit 1
	EOF
	git am patch1 &&
	test_path_is_missing .git/rebase-apply &&
	git diff --exit-code second &&
	test_cmp_rev second HEAD &&
	git rev-parse second >head.expected &&
	test_cmp head.expected head.actual

expecting success: 
	test_commit initial file &&
	test_commit first file &&

	git checkout initial &&
	git mv file file2 &&
	test_tick &&
	git commit -m renamed-file &&
	git tag renamed-file &&

	git checkout -b side initial &&
	test_commit side1 file &&
	test_commit side2 file &&

	format_patch side1 &&
	format_patch side2

t4137-apply-submodule.sh: 159: cd: can't cd to sub1
HEAD is now at e01c0d3 second
Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4200-rerere/.git/
Previous HEAD position was e01c0d3... second
[master (root-commit) b6d2089] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
HEAD is now at 6b2d93f... first
expecting success: 
	cat >a1 <<-\EOF &&
	Some title
	==========
	Whether 'tis nobler in the mind to suffer
	The slings and arrows of outrageous fortune,
	Or to take arms against a sea of troubles,
	And by opposing end them? To die: to sleep;
	No more; and by a sleep to say we end
	The heart-ache and the thousand natural shocks
	That flesh is heir to, 'tis a consummation
	Devoutly to be wish'd.
	EOF

	git add a1 &&
	test_tick &&
	git commit -q -a -m initial &&

	cat >>a1 <<-\EOF &&
	Some title
	==========
	To die, to sleep;
	To sleep: perchance to dream: ay, there's the rub;
	For in that sleep of death what dreams may come
	When we have shuffled off this mortal coil,
	Must give us pause: there's the respect
	That makes calamity of so long life;
	EOF

	git checkout -b first &&
	test_tick &&
	git commit -q -a -m first &&

	git checkout -b second master &&
	git show first:a1 |
	sed -e "s/To die, t/To die! T/" -e "s/Some title/Some Title/" >a1 &&
	echo "* END *" >>a1 &&
	test_tick &&
	git commit -q -a -m second

Applying: second
[master 3aaf771] first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'first'
M	a1
Note: checking out 'initial'.

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 b6d2089... initial
[detached HEAD 5e7fd8e] renamed-file
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename file => file2 (100%)
Switched to a new branch 'second'
ok 18 - am with failing post-applypatch hook

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout second &&
	git am --scissors scissors-patch.eml &&
	test_path_is_missing .git/rebase-apply &&
	git diff --exit-code scissors &&
	test_cmp_rev scissors HEAD

Previous HEAD position was 5e7fd8e... renamed-file
Switched to a new branch 'side'
ok 1 - setup

expecting success: 
	rm -rf .git/rr-cache &&
	git config rerere.enabled false &&
	test_must_fail git merge first &&
	! test -d .git/rr-cache

HEAD is now at e01c0d3 second
HEAD is now at e01c0d3... second
[side ccf21da] side1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Merging:
fcd23fa second
virtual first
found 1 common ancestor:
70749e0 initial
Auto-merging a1
CONFLICT (content): Merge conflict in a1
Automatic merge failed; fix conflicts and then commit the result.
ok 2 - nothing recorded without rerere

expecting success: 
	git reset --hard &&
	mkdir .git/rr-cache &&
	test_might_fail git config --unset rerere.enabled &&
	test_must_fail git merge first &&

	sha1=$(perl -pe "s/	.*//" .git/MERGE_RR) &&
	rr=.git/rr-cache/$sha1 &&
	grep "^=======\$" $rr/preimage &&
	! test -f $rr/postimage &&
	! test -f $rr/thisimage

Applying: Test git-am with scissors line
HEAD is now at fcd23fa second
[side 58bd40e] side2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/submodule_update_repo/.) registered for path 'sub1'
Recorded preimage for 'a1'
Merging:
fcd23fa second
virtual first
found 1 common ancestor:
70749e0 initial
Auto-merging a1
CONFLICT (content): Merge conflict in a1
Automatic merge failed; fix conflicts and then commit the result.
=======
=======
ok 3 - activate rerere, old style (conflicting merge)

expecting success: 
	rm -rf .git/rr-cache &&
	git config rerere.enabled true &&
	git reset --hard &&
	test_must_fail git merge first &&

	sha1=$(perl -pe "s/	.*//" .git/MERGE_RR) &&
	rr=.git/rr-cache/$sha1 &&
	grep ^=======$ $rr/preimage

ok 19 - am --scissors cuts the message at the scissors line

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout second &&
	test_config mailinfo.scissors true &&
	git am --no-scissors no-scissors-patch.eml &&
	test_path_is_missing .git/rebase-apply &&
	git diff --exit-code no-scissors &&
	test_cmp_rev no-scissors HEAD

ok 1 - setup

checking prerequisite: TTY

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	test_have_prereq PERL &&

	# Reading from the pty master seems to get stuck _sometimes_
	# on Mac OS X 10.5.0, using Perl 5.10.0 or 5.8.9.
	#
	# Reproduction recipe: run
	#
	#	i=0
	#	while ./test-terminal.perl echo hi $i
	#	do
	#		: $((i = $i + 1))
	#	done
	#
	# After 2000 iterations or so it hangs.
	# https://rt.cpan.org/Ticket/Display.html?id=65692
	#
	test "$(uname -s)" != Darwin &&

	perl "$TEST_DIRECTORY"/test-terminal.perl \
		sh -c "test -t 1 && test -t 2"

)
HEAD is now at 97332d5 Test git-am with scissors line
Previous HEAD position was 97332d5... Test git-am with scissors line
HEAD is now at fcd23fa second
HEAD is now at e01c0d3... second
Recorded preimage for 'a1'
Merging:
fcd23fa second
virtual first
found 1 common ancestor:
70749e0 initial
Auto-merging a1
CONFLICT (content): Merge conflict in a1
Automatic merge failed; fix conflicts and then commit the result.
Cloning into 'sub1'...
=======
=======
ok 4 - rerere.enabled works, too

expecting success: 
	rm -rf .git/rr-cache &&
	git config rerere.enabled true &&
	git reset --hard &&
	test_must_fail git merge first &&
	sha1=$(perl -pe "s/	.*//" .git/MERGE_RR) &&
	rr=.git/rr-cache/$sha1

Applying: This line should not be included in the commit message with --scissors enabled.
HEAD is now at fcd23fa second
done.
Recorded preimage for 'a1'
Merging:
fcd23fa second
virtual first
found 1 common ancestor:
70749e0 initial
Auto-merging a1
CONFLICT (content): Merge conflict in a1
Automatic merge failed; fix conflicts and then commit the result.
ok 5 - set up rr-cache

expecting success: 
	# no postimage or thisimage yet
	! test -f $rr/postimage &&
	! test -f $rr/thisimage &&

	# preimage has right number of lines
	cnt=$(sed -ne "/^<<<<<<</,/^>>>>>>>/p" $rr/preimage | wc -l) &&
	echo $cnt &&
	test $cnt = 13

13
ok 6 - rr-cache looks sane

expecting success: 
	git show first:a1 >a1 &&
	cat >expect <<-\EOF &&
	--- a/a1
	+++ b/a1
	@@ -1,4 +1,4 @@
	-Some Title
	+Some title
	 ==========
	 Whether 'tis nobler in the mind to suffer
	 The slings and arrows of outrageous fortune,
	@@ -8,21 +8,11 @@
	 The heart-ache and the thousand natural shocks
	 That flesh is heir to, 'tis a consummation
	 Devoutly to be wish'd.
	-<<<<<<<
	-Some Title
	-==========
	-To die! To sleep;
	-=======
	 Some title
	 ==========
	 To die, to sleep;
	->>>>>>>
	 To sleep: perchance to dream: ay, there's the rub;
	 For in that sleep of death what dreams may come
	 When we have shuffled off this mortal coil,
	 Must give us pause: there's the respect
	 That makes calamity of so long life;
	-<<<<<<<
	-=======
	-* END *
	->>>>>>>
	EOF
	git rerere diff >out &&
	test_cmp expect out

ok 20 - am --no-scissors overrides mailinfo.scissors

expecting success: 
	GIT_AUTHOR_NAME="Another Thor" &&
	GIT_AUTHOR_EMAIL="a.thor@example.com" &&
	GIT_COMMITTER_NAME="Co M Miter" &&
	GIT_COMMITTER_EMAIL="c.miter@example.com" &&
	export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL

ok 21 - setup: new author and committer

expecting success: 
	test_tick &&
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout first &&
	git am patch2 &&
	test_path_is_missing .git/rebase-apply &&
	test "$(git rev-parse master^^)" = "$(git rev-parse HEAD^^)" &&
	git diff --exit-code master..HEAD &&
	git diff --exit-code master^..HEAD^ &&
	compare author master HEAD &&
	compare author master^ HEAD^ &&
	test "$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>" = \
	     "$(git log -1 --pretty=format:"%cn <%ce>" HEAD)"

ok 7 - rerere diff

expecting success: 
	echo a1 >expect &&
	git rerere status >out &&
	test_cmp expect out

HEAD is now at 902f0be This line should not be included in the commit message with --scissors enabled.
ok 8 - rerere status

expecting success: 
	git show first:a1 | sed "s/To die: t/To die! T/" >expect &&

	git commit -q -a -m "prefer first over second" &&
	test -f $rr/postimage &&

	oldmtimepost=$(test-chmtime -v -60 $rr/postimage | cut -f 1) &&

	git checkout -b third master &&
	git show second^:a1 | sed "s/To die: t/To die! T/" >a1 &&
	git commit -q -a -m third &&

	test_must_fail git merge first &&
	# rerere kicked in
	! grep "^=======\$" a1 &&
	test_cmp expect a1

Previous HEAD position was 902f0be... This line should not be included in the commit message with --scissors enabled.
HEAD is now at 6b2d93f... first
Recorded resolution for 'a1'.
Submodule path 'sub1': checked out '613068f76d422f07de14d59bca708cacb8bb3c5b'
Applying: second
Applying: third
Switched to a new branch 'third'
prerequisite TTY ok
expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout renamed-file &&

	# Applying side1 will fail as the file has been renamed.
	test_must_fail git am --no-3way side[12].eml &&
	test_path_is_dir .git/rebase-apply &&
	test_cmp_rev renamed-file HEAD &&
	test -z "$(git ls-files -u)" &&

	# Applying side1 with am --3way will succeed due to the threeway-merge.
	# Applying side2 will fail as --3way does not apply to it.
	test_must_fail test_terminal git am --3way </dev/zero &&
	test_path_is_dir .git/rebase-apply &&
	test side1 = "$(cat file2)"

HEAD is now at 58bd40e side2
Resolved 'a1' using previous resolution.
Merging:
40cb797 third
virtual first
found 1 common ancestor:
70749e0 initial
Auto-merging a1
CONFLICT (content): Merge conflict in a1
Automatic merge failed; fix conflicts and then commit the result.
Note: checking out 'renamed-file'.

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 5e7fd8e... renamed-file
ok 9 - first postimage wins

expecting success: 
	newmtimepost=$(test-chmtime -v +0 $rr/postimage | cut -f 1) &&
	test $oldmtimepost -lt $newmtimepost

ok 10 - rerere updates postimage timestamp

expecting success: 
	rm $rr/postimage &&
	echo "$sha1	a1" | perl -pe "y/\012/\000/" >.git/MERGE_RR &&
	git rerere clear &&
	! test -d $rr

ok 4 - apply_index: 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
		)
	
Applying: side1
error: file: does not exist in index
Patch failed at 0001 side1
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
ok 11 - rerere clear

expecting success: 
	mkdir -p $rr &&
	echo Hello >$rr/preimage &&
	echo World >$rr/postimage &&

	sha2=4000000000000000000000000000000000000000 &&
	rr2=.git/rr-cache/$sha2 &&
	mkdir $rr2 &&
	echo Hello >$rr2/preimage &&

	almost_15_days_ago=$((60-15*86400)) &&
	just_over_15_days_ago=$((-1-15*86400)) &&
	almost_60_days_ago=$((60-60*86400)) &&
	just_over_60_days_ago=$((-1-60*86400)) &&

	test-chmtime =$just_over_60_days_ago $rr/preimage &&
	test-chmtime =$almost_60_days_ago $rr/postimage &&
	test-chmtime =$almost_15_days_ago $rr2/preimage

ok 22 - am changes committer and keeps author

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout -b master2 first &&
	git am --signoff <patch2 &&
	printf "%s\n" "$signoff" >expected &&
	echo "Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>" >>expected &&
	git cat-file commit HEAD^ | grep "Signed-off-by:" >actual &&
	test_cmp expected actual &&
	echo "Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>" >expected &&
	git cat-file commit HEAD | grep "Signed-off-by:" >actual &&
	test_cmp expected actual

HEAD is now at 5005784 third
ok 12 - set up for garbage collection tests

expecting success: 
	git rerere gc &&
	test -f $rr/preimage &&
	test -f $rr2/preimage

Warning: you are leaving 2 commits behind, not connected to
any of your branches:

  5005784 third
  86e60bd second

If you want to keep them by creating a new branch, this may be a good time
to do so with:

 git branch <new-branch-name> 5005784

ok 13 - gc preserves young or recently used records

expecting success: 
	test-chmtime =$just_over_60_days_ago $rr/postimage &&
	test-chmtime =$just_over_15_days_ago $rr2/preimage &&
	git rerere gc &&
	! test -f $rr/preimage &&
	! test -f $rr2/preimage

Switched to a new branch 'master2'
Cloning into 'submodule_update'...
ok 14 - old records rest in peace

expecting success: 
	git reset --hard &&

	git checkout -b fourth &&
	echo Hallo >file2 &&
	git add file2 &&
	test_tick &&
	git commit -m version1 &&

	git checkout third &&
	echo Bello >file2 &&
	git add file2 &&
	test_tick &&
	git commit -m version2 &&

	test_must_fail git merge fourth &&
	echo Cello >file2 &&
	git add file2 &&
	git commit -m resolution

Applying: second
HEAD is now at 40cb797 third
Applying: third
done.
Switched to a new branch 'fourth'
[fourth 26401ec] version1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file2
ok 23 - am --signoff adds Signed-off-by: line

expecting success: 
	echo refs/heads/master2 >expected &&
	git symbolic-ref HEAD >actual &&
	test_cmp expected 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.
Switched to branch 'third'
ok 24 - am stays in branch

expecting success: 
	git format-patch --stdout HEAD^ >patch3 &&
	sed -e "/^Subject/ s,\[PATCH,Re: Re: Re: & 1/5 v2] [foo," patch3 >patch4 &&
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout HEAD^ &&
	git am --signoff patch4 &&
	git cat-file commit HEAD >actual &&
	test $(grep -c "^Signed-off-by:" actual) -eq 1

error: 8ed2e6719f8484ce01fa3ce133fe42d25c2441b8^{commit}: expected commit type, but the object dereferences to tree type
fatal: Needed a single revision
[third 1f50303] version2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file2
HEAD is now at a84b439 third
Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
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 2b9ceb3... second
Recorded preimage for 'file2'
Merging:
1f50303 version2
virtual fourth
found 1 common ancestor:
40cb797 third
Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
Automatic merge failed; fix conflicts and then commit the result.
Applying: third
Recorded resolution for 'file2'.
[third e9acb28] resolution
 Author: A U Thor <author@example.com>
ok 15 - setup: file2 added differently in two branches

expecting success: 
	echo Cello >expected &&

	git reset --hard HEAD~2 &&
	git checkout -b fifth &&

	echo Hallo >file3 &&
	git add file3 &&
	test_tick &&
	git commit -m version1 &&

	git checkout third &&
	echo Bello >file3 &&
	git add file3 &&
	test_tick &&
	git commit -m version2 &&
	git tag version2 &&

	test_must_fail git merge fifth &&
	test_cmp expected file3 &&
	test_must_fail git update-index --refresh

HEAD is now at 40cb797 third
Applying: side1
ok 25 - am --signoff does not add Signed-off-by: line if already there

expecting success: 
	git rev-parse HEAD >expected &&
	git rev-parse master2 >actual &&
	test_cmp expected actual

Switched to a new branch 'fifth'
Using index info to reconstruct a base tree...
A	file
Falling back to patching base and 3-way merge...
Merging 5e7fd8eed08248327eb19d9afdf6558849aa8070 with side1
ok 26 - am without --keep removes Re: and [PATCH] stuff

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout HEAD^ &&
	git am --keep patch4 &&
	test_path_is_missing .git/rebase-apply &&
	git cat-file commit HEAD >actual &&
	grep "Re: Re: Re: \[PATCH 1/5 v2\] \[foo\] third" actual

Merging:
5e7fd8e renamed-file
virtual side1
found 1 common ancestor:
virtual 99f2e3e1cb15f9b52fa29f66d380dda061d917ab
Auto-merging file2
[fifth 9b6b3c4] version1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file3
Applying: side2
HEAD is now at a84b439 third
Switched to branch 'third'
error: file: does not exist in index
Patch failed at 0002 side2
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
died of signal 15 at /«PKGBUILDDIR»/t/test-terminal.perl line 35.
Previous HEAD position was a84b439... third
HEAD is now at 2b9ceb3... second
ok 2 - --3way overrides --no-3way

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout first &&

	# Applying side1 will be quiet.
	test_must_fail git am --quiet side[123].eml >out &&
	test_path_is_dir .git/rebase-apply &&
	! test_i18ngrep "^Applying: " out &&
	echo side1 >file &&
	git add file &&

	# Applying side1 will not be quiet.
	# Applying side2 will be quiet.
	git am --no-quiet --continue >out &&
	echo "Applying: side1" >expected &&
	test_i18ncmp expected out

[third 7eec302] version2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file3
HEAD is now at 8e08c98 side1
Applying: Re: Re: Re: [PATCH 1/5 v2] [foo] third
Resolved 'file3' using previous resolution.
Merging:
7eec302 version2
virtual fifth
found 1 common ancestor:
40cb797 third
Auto-merging file3
CONFLICT (add/add): Merge conflict in file3
Automatic merge failed; fix conflicts and then commit the result.
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  8e08c98 side1

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> 8e08c98

HEAD is now at 3aaf771... first
file3: needs merge
ok 16 - resolution was recorded properly

expecting success: 
	git config rerere.autoupdate true &&
	git reset --hard &&
	git checkout version2 &&
	test_must_fail git merge fifth &&
	git update-index --refresh

Re: Re: Re: [PATCH 1/5 v2] [foo] third
ok 27 - am --keep really keeps the subject

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout HEAD^ &&
	git am --keep-non-patch patch4 &&
	test_path_is_missing .git/rebase-apply &&
	git cat-file commit HEAD >actual &&
	grep "^\[foo\] third" actual

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/submodule_update_repo/.) registered for path 'sub1'
HEAD is now at 7eec302 version2
error: patch failed: file:1
error: file: patch does not apply
HEAD is now at 3da879d Re: Re: Re: [PATCH 1/5 v2] [foo] third
Note: checking out 'version2'.

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 7eec302... version2
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  3da879d Re: Re: Re: [PATCH 1/5 v2] [foo] third

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> 3da879d

HEAD is now at 2b9ceb3... second
Staged 'file3' using previous resolution.
Merging:
7eec302 version2
virtual fifth
found 1 common ancestor:
40cb797 third
Auto-merging file3
CONFLICT (add/add): Merge conflict in file3
Automatic merge failed; fix conflicts and then commit the result.
ok 17 - rerere.autoupdate

expecting success: 
	test_might_fail git config --unset rerere.autoupdate &&
	git reset --hard &&
	git checkout version2 &&
	test_must_fail git merge --rerere-autoupdate fifth &&
	git update-index --refresh

Applying: [foo] third
HEAD is now at 7eec302 version2
ok 3 - --no-quiet overrides --quiet

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout first &&

	test_must_fail git am --no-signoff side[12].eml &&
	test_path_is_dir .git/rebase-apply &&
	echo side1 >file &&
	git add file &&
	git am --signoff --continue &&

	# Applied side1 will be signed off
	echo "Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>" >expected &&
	git cat-file commit HEAD^ | grep "Signed-off-by:" >actual &&
	test_cmp expected actual &&

	# Applied side2 will not be signed off
	test $(git cat-file commit HEAD | grep -c "Signed-off-by:") -eq 0

HEAD is now at 7eec302... version2
Cloning into 'sub1'...
Staged 'file3' using previous resolution.
Merging:
7eec302 version2
virtual fifth
found 1 common ancestor:
40cb797 third
Auto-merging file3
CONFLICT (add/add): Merge conflict in file3
Automatic merge failed; fix conflicts and then commit the result.
HEAD is now at 1d25943 side2
[foo] third
ok 28 - am --keep-non-patch really keeps the non-patch part

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout -b base3way master2 &&
	sed -n -e "3,\$p" msg >file &&
	head -n 9 msg >>file &&
	git add file &&
	test_tick &&
	git commit -m "copied stuff"

ok 18 - merge --rerere-autoupdate

expecting success: 
	headblob=$(git rev-parse version2:file3) &&
	mergeblob=$(git rev-parse fifth:file3) &&
	cat >expected <<-EOF &&
	100644 $headblob 2	file3
	100644 $mergeblob 3	file3
	EOF

	git config rerere.autoupdate true &&
	git reset --hard &&
	git checkout version2 &&
	test_must_fail git merge --no-rerere-autoupdate fifth &&
	git ls-files -u >actual &&
	test_cmp expected actual

Warning: you are leaving 2 commits behind, not connected to
any of your branches:

  1d25943 side2
  0400be0 side1

If you want to keep them by creating a new branch, this may be a good time
to do so with:

 git branch <new-branch-name> 1d25943

HEAD is now at 3aaf771... first
HEAD is now at 15a366e [foo] third
done.
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  15a366e [foo] third

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> 15a366e

Switched to a new branch 'base3way'
Applying: side1
error: patch failed: file:1
error: file: patch does not apply
Patch failed at 0001 side1
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
HEAD is now at 7eec302 version2
HEAD is now at 7eec302... version2
Applying: side1
Resolved 'file3' using previous resolution.
[base3way 6f68cdc] copied stuff
 Author: Another Thor <a.thor@example.com>
 1 file changed, 9 insertions(+)
Applying: side2
Merging:
7eec302 version2
virtual fifth
found 1 common ancestor:
40cb797 third
Auto-merging file3
CONFLICT (add/add): Merge conflict in file3
Automatic merge failed; fix conflicts and then commit the result.
ok 29 - setup am -3

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout -b lorem2 base3way &&
	git am -3 lorem-move.patch &&
	test_path_is_missing .git/rebase-apply &&
	git diff --exit-code lorem

ok 19 - merge --no-rerere-autoupdate

expecting success: 
	headblob=$(git rev-parse version2:file3) &&
	mergeblob=$(git rev-parse fifth:file3) &&
	cat >expected.unresolved <<-EOF &&
	100644 $headblob 2	file3
	100644 $mergeblob 3	file3
	EOF

	test_might_fail git config --unset rerere.autoupdate &&
	git reset --hard &&
	git checkout version2 &&
	fifth=$(git rev-parse fifth) &&
	echo "$fifth		branch fifth of ." |
	git fmt-merge-msg >msg &&
	ancestor=$(git merge-base version2 fifth) &&
	test_must_fail git merge-recursive "$ancestor" -- HEAD fifth &&

	git ls-files --stage >failedmerge &&
	cp file3 file3.conflict &&

	git ls-files -u >actual &&
	test_cmp expected.unresolved actual

HEAD is now at 6f68cdc copied stuff
Switched to a new branch 'lorem2'
Submodule path 'sub1': checked out '613068f76d422f07de14d59bca708cacb8bb3c5b'
ok 4 - --signoff overrides --no-signoff

HEAD is now at 7eec302 version2
expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout first &&
	rm -f file.rej &&

	test_must_fail git am --no-reject side1.eml &&
	test_path_is_dir .git/rebase-apply &&
	test_path_is_missing file.rej &&

	test_must_fail test_terminal git am --reject </dev/zero &&
	test_path_is_dir .git/rebase-apply &&
	test_path_is_file file.rej

Applying: moved stuff
HEAD is now at 7eec302... version2
HEAD is now at 4f3810f side2
Using index info to reconstruct a base tree...
M	file
Falling back to patching base and 3-way merge...
Warning: you are leaving 2 commits behind, not connected to
any of your branches:

  4f3810f side2
  deca85c side1

If you want to keep them by creating a new branch, this may be a good time
to do so with:

 git branch <new-branch-name> 4f3810f

HEAD is now at 3aaf771... first
Merging 6f68cdc6184573f93c87511a2475ac78e91953a8 with moved stuff
Merging:
6f68cdc copied stuff
virtual moved stuff
found 1 common ancestor:
virtual 1a0aed3db7ed3439d173ac047eca267fd076cc21
Auto-merging file
Applying: added another file
Applying: side1
Merging HEAD with fifth
Merging:
7eec302 version2
9b6b3c4 version1
found 1 common ancestor:
40cb797 third
Auto-merging file3
CONFLICT (add/add): Merge conflict in file3
error: patch failed: file:1
error: file: patch does not apply
Patch failed at 0001 side1
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
ok 20 - set up an unresolved merge

expecting success: 
	test_might_fail git config --unset rerere.autoupdate &&
	git rm -fr --cached . &&
	git update-index --index-info <failedmerge &&
	cp file3.conflict file3 &&
	test_must_fail git update-index --refresh -q &&

	git rerere &&
	git ls-files -u >actual &&
	test_cmp expected.unresolved actual

ok 30 - am -3 falls back to 3-way merge

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout -b lorem3 base3way &&
	git am -3 -p0 lorem-zero.patch &&
	test_path_is_missing .git/rebase-apply &&
	git diff --exit-code lorem

ok 5 - apply_index: 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
		)
	
file3: needs merge
rm 'a1'
rm 'file3'
rm 'file3'
HEAD is now at 7446e63 added another file
file3: needs merge
Switched to a new branch 'lorem3'
Resolved 'file3' using previous resolution.
ok 21 - explicit rerere

expecting success: 
	git config rerere.autoupdate true &&
	git rm -fr --cached . &&
	git update-index --index-info <failedmerge &&
	cp file3.conflict file3 &&
	test_must_fail git update-index --refresh -q &&

	git rerere &&
	git update-index --refresh

Applying: moved stuff
file3: needs merge
rm 'a1'
rm 'file3'
rm 'file3'
Using index info to reconstruct a base tree...
M	file
Cloning into 'submodule_update'...
Falling back to patching base and 3-way merge...
file3: needs merge
Staged 'file3' using previous resolution.
Merging 6f68cdc6184573f93c87511a2475ac78e91953a8 with moved stuff
Merging:
6f68cdc copied stuff
virtual moved stuff
found 1 common ancestor:
virtual 1a0aed3db7ed3439d173ac047eca267fd076cc21
Auto-merging file
Applying: added another file
ok 22 - explicit rerere with autoupdate

expecting success: 
	git config rerere.autoupdate false &&
	git rm -fr --cached . &&
	git update-index --index-info <failedmerge &&
	cp file3.conflict file3 &&
	git rerere &&
	git ls-files -u >actual1 &&

	git rm -fr --cached . &&
	git update-index --index-info <failedmerge &&
	cp file3.conflict file3 &&
	git rerere --rerere-autoupdate &&
	git update-index --refresh &&

	git rm -fr --cached . &&
	git update-index --index-info <failedmerge &&
	cp file3.conflict file3 &&
	git rerere --rerere-autoupdate --no-rerere-autoupdate &&
	git ls-files -u >actual2 &&

	git rm -fr --cached . &&
	git update-index --index-info <failedmerge &&
	cp file3.conflict file3 &&
	git rerere --rerere-autoupdate --no-rerere-autoupdate --rerere-autoupdate &&
	git update-index --refresh &&

	test_cmp expected.unresolved actual1 &&
	test_cmp expected.unresolved actual2

done.
rm 'a1'
rm 'file3'
ok 31 - am -3 -p0 can read --no-prefix patch

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout -b lorem4 base3way &&
	test_config am.threeWay 1 &&
	git am lorem-move.patch &&
	test_path_is_missing .git/rebase-apply &&
	git diff --exit-code lorem

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Resolved 'file3' using previous resolution.
HEAD is now at 7446e63 added another file
file3: needs merge
rm 'a1'
rm 'file3'
rm 'file3'
Switched to a new branch 'lorem4'
Applying: side1
Checking patch file...
error: while searching for:
initial

error: patch failed: file:1
Applying patch file with 1 reject...
Rejected hunk #1.
Patch failed at 0001 side1
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Staged 'file3' using previous resolution.
died of signal 15 at /«PKGBUILDDIR»/t/test-terminal.perl line 35.
Applying: moved stuff
ok 5 - --reject overrides --no-reject

# passed all 5 test(s)
1..5
rm 'a1'
rm 'file3'
Using index info to reconstruct a base tree...
M	file
Falling back to patching base and 3-way merge...
Resolved 'file3' using previous resolution.
Merging 6f68cdc6184573f93c87511a2475ac78e91953a8 with moved stuff
Merging:
6f68cdc copied stuff
virtual moved stuff
found 1 common ancestor:
virtual 1a0aed3db7ed3439d173ac047eca267fd076cc21
Auto-merging file
Applying: added another file
*** t4201-shortlog.sh ***
file3: needs merge
rm 'a1'
rm 'file3'
rm 'file3'
Staged 'file3' using previous resolution.
ok 32 - am with config am.threeWay falls back to 3-way merge

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout -b lorem5 base3way &&
	test_config am.threeWay 1 &&
	test_must_fail git am --no-3way lorem-move.patch &&
	test_path_is_dir .git/rebase-apply

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4201-shortlog/.git/
ok 23 - explicit rerere --rerere-autoupdate overrides

expecting success: 
	git rm -fr --cached . &&
	git update-index --index-info <failedmerge &&
	cp file3.conflict file3 &&
	test_must_fail git rerere --no-no-rerere-autoupdate 2>err &&
	test_i18ngrep [Uu]sage err &&
	test_must_fail git update-index --refresh

HEAD is now at 7446e63 added another file
expecting success: 
	echo 1 >a1 &&
	git add a1 &&
	tree=$(git write-tree) &&
	commit=$(printf "%s\n" "Test" "" | git commit-tree "$tree") &&
	git update-ref HEAD "$commit" &&

	echo 2 >a1 &&
	git commit --quiet -m "This is a very, very long first line for the commit message to see if it is wrapped correctly" a1 &&

	# test if the wrapping is still valid
	# when replacing all is by treble clefs.
	echo 3 >a1 &&
	git commit --quiet -m "$(
		echo "This is a very, very long first line for the commit message to see if it is wrapped correctly" |
		sed "s/i/1234/g" |
		tr 1234 "\360\235\204\236")" a1 &&

	# now fsck up the utf8
	git config i18n.commitencoding non-utf-8 &&
	echo 4 >a1 &&
	git commit --quiet -m "$(
		echo "This is a very, very long first line for the commit message to see if it is wrapped correctly" |
		sed "s/i/1234/g" |
		tr 1234 "\370\235\204\236")" a1 &&

	echo 5 >a1 &&
	git commit --quiet -m "a								12	34	56	78" a1 &&

	echo 6 >a1 &&
	git commit --quiet -m "Commit by someone else" \
		--author="Someone else <not!me>" a1 &&

	cat >expect.template <<-\EOF
	A U Thor (5):
	      SUBJECT
	      SUBJECT
	      SUBJECT
	      SUBJECT
	      SUBJECT

	Someone else (1):
	      SUBJECT

	EOF

rm 'a1'
rm 'file3'
Switched to a new branch 'lorem5'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/submodule_update_repo/.) registered for path 'sub1'
usage: git rerere [clear | forget <path>... | status | remaining | diff | gc]
file3: needs merge
ok 24 - rerere --no-no-rerere-autoupdate

expecting success: 
	test_must_fail git rerere -h >help &&
	test_i18ngrep [Uu]sage help

Applying: moved stuff
usage: git rerere [clear | forget <path>... | status | remaining | diff | gc]
ok 25 - rerere -h

error: patch failed: file:26
error: file: patch does not apply
Patch failed at 0001 moved stuff
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
# passed all 25 test(s)
1..25
ok 33 - am with config am.threeWay overridden by --no-3way

expecting success: 
	grep "^rename from" rename.patch &&
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout lorem^0 &&
	git am rename.patch &&
	test_path_is_missing .git/rebase-apply &&
	git update-index --refresh &&
	git diff --exit-code rename

rename from file
HEAD is now at 6f68cdc copied stuff
Cloning into 'sub1'...
*** t4202-log.sh ***
Note: checking out 'lorem^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 5adb50d... added another file
Applying: renamed a file
done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4202-log/.git/
ok 1 - setup

expecting success: 
	git shortlog HEAD >log &&
	fuzz log >log.predictable &&
	test_cmp expect.template log.predictable

ok 34 - am can rename a file

expecting success: 
	grep "^rename from" rename.patch &&
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout lorem^0 &&
	git am -3 rename.patch &&
	test_path_is_missing .git/rebase-apply &&
	git update-index --refresh &&
	git diff --exit-code rename

rename from file
ok 2 - default output format

expecting success: 
	sed s/SUBJECT/OBJECT_NAME/ expect.template >expect &&
	git shortlog --format="%H" HEAD >log &&
	fuzz log >log.predictable &&
	test_cmp expect log.predictable

HEAD is now at 053c2a5 renamed a file
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  053c2a5 renamed a file

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> 053c2a5

HEAD is now at 5adb50d... added another file
ok 3 - pretty format

expecting success: 
	sed s/SUBJECT/OBJID/ expect.template >expect &&
	git shortlog --format="%h" --abbrev=5 HEAD >log &&
	fuzz log >log.predictable &&
	test_cmp expect log.predictable

Submodule path 'sub1': checked out '613068f76d422f07de14d59bca708cacb8bb3c5b'
Applying: renamed a file
ok 4 - --abbrev

expecting success: 
	sed "s/SUBJECT/two lines/" expect.template >expect &&
	git shortlog --format="two%nlines" HEAD >log &&
	fuzz log >log.predictable &&
	test_cmp expect log.predictable

ok 5 - output from user-defined format is re-wrapped

ok 35 - am -3 can rename a file

expecting success: 
	grep "^rename from" rename-add.patch &&
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout lorem^0 &&
	git am -3 rename-add.patch &&
	test_path_is_missing .git/rebase-apply &&
	git update-index --refresh &&
	git diff --exit-code rename

expecting success: 
	cat >expect <<\EOF &&
A U Thor (5):
      Test
      This is a very, very long first line for the commit message to see if
         it is wrapped correctly
      Th𝄞s 𝄞s a very, very long f𝄞rst l𝄞ne for the comm𝄞t message to see 𝄞f
         𝄞t 𝄞s wrapped correctly
      a								12	34
         56	78

Someone else (1):
      Commit by someone else

EOF
	git shortlog -w HEAD >out &&
	test_cmp expect out

rename from file
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
HEAD is now at 053c2a5 renamed a file
warning: unable to rmdir sub1: Directory not empty
ok 6 - shortlog wrapping

Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  053c2a5 renamed a file

expecting success: 
	git log HEAD >log &&
	GIT_DIR=non-existing git shortlog -w <log >out &&
	test_cmp expect out

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> 053c2a5

HEAD is now at 5adb50d... added another file
ok 7 - shortlog from non-git directory

expecting success: 
	cat >expect <<\EOF &&
A U Thor (2):
      bbbbbbbbbbbbbbbbbb: bbbbbbbb bbb bbbb bbbbbbb bb bbbb bbb bbbbb bbbbbb
      aaaaaaaaaaaaaaaaaaaaaa: aaaaaa aaaaaaaaaa aaaa aaaaaaaa aa aaaa aa aaa

EOF
	git shortlog -w >out <<\EOF &&
commit 0000000000000000000000000000000000000001
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:14:13 2005 -0700

    aaaaaaaaaaaaaaaaaaaaaa: aaaaaa aaaaaaaaaa aaaa aaaaaaaa aa aaaa aa aaa

commit 0000000000000000000000000000000000000002
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:14:13 2005 -0700

    bbbbbbbbbbbbbbbbbb: bbbbbbbb bbb bbbb bbbbbbb bb bbbb bbb bbbbb bbbbbb

EOF
	test_cmp expect out

Applying: renamed a file and added another
ok 8 - shortlog should add newline when input line matches wraplen

expecting success: 
	git reset --hard "$commit" &&
	git config --unset i18n.commitencoding &&
	echo 2 > a1 &&
	git commit --quiet -m "$MSG1" --author="$DSCHOE" a1 &&
	git config i18n.commitencoding "ISO8859-1" &&
	echo 3 > a1 &&
	git commit --quiet -m "$(iconvfromutf8toiso88591 "$MSG2")" \
		--author="$(iconvfromutf8toiso88591 "$DSCHOE")" a1 &&
	git config --unset i18n.commitencoding &&
	git shortlog HEAD~2.. > out &&
test_cmp expect out
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
HEAD is now at d3c627a Test
Merging 5adb50d78603a37ca5425714334080040b709afc with renamed a file and added another
Merging:
5adb50d added another file
virtual renamed a file and added another
found 1 common ancestor:
virtual 7ef4c6cfd0798027608935ae3f888758bcaceb89
Skipped renamed (merged same as existing)
expecting success: 

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

	echo ichi >one &&
	git add one &&
	test_tick &&
	git commit -m second &&

	git mv one ichi &&
	test_tick &&
	git commit -m third &&

	cp ichi ein &&
	git add ein &&
	test_tick &&
	git commit -m fourth &&

	mkdir a &&
	echo ni >a/two &&
	git add a/two &&
	test_tick &&
	git commit -m fifth  &&

	git rm a/two &&
	test_tick &&
	git commit -m sixth


ok 6 - apply_index: 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 36 - am -3 can rename a file after falling back to 3-way merge

expecting success: 
	rm -fr .git/rebase-apply &&
	git checkout -f lorem2 &&
	git reset base3way --hard &&
	git am -3 -q lorem-move.patch >output.out 2>&1 &&
	! test -s output.out

[master (root-commit) 3a2fdcb] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  411242f renamed a file and added another

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> 411242f

Switched to branch 'lorem2'
ok 9 - shortlog encoding

expecting success: 
	git commit --allow-empty -m normal &&
	git commit --allow-empty -m soon-to-be-broken &&
	git cat-file commit HEAD >commit.tmp &&
	sed "/^author/d" commit.tmp >broken.tmp &&
	commit=$(git hash-object -w -t commit --stdin <broken.tmp) &&
	git update-ref HEAD $commit &&
	cat >expect <<-\EOF &&
	A U Thor (1):
	      normal

	EOF
	git shortlog HEAD~2.. >actual &&
	test_cmp expect actual

[master f7dab8e] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
HEAD is now at 6f68cdc copied stuff
[master e1ed609] normal
 Author: A U Thor <author@example.com>
Cloning into 'submodule_update'...
[master 2fbe8c0] third
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename one => ichi (100%)
[master eb1bf58] soon-to-be-broken
 Author: A U Thor <author@example.com>
done.
[master 5d31159] fourth
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 ein
warning: Missing author: 908ce2e92027304ff4cc11ac6139da893811d6e4
ok 10 - shortlog ignores commits with missing authors

expecting success: 
	git shortlog --all &&
	git shortlog --branches &&
	git shortlog --exclude=refs/heads/m* --all

warning: Missing author: 908ce2e92027304ff4cc11ac6139da893811d6e4
A U Thor (2):
      Test
      normal

Jöhännës "Dschö" Schindëlin (2):
      set a1 to 2 and some non-ASCII chars: Äßø
      set a1 to 3 and some non-ASCII chars: áæï

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
[master 394ef78] fifth
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a/two
ok 37 - am -3 -q is quiet

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout lorem2^^ &&
	test_must_fail git am lorem-move.patch &&
	test -d .git/rebase-apply

warning: Missing author: 908ce2e92027304ff4cc11ac6139da893811d6e4
A U Thor (2):
      Test
      normal

Jöhännës "Dschö" Schindëlin (2):
      set a1 to 2 and some non-ASCII chars: Äßø
      set a1 to 3 and some non-ASCII chars: áæï

warning: Missing author: 908ce2e92027304ff4cc11ac6139da893811d6e4
rm 'a/two'
A U Thor (2):
      Test
      normal

Jöhännës "Dschö" Schindëlin (2):
      set a1 to 2 and some non-ASCII chars: Äßø
      set a1 to 3 and some non-ASCII chars: áæï

ok 11 - shortlog with revision pseudo options

HEAD is now at 7446e63 added another file
# passed all 11 test(s)
1..11
[master 804a787] sixth
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 a/two
ok 1 - setup

expecting success: 

	git log --pretty="format:%s" > actual &&
	test_cmp expect actual

Note: checking out 'lorem2^^'.

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 6f68cdc... copied stuff
ok 2 - pretty

expecting success: 

	git log --pretty="tformat:%s" > actual &&
	test_cmp expect actual

*** t4203-mailmap.sh ***
Applying: moved stuff
ok 3 - pretty (tformat)

expecting success: 

	git log --pretty="%s" > actual &&
	test_cmp expect actual

error: patch failed: file:26
error: file: patch does not apply
Patch failed at 0001 moved stuff
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
ok 38 - am pauses on conflict

expecting success: 
	echo goodbye >expected &&
	git am --skip &&
	test_path_is_missing .git/rebase-apply &&
	git diff --exit-code lorem2^^ -- file &&
	test_cmp expected another

ok 4 - pretty (shortcut)

expecting success: 

	git log --format="%s" > actual &&
	test_cmp expect actual

Applying: added another file
ok 5 - format

expecting success: 

	git log -2 --format="%w(11,1,2)This is the %s commit." > actual &&
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4203-mailmap/.git/
ok 6 - format %w(11,1,2)

expecting success: 

	git log -2 --format="%w(,1,2)This is%nthe %s%ncommit." > actual &&
	test_cmp expect actual

expecting success: 
	cat >contacts <<-\EOF &&
	A U Thor <author@example.com>
	nick1 <bugs@company.xx>
	EOF

	echo one >one &&
	git add one &&
	test_tick &&
	git commit -m initial &&
	echo two >>one &&
	git add one &&
	test_tick &&
	git commit --author "nick1 <bugs@company.xx>" -m second

ok 7 - format %w(,1,2)

ok 39 - am --skip works

expecting success: 
	mkdir .git/rebase-apply &&
	git am --abort &&
	test_path_is_missing .git/rebase-apply

expecting success: 

	git log --oneline > actual &&
	test_cmp expect actual

ok 40 - am --abort removes a stray directory

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout lorem2^^ &&

	test_must_fail git am lorem-move.patch &&
	test_path_is_dir .git/rebase-apply &&
	test_cmp_rev lorem2^^ HEAD &&

	test_must_fail git am <lorem-move.patch &&
	test_path_is_dir .git/rebase-apply &&
	test_cmp_rev lorem2^^ HEAD

ok 8 - oneline

expecting success: 

	git log --pretty="format:%s" --diff-filter=A HEAD > actual &&
	git log --pretty="format:%s" --diff-filter A HEAD > actual-separate &&
	printf "fifth\nfourth\nthird\ninitial" > expect &&
	test_cmp expect actual &&
	test_cmp expect actual-separate


[master (root-commit) 3a2fdcb] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one
HEAD is now at 8dcdeb6 added another file
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/submodule_update_repo/.) registered for path 'sub1'
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  8dcdeb6 added another file

ok 9 - diff-filter=A

expecting success: 

	actual=$(git log --pretty="format:%s" --diff-filter=M HEAD) &&
	expect=$(echo second) &&
	verbose test "$actual" = "$expect"


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> 8dcdeb6

HEAD is now at 6f68cdc... copied stuff
[master e0f6049] second
 Author: nick1 <bugs@company.xx>
 1 file changed, 1 insertion(+)
ok 1 - setup

expecting success: 
	test_must_fail git check-mailmap

fatal: no contacts specified
ok 10 - diff-filter=M

expecting success: 

	actual=$(git log --pretty="format:%s" --diff-filter=D HEAD) &&
	expect=$(echo sixth ; echo third) &&
	verbose test "$actual" = "$expect"


ok 2 - check-mailmap no arguments

expecting success: 
	cat >expect <<-\EOF &&
	A U Thor <author@example.com>
	nick1 <bugs@company.xx>
	EOF
	git check-mailmap \
		"A U Thor <author@example.com>" \
		"nick1 <bugs@company.xx>" >actual &&
	test_cmp expect actual

Applying: moved stuff
ok 3 - check-mailmap arguments

expecting success: 
	cat >expect <<-\EOF &&
	A U Thor <author@example.com>
	nick1 <bugs@company.xx>
	EOF
	git check-mailmap --stdin <contacts >actual &&
	test_cmp expect actual

ok 11 - diff-filter=D

expecting success: 

	actual=$(git log -M --pretty="format:%s" --diff-filter=R HEAD) &&
	expect=$(echo third) &&
	verbose test "$actual" = "$expect"


error: patch failed: file:26
error: file: patch does not apply
Patch failed at 0001 moved stuff
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
ok 12 - diff-filter=R

expecting success: 

	actual=$(git log -C -C --pretty="format:%s" --diff-filter=C HEAD) &&
	expect=$(echo fourth) &&
	verbose test "$actual" = "$expect"


ok 4 - check-mailmap --stdin

expecting success: 
	cat >expect <<-\EOF &&
	Internal Guy <bugs@company.xy>
	EOF
	cat <contacts >>expect &&
	git check-mailmap --stdin "Internal Guy <bugs@company.xy>" \
		<contacts >actual &&
	test_cmp expect actual

ok 13 - diff-filter=C

expecting success: 

	actual=$(git log --follow --pretty="format:%s" ichi) &&
	expect=$(echo third ; echo second ; echo initial) &&
	verbose test "$actual" = "$expect"

fatal: previous rebase directory .git/rebase-apply still exists but mbox given.
Cloning into 'sub1'...
ok 5 - check-mailmap --stdin arguments

expecting success: 
	test_must_fail git check-mailmap bogus

ok 14 - git log --follow

expecting success: 
	test_config log.follow true &&
	actual=$(git log --pretty="format:%s" ichi) &&
	expect=$(echo third ; echo second ; echo initial) &&
	verbose test "$actual" = "$expect"

fatal: unable to parse contact: bogus
ok 6 - check-mailmap bogus contact

expecting success: 
	git shortlog HEAD >actual &&
	test_cmp expect actual

ok 41 - am refuses patches when paused

expecting success: 
	echo goodbye >expected &&
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout lorem2^^ &&
	test_must_fail git am lorem-move.patch &&
	test -d .git/rebase-apply &&
	echo resolved >>file &&
	git add file &&
	git am --resolved &&
	test_path_is_missing .git/rebase-apply &&
	test_cmp expected another

ok 7 - No mailmap

expecting success: 
	echo "Repo Guy <author@example.com>" > .mailmap &&
	git shortlog HEAD >actual &&
	test_cmp expect actual

ok 15 - git config log.follow works like --follow

expecting success: 
	test_config log.follow true &&
	git log --pretty="format:%s" ichi ein

done.
HEAD is now at 6f68cdc copied stuff
ok 8 - default .mailmap

HEAD is now at 6f68cdc... copied stuff
expecting success: 
	mkdir -p internal_mailmap &&
	echo "Internal Guy <bugs@company.xx>" > internal_mailmap/.mailmap &&
	git config mailmap.file internal_mailmap/.mailmap &&
	git shortlog HEAD >actual &&
	test_cmp expect actual

fourth
thirdok 16 - git config log.follow does not die with multiple paths

expecting success: 
	test_config log.follow true &&
	git log --

Applying: moved stuff
error: patch failed: file:26
error: file: patch does not apply
ok 9 - mailmap.file set

Patch failed at 0001 moved stuff
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
expecting success: 
	echo "External Guy <author@example.com>" >> internal_mailmap/.mailmap &&
	git config mailmap.file internal_mailmap/.mailmap &&
	git shortlog HEAD >actual &&
	test_cmp expect actual

commit 804a7879c6cac637c9d34d1608e3e54867d90b7e
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:18:13 2005 -0700

    sixth

commit 394ef780a000df496e0a8fdd648963c3f9d96f56
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:17:13 2005 -0700

    fifth

commit 5d311594784eefe7b43496741766fe058f1c91a1
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:16:13 2005 -0700

    fourth

commit 2fbe8c09c8e84c2346ba2ac744cb09a926773855
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:15:13 2005 -0700

    third

commit f7dab8eda217fc1e06315e7c91b6bd7c2a56363a
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:14:13 2005 -0700

    second

commit 3a2fdcbc365f1f169c2d433dbb277d88b412d8c9
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:13:13 2005 -0700

    initial
Applying: moved stuff
ok 17 - git config log.follow does not die with no paths

expecting success: 
	test_config log.follow true &&
	actual=$(git log --no-follow --pretty="format:%s" ichi) &&
	expect="third" &&
	verbose test "$actual" = "$expect"

ok 10 - mailmap.file override

Applying: added another file
expecting success: 
	rm internal_mailmap/.mailmap &&
	rmdir internal_mailmap &&
	git shortlog HEAD >actual &&
	test_cmp expect actual

ok 18 - git config log.follow is overridden by --no-follow

ok 11 - mailmap.file non-existent

ok 42 - am --resolved works

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout lorem2^^ &&
	test_must_fail git am lorem-move.patch &&
	test_path_is_dir .git/rebase-apply &&
	test_cmp_rev lorem2^^ HEAD &&
	test_must_fail git am --resolved &&
	test_path_is_dir .git/rebase-apply &&
	test_cmp_rev lorem2^^ HEAD

Submodule path 'sub1': checked out '613068f76d422f07de14d59bca708cacb8bb3c5b'
expecting success: 
	git log --no-walk --oneline 5d31159 804a787 394ef78 > actual &&
	test_cmp expect actual

expecting success: 
	mkdir -p internal_mailmap &&
	echo "<bugs@company.xy> <bugs@company.xx>" >internal_mailmap/.mailmap &&
	echo "Internal Guy <bugs@company.xx>" >>internal_mailmap/.mailmap &&
	git shortlog HEAD >actual &&
	test_cmp expect actual

ok 19 - git log --no-walk <commits> sorts by commit time

expecting success: 
	git log --no-walk=sorted --oneline 5d31159 804a787 394ef78 > actual &&
	test_cmp expect actual

HEAD is now at 61140de added another file
ok 12 - name entry after email entry

expecting success: 
	mkdir -p internal_mailmap &&
	echo "<bugs@company.xy> <bugs@company.xx>" >internal_mailmap/.mailmap &&
	echo "Internal Guy <BUGS@Company.xx>" >>internal_mailmap/.mailmap &&
	git shortlog HEAD >actual &&
	test_cmp expect actual

ok 20 - git log --no-walk=sorted <commits> sorts by commit time

expecting success: 
	git log --no-walk=unsorted --oneline 5d31159 804a787 394ef78 > actual &&
	test_cmp expect actual

Warning: you are leaving 2 commits behind, not connected to
any of your branches:

  61140de added another file
  fbc1373 moved stuff

If you want to keep them by creating a new branch, this may be a good time
to do so with:

 git branch <new-branch-name> 61140de

HEAD is now at 6f68cdc... copied stuff
ok 13 - name entry after email entry, case-insensitive

expecting success: 
	rm -f .mailmap internal_mailmap/.mailmap &&
	git shortlog HEAD >actual &&
	test_cmp expect actual

ok 21 - git log --no-walk=unsorted <commits> leaves list of commits as given

expecting success: 
	git show --oneline -s 5d31159 804a787 394ef78 > actual &&
	test_cmp expect actual

Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
ok 22 - git show <commits> leaves list of commits as given

expecting success: 
	echo case >one &&
	test_tick &&
	git add one &&
	git commit -a -m Second

ok 14 - No mailmap files, but configured

expecting success: 
	git checkout -b map &&
	test_when_finished "git checkout master" &&
	cat >just-bugs <<-\EOF &&
	Blob Guy <bugs@company.xx>
	EOF
	cat >both <<-\EOF &&
	Blob Guy <author@example.com>
	Blob Guy <bugs@company.xx>
	EOF
	printf "Tricky Guy <author@example.com>" >no-newline &&
	git add just-bugs both no-newline &&
	git commit -m "my mailmaps" &&
	echo "Repo Guy <author@example.com>" >.mailmap &&
	echo "Internal Guy <author@example.com>" >internal.map

Applying: moved stuff
error: patch failed: file:26
error: file: patch does not apply
Patch failed at 0001 moved stuff
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Switched to a new branch 'map'
[master e9e4904] Second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one
ok 23 - setup case sensitivity tests

expecting success: 
	echo second >expect &&
	git log -1 --pretty="tformat:%s" --grep=sec >actual &&
	test_cmp expect actual

Applying: moved stuff
No changes - did you forget to use 'git add'?
If there is nothing left to stage, chances are that something else
already introduced the same changes; you might want to skip this patch.
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
ok 24 - log --grep

expecting success: 
	git log --pretty="tformat:%s" --invert-grep --grep=th --grep=Sec >actual &&
	test_cmp expect actual

[map d53f9b1] my mailmaps
 Author: A U Thor <author@example.com>
 3 files changed, 4 insertions(+)
 create mode 100644 both
 create mode 100644 just-bugs
 create mode 100644 no-newline
ok 25 - log --invert-grep --grep

expecting success: 
	echo initial >expect &&
	git log --pretty="tformat:%s" --invert-grep -i --grep=th --grep=Sec >actual &&
	test_cmp expect actual

ok 43 - am --resolved fails if index has no changes

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout second &&
	test_must_fail git am -3 lorem-move.patch &&
	test_path_is_dir .git/rebase-apply &&
	test_cmp_rev second HEAD &&
	test_must_fail git am --resolved >err &&
	test_path_is_dir .git/rebase-apply &&
	test_cmp_rev second HEAD &&
	test_i18ngrep "still have unmerged paths" err

warning: unable to rmdir sub1: Directory not empty
Switched to branch 'master'
ok 26 - log --invert-grep --grep -i
ok 15 - setup mailmap blob tests


expecting success: 
	cat >expect <<-\EOF &&
	Blob Guy (1):
	      second

	Repo Guy (1):
	      initial

	EOF
	git -c mailmap.blob=map:just-bugs shortlog HEAD >actual &&
	test_cmp expect actual

expecting success: 
	echo second >expect &&
	git log -1 --pretty="tformat:%s" --grep sec >actual &&
	test_cmp expect actual &&
	test_must_fail git log -1 --pretty="tformat:%s" --grep

HEAD is now at 6f68cdc copied stuff
fatal: Option '--grep' requires a value
ok 27 - log --grep option parsing

expecting success: 
	echo Second >expect &&
	git log -1 --pretty="tformat:%s" -i --grep=sec >actual &&
	test_cmp expect actual

ok 16 - mailmap.blob set

expecting success: 
	cat >expect <<-\EOF &&
	Blob Guy (2):
	      initial
	      second

	EOF
	git -c mailmap.blob=map:both shortlog HEAD >actual &&
	test_cmp expect actual

Previous HEAD position was 6f68cdc... copied stuff
HEAD is now at e01c0d3... second
ok 28 - log -i --grep

expecting success: 
	echo Second >expect &&
	git log -1 --pretty="tformat:%s" --grep=sec -i >actual &&
	test_cmp expect actual

ok 17 - mailmap.blob overrides .mailmap

expecting success: 
	cat >expect <<-\EOF &&
	Blob Guy (1):
	      second

	Internal Guy (1):
	      initial

	EOF
	git \
	  -c mailmap.blob=map:both \
	  -c mailmap.file=internal.map \
	  shortlog HEAD >actual &&
	test_cmp expect actual

ok 29 - log --grep -i

expecting success: 
	echo second >expect &&
	git log -1 --pretty="tformat:%s" -F -E --grep=s.c.nd >actual &&
	test_cmp expect actual

Applying: moved stuff
ok 18 - mailmap.file overrides mailmap.blob

expecting success: 
	cat >expect <<-\EOF &&
	Repo Guy (1):
	      initial

	nick1 (1):
	      second

	EOF
	git -c mailmap.blob=map:nonexistent shortlog HEAD >actual &&
	test_cmp expect actual

ok 30 - log -F -E --grep=<ere> uses ere

Using index info to reconstruct a base tree...
M	file
expecting success: 
	git log --graph --pretty=tformat:%s >actual &&
	test_cmp expect actual

Falling back to patching base and 3-way merge...
ok 19 - mailmap.blob can be missing

expecting success: 
	git init non-bare &&
	(
		cd non-bare &&
		test_commit one .mailmap "Fake Name <author@example.com>" &&
		echo "     1	Fake Name" >expect &&
		git shortlog -ns HEAD >actual &&
		test_cmp expect actual &&
		rm .mailmap &&
		echo "     1	A U Thor" >expect &&
		git shortlog -ns HEAD >actual &&
		test_cmp expect actual
	)

Merging e01c0d3c660754fcc53a09b0f8023c72e8358dd9 with moved stuff
Merging:
e01c0d3 second
virtual moved stuff
found 1 common ancestor:
virtual 1a0aed3db7ed3439d173ac047eca267fd076cc21
Auto-merging file
CONFLICT (content): Merge conflict in file
error: Failed to merge in the changes.
Patch failed at 0001 moved stuff
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
ok 31 - simple log --graph

expecting success: 
	git checkout -b side HEAD~4 &&
	test_commit side-1 1 1 &&
	test_commit side-2 2 2 &&
	git checkout master &&
	git merge side

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4203-mailmap/non-bare/.git/
Switched to a new branch 'side'
ok 7 - apply_index: 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
		)
	
[side 4447a16] side-1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 1
[master (root-commit) c736a92] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 .mailmap
You still have unmerged paths in your index.
ok 44 - am --resolved fails if index has unmerged entries

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout first &&
	cat pine patch1 | git am &&
	test_path_is_missing .git/rebase-apply &&
	git diff --exit-code master^..HEAD

HEAD is now at e01c0d3 second
[side 1666e54] side-2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 2
ok 20 - mailmap.blob defaults to off in non-bare repo

expecting success: 
	git clone --bare non-bare bare &&
	(
		cd bare &&
		echo "     1	Fake Name" >expect &&
		git shortlog -ns HEAD >actual &&
		test_cmp expect actual
	)

Previous HEAD position was e01c0d3... second
HEAD is now at 6b2d93f... first
Cloning into bare repository 'bare'...
Switched to branch 'master'
done.
Merging:
e9e4904 Second
virtual side
found 1 common ancestor:
2fbe8c0 third
Merge made by the 'recursive' strategy.
Cloning into 'submodule_update'...
Applying: second
 1 | 1 +
 2 | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 1
 create mode 100644 2
ok 32 - set up merge history

expecting success: 
	git log --graph --date-order --pretty=tformat:%s |
		sed "s/ *\$//" >actual &&
	test_cmp expect actual

ok 21 - mailmap.blob defaults to HEAD:.mailmap in bare repo

expecting success: 
	cat >expect <<-\EOF &&
	Tricky Guy (1):
	      initial

	nick1 (1):
	      second

	EOF
	git -c mailmap.blob=map:no-newline shortlog HEAD >actual &&
	test_cmp expect actual

ok 33 - log --graph with merge

expecting success: 
	git log --raw --graph --oneline -m master | head -n 500 >actual &&
	grep "initial" actual

done.
ok 45 - am takes patches from a Pine mailbox

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	test_must_fail git am <failmail &&
	git am --abort &&
	test_path_is_missing .git/rebase-apply

ok 22 - mailmap.blob can handle blobs without trailing newline

expecting success: 
	rm -f .mailmap

ok 23 - cleanup after mailmap.blob tests

expecting success: 
	echo "     1	A <author@example.com>" >expect &&
	echo "     1	nick1 <bugs@company.xx>" >>expect &&
	echo "A <author@example.com>" >.mailmap &&
	test_when_finished "rm .mailmap" &&
	git shortlog -es HEAD >actual &&
	test_cmp expect actual

* 3a2fdcb initial
ok 34 - log --raw --graph -m with merge

expecting success: 
	git diff-tree --graph master^ | head -n 500 >actual &&
	grep "one" actual

HEAD is now at fd7c70f second
ok 24 - single-character name

expecting success: 
	echo "     1	A U Thor <AUTHOR@example.com>" >expect &&
	echo "     1	nick1 <bugs@company.xx>" >>expect &&
	echo "<AUTHOR@example.com> <author@example.com>" >.mailmap &&
	test_when_finished "rm .mailmap" &&
	git shortlog -es HEAD >actual &&
	test_cmp expect actual

:000000 100644 0000000000000000000000000000000000000000 9a333834d7f76d26bf24f07f0d8ab00010e78b91 A	one
ok 35 - diff-tree --graph

expecting success: 
	git log --graph --date-order --pretty=short |
		git name-rev --name-only --stdin |
		sed "s/Merge:.*/Merge: A B/;s/ *\$//" >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.
Patch is empty. Was it split wrong?
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
ok 25 - preserve canonical email case

expecting success: 
	echo three >>one &&
	git add one &&
	test_tick &&
	git commit --author "nick2 <bugs@company.xx>" -m third &&

	echo four >>one &&
	git add one &&
	test_tick &&
	git commit --author "nick2 <nick2@company.xx>" -m fourth &&

	echo five >>one &&
	git add one &&
	test_tick &&
	git commit --author "santa <me@company.xx>" -m fifth &&

	echo six >>one &&
	git add one &&
	test_tick &&
	git commit --author "claus <me@company.xx>" -m sixth &&

	echo seven >>one &&
	git add one &&
	test_tick &&
	git commit --author "CTO <cto@coompany.xx>" -m seventh &&

	mkdir -p internal_mailmap &&
	echo "Committed <committer@example.com>" > internal_mailmap/.mailmap &&
	echo "<cto@company.xx>                       <cto@coompany.xx>" >> internal_mailmap/.mailmap &&
	echo "Some Dude <some@dude.xx>         nick1 <bugs@company.xx>" >> internal_mailmap/.mailmap &&
	echo "Other Author <other@author.xx>   nick2 <bugs@company.xx>" >> internal_mailmap/.mailmap &&
	echo "Other Author <other@author.xx>         <nick2@company.xx>" >> internal_mailmap/.mailmap &&
	echo "Santa Claus <santa.claus@northpole.xx> <me@company.xx>" >> internal_mailmap/.mailmap &&
	echo "Santa Claus <santa.claus@northpole.xx> <me@company.xx>" >> internal_mailmap/.mailmap &&

	git shortlog -e HEAD >actual &&
	test_cmp expect actual


ok 36 - log --graph with full output

expecting success: 
	git checkout -b tangle HEAD~6 &&
	test_commit tangle-a tangle-a a &&
	git merge master~3 &&
	git merge side~1 &&
	git checkout master &&
	git merge tangle &&
	git checkout -b reach &&
	test_commit reach &&
	git checkout master &&
	git checkout -b octopus-a &&
	test_commit octopus-a &&
	git checkout master &&
	git checkout -b octopus-b &&
	test_commit octopus-b &&
	git checkout master &&
	test_commit seventh &&
	git merge octopus-a octopus-b &&
	git merge reach

ok 46 - am fails on mail without patch

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	echo "---" >>failmail &&
	test_must_fail git am <failmail &&
	git am --skip &&
	test_path_is_missing .git/rebase-apply

Switched to a new branch 'tangle'
HEAD is now at fd7c70f second
[master 4db1a3d] third
 Author: nick2 <bugs@company.xx>
 1 file changed, 1 insertion(+)
[tangle f6c510e] tangle-a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 tangle-a
Applying: git-foo.sh
fatal: unrecognized input
[master e371838] fourth
 Author: nick2 <nick2@company.xx>
 1 file changed, 1 insertion(+)
Patch failed at 0001 git-foo.sh
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
ok 47 - am fails on empty patch

[master 25e4bf3] fifth
 Author: santa <me@company.xx>
 1 file changed, 1 insertion(+)
expecting success: 
	rm -fr subdir &&
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout first &&
	(
		mkdir -p subdir &&
		cd subdir &&
		git am <../patch1
	) &&
	git diff --exit-code second

Merging:
f6c510e tangle-a
virtual master~3
found 1 common ancestor:
f7dab8e second
Skipped ein (merged same as existing)
Merge made by the 'recursive' strategy.
 a/two      | 1 +
 one => ein | 0
 ichi       | 1 +
 3 files changed, 2 insertions(+)
 create mode 100644 a/two
 rename one => ein (100%)
 create mode 100644 ichi
HEAD is now at fd7c70f second
[master 17c3971] sixth
 Author: claus <me@company.xx>
 1 file changed, 1 insertion(+)
Merging:
2dc6a29 Merge branch 'master' (early part) into tangle
virtual side~1
found 1 common ancestor:
2fbe8c0 third
Merge made by the 'recursive' strategy.
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  fd7c70f second

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> fd7c70f

HEAD is now at 6b2d93f... first
 1 | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 1
[master f399f22] seventh
 Author: CTO <cto@coompany.xx>
 1 file changed, 1 insertion(+)
Switched to branch 'master'
Applying: second
ok 26 - Shortlog output (complex mapping)

expecting success: 
	git log --pretty=format:"Author %an <%ae> maps to %aN <%aE>%nCommitter %cn <%ce> maps to %cN <%cE>%n" >actual &&
	test_cmp expect actual

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/submodule_update_repo/.) registered for path 'sub1'
Merging:
e8dcb3b Merge branch 'side'
virtual tangle
found 2 common ancestors:
394ef78 fifth
4447a16 side-1
  Merging:
  394ef78 fifth
  4447a16 side-1
  found 1 common ancestor:
  2fbe8c0 third
Merge made by the 'recursive' strategy.
ok 27 - Log output (complex mapping)

expecting success: 
	git log --use-mailmap | grep Author >actual &&
	test_cmp expect actual

 tangle-a | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 tangle-a
ok 48 - am works from stdin in subdirectory

expecting success: 
	rm -fr subdir &&
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout first &&
	(
		mkdir -p subdir &&
		cd subdir &&
		git am ../patch1
	) &&
	git diff --exit-code second

Switched to a new branch 'reach'
ok 28 - Log output with --use-mailmap

expecting success: 
	git -c log.mailmap=True log | grep Author >actual &&
	test_cmp expect actual

HEAD is now at e991f6f second
ok 29 - Log output with log.mailmap

[reach 973a5f9] reach
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 reach.t
expecting success: 
	git log --use-mailmap --author Santa | grep Author >actual &&
	test_cmp expect actual

Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  e991f6f second

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> e991f6f

HEAD is now at 6b2d93f... first
ok 30 - Grep author with --use-mailmap

Switched to branch 'master'
expecting success: 
	git -c log.mailmap=True log --author Santa | grep Author >actual &&
	test_cmp expect actual

Cloning into 'sub1'...
Switched to a new branch 'octopus-a'
ok 31 - Grep author with log.mailmap

expecting success: 
	git log --use-mailmap --author "<cto@coompany.xx>" >actual &&
	test_cmp expect actual

Applying: second
ok 32 - Only grep replaced author with --use-mailmap

[octopus-a 5c3c15c] octopus-a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 octopus-a.t
expecting success: 
	git blame one >actual &&
	fuzz_blame actual >actual.fuzz &&
	test_cmp expect actual.fuzz

done.
ok 33 - Blame output (complex mapping)

ok 49 - am works from file (relative path given) in subdirectory

expecting success: 
	rm -fr subdir &&
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout first &&
	P=$(pwd) &&
	(
		mkdir -p subdir &&
		cd subdir &&
		git am "$P/patch1"
	) &&
	git diff --exit-code second

expecting success: 
	test_must_fail git commit --author "nick" --allow-empty -meight &&
	git commit --author "Some Dude" --allow-empty -meight &&
	git show --pretty=format:"%an <%ae>%n" >actual &&
	test_cmp expect actual
Switched to branch 'master'

Switched to a new branch 'octopus-b'
fatal: --author 'nick' is not 'Name <email>' and matches no existing author
HEAD is now at e991f6f second
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  e991f6f second

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> e991f6f

HEAD is now at 6b2d93f... first
[master 41e4fcf] eight
 Author: Some Dude <some@dude.xx>
[octopus-b ef3da6e] octopus-b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 octopus-b.t
ok 34 - commit --author honors mailmap

# passed all 34 test(s)
1..34
Applying: second
Switched to branch 'master'
Submodule path 'sub1': checked out '613068f76d422f07de14d59bca708cacb8bb3c5b'
[master c379a04] seventh
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 seventh.t
ok 50 - am works from file (absolute path given) in subdirectory

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout first &&
	test_tick &&
	git am --committer-date-is-author-date patch1 &&
	git cat-file commit HEAD | sed -e "/^\$/q" >head1 &&
	sed -ne "/^author /s/.*> //p" head1 >at &&
	sed -ne "/^committer /s/.*> //p" head1 >ct &&
	test_cmp at ct

*** t4204-patch-id.sh ***
warning: refname 'octopus-a' is ambiguous.
warning: refname 'octopus-b' is ambiguous.
warning: refname 'octopus-a' is ambiguous.
warning: refname 'octopus-b' is ambiguous.
HEAD is now at e991f6f second
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  e991f6f second

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> e991f6f

HEAD is now at 6b2d93f... first
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
Trying simple merge with octopus-a
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4204-patch-id/.git/
error: sub1/file1: already exists in working directory
error: sub1/file2: already exists in working directory
expecting success: 
	as="a a a a a a a a" && # eight a
	test_write_lines $as >foo &&
	test_write_lines $as >bar &&
	git add foo bar &&
	git commit -a -m initial &&
	test_write_lines $as b >foo &&
	test_write_lines $as b >bar &&
	git commit -a -m first &&
	git checkout -b same master &&
	git commit --amend -m same-msg &&
	git checkout -b notsame master &&
	echo c >foo &&
	echo c >bar &&
	git commit --amend -a -m notsame-msg &&
	test_write_lines bar foo >bar-then-foo &&
	test_write_lines foo bar >foo-then-bar

Applying: second
Trying simple merge with octopus-b
[master (root-commit) 159f108] initial
 Author: A U Thor <author@example.com>
 2 files changed, 16 insertions(+)
 create mode 100644 bar
 create mode 100644 foo
Merge made by the 'octopus' strategy.
 octopus-a.t | 1 +
 octopus-b.t | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 octopus-a.t
 create mode 100644 octopus-b.t
ok 51 - am --committer-date-is-author-date

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout first &&
	test_tick &&
	git am patch1 &&
	git cat-file commit HEAD | sed -e "/^\$/q" >head1 &&
	sed -ne "/^author /s/.*> //p" head1 >at &&
	sed -ne "/^committer /s/.*> //p" head1 >ct &&
	! test_cmp at ct

[master 511ec94] first
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
warning: refname 'reach' is ambiguous.
warning: refname 'reach' is ambiguous.
Merging:
f20367c Merge tags 'octopus-a' and 'octopus-b'
virtual reach
found 1 common ancestor:
5e75a13 Merge branch 'tangle'
Merge made by the 'recursive' strategy.
Switched to a new branch 'same'
HEAD is now at d3536eb second
 reach.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 reach.t
ok 37 - set up more tangled history

ok 8 - apply_index: 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
		)
	
expecting success: 
	git log --graph --date-order --pretty=tformat:%s |
		sed "s/ *\$//" >actual &&
	test_cmp expect actual

[same e113b6a] same-msg
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:57:50 2015 +0000
 2 files changed, 2 insertions(+)
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  d3536eb second

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> d3536eb

ok 38 - log --graph with merge

expecting success: 
	git log --oneline >expect.none &&
	git log --oneline --decorate >expect.short &&
	git log --oneline --decorate=full >expect.full &&

	echo "[log] decorate" >>.git/config &&
	git log --oneline >actual &&
	test_cmp expect.short actual &&

	test_config log.decorate true &&
	git log --oneline >actual &&
	test_cmp expect.short actual &&
	git log --oneline --decorate=full >actual &&
	test_cmp expect.full actual &&
	git log --oneline --decorate=no >actual &&
	test_cmp expect.none actual &&

	test_config log.decorate no &&
	git log --oneline >actual &&
	test_cmp expect.none actual &&
	git log --oneline --decorate >actual &&
	test_cmp expect.short actual &&
	git log --oneline --decorate=full >actual &&
	test_cmp expect.full actual &&

	test_config log.decorate 1 &&
	git log --oneline >actual &&
	test_cmp expect.short actual &&
	git log --oneline --decorate=full >actual &&
	test_cmp expect.full actual &&
	git log --oneline --decorate=no >actual &&
	test_cmp expect.none actual &&

	test_config log.decorate short &&
	git log --oneline >actual &&
	test_cmp expect.short actual &&
	git log --oneline --no-decorate >actual &&
	test_cmp expect.none actual &&
	git log --oneline --decorate=full >actual &&
	test_cmp expect.full actual &&

	test_config log.decorate full &&
	git log --oneline >actual &&
	test_cmp expect.full actual &&
	git log --oneline --no-decorate >actual &&
	test_cmp expect.none actual &&
	git log --oneline --decorate >actual &&
	test_cmp expect.short actual &&

	test_unconfig log.decorate &&
	git log --pretty=raw >expect.raw &&
	test_config log.decorate full &&
	git log --pretty=raw >actual &&
	test_cmp expect.raw actual


HEAD is now at 6b2d93f... first
Switched to a new branch 'notsame'
[notsame ec93f81] notsame-msg
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 10:57:50 2015 +0000
 2 files changed, 2 insertions(+), 16 deletions(-)
ok 1 - setup

expecting success: 
	git log -p -1 | git patch-id >output &&
	grep "^[a-f0-9]\{40\} $(git rev-parse HEAD)$" output

Applying: second
f107563c3b906af306765d78fce3e3a7e121cb5d ec93f81b318df8922636350b1466c2849ae2af82
ok 2 - patch-id output is well-formed

expecting success: 
	get_patch_id master &&
	get_patch_id same &&
	test_cmp patch-id_master patch-id_same

Cloning into 'submodule_update'...
--- at	2015-12-16 10:57:51.085564830 +0000
+++ ct	2015-12-16 10:57:51.097564830 +0000
@@ -1 +1 @@
-1112912053 -0700
+1112912293 -0700
ok 52 - am without --committer-date-is-author-date

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout first &&
	test_tick &&
	git am --ignore-date patch1 &&
	git cat-file commit HEAD | sed -e "/^\$/q" >head1 &&
	sed -ne "/^author /s/.*> //p" head1 >at &&
	grep "+0000" at

ok 3 - patch-id detects equality

expecting success: 
	get_patch_id master &&
	get_patch_id notsame &&
	! test_cmp patch-id_master patch-id_notsame

HEAD is now at 7b29a3a second
done.
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  7b29a3a second

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> 7b29a3a

HEAD is now at 6b2d93f... first
--- patch-id_master	2015-12-16 10:57:51.201564830 +0000
+++ patch-id_notsame	2015-12-16 10:57:51.249564830 +0000
@@ -1 +1 @@
-5d64663409e35f10b786d5942856240338437436
+f107563c3b906af306765d78fce3e3a7e121cb5d
ok 4 - patch-id detects inequality

expecting success: 
	get_patch_id master &&
	git checkout same &&
	git format-patch -1 --stdout | calc_patch_id same &&
	test_cmp patch-id_master patch-id_same &&
	set $(git format-patch -1 --stdout | git patch-id) &&
	test "$2" = $(git rev-parse HEAD)

Applying: second
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Switched to branch 'same'
1450263471 +0000
ok 53 - am --ignore-date

expecting success: 
	git rev-parse first^{tree} >expected &&
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	rm -fr subdir &&
	mkdir subdir &&
	git format-patch --numbered-files -o subdir -1 first &&
	(
		cd subdir &&
		git init &&
		git am 1
	) &&
	(
		cd subdir &&
		git rev-parse HEAD^{tree} >../actual
	) &&
	test_cmp expected actual

ok 5 - patch-id supports git-format-patch output

expecting success: 
	get_patch_id master &&
	git checkout same &&
	git format-patch -1 --stdout | sed "s/ \$//" | calc_patch_id same &&
	test_cmp patch-id_master patch-id_same

HEAD is now at 49bb70f second
subdir/1
Already on 'same'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4150-am/subdir/.git/
ok 6 - whitespace is irrelevant in footer

expecting success: 
	test_patch_id_file_order irrelevant --stable --stable

Applying: first
applying to an empty history
Already on 'same'
ok 7 - file order is irrelevant with --stable

expecting success: 
	test_patch_id_file_order relevant --unstable --unstable

ok 54 - am into an unborn branch

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout first &&
	test_tick &&
	sed -e "s/second/second \\\n foo/" patch1 >patchnl &&
	git am <patchnl >output.out 2>&1 &&
	test_i18ngrep "^Applying: second \\\n foo$" output.out

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/submodule_update_repo/.) registered for path 'sub1'
HEAD is now at 49bb70f second
Already on 'same'
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  49bb70f second

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> 49bb70f

HEAD is now at 6b2d93f... first
--- patch-id_order---unstable-relevant	2015-12-16 10:57:51.821564831 +0000
+++ patch-id_ordered-order---unstable-relevant	2015-12-16 10:57:51.901564831 +0000
@@ -1 +1 @@
-5d64663409e35f10b786d5942856240338437436
+cdb26c63dc1ab08a93181ff3446560b20801f812
ok 8 - file order is relevant with --unstable

expecting success: 
	test_patch_id relevant default

Already on 'same'
Cloning into 'sub1'...
Applying: second \n foo
ok 55 - am newline in subject

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout first &&
	test_tick &&
	git am -q <patch1 >output.out 2>&1 &&
	! test -s output.out

--- patch-id_order-default-relevant	2015-12-16 10:57:51.961564831 +0000
+++ patch-id_ordered-order-default-relevant	2015-12-16 10:57:52.045564831 +0000
@@ -1 +1 @@
-5d64663409e35f10b786d5942856240338437436
+cdb26c63dc1ab08a93181ff3446560b20801f812
ok 9 - default is unstable

expecting success: 
	test_config patchid.stable true &&
	test_patch_id irrelevant patchid.stable=true

HEAD is now at 947f27e second \n foo
done.
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  947f27e second \n foo

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> 947f27e

HEAD is now at 6b2d93f... first
Already on 'same'
ok 10 - patchid.stable = true is stable

expecting success: 
	test_config patchid.stable false &&
	test_patch_id relevant patchid.stable=false

ok 56 - am -q is quiet

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	touch empty-file &&
	test_tick &&
	test_must_fail git am empty-file 2>actual &&
	echo Patch format detection failed. >expected &&
	test_i18ncmp expected actual

ok 39 - log.decorate configuration

expecting success: 
	git log -g --abbrev-commit --pretty=oneline >expect &&
	git reflog >actual &&
	test_cmp expect actual

HEAD is now at 775bdc6 second
Already on 'same'
Submodule path 'sub1': checked out '613068f76d422f07de14d59bca708cacb8bb3c5b'
ok 57 - am empty-file does not infloop

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout HEAD^ &&
	git am --message-id patch1.eml &&
	test_path_is_missing .git/rebase-apply &&
	git cat-file commit HEAD | tail -n1 >actual &&
	grep Message-Id patch1.eml >expected &&
	test_cmp expected actual

--- patch-id_order-patchid.stable=false-relevant	2015-12-16 10:57:52.321564831 +0000
+++ patch-id_ordered-order-patchid.stable=false-relevant	2015-12-16 10:57:52.405564831 +0000
@@ -1 +1 @@
-5d64663409e35f10b786d5942856240338437436
+cdb26c63dc1ab08a93181ff3446560b20801f812
HEAD is now at 775bdc6 second
ok 11 - patchid.stable = false is unstable

expecting success: 
	test_config patchid.stable true &&
	test_patch_id relevant patchid.stable=true--unstable --unstable

ok 40 - reflog is expected format

expecting success: 
	git log --no-merges --raw >expect &&
	git whatchanged >actual &&
	test_cmp expect actual

Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  775bdc6 second

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> 775bdc6

HEAD is now at 6b2d93f... first
Already on 'same'
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
ok 41 - whatchanged is expected format

expecting success: 
	git log --abbrev-commit >expect.log.abbrev &&
	git log --no-abbrev-commit >expect.log.full &&
	git log --pretty=raw >expect.log.raw &&
	git reflog --abbrev-commit >expect.reflog.abbrev &&
	git reflog --no-abbrev-commit >expect.reflog.full &&
	git whatchanged --abbrev-commit >expect.whatchanged.abbrev &&
	git whatchanged --no-abbrev-commit >expect.whatchanged.full &&

	test_config log.abbrevCommit true &&

	git log >actual &&
	test_cmp expect.log.abbrev actual &&
	git log --no-abbrev-commit >actual &&
	test_cmp expect.log.full actual &&

	git log --pretty=raw >actual &&
	test_cmp expect.log.raw actual &&

	git reflog >actual &&
	test_cmp expect.reflog.abbrev actual &&
	git reflog --no-abbrev-commit >actual &&
	test_cmp expect.reflog.full actual &&

	git whatchanged >actual &&
	test_cmp expect.whatchanged.abbrev actual &&
	git whatchanged --no-abbrev-commit >actual &&
	test_cmp expect.whatchanged.full actual

Applying: second
--- patch-id_order-patchid.stable=true--unstable-relevant	2015-12-16 10:57:52.521564831 +0000
+++ patch-id_ordered-order-patchid.stable=true--unstable-relevant	2015-12-16 10:57:52.601564831 +0000
@@ -1 +1 @@
-5d64663409e35f10b786d5942856240338437436
+cdb26c63dc1ab08a93181ff3446560b20801f812
ok 12 - --unstable overrides patchid.stable = true

expecting success: 
	test_config patchid.stable false &&
	test_patch_id irrelevant patchid.stable=false--stable --stable

ok 58 - am --message-id really adds the message id

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout HEAD^ &&
	test_config am.messageid true &&
	git am patch1.eml &&
	test_path_is_missing .git/rebase-apply &&
	git cat-file commit HEAD | tail -n1 >actual &&
	grep Message-Id patch1.eml >expected &&
	test_cmp expected actual

HEAD is now at 10bb55e second
Already on 'same'
error: sub1/file1: already exists in working directory
error: sub1/file2: already exists in working directory
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  10bb55e second

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> 10bb55e

HEAD is now at 6b2d93f... first
ok 13 - --stable overrides patchid.stable = false

expecting success: 
	get_patch_id master &&
	git checkout same &&
	git format-patch -1 --attach --stdout | calc_patch_id same &&
	test_cmp patch-id_master patch-id_same

Applying: second
Already on 'same'
ok 14 - patch-id supports git-format-patch MIME output

ok 59 - am.messageid really adds the message id

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	git checkout HEAD^ &&
	git am -s --message-id patch1.eml &&
	test_path_is_missing .git/rebase-apply &&
	git cat-file commit HEAD | tail -n2 | head -n1 >actual &&
	grep Message-Id patch1.eml >expected &&
	test_cmp expected actual

expecting success: 
	cat nonl | calc_patch_id nonl &&
	cat withnl | calc_patch_id withnl &&
	test_cmp patch-id_nonl patch-id_withnl

HEAD is now at 10bb55e second
ok 9 - apply_index: 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 15 - patch-id handles no-nl-at-eof markers

# passed all 15 test(s)
1..15
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  10bb55e second

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> 10bb55e

HEAD is now at 6b2d93f... first
Applying: second
*** t4205-log-pretty-formats.sh ***
ok 60 - am --message-id -s signs off after the message id

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&

	# make patches one->two and two->three...
	test_commit one file &&
	test_commit two file &&
	test_commit three file &&
	git format-patch -2 --stdout >seq.patch &&

	# and create a situation that conflicts...
	git reset --hard one &&
	test_commit other file &&

	# enable rerere...
	test_config rerere.enabled true &&
	test_when_finished "rm -rf .git/rr-cache" &&

	# ...and apply. Our resolution is to skip the first
	# patch, and the rerere the second one.
	test_must_fail git am -3 seq.patch &&
	test_must_fail git am --skip &&
	echo resolved >file &&
	git add file &&
	git am --resolved &&

	# now apply again, and confirm that rerere engaged (we still
	# expect failure from am because rerere does not auto-commit
	# for us).
	git reset --hard other &&
	test_must_fail git am -3 seq.patch &&
	test_must_fail git am --skip &&
	echo resolved >expect &&
	test_cmp expect file

HEAD is now at 0c75574 second
ok 42 - log.abbrevCommit configuration

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4205-log-pretty-formats/.git/
expecting success: 
	# This tests for a regression introduced in v1.7.2-rc0~103^2~2
	test_create_repo regression &&
	(
		cd regression &&
		test_commit needs-another-commit &&
		test_commit foo.bar &&
		git log -M --follow -p foo.bar.t &&
		git log -M --follow --stat foo.bar.t &&
		git log -M --follow --name-only foo.bar.t
	)

Cloning into 'submodule_update'...
expecting success: 
	>foo &&
	>bar &&
	git add foo &&
	test_tick &&
	git config i18n.commitEncoding $test_encoding &&
	commit_msg $test_encoding | git commit -F - &&
	git add bar &&
	test_tick &&
	git commit -m "add bar" &&
	git config --unset i18n.commitEncoding

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4202-log/regression/.git/
[detached HEAD ae4c1f6] one
 Author: Another Thor <a.thor@example.com>
 1 file changed, 1 insertion(+), 2 deletions(-)
done.
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 foo
[master (root-commit) 2c943e6] needs-another-commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 needs-another-commit.t
[detached HEAD 9cb830c] two
 Author: Another Thor <a.thor@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
[master 91b4447] add bar
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 bar
ok 1 - set up basic repos

expecting success: 
	git log --pretty=oneline >expected &&
	git config pretty.test-alias oneline &&
	git log --pretty=test-alias >actual &&
	test_cmp expected actual

[master 88a3158] foo.bar
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo.bar.t
[detached HEAD b4dc8bf] three
 Author: Another Thor <a.thor@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
commit 88a3158a223f4c9eff6009796d6f4a01db6f394c
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:28:13 2005 -0700

    foo.bar

diff --git a/foo.bar.t b/foo.bar.t
new file mode 100644
index 0000000..fbf8e96
--- /dev/null
+++ b/foo.bar.t
@@ -0,0 +1 @@
+foo.bar
ok 2 - alias builtin format

expecting success: 
	git log --pretty=oneline >expected &&
	git config pretty.oneline "%H" &&
	git log --pretty=oneline >actual &&
	test_cmp expected actual

commit 88a3158a223f4c9eff6009796d6f4a01db6f394c
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:28:13 2005 -0700

    foo.bar

 foo.bar.t | 1 +
 1 file changed, 1 insertion(+)
commit 88a3158a223f4c9eff6009796d6f4a01db6f394c
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:28:13 2005 -0700

    foo.bar

foo.bar.t
ok 43 - show added path under "--follow -M"

expecting success: 
	test_create_repo follow-c &&
	(
		cd follow-c &&
		test_commit initial file original &&
		git rm file &&
		test_commit rename file2 original &&
		git reset --hard initial &&
		test_commit modify file foo &&
		git merge -m merge rename &&
		git log -c --follow file2
	)

HEAD is now at ae4c1f6 one
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4202-log/follow-c/.git/
ok 3 - alias masking builtin format

expecting success: 
	git log --pretty="format:%h" >expected &&
	git config pretty.test-alias "format:%h" &&
	git log --pretty=test-alias >actual &&
	test_cmp expected actual

[detached HEAD c2f509b] other
 Author: Another Thor <a.thor@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master (root-commit) 1ae2302] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 4 - alias user-defined format

expecting success: 
	git config i18n.logOutputEncoding $test_encoding &&
	git log --oneline >expected-s &&
	git log --pretty="tformat:%h %s" >actual-s &&
	git config --unset i18n.logOutputEncoding &&
	test_cmp expected-s actual-s

rm 'file'
Applying: two
Using index info to reconstruct a base tree...
M	file
[master b666f54] rename
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename file => file2 (100%)
ok 5 - alias user-defined tformat with %s (ISO8859-1 encoding)

expecting success: 
	git log --oneline >expected-s &&
	git log --pretty="tformat:%h %s" >actual-s &&
	test_cmp expected-s actual-s

Falling back to patching base and 3-way merge...
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/submodule_update_repo/.) registered for path 'sub1'
Merging c2f509beb0aa46f31c580e447c76f6667aef49ca with two
Merging:
c2f509b other
virtual two
found 1 common ancestor:
virtual 693a3de402bb23897ed5c931273e53c78eff0495
Auto-merging file
CONFLICT (content): Merge conflict in file
Recorded preimage for 'file'
error: Failed to merge in the changes.
HEAD is now at 1ae2302 initial
Patch failed at 0001 two
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
ok 6 - alias user-defined tformat with %s (utf-8 encoding)

expecting success: 
	git log --pretty="tformat:%h" >expected &&
	git config pretty.test-alias "tformat:%h" &&
	git log --pretty=test-alias >actual &&
	test_cmp expected actual

Applying: three
[master ab921c8] modify
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Using index info to reconstruct a base tree...
M	file
ok 7 - alias user-defined tformat

expecting success: 
	git config pretty.test-alias format-that-will-never-exist &&
	test_must_fail git log --pretty=test-alias

Falling back to patching base and 3-way merge...
Merging:
ab921c8 modify
virtual rename
found 1 common ancestor:
1ae2302 initial
Skipped file2 (merged same as existing)
Merge made by the 'recursive' strategy.
fatal: invalid --pretty format: test-alias
Merging c2f509beb0aa46f31c580e447c76f6667aef49ca with three
Merging:
c2f509b other
virtual three
found 1 common ancestor:
virtual aad8d5cef3915ab78b3227abaaac99b62db9eb54
Auto-merging file
CONFLICT (content): Merge conflict in file
ok 8 - alias non-existent format

expecting success: 
	git log --pretty="tformat:%h" >expected &&
	git config pretty.test-foo "tformat:%h" &&
	git config pretty.test-bar test-foo &&
	git log --pretty=test-bar >actual && test_cmp expected actual

Recorded preimage for 'file'
error: Failed to merge in the changes.
Patch failed at 0002 three
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
 file => file2 | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename file => file2 (100%)
Cloning into 'sub1'...
commit 0071b8c0b17b9c12c2c48a042c83e27bab6aad4e
Merge: ab921c8 b666f54
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:29:13 2005 -0700

    merge


commit b666f54d82025f8eaec1a190d72356cf651c2521
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:28:13 2005 -0700

    rename

diff --git a/file b/file2
similarity index 100%
rename from file
rename to file2

commit 1ae230258ca6e8e83c5d2d3840b9cf430273fca2
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:27:13 2005 -0700

    initial

diff --git a/file b/file
new file mode 100644
index 0000000..4b48dee
--- /dev/null
+++ b/file
@@ -0,0 +1 @@
+original
ok 44 - git log -c --follow

Recorded resolution for 'file'.
expecting success: 
	git log --graph --pretty=short --stat -p >actual &&
	sanitize_output >actual.sanitized <actual &&
	test_i18ncmp expect actual.sanitized

Applying: three
ok 9 - alias of an alias

expecting success: 
	git log --pretty=format:"Two %H" >expected &&
	git config pretty.duplicate "format:One %H" &&
	git config --add pretty.duplicate "format:Two %H" &&
	git log --pretty=duplicate >actual &&
	test_cmp expected actual

done.
HEAD is now at c2f509b other
ok 45 - log --graph with diff and stats

expecting success: 
	mkdir -p a/b &&
	( echo sixth && echo fifth ) >expect &&
	( cd a/b && git log --format=%s .. ) >actual &&
	test_cmp expect actual

Applying: two
ok 10 - alias masking an alias

expecting success: 
	git config pretty.test-foo test-bar &&
	git config pretty.test-bar test-foo &&
	test_must_fail git log --pretty=test-foo

ok 46 - dotdot is a parent directory

expecting success: 
	test_when_finished "git reset --hard && git checkout master" &&
	git checkout -b signed master &&
	echo foo >foo &&
	git add foo &&
	git commit -S -m signed_commit &&
	git log --graph --show-signature -n1 signed >actual &&
	grep "^| gpg: Signature made" actual &&
	grep "^| gpg: Good signature" actual

Using index info to reconstruct a base tree...
M	file
Falling back to patching base and 3-way merge...
Switched to a new branch 'signed'
fatal: invalid --pretty format: 'test-foo' references an alias which points to itself
ok 11 - alias loop

expecting success: 
	printf "add bar\0$(commit_msg)" >expected &&
	git log -z --pretty="format:%s" >actual &&
	test_cmp expected actual

Merging c2f509beb0aa46f31c580e447c76f6667aef49ca with two
Merging:
c2f509b other
virtual two
found 1 common ancestor:
virtual 693a3de402bb23897ed5c931273e53c78eff0495
Auto-merging file
CONFLICT (content): Merge conflict in file
Recorded preimage for 'file'
error: Failed to merge in the changes.
Patch failed at 0001 two
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
ok 12 - NUL separation

expecting success: 
	printf "add bar\0$(commit_msg)\0" >expected &&
	git log -z --pretty="tformat:%s" >actual &&
	test_cmp expected actual

ok 13 - NUL termination

expecting success: 
	stat0_part=$(git diff --stat HEAD^ HEAD) &&
	stat1_part=$(git diff-tree --no-commit-id --stat --root HEAD^) &&
	printf "add bar\n$stat0_part\n\0$(commit_msg)\n$stat1_part\n" >expected &&
	git log -z --stat --pretty="format:%s" >actual &&
	test_i18ncmp expected actual

Applying: three
Submodule path 'sub1': checked out '613068f76d422f07de14d59bca708cacb8bb3c5b'
Using index info to reconstruct a base tree...
M	file
[signed 9a53ca0] signed_commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
Falling back to patching base and 3-way merge...
Merging c2f509beb0aa46f31c580e447c76f6667aef49ca with three
Merging:
c2f509b other
virtual three
found 1 common ancestor:
virtual aad8d5cef3915ab78b3227abaaac99b62db9eb54
Auto-merging file
CONFLICT (content): Merge conflict in file
ok 14 - NUL separation with --stat

checking known breakage: 
	stat0_part=$(git diff --stat HEAD^ HEAD) &&
	stat1_part=$(git diff-tree --no-commit-id --stat --root HEAD^) &&
	printf "add bar\n$stat0_part\n\0$(commit_msg)\n$stat1_part\n0" >expected &&
	git log -z --stat --pretty="tformat:%s" >actual &&
	test_i18ncmp expected actual

Resolved 'file' using previous resolution.
error: Failed to merge in the changes.
Patch failed at 0002 three
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
ok 61 - am -3 works with rerere

expecting success: 
	rm -fr .git/rebase-apply &&
	git reset --hard &&
	echo signed >file &&
	git add file &&
	cat >msg <<-EOF &&
	subject here

	Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>
	[jc: tweaked log message]
	Signed-off-by: J C H <j@c.h>
	EOF
	git commit -F msg &&
	git cat-file commit HEAD | sed -e 1,/^$/d >original &&
	git format-patch --stdout -1 >patch &&

	git reset --hard HEAD^ &&
	git am -s patch &&
	(
		cat original &&
		echo "Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>"
	) >expect &&
	git cat-file commit HEAD | sed -e 1,/^$/d >actual &&
	test_cmp expect actual &&

	cat >msg <<-\EOF &&
	subject here

	We make sure that there is a blank line between the log
	message proper and Signed-off-by: line added.
	EOF
	git reset HEAD^ &&
	git commit -F msg file &&
	git cat-file commit HEAD | sed -e 1,/^$/d >original &&
	git format-patch --stdout -1 >patch &&

	git reset --hard HEAD^ &&
	git am -s patch &&

	(
		cat original &&
		echo &&
		echo "Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>"
	) >expect &&
	git cat-file commit HEAD | sed -e 1,/^$/d >actual &&
	test_cmp expect actual

| gpg: Signature made Wed Dec 16 10:57:54 2015 UTC using DSA key ID CDDE430D
| gpg: Good signature from "C O Mitter <committer@example.com>"
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
Binary files expected and actual differ
not ok 15 - NUL termination with --stat # TODO known breakage

expecting success: 
	test_commit "message one" one one message-one &&
	test_commit "message two" two two message-two &&
	head1=$(git rev-parse --verify --short HEAD~0) &&
	head2=$(git rev-parse --verify --short HEAD~1) &&
	head3=$(git rev-parse --verify --short HEAD~2) &&
	head4=$(git rev-parse --verify --short HEAD~3)

HEAD is now at 9a53ca0 signed_commit
HEAD is now at c2f509b other
warning: unable to rmdir sub1: Directory not empty
fatal: unable to write file 'sub1' mode 100644: Directory not empty
Switched to branch 'master'
ok 47 - log --graph --show-signature

expecting success: 
	test_when_finished "git reset --hard && git checkout master" &&
	git checkout -b plain master &&
	echo aaa >bar &&
	git add bar &&
	git commit -m bar_commit &&
	git checkout -b tagged master &&
	echo bbb >baz &&
	git add baz &&
	git commit -m baz_commit &&
	git tag -s -m signed_tag_msg signed_tag &&
	git checkout plain &&
	git merge --no-ff -m msg signed_tag &&
	git log --graph --show-signature -n1 plain >actual &&
	grep "^|\\\  merged tag" actual &&
	grep "^| | gpg: Signature made" actual &&
	grep "^| | gpg: Good signature" actual

[master 23ca4f5] message one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one
'actual' is not empty, it contains:
:100644 100644 1b52e94c4a64cb0f66e5ac63bf7612443af0bb91 0000000000000000000000000000000000000000 M	.gitmodules
Switched to a new branch 'plain'
[detached HEAD f3ca59f] subject here
 Author: Another Thor <a.thor@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[plain b631594] bar_commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bar
not ok 10 - apply_index: 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
		)
	
[master a015cbe] message two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two
HEAD is now at c2f509b other
Switched to a new branch 'tagged'
Applying: subject here
[tagged 018c3a1] baz_commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 baz
ok 16 - setup more commits

expecting success: 
	git log --pretty="tformat:%<(40)%s" >actual &&
	qz_to_tab_space <<EOF >expected &&
message two                            Z
message one                            Z
add bar                                Z
$(commit_msg)                    Z
EOF
	test_cmp expected actual

ok 17 - left alignment formatting

expecting success: 
	git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(40)%s" >actual &&
	qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
message two                            Z
message one                            Z
add bar                                Z
$(commit_msg)                    Z
EOF
	test_cmp expected actual

Cloning into 'submodule_update'...
Switched to branch 'plain'
ok 18 - left alignment formatting. i18n.logOutputEncoding

expecting success: 
	git log --pretty="tformat:%h %<|(40)%s" >actual &&
	qz_to_tab_space <<EOF >expected &&
$head1 message two                    Z
$head2 message one                    Z
$head3 add bar                        Z
$head4 $(commit_msg)            Z
EOF
	test_cmp expected actual

Unstaged changes after reset:
M	file
Merging:
b631594 bar_commit
virtual signed_tag
found 1 common ancestor:
8ef4f46 Merge tag 'reach'
Merge made by the 'recursive' strategy.
[detached HEAD 10af730] subject here
 Author: Another Thor <a.thor@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
 baz | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 baz
ok 19 - left alignment formatting at the nth column

expecting success: 
	git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%h %<|(40)%s" >actual &&
	qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
$head1 message two                    Z
$head2 message one                    Z
$head3 add bar                        Z
$head4 $(commit_msg)            Z
EOF
	test_cmp expected actual

done.
ok 20 - left alignment formatting at the nth column. i18n.logOutputEncoding

expecting success: 
	git log --pretty="tformat:%<(1)%s" >actual &&
	cat <<EOF >expected &&
message two
message one
add bar
$(commit_msg)
EOF
	test_cmp expected actual

HEAD is now at c2f509b other
|\  merged tag 'signed_tag'
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
| | gpg: Signature made Wed Dec 16 10:57:55 2015 UTC using DSA key ID CDDE430D
ok 21 - left alignment formatting with no padding

expecting success: 
	git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(1)%s" >actual &&
	cat <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
message two
message one
add bar
$(commit_msg)
EOF
	test_cmp expected actual

| | gpg: Good signature from "C O Mitter <committer@example.com>"
HEAD is now at c01f6b5 msg
Applying: subject here
ok 22 - left alignment formatting with no padding. i18n.logOutputEncoding

expecting success: 
	git log --pretty="tformat:%<(10,trunc)%s" >actual &&
	qz_to_tab_space <<EOF >expected &&
message ..
message ..
add bar  Z
initial...
EOF
	test_cmp expected actual

Switched to branch 'master'
ok 48 - log --graph --show-signature for merged tag

expecting success: 
	test_must_fail git log --graph --no-walk

fatal: cannot combine --no-walk with --graph
ok 49 - log --graph --no-walk is forbidden

ok 23 - left alignment formatting with trunc

expecting success: 
	git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(10,trunc)%s" >actual &&
	qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
message ..
message ..
add bar  Z
initial...
EOF
	test_cmp expected actual

expecting success: 
	git init empty &&
	test_must_fail git -C empty log 2>stderr &&
	test_i18ngrep does.not.have.any.commits stderr &&
	echo 1234abcd >empty/.git/refs/heads/master &&
	test_must_fail git -C empty log 2>stderr &&
	test_i18ngrep broken stderr &&
	echo "ref: refs/heads/invalid.lock" >empty/.git/HEAD &&
	test_must_fail git -C empty log 2>stderr &&
	test_i18ngrep broken stderr &&
	test_must_fail git -C empty log --default totally-bogus 2>stderr &&
	test_i18ngrep broken stderr

ok 62 - am -s unexpected trailer block

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4202-log/empty/.git/
# passed all 62 test(s)
ok 24 - left alignment formatting with trunc. i18n.logOutputEncoding

1..62
expecting success: 
	git log --pretty="tformat:%<(10,ltrunc)%s" >actual &&
	qz_to_tab_space <<EOF >expected &&
..sage two
..sage one
add bar  Z
..${sample_utf8_part}lich
EOF
	test_cmp expected actual

fatal: your current branch 'master' does not have any commits yet
ok 25 - left alignment formatting with ltrunc

expecting success: 
	git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(10,ltrunc)%s" >actual &&
	qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
..sage two
..sage one
add bar  Z
..${sample_utf8_part}lich
EOF
	test_cmp expected actual

fatal: your current branch appears to be broken
ok 26 - left alignment formatting with ltrunc. i18n.logOutputEncoding

expecting success: 
	git log --pretty="tformat:%<(10,mtrunc)%s" >actual &&
	qz_to_tab_space <<EOF >expected &&
mess.. two
mess.. one
add bar  Z
init..lich
EOF
	test_cmp expected actual

fatal: your current branch appears to be broken
fatal: your current branch appears to be broken
ok 50 - log diagnoses bogus HEAD

ok 27 - left alignment formatting with mtrunc

expecting success: 
	git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(10,mtrunc)%s" >actual &&
	qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
mess.. two
mess.. one
add bar  Z
init..lich
EOF
	test_cmp expected actual

# passed all 50 test(s)
1..50
*** t4206-log-follow-harder-copies.sh ***
ok 28 - left alignment formatting with mtrunc. i18n.logOutputEncoding

expecting success: 
	git log --pretty="tformat:%>(40)%s" >actual &&
	qz_to_tab_space <<EOF >expected &&
Z                            message two
Z                            message one
Z                                add bar
Z                    $(commit_msg)
EOF
	test_cmp expected actual

ok 29 - right alignment formatting

expecting success: 
	git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%>(40)%s" >actual &&
	qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
Z                            message two
Z                            message one
Z                                add bar
Z                    $(commit_msg)
EOF
	test_cmp expected actual

ok 30 - right alignment formatting. i18n.logOutputEncoding

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/submodule_update_repo/.) registered for path 'sub1'
expecting success: 
	git log --pretty="tformat:%h %>|(40)%s" >actual &&
	qz_to_tab_space <<EOF >expected &&
$head1                      message two
$head2                      message one
$head3                          add bar
$head4              $(commit_msg)
EOF
	test_cmp expected actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4206-log-follow-harder-copies/.git/
ok 31 - right alignment formatting at the nth column

expecting success: 
	git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%h %>|(40)%s" >actual &&
	qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
$head1                      message two
$head2                      message one
$head3                          add bar
$head4              $(commit_msg)
EOF
	test_cmp expected actual

expecting success: git add path0 &&
     git commit -m "Add path0"
ok 32 - right alignment formatting at the nth column. i18n.logOutputEncoding

expecting success: 
	git log --pretty="tformat:%>(1)%s" >actual &&
	cat <<EOF >expected &&
message two
message one
add bar
$(commit_msg)
EOF
	test_cmp expected actual

*** t4207-log-decoration-colors.sh ***
[master (root-commit) eed15de] Add path0
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+)
 create mode 100644 path0
ok 1 - add a file path0 and commit.

expecting success: git add path0 &&
     git commit -m "Change path0"
ok 33 - right alignment formatting with no padding

expecting success: 
	git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%>(1)%s" >actual &&
	cat <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
message two
message one
add bar
$(commit_msg)
EOF
	test_cmp expected actual

[master 6d19c7d] Change path0
 Author: A U Thor <author@example.com>
 1 file changed, 3 insertions(+), 3 deletions(-)
ok 2 - Change path0.

ok 34 - right alignment formatting with no padding. i18n.logOutputEncoding

expecting success: 
	git log --pretty="tformat:%><(40)%s" >actual &&
	qz_to_tab_space <<EOF >expected &&
Z             message two              Z
Z             message one              Z
Z               add bar                Z
Z         $(commit_msg)          Z
EOF
	test_cmp expected actual

expecting success: git add path1 &&
     git commit -m "Copy path1 from path0"
Cloning into 'sub1'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4207-log-decoration-colors/.git/
expecting success: 
	git config diff.color.commit yellow &&
	git config color.decorate.branch green &&
	git config color.decorate.remoteBranch red &&
	git config color.decorate.tag "reverse bold yellow" &&
	git config color.decorate.stash magenta &&
	git config color.decorate.HEAD cyan &&

	c_reset=$(get_color reset) &&

	c_commit=$(get_color yellow) &&
	c_branch=$(get_color green) &&
	c_remoteBranch=$(get_color red) &&
	c_tag=$(get_color "reverse bold yellow") &&
	c_stash=$(get_color magenta) &&
	c_HEAD=$(get_color cyan) &&

	test_commit A &&
	git clone . other &&
	(
		cd other &&
		test_commit A1
	) &&

	git remote add -f other ./other &&
	test_commit B &&
	git tag v1.0 &&
	echo >>A.t &&
	git stash save Changes to A.t

ok 35 - center alignment formatting

expecting success: 
	git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%><(40)%s" >actual &&
	qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
Z             message two              Z
Z             message one              Z
Z               add bar                Z
Z         $(commit_msg)          Z
EOF
	test_cmp expected actual

[master 0b2c349] Copy path1 from path0
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+)
 create mode 100644 path1
ok 3 - copy path0 to path1.

expecting success: git log --follow --name-status --pretty="format:%s"  path1 > current
done.
ok 4 - find the copy path0 -> path1 harder

ok 36 - center alignment formatting. i18n.logOutputEncoding

expecting success: 
	git log --pretty="tformat:%h %><|(40)%s" >actual &&
	qz_to_tab_space <<EOF >expected &&
$head1           message two          Z
$head2           message one          Z
$head3             add bar            Z
$head4       $(commit_msg)      Z
EOF
	test_cmp expected actual

expecting success: compare_diff_patch current expected
ok 5 - validate the output.

ok 37 - center alignment formatting at the nth column

expecting success: 
	git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%h %><|(40)%s" >actual &&
	qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
$head1           message two          Z
$head2           message one          Z
$head3             add bar            Z
$head4       $(commit_msg)      Z
EOF
	test_cmp expected actual

# passed all 5 test(s)
1..5
*** t4208-log-magic-pathspec.sh ***
ok 38 - center alignment formatting at the nth column. i18n.logOutputEncoding

expecting success: 
	git log --pretty="tformat:%><(1)%s" >actual &&
	cat <<EOF >expected &&
message two
message one
add bar
$(commit_msg)
EOF
	test_cmp expected actual

ok 39 - center alignment formatting with no padding

expecting success: 
	git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%><(1)%s" >actual &&
	cat <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
message two
message one
add bar
$(commit_msg)
EOF
	test_cmp expected actual

Submodule path 'sub1': checked out '613068f76d422f07de14d59bca708cacb8bb3c5b'
ok 40 - center alignment formatting with no padding. i18n.logOutputEncoding

expecting success: 
	git commit --amend -m short --author "long long long <long@me.com>" &&
	git log --pretty="tformat:%<(10,trunc)%s%>>(10,ltrunc)% an" >actual &&
	cat <<EOF >expected &&
short long  long long
message ..   A U Thor
add bar      A U Thor
initial...   A U Thor
EOF
	test_cmp expected actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4208-log-magic-pathspec/.git/
expecting success: 
	test_commit initial &&
	test_tick &&
	git commit --allow-empty -m empty &&
	mkdir sub

[master 2151238] short
 Author: long long long <long@me.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 two
[master (root-commit) 0ddfaf1] A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 A.t
Cloning into 'other'...
ok 41 - left/right alignment formatting with stealing

expecting success: 
	git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(10,trunc)%s%>>(10,ltrunc)% an" >actual &&
	cat <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
short long  long long
message ..   A U Thor
add bar      A U Thor
initial...   A U Thor
EOF
	test_cmp expected actual

[master (root-commit) 24b24cf] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 initial.t
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
ok 42 - left/right alignment formatting with stealing. i18n.logOutputEncoding

expecting success: 
	git log --color --pretty="tformat:%<(10,trunc)%s%>>(10,ltrunc)%C(auto)%d" |
		test_decode_color |
		nul_to_q >actual &&
	! grep Q actual

done.
[master 41d179c] empty
 Author: A U Thor <author@example.com>
ok 1 - setup

expecting success: 
	git log :/

ok 43 - strbuf_utf8_replace() not producing NUL

expecting success: 
	git log --format=%ai%n%ci |
	sed -e "s/ /T/; s/ //; s/..\$/:&/" >expected &&
	git log --format=%aI%n%cI >actual &&
	test_cmp expected actual

commit 24b24cf8a829f5b8c30dfc018b0a459a2ccaf380
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:13:13 2005 -0700

    initial
ok 2 - "git log :/" should not be ambiguous

expecting success: 
	: >a &&
	test_must_fail git log :/a 2>error &&
	grep ambiguous error

fatal: ambiguous argument ':/a': both revision and filename
ok 3 - "git log :/a" should be ambiguous (applied both rev and worktree)

expecting success: 
	git log :/a --

[master ca6ed14] A1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 A1.t
ok 44 - ISO and ISO-strict date formats display the same values

commit 24b24cf8a829f5b8c30dfc018b0a459a2ccaf380
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:13:13 2005 -0700

    initial
ok 4 - "git log :/a -- " should not be ambiguous

expecting success: 
	git log -- :/a

Updating other
expecting success: 
	git tag -a tag1 -m tag1 &&
	git tag -a tag2 -m tag2 tag1 &&
	git tag -d tag1 &&
	git commit --amend -m shorter &&
	git log --no-walk --tags --pretty="%H %d" --decorate=full >actual &&
	cat <<EOF >expected &&
$head1  (tag: refs/tags/tag2)
$head2  (tag: refs/tags/message-one)
$old_head1  (tag: refs/tags/message-two)
EOF
	sort actual >actual1 &&
	test_cmp expected actual1

warning: unable to rmdir sub1: Directory not empty
fatal: unable to write file 'sub1' mode 100644: Directory not empty
ok 5 - "git log -- :/a" should not be ambiguous

expecting success: 
	test_must_fail git log : 2>error &&
	grep ambiguous error

fatal: ambiguous argument ':': unknown revision or path not in the working tree.
ok 6 - "git log :" should be ambiguous

expecting success: 
	git log -- :

'actual' is not empty, it contains:
:100644 100644 1b52e94c4a64cb0f66e5ac63bf7612443af0bb91 0000000000000000000000000000000000000000 M	.gitmodules
commit 24b24cf8a829f5b8c30dfc018b0a459a2ccaf380
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:13:13 2005 -0700

    initial
ok 7 - git log -- :

expecting success: 
	cat >expected <<-EOF &&
	24b24cf initial
	EOF
	(cd sub && git log --oneline HEAD -- :/ >../actual) &&
	test_cmp expected actual

Deleted tag 'tag1' (was 3df4ac8)
[master e1fa287] shorter
 Author: long long long <long@me.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 two
not ok 11 - apply_index: 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 8 - git log HEAD -- :/

expecting success: 
	git reset --hard &&
	>a &&
	git add a &&
	git commit -m "add an empty a" --allow-empty &&
	echo 1 >a &&
	git commit -a -m "update a to 1" &&
	git checkout HEAD^ &&
	echo 2 >a &&
	git commit -a -m "update a to 2" &&
	test_must_fail git merge master &&
	git add a &&
	git log --merge -- a

From ./other
 * [new branch]      master     -> other/master
 * [new tag]         A1         -> A1
HEAD is now at 41d179c empty
ok 45 - log decoration properly follows tag chain

expecting success: 
	git log --no-walk --tags --pretty="%H %D" --decorate=full >actual &&
	cat >expected <<EOF &&
$head1 tag: refs/tags/tag2
$head2 tag: refs/tags/message-one
$old_head1 tag: refs/tags/message-two
EOF
	sort actual >actual1 &&
	test_cmp expected actual1

[master d9df450] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 B.t
[master 0ca6fcc] add an empty a
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 a
ok 46 - clean log decoration

# still have 1 known breakage(s)
# passed all remaining 45 test(s)
1..46
[master 4acae71] update a to 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
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 0ca6fcc... add an empty a
*** t4209-log-pickaxe.sh ***
[detached HEAD c8a70ef] update a to 2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Merging:
c8a70ef update a to 2
virtual master
found 1 common ancestor:
0ca6fcc add an empty a
Auto-merging a
CONFLICT (content): Merge conflict in a
Automatic merge failed; fix conflicts and then commit the result.
Cloning into 'submodule_update'...
commit c8a70ef8c7bc7d8aeda6d3f5d2aa59cc7f17cdf8
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:14:13 2005 -0700

    update a to 2

commit 4acae718c45c72a5699be1f80982e9c47273ab08
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:14:13 2005 -0700

    update a to 1
ok 9 - command line pathspec parsing for "git log"

# passed all 9 test(s)
1..9
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4209-log-pickaxe/.git/
done.
expecting success: 
	>expect_nomatch &&

	>file &&
	git add file &&
	test_tick &&
	git commit -m initial &&
	git rev-parse --verify HEAD >expect_initial &&

	echo Picked >file &&
	git add file &&
	test_tick &&
	git commit --author="Another Person <another@example.com>" -m second &&
	git rev-parse --verify HEAD >expect_second

*** t4210-log-i18n.sh ***
[master (root-commit) 1bd44cb] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
[master 64f6655] second
 Author: Another Person <another@example.com>
 1 file changed, 1 insertion(+)
ok 1 - setup

expecting success: 
		git log  --grep=initial --format=%H >actual &&
		test_cmp expect_initial actual
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4210-log-i18n/.git/
expecting success: 
	test_tick &&
	cat >msg <<-EOF &&
	utf8

	t${utf8_e}st
	EOF
	git add msg &&
	git -c i18n.commitencoding=utf8 commit -F msg &&
	cat >msg <<-EOF &&
	latin1

	t${latin1_e}st
	EOF
	git add msg &&
	git -c i18n.commitencoding=ISO-8859-1 commit -F msg

ok 2 - log --grep (match)

expecting success: 
		git log  --grep=InItial --format=%H >actual &&
		test_cmp expect_nomatch actual
	
ok 3 - log --grep (nomatch)

expecting success: 
		git log --regexp-ignore-case --grep=InItial --format=%H >actual &&
		test_cmp expect_initial actual
	
Saved working directory and index state On master: Changes to A.t
ok 4 - log --grep --regexp-ignore-case (match)

expecting success: 
		git log -i --grep=InItial --format=%H >actual &&
		test_cmp expect_initial actual
	
[master (root-commit) cbf2796] utf8
 Author: A U Thor <author@example.com>
 1 file changed, 3 insertions(+)
 create mode 100644 msg
HEAD is now at d9df450 B
ok 5 - log --grep -i (match)

expecting success: 
		git log --regexp-ignore-case --grep=initail --format=%H >actual &&
		test_cmp expect_nomatch actual
	
ok 1 - setup

expecting success: 
	git log --first-parent --abbrev=10 --all --decorate --oneline --color=always |
	sed "s/[0-9a-f]\{10,10\}/COMMIT_ID/" >out &&
	test_cmp expected out

ok 6 - log --grep --regexp-ignore-case (nomatch)

expecting success: 
		git log -i --grep=initail --format=%H >actual &&
		test_cmp expect_nomatch actual
	
[master b077cf9] latin1
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+), 2 deletions(-)
ok 1 - create commits in different encodings

expecting success: 
	cat >expect <<-\EOF &&
	latin1
	utf8
	EOF
	git log --encoding=utf8 --format=%s --grep=$utf8_e >actual &&
	test_cmp expect actual

ok 2 - Commit Decorations Colored Correctly

ok 7 - log --grep -i (nomatch)

expecting success: 
		git log  --author=Person --format=%H >actual &&
		test_cmp expect_second actual
	
# passed all 2 test(s)
1..2
ok 2 - log --grep searches in log output encoding (utf8)

expecting success: 
	cat >expect <<-\EOF &&
	latin1
	utf8
	EOF
	git log --encoding=ISO-8859-1 --format=%s --grep=$latin1_e >actual &&
	test_cmp expect actual

ok 8 - log --author (match)

expecting success: 
		git log  --author=person --format=%H >actual &&
		test_cmp expect_nomatch actual
	
ok 9 - log --author (nomatch)
ok 3 - log --grep searches in log output encoding (latin1)


expecting success: 
		git log --regexp-ignore-case --author=person --format=%H >actual &&
		test_cmp expect_second actual
	
expecting success: 
	>expect &&
	git log --encoding=utf8 --format=%s --grep=$latin1_e >actual &&
	test_cmp expect actual

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 10 - log --author --regexp-ignore-case (match)

expecting success: 
		git log -i --author=person --format=%H >actual &&
		test_cmp expect_second actual
	
*** t4211-line-log.sh ***
ok 4 - log --grep does not find non-reencoded values (utf8)

expecting success: 
	>expect &&
	git log --encoding=ISO-8859-1 --format=%s --grep=$utf8_e >actual &&
	test_cmp expect actual

ok 11 - log --author -i (match)

expecting success: 
		git log --regexp-ignore-case --author=spreon --format=%H >actual &&
		test_cmp expect_nomatch actual
	
ok 5 - log --grep does not find non-reencoded values (latin1)

# passed all 5 test(s)
1..5
ok 12 - log --author --regexp-ignore-case (nomatch)

expecting success: 
		git log -i --author=spreon --format=%H >actual &&
		test_cmp expect_nomatch actual
	
ok 13 - log --author -i (nomatch)

expecting success: 
		git log  -Gpicked --format=%H >actual &&
		test_cmp expect_nomatch actual
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4211-line-log/.git/
*** t4212-log-corrupt.sh ***
expecting success: 
	git fast-import < "$TEST_DIRECTORY"/t4211/history.export &&
	git reset --hard

ok 14 - log -G (nomatch)

expecting success: 
		git log  -GPicked --format=%H >actual &&
		test_cmp expect_second actual
	
Cloning into 'sub1'...
ok 15 - log -G (match)

expecting success: 
		git log --regexp-ignore-case -Gpickle --format=%H >actual &&
		test_cmp expect_nomatch actual
	
ok 16 - log -G --regexp-ignore-case (nomatch)

expecting success: 
		git log -i -Gpickle --format=%H >actual &&
		test_cmp expect_nomatch actual
	
ok 17 - log -G -i (nomatch)

expecting success: 
		git log --regexp-ignore-case -Gpicked --format=%H >actual &&
		test_cmp expect_second actual
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4212-log-corrupt/.git/
done.
expecting success: 
	test_commit foo &&

	git cat-file commit HEAD |
	sed "/^author /s/>/>-<>/" >broken_email.commit &&
	git hash-object -w -t commit broken_email.commit >broken_email.hash &&
	git update-ref refs/heads/broken_email $(cat broken_email.hash)

ok 18 - log -G --regexp-ignore-case (match)

expecting success: 
		git log -i -Gpicked --format=%H >actual &&
		test_cmp expect_second actual
	
ok 19 - log -G -i (match)

expecting success: 
	echo "* diff=test" >.gitattributes &&
	test_must_fail git -c diff.test.textconv=missing log -Gfoo &&
	rm .gitattributes

[master (root-commit) ddd63c9] foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo.t
error: cannot run missing: No such file or directory
fatal: unable to read files to diff
ok 20 - log -G --textconv (missing textconv tool)

expecting success: 
	echo "* diff=test" >.gitattributes &&
	git -c diff.test.textconv=missing log -Gfoo --no-textconv >actual &&
	test_cmp expect_nomatch actual &&
	rm .gitattributes

ok 21 - log -G --no-textconv (missing textconv tool)

expecting success: 
		git log  -Spicked --format=%H >actual &&
		test_cmp expect_nomatch actual
	
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:           35 (         0 duplicates                  )
      blobs  :           11 (         0 duplicates         10 deltas of         11 attempts)
      trees  :           12 (         0 duplicates          0 deltas of         12 attempts)
      commits:           12 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           4 (         4 loads     )
      marks:           1024 (        23 unique    )
      atoms:              2
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =         14
pack_report: pack_mmap_calls          =          5
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =       3020 /       3020
---------------------------------------------------------------------

ok 22 - log -S (nomatch)

expecting success: 
		git log  -SPicked --format=%H >actual &&
		test_cmp expect_second actual
	
HEAD is now at 0d8dcfc move within the file
ok 1 - setup

expecting success: 
	test_must_fail git fsck 2>actual &&
	test_i18ngrep invalid.author actual

ok 1 - setup (import history)

expecting success: 
		git log -L 4,12:a.c simple >actual &&
		test_cmp "$TEST_DIRECTORY"/t4211/expect.simple-f actual
	
ok 23 - log -S (match)

expecting success: 
		git log --regexp-ignore-case -Spicked --format=%H >actual &&
		test_cmp expect_second actual
	
ok 2 - -L 4,12:a.c simple

expecting success: 
		git log -L 4,+9:a.c simple >actual &&
		test_cmp "$TEST_DIRECTORY"/t4211/expect.simple-f actual
	
error in commit fb99366eaec195640f250774fc94d75e4f06f441: missingSpaceBeforeDate: invalid author/committer line - missing space before date
ok 2 - fsck notices broken commit

expecting success: 
	{
		echo commit $(cat broken_email.hash)
		echo "Author: A U Thor <author@example.com>"
		echo "Date:   Thu Apr 7 15:13:13 2005 -0700"
		echo
		echo "    foo"
	} >expect.out &&
	: >expect.err &&

	git log broken_email >actual.out 2>actual.err &&

	test_cmp expect.out actual.out &&
	test_cmp expect.err actual.err

ok 24 - log -S --regexp-ignore-case (match)

expecting success: 
		git log -i -Spicked --format=%H >actual &&
		test_cmp expect_second actual
	
Submodule path 'sub1': checked out '613068f76d422f07de14d59bca708cacb8bb3c5b'
ok 3 - -L 4,+9:a.c simple

expecting success: 
		git log -L '/long f/,/^}/:a.c' simple >actual &&
		test_cmp "$TEST_DIRECTORY"/t4211/expect.simple-f actual
	
ok 25 - log -S -i (match)

expecting success: 
		git log --regexp-ignore-case -Spickle --format=%H >actual &&
		test_cmp expect_nomatch actual
	
ok 3 - git log with broken author email

expecting success: 
	echo "A U Thor+author@example.com+Thu Apr 7 15:13:13 2005 -0700" >expect.out &&
	: >expect.err &&

	git log --format="%an+%ae+%ad" broken_email >actual.out 2>actual.err &&

	test_cmp expect.out actual.out &&
	test_cmp expect.err actual.err

ok 4 - -L '/long f/,/^}/:a.c' simple

expecting success: 
		git log -L :f:a.c simple >actual &&
		test_cmp "$TEST_DIRECTORY"/t4211/expect.simple-f-to-main actual
	
ok 26 - log -S --regexp-ignore-case (nomatch)

expecting success: 
		git log -i -Spickle --format=%H >actual &&
		test_cmp expect_nomatch actual
	
ok 4 - git log --format with broken author email

expecting success: 
	commit=$(munge_author_date HEAD totally_bogus) &&
	echo "Date:   Thu Jan 1 00:00:00 1970 +0000" >expect &&
	git log -1 $commit >actual.full &&
	grep Date <actual.full >actual &&
	test_cmp expect actual

ok 5 - -L :f:a.c simple

expecting success: 
		git log -L '/main/,/^}/:a.c' simple >actual &&
		test_cmp "$TEST_DIRECTORY"/t4211/expect.simple-main actual
	
ok 27 - log -S -i (nomatch)

expecting success: 
		git log --pickaxe-regex -Sp.cked --format=%H >actual &&
		test_cmp expect_nomatch actual
	
ok 6 - -L '/main/,/^}/:a.c' simple

expecting success: 
		git log -L :main:a.c simple >actual &&
		test_cmp "$TEST_DIRECTORY"/t4211/expect.simple-main-to-end actual
	
ok 28 - log -S --pickaxe-regex (nomatch)

expecting success: 
		git log --pickaxe-regex -SP.cked --format=%H >actual &&
		test_cmp expect_second actual
	
Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
warning: unable to rmdir sub1: Directory not empty
ok 7 - -L :main:a.c simple

ok 29 - log -S --pickaxe-regex (match)

expecting success: 
		git log -L 1,+4:a.c simple >actual &&
		test_cmp "$TEST_DIRECTORY"/t4211/expect.beginning-of-file actual
	
expecting success: 
		git log --pickaxe-regex --regexp-ignore-case -Sp.cked --format=%H >actual &&
		test_cmp expect_second actual
	
ok 5 - unparsable dates produce sentinel value

expecting success: 
	commit=$(munge_author_date HEAD totally_bogus) &&
	echo >expect &&
	git log -1 --format=%ad $commit >actual &&
	test_cmp expect actual

ok 30 - log -S --pickaxe-regex --regexp-ignore-case (match)

expecting success: 
		git log --pickaxe-regex -i -Sp.cked --format=%H >actual &&
		test_cmp expect_second actual
	
ok 8 - -L 1,+4:a.c simple

expecting success: 
		git log -L 20:a.c simple >actual &&
		test_cmp "$TEST_DIRECTORY"/t4211/expect.end-of-file actual
	
ok 31 - log -S --pickaxe-regex -i (match)

expecting success: 
		git log --pickaxe-regex --regexp-ignore-case -Sp.ckle --format=%H >actual &&
		test_cmp expect_nomatch actual
	
ok 9 - -L 20:a.c simple

expecting success: 
		git log -L '/long f/',/^}/:a.c -L /main/,/^}/:a.c simple >actual &&
		test_cmp "$TEST_DIRECTORY"/t4211/expect.two-ranges actual
	
ok 32 - log -S --pickaxe-regex --regexp-ignore-case (nomatch)

expecting success: 
		git log --pickaxe-regex -i -Sp.ckle --format=%H >actual &&
		test_cmp expect_nomatch actual
	
ok 6 - unparsable dates produce sentinel value (%ad)

expecting success: 
	commit=$(munge_author_date HEAD 18446744073709551617) &&
	echo "Thu Jan 1 00:00:00 1970 +0000" >expect &&
	git log -1 --format=%ad $commit >actual &&
	test_cmp expect actual

ok 10 - -L '/long f/',/^}/:a.c -L /main/,/^}/:a.c simple

expecting success: 
		git log -L 24,+1:a.c simple >actual &&
		test_cmp "$TEST_DIRECTORY"/t4211/expect.vanishes-early actual
	
ok 33 - log -S --pickaxe-regex -i (nomatch)

expecting success: 
	echo "* diff=test" >.gitattributes &&
	test_must_fail git -c diff.test.textconv=missing log -Sfoo &&
	rm .gitattributes

ok 11 - -L 24,+1:a.c simple

expecting success: 
		git log -M -L '/long f/,/^}/:b.c' move-support >actual &&
		test_cmp "$TEST_DIRECTORY"/t4211/expect.move-support-f actual
	
error: cannot run missing: No such file or directory
fatal: unable to read files to diff
ok 34 - log -S --textconv (missing textconv tool)

expecting success: 
	echo "* diff=test" >.gitattributes &&
	git -c diff.test.textconv=missing log -Sfoo --no-textconv >actual &&
	test_cmp expect_nomatch actual &&
	rm .gitattributes

ok 7 - date parser recognizes integer overflow

expecting success: 
	commit=$(munge_author_date HEAD 18446744073709551614) &&
	echo "Thu Jan 1 00:00:00 1970 +0000" >expect &&
	git log -1 --format=%ad $commit >actual &&
	test_cmp expect actual

ok 12 - -M -L '/long f/,/^}/:b.c' move-support

expecting success: 
		git log -M -L ':f:b.c' parallel-change >actual &&
		test_cmp "$TEST_DIRECTORY"/t4211/expect.parallel-change-f-to-main actual
	
ok 35 - log -S --no-textconv (missing textconv tool)

# passed all 35 test(s)
1..35
ok 13 - -M -L ':f:b.c' parallel-change

expecting success: 
		git log -L 4,12:a.c -L :main:a.c simple >actual &&
		test_cmp "$TEST_DIRECTORY"/t4211/expect.multiple actual
	
*** t4252-am-options.sh ***
ok 14 - -L 4,12:a.c -L :main:a.c simple

expecting success: 
		git log -L 4,18:a.c -L ^:main:a.c simple >actual &&
		test_cmp "$TEST_DIRECTORY"/t4211/expect.multiple-overlapping actual
	
ok 8 - date parser recognizes time_t overflow

expecting success: 
	commit=$(munge_author_date HEAD 999999999999999999) &&
	git log -1 --format=%ad $commit

ok 15 - -L 4,18:a.c -L ^:main:a.c simple

expecting success: 
		git log -L :main:a.c -L 4,18:a.c simple >actual &&
		test_cmp "$TEST_DIRECTORY"/t4211/expect.multiple-overlapping actual
	
Thu Jan 1 00:00:00 1970 +0000
ok 16 - -L :main:a.c -L 4,18:a.c simple

expecting success: 
		git log -L 4:a.c -L 8,12:a.c simple >actual &&
		test_cmp "$TEST_DIRECTORY"/t4211/expect.multiple-superset actual
	
ok 9 - absurdly far-in-future date

# passed all 9 test(s)
1..9
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4252-am-options/.git/
ok 17 - -L 4:a.c -L 8,12:a.c simple

expecting success: 
		git log -L 8,12:a.c -L 4:a.c simple >actual &&
		test_cmp "$TEST_DIRECTORY"/t4211/expect.multiple-superset actual
	
expecting success: 
	cp "$tm/file-1-0" file-1 &&
	cp "$tm/file-2-0" file-2 &&
	git add file-1 file-2 &&
	test_tick &&
	git commit -m initial &&
	git tag initial

*** t4253-am-keep-cr-dos.sh ***
ok 18 - -L 8,12:a.c -L 4:a.c simple

expecting success: 
		test_must_fail git log -L 2>errors &&
		grep 'switch.*requires a value' errors
	
error: switch `L' requires a value
ok 19 - invalid args: -L

expecting success: 
		test_must_fail git log -L b.c 2>errors &&
		grep 'argument not .start,end:file' errors
	
[master (root-commit) f06d5e1] initial
 Author: A U Thor <author@example.com>
 2 files changed, 14 insertions(+)
 create mode 100644 file-1
 create mode 100644 file-2
ok 1 - setup

expecting success: 
	rm -rf .git/rebase-apply &&
	git reset --hard initial &&
	test_must_fail git am --whitespace=fix "$tm"/am-test-1-? &&
	git am --skip &&
	grep 3 file-1 &&
	grep "^Six$" file-2

fatal: -L argument not 'start,end:file' or ':funcname:file': b.c
ok 20 - invalid args: -L b.c

expecting success: 
		test_must_fail git log -L 1: 2>errors &&
		grep 'argument not .start,end:file' errors
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4253-am-keep-cr-dos/.git/
HEAD is now at f06d5e1 initial
Submodule path 'sub1': checked out '5cc407e1d291a6ad6718e3f1e88fdaa4cc2b4ddd'
fatal: -L argument not 'start,end:file' or ':funcname:file': 1:
ok 21 - invalid args: -L 1:

expecting success: 
		test_must_fail git log -L 1:nonexistent 2>errors &&
		grep 'There is no path' errors
	
expecting success: 
	append_cr <file1 >file &&
	git add file &&
	git commit -m Initial &&
	git tag initial &&
	append_cr <file2 >file &&
	git commit -a -m Second &&
	append_cr <file3 >file &&
	git commit -a -m Third

Applying: Three
fatal: There is no path nonexistent in the commit
ok 22 - invalid args: -L 1:nonexistent

expecting success: 
		test_must_fail git log -L 1:simple 2>errors &&
		grep 'There is no path' errors
	
.git/rebase-apply/patch:9: trailing whitespace.
Three 
error: patch failed: file-1:1
error: file-1: patch does not apply
Patch failed at 0001 Three
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
fatal: There is no path simple in the commit
ok 23 - invalid args: -L 1:simple

expecting success: 
		test_must_fail git log -L '/foo:b.c' 2>errors &&
		grep 'argument not .start,end:file' errors
	
[master (root-commit) 28ca046] Initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
fatal: -L argument not 'start,end:file' or ':funcname:file': /foo:b.c
Applying: Six
ok 24 - invalid args: -L '/foo:b.c'

expecting success: 
		test_must_fail git log -L 1000:b.c 2>errors &&
		grep 'has only.*lines' errors
	
.git/rebase-apply/patch:13: trailing whitespace.
Six 
ok 12 - apply_index: 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
		)
	
warning: 1 line applied after fixing whitespace errors.
fatal: file b.c has only 26 lines
ok 25 - invalid args: -L 1000:b.c

expecting success: 
		test_must_fail git log -L 1,1000:b.c 2>errors &&
		grep 'has only.*lines' errors
	
3
fatal: file b.c has only 26 lines
ok 26 - invalid args: -L 1,1000:b.c

expecting success: 
		test_must_fail git log -L :b.c 2>errors &&
		grep 'argument not .start,end:file' errors
	
[master d4dd81d] Second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Six
ok 2 - interrupted am --whitespace=fix

expecting success: 
	rm -rf .git/rebase-apply &&
	git reset --hard initial &&
	test_must_fail git am -C1 "$tm"/am-test-2-? &&
	git am --skip &&
	grep 3 file-1 &&
	grep "^Three$" file-2

fatal: -L argument not 'start,end:file' or ':funcname:file': :b.c
ok 27 - invalid args: -L :b.c

expecting success: 
		test_must_fail git log -L :foo:b.c 2>errors &&
		grep 'no match' errors
	
HEAD is now at f06d5e1 initial
[master 55b9e8d] Third
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 1 - setup repository with dos files

expecting success: 
	git checkout -b dosfiles initial &&
	git format-patch -k initial..master &&
	test_must_fail git am -k -3 000*.patch &&
	git am --abort &&
	rm -rf .git/rebase-apply 000*.patch

fatal: -L parameter 'foo' starting at line 1: no match
ok 28 - invalid args: -L :foo:b.c

expecting success: 
	n=$(wc -l <b.c) &&
	git log -L $n:b.c

Switched to a new branch 'dosfiles'
Applying: Three
Cloning into 'submodule_update'...
commit 0d8dcfc6b968e06a27d5215bad1fdde3de9d6235
Author: Thomas Rast <trast@student.ethz.ch>
Date:   Thu Feb 28 10:50:24 2013 +0100

    move within the file

diff --git a/b.c b/b.c
--- a/b.c
+++ b/b.c
@@ -25,0 +26,1 @@
+}
ok 29 - -L X (X == nlines)

expecting success: 
	n=$(expr $(wc -l <b.c) + 1) &&
	test_must_fail git log -L $n:b.c

.git/rebase-apply/patch:9: trailing whitespace.
Three 
error: patch failed: file-1:1
error: file-1: patch does not apply
Patch failed at 0001 Three
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
0001-Second.patch
0002-Third.patch
fatal: file b.c has only 26 lines
ok 30 - -L X (X == nlines + 1)

expecting success: 
	n=$(expr $(wc -l <b.c) + 2) &&
	test_must_fail git log -L $n:b.c

Applying: Six
fatal: file b.c has only 26 lines
ok 31 - -L X (X == nlines + 2)

expecting success: 
	n=$(printf "%d" $(wc -l <b.c)) &&
	git log -L ,$n:b.c

Context reduced to (1/1) to apply fragment at 2
done.
Applying: Second
commit 0d8dcfc6b968e06a27d5215bad1fdde3de9d6235
Author: Thomas Rast <trast@student.ethz.ch>
Date:   Thu Feb 28 10:50:24 2013 +0100

    move within the file

diff --git a/b.c b/b.c
--- a/b.c
+++ b/b.c
@@ -1,24 +1,26 @@
 #include <unistd.h>
 #include <stdio.h>
 
-long f(long x)
-{
-	int s = 0;
-	while (x) {
-		x /= 2;
-		s++;
-	}
-	return s;
-}
+long f(long x);
 
 /*
  * This is only an example!
  */
 
 int main ()
 {
 	printf("%ld\n", f(15));
 	return 0;
 }
 
 /* incomplete lines are bad! */
+
+long f(long x)
+{
+	int s = 0;
+	while (x) {
+		x /= 2;
+		s++;
+	}
+	return s;
+}

commit 6ce3c4ff690136099bb17e1a8766b75764726ea7
Author: Thomas Rast <trast@student.ethz.ch>
Date:   Thu Feb 28 10:49:50 2013 +0100

    another simple change

diff --git a/b.c b/b.c
--- a/b.c
+++ b/b.c
@@ -1,24 +1,24 @@
 #include <unistd.h>
 #include <stdio.h>
 
 long f(long x)
 {
 	int s = 0;
 	while (x) {
-		x >>= 1;
+		x /= 2;
 		s++;
 	}
 	return s;
 }
 
 /*
  * This is only an example!
  */
 
 int main ()
 {
 	printf("%ld\n", f(15));
 	return 0;
 }
 
 /* incomplete lines are bad! */

commit e6da343666244ea9e67cbe3f3bd26da860f9fe0e
Author: Thomas Rast <trast@student.ethz.ch>
Date:   Thu Feb 28 10:49:28 2013 +0100

    move file

diff --git a/b.c b/b.c
--- /dev/null
+++ b/b.c
@@ -0,0 +1,24 @@
+#include <unistd.h>
+#include <stdio.h>
+
+long f(long x)
+{
+	int s = 0;
+	while (x) {
+		x >>= 1;
+		s++;
+	}
+	return s;
+}
+
+/*
+ * This is only an example!
+ */
+
+int main ()
+{
+	printf("%ld\n", f(15));
+	return 0;
+}
+
+/* incomplete lines are bad! */
ok 32 - -L ,Y (Y == nlines)

expecting success: 
	n=$(expr $(wc -l <b.c) + 1) &&
	test_must_fail git log -L ,$n:b.c

Using index info to reconstruct a base tree...
fatal: file b.c has only 26 lines
ok 33 - -L ,Y (Y == nlines + 1)

expecting success: 
	n=$(expr $(wc -l <b.c) + 2) &&
	test_must_fail git log -L ,$n:b.c

3
Three
ok 3 - interrupted am -C1

expecting success: 
	rm -rf .git/rebase-apply &&
	git reset --hard initial &&
	test_must_fail git am -p2 "$tm"/am-test-3-? &&
	git am --skip &&
	grep 3 file-1 &&
	grep "^Three$" file-2

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
error: patch failed: file:1
error: file: patch does not apply
error: Did you hand edit your patch?
It does not apply to blobs recorded in its index.
Patch failed at 0001 Second
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
fatal: file b.c has only 26 lines
ok 34 - -L ,Y (Y == nlines + 2)

expecting success: 
	git checkout parallel-change &&
	git log --first-parent -L 1,1:b.c

HEAD is now at f06d5e1 initial
Switched to branch 'parallel-change'
ok 2 - am with dos files without --keep-cr

expecting success: 
	git checkout -b dosfiles-keep-cr initial &&
	git format-patch -k --stdout initial..master | git am --keep-cr -k -3 &&
	git diff --exit-code master

commit 0469c60bc4837d52d97b1f081dec5f98dea20fed
Author: Thomas Rast <trast@inf.ethz.ch>
Date:   Fri Apr 12 16:16:24 2013 +0200

    Merge across the rename

ok 35 - -L with --first-parent and a merge

Applying: Three
# passed all 35 test(s)
1..35
Switched to a new branch 'dosfiles-keep-cr'
.git/rebase-apply/patch:9: trailing whitespace.
Three 
error: patch failed: file-1:1
error: file-1: patch does not apply
Patch failed at 0001 Three
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
*** t4254-am-corrupt.sh ***
Applying: Six
Applying: Second
Applying: Third
3
Three
ok 4 - interrupted am -p2

expecting success: 
	rm -rf .git/rebase-apply &&
	git reset --hard initial &&
	test_must_fail git am -p2 -C1 "$tm"/am-test-4-? &&
	git am --skip &&
	grep 3 file-1 &&
	grep "^Three$" file-2

HEAD is now at f06d5e1 initial
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4254-am-corrupt/.git/
ok 3 - am with dos files with --keep-cr

expecting success: 
	git config am.keepcr 1 &&
	git checkout -b dosfiles-conf-keepcr initial &&
	git format-patch -k --stdout initial..master | git am -k -3 &&
	git diff --exit-code master

expecting success: 
	# Note the missing "+++" line:
	cat >bad-patch.diff <<-\EOF &&
	From: A U Thor <au.thor@example.com>
	diff --git a/f b/f
	index 7898192..6178079 100644
	--- a/f
	@@ -1 +1 @@
	-a
	+b
	EOF

	echo a >f &&
	git add f &&
	test_tick &&
	git commit -m initial

Applying: Three
Switched to a new branch 'dosfiles-conf-keepcr'
.git/rebase-apply/patch:9: trailing whitespace.
Three 
error: patch failed: file-1:1
error: file-1: patch does not apply
Patch failed at 0001 Three
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
[master (root-commit) 07398d1] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 f
ok 1 - setup

expecting success: 
	test_must_fail git am bad-patch.diff 2>actual

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/submodule_update_repo/.) registered for path 'sub1'
Applying: Six
Applying: Second
Context reduced to (1/1) to apply fragment at 2
Applying: 
Patch failed at 0001 
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
ok 2 - try to apply corrupted patch

expecting success: 
	echo "fatal: git diff header lacks filename information (line 4)" >expected &&
	test_path_is_file f &&
	test_cmp expected actual

Applying: Third
ok 3 - compare diagnostic; ensure file is still here

3
Three
# passed all 3 test(s)
ok 5 - interrupted am -C1 -p2
1..3

expecting success: 
	rm -rf .git/rebase-apply &&
	git reset --hard initial &&
	test_must_fail git am --directory="frotz nitfol" "$tm"/am-test-5-? &&
	git am --skip &&
	grep One "frotz nitfol/file-5"

HEAD is now at f06d5e1 initial
*** t4255-am-submodule.sh ***
ok 4 - am with dos files config am.keepcr

expecting success: 
	git config am.keepcr 1 &&
	git checkout -b dosfiles-conf-keepcr-override initial &&
	git format-patch -k initial..master &&
	test_must_fail git am -k -3 --no-keep-cr 000*.patch &&
	git am --abort &&
	rm -rf .git/rebase-apply 000*.patch

Applying: Six
error: frotz nitfol/junk/file-2: does not exist in index
Patch failed at 0001 Six
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Switched to a new branch 'dosfiles-conf-keepcr-override'
Cloning into 'sub1'...
0001-Second.patch
0002-Third.patch
Applying: Six
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/.git/
done.
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
		)
	
Applying: Second
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule_update_repo/.git/
One
Using index info to reconstruct a base tree...
ok 6 - interrupted am --directory="frotz nitfol"

expecting success: 
	with_sq="with'sq" &&
	rm -fr .git/rebase-apply &&
	git reset --hard initial &&
	git am --directory="$with_sq" "$tm"/am-test-5-2 &&
	test -f "$with_sq/file-5"

error: patch failed: file:1
error: file: patch does not apply
error: Did you hand edit your patch?
It does not apply to blobs recorded in its index.
Patch failed at 0001 Second
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
HEAD is now at f06d5e1 initial
[master (root-commit) 912f7e7] 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
ok 5 - am with dos files config am.keepcr overridden by --no-keep-cr

expecting success: 
	git checkout -b dosfiles-keep-cr-continue initial &&
	git format-patch -k initial..master &&
	append_cr <file1a >file &&
	git commit -m "different patch" file &&
	test_must_fail git am --keep-cr -k -3 000*.patch &&
	append_cr <file2 >file &&
	git add file &&
	git am -3 --resolved &&
	git diff --exit-code master

Applying: Six
Switched to a new branch 'dosfiles-keep-cr-continue'
Switched to a new branch 'add_sub1'
0001-Second.patch
0002-Third.patch
ok 7 - apply to a funny path

expecting success: 
	rm -rf .git/rebase-apply &&
	git reset --hard initial &&
	test_must_fail git am --reject "$tm"/am-test-6-1 &&
	grep "@@ -1,3 +1,3 @@" file-2.rej &&
	test_must_fail git diff-files --exit-code --quiet file-2 &&
	grep "[-]-reject" .git/rebase-apply/apply-opt

Submodule path 'sub1': checked out '613068f76d422f07de14d59bca708cacb8bb3c5b'
[dosfiles-keep-cr-continue 9ff54d7] different patch
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
HEAD is now at f06d5e1 initial
Applying: Second
Applying: Huh
Using index info to reconstruct a base tree...
M	file
Checking patch file-2...
error: while searching for:
0
2
3

error: patch failed: file-2:1
Applying patch file-2 with 1 reject...
Rejected hunk #1.
.git/rebase-apply/patch:11: trailing whitespace.
line 2
Hunk #2 applied cleanly.
warning: 1 line adds whitespace errors.
Patch failed at 0001 Huh
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Falling back to patching base and 3-way merge...
@@ -1,3 +1,3 @@
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
Merging 9ff54d7f92806f45bc4d1b032adc4d795e1add02 with Second
Merging:
9ff54d7 different patch
virtual Second
found 1 common ancestor:
virtual 0626bbef2b13f86fc002fb580ec5fac3fd75fa44
Auto-merging file
CONFLICT (content): Merge conflict in file
error: Failed to merge in the changes.
Patch failed at 0001 Second
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
 '--reject'
ok 8 - am --reject

warning: unable to rmdir sub1: Directory not empty
# passed all 8 test(s)
1..8
Cloning into 'sub1'...
Applying: Second
Applying: Third
done.
*** t4300-merge-tree.sh ***
ok 6 - am with dos files with --keep-cr continue

expecting success: 
	git config am.keepcr 1 &&
	git checkout -b unixfiles-conf-keepcr-override initial &&
	cp -f file1 file &&
	git commit -m "line ending to unix" file &&
	git format-patch -k initial..master &&
	git am -k -3 --no-keep-cr 000*.patch &&
	git diff --exit-code -w master

Switched to a new branch 'unixfiles-conf-keepcr-override'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4300-merge-tree/.git/
expecting success: 
	test_commit "initial" "initial-file" "initial"

[unixfiles-conf-keepcr-override eb2d79f] line ending to unix
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
0001-Second.patch
0002-Third.patch
[master (root-commit) c1d16d8] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 initial-file
ok 1 - setup

expecting success: 
	cat >expected <<\EXPECTED &&
added in remote
  their  100644 43d5a8ed6ef6c00ff775008633f95787d088285d ONE
@@ -0,0 +1 @@
+AAA
EXPECTED

	git reset --hard initial &&
	test_commit "add-a-not-b" "ONE" "AAA" &&
	git merge-tree initial initial add-a-not-b >actual &&
	test_cmp expected actual

Applying: Second
HEAD is now at c1d16d8 initial
[add_sub1 9a6c3e9] Add sub1
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
Applying: Third
Switched to a new branch 'remove_sub1'
[master e55b628] add-a-not-b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 ONE
Removing sub1
Removing .gitmodules
[remove_sub1 ca1d880] Revert "Add sub1"
 Author: A U Thor <author@example.com>
 2 files changed, 5 deletions(-)
 delete mode 100644 .gitmodules
 delete mode 160000 sub1
ok 7 - am with unix files config am.keepcr overridden by --no-keep-cr

ok 2 - file add A, !B

expecting success: 
	cat >expected <<\EXPECTED &&
EXPECTED

	git reset --hard initial &&
	test_commit "add-not-a-b" "ONE" "AAA" &&
	git merge-tree initial add-not-a-b initial >actual &&
	test_cmp expected actual

# passed all 7 test(s)
1..7
HEAD is now at c1d16d8 initial
Switched to a new branch 'modify_sub1'
*** t5000-tar-tree.sh ***
[master fe72a09] add-not-a-b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 ONE
ok 3 - file add !A, B

expecting success: 
	cat >expected <<\EXPECTED &&
EXPECTED

	git reset --hard initial &&
	test_commit "add-a-b-same-A" "ONE" "AAA" &&
	git reset --hard initial &&
	test_commit "add-a-b-same-B" "ONE" "AAA" &&
	git merge-tree initial add-a-b-same-A add-a-b-same-B >actual &&
	test_cmp expected actual

fatal: reference is not a tree: 0123456789012345678901234567890123456789
Unable to checkout '0123456789012345678901234567890123456789' in submodule path 'sub1'
HEAD is now at c1d16d8 initial
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5000-tar-tree/.git/
expecting success: mkdir a &&
     echo simple textfile >a/a &&
     ten=0123456789 && hundred=$ten$ten$ten$ten$ten$ten$ten$ten$ten$ten &&
     echo long filename >a/four$hundred &&
     mkdir a/bin &&
     test-genrandom "frotz" 500000 >a/bin/sh &&
     printf "A\$Format:%s\$O" "$SUBSTFORMAT" >a/substfile1 &&
     printf "A not substituted O" >a/substfile2 &&
     if test_have_prereq SYMLINKS; then
	ln -s a a/l1
     else
	printf %s a > a/l1
     fi &&
     (p=long_path_to_a_file && cd a &&
      for depth in 1 2 3 4 5; do mkdir $p && cd $p; done &&
      echo text >file_with_long_path) &&
     (cd a && find .) | sort >a.lst
[master adad022] add-a-b-same-A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 ONE
HEAD is now at c1d16d8 initial
ok 13 - apply_index: 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
		)
	
[master c566426] add-a-b-same-B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 ONE
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
ok 4 - file add A, B (same)

expecting success: 
	cat >expected <<\EXPECTED &&
added in both
  our    100644 43d5a8ed6ef6c00ff775008633f95787d088285d ONE
  their  100644 ba629238ca89489f2b350e196ca445e09d8bb834 ONE
@@ -1 +1,5 @@
+<<<<<<< .our
 AAA
+=======
+BBB
+>>>>>>> .their
EXPECTED

	git reset --hard initial &&
	test_commit "add-a-b-diff-A" "ONE" "AAA" &&
	git reset --hard initial &&
	test_commit "add-a-b-diff-B" "ONE" "BBB" &&
	git merge-tree initial add-a-b-diff-A add-a-b-diff-B >actual &&
	test_cmp expected actual

HEAD is now at c1d16d8 initial
ok 1 - populate workdir

expecting success: echo ignore me >a/ignored &&
     echo ignored export-ignore >.git/info/attributes
From /«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule_update_repo/.
   912f7e7..9a6c3e9  add_sub1   -> origin/add_sub1
ok 2 - add ignored file

expecting success: 
	git add a &&
	GIT_COMMITTER_DATE="2005-05-27 22:00" git commit -m initial

 * [new branch]      modify_sub1 -> origin/modify_sub1
 * [new branch]      remove_sub1 -> origin/remove_sub1
Cloning into 'submodule_update'...
[master 59aa417] add-a-b-diff-A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 ONE
Switched to a new branch 'modifications'
HEAD is now at c1d16d8 initial
done.
[modifications 7c11438] modified file2 and added file3
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 file3
[master 06b549e] add-a-b-diff-B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 ONE
Switched to a new branch 'invalid_sub1'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
ok 5 - file add A, B (different)

expecting success: 
	cat >expected <<\EXPECTED &&
EXPECTED

	git reset --hard initial &&
	test_commit "change-a-not-b" "initial-file" "BBB" &&
	git merge-tree initial change-a-not-b initial >actual &&
	test_cmp expected actual

HEAD is now at c1d16d8 initial
fatal: Needed a single revision
To /«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule_update_repo/.
 * [new branch]      modifications -> modifications
Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
[master 46329de] change-a-not-b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[modify_sub1 da1aad3] Modify sub1
 Author: A U Thor <author@example.com>
ok 6 - file change A, !B

expecting success: 
	cat >expected <<\EXPECTED &&
merged
  result 100644 ba629238ca89489f2b350e196ca445e09d8bb834 initial-file
  our    100644 e79c5e8f964493290a409888d5413a737e8e5dd5 initial-file
@@ -1 +1 @@
-initial
+BBB
EXPECTED

	git reset --hard initial &&
	test_commit "change-not-a-b" "initial-file" "BBB" &&
	git merge-tree initial initial change-not-a-b >actual &&
	test_cmp expected actual

Switched to a new branch 'replace_sub1_with_directory'
[master (root-commit) 18ad213] initial
 Author: A U Thor <author@example.com>
 8 files changed, 7 insertions(+)
 create mode 100644 a/a
 create mode 100644 a/bin/sh
 create mode 100644 a/four0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
 create mode 100644 a/ignored
 create mode 120000 a/l1
 create mode 100644 a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/file_with_long_path
 create mode 100644 a/substfile1
 create mode 100644 a/substfile2
ok 3 - add files to repository

expecting success: 
	echo "substfile?" export-subst >>.git/info/attributes &&
	git log --max-count=1 "--pretty=format:A${SUBSTFORMAT}O" HEAD \
		>a/substfile1

ok 4 - setup export-subst

expecting success: git clone --bare . bare.git &&
     cp .git/info/attributes bare.git/info/attributes
HEAD is now at c1d16d8 initial
Cloning into bare repository 'bare.git'...
[master 4667cad] change-not-a-b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
done.
ok 5 - create bare clone

expecting success: rm a/ignored
ok 7 - file change !A, B

expecting success: 
	cat >expected <<\EXPECTED &&
EXPECTED

	git reset --hard initial &&
	test_commit "change-a-b-same-A" "initial-file" "AAA" &&
	git reset --hard initial &&
	test_commit "change-a-b-same-B" "initial-file" "AAA" &&
	git merge-tree initial change-a-b-same-A change-a-b-same-B >actual &&
	test_cmp expected actual

ok 6 - remove ignored file

expecting success: git archive HEAD >b.tar
HEAD is now at c1d16d8 initial
ok 7 - git archive

expecting success: 
		(mkdir $dir && cd $dir && "$TAR" xf -) <$tarfile
	
ok 8 -  extract tar archive

[master 17f6774] change-a-b-same-A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
checking prerequisite: TAR_NEEDS_PAX_FALLBACK

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	(
		mkdir pax &&
		cd pax &&
		"$TAR" xf "$TEST_DIRECTORY"/t5000/pax.tar &&
		test -f PaxHeaders.1791/file
	)

)
prerequisite TAR_NEEDS_PAX_FALLBACK not satisfied
skipping test:  interpret pax headers 
		(
			cd $dir &&
			for header in *.paxheader
			do
				data=${header%.paxheader}.data &&
				if test -h $data || test -e $data
				then
					path=$(get_pax_header $header path) &&
					if test -n "$path"
					then
						mv "$data" "$path"
					fi
				fi
			done
		)
	
ok 9 # skip  interpret pax headers (missing TAR_NEEDS_PAX_FALLBACK)

expecting success: 
		(cd ${dir_with_prefix}a && find .) | sort >$listfile &&
		test_cmp a.lst $listfile
	
HEAD is now at c1d16d8 initial
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 10 -  validate filenames

expecting success: 
		diff -r a ${dir_with_prefix}a
	
[master c618aaa] change-a-b-same-B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 11 -  validate file contents

expecting success: 
	git archive --prefix=prefix/ HEAD >with_prefix.tar

Submodule path 'sub1': checked out '912f7e75d9b2a9ea1bda5e8f2864195a1f540d4c'
ok 8 - file change A, B (same)

expecting success: 
	cat >expected <<\EXPECTED &&
changed in both
  base   100644 e79c5e8f964493290a409888d5413a737e8e5dd5 initial-file
  our    100644 43d5a8ed6ef6c00ff775008633f95787d088285d initial-file
  their  100644 ba629238ca89489f2b350e196ca445e09d8bb834 initial-file
@@ -1 +1,5 @@
+<<<<<<< .our
 AAA
+=======
+BBB
+>>>>>>> .their
EXPECTED

	git reset --hard initial &&
	test_commit "change-a-b-diff-A" "initial-file" "AAA" &&
	git reset --hard initial &&
	test_commit "change-a-b-diff-B" "initial-file" "BBB" &&
	git merge-tree initial change-a-b-diff-A change-a-b-diff-B >actual &&
	test_cmp expected actual

Previous HEAD position was 912f7e7... Base
Switched to branch 'modifications'
ok 12 - git archive --prefix=prefix/

expecting success: 
		(mkdir $dir && cd $dir && "$TAR" xf -) <$tarfile
	
rm 'sub1'
HEAD is now at c1d16d8 initial
ok 13 -  extract tar archive

skipping test:  interpret pax headers 
		(
			cd $dir &&
			for header in *.paxheader
			do
				data=${header%.paxheader}.data &&
				if test -h $data || test -e $data
				then
					path=$(get_pax_header $header path) &&
					if test -n "$path"
					then
						mv "$data" "$path"
					fi
				fi
			done
		)
	
ok 14 # skip  interpret pax headers (missing TAR_NEEDS_PAX_FALLBACK)

expecting success: 
		(cd ${dir_with_prefix}a && find .) | sort >$listfile &&
		test_cmp a.lst $listfile
	
ok 15 -  validate filenames

expecting success: 
		diff -r a ${dir_with_prefix}a
	
[master f14ee41] change-a-b-diff-A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'sub1'...
[replace_sub1_with_directory 9da3b56] 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
ok 16 -  validate file contents

expecting success: 
	git archive --prefix=olde- HEAD >with_olde-prefix.tar

HEAD is now at c1d16d8 initial
Switched to a new branch 'replace_directory_with_sub1'
ok 17 - git-archive --prefix=olde-

expecting success: 
		(mkdir $dir && cd $dir && "$TAR" xf -) <$tarfile
	
done.
Removing sub1/file3
Removing sub1/file2
Removing sub1/file1
Adding sub1
[master 6faccc3] change-a-b-diff-B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 18 -  extract tar archive

skipping test:  interpret pax headers 
		(
			cd $dir &&
			for header in *.paxheader
			do
				data=${header%.paxheader}.data &&
				if test -h $data || test -e $data
				then
					path=$(get_pax_header $header path) &&
					if test -n "$path"
					then
						mv "$data" "$path"
					fi
				fi
			done
		)
	
ok 19 # skip  interpret pax headers (missing TAR_NEEDS_PAX_FALLBACK)

expecting success: 
		(cd ${dir_with_prefix}a && find .) | sort >$listfile &&
		test_cmp a.lst $listfile
	
[replace_directory_with_sub1 8ac112d] 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 9 - file change A, B (different)

expecting success: 
	cat >expected <<\EXPECTED &&
Switched to a new branch 'replace_sub1_with_file'
changed in both
  base   100644 f4f1f998c7776568c4ff38f516d77fef9399b5a7 ONE
  our    100644 af14c2c3475337c73759d561ef70b59e5c731176 ONE
  their  100644 372d761493f524d44d59bd24700c3bdf914c973c ONE
@@ -7,7 +7,11 @@
 AAA
 AAA
 AAA
+<<<<<<< .our
 BBB
+=======
+CCC
+>>>>>>> .their
 AAA
 AAA
 AAA
EXPECTED

	git reset --hard initial &&
	test_commit "change-a-b-mix-base" "ONE" "
AAA
AAA
AAA
AAA
AAA
AAA
AAA
AAA
AAA
AAA
AAA
AAA
AAA
AAA
AAA" &&
	test_commit "change-a-b-mix-A" "ONE" \
		"$(sed -e "1{s/AAA/BBB/;}" -e "10{s/AAA/BBB/;}" <ONE)" &&
	git reset --hard change-a-b-mix-base &&
	test_commit "change-a-b-mix-B" "ONE" \
		"$(sed -e "1{s/AAA/BBB/;}" -e "10{s/AAA/CCC/;}" <ONE)" &&
	git merge-tree change-a-b-mix-base change-a-b-mix-A change-a-b-mix-B \
		>actual &&
	test_cmp expected actual

ok 20 -  validate filenames

expecting success: 
		diff -r a ${dir_with_prefix}a
	
rm 'sub1'
ok 21 -  validate file contents

expecting success: 
    test_config core.bigfilethreshold 1 &&
    git archive HEAD >b3.tar &&
    test_cmp_bin b.tar b3.tar

HEAD is now at c1d16d8 initial
[replace_sub1_with_file 9f4027d] Replace sub1 with file
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
[master 8f24aa4] change-a-b-mix-base
 Author: A U Thor <author@example.com>
 1 file changed, 16 insertions(+)
 create mode 100644 ONE
Switched to a new branch 'replace_file_with_sub1'
ok 22 - git archive on large files

expecting success: (cd bare.git && git archive HEAD) >b3.tar
Submodule path 'sub1': checked out '613068f76d422f07de14d59bca708cacb8bb3c5b'
ok 23 - git archive in a bare repo

expecting success: test_cmp_bin b.tar b3.tar
[replace_file_with_sub1 1e4971c] Revert "Replace sub1 with file"
 Author: A U Thor <author@example.com>
 2 files changed, 5 insertions(+), 1 deletion(-)
 mode change 100644 => 160000 sub1
[master 37be425] change-a-b-mix-A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 24 - git archive vs. the same in a bare repo

expecting success: git archive --output=b4.tar HEAD &&
    test_cmp_bin b.tar b4.tar
Switched to a new branch 'invalid_sub1'
HEAD is now at 8f24aa4 change-a-b-mix-base
ok 25 - git archive with --output

expecting success: git archive --remote=. HEAD >b5.tar &&
    test_cmp_bin b.tar b5.tar
[invalid_sub1 80d1724] Invalid sub1 commit
 Author: A U Thor <author@example.com>
Switched to a new branch 'valid_sub1'
[master 9bb3ceb] change-a-b-mix-B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 26 - git archive --remote

expecting success: mkdir extract &&
     "$TAR" xf b.tar -C extract a/a &&
     test-chmtime -v +0 extract/a/a |cut -f 1 >b.mtime &&
     echo "1117231200" >expected.mtime &&
     test_cmp expected.mtime b.mtime
ok 10 - file change A, B (mixed)

expecting success: 
	cat >expected <<\EXPECTED &&
EXPECTED

	git reset --hard initial &&
	test_commit "rm-a-not-b-base" "ONE" "AAA" &&
	git rm ONE &&
	git commit -m "rm-a-not-b" &&
	git tag "rm-a-not-b" &&
	git merge-tree rm-a-not-b-base rm-a-not-b rm-a-not-b-base >actual &&
	test_cmp expected actual

ok 14 - apply_index: 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
		)
	
[valid_sub1 0a5f4be] Revert "Invalid sub1 commit"
 Author: A U Thor <author@example.com>
HEAD is now at c1d16d8 initial
ok 27 - validate file modification time

expecting success: git get-tar-commit-id <b.tar >b.commitid &&
     test_cmp .git/$(git symbolic-ref HEAD) b.commitid
Switched to branch 'master'
ok 28 - git get-tar-commit-id

expecting success: 
	git archive --format=tar --output=d4.zip HEAD &&
	test_cmp_bin b.tar d4.zip

[master 6bc469c] rm-a-not-b-base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 ONE
Cloning into 'submodule_update'...
ok 29 - git archive with --output, override inferred format

expecting success: GIT_DIR=some/non-existing/directory git archive --list
rm 'ONE'
tar
tgz
tar.gz
zip
ok 30 - git archive --list outside of a git repo

expecting success: 
	test_commit unreachable &&
	sha1=$(git rev-parse HEAD) &&
	git reset --hard HEAD^ &&
	git archive $sha1 >remote.tar &&
	test_must_fail git archive --remote=. $sha1 >remote.tar

Cloning into 'submodule_update'...
[master eaee347] rm-a-not-b
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 ONE
done.
done.
[master 4ab1f51] unreachable
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 unreachable.t
ok 11 - file remove A, !B

expecting success: 
	cat >expected <<\EXPECTED &&
removed in remote
  base   100644 43d5a8ed6ef6c00ff775008633f95787d088285d ONE
  our    100644 43d5a8ed6ef6c00ff775008633f95787d088285d ONE
@@ -1 +0,0 @@
-AAA
EXPECTED

	git reset --hard initial &&
	test_commit "rm-not-a-b-base" "ONE" "AAA" &&
	git rm ONE &&
	git commit -m "rm-not-a-b" &&
	git tag "rm-not-a-b" &&
	git merge-tree rm-a-not-b-base rm-a-not-b-base rm-a-not-b >actual &&
	test_cmp expected actual

HEAD is now at c1d16d8 initial
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
HEAD is now at 18ad213 initial
[master 4c80bfe] rm-not-a-b-base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 ONE
Branch add_sub1 set up to track remote branch add_sub1 from origin.
rm 'ONE'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
remote: fatal: no such ref: 4ab1f51eb9ad7a121656cfebf70c6a3160e077d6        
fatal: sent error to the client: git upload-archive: archiver died with error
remote: git upload-archive: archiver died with error
ok 31 - clients cannot access unreachable commits

expecting success: 
	test_commit unreachable1 &&
	sha1=$(git rev-parse HEAD) &&
	git reset --hard HEAD^ &&
	git archive $sha1 >remote.tar &&
	test_config uploadarchive.allowUnreachable true &&
	git archive --remote=. $sha1 >remote.tar

[master f5c368c] rm-not-a-b
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 ONE
Applying: Add sub1
[master 82d10e3] unreachable1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 unreachable1.t
ok 12 - file remove !A, B

expecting success: 
	cat >expected <<\EXPECTED &&
EXPECTED

	git reset --hard initial &&
	test_commit "rm-a-b-base" "ONE" "AAA" &&
	git rm ONE &&
	git commit -m "rm-a-b" &&
	git tag "rm-a-b" &&
	git merge-tree rm-a-b-base rm-a-b rm-a-b >actual &&
	test_cmp expected actual

HEAD is now at c1d16d8 initial
HEAD is now at 18ad213 initial
[master ba896b0] rm-a-b-base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 ONE
rm 'ONE'
[master e5794d5] rm-a-b
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 ONE
ok 13 - file remove A, B (same)

expecting success: 
	cat >expected <<\EXPECTED &&
removed in remote
  base   100644 43d5a8ed6ef6c00ff775008633f95787d088285d ONE
  our    100644 ba629238ca89489f2b350e196ca445e09d8bb834 ONE
@@ -1 +0,0 @@
-BBB
EXPECTED

	git reset --hard initial &&
	test_commit "change-a-rm-b-base" "ONE" "AAA" &&
	test_commit "change-a-rm-b-A" "ONE" "BBB" &&
	git reset --hard change-a-rm-b-base &&
	git rm ONE &&
	git commit -m "change-a-rm-b-B" &&
	git tag "change-a-rm-b-B" &&
	git merge-tree change-a-rm-b-base change-a-rm-b-A change-a-rm-b-B \
		>actual &&
	test_cmp expected actual

HEAD is now at c1d16d8 initial
ok 32 - upload-archive can allow unreachable commits

expecting success: 
	git config tar.tar.foo.command "tr ab ba" &&
	git config tar.bar.command "tr ab ba" &&
	git config tar.bar.remote true &&
	git config tar.invalid baz

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/submodule_update_repo/.) registered for path 'sub1'
[master 425fe11] change-a-rm-b-base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 ONE
ok 33 - setup tar filters

expecting success: 
	git archive --list >output &&
	grep "^tar\.foo\$" output &&
	grep "^bar\$" output

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule_update_repo/.) registered for path 'sub1'
tar.foo
bar
ok 34 - archive --list mentions user filter

expecting success: 
	git archive --list --remote=. >output &&
	! grep "^tar\.foo\$" output &&
	grep "^bar\$" output

[master d7b5417] change-a-rm-b-A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
HEAD is now at 425fe11 change-a-rm-b-base
bar
ok 35 - archive --list shows only enabled remote filters

expecting success: 
	git archive --format=tar.foo HEAD >config.tar.foo &&
	tr ab ba <config.tar.foo >config.tar &&
	test_cmp_bin b.tar config.tar &&
	git archive --format=bar HEAD >config.bar &&
	tr ab ba <config.bar >config.tar &&
	test_cmp_bin b.tar config.tar

rm 'ONE'
Cloning into 'sub1'...
[master a35c11c] change-a-rm-b-B
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 ONE
done.
Cloning into 'sub1'...
ok 14 - file change A, remove B

expecting success: 
	cat >expected <<\EXPECTED &&
removed in local
  base   100644 43d5a8ed6ef6c00ff775008633f95787d088285d ONE
  their  100644 ba629238ca89489f2b350e196ca445e09d8bb834 ONE
EXPECTED

	git reset --hard initial &&
	test_commit "rm-a-change-b-base" "ONE" "AAA" &&

	git rm ONE &&
	git commit -m "rm-a-change-b-A" &&
	git tag "rm-a-change-b-A" &&
	git reset --hard rm-a-change-b-base &&
	test_commit "rm-a-change-b-B" "ONE" "BBB" &&
	git merge-tree rm-a-change-b-base rm-a-change-b-A rm-a-change-b-B \
		>actual &&
	test_cmp expected actual

HEAD is now at c1d16d8 initial
done.
ok 36 - invoke tar filter by format

expecting success: 
	git archive -o config-implicit.tar.foo HEAD &&
	test_cmp_bin config.tar.foo config-implicit.tar.foo &&
	git archive -o config-implicit.bar HEAD &&
	test_cmp_bin config.tar.foo config-implicit.bar

[master e3f76d1] rm-a-change-b-base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 ONE
rm 'ONE'
[master 12305ab] rm-a-change-b-A
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 ONE
Submodule path 'sub1': checked out '613068f76d422f07de14d59bca708cacb8bb3c5b'
HEAD is now at e3f76d1 rm-a-change-b-base
ok 37 - invoke tar filter by extension

expecting success: 
	git archive -o config-implicit.baz HEAD &&
	test_cmp_bin b.tar config-implicit.baz

Submodule path 'sub1': checked out '912f7e75d9b2a9ea1bda5e8f2864195a1f540d4c'
[master 30c5a34] rm-a-change-b-B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 38 - default output format remains tar

expecting success: 
	git archive -o config-implicittar.foo HEAD &&
	test_cmp_bin b.tar config-implicittar.foo

ok 15 - file remove A, change B

expecting success: 
	cat >expect <<-\EOF &&
	EOF
	git reset --hard initial &&
	mkdir sub &&
	test_commit "add sub/file" "sub/file" "file" add-tree-A &&
	git merge-tree initial add-tree-A add-tree-A >actual &&
	test_cmp expect actual

ok 39 - extension matching requires dot

expecting success: 
	test_must_fail git archive --remote=. --format=tar.foo HEAD \
		>remote.tar.foo &&
	git archive --remote=. --format=bar >remote.bar HEAD &&
	test_cmp_bin remote.bar config.bar

HEAD is now at c1d16d8 initial
ok 15 - apply_3way: 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 &&
remote: fatal: Unknown archive format 'tar.foo'        
			git submodule update --init --recursive &&
			test_submodule_content sub1 origin/add_sub1
		)
	
fatal: sent error to the client: git upload-archive: archiver died with error
remote: git upload-archive: archiver died with error
[master f146135] add sub/file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 sub/file
ok 1 - am: 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 16 - tree add A, B (same)

expecting success: 
	cat >expect <<-\EOF &&
	added in both
	  our    100644 43d5a8ed6ef6c00ff775008633f95787d088285d sub/file
	  their  100644 ba629238ca89489f2b350e196ca445e09d8bb834 sub/file
	@@ -1 +1,5 @@
	+<<<<<<< .our
	 AAA
	+=======
	+BBB
	+>>>>>>> .their
	EOF
	git reset --hard initial &&
	mkdir sub &&
	test_commit "add sub/file" "sub/file" "AAA" add-tree-a-b-A &&
	git reset --hard initial &&
	mkdir sub &&
	test_commit "add sub/file" "sub/file" "BBB" add-tree-a-b-B &&
	git merge-tree initial add-tree-a-b-A add-tree-a-b-B >actual &&
	test_cmp expect actual

ok 40 - only enabled filters are available remotely

checking prerequisite: GZIP

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&gzip --version
)
gzip 1.6
Copyright (C) 2007, 2010, 2011 Free Software Foundation, Inc.
Copyright (C) 1993 Jean-loup Gailly.
This is free software.  You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.

Written by Jean-loup Gailly.
prerequisite GZIP ok
expecting success: 
	git archive --format=tgz HEAD >j.tgz

HEAD is now at c1d16d8 initial
Cloning into 'submodule_update'...
[master 278e538] add sub/file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 sub/file
Cloning into 'submodule_update'...
done.
HEAD is now at c1d16d8 initial
[master b437163] add sub/file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 sub/file
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
done.
ok 17 - tree add A, B (different)

expecting success: 
	cat >expect <<-\EOF &&
	removed in remote
	  base   100644 43d5a8ed6ef6c00ff775008633f95787d088285d sub/file
	  our    100644 43d5a8ed6ef6c00ff775008633f95787d088285d sub/file
	@@ -1 +0,0 @@
	-AAA
	EOF
	git reset --hard initial &&
	mkdir sub &&
	test_commit "add sub/file" "sub/file" "AAA" tree-remove-b-initial &&
	git rm sub/file &&
	test_tick &&
	git commit -m "remove sub/file" &&
	git tag tree-remove-b-B &&
	git merge-tree tree-remove-b-initial tree-remove-b-initial tree-remove-b-B >actual &&
	test_cmp expect actual

Branch add_sub1 set up to track remote branch add_sub1 from origin.
Switched to a new branch 'no_submodule'
HEAD is now at c1d16d8 initial
Branch no_submodule set up to track remote branch no_submodule from origin.
ok 41 - git archive --format=tgz

expecting success: 
	git archive --format=tar.gz HEAD >j1.tar.gz &&
	test_cmp_bin j.tgz j1.tar.gz

[master 06f44d6] add sub/file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 sub/file
Branch add_sub1 set up to track remote branch add_sub1 from origin.
rm 'sub/file'
Applying: Add sub1
[master 7d2ab7e] remove sub/file
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 sub/file
ok 18 - tree unchanged A, removed B

expecting success: 
	git reset --hard initial &&
	rm initial-file &&
	mkdir initial-file &&
	test_commit "turn-file-to-tree" "initial-file/ONE" "CCC" &&
	git merge-tree initial initial turn-file-to-tree >actual &&
	cat >expect <<-\EOF &&
	added in remote
	  their  100644 43aa4fdec31eb92e1fdc2f0ce6ea9ddb7c32bcf7 initial-file/ONE
	@@ -0,0 +1 @@
	+CCC
	removed in remote
	  base   100644 e79c5e8f964493290a409888d5413a737e8e5dd5 initial-file
	  our    100644 e79c5e8f964493290a409888d5413a737e8e5dd5 initial-file
	@@ -1 +0,0 @@
	-initial
	EOF
	test_cmp expect actual

HEAD is now at c1d16d8 initial
[master c7dbe97] turn-file-to-tree
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 1 deletion(-)
 delete mode 100644 initial-file
 create mode 100644 initial-file/ONE
ok 42 - git archive --format=tar.gz

ok 19 - turn file to tree

expecting success: 
	git reset --hard initial &&
	mkdir dir &&
	test_commit "add-tree" "dir/path" "AAA" &&
	test_commit "add-another-tree" "dir/another" "BBB" &&
	rm -fr dir &&
	test_commit "make-file" "dir" "CCC" &&
	git merge-tree add-tree add-another-tree make-file >actual &&
	cat >expect <<-\EOF &&
	removed in remote
	  base   100644 43d5a8ed6ef6c00ff775008633f95787d088285d dir/path
	  our    100644 43d5a8ed6ef6c00ff775008633f95787d088285d dir/path
	@@ -1 +0,0 @@
	-AAA
	added in remote
	  their  100644 43aa4fdec31eb92e1fdc2f0ce6ea9ddb7c32bcf7 dir
	@@ -0,0 +1 @@
	+CCC
	EOF
	test_cmp expect actual

expecting success: 
	git archive --output=j2.tgz HEAD &&
	test_cmp_bin j.tgz j2.tgz

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/submodule_update_repo/.) registered for path 'sub1'
HEAD is now at c1d16d8 initial
[master fadeed0] add-tree
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 dir/path
[master 2076f67] add-another-tree
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 dir/another
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'sub1'...
[master 8ffb08d] make-file
 Author: A U Thor <author@example.com>
 3 files changed, 1 insertion(+), 2 deletions(-)
 create mode 100644 dir
 delete mode 100644 dir/another
 delete mode 100644 dir/path
done.
ok 43 - infer tgz from .tgz filename

ok 20 - turn tree to file

expecting success: 
	git archive --output=j3.tar.gz HEAD &&
	test_cmp_bin j.tgz j3.tar.gz

# passed all 20 test(s)
1..20
Cloning into 'sub1'...
*** t5001-archive-attr.sh ***
done.
Submodule path 'sub1': checked out '613068f76d422f07de14d59bca708cacb8bb3c5b'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5001-archive-attr/.git/
expecting success: 
	echo ignored >ignored &&
	echo ignored export-ignore >>.git/info/attributes &&
	git add ignored &&

	echo ignored by tree >ignored-by-tree &&
	echo ignored-by-tree export-ignore >.gitattributes &&
	git add ignored-by-tree .gitattributes &&

	echo ignored by worktree >ignored-by-worktree &&
	echo ignored-by-worktree export-ignore >.gitattributes &&
	git add ignored-by-worktree &&

	printf "A\$Format:%s\$O" "$SUBSTFORMAT" >nosubstfile &&
	printf "A\$Format:%s\$O" "$SUBSTFORMAT" >substfile1 &&
	printf "A not substituted O" >substfile2 &&
	echo "substfile?" export-subst >>.git/info/attributes &&
	git add nosubstfile substfile1 substfile2 &&

	git commit -m. &&

	git clone --bare . bare &&
	cp .git/info/attributes bare/info/attributes

ok 44 - infer tgz from .tar.gz filename

expecting success: 
	gzip -d -c <j.tgz >j.tar &&
	test_cmp_bin b.tar j.tar

ok 45 - extract tgz file

expecting success: 
	git archive --remote=. --format=tar.gz HEAD >remote.tar.gz &&
	test_cmp_bin j.tgz remote.tar.gz

ok 16 - apply_3way: 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
		)
	
Submodule path 'sub1': checked out '912f7e75d9b2a9ea1bda5e8f2864195a1f540d4c'
[master (root-commit) f6ad290] .
 Author: A U Thor <author@example.com>
 7 files changed, 7 insertions(+)
 create mode 100644 .gitattributes
 create mode 100644 ignored
 create mode 100644 ignored-by-tree
 create mode 100644 ignored-by-worktree
 create mode 100644 nosubstfile
 create mode 100644 substfile1
 create mode 100644 substfile2
Cloning into bare repository 'bare'...
done.
ok 1 - setup

expecting success: 
	git archive HEAD >archive.tar &&
	(mkdir archive && cd archive && "$TAR" xf -) <archive.tar

Cloning into 'submodule_update'...
ok 2 - git archive

expecting success: test ! -e archive/ignored
ok 3 -  archive/ignored does not exist

expecting success: test ! -e archive/ignored-by-tree
ok 4 -  archive/ignored-by-tree does not exist

expecting success: test -e archive/ignored-by-worktree
ok 5 -  archive/ignored-by-worktree exists

expecting success: 
	git archive --worktree-attributes HEAD >worktree.tar &&
	(mkdir worktree && cd worktree && "$TAR" xf -) <worktree.tar

done.
ok 6 - git archive with worktree attributes

expecting success: test ! -e worktree/ignored
ok 7 -  worktree/ignored does not exist

expecting success: test -e worktree/ignored-by-tree
ok 8 -  worktree/ignored-by-tree exists

expecting success: test ! -e worktree/ignored-by-worktree
ok 9 -  worktree/ignored-by-worktree does not exist

ok 2 - am: added submodule leaves existing empty directory alone

expecting success: 
	git archive --worktree-attributes --worktree-attributes HEAD >worktree.tar &&
	(mkdir worktree2 && cd worktree2 && "$TAR" xf -) <worktree.tar

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
		)
	
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
ok 10 - git archive --worktree-attributes option

expecting success: test ! -e worktree2/ignored
ok 11 -  worktree2/ignored does not exist

expecting success: test -e worktree2/ignored-by-tree
ok 12 -  worktree2/ignored-by-tree exists

expecting success: test ! -e worktree2/ignored-by-worktree
ok 13 -  worktree2/ignored-by-worktree does not exist

expecting success: 
	(cd bare && git archive HEAD) >bare-archive.tar &&
	test_cmp_bin archive.tar bare-archive.tar

ok 14 - git archive vs. bare

expecting success: 
	(cd bare && git archive --worktree-attributes HEAD) >bare-worktree.tar &&
	(mkdir bare-worktree && cd bare-worktree && "$TAR" xf -) <bare-worktree.tar

Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 46 - remote tar.gz is allowed by default

error: sub1: patch does not apply
expecting success: 
	git config tar.tar.gz.remote false &&
	test_must_fail git archive --remote=. --format=tar.gz HEAD \
		>remote.tar.gz

ok 15 - git archive with worktree attributes, bare

expecting success: test ! -e bare-worktree/ignored
ok 16 -  bare-worktree/ignored does not exist

expecting success: test -e bare-worktree/ignored-by-tree
ok 17 -  bare-worktree/ignored-by-tree exists

expecting success: test -e bare-worktree/ignored-by-worktree
ok 18 -  bare-worktree/ignored-by-worktree exists

expecting success: 
	git log "--pretty=format:A${SUBSTFORMAT}O" HEAD >substfile1.expected &&
	test_cmp nosubstfile archive/nosubstfile &&
	test_cmp substfile1.expected archive/substfile1 &&
	test_cmp substfile2 archive/substfile2

Cloning into 'submodule_update'...
remote: fatal: Unknown archive format 'tar.gz'        
fatal: sent error to the client: git upload-archive: archiver died with error
remote: git upload-archive: archiver died with error
ok 19 - export-subst

ok 47 - remote tar.gz can be disabled

expecting success: 
	git archive -v HEAD -- ":(glob)**/sh" >/dev/null 2>actual &&
	cat >expect <<EOF &&
a/
a/bin/
a/bin/sh
EOF
	test_cmp expect actual

ok 17 - apply_3way: 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
		)
	
# passed all 19 test(s)
1..19
ok 48 - archive and :(glob)

expecting success: 
	test_must_fail git archive -v HEAD -- "*.abc" >/dev/null

done.
fatal: pathspec '*.abc' did not match any files
ok 49 - catch non-matching pathspec

# passed all 49 test(s)
1..49
Cloning into 'submodule_update'...
*** t5002-archive-attr-pattern.sh ***
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
done.
Branch add_sub1 set up to track remote branch add_sub1 from origin.
*** t5003-archive-zip.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5002-archive-attr-pattern/.git/
expecting success: 
	echo ignored >ignored &&
	echo ignored export-ignore >>.git/info/attributes &&
	git add ignored &&

	mkdir not-ignored-dir &&
	echo ignored-in-tree >not-ignored-dir/ignored &&
	echo not-ignored-in-tree >not-ignored-dir/ignored-only-if-dir &&
	git add not-ignored-dir &&

	mkdir ignored-only-if-dir &&
	echo ignored by ignored dir >ignored-only-if-dir/ignored-by-ignored-dir &&
	echo ignored-only-if-dir/ export-ignore >>.git/info/attributes &&
	git add ignored-only-if-dir &&

	mkdir -p ignored-without-slash &&
	echo "ignored without slash" >ignored-without-slash/foo &&
	git add ignored-without-slash/foo &&
	echo "ignored-without-slash export-ignore" >>.git/info/attributes &&

	mkdir -p wildcard-without-slash &&
	echo "ignored without slash" >wildcard-without-slash/foo &&
	git add wildcard-without-slash/foo &&
	echo "wild*-without-slash export-ignore" >>.git/info/attributes &&

	mkdir -p deep/and/slashless &&
	echo "ignored without slash" >deep/and/slashless/foo &&
	git add deep/and/slashless/foo &&
	echo "deep/and/slashless export-ignore" >>.git/info/attributes &&

	mkdir -p deep/with/wildcard &&
	echo "ignored without slash" >deep/with/wildcard/foo &&
	git add deep/with/wildcard/foo &&
	echo "deep/*t*/wildcard export-ignore" >>.git/info/attributes &&

	mkdir -p one-level-lower/two-levels-lower/ignored-only-if-dir &&
	echo ignored by ignored dir >one-level-lower/two-levels-lower/ignored-only-if-dir/ignored-by-ignored-dir &&
	git add one-level-lower &&

	git commit -m. &&

	git clone --bare . bare &&
	cp .git/info/attributes bare/info/attributes

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.
Applying: Add sub1
error: sub1: already exists in working directory
Patch failed at 0001 Add sub1
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
t4137-apply-submodule.sh: 159: cd: can't cd to sub1
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5003-archive-zip/.git/
Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
expecting success: mkdir a &&
     echo simple textfile >a/a &&
     mkdir a/bin &&
     cp /bin/sh a/bin &&
     printf "text\r"	>a/text.cr &&
     printf "text\r\n"	>a/text.crlf &&
     printf "text\n"	>a/text.lf &&
     printf "text\r"	>a/nodiff.cr &&
     printf "text\r\n"	>a/nodiff.crlf &&
     printf "text\n"	>a/nodiff.lf &&
     printf "\0\r"	>a/binary.cr &&
     printf "\0\r\n"	>a/binary.crlf &&
     printf "\0\n"	>a/binary.lf &&
     printf "\0\r"	>a/diff.cr &&
     printf "\0\r\n"	>a/diff.crlf &&
     printf "\0\n"	>a/diff.lf &&
     printf "A\$Format:%s\$O" "$SUBSTFORMAT" >a/substfile1 &&
     printf "A not substituted O" >a/substfile2 &&
     (p=long_path_to_a_file && cd a &&
      for depth in 1 2 3 4 5; do mkdir $p && cd $p; done &&
      echo text >file_with_long_path)

ok 3 - am: 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 1 - populate workdir

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
checking prerequisite: UNZIP_SYMLINKS

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	(
		mkdir unzip-symlinks &&
		cd unzip-symlinks &&
		"$GIT_UNZIP" "$TEST_DIRECTORY"/t5003/infozip-symlinks.zip &&
		test -h symlink
	)

)
Cloning into 'submodule_update'...
Archive:  /«PKGBUILDDIR»/t/t5003/infozip-symlinks.zip
 extracting: textfile                
    linking: symlink                 -> textfile 
finishing deferred symbolic links:
  symlink                -> textfile
prerequisite UNZIP_SYMLINKS ok
expecting success: 
	ln -s a a/symlink_to_a

ok 2 - add symlink

expecting success: 
	(cd a && find .) | sort >a.lst

done.
ok 3 - prepare file list

expecting success: echo ignore me >a/ignored &&
     echo ignored export-ignore >.git/info/attributes
ok 4 - add ignored file

expecting success: 
	git add a &&
	GIT_COMMITTER_DATE="2005-05-27 22:00" git commit -m initial

[master (root-commit) 7cacf6b] .
 Author: A U Thor <author@example.com>
 9 files changed, 9 insertions(+)
 create mode 100644 deep/and/slashless/foo
 create mode 100644 deep/with/wildcard/foo
 create mode 100644 ignored
 create mode 100644 ignored-only-if-dir/ignored-by-ignored-dir
 create mode 100644 ignored-without-slash/foo
 create mode 100644 not-ignored-dir/ignored
 create mode 100644 not-ignored-dir/ignored-only-if-dir
 create mode 100644 one-level-lower/two-levels-lower/ignored-only-if-dir/ignored-by-ignored-dir
 create mode 100644 wildcard-without-slash/foo
Cloning into bare repository 'bare'...
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.
done.
ok 1 - setup

expecting success: 
	git archive HEAD >archive.tar &&
	(mkdir archive && cd archive && "$TAR" xf -) <archive.tar

t4255-am-submodule.sh: 159: cd: can't cd to sub1
ok 2 - git archive

expecting success: test ! -e archive/ignored
ok 3 -  archive/ignored does not exist

expecting success: test ! -e archive/not-ignored-dir/ignored
[master (root-commit) ad3d1cc] initial
 Author: A U Thor <author@example.com>
 19 files changed, 12 insertions(+)
 create mode 100644 a/a
 create mode 100755 a/bin/sh
 create mode 100644 a/binary.cr
 create mode 100644 a/binary.crlf
 create mode 100644 a/binary.lf
 create mode 100644 a/diff.cr
 create mode 100644 a/diff.crlf
 create mode 100644 a/diff.lf
 create mode 100644 a/ignored
 create mode 100644 a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/file_with_long_path
 create mode 100644 a/nodiff.cr
 create mode 100644 a/nodiff.crlf
 create mode 100644 a/nodiff.lf
 create mode 100644 a/substfile1
 create mode 100644 a/substfile2
 create mode 120000 a/symlink_to_a
 create mode 100644 a/text.cr
 create mode 100644 a/text.crlf
 create mode 100644 a/text.lf
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 5 - add files to repository

expecting success: 
	echo "a/nodiff.* -diff" >>.git/info/attributes &&
	echo "a/diff.* diff" >>.git/info/attributes &&
	echo "substfile?" export-subst >>.git/info/attributes &&
	git log --max-count=1 "--pretty=format:A${SUBSTFORMAT}O" HEAD \
		>a/substfile1

ok 4 -  archive/not-ignored-dir/ignored does not exist

Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
expecting success: test -e archive/not-ignored-dir/ignored-only-if-dir
ok 5 -  archive/not-ignored-dir/ignored-only-if-dir exists

expecting success: test -e archive/not-ignored-dir/
ok 6 -  archive/not-ignored-dir/ exists

expecting success: test ! -e archive/ignored-only-if-dir/
ok 7 -  archive/ignored-only-if-dir/ does not exist

expecting success: test ! -e archive/ignored-ony-if-dir/ignored-by-ignored-dir
ok 8 -  archive/ignored-ony-if-dir/ignored-by-ignored-dir does not exist

expecting success: test ! -e archive/ignored-without-slash/
ok 6 - setup export-subst and diff attributes

ok 9 -  archive/ignored-without-slash/ does not exist

expecting success: git clone --bare . bare.git &&
     cp .git/info/attributes bare.git/info/attributes
expecting success: test ! -e archive/ignored-without-slash/foo
ok 10 -  archive/ignored-without-slash/foo does not exist

expecting success: test ! -e archive/wildcard-without-slash/
ok 11 -  archive/wildcard-without-slash/ does not exist

expecting success: test ! -e archive/wildcard-without-slash/foo
ok 12 -  archive/wildcard-without-slash/foo does not exist

expecting success: test ! -e archive/deep/and/slashless/
ok 13 -  archive/deep/and/slashless/ does not exist

expecting success: test ! -e archive/deep/and/slashless/foo
ok 14 -  archive/deep/and/slashless/foo does not exist

expecting success: test ! -e archive/deep/with/wildcard/
Cloning into bare repository 'bare.git'...
ok 15 -  archive/deep/with/wildcard/ does not exist

expecting success: test ! -e archive/deep/with/wildcard/foo
ok 16 -  archive/deep/with/wildcard/foo does not exist

expecting success: test -e archive/one-level-lower/
ok 17 -  archive/one-level-lower/ exists

expecting success: test ! -e archive/one-level-lower/two-levels-lower/ignored-only-if-dir/
ok 18 -  archive/one-level-lower/two-levels-lower/ignored-only-if-dir/ does not exist

expecting success: test ! -e archive/one-level-lower/two-levels-lower/ignored-ony-if-dir/ignored-by-ignored-dir
ok 19 -  archive/one-level-lower/two-levels-lower/ignored-ony-if-dir/ignored-by-ignored-dir does not exist

Applying: Revert "Replace sub1 with file"
# passed all 19 test(s)
1..19
done.
ok 7 - create bare clone

expecting success: rm a/ignored
ok 8 - remove ignored file

expecting success: git archive --format=zip HEAD >d.zip
Cloning into 'sub1'...
*** t5004-archive-corner-cases.sh ***
done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5004-archive-corner-cases/.git/
ok 9 - git archive --format=zip

expecting success: 
	git commit --allow-empty -m foo

checking prerequisite: UNZIP

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

)
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 5.2.1 20151028 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]
[master (root-commit) 9155d42] foo
 Author: A U Thor <author@example.com>
ok 1 - create commit with empty tree

prerequisite UNZIP ok
expecting success: 
		(mkdir $dir && cd $dir && "$GIT_UNZIP" ../$zipfile)
	
expecting success: 
	git archive --format=tar HEAD >empty-with-pax-header.tar &&
	make_dir extract &&
	"$TAR" xf empty-with-pax-header.tar -C extract &&
	check_dir extract

Archive:  ../d.zip
ad3d1cc9697401df09559d9744da5defd0046906
   creating: a/
 extracting: a/a                     
   creating: a/bin/
  inflating: a/bin/sh                
 extracting: a/binary.cr             
 extracting: a/binary.crlf           
 extracting: a/binary.lf             
 extracting: a/diff.cr               
 extracting: a/diff.crlf             
 extracting: a/diff.lf               
   creating: a/long_path_to_a_file/
   creating: a/long_path_to_a_file/long_path_to_a_file/
   creating: a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/
   creating: a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/
   creating: a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/
 extracting: a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/file_with_long_path  
 extracting: a/nodiff.cr             
 extracting: a/nodiff.crlf           
 extracting: a/nodiff.lf             
 extracting: a/substfile1            
 extracting: a/substfile2            
    linking: a/symlink_to_a          -> a 
 extracting: a/text.cr               
 extracting: a/text.crlf             
 extracting: a/text.lf               
finishing deferred symbolic links:
  a/symlink_to_a         -> a
ok 10 -  extract ZIP archive

expecting success: 
		(cd d/a && find .) | sort >d.lst &&
		test_cmp a.lst d.lst
	
Submodule path 'sub1': checked out '613068f76d422f07de14d59bca708cacb8bb3c5b'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 2 - tar archive of commit with empty tree

expecting success: 
	git archive --format=tar HEAD: >empty.tar &&
	perl -e "print \"\\0\" x 10240" >10knuls.tar &&
	test_cmp_bin 10knuls.tar empty.tar

ok 11 -  validate filenames

expecting success: 
		diff -r a d/a
	
ok 12 -  validate file contents

expecting success: 
		(mkdir $dir && cd $dir && "$GIT_UNZIP" -a ../$zipfile)
	
ok 3 - tar archive of empty tree is empty

expecting success: 
	git archive --format=tar --prefix=foo/ HEAD >prefix.tar &&
	make_dir extract &&
	"$TAR" xf prefix.tar -C extract &&
	check_dir extract foo

Archive:  ../d.zip
ad3d1cc9697401df09559d9744da5defd0046906
   creating: a/
 extracting: a/a                     [text]  
   creating: a/bin/
  inflating: a/bin/sh                [binary]
 extracting: a/binary.cr             [binary]
 extracting: a/binary.crlf           [binary]
 extracting: a/binary.lf             [binary]
 extracting: a/diff.cr               [text]  
 extracting: a/diff.crlf             [text]  
 extracting: a/diff.lf               [text]  
   creating: a/long_path_to_a_file/
   creating: a/long_path_to_a_file/long_path_to_a_file/
   creating: a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/
   creating: a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/
   creating: a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/
 extracting: a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/file_with_long_path  [text]  
 extracting: a/nodiff.cr             [binary]
 extracting: a/nodiff.crlf           [binary]
 extracting: a/nodiff.lf             [binary]
 extracting: a/substfile1            [text]  
 extracting: a/substfile2            [text]  
    linking: a/symlink_to_a          -> a 
 extracting: a/text.cr               [text]  
 extracting: a/text.crlf             [text]  
 extracting: a/text.lf               [text]  
finishing deferred symbolic links:
  a/symlink_to_a         -> a
ok 13 -  extract ZIP archive with EOL conversion

expecting success: 
		test_cmp_bin eol_d/a/text.cr eol_d/a/text.crlf &&
		test_cmp_bin eol_d/a/text.cr eol_d/a/text.lf
	
ok 14 -  validate that text files are converted

expecting success: 
		test_cmp_bin a/binary.cr   eol_d/a/binary.cr &&
		test_cmp_bin a/binary.crlf eol_d/a/binary.crlf &&
		test_cmp_bin a/binary.lf   eol_d/a/binary.lf
	
Cloning into 'sub1'...
ok 15 -  validate that binary files are unchanged

expecting success: 
		test_cmp_bin eol_d/a/diff.cr eol_d/a/diff.crlf &&
		test_cmp_bin eol_d/a/diff.cr eol_d/a/diff.lf
	
ok 4 - tar archive of empty tree with prefix

ok 16 -  validate that diff files are converted

checking prerequisite: UNZIP
expecting success: 
		test_cmp_bin a/nodiff.cr   eol_d/a/nodiff.cr &&
		test_cmp_bin a/nodiff.crlf eol_d/a/nodiff.crlf &&
		test_cmp_bin a/nodiff.lf   eol_d/a/nodiff.lf
	

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

)
ok 18 - apply_3way: 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
		)
	
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 5.2.1 20151028 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]
ok 17 -  validate that -diff files are unchanged

done.
expecting success: (cd bare.git && git archive --format=zip HEAD) >d1.zip
prerequisite UNZIP ok
expecting success: 
	# Detect the exit code produced when our particular flavor of unzip
	# sees an empty archive. Infozip will generate a warning and exit with
	# code 1. But in the name of sanity, we do not expect other unzip
	# implementations to do the same thing (it would be perfectly
	# reasonable to exit 0, for example).
	#
	# This makes our test less rigorous on some platforms (unzip may not
	# handle the empty repo at all, making our later check of its exit code
	# a no-op). But we cannot do anything reasonable except skip the test
	# on such platforms anyway, and this is the moral equivalent.
	{
		"$GIT_UNZIP" "$TEST_DIRECTORY"/t5004/empty.zip
		expect_code=$?
	} &&

	git archive --format=zip HEAD >empty.zip &&
	make_dir extract &&
	(
		cd extract &&
		test_expect_code $expect_code "$GIT_UNZIP" ../empty.zip
	) &&
	check_dir extract

Archive:  /«PKGBUILDDIR»/t/t5004/empty.zip
fc8e0d59c1cc5c14b6919fb2006b27fe337e7d0e
warning [/«PKGBUILDDIR»/t/t5004/empty.zip]:  zipfile is empty
Archive:  ../empty.zip
9155d424377fc5ad3558c9dc1f728788905910ad
warning [../empty.zip]:  zipfile is empty
ok 5 - zip archive of empty tree is empty

expecting success: 
	# We do not have to play exit-code tricks here, because our
	# result should not be empty; it has a directory in it.
	git archive --format=zip --prefix=foo/ HEAD >prefix.zip &&
	make_dir extract &&
	(
		cd extract &&
		"$GIT_UNZIP" ../prefix.zip
	) &&
	check_dir extract foo

Cloning into 'submodule_update'...
Archive:  ../prefix.zip
ok 18 - git archive --format=zip in a bare repo

9155d424377fc5ad3558c9dc1f728788905910ad
   creating: foo/
expecting success: test_cmp_bin d.zip d1.zip
ok 19 - git archive --format=zip vs. the same in a bare repo

expecting success: git archive --format=zip --output=d2.zip HEAD &&
    test_cmp_bin d.zip d2.zip
Submodule path 'sub1': checked out '912f7e75d9b2a9ea1bda5e8f2864195a1f540d4c'
done.
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 6 - zip archive of empty tree with prefix

expecting success: 
	test_must_fail git archive --format=tar HEAD -- foo >/dev/null

fatal: pathspec 'foo' did not match any files
ok 7 - archive complains about pathspec on empty tree

expecting success: 
	empty_tree=$(git hash-object -t tree /dev/null) &&
	root_tree=$(printf "040000 tree $empty_tree\tsub\n" | git mktree)

error: 8ed2e6719f8484ce01fa3ce133fe42d25c2441b8^{commit}: expected commit type, but the object dereferences to tree type
fatal: Needed a single revision
ok 8 - create a commit with an empty subtree

expecting success: 
	git archive --format=tar $root_tree >subtree-all.tar &&
	make_dir extract &&
	"$TAR" xf subtree-all.tar -C extract &&
	check_dir extract sub

Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
ok 20 - git archive --format=zip with --output

expecting success: 
	git archive --output=d3.zip HEAD &&
	test_cmp_bin d.zip d3.zip

ok 4 - am: 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
		)
	
ok 9 - archive empty subtree with no pathspec

expecting success: 
	git archive --format=tar $root_tree -- sub >subtree-path.tar &&
	make_dir extract &&
	"$TAR" xf subtree-path.tar -C extract &&
	check_dir extract sub

Cloning into 'submodule_update'...
ok 10 - archive empty subtree by direct pathspec

checking prerequisite: ZIPINFO

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	n=$("$ZIPINFO" "$TEST_DIRECTORY"/t5004/empty.zip | sed -n "2s/.* //p")
	test "x$n" = "x0"

)
ok 21 - git archive with --output, inferring format

expecting success: git archive --format=zip --prefix=prefix/ HEAD >e.zip
prerequisite ZIPINFO ok
expecting success: 
	# add a directory with 256 files
	mkdir 00 &&
	for a in 0 1 2 3 4 5 6 7 8 9 a b c d e f
	do
		for b in 0 1 2 3 4 5 6 7 8 9 a b c d e f
		do
			: >00/$a$b
		done
	done &&
	git add 00 &&
	git commit -m "256 files in 1 directory" &&

	# duplicate it to get 65536 files in 256 directories
	subtree=$(git write-tree --prefix=00/) &&
	for c in 0 1 2 3 4 5 6 7 8 9 a b c d e f
	do
		for d in 0 1 2 3 4 5 6 7 8 9 a b c d e f
		do
			echo "040000 tree $subtree	$c$d"
		done
	done >tree &&
	tree=$(git mktree <tree) &&

	# zip them
	git archive -o many.zip $tree &&

	# check the number of entries in the ZIP file directory
	expr 65536 + 256 >expect &&
	"$ZIPINFO" many.zip | head -2 | sed -n "2s/.* //p" >actual &&
	test_cmp expect actual

done.
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.
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/submodule_update_repo/.) registered for path 'sub1'
error: 8ed2e6719f8484ce01fa3ce133fe42d25c2441b8^{commit}: expected commit type, but the object dereferences to tree type
fatal: Needed a single revision
ok 22 - git archive --format=zip with prefix

expecting success: 
		(mkdir $dir && cd $dir && "$GIT_UNZIP" ../$zipfile)
	
Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
Archive:  ../e.zip
ad3d1cc9697401df09559d9744da5defd0046906
   creating: prefix/
   creating: prefix/a/
 extracting: prefix/a/a              
   creating: prefix/a/bin/
  inflating: prefix/a/bin/sh         [master 7ddf61d] 256 files in 1 directory
 Author: A U Thor <author@example.com>
 256 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 00/00
 create mode 100644 00/01
 create mode 100644 00/02
 create mode 100644 00/03
 create mode 100644 00/04
 create mode 100644 00/05
 create mode 100644 00/06
 create mode 100644 00/07
 create mode 100644 00/08
 create mode 100644 00/09
 create mode 100644 00/0a
 create mode 100644 00/0b
 create mode 100644 00/0c
 create mode 100644 00/0d
 create mode 100644 00/0e
 create mode 100644 00/0f
 create mode 100644 00/10
 create mode 100644 00/11
 create mode 100644 00/12
 create mode 100644 00/13
 create mode 100644 00/14
 create mode 100644 00/15
 create mode 100644 00/16
 create mode 100644 00/17
 create mode 100644 00/18
 create mode 100644 00/19
 create mode 100644 00/1a
 create mode 100644 00/1b
 create mode 100644 00/1c
 create mode 100644 00/1d
 create mode 100644 00/1e
 create mode 100644 00/1f
 create mode 100644 00/20
 create mode 100644 00/21
 create mode 100644 00/22
 create mode 100644 00/23
 create mode 100644 00/24
 create mode 100644 00/25
 create mode 100644 00/26
 create mode 100644 00/27
 create mode 100644 00/28
 create mode 100644 00/29
 create mode 100644 00/2a
 create mode 100644 00/2b
 create mode 100644 00/2c
 create mode 100644 00/2d
 create mode 100644 00/2e
 create mode 100644 00/2f
 create mode 100644 00/30
 create mode 100644 00/31
 create mode 100644 00/32
 create mode 100644 00/33
 create mode 100644 00/34
 create mode 100644 00/35
 create mode 100644 00/36
 create mode 100644 00/37
 create mode 100644 00/38
 create mode 100644 00/39
 create mode 100644 00/3a
 create mode 100644 00/3b
 create mode 100644 00/3c
 create mode 100644 00/3d
 create mode 100644 00/3e
 create mode 100644 00/3f
 create mode 100644 00/40
 create mode 100644 00/41
 create mode 100644 00/42
 create mode 100644 00/43
 create mode 100644 00/44
 create mode 100644 00/45
 create mode 100644 00/46
 create mode 100644 00/47
 create mode 100644 00/48
 create mode 100644 00/49
 create mode 100644 00/4a
 create mode 100644 00/4b
 create mode 100644 00/4c
 create mode 100644 00/4d
 create mode 100644 00/4e
 create mode 100644 00/4f
 create mode 100644 00/50
 create mode 100644 00/51
 create mode 100644 00/52
 create mode 100644 00/53
 create mode 100644 00/54
 create mode 100644 00/55
 create mode 100644 00/56
 create mode 100644 00/57
 create mode 100644 00/58
 create mode 100644 00/59
 create mode 100644 00/5a
 create mode 100644 00/5b
 create mode 100644 00/5c
 create mode 100644 00/5d
 create mode 100644 00/5e
 create mode 100644 00/5f
 create mode 100644 00/60
 create mode 100644 00/61
 create mode 100644 00/62
 create mode 100644 00/63
 create mode 100644 00/64
 create mode 100644 00/65
 create mode 100644 00/66
 create mode 100644 00/67
 create mode 100644 00/68
 create mode 100644 00/69
 create mode 100644 00/6a
 create mode 100644 00/6b
 create mode 100644 00/6c
 create mode 100644 00/6d
 create mode 100644 00/6e
 create mode 100644 00/6f
 create mode 100644 00/70
 create mode 100644 00/71
 create mode 100644 00/72
 create mode 100644 00/73
 create mode 100644 00/74
 create mode 100644 00/75
 create mode 100644 00/76
 create mode 100644 00/77
 create mode 100644 00/78
 create mode 100644 00/79
 create mode 100644 00/7a
 create mode 100644 00/7b
 create mode 100644 00/7c
 create mode 100644 00/7d
 create mode 100644 00/7e
 create mode 100644 00/7f
 create mode 100644 00/80
 create mode 100644 00/81
 create mode 100644 00/82
 create mode 100644 00/83
 create mode 100644 00/84
 create mode 100644 00/85
 create mode 100644 00/86
 create mode 100644 00/87
 create mode 100644 00/88
 create mode 100644 00/89
 create mode 100644 00/8a
 create mode 100644 00/8b
 create mode 100644 00/8c
 create mode 100644 00/8d
 create mode 100644 00/8e
 create mode 100644 00/8f
 create mode 100644 00/90
 create mode 100644 00/91
 create mode 100644 00/92
 create mode 100644 00/93
 create mode 100644 00/94
 create mode 100644 00/95
 create mode 100644 00/96
 create mode 100644 00/97
 create mode 100644 00/98
 create mode 100644 00/99
 create mode 100644 00/9a
 create mode 100644 00/9b
 create mode 100644 00/9c
 create mode 100644 00/9d
 create mode 100644 00/9e
 create mode 100644 00/9f
 create mode 100644 00/a0
 create mode 100644 00/a1
 create mode 100644 00/a2
 create mode 100644 00/a3
 create mode 100644 00/a4
 create mode 100644 00/a5
 create mode 100644 00/a6
 create mode 100644 00/a7
 create mode 100644 00/a8
 create mode 100644 00/a9
 create mode 100644 00/aa
 create mode 100644 00/ab
 create mode 100644 00/ac
 create mode 100644 00/ad
 create mode 100644 00/ae
 create mode 100644 00/af
 create mode 100644 00/b0
 create mode 100644 00/b1
 create mode 100644 00/b2
 create mode 100644 00/b3
 create mode 100644 00/b4
 create mode 100644 00/b5
 create mode 100644 00/b6
 create mode 100644 00/b7
 create mode 100644 00/b8
 create mode 100644 00/b9
 create mode 100644 00/ba
 create mode 100644 00/bb
 create mode 100644 00/bc
 create mode 100644 00/bd
 create mode 100644 00/be
 create mode 100644 00/bf
 create mode 100644 00/c0
 create mode 100644 00/c1
 create mode 100644 00/c2
 create mode 100644 00/c3
 create mode 100644 00/c4
 create mode 100644 00/c5
 create mode 100644 00/c6
 create mode 100644 00/c7
 create mode 100644 00/c8
 create mode 100644 00/c9
 create mode 100644 00/ca
 create mode 100644 00/cb
 create mode 100644 00/cc
 create mode 100644 00/cd
 create mode 100644 00/ce
 create mode 100644 00/cf
 create mode 100644 00/d0
 create mode 100644 00/d1
 create mode 100644 00/d2
 create mode 100644 00/d3
 create mode 100644 00/d4
 create mode 100644 00/d5
 create mode 100644 00/d6
 create mode 100644 00/d7
 create mode 100644 00/d8
 create mode 100644 00/d9
 create mode 100644 00/da
 create mode 100644 00/db
 create mode 100644 00/dc
 create mode 100644 00/dd
 create mode 100644 00/de
 create mode 100644 00/df
 create mode 100644 00/e0
 create mode 100644 00/e1
 create mode 100644 00/e2
 create mode 100644 00/e3
 create mode 100644 00/e4
 create mode 100644 00/e5
 create mode 100644 00/e6
 create mode 100644 00/e7
 create mode 100644 00/e8
 create mode 100644 00/e9
 create mode 100644 00/ea
 create mode 100644 00/eb
 create mode 100644 00/ec
 create mode 100644 00/ed
 create mode 100644 00/ee
 create mode 100644 00/ef
 create mode 100644 00/f0
 create mode 100644 00/f1
 create mode 100644 00/f2
 create mode 100644 00/f3
 create mode 100644 00/f4
 create mode 100644 00/f5
 create mode 100644 00/f6
 create mode 100644 00/f7
 create mode 100644 00/f8
 create mode 100644 00/f9
 create mode 100644 00/fa
 create mode 100644 00/fb
 create mode 100644 00/fc
 create mode 100644 00/fd
 create mode 100644 00/fe
 create mode 100644 00/ff

 extracting: prefix/a/binary.cr      
 extracting: prefix/a/binary.crlf    
 extracting: prefix/a/binary.lf      
 extracting: prefix/a/diff.cr        
 extracting: prefix/a/diff.crlf      
 extracting: prefix/a/diff.lf        
   creating: prefix/a/long_path_to_a_file/
   creating: prefix/a/long_path_to_a_file/long_path_to_a_file/
   creating: prefix/a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/
   creating: prefix/a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/
   creating: prefix/a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/
 extracting: prefix/a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/file_with_long_path  
 extracting: prefix/a/nodiff.cr      
 extracting: prefix/a/nodiff.crlf    
 extracting: prefix/a/nodiff.lf      
 extracting: prefix/a/substfile1     
 extracting: prefix/a/substfile2     
    linking: prefix/a/symlink_to_a   -> a 
 extracting: prefix/a/text.cr        
 extracting: prefix/a/text.crlf      
 extracting: prefix/a/text.lf        
finishing deferred symbolic links:
  prefix/a/symlink_to_a  -> a
Applying: Revert "Replace sub1 with directory"
ok 23 -  extract ZIP archive

expecting success: 
		(cd e/prefix/a && find .) | sort >e.lst &&
		test_cmp a.lst e.lst
	
ok 24 -  validate filenames

expecting success: 
		diff -r a e/prefix/a
	
ok 25 -  validate file contents

expecting success: 
		(mkdir $dir && cd $dir && "$GIT_UNZIP" -a ../$zipfile)
	
Archive:  ../e.zip
ad3d1cc9697401df09559d9744da5defd0046906
   creating: prefix/
   creating: prefix/a/
 extracting: prefix/a/a              [text]  
   creating: prefix/a/bin/
Cloning into 'sub1'...
  inflating: prefix/a/bin/sh         [binary]
 extracting: prefix/a/binary.cr      [binary]
 extracting: prefix/a/binary.crlf    [binary]
 extracting: prefix/a/binary.lf      [binary]
 extracting: prefix/a/diff.cr        [text]  
 extracting: prefix/a/diff.crlf      [text]  
 extracting: prefix/a/diff.lf        [text]  
   creating: prefix/a/long_path_to_a_file/
   creating: prefix/a/long_path_to_a_file/long_path_to_a_file/
   creating: prefix/a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/
   creating: prefix/a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/
   creating: prefix/a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/
 extracting: prefix/a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/file_with_long_path  [text]  
 extracting: prefix/a/nodiff.cr      [binary]
 extracting: prefix/a/nodiff.crlf    [binary]
 extracting: prefix/a/nodiff.lf      [binary]
 extracting: prefix/a/substfile1     [text]  
 extracting: prefix/a/substfile2     [text]  
    linking: prefix/a/symlink_to_a   -> a 
 extracting: prefix/a/text.cr        [text]  
 extracting: prefix/a/text.crlf      [text]  
 extracting: prefix/a/text.lf        [text]  
finishing deferred symbolic links:
  prefix/a/symlink_to_a  -> a
ok 26 -  extract ZIP archive with EOL conversion

expecting success: 
		test_cmp_bin eol_e/prefix/a/text.cr eol_e/prefix/a/text.crlf &&
		test_cmp_bin eol_e/prefix/a/text.cr eol_e/prefix/a/text.lf
	
ok 27 -  validate that text files are converted

expecting success: 
		test_cmp_bin a/binary.cr   eol_e/prefix/a/binary.cr &&
		test_cmp_bin a/binary.crlf eol_e/prefix/a/binary.crlf &&
		test_cmp_bin a/binary.lf   eol_e/prefix/a/binary.lf
	
ok 28 -  validate that binary files are unchanged

done.
expecting success: 
		test_cmp_bin eol_e/prefix/a/diff.cr eol_e/prefix/a/diff.crlf &&
		test_cmp_bin eol_e/prefix/a/diff.cr eol_e/prefix/a/diff.lf
	
ok 29 -  validate that diff files are converted

expecting success: 
		test_cmp_bin a/nodiff.cr   eol_e/prefix/a/nodiff.cr &&
		test_cmp_bin a/nodiff.crlf eol_e/prefix/a/nodiff.crlf &&
		test_cmp_bin a/nodiff.lf   eol_e/prefix/a/nodiff.lf
	
ok 30 -  validate that -diff files are unchanged

expecting success: 
	test_config core.bigfilethreshold 1 &&
	git archive -0 --format=zip HEAD >large.zip

ok 31 - git archive -0 --format=zip on large files

expecting success: 
		(mkdir $dir && cd $dir && "$GIT_UNZIP" ../$zipfile)
	
Archive:  ../large.zip
ad3d1cc9697401df09559d9744da5defd0046906
   creating: a/
 extracting: a/a                     
   creating: a/bin/
 extracting: a/bin/sh                
 extracting: a/binary.cr             
 extracting: a/binary.crlf           
 extracting: a/binary.lf             
 extracting: a/diff.cr               
 extracting: a/diff.crlf             
 extracting: a/diff.lf               
   creating: a/long_path_to_a_file/
   creating: a/long_path_to_a_file/long_path_to_a_file/
   creating: a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/
   creating: a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/
   creating: a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/
 extracting: a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/file_with_long_path  
 extracting: a/nodiff.cr             
 extracting: a/nodiff.crlf           
 extracting: a/nodiff.lf             
 extracting: a/substfile1            
 extracting: a/substfile2            
    linking: a/symlink_to_a          -> a 
 extracting: a/text.cr               
 extracting: a/text.crlf             
 extracting: a/text.lf               
finishing deferred symbolic links:
  a/symlink_to_a         -> a
ok 32 -  extract ZIP archive

expecting success: 
		(cd large/a && find .) | sort >large.lst &&
		test_cmp a.lst large.lst
	
ok 33 -  validate filenames

Submodule path 'sub1': checked out '613068f76d422f07de14d59bca708cacb8bb3c5b'
expecting success: 
		diff -r a large/a
	
ok 34 -  validate file contents

expecting success: 
		(mkdir $dir && cd $dir && "$GIT_UNZIP" -a ../$zipfile)
	
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule_update_repo/.) registered for path 'sub1'
Archive:  ../large.zip
ad3d1cc9697401df09559d9744da5defd0046906
   creating: a/
 extracting: a/a                     [text]  
   creating: a/bin/
 extracting: a/bin/sh                [binary]
 extracting: a/binary.cr             [binary]
 extracting: a/binary.crlf           [binary]
 extracting: a/binary.lf             [binary]
 extracting: a/diff.cr               [text]  
 extracting: a/diff.crlf             [text]  
 extracting: a/diff.lf               [text]  
   creating: a/long_path_to_a_file/
   creating: a/long_path_to_a_file/long_path_to_a_file/
   creating: a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/
   creating: a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/
   creating: a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/
 extracting: a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/file_with_long_path  [text]  
 extracting: a/nodiff.cr             [binary]
 extracting: a/nodiff.crlf           [binary]
 extracting: a/nodiff.lf             [binary]
 extracting: a/substfile1            [text]  
 extracting: a/substfile2            [text]  
    linking: a/symlink_to_a          -> a 
 extracting: a/text.cr               [text]  
 extracting: a/text.crlf             [text]  
 extracting: a/text.lf               [text]  
finishing deferred symbolic links:
  a/symlink_to_a         -> a
ok 35 -  extract ZIP archive with EOL conversion

expecting success: 
		test_cmp_bin eol_large/a/text.cr eol_large/a/text.crlf &&
		test_cmp_bin eol_large/a/text.cr eol_large/a/text.lf
	
ok 36 -  validate that text files are converted

expecting success: 
		test_cmp_bin a/binary.cr   eol_large/a/binary.cr &&
		test_cmp_bin a/binary.crlf eol_large/a/binary.crlf &&
		test_cmp_bin a/binary.lf   eol_large/a/binary.lf
	
ok 37 -  validate that binary files are unchanged

expecting success: 
		test_cmp_bin eol_large/a/diff.cr eol_large/a/diff.crlf &&
		test_cmp_bin eol_large/a/diff.cr eol_large/a/diff.lf
	
ok 38 -  validate that diff files are converted

expecting success: 
		test_cmp_bin a/nodiff.cr   eol_large/a/nodiff.cr &&
		test_cmp_bin a/nodiff.crlf eol_large/a/nodiff.crlf &&
		test_cmp_bin a/nodiff.lf   eol_large/a/nodiff.lf
	
ok 39 -  validate that -diff files are unchanged

expecting success: 
	test_config core.bigfilethreshold 1 &&
	git archive --format=zip HEAD >large-compressed.zip

Cloning into 'sub1'...
ok 19 - apply_3way: 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
		)
	
done.
Cloning into 'submodule_update'...
ok 40 - git archive --format=zip on large files

expecting success: 
		(mkdir $dir && cd $dir && "$GIT_UNZIP" ../$zipfile)
	
done.
Archive:  ../large-compressed.zip
ad3d1cc9697401df09559d9744da5defd0046906
   creating: a/
  inflating: a/a                     
   creating: a/bin/
  inflating: a/bin/sh                Submodule path 'sub1': checked out '912f7e75d9b2a9ea1bda5e8f2864195a1f540d4c'

  inflating: a/binary.cr             
  inflating: a/binary.crlf           
  inflating: a/binary.lf             
  inflating: a/diff.cr               
  inflating: a/diff.crlf             
  inflating: a/diff.lf               
   creating: a/long_path_to_a_file/
   creating: a/long_path_to_a_file/long_path_to_a_file/
   creating: a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/
   creating: a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/
   creating: a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/
  inflating: a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/file_with_long_path  
  inflating: a/nodiff.cr             
  inflating: a/nodiff.crlf           
  inflating: a/nodiff.lf             
 extracting: a/substfile1            
 extracting: a/substfile2            
    linking: a/symlink_to_a          -> a 
  inflating: a/text.cr               
  inflating: a/text.crlf             
  inflating: a/text.lf               
finishing deferred symbolic links:
  a/symlink_to_a         -> a
ok 41 -  extract ZIP archive

expecting success: 
		(cd large-compressed/a && find .) | sort >large-compressed.lst &&
		test_cmp a.lst large-compressed.lst
	
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 42 -  validate filenames

expecting success: 
		diff -r a large-compressed/a
	
ok 43 -  validate file contents

expecting success: 
		(mkdir $dir && cd $dir && "$GIT_UNZIP" -a ../$zipfile)
	
Archive:  ../large-compressed.zip
ad3d1cc9697401df09559d9744da5defd0046906
   creating: a/
  inflating: a/a                     [text]  
   creating: a/bin/
  inflating: a/bin/sh                [binary]
  inflating: a/binary.cr             [binary]
  inflating: a/binary.crlf           [binary]
  inflating: a/binary.lf             [binary]
  inflating: a/diff.cr               [text]  
  inflating: a/diff.crlf             [text]  
  inflating: a/diff.lf               [text]  
   creating: a/long_path_to_a_file/
   creating: a/long_path_to_a_file/long_path_to_a_file/
   creating: a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/
   creating: a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/
   creating: a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/
  inflating: a/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/long_path_to_a_file/file_with_long_path  [text]  
  inflating: a/nodiff.cr             [binary]
  inflating: a/nodiff.crlf           [binary]
  inflating: a/nodiff.lf             [binary]
 extracting: a/substfile1            [text]  
 extracting: a/substfile2            [text]  
    linking: a/symlink_to_a          -> a 
  inflating: a/text.cr               [text]  
  inflating: a/text.crlf             [text]  
  inflating: a/text.lf               [text]  
finishing deferred symbolic links:
  a/symlink_to_a         -> a
ok 44 -  extract ZIP archive with EOL conversion

expecting success: 
		test_cmp_bin eol_large-compressed/a/text.cr eol_large-compressed/a/text.crlf &&
		test_cmp_bin eol_large-compressed/a/text.cr eol_large-compressed/a/text.lf
	
ok 45 -  validate that text files are converted

expecting success: 
		test_cmp_bin a/binary.cr   eol_large-compressed/a/binary.cr &&
		test_cmp_bin a/binary.crlf eol_large-compressed/a/binary.crlf &&
		test_cmp_bin a/binary.lf   eol_large-compressed/a/binary.lf
	
ok 46 -  validate that binary files are unchanged

ok 5 - am: 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: 
		test_cmp_bin eol_large-compressed/a/diff.cr eol_large-compressed/a/diff.crlf &&
		test_cmp_bin eol_large-compressed/a/diff.cr eol_large-compressed/a/diff.lf
	
ok 47 -  validate that diff files are converted

expecting success: 
		test_cmp_bin a/nodiff.cr   eol_large-compressed/a/nodiff.cr &&
		test_cmp_bin a/nodiff.crlf eol_large-compressed/a/nodiff.crlf &&
		test_cmp_bin a/nodiff.lf   eol_large-compressed/a/nodiff.lf
	
ok 48 -  validate that -diff files are unchanged

# passed all 48 test(s)
1..48
Cloning into 'submodule_update'...
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/submodule_update_repo/.) registered for path 'sub1'
done.
*** t5100-mailinfo.sh ***
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5100-mailinfo/.git/
expecting success: git mailsplit -o. "$TEST_DIRECTORY"/t5100/sample.mbox >last &&
	last=`cat last` &&
	echo total is $last &&
	test `cat last` = 17
Cloning into 'sub1'...
total is 17
ok 1 - split sample box

expecting success: 
		check_mailinfo $mail "" &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--scissors
		then
			check_mailinfo $mail --scissors
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--no-inbody-headers
		then
			check_mailinfo $mail --no-inbody-headers
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--message-id
		then
			check_mailinfo $mail --message-id
		fi
	
ok 2 - mailinfo 0001

expecting success: 
		check_mailinfo $mail "" &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--scissors
		then
			check_mailinfo $mail --scissors
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--no-inbody-headers
		then
			check_mailinfo $mail --no-inbody-headers
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--message-id
		then
			check_mailinfo $mail --message-id
		fi
	
done.
ok 3 - mailinfo 0002

expecting success: 
		check_mailinfo $mail "" &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--scissors
		then
			check_mailinfo $mail --scissors
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--no-inbody-headers
		then
			check_mailinfo $mail --no-inbody-headers
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--message-id
		then
			check_mailinfo $mail --message-id
		fi
	
ok 4 - mailinfo 0003

expecting success: 
		check_mailinfo $mail "" &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--scissors
		then
			check_mailinfo $mail --scissors
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--no-inbody-headers
		then
			check_mailinfo $mail --no-inbody-headers
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--message-id
		then
			check_mailinfo $mail --message-id
		fi
	
ok 5 - mailinfo 0004

expecting success: 
		check_mailinfo $mail "" &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--scissors
		then
			check_mailinfo $mail --scissors
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--no-inbody-headers
		then
			check_mailinfo $mail --no-inbody-headers
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--message-id
		then
			check_mailinfo $mail --message-id
		fi
	
ok 6 - mailinfo 0005

expecting success: 
		check_mailinfo $mail "" &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--scissors
		then
			check_mailinfo $mail --scissors
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--no-inbody-headers
		then
			check_mailinfo $mail --no-inbody-headers
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--message-id
		then
			check_mailinfo $mail --message-id
		fi
	
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 7 - mailinfo 0006

expecting success: 
		check_mailinfo $mail "" &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--scissors
		then
			check_mailinfo $mail --scissors
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--no-inbody-headers
		then
			check_mailinfo $mail --no-inbody-headers
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--message-id
		then
			check_mailinfo $mail --message-id
		fi
	
ok 8 - mailinfo 0007

expecting success: 
		check_mailinfo $mail "" &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--scissors
		then
			check_mailinfo $mail --scissors
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--no-inbody-headers
		then
			check_mailinfo $mail --no-inbody-headers
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--message-id
		then
			check_mailinfo $mail --message-id
		fi
	
Submodule path 'sub1': checked out '613068f76d422f07de14d59bca708cacb8bb3c5b'
ok 9 - mailinfo 0008

expecting success: 
		check_mailinfo $mail "" &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--scissors
		then
			check_mailinfo $mail --scissors
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--no-inbody-headers
		then
			check_mailinfo $mail --no-inbody-headers
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--message-id
		then
			check_mailinfo $mail --message-id
		fi
	
ok 10 - mailinfo 0009

expecting success: 
		check_mailinfo $mail "" &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--scissors
		then
			check_mailinfo $mail --scissors
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--no-inbody-headers
		then
			check_mailinfo $mail --no-inbody-headers
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--message-id
		then
			check_mailinfo $mail --message-id
		fi
	
Cloning into 'sub1'...
ok 11 - mailinfo 0010

expecting success: 
		check_mailinfo $mail "" &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--scissors
		then
			check_mailinfo $mail --scissors
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--no-inbody-headers
		then
			check_mailinfo $mail --no-inbody-headers
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--message-id
		then
			check_mailinfo $mail --message-id
		fi
	
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
warning: unable to rmdir sub1: Directory not empty
ok 12 - mailinfo 0011

expecting success: 
		check_mailinfo $mail "" &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--scissors
		then
			check_mailinfo $mail --scissors
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--no-inbody-headers
		then
			check_mailinfo $mail --no-inbody-headers
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--message-id
		then
			check_mailinfo $mail --message-id
		fi
	
done.
ok 13 - mailinfo 0012

expecting success: 
		check_mailinfo $mail "" &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--scissors
		then
			check_mailinfo $mail --scissors
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--no-inbody-headers
		then
			check_mailinfo $mail --no-inbody-headers
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--message-id
		then
			check_mailinfo $mail --message-id
		fi
	
ok 14 - mailinfo 0013

expecting success: 
		check_mailinfo $mail "" &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--scissors
		then
			check_mailinfo $mail --scissors
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--no-inbody-headers
		then
			check_mailinfo $mail --no-inbody-headers
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--message-id
		then
			check_mailinfo $mail --message-id
		fi
	
ok 20 - apply_3way: 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 15 - mailinfo 0014

expecting success: 
		check_mailinfo $mail "" &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--scissors
		then
			check_mailinfo $mail --scissors
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--no-inbody-headers
		then
			check_mailinfo $mail --no-inbody-headers
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--message-id
		then
			check_mailinfo $mail --message-id
		fi
	
Submodule path 'sub1': checked out '912f7e75d9b2a9ea1bda5e8f2864195a1f540d4c'
ok 16 - mailinfo 0015

expecting success: 
		check_mailinfo $mail "" &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--scissors
		then
			check_mailinfo $mail --scissors
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--no-inbody-headers
		then
			check_mailinfo $mail --no-inbody-headers
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--message-id
		then
			check_mailinfo $mail --message-id
		fi
	
Cloning into 'submodule_update'...
ok 17 - mailinfo 0016

expecting success: 
		check_mailinfo $mail "" &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--scissors
		then
			check_mailinfo $mail --scissors
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--no-inbody-headers
		then
			check_mailinfo $mail --no-inbody-headers
		fi &&
		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--message-id
		then
			check_mailinfo $mail --message-id
		fi
	
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
done.
ok 18 - mailinfo 0017

expecting success: mkdir rfc2047 &&
	git mailsplit -orfc2047 "$TEST_DIRECTORY"/t5100/rfc2047-samples.mbox \
	  >rfc2047/last &&
	last=`cat rfc2047/last` &&
	echo total is $last &&
	test `cat rfc2047/last` = 11
Applying: Revert "Add sub1"
warning: unable to rmdir sub1: Directory not empty
total is 11
ok 19 - split box with rfc2047 samples

expecting success: 
		git mailinfo -u $mail-msg $mail-patch <$mail >$mail-info &&
		echo msg &&
		test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-msg &&
		echo patch &&
		test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-patch &&
		echo info &&
		test_cmp "$TEST_DIRECTORY"/t5100/rfc2047-info-$(basename $mail) $mail-info
	
Switched to a new branch 'add_sub1'
msg
Branch add_sub1 set up to track remote branch add_sub1 from origin.
patch
info
ok 20 - mailinfo rfc2047/0001

expecting success: 
		git mailinfo -u $mail-msg $mail-patch <$mail >$mail-info &&
		echo msg &&
		test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-msg &&
		echo patch &&
		test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-patch &&
		echo info &&
		test_cmp "$TEST_DIRECTORY"/t5100/rfc2047-info-$(basename $mail) $mail-info
	
msg
patch
info
ok 21 - mailinfo rfc2047/0002

expecting success: 
		git mailinfo -u $mail-msg $mail-patch <$mail >$mail-info &&
		echo msg &&
		test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-msg &&
		echo patch &&
		test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-patch &&
		echo info &&
		test_cmp "$TEST_DIRECTORY"/t5100/rfc2047-info-$(basename $mail) $mail-info
	
msg
patch
info
ok 22 - mailinfo rfc2047/0003

expecting success: 
		git mailinfo -u $mail-msg $mail-patch <$mail >$mail-info &&
		echo msg &&
		test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-msg &&
		echo patch &&
		test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-patch &&
		echo info &&
		test_cmp "$TEST_DIRECTORY"/t5100/rfc2047-info-$(basename $mail) $mail-info
	
msg
patch
info
ok 6 - am: 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 23 - mailinfo rfc2047/0004

expecting success: 
		git mailinfo -u $mail-msg $mail-patch <$mail >$mail-info &&
		echo msg &&
		test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-msg &&
		echo patch &&
		test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-patch &&
		echo info &&
		test_cmp "$TEST_DIRECTORY"/t5100/rfc2047-info-$(basename $mail) $mail-info
	
msg
patch
info
ok 24 - mailinfo rfc2047/0005

expecting success: 
		git mailinfo -u $mail-msg $mail-patch <$mail >$mail-info &&
		echo msg &&
		test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-msg &&
		echo patch &&
		test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-patch &&
		echo info &&
		test_cmp "$TEST_DIRECTORY"/t5100/rfc2047-info-$(basename $mail) $mail-info
	
msg
patch
info
ok 25 - mailinfo rfc2047/0006

expecting success: 
		git mailinfo -u $mail-msg $mail-patch <$mail >$mail-info &&
		echo msg &&
		test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-msg &&
		echo patch &&
		test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-patch &&
		echo info &&
		test_cmp "$TEST_DIRECTORY"/t5100/rfc2047-info-$(basename $mail) $mail-info
	
msg
patch
info
ok 26 - mailinfo rfc2047/0007

expecting success: 
		git mailinfo -u $mail-msg $mail-patch <$mail >$mail-info &&
		echo msg &&
		test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-msg &&
		echo patch &&
		test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-patch &&
		echo info &&
		test_cmp "$TEST_DIRECTORY"/t5100/rfc2047-info-$(basename $mail) $mail-info
	
msg
patch
info
ok 27 - mailinfo rfc2047/0008

expecting success: 
		git mailinfo -u $mail-msg $mail-patch <$mail >$mail-info &&
		echo msg &&
		test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-msg &&
		echo patch &&
		test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-patch &&
		echo info &&
		test_cmp "$TEST_DIRECTORY"/t5100/rfc2047-info-$(basename $mail) $mail-info
	
Cloning into 'submodule_update'...
msg
patch
info
ok 28 - mailinfo rfc2047/0009

expecting success: 
		git mailinfo -u $mail-msg $mail-patch <$mail >$mail-info &&
		echo msg &&
		test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-msg &&
		echo patch &&
		test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-patch &&
		echo info &&
		test_cmp "$TEST_DIRECTORY"/t5100/rfc2047-info-$(basename $mail) $mail-info
	
msg
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/submodule_update_repo/.) registered for path 'sub1'
patch
info
done.
ok 29 - mailinfo rfc2047/0010

expecting success: 
		git mailinfo -u $mail-msg $mail-patch <$mail >$mail-info &&
		echo msg &&
		test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-msg &&
		echo patch &&
		test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-patch &&
		echo info &&
		test_cmp "$TEST_DIRECTORY"/t5100/rfc2047-info-$(basename $mail) $mail-info
	
msg
patch
info
ok 30 - mailinfo rfc2047/0011

expecting success: 

	git mailsplit -d3 -o. "$TEST_DIRECTORY"/t5100/nul-plain &&
	test_cmp "$TEST_DIRECTORY"/t5100/nul-plain 001 &&
	(cat 001 | git mailinfo msg patch) &&
	test_line_count = 4 patch


1
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.

ok 31 - respect NULs

expecting success: 

	git mailsplit -d5 -o. "$TEST_DIRECTORY"/t5100/nul-b64.in &&
	test_cmp "$TEST_DIRECTORY"/t5100/nul-b64.in 00001 &&
	git mailinfo msg patch <00001 &&
	test_cmp "$TEST_DIRECTORY"/t5100/nul-b64.expect patch


1
Author: Junio C Hamano
Email: gitster@pobox.com
Subject: second
Date: Sun, 25 May 2008 00:38:18 -0700

ok 32 - Preserve NULs out of MIME encoded message

expecting success: 

	mkdir info-from &&
	git mailsplit -oinfo-from "$TEST_DIRECTORY"/t5100/info-from.in &&
	test_cmp "$TEST_DIRECTORY"/t5100/info-from.in info-from/0001 &&
	git mailinfo info-from/msg info-from/patch \
	  <info-from/0001 >info-from/out &&
	test_cmp "$TEST_DIRECTORY"/t5100/info-from.expect info-from/out


1
Cloning into 'sub1'...
ok 33 - mailinfo on from header without name works

expecting success: 
	mkdir embed-from &&
	git mailsplit -oembed-from "$TEST_DIRECTORY"/t5100/embed-from.in &&
	test_cmp "$TEST_DIRECTORY"/t5100/embed-from.in embed-from/0001 &&
	git mailinfo embed-from/msg embed-from/patch \
	  <embed-from/0001 >embed-from/out &&
	test_cmp "$TEST_DIRECTORY"/t5100/embed-from.expect embed-from/out

1
done.
ok 34 - mailinfo finds headers after embedded From line

expecting success: 
	mkdir quoted-from &&
	git mailsplit -oquoted-from "$TEST_DIRECTORY"/t5100/quoted-from.in &&
	test_cmp "$TEST_DIRECTORY"/t5100/quoted-from.in quoted-from/0001 &&
	git mailinfo quoted-from/msg quoted-from/patch \
	  <quoted-from/0001 >quoted-from/out &&
	test_cmp "$TEST_DIRECTORY"/t5100/quoted-from.expect quoted-from/msg

1
ok 35 - mailinfo on message with quoted >From

# passed all 35 test(s)
1..35
*** t5150-request-pull.sh ***
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule_update_repo/.) registered for path 'sub1'
Submodule path 'sub1': checked out '613068f76d422f07de14d59bca708cacb8bb3c5b'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5150-request-pull/.git/
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
expecting success: 

	git init --bare upstream.git &&
	git init --bare downstream.git &&
	git clone upstream.git upstream-private &&
	git clone downstream.git local &&

	trash_url="file://$TRASH_DIRECTORY" &&
	downstream_url="$trash_url/downstream.git/" &&
	upstream_url="$trash_url/upstream.git/" &&

	(
		cd upstream-private &&
		cat <<-\EOT >mnemonic.txt &&
		Thirtey days hath November,
		Aprile, June, and September:
		EOT
		git add mnemonic.txt &&
		test_tick &&
		git commit -m "\"Thirty days\", a reminder of month lengths" &&
		git tag -m "version 1" -a initial &&
		git push --tags origin master
	) &&
	(
		cd local &&
		git remote add upstream "$trash_url/upstream.git" &&
		git fetch upstream &&
		git pull upstream master &&
		cat <<-\EOT >>mnemonic.txt &&
		Of twyecescore-eightt is but eine,
		And all the remnante be thrycescore-eine.
		O’course Leap yare comes an’pynes,
		Ev’rie foure yares, gote it ryghth.
		An’twyecescore-eight is but twyecescore-nyne.
		EOT
		git add mnemonic.txt &&
		test_tick &&
		git commit -m "More detail" &&
		git tag -m "version 2" -a full &&
		git checkout -b simplify HEAD^ &&
		mv mnemonic.txt mnemonic.standard &&
		cat <<-\EOT >mnemonic.clarified &&
		Thirty days has September,
		All the rest I can’t remember.
		EOT
		git add -N mnemonic.standard mnemonic.clarified &&
		git commit -a -m "Adapt to use modern, simpler English

But keep the old version, too, in case some people prefer it." &&
		git checkout master
	)


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5150-request-pull/upstream.git/
Cloning into 'sub1'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5150-request-pull/downstream.git/
Cloning into 'upstream-private'...
done.
warning: You appear to have cloned an empty repository.
done.
Cloning into 'local'...
warning: unable to rmdir sub1: Directory not empty
warning: You appear to have cloned an empty repository.
done.
[master (root-commit) 7244768] "Thirty days", a reminder of month lengths
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+)
 create mode 100644 mnemonic.txt
Submodule path 'sub1': checked out '912f7e75d9b2a9ea1bda5e8f2864195a1f540d4c'
ok 21 - apply_3way: 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
		)
	
To /«PKGBUILDDIR»/t/trash directory.t5150-request-pull/upstream.git
 * [new branch]      master -> master
 * [new tag]         initial -> initial
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
From file:///«PKGBUILDDIR»/t/trash directory.t5150-request-pull/upstream
 * [new branch]      master     -> upstream/master
 * [new tag]         initial    -> initial
Cloning into 'submodule_update'...
Applying: Revert "Add sub1"
warning: unable to rmdir sub1: Directory not empty
done.
From file:///«PKGBUILDDIR»/t/trash directory.t5150-request-pull/upstream
 * branch            master     -> FETCH_HEAD
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
[master cc0f4ce] More detail
 Author: A U Thor <author@example.com>
 1 file changed, 5 insertions(+)
Switched to a new branch 'simplify'
[simplify 6fa5b4f] Adapt to use modern, simpler English
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 mnemonic.clarified
 rename mnemonic.txt => mnemonic.standard (100%)
ok 7 - am: 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
		)
	
Switched to branch 'master'
Your branch is based on 'origin/master', but the upstream is gone.
  (use "git branch --unset-upstream" to fixup)
ok 1 - setup

expecting success: 

	downstream_url_for_sed=$(
		printf "%s\n" "$downstream_url" |
		sed -e 's/\\/\\\\/g' -e 's/[[/.*^$]/\\&/g'
	) &&

	cat <<-\EOT >read-request.sed &&
	#!/bin/sed -nf
	# Note that a request could ask for "tag $tagname"
	/ in the git repository at:$/!d
	n
	/^$/ n
	s/ tag \([^ ]*\)$/ tag--\1/
	s/^[ 	]*\(.*\) \([^ ]*\)/please pull\
	\1\
	\2/p
	q
	EOT

	cat <<-EOT >fuzz.sed
	#!/bin/sed -nf
	s/$downstream_url_for_sed/URL/g
	s/$_x40/OBJECT_NAME/g
	s/A U Thor/AUTHOR/g
	s/[-0-9]\{10\} [:0-9]\{8\} [-+][0-9]\{4\}/DATE/g
	s/        [^ ].*/        SUBJECT/g
	s/  [^ ].* (DATE)/  SUBJECT (DATE)/g
	s|tags/full|BRANCH|g
	s/mnemonic.txt/FILENAME/g
	s/^version [0-9]/VERSION/
	/^ FILENAME | *[0-9]* [-+]*\$/ b diffstat
	/^AUTHOR ([0-9]*):\$/ b shortlog
	p
	b
	: diffstat
	n
	/ [0-9]* files* changed/ {
		a\\
	DIFFSTAT
		b
	}
	b diffstat
	: shortlog
	/^        [a-zA-Z]/ n
	/^[a-zA-Z]* ([0-9]*):\$/ n
	/^\$/ N
	/^\n[a-zA-Z]* ([0-9]*):\$/!{
		a\\
	SHORTLOG
		D
	}
	n
	b shortlog
	EOT


ok 2 - setup: two scripts for reading pull requests

expecting success: 

	rm -fr downstream.git &&
	git init --bare downstream.git &&
	(
		cd local &&
		git checkout initial &&
		git merge --ff-only master &&
		test_must_fail git request-pull initial "$downstream_url" \
			2>../err
	) &&
	grep "No match for commit .*" err &&
	grep "Are you sure you pushed" err


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5150-request-pull/downstream.git/
Note: checking out 'initial'.

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 7244768... "Thirty days", a reminder of month lengths
Updating 7244768..cc0f4ce
Fast-forward
Cloning into 'submodule_update'...
 mnemonic.txt | 5 +++++
 1 file changed, 5 insertions(+)
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/submodule_update_repo/.) registered for path 'sub1'
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Cloning into 'sub1'...
done.
The following changes since commit 7244768f7e34b5fbdf65e26dda6c138d29596555:

  "Thirty days", a reminder of month lengths (2005-04-07 15:13:13 -0700)

are available in the git repository at:

  file:///«PKGBUILDDIR»/t/trash directory.t5150-request-pull/downstream.git/ 

for you to fetch changes up to cc0f4cedef2d8246b90a5255caa6a61ad760ad56:

  More detail (2005-04-07 15:13:13 -0700)

----------------------------------------------------------------
A U Thor (1):
      More detail

 mnemonic.txt | 5 +++++
 1 file changed, 5 insertions(+)
warn: No match for commit cc0f4cedef2d8246b90a5255caa6a61ad760ad56 found at file:///«PKGBUILDDIR»/t/trash directory.t5150-request-pull/downstream.git/
warn: Are you sure you pushed 'HEAD' there?
ok 3 - pull request when forgot to push

expecting success: 

	rm -fr downstream.git &&
	git init --bare downstream.git &&
	(
		cd local &&
		git checkout initial &&
		git merge --ff-only master &&
		git push origin master:for-upstream &&
		git request-pull initial origin master:for-upstream >../request
	) &&
	sed -nf read-request.sed <request >digest &&
	cat digest &&
	{
		read task &&
		read repository &&
		read branch
	} <digest &&
	(
		cd upstream-private &&
		git checkout initial &&
		git pull --ff-only "$repository" "$branch"
	) &&
	test "$branch" = for-upstream &&
	test_cmp local/mnemonic.txt upstream-private/mnemonic.txt


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5150-request-pull/downstream.git/
Previous HEAD position was cc0f4ce... More detail
HEAD is now at 7244768... "Thirty days", a reminder of month lengths
Submodule path 'sub1': checked out '613068f76d422f07de14d59bca708cacb8bb3c5b'
Updating 7244768..cc0f4ce
Fast-forward
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule_update_repo/.) registered for path 'sub1'
 mnemonic.txt | 5 +++++
 1 file changed, 5 insertions(+)
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
Falling back to three-way merge...
error: sub1/file1: does not exist in index
error: cannot read the current contents of 'sub1/file1'
error: sub1/file1: patch does not apply
Falling back to three-way merge...
error: sub1/file2: does not exist in index
error: cannot read the current contents of 'sub1/file2'
error: sub1/file2: patch does not apply
To /«PKGBUILDDIR»/t/trash directory.t5150-request-pull/downstream.git
 * [new branch]      master -> for-upstream
Cloning into 'sub1'...
done.
ok 22 - apply_3way: 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
		)
	
please pull
/«PKGBUILDDIR»/t/trash directory.t5150-request-pull/downstream.git
for-upstream
Cloning into 'submodule_update'...
Note: checking out 'initial'.

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 7244768... "Thirty days", a reminder of month lengths
Submodule path 'sub1': checked out '912f7e75d9b2a9ea1bda5e8f2864195a1f540d4c'
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
From /«PKGBUILDDIR»/t/trash directory.t5150-request-pull/downstream
 * branch            for-upstream -> FETCH_HEAD
Applying: Replace sub1 with directory
Updating 7244768..cc0f4ce
Fast-forward
error: sub1/file1: already exists in working directory
error: sub1/file2: already exists in working directory
Patch failed at 0001 Replace sub1 with directory
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
 mnemonic.txt | 5 +++++
 1 file changed, 5 insertions(+)
ok 4 - pull request after push

expecting success: 

	rm -fr downstream.git &&
	git init --bare downstream.git &&
	(
		cd local &&
		git checkout initial &&
		git merge --ff-only master &&
		git push --tags origin master simplify &&
		git push origin master:for-upstream &&
		git request-pull initial "$downstream_url" >../request
	) &&
	sed -nf read-request.sed <request >digest &&
	cat digest &&
	{
		read task &&
		read repository &&
		read branch
	} <digest &&
	test -z "$branch"


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5150-request-pull/downstream.git/
Previous HEAD position was cc0f4ce... More detail
HEAD is now at 7244768... "Thirty days", a reminder of month lengths
Updating 7244768..cc0f4ce
Fast-forward
 mnemonic.txt | 5 +++++
 1 file changed, 5 insertions(+)
ok 8 - am: 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
		)
	
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/submodule_update_repo/.) registered for path 'sub1'
To /«PKGBUILDDIR»/t/trash directory.t5150-request-pull/downstream.git
 * [new branch]      master -> master
 * [new branch]      simplify -> simplify
 * [new tag]         full -> full
 * [new tag]         initial -> initial
Cloning into 'submodule_update'...
done.
To /«PKGBUILDDIR»/t/trash directory.t5150-request-pull/downstream.git
 * [new branch]      master -> for-upstream
Cloning into 'sub1'...
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
done.
please pull
file:///«PKGBUILDDIR»/t/trash directory.t5150-request-pull/downstream.git/

ok 5 - request asks HEAD to be pulled

expecting success: 

	rm -fr downstream.git &&
	git init --bare downstream.git &&
	cat <<-\EOT >expect &&
	The following changes since commit OBJECT_NAME:

	  SUBJECT (DATE)

	are available in the git repository at:

	  URL BRANCH

	for you to fetch changes up to OBJECT_NAME:

	  SUBJECT (DATE)

	----------------------------------------------------------------
	VERSION

	----------------------------------------------------------------
	SHORTLOG

	DIFFSTAT
	EOT
	(
		cd local &&
		git checkout initial &&
		git merge --ff-only master &&
		git push origin tags/full &&
		git request-pull initial "$downstream_url" tags/full >../request
	) &&
	<request sed -nf fuzz.sed >request.fuzzy &&
	test_i18ncmp expect request.fuzzy &&

	(
		cd local &&
		git request-pull initial "$downstream_url" tags/full:refs/tags/full
	) >request &&
	sed -nf fuzz.sed <request >request.fuzzy &&
	test_i18ncmp expect request.fuzzy &&

	(
		cd local &&
		git request-pull initial "$downstream_url" full
	) >request &&
	grep " tags/full\$" request

Submodule path 'sub1': checked out '613068f76d422f07de14d59bca708cacb8bb3c5b'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5150-request-pull/downstream.git/
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
Previous HEAD position was cc0f4ce... More detail
HEAD is now at 7244768... "Thirty days", a reminder of month lengths
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule_update_repo/.) registered for path 'sub1'
Updating 7244768..cc0f4ce
Fast-forward
 mnemonic.txt | 5 +++++
 1 file changed, 5 insertions(+)
Falling back to three-way merge...
error: sub1/file1: does not exist in index
error: cannot read the current contents of 'sub1/file1'
error: sub1/file1: patch does not apply
Falling back to three-way merge...
error: sub1/file2: does not exist in index
error: cannot read the current contents of 'sub1/file2'
error: sub1/file2: patch does not apply
To /«PKGBUILDDIR»/t/trash directory.t5150-request-pull/downstream.git
 * [new tag]         full -> full
Cloning into 'sub1'...
done.
ok 23 - apply_3way: 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
		)
	
Submodule path 'sub1': checked out '912f7e75d9b2a9ea1bda5e8f2864195a1f540d4c'
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
Cloning into 'submodule_update'...
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Applying: Replace sub1 with directory
error: sub1/file1: already exists in working directory
error: sub1/file2: already exists in working directory
Patch failed at 0001 Replace sub1 with directory
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
ok 9 - am: 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
		)
	
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/submodule_update_repo/.) registered for path 'sub1'
  file:///«PKGBUILDDIR»/t/trash directory.t5150-request-pull/downstream.git/ tags/full
ok 6 - pull request format

expecting success: 

	(
		cd local &&
		OPTIONS_KEEPDASHDASH=Yes &&
		export OPTIONS_KEEPDASHDASH &&
		git checkout initial &&
		git merge --ff-only master &&
		git push origin master:for-upstream &&
		git request-pull -- initial "$downstream_url" master:for-upstream >../request
	)


Previous HEAD position was cc0f4ce... More detail
HEAD is now at 7244768... "Thirty days", a reminder of month lengths
Updating 7244768..cc0f4ce
Fast-forward
 mnemonic.txt | 5 +++++
 1 file changed, 5 insertions(+)
Cloning into 'sub1'...
Cloning into 'submodule_update'...
To /«PKGBUILDDIR»/t/trash directory.t5150-request-pull/downstream.git
 * [new branch]      master -> for-upstream
done.
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Submodule path 'sub1': checked out '613068f76d422f07de14d59bca708cacb8bb3c5b'
ok 7 - request-pull ignores OPTIONS_KEEPDASHDASH poison

# passed all 7 test(s)
1..7
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
warning: unable to rmdir sub1: Directory not empty
fatal: unable to write file 'sub1' mode 100644: Directory not empty
'actual' is not empty, it contains:
*** t5300-pack-object.sh ***
:100644 100644 1b52e94c4a64cb0f66e5ac63bf7612443af0bb91 0000000000000000000000000000000000000000 M	.gitmodules
not ok 24 - apply_3way: 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
		)
	
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule_update_repo/.) registered for path 'sub1'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5300-pack-object/.git/
expecting success: rm -f .git/index* &&
     perl -e "print \"a\" x 4096;" > a &&
     perl -e "print \"b\" x 4096;" > b &&
     perl -e "print \"c\" x 4096;" > c &&
     test-genrandom "seed a" 2097152 > a_big &&
     test-genrandom "seed b" 2097152 > b_big &&
     git update-index --add a a_big b b_big c &&
     cat c >d && echo foo >>d && git update-index --add d &&
     tree=`git write-tree` &&
     commit=`git commit-tree $tree </dev/null` && {
	 echo $tree &&
	 echo $commit &&
	 git ls-tree $tree | sed -e "s/.* \\([0-9a-f]*\\)	.*/\\1/"
     } >obj-list && {
	 git diff-tree --root -p $commit &&
	 while read object
	 do
	    t=`git cat-file -t $object` &&
	    git cat-file $t $object || return 1
	 done <obj-list
     } >expect
Cloning into 'submodule_update'...
Cloning into 'sub1'...
done.
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Submodule path 'sub1': checked out '912f7e75d9b2a9ea1bda5e8f2864195a1f540d4c'
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
Applying: Replace sub1 with file
warning: unable to rmdir sub1: Directory not empty
fatal: unable to write file 'sub1' mode 100644: Directory not empty
Patch failed at 0001 Replace sub1 with file
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/submodule_update_repo/.) registered for path 'sub1'
'actual' is not empty, it contains:
:100644 100644 1b52e94c4a64cb0f66e5ac63bf7612443af0bb91 0000000000000000000000000000000000000000 M	.gitmodules
not ok 10 - am: 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
		)
	
Cloning into 'sub1'...
done.
Cloning into 'submodule_update'...
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Submodule path 'sub1': checked out '613068f76d422f07de14d59bca708cacb8bb3c5b'
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
warning: unable to rmdir sub1: Directory not empty
fatal: unable to write file 'sub1' mode 100644: Directory not empty
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule_update_repo/.) registered for path 'sub1'
'actual' is not empty, it contains:
:100644 100644 1b52e94c4a64cb0f66e5ac63bf7612443af0bb91 0000000000000000000000000000000000000000 M	.gitmodules
not ok 25 - apply_3way: 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
		)
	
Cloning into 'sub1'...
done.
Cloning into 'submodule_update'...
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Submodule path 'sub1': checked out '912f7e75d9b2a9ea1bda5e8f2864195a1f540d4c'
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
Applying: Replace sub1 with file
warning: unable to rmdir sub1: Directory not empty
fatal: unable to write file 'sub1' mode 100644: Directory not empty
Patch failed at 0001 Replace sub1 with file
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
'actual' is not empty, it contains:
:100644 100644 1b52e94c4a64cb0f66e5ac63bf7612443af0bb91 0000000000000000000000000000000000000000 M	.gitmodules
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/submodule_update_repo/.) registered for path 'sub1'
not ok 11 - am: 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
		)
	
Cloning into 'sub1'...
done.
Cloning into 'submodule_update'...
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Submodule path 'sub1': checked out '613068f76d422f07de14d59bca708cacb8bb3c5b'
Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
warning: unable to rmdir sub1: Directory not empty
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'sub1'...
done.
Submodule path 'sub1': checked out '5cc407e1d291a6ad6718e3f1e88fdaa4cc2b4ddd'
Submodule path 'sub1': checked out '912f7e75d9b2a9ea1bda5e8f2864195a1f540d4c'
ok 26 - apply_3way: 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
		)
	
Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
Applying: Modify sub1
warning: unable to rmdir sub1: Directory not empty
Cloning into 'submodule_update'...
done.
ok 1 - setup

expecting success: packname_1=$(git pack-objects --window=0 test-1 <obj-list)
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/submodule_update_repo/.) registered for path 'sub1'
Submodule path 'sub1': checked out '7c11438d55b7d735712486d76a499d3ef1033d4c'
ok 12 - am: 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
		)
	
Cloning into 'sub1'...
done.
Cloning into 'submodule_update'...
done.
Submodule path 'sub1': checked out '613068f76d422f07de14d59bca708cacb8bb3c5b'
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
warning: unable to rmdir sub1: Directory not empty
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'sub1'...
done.
fatal: reference is not a tree: 0123456789012345678901234567890123456789
Unable to checkout '0123456789012345678901234567890123456789' in submodule path 'sub1'
Submodule path 'sub1': checked out '912f7e75d9b2a9ea1bda5e8f2864195a1f540d4c'
ok 27 - apply_3way: 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
		)
	
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
Cloning into 'submodule_update'...
Applying: Invalid sub1 commit
warning: unable to rmdir sub1: Directory not empty
done.
Switched to a new branch 'invalid_sub1'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
fatal: Needed a single revision
Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
ok 2 - pack without delta

expecting success: test_must_fail git pack-objects --window=0 test-1 blah blah <obj-list
usage: git pack-objects --stdout [<options>...] [< <ref-list> | < <object-list>]
   or: git pack-objects [<options>...] <base-name> [< <ref-list> | < <object-list>]

    -q, --quiet           do not show progress meter
    --progress            show progress meter
    --all-progress        show progress meter during object writing phase
    --all-progress-implied
                          similar to --all-progress when progress meter is shown
    --index-version <version[,offset]>
                          write the pack index file in the specified idx format version
    --max-pack-size <n>   maximum size of each output pack file
    --local               ignore borrowed objects from alternate object store
    --incremental         ignore packed objects
    --window <n>          limit pack window by objects
    --window-memory <n>   limit pack window by memory in addition to object limit
    --depth <n>           maximum length of delta chain allowed in the resulting pack
    --reuse-delta         reuse existing deltas
    --reuse-object        reuse existing objects
    --delta-base-offset   use OFS_DELTA objects
    --threads <n>         use threads when searching for best delta matches
    --non-empty           do not create an empty pack output
    --revs                read revision arguments from standard input
    --unpacked            limit the objects to those that are not yet packed
    --all                 include objects reachable from any reference
    --reflog              include objects referred by reflog entries
    --indexed-objects     include objects referred to by the index
    --stdout              output pack to stdout
    --include-tag         include tag objects that refer to objects to be packed
    --keep-unreachable    keep unreachable objects
    --unpack-unreachable[=<time>]
                          unpack unreachable objects newer than <time>
    --thin                create thin packs
    --shallow             create packs suitable for shallow fetches
    --honor-pack-keep     ignore packs that have companion .keep file
    --compression <n>     pack compression level
    --keep-true-parents   do not hide commits by grafts
    --use-bitmap-index    use a bitmap index if available to speed up counting objects
    --write-bitmap-index  write a bitmap index together with the pack index

ok 3 - pack-objects with bogus arguments

expecting success: GIT_OBJECT_DIRECTORY=.git2/objects &&
     export GIT_OBJECT_DIRECTORY &&
     git init &&
     git unpack-objects -n <test-1-6a0af710a6468334a8152e4eaf18c75998e78755.pack &&
     git unpack-objects <test-1-6a0af710a6468334a8152e4eaf18c75998e78755.pack
Reinitialized existing Git repository in /«PKGBUILDDIR»/t/trash directory.t5300-pack-object/.git/
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4137-apply-submodule/submodule_update_repo/.) registered for path 'sub1'
fatal: reference is not a tree: 0123456789012345678901234567890123456789
Unable to checkout '0123456789012345678901234567890123456789' in submodule path 'sub1'
Cloning into 'sub1'...
ok 13 - am: 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
		)
	
done.
Cloning into 'submodule_update'...
done.
Switched to a new branch 'invalid_sub1'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
Submodule path 'sub1': checked out '613068f76d422f07de14d59bca708cacb8bb3c5b'
fatal: Needed a single revision
Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
Applying: Revert "Invalid sub1 commit"
ok 28 - apply_3way: modified submodule does not update submodule work tree from invalid commit

# still have 4 known breakage(s)
# passed all remaining 24 test(s)
1..28
*** t5301-sliding-window.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5301-sliding-window/.git/
expecting success: rm -f .git/index* &&
     for i in a b c
     do
         echo $i >$i &&
         test-genrandom "$i" 32768 >>$i &&
         git update-index --add $i || return 1
     done &&
     echo d >d && cat c >>d && git update-index --add d &&
     tree=`git write-tree` &&
     commit1=`git commit-tree $tree </dev/null` &&
     git update-ref HEAD $commit1 &&
     git repack -a -d &&
     test "`git count-objects`" = "0 objects, 0 kilobytes" &&
     pack1=`ls .git/objects/pack/*.pack` &&
     test -f "$pack1"
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'sub1'...
done.
Submodule path 'sub1': checked out '912f7e75d9b2a9ea1bda5e8f2864195a1f540d4c'
ok 1 - setup

expecting success: git verify-pack -v "$pack1"
ok 14 - am: 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
		)
	
4f754aefc0976c897618a288bc59f42b7f36c386 commit 163 124 12
d67b2ae81f0bd18212d239b6a965711041f73739 blob   32770 32789 136
7c0c57f15aee3c4cbe243c44d3c01ecfa949bb25 blob   32770 32789 32925
f76f6b9f6aed8209a40d300bf7dcb4fcf9863531 blob   32772 32791 65714
556c804eac998cc8fa89f225a29870c3d873477b blob   10 22 98505 1 f76f6b9f6aed8209a40d300bf7dcb4fcf9863531
b7fabea4d93049ea90d45d8252b9a4f8ee7c9c2c tree   116 115 98527
non delta: 5 objects
chain length = 1: 1 object
.git/objects/pack/pack-29b6f388143b50462424737a36b0a30f7de7d4cf.pack: ok
ok 2 - verify-pack -v, defaults

expecting success: git config core.packedGitWindowSize 512 &&
     git verify-pack -v "$pack1"
4f754aefc0976c897618a288bc59f42b7f36c386 commit 163 124 12
d67b2ae81f0bd18212d239b6a965711041f73739 blob   32770 32789 136
7c0c57f15aee3c4cbe243c44d3c01ecfa949bb25 blob   32770 32789 32925
f76f6b9f6aed8209a40d300bf7dcb4fcf9863531 blob   32772 32791 65714
556c804eac998cc8fa89f225a29870c3d873477b blob   10 22 98505 1 f76f6b9f6aed8209a40d300bf7dcb4fcf9863531
b7fabea4d93049ea90d45d8252b9a4f8ee7c9c2c tree   116 115 98527
non delta: 5 objects
chain length = 1: 1 object
.git/objects/pack/pack-29b6f388143b50462424737a36b0a30f7de7d4cf.pack: ok
ok 3 - verify-pack -v, packedGitWindowSize == 1 page

expecting success: git config core.packedGitWindowSize 512 &&
     git config core.packedGitLimit 512 &&
     git verify-pack -v "$pack1"
Cloning into 'submodule_update'...
4f754aefc0976c897618a288bc59f42b7f36c386 commit 163 124 12
d67b2ae81f0bd18212d239b6a965711041f73739 blob   32770 32789 136
7c0c57f15aee3c4cbe243c44d3c01ecfa949bb25 blob   32770 32789 32925
f76f6b9f6aed8209a40d300bf7dcb4fcf9863531 blob   32772 32791 65714
556c804eac998cc8fa89f225a29870c3d873477b blob   10 22 98505 1 f76f6b9f6aed8209a40d300bf7dcb4fcf9863531
b7fabea4d93049ea90d45d8252b9a4f8ee7c9c2c tree   116 115 98527
non delta: 5 objects
chain length = 1: 1 object
.git/objects/pack/pack-29b6f388143b50462424737a36b0a30f7de7d4cf.pack: ok
ok 4 - verify-pack -v, packedGit{WindowSize,Limit} == 1 page

expecting success: git config core.packedGitWindowSize 512 &&
     git config core.packedGitLimit 512 &&
     commit2=`git commit-tree $tree -p $commit1 </dev/null` &&
     git update-ref HEAD $commit2 &&
     git repack -a -d &&
     test "`git count-objects`" = "0 objects, 0 kilobytes" &&
     pack2=`ls .git/objects/pack/*.pack` &&
     test -f "$pack2" &&
     test "$pack1" \!= "$pack2"
done.
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Applying: Add sub1
ok 5 - repack -a -d, packedGit{WindowSize,Limit} == 1 page

expecting success: git config --unset core.packedGitWindowSize &&
     git config --unset core.packedGitLimit &&
     git verify-pack -v "$pack2"
e3a0f6eb6467b3e9794ff97541102abffff641e3 commit 211 154 12
4f754aefc0976c897618a288bc59f42b7f36c386 commit 24 35 166 1 e3a0f6eb6467b3e9794ff97541102abffff641e3
d67b2ae81f0bd18212d239b6a965711041f73739 blob   32770 32789 201
7c0c57f15aee3c4cbe243c44d3c01ecfa949bb25 blob   32770 32789 32990
f76f6b9f6aed8209a40d300bf7dcb4fcf9863531 blob   32772 32791 65779
556c804eac998cc8fa89f225a29870c3d873477b blob   10 22 98570 1 f76f6b9f6aed8209a40d300bf7dcb4fcf9863531
b7fabea4d93049ea90d45d8252b9a4f8ee7c9c2c tree   116 115 98592
non delta: 5 objects
chain length = 1: 2 objects
.git/objects/pack/pack-c93f24206333e6731fb1f7eef74525e57d88af1d.pack: ok
ok 6 - verify-pack -v, defaults

# passed all 6 test(s)
1..6
*** t5302-pack-index.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5302-pack-index/.git/
expecting success: rm -rf .git &&
     git init &&
     git config pack.threads 1 &&
     i=1 &&
     while test $i -le 100
     do
         iii=`printf %03i $i`
         test-genrandom "bar" 200 > wide_delta_$iii &&
         test-genrandom "baz $iii" 50 >> wide_delta_$iii &&
         test-genrandom "foo"$i 100 > deep_delta_$iii &&
         test-genrandom "foo"`expr $i + 1` 100 >> deep_delta_$iii &&
         test-genrandom "foo"`expr $i + 2` 100 >> deep_delta_$iii &&
         echo $iii >file_$iii &&
         test-genrandom "$iii" 8192 >>file_$iii &&
         git update-index --add file_$iii deep_delta_$iii wide_delta_$iii &&
         i=`expr $i + 1` || return 1
     done &&
     { echo 101 && test-genrandom 100 8192; } >file_101 &&
     git update-index --add file_101 &&
     tree=`git write-tree` &&
     commit=`git commit-tree $tree </dev/null` && {
	 echo $tree &&
	 git ls-tree $tree | sed -e "s/.* \\([0-9a-f]*\\)	.*/\\1/"
     } >obj-list &&
     git update-ref HEAD $commit
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5302-pack-index/.git/
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'sub1'...
done.
ok 4 - unpack without delta

expecting success: (cd ../.git && find objects -type f -print) |
     while read path
     do
         cmp $path ../.git/$path || {
	     echo $path differs.
	     return 1
	 }
     done
ok 5 - check unpack without delta

expecting success: pwd &&
     packname_2=$(git pack-objects test-2 <obj-list)
/«PKGBUILDDIR»/t/trash directory.t5300-pack-object
Submodule path 'sub1': checked out '912f7e75d9b2a9ea1bda5e8f2864195a1f540d4c'
ok 15 - am_3way: 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
		)
	
Cloning into 'submodule_update'...
done.
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Applying: Add sub1
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'sub1'...
done.
Submodule path 'sub1': checked out '912f7e75d9b2a9ea1bda5e8f2864195a1f540d4c'
ok 16 - am_3way: 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
		)
	
Cloning into 'submodule_update'...
done.
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Applying: Add sub1
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
error: The following untracked working tree files would be overwritten by merge:
	sub1
Please move or remove them before you can merge.
Aborting
fatal: merging of trees ec38489b3f8eda08fda17055ad272abc24bdf929 and 20265dd47fa7d46194fa4afbd35c75ba89f96150 failed
Merging 912f7e75d9b2a9ea1bda5e8f2864195a1f540d4c with Add sub1
Merging:
912f7e7 Base
virtual Add sub1
found 1 common ancestor:
virtual 4b825dc642cb6eb9a060e54bf8d69288fbee4904
error: Failed to merge in the changes.
Patch failed at 0001 Add sub1
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
ok 17 - am_3way: 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
		)
	
Cloning into 'submodule_update'...
done.
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.
t4255-am-submodule.sh: 159: cd: can't cd to sub1
Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
Applying: Revert "Replace sub1 with file"
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 6 - pack with REF_DELTA

expecting success: GIT_OBJECT_DIRECTORY=.git2/objects &&
     export GIT_OBJECT_DIRECTORY &&
     git init &&
     git unpack-objects -n <test-2-${packname_2}.pack &&
     git unpack-objects <test-2-${packname_2}.pack
Reinitialized existing Git repository in /«PKGBUILDDIR»/t/trash directory.t5300-pack-object/.git/
Cloning into 'sub1'...
done.
Submodule path 'sub1': checked out '912f7e75d9b2a9ea1bda5e8f2864195a1f540d4c'
ok 18 - am_3way: 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
		)
	
Cloning into 'submodule_update'...
done.
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.
error: 8ed2e6719f8484ce01fa3ce133fe42d25c2441b8^{commit}: expected commit type, but the object dereferences to tree type
fatal: Needed a single revision
Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
Applying: Revert "Replace sub1 with directory"
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'sub1'...
done.
Submodule path 'sub1': checked out '912f7e75d9b2a9ea1bda5e8f2864195a1f540d4c'
ok 19 - am_3way: 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
		)
	
Cloning into 'submodule_update'...
done.
ok 11 - zip archive with many entries

# passed all 11 test(s)
1..11
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
*** t5303-pack-corruption-resilience.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5303-pack-corruption-resilience/.git/
expecting success: create_test_files &&
     create_new_pack &&
     git prune-packed &&
     git cat-file blob $blob_1 > /dev/null &&
     git cat-file blob $blob_2 > /dev/null &&
     git cat-file blob $blob_3 > /dev/null
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule_update_repo/.) registered for path 'sub1'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5303-pack-corruption-resilience/.git/
ok 7 - unpack with REF_DELTA

expecting success: (cd ../.git && find objects -type f -print) |
     while read path
     do
         cmp $path ../.git/$path || {
	     echo $path differs.
	     return 1
	 }
     done
Cloning into 'sub1'...
ok 8 - check unpack with REF_DELTA

expecting success: pwd &&
     packname_3=$(git pack-objects --delta-base-offset test-3 <obj-list)
/«PKGBUILDDIR»/t/trash directory.t5300-pack-object
done.
06686a2094b7518d92cd6e26efaab209b398ebd3 blob   2007 2020 12
30fd6590c6df999b5a77622491bee8cb1b96d807 blob   168 201 2032 1 06686a2094b7518d92cd6e26efaab209b398ebd3
44cc0b565eca87cf836116abe0f9e2ff4fd0b0a4 blob   117 150 2233 2 30fd6590c6df999b5a77622491bee8cb1b96d807
non delta: 1 object
chain length = 1: 1 object
chain length = 2: 1 object
.git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack: ok
ok 1 - initial setup validation

expecting success: do_corrupt_object $blob_1 0 < zero &&
     test_must_fail git cat-file blob $blob_1 > /dev/null &&
     test_must_fail git cat-file blob $blob_2 > /dev/null &&
     test_must_fail git cat-file blob $blob_3 > /dev/null
1+0 records in
1+0 records out
1 byte (1 B) copied, 0.00128533 s, 0.8 kB/s
fatal: pack has bad object at offset 12: unknown object type 0
error: unknown object type 0 at offset 12 in .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
fatal: packed object 06686a2094b7518d92cd6e26efaab209b398ebd3 (stored in .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack) is corrupt
fatal: packed object 30fd6590c6df999b5a77622491bee8cb1b96d807 (stored in .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack) is corrupt
Submodule path 'sub1': checked out '912f7e75d9b2a9ea1bda5e8f2864195a1f540d4c'
fatal: packed object 44cc0b565eca87cf836116abe0f9e2ff4fd0b0a4 (stored in .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack) is corrupt
ok 2 - create corruption in header of first object

expecting success: mv ${pack}.idx tmp &&
     git hash-object -t blob -w file_1 &&
     mv tmp ${pack}.idx &&
     git cat-file blob $blob_1 > /dev/null &&
     git cat-file blob $blob_2 > /dev/null &&
     git cat-file blob $blob_3 > /dev/null
06686a2094b7518d92cd6e26efaab209b398ebd3
error: unknown object type 0 at offset 12 in .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
error: unknown object type 0 at offset 12 in .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
error: failed to read delta base object 06686a2094b7518d92cd6e26efaab209b398ebd3 at offset 12 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
error: unknown object type 0 at offset 12 in .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
error: failed to read delta base object 06686a2094b7518d92cd6e26efaab209b398ebd3 at offset 12 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
ok 3 - ... but having a loose copy allows for full recovery

expecting success: git prune-packed &&
     test_must_fail git cat-file blob $blob_2 > /dev/null &&
     mv ${pack}.idx tmp &&
     git hash-object -t blob -w file_2 &&
     mv tmp ${pack}.idx &&
     test_must_fail git cat-file blob $blob_1 > /dev/null &&
     git cat-file blob $blob_2 > /dev/null &&
     git cat-file blob $blob_3 > /dev/null
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
fatal: packed object 30fd6590c6df999b5a77622491bee8cb1b96d807 (stored in .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack) is corrupt
Applying: Revert "Add sub1"
30fd6590c6df999b5a77622491bee8cb1b96d807
error: unknown object type 0 at offset 12 in .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
fatal: packed object 06686a2094b7518d92cd6e26efaab209b398ebd3 (stored in .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack) is corrupt
error: unknown object type 0 at offset 12 in .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
error: failed to read delta base object 06686a2094b7518d92cd6e26efaab209b398ebd3 at offset 12 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
error: failed to read delta base object 30fd6590c6df999b5a77622491bee8cb1b96d807 at offset 2032 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
ok 4 - ... and loose copy of first delta allows for partial recovery

expecting success: create_new_pack &&
     git prune-packed &&
     chmod +w ${pack}.pack &&
     perl -i.bak -pe "s/ base /abcdef/" ${pack}.pack &&
     test_must_fail git cat-file blob $blob_1 > /dev/null &&
     test_must_fail git cat-file blob $blob_2 > /dev/null &&
     test_must_fail git cat-file blob $blob_3 > /dev/null
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5303-pack-corruption-resilience/.git/
ok 20 - am_3way: 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
		)
	
Cloning into 'submodule_update'...
06686a2094b7518d92cd6e26efaab209b398ebd3 blob   2007 2020 12
30fd6590c6df999b5a77622491bee8cb1b96d807 blob   168 201 2032 1 06686a2094b7518d92cd6e26efaab209b398ebd3
44cc0b565eca87cf836116abe0f9e2ff4fd0b0a4 blob   117 150 2233 2 30fd6590c6df999b5a77622491bee8cb1b96d807
non delta: 1 object
chain length = 1: 1 object
chain length = 2: 1 object
.git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack: ok
done.
error: inflate: data stream error (incorrect data check)
error: failed to read object 06686a2094b7518d92cd6e26efaab209b398ebd3 at offset 12 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
fatal: packed object 06686a2094b7518d92cd6e26efaab209b398ebd3 (stored in .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack) is corrupt
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
error: inflate: data stream error (incorrect data check)
error: failed to read delta base object 06686a2094b7518d92cd6e26efaab209b398ebd3 at offset 12 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
error: failed to read object 30fd6590c6df999b5a77622491bee8cb1b96d807 at offset 2032 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
fatal: packed object 30fd6590c6df999b5a77622491bee8cb1b96d807 (stored in .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack) is corrupt
error: inflate: data stream error (incorrect data check)
error: failed to read delta base object 06686a2094b7518d92cd6e26efaab209b398ebd3 at offset 12 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
error: failed to read delta base object 30fd6590c6df999b5a77622491bee8cb1b96d807 at offset 2032 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
error: failed to read object 44cc0b565eca87cf836116abe0f9e2ff4fd0b0a4 at offset 2233 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
fatal: packed object 44cc0b565eca87cf836116abe0f9e2ff4fd0b0a4 (stored in .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack) is corrupt
ok 5 - create corruption in data of first object

expecting success: mv ${pack}.idx tmp &&
     git hash-object -t blob -w file_1 &&
     mv tmp ${pack}.idx &&
     git cat-file blob $blob_1 > /dev/null &&
     git cat-file blob $blob_2 > /dev/null &&
     git cat-file blob $blob_3 > /dev/null
06686a2094b7518d92cd6e26efaab209b398ebd3
error: inflate: data stream error (incorrect data check)
error: failed to read object 06686a2094b7518d92cd6e26efaab209b398ebd3 at offset 12 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
error: inflate: data stream error (incorrect data check)
error: failed to read delta base object 06686a2094b7518d92cd6e26efaab209b398ebd3 at offset 12 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
error: inflate: data stream error (incorrect data check)
error: failed to read delta base object 06686a2094b7518d92cd6e26efaab209b398ebd3 at offset 12 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
ok 6 - ... but having a loose copy allows for full recovery

expecting success: git prune-packed &&
     test_must_fail git cat-file blob $blob_2 > /dev/null &&
     mv ${pack}.idx tmp &&
     git hash-object -t blob -w file_2 &&
     mv tmp ${pack}.idx &&
     test_must_fail git cat-file blob $blob_1 > /dev/null &&
     git cat-file blob $blob_2 > /dev/null &&
     git cat-file blob $blob_3 > /dev/null
error: inflate: data stream error (incorrect data check)
error: failed to read delta base object 06686a2094b7518d92cd6e26efaab209b398ebd3 at offset 12 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
error: failed to read object 30fd6590c6df999b5a77622491bee8cb1b96d807 at offset 2032 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
fatal: packed object 30fd6590c6df999b5a77622491bee8cb1b96d807 (stored in .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack) is corrupt
30fd6590c6df999b5a77622491bee8cb1b96d807
error: inflate: data stream error (incorrect data check)
error: failed to read object 06686a2094b7518d92cd6e26efaab209b398ebd3 at offset 12 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
fatal: packed object 06686a2094b7518d92cd6e26efaab209b398ebd3 (stored in .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack) is corrupt
error: inflate: data stream error (incorrect data check)
error: failed to read delta base object 06686a2094b7518d92cd6e26efaab209b398ebd3 at offset 12 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
error: failed to read object 30fd6590c6df999b5a77622491bee8cb1b96d807 at offset 2032 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
error: inflate: data stream error (incorrect data check)
error: failed to read delta base object 06686a2094b7518d92cd6e26efaab209b398ebd3 at offset 12 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
error: failed to read delta base object 30fd6590c6df999b5a77622491bee8cb1b96d807 at offset 2032 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
ok 7 - ... and loose copy of second object allows for partial recovery

expecting success: create_new_pack &&
     git prune-packed &&
     do_corrupt_object $blob_2 0 < zero &&
     git cat-file blob $blob_1 > /dev/null &&
     test_must_fail git cat-file blob $blob_2 > /dev/null &&
     test_must_fail git cat-file blob $blob_3 > /dev/null
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5303-pack-corruption-resilience/.git/
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'sub1'...
06686a2094b7518d92cd6e26efaab209b398ebd3 blob   2007 2020 12
30fd6590c6df999b5a77622491bee8cb1b96d807 blob   168 201 2032 1 06686a2094b7518d92cd6e26efaab209b398ebd3
44cc0b565eca87cf836116abe0f9e2ff4fd0b0a4 blob   117 150 2233 2 30fd6590c6df999b5a77622491bee8cb1b96d807
non delta: 1 object
chain length = 1: 1 object
chain length = 2: 1 object
.git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack: ok
done.
1+0 records in
1+0 records out
1 byte (1 B) copied, 0.001747 s, 0.6 kB/s
fatal: pack has bad object at offset 2032: unknown object type 0
error: unknown object type 0 at offset 2032 in .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
fatal: packed object 30fd6590c6df999b5a77622491bee8cb1b96d807 (stored in .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack) is corrupt
fatal: packed object 44cc0b565eca87cf836116abe0f9e2ff4fd0b0a4 (stored in .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack) is corrupt
ok 8 - create corruption in header of first delta

expecting success: mv ${pack}.idx tmp &&
     git hash-object -t blob -w file_2 &&
     mv tmp ${pack}.idx &&
     git cat-file blob $blob_1 > /dev/null &&
     git cat-file blob $blob_2 > /dev/null &&
     git cat-file blob $blob_3 > /dev/null
30fd6590c6df999b5a77622491bee8cb1b96d807
Submodule path 'sub1': checked out '912f7e75d9b2a9ea1bda5e8f2864195a1f540d4c'
error: unknown object type 0 at offset 2032 in .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
error: unknown object type 0 at offset 2032 in .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
error: failed to read delta base object 30fd6590c6df999b5a77622491bee8cb1b96d807 at offset 2032 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
ok 9 - ... but having a loose copy allows for full recovery

expecting success: do_repack &&
     git prune-packed &&
     git verify-pack ${pack}.pack &&
     git cat-file blob $blob_1 > /dev/null &&
     git cat-file blob $blob_2 > /dev/null &&
     git cat-file blob $blob_3 > /dev/null
error: unknown object type 0 at offset 2032 in .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
Applying: Revert "Add sub1"
ok 10 - ... and then a repack "clears" the corruption

expecting success: create_new_pack &&
     git prune-packed &&
     chmod +w ${pack}.pack &&
     perl -i.bak -pe "s/ delta1 /abcdefgh/" ${pack}.pack &&
     git cat-file blob $blob_1 > /dev/null &&
     test_must_fail git cat-file blob $blob_2 > /dev/null &&
     test_must_fail git cat-file blob $blob_3 > /dev/null
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5303-pack-corruption-resilience/.git/
ok 21 - am_3way: 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
		)
	
06686a2094b7518d92cd6e26efaab209b398ebd3 blob   2007 2020 12
30fd6590c6df999b5a77622491bee8cb1b96d807 blob   168 201 2032 1 06686a2094b7518d92cd6e26efaab209b398ebd3
44cc0b565eca87cf836116abe0f9e2ff4fd0b0a4 blob   117 150 2233 2 30fd6590c6df999b5a77622491bee8cb1b96d807
non delta: 1 object
chain length = 1: 1 object
chain length = 2: 1 object
.git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack: ok
error: inflate: data stream error (incorrect data check)
error: failed to unpack compressed delta at offset 2054 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
error: failed to read object 30fd6590c6df999b5a77622491bee8cb1b96d807 at offset 2032 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
fatal: packed object 30fd6590c6df999b5a77622491bee8cb1b96d807 (stored in .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack) is corrupt
error: inflate: data stream error (incorrect data check)
error: failed to unpack compressed delta at offset 2054 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
error: failed to read delta base object 30fd6590c6df999b5a77622491bee8cb1b96d807 at offset 2032 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
error: failed to read object 44cc0b565eca87cf836116abe0f9e2ff4fd0b0a4 at offset 2233 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
fatal: packed object 44cc0b565eca87cf836116abe0f9e2ff4fd0b0a4 (stored in .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack) is corrupt
ok 11 - create corruption in data of first delta

expecting success: mv ${pack}.idx tmp &&
     git hash-object -t blob -w file_2 &&
     mv tmp ${pack}.idx &&
     git cat-file blob $blob_1 > /dev/null &&
     git cat-file blob $blob_2 > /dev/null &&
     git cat-file blob $blob_3 > /dev/null
Cloning into 'submodule_update'...
30fd6590c6df999b5a77622491bee8cb1b96d807
error: inflate: data stream error (incorrect data check)
error: failed to unpack compressed delta at offset 2054 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
error: failed to read object 30fd6590c6df999b5a77622491bee8cb1b96d807 at offset 2032 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
error: inflate: data stream error (incorrect data check)
error: failed to unpack compressed delta at offset 2054 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
error: failed to read delta base object 30fd6590c6df999b5a77622491bee8cb1b96d807 at offset 2032 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
ok 12 - ... but having a loose copy allows for full recovery

expecting success: do_repack &&
     git prune-packed &&
     git verify-pack ${pack}.pack &&
     git cat-file blob $blob_1 > /dev/null &&
     git cat-file blob $blob_2 > /dev/null &&
     git cat-file blob $blob_3 > /dev/null
done.
error: bad packed object CRC for 30fd6590c6df999b5a77622491bee8cb1b96d807
error: bad packed object CRC for 30fd6590c6df999b5a77622491bee8cb1b96d807
error: failed to read object 30fd6590c6df999b5a77622491bee8cb1b96d807 at offset 2032 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 13 - ... and then a repack "clears" the corruption

expecting success: create_new_pack &&
     git prune-packed &&
     do_corrupt_object $blob_2 2 < zero &&
     git cat-file blob $blob_1 > /dev/null &&
     test_must_fail git cat-file blob $blob_2 > /dev/null &&
     test_must_fail git cat-file blob $blob_3 > /dev/null
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5303-pack-corruption-resilience/.git/
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 9 - pack with OFS_DELTA

expecting success: GIT_OBJECT_DIRECTORY=.git2/objects &&
     export GIT_OBJECT_DIRECTORY &&
     git init &&
     git unpack-objects -n <test-3-${packname_3}.pack &&
     git unpack-objects <test-3-${packname_3}.pack
Reinitialized existing Git repository in /«PKGBUILDDIR»/t/trash directory.t5300-pack-object/.git/
Cloning into 'sub1'...
06686a2094b7518d92cd6e26efaab209b398ebd3 blob   2007 2020 12
30fd6590c6df999b5a77622491bee8cb1b96d807 blob   168 201 2032 1 06686a2094b7518d92cd6e26efaab209b398ebd3
44cc0b565eca87cf836116abe0f9e2ff4fd0b0a4 blob   117 150 2233 2 30fd6590c6df999b5a77622491bee8cb1b96d807
non delta: 1 object
chain length = 1: 1 object
chain length = 2: 1 object
.git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack: ok
done.
1+0 records in
1+0 records out
1 byte (1 B) copied, 0.00152033 s, 0.7 kB/s
fatal: pack is corrupted (SHA1 mismatch)
fatal: packed object 30fd6590c6df999b5a77622491bee8cb1b96d807 (stored in .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack) is corrupt
fatal: packed object 44cc0b565eca87cf836116abe0f9e2ff4fd0b0a4 (stored in .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack) is corrupt
ok 14 - corruption in delta base reference of first delta (OBJ_REF_DELTA)

expecting success: mv ${pack}.idx tmp &&
     git hash-object -t blob -w file_2 &&
     mv tmp ${pack}.idx &&
     git cat-file blob $blob_1 > /dev/null &&
     git cat-file blob $blob_2 > /dev/null &&
     git cat-file blob $blob_3 > /dev/null
30fd6590c6df999b5a77622491bee8cb1b96d807
error: failed to validate delta base reference at offset 2054 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
error: failed to read delta base object 30fd6590c6df999b5a77622491bee8cb1b96d807 at offset 2032 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
ok 15 - ... but having a loose copy allows for full recovery

expecting success: do_repack &&
     git prune-packed &&
     git verify-pack ${pack}.pack &&
     git cat-file blob $blob_1 > /dev/null &&
     git cat-file blob $blob_2 > /dev/null &&
     git cat-file blob $blob_3 > /dev/null
Submodule path 'sub1': checked out '912f7e75d9b2a9ea1bda5e8f2864195a1f540d4c'
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
Applying: Replace sub1 with directory
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
error: refusing to lose untracked file at 'sub1/file2'
error: refusing to lose untracked file at 'sub1/file1'
Merging 9a6c3e9bad777fd62694b780f2df8a4a39f46cff with Replace sub1 with directory
Merging:
9a6c3e9 Add sub1
virtual Replace sub1 with directory
found 1 common ancestor:
virtual 20265dd47fa7d46194fa4afbd35c75ba89f96150
Adding sub1/file3
Adding sub1/file2
Adding sub1/file1
Removing sub1
ok 16 - ... and then a repack "clears" the corruption

expecting success: create_new_pack --delta-base-offset &&
     git prune-packed &&
     do_corrupt_object $blob_2 2 < zero &&
     git cat-file blob $blob_1 > /dev/null &&
     test_must_fail git cat-file blob $blob_2 > /dev/null &&
     test_must_fail git cat-file blob $blob_3 > /dev/null
test_must_fail: command succeeded: am_3way replace_sub1_with_directory
not ok 22 - am_3way: 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
		)
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5303-pack-corruption-resilience/.git/
Cloning into 'submodule_update'...
done.
06686a2094b7518d92cd6e26efaab209b398ebd3 blob   2007 2020 12
30fd6590c6df999b5a77622491bee8cb1b96d807 blob   168 183 2032 1 06686a2094b7518d92cd6e26efaab209b398ebd3
44cc0b565eca87cf836116abe0f9e2ff4fd0b0a4 blob   117 132 2215 2 30fd6590c6df999b5a77622491bee8cb1b96d807
non delta: 1 object
chain length = 1: 1 object
chain length = 2: 1 object
.git/objects/pack/pack-417bd5d650269e28ec8026312b966d0bf1dab469.pack: ok
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
1+0 records in
1+0 records out
1 byte (1 B) copied, 0.000456667 s, 2.2 kB/s
fatal: pack has bad object at offset 2032: delta base offset is out of bound
fatal: packed object 30fd6590c6df999b5a77622491bee8cb1b96d807 (stored in .git/objects/pack/pack-417bd5d650269e28ec8026312b966d0bf1dab469.pack) is corrupt
fatal: packed object 44cc0b565eca87cf836116abe0f9e2ff4fd0b0a4 (stored in .git/objects/pack/pack-417bd5d650269e28ec8026312b966d0bf1dab469.pack) is corrupt
ok 17 - corruption #0 in delta base reference of first delta (OBJ_OFS_DELTA)

expecting success: mv ${pack}.idx tmp &&
     git hash-object -t blob -w file_2 &&
     mv tmp ${pack}.idx &&
     git cat-file blob $blob_1 > /dev/null &&
     git cat-file blob $blob_2 > /dev/null &&
     git cat-file blob $blob_3 > /dev/null
30fd6590c6df999b5a77622491bee8cb1b96d807
error: failed to validate delta base reference at offset 2034 from .git/objects/pack/pack-417bd5d650269e28ec8026312b966d0bf1dab469.pack
error: failed to read delta base object 30fd6590c6df999b5a77622491bee8cb1b96d807 at offset 2032 from .git/objects/pack/pack-417bd5d650269e28ec8026312b966d0bf1dab469.pack
ok 18 - ... but having a loose copy allows for full recovery

expecting success: do_repack --delta-base-offset &&
     git prune-packed &&
     git verify-pack ${pack}.pack &&
     git cat-file blob $blob_1 > /dev/null &&
     git cat-file blob $blob_2 > /dev/null &&
     git cat-file blob $blob_3 > /dev/null
error: delta base offset out of bound for 30fd6590c6df999b5a77622491bee8cb1b96d807
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 19 - ... and then a repack "clears" the corruption

expecting success: create_new_pack --delta-base-offset &&
     git prune-packed &&
     printf "\001" | do_corrupt_object $blob_2 2 &&
     git cat-file blob $blob_1 > /dev/null &&
     test_must_fail git cat-file blob $blob_2 > /dev/null &&
     test_must_fail git cat-file blob $blob_3 > /dev/null
Cloning into 'sub1'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5303-pack-corruption-resilience/.git/
done.
Submodule path 'sub1': checked out '912f7e75d9b2a9ea1bda5e8f2864195a1f540d4c'
06686a2094b7518d92cd6e26efaab209b398ebd3 blob   2007 2020 12
30fd6590c6df999b5a77622491bee8cb1b96d807 blob   168 183 2032 1 06686a2094b7518d92cd6e26efaab209b398ebd3
44cc0b565eca87cf836116abe0f9e2ff4fd0b0a4 blob   117 132 2215 2 30fd6590c6df999b5a77622491bee8cb1b96d807
non delta: 1 object
chain length = 1: 1 object
chain length = 2: 1 object
.git/objects/pack/pack-417bd5d650269e28ec8026312b966d0bf1dab469.pack: ok
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
1+0 records in
1+0 records out
1 byte (1 B) copied, 0.000356 s, 2.8 kB/s
error: inflate: data stream error (incorrect header check)
fatal: pack has bad object at offset 2032: inflate returned -3
error: bad offset for revindex
fatal: packed object 30fd6590c6df999b5a77622491bee8cb1b96d807 (stored in .git/objects/pack/pack-417bd5d650269e28ec8026312b966d0bf1dab469.pack) is corrupt
error: bad offset for revindex
fatal: packed object 44cc0b565eca87cf836116abe0f9e2ff4fd0b0a4 (stored in .git/objects/pack/pack-417bd5d650269e28ec8026312b966d0bf1dab469.pack) is corrupt
ok 20 - corruption #1 in delta base reference of first delta (OBJ_OFS_DELTA)

expecting success: mv ${pack}.idx tmp &&
     git hash-object -t blob -w file_2 &&
     mv tmp ${pack}.idx &&
     git cat-file blob $blob_1 > /dev/null &&
     git cat-file blob $blob_2 > /dev/null &&
     git cat-file blob $blob_3 > /dev/null
30fd6590c6df999b5a77622491bee8cb1b96d807
error: bad offset for revindex
Applying: Replace sub1 with directory
error: bad offset for revindex
error: bad offset for revindex
error: bad offset for revindex
error: failed to validate delta base reference at offset 2054 from .git/objects/pack/pack-417bd5d650269e28ec8026312b966d0bf1dab469.pack
error: bad offset for revindex
error: failed to read delta base object 30fd6590c6df999b5a77622491bee8cb1b96d807 at offset 2032 from .git/objects/pack/pack-417bd5d650269e28ec8026312b966d0bf1dab469.pack
ok 21 - ... but having a loose copy allows for full recovery

expecting success: do_repack --delta-base-offset &&
     git prune-packed &&
     git verify-pack ${pack}.pack &&
     git cat-file blob $blob_1 > /dev/null &&
     git cat-file blob $blob_2 > /dev/null &&
     git cat-file blob $blob_3 > /dev/null
Using index info to reconstruct a base tree...
error: bad offset for revindex
error: inflate: data stream error (incorrect header check)
error: delta data unpack-initial failed
Falling back to patching base and 3-way merge...
error: refusing to lose untracked file at 'sub1/file2'
error: refusing to lose untracked file at 'sub1/file1'
Merging 9a6c3e9bad777fd62694b780f2df8a4a39f46cff with Replace sub1 with directory
Merging:
9a6c3e9 Add sub1
virtual Replace sub1 with directory
found 1 common ancestor:
virtual 20265dd47fa7d46194fa4afbd35c75ba89f96150
Adding sub1/file3
Adding sub1/file2
Adding sub1/file1
Removing sub1
test_must_fail: command succeeded: am_3way replace_sub1_with_directory
not ok 23 - am_3way: 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
		)
	
ok 22 - ... and then a repack "clears" the corruption

expecting success: do_corrupt_object $blob_2 2 < zero &&
     git cat-file blob $blob_1 > /dev/null &&
     test_must_fail git cat-file blob $blob_2 > /dev/null &&
     test_must_fail git cat-file blob $blob_3 > /dev/null &&
     mv ${pack}.idx tmp &&
     git hash-object -t blob -w file_1 &&
     git hash-object -t blob -w file_2 &&
     printf "$blob_1\n$blob_2\n" | git pack-objects .git/objects/pack/pack &&
     git prune-packed &&
     mv tmp ${pack}.idx &&
     git cat-file blob $blob_1 > /dev/null &&
     git cat-file blob $blob_2 > /dev/null &&
     git cat-file blob $blob_3 > /dev/null
1+0 records in
1+0 records out
1 byte (1 B) copied, 0.00156467 s, 0.6 kB/s
Cloning into 'submodule_update'...
fatal: pack has bad object at offset 2032: delta base offset is out of bound
fatal: packed object 30fd6590c6df999b5a77622491bee8cb1b96d807 (stored in .git/objects/pack/pack-417bd5d650269e28ec8026312b966d0bf1dab469.pack) is corrupt
done.
fatal: packed object 44cc0b565eca87cf836116abe0f9e2ff4fd0b0a4 (stored in .git/objects/pack/pack-417bd5d650269e28ec8026312b966d0bf1dab469.pack) is corrupt
06686a2094b7518d92cd6e26efaab209b398ebd3
ok 10 - unpack with OFS_DELTA

expecting success: (cd ../.git && find objects -type f -print) |
     while read path
     do
         cmp $path ../.git/$path || {
	     echo $path differs.
	     return 1
	 }
     done
30fd6590c6df999b5a77622491bee8cb1b96d807
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 11 - check unpack with OFS_DELTA

expecting success: 
	perl -e '
		defined($_ = -s $_) or die for @ARGV;
		exit 1 if $ARGV[0] <= $ARGV[1];
	' test-2-$packname_2.pack test-3-$packname_3.pack

ok 12 - compare delta flavors

expecting success: GIT_OBJECT_DIRECTORY=.git2/objects &&
     export GIT_OBJECT_DIRECTORY &&
     git init &&
     cp test-1-${packname_1}.pack test-1-${packname_1}.idx .git2/objects/pack && {
	 git diff-tree --root -p $commit &&
	 while read object
	 do
	    t=`git cat-file -t $object` &&
	    git cat-file $t $object || return 1
	 done <obj-list
    } >current &&
    cmp expect current
8e27963e1e80900149c7ca3ea5eeb0cf53e9cb23
Reinitialized existing Git repository in /«PKGBUILDDIR»/t/trash directory.t5300-pack-object/.git/
error: failed to validate delta base reference at offset 2034 from .git/objects/pack/pack-417bd5d650269e28ec8026312b966d0bf1dab469.pack
error: failed to read delta base object 30fd6590c6df999b5a77622491bee8cb1b96d807 at offset 2032 from .git/objects/pack/pack-417bd5d650269e28ec8026312b966d0bf1dab469.pack
ok 23 - ... and a redundant pack allows for full recovery too

expecting success: create_new_pack --delta-base-offset &&
     git prune-packed &&
     printf "\220\033" | do_corrupt_object $blob_3 2 &&
     git cat-file blob $blob_1 >/dev/null &&
     git cat-file blob $blob_2 >/dev/null &&
     test_must_fail git cat-file blob $blob_3 >/dev/null
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5303-pack-corruption-resilience/.git/
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 1 - setup

expecting success: pack1=$(git pack-objects --index-version=1 test-1 <obj-list) &&
     git verify-pack -v "test-1-${pack1}.pack"
Cloning into 'sub1'...
06686a2094b7518d92cd6e26efaab209b398ebd3 blob   2007 2020 12
30fd6590c6df999b5a77622491bee8cb1b96d807 blob   168 183 2032 1 06686a2094b7518d92cd6e26efaab209b398ebd3
44cc0b565eca87cf836116abe0f9e2ff4fd0b0a4 blob   117 132 2215 2 30fd6590c6df999b5a77622491bee8cb1b96d807
non delta: 1 object
chain length = 1: 1 object
chain length = 2: 1 object
.git/objects/pack/pack-417bd5d650269e28ec8026312b966d0bf1dab469.pack: ok
done.
2+0 records in
2+0 records out
2 bytes (2 B) copied, 0.000614666 s, 3.3 kB/s
fatal: pack is corrupted (SHA1 mismatch)
error: failed to apply delta
error: failed to read object 44cc0b565eca87cf836116abe0f9e2ff4fd0b0a4 at offset 2215 from .git/objects/pack/pack-417bd5d650269e28ec8026312b966d0bf1dab469.pack
fatal: packed object 44cc0b565eca87cf836116abe0f9e2ff4fd0b0a4 (stored in .git/objects/pack/pack-417bd5d650269e28ec8026312b966d0bf1dab469.pack) is corrupt
ok 24 - corruption of delta base reference pointing to wrong object

expecting success: mv ${pack}.idx tmp &&
     git hash-object -t blob -w file_3 &&
     mv tmp ${pack}.idx &&
     git cat-file blob $blob_1 > /dev/null &&
     git cat-file blob $blob_2 > /dev/null &&
     git cat-file blob $blob_3 > /dev/null
44cc0b565eca87cf836116abe0f9e2ff4fd0b0a4
ok 13 - use packed objects

expecting success: GIT_OBJECT_DIRECTORY=.git2/objects &&
     export GIT_OBJECT_DIRECTORY &&
     rm -f .git2/objects/pack/test-* &&
     cp test-2-${packname_2}.pack test-2-${packname_2}.idx .git2/objects/pack && {
	 git diff-tree --root -p $commit &&
	 while read object
	 do
	    t=`git cat-file -t $object` &&
	    git cat-file $t $object || return 1
	 done <obj-list
    } >current &&
    cmp expect current
error: failed to apply delta
error: failed to read object 44cc0b565eca87cf836116abe0f9e2ff4fd0b0a4 at offset 2215 from .git/objects/pack/pack-417bd5d650269e28ec8026312b966d0bf1dab469.pack
ok 25 - ... but having a loose copy allows for full recovery

expecting success: do_repack --delta-base-offset --no-reuse-delta &&
     git prune-packed &&
     git verify-pack ${pack}.pack &&
     git cat-file blob $blob_1 > /dev/null &&
     git cat-file blob $blob_2 > /dev/null &&
     git cat-file blob $blob_3 > /dev/null
Submodule path 'sub1': checked out '912f7e75d9b2a9ea1bda5e8f2864195a1f540d4c'
error: bad packed object CRC for 44cc0b565eca87cf836116abe0f9e2ff4fd0b0a4
error: failed to read object 44cc0b565eca87cf836116abe0f9e2ff4fd0b0a4 at offset 2215 from .git/objects/pack/pack-417bd5d650269e28ec8026312b966d0bf1dab469.pack
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
Applying: Replace sub1 with file
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
ok 26 - ... and then a repack "clears" the corruption

expecting success: create_new_pack &&
     git prune-packed &&
     printf "\262\001" | do_corrupt_object $blob_1 0 &&
     test_must_fail git cat-file blob $blob_1 > /dev/null &&
     test_must_fail git cat-file blob $blob_2 > /dev/null &&
     test_must_fail git cat-file blob $blob_3 > /dev/null
error: Your local changes to the following files would be overwritten by merge:
	.gitmodules
Please, commit your changes or stash them before you can merge.
Aborting
fatal: merging of trees 14c3edc2a99f5ea96b628ffab65df33a29b7be40 and d1e9329c60a6b679e0b815bd5c0de8ed01766cc5 failed
Merging 9a6c3e9bad777fd62694b780f2df8a4a39f46cff with Replace sub1 with file
Merging:
9a6c3e9 Add sub1
virtual Replace sub1 with file
found 1 common ancestor:
virtual 20265dd47fa7d46194fa4afbd35c75ba89f96150
error: Failed to merge in the changes.
Patch failed at 0001 Replace sub1 with file
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
'actual' is not empty, it contains:
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5303-pack-corruption-resilience/.git/
:100644 100644 1b52e94c4a64cb0f66e5ac63bf7612443af0bb91 0000000000000000000000000000000000000000 M	.gitmodules
not ok 24 - am_3way: 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
		)
	
Cloning into 'submodule_update'...
ok 14 - use packed deltified (REF_DELTA) objects

expecting success: GIT_OBJECT_DIRECTORY=.git2/objects &&
     export GIT_OBJECT_DIRECTORY &&
     rm -f .git2/objects/pack/test-* &&
     cp test-3-${packname_3}.pack test-3-${packname_3}.idx .git2/objects/pack && {
	 git diff-tree --root -p $commit &&
	 while read object
	 do
	    t=`git cat-file -t $object` &&
	    git cat-file $t $object || return 1
	 done <obj-list
    } >current &&
    cmp expect current
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
06686a2094b7518d92cd6e26efaab209b398ebd3 blob   2007 2020 12
30fd6590c6df999b5a77622491bee8cb1b96d807 blob   168 201 2032 1 06686a2094b7518d92cd6e26efaab209b398ebd3
44cc0b565eca87cf836116abe0f9e2ff4fd0b0a4 blob   117 150 2233 2 30fd6590c6df999b5a77622491bee8cb1b96d807
non delta: 1 object
chain length = 1: 1 object
chain length = 2: 1 object
.git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack: ok
2+0 records in
2+0 records out
2 bytes (2 B) copied, 0.00143633 s, 1.4 kB/s
fatal: pack has bad object at offset 12: inflate returned -5
error: failed to read object 06686a2094b7518d92cd6e26efaab209b398ebd3 at offset 12 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
fatal: packed object 06686a2094b7518d92cd6e26efaab209b398ebd3 (stored in .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack) is corrupt
error: failed to read delta base object 06686a2094b7518d92cd6e26efaab209b398ebd3 at offset 12 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
error: failed to read object 30fd6590c6df999b5a77622491bee8cb1b96d807 at offset 2032 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
fatal: packed object 30fd6590c6df999b5a77622491bee8cb1b96d807 (stored in .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack) is corrupt
error: failed to read delta base object 06686a2094b7518d92cd6e26efaab209b398ebd3 at offset 12 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
error: failed to read delta base object 30fd6590c6df999b5a77622491bee8cb1b96d807 at offset 2032 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
error: failed to read object 44cc0b565eca87cf836116abe0f9e2ff4fd0b0a4 at offset 2233 from .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack
fatal: packed object 44cc0b565eca87cf836116abe0f9e2ff4fd0b0a4 (stored in .git/objects/pack/pack-bbfb7489c21eaac49a086215e1c3699ef989f595.pack) is corrupt
ok 27 - corrupting header to have too small output buffer fails unpack

# passed all 27 test(s)
1..27
*** t5304-prune.sh ***
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule_update_repo/.) registered for path 'sub1'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5304-prune/.git/
ok 15 - use packed deltified (OFS_DELTA) objects

expecting success: 
	(
		rm -fr missing-pack &&
		mkdir missing-pack &&
		cd missing-pack &&
		git init &&
		GOP=.git/objects/pack
		rm -fr $GOP &&
		git index-pack --stdin --keep=test <../test-3-${packname_3}.pack &&
		test -f $GOP/pack-${packname_3}.pack &&
		cmp $GOP/pack-${packname_3}.pack ../test-3-${packname_3}.pack &&
		test -f $GOP/pack-${packname_3}.idx &&
		cmp $GOP/pack-${packname_3}.idx ../test-3-${packname_3}.idx &&
		test -f $GOP/pack-${packname_3}.keep
	)

expecting success: 

	: > file &&
	git add file &&
	test_tick &&
	git commit -m initial &&
	git gc


4307528f01beff143cd36a903cb8c9a9983a4c27 tree   12036 7200 12
e43b5801e4ac39a512e5d9423fc272cf5c3343f9 blob   300 313 7212
78fcb2fa30f448929fae32736f0fb56733d08746 blob   108 141 7525 1 e43b5801e4ac39a512e5d9423fc272cf5c3343f9
1c547eac61c40965963e85a56c24991ab1a0e3ef blob   108 141 7666 2 78fcb2fa30f448929fae32736f0fb56733d08746
571c7b54485960a9820927983c702eec1b41e91a blob   108 141 7807 3 1c547eac61c40965963e85a56c24991ab1a0e3ef
671d8800ae6936f107d70de2dbec536afb47d89a blob   108 141 7948 4 571c7b54485960a9820927983c702eec1b41e91a
f2377b316d0d92e3c29a2d6dba598ca02fb80e9c blob   108 141 8089 5 671d8800ae6936f107d70de2dbec536afb47d89a
0483297992ed4cd5ab3b5790912b1f03598ea660 blob   108 141 8230 6 f2377b316d0d92e3c29a2d6dba598ca02fb80e9c
1ddb0e1ff0db350df93807fda44ef75358d7ddb0 blob   108 141 8371 7 0483297992ed4cd5ab3b5790912b1f03598ea660
19dec2e189cd33584d2173979aecea01b3c59904 blob   108 141 8512 8 1ddb0e1ff0db350df93807fda44ef75358d7ddb0
2bc95d3b86ed1808b73d84f5c0287a61df979063 blob   108 141 8653 9 19dec2e189cd33584d2173979aecea01b3c59904
b8f11d512203fd0260eb79edd5cfca416ca404cb blob   300 313 8794
ef790963bda7ffd9e3556cf4211492680b34c2bf blob   108 141 9107 1 b8f11d512203fd0260eb79edd5cfca416ca404cb
a854bd2ad779f987395c790d0aa378277a7d3216 blob   108 141 9248 2 ef790963bda7ffd9e3556cf4211492680b34c2bf
b750a0431df80025eff766f0811e6a85e1dbc32a blob   108 141 9389 3 a854bd2ad779f987395c790d0aa378277a7d3216
9e793c3eeb7402e17eafb61928b96648a54a8789 blob   108 141 9530 4 b750a0431df80025eff766f0811e6a85e1dbc32a
35691bb59cfc8e5f0749a3c2df2d236150d7f7d1 blob   108 141 9671 5 9e793c3eeb7402e17eafb61928b96648a54a8789
0df5edef6dcc6452cf814984a4d4ea23a8e41e3c blob   108 141 9812 6 35691bb59cfc8e5f0749a3c2df2d236150d7f7d1
305f923c2d2e1fff9ec067b42443fff88aeebc67 blob   108 141 9953 7 0df5edef6dcc6452cf814984a4d4ea23a8e41e3c
67db08cb82e0053ee51773fbf4bdc50094e03767 blob   108 141 10094 8 305f923c2d2e1fff9ec067b42443fff88aeebc67
61a87ea87b8af074a75d0af78e77f2ed6141922c blob   108 141 10235 9 67db08cb82e0053ee51773fbf4bdc50094e03767
5e69af01a42867f9be8213089efc57c6a1517976 blob   300 313 10376
1280048552e2ee86127654132148d3c2e208b397 blob   108 141 10689 1 5e69af01a42867f9be8213089efc57c6a1517976
ec86b748af33306ff620ebe591da28ed622c1b4d blob   108 141 10830 2 1280048552e2ee86127654132148d3c2e208b397
ce83a0772693235f137100863f4217f9c6398a53 blob   108 141 10971 3 ec86b748af33306ff620ebe591da28ed622c1b4d
ebd5d1af0d246aa4f8e288c539b906eb765d48e1 blob   108 141 11112 4 ce83a0772693235f137100863f4217f9c6398a53
ef99659edf6a12a9320e29453d1e17054863c3d1 blob   108 141 11253 5 ebd5d1af0d246aa4f8e288c539b906eb765d48e1
17dc4d50c25440e569d3c4dabf41bb562c9013fc blob   108 141 11394 6 ef99659edf6a12a9320e29453d1e17054863c3d1
36a0964d29672133cea581290233bae77c3b8cca blob   108 141 11535 7 17dc4d50c25440e569d3c4dabf41bb562c9013fc
60a658626764685c980311c6325263eabdbe0547 blob   108 141 11676 8 36a0964d29672133cea581290233bae77c3b8cca
a7b6688d2a6f15e6f91d1701f64ca7da42a5a73a blob   108 141 11817 9 60a658626764685c980311c6325263eabdbe0547
ef1259b944f1b0c4ade62c049c2ea41daf63ccc7 blob   300 313 11958
612f382c01ffd0ea89c2a840cc683cfd1108628e blob   108 141 12271 1 ef1259b944f1b0c4ade62c049c2ea41daf63ccc7
ba0b924be466e9d85f8ba5563211e570d12d2841 blob   108 141 12412 2 612f382c01ffd0ea89c2a840cc683cfd1108628e
d05e80ce75fe6189e1b08dfc5fb9bf0a1a6e544e blob   108 141 12553 3 ba0b924be466e9d85f8ba5563211e570d12d2841
e80b417ea517c993f906556a00fa8acaceb559b4 blob   108 141 12694 4 d05e80ce75fe6189e1b08dfc5fb9bf0a1a6e544e
8cc2e1974c339c43bd481c205ea0024b54dbcb83 blob   108 141 12835 5 e80b417ea517c993f906556a00fa8acaceb559b4
8e57f0560c1135c5cdaca2c69094489ad6ddcdb0 blob   108 141 12976 6 8cc2e1974c339c43bd481c205ea0024b54dbcb83
416013a155571063a96f1e443ee44a8ac3f09c1b blob   108 141 13117 7 8e57f0560c1135c5cdaca2c69094489ad6ddcdb0
8dc7c392787f4ec7bb28c57bc6744a2b5f3122ed blob   108 141 13258 8 416013a155571063a96f1e443ee44a8ac3f09c1b
beb699952b6a188a54675c11696cb6a2652b5249 blob   108 141 13399 9 8dc7c392787f4ec7bb28c57bc6744a2b5f3122ed
0f66db930e6ce643852ad45eb91dc203575fb5f4 blob   300 313 13540
9a3a619d26a6e19b556d119d760b40a6397a9df4 blob   108 141 13853 1 0f66db930e6ce643852ad45eb91dc203575fb5f4
66336af04f97cfd40474e8aa4cea2e25275b5f94 blob   108 141 13994 2 9a3a619d26a6e19b556d119d760b40a6397a9df4
bf8886056d3abf37690115bfee10bf14ef5e4db9 blob   108 141 14135 3 66336af04f97cfd40474e8aa4cea2e25275b5f94
2c1120aee9298045837641feab263b3655725aa3 blob   108 141 14276 4 bf8886056d3abf37690115bfee10bf14ef5e4db9
f47f0d90220589a45dbccd06c8468eca7c04d70a blob   108 141 14417 5 2c1120aee9298045837641feab263b3655725aa3
add63edc5ce2dd58ff7d66b153f44d03b0d93df2 blob   108 141 14558 6 f47f0d90220589a45dbccd06c8468eca7c04d70a
75642e5399f1b51a33f0c6430af2fd997e4db578 blob   108 141 14699 7 add63edc5ce2dd58ff7d66b153f44d03b0d93df2
64e473488413d66fe6e464b3f09827501eb353fe blob   108 141 14840 8 75642e5399f1b51a33f0c6430af2fd997e4db578
597244daf249731fc922a26acfe6fb9ea3baca7f blob   108 141 14981 9 64e473488413d66fe6e464b3f09827501eb353fe
8d5f6b41255c60ea8f44892b918a38eebe43de6b blob   300 313 15122
c26e8fbe6bd52d34b340f61780b6e3dd3b9bed94 blob   108 141 15435 1 8d5f6b41255c60ea8f44892b918a38eebe43de6b
0246ff570c396c37ff08c0f5f9d88c84fc21a297 blob   108 141 15576 2 c26e8fbe6bd52d34b340f61780b6e3dd3b9bed94
cff9bb4b47c1bc50205d6a793d8d02bee852a229 blob   108 141 15717 3 0246ff570c396c37ff08c0f5f9d88c84fc21a297
2096ec927d087ee1076f1118e8fe48ab21a27bd7 blob   108 141 15858 4 cff9bb4b47c1bc50205d6a793d8d02bee852a229
0ff6b3e6f0b0957b5b05a06d9b4580f0e1798501 blob   108 141 15999 5 2096ec927d087ee1076f1118e8fe48ab21a27bd7
633de7a70fe29cecb721bb5033573fbf175b31fc blob   108 141 16140 6 0ff6b3e6f0b0957b5b05a06d9b4580f0e1798501
76db9ca0f1afa9c247d4c5a2fe60ca95154fd465 blob   108 141 16281 7 633de7a70fe29cecb721bb5033573fbf175b31fc
df4c5c8e8e25621bba74f233d59c76e5810f8677 blob   108 141 16422 8 76db9ca0f1afa9c247d4c5a2fe60ca95154fd465
9fc4cce844af6ed26932eb84045df0ab4a79f0b7 blob   108 141 16563 9 df4c5c8e8e25621bba74f233d59c76e5810f8677
ef3ddda4c2922f10089dfed6436267b445d5b118 blob   300 313 16704
1bdedd473270eef5c2c67c968ba1d5ee081013ee blob   108 141 17017 1 ef3ddda4c2922f10089dfed6436267b445d5b118
9d28c1ea0790ee28b8c35bc3fe88629980708730 blob   108 141 17158 2 1bdedd473270eef5c2c67c968ba1d5ee081013ee
a3264a35996ccaf722f869be8e379864e28ef561 blob   108 141 17299 3 9d28c1ea0790ee28b8c35bc3fe88629980708730
cd6f1b15bb20b9c706f8f80c77b7c210921f0b26 blob   108 141 17440 4 a3264a35996ccaf722f869be8e379864e28ef561
60601746c22df38cc0bcbce68f359fb2796d7569 blob   108 141 17581 5 cd6f1b15bb20b9c706f8f80c77b7c210921f0b26
f15a3f5dae93709cce491d407dad343f9577d8c5 blob   108 141 17722 6 60601746c22df38cc0bcbce68f359fb2796d7569
5dd384bbc7186571a9cccdba2ebaa794e87bfbdd blob   108 141 17863 7 f15a3f5dae93709cce491d407dad343f9577d8c5
d18475904b78554f1fd6f96b4c1ad44e84edf873 blob   108 141 18004 8 5dd384bbc7186571a9cccdba2ebaa794e87bfbdd
67728c76be3b7d5319ff2a93fc78aca0ff3824eb blob   108 141 18145 9 d18475904b78554f1fd6f96b4c1ad44e84edf873
c1ec14f204e244f32aa93c66e3fb6a7d4f58c081 blob   300 313 18286
258424ed6e5c4377a2aa55fb6d4818a3580291ad blob   108 141 18599 1 c1ec14f204e244f32aa93c66e3fb6a7d4f58c081
fcaa7a21cb9d0b0aa84d2cbac5115d7c300739a2 blob   108 141 18740 2 258424ed6e5c4377a2aa55fb6d4818a3580291ad
e1bfca166c2ff676f665fd3c58d7dea896ec48d7 blob   108 141 18881 3 fcaa7a21cb9d0b0aa84d2cbac5115d7c300739a2
383c3c67e93cfd05d272b187e3af5c1e00bcae5c blob   108 141 19022 4 e1bfca166c2ff676f665fd3c58d7dea896ec48d7
ad6a3267a9e0d49014eec133a5e968315e8ce834 blob   108 141 19163 5 383c3c67e93cfd05d272b187e3af5c1e00bcae5c
9dfc592085bb14371890b41e48c98b220420669b blob   108 141 19304 6 ad6a3267a9e0d49014eec133a5e968315e8ce834
c872afc7539f689178b7385010010ca7aef8f09a blob   108 141 19445 7 9dfc592085bb14371890b41e48c98b220420669b
1bc038b18c5039a05e173da2fd2b65b3d34ccd2b blob   108 141 19586 8 c872afc7539f689178b7385010010ca7aef8f09a
bdd7bd883f75c1726538851757168dc0dc33e222 blob   108 141 19727 9 1bc038b18c5039a05e173da2fd2b65b3d34ccd2b
71529d6ca58922aa05603b6f2784f87cad8703cf blob   300 313 19868
2bebfa6240e319a1c31951d05c8135f089fbbd29 blob   108 141 20181 1 71529d6ca58922aa05603b6f2784f87cad8703cf
83fcb919ae7bc9a80912c9bfd5731acd36666480 blob   108 141 20322 2 2bebfa6240e319a1c31951d05c8135f089fbbd29
b97506df40bbd212b52062b851cd88f04abb59b3 blob   108 141 20463 3 83fcb919ae7bc9a80912c9bfd5731acd36666480
298dc4942c3b3db53d484ffa86b451755cd2125f blob   108 141 20604 4 b97506df40bbd212b52062b851cd88f04abb59b3
ba11c807afc9699e7ea1cab791699bfd698c7e7d blob   108 141 20745 5 298dc4942c3b3db53d484ffa86b451755cd2125f
b1281e620292c2e74d8770eb99f0b6871e4cca59 blob   108 141 20886 6 ba11c807afc9699e7ea1cab791699bfd698c7e7d
368cd4d02a420764e0d31b35576f73b777c34604 blob   108 141 21027 7 b1281e620292c2e74d8770eb99f0b6871e4cca59
16d1323e84e3d5b058ab2ac8245db85bc4606c88 blob   108 141 21168 8 368cd4d02a420764e0d31b35576f73b777c34604
711d5e6b0d21b3aa205dcc960ec51475be8a25a5 blob   108 141 21309 9 16d1323e84e3d5b058ab2ac8245db85bc4606c88
d174d532539487c9aedbbaf38d556061b5acf826 blob   300 313 21450
bf5dcb9013df15ff0ae10e0682a92a7688a7720b blob   108 141 21763 1 d174d532539487c9aedbbaf38d556061b5acf826
fb214b786310655bc8ee46d89ca9a04ec9aed0c3 blob   108 141 21904 2 bf5dcb9013df15ff0ae10e0682a92a7688a7720b
b94140f4006d05e7e3822f5db19adc2b73a2cc05 blob   108 141 22045 3 fb214b786310655bc8ee46d89ca9a04ec9aed0c3
4019b50c838197ca4b8d664a4164a183cac8ad11 blob   108 141 22186 4 b94140f4006d05e7e3822f5db19adc2b73a2cc05
2826157afde0e74742115842ac2dddf5c3b5e23e blob   108 141 22327 5 4019b50c838197ca4b8d664a4164a183cac8ad11
99556fcde6a0be62a72c8b0c6682576a1d596bea blob   108 141 22468 6 2826157afde0e74742115842ac2dddf5c3b5e23e
8f5e7974c287b07f1cf8116485c4135340b807f3 blob   108 141 22609 7 99556fcde6a0be62a72c8b0c6682576a1d596bea
f9982291dfe87a9def1b12d24f9ca9a024a9dd8e blob   108 141 22750 8 8f5e7974c287b07f1cf8116485c4135340b807f3
3c5c0be699798d2f4fbe651051b9f17156f133c1 blob   108 141 22891 9 f9982291dfe87a9def1b12d24f9ca9a024a9dd8e
1297547aab30f952af805d38f6f1c1930cb3117b blob   8196 8210 23032
862f6954d9afd549b48fa2ef8e2f8ab96e309916 blob   8196 8210 31242
0471b3b8ab8da19f3968dc238e9555f4e48ce858 blob   8196 8210 39452
c80092496b80b5f21503b8c838dccfc1f2e2ddde blob   8196 8210 47662
e5a12c79cec70d52817054c4b9ef321003c6755f blob   8196 8210 55872
bf96a31446f37d8e57bb38a00797aa3af1f99370 blob   8196 8210 64082
0508b858e01f0367552fb14722388ba48dbd36f7 blob   8196 8210 72292
359017d1534767455090901a260985de1658d752 blob   8196 8210 80502
8d06001a3d38390afa66576caa6c55c796e33835 blob   8196 8210 88712
8162ceb825c07e3b1e17f5775665085da9b1e855 blob   8196 8210 96922
6910c5a645c9fe7f6b728034566b1668f0677a8e blob   8196 8210 105132
09ba511a995b8ea75067036d5c046f39052a3bd8 blob   8196 8210 113342
f45d142313c7a5270a60c664bb463cddadc467c1 blob   8196 8210 121552
964e51bf7d344bda71ea5e12dbd7bfb90120fcf0 blob   8196 8210 129762
408dd031138139f6ac6f402988f960527871f71a blob   8196 8210 137972
912fa0ec5536f31122e34577a4baf3b22d40de2a blob   8196 8210 146182
f02359c44ca04a542cc5bf59aa5f1de6cd1d5a4c blob   8196 8210 154392
b0566dd5d479c80c278bd5455c92aca689328471 blob   8196 8210 162602
49d17d605f042c1e978a68f625be6ab6294fa8fa blob   8196 8210 170812
8f744480abe8ad05bc419d1ab2e375b9c0fa3978 blob   8196 8210 179022
fff3a3a92d2268a464dbdcd00fc055885ee3cba9 blob   8196 8210 187232
f5fc0ff4afc14d9dfcb2580d3f438edd4cd8130a blob   8196 8210 195442
01179d82b18c252824e20e190543e0e84950d820 blob   8196 8210 203652
de3ed457f973b7ffb20edc36002c47a6e4b41066 blob   8196 8210 211862
9c4e1f8c16d04d90a2217279240996276d617067 blob   8196 8210 220072
816f18d19f433f5df9edbfb5547684b519fdeb3b blob   8196 8210 228282
72e7428e5ee3797ca0bf955f723b915bee919c48 blob   8196 8210 236492
41adb5af8e7f9737b16261fb0c224c7550c82f23 blob   8196 8210 244702
94f5d368a7c4ea294c463dc45cf15d387fa83c4e blob   8196 8210 252912
85fdf2eed169dbc1fe2d71439b589b0326dad12b blob   8196 8210 261122
bab18d872e9183c6d450b326477205bb0cc081cb blob   8196 8210 269332
b31fb3fb181512bc608b58cb33323d97ad6eac2f blob   8196 8210 277542
20a9519106ab64bf043456a58b6bfb04f1c7b39d blob   8196 8210 285752
94a015b2b6053f7a1d541969919e879bb2b75eef blob   8196 8210 293962
7353550b9b0e1da4f68b9484dfad2634100a00cc blob   8196 8210 302172
e28a360bcbd69ca1a0bb47834e640069c6672a8d blob   8196 8210 310382
8e6ffc05856460c2e08c8e9d824bbf510d3c1b52 blob   8196 8210 318592
ceade5760b1ba0bc11d4e4db6982ddf671495e58 blob   8196 8210 326802
92534f38b94c1da321d88c9ab5af8c3e804c2507 blob   8196 8210 335012
f5577acbfd83dddf90b2054d6cb5dce2df6d06ee blob   8196 8210 343222
59a27076dc0a8989215a160d61ac401e41c05126 blob   8196 8210 351432
2db6b919f253444b5437d8251e5d101d5a34e1b3 blob   8196 8210 359642
c1c35c36d4300da28c0570746adaf2f5b0b015a3 blob   8196 8210 367852
03a6f56dbbb556425ef8c43c31519b32eb5629a4 blob   8196 8210 376062
dd6209d4c0c5d4f210a8d1bb4a4d314cf284dea9 blob   8196 8210 384272
8c04fa425f4dfb4555b376e73d8f28d56b97a569 blob   8196 8210 392482
614e235cd8ca8af7ccf402a92eb34baadaaa3f18 blob   8196 8210 400692
b2f07ee5771d9e0de7166bc72a4a7ebce9830779 blob   8196 8210 408902
852ba0cf084474c1b0b48052606ae27346a5b1a1 blob   8196 8210 417112
15ff79f644a0596529eba0592017dce39e222b8e blob   8196 8210 425322
75f67c0c230f8923db5831094b1cc67f61bf1734 blob   8196 8210 433532
95b51158cd6365da9b10f1d8b06ba76dc5d5c5f1 blob   8196 8210 441742
5217ce416b26a3d76191d873490110746d0e8a04 blob   8196 8210 449952
c16eb68827fa5d6da73b320b431cf736c7a6a4af blob   8196 8210 458162
57983aab7f7384626a6a1f9ec08fba1902dd11e5 blob   8196 8210 466372
84e4d2ce637781776791c8e2cf4a9312a2783ceb blob   8196 8210 474582
2175a1a9d8757b3836f5cc44c6af0297aea36709 blob   8196 8210 482792
9b655d54faaf0a737a03731852f27cf6b552bcaf blob   8196 8210 491002
a3233ba1323f07a0d68f6020e7209025819cfa13 blob   8196 8210 499212
5a65a213ee0ebdc285c8e8eca24e9eda97f8a384 blob   8196 8210 507422
de1679ebb44d3fe59e8d2378471b56db384fb181 blob   8196 8210 515632
d2e455cc03081911f9ecd81245becd858d1e64ca blob   8196 8210 523842
72826d3e97bc228616e06235566a0db59c94bd74 blob   8196 8210 532052
debe389b3bdd62d96748db592e99cb0cc7b1b0f2 blob   8196 8210 540262
e572e59eee8119f8fb58e8595ecd0c622f2d6e29 blob   8196 8210 548472
197f45d948a36ac3762e5daf6ef4d43a5d969503 blob   8196 8210 556682
fb294d29a9d045d5a46a9c00e53777b394ceb346 blob   8196 8210 564892
10f7133774acbc162f5f79804744d64747eee380 blob   8196 8210 573102
16b9dea85eab6d7e452bdea4889e24a8ad79afd5 blob   8196 8210 581312
08a8cf223e5dc57504da3cd8eb56d33f276dc1b9 blob   8196 8210 589522
e3332ff9a2540b45e599be0c7bca8bbe28af2b43 blob   8196 8210 597732
5e1b961ae623672df764f64b737f332318d43baa blob   8196 8210 605942
14caba1bc2835573f3c20b7f2e5fb638a08e12ee blob   8196 8210 614152
84d1369c26d187b24dffe9029e81e119e4a374f5 blob   8196 8210 622362
5ef3a0f4954ade2d5c290ccc4d791c3b219d89ea blob   8196 8210 630572
610d16151ceb1dc4d5138f63ed410819a8b9161c blob   8196 8210 638782
3545eb1f5549261267ab0577b94372e88b49731d blob   8196 8210 646992
0d6e5c0388744cf82463ce1283ff99e863e9b26e blob   8196 8210 655202
611261b75bd720d3433ea8975d555b1ac3e692bd blob   8196 8210 663412
e25dc2ac80f9f78aa2809b5cd254ce47a51efbe5 blob   8196 8210 671622
ea5a4b4fed0bab7beffd3c7fc6cc549df47017d7 blob   8196 8210 679832
d68756996794df8c00dfcbf520662b14cb06958e blob   8196 8210 688042
b5b44a475116c2d0054edf54c699909d5d583aac blob   8196 8210 696252
99ff18078623c32b85a49cc8a03e3c58ee94eecb blob   8196 8210 704462
159fdc73e63cf90624d128d87b8185154727714e blob   8196 8210 712672
1f0ca97497381a196e53a7639ee769ed019469a3 blob   8196 8210 720882
6dbed45fde708bb67e6b21bd55976483305f9e74 blob   8196 8210 729092
b5ec32ad29b65e5742cd1857d17e92c2efc5da96 blob   8196 8210 737302
cf823d111604e8a014e0702b5e15b242bb961c78 blob   8196 8210 745512
72528baaeeba0d9c01da36a7a0add1ac49d860f2 blob   8196 8210 753722
b976a8fd346486d78cdebeaa0b0ac200befca629 blob   8196 8210 761932
e652cd97e9aae1523d892c1f417274dd26c3bcd3 blob   8196 8210 770142
aa82432626cc08fb818a20aa62b607aa52e7b35d blob   8196 8210 778352
d67069815168092ee0eadeab8177002bd0376b6f blob   8196 8210 786562
fa7ca115eb82e14f0263990362d4fc27591e1143 blob   8196 8210 794772
5cadb04c4d4ec953dffc528bf75561a6ae1c5820 blob   8196 8210 802982
a769ce6dfe1abe1b6162627b2b5df89f4f7d4317 blob   8196 8210 811192
bf265906aab0df90b6a4bdb1fe6f8088a9038435 blob   8196 8210 819402
b302b77fd5595784b5e85e91f8b4314fff49a6a1 blob   8196 8210 827612
3927444e44b49dfa6cdc768298ae879ec298c45d blob   8196 8210 835822
0b968294884af115eb5a1b941b3dabd48470c3bb blob   12 41 844032 1 3927444e44b49dfa6cdc768298ae879ec298c45d
34a68de99f94f6f9e437a288349602768eae4b92 blob   250 263 844073
8517d36660dffb896fb4e283ad110023aaebaf1b blob   57 90 844336 1 34a68de99f94f6f9e437a288349602768eae4b92
e3fc6633c069c8e246d77a408e4747c2852ba44a blob   57 90 844426 1 34a68de99f94f6f9e437a288349602768eae4b92
37a071e55d1f2e07af146ca6017d98dd85beae68 blob   57 90 844516 1 34a68de99f94f6f9e437a288349602768eae4b92
a8179a233b7aeeb7a450c5d321d4b73df936b64b blob   57 90 844606 1 34a68de99f94f6f9e437a288349602768eae4b92
99e0b239888c8b71671fb948e41111876e61a3c2 blob   57 90 844696 1 34a68de99f94f6f9e437a288349602768eae4b92
e26e04b4786bf6b0ec3c5d528e7002cd58e2401b blob   57 90 844786 1 34a68de99f94f6f9e437a288349602768eae4b92
a6106f10ea80724dbc32b328d9892111589a2111 blob   57 90 844876 1 34a68de99f94f6f9e437a288349602768eae4b92
d1669a170780865ccd7645211c2e1cebdfb28aad blob   57 90 844966 1 34a68de99f94f6f9e437a288349602768eae4b92
53a19e0c2c34ef1a4e1bbc9aa1cba4cb9bc2dd80 blob   57 90 845056 1 34a68de99f94f6f9e437a288349602768eae4b92
26ff29a62e7a6359d3975813fd645af871576125 blob   57 90 845146 1 34a68de99f94f6f9e437a288349602768eae4b92
c1d6b9953613f5732cd40d8cffbb2b746a71fb92 blob   57 90 845236 1 34a68de99f94f6f9e437a288349602768eae4b92
a2bfcc19d1592c43af33617500394e1ac09e968c blob   57 90 845326 1 34a68de99f94f6f9e437a288349602768eae4b92
36c0479c58cef0b9a10b56934ed42a862e1dcfe2 blob   57 90 845416 1 34a68de99f94f6f9e437a288349602768eae4b92
642aa265517d66c88f030a2230eb97e77c973905 blob   57 90 845506 1 34a68de99f94f6f9e437a288349602768eae4b92
29cd4721cd3cef7f5a2e032d6c2d6908427cd5af blob   57 90 845596 1 34a68de99f94f6f9e437a288349602768eae4b92
ae5ccb1578fbc399571f4f0132edd18c55b19ef0 blob   57 90 845686 1 34a68de99f94f6f9e437a288349602768eae4b92
d22feecdd32e57af8fd88bda0fbde8fbb96d4f1c blob   57 90 845776 1 34a68de99f94f6f9e437a288349602768eae4b92
ab2acc4bd273e799b56effc7e208a01814432ba5 blob   57 90 845866 1 34a68de99f94f6f9e437a288349602768eae4b92
2d5f83c6857691045da554091b8f2d82477d9baf blob   57 90 845956 1 34a68de99f94f6f9e437a288349602768eae4b92
fac99cd6f9219ee888b9382ee44a3b7932723b12 blob   57 90 846046 1 34a68de99f94f6f9e437a288349602768eae4b92
b32b0ed27f34e4a9d7c4aab24dfa2d6c51b1c2eb blob   57 90 846136 1 34a68de99f94f6f9e437a288349602768eae4b92
a3f38fbdbe8f34acc61f3a325104e739a875a4b6 blob   57 90 846226 1 34a68de99f94f6f9e437a288349602768eae4b92
6bc5c86eeb3dfcc3ca2343e39cc91dec35ddc90b blob   57 90 846316 1 34a68de99f94f6f9e437a288349602768eae4b92
38897be9103dbc6aff7d1ecd15c1dc6c6d18b0a7 blob   57 90 846406 1 34a68de99f94f6f9e437a288349602768eae4b92
69e0b8ef8cda369575b6801c6ed47daf09aa3c62 blob   57 90 846496 1 34a68de99f94f6f9e437a288349602768eae4b92
c3e6c8cf465113a74926f3d5c73a3b400970643c blob   57 90 846586 1 34a68de99f94f6f9e437a288349602768eae4b92
a31a03a60bad0896133e6e52982da2e7e22832ff blob   57 90 846676 1 34a68de99f94f6f9e437a288349602768eae4b92
735fe835bee0cfa2d7ecc2f195c22de3e7b208b3 blob   57 90 846766 1 34a68de99f94f6f9e437a288349602768eae4b92
84705bfd7a24eb59137fdc26c070c4329eee46a7 blob   57 90 846856 1 34a68de99f94f6f9e437a288349602768eae4b92
5090e761c398db8c0b3fe1c0069535c3b7a9a575 blob   57 90 846946 1 34a68de99f94f6f9e437a288349602768eae4b92
c5c8cc3525a17842c2e668d1499c7c2518202a87 blob   57 90 847036 1 34a68de99f94f6f9e437a288349602768eae4b92
441d41902c4ccb987a866663ebbcc729fbcc4072 blob   57 90 847126 1 34a68de99f94f6f9e437a288349602768eae4b92
55bc16727ba8a63a31eabd811cfc740dc423bab6 blob   57 90 847216 1 34a68de99f94f6f9e437a288349602768eae4b92
86c6bd761eacb8a021246263994bf02d1163c7b5 blob   57 90 847306 1 34a68de99f94f6f9e437a288349602768eae4b92
8812057b6f2583732f83db5bac543549cc621783 blob   57 90 847396 1 34a68de99f94f6f9e437a288349602768eae4b92
c8043aaa6a70318be94ef87be98ea2c7de7f23f5 blob   57 90 847486 1 34a68de99f94f6f9e437a288349602768eae4b92
9d48f3c2e700d81fbe46fbccc400bedc8666221a blob   57 90 847576 1 34a68de99f94f6f9e437a288349602768eae4b92
fd68f118bfc99562e08bd153a3f1c604f1ac0124 blob   57 90 847666 1 34a68de99f94f6f9e437a288349602768eae4b92
879bc6e196323012740d55b1e5bbd9937632ecf3 blob   57 90 847756 1 34a68de99f94f6f9e437a288349602768eae4b92
a3ed4b758faeca44e89792c3f1b0536b685d0552 blob   57 90 847846 1 34a68de99f94f6f9e437a288349602768eae4b92
d9dd72f666a9d30dee5cdd894ca365a82e965594 blob   57 90 847936 1 34a68de99f94f6f9e437a288349602768eae4b92
088ddcb945af72c47348b65a63992c71b6b9dbe8 blob   57 90 848026 1 34a68de99f94f6f9e437a288349602768eae4b92
9e7b55d50c530d08c120379e19bb1c1653bb3063 blob   57 90 848116 1 34a68de99f94f6f9e437a288349602768eae4b92
2dfd9df0b22049f88e22ae86e4370155ecb23271 blob   57 90 848206 1 34a68de99f94f6f9e437a288349602768eae4b92
9de2bb387fc8bf63dbc7a68cb22b9e8439896326 blob   57 90 848296 1 34a68de99f94f6f9e437a288349602768eae4b92
a7eacc2c62dfd538c2948cce08cd217cc72a7140 blob   57 90 848386 1 34a68de99f94f6f9e437a288349602768eae4b92
291b2d8c01a9bc50bc4605bc479a183193de2e45 blob   57 90 848476 1 34a68de99f94f6f9e437a288349602768eae4b92
464adf43722b49bca34d8727d70db33c9ec70097 blob   57 90 848566 1 34a68de99f94f6f9e437a288349602768eae4b92
aa6095774c04683081cad47f300324a88ea95f2e blob   57 90 848656 1 34a68de99f94f6f9e437a288349602768eae4b92
896562b116d22c48f8872854123c523b76928061 blob   57 90 848746 1 34a68de99f94f6f9e437a288349602768eae4b92
f01eb69ea9caabb9fe801ef0f1bfdfa4477e0e34 blob   57 90 848836 1 34a68de99f94f6f9e437a288349602768eae4b92
d8603740ffe28d592c9d10ae2d6ec9dd0cf71949 blob   57 90 848926 1 34a68de99f94f6f9e437a288349602768eae4b92
8eb88090ce51c8ce838b12302c761bbf806c3fcc blob   57 90 849016 1 34a68de99f94f6f9e437a288349602768eae4b92
e961d288a95c209fe01ba42f01a18605eb5a85d3 blob   57 90 849106 1 34a68de99f94f6f9e437a288349602768eae4b92
abd14d13fada2545825fdf71c5d4a22ebb60f697 blob   57 90 849196 1 34a68de99f94f6f9e437a288349602768eae4b92
6a54ffedf41f419c66f6cd734a27ec5968f79b5a blob   57 90 849286 1 34a68de99f94f6f9e437a288349602768eae4b92
b6fa6c3c025c4f875c78423ab993a9349cd964c5 blob   57 90 849376 1 34a68de99f94f6f9e437a288349602768eae4b92
088e69e7ab273e35b4f63ecb1b915a3997f13dff blob   57 90 849466 1 34a68de99f94f6f9e437a288349602768eae4b92
609652080c31409406c828cb996e41fa6a286654 blob   57 90 849556 1 34a68de99f94f6f9e437a288349602768eae4b92
90d3d9b65a2f0c939f45a86f65192846e8066e7f blob   57 90 849646 1 34a68de99f94f6f9e437a288349602768eae4b92
05b4f18d9841f7abb271e81accadea31c5416a71 blob   57 90 849736 1 34a68de99f94f6f9e437a288349602768eae4b92
cfdd1e216211554d586bb3be233190457c5f5c0d blob   57 90 849826 1 34a68de99f94f6f9e437a288349602768eae4b92
73375ca0591d6c17f37b9f287a7c19f368fc644f blob   57 90 849916 1 34a68de99f94f6f9e437a288349602768eae4b92
46cd94a7854b7360f8f8a7e637e2575e707f7b04 blob   57 90 850006 1 34a68de99f94f6f9e437a288349602768eae4b92
ec35852188f9e88aa67849934b0c50bd698fafef blob   57 90 850096 1 34a68de99f94f6f9e437a288349602768eae4b92
0106e17481932f5c223fafadc1d26abc6adf40d6 blob   57 90 850186 1 34a68de99f94f6f9e437a288349602768eae4b92
f846f988e45d97ac0163885e65920643f0029922 blob   57 90 850276 1 34a68de99f94f6f9e437a288349602768eae4b92
636d415b097ff0c103e63d09d96aeb07fdad2045 blob   57 90 850366 1 34a68de99f94f6f9e437a288349602768eae4b92
497017bb8901086d3120553a384f3500ceb86f2e blob   57 90 850456 1 34a68de99f94f6f9e437a288349602768eae4b92
c50bc0b26b2336dbe90b9c7bdaa8d4cfb8f65638 blob   57 90 850546 1 34a68de99f94f6f9e437a288349602768eae4b92
921538e73389e99e294938d8580ababdb639f140 blob   57 90 850636 1 34a68de99f94f6f9e437a288349602768eae4b92
9ede1b01ec1751bf9ca9d5845ac005edc6935601 blob   57 90 850726 1 34a68de99f94f6f9e437a288349602768eae4b92
1ba5df91f11a1011f4788bc4cc067743828dda41 blob   57 90 850816 1 34a68de99f94f6f9e437a288349602768eae4b92
188728c24ca8cf687133dd0a5782e8819cee10a6 blob   57 90 850906 1 34a68de99f94f6f9e437a288349602768eae4b92
cb0d0270d7c50e33aacd9a4247333622c62846a4 blob   57 90 850996 1 34a68de99f94f6f9e437a288349602768eae4b92
dd39f8544a79066c925baca19ddc02623970efd1 blob   57 90 851086 1 34a68de99f94f6f9e437a288349602768eae4b92
d0b35a20e2ffaa46d895d6296f555dd98956d536 blob   57 90 851176 1 34a68de99f94f6f9e437a288349602768eae4b92
ae274e8cd31f35d743e68b3c8420e604386fc514 blob   57 90 851266 1 34a68de99f94f6f9e437a288349602768eae4b92
d1ede5db04b30c10d395c13dec020c90320498b8 blob   57 90 851356 1 34a68de99f94f6f9e437a288349602768eae4b92
2adace6c3082b12f42112482372696d66c36e4ae blob   57 90 851446 1 34a68de99f94f6f9e437a288349602768eae4b92
035e7e54cee9eb197af435b6b6dcced489c233f6 blob   57 90 851536 1 34a68de99f94f6f9e437a288349602768eae4b92
74aced6a3316fd8d726932ed908b035cd33afef6 blob   57 90 851626 1 34a68de99f94f6f9e437a288349602768eae4b92
efbbfa01b16e997301bb440aad9c885321bb13d2 blob   57 90 851716 1 34a68de99f94f6f9e437a288349602768eae4b92
92433746fe3340a5d4bc3f5487545f5167eaeaad blob   57 90 851806 1 34a68de99f94f6f9e437a288349602768eae4b92
da7b351a2560fd44fe89fc6288c3efa72eace9eb blob   57 90 851896 1 34a68de99f94f6f9e437a288349602768eae4b92
63176d3a0ae88aee86fa1b2b4390ed0850e67a9b blob   57 90 851986 1 34a68de99f94f6f9e437a288349602768eae4b92
5e10cf16f2bf33110cf59f53d583527d676820e1 blob   57 90 852076 1 34a68de99f94f6f9e437a288349602768eae4b92
aeb87caeb18972ad237d4c5628bfedb2dca51d47 blob   57 90 852166 1 34a68de99f94f6f9e437a288349602768eae4b92
141df301ab1d7f9e40b90fb4435ec4ac40ae544d blob   57 90 852256 1 34a68de99f94f6f9e437a288349602768eae4b92
e7172196f3fd2742cbe382daa02fd9641b9f6ffb blob   57 90 852346 1 34a68de99f94f6f9e437a288349602768eae4b92
4e78d6c905bc6d0c06ad066400f0570a391f9385 blob   57 90 852436 1 34a68de99f94f6f9e437a288349602768eae4b92
c096ccf827c047c3a20cfb1dd3fd5b0485ec2a0b blob   57 90 852526 1 34a68de99f94f6f9e437a288349602768eae4b92
91c4bc3b3c200535d88f76e9e3566658cb7b2bfd blob   57 90 852616 1 34a68de99f94f6f9e437a288349602768eae4b92
0b7888c3e508fe256fe859ba46c77d100abbce3f blob   57 90 852706 1 34a68de99f94f6f9e437a288349602768eae4b92
36cfe418f3038689cd47b64845c6f24886f9ec73 blob   57 90 852796 1 34a68de99f94f6f9e437a288349602768eae4b92
54c9d6ab199e99bdbba483ef1287e0cc31fc84b3 blob   57 90 852886 1 34a68de99f94f6f9e437a288349602768eae4b92
8b64b7aafc16c177bcc58813c7a853f622feb10f blob   57 90 852976 1 34a68de99f94f6f9e437a288349602768eae4b92
6ff2ccef89b04f0539f51c0ffcbe5f7bcf108ced blob   57 90 853066 1 34a68de99f94f6f9e437a288349602768eae4b92
7b419ded53760b5dbe136c1ec83ef3f338fab544 blob   57 90 853156 1 34a68de99f94f6f9e437a288349602768eae4b92
non delta: 112 objects
chain length = 1: 110 objects
chain length = 2: 10 objects
chain length = 3: 10 objects
chain length = 4: 10 objects
chain length = 5: 10 objects
chain length = 6: 10 objects
chain length = 7: 10 objects
chain length = 8: 10 objects
chain length = 9: 10 objects
test-1-1c54d893dd9bf6645ecee2886ea72f2c2030bea1.pack: ok
ok 2 - pack-objects with index version 1

expecting success: pack2=$(git pack-objects --index-version=2 test-2 <obj-list) &&
     git verify-pack -v "test-2-${pack2}.pack"
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5300-pack-object/missing-pack/.git/
[master (root-commit) 1bd44cb] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file
Cloning into 'sub1'...
done.
ok 1 - setup

expecting success: 

	orig_pack=$(echo .git/objects/pack/*.pack) &&
	: > .git/objects/tmp_1.pack &&
	: > .git/objects/tmp_2.pack &&
	test-chmtime =-86501 .git/objects/tmp_1.pack &&
	git prune --expire 1.day &&
	test_path_is_file $orig_pack &&
	test_path_is_file .git/objects/tmp_2.pack &&
	test_path_is_missing .git/objects/tmp_1.pack


Submodule path 'sub1': checked out '912f7e75d9b2a9ea1bda5e8f2864195a1f540d4c'
ok 2 - prune stale packs

expecting success: 

	add_blob &&
	git prune --expire=1.hour.ago &&
	verbose test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
	test_path_is_file $BLOB_FILE &&
	test-chmtime =-86500 $BLOB_FILE &&
	git prune --expire 1.day &&
	verbose test $before = $(git count-objects | sed "s/ .*//") &&
	test_path_is_missing $BLOB_FILE


Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
ok 3 - prune --expire

expecting success: 

	add_blob &&
	test-chmtime =-$((2*$week-30)) $BLOB_FILE &&
	git gc &&
	verbose test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
	test_path_is_file $BLOB_FILE &&
	test-chmtime =-$((2*$week+1)) $BLOB_FILE &&
	git gc &&
	verbose test $before = $(git count-objects | sed "s/ .*//") &&
	test_path_is_missing $BLOB_FILE


keep	a0ba4155e12b5d059b80b5734acdd7ffbe0d697d
Applying: Replace sub1 with file
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
error: Your local changes to the following files would be overwritten by merge:
	.gitmodules
Please, commit your changes or stash them before you can merge.
Aborting
fatal: merging of trees 14c3edc2a99f5ea96b628ffab65df33a29b7be40 and d1e9329c60a6b679e0b815bd5c0de8ed01766cc5 failed
Merging 9a6c3e9bad777fd62694b780f2df8a4a39f46cff with Replace sub1 with file
Merging:
9a6c3e9 Add sub1
virtual Replace sub1 with file
found 1 common ancestor:
virtual 20265dd47fa7d46194fa4afbd35c75ba89f96150
error: Failed to merge in the changes.
Patch failed at 0001 Replace sub1 with file
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
ok 16 - survive missing objects/pack directory

expecting success: git verify-pack	test-1-${packname_1}.idx \
			test-2-${packname_2}.idx \
			test-3-${packname_3}.idx
'actual' is not empty, it contains:
:100644 100644 1b52e94c4a64cb0f66e5ac63bf7612443af0bb91 0000000000000000000000000000000000000000 M	.gitmodules
not ok 25 - am_3way: 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
		)
	
Cloning into 'submodule_update'...
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 4 - gc: implicit prune --expire

expecting success: 

	git config gc.pruneExpire invalid &&
	test_must_fail git gc


error: Invalid gc.pruneexpire: 'invalid'
fatal: bad config variable 'gc.pruneexpire' in file '.git/config' at line 7
ok 5 - gc: refuse to start with invalid gc.pruneExpire

expecting success: 

	git config gc.pruneExpire 2.days.ago &&
	git gc


Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule_update_repo/.) registered for path 'sub1'
4307528f01beff143cd36a903cb8c9a9983a4c27 tree   12036 7200 12
e43b5801e4ac39a512e5d9423fc272cf5c3343f9 blob   300 313 7212
78fcb2fa30f448929fae32736f0fb56733d08746 blob   108 141 7525 1 e43b5801e4ac39a512e5d9423fc272cf5c3343f9
1c547eac61c40965963e85a56c24991ab1a0e3ef blob   108 141 7666 2 78fcb2fa30f448929fae32736f0fb56733d08746
571c7b54485960a9820927983c702eec1b41e91a blob   108 141 7807 3 1c547eac61c40965963e85a56c24991ab1a0e3ef
671d8800ae6936f107d70de2dbec536afb47d89a blob   108 141 7948 4 571c7b54485960a9820927983c702eec1b41e91a
f2377b316d0d92e3c29a2d6dba598ca02fb80e9c blob   108 141 8089 5 671d8800ae6936f107d70de2dbec536afb47d89a
0483297992ed4cd5ab3b5790912b1f03598ea660 blob   108 141 8230 6 f2377b316d0d92e3c29a2d6dba598ca02fb80e9c
1ddb0e1ff0db350df93807fda44ef75358d7ddb0 blob   108 141 8371 7 0483297992ed4cd5ab3b5790912b1f03598ea660
19dec2e189cd33584d2173979aecea01b3c59904 blob   108 141 8512 8 1ddb0e1ff0db350df93807fda44ef75358d7ddb0
2bc95d3b86ed1808b73d84f5c0287a61df979063 blob   108 141 8653 9 19dec2e189cd33584d2173979aecea01b3c59904
b8f11d512203fd0260eb79edd5cfca416ca404cb blob   300 313 8794
ef790963bda7ffd9e3556cf4211492680b34c2bf blob   108 141 9107 1 b8f11d512203fd0260eb79edd5cfca416ca404cb
a854bd2ad779f987395c790d0aa378277a7d3216 blob   108 141 9248 2 ef790963bda7ffd9e3556cf4211492680b34c2bf
b750a0431df80025eff766f0811e6a85e1dbc32a blob   108 141 9389 3 a854bd2ad779f987395c790d0aa378277a7d3216
9e793c3eeb7402e17eafb61928b96648a54a8789 blob   108 141 9530 4 b750a0431df80025eff766f0811e6a85e1dbc32a
35691bb59cfc8e5f0749a3c2df2d236150d7f7d1 blob   108 141 9671 5 9e793c3eeb7402e17eafb61928b96648a54a8789
0df5edef6dcc6452cf814984a4d4ea23a8e41e3c blob   108 141 9812 6 35691bb59cfc8e5f0749a3c2df2d236150d7f7d1
305f923c2d2e1fff9ec067b42443fff88aeebc67 blob   108 141 9953 7 0df5edef6dcc6452cf814984a4d4ea23a8e41e3c
67db08cb82e0053ee51773fbf4bdc50094e03767 blob   108 141 10094 8 305f923c2d2e1fff9ec067b42443fff88aeebc67
61a87ea87b8af074a75d0af78e77f2ed6141922c blob   108 141 10235 9 67db08cb82e0053ee51773fbf4bdc50094e03767
5e69af01a42867f9be8213089efc57c6a1517976 blob   300 313 10376
1280048552e2ee86127654132148d3c2e208b397 blob   108 141 10689 1 5e69af01a42867f9be8213089efc57c6a1517976
ec86b748af33306ff620ebe591da28ed622c1b4d blob   108 141 10830 2 1280048552e2ee86127654132148d3c2e208b397
ce83a0772693235f137100863f4217f9c6398a53 blob   108 141 10971 3 ec86b748af33306ff620ebe591da28ed622c1b4d
ebd5d1af0d246aa4f8e288c539b906eb765d48e1 blob   108 141 11112 4 ce83a0772693235f137100863f4217f9c6398a53
ef99659edf6a12a9320e29453d1e17054863c3d1 blob   108 141 11253 5 ebd5d1af0d246aa4f8e288c539b906eb765d48e1
17dc4d50c25440e569d3c4dabf41bb562c9013fc blob   108 141 11394 6 ef99659edf6a12a9320e29453d1e17054863c3d1
36a0964d29672133cea581290233bae77c3b8cca blob   108 141 11535 7 17dc4d50c25440e569d3c4dabf41bb562c9013fc
60a658626764685c980311c6325263eabdbe0547 blob   108 141 11676 8 36a0964d29672133cea581290233bae77c3b8cca
a7b6688d2a6f15e6f91d1701f64ca7da42a5a73a blob   108 141 11817 9 60a658626764685c980311c6325263eabdbe0547
ef1259b944f1b0c4ade62c049c2ea41daf63ccc7 blob   300 313 11958
612f382c01ffd0ea89c2a840cc683cfd1108628e blob   108 141 12271 1 ef1259b944f1b0c4ade62c049c2ea41daf63ccc7
ba0b924be466e9d85f8ba5563211e570d12d2841 blob   108 141 12412 2 612f382c01ffd0ea89c2a840cc683cfd1108628e
d05e80ce75fe6189e1b08dfc5fb9bf0a1a6e544e blob   108 141 12553 3 ba0b924be466e9d85f8ba5563211e570d12d2841
e80b417ea517c993f906556a00fa8acaceb559b4 blob   108 141 12694 4 d05e80ce75fe6189e1b08dfc5fb9bf0a1a6e544e
8cc2e1974c339c43bd481c205ea0024b54dbcb83 blob   108 141 12835 5 e80b417ea517c993f906556a00fa8acaceb559b4
8e57f0560c1135c5cdaca2c69094489ad6ddcdb0 blob   108 141 12976 6 8cc2e1974c339c43bd481c205ea0024b54dbcb83
416013a155571063a96f1e443ee44a8ac3f09c1b blob   108 141 13117 7 8e57f0560c1135c5cdaca2c69094489ad6ddcdb0
8dc7c392787f4ec7bb28c57bc6744a2b5f3122ed blob   108 141 13258 8 416013a155571063a96f1e443ee44a8ac3f09c1b
beb699952b6a188a54675c11696cb6a2652b5249 blob   108 141 13399 9 8dc7c392787f4ec7bb28c57bc6744a2b5f3122ed
0f66db930e6ce643852ad45eb91dc203575fb5f4 blob   300 313 13540
9a3a619d26a6e19b556d119d760b40a6397a9df4 blob   108 141 13853 1 0f66db930e6ce643852ad45eb91dc203575fb5f4
66336af04f97cfd40474e8aa4cea2e25275b5f94 blob   108 141 13994 2 9a3a619d26a6e19b556d119d760b40a6397a9df4
bf8886056d3abf37690115bfee10bf14ef5e4db9 blob   108 141 14135 3 66336af04f97cfd40474e8aa4cea2e25275b5f94
2c1120aee9298045837641feab263b3655725aa3 blob   108 141 14276 4 bf8886056d3abf37690115bfee10bf14ef5e4db9
f47f0d90220589a45dbccd06c8468eca7c04d70a blob   108 141 14417 5 2c1120aee9298045837641feab263b3655725aa3
add63edc5ce2dd58ff7d66b153f44d03b0d93df2 blob   108 141 14558 6 f47f0d90220589a45dbccd06c8468eca7c04d70a
75642e5399f1b51a33f0c6430af2fd997e4db578 blob   108 141 14699 7 add63edc5ce2dd58ff7d66b153f44d03b0d93df2
64e473488413d66fe6e464b3f09827501eb353fe blob   108 141 14840 8 75642e5399f1b51a33f0c6430af2fd997e4db578
597244daf249731fc922a26acfe6fb9ea3baca7f blob   108 141 14981 9 64e473488413d66fe6e464b3f09827501eb353fe
8d5f6b41255c60ea8f44892b918a38eebe43de6b blob   300 313 15122
c26e8fbe6bd52d34b340f61780b6e3dd3b9bed94 blob   108 141 15435 1 8d5f6b41255c60ea8f44892b918a38eebe43de6b
0246ff570c396c37ff08c0f5f9d88c84fc21a297 blob   108 141 15576 2 c26e8fbe6bd52d34b340f61780b6e3dd3b9bed94
cff9bb4b47c1bc50205d6a793d8d02bee852a229 blob   108 141 15717 3 0246ff570c396c37ff08c0f5f9d88c84fc21a297
2096ec927d087ee1076f1118e8fe48ab21a27bd7 blob   108 141 15858 4 cff9bb4b47c1bc50205d6a793d8d02bee852a229
0ff6b3e6f0b0957b5b05a06d9b4580f0e1798501 blob   108 141 15999 5 2096ec927d087ee1076f1118e8fe48ab21a27bd7
633de7a70fe29cecb721bb5033573fbf175b31fc blob   108 141 16140 6 0ff6b3e6f0b0957b5b05a06d9b4580f0e1798501
76db9ca0f1afa9c247d4c5a2fe60ca95154fd465 blob   108 141 16281 7 633de7a70fe29cecb721bb5033573fbf175b31fc
df4c5c8e8e25621bba74f233d59c76e5810f8677 blob   108 141 16422 8 76db9ca0f1afa9c247d4c5a2fe60ca95154fd465
9fc4cce844af6ed26932eb84045df0ab4a79f0b7 blob   108 141 16563 9 df4c5c8e8e25621bba74f233d59c76e5810f8677
ef3ddda4c2922f10089dfed6436267b445d5b118 blob   300 313 16704
1bdedd473270eef5c2c67c968ba1d5ee081013ee blob   108 141 17017 1 ef3ddda4c2922f10089dfed6436267b445d5b118
9d28c1ea0790ee28b8c35bc3fe88629980708730 blob   108 141 17158 2 1bdedd473270eef5c2c67c968ba1d5ee081013ee
a3264a35996ccaf722f869be8e379864e28ef561 blob   108 141 17299 3 9d28c1ea0790ee28b8c35bc3fe88629980708730
cd6f1b15bb20b9c706f8f80c77b7c210921f0b26 blob   108 141 17440 4 a3264a35996ccaf722f869be8e379864e28ef561
60601746c22df38cc0bcbce68f359fb2796d7569 blob   108 141 17581 5 cd6f1b15bb20b9c706f8f80c77b7c210921f0b26
f15a3f5dae93709cce491d407dad343f9577d8c5 blob   108 141 17722 6 60601746c22df38cc0bcbce68f359fb2796d7569
5dd384bbc7186571a9cccdba2ebaa794e87bfbdd blob   108 141 17863 7 f15a3f5dae93709cce491d407dad343f9577d8c5
d18475904b78554f1fd6f96b4c1ad44e84edf873 blob   108 141 18004 8 5dd384bbc7186571a9cccdba2ebaa794e87bfbdd
67728c76be3b7d5319ff2a93fc78aca0ff3824eb blob   108 141 18145 9 d18475904b78554f1fd6f96b4c1ad44e84edf873
c1ec14f204e244f32aa93c66e3fb6a7d4f58c081 blob   300 313 18286
258424ed6e5c4377a2aa55fb6d4818a3580291ad blob   108 141 18599 1 c1ec14f204e244f32aa93c66e3fb6a7d4f58c081
fcaa7a21cb9d0b0aa84d2cbac5115d7c300739a2 blob   108 141 18740 2 258424ed6e5c4377a2aa55fb6d4818a3580291ad
e1bfca166c2ff676f665fd3c58d7dea896ec48d7 blob   108 141 18881 3 fcaa7a21cb9d0b0aa84d2cbac5115d7c300739a2
383c3c67e93cfd05d272b187e3af5c1e00bcae5c blob   108 141 19022 4 e1bfca166c2ff676f665fd3c58d7dea896ec48d7
ad6a3267a9e0d49014eec133a5e968315e8ce834 blob   108 141 19163 5 383c3c67e93cfd05d272b187e3af5c1e00bcae5c
9dfc592085bb14371890b41e48c98b220420669b blob   108 141 19304 6 ad6a3267a9e0d49014eec133a5e968315e8ce834
c872afc7539f689178b7385010010ca7aef8f09a blob   108 141 19445 7 9dfc592085bb14371890b41e48c98b220420669b
1bc038b18c5039a05e173da2fd2b65b3d34ccd2b blob   108 141 19586 8 c872afc7539f689178b7385010010ca7aef8f09a
bdd7bd883f75c1726538851757168dc0dc33e222 blob   108 141 19727 9 1bc038b18c5039a05e173da2fd2b65b3d34ccd2b
71529d6ca58922aa05603b6f2784f87cad8703cf blob   300 313 19868
2bebfa6240e319a1c31951d05c8135f089fbbd29 blob   108 141 20181 1 71529d6ca58922aa05603b6f2784f87cad8703cf
83fcb919ae7bc9a80912c9bfd5731acd36666480 blob   108 141 20322 2 2bebfa6240e319a1c31951d05c8135f089fbbd29
b97506df40bbd212b52062b851cd88f04abb59b3 blob   108 141 20463 3 83fcb919ae7bc9a80912c9bfd5731acd36666480
298dc4942c3b3db53d484ffa86b451755cd2125f blob   108 141 20604 4 b97506df40bbd212b52062b851cd88f04abb59b3
ba11c807afc9699e7ea1cab791699bfd698c7e7d blob   108 141 20745 5 298dc4942c3b3db53d484ffa86b451755cd2125f
b1281e620292c2e74d8770eb99f0b6871e4cca59 blob   108 141 20886 6 ba11c807afc9699e7ea1cab791699bfd698c7e7d
368cd4d02a420764e0d31b35576f73b777c34604 blob   108 141 21027 7 b1281e620292c2e74d8770eb99f0b6871e4cca59
16d1323e84e3d5b058ab2ac8245db85bc4606c88 blob   108 141 21168 8 368cd4d02a420764e0d31b35576f73b777c34604
711d5e6b0d21b3aa205dcc960ec51475be8a25a5 blob   108 141 21309 9 16d1323e84e3d5b058ab2ac8245db85bc4606c88
d174d532539487c9aedbbaf38d556061b5acf826 blob   300 313 21450
bf5dcb9013df15ff0ae10e0682a92a7688a7720b blob   108 141 21763 1 d174d532539487c9aedbbaf38d556061b5acf826
fb214b786310655bc8ee46d89ca9a04ec9aed0c3 blob   108 141 21904 2 bf5dcb9013df15ff0ae10e0682a92a7688a7720b
b94140f4006d05e7e3822f5db19adc2b73a2cc05 blob   108 141 22045 3 fb214b786310655bc8ee46d89ca9a04ec9aed0c3
4019b50c838197ca4b8d664a4164a183cac8ad11 blob   108 141 22186 4 b94140f4006d05e7e3822f5db19adc2b73a2cc05
2826157afde0e74742115842ac2dddf5c3b5e23e blob   108 141 22327 5 4019b50c838197ca4b8d664a4164a183cac8ad11
99556fcde6a0be62a72c8b0c6682576a1d596bea blob   108 141 22468 6 2826157afde0e74742115842ac2dddf5c3b5e23e
8f5e7974c287b07f1cf8116485c4135340b807f3 blob   108 141 22609 7 99556fcde6a0be62a72c8b0c6682576a1d596bea
f9982291dfe87a9def1b12d24f9ca9a024a9dd8e blob   108 141 22750 8 8f5e7974c287b07f1cf8116485c4135340b807f3
3c5c0be699798d2f4fbe651051b9f17156f133c1 blob   108 141 22891 9 f9982291dfe87a9def1b12d24f9ca9a024a9dd8e
1297547aab30f952af805d38f6f1c1930cb3117b blob   8196 8210 23032
862f6954d9afd549b48fa2ef8e2f8ab96e309916 blob   8196 8210 31242
0471b3b8ab8da19f3968dc238e9555f4e48ce858 blob   8196 8210 39452
c80092496b80b5f21503b8c838dccfc1f2e2ddde blob   8196 8210 47662
e5a12c79cec70d52817054c4b9ef321003c6755f blob   8196 8210 55872
bf96a31446f37d8e57bb38a00797aa3af1f99370 blob   8196 8210 64082
0508b858e01f0367552fb14722388ba48dbd36f7 blob   8196 8210 72292
359017d1534767455090901a260985de1658d752 blob   8196 8210 80502
8d06001a3d38390afa66576caa6c55c796e33835 blob   8196 8210 88712
8162ceb825c07e3b1e17f5775665085da9b1e855 blob   8196 8210 96922
6910c5a645c9fe7f6b728034566b1668f0677a8e blob   8196 8210 105132
09ba511a995b8ea75067036d5c046f39052a3bd8 blob   8196 8210 113342
f45d142313c7a5270a60c664bb463cddadc467c1 blob   8196 8210 121552
964e51bf7d344bda71ea5e12dbd7bfb90120fcf0 blob   8196 8210 129762
408dd031138139f6ac6f402988f960527871f71a blob   8196 8210 137972
912fa0ec5536f31122e34577a4baf3b22d40de2a blob   8196 8210 146182
f02359c44ca04a542cc5bf59aa5f1de6cd1d5a4c blob   8196 8210 154392
b0566dd5d479c80c278bd5455c92aca689328471 blob   8196 8210 162602
49d17d605f042c1e978a68f625be6ab6294fa8fa blob   8196 8210 170812
8f744480abe8ad05bc419d1ab2e375b9c0fa3978 blob   8196 8210 179022
fff3a3a92d2268a464dbdcd00fc055885ee3cba9 blob   8196 8210 187232
f5fc0ff4afc14d9dfcb2580d3f438edd4cd8130a blob   8196 8210 195442
01179d82b18c252824e20e190543e0e84950d820 blob   8196 8210 203652
de3ed457f973b7ffb20edc36002c47a6e4b41066 blob   8196 8210 211862
9c4e1f8c16d04d90a2217279240996276d617067 blob   8196 8210 220072
816f18d19f433f5df9edbfb5547684b519fdeb3b blob   8196 8210 228282
72e7428e5ee3797ca0bf955f723b915bee919c48 blob   8196 8210 236492
41adb5af8e7f9737b16261fb0c224c7550c82f23 blob   8196 8210 244702
94f5d368a7c4ea294c463dc45cf15d387fa83c4e blob   8196 8210 252912
85fdf2eed169dbc1fe2d71439b589b0326dad12b blob   8196 8210 261122
bab18d872e9183c6d450b326477205bb0cc081cb blob   8196 8210 269332
b31fb3fb181512bc608b58cb33323d97ad6eac2f blob   8196 8210 277542
20a9519106ab64bf043456a58b6bfb04f1c7b39d blob   8196 8210 285752
94a015b2b6053f7a1d541969919e879bb2b75eef blob   8196 8210 293962
7353550b9b0e1da4f68b9484dfad2634100a00cc blob   8196 8210 302172
e28a360bcbd69ca1a0bb47834e640069c6672a8d blob   8196 8210 310382
8e6ffc05856460c2e08c8e9d824bbf510d3c1b52 blob   8196 8210 318592
ceade5760b1ba0bc11d4e4db6982ddf671495e58 blob   8196 8210 326802
92534f38b94c1da321d88c9ab5af8c3e804c2507 blob   8196 8210 335012
f5577acbfd83dddf90b2054d6cb5dce2df6d06ee blob   8196 8210 343222
59a27076dc0a8989215a160d61ac401e41c05126 blob   8196 8210 351432
2db6b919f253444b5437d8251e5d101d5a34e1b3 blob   8196 8210 359642
c1c35c36d4300da28c0570746adaf2f5b0b015a3 blob   8196 8210 367852
03a6f56dbbb556425ef8c43c31519b32eb5629a4 blob   8196 8210 376062
dd6209d4c0c5d4f210a8d1bb4a4d314cf284dea9 blob   8196 8210 384272
8c04fa425f4dfb4555b376e73d8f28d56b97a569 blob   8196 8210 392482
614e235cd8ca8af7ccf402a92eb34baadaaa3f18 blob   8196 8210 400692
b2f07ee5771d9e0de7166bc72a4a7ebce9830779 blob   8196 8210 408902
852ba0cf084474c1b0b48052606ae27346a5b1a1 blob   8196 8210 417112
15ff79f644a0596529eba0592017dce39e222b8e blob   8196 8210 425322
75f67c0c230f8923db5831094b1cc67f61bf1734 blob   8196 8210 433532
95b51158cd6365da9b10f1d8b06ba76dc5d5c5f1 blob   8196 8210 441742
5217ce416b26a3d76191d873490110746d0e8a04 blob   8196 8210 449952
c16eb68827fa5d6da73b320b431cf736c7a6a4af blob   8196 8210 458162
57983aab7f7384626a6a1f9ec08fba1902dd11e5 blob   8196 8210 466372
84e4d2ce637781776791c8e2cf4a9312a2783ceb blob   8196 8210 474582
2175a1a9d8757b3836f5cc44c6af0297aea36709 blob   8196 8210 482792
9b655d54faaf0a737a03731852f27cf6b552bcaf blob   8196 8210 491002
a3233ba1323f07a0d68f6020e7209025819cfa13 blob   8196 8210 499212
5a65a213ee0ebdc285c8e8eca24e9eda97f8a384 blob   8196 8210 507422
de1679ebb44d3fe59e8d2378471b56db384fb181 blob   8196 8210 515632
d2e455cc03081911f9ecd81245becd858d1e64ca blob   8196 8210 523842
72826d3e97bc228616e06235566a0db59c94bd74 blob   8196 8210 532052
debe389b3bdd62d96748db592e99cb0cc7b1b0f2 blob   8196 8210 540262
e572e59eee8119f8fb58e8595ecd0c622f2d6e29 blob   8196 8210 548472
197f45d948a36ac3762e5daf6ef4d43a5d969503 blob   8196 8210 556682
fb294d29a9d045d5a46a9c00e53777b394ceb346 blob   8196 8210 564892
10f7133774acbc162f5f79804744d64747eee380 blob   8196 8210 573102
16b9dea85eab6d7e452bdea4889e24a8ad79afd5 blob   8196 8210 581312
08a8cf223e5dc57504da3cd8eb56d33f276dc1b9 blob   8196 8210 589522
e3332ff9a2540b45e599be0c7bca8bbe28af2b43 blob   8196 8210 597732
5e1b961ae623672df764f64b737f332318d43baa blob   8196 8210 605942
14caba1bc2835573f3c20b7f2e5fb638a08e12ee blob   8196 8210 614152
84d1369c26d187b24dffe9029e81e119e4a374f5 blob   8196 8210 622362
5ef3a0f4954ade2d5c290ccc4d791c3b219d89ea blob   8196 8210 630572
610d16151ceb1dc4d5138f63ed410819a8b9161c blob   8196 8210 638782
3545eb1f5549261267ab0577b94372e88b49731d blob   8196 8210 646992
0d6e5c0388744cf82463ce1283ff99e863e9b26e blob   8196 8210 655202
611261b75bd720d3433ea8975d555b1ac3e692bd blob   8196 8210 663412
e25dc2ac80f9f78aa2809b5cd254ce47a51efbe5 blob   8196 8210 671622
ea5a4b4fed0bab7beffd3c7fc6cc549df47017d7 blob   8196 8210 679832
d68756996794df8c00dfcbf520662b14cb06958e blob   8196 8210 688042
b5b44a475116c2d0054edf54c699909d5d583aac blob   8196 8210 696252
99ff18078623c32b85a49cc8a03e3c58ee94eecb blob   8196 8210 704462
159fdc73e63cf90624d128d87b8185154727714e blob   8196 8210 712672
1f0ca97497381a196e53a7639ee769ed019469a3 blob   8196 8210 720882
6dbed45fde708bb67e6b21bd55976483305f9e74 blob   8196 8210 729092
b5ec32ad29b65e5742cd1857d17e92c2efc5da96 blob   8196 8210 737302
cf823d111604e8a014e0702b5e15b242bb961c78 blob   8196 8210 745512
72528baaeeba0d9c01da36a7a0add1ac49d860f2 blob   8196 8210 753722
b976a8fd346486d78cdebeaa0b0ac200befca629 blob   8196 8210 761932
e652cd97e9aae1523d892c1f417274dd26c3bcd3 blob   8196 8210 770142
aa82432626cc08fb818a20aa62b607aa52e7b35d blob   8196 8210 778352
d67069815168092ee0eadeab8177002bd0376b6f blob   8196 8210 786562
fa7ca115eb82e14f0263990362d4fc27591e1143 blob   8196 8210 794772
5cadb04c4d4ec953dffc528bf75561a6ae1c5820 blob   8196 8210 802982
a769ce6dfe1abe1b6162627b2b5df89f4f7d4317 blob   8196 8210 811192
bf265906aab0df90b6a4bdb1fe6f8088a9038435 blob   8196 8210 819402
b302b77fd5595784b5e85e91f8b4314fff49a6a1 blob   8196 8210 827612
3927444e44b49dfa6cdc768298ae879ec298c45d blob   8196 8210 835822
0b968294884af115eb5a1b941b3dabd48470c3bb blob   12 41 844032 1 3927444e44b49dfa6cdc768298ae879ec298c45d
34a68de99f94f6f9e437a288349602768eae4b92 blob   250 263 844073
8517d36660dffb896fb4e283ad110023aaebaf1b blob   57 90 844336 1 34a68de99f94f6f9e437a288349602768eae4b92
e3fc6633c069c8e246d77a408e4747c2852ba44a blob   57 90 844426 1 34a68de99f94f6f9e437a288349602768eae4b92
37a071e55d1f2e07af146ca6017d98dd85beae68 blob   57 90 844516 1 34a68de99f94f6f9e437a288349602768eae4b92
a8179a233b7aeeb7a450c5d321d4b73df936b64b blob   57 90 844606 1 34a68de99f94f6f9e437a288349602768eae4b92
99e0b239888c8b71671fb948e41111876e61a3c2 blob   57 90 844696 1 34a68de99f94f6f9e437a288349602768eae4b92
e26e04b4786bf6b0ec3c5d528e7002cd58e2401b blob   57 90 844786 1 34a68de99f94f6f9e437a288349602768eae4b92
a6106f10ea80724dbc32b328d9892111589a2111 blob   57 90 844876 1 34a68de99f94f6f9e437a288349602768eae4b92
d1669a170780865ccd7645211c2e1cebdfb28aad blob   57 90 844966 1 34a68de99f94f6f9e437a288349602768eae4b92
53a19e0c2c34ef1a4e1bbc9aa1cba4cb9bc2dd80 blob   57 90 845056 1 34a68de99f94f6f9e437a288349602768eae4b92
26ff29a62e7a6359d3975813fd645af871576125 blob   57 90 845146 1 34a68de99f94f6f9e437a288349602768eae4b92
c1d6b9953613f5732cd40d8cffbb2b746a71fb92 blob   57 90 845236 1 34a68de99f94f6f9e437a288349602768eae4b92
a2bfcc19d1592c43af33617500394e1ac09e968c blob   57 90 845326 1 34a68de99f94f6f9e437a288349602768eae4b92
36c0479c58cef0b9a10b56934ed42a862e1dcfe2 blob   57 90 845416 1 34a68de99f94f6f9e437a288349602768eae4b92
642aa265517d66c88f030a2230eb97e77c973905 blob   57 90 845506 1 34a68de99f94f6f9e437a288349602768eae4b92
29cd4721cd3cef7f5a2e032d6c2d6908427cd5af blob   57 90 845596 1 34a68de99f94f6f9e437a288349602768eae4b92
ae5ccb1578fbc399571f4f0132edd18c55b19ef0 blob   57 90 845686 1 34a68de99f94f6f9e437a288349602768eae4b92
d22feecdd32e57af8fd88bda0fbde8fbb96d4f1c blob   57 90 845776 1 34a68de99f94f6f9e437a288349602768eae4b92
ab2acc4bd273e799b56effc7e208a01814432ba5 blob   57 90 845866 1 34a68de99f94f6f9e437a288349602768eae4b92
2d5f83c6857691045da554091b8f2d82477d9baf blob   57 90 845956 1 34a68de99f94f6f9e437a288349602768eae4b92
fac99cd6f9219ee888b9382ee44a3b7932723b12 blob   57 90 846046 1 34a68de99f94f6f9e437a288349602768eae4b92
b32b0ed27f34e4a9d7c4aab24dfa2d6c51b1c2eb blob   57 90 846136 1 34a68de99f94f6f9e437a288349602768eae4b92
a3f38fbdbe8f34acc61f3a325104e739a875a4b6 blob   57 90 846226 1 34a68de99f94f6f9e437a288349602768eae4b92
6bc5c86eeb3dfcc3ca2343e39cc91dec35ddc90b blob   57 90 846316 1 34a68de99f94f6f9e437a288349602768eae4b92
38897be9103dbc6aff7d1ecd15c1dc6c6d18b0a7 blob   57 90 846406 1 34a68de99f94f6f9e437a288349602768eae4b92
69e0b8ef8cda369575b6801c6ed47daf09aa3c62 blob   57 90 846496 1 34a68de99f94f6f9e437a288349602768eae4b92
c3e6c8cf465113a74926f3d5c73a3b400970643c blob   57 90 846586 1 34a68de99f94f6f9e437a288349602768eae4b92
a31a03a60bad0896133e6e52982da2e7e22832ff blob   57 90 846676 1 34a68de99f94f6f9e437a288349602768eae4b92
735fe835bee0cfa2d7ecc2f195c22de3e7b208b3 blob   57 90 846766 1 34a68de99f94f6f9e437a288349602768eae4b92
84705bfd7a24eb59137fdc26c070c4329eee46a7 blob   57 90 846856 1 34a68de99f94f6f9e437a288349602768eae4b92
5090e761c398db8c0b3fe1c0069535c3b7a9a575 blob   57 90 846946 1 34a68de99f94f6f9e437a288349602768eae4b92
c5c8cc3525a17842c2e668d1499c7c2518202a87 blob   57 90 847036 1 34a68de99f94f6f9e437a288349602768eae4b92
441d41902c4ccb987a866663ebbcc729fbcc4072 blob   57 90 847126 1 34a68de99f94f6f9e437a288349602768eae4b92
55bc16727ba8a63a31eabd811cfc740dc423bab6 blob   57 90 847216 1 34a68de99f94f6f9e437a288349602768eae4b92
86c6bd761eacb8a021246263994bf02d1163c7b5 blob   57 90 847306 1 34a68de99f94f6f9e437a288349602768eae4b92
8812057b6f2583732f83db5bac543549cc621783 blob   57 90 847396 1 34a68de99f94f6f9e437a288349602768eae4b92
c8043aaa6a70318be94ef87be98ea2c7de7f23f5 blob   57 90 847486 1 34a68de99f94f6f9e437a288349602768eae4b92
9d48f3c2e700d81fbe46fbccc400bedc8666221a blob   57 90 847576 1 34a68de99f94f6f9e437a288349602768eae4b92
fd68f118bfc99562e08bd153a3f1c604f1ac0124 blob   57 90 847666 1 34a68de99f94f6f9e437a288349602768eae4b92
879bc6e196323012740d55b1e5bbd9937632ecf3 blob   57 90 847756 1 34a68de99f94f6f9e437a288349602768eae4b92
a3ed4b758faeca44e89792c3f1b0536b685d0552 blob   57 90 847846 1 34a68de99f94f6f9e437a288349602768eae4b92
d9dd72f666a9d30dee5cdd894ca365a82e965594 blob   57 90 847936 1 34a68de99f94f6f9e437a288349602768eae4b92
088ddcb945af72c47348b65a63992c71b6b9dbe8 blob   57 90 848026 1 34a68de99f94f6f9e437a288349602768eae4b92
9e7b55d50c530d08c120379e19bb1c1653bb3063 blob   57 90 848116 1 34a68de99f94f6f9e437a288349602768eae4b92
2dfd9df0b22049f88e22ae86e4370155ecb23271 blob   57 90 848206 1 34a68de99f94f6f9e437a288349602768eae4b92
9de2bb387fc8bf63dbc7a68cb22b9e8439896326 blob   57 90 848296 1 34a68de99f94f6f9e437a288349602768eae4b92
a7eacc2c62dfd538c2948cce08cd217cc72a7140 blob   57 90 848386 1 34a68de99f94f6f9e437a288349602768eae4b92
291b2d8c01a9bc50bc4605bc479a183193de2e45 blob   57 90 848476 1 34a68de99f94f6f9e437a288349602768eae4b92
464adf43722b49bca34d8727d70db33c9ec70097 blob   57 90 848566 1 34a68de99f94f6f9e437a288349602768eae4b92
aa6095774c04683081cad47f300324a88ea95f2e blob   57 90 848656 1 34a68de99f94f6f9e437a288349602768eae4b92
896562b116d22c48f8872854123c523b76928061 blob   57 90 848746 1 34a68de99f94f6f9e437a288349602768eae4b92
f01eb69ea9caabb9fe801ef0f1bfdfa4477e0e34 blob   57 90 848836 1 34a68de99f94f6f9e437a288349602768eae4b92
d8603740ffe28d592c9d10ae2d6ec9dd0cf71949 blob   57 90 848926 1 34a68de99f94f6f9e437a288349602768eae4b92
8eb88090ce51c8ce838b12302c761bbf806c3fcc blob   57 90 849016 1 34a68de99f94f6f9e437a288349602768eae4b92
e961d288a95c209fe01ba42f01a18605eb5a85d3 blob   57 90 849106 1 34a68de99f94f6f9e437a288349602768eae4b92
abd14d13fada2545825fdf71c5d4a22ebb60f697 blob   57 90 849196 1 34a68de99f94f6f9e437a288349602768eae4b92
6a54ffedf41f419c66f6cd734a27ec5968f79b5a blob   57 90 849286 1 34a68de99f94f6f9e437a288349602768eae4b92
b6fa6c3c025c4f875c78423ab993a9349cd964c5 blob   57 90 849376 1 34a68de99f94f6f9e437a288349602768eae4b92
088e69e7ab273e35b4f63ecb1b915a3997f13dff blob   57 90 849466 1 34a68de99f94f6f9e437a288349602768eae4b92
609652080c31409406c828cb996e41fa6a286654 blob   57 90 849556 1 34a68de99f94f6f9e437a288349602768eae4b92
90d3d9b65a2f0c939f45a86f65192846e8066e7f blob   57 90 849646 1 34a68de99f94f6f9e437a288349602768eae4b92
05b4f18d9841f7abb271e81accadea31c5416a71 blob   57 90 849736 1 34a68de99f94f6f9e437a288349602768eae4b92
cfdd1e216211554d586bb3be233190457c5f5c0d blob   57 90 849826 1 34a68de99f94f6f9e437a288349602768eae4b92
73375ca0591d6c17f37b9f287a7c19f368fc644f blob   57 90 849916 1 34a68de99f94f6f9e437a288349602768eae4b92
46cd94a7854b7360f8f8a7e637e2575e707f7b04 blob   57 90 850006 1 34a68de99f94f6f9e437a288349602768eae4b92
ec35852188f9e88aa67849934b0c50bd698fafef blob   57 90 850096 1 34a68de99f94f6f9e437a288349602768eae4b92
0106e17481932f5c223fafadc1d26abc6adf40d6 blob   57 90 850186 1 34a68de99f94f6f9e437a288349602768eae4b92
f846f988e45d97ac0163885e65920643f0029922 blob   57 90 850276 1 34a68de99f94f6f9e437a288349602768eae4b92
636d415b097ff0c103e63d09d96aeb07fdad2045 blob   57 90 850366 1 34a68de99f94f6f9e437a288349602768eae4b92
497017bb8901086d3120553a384f3500ceb86f2e blob   57 90 850456 1 34a68de99f94f6f9e437a288349602768eae4b92
c50bc0b26b2336dbe90b9c7bdaa8d4cfb8f65638 blob   57 90 850546 1 34a68de99f94f6f9e437a288349602768eae4b92
921538e73389e99e294938d8580ababdb639f140 blob   57 90 850636 1 34a68de99f94f6f9e437a288349602768eae4b92
9ede1b01ec1751bf9ca9d5845ac005edc6935601 blob   57 90 850726 1 34a68de99f94f6f9e437a288349602768eae4b92
1ba5df91f11a1011f4788bc4cc067743828dda41 blob   57 90 850816 1 34a68de99f94f6f9e437a288349602768eae4b92
188728c24ca8cf687133dd0a5782e8819cee10a6 blob   57 90 850906 1 34a68de99f94f6f9e437a288349602768eae4b92
cb0d0270d7c50e33aacd9a4247333622c62846a4 blob   57 90 850996 1 34a68de99f94f6f9e437a288349602768eae4b92
dd39f8544a79066c925baca19ddc02623970efd1 blob   57 90 851086 1 34a68de99f94f6f9e437a288349602768eae4b92
d0b35a20e2ffaa46d895d6296f555dd98956d536 blob   57 90 851176 1 34a68de99f94f6f9e437a288349602768eae4b92
ae274e8cd31f35d743e68b3c8420e604386fc514 blob   57 90 851266 1 34a68de99f94f6f9e437a288349602768eae4b92
d1ede5db04b30c10d395c13dec020c90320498b8 blob   57 90 851356 1 34a68de99f94f6f9e437a288349602768eae4b92
2adace6c3082b12f42112482372696d66c36e4ae blob   57 90 851446 1 34a68de99f94f6f9e437a288349602768eae4b92
035e7e54cee9eb197af435b6b6dcced489c233f6 blob   57 90 851536 1 34a68de99f94f6f9e437a288349602768eae4b92
74aced6a3316fd8d726932ed908b035cd33afef6 blob   57 90 851626 1 34a68de99f94f6f9e437a288349602768eae4b92
efbbfa01b16e997301bb440aad9c885321bb13d2 blob   57 90 851716 1 34a68de99f94f6f9e437a288349602768eae4b92
92433746fe3340a5d4bc3f5487545f5167eaeaad blob   57 90 851806 1 34a68de99f94f6f9e437a288349602768eae4b92
da7b351a2560fd44fe89fc6288c3efa72eace9eb blob   57 90 851896 1 34a68de99f94f6f9e437a288349602768eae4b92
63176d3a0ae88aee86fa1b2b4390ed0850e67a9b blob   57 90 851986 1 34a68de99f94f6f9e437a288349602768eae4b92
5e10cf16f2bf33110cf59f53d583527d676820e1 blob   57 90 852076 1 34a68de99f94f6f9e437a288349602768eae4b92
aeb87caeb18972ad237d4c5628bfedb2dca51d47 blob   57 90 852166 1 34a68de99f94f6f9e437a288349602768eae4b92
141df301ab1d7f9e40b90fb4435ec4ac40ae544d blob   57 90 852256 1 34a68de99f94f6f9e437a288349602768eae4b92
e7172196f3fd2742cbe382daa02fd9641b9f6ffb blob   57 90 852346 1 34a68de99f94f6f9e437a288349602768eae4b92
4e78d6c905bc6d0c06ad066400f0570a391f9385 blob   57 90 852436 1 34a68de99f94f6f9e437a288349602768eae4b92
c096ccf827c047c3a20cfb1dd3fd5b0485ec2a0b blob   57 90 852526 1 34a68de99f94f6f9e437a288349602768eae4b92
91c4bc3b3c200535d88f76e9e3566658cb7b2bfd blob   57 90 852616 1 34a68de99f94f6f9e437a288349602768eae4b92
0b7888c3e508fe256fe859ba46c77d100abbce3f blob   57 90 852706 1 34a68de99f94f6f9e437a288349602768eae4b92
36cfe418f3038689cd47b64845c6f24886f9ec73 blob   57 90 852796 1 34a68de99f94f6f9e437a288349602768eae4b92
54c9d6ab199e99bdbba483ef1287e0cc31fc84b3 blob   57 90 852886 1 34a68de99f94f6f9e437a288349602768eae4b92
8b64b7aafc16c177bcc58813c7a853f622feb10f blob   57 90 852976 1 34a68de99f94f6f9e437a288349602768eae4b92
6ff2ccef89b04f0539f51c0ffcbe5f7bcf108ced blob   57 90 853066 1 34a68de99f94f6f9e437a288349602768eae4b92
7b419ded53760b5dbe136c1ec83ef3f338fab544 blob   57 90 853156 1 34a68de99f94f6f9e437a288349602768eae4b92
non delta: 112 objects
chain length = 1: 110 objects
chain length = 2: 10 objects
chain length = 3: 10 objects
chain length = 4: 10 objects
chain length = 5: 10 objects
chain length = 6: 10 objects
chain length = 7: 10 objects
chain length = 8: 10 objects
chain length = 9: 10 objects
test-2-1c54d893dd9bf6645ecee2886ea72f2c2030bea1.pack: ok
ok 3 - pack-objects with index version 2

expecting success: cmp "test-1-${pack1}.pack" "test-2-${pack2}.pack"
ok 4 - both packs should be identical

expecting success: ! cmp "test-1-${pack1}.idx" "test-2-${pack2}.idx"
test-1-1c54d893dd9bf6645ecee2886ea72f2c2030bea1.idx test-2-1c54d893dd9bf6645ecee2886ea72f2c2030bea1.idx differ: char 1, line 1
ok 5 - index v1 and index v2 should be different

expecting success: git index-pack --index-version=1 -o 1.idx "test-1-${pack1}.pack"
Cloning into 'sub1'...
done.
ok 6 - gc: start with ok gc.pruneExpire

expecting success: 

	test_must_fail git prune garbage &&
	test_must_fail git prune --- &&
	test_must_fail git prune --no-such-option


fatal: unrecognized argument: garbage
error: unknown option `-'
usage: git prune [-n] [-v] [--expire <time>] [--] [<head>...]

    -n, --dry-run         do not remove, show only
    -v, --verbose         report pruned objects
    --progress            show progress
    --expire <expiry-date>
                          expire objects older than <time>

error: unknown option `no-such-option'
usage: git prune [-n] [-v] [--expire <time>] [--] [<head>...]

    -n, --dry-run         do not remove, show only
    -v, --verbose         report pruned objects
    --progress            show progress
    --expire <expiry-date>
                          expire objects older than <time>

ok 7 - prune: prune nonsense parameters

expecting success: 

	git config core.logAllRefUpdates false &&
	mv .git/logs .git/logs.old &&
	: > file2 &&
	git add file2 &&
	git commit -m temporary &&
	tmp_head=$(git rev-list -1 HEAD) &&
	git reset HEAD^ &&
	git prune &&
	test_must_fail git reset $tmp_head --


ok 17 - verify pack

expecting success: git verify-pack -v	test-1-${packname_1}.idx \
			test-2-${packname_2}.idx \
			test-3-${packname_3}.idx
1c54d893dd9bf6645ecee2886ea72f2c2030bea1
ok 6 - index-pack with index version 1

expecting success: git index-pack --index-version=2 -o 2.idx "test-1-${pack1}.pack"
[master bfcb208] temporary
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file2
Submodule path 'sub1': checked out '912f7e75d9b2a9ea1bda5e8f2864195a1f540d4c'
fatal: Could not parse object 'bfcb208a0bde848c9f19fc14ef5257e858575bcb'.
ok 8 - prune: prune unreachable heads

expecting success: 

	git checkout --detach --quiet &&
	git commit --allow-empty -m "detached commit" &&
	# verify that there is no reflogs
	# (should be removed and disabled by previous test)
	test_path_is_missing .git/logs &&
	git prune -n >prune_actual &&
	: >prune_expected &&
	test_cmp prune_actual prune_expected


[detached HEAD c34e89b] detached commit
 Author: A U Thor <author@example.com>
Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
ok 9 - prune: do not prune detached HEAD with no reflog

expecting success: 

	head_sha1=$(git rev-parse HEAD) &&
	git checkout --quiet master &&
	git prune -v >prune_actual &&
	grep "$head_sha1" prune_actual


Applying: Modify sub1
c34e89b682ec97c13fe9306a95efc6e8d3ab348a commit
ok 10 - prune: prune former HEAD after checking out branch

expecting success: 

	: > file2 &&
	git add file2 &&
	git commit -m temporary &&
	tmp_head=$(git rev-list -1 HEAD) &&
	git reset HEAD^ &&
	git prune -- $tmp_head &&
	git reset $tmp_head --


1c54d893dd9bf6645ecee2886ea72f2c2030bea1
ok 7 - index-pack with index version 2

expecting success: cmp "test-1-${pack1}.idx" "1.idx" &&
     cmp "test-2-${pack2}.idx" "2.idx"
ok 8 - index-pack results should match pack-objects ones

expecting success: 
	git index-pack --verify "test-1-${pack1}.pack"

3c5699c72c7dae4ca3b3ca9de37d68a592b50a45 tree   182 169 12
b04c7a2663e72179c393bdc0af5b6bc17a739237 commit 163 124 181
9d235ed07cd19811a6ceb342de82f190e49c9f68 blob   4096 31 305
012b05d476b4ffc9e62d036156b99467206f1efa blob   2097152 2097802 336
c82de19312b6c3695c0c18f70709a6c535682a67 blob   4096 31 2098138
6a9aaa62f091ea4b20590414e8b58c1b0b32b5bf blob   2097152 2097802 2098169
0be779221aca65277fd447c8207e1b3c2706ae20 blob   4096 31 4195971
b010fe5253f7dc59c6605dacb92fcea00d199d4e blob   4100 36 4196002
non delta: 8 objects
test-1-6a0af710a6468334a8152e4eaf18c75998e78755.pack: ok
[master bfcb208] temporary
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file2
ok 11 - prune: do not prune heads listed as an argument

expecting success: 

	add_blob &&
	test-chmtime =-$((5001*$day)) $BLOB_FILE &&
	git config gc.pruneExpire 2.days.ago &&
	git gc --no-prune &&
	verbose test 1 = $(git count-objects | sed "s/ .*//") &&
	test_path_is_file $BLOB_FILE


ok 9 - index-pack --verify on index version 1

expecting success: 
	git index-pack --verify "test-2-${pack2}.pack"

3c5699c72c7dae4ca3b3ca9de37d68a592b50a45 tree   182 169 12
b04c7a2663e72179c393bdc0af5b6bc17a739237 commit 163 124 181
9d235ed07cd19811a6ceb342de82f190e49c9f68 blob   4096 31 305
012b05d476b4ffc9e62d036156b99467206f1efa blob   2097152 2097802 336
c82de19312b6c3695c0c18f70709a6c535682a67 blob   4096 31 2098138
6a9aaa62f091ea4b20590414e8b58c1b0b32b5bf blob   2097152 2097802 2098169
b010fe5253f7dc59c6605dacb92fcea00d199d4e blob   4100 36 4195971
0be779221aca65277fd447c8207e1b3c2706ae20 blob   6 35 4196007 1 b010fe5253f7dc59c6605dacb92fcea00d199d4e
non delta: 7 objects
chain length = 1: 1 object
test-2-cec5d8f349f9079e3ee93ce629746bf578c31652.pack: ok
ok 10 - index-pack --verify on index version 2

expecting success: test_must_fail git pack-objects --index-version=2, test-3 <obj-list
fatal: bad index version '2,'
ok 11 - pack-objects --index-version=2, is not accepted

expecting success: pack3=$(git pack-objects --index-version=2,0x40000 test-3 <obj-list)
Submodule path 'sub1': checked out '7c11438d55b7d735712486d76a499d3ef1033d4c'
ok 12 - gc --no-prune

expecting success: 

	git config gc.pruneExpire 5002.days.ago &&
	git gc &&
	test_path_is_file $BLOB_FILE &&
	git config gc.pruneExpire 5000.days.ago &&
	git gc &&
	test_path_is_missing $BLOB_FILE


ok 26 - am_3way: 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
		)
	
Cloning into 'submodule_update'...
done.
3c5699c72c7dae4ca3b3ca9de37d68a592b50a45 tree   182 169 12
b04c7a2663e72179c393bdc0af5b6bc17a739237 commit 163 124 181
9d235ed07cd19811a6ceb342de82f190e49c9f68 blob   4096 31 305
012b05d476b4ffc9e62d036156b99467206f1efa blob   2097152 2097802 336
c82de19312b6c3695c0c18f70709a6c535682a67 blob   4096 31 2098138
6a9aaa62f091ea4b20590414e8b58c1b0b32b5bf blob   2097152 2097802 2098169
b010fe5253f7dc59c6605dacb92fcea00d199d4e blob   4100 36 4195971
0be779221aca65277fd447c8207e1b3c2706ae20 blob   6 16 4196007 1 b010fe5253f7dc59c6605dacb92fcea00d199d4e
non delta: 7 objects
chain length = 1: 1 object
test-3-a0ba4155e12b5d059b80b5734acdd7ffbe0d697d.pack: ok
ok 18 - verify pack -v

expecting success: cat test-1-${packname_1}.idx >test-3.idx &&
     cat test-2-${packname_2}.pack >test-3.pack &&
     if git verify-pack test-3.idx
     then false
     else :;
     fi
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 13 - gc respects gc.pruneExpire

expecting success: 

	add_blob &&
	test-chmtime =-$((5001*$day)) $BLOB_FILE &&
	git gc --prune=5002.days.ago &&
	test_path_is_file $BLOB_FILE &&
	git gc --prune=5000.days.ago &&
	test_path_is_missing $BLOB_FILE


Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule_update_repo/.) registered for path 'sub1'
fatal: sha1 file 'test-3.idx' validation error
ok 19 - verify-pack catches mismatched .idx and .pack files

expecting success: cat test-1-${packname_1}.pack >test-3.pack &&
     echo | dd of=test-3.pack count=1 bs=1 conv=notrunc seek=2 &&
     if git verify-pack test-3.idx
     then false
     else :;
     fi
Cloning into 'sub1'...
1+0 records in
1+0 records out
1 byte (1 B) copied, 0.0915887 s, 0.0 kB/s
fatal: pack signature mismatch
ok 20 - verify-pack catches a corrupted pack signature

expecting success: cat test-1-${packname_1}.pack >test-3.pack &&
     echo | dd of=test-3.pack count=1 bs=1 conv=notrunc seek=7 &&
     if git verify-pack test-3.idx
     then false
     else :;
     fi
done.
Submodule path 'sub1': checked out '912f7e75d9b2a9ea1bda5e8f2864195a1f540d4c'
1+0 records in
1+0 records out
1 byte (1 B) copied, 0.208846 s, 0.0 kB/s
fatal: pack version 10 unsupported
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
ok 21 - verify-pack catches a corrupted pack version

expecting success: cat test-1-${packname_1}.pack >test-3.pack &&
     echo | dd of=test-3.pack count=1 bs=1 conv=notrunc seek=12 &&
     if git verify-pack test-3.idx
     then false
     else :;
     fi
Applying: Invalid sub1 commit
1+0 records in
1+0 records out
1 byte (1 B) copied, 0.131064 s, 0.0 kB/s
fatal: pack has bad object at offset 12: unknown object type 0
ok 22 - verify-pack catches a corrupted type/size of the 1st packed object data

expecting success: l=`wc -c <test-3.idx` &&
     l=`expr $l - 20` &&
     cat test-1-${packname_1}.pack >test-3.pack &&
     printf "%20s" "" | dd of=test-3.idx count=20 bs=1 conv=notrunc seek=$l &&
     if git verify-pack test-3.pack
     then false
     else :;
     fi
ok 12 - index v2: force some 64-bit offsets with pack-objects

20+0 records in
20+0 records out
20 bytes (20 B) copied, 0.000993333 s, 20.1 kB/s
expecting success: git verify-pack -v "test-3-${pack3}.pack"
ok 14 - gc --prune=<date>

expecting success: 

	add_blob &&
	git gc --prune=never &&
	test_path_is_file $BLOB_FILE &&
	git gc --prune=now &&
	test_path_is_missing $BLOB_FILE


4307528f01beff143cd36a903cb8c9a9983a4c27 tree   12036 7200 12
e43b5801e4ac39a512e5d9423fc272cf5c3343f9 blob   300 313 7212
78fcb2fa30f448929fae32736f0fb56733d08746 blob   108 141 7525 1 e43b5801e4ac39a512e5d9423fc272cf5c3343f9
1c547eac61c40965963e85a56c24991ab1a0e3ef blob   108 141 7666 2 78fcb2fa30f448929fae32736f0fb56733d08746
571c7b54485960a9820927983c702eec1b41e91a blob   108 141 7807 3 1c547eac61c40965963e85a56c24991ab1a0e3ef
671d8800ae6936f107d70de2dbec536afb47d89a blob   108 141 7948 4 571c7b54485960a9820927983c702eec1b41e91a
f2377b316d0d92e3c29a2d6dba598ca02fb80e9c blob   108 141 8089 5 671d8800ae6936f107d70de2dbec536afb47d89a
0483297992ed4cd5ab3b5790912b1f03598ea660 blob   108 141 8230 6 f2377b316d0d92e3c29a2d6dba598ca02fb80e9c
1ddb0e1ff0db350df93807fda44ef75358d7ddb0 blob   108 141 8371 7 0483297992ed4cd5ab3b5790912b1f03598ea660
19dec2e189cd33584d2173979aecea01b3c59904 blob   108 141 8512 8 1ddb0e1ff0db350df93807fda44ef75358d7ddb0
2bc95d3b86ed1808b73d84f5c0287a61df979063 blob   108 141 8653 9 19dec2e189cd33584d2173979aecea01b3c59904
b8f11d512203fd0260eb79edd5cfca416ca404cb blob   300 313 8794
ef790963bda7ffd9e3556cf4211492680b34c2bf blob   108 141 9107 1 b8f11d512203fd0260eb79edd5cfca416ca404cb
a854bd2ad779f987395c790d0aa378277a7d3216 blob   108 141 9248 2 ef790963bda7ffd9e3556cf4211492680b34c2bf
b750a0431df80025eff766f0811e6a85e1dbc32a blob   108 141 9389 3 a854bd2ad779f987395c790d0aa378277a7d3216
9e793c3eeb7402e17eafb61928b96648a54a8789 blob   108 141 9530 4 b750a0431df80025eff766f0811e6a85e1dbc32a
35691bb59cfc8e5f0749a3c2df2d236150d7f7d1 blob   108 141 9671 5 9e793c3eeb7402e17eafb61928b96648a54a8789
0df5edef6dcc6452cf814984a4d4ea23a8e41e3c blob   108 141 9812 6 35691bb59cfc8e5f0749a3c2df2d236150d7f7d1
305f923c2d2e1fff9ec067b42443fff88aeebc67 blob   108 141 9953 7 0df5edef6dcc6452cf814984a4d4ea23a8e41e3c
67db08cb82e0053ee51773fbf4bdc50094e03767 blob   108 141 10094 8 305f923c2d2e1fff9ec067b42443fff88aeebc67
61a87ea87b8af074a75d0af78e77f2ed6141922c blob   108 141 10235 9 67db08cb82e0053ee51773fbf4bdc50094e03767
5e69af01a42867f9be8213089efc57c6a1517976 blob   300 313 10376
1280048552e2ee86127654132148d3c2e208b397 blob   108 141 10689 1 5e69af01a42867f9be8213089efc57c6a1517976
ec86b748af33306ff620ebe591da28ed622c1b4d blob   108 141 10830 2 1280048552e2ee86127654132148d3c2e208b397
ce83a0772693235f137100863f4217f9c6398a53 blob   108 141 10971 3 ec86b748af33306ff620ebe591da28ed622c1b4d
ebd5d1af0d246aa4f8e288c539b906eb765d48e1 blob   108 141 11112 4 ce83a0772693235f137100863f4217f9c6398a53
ef99659edf6a12a9320e29453d1e17054863c3d1 blob   108 141 11253 5 ebd5d1af0d246aa4f8e288c539b906eb765d48e1
17dc4d50c25440e569d3c4dabf41bb562c9013fc blob   108 141 11394 6 ef99659edf6a12a9320e29453d1e17054863c3d1
36a0964d29672133cea581290233bae77c3b8cca blob   108 141 11535 7 17dc4d50c25440e569d3c4dabf41bb562c9013fc
60a658626764685c980311c6325263eabdbe0547 blob   108 141 11676 8 36a0964d29672133cea581290233bae77c3b8cca
a7b6688d2a6f15e6f91d1701f64ca7da42a5a73a blob   108 141 11817 9 60a658626764685c980311c6325263eabdbe0547
ef1259b944f1b0c4ade62c049c2ea41daf63ccc7 blob   300 313 11958
612f382c01ffd0ea89c2a840cc683cfd1108628e blob   108 141 12271 1 ef1259b944f1b0c4ade62c049c2ea41daf63ccc7
ba0b924be466e9d85f8ba5563211e570d12d2841 blob   108 141 12412 2 612f382c01ffd0ea89c2a840cc683cfd1108628e
d05e80ce75fe6189e1b08dfc5fb9bf0a1a6e544e blob   108 141 12553 3 ba0b924be466e9d85f8ba5563211e570d12d2841
e80b417ea517c993f906556a00fa8acaceb559b4 blob   108 141 12694 4 d05e80ce75fe6189e1b08dfc5fb9bf0a1a6e544e
8cc2e1974c339c43bd481c205ea0024b54dbcb83 blob   108 141 12835 5 e80b417ea517c993f906556a00fa8acaceb559b4
8e57f0560c1135c5cdaca2c69094489ad6ddcdb0 blob   108 141 12976 6 8cc2e1974c339c43bd481c205ea0024b54dbcb83
416013a155571063a96f1e443ee44a8ac3f09c1b blob   108 141 13117 7 8e57f0560c1135c5cdaca2c69094489ad6ddcdb0
8dc7c392787f4ec7bb28c57bc6744a2b5f3122ed blob   108 141 13258 8 416013a155571063a96f1e443ee44a8ac3f09c1b
beb699952b6a188a54675c11696cb6a2652b5249 blob   108 141 13399 9 8dc7c392787f4ec7bb28c57bc6744a2b5f3122ed
0f66db930e6ce643852ad45eb91dc203575fb5f4 blob   300 313 13540
9a3a619d26a6e19b556d119d760b40a6397a9df4 blob   108 141 13853 1 0f66db930e6ce643852ad45eb91dc203575fb5f4
66336af04f97cfd40474e8aa4cea2e25275b5f94 blob   108 141 13994 2 9a3a619d26a6e19b556d119d760b40a6397a9df4
bf8886056d3abf37690115bfee10bf14ef5e4db9 blob   108 141 14135 3 66336af04f97cfd40474e8aa4cea2e25275b5f94
2c1120aee9298045837641feab263b3655725aa3 blob   108 141 14276 4 bf8886056d3abf37690115bfee10bf14ef5e4db9
f47f0d90220589a45dbccd06c8468eca7c04d70a blob   108 141 14417 5 2c1120aee9298045837641feab263b3655725aa3
add63edc5ce2dd58ff7d66b153f44d03b0d93df2 blob   108 141 14558 6 f47f0d90220589a45dbccd06c8468eca7c04d70a
75642e5399f1b51a33f0c6430af2fd997e4db578 blob   108 141 14699 7 add63edc5ce2dd58ff7d66b153f44d03b0d93df2
64e473488413d66fe6e464b3f09827501eb353fe blob   108 141 14840 8 75642e5399f1b51a33f0c6430af2fd997e4db578
597244daf249731fc922a26acfe6fb9ea3baca7f blob   108 141 14981 9 64e473488413d66fe6e464b3f09827501eb353fe
8d5f6b41255c60ea8f44892b918a38eebe43de6b blob   300 313 15122
c26e8fbe6bd52d34b340f61780b6e3dd3b9bed94 blob   108 141 15435 1 8d5f6b41255c60ea8f44892b918a38eebe43de6b
0246ff570c396c37ff08c0f5f9d88c84fc21a297 blob   108 141 15576 2 c26e8fbe6bd52d34b340f61780b6e3dd3b9bed94
cff9bb4b47c1bc50205d6a793d8d02bee852a229 blob   108 141 15717 3 0246ff570c396c37ff08c0f5f9d88c84fc21a297
2096ec927d087ee1076f1118e8fe48ab21a27bd7 blob   108 141 15858 4 cff9bb4b47c1bc50205d6a793d8d02bee852a229
0ff6b3e6f0b0957b5b05a06d9b4580f0e1798501 blob   108 141 15999 5 2096ec927d087ee1076f1118e8fe48ab21a27bd7
633de7a70fe29cecb721bb5033573fbf175b31fc blob   108 141 16140 6 0ff6b3e6f0b0957b5b05a06d9b4580f0e1798501
76db9ca0f1afa9c247d4c5a2fe60ca95154fd465 blob   108 141 16281 7 633de7a70fe29cecb721bb5033573fbf175b31fc
df4c5c8e8e25621bba74f233d59c76e5810f8677 blob   108 141 16422 8 76db9ca0f1afa9c247d4c5a2fe60ca95154fd465
9fc4cce844af6ed26932eb84045df0ab4a79f0b7 blob   108 141 16563 9 df4c5c8e8e25621bba74f233d59c76e5810f8677
ef3ddda4c2922f10089dfed6436267b445d5b118 blob   300 313 16704
1bdedd473270eef5c2c67c968ba1d5ee081013ee blob   108 141 17017 1 ef3ddda4c2922f10089dfed6436267b445d5b118
9d28c1ea0790ee28b8c35bc3fe88629980708730 blob   108 141 17158 2 1bdedd473270eef5c2c67c968ba1d5ee081013ee
a3264a35996ccaf722f869be8e379864e28ef561 blob   108 141 17299 3 9d28c1ea0790ee28b8c35bc3fe88629980708730
cd6f1b15bb20b9c706f8f80c77b7c210921f0b26 blob   108 141 17440 4 a3264a35996ccaf722f869be8e379864e28ef561
60601746c22df38cc0bcbce68f359fb2796d7569 blob   108 141 17581 5 cd6f1b15bb20b9c706f8f80c77b7c210921f0b26
f15a3f5dae93709cce491d407dad343f9577d8c5 blob   108 141 17722 6 60601746c22df38cc0bcbce68f359fb2796d7569
5dd384bbc7186571a9cccdba2ebaa794e87bfbdd blob   108 141 17863 7 f15a3f5dae93709cce491d407dad343f9577d8c5
d18475904b78554f1fd6f96b4c1ad44e84edf873 blob   108 141 18004 8 5dd384bbc7186571a9cccdba2ebaa794e87bfbdd
67728c76be3b7d5319ff2a93fc78aca0ff3824eb blob   108 141 18145 9 d18475904b78554f1fd6f96b4c1ad44e84edf873
c1ec14f204e244f32aa93c66e3fb6a7d4f58c081 blob   300 313 18286
258424ed6e5c4377a2aa55fb6d4818a3580291ad blob   108 141 18599 1 c1ec14f204e244f32aa93c66e3fb6a7d4f58c081
fcaa7a21cb9d0b0aa84d2cbac5115d7c300739a2 blob   108 141 18740 2 258424ed6e5c4377a2aa55fb6d4818a3580291ad
e1bfca166c2ff676f665fd3c58d7dea896ec48d7 blob   108 141 18881 3 fcaa7a21cb9d0b0aa84d2cbac5115d7c300739a2
383c3c67e93cfd05d272b187e3af5c1e00bcae5c blob   108 141 19022 4 e1bfca166c2ff676f665fd3c58d7dea896ec48d7
ad6a3267a9e0d49014eec133a5e968315e8ce834 blob   108 141 19163 5 383c3c67e93cfd05d272b187e3af5c1e00bcae5c
9dfc592085bb14371890b41e48c98b220420669b blob   108 141 19304 6 ad6a3267a9e0d49014eec133a5e968315e8ce834
c872afc7539f689178b7385010010ca7aef8f09a blob   108 141 19445 7 9dfc592085bb14371890b41e48c98b220420669b
1bc038b18c5039a05e173da2fd2b65b3d34ccd2b blob   108 141 19586 8 c872afc7539f689178b7385010010ca7aef8f09a
bdd7bd883f75c1726538851757168dc0dc33e222 blob   108 141 19727 9 1bc038b18c5039a05e173da2fd2b65b3d34ccd2b
71529d6ca58922aa05603b6f2784f87cad8703cf blob   300 313 19868
2bebfa6240e319a1c31951d05c8135f089fbbd29 blob   108 141 20181 1 71529d6ca58922aa05603b6f2784f87cad8703cf
83fcb919ae7bc9a80912c9bfd5731acd36666480 blob   108 141 20322 2 2bebfa6240e319a1c31951d05c8135f089fbbd29
b97506df40bbd212b52062b851cd88f04abb59b3 blob   108 141 20463 3 83fcb919ae7bc9a80912c9bfd5731acd36666480
298dc4942c3b3db53d484ffa86b451755cd2125f blob   108 141 20604 4 b97506df40bbd212b52062b851cd88f04abb59b3
ba11c807afc9699e7ea1cab791699bfd698c7e7d blob   108 141 20745 5 298dc4942c3b3db53d484ffa86b451755cd2125f
b1281e620292c2e74d8770eb99f0b6871e4cca59 blob   108 141 20886 6 ba11c807afc9699e7ea1cab791699bfd698c7e7d
368cd4d02a420764e0d31b35576f73b777c34604 blob   108 141 21027 7 b1281e620292c2e74d8770eb99f0b6871e4cca59
16d1323e84e3d5b058ab2ac8245db85bc4606c88 blob   108 141 21168 8 368cd4d02a420764e0d31b35576f73b777c34604
711d5e6b0d21b3aa205dcc960ec51475be8a25a5 blob   108 141 21309 9 16d1323e84e3d5b058ab2ac8245db85bc4606c88
d174d532539487c9aedbbaf38d556061b5acf826 blob   300 313 21450
bf5dcb9013df15ff0ae10e0682a92a7688a7720b blob   108 141 21763 1 d174d532539487c9aedbbaf38d556061b5acf826
fb214b786310655bc8ee46d89ca9a04ec9aed0c3 blob   108 141 21904 2 bf5dcb9013df15ff0ae10e0682a92a7688a7720b
b94140f4006d05e7e3822f5db19adc2b73a2cc05 blob   108 141 22045 3 fb214b786310655bc8ee46d89ca9a04ec9aed0c3
4019b50c838197ca4b8d664a4164a183cac8ad11 blob   108 141 22186 4 b94140f4006d05e7e3822f5db19adc2b73a2cc05
2826157afde0e74742115842ac2dddf5c3b5e23e blob   108 141 22327 5 4019b50c838197ca4b8d664a4164a183cac8ad11
99556fcde6a0be62a72c8b0c6682576a1d596bea blob   108 141 22468 6 2826157afde0e74742115842ac2dddf5c3b5e23e
8f5e7974c287b07f1cf8116485c4135340b807f3 blob   108 141 22609 7 99556fcde6a0be62a72c8b0c6682576a1d596bea
f9982291dfe87a9def1b12d24f9ca9a024a9dd8e blob   108 141 22750 8 8f5e7974c287b07f1cf8116485c4135340b807f3
3c5c0be699798d2f4fbe651051b9f17156f133c1 blob   108 141 22891 9 f9982291dfe87a9def1b12d24f9ca9a024a9dd8e
1297547aab30f952af805d38f6f1c1930cb3117b blob   8196 8210 23032
862f6954d9afd549b48fa2ef8e2f8ab96e309916 blob   8196 8210 31242
0471b3b8ab8da19f3968dc238e9555f4e48ce858 blob   8196 8210 39452
c80092496b80b5f21503b8c838dccfc1f2e2ddde blob   8196 8210 47662
e5a12c79cec70d52817054c4b9ef321003c6755f blob   8196 8210 55872
bf96a31446f37d8e57bb38a00797aa3af1f99370 blob   8196 8210 64082
0508b858e01f0367552fb14722388ba48dbd36f7 blob   8196 8210 72292
359017d1534767455090901a260985de1658d752 blob   8196 8210 80502
8d06001a3d38390afa66576caa6c55c796e33835 blob   8196 8210 88712
8162ceb825c07e3b1e17f5775665085da9b1e855 blob   8196 8210 96922
6910c5a645c9fe7f6b728034566b1668f0677a8e blob   8196 8210 105132
09ba511a995b8ea75067036d5c046f39052a3bd8 blob   8196 8210 113342
f45d142313c7a5270a60c664bb463cddadc467c1 blob   8196 8210 121552
964e51bf7d344bda71ea5e12dbd7bfb90120fcf0 blob   8196 8210 129762
408dd031138139f6ac6f402988f960527871f71a blob   8196 8210 137972
912fa0ec5536f31122e34577a4baf3b22d40de2a blob   8196 8210 146182
f02359c44ca04a542cc5bf59aa5f1de6cd1d5a4c blob   8196 8210 154392
b0566dd5d479c80c278bd5455c92aca689328471 blob   8196 8210 162602
49d17d605f042c1e978a68f625be6ab6294fa8fa blob   8196 8210 170812
8f744480abe8ad05bc419d1ab2e375b9c0fa3978 blob   8196 8210 179022
fff3a3a92d2268a464dbdcd00fc055885ee3cba9 blob   8196 8210 187232
f5fc0ff4afc14d9dfcb2580d3f438edd4cd8130a blob   8196 8210 195442
01179d82b18c252824e20e190543e0e84950d820 blob   8196 8210 203652
de3ed457f973b7ffb20edc36002c47a6e4b41066 blob   8196 8210 211862
9c4e1f8c16d04d90a2217279240996276d617067 blob   8196 8210 220072
816f18d19f433f5df9edbfb5547684b519fdeb3b blob   8196 8210 228282
72e7428e5ee3797ca0bf955f723b915bee919c48 blob   8196 8210 236492
41adb5af8e7f9737b16261fb0c224c7550c82f23 blob   8196 8210 244702
94f5d368a7c4ea294c463dc45cf15d387fa83c4e blob   8196 8210 252912
85fdf2eed169dbc1fe2d71439b589b0326dad12b blob   8196 8210 261122
bab18d872e9183c6d450b326477205bb0cc081cb blob   8196 8210 269332
b31fb3fb181512bc608b58cb33323d97ad6eac2f blob   8196 8210 277542
20a9519106ab64bf043456a58b6bfb04f1c7b39d blob   8196 8210 285752
94a015b2b6053f7a1d541969919e879bb2b75eef blob   8196 8210 293962
7353550b9b0e1da4f68b9484dfad2634100a00cc blob   8196 8210 302172
e28a360bcbd69ca1a0bb47834e640069c6672a8d blob   8196 8210 310382
8e6ffc05856460c2e08c8e9d824bbf510d3c1b52 blob   8196 8210 318592
ceade5760b1ba0bc11d4e4db6982ddf671495e58 blob   8196 8210 326802
92534f38b94c1da321d88c9ab5af8c3e804c2507 blob   8196 8210 335012
f5577acbfd83dddf90b2054d6cb5dce2df6d06ee blob   8196 8210 343222
59a27076dc0a8989215a160d61ac401e41c05126 blob   8196 8210 351432
2db6b919f253444b5437d8251e5d101d5a34e1b3 blob   8196 8210 359642
c1c35c36d4300da28c0570746adaf2f5b0b015a3 blob   8196 8210 367852
03a6f56dbbb556425ef8c43c31519b32eb5629a4 blob   8196 8210 376062
dd6209d4c0c5d4f210a8d1bb4a4d314cf284dea9 blob   8196 8210 384272
8c04fa425f4dfb4555b376e73d8f28d56b97a569 blob   8196 8210 392482
614e235cd8ca8af7ccf402a92eb34baadaaa3f18 blob   8196 8210 400692
b2f07ee5771d9e0de7166bc72a4a7ebce9830779 blob   8196 8210 408902
852ba0cf084474c1b0b48052606ae27346a5b1a1 blob   8196 8210 417112
15ff79f644a0596529eba0592017dce39e222b8e blob   8196 8210 425322
75f67c0c230f8923db5831094b1cc67f61bf1734 blob   8196 8210 433532
95b51158cd6365da9b10f1d8b06ba76dc5d5c5f1 blob   8196 8210 441742
5217ce416b26a3d76191d873490110746d0e8a04 blob   8196 8210 449952
c16eb68827fa5d6da73b320b431cf736c7a6a4af blob   8196 8210 458162
57983aab7f7384626a6a1f9ec08fba1902dd11e5 blob   8196 8210 466372
84e4d2ce637781776791c8e2cf4a9312a2783ceb blob   8196 8210 474582
2175a1a9d8757b3836f5cc44c6af0297aea36709 blob   8196 8210 482792
9b655d54faaf0a737a03731852f27cf6b552bcaf blob   8196 8210 491002
a3233ba1323f07a0d68f6020e7209025819cfa13 blob   8196 8210 499212
5a65a213ee0ebdc285c8e8eca24e9eda97f8a384 blob   8196 8210 507422
de1679ebb44d3fe59e8d2378471b56db384fb181 blob   8196 8210 515632
d2e455cc03081911f9ecd81245becd858d1e64ca blob   8196 8210 523842
72826d3e97bc228616e06235566a0db59c94bd74 blob   8196 8210 532052
debe389b3bdd62d96748db592e99cb0cc7b1b0f2 blob   8196 8210 540262
e572e59eee8119f8fb58e8595ecd0c622f2d6e29 blob   8196 8210 548472
197f45d948a36ac3762e5daf6ef4d43a5d969503 blob   8196 8210 556682
fb294d29a9d045d5a46a9c00e53777b394ceb346 blob   8196 8210 564892
10f7133774acbc162f5f79804744d64747eee380 blob   8196 8210 573102
16b9dea85eab6d7e452bdea4889e24a8ad79afd5 blob   8196 8210 581312
08a8cf223e5dc57504da3cd8eb56d33f276dc1b9 blob   8196 8210 589522
e3332ff9a2540b45e599be0c7bca8bbe28af2b43 blob   8196 8210 597732
5e1b961ae623672df764f64b737f332318d43baa blob   8196 8210 605942
14caba1bc2835573f3c20b7f2e5fb638a08e12ee blob   8196 8210 614152
84d1369c26d187b24dffe9029e81e119e4a374f5 blob   8196 8210 622362
5ef3a0f4954ade2d5c290ccc4d791c3b219d89ea blob   8196 8210 630572
610d16151ceb1dc4d5138f63ed410819a8b9161c blob   8196 8210 638782
3545eb1f5549261267ab0577b94372e88b49731d blob   8196 8210 646992
0d6e5c0388744cf82463ce1283ff99e863e9b26e blob   8196 8210 655202
611261b75bd720d3433ea8975d555b1ac3e692bd blob   8196 8210 663412
e25dc2ac80f9f78aa2809b5cd254ce47a51efbe5 blob   8196 8210 671622
ea5a4b4fed0bab7beffd3c7fc6cc549df47017d7 blob   8196 8210 679832
d68756996794df8c00dfcbf520662b14cb06958e blob   8196 8210 688042
b5b44a475116c2d0054edf54c699909d5d583aac blob   8196 8210 696252
99ff18078623c32b85a49cc8a03e3c58ee94eecb blob   8196 8210 704462
159fdc73e63cf90624d128d87b8185154727714e blob   8196 8210 712672
1f0ca97497381a196e53a7639ee769ed019469a3 blob   8196 8210 720882
6dbed45fde708bb67e6b21bd55976483305f9e74 blob   8196 8210 729092
b5ec32ad29b65e5742cd1857d17e92c2efc5da96 blob   8196 8210 737302
cf823d111604e8a014e0702b5e15b242bb961c78 blob   8196 8210 745512
72528baaeeba0d9c01da36a7a0add1ac49d860f2 blob   8196 8210 753722
b976a8fd346486d78cdebeaa0b0ac200befca629 blob   8196 8210 761932
e652cd97e9aae1523d892c1f417274dd26c3bcd3 blob   8196 8210 770142
aa82432626cc08fb818a20aa62b607aa52e7b35d blob   8196 8210 778352
d67069815168092ee0eadeab8177002bd0376b6f blob   8196 8210 786562
fa7ca115eb82e14f0263990362d4fc27591e1143 blob   8196 8210 794772
5cadb04c4d4ec953dffc528bf75561a6ae1c5820 blob   8196 8210 802982
a769ce6dfe1abe1b6162627b2b5df89f4f7d4317 blob   8196 8210 811192
bf265906aab0df90b6a4bdb1fe6f8088a9038435 blob   8196 8210 819402
b302b77fd5595784b5e85e91f8b4314fff49a6a1 blob   8196 8210 827612
3927444e44b49dfa6cdc768298ae879ec298c45d blob   8196 8210 835822
0b968294884af115eb5a1b941b3dabd48470c3bb blob   12 41 844032 1 3927444e44b49dfa6cdc768298ae879ec298c45d
34a68de99f94f6f9e437a288349602768eae4b92 blob   250 263 844073
8517d36660dffb896fb4e283ad110023aaebaf1b blob   57 90 844336 1 34a68de99f94f6f9e437a288349602768eae4b92
e3fc6633c069c8e246d77a408e4747c2852ba44a blob   57 90 844426 1 34a68de99f94f6f9e437a288349602768eae4b92
37a071e55d1f2e07af146ca6017d98dd85beae68 blob   57 90 844516 1 34a68de99f94f6f9e437a288349602768eae4b92
a8179a233b7aeeb7a450c5d321d4b73df936b64b blob   57 90 844606 1 34a68de99f94f6f9e437a288349602768eae4b92
99e0b239888c8b71671fb948e41111876e61a3c2 blob   57 90 844696 1 34a68de99f94f6f9e437a288349602768eae4b92
e26e04b4786bf6b0ec3c5d528e7002cd58e2401b blob   57 90 844786 1 34a68de99f94f6f9e437a288349602768eae4b92
a6106f10ea80724dbc32b328d9892111589a2111 blob   57 90 844876 1 34a68de99f94f6f9e437a288349602768eae4b92
d1669a170780865ccd7645211c2e1cebdfb28aad blob   57 90 844966 1 34a68de99f94f6f9e437a288349602768eae4b92
53a19e0c2c34ef1a4e1bbc9aa1cba4cb9bc2dd80 blob   57 90 845056 1 34a68de99f94f6f9e437a288349602768eae4b92
26ff29a62e7a6359d3975813fd645af871576125 blob   57 90 845146 1 34a68de99f94f6f9e437a288349602768eae4b92
c1d6b9953613f5732cd40d8cffbb2b746a71fb92 blob   57 90 845236 1 34a68de99f94f6f9e437a288349602768eae4b92
a2bfcc19d1592c43af33617500394e1ac09e968c blob   57 90 845326 1 34a68de99f94f6f9e437a288349602768eae4b92
36c0479c58cef0b9a10b56934ed42a862e1dcfe2 blob   57 90 845416 1 34a68de99f94f6f9e437a288349602768eae4b92
642aa265517d66c88f030a2230eb97e77c973905 blob   57 90 845506 1 34a68de99f94f6f9e437a288349602768eae4b92
29cd4721cd3cef7f5a2e032d6c2d6908427cd5af blob   57 90 845596 1 34a68de99f94f6f9e437a288349602768eae4b92
ae5ccb1578fbc399571f4f0132edd18c55b19ef0 blob   57 90 845686 1 34a68de99f94f6f9e437a288349602768eae4b92
d22feecdd32e57af8fd88bda0fbde8fbb96d4f1c blob   57 90 845776 1 34a68de99f94f6f9e437a288349602768eae4b92
ab2acc4bd273e799b56effc7e208a01814432ba5 blob   57 90 845866 1 34a68de99f94f6f9e437a288349602768eae4b92
2d5f83c6857691045da554091b8f2d82477d9baf blob   57 90 845956 1 34a68de99f94f6f9e437a288349602768eae4b92
fac99cd6f9219ee888b9382ee44a3b7932723b12 blob   57 90 846046 1 34a68de99f94f6f9e437a288349602768eae4b92
b32b0ed27f34e4a9d7c4aab24dfa2d6c51b1c2eb blob   57 90 846136 1 34a68de99f94f6f9e437a288349602768eae4b92
a3f38fbdbe8f34acc61f3a325104e739a875a4b6 blob   57 90 846226 1 34a68de99f94f6f9e437a288349602768eae4b92
6bc5c86eeb3dfcc3ca2343e39cc91dec35ddc90b blob   57 90 846316 1 34a68de99f94f6f9e437a288349602768eae4b92
38897be9103dbc6aff7d1ecd15c1dc6c6d18b0a7 blob   57 90 846406 1 34a68de99f94f6f9e437a288349602768eae4b92
69e0b8ef8cda369575b6801c6ed47daf09aa3c62 blob   57 90 846496 1 34a68de99f94f6f9e437a288349602768eae4b92
c3e6c8cf465113a74926f3d5c73a3b400970643c blob   57 90 846586 1 34a68de99f94f6f9e437a288349602768eae4b92
a31a03a60bad0896133e6e52982da2e7e22832ff blob   57 90 846676 1 34a68de99f94f6f9e437a288349602768eae4b92
735fe835bee0cfa2d7ecc2f195c22de3e7b208b3 blob   57 90 846766 1 34a68de99f94f6f9e437a288349602768eae4b92
84705bfd7a24eb59137fdc26c070c4329eee46a7 blob   57 90 846856 1 34a68de99f94f6f9e437a288349602768eae4b92
5090e761c398db8c0b3fe1c0069535c3b7a9a575 blob   57 90 846946 1 34a68de99f94f6f9e437a288349602768eae4b92
c5c8cc3525a17842c2e668d1499c7c2518202a87 blob   57 90 847036 1 34a68de99f94f6f9e437a288349602768eae4b92
441d41902c4ccb987a866663ebbcc729fbcc4072 blob   57 90 847126 1 34a68de99f94f6f9e437a288349602768eae4b92
55bc16727ba8a63a31eabd811cfc740dc423bab6 blob   57 90 847216 1 34a68de99f94f6f9e437a288349602768eae4b92
86c6bd761eacb8a021246263994bf02d1163c7b5 blob   57 90 847306 1 34a68de99f94f6f9e437a288349602768eae4b92
8812057b6f2583732f83db5bac543549cc621783 blob   57 90 847396 1 34a68de99f94f6f9e437a288349602768eae4b92
c8043aaa6a70318be94ef87be98ea2c7de7f23f5 blob   57 90 847486 1 34a68de99f94f6f9e437a288349602768eae4b92
9d48f3c2e700d81fbe46fbccc400bedc8666221a blob   57 90 847576 1 34a68de99f94f6f9e437a288349602768eae4b92
fd68f118bfc99562e08bd153a3f1c604f1ac0124 blob   57 90 847666 1 34a68de99f94f6f9e437a288349602768eae4b92
879bc6e196323012740d55b1e5bbd9937632ecf3 blob   57 90 847756 1 34a68de99f94f6f9e437a288349602768eae4b92
a3ed4b758faeca44e89792c3f1b0536b685d0552 blob   57 90 847846 1 34a68de99f94f6f9e437a288349602768eae4b92
d9dd72f666a9d30dee5cdd894ca365a82e965594 blob   57 90 847936 1 34a68de99f94f6f9e437a288349602768eae4b92
088ddcb945af72c47348b65a63992c71b6b9dbe8 blob   57 90 848026 1 34a68de99f94f6f9e437a288349602768eae4b92
9e7b55d50c530d08c120379e19bb1c1653bb3063 blob   57 90 848116 1 34a68de99f94f6f9e437a288349602768eae4b92
2dfd9df0b22049f88e22ae86e4370155ecb23271 blob   57 90 848206 1 34a68de99f94f6f9e437a288349602768eae4b92
9de2bb387fc8bf63dbc7a68cb22b9e8439896326 blob   57 90 848296 1 34a68de99f94f6f9e437a288349602768eae4b92
a7eacc2c62dfd538c2948cce08cd217cc72a7140 blob   57 90 848386 1 34a68de99f94f6f9e437a288349602768eae4b92
291b2d8c01a9bc50bc4605bc479a183193de2e45 blob   57 90 848476 1 34a68de99f94f6f9e437a288349602768eae4b92
464adf43722b49bca34d8727d70db33c9ec70097 blob   57 90 848566 1 34a68de99f94f6f9e437a288349602768eae4b92
aa6095774c04683081cad47f300324a88ea95f2e blob   57 90 848656 1 34a68de99f94f6f9e437a288349602768eae4b92
896562b116d22c48f8872854123c523b76928061 blob   57 90 848746 1 34a68de99f94f6f9e437a288349602768eae4b92
f01eb69ea9caabb9fe801ef0f1bfdfa4477e0e34 blob   57 90 848836 1 34a68de99f94f6f9e437a288349602768eae4b92
d8603740ffe28d592c9d10ae2d6ec9dd0cf71949 blob   57 90 848926 1 34a68de99f94f6f9e437a288349602768eae4b92
8eb88090ce51c8ce838b12302c761bbf806c3fcc blob   57 90 849016 1 34a68de99f94f6f9e437a288349602768eae4b92
e961d288a95c209fe01ba42f01a18605eb5a85d3 blob   57 90 849106 1 34a68de99f94f6f9e437a288349602768eae4b92
abd14d13fada2545825fdf71c5d4a22ebb60f697 blob   57 90 849196 1 34a68de99f94f6f9e437a288349602768eae4b92
6a54ffedf41f419c66f6cd734a27ec5968f79b5a blob   57 90 849286 1 34a68de99f94f6f9e437a288349602768eae4b92
b6fa6c3c025c4f875c78423ab993a9349cd964c5 blob   57 90 849376 1 34a68de99f94f6f9e437a288349602768eae4b92
088e69e7ab273e35b4f63ecb1b915a3997f13dff blob   57 90 849466 1 34a68de99f94f6f9e437a288349602768eae4b92
609652080c31409406c828cb996e41fa6a286654 blob   57 90 849556 1 34a68de99f94f6f9e437a288349602768eae4b92
90d3d9b65a2f0c939f45a86f65192846e8066e7f blob   57 90 849646 1 34a68de99f94f6f9e437a288349602768eae4b92
05b4f18d9841f7abb271e81accadea31c5416a71 blob   57 90 849736 1 34a68de99f94f6f9e437a288349602768eae4b92
cfdd1e216211554d586bb3be233190457c5f5c0d blob   57 90 849826 1 34a68de99f94f6f9e437a288349602768eae4b92
73375ca0591d6c17f37b9f287a7c19f368fc644f blob   57 90 849916 1 34a68de99f94f6f9e437a288349602768eae4b92
46cd94a7854b7360f8f8a7e637e2575e707f7b04 blob   57 90 850006 1 34a68de99f94f6f9e437a288349602768eae4b92
ec35852188f9e88aa67849934b0c50bd698fafef blob   57 90 850096 1 34a68de99f94f6f9e437a288349602768eae4b92
0106e17481932f5c223fafadc1d26abc6adf40d6 blob   57 90 850186 1 34a68de99f94f6f9e437a288349602768eae4b92
f846f988e45d97ac0163885e65920643f0029922 blob   57 90 850276 1 34a68de99f94f6f9e437a288349602768eae4b92
636d415b097ff0c103e63d09d96aeb07fdad2045 blob   57 90 850366 1 34a68de99f94f6f9e437a288349602768eae4b92
497017bb8901086d3120553a384f3500ceb86f2e blob   57 90 850456 1 34a68de99f94f6f9e437a288349602768eae4b92
c50bc0b26b2336dbe90b9c7bdaa8d4cfb8f65638 blob   57 90 850546 1 34a68de99f94f6f9e437a288349602768eae4b92
921538e73389e99e294938d8580ababdb639f140 blob   57 90 850636 1 34a68de99f94f6f9e437a288349602768eae4b92
9ede1b01ec1751bf9ca9d5845ac005edc6935601 blob   57 90 850726 1 34a68de99f94f6f9e437a288349602768eae4b92
1ba5df91f11a1011f4788bc4cc067743828dda41 blob   57 90 850816 1 34a68de99f94f6f9e437a288349602768eae4b92
188728c24ca8cf687133dd0a5782e8819cee10a6 blob   57 90 850906 1 34a68de99f94f6f9e437a288349602768eae4b92
cb0d0270d7c50e33aacd9a4247333622c62846a4 blob   57 90 850996 1 34a68de99f94f6f9e437a288349602768eae4b92
dd39f8544a79066c925baca19ddc02623970efd1 blob   57 90 851086 1 34a68de99f94f6f9e437a288349602768eae4b92
d0b35a20e2ffaa46d895d6296f555dd98956d536 blob   57 90 851176 1 34a68de99f94f6f9e437a288349602768eae4b92
ae274e8cd31f35d743e68b3c8420e604386fc514 blob   57 90 851266 1 34a68de99f94f6f9e437a288349602768eae4b92
d1ede5db04b30c10d395c13dec020c90320498b8 blob   57 90 851356 1 34a68de99f94f6f9e437a288349602768eae4b92
2adace6c3082b12f42112482372696d66c36e4ae blob   57 90 851446 1 34a68de99f94f6f9e437a288349602768eae4b92
035e7e54cee9eb197af435b6b6dcced489c233f6 blob   57 90 851536 1 34a68de99f94f6f9e437a288349602768eae4b92
74aced6a3316fd8d726932ed908b035cd33afef6 blob   57 90 851626 1 34a68de99f94f6f9e437a288349602768eae4b92
efbbfa01b16e997301bb440aad9c885321bb13d2 blob   57 90 851716 1 34a68de99f94f6f9e437a288349602768eae4b92
92433746fe3340a5d4bc3f5487545f5167eaeaad blob   57 90 851806 1 34a68de99f94f6f9e437a288349602768eae4b92
da7b351a2560fd44fe89fc6288c3efa72eace9eb blob   57 90 851896 1 34a68de99f94f6f9e437a288349602768eae4b92
63176d3a0ae88aee86fa1b2b4390ed0850e67a9b blob   57 90 851986 1 34a68de99f94f6f9e437a288349602768eae4b92
5e10cf16f2bf33110cf59f53d583527d676820e1 blob   57 90 852076 1 34a68de99f94f6f9e437a288349602768eae4b92
aeb87caeb18972ad237d4c5628bfedb2dca51d47 blob   57 90 852166 1 34a68de99f94f6f9e437a288349602768eae4b92
141df301ab1d7f9e40b90fb4435ec4ac40ae544d blob   57 90 852256 1 34a68de99f94f6f9e437a288349602768eae4b92
e7172196f3fd2742cbe382daa02fd9641b9f6ffb blob   57 90 852346 1 34a68de99f94f6f9e437a288349602768eae4b92
4e78d6c905bc6d0c06ad066400f0570a391f9385 blob   57 90 852436 1 34a68de99f94f6f9e437a288349602768eae4b92
c096ccf827c047c3a20cfb1dd3fd5b0485ec2a0b blob   57 90 852526 1 34a68de99f94f6f9e437a288349602768eae4b92
91c4bc3b3c200535d88f76e9e3566658cb7b2bfd blob   57 90 852616 1 34a68de99f94f6f9e437a288349602768eae4b92
0b7888c3e508fe256fe859ba46c77d100abbce3f blob   57 90 852706 1 34a68de99f94f6f9e437a288349602768eae4b92
36cfe418f3038689cd47b64845c6f24886f9ec73 blob   57 90 852796 1 34a68de99f94f6f9e437a288349602768eae4b92
54c9d6ab199e99bdbba483ef1287e0cc31fc84b3 blob   57 90 852886 1 34a68de99f94f6f9e437a288349602768eae4b92
8b64b7aafc16c177bcc58813c7a853f622feb10f blob   57 90 852976 1 34a68de99f94f6f9e437a288349602768eae4b92
6ff2ccef89b04f0539f51c0ffcbe5f7bcf108ced blob   57 90 853066 1 34a68de99f94f6f9e437a288349602768eae4b92
7b419ded53760b5dbe136c1ec83ef3f338fab544 blob   57 90 853156 1 34a68de99f94f6f9e437a288349602768eae4b92
non delta: 112 objects
chain length = 1: 110 objects
chain length = 2: 10 objects
chain length = 3: 10 objects
chain length = 4: 10 objects
chain length = 5: 10 objects
chain length = 6: 10 objects
chain length = 7: 10 objects
chain length = 8: 10 objects
chain length = 9: 10 objects
test-3-1c54d893dd9bf6645ecee2886ea72f2c2030bea1.pack: ok
ok 13 - index v2: verify a pack with some 64-bit offsets

expecting success: ! cmp "test-2-${pack2}.idx" "test-3-${pack3}.idx"
test-2-1c54d893dd9bf6645ecee2886ea72f2c2030bea1.idx test-3-1c54d893dd9bf6645ecee2886ea72f2c2030bea1.idx differ: char 8281, line 24
ok 14 - 64-bit offsets: should be different from previous index v2 results

expecting success: git index-pack --index-version=2,0x40000 -o 3.idx "test-1-${pack1}.pack"
fatal: sha1 file 'test-3.idx' validation error
ok 23 - verify-pack catches a corrupted sum of the index file itself

expecting success: cat test-1-${packname_1}.pack >test-3.pack &&
     git index-pack -o tmp.idx test-3.pack &&
     cmp tmp.idx test-1-${packname_1}.idx &&

     git index-pack test-3.pack &&
     cmp test-3.idx test-1-${packname_1}.idx &&

     cat test-2-${packname_2}.pack >test-3.pack &&
     git index-pack -o tmp.idx test-2-${packname_2}.pack &&
     cmp tmp.idx test-2-${packname_2}.idx &&

     git index-pack test-3.pack &&
     cmp test-3.idx test-2-${packname_2}.idx &&

     cat test-3-${packname_3}.pack >test-3.pack &&
     git index-pack -o tmp.idx test-3-${packname_3}.pack &&
     cmp tmp.idx test-3-${packname_3}.idx &&

     git index-pack test-3.pack &&
     cmp test-3.idx test-3-${packname_3}.idx &&

     :
fatal: reference is not a tree: 0123456789012345678901234567890123456789
Unable to checkout '0123456789012345678901234567890123456789' in submodule path 'sub1'
ok 27 - am_3way: 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
		)
	
Cloning into 'submodule_update'...
done.
1c54d893dd9bf6645ecee2886ea72f2c2030bea1
ok 15 - index v2: force some 64-bit offsets with index-pack

expecting success: cmp "test-3-${pack3}.idx" "3.idx"
ok 16 - 64-bit offsets: index-pack result should match pack-objects one

expecting success: 
	# This cheats by knowing which lower offset should still be encoded
	# in 64-bit representation.
	git index-pack --verify --index-version=2,0x40000 "test-3-${pack3}.pack"

Switched to a new branch 'invalid_sub1'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
fatal: Needed a single revision
Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
6a0af710a6468334a8152e4eaf18c75998e78755
Applying: Revert "Invalid sub1 commit"
ok 17 - index-pack --verify on 64-bit offset v2 (cheat)

expecting success: 
	git index-pack --verify "test-3-${pack3}.pack"

ok 15 - gc --prune=never

expecting success: 

	git config gc.pruneExpire never &&
	add_blob &&
	git gc &&
	test_path_is_file $BLOB_FILE &&
	git config gc.pruneExpire now &&
	git gc &&
	test_path_is_missing $BLOB_FILE


ok 18 - index-pack --verify on 64-bit offset v2

expecting success: git index-pack --index-version=1 --stdin < "test-1-${pack1}.pack" &&
     git prune-packed &&
     git count-objects | ( read nr rest && test "$nr" -eq 1 ) &&
     cmp "test-1-${pack1}.pack" ".git/objects/pack/pack-${pack1}.pack" &&
     cmp "test-1-${pack1}.idx"  ".git/objects/pack/pack-${pack1}.idx"
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule_update_repo/.) registered for path 'sub1'
6a0af710a6468334a8152e4eaf18c75998e78755
Cloning into 'sub1'...
done.
Submodule path 'sub1': checked out '912f7e75d9b2a9ea1bda5e8f2864195a1f540d4c'
pack	1c54d893dd9bf6645ecee2886ea72f2c2030bea1
cec5d8f349f9079e3ee93ce629746bf578c31652
ok 16 - gc respects gc.pruneExpire=never

expecting success: 

	add_blob &&
	git prune --expire=never &&
	test_path_is_file $BLOB_FILE &&
	git prune &&
	test_path_is_missing $BLOB_FILE


ok 28 - am_3way: modified submodule does not update submodule work tree from invalid commit

expecting success: 
	test_commit one &&
	INITIAL=$(git rev-parse HEAD) &&

	git init submodule &&
	(
		cd submodule &&
		test_commit two &&
		git rev-parse HEAD >../initial-submodule
	) &&
	git submodule add ./submodule &&
	git commit -m first &&

	(
		cd submodule &&
		test_commit three &&
		git rev-parse HEAD >../first-submodule
	) &&
	git add submodule &&
	git commit -m second &&
	SECOND=$(git rev-parse HEAD) &&

	(
		cd submodule &&
		git mv two.t four.t &&
		git commit -m "second submodule" &&
		git rev-parse HEAD >../second-submodule
	) &&
	test_commit four &&
	git add submodule &&
	git commit --amend --no-edit &&
	THIRD=$(git rev-parse HEAD) &&
	git submodule update --init

[master (root-commit) d79ce16] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
ok 17 - prune --expire=never

expecting success: 
	add_blob &&
	test-chmtime =-$((2*$week+1)) $BLOB_FILE &&
	git clone --no-hardlinks . aclone &&
	(
		cd aclone &&
		verbose test 1 = $(git count-objects | sed "s/ .*//") &&
		test_path_is_file $BLOB_FILE &&
		git gc --prune &&
		verbose test 0 = $(git count-objects | sed "s/ .*//") &&
		test_path_is_missing $BLOB_FILE
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t4255-am-submodule/submodule/.git/
[master (root-commit) 274aeeb] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two.t
ok 19 - [index v1] 1) stream pack to repository

expecting success: # This test assumes file_101 is a delta smaller than 16 bytes.
     # It should be against file_100 but we substitute its base for file_099
     sha1_101=`git hash-object file_101` &&
     sha1_099=`git hash-object file_099` &&
     offs_101=`index_obj_offset 1.idx $sha1_101` &&
     nr_099=`index_obj_nr 1.idx $sha1_099` &&
     chmod +w ".git/objects/pack/pack-${pack1}.pack" &&
     dd of=".git/objects/pack/pack-${pack1}.pack" seek=$(($offs_101 + 1)) \
        if=".git/objects/pack/pack-${pack1}.idx" \
        skip=$((4 + 256 * 4 + $nr_099 * 24)) \
        bs=1 count=20 conv=notrunc &&
     git cat-file blob $sha1_101 > file_101_foo1
Cloning into 'aclone'...
done.
20+0 records in
20+0 records out
20 bytes (20 B) copied, 0.00285833 s, 7.0 kB/s
ok 20 - [index v1] 2) create a stealth corruption in a delta base reference

expecting success: test -f file_101_foo1 && ! cmp file_101 file_101_foo1
file_101 file_101_foo1 differ: char 5, line 2
ok 21 - [index v1] 3) corrupted delta happily returned wrong data

expecting success: test_must_fail git fsck --full $commit
cec5d8f349f9079e3ee93ce629746bf578c31652
error: .git/objects/pack/pack-1c54d893dd9bf6645ecee2886ea72f2c2030bea1.pack SHA1 checksum mismatch
Adding existing repo at 'submodule' to the index
error: packed 0b968294884af115eb5a1b941b3dabd48470c3bb from .git/objects/pack/pack-1c54d893dd9bf6645ecee2886ea72f2c2030bea1.pack is corrupt
ok 22 - [index v1] 4) confirm that the pack is actually corrupted

expecting success: pack4=$(git pack-objects test-4 <obj-list) &&
     test -f "test-4-${pack4}.pack"
[master 8fb6b7a] first
 Author: A U Thor <author@example.com>
 2 files changed, 4 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 submodule
[master 2b16875] three
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 three.t
[master 7cdc426] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master a623af5] second submodule
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename two.t => four.t (100%)
[master d6b9f1d] four
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 four.t
[master be614db] four
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 four.t
a0ba4155e12b5d059b80b5734acdd7ffbe0d697d
ok 18 - gc: prune old objects after local clone

expecting success: 
	test_when_finished "rm -f .git/objects/pack/fake*" &&
	test_when_finished "rm -f .git/objects/pack/foo*" &&
	: >.git/objects/pack/foo &&
	: >.git/objects/pack/foo.bar &&
	: >.git/objects/pack/foo.keep &&
	: >.git/objects/pack/foo.pack &&
	: >.git/objects/pack/fake.bar &&
	: >.git/objects/pack/fake.keep &&
	: >.git/objects/pack/fake.pack &&
	: >.git/objects/pack/fake.idx &&
	: >.git/objects/pack/fake2.keep &&
	: >.git/objects/pack/fake3.idx &&
	git count-objects -v 2>stderr &&
	grep "index file .git/objects/pack/fake.idx is too small" stderr &&
	grep "^warning:" stderr | sort >actual &&
	cat >expected <<\EOF &&
warning: garbage found: .git/objects/pack/fake.bar
warning: garbage found: .git/objects/pack/foo
warning: garbage found: .git/objects/pack/foo.bar
warning: no corresponding .idx or .pack: .git/objects/pack/fake2.keep
warning: no corresponding .idx: .git/objects/pack/foo.keep
warning: no corresponding .idx: .git/objects/pack/foo.pack
warning: no corresponding .pack: .git/objects/pack/fake3.idx
EOF
	test_cmp expected actual

count: 1
size: 4
in-pack: 5
packs: 1
size-pack: 1
prune-packable: 0
garbage: 7
size-garbage: 0
ok 23 - [index v1] 5) pack-objects happily reuses corrupted data

expecting success: test_must_fail git verify-pack -v "test-4-${pack4}.pack"
error: index file .git/objects/pack/fake.idx is too small
error: index file .git/objects/pack/fake.idx is too small
ok 29 - setup diff.submodule

expecting success: 
	test_unconfig diff.submodule &&
	run_test $SECOND first-submodule

fatal: Resolve operation not in progress, we are not resuming.
ok 19 - garbage report in count-objects -v

expecting success: 
	test_when_finished "rm -f .git/objects/pack/fake*" &&
	test_when_finished "rm -f .git/objects/pack/foo*" &&
	: >.git/objects/pack/foo.keep &&
	: >.git/objects/pack/foo.pack &&
	: >.git/objects/pack/fake.idx &&
	: >.git/objects/pack/fake2.keep &&
	: >.git/objects/pack/fake2.idx &&
	: >.git/objects/pack/fake3.keep &&
	git gc &&
	git count-objects -v 2>stderr &&
	grep "^warning:" stderr | sort >actual &&
	cat >expected <<\EOF &&
warning: no corresponding .idx or .pack: .git/objects/pack/fake3.keep
warning: no corresponding .idx: .git/objects/pack/foo.keep
warning: no corresponding .idx: .git/objects/pack/foo.pack
EOF
	test_cmp expected actual

HEAD is now at 7cdc426 second
0001-second.patch
HEAD is now at 8fb6b7a first
4307528f01beff143cd36a903cb8c9a9983a4c27 tree   12036 7200 12
e43b5801e4ac39a512e5d9423fc272cf5c3343f9 blob   300 313 7212
78fcb2fa30f448929fae32736f0fb56733d08746 blob   108 141 7525 1 e43b5801e4ac39a512e5d9423fc272cf5c3343f9
1c547eac61c40965963e85a56c24991ab1a0e3ef blob   108 141 7666 2 78fcb2fa30f448929fae32736f0fb56733d08746
571c7b54485960a9820927983c702eec1b41e91a blob   108 141 7807 3 1c547eac61c40965963e85a56c24991ab1a0e3ef
671d8800ae6936f107d70de2dbec536afb47d89a blob   108 141 7948 4 571c7b54485960a9820927983c702eec1b41e91a
f2377b316d0d92e3c29a2d6dba598ca02fb80e9c blob   108 141 8089 5 671d8800ae6936f107d70de2dbec536afb47d89a
0483297992ed4cd5ab3b5790912b1f03598ea660 blob   108 141 8230 6 f2377b316d0d92e3c29a2d6dba598ca02fb80e9c
1ddb0e1ff0db350df93807fda44ef75358d7ddb0 blob   108 141 8371 7 0483297992ed4cd5ab3b5790912b1f03598ea660
19dec2e189cd33584d2173979aecea01b3c59904 blob   108 141 8512 8 1ddb0e1ff0db350df93807fda44ef75358d7ddb0
2bc95d3b86ed1808b73d84f5c0287a61df979063 blob   108 141 8653 9 19dec2e189cd33584d2173979aecea01b3c59904
b8f11d512203fd0260eb79edd5cfca416ca404cb blob   300 313 8794
ef790963bda7ffd9e3556cf4211492680b34c2bf blob   108 141 9107 1 b8f11d512203fd0260eb79edd5cfca416ca404cb
a854bd2ad779f987395c790d0aa378277a7d3216 blob   108 141 9248 2 ef790963bda7ffd9e3556cf4211492680b34c2bf
b750a0431df80025eff766f0811e6a85e1dbc32a blob   108 141 9389 3 a854bd2ad779f987395c790d0aa378277a7d3216
9e793c3eeb7402e17eafb61928b96648a54a8789 blob   108 141 9530 4 b750a0431df80025eff766f0811e6a85e1dbc32a
35691bb59cfc8e5f0749a3c2df2d236150d7f7d1 blob   108 141 9671 5 9e793c3eeb7402e17eafb61928b96648a54a8789
0df5edef6dcc6452cf814984a4d4ea23a8e41e3c blob   108 141 9812 6 35691bb59cfc8e5f0749a3c2df2d236150d7f7d1
305f923c2d2e1fff9ec067b42443fff88aeebc67 blob   108 141 9953 7 0df5edef6dcc6452cf814984a4d4ea23a8e41e3c
67db08cb82e0053ee51773fbf4bdc50094e03767 blob   108 141 10094 8 305f923c2d2e1fff9ec067b42443fff88aeebc67
61a87ea87b8af074a75d0af78e77f2ed6141922c blob   108 141 10235 9 67db08cb82e0053ee51773fbf4bdc50094e03767
5e69af01a42867f9be8213089efc57c6a1517976 blob   300 313 10376
1280048552e2ee86127654132148d3c2e208b397 blob   108 141 10689 1 5e69af01a42867f9be8213089efc57c6a1517976
ec86b748af33306ff620ebe591da28ed622c1b4d blob   108 141 10830 2 1280048552e2ee86127654132148d3c2e208b397
ce83a0772693235f137100863f4217f9c6398a53 blob   108 141 10971 3 ec86b748af33306ff620ebe591da28ed622c1b4d
ebd5d1af0d246aa4f8e288c539b906eb765d48e1 blob   108 141 11112 4 ce83a0772693235f137100863f4217f9c6398a53
ef99659edf6a12a9320e29453d1e17054863c3d1 blob   108 141 11253 5 ebd5d1af0d246aa4f8e288c539b906eb765d48e1
17dc4d50c25440e569d3c4dabf41bb562c9013fc blob   108 141 11394 6 ef99659edf6a12a9320e29453d1e17054863c3d1
36a0964d29672133cea581290233bae77c3b8cca blob   108 141 11535 7 17dc4d50c25440e569d3c4dabf41bb562c9013fc
60a658626764685c980311c6325263eabdbe0547 blob   108 141 11676 8 36a0964d29672133cea581290233bae77c3b8cca
a7b6688d2a6f15e6f91d1701f64ca7da42a5a73a blob   108 141 11817 9 60a658626764685c980311c6325263eabdbe0547
ef1259b944f1b0c4ade62c049c2ea41daf63ccc7 blob   300 313 11958
612f382c01ffd0ea89c2a840cc683cfd1108628e blob   108 141 12271 1 ef1259b944f1b0c4ade62c049c2ea41daf63ccc7
ba0b924be466e9d85f8ba5563211e570d12d2841 blob   108 141 12412 2 612f382c01ffd0ea89c2a840cc683cfd1108628e
d05e80ce75fe6189e1b08dfc5fb9bf0a1a6e544e blob   108 141 12553 3 ba0b924be466e9d85f8ba5563211e570d12d2841
e80b417ea517c993f906556a00fa8acaceb559b4 blob   108 141 12694 4 d05e80ce75fe6189e1b08dfc5fb9bf0a1a6e544e
8cc2e1974c339c43bd481c205ea0024b54dbcb83 blob   108 141 12835 5 e80b417ea517c993f906556a00fa8acaceb559b4
8e57f0560c1135c5cdaca2c69094489ad6ddcdb0 blob   108 141 12976 6 8cc2e1974c339c43bd481c205ea0024b54dbcb83
416013a155571063a96f1e443ee44a8ac3f09c1b blob   108 141 13117 7 8e57f0560c1135c5cdaca2c69094489ad6ddcdb0
8dc7c392787f4ec7bb28c57bc6744a2b5f3122ed blob   108 141 13258 8 416013a155571063a96f1e443ee44a8ac3f09c1b
beb699952b6a188a54675c11696cb6a2652b5249 blob   108 141 13399 9 8dc7c392787f4ec7bb28c57bc6744a2b5f3122ed
0f66db930e6ce643852ad45eb91dc203575fb5f4 blob   300 313 13540
9a3a619d26a6e19b556d119d760b40a6397a9df4 blob   108 141 13853 1 0f66db930e6ce643852ad45eb91dc203575fb5f4
66336af04f97cfd40474e8aa4cea2e25275b5f94 blob   108 141 13994 2 9a3a619d26a6e19b556d119d760b40a6397a9df4
bf8886056d3abf37690115bfee10bf14ef5e4db9 blob   108 141 14135 3 66336af04f97cfd40474e8aa4cea2e25275b5f94
2c1120aee9298045837641feab263b3655725aa3 blob   108 141 14276 4 bf8886056d3abf37690115bfee10bf14ef5e4db9
f47f0d90220589a45dbccd06c8468eca7c04d70a blob   108 141 14417 5 2c1120aee9298045837641feab263b3655725aa3
add63edc5ce2dd58ff7d66b153f44d03b0d93df2 blob   108 141 14558 6 f47f0d90220589a45dbccd06c8468eca7c04d70a
75642e5399f1b51a33f0c6430af2fd997e4db578 blob   108 141 14699 7 add63edc5ce2dd58ff7d66b153f44d03b0d93df2
64e473488413d66fe6e464b3f09827501eb353fe blob   108 141 14840 8 75642e5399f1b51a33f0c6430af2fd997e4db578
fatal: sha1 file 'test-4-48a1956df258ba8b8a12e47466ef8e10ada5d680.idx' validation error
597244daf249731fc922a26acfe6fb9ea3baca7f blob   108 141 14981 9 64e473488413d66fe6e464b3f09827501eb353fe
8d5f6b41255c60ea8f44892b918a38eebe43de6b blob   300 313 15122
c26e8fbe6bd52d34b340f61780b6e3dd3b9bed94 blob   108 141 15435 1 8d5f6b41255c60ea8f44892b918a38eebe43de6b
0246ff570c396c37ff08c0f5f9d88c84fc21a297 blob   108 141 15576 2 c26e8fbe6bd52d34b340f61780b6e3dd3b9bed94
cff9bb4b47c1bc50205d6a793d8d02bee852a229 blob   108 141 15717 3 0246ff570c396c37ff08c0f5f9d88c84fc21a297
2096ec927d087ee1076f1118e8fe48ab21a27bd7 blob   108 141 15858 4 cff9bb4b47c1bc50205d6a793d8d02bee852a229
0ff6b3e6f0b0957b5b05a06d9b4580f0e1798501 blob   108 141 15999 5 2096ec927d087ee1076f1118e8fe48ab21a27bd7
633de7a70fe29cecb721bb5033573fbf175b31fc blob   108 141 16140 6 0ff6b3e6f0b0957b5b05a06d9b4580f0e1798501
76db9ca0f1afa9c247d4c5a2fe60ca95154fd465 blob   108 141 16281 7 633de7a70fe29cecb721bb5033573fbf175b31fc
df4c5c8e8e25621bba74f233d59c76e5810f8677 blob   108 141 16422 8 76db9ca0f1afa9c247d4c5a2fe60ca95154fd465
9fc4cce844af6ed26932eb84045df0ab4a79f0b7 blob   108 141 16563 9 df4c5c8e8e25621bba74f233d59c76e5810f8677
ef3ddda4c2922f10089dfed6436267b445d5b118 blob   300 313 16704
1bdedd473270eef5c2c67c968ba1d5ee081013ee blob   108 141 17017 1 ef3ddda4c2922f10089dfed6436267b445d5b118
9d28c1ea0790ee28b8c35bc3fe88629980708730 blob   108 141 17158 2 1bdedd473270eef5c2c67c968ba1d5ee081013ee
a3264a35996ccaf722f869be8e379864e28ef561 blob   108 141 17299 3 9d28c1ea0790ee28b8c35bc3fe88629980708730
cd6f1b15bb20b9c706f8f80c77b7c210921f0b26 blob   108 141 17440 4 a3264a35996ccaf722f869be8e379864e28ef561
60601746c22df38cc0bcbce68f359fb2796d7569 blob   108 141 17581 5 cd6f1b15bb20b9c706f8f80c77b7c210921f0b26
f15a3f5dae93709cce491d407dad343f9577d8c5 blob   108 141 17722 6 60601746c22df38cc0bcbce68f359fb2796d7569
5dd384bbc7186571a9cccdba2ebaa794e87bfbdd blob   108 141 17863 7 f15a3f5dae93709cce491d407dad343f9577d8c5
d18475904b78554f1fd6f96b4c1ad44e84edf873 blob   108 141 18004 8 5dd384bbc7186571a9cccdba2ebaa794e87bfbdd
67728c76be3b7d5319ff2a93fc78aca0ff3824eb blob   108 141 18145 9 d18475904b78554f1fd6f96b4c1ad44e84edf873
c1ec14f204e244f32aa93c66e3fb6a7d4f58c081 blob   300 313 18286
258424ed6e5c4377a2aa55fb6d4818a3580291ad blob   108 141 18599 1 c1ec14f204e244f32aa93c66e3fb6a7d4f58c081
fcaa7a21cb9d0b0aa84d2cbac5115d7c300739a2 blob   108 141 18740 2 258424ed6e5c4377a2aa55fb6d4818a3580291ad
e1bfca166c2ff676f665fd3c58d7dea896ec48d7 blob   108 141 18881 3 fcaa7a21cb9d0b0aa84d2cbac5115d7c300739a2
383c3c67e93cfd05d272b187e3af5c1e00bcae5c blob   108 141 19022 4 e1bfca166c2ff676f665fd3c58d7dea896ec48d7
ad6a3267a9e0d49014eec133a5e968315e8ce834 blob   108 141 19163 5 383c3c67e93cfd05d272b187e3af5c1e00bcae5c
9dfc592085bb14371890b41e48c98b220420669b blob   108 141 19304 6 ad6a3267a9e0d49014eec133a5e968315e8ce834
c872afc7539f689178b7385010010ca7aef8f09a blob   108 141 19445 7 9dfc592085bb14371890b41e48c98b220420669b
1bc038b18c5039a05e173da2fd2b65b3d34ccd2b blob   108 141 19586 8 c872afc7539f689178b7385010010ca7aef8f09a
bdd7bd883f75c1726538851757168dc0dc33e222 blob   108 141 19727 9 1bc038b18c5039a05e173da2fd2b65b3d34ccd2b
71529d6ca58922aa05603b6f2784f87cad8703cf blob   300 313 19868
2bebfa6240e319a1c31951d05c8135f089fbbd29 blob   108 141 20181 1 71529d6ca58922aa05603b6f2784f87cad8703cf
83fcb919ae7bc9a80912c9bfd5731acd36666480 blob   108 141 20322 2 2bebfa6240e319a1c31951d05c8135f089fbbd29
b97506df40bbd212b52062b851cd88f04abb59b3 blob   108 141 20463 3 83fcb919ae7bc9a80912c9bfd5731acd36666480
298dc4942c3b3db53d484ffa86b451755cd2125f blob   108 141 20604 4 b97506df40bbd212b52062b851cd88f04abb59b3
ba11c807afc9699e7ea1cab791699bfd698c7e7d blob   108 141 20745 5 298dc4942c3b3db53d484ffa86b451755cd2125f
b1281e620292c2e74d8770eb99f0b6871e4cca59 blob   108 141 20886 6 ba11c807afc9699e7ea1cab791699bfd698c7e7d
368cd4d02a420764e0d31b35576f73b777c34604 blob   108 141 21027 7 b1281e620292c2e74d8770eb99f0b6871e4cca59
16d1323e84e3d5b058ab2ac8245db85bc4606c88 blob   108 141 21168 8 368cd4d02a420764e0d31b35576f73b777c34604
711d5e6b0d21b3aa205dcc960ec51475be8a25a5 blob   108 141 21309 9 16d1323e84e3d5b058ab2ac8245db85bc4606c88
d174d532539487c9aedbbaf38d556061b5acf826 blob   300 313 21450
bf5dcb9013df15ff0ae10e0682a92a7688a7720b blob   108 141 21763 1 d174d532539487c9aedbbaf38d556061b5acf826
fb214b786310655bc8ee46d89ca9a04ec9aed0c3 blob   108 141 21904 2 bf5dcb9013df15ff0ae10e0682a92a7688a7720b
b94140f4006d05e7e3822f5db19adc2b73a2cc05 blob   108 141 22045 3 fb214b786310655bc8ee46d89ca9a04ec9aed0c3
4019b50c838197ca4b8d664a4164a183cac8ad11 blob   108 141 22186 4 b94140f4006d05e7e3822f5db19adc2b73a2cc05
2826157afde0e74742115842ac2dddf5c3b5e23e blob   108 141 22327 5 4019b50c838197ca4b8d664a4164a183cac8ad11
99556fcde6a0be62a72c8b0c6682576a1d596bea blob   108 141 22468 6 2826157afde0e74742115842ac2dddf5c3b5e23e
8f5e7974c287b07f1cf8116485c4135340b807f3 blob   108 141 22609 7 99556fcde6a0be62a72c8b0c6682576a1d596bea
f9982291dfe87a9def1b12d24f9ca9a024a9dd8e blob   108 141 22750 8 8f5e7974c287b07f1cf8116485c4135340b807f3
3c5c0be699798d2f4fbe651051b9f17156f133c1 blob   108 141 22891 9 f9982291dfe87a9def1b12d24f9ca9a024a9dd8e
1297547aab30f952af805d38f6f1c1930cb3117b blob   8196 8210 23032
862f6954d9afd549b48fa2ef8e2f8ab96e309916 blob   8196 8210 31242
0471b3b8ab8da19f3968dc238e9555f4e48ce858 blob   8196 8210 39452
c80092496b80b5f21503b8c838dccfc1f2e2ddde blob   8196 8210 47662
e5a12c79cec70d52817054c4b9ef321003c6755f blob   8196 8210 55872
bf96a31446f37d8e57bb38a00797aa3af1f99370 blob   8196 8210 64082
0508b858e01f0367552fb14722388ba48dbd36f7 blob   8196 8210 72292
359017d1534767455090901a260985de1658d752 blob   8196 8210 80502
8d06001a3d38390afa66576caa6c55c796e33835 blob   8196 8210 88712
8162ceb825c07e3b1e17f5775665085da9b1e855 blob   8196 8210 96922
6910c5a645c9fe7f6b728034566b1668f0677a8e blob   8196 8210 105132
09ba511a995b8ea75067036d5c046f39052a3bd8 blob   8196 8210 113342
f45d142313c7a5270a60c664bb463cddadc467c1 blob   8196 8210 121552
964e51bf7d344bda71ea5e12dbd7bfb90120fcf0 blob   8196 8210 129762
408dd031138139f6ac6f402988f960527871f71a blob   8196 8210 137972
912fa0ec5536f31122e34577a4baf3b22d40de2a blob   8196 8210 146182
f02359c44ca04a542cc5bf59aa5f1de6cd1d5a4c blob   8196 8210 154392
b0566dd5d479c80c278bd5455c92aca689328471 blob   8196 8210 162602
49d17d605f042c1e978a68f625be6ab6294fa8fa blob   8196 8210 170812
8f744480abe8ad05bc419d1ab2e375b9c0fa3978 blob   8196 8210 179022
fff3a3a92d2268a464dbdcd00fc055885ee3cba9 blob   8196 8210 187232
f5fc0ff4afc14d9dfcb2580d3f438edd4cd8130a blob   8196 8210 195442
01179d82b18c252824e20e190543e0e84950d820 blob   8196 8210 203652
de3ed457f973b7ffb20edc36002c47a6e4b41066 blob   8196 8210 211862
9c4e1f8c16d04d90a2217279240996276d617067 blob   8196 8210 220072
816f18d19f433f5df9edbfb5547684b519fdeb3b blob   8196 8210 228282
72e7428e5ee3797ca0bf955f723b915bee919c48 blob   8196 8210 236492
41adb5af8e7f9737b16261fb0c224c7550c82f23 blob   8196 8210 244702
94f5d368a7c4ea294c463dc45cf15d387fa83c4e blob   8196 8210 252912
85fdf2eed169dbc1fe2d71439b589b0326dad12b blob   8196 8210 261122
bab18d872e9183c6d450b326477205bb0cc081cb blob   8196 8210 269332
b31fb3fb181512bc608b58cb33323d97ad6eac2f blob   8196 8210 277542
20a9519106ab64bf043456a58b6bfb04f1c7b39d blob   8196 8210 285752
94a015b2b6053f7a1d541969919e879bb2b75eef blob   8196 8210 293962
7353550b9b0e1da4f68b9484dfad2634100a00cc blob   8196 8210 302172
e28a360bcbd69ca1a0bb47834e640069c6672a8d blob   8196 8210 310382
8e6ffc05856460c2e08c8e9d824bbf510d3c1b52 blob   8196 8210 318592
ceade5760b1ba0bc11d4e4db6982ddf671495e58 blob   8196 8210 326802
92534f38b94c1da321d88c9ab5af8c3e804c2507 blob   8196 8210 335012
f5577acbfd83dddf90b2054d6cb5dce2df6d06ee blob   8196 8210 343222
59a27076dc0a8989215a160d61ac401e41c05126 blob   8196 8210 351432
2db6b919f253444b5437d8251e5d101d5a34e1b3 blob   8196 8210 359642
c1c35c36d4300da28c0570746adaf2f5b0b015a3 blob   8196 8210 367852
03a6f56dbbb556425ef8c43c31519b32eb5629a4 blob   8196 8210 376062
dd6209d4c0c5d4f210a8d1bb4a4d314cf284dea9 blob   8196 8210 384272
8c04fa425f4dfb4555b376e73d8f28d56b97a569 blob   8196 8210 392482
614e235cd8ca8af7ccf402a92eb34baadaaa3f18 blob   8196 8210 400692
b2f07ee5771d9e0de7166bc72a4a7ebce9830779 blob   8196 8210 408902
852ba0cf084474c1b0b48052606ae27346a5b1a1 blob   8196 8210 417112
15ff79f644a0596529eba0592017dce39e222b8e blob   8196 8210 425322
75f67c0c230f8923db5831094b1cc67f61bf1734 blob   8196 8210 433532
95b51158cd6365da9b10f1d8b06ba76dc5d5c5f1 blob   8196 8210 441742
5217ce416b26a3d76191d873490110746d0e8a04 blob   8196 8210 449952
c16eb68827fa5d6da73b320b431cf736c7a6a4af blob   8196 8210 458162
57983aab7f7384626a6a1f9ec08fba1902dd11e5 blob   8196 8210 466372
84e4d2ce637781776791c8e2cf4a9312a2783ceb blob   8196 8210 474582
2175a1a9d8757b3836f5cc44c6af0297aea36709 blob   8196 8210 482792
9b655d54faaf0a737a03731852f27cf6b552bcaf blob   8196 8210 491002
a3233ba1323f07a0d68f6020e7209025819cfa13 blob   8196 8210 499212
5a65a213ee0ebdc285c8e8eca24e9eda97f8a384 blob   8196 8210 507422
de1679ebb44d3fe59e8d2378471b56db384fb181 blob   8196 8210 515632
d2e455cc03081911f9ecd81245becd858d1e64ca blob   8196 8210 523842
72826d3e97bc228616e06235566a0db59c94bd74 blob   8196 8210 532052
debe389b3bdd62d96748db592e99cb0cc7b1b0f2 blob   8196 8210 540262
e572e59eee8119f8fb58e8595ecd0c622f2d6e29 blob   8196 8210 548472
197f45d948a36ac3762e5daf6ef4d43a5d969503 blob   8196 8210 556682
fb294d29a9d045d5a46a9c00e53777b394ceb346 blob   8196 8210 564892
10f7133774acbc162f5f79804744d64747eee380 blob   8196 8210 573102
16b9dea85eab6d7e452bdea4889e24a8ad79afd5 blob   8196 8210 581312
08a8cf223e5dc57504da3cd8eb56d33f276dc1b9 blob   8196 8210 589522
e3332ff9a2540b45e599be0c7bca8bbe28af2b43 blob   8196 8210 597732
5e1b961ae623672df764f64b737f332318d43baa blob   8196 8210 605942
14caba1bc2835573f3c20b7f2e5fb638a08e12ee blob   8196 8210 614152
84d1369c26d187b24dffe9029e81e119e4a374f5 blob   8196 8210 622362
5ef3a0f4954ade2d5c290ccc4d791c3b219d89ea blob   8196 8210 630572
610d16151ceb1dc4d5138f63ed410819a8b9161c blob   8196 8210 638782
3545eb1f5549261267ab0577b94372e88b49731d blob   8196 8210 646992
0d6e5c0388744cf82463ce1283ff99e863e9b26e blob   8196 8210 655202
611261b75bd720d3433ea8975d555b1ac3e692bd blob   8196 8210 663412
e25dc2ac80f9f78aa2809b5cd254ce47a51efbe5 blob   8196 8210 671622
ea5a4b4fed0bab7beffd3c7fc6cc549df47017d7 blob   8196 8210 679832
d68756996794df8c00dfcbf520662b14cb06958e blob   8196 8210 688042
b5b44a475116c2d0054edf54c699909d5d583aac blob   8196 8210 696252
99ff18078623c32b85a49cc8a03e3c58ee94eecb blob   8196 8210 704462
159fdc73e63cf90624d128d87b8185154727714e blob   8196 8210 712672
1f0ca97497381a196e53a7639ee769ed019469a3 blob   8196 8210 720882
6dbed45fde708bb67e6b21bd55976483305f9e74 blob   8196 8210 729092
b5ec32ad29b65e5742cd1857d17e92c2efc5da96 blob   8196 8210 737302
cf823d111604e8a014e0702b5e15b242bb961c78 blob   8196 8210 745512
72528baaeeba0d9c01da36a7a0add1ac49d860f2 blob   8196 8210 753722
b976a8fd346486d78cdebeaa0b0ac200befca629 blob   8196 8210 761932
e652cd97e9aae1523d892c1f417274dd26c3bcd3 blob   8196 8210 770142
aa82432626cc08fb818a20aa62b607aa52e7b35d blob   8196 8210 778352
d67069815168092ee0eadeab8177002bd0376b6f blob   8196 8210 786562
fa7ca115eb82e14f0263990362d4fc27591e1143 blob   8196 8210 794772
5cadb04c4d4ec953dffc528bf75561a6ae1c5820 blob   8196 8210 802982
a769ce6dfe1abe1b6162627b2b5df89f4f7d4317 blob   8196 8210 811192
bf265906aab0df90b6a4bdb1fe6f8088a9038435 blob   8196 8210 819402
b302b77fd5595784b5e85e91f8b4314fff49a6a1 blob   8196 8210 827612
3927444e44b49dfa6cdc768298ae879ec298c45d blob   8196 8210 835822
51e0bb44b17501c6803ca30f299ad8e69b21c8c4 blob   12 41 844032 1 b302b77fd5595784b5e85e91f8b4314fff49a6a1
34a68de99f94f6f9e437a288349602768eae4b92 blob   250 263 844073
8517d36660dffb896fb4e283ad110023aaebaf1b blob   57 90 844336 1 34a68de99f94f6f9e437a288349602768eae4b92
e3fc6633c069c8e246d77a408e4747c2852ba44a blob   57 90 844426 1 34a68de99f94f6f9e437a288349602768eae4b92
37a071e55d1f2e07af146ca6017d98dd85beae68 blob   57 90 844516 1 34a68de99f94f6f9e437a288349602768eae4b92
a8179a233b7aeeb7a450c5d321d4b73df936b64b blob   57 90 844606 1 34a68de99f94f6f9e437a288349602768eae4b92
99e0b239888c8b71671fb948e41111876e61a3c2 blob   57 90 844696 1 34a68de99f94f6f9e437a288349602768eae4b92
e26e04b4786bf6b0ec3c5d528e7002cd58e2401b blob   57 90 844786 1 34a68de99f94f6f9e437a288349602768eae4b92
a6106f10ea80724dbc32b328d9892111589a2111 blob   57 90 844876 1 34a68de99f94f6f9e437a288349602768eae4b92
d1669a170780865ccd7645211c2e1cebdfb28aad blob   57 90 844966 1 34a68de99f94f6f9e437a288349602768eae4b92
53a19e0c2c34ef1a4e1bbc9aa1cba4cb9bc2dd80 blob   57 90 845056 1 34a68de99f94f6f9e437a288349602768eae4b92
26ff29a62e7a6359d3975813fd645af871576125 blob   57 90 845146 1 34a68de99f94f6f9e437a288349602768eae4b92
c1d6b9953613f5732cd40d8cffbb2b746a71fb92 blob   57 90 845236 1 34a68de99f94f6f9e437a288349602768eae4b92
a2bfcc19d1592c43af33617500394e1ac09e968c blob   57 90 845326 1 34a68de99f94f6f9e437a288349602768eae4b92
36c0479c58cef0b9a10b56934ed42a862e1dcfe2 blob   57 90 845416 1 34a68de99f94f6f9e437a288349602768eae4b92
642aa265517d66c88f030a2230eb97e77c973905 blob   57 90 845506 1 34a68de99f94f6f9e437a288349602768eae4b92
29cd4721cd3cef7f5a2e032d6c2d6908427cd5af blob   57 90 845596 1 34a68de99f94f6f9e437a288349602768eae4b92
ae5ccb1578fbc399571f4f0132edd18c55b19ef0 blob   57 90 845686 1 34a68de99f94f6f9e437a288349602768eae4b92
d22feecdd32e57af8fd88bda0fbde8fbb96d4f1c blob   57 90 845776 1 34a68de99f94f6f9e437a288349602768eae4b92
ab2acc4bd273e799b56effc7e208a01814432ba5 blob   57 90 845866 1 34a68de99f94f6f9e437a288349602768eae4b92
2d5f83c6857691045da554091b8f2d82477d9baf blob   57 90 845956 1 34a68de99f94f6f9e437a288349602768eae4b92
fac99cd6f9219ee888b9382ee44a3b7932723b12 blob   57 90 846046 1 34a68de99f94f6f9e437a288349602768eae4b92
b32b0ed27f34e4a9d7c4aab24dfa2d6c51b1c2eb blob   57 90 846136 1 34a68de99f94f6f9e437a288349602768eae4b92
a3f38fbdbe8f34acc61f3a325104e739a875a4b6 blob   57 90 846226 1 34a68de99f94f6f9e437a288349602768eae4b92
6bc5c86eeb3dfcc3ca2343e39cc91dec35ddc90b blob   57 90 846316 1 34a68de99f94f6f9e437a288349602768eae4b92
38897be9103dbc6aff7d1ecd15c1dc6c6d18b0a7 blob   57 90 846406 1 34a68de99f94f6f9e437a288349602768eae4b92
69e0b8ef8cda369575b6801c6ed47daf09aa3c62 blob   57 90 846496 1 34a68de99f94f6f9e437a288349602768eae4b92
c3e6c8cf465113a74926f3d5c73a3b400970643c blob   57 90 846586 1 34a68de99f94f6f9e437a288349602768eae4b92
a31a03a60bad0896133e6e52982da2e7e22832ff blob   57 90 846676 1 34a68de99f94f6f9e437a288349602768eae4b92
735fe835bee0cfa2d7ecc2f195c22de3e7b208b3 blob   57 90 846766 1 34a68de99f94f6f9e437a288349602768eae4b92
84705bfd7a24eb59137fdc26c070c4329eee46a7 blob   57 90 846856 1 34a68de99f94f6f9e437a288349602768eae4b92
5090e761c398db8c0b3fe1c0069535c3b7a9a575 blob   57 90 846946 1 34a68de99f94f6f9e437a288349602768eae4b92
c5c8cc3525a17842c2e668d1499c7c2518202a87 blob   57 90 847036 1 34a68de99f94f6f9e437a288349602768eae4b92
441d41902c4ccb987a866663ebbcc729fbcc4072 blob   57 90 847126 1 34a68de99f94f6f9e437a288349602768eae4b92
55bc16727ba8a63a31eabd811cfc740dc423bab6 blob   57 90 847216 1 34a68de99f94f6f9e437a288349602768eae4b92
86c6bd761eacb8a021246263994bf02d1163c7b5 blob   57 90 847306 1 34a68de99f94f6f9e437a288349602768eae4b92
8812057b6f2583732f83db5bac543549cc621783 blob   57 90 847396 1 34a68de99f94f6f9e437a288349602768eae4b92
c8043aaa6a70318be94ef87be98ea2c7de7f23f5 blob   57 90 847486 1 34a68de99f94f6f9e437a288349602768eae4b92
9d48f3c2e700d81fbe46fbccc400bedc8666221a blob   57 90 847576 1 34a68de99f94f6f9e437a288349602768eae4b92
fd68f118bfc99562e08bd153a3f1c604f1ac0124 blob   57 90 847666 1 34a68de99f94f6f9e437a288349602768eae4b92
879bc6e196323012740d55b1e5bbd9937632ecf3 blob   57 90 847756 1 34a68de99f94f6f9e437a288349602768eae4b92
a3ed4b758faeca44e89792c3f1b0536b685d0552 blob   57 90 847846 1 34a68de99f94f6f9e437a288349602768eae4b92
d9dd72f666a9d30dee5cdd894ca365a82e965594 blob   57 90 847936 1 34a68de99f94f6f9e437a288349602768eae4b92
088ddcb945af72c47348b65a63992c71b6b9dbe8 blob   57 90 848026 1 34a68de99f94f6f9e437a288349602768eae4b92
9e7b55d50c530d08c120379e19bb1c1653bb3063 blob   57 90 848116 1 34a68de99f94f6f9e437a288349602768eae4b92
2dfd9df0b22049f88e22ae86e4370155ecb23271 blob   57 90 848206 1 34a68de99f94f6f9e437a288349602768eae4b92
9de2bb387fc8bf63dbc7a68cb22b9e8439896326 blob   57 90 848296 1 34a68de99f94f6f9e437a288349602768eae4b92
a7eacc2c62dfd538c2948cce08cd217cc72a7140 blob   57 90 848386 1 34a68de99f94f6f9e437a288349602768eae4b92
291b2d8c01a9bc50bc4605bc479a183193de2e45 blob   57 90 848476 1 34a68de99f94f6f9e437a288349602768eae4b92
464adf43722b49bca34d8727d70db33c9ec70097 blob   57 90 848566 1 34a68de99f94f6f9e437a288349602768eae4b92
aa6095774c04683081cad47f300324a88ea95f2e blob   57 90 848656 1 34a68de99f94f6f9e437a288349602768eae4b92
896562b116d22c48f8872854123c523b76928061 blob   57 90 848746 1 34a68de99f94f6f9e437a288349602768eae4b92
f01eb69ea9caabb9fe801ef0f1bfdfa4477e0e34 blob   57 90 848836 1 34a68de99f94f6f9e437a288349602768eae4b92
d8603740ffe28d592c9d10ae2d6ec9dd0cf71949 blob   57 90 848926 1 34a68de99f94f6f9e437a288349602768eae4b92
8eb88090ce51c8ce838b12302c761bbf806c3fcc blob   57 90 849016 1 34a68de99f94f6f9e437a288349602768eae4b92
e961d288a95c209fe01ba42f01a18605eb5a85d3 blob   57 90 849106 1 34a68de99f94f6f9e437a288349602768eae4b92
abd14d13fada2545825fdf71c5d4a22ebb60f697 blob   57 90 849196 1 34a68de99f94f6f9e437a288349602768eae4b92
6a54ffedf41f419c66f6cd734a27ec5968f79b5a blob   57 90 849286 1 34a68de99f94f6f9e437a288349602768eae4b92
b6fa6c3c025c4f875c78423ab993a9349cd964c5 blob   57 90 849376 1 34a68de99f94f6f9e437a288349602768eae4b92
088e69e7ab273e35b4f63ecb1b915a3997f13dff blob   57 90 849466 1 34a68de99f94f6f9e437a288349602768eae4b92
609652080c31409406c828cb996e41fa6a286654 blob   57 90 849556 1 34a68de99f94f6f9e437a288349602768eae4b92
90d3d9b65a2f0c939f45a86f65192846e8066e7f blob   57 90 849646 1 34a68de99f94f6f9e437a288349602768eae4b92
05b4f18d9841f7abb271e81accadea31c5416a71 blob   57 90 849736 1 34a68de99f94f6f9e437a288349602768eae4b92
cfdd1e216211554d586bb3be233190457c5f5c0d blob   57 90 849826 1 34a68de99f94f6f9e437a288349602768eae4b92
73375ca0591d6c17f37b9f287a7c19f368fc644f blob   57 90 849916 1 34a68de99f94f6f9e437a288349602768eae4b92
46cd94a7854b7360f8f8a7e637e2575e707f7b04 blob   57 90 850006 1 34a68de99f94f6f9e437a288349602768eae4b92
ec35852188f9e88aa67849934b0c50bd698fafef blob   57 90 850096 1 34a68de99f94f6f9e437a288349602768eae4b92
0106e17481932f5c223fafadc1d26abc6adf40d6 blob   57 90 850186 1 34a68de99f94f6f9e437a288349602768eae4b92
f846f988e45d97ac0163885e65920643f0029922 blob   57 90 850276 1 34a68de99f94f6f9e437a288349602768eae4b92
636d415b097ff0c103e63d09d96aeb07fdad2045 blob   57 90 850366 1 34a68de99f94f6f9e437a288349602768eae4b92
497017bb8901086d3120553a384f3500ceb86f2e blob   57 90 850456 1 34a68de99f94f6f9e437a288349602768eae4b92
c50bc0b26b2336dbe90b9c7bdaa8d4cfb8f65638 blob   57 90 850546 1 34a68de99f94f6f9e437a288349602768eae4b92
921538e73389e99e294938d8580ababdb639f140 blob   57 90 850636 1 34a68de99f94f6f9e437a288349602768eae4b92
9ede1b01ec1751bf9ca9d5845ac005edc6935601 blob   57 90 850726 1 34a68de99f94f6f9e437a288349602768eae4b92
1ba5df91f11a1011f4788bc4cc067743828dda41 blob   57 90 850816 1 34a68de99f94f6f9e437a288349602768eae4b92
188728c24ca8cf687133dd0a5782e8819cee10a6 blob   57 90 850906 1 34a68de99f94f6f9e437a288349602768eae4b92
cb0d0270d7c50e33aacd9a4247333622c62846a4 blob   57 90 850996 1 34a68de99f94f6f9e437a288349602768eae4b92
dd39f8544a79066c925baca19ddc02623970efd1 blob   57 90 851086 1 34a68de99f94f6f9e437a288349602768eae4b92
d0b35a20e2ffaa46d895d6296f555dd98956d536 blob   57 90 851176 1 34a68de99f94f6f9e437a288349602768eae4b92
ae274e8cd31f35d743e68b3c8420e604386fc514 blob   57 90 851266 1 34a68de99f94f6f9e437a288349602768eae4b92
d1ede5db04b30c10d395c13dec020c90320498b8 blob   57 90 851356 1 34a68de99f94f6f9e437a288349602768eae4b92
2adace6c3082b12f42112482372696d66c36e4ae blob   57 90 851446 1 34a68de99f94f6f9e437a288349602768eae4b92
035e7e54cee9eb197af435b6b6dcced489c233f6 blob   57 90 851536 1 34a68de99f94f6f9e437a288349602768eae4b92
74aced6a3316fd8d726932ed908b035cd33afef6 blob   57 90 851626 1 34a68de99f94f6f9e437a288349602768eae4b92
efbbfa01b16e997301bb440aad9c885321bb13d2 blob   57 90 851716 1 34a68de99f94f6f9e437a288349602768eae4b92
92433746fe3340a5d4bc3f5487545f5167eaeaad blob   57 90 851806 1 34a68de99f94f6f9e437a288349602768eae4b92
da7b351a2560fd44fe89fc6288c3efa72eace9eb blob   57 90 851896 1 34a68de99f94f6f9e437a288349602768eae4b92
63176d3a0ae88aee86fa1b2b4390ed0850e67a9b blob   57 90 851986 1 34a68de99f94f6f9e437a288349602768eae4b92
5e10cf16f2bf33110cf59f53d583527d676820e1 blob   57 90 852076 1 34a68de99f94f6f9e437a288349602768eae4b92
aeb87caeb18972ad237d4c5628bfedb2dca51d47 blob   57 90 852166 1 34a68de99f94f6f9e437a288349602768eae4b92
141df301ab1d7f9e40b90fb4435ec4ac40ae544d blob   57 90 852256 1 34a68de99f94f6f9e437a288349602768eae4b92
e7172196f3fd2742cbe382daa02fd9641b9f6ffb blob   57 90 852346 1 34a68de99f94f6f9e437a288349602768eae4b92
4e78d6c905bc6d0c06ad066400f0570a391f9385 blob   57 90 852436 1 34a68de99f94f6f9e437a288349602768eae4b92
c096ccf827c047c3a20cfb1dd3fd5b0485ec2a0b blob   57 90 852526 1 34a68de99f94f6f9e437a288349602768eae4b92
91c4bc3b3c200535d88f76e9e3566658cb7b2bfd blob   57 90 852616 1 34a68de99f94f6f9e437a288349602768eae4b92
0b7888c3e508fe256fe859ba46c77d100abbce3f blob   57 90 852706 1 34a68de99f94f6f9e437a288349602768eae4b92
36cfe418f3038689cd47b64845c6f24886f9ec73 blob   57 90 852796 1 34a68de99f94f6f9e437a288349602768eae4b92
54c9d6ab199e99bdbba483ef1287e0cc31fc84b3 blob   57 90 852886 1 34a68de99f94f6f9e437a288349602768eae4b92
8b64b7aafc16c177bcc58813c7a853f622feb10f blob   57 90 852976 1 34a68de99f94f6f9e437a288349602768eae4b92
6ff2ccef89b04f0539f51c0ffcbe5f7bcf108ced blob   57 90 853066 1 34a68de99f94f6f9e437a288349602768eae4b92
7b419ded53760b5dbe136c1ec83ef3f338fab544 blob   57 90 853156 1 34a68de99f94f6f9e437a288349602768eae4b92
non delta: 112 objects
chain length = 1: 110 objects
chain length = 2: 10 objects
chain length = 3: 10 objects
chain length = 4: 10 objects
chain length = 5: 10 objects
chain length = 6: 10 objects
chain length = 7: 10 objects
chain length = 8: 10 objects
chain length = 9: 10 objects
test-4-48a1956df258ba8b8a12e47466ef8e10ada5d680.pack: bad
ok 24 - [index v1] 6) newly created pack is BAD !

expecting success: rm -f .git/objects/pack/* &&
     git index-pack --index-version=2 --stdin < "test-1-${pack1}.pack" &&
     git prune-packed &&
     git count-objects | ( read nr rest && test "$nr" -eq 1 ) &&
     cmp "test-1-${pack1}.pack" ".git/objects/pack/pack-${pack1}.pack" &&
     cmp "test-2-${pack1}.idx"  ".git/objects/pack/pack-${pack1}.idx"
count: 0
size: 0
in-pack: 5
packs: 1
size-pack: 1
prune-packable: 0
garbage: 3
size-garbage: 0
ok 20 - clean pack garbage with gc

expecting success: 
	SHA1=`echo hi|git commit-tree HEAD^{tree}` &&
	echo $SHA1 >.git/shallow &&
	git prune --dry-run >out &&
	grep $SHA1 .git/shallow &&
	grep $SHA1 out &&
	git prune &&
	test_path_is_missing .git/shallow

600238ca122b30a155a15330dffd6abd056eca17
Removing 600238ca122b30a155a15330dffd6abd056eca17 from .git/shallow
a0ba4155e12b5d059b80b5734acdd7ffbe0d697d
ok 24 - build pack index for an existing pack

expecting success: 

	for j in a b c d e f g
	do
		for i in 0 1 2 3 4 5 6 7 8 9
		do
			o=$(echo $j$i | git hash-object -w --stdin) &&
			echo "100644 $o	0 $j$i"
		done
	done >LIST &&
	rm -f .git/index &&
	git update-index --index-info <LIST &&
	LIST=$(git write-tree) &&
	rm -f .git/index &&
	head -n 10 LIST | git update-index --index-info &&
	LI=$(git write-tree) &&
	rm -f .git/index &&
	tail -n 10 LIST | git update-index --index-info &&
	ST=$(git write-tree) &&
	PACK5=$( git rev-list --objects "$LIST" "$LI" "$ST" | \
		git pack-objects test-5 ) &&
	PACK6=$( (
			echo "$LIST"
			echo "$LI"
			echo "$ST"
		 ) | git pack-objects test-6 ) &&
	test_create_repo test-5 &&
	(
		cd test-5 &&
		git unpack-objects --strict <../test-5-$PACK5.pack &&
		git ls-tree -r $LIST &&
		git ls-tree -r $LI &&
		git ls-tree -r $ST
	) &&
	test_create_repo test-6 &&
	(
		# tree-only into empty repo -- many unreachables
		cd test-6 &&
		test_must_fail git unpack-objects --strict <../test-6-$PACK6.pack
	) &&
	(
		# already populated -- no unreachables
		cd test-5 &&
		git unpack-objects --strict <../test-6-$PACK6.pack
	)

ok 21 - prune .git/shallow

expecting success: 
	test_create_repo A &&
	git -C A commit --allow-empty -m "initial commit" &&
	git clone --shared A B &&
	git -C B commit --allow-empty -m "next commit" &&
	git -C B prune

pack	1c54d893dd9bf6645ecee2886ea72f2c2030bea1
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5304-prune/A/.git/
Submodule path 'submodule': checked out '274aeebc83e7f26e680862996e9bd5ecc327019b'
[master (root-commit) 96ee8f3] initial commit
 Author: A U Thor <author@example.com>
ok 25 - [index v2] 1) stream pack to repository

expecting success: # This test assumes file_101 is a delta smaller than 16 bytes.
     # It should be against file_100 but we substitute its base for file_099
     sha1_101=`git hash-object file_101` &&
     sha1_099=`git hash-object file_099` &&
     offs_101=`index_obj_offset 1.idx $sha1_101` &&
     nr_099=`index_obj_nr 1.idx $sha1_099` &&
     chmod +w ".git/objects/pack/pack-${pack1}.pack" &&
     dd of=".git/objects/pack/pack-${pack1}.pack" seek=$(($offs_101 + 1)) \
        if=".git/objects/pack/pack-${pack1}.idx" \
        skip=$((8 + 256 * 4 + $nr_099 * 20)) \
        bs=1 count=20 conv=notrunc &&
     git cat-file blob $sha1_101 > file_101_foo2
Cloning into 'B'...
Applying: second
warning: unable to rmdir submodule: Directory not empty
done.
[master 40123d0] next commit
 Author: A U Thor <author@example.com>
ok 22 - prune: handle alternate object database

# passed all 22 test(s)
1..22
20+0 records in
20+0 records out
20 bytes (20 B) copied, 0.00313667 s, 6.4 kB/s
ok 26 - [index v2] 2) create a stealth corruption in a delta base reference

expecting success: test -f file_101_foo2 && ! cmp file_101 file_101_foo2
file_101 file_101_foo2 differ: char 5, line 2
ok 27 - [index v2] 3) corrupted delta happily returned wrong data

expecting success: test_must_fail git fsck --full $commit
*** t5305-include-tag.sh ***
error: .git/objects/pack/pack-1c54d893dd9bf6645ecee2886ea72f2c2030bea1.pack SHA1 checksum mismatch
error: index CRC mismatch for object 0b968294884af115eb5a1b941b3dabd48470c3bb from .git/objects/pack/pack-1c54d893dd9bf6645ecee2886ea72f2c2030bea1.pack at offset 844032
error: packed 0b968294884af115eb5a1b941b3dabd48470c3bb from .git/objects/pack/pack-1c54d893dd9bf6645ecee2886ea72f2c2030bea1.pack is corrupt
ok 28 - [index v2] 4) confirm that the pack is actually corrupted

expecting success: test_must_fail git pack-objects test-5 <obj-list &&
     test_must_fail git pack-objects --no-reuse-object test-6 <obj-list
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5305-include-tag/.git/
error: bad packed object CRC for 0b968294884af115eb5a1b941b3dabd48470c3bb
error: bad packed object CRC for 0b968294884af115eb5a1b941b3dabd48470c3bb
error: failed to read object 0b968294884af115eb5a1b941b3dabd48470c3bb at offset 844032 from .git/objects/pack/pack-1c54d893dd9bf6645ecee2886ea72f2c2030bea1.pack
fatal: packed object 0b968294884af115eb5a1b941b3dabd48470c3bb (stored in .git/objects/pack/pack-1c54d893dd9bf6645ecee2886ea72f2c2030bea1.pack) is corrupt
expecting success: 
	echo c >d &&
	git update-index --add d &&
	tree=`git write-tree` &&
	commit=`git commit-tree $tree </dev/null` &&
	echo "object $commit" >sig &&
	echo "type commit" >>sig &&
	echo "tag mytag" >>sig &&
	echo "tagger $(git var GIT_COMMITTER_IDENT)" >>sig &&
	echo >>sig &&
	echo "our test tag" >>sig &&
	tag=`git mktag <sig` &&
	rm d sig &&
	git update-ref refs/tags/mytag $tag && {
		echo $tree &&
		echo $commit &&
		git ls-tree $tree | sed -e "s/.* \\([0-9a-f]*\\)	.*/\\1/"
	} >obj-list

Submodule path 'submodule': checked out '2b16875140fdb3b4aae24b2015fe1bcc27aafb37'
ok 30 - diff.submodule unset

expecting success: 
	test_unconfig diff.submodule &&
	run_test $THIRD second-submodule

fatal: Resolve operation not in progress, we are not resuming.
HEAD is now at be614db four
ok 1 - setup

expecting success: 
	packname_1=$(git pack-objects \
		--window=0 \
		test-1 <obj-list)

0001-four.patch
HEAD is now at 7cdc426 second
ok 2 - pack without --include-tag

expecting success: 
	(
		GIT_DIR=clone.git &&
		export GIT_DIR &&
		git init &&
		git unpack-objects -n <test-1-${packname_1}.pack &&
		git unpack-objects <test-1-${packname_1}.pack
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5305-include-tag/clone.git/
ok 3 - unpack objects

expecting success: 
	git rev-list --objects $commit >list.expect &&
	(
		test_must_fail env GIT_DIR=clone.git git cat-file -e $tag &&
		git rev-list --objects $commit
	) >list.actual &&
	test_cmp list.expect list.actual

ok 4 - check unpacked result (have commit, no tag)

Applying: four
error: bad packed object CRC for 0b968294884af115eb5a1b941b3dabd48470c3bb
error: failed to read object 0b968294884af115eb5a1b941b3dabd48470c3bb at offset 844032 from .git/objects/pack/pack-1c54d893dd9bf6645ecee2886ea72f2c2030bea1.pack
fatal: packed object 0b968294884af115eb5a1b941b3dabd48470c3bb (stored in .git/objects/pack/pack-1c54d893dd9bf6645ecee2886ea72f2c2030bea1.pack) is corrupt
warning: unable to rmdir submodule: Directory not empty
ok 29 - [index v2] 5) pack-objects refuses to reuse corrupted data

expecting success: rm -f .git/objects/pack/* &&
     git index-pack --index-version=2 --stdin < "test-1-${pack1}.pack" &&
     git verify-pack ".git/objects/pack/pack-${pack1}.pack" &&
     obj=`git hash-object file_001` &&
     nr=`index_obj_nr ".git/objects/pack/pack-${pack1}.idx" $obj` &&
     chmod +w ".git/objects/pack/pack-${pack1}.idx" &&
     printf xxxx | dd of=".git/objects/pack/pack-${pack1}.idx" conv=notrunc \
        bs=1 count=4 seek=$((8 + 256 * 4 + `wc -l <obj-list` * 20 + $nr * 4)) &&
     ( while read obj
       do git cat-file -p $obj >/dev/null || exit 1
       done <obj-list ) &&
     test_must_fail git verify-pack ".git/objects/pack/pack-${pack1}.pack"

expecting success: 
	packname_1=$(git pack-objects \
		--window=0 \
		--include-tag \
		test-2 <obj-list)

ok 5 - pack with --include-tag

expecting success: 
	(
		GIT_DIR=clone.git &&
		export GIT_DIR &&
		git init &&
		git unpack-objects -n <test-2-${packname_1}.pack &&
		git unpack-objects <test-2-${packname_1}.pack
	)

Submodule path 'submodule': checked out 'a623af53832974aedda72512f4fa27b05b513dee'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5305-include-tag/clone.git/
pack	1c54d893dd9bf6645ecee2886ea72f2c2030bea1
ok 31 - diff.submodule unset with extra file

expecting success: 
	test_config diff.submodule log &&
	run_test $SECOND first-submodule

ok 6 - unpack objects

expecting success: 
	git rev-list --objects mytag >list.expect &&
	(
		GIT_DIR=clone.git &&
		export GIT_DIR &&
		git rev-list --objects $tag
	) >list.actual &&
	test_cmp list.expect list.actual

fatal: Resolve operation not in progress, we are not resuming.
HEAD is now at 7cdc426 second
ok 7 - check unpacked result (have commit, have tag)

# passed all 7 test(s)
1..7
0001-second.patch
HEAD is now at 8fb6b7a first
*** t5306-pack-nobase.sh ***
4+0 records in
4+0 records out
4 bytes (4 B) copied, 0.002083 s, 1.9 kB/s
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5306-pack-nobase/.git/
expecting success: for a in a b c d e f g h i; do echo $a >>text; done &&
     echo side >side &&
     git update-index --add text side &&
     A=$(echo A | git commit-tree $(git write-tree)) &&

     echo m >>text &&
     git update-index text &&
     B=$(echo B | git commit-tree $(git write-tree) -p $A) &&
     git update-ref HEAD $B
    
ok 1 - setup base

expecting success: base_objects=$(pwd)/.git/objects &&
     (mkdir patch_clone &&
      cd patch_clone &&
      git init &&
      echo "$base_objects" >.git/objects/info/alternates &&
      echo q >>text &&
      git read-tree $B &&
      git update-index text &&
      git update-ref HEAD $(echo C | git commit-tree $(git write-tree) -p $B) &&
      rm .git/objects/info/alternates &&

      git --git-dir=../.git cat-file commit $B |
      git hash-object -t commit -w --stdin &&

      git --git-dir=../.git cat-file tree "$B^{tree}" |
      git hash-object -t tree -w --stdin
     ) &&
     C=$(git --git-dir=patch_clone/.git rev-parse HEAD)
    
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5306-pack-nobase/patch_clone/.git/
Submodule path 'submodule': checked out '274aeebc83e7f26e680862996e9bd5ecc327019b'
Applying: second
warning: unable to rmdir submodule: Directory not empty
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5300-pack-object/test-5/.git/
506b8c90d014e4b7f89030ddf7b53eeec1cfeecf
f9037bf6e8d95d31af48907ab2c93c2d6c2c7fcd
ok 2 - setup patch_clone

expecting success: (mkdir user_clone &&
      cd user_clone &&
      git init &&
      git pull ../.git &&
      test $(git rev-parse HEAD) = $B &&

      git pull ../patch_clone/.git &&
      test $(git rev-parse HEAD) = $C
     )
    
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5306-pack-nobase/user_clone/.git/
100644 blob 0042f6c56d8fc1896f3efc2cdc5060e5b5e44e02	0 a0
100644 blob da0f8ed91a8f2f0f067b3bdf26265d5ca48cf82c	0 a1
100644 blob c1827f07e114c20547dc6a7296588870a4b5b62c	0 a2
100644 blob d616f7380ad325123fed6f628d02fa76e1ce77c3	0 a3
100644 blob 88ba23dca8c8529f8165539c369925a99391a4d1	0 a4
100644 blob fafec68b313bde633804c37b46810f136ee12ea6	0 a5
100644 blob 5b521d0587015867ac1a23fa00be3f3fce080b9f	0 a6
100644 blob 6bac181dd20780870c30d69308f5a90b59a15102	0 a7
100644 blob f1914bb68f8515ba7d1ab0f0cddcdf960731773d	0 a8
100644 blob dbe2bc1151e5d5d469644f20189f923f006ed0cc	0 a9
100644 blob 2270a80fbb71d7109b85e7489f3f307d0141a559	0 b0
100644 blob c9c6af7f78bc47490dbf3e822cf2f3c24d4b9061	0 b1
100644 blob e6bfff5c1d0f0ecd501552b43a1e13d8008abc31	0 b2
100644 blob 6d0875c82a99774922eab07fbc08510fc85d9e0a	0 b3
100644 blob 8e953e84d803f13fd06416a1bd8161dcd93cfd00	0 b4
100644 blob 90a5159bf020296276ea5ca1bcd292a9b1de9947	0 b5
100644 blob 07eb61d36f49569a2b0649af299f9f00013d0969	0 b6
100644 blob 6e6d33cfc7b1581413a88ae0759202b25ac4cad1	0 b7
100644 blob 5d453c66b522d8de5d99c03bd2bf8b65ca0bcf33	0 b8
100644 blob 9a16e0d1a643983973291127012d2694a0b17fe8	0 b9
100644 blob caecf05cdbb03e144f113ecab2b99e5ee74df706	0 c0
100644 blob ae9304576a6ec3419b231b2b9c8e33a06f97f9fb	0 c1
100644 blob 16f9ec009e5568c435f473ba3a1df732d49ce8c3	0 c2
100644 blob 0771aea884dd394a7b12783d049f05b5599f41a4	0 c3
100644 blob a103f673dd1b7c5727aa0ae0100419adc50e1b76	0 c4
100644 blob c36357109ce20af8f90df3c0dd0784e89408d707	0 c5
100644 blob 86a716504cbdc40a135faa5ab199d15e364c416d	0 c6
100644 blob 20be68787e59f4cb8983b641d170c4baf8ea25dd	0 c7
100644 blob bb420bc8fb9e91530fdc25e363f6b822d5195309	0 c8
100644 blob f899bd1761a5ca5978799bc3189a04d3c52d8435	0 c9
100644 blob 79a5e858be4a3a969e3b71406fef0d3d36e1d387	0 d0
100644 blob 6f1852975b9306ae5d8dfdf0d4cb1f5cb36ac229	0 d1
100644 blob fd3671590780b645e1bef030d550191f6cdf1c95	0 d2
100644 blob 69c77a9ea746edd27b46107142fc2c5288c1daf5	0 d3
100644 blob d7b30ee07d4b9819a77a3b122282b4c04528ec21	0 d4
100644 blob fa590f3f8bfbef6095cf6525e8497b2b2b46445c	0 d5
100644 blob fef4390d19cb98fa97efd44c09d4e2eb7b084b40	0 d6
100644 blob a5adf29249757619b8890c86f2cfcfeee611b5d8	0 d7
100644 blob 1859919d049c078ba63fcecbce60e697c6da8e01	0 d8
100644 blob b6148c82443a60d1d5ce07872a85e3c544b5f4b0	0 d9
100644 blob 4fe4106b50b257f3d6ffd23b750d2d1945c2608b	0 e0
100644 blob 5ff91639494693b1f238b5dc9baf8be95142c3ab	0 e1
100644 blob 3811af3ca744c2fb44077a8025c23b4d4166a449	0 e2
100644 blob 9338c3fa1f74d202651154257572d32aed57cc16	0 e3
100644 blob c5195815f83aa9ef1ebac9e11f14d62b26406c99	0 e4
100644 blob 0c44c89ef9c29077cceebc6dd9ca0b3a950c95ee	0 e5
100644 blob f17172bc54cfa55a9e531cc845dff39855cd8df0	0 e6
100644 blob 29870e9ccff84f86938ee588a47b39cf3a802e6b	0 e7
100644 blob e8d01d007452cede5c6eafc3343fc80675b1e2f9	0 e8
100644 blob 0c1945ad576ffc445ad69a3fafd1d3c04cc0bd40	0 e9
100644 blob 844dc808a1d3d769ddcf5430eac933d4d87ff606	0 f0
100644 blob 8e1e71d5ce34c01b6fe83bc5051545f2918c8c2b	0 f1
100644 blob 9de77c18733ab8009a956c25e28c85fe203a17d7	0 f2
100644 blob 45d9e0e9fc8859787c33081dffdf12f41b54fcf3	0 f3
100644 blob c48ac4847d3abae8e5899dcc5cf490a98df55755	0 f4
100644 blob 14c61ecf25961ce674048103c5fa5ea3c535a5cd	0 f5
100644 blob 59ce90029dfd9e224701a040a26153e9f2feb74c	0 f6
100644 blob 0a7bd52ffb819609cf65f40eb91be62000db47e5	0 f7
100644 blob c7e617f6b429a1f3b462df6add2b4ea2cf702faf	0 f8
100644 blob a720d8c8d277ad31ee5b180bef57379b5f62517c	0 f9
100644 blob 2e7d2f0b106eb8823e449a020497e26b86dc3eb1	0 g0
100644 blob d8a17fff13638d804e8bf7f9f357c174db98f126	0 g1
100644 blob 247c4abd244a429297a4c4b091592ae13bbf4677	0 g2
100644 blob affaa5ba8c43cfc71469226e0d57cb6823c843da	0 g3
100644 blob 51bc00f93e60aeef7dccfcf646e3f615056112bd	0 g4
100644 blob 02b4fdd23d495769852f1550c10eb015f0fe0039	0 g5
100644 blob e65aa9d64b596da2ba61e0662b1173f1e16dcbcf	0 g6
100644 blob e19089689a05907b359f52c972ee7d2294fa96ab	0 g7
100644 blob 30c2af9542d38e1f248390632612e0fb944fd27d	0 g8
100644 blob 09827d7e43d81089e868e9f0f06502b865939c05	0 g9
100644 blob 0042f6c56d8fc1896f3efc2cdc5060e5b5e44e02	0 a0
100644 blob da0f8ed91a8f2f0f067b3bdf26265d5ca48cf82c	0 a1
100644 blob c1827f07e114c20547dc6a7296588870a4b5b62c	0 a2
100644 blob d616f7380ad325123fed6f628d02fa76e1ce77c3	0 a3
100644 blob 88ba23dca8c8529f8165539c369925a99391a4d1	0 a4
100644 blob fafec68b313bde633804c37b46810f136ee12ea6	0 a5
100644 blob 5b521d0587015867ac1a23fa00be3f3fce080b9f	0 a6
100644 blob 6bac181dd20780870c30d69308f5a90b59a15102	0 a7
100644 blob f1914bb68f8515ba7d1ab0f0cddcdf960731773d	0 a8
100644 blob dbe2bc1151e5d5d469644f20189f923f006ed0cc	0 a9
100644 blob 2e7d2f0b106eb8823e449a020497e26b86dc3eb1	0 g0
100644 blob d8a17fff13638d804e8bf7f9f357c174db98f126	0 g1
100644 blob 247c4abd244a429297a4c4b091592ae13bbf4677	0 g2
100644 blob affaa5ba8c43cfc71469226e0d57cb6823c843da	0 g3
100644 blob 51bc00f93e60aeef7dccfcf646e3f615056112bd	0 g4
100644 blob 02b4fdd23d495769852f1550c10eb015f0fe0039	0 g5
100644 blob e65aa9d64b596da2ba61e0662b1173f1e16dcbcf	0 g6
100644 blob e19089689a05907b359f52c972ee7d2294fa96ab	0 g7
100644 blob 30c2af9542d38e1f248390632612e0fb944fd27d	0 g8
100644 blob 09827d7e43d81089e868e9f0f06502b865939c05	0 g9
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5300-pack-object/test-6/.git/
From ../
 * branch            HEAD       -> FETCH_HEAD
fatal: object of unexpected type
ok 25 - unpacking with --strict

expecting success: 

	for j in a b c d e f g
	do
		for i in 0 1 2 3 4 5 6 7 8 9
		do
			o=$(echo $j$i | git hash-object -w --stdin) &&
			echo "100644 $o	0 $j$i"
		done
	done >LIST &&
	rm -f .git/index &&
	git update-index --index-info <LIST &&
	LIST=$(git write-tree) &&
	rm -f .git/index &&
	head -n 10 LIST | git update-index --index-info &&
	LI=$(git write-tree) &&
	rm -f .git/index &&
	tail -n 10 LIST | git update-index --index-info &&
	ST=$(git write-tree) &&
	PACK5=$( git rev-list --objects "$LIST" "$LI" "$ST" | \
		git pack-objects test-5 ) &&
	PACK6=$( (
			echo "$LIST"
			echo "$LI"
			echo "$ST"
		 ) | git pack-objects test-6 ) &&
	test_create_repo test-7 &&
	(
		cd test-7 &&
		git index-pack --strict --stdin <../test-5-$PACK5.pack &&
		git ls-tree -r $LIST &&
		git ls-tree -r $LI &&
		git ls-tree -r $ST
	) &&
	test_create_repo test-8 &&
	(
		# tree-only into empty repo -- many unreachables
		cd test-8 &&
		test_must_fail git index-pack --strict --stdin <../test-6-$PACK6.pack
	) &&
	(
		# already populated -- no unreachables
		cd test-7 &&
		git index-pack --strict --stdin <../test-6-$PACK6.pack
	)

Submodule path 'submodule': checked out '2b16875140fdb3b4aae24b2015fe1bcc27aafb37'
ok 32 - diff.submodule=log

expecting success: 
	test_config diff.submodule log &&
	run_test $THIRD second-submodule

From ../patch_clone/
 * branch            HEAD       -> FETCH_HEAD
fatal: Resolve operation not in progress, we are not resuming.
Updating 506b8c9..09d3c20
Fast-forward
HEAD is now at be614db four
 text | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)
ok 3 - indirectly clone patch_clone

expecting success: (mkdir user_direct &&
      cd user_direct &&
      git init &&
      test_must_fail git fetch ../patch_clone/.git
     )
    
0001-four.patch
HEAD is now at 7cdc426 second
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5306-pack-nobase/user_direct/.git/
remote: error: Could not read b4b5bad44b6faa8467959ab80672db75f8466b9f        
remote: fatal: Failed to traverse parents of commit 506b8c90d014e4b7f89030ddf7b53eeec1cfeecf        
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: protocol error: bad pack header
ok 4 - clone of patch_clone is incomplete

# passed all 4 test(s)
1..4
*** t5307-pack-missing-commit.sh ***
Applying: four
warning: unable to rmdir submodule: Directory not empty
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5307-pack-missing-commit/.git/
expecting success: 
	for i in 1 2 3 4 5
	do
		echo "$i" >"file$i" &&
		git add "file$i" &&
		test_tick &&
		git commit -m "$i" &&
		git tag "tag$i"
	done &&
	obj=$(git rev-parse --verify tag3) &&
	fanout=$(expr "$obj" : "\(..\)") &&
	remainder=$(expr "$obj" : "..\(.*\)") &&
	rm -f ".git/objects/$fanout/$remainder"

[master (root-commit) f1e5f64] 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file1
[master 464ac64] 2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file2
[master 4b3f9fe] 3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file3
[master 4387cd0] 4
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file4
[master 18dfde5] 5
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file5
Submodule path 'submodule': checked out 'a623af53832974aedda72512f4fa27b05b513dee'
ok 33 - diff.submodule=log with extra file

ok 1 - setup

expecting success: 
	test_must_fail git fsck

# still have 6 known breakage(s)
# passed all remaining 27 test(s)
1..33
error: refs/tags/tag3: invalid sha1 pointer 4b3f9fe85f6c3449091baf9783e2641f38efdd8e
missing commit 4b3f9fe85f6c3449091baf9783e2641f38efdd8e
ok 2 - check corruption

expecting success: 
	test_must_fail git rev-list HEAD

18dfde5380f75061a4c4e203210947d874f34b14
error: Could not read 4b3f9fe85f6c3449091baf9783e2641f38efdd8e
fatal: Failed to traverse parents of commit 4387cd029ff9d3e6d049717fc055ca04b972bfb8
ok 3 - rev-list notices corruption (1)

expecting success: 
	test_must_fail git rev-list --objects HEAD

18dfde5380f75061a4c4e203210947d874f34b14
error: Could not read 4b3f9fe85f6c3449091baf9783e2641f38efdd8e
fatal: Failed to traverse parents of commit 4387cd029ff9d3e6d049717fc055ca04b972bfb8
ok 4 - rev-list notices corruption (2)

expecting success: 
	echo HEAD |
	test_must_fail git pack-objects --revs pack

error: Could not read 4b3f9fe85f6c3449091baf9783e2641f38efdd8e
fatal: Failed to traverse parents of commit 4387cd029ff9d3e6d049717fc055ca04b972bfb8
ok 5 - pack-objects notices corruption

# passed all 5 test(s)
1..5
*** t5308-pack-detect-duplicates.sh ***
*** t5309-pack-delta-cycles.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5308-pack-detect-duplicates/.git/
expecting success: 
	create_pack no-dups.pack 1 &&
	git index-pack --stdin <no-dups.pack

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5309-pack-delta-cycles/.git/
expecting success: 
	clear_packs &&
	{
		pack_header 2 &&
		pack_obj $A $B &&
		pack_obj $B
	} >ab.pack &&
	pack_trailer ab.pack &&
	git index-pack --stdin <ab.pack &&
	git cat-file -t $A &&
	git cat-file -t $B

pack	2b6334c837f829fc85b8483b099737d46872fcf1
ok 1 - pack with no duplicates

expecting success: 
	clear_packs &&
	create_pack dups.pack 100 &&
	git index-pack --stdin <dups.pack

pack	8af524300e46c11647862073e882d467bc0dd22d
blob
blob
ok 1 - index-pack works with a single delta (A->B)

expecting success: 
	clear_packs &&
	{
		pack_header 2 &&
		pack_obj $A &&
		pack_obj $B $A
	} >ba.pack &&
	pack_trailer ba.pack &&
	git index-pack --stdin <ba.pack &&
	git cat-file -t $A &&
	git cat-file -t $B

pack	9452d1779e83b02a99c82f7dd97a9ed27464a46e
ok 2 - index-pack will allow duplicate objects by default

expecting success: 
	cat >input <<-EOF &&
	$LO_SHA1
	$HI_SHA1
	$MISSING_SHA1
	EOF
	cat >expect <<-EOF
	$LO_SHA1 blob 2
	$HI_SHA1 blob 0
	$MISSING_SHA1 missing
	EOF

ok 3 - create batch-check test vectors

expecting success: 
	git cat-file --batch-check <input >actual &&
	test_cmp expect actual

ok 4 - lookup in duplicated pack (binary search)

expecting success: 
	(
		GIT_USE_LOOKUP=1 &&
		export GIT_USE_LOOKUP &&
		git cat-file --batch-check <input >actual
	) &&
	test_cmp expect actual

ok 5 - lookup in duplicated pack (GIT_USE_LOOKUP)

expecting success: 
	clear_packs &&
	create_pack dups.pack 2 &&
	test_must_fail git index-pack --strict --stdin <dups.pack &&
	test_expect_code 1 git cat-file -e $LO_SHA1

pack	80442ca09df79dab1a7b2ac6fc4928bfbeeddc20
blob
blob
ok 2 - index-pack works with a single delta (B->A)

expecting success: 
	clear_packs &&
	{
		pack_header 1 &&
		pack_obj $A $B
	} >missing.pack &&
	pack_trailer missing.pack &&
	test_must_fail git index-pack --fix-thin --stdin <missing.pack

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5300-pack-object/test-7/.git/
fatal: The same object e68fe8129b546b101aee9510c5328e7f21ca1d18 appears twice in the pack
ok 6 - index-pack can reject packs with duplicates

# passed all 6 test(s)
1..6
*** t5310-pack-bitmaps.sh ***
fatal: pack has 1 unresolved delta
ok 3 - index-pack detects missing base objects

expecting success: 
	clear_packs &&
	{
		pack_header 2 &&
		pack_obj $A $B &&
		pack_obj $B $A
	} >cycle.pack &&
	pack_trailer cycle.pack &&
	test_must_fail git index-pack --fix-thin --stdin <cycle.pack

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5310-pack-bitmaps/.git/
expecting success: 
	for i in $(test_seq 1 10); do
		test_commit $i
	done &&
	git checkout -b other HEAD~5 &&
	for i in $(test_seq 1 10); do
		test_commit side-$i
	done &&
	git checkout master &&
	blob=$(echo tagged-blob | git hash-object -w --stdin) &&
	git tag tagged-blob $blob &&
	git config repack.writebitmaps true &&
	git config pack.writebitmaphashcache true

pack	580f6e9e5f1fc55c922ae4f748e6adb3737375f4
100644 blob 0042f6c56d8fc1896f3efc2cdc5060e5b5e44e02	0 a0
100644 blob da0f8ed91a8f2f0f067b3bdf26265d5ca48cf82c	0 a1
100644 blob c1827f07e114c20547dc6a7296588870a4b5b62c	0 a2
100644 blob d616f7380ad325123fed6f628d02fa76e1ce77c3	0 a3
100644 blob 88ba23dca8c8529f8165539c369925a99391a4d1	0 a4
100644 blob fafec68b313bde633804c37b46810f136ee12ea6	0 a5
100644 blob 5b521d0587015867ac1a23fa00be3f3fce080b9f	0 a6
100644 blob 6bac181dd20780870c30d69308f5a90b59a15102	0 a7
100644 blob f1914bb68f8515ba7d1ab0f0cddcdf960731773d	0 a8
100644 blob dbe2bc1151e5d5d469644f20189f923f006ed0cc	0 a9
100644 blob 2270a80fbb71d7109b85e7489f3f307d0141a559	0 b0
100644 blob c9c6af7f78bc47490dbf3e822cf2f3c24d4b9061	0 b1
100644 blob e6bfff5c1d0f0ecd501552b43a1e13d8008abc31	0 b2
100644 blob 6d0875c82a99774922eab07fbc08510fc85d9e0a	0 b3
100644 blob 8e953e84d803f13fd06416a1bd8161dcd93cfd00	0 b4
100644 blob 90a5159bf020296276ea5ca1bcd292a9b1de9947	0 b5
100644 blob 07eb61d36f49569a2b0649af299f9f00013d0969	0 b6
100644 blob 6e6d33cfc7b1581413a88ae0759202b25ac4cad1	0 b7
100644 blob 5d453c66b522d8de5d99c03bd2bf8b65ca0bcf33	0 b8
100644 blob 9a16e0d1a643983973291127012d2694a0b17fe8	0 b9
100644 blob caecf05cdbb03e144f113ecab2b99e5ee74df706	0 c0
100644 blob ae9304576a6ec3419b231b2b9c8e33a06f97f9fb	0 c1
100644 blob 16f9ec009e5568c435f473ba3a1df732d49ce8c3	0 c2
100644 blob 0771aea884dd394a7b12783d049f05b5599f41a4	0 c3
100644 blob a103f673dd1b7c5727aa0ae0100419adc50e1b76	0 c4
100644 blob c36357109ce20af8f90df3c0dd0784e89408d707	0 c5
100644 blob 86a716504cbdc40a135faa5ab199d15e364c416d	0 c6
100644 blob 20be68787e59f4cb8983b641d170c4baf8ea25dd	0 c7
100644 blob bb420bc8fb9e91530fdc25e363f6b822d5195309	0 c8
100644 blob f899bd1761a5ca5978799bc3189a04d3c52d8435	0 c9
100644 blob 79a5e858be4a3a969e3b71406fef0d3d36e1d387	0 d0
100644 blob 6f1852975b9306ae5d8dfdf0d4cb1f5cb36ac229	0 d1
100644 blob fd3671590780b645e1bef030d550191f6cdf1c95	0 d2
100644 blob 69c77a9ea746edd27b46107142fc2c5288c1daf5	0 d3
100644 blob d7b30ee07d4b9819a77a3b122282b4c04528ec21	0 d4
100644 blob fa590f3f8bfbef6095cf6525e8497b2b2b46445c	0 d5
100644 blob fef4390d19cb98fa97efd44c09d4e2eb7b084b40	0 d6
100644 blob a5adf29249757619b8890c86f2cfcfeee611b5d8	0 d7
100644 blob 1859919d049c078ba63fcecbce60e697c6da8e01	0 d8
100644 blob b6148c82443a60d1d5ce07872a85e3c544b5f4b0	0 d9
100644 blob 4fe4106b50b257f3d6ffd23b750d2d1945c2608b	0 e0
100644 blob 5ff91639494693b1f238b5dc9baf8be95142c3ab	0 e1
100644 blob 3811af3ca744c2fb44077a8025c23b4d4166a449	0 e2
100644 blob 9338c3fa1f74d202651154257572d32aed57cc16	0 e3
100644 blob c5195815f83aa9ef1ebac9e11f14d62b26406c99	0 e4
100644 blob 0c44c89ef9c29077cceebc6dd9ca0b3a950c95ee	0 e5
100644 blob f17172bc54cfa55a9e531cc845dff39855cd8df0	0 e6
100644 blob 29870e9ccff84f86938ee588a47b39cf3a802e6b	0 e7
100644 blob e8d01d007452cede5c6eafc3343fc80675b1e2f9	0 e8
100644 blob 0c1945ad576ffc445ad69a3fafd1d3c04cc0bd40	0 e9
100644 blob 844dc808a1d3d769ddcf5430eac933d4d87ff606	0 f0
100644 blob 8e1e71d5ce34c01b6fe83bc5051545f2918c8c2b	0 f1
100644 blob 9de77c18733ab8009a956c25e28c85fe203a17d7	0 f2
100644 blob 45d9e0e9fc8859787c33081dffdf12f41b54fcf3	0 f3
100644 blob c48ac4847d3abae8e5899dcc5cf490a98df55755	0 f4
100644 blob 14c61ecf25961ce674048103c5fa5ea3c535a5cd	0 f5
100644 blob 59ce90029dfd9e224701a040a26153e9f2feb74c	0 f6
100644 blob 0a7bd52ffb819609cf65f40eb91be62000db47e5	0 f7
100644 blob c7e617f6b429a1f3b462df6add2b4ea2cf702faf	0 f8
100644 blob a720d8c8d277ad31ee5b180bef57379b5f62517c	0 f9
100644 blob 2e7d2f0b106eb8823e449a020497e26b86dc3eb1	0 g0
100644 blob d8a17fff13638d804e8bf7f9f357c174db98f126	0 g1
100644 blob 247c4abd244a429297a4c4b091592ae13bbf4677	0 g2
100644 blob affaa5ba8c43cfc71469226e0d57cb6823c843da	0 g3
100644 blob 51bc00f93e60aeef7dccfcf646e3f615056112bd	0 g4
100644 blob 02b4fdd23d495769852f1550c10eb015f0fe0039	0 g5
100644 blob e65aa9d64b596da2ba61e0662b1173f1e16dcbcf	0 g6
100644 blob e19089689a05907b359f52c972ee7d2294fa96ab	0 g7
100644 blob 30c2af9542d38e1f248390632612e0fb944fd27d	0 g8
100644 blob 09827d7e43d81089e868e9f0f06502b865939c05	0 g9
100644 blob 0042f6c56d8fc1896f3efc2cdc5060e5b5e44e02	0 a0
100644 blob da0f8ed91a8f2f0f067b3bdf26265d5ca48cf82c	0 a1
100644 blob c1827f07e114c20547dc6a7296588870a4b5b62c	0 a2
100644 blob d616f7380ad325123fed6f628d02fa76e1ce77c3	0 a3
100644 blob 88ba23dca8c8529f8165539c369925a99391a4d1	0 a4
100644 blob fafec68b313bde633804c37b46810f136ee12ea6	0 a5
100644 blob 5b521d0587015867ac1a23fa00be3f3fce080b9f	0 a6
100644 blob 6bac181dd20780870c30d69308f5a90b59a15102	0 a7
100644 blob f1914bb68f8515ba7d1ab0f0cddcdf960731773d	0 a8
100644 blob dbe2bc1151e5d5d469644f20189f923f006ed0cc	0 a9
fatal: pack has 2 unresolved deltas
ok 4 - index-pack detects REF_DELTA cycles

[master (root-commit) d0dcf97] 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 1.t
checking known breakage: 
	clear_packs &&
	git index-pack --stdin <ab.pack &&
	git index-pack --stdin --fix-thin <cycle.pack

100644 blob 2e7d2f0b106eb8823e449a020497e26b86dc3eb1	0 g0
100644 blob d8a17fff13638d804e8bf7f9f357c174db98f126	0 g1
100644 blob 247c4abd244a429297a4c4b091592ae13bbf4677	0 g2
100644 blob affaa5ba8c43cfc71469226e0d57cb6823c843da	0 g3
100644 blob 51bc00f93e60aeef7dccfcf646e3f615056112bd	0 g4
100644 blob 02b4fdd23d495769852f1550c10eb015f0fe0039	0 g5
100644 blob e65aa9d64b596da2ba61e0662b1173f1e16dcbcf	0 g6
100644 blob e19089689a05907b359f52c972ee7d2294fa96ab	0 g7
100644 blob 30c2af9542d38e1f248390632612e0fb944fd27d	0 g8
100644 blob 09827d7e43d81089e868e9f0f06502b865939c05	0 g9
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5300-pack-object/test-8/.git/
fatal: did not receive expected object 0042f6c56d8fc1896f3efc2cdc5060e5b5e44e02
[master 82335b2] 2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 2.t
[master ddc8575] 3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 3.t
pack	8af524300e46c11647862073e882d467bc0dd22d
fatal: BUG: child->real_type != OBJ_REF_DELTA
not ok 5 - failover to an object in another pack # TODO known breakage

checking known breakage: 
	clear_packs &&
	{
		pack_header 3 &&
		pack_obj $A $B &&
		pack_obj $B $A &&
		pack_obj $A
	} >recoverable.pack &&
	pack_trailer recoverable.pack &&
	git index-pack --fix-thin --stdin <recoverable.pack

[master 11daa30] 4
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 4.t
fatal: BUG: child->real_type != OBJ_REF_DELTA
not ok 6 - failover to a duplicate object in the same pack # TODO known breakage

# still have 2 known breakage(s)
# passed all remaining 4 test(s)
1..6
pack	499fed00672b4ac4e35132711ee1664a089f355e
ok 26 - index-pack with --strict

expecting success: 
	git config pack.packSizeLimit 3m &&
	packname_10=$(git pack-objects test-10 <obj-list) &&
	test 2 = $(ls test-10-*.pack | wc -l)

*** t5311-pack-bitmaps-shallow.sh ***
[master 9550f3b] 5
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 5.t
[master 63dff72] 6
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 6.t
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5311-pack-bitmaps-shallow/.git/
expecting success: 
	echo 1 >file &&
	git add file &&
	git commit -m orig &&
	echo 2 >file &&
	git commit -a -m update &&
	git clone --no-local --bare --depth=1 . shallow.git &&
	echo 1 >file &&
	git commit -a -m repeat

[master dd6f5e0] 7
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 7.t
[master (root-commit) c322c76] orig
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
[master 285d886] update
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 7992f15] 8
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 8.t
Cloning into bare repository 'shallow.git'...
[master 5318660] 9
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 9.t
[master 537ea4d] 10
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 10.t
Switched to a new branch 'other'
[master b62f41f] repeat
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - setup shallow repo

expecting success: 
	git repack -adb

[other 786881f] side-1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 side-1.t
[other 4afa1c4] side-2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 side-2.t
[other 3b8c906] side-3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 side-3.t
[other 6931ab2] side-4
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 side-4.t
ok 2 - turn on bitmaps in the parent

expecting success: 
	(cd shallow.git && git fetch)

[other a178276] side-5
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 side-5.t
From /«PKGBUILDDIR»/t/trash directory.t5311-pack-bitmaps-shallow/.
 * branch            HEAD       -> FETCH_HEAD
ok 3 - shallow fetch from bitmapped repo

[other a297fce] side-6
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 side-6.t
# passed all 3 test(s)
1..3
[other e787f87] side-7
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 side-7.t
*** t5312-prune-corruption.sh ***
[other b306e07] side-8
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 side-8.t
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5312-prune-corruption/.git/
expecting success: 
	git config core.logallrefupdates false &&
	git reflog expire --expire=all --all

[other f2abcf8] side-9
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 side-9.t
ok 1 - disable reflogs

expecting success: 
	test_tick && git commit --allow-empty -m master &&
	base=$(git rev-parse HEAD) &&
	test_tick && git commit --allow-empty -m bogus &&
	bogus=$(git rev-parse HEAD) &&
	git cat-file commit $bogus >saved &&
	echo $bogus >.git/refs/heads/bogus..name &&
	git reset --hard HEAD^

[master (root-commit) 080f071] master
 Author: A U Thor <author@example.com>
[other 1ecd10a] side-10
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 side-10.t
[master f940c56] bogus
 Author: A U Thor <author@example.com>
Switched to branch 'master'
HEAD is now at 080f071 master
ok 2 - create history reachable only from a bogus-named ref

expecting success: 
	test_when_finished "git hash-object -w -t commit saved" &&
	test_might_fail git prune --expire=now &&
	verbose git cat-file -e $bogus

fatal: unable to parse object: refs/heads/bogus..name
f940c56ce42d31a4dd10ec9f28502a6ff9501fc9
ok 1 - setup repo with moderate-sized history

ok 3 - pruning does not drop bogus object

expecting success: 
	git repack -ad &&
	ls .git/objects/pack/ | grep bitmap >output &&
	test_line_count = 1 output

expecting success: 
	git tag reachable $bogus &&
	git repack -ad &&
	git tag -d reachable &&
	verbose git cat-file -e $bogus

Deleted tag 'reachable' (was f940c56)
ok 4 - put bogus object into pack

expecting success: 
	test_might_fail git repack -Ad --unpack-unreachable=now &&
	verbose git cat-file -e $bogus &&
	test_might_fail git repack -ad &&
	verbose git cat-file -e $bogus

fatal: bad object refs/heads/bogus..name
fatal: bad object refs/heads/bogus..name
ok 5 - destructive repack keeps packed object

expecting success: 
	rm .git/refs/heads/bogus..name

ok 6 - clean up bogus ref

expecting success: 
	test_tick && git commit --allow-empty -m one &&
	recoverable=$(git rev-parse HEAD) &&
	git cat-file commit $recoverable >saved &&
	test_tick && git commit --allow-empty -m two &&
	missing=$(git rev-parse HEAD) &&
	git checkout --detach $base &&
	rm .git/objects/$(echo $missing | sed "s,..,&/,") &&
	test_must_fail git cat-file -e $missing

[master 7dcec5b] one
 Author: A U Thor <author@example.com>
[master e9fdcfa] two
 Author: A U Thor <author@example.com>
ok 2 - full repack creates bitmaps

expecting success: 
	git rev-list --test-bitmap HEAD

Note: checking out '080f0716155eb479b0a4c081f520695afe5a4fe8'.

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 080f071... master
Bitmap v1 test (20 entries loaded)
Found bitmap for 537ea4d3eb79c95f602873b1167c480006d2ac2d. 64 bits / 9d288ce4 checksum
Verifying bitmap entries:   3% (1/30)   
Verifying bitmap entries:   6% (2/30)   
Verifying bitmap entries:  10% (3/30)   
Verifying bitmap entries:  13% (4/30)   
Verifying bitmap entries:  16% (5/30)   
Verifying bitmap entries:  20% (6/30)   
Verifying bitmap entries:  23% (7/30)   
Verifying bitmap entries:  26% (8/30)   
Verifying bitmap entries:  30% (9/30)   
Verifying bitmap entries:  33% (10/30)   
Verifying bitmap entries:  36% (11/30)   
Verifying bitmap entries:  40% (12/30)   
Verifying bitmap entries:  43% (13/30)   
Verifying bitmap entries:  46% (14/30)   
Verifying bitmap entries:  50% (15/30)   
Verifying bitmap entries:  53% (16/30)   
Verifying bitmap entries:  56% (17/30)   
Verifying bitmap entries:  60% (18/30)   
Verifying bitmap entries:  63% (19/30)   
Verifying bitmap entries:  66% (20/30)   
Verifying bitmap entries:  70% (21/30)   
Verifying bitmap entries:  73% (22/30)   
Verifying bitmap entries:  76% (23/30)   
Verifying bitmap entries:  80% (24/30)   
Verifying bitmap entries:  83% (25/30)   
Verifying bitmap entries:  86% (26/30)   
Verifying bitmap entries:  90% (27/30)   
Verifying bitmap entries:  93% (28/30)   
Verifying bitmap entries:  96% (29/30)   
Verifying bitmap entries: 100% (30/30)   
Verifying bitmap entries: 100% (30/30), done.
OK!
ok 3 - rev-list --test-bitmap verifies bitmaps

expecting success: 
		git rev-list --count HEAD >expect &&
		git rev-list --use-bitmap-index --count HEAD >actual &&
		test_cmp expect actual
	
ok 7 - create history with missing tip commit

expecting success: 
	test_when_finished "git hash-object -w -t commit saved" &&
	test_might_fail git prune --expire=now &&
	verbose git cat-file -e $recoverable

fatal: unable to parse object: refs/heads/master
ok 4 - counting commits via bitmap (full bitmap)

expecting success: 
		git rev-list --count HEAD~5..HEAD >expect &&
		git rev-list --use-bitmap-index --count HEAD~5..HEAD >actual &&
		test_cmp expect actual
	
7dcec5bdbc3bc472bf44c87010a4acd327683b24
ok 8 - pruning with a corrupted tip does not drop history

expecting success: 
	git pack-refs --all --prune &&
	echo $missing >expect &&
	git rev-parse refs/heads/master >actual &&
	test_cmp expect actual

error: refs/heads/master does not point to a valid object!
ok 5 - counting partial commits via bitmap (full bitmap)

expecting success: 
		git rev-list --count other...master >expect &&
		git rev-list --use-bitmap-index --count other...master >actual &&
		test_cmp expect actual
	
ok 9 - pack-refs does not silently delete broken loose ref

expecting success: 
	rm -f .git/refs/heads/master &&
	cat >.git/packed-refs <<-EOF &&
	$missing refs/heads/master
	$recoverable refs/heads/other
	EOF
	echo $missing >expect &&
	git rev-parse refs/heads/master >actual &&
	test_cmp expect actual

ok 10 - create packed-refs file with broken ref

expecting success: 
	git pack-refs --all --prune &&
	git rev-parse refs/heads/master >actual &&
	test_cmp expect actual

ok 6 - counting non-linear history (full bitmap)

expecting success: 
		git rev-list --count HEAD -- 1.t >expect &&
		git rev-list --use-bitmap-index --count HEAD -- 1.t >actual &&
		test_cmp expect actual
	
error: internal error: refs/heads/master is not a valid packed reference!
ok 11 - pack-refs does not silently delete broken packed ref

expecting success: 
	git update-ref -d refs/heads/other &&
	git rev-parse refs/heads/master >actual &&
	test_cmp expect actual

fatal: sha1 file '.git/objects/pack/pack-1c54d893dd9bf6645ecee2886ea72f2c2030bea1.idx' validation error
ok 30 - [index v2] 6) verify-pack detects CRC mismatch

expecting success: 
    rm -f .git/objects/pack/* &&
    cp test-1-${pack1}.pack .git/objects/pack/pack-${pack1}.pack &&
    (
	cd .git/objects/pack
	git index-pack pack-${pack1}.pack
    ) &&
    test -f .git/objects/pack/pack-${pack1}.idx

ok 7 - counting commits with limiting (full bitmap)

expecting success: 
		git rev-list --objects --use-bitmap-index HEAD >tmp &&
		cut -d" " -f1 <tmp >tmp2 &&
		sort <tmp2 >actual &&
		git rev-list --objects HEAD >tmp &&
		cut -d" " -f1 <tmp >tmp2 &&
		sort <tmp2 >expect &&
		test_cmp expect actual
	
ok 12 - pack-refs does not drop broken refs during deletion

# passed all 12 test(s)
1..12
ok 8 - enumerate --objects (full bitmap)

expecting success: 
		git rev-list --objects --use-bitmap-index HEAD tagged-blob >actual &&
		grep $blob actual
	
*** t5400-send-pack.sh ***
782f60206c837dcd3d441e106549ad6f58de55b5
ok 9 - bitmap --objects handles non-commit objects (full bitmap)

expecting success: 
	git clone --no-local --bare . clone.git &&
	git rev-parse HEAD >expect &&
	git --git-dir=clone.git rev-parse HEAD >actual &&
	test_cmp expect actual

Cloning into bare repository 'clone.git'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5400-send-pack/.git/
expecting success: 
	test_tick &&
	mkdir mozart mozart/is &&
	echo "Commit #0" >mozart/is/pink &&
	git update-index --add mozart/is/pink &&
	tree=$(git write-tree) &&
	commit=$(echo "Commit #0" | git commit-tree $tree) &&
	zero=$commit &&
	parent=$zero &&
	i=0 &&
	while test $i -le $cnt
	do
	    i=$(($i+1)) &&
	    test_tick &&
	    echo "Commit #$i" >mozart/is/pink &&
	    git update-index --add mozart/is/pink &&
	    tree=$(git write-tree) &&
	    commit=$(echo "Commit #$i" | git commit-tree $tree -p $parent) &&
	    git update-ref refs/tags/commit$i $commit &&
	    parent=$commit || return 1
	done &&
	git update-ref HEAD "$commit" &&
	git clone ./. victim &&
	( cd victim && git config receive.denyCurrentBranch warn && git log ) &&
	git update-ref HEAD "$zero" &&
	parent=$zero &&
	i=0 &&
	while test $i -le $cnt
	do
	    i=$(($i+1)) &&
	    test_tick &&
	    echo "Rebase #$i" >mozart/is/pink &&
	    git update-index --add mozart/is/pink &&
	    tree=$(git write-tree) &&
	    commit=$(echo "Rebase #$i" | git commit-tree $tree -p $parent) &&
	    git update-ref refs/tags/rebase$i $commit &&
	    parent=$commit || return 1
	done &&
	git update-ref HEAD "$commit" &&
	echo Rebase &&
	git log
1c54d893dd9bf6645ecee2886ea72f2c2030bea1
ok 31 - running index-pack in the object store

expecting success: 
    sha=$(git rev-parse HEAD) &&
    cat >wrong-tag <<EOF &&
object $sha
type commit
tag guten tag

This is an invalid tag.
EOF

    tag=$(git hash-object -t tag -w --stdin <wrong-tag) &&
    pack1=$(echo $tag $sha | git pack-objects tag-test) &&
    echo remove tag object &&
    thirtyeight=${tag#??} &&
    rm -f .git/objects/${tag%$thirtyeight}/$thirtyeight &&
    git index-pack --strict tag-test-${pack1}.pack 2>err &&
    grep "^warning:.* expected .tagger. line" err

remove tag object
ok 10 - clone from bitmapped repository

expecting success: 
	for i in $(test_seq 1 10); do
		test_commit further-$i
	done

[master d21efa5] further-1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 further-1.t
933258aac5cc4ed9f95db1edf781923b2c8ff6f3
warning: object ae23821c3edde554dc27a98401d5de556684b317: missingTaggerEntry: invalid format - expected 'tagger' line
ok 32 - index-pack --strict warns upon missing tagger in tag

# passed all 32 test(s)
1..32
[master e57925b] further-2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 further-2.t
[master 717b395] further-3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 further-3.t
[master f4bf434] further-4
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 further-4.t
*** t5401-update-hooks.sh ***
[master 456317d] further-5
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 further-5.t
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5401-update-hooks/.git/
expecting success: 
	echo This is a test. >a &&
	git update-index --add a &&
	tree0=$(git write-tree) &&
	commit0=$(echo setup | git commit-tree $tree0) &&
	echo We hope it works. >a &&
	git update-index a &&
	tree1=$(git write-tree) &&
	commit1=$(echo modify | git commit-tree $tree1 -p $commit0) &&
	git update-ref refs/heads/master $commit0 &&
	git update-ref refs/heads/tofail $commit1 &&
	git clone --bare ./. victim.git &&
	GIT_DIR=victim.git git update-ref refs/heads/tofail $commit1 &&
	git update-ref refs/heads/master $commit1 &&
	git update-ref refs/heads/tofail $commit0

[master dcd37ff] further-6
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 further-6.t
[master e723c17] further-7
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 further-7.t
Cloning into bare repository 'victim.git'...
[master e3a24bf] further-8
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 further-8.t
done.
[master 50e9bfb] further-9
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 further-9.t
ok 1 - setup

expecting success: 
	test_must_fail git send-pack --force ./victim.git \
		master tofail >send.out 2>send.err

[master c4d446f] further-10
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 further-10.t
ok 11 - setup further non-bitmapped commits

expecting success: 
		git rev-list --count HEAD >expect &&
		git rev-list --use-bitmap-index --count HEAD >actual &&
		test_cmp expect actual
	
ok 12 - counting commits via bitmap (partial bitmap)

expecting success: 
		git rev-list --count HEAD~5..HEAD >expect &&
		git rev-list --use-bitmap-index --count HEAD~5..HEAD >actual &&
		test_cmp expect actual
	
ok 13 - counting partial commits via bitmap (partial bitmap)

expecting success: 
		git rev-list --count other...master >expect &&
		git rev-list --use-bitmap-index --count other...master >actual &&
		test_cmp expect actual
	
ok 2 - push

expecting success: 
	test $(GIT_DIR=victim.git git rev-parse master) = $commit1 &&
	test $(GIT_DIR=victim.git git rev-parse tofail) = $commit1

ok 3 - updated as expected

expecting success: 
	test -f victim.git/pre-receive.args &&
	test -f victim.git/pre-receive.stdin &&
	test -f victim.git/update.args &&
	test -f victim.git/update.stdin &&
	test -f victim.git/post-receive.args &&
	test -f victim.git/post-receive.stdin &&
	test -f victim.git/post-update.args &&
	test -f victim.git/post-update.stdin

ok 14 - counting non-linear history (partial bitmap)

expecting success: 
		git rev-list --count HEAD -- 1.t >expect &&
		git rev-list --use-bitmap-index --count HEAD -- 1.t >actual &&
		test_cmp expect actual
	
ok 4 - hooks ran

expecting success: 
	(echo $commit0 $commit1 refs/heads/master;
	 echo $commit1 $commit0 refs/heads/tofail
	) | test_cmp - victim.git/pre-receive.stdin

ok 5 - pre-receive hook input

expecting success: 
	(echo refs/heads/master $commit0 $commit1;
	 echo refs/heads/tofail $commit1 $commit0
	) | test_cmp - victim.git/update.args

ok 6 - update hook arguments

expecting success: 
	echo $commit0 $commit1 refs/heads/master |
	test_cmp - victim.git/post-receive.stdin

ok 7 - post-receive hook input

expecting success: 
	echo refs/heads/master |
	test_cmp - victim.git/post-update.args

ok 8 - post-update hook arguments

expecting success: 
	! test -s victim.git/update.stdin &&
	! test -s victim.git/post-update.stdin

ok 9 - all hook stdin is /dev/null

expecting success: 
	! test -s victim.git/pre-receive.args &&
	! test -s victim.git/post-receive.args

ok 10 - all *-receive hook args are empty

expecting success: 
	! test -s send.out

ok 15 - counting commits with limiting (partial bitmap)

expecting success: 
		git rev-list --objects --use-bitmap-index HEAD >tmp &&
		cut -d" " -f1 <tmp >tmp2 &&
		sort <tmp2 >actual &&
		git rev-list --objects HEAD >tmp &&
		cut -d" " -f1 <tmp >tmp2 &&
		sort <tmp2 >expect &&
		test_cmp expect actual
	
ok 11 - send-pack produced no output

expecting success: 
	grep ^remote: send.err | sed "s/ *\$//" >actual &&
	test_cmp expect actual

ok 12 - send-pack stderr contains hook messages

expecting success: 
	write_script victim.git/hooks/pre-receive <<-\EOF &&
	exit 0
	EOF
	rm -f victim.git/hooks/update victim.git/hooks/post-update &&

	for v in $(test_seq 100 999)
	do
		git branch branch_$v master || return
	done &&
	git push ./victim.git "+refs/heads/*:refs/heads/*"

ok 16 - enumerate --objects (partial bitmap)

expecting success: 
		git rev-list --objects --use-bitmap-index HEAD tagged-blob >actual &&
		grep $blob actual
	
782f60206c837dcd3d441e106549ad6f58de55b5
ok 17 - bitmap --objects handles non-commit objects (partial bitmap)

expecting success: 
	git --git-dir=clone.git fetch origin master:master &&
	git rev-parse HEAD >expect &&
	git --git-dir=clone.git rev-parse HEAD >actual &&
	test_cmp expect actual

From /«PKGBUILDDIR»/t/trash directory.t5310-pack-bitmaps/.
   537ea4d..c4d446f  master     -> master
 * [new tag]         further-10 -> further-10
 * [new tag]         further-1  -> further-1
 * [new tag]         further-2  -> further-2
 * [new tag]         further-3  -> further-3
 * [new tag]         further-4  -> further-4
 * [new tag]         further-5  -> further-5
 * [new tag]         further-6  -> further-6
 * [new tag]         further-7  -> further-7
 * [new tag]         further-8  -> further-8
 * [new tag]         further-9  -> further-9
ok 18 - fetch (partial bitmap)

expecting success: 
	test_commit more-1 &&
	find .git/objects/pack -name "*.bitmap" >expect &&
	git repack -d &&
	find .git/objects/pack -name "*.bitmap" >actual &&
	test_cmp expect actual

ok 27 - honor pack.packSizeLimit

expecting success: 
	git verify-pack test-10-*.pack

[master 7556d38] more-1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 more-1.t
warning: disabling bitmap writing, as some objects are not being packed
ok 28 - verify resulting packs

expecting success: 
	git config pack.packSizeLimit 1 &&
	packname_11=$(git pack-objects test-11 <obj-list) &&
	test 5 = $(ls test-11-*.pack | wc -l)

warning: minimum pack size limit is 1 MiB
ok 19 - incremental repack cannot create bitmaps

expecting success: 
	test_commit more-2 &&
	git repack -d --no-write-bitmap-index

[master d30f6cf] more-2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 more-2.t
ok 20 - incremental repack can disable bitmaps

expecting success: 
	git repack -ad &&
	ls .git/objects/pack/ | grep bitmap >output &&
	test_line_count = 1 output

ok 21 - full repack, reusing previous bitmaps

expecting success: 
	git --git-dir=clone.git fetch origin master:master &&
	git rev-parse HEAD >expect &&
	git --git-dir=clone.git rev-parse HEAD >actual &&
	test_cmp expect actual

From /«PKGBUILDDIR»/t/trash directory.t5310-pack-bitmaps/.
   c4d446f..d30f6cf  master     -> master
 * [new tag]         more-2     -> more-2
 * [new tag]         more-1     -> more-1
ok 22 - fetch (full bitmap)

expecting success: 
	blob=$(echo "missing have" | git hash-object -w --stdin) &&
	tree=$(printf "100644 blob $blob\tfile\n" | git mktree) &&
	parent=$(echo parent | git commit-tree $tree) &&
	commit=$(echo commit | git commit-tree $tree -p $parent) &&
	cat >revs <<-EOF
	HEAD
	^HEAD^
	^$commit
	EOF

ok 23 - create objects for missing-HAVE tests

expecting success: 
	rm $(objpath $blob) &&
	git pack-objects --stdout --revs <revs >/dev/null

ok 24 - pack with missing blob

expecting success: 
	rm $(objpath $tree) &&
	git pack-objects --stdout --revs <revs >/dev/null

ok 25 - pack with missing tree

expecting success: 
	rm $(objpath $parent) &&
	git pack-objects --stdout --revs <revs >/dev/null

ok 26 - pack with missing parent

checking prerequisite: JGIT

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	type jgit

)
jgit: not found
prerequisite JGIT not satisfied
skipping test: we can read jgit bitmaps 
	git clone . compat-jgit &&
	(
		cd compat-jgit &&
		rm -f .git/objects/pack/*.bitmap &&
		jgit gc &&
		git rev-list --test-bitmap HEAD
	)

ok 27 # skip we can read jgit bitmaps (missing JGIT)

skipping test: jgit can read our bitmaps 
	git clone . compat-us &&
	(
		cd compat-us &&
		git repack -adb &&
		# jgit gc will barf if it does not like our bitmaps
		jgit gc
	)

ok 28 # skip jgit can read our bitmaps (missing JGIT)

expecting success: 
	test-genrandom foo $((1024 * 1024)) >rand &&
	git add rand &&
	git commit -m "commit with big file" &&
	git -c pack.packSizeLimit=500k repack -adb &&
	git init --bare no-bitmaps.git &&
	git -C no-bitmaps.git fetch .. HEAD

[master 28af59d] commit with big file
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 rand
warning: minimum pack size limit is 1 MiB
Cloning into 'victim'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5310-pack-bitmaps/no-bitmaps.git/
done.
commit fbc850672173770f17d48f9f2dfcb286d30b70cb
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:18:13 2005 -0700

    Commit #65

commit 940af75942cf34a9fc156d9dc79c8c370e4c3247
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:17:13 2005 -0700

    Commit #64

commit 1fe3a3ebbeaddd1e503ee516a5433a8ebe097112
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:16:13 2005 -0700

    Commit #63

commit 0c78ec36deec72f8c6d458db5b753249a5447dec
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:15:13 2005 -0700

    Commit #62

commit 0ad1da14d02ef96f2c1cb8403952ffddeaaca439
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:14:13 2005 -0700

    Commit #61

commit 15278e4b9b51ca8e00785fff5592d9ba7b8012ea
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:13:13 2005 -0700

    Commit #60

commit d92539d97407cae3ac62cdd1992188ce96a04699
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:12:13 2005 -0700

    Commit #59

commit eeddc69755cde0046432203191b431846124c36d
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:11:13 2005 -0700

    Commit #58

commit 9481eb1cebd4e35080a85eaac0a389e436d174d9
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:10:13 2005 -0700

    Commit #57

commit 9ab7d0c3f85908c1624cc58f67c236b2e5d53c5d
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:09:13 2005 -0700

    Commit #56

commit 070f3c8d7d43c5b9df69498416664b994a36a3e7
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:08:13 2005 -0700

    Commit #55

commit a2f3e1ffc14adb111494e37e857de5428da7230e
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:07:13 2005 -0700

    Commit #54

commit 373ca332c114a8af8262474c0b750133d11c3467
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:06:13 2005 -0700

    Commit #53

commit abddf6c6693561aed51ed7308754360720399450
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:05:13 2005 -0700

    Commit #52

commit e9dc99c35123a1d9dd416eb32975f518f7e52776
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:04:13 2005 -0700

    Commit #51

commit 3efc54f7bd18addc186e565f051c1f57ae499205
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:03:13 2005 -0700

    Commit #50

commit 288f90defdf9f8fe6cafb95c4a53d41e3d2914bc
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:02:13 2005 -0700

    Commit #49

commit 1dfae6503af0ff1c353be39162beb34744556d2d
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:01:13 2005 -0700

    Commit #48

commit c21493faada856b0f2ac0b85de568ffd9f21ad09
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:00:13 2005 -0700

    Commit #47

commit 0e48e7bf42f7c84d1039794461501f4d3e6bef59
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:59:13 2005 -0700

    Commit #46

commit bb0ff093c62b37247e4b570e41e57fa123962ee8
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:58:13 2005 -0700

    Commit #45

commit a2d17f74bfdf7acc0c40e3b228d57a4d68a9c01b
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:57:13 2005 -0700

    Commit #44

commit cbac9fdcb0113800bc9ff62d8c1a0cfd61815b11
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:56:13 2005 -0700

    Commit #43

commit 13eff776535a4d90e14a5ba1239e3bb094fce3ef
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:55:13 2005 -0700

    Commit #42

commit b7592bd14654cc3f437db49791a176d29d3aa8f0
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:54:13 2005 -0700

    Commit #41

commit 83b8bfc7c90441063b251721278b7e8f9c5a201a
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:53:13 2005 -0700

    Commit #40

commit 0b9d55bbcb1a6033be38cb93b03d75e5a78f9c3f
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:52:13 2005 -0700

    Commit #39

commit d453237bfb3140a104f4c3946b562e8b8e9cda13
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:51:13 2005 -0700

    Commit #38

commit 63c4e0264b89e227660dc2fbd7fc8077627ab28e
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:50:13 2005 -0700

    Commit #37

commit 5df897dfd4814feea01849f65e8fc3e81d72728f
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:49:13 2005 -0700

    Commit #36

commit 5e2d0ff7bcf7c8973b325689dd3604bd01d6b075
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:48:13 2005 -0700

    Commit #35

commit cbf881eb049d21325ff0fba1e98746e36f1d46a8
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:47:13 2005 -0700

    Commit #34

commit b8a9eb0e7c8cff2ab2d65d53f5a568dc7b54d5b0
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:46:13 2005 -0700

    Commit #33

commit 20db8c933b4ca134652d077a7a59a12f7653c3a4
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:45:13 2005 -0700

    Commit #32

commit 738136f07b8bf1cff560dc0dbf4a18eee3b1de94
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:44:13 2005 -0700

    Commit #31

commit dd3f1b3396477b30b131d10831090cd58add8a2f
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:43:13 2005 -0700

    Commit #30

commit e7bbe70cb14feebd4d4ceada22d700e1bdcb301f
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:42:13 2005 -0700

    Commit #29

commit 7c932743e94bd2239c435bf5645dccb051f3c5fe
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:41:13 2005 -0700

    Commit #28

commit c3cca0936c775de13190616bf109b3992732f2e1
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:40:13 2005 -0700

    Commit #27

commit 2eb3c6ccb3b91269a09de0d742aecfd52817f72f
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:39:13 2005 -0700

    Commit #26

commit 0f219719c1472626b844e140343f904fa4972bcc
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:38:13 2005 -0700

    Commit #25

commit 03c8ac629a12338cc02e81b17da6d7cb0e1a802b
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:37:13 2005 -0700

    Commit #24

commit 99b081ae6f13358b2cff7faad1b3f2a4c347edad
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:36:13 2005 -0700

    Commit #23

commit 7206ff76323748a074c19dacc097d2ed3b96bfb2
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:35:13 2005 -0700

    Commit #22

commit 490ddb36dddfeffa7779829333c151cbbe9e7366
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:34:13 2005 -0700

    Commit #21

commit a73206b2f61cdf7bf21c8138c9900794f0eab9a5
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:33:13 2005 -0700

    Commit #20

commit 01e16b5ab9e14247c98de5452a4be588930371be
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:32:13 2005 -0700

    Commit #19

commit 9c803e03a40e955e599e8ecb9131651832083f57
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:31:13 2005 -0700

    Commit #18

commit 6fc6ec72c6ce78e654a775f4f659411294f1d4e6
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:30:13 2005 -0700

    Commit #17

commit b601a967eeee6cb91b552c6e43b4bafdf2b1c7ac
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:29:13 2005 -0700

    Commit #16

commit 1747235a5c3fa673cab96b05b46dd97adb0c00c8
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:28:13 2005 -0700

    Commit #15

commit 26bc6342db340ab762645b0b3b83517623b4c675
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:27:13 2005 -0700

    Commit #14

commit b2f646eca1878e3000b6ceabd81b60ce604cb41e
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:26:13 2005 -0700

    Commit #13

commit be3e57a8ad8950e367abdb48fe904d3f965e96fa
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:25:13 2005 -0700

    Commit #12

commit 838c59d0f1f2160aa980e1c58db52403effc9dc6
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:24:13 2005 -0700

    Commit #11

commit 2d04f66a08825b9bd9631a379768ee94d9e35c94
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:23:13 2005 -0700

    Commit #10

commit 3b4907bf685c7f5694fd51989e990218a5844ee6
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:22:13 2005 -0700

    Commit #9

commit e87f17a34ce327a5cef1309626784bc0bcc74743
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:21:13 2005 -0700

    Commit #8

commit b1248b7697c5ba5bd2099f38eee5728f05a07a2c
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:20:13 2005 -0700

    Commit #7

commit a69e0e75ae4b3c7d5954f52f3dc1666d7facf114
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:19:13 2005 -0700

    Commit #6

commit d2559a7d1598c17fb8259ed9c923a40f242edbd7
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:18:13 2005 -0700

    Commit #5

commit c45f8a131dd92e17228868c96e1b0b0b07693331
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:17:13 2005 -0700

    Commit #4

commit 758f634f1b1a066097ec1ee3c9a4aedc0bfb3d46
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:16:13 2005 -0700

    Commit #3

commit 2285e440694323e1c325d1838d97abdecada8ade
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:15:13 2005 -0700

    Commit #2

commit b86cdba23d2682dd459133f2efac8ea660f1dd5b
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:14:13 2005 -0700

    Commit #1

commit e8d9fe63116478156180f7026f6c181cc60432c5
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:13:13 2005 -0700

    Commit #0
From ..
 * branch            HEAD       -> FETCH_HEAD
ok 29 - splitting packs does not generate bogus bitmaps

# passed all 29 test(s)
1..29
*** t5402-post-merge-hook.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5402-post-merge-hook/.git/
expecting success: 
	echo Data for commit0. >a &&
	git update-index --add a &&
	tree0=$(git write-tree) &&
	commit0=$(echo setup | git commit-tree $tree0) &&
	echo Changed data for commit1. >a &&
	git update-index a &&
	tree1=$(git write-tree) &&
	commit1=$(echo modify | git commit-tree $tree1 -p $commit0) &&
        git update-ref refs/heads/master $commit0 &&
	git clone ./. clone1 &&
	GIT_DIR=clone1/.git git update-index --add a &&
	git clone ./. clone2 &&
	GIT_DIR=clone2/.git git update-index --add a

Cloning into 'clone1'...
done.
Cloning into 'clone2'...
done.
ok 1 - setup

expecting success: 
        GIT_DIR=clone1/.git git merge $commit0 &&
	! test -f clone1/.git/post-merge.args

Already up-to-date.
ok 2 - post-merge does not run for up-to-date 

expecting success: 
        GIT_DIR=clone1/.git git merge $commit1 &&
	test -e clone1/.git/post-merge.args

Updating 9e03542..cd04607
Fast-forward
 a | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 3 - post-merge runs as expected 

expecting success: 
        grep 0 clone1/.git/post-merge.args

0
ok 4 - post-merge from normal merge receives the right argument 

expecting success: 
        GIT_DIR=clone2/.git git merge --squash $commit1 &&
	test -e clone2/.git/post-merge.args

Updating 9e03542..cd04607
Fast-forward
Squash commit -- not updating HEAD
 a | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 5 - post-merge from squash merge runs as expected 

expecting success: 
        grep 1 clone2/.git/post-merge.args

1
ok 6 - post-merge from squash merge receives the right argument 

# passed all 6 test(s)
1..6
ok 29 - tolerate packsizelimit smaller than biggest object

expecting success: 
	git verify-pack test-11-*.pack

*** t5403-post-checkout-hook.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5403-post-checkout-hook/.git/
expecting success: 
	echo Data for commit0. >a &&
	echo Data for commit0. >b &&
	git update-index --add a &&
	git update-index --add b &&
	tree0=$(git write-tree) &&
	commit0=$(echo setup | git commit-tree $tree0) &&
	git update-ref refs/heads/master $commit0 &&
	git clone ./. clone1 &&
	git clone ./. clone2 &&
	GIT_DIR=clone2/.git git branch new2 &&
	echo Data for commit1. >clone2/b &&
	GIT_DIR=clone2/.git git add clone2/b &&
	GIT_DIR=clone2/.git git commit -m new2

Cloning into 'clone1'...
done.
Cloning into 'clone2'...
done.
ok 30 - verify resulting packs

expecting success: test -f	.git/objects/c8/2de19312b6c3695c0c18f70709a6c535682a67 &&
     cp -f	.git/objects/9d/235ed07cd19811a6ceb342de82f190e49c9f68 \
		.git/objects/c8/2de19312b6c3695c0c18f70709a6c535682a67
ok 31 - fake a SHA1 hash collision

expecting success: test_must_fail git index-pack -o bad.idx test-3.pack 2>msg &&
     test_i18ngrep "SHA1 COLLISION FOUND" msg
[master 9da5370] new2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 clone2/b
ok 1 - setup

expecting success: 
	GIT_DIR=clone1/.git git checkout master &&
	test -e clone1/.git/post-checkout.args

Already on 'master'
Your branch is up-to-date with 'origin/master'.
ok 2 - post-checkout runs as expected 

expecting success: 
	old=$(awk "{print \$1}" clone1/.git/post-checkout.args) &&
	new=$(awk "{print \$2}" clone1/.git/post-checkout.args) &&
	flag=$(awk "{print \$3}" clone1/.git/post-checkout.args) &&
	test $old = $new && test $flag = 1

ok 3 - post-checkout receives the right arguments with HEAD unchanged 

expecting success: 
	GIT_DIR=clone1/.git git checkout master &&
	test -e clone1/.git/post-checkout.args

Already on 'master'
Your branch is up-to-date with 'origin/master'.
ok 4 - post-checkout runs as expected 

expecting success: 
	GIT_DIR=clone1/.git git checkout -b new1 &&
	old=$(awk "{print \$1}" clone1/.git/post-checkout.args) &&
	new=$(awk "{print \$2}" clone1/.git/post-checkout.args) &&
	flag=$(awk "{print \$3}" clone1/.git/post-checkout.args) &&
	test $old = $new && test $flag = 1

Switched to a new branch 'new1'
fatal: SHA1 COLLISION FOUND WITH c82de19312b6c3695c0c18f70709a6c535682a67 !
ok 32 - make sure index-pack detects the SHA1 collision

expecting success: test_must_fail git -c core.bigfilethreshold=1 index-pack -o bad.idx test-3.pack 2>msg &&
     test_i18ngrep "SHA1 COLLISION FOUND" msg
ok 5 - post-checkout args are correct with git checkout -b 

expecting success: 
	GIT_DIR=clone2/.git git checkout new2 &&
	old=$(awk "{print \$1}" clone2/.git/post-checkout.args) &&
	new=$(awk "{print \$2}" clone2/.git/post-checkout.args) &&
	flag=$(awk "{print \$3}" clone2/.git/post-checkout.args) &&
	test $old != $new && test $flag = 1

Switched to branch 'new2'
ok 6 - post-checkout receives the right args with HEAD changed 

expecting success: 
	GIT_DIR=clone2/.git git checkout master b &&
	old=$(awk "{print \$1}" clone2/.git/post-checkout.args) &&
	new=$(awk "{print \$2}" clone2/.git/post-checkout.args) &&
	flag=$(awk "{print \$3}" clone2/.git/post-checkout.args) &&
	test $old = $new && test $flag = 0

ok 7 - post-checkout receives the right args when not switching branches 

expecting success: 
	git clone --template=templates . clone3 &&
	test -f clone3/.git/post-checkout.args

Cloning into 'clone3'...
done.
ok 8 - post-checkout hook is triggered by clone

# passed all 8 test(s)
1..8
fatal: SHA1 COLLISION FOUND WITH c82de19312b6c3695c0c18f70709a6c535682a67 !
ok 33 - make sure index-pack detects the SHA1 collision (large blobs)

# passed all 33 test(s)
1..33
*** t5404-tracking-branches.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5404-tracking-branches/.git/
expecting success: 
	echo 1 >file &&
	git add file &&
	git commit -m 1 &&
	git branch b1 &&
	git branch b2 &&
	git branch b3 &&
	git clone . aa &&
	git checkout b1 &&
	echo b1 >>file &&
	git commit -a -m b1 &&
	git checkout b2 &&
	echo b2 >>file &&
	git commit -a -m b2

[master (root-commit) a9e69ba] 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
Cloning into 'aa'...
done.
Switched to branch 'b1'
*** t5405-send-pack-rewind.sh ***
[b1 580254c] b1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Switched to branch 'b2'
[b2 68c0b45] b2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 1 - setup

expecting success: 
	cd aa &&
	b1=$(git rev-parse origin/b1) &&
	b2=$(git rev-parse origin/b2) &&
	git checkout -b b1 origin/b1 &&
	echo aa-b1 >>file &&
	git commit -a -m aa-b1 &&
	git checkout -b b2 origin/b2 &&
	echo aa-b2 >>file &&
	git commit -a -m aa-b2 &&
	git checkout master &&
	echo aa-master >>file &&
	git commit -a -m aa-master

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5405-send-pack-rewind/.git/
expecting success: 

	>file1 && git add file1 && test_tick &&
	git commit -m Initial &&
	git config receive.denyCurrentBranch warn &&

	mkdir another && (
		cd another &&
		git init &&
		git fetch --update-head-ok .. master:master
	) &&

	>file2 && git add file2 && test_tick &&
	git commit -m Second


Switched to a new branch 'b1'
Branch b1 set up to track remote branch b1 from origin.
[master (root-commit) de5945f] Initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file1
[b1 e7d364f] aa-b1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Switched to a new branch 'b2'
Branch b2 set up to track remote branch b2 from origin.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5405-send-pack-rewind/another/.git/
[b2 3d4b02d] aa-b2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
[master 0e430b5] aa-master
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 2 - prepare pushable branches

expecting success: 
	test_must_fail git push origin :

From ..
 * [new branch]      master     -> master
[master 3dc47c1] Second
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file2
ok 1 - setup

expecting success: 

	(
		cd another &&
		git push .. master:master
		test $? = 1
	)


To ..
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to '..'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
To /«PKGBUILDDIR»/t/trash directory.t5404-tracking-branches/.
   a9e69ba..0e430b5  master -> master
 ! [rejected]        b1 -> b1 (fetch first)
 ! [rejected]        b2 -> b2 (fetch first)
error: failed to push some refs to '/«PKGBUILDDIR»/t/trash directory.t5404-tracking-branches/.'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
ok 3 - mixed-success push returns error

expecting success: 
	test "$(git rev-parse origin/master)" = "$(git rev-parse master)"

ok 2 - non forced push should die not segfault

expecting success: 

	(
		cd another &&
		git push .. +master:master
	)


ok 4 - check tracking branches updated correctly after push

expecting success: 
	test "$(git rev-parse origin/b1)" = "$b1" &&
	test "$(git rev-parse origin/b2)" = "$b2"

ok 5 - check tracking branches not updated for failed refs

expecting success: 
	git push origin :b1 &&
	test "$(git rev-parse origin/b1)" = "origin/b1"

remote: warning: updating the current branch        
To ..
 + 3dc47c1...de5945f master -> master (forced update)
ok 3 - forced push should succeed

# passed all 3 test(s)
1..3
To /«PKGBUILDDIR»/t/trash directory.t5404-tracking-branches/.
 - [deleted]         b1
fatal: ambiguous argument 'origin/b1': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
ok 6 - deleted branches have their tracking branches removed

expecting success: 
	git branch -d -r origin/b3 &&
	git push origin :b3 >output 2>&1 &&
	! grep error output

Deleted remote-tracking branch origin/b3 (was a9e69ba).
*** t5406-remote-rejects.sh ***
ok 7 - already deleted tracking branches ignored

# passed all 7 test(s)
1..7
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5406-remote-rejects/.git/
expecting success: 
	mkdir .git/hooks &&
	(echo "#!/bin/sh" ; echo "exit 1") >.git/hooks/update &&
	chmod +x .git/hooks/update &&
	echo 1 >file &&
	git add file &&
	git commit -m 1 &&
	git clone . child &&
	cd child &&
	echo 2 >file &&
	git commit -a -m 2

*** t5407-post-rewrite-hook.sh ***
[master (root-commit) b5b4f68] 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
Cloning into 'child'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5407-post-rewrite-hook/.git/
done.
expecting success: 
	test_commit A foo A &&
	test_commit B foo B &&
	test_commit C foo C &&
	test_commit D foo D &&
	git checkout A^0 &&
	test_commit E bar E &&
	test_commit F foo F &&
	git checkout master

[master fee1dc6] 2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - setup

expecting success: test_must_fail git push 2>stderr
[master (root-commit) be6e19b] A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
[master df02547] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 2 - push reports error

expecting success: grep rejected stderr
 ! [remote rejected] master -> master (branch is currently checked out)
ok 3 - individual ref reports error

# passed all 3 test(s)
1..3
[master 2362ae8] C
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
*** t5408-send-pack-stdin.sh ***
[master babc8a4] D
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Note: checking out 'A^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 be6e19b... A
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5408-send-pack-stdin/.git/
[detached HEAD 5baa167] E
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bar
expecting success: 
	cat >refs <<-\EOF &&
	refs/heads/A
	refs/heads/C
	refs/tags/D
	refs/heads/B
	refs/tags/E
	EOF
	for i in $(cat refs); do
		create_ref $i || return 1
	done

[detached HEAD 38c24e8] F
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Previous HEAD position was 38c24e8... F
Switched to branch 'master'
ok 1 - setup

expecting success: 
	clear_hook_input &&
	echo "D new message" > newmsg &&
	oldsha=$(git rev-parse HEAD^0) &&
	git commit -Fnewmsg --amend &&
	echo amend > expected.args &&
	echo $oldsha $(git rev-parse HEAD^0) > expected.data &&
	verify_hook_input

[master 1333da2] D new message
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 2 - git commit --amend

expecting success: 
	clear_hook_input &&
	echo "D new message again" > newmsg &&
	git commit --no-post-rewrite -Fnewmsg --amend &&
	test ! -f post-rewrite.args &&
	test ! -f post-rewrite.data

[master 18a65a5] D new message again
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 3 - git commit --amend --no-post-rewrite

expecting success: 
	git reset --hard D &&
	clear_hook_input &&
	test_must_fail git rebase --onto A B &&
	echo C > foo &&
	git add foo &&
	git rebase --continue &&
	echo rebase >expected.args &&
	cat >expected.data <<-EOF &&
	$(git rev-parse C) $(git rev-parse HEAD^)
	$(git rev-parse D) $(git rev-parse HEAD)
	EOF
	verify_hook_input

ok 1 - setup refs

expecting success: 
	clear_remote &&
	git send-pack remote.git $(cat refs) &&
	for i in $(cat refs); do
		verify_push $i || return 1
	done

HEAD is now at babc8a4 D
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5408-send-pack-stdin/remote.git/
To remote.git
 * [new branch]      A -> A
 * [new branch]      C -> C
 * [new tag]         D -> D
 * [new branch]      B -> B
 * [new tag]         E -> E
First, rewinding head to replay your work on top of it...
ok 2 - refs on cmdline

Applying: C
expecting success: 
	clear_remote &&
	git send-pack remote.git --stdin <refs &&
	for i in $(cat refs); do
		verify_push $i || return 1
	done

Using index info to reconstruct a base tree...
M	foo
Falling back to patching base and 3-way merge...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5408-send-pack-stdin/remote.git/
Merging be6e19bca87a618a48e2a81ed7e00c90b5091b9e with C
Merging:
be6e19b A
virtual C
found 1 common ancestor:
virtual e6a635ee70776f6585de405639ebebd74da5c390
Auto-merging foo
CONFLICT (content): Merge conflict in foo
error: Failed to merge in the changes.
Patch failed at 0001 C
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

To remote.git
 * [new branch]      A -> A
 * [new branch]      C -> C
 * [new tag]         D -> D
 * [new branch]      B -> B
 * [new tag]         E -> E
Applying: C
Applying: D
ok 3 - refs over stdin

expecting success: 
	clear_remote &&
	echo "A:other" >input &&
	git send-pack remote.git --stdin <input &&
	verify_push refs/heads/A refs/heads/other

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5408-send-pack-stdin/remote.git/
ok 4 - git rebase

expecting success: 
	git reset --hard D &&
	clear_hook_input &&
	test_must_fail git rebase --onto A B &&
	test_must_fail git rebase --skip &&
	echo D > foo &&
	git add foo &&
	git rebase --continue &&
	echo rebase >expected.args &&
	cat >expected.data <<-EOF &&
	$(git rev-parse D) $(git rev-parse HEAD)
	EOF
	verify_hook_input

To remote.git
 * [new branch]      A -> other
HEAD is now at babc8a4 D
ok 4 - stdin lines are full refspecs

expecting success: 
	clear_remote &&
	echo A >input &&
	git send-pack remote.git --stdin B <input &&
	verify_push A &&
	verify_push B

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5408-send-pack-stdin/remote.git/
To remote.git
 * [new branch]      B -> B
 * [new branch]      A -> A
Rebase
ok 5 - stdin mixed with cmdline

expecting success: 
	clear_remote &&
	test_must_fail git send-pack remote.git A:foo B:foo &&
	verify_push A foo

First, rewinding head to replay your work on top of it...
commit b1a1c97e94b6388c108e195d28a3e89f00c81698
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 17:23:13 2005 -0700

    Rebase #65

commit b1a473533f3c7654e6aabe20b868f403cc4542c4
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 17:22:13 2005 -0700

    Rebase #64

commit b44d0fc2fa543aae48a3e88ca2d4bb69b0808618
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 17:21:13 2005 -0700

    Rebase #63

commit bdb72969f88d60418acc3c5cb69f94a9254e4069
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 17:20:13 2005 -0700

    Rebase #62

commit f4846c914d90426d0aa7d9ae8c617e23aeb7aadc
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 17:19:13 2005 -0700

    Rebase #61

commit 5513d6a596bf3937f715bf4c4fa240dae08c1183
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 17:18:13 2005 -0700

    Rebase #60

commit c17d7284cf4910e76deb07380fdb38db71d239c7
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 17:17:13 2005 -0700

    Rebase #59

commit 61c422e7618c96824dffec2cbb0cc7ec1933e48e
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 17:16:13 2005 -0700

    Rebase #58

commit 2d32b535df82e1d77ee22da27287e3a676723ef8
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 17:15:13 2005 -0700

    Rebase #57

commit d8638fd41e1699aa201527ace01d2ba19815aceb
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 17:14:13 2005 -0700

    Rebase #56

commit 04fe055c82dc9923f2be842c62ddf3325ed7e4c3
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 17:13:13 2005 -0700

    Rebase #55

commit 8b3228b708d50b5e797bb375d97082ec7afeace4
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 17:12:13 2005 -0700

    Rebase #54

commit 5f4c3fe8ed7e4d32b60d7abb0e2af50d1343cca0
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 17:11:13 2005 -0700

    Rebase #53

commit 7f88d5e9d36769f5c9c65bcdd6b74456be65794b
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 17:10:13 2005 -0700

    Rebase #52

commit 54fa0318009bc334ce8aa9a83e559582a15df921
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 17:09:13 2005 -0700

    Rebase #51

commit 874533e6395fa245e3aad590c5b29b113c993d88
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 17:08:13 2005 -0700

    Rebase #50

commit dc1211213cf96c29abb9e65856f42adb8ae87f44
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 17:07:13 2005 -0700

    Rebase #49

commit ecc16305000cbf7e0e28eaefa037380923f54f2b
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 17:06:13 2005 -0700

    Rebase #48

commit 22eb8b0dd79fa78df505878adb615b382c819795
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 17:05:13 2005 -0700

    Rebase #47

commit e658f744975d593f1d768ae6a252466f3d6f542e
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 17:04:13 2005 -0700

    Rebase #46

commit 927e9cfe3212295919b60727098c2bcba986c37e
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 17:03:13 2005 -0700

    Rebase #45

commit 8c6450200d3f0d8d334e87e0d8a8277a2f791251
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 17:02:13 2005 -0700

    Rebase #44

commit 63e19d3641a395e0933a71af193c8dab5ddf587a
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 17:01:13 2005 -0700

    Rebase #43

commit dea9ca7996241bf8d256a6207334ab6cb0a2f16d
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 17:00:13 2005 -0700

    Rebase #42

commit 026648f873caf2683546bb4a0bffc8293d8c2a73
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:59:13 2005 -0700

    Rebase #41

commit 614287fbf62149f243db150a29195ddd2552620e
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:58:13 2005 -0700

    Rebase #40

commit 796c2f217a5f8738534fbb7febc3879590747fc2
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:57:13 2005 -0700

    Rebase #39

commit 5aaad3995be7c0de7d694ab11b764a400a4df57f
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:56:13 2005 -0700

    Rebase #38

commit 313b77b49a4baf7c7fe8055753a71c38bdd38b47
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:55:13 2005 -0700

    Rebase #37

commit a59332167314137eb8af8837e16115c9680e018e
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:54:13 2005 -0700

    Rebase #36

commit 0ab0d27b1668006e073534c69e62685f0f9fc4ab
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:53:13 2005 -0700

    Rebase #35

commit 43f966630635e7421592b1564d06becd4329fb7f
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:52:13 2005 -0700

    Rebase #34

commit fe710d4f0305ee6cfcc29f08823ccc6a8eb2e78a
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:51:13 2005 -0700

    Rebase #33

commit 58465df8a64cc8cf28c98afc18e920e03dad9ec8
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:50:13 2005 -0700

    Rebase #32

commit 559f5ec230a71724d6ea3399c0216e52938cba74
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:49:13 2005 -0700

    Rebase #31

commit 423868ae9fccf8a50212b69677d9fe252065eb3b
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:48:13 2005 -0700

    Rebase #30

commit d02b87bdc1b8e96ed634d52ddefb6b7db693b84b
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:47:13 2005 -0700

    Rebase #29

commit 04e55758ac35dc63f899b6c3d526b2b802cee7c9
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:46:13 2005 -0700

    Rebase #28

commit be5fbd2f45796936f2cfa86bb4dffe5b95013f0e
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:45:13 2005 -0700

    Rebase #27

commit 213212c4ff3f0e681db0e061ed02dcc2e3902374
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:44:13 2005 -0700

    Rebase #26

commit 61a890331f2ecf786d50fa8248d4f86345569421
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:43:13 2005 -0700

    Rebase #25

commit a1bfffeeeb67da7d9433dd5d4dcc2876badda7de
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:42:13 2005 -0700

    Rebase #24

commit ade5cf07bd9f8a623762be2b83d5200fd4c23e78
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:41:13 2005 -0700

    Rebase #23

commit 541aba44d5797d319874b1d242c491aecd70072e
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:40:13 2005 -0700

    Rebase #22

commit 8ef186d480959ba1c1950497155e9db2bb5cf262
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:39:13 2005 -0700

    Rebase #21

commit dd1cc8a79dd40f7d83223b2b2293062a17ed60ee
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:38:13 2005 -0700

    Rebase #20

commit 60c8d8288c55de0f0dadd7f570f69a5bd9023e54
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:37:13 2005 -0700

    Rebase #19

commit 2720bed4e6e3a6011714b76356527f5626a8b7bf
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:36:13 2005 -0700

    Rebase #18

commit e4946f6736764ebcc7b4392c98b1916f37a8151c
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:35:13 2005 -0700

    Rebase #17

commit f2a50e2577f679dd6edf5afa77fb0d331cf0e487
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:34:13 2005 -0700

    Rebase #16

commit ba62d05c67970ca150478a6e204c07876eb45310
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:33:13 2005 -0700

    Rebase #15

commit 16bbc537388506c6aa3568aec7a1c295ff664ad8
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:32:13 2005 -0700

    Rebase #14

commit 8ae96d45eca9358820adedc310a2bc6ff331a3e7
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:31:13 2005 -0700

    Rebase #13

commit 2557a8c044e16526b8261947e17623841a0d5a91
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:30:13 2005 -0700

    Rebase #12

commit 3f1275e3115a421a76f0ccbd5dea35b7cf227ce9
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:29:13 2005 -0700

    Rebase #11

commit 6d31feb4517418400c8f76a834f7cff206a2b1ab
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:28:13 2005 -0700

    Rebase #10

commit 054728ce53143ed538a80cc1db2f91642848d9d8
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:27:13 2005 -0700

    Rebase #9

commit dbee1ce0dbeb64756fba483e99628287182a0be1
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:26:13 2005 -0700

    Rebase #8

commit d174cc1075a864f5db77014609f7f9af0240ed0c
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:25:13 2005 -0700

    Rebase #7

commit 18b56d78fb5f32acd1d2a027c139cb14df278e1c
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:24:13 2005 -0700

    Rebase #6

commit 754de5100e6921cb300704183c76e1c65e301beb
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:23:13 2005 -0700

    Rebase #5

commit 9fe752390a117faf8d6f239358fa821b464ff14d
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:22:13 2005 -0700

    Rebase #4

commit 3e9bfb9468271e1707c357a5018af569c2a676d4
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:21:13 2005 -0700

    Rebase #3

commit d15adbaa5fdd6b03140db45c714342b2023152fa
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:20:13 2005 -0700

    Rebase #2

commit 82c2bc152fd9f785c269098549562d289347b2f8
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 16:19:13 2005 -0700

    Rebase #1

commit e8d9fe63116478156180f7026f6c181cc60432c5
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:13:13 2005 -0700

    Commit #0
ok 1 - setup

expecting success: 
	git repack -a -d &&
	git prune

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5408-send-pack-stdin/remote.git/
Applying: C
Using index info to reconstruct a base tree...
M	foo
Falling back to patching base and 3-way merge...
remote: error: cannot lock ref 'refs/heads/foo': ref refs/heads/foo is at d6e0d8112399e9b64041ab12f92a23c68ff4c2e6 but expected 0000000000000000000000000000000000000000        
Merging be6e19bca87a618a48e2a81ed7e00c90b5091b9e with C
Merging:
be6e19b A
virtual C
found 1 common ancestor:
virtual e6a635ee70776f6585de405639ebebd74da5c390
Auto-merging foo
CONFLICT (content): Merge conflict in foo
error: Failed to merge in the changes.
Patch failed at 0001 C
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

To remote.git
 * [new branch]      A -> foo
 ! [remote rejected] B -> foo (failed to update ref)
ok 6 - cmdline refs written in order

expecting success: 
	clear_remote &&
	echo A:foo >input &&
	test_must_fail git send-pack remote.git --stdin B:foo <input &&
	verify_push B foo

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5408-send-pack-stdin/remote.git/
remote: error: cannot lock ref 'refs/heads/foo': ref refs/heads/foo is at 136c346ef8e049c9d35160624af06ef40b31c292 but expected 0000000000000000000000000000000000000000        
To remote.git
 * [new branch]      B -> foo
 ! [remote rejected] A -> foo (failed to update ref)
Applying: D
ok 7 - --stdin refs come after cmdline

expecting success: 
	clear_remote &&
	test_must_fail git send-pack remote.git --mirror $(cat refs)

Using index info to reconstruct a base tree...
M	foo
Falling back to patching base and 3-way merge...
Merging be6e19bca87a618a48e2a81ed7e00c90b5091b9e with D
Merging:
be6e19b A
virtual D
found 1 common ancestor:
virtual a0d64960e32dc5d0cf8eff7ded11a413a31c0891
Auto-merging foo
CONFLICT (content): Merge conflict in foo
error: Failed to merge in the changes.
Patch failed at 0002 D
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5408-send-pack-stdin/remote.git/
usage: git send-pack [--all | --mirror] [--dry-run] [--force] [--receive-pack=<git-receive-pack>] [--verbose] [--thin] [--atomic] [<host>:]<directory> [<ref>...]
  --all and explicit <ref> specification are mutually exclusive.

    -v, --verbose         be more verbose
    -q, --quiet           be more quiet
    --receive-pack <receive-pack>
                          receive pack program
    --exec <receive-pack>
                          receive pack program
    --remote <remote>     remote name
    --all                 push all refs
    -n, --dry-run         dry run
    --mirror              mirror all refs
    -f, --force           force updates
    --signed[=<yes|no|if-asked>]
                          GPG sign the push
    --progress            force progress reporting
    --thin                use thin pack
    --atomic              request atomic transaction on remote side
    --stateless-rpc       use stateless RPC protocol
    --stdin               read refs from stdin
    --helper-status       print status from remote helper
    --force-with-lease[=<refname>:<expect>]
                          require old value of ref to be at this value

ok 8 - refspecs and --mirror do not mix (cmdline)

expecting success: 
	clear_remote &&
	test_must_fail git send-pack remote.git --mirror --stdin <refs

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5408-send-pack-stdin/remote.git/
usage: git send-pack [--all | --mirror] [--dry-run] [--force] [--receive-pack=<git-receive-pack>] [--verbose] [--thin] [--atomic] [<host>:]<directory> [<ref>...]
  --all and explicit <ref> specification are mutually exclusive.

    -v, --verbose         be more verbose
    -q, --quiet           be more quiet
    --receive-pack <receive-pack>
                          receive pack program
    --exec <receive-pack>
                          receive pack program
    --remote <remote>     remote name
    --all                 push all refs
    -n, --dry-run         dry run
    --mirror              mirror all refs
    -f, --force           force updates
    --signed[=<yes|no|if-asked>]
                          GPG sign the push
    --progress            force progress reporting
    --thin                use thin pack
    --atomic              request atomic transaction on remote side
    --stateless-rpc       use stateless RPC protocol
    --stdin               read refs from stdin
    --helper-status       print status from remote helper
    --force-with-lease[=<refname>:<expect>]
                          require old value of ref to be at this value

ok 9 - refspecs and --mirror do not mix (stdin)

# passed all 9 test(s)
1..9
*** t5500-fetch-pack.sh ***
Applying: D
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5500-fetch-pack/.git/
expecting success: 
	mkdir client &&
	(
		cd client &&
		git init &&
		git config transfer.unpacklimit 0
	) &&
	add A1 &&
	prev=1 &&
	cur=2 &&
	while [ $cur -le 10 ]; do
		add A$cur $(eval echo \$A$prev) &&
		prev=$cur &&
		cur=$(($cur+1))
	done &&
	add B1 $A1 &&
	echo $ATIP > .git/refs/heads/A &&
	echo $BTIP > .git/refs/heads/B &&
	git symbolic-ref HEAD refs/heads/B

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5500-fetch-pack/client/.git/
ok 5 - git rebase --skip

expecting success: 
	git reset --hard F &&
	clear_hook_input &&
	test_must_fail git rebase --onto D A &&
	git rebase --skip &&
	echo rebase >expected.args &&
	cat >expected.data <<-EOF &&
	$(git rev-parse E) $(git rev-parse HEAD)
	EOF
	verify_hook_input

HEAD is now at 38c24e8 F
First, rewinding head to replay your work on top of it...
Applying: E
Applying: F
Using index info to reconstruct a base tree...
M	foo
Falling back to patching base and 3-way merge...
Merging 726c769f573c335c2ccda973cf3ad5b2991ba937 with F
Merging:
726c769 E
virtual F
found 1 common ancestor:
virtual bdb58bd8ea55127260d069a5e7ee2995726633f9
Auto-merging foo
CONFLICT (content): Merge conflict in foo
error: Failed to merge in the changes.
Patch failed at 0002 F
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

ok 2 - pack the source repository

expecting success: 
    (
	cd victim &&
	git repack -a -d &&
	git prune
    )

ok 6 - git rebase --skip the last one

expecting success: 
	git reset --hard D &&
	clear_hook_input &&
	test_must_fail git rebase -m --onto A B &&
	echo C > foo &&
	git add foo &&
	git rebase --continue &&
	echo rebase >expected.args &&
	cat >expected.data <<-EOF &&
	$(git rev-parse C) $(git rev-parse HEAD^)
	$(git rev-parse D) $(git rev-parse HEAD)
	EOF
	verify_hook_input

ok 1 - setup

expecting success: 
		(
			cd client &&
			git fetch-pack -k -v .. $heads &&

			case "$heads" in
			    *A*)
				    echo $ATIP > .git/refs/heads/A;;
			esac &&
			case "$heads" in *B*)
			    echo $BTIP > .git/refs/heads/B;;
			esac &&
			git symbolic-ref HEAD refs/heads/`echo $heads \
				| sed -e "s/^\(.\).*$/\1/"` &&

			git fsck --full &&

			mv .git/objects/pack/pack-* . &&
			p=`ls -1 pack-*.pack` &&
			git unpack-objects <$p &&
			git fsck --full &&

			idx=`echo pack-*.idx` &&
			pack_count=`git show-index <$idx | wc -l` &&
			test $pack_count = $count &&
			rm -f pack-*
		)
	
HEAD is now at babc8a4 D
Server supports multi_ack_detailed
Server supports side-band-64k
Server supports ofs-delta
Server version is git/2.6.4
want 9980fc7e97f06bbd7341f45d570f0c5eb2a954f1 (refs/heads/A)
want ed6d498dac4948371a8c2a3954eef783312857f5 (refs/heads/B)
done
remote: Counting objects: 33, done.        
remote: Compressing objects:   9% (1/11)           
remote: Compressing objects:  18% (2/11)           
remote: Compressing objects:  27% (3/11)           
remote: Compressing objects:  36% (4/11)           
remote: Compressing objects:  45% (5/11)           
remote: Compressing objects:  54% (6/11)           
remote: Compressing objects:  63% (7/11)           
remote: Compressing objects:  72% (8/11)           
remote: Compressing objects:  81% (9/11)           
remote: Compressing objects:  90% (10/11)           
remote: Compressing objects: 100% (11/11)           
remote: Compressing objects: 100% (11/11), done.        
remote: Total 33 (delta 1), reused 0 (delta 0)        
Receiving objects:   3% (1/33)   
Receiving objects:   6% (2/33)   
Receiving objects:   9% (3/33)   
Receiving objects:  12% (4/33)   
Receiving objects:  15% (5/33)   
Receiving objects:  18% (6/33)   
Receiving objects:  21% (7/33)   
Receiving objects:  24% (8/33)   
Receiving objects:  27% (9/33)   
Receiving objects:  30% (10/33)   
Receiving objects:  33% (11/33)   
Receiving objects:  36% (12/33)   
Receiving objects:  39% (13/33)   
Receiving objects:  42% (14/33)   
Receiving objects:  45% (15/33)   
Receiving objects:  48% (16/33)   
Receiving objects:  51% (17/33)   
Receiving objects:  54% (18/33)   
Receiving objects:  57% (19/33)   
Receiving objects:  60% (20/33)   
Receiving objects:  63% (21/33)   
Receiving objects:  66% (22/33)   
Receiving objects:  69% (23/33)   
Receiving objects:  72% (24/33)   
Receiving objects:  75% (25/33)   
Receiving objects:  78% (26/33)   
Receiving objects:  81% (27/33)   
Receiving objects:  84% (28/33)   
Receiving objects:  87% (29/33)   
Receiving objects:  90% (30/33)   
Receiving objects:  93% (31/33)   
Receiving objects:  96% (32/33)   
Receiving objects: 100% (33/33)   
Receiving objects: 100% (33/33), done.
Resolving deltas:   0% (0/1)   
Resolving deltas: 100% (1/1)   
Resolving deltas: 100% (1/1), done.
pack	3791170b8839b1bcb89a066d52633bc8b213dcdf
9980fc7e97f06bbd7341f45d570f0c5eb2a954f1 refs/heads/A
ed6d498dac4948371a8c2a3954eef783312857f5 refs/heads/B
notice: HEAD points to an unborn branch (r)
First, rewinding head to replay your work on top of it...
Merging A with HEAD~1
Merging:
be6e19b A
2362ae8 C
found 1 common ancestor:
df02547 B
Auto-merging foo
CONFLICT (content): Merge conflict in foo

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

notice: HEAD points to an unborn branch (r)
ok 2 - 1st pull

expecting success: 
	add A11 $A10 &&
	prev=1 &&
	cur=2 &&
	while [ $cur -le 65 ]; do
		add B$cur $(eval echo \$B$prev) &&
		prev=$cur &&
		cur=$(($cur+1))
	done

[detached HEAD bd57595] C
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
Committed: 0001 C
Merging A with HEAD~0
Merging:
bd57595 C
babc8a4 D
found 1 common ancestor:
2362ae8 C
[detached HEAD f7cc6b6] D
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
Committed: 0002 D
ok 3 - pack the destination repository

expecting success: 
	pushed_head=$(git rev-parse --verify master) &&
	victim_orig=$(cd victim && git rev-parse --verify master) &&
	test_must_fail git send-pack ./victim master &&
	victim_head=$(cd victim && git rev-parse --verify master) &&
	test "$victim_head" = "$victim_orig" &&
	# this should update
	git send-pack --force ./victim master &&
	victim_head=$(cd victim && git rev-parse --verify master) &&
	test "$victim_head" = "$pushed_head"

All done.
To ./victim
 ! [rejected]        master -> master (non-fast-forward)
ok 7 - git rebase -m

expecting success: 
	git reset --hard D &&
	clear_hook_input &&
	test_must_fail git rebase --onto A B &&
	test_must_fail git rebase --skip &&
	echo D > foo &&
	git add foo &&
	git rebase --continue &&
	echo rebase >expected.args &&
	cat >expected.data <<-EOF &&
	$(git rev-parse D) $(git rev-parse HEAD)
	EOF
	verify_hook_input

HEAD is now at babc8a4 D
First, rewinding head to replay your work on top of it...
remote: warning: updating the current branch        
To ./victim
 + fbc8506...b1a1c97 master -> master (forced update)
ok 4 - refuse pushing rewound head without --force

expecting success: 
	( cd victim && git branch extra master ) &&
	git send-pack ./victim :extra master &&
	( cd victim &&
	  test_must_fail git rev-parse --verify extra )

Applying: C
Using index info to reconstruct a base tree...
M	foo
Falling back to patching base and 3-way merge...
Merging be6e19bca87a618a48e2a81ed7e00c90b5091b9e with C
Merging:
be6e19b A
virtual C
found 1 common ancestor:
virtual e6a635ee70776f6585de405639ebebd74da5c390
Auto-merging foo
CONFLICT (content): Merge conflict in foo
error: Failed to merge in the changes.
Patch failed at 0001 C
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

To ./victim
 - [deleted]         extra
fatal: Needed a single revision
ok 5 - push can be used to delete a ref

expecting success: 
	(
	    cd victim &&
	    ( git branch -D extra || : ) &&
	    git config receive.denyDeletes true &&
	    git branch extra master
	) &&
	test_must_fail git send-pack ./victim :extra master

error: branch 'extra' not found.
remote: error: denying ref deletion for refs/heads/extra        
To ./victim
 ! [remote rejected] extra (deletion prohibited)
ok 6 - refuse deleting push with denyDeletes

expecting success: 
	(
		cd victim &&
		test_might_fail git branch -D extra &&
		git config receive.denyDeletes true &&
		git branch extra master
	) &&
	test_must_fail git -c receive.denyDeletes=false \
					send-pack ./victim :extra master

Deleted branch extra (was b1a1c97).
Applying: D
Using index info to reconstruct a base tree...
M	foo
Falling back to patching base and 3-way merge...
remote: error: denying ref deletion for refs/heads/extra        
Merging be6e19bca87a618a48e2a81ed7e00c90b5091b9e with D
Merging:
be6e19b A
virtual D
found 1 common ancestor:
virtual a0d64960e32dc5d0cf8eff7ded11a413a31c0891
Auto-merging foo
CONFLICT (content): Merge conflict in foo
error: Failed to merge in the changes.
Patch failed at 0002 D
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

To ./victim
 ! [remote rejected] extra (deletion prohibited)
ok 7 - cannot override denyDeletes with git -c send-pack

expecting success: 
	(
		cd victim &&
		test_might_fail git branch -D extra &&
		git config receive.denyDeletes true &&
		git branch extra master
	) &&
	git send-pack \
		--receive-pack="git -c receive.denyDeletes=false receive-pack" \
		./victim :extra master

Deleted branch extra (was b1a1c97).
To ./victim
 - [deleted]         extra
ok 8 - override denyDeletes with git -c receive-pack

expecting success: 
	(
	    cd victim &&
	    ( git branch -D extra || : ) &&
	    git config receive.denyNonFastforwards true
	) &&
	victim_orig=$(cd victim && git rev-parse --verify master) &&
	test_must_fail git send-pack --force ./victim master^:master &&
	victim_head=$(cd victim && git rev-parse --verify master) &&
	test "$victim_orig" = "$victim_head"

error: branch 'extra' not found.
Applying: D
remote: warning: updating the current branch        
ok 8 - git rebase -m --skip

remote: error: denying non-fast-forward refs/heads/master (you should pull first)        
To ./victim
 ! [remote rejected] master^ -> master (non-fast-forward)
expecting success: 
	git reset --hard D &&
	clear_hook_input &&
	test_fail_interactive_rebase "1 2" --onto A B &&
	echo C > foo &&
	git add foo &&
	git rebase --continue &&
	echo rebase >expected.args &&
	cat >expected.data <<-EOF &&
	$(git rev-parse C) $(git rev-parse HEAD^)
	$(git rev-parse D) $(git rev-parse HEAD)
	EOF
	verify_hook_input

ok 9 - denyNonFastforwards trumps --force

expecting success: 
	mkdir parent &&
	(
	    cd parent &&
	    git init && : >file && git add file && git commit -m add
	) &&
	git clone parent child &&
	(
	    cd child && git push --all
	) &&
	(
	    cd parent &&
	    test -z "$(git for-each-ref refs/remotes/origin)"
	)

HEAD is now at babc8a4 D
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5400-send-pack/parent/.git/
[master (root-commit) 9addffa] add
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file
Cloning into 'child'...
done.
Everything up-to-date
ok 10 - push --all excludes remote-tracking hierarchy

expecting success: 
	rm -rf parent child &&
	git init parent &&
	(
	    # Setup a repo with 2 packs
	    cd parent &&
	    echo "Some text" >file.txt &&
	    git add . &&
	    git commit -m "Initial commit" &&
	    git repack -adl &&
	    echo "Some more text" >>file.txt &&
	    git commit -a -m "Second commit" &&
	    git repack
	) &&
	cp -R parent child &&
	(
	    # Set the child to auto-pack if more than one pack exists
	    cd child &&
	    git config gc.autopacklimit 1 &&
	    git config gc.autodetach false &&
	    git branch test_auto_gc &&
	    # And create a file that follows the temporary object naming
	    # convention for the auto-gc to remove
	    : >.git/objects/tmp_test_object &&
	    test-chmtime =-1209601 .git/objects/tmp_test_object
	) &&
	(
	    cd parent &&
	    echo "Even more text" >>file.txt &&
	    git commit -a -m "Third commit" &&
	    git send-pack ../child HEAD:refs/heads/test_auto_gc
	) &&
	test ! -e child/.git/objects/tmp_test_object

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5400-send-pack/parent/.git/
[master (root-commit) bdeab67] Initial commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file.txt
[master 5404fd0] Second commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
rebase -i script before editing:
pick 2362ae8 C
pick babc8a4 D

rebase -i script after editing:
pick 2362ae8 C
pick babc8a4 D
Rebasing (1/2)
[master 1f665f1] Third commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
error: could not apply 2362ae8... C

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Auto-merging foo
CONFLICT (content): Merge conflict in foo
Could not apply 2362ae8e1b1b865e6161e6f0e165ffb974abf018... C
[detached HEAD bd57595] C
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
To ../child
   5404fd0..1f665f1  HEAD -> test_auto_gc
ok 11 - receive-pack runs auto-gc in remote repo

expecting success: 
	rewound_push_setup &&
	parent_orig=$(cd parent && git rev-parse --verify master) &&
	(
	    cd child &&
	    test_must_fail git send-pack ../parent \
		refs/heads/master:refs/heads/master
	) &&
	parent_head=$(cd parent && git rev-parse --verify master) &&
	test "$parent_orig" = "$parent_head" &&
	(
	    cd child &&
	    git send-pack ../parent \
	        +refs/heads/master:refs/heads/master
	) &&
	parent_head=$(cd parent && git rev-parse --verify master) &&
	child_head=$(cd child && git rev-parse --verify master) &&
	test "$parent_head" = "$child_head"

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5400-send-pack/parent/.git/
Rebasing (2/2)
[master (root-commit) 14eeca9] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
[master 43ab524] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'child'...
done.
HEAD is now at 14eeca9 one
Successfully rebased and updated refs/heads/master.
To ../parent
 ! [rejected]        master -> master (non-fast-forward)
ok 9 - git rebase -i (unchanged)

expecting success: 
	git reset --hard D &&
	clear_hook_input &&
	test_fail_interactive_rebase "2" --onto A B &&
	echo D > foo &&
	git add foo &&
	git rebase --continue &&
	echo rebase >expected.args &&
	cat >expected.data <<-EOF &&
	$(git rev-parse D) $(git rev-parse HEAD)
	EOF
	verify_hook_input

remote: warning: updating the current branch        
To ../parent
 + 43ab524...14eeca9 master -> master (forced update)
HEAD is now at babc8a4 D
ok 12 - pushing explicit refspecs respects forcing

expecting success: 
	rewound_push_setup &&
	parent_orig=$(cd parent && git rev-parse --verify master) &&
	(
	    cd child &&
	    test_must_fail git send-pack ../parent \
	        "refs/heads/*:refs/heads/*"
	) &&
	parent_head=$(cd parent && git rev-parse --verify master) &&
	test "$parent_orig" = "$parent_head" &&
	(
	    cd child &&
	    git send-pack ../parent \
	        "+refs/heads/*:refs/heads/*"
	) &&
	parent_head=$(cd parent && git rev-parse --verify master) &&
	child_head=$(cd child && git rev-parse --verify master) &&
	test "$parent_head" = "$child_head"

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5400-send-pack/parent/.git/
[master (root-commit) 14eeca9] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
[master 43ab524] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'child'...
done.
HEAD is now at 14eeca9 one
To ../parent
 ! [rejected]        master -> master (non-fast-forward)
remote: warning: updating the current branch        
To ../parent
 + 43ab524...14eeca9 master -> master (forced update)
ok 13 - pushing wildcard refspecs respects forcing

expecting success: 
	rewound_push_setup &&
	(
	    cd child &&
	    test_must_fail git send-pack ../parent :refs/heads/master 2>errs
	)

rebase -i script before editing:
pick 2362ae8 C
pick babc8a4 D

rebase -i script after editing:
pick babc8a4 D
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5400-send-pack/parent/.git/
[master (root-commit) 14eeca9] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
[master 43ab524] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'child'...
done.
Rebasing (1/1)
HEAD is now at 14eeca9 one
error: could not apply babc8a4... D

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Auto-merging foo
CONFLICT (content): Merge conflict in foo
ok 14 - deny pushing to delete current branch

# passed all 14 test(s)
1..14
Could not apply babc8a4c7470895886fc129f1a015c486d05a351... D
*** t5501-fetch-push-alternates.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5501-fetch-push-alternates/.git/
expecting success: 
	(
		git init original &&
		cd original &&
		i=0 &&
		while test $i -le 100
		do
			echo "$i" >count &&
			git add count &&
			git commit -m "$i" || exit
			i=$(($i + 1))
		done
	) &&
	(
		git clone --reference=original "file://$(pwd)/original" one &&
		cd one &&
		echo Z >count &&
		git add count &&
		git commit -m Z &&
		count_objects >../one.count
	) &&
	A=$(pwd)/original/.git/objects &&
	git init receiver &&
	echo "$A" >receiver/.git/objects/info/alternates &&
	git init fetcher &&
	echo "$A" >fetcher/.git/objects/info/alternates

[detached HEAD a087d55] D
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5501-fetch-push-alternates/original/.git/
[master (root-commit) 8f75046] 0
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 count
[master d99f507] 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Rebasing (1/1)
[master f957874] 2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 3 - post 1st pull setup

expecting success: 
		(
			cd client &&
			git fetch-pack -k -v .. $heads &&

			case "$heads" in
			    *A*)
				    echo $ATIP > .git/refs/heads/A;;
			esac &&
			case "$heads" in *B*)
			    echo $BTIP > .git/refs/heads/B;;
			esac &&
			git symbolic-ref HEAD refs/heads/`echo $heads \
				| sed -e "s/^\(.\).*$/\1/"` &&

			git fsck --full &&

			mv .git/objects/pack/pack-* . &&
			p=`ls -1 pack-*.pack` &&
			git unpack-objects <$p &&
			git fsck --full &&

			idx=`echo pack-*.idx` &&
			pack_count=`git show-index <$idx | wc -l` &&
			test $pack_count = $count &&
			rm -f pack-*
		)
	
[master 3b4ae4f] 3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Server supports multi_ack_detailed
Server supports side-band-64k
Server supports ofs-delta
Server version is git/2.6.4
Successfully rebased and updated refs/heads/master.
want 27f494dfb7e67d2f9cd2282404adf1d97581aa34 (refs/heads/B)
have ed6d498dac4948371a8c2a3954eef783312857f5
have 9980fc7e97f06bbd7341f45d570f0c5eb2a954f1
have 47efdca58ae7f1fde501a06f1d57df26917b26b3
have ba87c301b81383c24349363a6bb39b6111abf78b
have 602f04194f3675f02accdfbf8e6291386b0f4e97
have 6e148f1d228e32d605c1881b1adbd357d61dc835
have 17e73716ce6121eb708bfb31fba1d4734d567834
have 858fd03f424cf6017e764d3239da1f6b9584ee4b
have 3911f7110bed898c8916759e9788b6ac72f052f4
have c1e2732633d64f4deb9d97137237b2769d6e29f5
have 3ac3ef48e6a300496e8466ad8a80df7f37503a7e
done
got ack (3) ed6d498dac4948371a8c2a3954eef783312857f5
got ack (3) 9980fc7e97f06bbd7341f45d570f0c5eb2a954f1
got ack (3) 47efdca58ae7f1fde501a06f1d57df26917b26b3
got ack (3) ba87c301b81383c24349363a6bb39b6111abf78b
got ack (3) 602f04194f3675f02accdfbf8e6291386b0f4e97
got ack (3) 6e148f1d228e32d605c1881b1adbd357d61dc835
got ack (3) 17e73716ce6121eb708bfb31fba1d4734d567834
got ack (3) 858fd03f424cf6017e764d3239da1f6b9584ee4b
got ack (3) 3911f7110bed898c8916759e9788b6ac72f052f4
got ack (3) c1e2732633d64f4deb9d97137237b2769d6e29f5
got ack (3) 3ac3ef48e6a300496e8466ad8a80df7f37503a7e
got ack (1) 3ac3ef48e6a300496e8466ad8a80df7f37503a7e
remote: Counting objects: 192, done.        
[master 13e4489] 4
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
remote: Compressing objects:   1% (1/64)           
remote: Compressing objects:   3% (2/64)           
remote: Compressing objects:   4% (3/64)           
remote: Compressing objects:   6% (4/64)           
remote: Compressing objects:   7% (5/64)           
remote: Compressing objects:   9% (6/64)           
remote: Compressing objects:  10% (7/64)           
remote: Compressing objects:  12% (8/64)           
remote: Compressing objects:  14% (9/64)           
remote: Compressing objects:  15% (10/64)           
remote: Compressing objects:  17% (11/64)           
remote: Compressing objects:  18% (12/64)           
remote: Compressing objects:  20% (13/64)           
ok 10 - git rebase -i (skip)

remote: Compressing objects:  21% (14/64)           
remote: Compressing objects:  23% (15/64)           
remote: Compressing objects:  25% (16/64)           
expecting success: 
remote: Compressing objects:  26% (17/64)           
	git reset --hard D &&
	clear_hook_input &&
	test_fail_interactive_rebase "1 squash 2" --onto A B &&
	echo C > foo &&
	git add foo &&
	git rebase --continue &&
	echo rebase >expected.args &&
	cat >expected.data <<-EOF &&
	$(git rev-parse C) $(git rev-parse HEAD)
	$(git rev-parse D) $(git rev-parse HEAD)
remote: Compressing objects:  28% (18/64)           
	EOF
	verify_hook_input

remote: Compressing objects:  29% (19/64)           
remote: Compressing objects:  31% (20/64)           
remote: Compressing objects:  32% (21/64)           
remote: Compressing objects:  34% (22/64)           
remote: Compressing objects:  35% (23/64)           
remote: Compressing objects:  37% (24/64)           
remote: Compressing objects:  39% (25/64)           
remote: Compressing objects:  40% (26/64)           
remote: Compressing objects:  42% (27/64)           
remote: Compressing objects:  43% (28/64)           
remote: Compressing objects:  45% (29/64)           
remote: Compressing objects:  46% (30/64)           
remote: Compressing objects:  48% (31/64)           
remote: Compressing objects:  50% (32/64)           
remote: Compressing objects:  51% (33/64)           
remote: Compressing objects:  53% (34/64)           
remote: Compressing objects:  54% (35/64)           
remote: Compressing objects:  56% (36/64)           
remote: Compressing objects:  57% (37/64)           
remote: Compressing objects:  59% (38/64)           
remote: Compressing objects:  60% (39/64)           
remote: Compressing objects:  62% (40/64)           
remote: Compressing objects:  64% (41/64)           
remote: Compressing objects:  65% (42/64)           
remote: Compressing objects:  67% (43/64)           
remote: Compressing objects:  68% (44/64)           
remote: Compressing objects:  70% (45/64)           
remote: Compressing objects:  71% (46/64)           
remote: Compressing objects:  73% (47/64)           
remote: Compressing objects:  75% (48/64)           
remote: Compressing objects:  76% (49/64)           
remote: Compressing objects:  78% (50/64)           
remote: Compressing objects:  79% (51/64)           
remote: Compressing objects:  81% (52/64)           
remote: Compressing objects:  82% (53/64)           
remote: Compressing objects:  84% (54/64)           
remote: Compressing objects:  85% (55/64)           
remote: Compressing objects:  87% (56/64)           
remote: Compressing objects:  89% (57/64)           
remote: Compressing objects:  90% (58/64)           
remote: Compressing objects:  92% (59/64)           
remote: Compressing objects:  93% (60/64)           
remote: Compressing objects:  95% (61/64)           
remote: Compressing objects:  96% (62/64)           
remote: Compressing objects:  98% (63/64)           
remote: Compressing objects: 100% (64/64)           
remote: Compressing objects: 100% (64/64), done.        
HEAD is now at babc8a4 D
[master 30cff6c] 5
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Receiving objects:   0% (1/192)   
Receiving objects:   1% (2/192)   
Receiving objects:   2% (4/192)   
Receiving objects:   3% (6/192)   
Receiving objects:   4% (8/192)   
Receiving objects:   5% (10/192)   
Receiving objects:   6% (12/192)   
Receiving objects:   7% (14/192)   
Receiving objects:   8% (16/192)   
Receiving objects:   9% (18/192)   
Receiving objects:  10% (20/192)   
Receiving objects:  11% (22/192)   
Receiving objects:  12% (24/192)   
Receiving objects:  13% (25/192)   
Receiving objects:  14% (27/192)   
Receiving objects:  15% (29/192)   
Receiving objects:  16% (31/192)   
Receiving objects:  17% (33/192)   
Receiving objects:  18% (35/192)   
Receiving objects:  19% (37/192)   
Receiving objects:  20% (39/192)   
Receiving objects:  21% (41/192)   
Receiving objects:  22% (43/192)   
Receiving objects:  23% (45/192)   
Receiving objects:  24% (47/192)   
Receiving objects:  25% (48/192)   
Receiving objects:  26% (50/192)   
[master cc14fab] 6
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 7bfe907] 7
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 134576a] 8
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Receiving objects:  27% (52/192)   
Receiving objects:  28% (54/192)   
Receiving objects:  29% (56/192)   
Receiving objects:  30% (58/192)   
Receiving objects:  31% (60/192)   
Receiving objects:  32% (62/192)   
Receiving objects:  33% (64/192)   
Receiving objects:  34% (66/192)   
Receiving objects:  35% (68/192)   
Receiving objects:  36% (70/192)   
Receiving objects:  37% (72/192)   
Receiving objects:  38% (73/192)   
Receiving objects:  39% (75/192)   
Receiving objects:  40% (77/192)   
Receiving objects:  41% (79/192)   
Receiving objects:  42% (81/192)   
Receiving objects:  43% (83/192)   
Receiving objects:  44% (85/192)   
Receiving objects:  45% (87/192)   
Receiving objects:  46% (89/192)   
Receiving objects:  47% (91/192)   
Receiving objects:  48% (93/192)   
Receiving objects:  49% (95/192)   
Receiving objects:  50% (96/192)   
Receiving objects:  51% (98/192)   
Receiving objects:  52% (100/192)   
Receiving objects:  53% (102/192)   
Receiving objects:  54% (104/192)   
remote: Total 192 (delta 0), reused 0 (delta 0)        
Receiving objects:  55% (106/192)   
Receiving objects:  56% (108/192)   
Receiving objects:  57% (110/192)   
Receiving objects:  58% (112/192)   
Receiving objects:  59% (114/192)   
Receiving objects:  60% (116/192)   
Receiving objects:  61% (118/192)   
Receiving objects:  62% (120/192)   
Receiving objects:  63% (121/192)   
Receiving objects:  64% (123/192)   
Receiving objects:  65% (125/192)   
Receiving objects:  66% (127/192)   
Receiving objects:  67% (129/192)   
Receiving objects:  68% (131/192)   
Receiving objects:  69% (133/192)   
Receiving objects:  70% (135/192)   
Receiving objects:  71% (137/192)   
Receiving objects:  72% (139/192)   
Receiving objects:  73% (141/192)   
Receiving objects:  74% (143/192)   
Receiving objects:  75% (144/192)   
Receiving objects:  76% (146/192)   
Receiving objects:  77% (148/192)   
Receiving objects:  78% (150/192)   
Receiving objects:  79% (152/192)   
Receiving objects:  80% (154/192)   
Receiving objects:  81% (156/192)   
Receiving objects:  82% (158/192)   
Receiving objects:  83% (160/192)   
Receiving objects:  84% (162/192)   
Receiving objects:  85% (164/192)   
Receiving objects:  86% (166/192)   
Receiving objects:  87% (168/192)   
Receiving objects:  88% (169/192)   
Receiving objects:  89% (171/192)   
Receiving objects:  90% (173/192)   
Receiving objects:  91% (175/192)   
Receiving objects:  92% (177/192)   
Receiving objects:  93% (179/192)   
Receiving objects:  94% (181/192)   
Receiving objects:  95% (183/192)   
Receiving objects:  96% (185/192)   
Receiving objects:  97% (187/192)   
Receiving objects:  98% (189/192)   
Receiving objects:  99% (191/192)   
Receiving objects: 100% (192/192)   
Receiving objects: 100% (192/192), 16.30 KiB | 0 bytes/s, done.
[master d9fac70] 9
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 8b7cc70] 10
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 1fe7aed] 11
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
pack	d6698cfcaf6e075007fcb2123d8a138210d6d911
27f494dfb7e67d2f9cd2282404adf1d97581aa34 refs/heads/B
[master 98f8216] 12
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
notice: HEAD points to an unborn branch (r)
[master 08a3530] 13
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master d4d5993] 14
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 844bf80] 15
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
rebase -i script before editing:
[master 2ae28d9] 16
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
pick 2362ae8 C
pick babc8a4 D

rebase -i script after editing:
pick 2362ae8 C
squash babc8a4 D
[master 4a5f133] 17
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master b2c4b70] 18
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 6f7bb52] 19
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 7de0e45] 20
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Rebasing (1/2)
[master ce09f1a] 21
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
notice: HEAD points to an unborn branch (r)
[master 4e80aa1] 22
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
error: could not apply 2362ae8... C

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Auto-merging foo
CONFLICT (content): Merge conflict in foo
[master e2df67a] 23
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 316112c] 24
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 4 - 2nd pull

expecting success: 
		(
			cd client &&
			git fetch-pack -k -v .. $heads &&

			case "$heads" in
			    *A*)
				    echo $ATIP > .git/refs/heads/A;;
			esac &&
			case "$heads" in *B*)
			    echo $BTIP > .git/refs/heads/B;;
			esac &&
			git symbolic-ref HEAD refs/heads/`echo $heads \
				| sed -e "s/^\(.\).*$/\1/"` &&

			git fsck --full &&

			mv .git/objects/pack/pack-* . &&
			p=`ls -1 pack-*.pack` &&
			git unpack-objects <$p &&
			git fsck --full &&

			idx=`echo pack-*.idx` &&
			pack_count=`git show-index <$idx | wc -l` &&
			test $pack_count = $count &&
			rm -f pack-*
		)
	
Could not apply 2362ae8e1b1b865e6161e6f0e165ffb974abf018... C
Server supports multi_ack_detailed
Server supports side-band-64k
Server supports ofs-delta
Server version is git/2.6.4
Marking 27f494dfb7e67d2f9cd2282404adf1d97581aa34 as complete
want f85e353c1b377970afbb804118d9135948598eea (refs/heads/A)
have 27f494dfb7e67d2f9cd2282404adf1d97581aa34
[master 928d12a] 25
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
have 9980fc7e97f06bbd7341f45d570f0c5eb2a954f1
have 47efdca58ae7f1fde501a06f1d57df26917b26b3
have ba87c301b81383c24349363a6bb39b6111abf78b
have 602f04194f3675f02accdfbf8e6291386b0f4e97
have 6e148f1d228e32d605c1881b1adbd357d61dc835
have 17e73716ce6121eb708bfb31fba1d4734d567834
have 858fd03f424cf6017e764d3239da1f6b9584ee4b
have 3911f7110bed898c8916759e9788b6ac72f052f4
have c1e2732633d64f4deb9d97137237b2769d6e29f5
done
got ack (3) 27f494dfb7e67d2f9cd2282404adf1d97581aa34
got ack (3) 9980fc7e97f06bbd7341f45d570f0c5eb2a954f1
got ack (3) 47efdca58ae7f1fde501a06f1d57df26917b26b3
got ack (3) ba87c301b81383c24349363a6bb39b6111abf78b
got ack (3) 602f04194f3675f02accdfbf8e6291386b0f4e97
got ack (3) 6e148f1d228e32d605c1881b1adbd357d61dc835
got ack (3) 17e73716ce6121eb708bfb31fba1d4734d567834
got ack (3) 858fd03f424cf6017e764d3239da1f6b9584ee4b
got ack (3) 3911f7110bed898c8916759e9788b6ac72f052f4
got ack (3) c1e2732633d64f4deb9d97137237b2769d6e29f5
got ack (1) c1e2732633d64f4deb9d97137237b2769d6e29f5
remote: Counting objects: 3, done.        
Receiving objects:  33% (1/3)   
Receiving objects:  66% (2/3)   
remote: Total 3 (delta 0), reused 0 (delta 0)        
Receiving objects: 100% (3/3)   
Receiving objects: 100% (3/3), 292 bytes | 0 bytes/s, done.
[master c639ba1] 26
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 243cd34] 27
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master c5cbab5] 28
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
pack	8c2aba64d976b4b0893650f8d05017eac7cd6e21
f85e353c1b377970afbb804118d9135948598eea refs/heads/A
[master 889cdf3] 29
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
notice: HEAD points to an unborn branch (r)
[detached HEAD bd57595] C
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master da05648] 30
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 2b9feb2] 31
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
notice: HEAD points to an unborn branch (r)
[master 3fc5f99] 32
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Rebasing (2/2)
[master 702deef] 33
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master bea9d13] 34
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 5 - 3rd pull

expecting success: 
	git clone --single-branch "file://$(pwd)/." singlebranch

[master 22bcce5] 35
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'singlebranch'...
[master 9aa1b05] 36
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[detached HEAD 341a9e4] C
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 2341008] 37
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master bc87574] 38
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master d362be6] 39
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Successfully rebased and updated refs/heads/master.
[master 87c5285] 40
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 11 - git rebase -i (squash)
[master 457eb45] 41
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)

expecting success: 
	git reset --hard D &&
	clear_hook_input &&
	FAKE_LINES="1 fixup 2" git rebase -i B &&
	echo rebase >expected.args &&
	cat >expected.data <<-EOF &&
	$(git rev-parse C) $(git rev-parse HEAD)
	$(git rev-parse D) $(git rev-parse HEAD)
	EOF
	verify_hook_input

HEAD is now at babc8a4 D
[master b5c0e32] 42
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master a37b0a0] 43
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 987253a] 44
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master fc5e21c] 45
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 6 - single branch clone

expecting success: 
	GIT_DIR=singlebranch/.git git count-objects -v |
		grep "^in-pack:" > count.singlebranch &&
	echo "in-pack: 198" >expected &&
	test_cmp expected count.singlebranch

ok 7 - single branch object count

expecting success: 
	git clone --single-branch --branch A "file://$(pwd)/." branch-a &&
	test_must_fail git --git-dir=branch-a/.git rev-parse origin/B

[master 6016775] 46
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'branch-a'...
[master 39ff1e3] 47
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master dbb9a53] 48
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 33d1508] 49
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 60aa088] 50
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
fatal: ambiguous argument 'origin/B': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
origin/B
ok 8 - single given branch clone

expecting success: 
	git clone --no-single-branch --depth 1 "file://$(pwd)/." shallow0 &&
	test "`git --git-dir=shallow0/.git rev-list --count HEAD`" = 1

[master f614361] 51
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'shallow0'...
[master 6fdee12] 52
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
rebase -i script before editing:
pick 2362ae8 C
pick babc8a4 D

[master 966d8d2] 53
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
rebase -i script after editing:
pick 2362ae8 C
fixup babc8a4 D
[master 325b466] 54
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 519c129] 55
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 2f380e7] 56
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 9 - clone shallow depth 1

expecting success: 
	git config --global fetch.fsckobjects true &&
	git clone --no-single-branch --depth 1 "file://$(pwd)/." shallow0fsck &&
	test "`git --git-dir=shallow0fsck/.git rev-list --count HEAD`" = 1 &&
	git config --global --unset fetch.fsckobjects

[master 5fef216] 57
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'shallow0fsck'...
[master f5b6f26] 58
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Rebasing (2/2)
[master c82531d] 59
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 6669a77] 60
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master c53a2a1] 61
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[detached HEAD 9ccd140] C
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 2bd80be] 62
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 10 - clone shallow depth 1 with fsck

expecting success: 
	git clone --no-single-branch --depth 2 "file://$(pwd)/." shallow

Cloning into 'shallow'...
[master a53b2c0] 63
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Successfully rebased and updated refs/heads/master.
remote: STDOUT post-receive        
remote: STDERR post-receive        
[master e0e17f9] 64
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
To ./victim.git
 + a434966...639813d tofail -> tofail (forced update)
 * [new branch]      branch_100 -> branch_100
 * [new branch]      branch_101 -> branch_101
 * [new branch]      branch_102 -> branch_102
 * [new branch]      branch_103 -> branch_103
 * [new branch]      branch_104 -> branch_104
 * [new branch]      branch_105 -> branch_105
 * [new branch]      branch_106 -> branch_106
 * [new branch]      branch_107 -> branch_107
 * [new branch]      branch_108 -> branch_108
 * [new branch]      branch_109 -> branch_109
 * [new branch]      branch_110 -> branch_110
 * [new branch]      branch_111 -> branch_111
 * [new branch]      branch_112 -> branch_112
 * [new branch]      branch_113 -> branch_113
 * [new branch]      branch_114 -> branch_114
 * [new branch]      branch_115 -> branch_115
 * [new branch]      branch_116 -> branch_116
 * [new branch]      branch_117 -> branch_117
 * [new branch]      branch_118 -> branch_118
 * [new branch]      branch_119 -> branch_119
 * [new branch]      branch_120 -> branch_120
 * [new branch]      branch_121 -> branch_121
 * [new branch]      branch_122 -> branch_122
 * [new branch]      branch_123 -> branch_123
 * [new branch]      branch_124 -> branch_124
 * [new branch]      branch_125 -> branch_125
 * [new branch]      branch_126 -> branch_126
 * [new branch]      branch_127 -> branch_127
 * [new branch]      branch_128 -> branch_128
 * [new branch]      branch_129 -> branch_129
 * [new branch]      branch_130 -> branch_130
 * [new branch]      branch_131 -> branch_131
 * [new branch]      branch_132 -> branch_132
 * [new branch]      branch_133 -> branch_133
 * [new branch]      branch_134 -> branch_134
 * [new branch]      branch_135 -> branch_135
 * [new branch]      branch_136 -> branch_136
 * [new branch]      branch_137 -> branch_137
 * [new branch]      branch_138 -> branch_138
 * [new branch]      branch_139 -> branch_139
 * [new branch]      branch_140 -> branch_140
 * [new branch]      branch_141 -> branch_141
 * [new branch]      branch_142 -> branch_142
 * [new branch]      branch_143 -> branch_143
 * [new branch]      branch_144 -> branch_144
 * [new branch]      branch_145 -> branch_145
 * [new branch]      branch_146 -> branch_146
 * [new branch]      branch_147 -> branch_147
 * [new branch]      branch_148 -> branch_148
 * [new branch]      branch_149 -> branch_149
 * [new branch]      branch_150 -> branch_150
 * [new branch]      branch_151 -> branch_151
 * [new branch]      branch_152 -> branch_152
 * [new branch]      branch_153 -> branch_153
 * [new branch]      branch_154 -> branch_154
 * [new branch]      branch_155 -> branch_155
 * [new branch]      branch_156 -> branch_156
 * [new branch]      branch_157 -> branch_157
 * [new branch]      branch_158 -> branch_158
 * [new branch]      branch_159 -> branch_159
 * [new branch]      branch_160 -> branch_160
 * [new branch]      branch_161 -> branch_161
 * [new branch]      branch_162 -> branch_162
 * [new branch]      branch_163 -> branch_163
 * [new branch]      branch_164 -> branch_164
 * [new branch]      branch_165 -> branch_165
 * [new branch]      branch_166 -> branch_166
 * [new branch]      branch_167 -> branch_167
 * [new branch]      branch_168 -> branch_168
 * [new branch]      branch_169 -> branch_169
 * [new branch]      branch_170 -> branch_170
 * [new branch]      branch_171 -> branch_171
 * [new branch]      branch_172 -> branch_172
 * [new branch]      branch_173 -> branch_173
 * [new branch]      branch_174 -> branch_174
 * [new branch]      branch_175 -> branch_175
 * [new branch]      branch_176 -> branch_176
 * [new branch]      branch_177 -> branch_177
 * [new branch]      branch_178 -> branch_178
 * [new branch]      branch_179 -> branch_179
 * [new branch]      branch_180 -> branch_180
 * [new branch]      branch_181 -> branch_181
 * [new branch]      branch_182 -> branch_182
 * [new branch]      branch_183 -> branch_183
 * [new branch]      branch_184 -> branch_184
 * [new branch]      branch_185 -> branch_185
 * [new branch]      branch_186 -> branch_186
 * [new branch]      branch_187 -> branch_187
 * [new branch]      branch_188 -> branch_188
 * [new branch]      branch_189 -> branch_189
 * [new branch]      branch_190 -> branch_190
 * [new branch]      branch_191 -> branch_191
 * [new branch]      branch_192 -> branch_192
 * [new branch]      branch_193 -> branch_193
 * [new branch]      branch_194 -> branch_194
 * [new branch]      branch_195 -> branch_195
 * [new branch]      branch_196 -> branch_196
 * [new branch]      branch_197 -> branch_197
 * [new branch]      branch_198 -> branch_198
 * [new branch]      branch_199 -> branch_199
 * [new branch]      branch_200 -> branch_200
 * [new branch]      branch_201 -> branch_201
 * [new branch]      branch_202 -> branch_202
 * [new branch]      branch_203 -> branch_203
 * [new branch]      branch_204 -> branch_204
 * [new branch]      branch_205 -> branch_205
 * [new branch]      branch_206 -> branch_206
 * [new branch]      branch_207 -> branch_207
 * [new branch]      branch_208 -> branch_208
 * [new branch]      branch_209 -> branch_209
 * [new branch]      branch_210 -> branch_210
 * [new branch]      branch_211 -> branch_211
 * [new branch]      branch_212 -> branch_212
 * [new branch]      branch_213 -> branch_213
 * [new branch]      branch_214 -> branch_214
 * [new branch]      branch_215 -> branch_215
 * [new branch]      branch_216 -> branch_216
 * [new branch]      branch_217 -> branch_217
 * [new branch]      branch_218 -> branch_218
 * [new branch]      branch_219 -> branch_219
 * [new branch]      branch_220 -> branch_220
 * [new branch]      branch_221 -> branch_221
 * [new branch]      branch_222 -> branch_222
 * [new branch]      branch_223 -> branch_223
 * [new branch]      branch_224 -> branch_224
 * [new branch]      branch_225 -> branch_225
 * [new branch]      branch_226 -> branch_226
 * [new branch]      branch_227 -> branch_227
 * [new branch]      branch_228 -> branch_228
 * [new branch]      branch_229 -> branch_229
 * [new branch]      branch_230 -> branch_230
 * [new branch]      branch_231 -> branch_231
 * [new branch]      branch_232 -> branch_232
 * [new branch]      branch_233 -> branch_233
 * [new branch]      branch_234 -> branch_234
 * [new branch]      branch_235 -> branch_235
 * [new branch]      branch_236 -> branch_236
 * [new branch]      branch_237 -> branch_237
 * [new branch]      branch_238 -> branch_238
 * [new branch]      branch_239 -> branch_239
 * [new branch]      branch_240 -> branch_240
 * [new branch]      branch_241 -> branch_241
 * [new branch]      branch_242 -> branch_242
 * [new branch]      branch_243 -> branch_243
 * [new branch]      branch_244 -> branch_244
 * [new branch]      branch_245 -> branch_245
 * [new branch]      branch_246 -> branch_246
 * [new branch]      branch_247 -> branch_247
 * [new branch]      branch_248 -> branch_248
 * [new branch]      branch_249 -> branch_249
 * [new branch]      branch_250 -> branch_250
 * [new branch]      branch_251 -> branch_251
 * [new branch]      branch_252 -> branch_252
 * [new branch]      branch_253 -> branch_253
 * [new branch]      branch_254 -> branch_254
 * [new branch]      branch_255 -> branch_255
 * [new branch]      branch_256 -> branch_256
 * [new branch]      branch_257 -> branch_257
 * [new branch]      branch_258 -> branch_258
 * [new branch]      branch_259 -> branch_259
 * [new branch]      branch_260 -> branch_260
 * [new branch]      branch_261 -> branch_261
 * [new branch]      branch_262 -> branch_262
 * [new branch]      branch_263 -> branch_263
 * [new branch]      branch_264 -> branch_264
 * [new branch]      branch_265 -> branch_265
 * [new branch]      branch_266 -> branch_266
 * [new branch]      branch_267 -> branch_267
 * [new branch]      branch_268 -> branch_268
 * [new branch]      branch_269 -> branch_269
 * [new branch]      branch_270 -> branch_270
 * [new branch]      branch_271 -> branch_271
 * [new branch]      branch_272 -> branch_272
 * [new branch]      branch_273 -> branch_273
 * [new branch]      branch_274 -> branch_274
 * [new branch]      branch_275 -> branch_275
 * [new branch]      branch_276 -> branch_276
 * [new branch]      branch_277 -> branch_277
 * [new branch]      branch_278 -> branch_278
 * [new branch]      branch_279 -> branch_279
 * [new branch]      branch_280 -> branch_280
 * [new branch]      branch_281 -> branch_281
 * [new branch]      branch_282 -> branch_282
 * [new branch]      branch_283 -> branch_283
 * [new branch]      branch_284 -> branch_284
 * [new branch]      branch_285 -> branch_285
 * [new branch]      branch_286 -> branch_286
 * [new branch]      branch_287 -> branch_287
 * [new branch]      branch_288 -> branch_288
 * [new branch]      branch_289 -> branch_289
 * [new branch]      branch_290 -> branch_290
 * [new branch]      branch_291 -> branch_291
 * [new branch]      branch_292 -> branch_292
 * [new branch]      branch_293 -> branch_293
 * [new branch]      branch_294 -> branch_294
 * [new branch]      branch_295 -> branch_295
 * [new branch]      branch_296 -> branch_296
 * [new branch]      branch_297 -> branch_297
 * [new branch]      branch_298 -> branch_298
 * [new branch]      branch_299 -> branch_299
 * [new branch]      branch_300 -> branch_300
 * [new branch]      branch_301 -> branch_301
 * [new branch]      branch_302 -> branch_302
 * [new branch]      branch_303 -> branch_303
 * [new branch]      branch_304 -> branch_304
 * [new branch]      branch_305 -> branch_305
 * [new branch]      branch_306 -> branch_306
 * [new branch]      branch_307 -> branch_307
 * [new branch]      branch_308 -> branch_308
 * [new branch]      branch_309 -> branch_309
 * [new branch]      branch_310 -> branch_310
 * [new branch]      branch_311 -> branch_311
 * [new branch]      branch_312 -> branch_312
 * [new branch]      branch_313 -> branch_313
 * [new branch]      branch_314 -> branch_314
 * [new branch]      branch_315 -> branch_315
 * [new branch]      branch_316 -> branch_316
 * [new branch]      branch_317 -> branch_317
 * [new branch]      branch_318 -> branch_318
 * [new branch]      branch_319 -> branch_319
 * [new branch]      branch_320 -> branch_320
 * [new branch]      branch_321 -> branch_321
 * [new branch]      branch_322 -> branch_322
 * [new branch]      branch_323 -> branch_323
 * [new branch]      branch_324 -> branch_324
 * [new branch]      branch_325 -> branch_325
 * [new branch]      branch_326 -> branch_326
 * [new branch]      branch_327 -> branch_327
 * [new branch]      branch_328 -> branch_328
 * [new branch]      branch_329 -> branch_329
 * [new branch]      branch_330 -> branch_330
 * [new branch]      branch_331 -> branch_331
 * [new branch]      branch_332 -> branch_332
 * [new branch]      branch_333 -> branch_333
 * [new branch]      branch_334 -> branch_334
 * [new branch]      branch_335 -> branch_335
 * [new branch]      branch_336 -> branch_336
 * [new branch]      branch_337 -> branch_337
 * [new branch]      branch_338 -> branch_338
 * [new branch]      branch_339 -> branch_339
 * [new branch]      branch_340 -> branch_340
 * [new branch]      branch_341 -> branch_341
 * [new branch]      branch_342 -> branch_342
 * [new branch]      branch_343 -> branch_343
 * [new branch]      branch_344 -> branch_344
 * [new branch]      branch_345 -> branch_345
 * [new branch]      branch_346 -> branch_346
 * [new branch]      branch_347 -> branch_347
 * [new branch]      branch_348 -> branch_348
 * [new branch]      branch_349 -> branch_349
 * [new branch]      branch_350 -> branch_350
 * [new branch]      branch_351 -> branch_351
 * [new branch]      branch_352 -> branch_352
 * [new branch]      branch_353 -> branch_353
 * [new branch]      branch_354 -> branch_354
 * [new branch]      branch_355 -> branch_355
 * [new branch]      branch_356 -> branch_356
 * [new branch]      branch_357 -> branch_357
 * [new branch]      branch_358 -> branch_358
 * [new branch]      branch_359 -> branch_359
 * [new branch]      branch_360 -> branch_360
 * [new branch]      branch_361 -> branch_361
 * [new branch]      branch_362 -> branch_362
 * [new branch]      branch_363 -> branch_363
 * [new branch]      branch_364 -> branch_364
 * [new branch]      branch_365 -> branch_365
 * [new branch]      branch_366 -> branch_366
 * [new branch]      branch_367 -> branch_367
 * [new branch]      branch_368 -> branch_368
 * [new branch]      branch_369 -> branch_369
 * [new branch]      branch_370 -> branch_370
 * [new branch]      branch_371 -> branch_371
 * [new branch]      branch_372 -> branch_372
 * [new branch]      branch_373 -> branch_373
 * [new branch]      branch_374 -> branch_374
 * [new branch]      branch_375 -> branch_375
 * [new branch]      branch_376 -> branch_376
 * [new branch]      branch_377 -> branch_377
 * [new branch]      branch_378 -> branch_378
 * [new branch]      branch_379 -> branch_379
 * [new branch]      branch_380 -> branch_380
 * [new branch]      branch_381 -> branch_381
 * [new branch]      branch_382 -> branch_382
 * [new branch]      branch_383 -> branch_383
 * [new branch]      branch_384 -> branch_384
 * [new branch]      branch_385 -> branch_385
 * [new branch]      branch_386 -> branch_386
 * [new branch]      branch_387 -> branch_387
 * [new branch]      branch_388 -> branch_388
 * [new branch]      branch_389 -> branch_389
 * [new branch]      branch_390 -> branch_390
 * [new branch]      branch_391 -> branch_391
 * [new branch]      branch_392 -> branch_392
 * [new branch]      branch_393 -> branch_393
 * [new branch]      branch_394 -> branch_394
 * [new branch]      branch_395 -> branch_395
 * [new branch]      branch_396 -> branch_396
 * [new branch]      branch_397 -> branch_397
 * [new branch]      branch_398 -> branch_398
 * [new branch]      branch_399 -> branch_399
 * [new branch]      branch_400 -> branch_400
 * [new branch]      branch_401 -> branch_401
 * [new branch]      branch_402 -> branch_402
 * [new branch]      branch_403 -> branch_403
 * [new branch]      branch_404 -> branch_404
 * [new branch]      branch_405 -> branch_405
 * [new branch]      branch_406 -> branch_406
 * [new branch]      branch_407 -> branch_407
 * [new branch]      branch_408 -> branch_408
 * [new branch]      branch_409 -> branch_409
 * [new branch]      branch_410 -> branch_410
 * [new branch]      branch_411 -> branch_411
 * [new branch]      branch_412 -> branch_412
 * [new branch]      branch_413 -> branch_413
 * [new branch]      branch_414 -> branch_414
 * [new branch]      branch_415 -> branch_415
 * [new branch]      branch_416 -> branch_416
 * [new branch]      branch_417 -> branch_417
 * [new branch]      branch_418 -> branch_418
 * [new branch]      branch_419 -> branch_419
 * [new branch]      branch_420 -> branch_420
 * [new branch]      branch_421 -> branch_421
 * [new branch]      branch_422 -> branch_422
 * [new branch]      branch_423 -> branch_423
 * [new branch]      branch_424 -> branch_424
 * [new branch]      branch_425 -> branch_425
 * [new branch]      branch_426 -> branch_426
 * [new branch]      branch_427 -> branch_427
 * [new branch]      branch_428 -> branch_428
 * [new branch]      branch_429 -> branch_429
 * [new branch]      branch_430 -> branch_430
 * [new branch]      branch_431 -> branch_431
 * [new branch]      branch_432 -> branch_432
 * [new branch]      branch_433 -> branch_433
 * [new branch]      branch_434 -> branch_434
 * [new branch]      branch_435 -> branch_435
 * [new branch]      branch_436 -> branch_436
 * [new branch]      branch_437 -> branch_437
 * [new branch]      branch_438 -> branch_438
 * [new branch]      branch_439 -> branch_439
 * [new branch]      branch_440 -> branch_440
 * [new branch]      branch_441 -> branch_441
 * [new branch]      branch_442 -> branch_442
 * [new branch]      branch_443 -> branch_443
 * [new branch]      branch_444 -> branch_444
 * [new branch]      branch_445 -> branch_445
 * [new branch]      branch_446 -> branch_446
 * [new branch]      branch_447 -> branch_447
 * [new branch]      branch_448 -> branch_448
 * [new branch]      branch_449 -> branch_449
 * [new branch]      branch_450 -> branch_450
 * [new branch]      branch_451 -> branch_451
 * [new branch]      branch_452 -> branch_452
 * [new branch]      branch_453 -> branch_453
 * [new branch]      branch_454 -> branch_454
 * [new branch]      branch_455 -> branch_455
 * [new branch]      branch_456 -> branch_456
 * [new branch]      branch_457 -> branch_457
 * [new branch]      branch_458 -> branch_458
 * [new branch]      branch_459 -> branch_459
 * [new branch]      branch_460 -> branch_460
 * [new branch]      branch_461 -> branch_461
 * [new branch]      branch_462 -> branch_462
 * [new branch]      branch_463 -> branch_463
 * [new branch]      branch_464 -> branch_464
 * [new branch]      branch_465 -> branch_465
 * [new branch]      branch_466 -> branch_466
 * [new branch]      branch_467 -> branch_467
 * [new branch]      branch_468 -> branch_468
 * [new branch]      branch_469 -> branch_469
 * [new branch]      branch_470 -> branch_470
 * [new branch]      branch_471 -> branch_471
 * [new branch]      branch_472 -> branch_472
 * [new branch]      branch_473 -> branch_473
 * [new branch]      branch_474 -> branch_474
 * [new branch]      branch_475 -> branch_475
 * [new branch]      branch_476 -> branch_476
 * [new branch]      branch_477 -> branch_477
 * [new branch]      branch_478 -> branch_478
 * [new branch]      branch_479 -> branch_479
 * [new branch]      branch_480 -> branch_480
 * [new branch]      branch_481 -> branch_481
 * [new branch]      branch_482 -> branch_482
 * [new branch]      branch_483 -> branch_483
 * [new branch]      branch_484 -> branch_484
 * [new branch]      branch_485 -> branch_485
 * [new branch]      branch_486 -> branch_486
 * [new branch]      branch_487 -> branch_487
 * [new branch]      branch_488 -> branch_488
 * [new branch]      branch_489 -> branch_489
 * [new branch]      branch_490 -> branch_490
 * [new branch]      branch_491 -> branch_491
 * [new branch]      branch_492 -> branch_492
 * [new branch]      branch_493 -> branch_493
 * [new branch]      branch_494 -> branch_494
 * [new branch]      branch_495 -> branch_495
 * [new branch]      branch_496 -> branch_496
 * [new branch]      branch_497 -> branch_497
 * [new branch]      branch_498 -> branch_498
 * [new branch]      branch_499 -> branch_499
 * [new branch]      branch_500 -> branch_500
 * [new branch]      branch_501 -> branch_501
 * [new branch]      branch_502 -> branch_502
 * [new branch]      branch_503 -> branch_503
 * [new branch]      branch_504 -> branch_504
 * [new branch]      branch_505 -> branch_505
 * [new branch]      branch_506 -> branch_506
 * [new branch]      branch_507 -> branch_507
 * [new branch]      branch_508 -> branch_508
 * [new branch]      branch_509 -> branch_509
 * [new branch]      branch_510 -> branch_510
 * [new branch]      branch_511 -> branch_511
 * [new branch]      branch_512 -> branch_512
 * [new branch]      branch_513 -> branch_513
 * [new branch]      branch_514 -> branch_514
 * [new branch]      branch_515 -> branch_515
 * [new branch]      branch_516 -> branch_516
 * [new branch]      branch_517 -> branch_517
 * [new branch]      branch_518 -> branch_518
 * [new branch]      branch_519 -> branch_519
 * [new branch]      branch_520 -> branch_520
 * [new branch]      branch_521 -> branch_521
 * [new branch]      branch_522 -> branch_522
 * [new branch]      branch_523 -> branch_523
 * [new branch]      branch_524 -> branch_524
 * [new branch]      branch_525 -> branch_525
 * [new branch]      branch_526 -> branch_526
 * [new branch]      branch_527 -> branch_527
 * [new branch]      branch_528 -> branch_528
 * [new branch]      branch_529 -> branch_529
 * [new branch]      branch_530 -> branch_530
 * [new branch]      branch_531 -> branch_531
 * [new branch]      branch_532 -> branch_532
 * [new branch]      branch_533 -> branch_533
 * [new branch]      branch_534 -> branch_534
 * [new branch]      branch_535 -> branch_535
 * [new branch]      branch_536 -> branch_536
 * [new branch]      branch_537 -> branch_537
 * [new branch]      branch_538 -> branch_538
 * [new branch]      branch_539 -> branch_539
 * [new branch]      branch_540 -> branch_540
 * [new branch]      branch_541 -> branch_541
 * [new branch]      branch_542 -> branch_542
 * [new branch]      branch_543 -> branch_543
 * [new branch]      branch_544 -> branch_544
 * [new branch]      branch_545 -> branch_545
 * [new branch]      branch_546 -> branch_546
 * [new branch]      branch_547 -> branch_547
 * [new branch]      branch_548 -> branch_548
 * [new branch]      branch_549 -> branch_549
 * [new branch]      branch_550 -> branch_550
 * [new branch]      branch_551 -> branch_551
 * [new branch]      branch_552 -> branch_552
 * [new branch]      branch_553 -> branch_553
 * [new branch]      branch_554 -> branch_554
 * [new branch]      branch_555 -> branch_555
 * [new branch]      branch_556 -> branch_556
 * [new branch]      branch_557 -> branch_557
 * [new branch]      branch_558 -> branch_558
 * [new branch]      branch_559 -> branch_559
 * [new branch]      branch_560 -> branch_560
 * [new branch]      branch_561 -> branch_561
 * [new branch]      branch_562 -> branch_562
 * [new branch]      branch_563 -> branch_563
 * [new branch]      branch_564 -> branch_564
 * [new branch]      branch_565 -> branch_565
 * [new branch]      branch_566 -> branch_566
 * [new branch]      branch_567 -> branch_567
 * [new branch]      branch_568 -> branch_568
 * [new branch]      branch_569 -> branch_569
 * [new branch]      branch_570 -> branch_570
 * [new branch]      branch_571 -> branch_571
 * [new branch]      branch_572 -> branch_572
 * [new branch]      branch_573 -> branch_573
 * [new branch]      branch_574 -> branch_574
 * [new branch]      branch_575 -> branch_575
 * [new branch]      branch_576 -> branch_576
 * [new branch]      branch_577 -> branch_577
 * [new branch]      branch_578 -> branch_578
 * [new branch]      branch_579 -> branch_579
 * [new branch]      branch_580 -> branch_580
 * [new branch]      branch_581 -> branch_581
 * [new branch]      branch_582 -> branch_582
 * [new branch]      branch_583 -> branch_583
 * [new branch]      branch_584 -> branch_584
 * [new branch]      branch_585 -> branch_585
 * [new branch]      branch_586 -> branch_586
 * [new branch]      branch_587 -> branch_587
 * [new branch]      branch_588 -> branch_588
 * [new branch]      branch_589 -> branch_589
 * [new branch]      branch_590 -> branch_590
 * [new branch]      branch_591 -> branch_591
 * [new branch]      branch_592 -> branch_592
 * [new branch]      branch_593 -> branch_593
 * [new branch]      branch_594 -> branch_594
 * [new branch]      branch_595 -> branch_595
 * [new branch]      branch_596 -> branch_596
 * [new branch]      branch_597 -> branch_597
 * [new branch]      branch_598 -> branch_598
 * [new branch]      branch_599 -> branch_599
 * [new branch]      branch_600 -> branch_600
 * [new branch]      branch_601 -> branch_601
 * [new branch]      branch_602 -> branch_602
 * [new branch]      branch_603 -> branch_603
 * [new branch]      branch_604 -> branch_604
 * [new branch]      branch_605 -> branch_605
 * [new branch]      branch_606 -> branch_606
 * [new branch]      branch_607 -> branch_607
 * [new branch]      branch_608 -> branch_608
 * [new branch]      branch_609 -> branch_609
 * [new branch]      branch_610 -> branch_610
 * [new branch]      branch_611 -> branch_611
 * [new branch]      branch_612 -> branch_612
 * [new branch]      branch_613 -> branch_613
 * [new branch]      branch_614 -> branch_614
 * [new branch]      branch_615 -> branch_615
 * [new branch]      branch_616 -> branch_616
 * [new branch]      branch_617 -> branch_617
 * [new branch]      branch_618 -> branch_618
 * [new branch]      branch_619 -> branch_619
 * [new branch]      branch_620 -> branch_620
 * [new branch]      branch_621 -> branch_621
 * [new branch]      branch_622 -> branch_622
 * [new branch]      branch_623 -> branch_623
 * [new branch]      branch_624 -> branch_624
 * [new branch]      branch_625 -> branch_625
 * [new branch]      branch_626 -> branch_626
 * [new branch]      branch_627 -> branch_627
 * [new branch]      branch_628 -> branch_628
 * [new branch]      branch_629 -> branch_629
 * [new branch]      branch_630 -> branch_630
 * [new branch]      branch_631 -> branch_631
 * [new branch]      branch_632 -> branch_632
 * [new branch]      branch_633 -> branch_633
 * [new branch]      branch_634 -> branch_634
 * [new branch]      branch_635 -> branch_635
 * [new branch]      branch_636 -> branch_636
 * [new branch]      branch_637 -> branch_637
 * [new branch]      branch_638 -> branch_638
 * [new branch]      branch_639 -> branch_639
 * [new branch]      branch_640 -> branch_640
 * [new branch]      branch_641 -> branch_641
 * [new branch]      branch_642 -> branch_642
 * [new branch]      branch_643 -> branch_643
 * [new branch]      branch_644 -> branch_644
 * [new branch]      branch_645 -> branch_645
 * [new branch]      branch_646 -> branch_646
 * [new branch]      branch_647 -> branch_647
 * [new branch]      branch_648 -> branch_648
 * [new branch]      branch_649 -> branch_649
 * [new branch]      branch_650 -> branch_650
 * [new branch]      branch_651 -> branch_651
 * [new branch]      branch_652 -> branch_652
 * [new branch]      branch_653 -> branch_653
 * [new branch]      branch_654 -> branch_654
 * [new branch]      branch_655 -> branch_655
 * [new branch]      branch_656 -> branch_656
 * [new branch]      branch_657 -> branch_657
 * [new branch]      branch_658 -> branch_658
 * [new branch]      branch_659 -> branch_659
 * [new branch]      branch_660 -> branch_660
 * [new branch]      branch_661 -> branch_661
 * [new branch]      branch_662 -> branch_662
 * [new branch]      branch_663 -> branch_663
 * [new branch]      branch_664 -> branch_664
 * [new branch]      branch_665 -> branch_665
 * [new branch]      branch_666 -> branch_666
 * [new branch]      branch_667 -> branch_667
 * [new branch]      branch_668 -> branch_668
 * [new branch]      branch_669 -> branch_669
 * [new branch]      branch_670 -> branch_670
 * [new branch]      branch_671 -> branch_671
 * [new branch]      branch_672 -> branch_672
 * [new branch]      branch_673 -> branch_673
 * [new branch]      branch_674 -> branch_674
 * [new branch]      branch_675 -> branch_675
 * [new branch]      branch_676 -> branch_676
 * [new branch]      branch_677 -> branch_677
 * [new branch]      branch_678 -> branch_678
 * [new branch]      branch_679 -> branch_679
 * [new branch]      branch_680 -> branch_680
 * [new branch]      branch_681 -> branch_681
 * [new branch]      branch_682 -> branch_682
 * [new branch]      branch_683 -> branch_683
 * [new branch]      branch_684 -> branch_684
 * [new branch]      branch_685 -> branch_685
 * [new branch]      branch_686 -> branch_686
 * [new branch]      branch_687 -> branch_687
 * [new branch]      branch_688 -> branch_688
 * [new branch]      branch_689 -> branch_689
 * [new branch]      branch_690 -> branch_690
 * [new branch]      branch_691 -> branch_691
 * [new branch]      branch_692 -> branch_692
 * [new branch]      branch_693 -> branch_693
 * [new branch]      branch_694 -> branch_694
 * [new branch]      branch_695 -> branch_695
 * [new branch]      branch_696 -> branch_696
 * [new branch]      branch_697 -> branch_697
 * [new branch]      branch_698 -> branch_698
 * [new branch]      branch_699 -> branch_699
 * [new branch]      branch_700 -> branch_700
 * [new branch]      branch_701 -> branch_701
 * [new branch]      branch_702 -> branch_702
 * [new branch]      branch_703 -> branch_703
 * [new branch]      branch_704 -> branch_704
 * [new branch]      branch_705 -> branch_705
 * [new branch]      branch_706 -> branch_706
 * [new branch]      branch_707 -> branch_707
 * [new branch]      branch_708 -> branch_708
 * [new branch]      branch_709 -> branch_709
 * [new branch]      branch_710 -> branch_710
 * [new branch]      branch_711 -> branch_711
 * [new branch]      branch_712 -> branch_712
 * [new branch]      branch_713 -> branch_713
 * [new branch]      branch_714 -> branch_714
 * [new branch]      branch_715 -> branch_715
 * [new branch]      branch_716 -> branch_716
 * [new branch]      branch_717 -> branch_717
 * [new branch]      branch_718 -> branch_718
 * [new branch]      branch_719 -> branch_719
 * [new branch]      branch_720 -> branch_720
 * [new branch]      branch_721 -> branch_721
 * [new branch]      branch_722 -> branch_722
 * [new branch]      branch_723 -> branch_723
 * [new branch]      branch_724 -> branch_724
 * [new branch]      branch_725 -> branch_725
 * [new branch]      branch_726 -> branch_726
 * [new branch]      branch_727 -> branch_727
 * [new branch]      branch_728 -> branch_728
 * [new branch]      branch_729 -> branch_729
 * [new branch]      branch_730 -> branch_730
 * [new branch]      branch_731 -> branch_731
 * [new branch]      branch_732 -> branch_732
 * [new branch]      branch_733 -> branch_733
 * [new branch]      branch_734 -> branch_734
 * [new branch]      branch_735 -> branch_735
 * [new branch]      branch_736 -> branch_736
 * [new branch]      branch_737 -> branch_737
 * [new branch]      branch_738 -> branch_738
 * [new branch]      branch_739 -> branch_739
 * [new branch]      branch_740 -> branch_740
 * [new branch]      branch_741 -> branch_741
 * [new branch]      branch_742 -> branch_742
 * [new branch]      branch_743 -> branch_743
 * [new branch]      branch_744 -> branch_744
 * [new branch]      branch_745 -> branch_745
 * [new branch]      branch_746 -> branch_746
 * [new branch]      branch_747 -> branch_747
 * [new branch]      branch_748 -> branch_748
 * [new branch]      branch_749 -> branch_749
 * [new branch]      branch_750 -> branch_750
 * [new branch]      branch_751 -> branch_751
 * [new branch]      branch_752 -> branch_752
 * [new branch]      branch_753 -> branch_753
 * [new branch]      branch_754 -> branch_754
 * [new branch]      branch_755 -> branch_755
 * [new branch]      branch_756 -> branch_756
 * [new branch]      branch_757 -> branch_757
 * [new branch]      branch_758 -> branch_758
 * [new branch]      branch_759 -> branch_759
 * [new branch]      branch_760 -> branch_760
 * [new branch]      branch_761 -> branch_761
 * [new branch]      branch_762 -> branch_762
 * [new branch]      branch_763 -> branch_763
 * [new branch]      branch_764 -> branch_764
 * [new branch]      branch_765 -> branch_765
 * [new branch]      branch_766 -> branch_766
 * [new branch]      branch_767 -> branch_767
 * [new branch]      branch_768 -> branch_768
 * [new branch]      branch_769 -> branch_769
 * [new branch]      branch_770 -> branch_770
 * [new branch]      branch_771 -> branch_771
 * [new branch]      branch_772 -> branch_772
 * [new branch]      branch_773 -> branch_773
 * [new branch]      branch_774 -> branch_774
 * [new branch]      branch_775 -> branch_775
 * [new branch]      branch_776 -> branch_776
 * [new branch]      branch_777 -> branch_777
 * [new branch]      branch_778 -> branch_778
 * [new branch]      branch_779 -> branch_779
 * [new branch]      branch_780 -> branch_780
 * [new branch]      branch_781 -> branch_781
 * [new branch]      branch_782 -> branch_782
 * [new branch]      branch_783 -> branch_783
 * [new branch]      branch_784 -> branch_784
 * [new branch]      branch_785 -> branch_785
 * [new branch]      branch_786 -> branch_786
 * [new branch]      branch_787 -> branch_787
 * [new branch]      branch_788 -> branch_788
 * [new branch]      branch_789 -> branch_789
 * [new branch]      branch_790 -> branch_790
 * [new branch]      branch_791 -> branch_791
 * [new branch]      branch_792 -> branch_792
 * [new branch]      branch_793 -> branch_793
 * [new branch]      branch_794 -> branch_794
 * [new branch]      branch_795 -> branch_795
 * [new branch]      branch_796 -> branch_796
 * [new branch]      branch_797 -> branch_797
 * [new branch]      branch_798 -> branch_798
 * [new branch]      branch_799 -> branch_799
 * [new branch]      branch_800 -> branch_800
 * [new branch]      branch_801 -> branch_801
 * [new branch]      branch_802 -> branch_802
 * [new branch]      branch_803 -> branch_803
 * [new branch]      branch_804 -> branch_804
 * [new branch]      branch_805 -> branch_805
 * [new branch]      branch_806 -> branch_806
 * [new branch]      branch_807 -> branch_807
 * [new branch]      branch_808 -> branch_808
 * [new branch]      branch_809 -> branch_809
 * [new branch]      branch_810 -> branch_810
 * [new branch]      branch_811 -> branch_811
 * [new branch]      branch_812 -> branch_812
 * [new branch]      branch_813 -> branch_813
 * [new branch]      branch_814 -> branch_814
 * [new branch]      branch_815 -> branch_815
 * [new branch]      branch_816 -> branch_816
 * [new branch]      branch_817 -> branch_817
 * [new branch]      branch_818 -> branch_818
 * [new branch]      branch_819 -> branch_819
 * [new branch]      branch_820 -> branch_820
 * [new branch]      branch_821 -> branch_821
 * [new branch]      branch_822 -> branch_822
 * [new branch]      branch_823 -> branch_823
 * [new branch]      branch_824 -> branch_824
 * [new branch]      branch_825 -> branch_825
 * [new branch]      branch_826 -> branch_826
 * [new branch]      branch_827 -> branch_827
 * [new branch]      branch_828 -> branch_828
 * [new branch]      branch_829 -> branch_829
 * [new branch]      branch_830 -> branch_830
 * [new branch]      branch_831 -> branch_831
 * [new branch]      branch_832 -> branch_832
 * [new branch]      branch_833 -> branch_833
 * [new branch]      branch_834 -> branch_834
 * [new branch]      branch_835 -> branch_835
 * [new branch]      branch_836 -> branch_836
 * [new branch]      branch_837 -> branch_837
 * [new branch]      branch_838 -> branch_838
 * [new branch]      branch_839 -> branch_839
 * [new branch]      branch_840 -> branch_840
 * [new branch]      branch_841 -> branch_841
 * [new branch]      branch_842 -> branch_842
 * [new branch]      branch_843 -> branch_843
 * [new branch]      branch_844 -> branch_844
 * [new branch]      branch_845 -> branch_845
 * [new branch]      branch_846 -> branch_846
 * [new branch]      branch_847 -> branch_847
 * [new branch]      branch_848 -> branch_848
 * [new branch]      branch_849 -> branch_849
 * [new branch]      branch_850 -> branch_850
 * [new branch]      branch_851 -> branch_851
 * [new branch]      branch_852 -> branch_852
 * [new branch]      branch_853 -> branch_853
 * [new branch]      branch_854 -> branch_854
 * [new branch]      branch_855 -> branch_855
 * [new branch]      branch_856 -> branch_856
 * [new branch]      branch_857 -> branch_857
 * [new branch]      branch_858 -> branch_858
 * [new branch]      branch_859 -> branch_859
 * [new branch]      branch_860 -> branch_860
 * [new branch]      branch_861 -> branch_861
 * [new branch]      branch_862 -> branch_862
 * [new branch]      branch_863 -> branch_863
 * [new branch]      branch_864 -> branch_864
 * [new branch]      branch_865 -> branch_865
 * [new branch]      branch_866 -> branch_866
 * [new branch]      branch_867 -> branch_867
 * [new branch]      branch_868 -> branch_868
 * [new branch]      branch_869 -> branch_869
 * [new branch]      branch_870 -> branch_870
 * [new branch]      branch_871 -> branch_871
 * [new branch]      branch_872 -> branch_872
 * [new branch]      branch_873 -> branch_873
 * [new branch]      branch_874 -> branch_874
 * [new branch]      branch_875 -> branch_875
 * [new branch]      branch_876 -> branch_876
 * [new branch]      branch_877 -> branch_877
 * [new branch]      branch_878 -> branch_878
 * [new branch]      branch_879 -> branch_879
 * [new branch]      branch_880 -> branch_880
 * [new branch]      branch_881 -> branch_881
 * [new branch]      branch_882 -> branch_882
 * [new branch]      branch_883 -> branch_883
 * [new branch]      branch_884 -> branch_884
 * [new branch]      branch_885 -> branch_885
 * [new branch]      branch_886 -> branch_886
 * [new branch]      branch_887 -> branch_887
 * [new branch]      branch_888 -> branch_888
 * [new branch]      branch_889 -> branch_889
 * [new branch]      branch_890 -> branch_890
 * [new branch]      branch_891 -> branch_891
 * [new branch]      branch_892 -> branch_892
 * [new branch]      branch_893 -> branch_893
 * [new branch]      branch_894 -> branch_894
 * [new branch]      branch_895 -> branch_895
 * [new branch]      branch_896 -> branch_896
 * [new branch]      branch_897 -> branch_897
 * [new branch]      branch_898 -> branch_898
 * [new branch]      branch_899 -> branch_899
 * [new branch]      branch_900 -> branch_900
 * [new branch]      branch_901 -> branch_901
 * [new branch]      branch_902 -> branch_902
 * [new branch]      branch_903 -> branch_903
 * [new branch]      branch_904 -> branch_904
 * [new branch]      branch_905 -> branch_905
 * [new branch]      branch_906 -> branch_906
 * [new branch]      branch_907 -> branch_907
 * [new branch]      branch_908 -> branch_908
 * [new branch]      branch_909 -> branch_909
 * [new branch]      branch_910 -> branch_910
 * [new branch]      branch_911 -> branch_911
 * [new branch]      branch_912 -> branch_912
 * [new branch]      branch_913 -> branch_913
 * [new branch]      branch_914 -> branch_914
 * [new branch]      branch_915 -> branch_915
 * [new branch]      branch_916 -> branch_916
 * [new branch]      branch_917 -> branch_917
 * [new branch]      branch_918 -> branch_918
 * [new branch]      branch_919 -> branch_919
 * [new branch]      branch_920 -> branch_920
 * [new branch]      branch_921 -> branch_921
 * [new branch]      branch_922 -> branch_922
 * [new branch]      branch_923 -> branch_923
 * [new branch]      branch_924 -> branch_924
 * [new branch]      branch_925 -> branch_925
 * [new branch]      branch_926 -> branch_926
 * [new branch]      branch_927 -> branch_927
 * [new branch]      branch_928 -> branch_928
 * [new branch]      branch_929 -> branch_929
 * [new branch]      branch_930 -> branch_930
 * [new branch]      branch_931 -> branch_931
 * [new branch]      branch_932 -> branch_932
 * [new branch]      branch_933 -> branch_933
 * [new branch]      branch_934 -> branch_934
 * [new branch]      branch_935 -> branch_935
 * [new branch]      branch_936 -> branch_936
 * [new branch]      branch_937 -> branch_937
 * [new branch]      branch_938 -> branch_938
 * [new branch]      branch_939 -> branch_939
 * [new branch]      branch_940 -> branch_940
 * [new branch]      branch_941 -> branch_941
 * [new branch]      branch_942 -> branch_942
 * [new branch]      branch_943 -> branch_943
 * [new branch]      branch_944 -> branch_944
 * [new branch]      branch_945 -> branch_945
 * [new branch]      branch_946 -> branch_946
 * [new branch]      branch_947 -> branch_947
 * [new branch]      branch_948 -> branch_948
 * [new branch]      branch_949 -> branch_949
 * [new branch]      branch_950 -> branch_950
 * [new branch]      branch_951 -> branch_951
 * [new branch]      branch_952 -> branch_952
 * [new branch]      branch_953 -> branch_953
 * [new branch]      branch_954 -> branch_954
 * [new branch]      branch_955 -> branch_955
 * [new branch]      branch_956 -> branch_956
 * [new branch]      branch_957 -> branch_957
 * [new branch]      branch_958 -> branch_958
 * [new branch]      branch_959 -> branch_959
 * [new branch]      branch_960 -> branch_960
 * [new branch]      branch_961 -> branch_961
 * [new branch]      branch_962 -> branch_962
 * [new branch]      branch_963 -> branch_963
 * [new branch]      branch_964 -> branch_964
 * [new branch]      branch_965 -> branch_965
 * [new branch]      branch_966 -> branch_966
 * [new branch]      branch_967 -> branch_967
 * [new branch]      branch_968 -> branch_968
 * [new branch]      branch_969 -> branch_969
 * [new branch]      branch_970 -> branch_970
 * [new branch]      branch_971 -> branch_971
 * [new branch]      branch_972 -> branch_972
 * [new branch]      branch_973 -> branch_973
 * [new branch]      branch_974 -> branch_974
 * [new branch]      branch_975 -> branch_975
 * [new branch]      branch_976 -> branch_976
 * [new branch]      branch_977 -> branch_977
 * [new branch]      branch_978 -> branch_978
 * [new branch]      branch_979 -> branch_979
 * [new branch]      branch_980 -> branch_980
 * [new branch]      branch_981 -> branch_981
 * [new branch]      branch_982 -> branch_982
 * [new branch]      branch_983 -> branch_983
 * [new branch]      branch_984 -> branch_984
 * [new branch]      branch_985 -> branch_985
 * [new branch]      branch_986 -> branch_986
 * [new branch]      branch_987 -> branch_987
 * [new branch]      branch_988 -> branch_988
 * [new branch]      branch_989 -> branch_989
 * [new branch]      branch_990 -> branch_990
 * [new branch]      branch_991 -> branch_991
 * [new branch]      branch_992 -> branch_992
 * [new branch]      branch_993 -> branch_993
 * [new branch]      branch_994 -> branch_994
 * [new branch]      branch_995 -> branch_995
 * [new branch]      branch_996 -> branch_996
 * [new branch]      branch_997 -> branch_997
 * [new branch]      branch_998 -> branch_998
 * [new branch]      branch_999 -> branch_999
ok 13 - pre-receive hook that forgets to read its input

# passed all 13 test(s)
1..13
[master 9b0d0e6] 65
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 12 - git rebase -i (fixup without conflict)

expecting success: 
	git reset --hard D &&
	clear_hook_input &&
	FAKE_LINES="edit 1 edit 2" git rebase -i B &&
	git rebase --continue &&
	echo something > foo &&
	git add foo &&
	git rebase --continue &&
	echo rebase >expected.args &&
	cat >expected.data <<-EOF &&
	$(git rev-parse C) $(git rev-parse HEAD^)
	$(git rev-parse D) $(git rev-parse HEAD)
	EOF
	verify_hook_input

HEAD is now at babc8a4 D
[master fb65e90] 66
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 11 - clone shallow

expecting success: 
	test "`git --git-dir=shallow/.git rev-list --count HEAD`" = 2

ok 12 - clone shallow depth count

expecting success: 
	(
		cd shallow &&
		git count-objects -v
	) > count.shallow &&
	grep "^in-pack: 12" count.shallow

[master ed8fee9] 67
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
in-pack: 12
ok 13 - clone shallow object count

expecting success: 
	sed -e "/^in-pack:/d" -e "/^packs:/d" -e "/^size-pack:/d" \
	    -e "/: 0$/d" count.shallow > count_output &&
	! test -s count_output

[master 7353642] 68
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 14 - clone shallow object count (part 2)

expecting success: 
	(
		cd shallow &&
		git fsck --full
	)

ok 15 - fsck in shallow repo

expecting success: 
	(
		cd shallow &&
		git fetch
	)

[master edce51b] 69
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 795165d] 70
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 16 - simple fetch in shallow repo

expecting success: 
	(
		cd shallow &&
		git count-objects -v
	) > count.shallow.2 &&
	cmp count.shallow count.shallow.2

[master a98cce7] 71
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 17 - no changes expected

expecting success: 
	(
		cd shallow &&
		git fetch --depth=2
	)

[master 490949c] 72
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 18 - fetch same depth in shallow repo

expecting success: 
	(
		cd shallow &&
		git count-objects -v
	) > count.shallow.3 &&
	cmp count.shallow count.shallow.3

[master 3a81322] 73
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 19 - no changes expected

expecting success: 
	add B66 $B65 &&
	add B67 $B66

[master bf848e8] 74
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 91ab985] 75
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 136d762] 76
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 20 - add two more

expecting success: 
	(
		cd shallow &&
		git pull .. B
	)

[master 95f55fb] 77
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
rebase -i script before editing:
pick 2362ae8 C
pick babc8a4 D

[master 7ed186d] 78
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
rebase -i script after editing:
edit 2362ae8 C
edit babc8a4 D
[master d594534] 79
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
From ..
 * branch            B          -> FETCH_HEAD
[master c98f85e] 80
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Updating 27f494d..437bc54
Fast-forward
 test.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 21 - pull in shallow repo

expecting success: 
	(
		cd shallow &&
		git count-objects -v
	) > count.shallow &&
	grep "^count: 6" count.shallow

[master bcb3b52] 81
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
count: 6
ok 22 - clone shallow object count

expecting success: 
	add B68 $B67 &&
	add B69 $B68

[master 7f58abd] 82
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Rebasing (1/2)
[master 0066203] 83
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Stopped at 2362ae8e1b1b865e6161e6f0e165ffb974abf018... C
ok 23 - add two more (part 2)

expecting success: 
	(
		cd shallow &&
		git pull --depth 4 .. B
	)

[master 6e35763] 84
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master c63561d] 85
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

[master 2f60ee3] 86
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 708be03] 87
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
From ..
 * branch            B          -> FETCH_HEAD
[master 81f6957] 88
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Updating 437bc54..9ca64d8
Fast-forward
 test.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 24 - deepening pull in shallow repo

expecting success: 
	(
		cd shallow &&
		git count-objects -v
	) > count.shallow &&
	grep "^count: 12" count.shallow

[master 1204abb] 89
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
count: 12
ok 25 - clone shallow object count

expecting success: 
	(
		cd shallow &&
		git fetch --depth 4 .. A:A
	)

*** t5502-quickfetch.sh ***
[master 781123d] 90
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 71f4bd9] 91
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5502-quickfetch/.git/
expecting success: 

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

	cnt=$( (
		git count-objects | sed -e "s/ *objects,.*//"
	) ) &&
	test $cnt -eq 3

From ..
 * [new branch]      A          -> A
[master 07bd61c] 92
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 26 - deepening fetch in shallow repo

expecting success: 
	(
		cd shallow &&
		git count-objects -v
	) > count.shallow &&
	grep "^count: 18" count.shallow

[master (root-commit) f3b89bf] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
count: 18
ok 27 - clone shallow object count

expecting success: 
	(
		cd shallow &&
		test_must_fail git pull --depth 4 .. A
	)

[master 01ac0ec] 93
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - setup

expecting success: 

	(
		mkdir cloned &&
		cd cloned &&
		git init-db &&
		git remote add -f origin ..
	) &&
	cnt=$( (
		cd cloned &&
		git count-objects | sed -e "s/ *objects,.*//"
	) ) &&
	test $cnt -eq 3

Rebasing (2/2)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5502-quickfetch/cloned/.git/
[master 63da3c9] 94
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Updating origin
Stopped at babc8a4c7470895886fc129f1a015c486d05a351... D
[master 197b59d] 95
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
From ..
 * branch            A          -> FETCH_HEAD
Merging:
9ca64d8 B69 12506236f9d4e4c1150d951940e54aa6ef43c8d3
virtual f85e353c1b377970afbb804118d9135948598eea
found 0 common ancestors:
Auto-merging test.txt
CONFLICT (add/add): Merge conflict in test.txt
Automatic merge failed; fix conflicts and then commit the result.
ok 28 - pull in shallow repo with missing merge base

expecting success: 
	(
		cd shallow &&
		git fetch --depth=8 &&
		git fetch --depth=10 &&
		git fetch --depth=11
	)

[master 19b6a83] 96
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

From ..
 * [new branch]      master     -> origin/master
[master 4ef58a8] 97
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 2 - clone without alternate

expecting success: 

	test_tick &&
	echo ni >file &&
	git commit -a -m second &&

	cnt=$( (
		git count-objects | sed -e "s/ *objects,.*//"
	) ) &&
	test $cnt -eq 6

[master a0f12df] 98
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 12e0958] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
From file:///«PKGBUILDDIR»/t/trash directory.t5500-fetch-pack/.
 + 27f494d...9ca64d8 B          -> origin/B  (forced update)
ok 3 - further commits in the original

expecting success: 

	git rev-list --objects HEAD |
	git pack-objects --stdout |
	(
		cd cloned &&
		git unpack-objects
	) &&

	cnt=$( (
		cd cloned &&
		git count-objects | sed -e "s/ *objects,.*//"
	) ) &&
	test $cnt -eq 6 &&

	blob=$(git rev-parse HEAD:file | sed -e "s|..|&/|") &&
	test -f "cloned/.git/objects/$blob" &&
	rm -f "cloned/.git/objects/$blob" &&

	cnt=$( (
		cd cloned &&
		git count-objects | sed -e "s/ *objects,.*//"
	) ) &&
	test $cnt -eq 5


[master 95ff68f] 99
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master ab191fe] 100
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'one'...
ok 4 - copy commit and tree but not blob by hand

expecting success: 

	(
		cd cloned &&
		git fetch
	) &&

	cnt=$( (
		cd cloned &&
		git count-objects | sed -e "s/ *objects,.*//"
	) ) &&
	test $cnt -eq 6


[detached HEAD 4d045be] D
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
From ..
   f3b89bf..12e0958  master     -> origin/master
ok 5 - quickfetch should not leave a corrupted repository

expecting success: 

	(
		mkdir quickclone &&
		cd quickclone &&
		git init-db &&
		(cd ../.git/objects && pwd) >.git/objects/info/alternates &&
		git remote add origin .. &&
		git fetch -k -k
	) &&
	obj_cnt=$( (
		cd quickclone &&
		git count-objects | sed -e "s/ *objects,.*//"
	) ) &&
	pck_cnt=$( (
		cd quickclone &&
		git count-objects -v | sed -n -e "/packs:/{
				s/packs://
				p
				q
			}"
	) ) &&
	origin_master=$( (
		cd quickclone &&
		git rev-parse origin/master
	) ) &&
	echo "loose objects: $obj_cnt, packfiles: $pck_cnt" &&
	test $obj_cnt -eq 0 &&
	test $pck_cnt -eq 0 &&
	test z$origin_master = z$(git rev-parse master)


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5502-quickfetch/quickclone/.git/
[master c1a06f9] Z
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Rebasing (2/2)
ok 29 - additional simple shallow deepenings

expecting success: 
	test "`git --git-dir=shallow/.git rev-list --count HEAD`" = 11

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5501-fetch-push-alternates/receiver/.git/
ok 30 - clone shallow depth count

From ..
 * [new branch]      master     -> origin/master
expecting success: 
	(
		cd shallow &&
		git count-objects -v
	) > count.shallow &&
	grep "^count: 55" count.shallow

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5501-fetch-push-alternates/fetcher/.git/
ok 1 - setup

expecting success: 
	(
		cd one &&
		git push ../receiver master:refs/heads/it
	) &&
	(
		cd receiver &&
		count_objects >../receiver.count
	) &&
	test_cmp one.count receiver.count

Successfully rebased and updated refs/heads/master.
count: 55
ok 31 - clone shallow object count

expecting success: 
	test_must_fail git fetch --noshallow

error: unknown option `noshallow'
usage: git fetch [<options>] [<repository> [<refspec>...]]
   or: git fetch [<options>] <group>
   or: git fetch --multiple [<options>] [(<repository> | <group>)...]
   or: git fetch --all [<options>]

    -v, --verbose         be more verbose
    -q, --quiet           be more quiet
    --all                 fetch from all remotes
    -a, --append          append to .git/FETCH_HEAD instead of overwriting
    --upload-pack <path>  path to upload pack on remote end
    -f, --force           force overwrite of local branch
    -m, --multiple        fetch from multiple remotes
    -t, --tags            fetch all tags and associated objects
    -n                    do not fetch all tags (--no-tags)
    -p, --prune           prune remote-tracking branches no longer on remote
    --recurse-submodules[=<on-demand>]
                          control recursive fetching of submodules
    --dry-run             dry run
    -k, --keep            keep downloaded pack
    -u, --update-head-ok  allow updating of HEAD ref
    --progress            force progress reporting
    --depth <depth>       deepen history of shallow clone
    --unshallow           convert to a complete repository
    --update-shallow      accept refs that update .git/shallow
    --refmap <refmap>     specify fetch refmap

ok 32 - fetch --no-shallow on full repo

expecting success: 
	(
		cd shallow &&
		test_must_fail git fetch --depth=1 --noshallow
	)

error: unknown option `noshallow'
usage: git fetch [<options>] [<repository> [<refspec>...]]
   or: git fetch [<options>] <group>
   or: git fetch --multiple [<options>] [(<repository> | <group>)...]
   or: git fetch --all [<options>]

loose objects: 0, packfiles:  0
    -v, --verbose         be more verbose
    -q, --quiet           be more quiet
    --all                 fetch from all remotes
    -a, --append          append to .git/FETCH_HEAD instead of overwriting
    --upload-pack <path>  path to upload pack on remote end
    -f, --force           force overwrite of local branch
    -m, --multiple        fetch from multiple remotes
    -t, --tags            fetch all tags and associated objects
    -n                    do not fetch all tags (--no-tags)
    -p, --prune           prune remote-tracking branches no longer on remote
    --recurse-submodules[=<on-demand>]
                          control recursive fetching of submodules
    --dry-run             dry run
    -k, --keep            keep downloaded pack
    -u, --update-head-ok  allow updating of HEAD ref
    --progress            force progress reporting
    --depth <depth>       deepen history of shallow clone
    --unshallow           convert to a complete repository
    --update-shallow      accept refs that update .git/shallow
    --refmap <refmap>     specify fetch refmap

ok 33 - fetch --depth --no-shallow

expecting success: 
	(
		cd shallow &&
		git fetch --unshallow &&
		! test -f .git/shallow &&
		git fsck --full
	)

ok 6 - quickfetch should not copy from alternate

expecting success: 

	git gc &&
	head=$(git rev-parse HEAD) &&
	branchprefix="$head refs/heads/branch" &&
	for i in 0 1 2 3 4 5 6 7 8 9; do
		for j in 0 1 2 3 4 5 6 7 8 9; do
			for k in 0 1 2 3 4 5 6 7 8 9; do
				echo "$branchprefix$i$j$k" >> .git/packed-refs
			done
		done
	done &&
	(
		cd cloned &&
		git fetch &&
		git fetch
	)


ok 13 - git rebase -i (double edit)

expecting success: 
	git reset --hard D &&
	clear_hook_input &&
	FAKE_LINES="edit 1 exec_false 2" git rebase -i B &&
	echo something >bar &&
	git add bar &&
	# Fails because of exec false
	test_must_fail git rebase --continue &&
	git rebase --continue &&
	echo rebase >expected.args &&
	cat >expected.data <<-EOF &&
	$(git rev-parse C) $(git rev-parse HEAD^)
	$(git rev-parse D) $(git rev-parse HEAD)
	EOF
	verify_hook_input

HEAD is now at babc8a4 D
To ../receiver
 * [new branch]      master -> it
ok 2 - pushing into a repository with the same alternate

expecting success: 
	(
		cd fetcher &&
		git fetch ../one master:refs/heads/it &&
		count_objects >../fetcher.count
	) &&
	test_cmp one.count fetcher.count

From ../one
 * [new branch]      master     -> it
ok 3 - fetching from a repository with the same alternate

# passed all 3 test(s)
1..3
dangling blob d0d7cfb9e7278f44d08d259185e215abd0ddc32c
ok 34 - turn shallow to complete repository

expecting success: 
	git clone --depth 1 "file://$(pwd)/." shallow2

Cloning into 'shallow2'...
rebase -i script before editing:
From ..
 * [new branch]      branch000  -> origin/branch000
 * [new branch]      branch001  -> origin/branch001
pick 2362ae8 C
pick babc8a4 D

 * [new branch]      branch002  -> origin/branch002
 * [new branch]      branch003  -> origin/branch003
 * [new branch]      branch004  -> origin/branch004
 * [new branch]      branch005  -> origin/branch005
 * [new branch]      branch006  -> origin/branch006
 * [new branch]      branch007  -> origin/branch007
 * [new branch]      branch008  -> origin/branch008
 * [new branch]      branch009  -> origin/branch009
 * [new branch]      branch010  -> origin/branch010
 * [new branch]      branch011  -> origin/branch011
 * [new branch]      branch012  -> origin/branch012
rebase -i script after editing:
 * [new branch]      branch013  -> origin/branch013
edit 2362ae8 C
exec false
pick babc8a4 D
 * [new branch]      branch014  -> origin/branch014
*** t5503-tagfollow.sh ***
 * [new branch]      branch015  -> origin/branch015
 * [new branch]      branch016  -> origin/branch016
 * [new branch]      branch017  -> origin/branch017
 * [new branch]      branch018  -> origin/branch018
 * [new branch]      branch019  -> origin/branch019
 * [new branch]      branch020  -> origin/branch020
 * [new branch]      branch021  -> origin/branch021
 * [new branch]      branch022  -> origin/branch022
 * [new branch]      branch023  -> origin/branch023
 * [new branch]      branch024  -> origin/branch024
 * [new branch]      branch025  -> origin/branch025
 * [new branch]      branch026  -> origin/branch026
 * [new branch]      branch027  -> origin/branch027
 * [new branch]      branch028  -> origin/branch028
 * [new branch]      branch029  -> origin/branch029
 * [new branch]      branch030  -> origin/branch030
 * [new branch]      branch031  -> origin/branch031
 * [new branch]      branch032  -> origin/branch032
 * [new branch]      branch033  -> origin/branch033
 * [new branch]      branch034  -> origin/branch034
 * [new branch]      branch035  -> origin/branch035
 * [new branch]      branch036  -> origin/branch036
 * [new branch]      branch037  -> origin/branch037
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5503-tagfollow/.git/
 * [new branch]      branch038  -> origin/branch038
 * [new branch]      branch039  -> origin/branch039
 * [new branch]      branch040  -> origin/branch040
 * [new branch]      branch041  -> origin/branch041
 * [new branch]      branch042  -> origin/branch042
 * [new branch]      branch043  -> origin/branch043
 * [new branch]      branch044  -> origin/branch044
expecting success: 
	test_tick &&
	echo ichi >file &&
	git add file &&
	git commit -m L &&
	L=$(git rev-parse --verify HEAD) &&

	(
		mkdir cloned &&
		cd cloned &&
		git init-db &&
		git remote add -f origin ..
	) &&

	test_tick &&
	echo A >file &&
	git add file &&
	git commit -m A &&
	A=$(git rev-parse --verify HEAD)

 * [new branch]      branch045  -> origin/branch045
 * [new branch]      branch046  -> origin/branch046
 * [new branch]      branch047  -> origin/branch047
 * [new branch]      branch048  -> origin/branch048
 * [new branch]      branch049  -> origin/branch049
 * [new branch]      branch050  -> origin/branch050
 * [new branch]      branch051  -> origin/branch051
 * [new branch]      branch052  -> origin/branch052
 * [new branch]      branch053  -> origin/branch053
 * [new branch]      branch054  -> origin/branch054
ok 35 - clone shallow without --no-single-branch

expecting success: 
	(
		cd shallow2 &&
		git count-objects -v
	) > count.shallow2 &&
	grep "^in-pack: 3" count.shallow2

 * [new branch]      branch055  -> origin/branch055
 * [new branch]      branch056  -> origin/branch056
 * [new branch]      branch057  -> origin/branch057
 * [new branch]      branch058  -> origin/branch058
 * [new branch]      branch059  -> origin/branch059
 * [new branch]      branch060  -> origin/branch060
 * [new branch]      branch061  -> origin/branch061
 * [new branch]      branch062  -> origin/branch062
 * [new branch]      branch063  -> origin/branch063
 * [new branch]      branch064  -> origin/branch064
 * [new branch]      branch065  -> origin/branch065
 * [new branch]      branch066  -> origin/branch066
 * [new branch]      branch067  -> origin/branch067
 * [new branch]      branch068  -> origin/branch068
 * [new branch]      branch069  -> origin/branch069
 * [new branch]      branch070  -> origin/branch070
 * [new branch]      branch071  -> origin/branch071
in-pack: 3
ok 36 - clone shallow object count

expecting success: 
	git clone --depth 1 --branch A "file://$(pwd)/." shallow3

[master (root-commit) 6a9c5e4] L
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
 * [new branch]      branch072  -> origin/branch072
 * [new branch]      branch073  -> origin/branch073
 * [new branch]      branch074  -> origin/branch074
 * [new branch]      branch075  -> origin/branch075
 * [new branch]      branch076  -> origin/branch076
Cloning into 'shallow3'...
 * [new branch]      branch077  -> origin/branch077
 * [new branch]      branch078  -> origin/branch078
 * [new branch]      branch079  -> origin/branch079
 * [new branch]      branch080  -> origin/branch080
 * [new branch]      branch081  -> origin/branch081
 * [new branch]      branch082  -> origin/branch082
 * [new branch]      branch083  -> origin/branch083
 * [new branch]      branch084  -> origin/branch084
 * [new branch]      branch085  -> origin/branch085
 * [new branch]      branch086  -> origin/branch086
 * [new branch]      branch087  -> origin/branch087
 * [new branch]      branch088  -> origin/branch088
 * [new branch]      branch089  -> origin/branch089
 * [new branch]      branch090  -> origin/branch090
 * [new branch]      branch091  -> origin/branch091
 * [new branch]      branch092  -> origin/branch092
Rebasing (1/3)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5503-tagfollow/cloned/.git/
 * [new branch]      branch093  -> origin/branch093
 * [new branch]      branch094  -> origin/branch094
 * [new branch]      branch095  -> origin/branch095
 * [new branch]      branch096  -> origin/branch096
 * [new branch]      branch097  -> origin/branch097
 * [new branch]      branch098  -> origin/branch098
 * [new branch]      branch099  -> origin/branch099
 * [new branch]      branch100  -> origin/branch100
 * [new branch]      branch101  -> origin/branch101
Updating origin
 * [new branch]      branch102  -> origin/branch102
 * [new branch]      branch103  -> origin/branch103
 * [new branch]      branch104  -> origin/branch104
 * [new branch]      branch105  -> origin/branch105
 * [new branch]      branch106  -> origin/branch106
 * [new branch]      branch107  -> origin/branch107
 * [new branch]      branch108  -> origin/branch108
 * [new branch]      branch109  -> origin/branch109
 * [new branch]      branch110  -> origin/branch110
 * [new branch]      branch111  -> origin/branch111
 * [new branch]      branch112  -> origin/branch112
 * [new branch]      branch113  -> origin/branch113
 * [new branch]      branch114  -> origin/branch114
 * [new branch]      branch115  -> origin/branch115
 * [new branch]      branch116  -> origin/branch116
 * [new branch]      branch117  -> origin/branch117
 * [new branch]      branch118  -> origin/branch118
 * [new branch]      branch119  -> origin/branch119
Stopped at 2362ae8e1b1b865e6161e6f0e165ffb974abf018... C
 * [new branch]      branch120  -> origin/branch120
 * [new branch]      branch121  -> origin/branch121
 * [new branch]      branch122  -> origin/branch122
 * [new branch]      branch123  -> origin/branch123
 * [new branch]      branch124  -> origin/branch124
 * [new branch]      branch125  -> origin/branch125
 * [new branch]      branch126  -> origin/branch126
 * [new branch]      branch127  -> origin/branch127
 * [new branch]      branch128  -> origin/branch128
 * [new branch]      branch129  -> origin/branch129
 * [new branch]      branch130  -> origin/branch130
 * [new branch]      branch131  -> origin/branch131
 * [new branch]      branch132  -> origin/branch132
 * [new branch]      branch133  -> origin/branch133
 * [new branch]      branch134  -> origin/branch134
 * [new branch]      branch135  -> origin/branch135
 * [new branch]      branch136  -> origin/branch136
 * [new branch]      branch137  -> origin/branch137
 * [new branch]      branch138  -> origin/branch138
 * [new branch]      branch139  -> origin/branch139
 * [new branch]      branch140  -> origin/branch140
 * [new branch]      branch141  -> origin/branch141
 * [new branch]      branch142  -> origin/branch142
 * [new branch]      branch143  -> origin/branch143
 * [new branch]      branch144  -> origin/branch144
 * [new branch]      branch145  -> origin/branch145
 * [new branch]      branch146  -> origin/branch146
 * [new branch]      branch147  -> origin/branch147
 * [new branch]      branch148  -> origin/branch148
 * [new branch]      branch149  -> origin/branch149
 * [new branch]      branch150  -> origin/branch150
 * [new branch]      branch151  -> origin/branch151
 * [new branch]      branch152  -> origin/branch152
 * [new branch]      branch153  -> origin/branch153
From ..
 * [new branch]      master     -> origin/master
 * [new branch]      branch154  -> origin/branch154
 * [new branch]      branch155  -> origin/branch155
 * [new branch]      branch156  -> origin/branch156
 * [new branch]      branch157  -> origin/branch157
 * [new branch]      branch158  -> origin/branch158
 * [new branch]      branch159  -> origin/branch159
 * [new branch]      branch160  -> origin/branch160
 * [new branch]      branch161  -> origin/branch161
 * [new branch]      branch162  -> origin/branch162
 * [new branch]      branch163  -> origin/branch163
ok 37 - clone shallow with --branch

expecting success: 
	echo "in-pack: 3" > count3.expected &&
 * [new branch]      branch164  -> origin/branch164
	GIT_DIR=shallow3/.git git count-objects -v |
		grep "^in-pack" > count3.actual &&
	test_cmp count3.expected count3.actual

 * [new branch]      branch165  -> origin/branch165
 * [new branch]      branch166  -> origin/branch166
 * [new branch]      branch167  -> origin/branch167
 * [new branch]      branch168  -> origin/branch168
You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

 * [new branch]      branch169  -> origin/branch169
 * [new branch]      branch170  -> origin/branch170
 * [new branch]      branch171  -> origin/branch171
 * [new branch]      branch172  -> origin/branch172
 * [new branch]      branch173  -> origin/branch173
 * [new branch]      branch174  -> origin/branch174
 * [new branch]      branch175  -> origin/branch175
 * [new branch]      branch176  -> origin/branch176
 * [new branch]      branch177  -> origin/branch177
 * [new branch]      branch178  -> origin/branch178
 * [new branch]      branch179  -> origin/branch179
 * [new branch]      branch180  -> origin/branch180
 * [new branch]      branch181  -> origin/branch181
ok 38 - clone shallow object count

expecting success: 
	git checkout HEAD^ &&
	git clone --depth 1 "file://$(pwd)/." shallow5 &&
	git checkout - &&
	GIT_DIR=shallow5/.git git rev-parse HEAD >actual &&
	git rev-parse HEAD^ >expected &&
	test_cmp expected actual

 * [new branch]      branch182  -> origin/branch182
 * [new branch]      branch183  -> origin/branch183
 * [new branch]      branch184  -> origin/branch184
 * [new branch]      branch185  -> origin/branch185
 * [new branch]      branch186  -> origin/branch186
 * [new branch]      branch187  -> origin/branch187
 * [new branch]      branch188  -> origin/branch188
 * [new branch]      branch189  -> origin/branch189
 * [new branch]      branch190  -> origin/branch190
 * [new branch]      branch191  -> origin/branch191
 * [new branch]      branch192  -> origin/branch192
[master c06aaaf] A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
 * [new branch]      branch193  -> origin/branch193
 * [new branch]      branch194  -> origin/branch194
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>

 * [new branch]      branch195  -> origin/branch195
 * [new branch]      branch196  -> origin/branch196
HEAD is now at 1250623... B68 437bc546da4e1741a26c6bfb6b7eeb6e56e2677f
 * [new branch]      branch197  -> origin/branch197
 * [new branch]      branch198  -> origin/branch198
 * [new branch]      branch199  -> origin/branch199
 * [new branch]      branch200  -> origin/branch200
ok 1 - setup

 * [new branch]      branch201  -> origin/branch201
expecting success: 
cat - <<EOF >expect
want $A
EOF

 * [new branch]      branch202  -> origin/branch202
 * [new branch]      branch203  -> origin/branch203
 * [new branch]      branch204  -> origin/branch204
 * [new branch]      branch205  -> origin/branch205
 * [new branch]      branch206  -> origin/branch206
Cloning into 'shallow5'...
 * [new branch]      branch207  -> origin/branch207
 * [new branch]      branch208  -> origin/branch208
ok 2 - setup expect

expecting success: 
 * [new branch]      branch209  -> origin/branch209
	rm -f $U &&
	(
		cd cloned &&
		GIT_TRACE_PACKET=$UPATH git fetch &&
		test $A = $(git rev-parse --verify origin/master)
	) &&
	get_needs $U >actual &&
	test_cmp expect actual

 * [new branch]      branch210  -> origin/branch210
 * [new branch]      branch211  -> origin/branch211
 * [new branch]      branch212  -> origin/branch212
 * [new branch]      branch213  -> origin/branch213
 * [new branch]      branch214  -> origin/branch214
 * [new branch]      branch215  -> origin/branch215
 * [new branch]      branch216  -> origin/branch216
 * [new branch]      branch217  -> origin/branch217
 * [new branch]      branch218  -> origin/branch218
 * [new branch]      branch219  -> origin/branch219
 * [new branch]      branch220  -> origin/branch220
 * [new branch]      branch221  -> origin/branch221
 * [new branch]      branch222  -> origin/branch222
 * [new branch]      branch223  -> origin/branch223
 * [new branch]      branch224  -> origin/branch224
 * [new branch]      branch225  -> origin/branch225
 * [new branch]      branch226  -> origin/branch226
 * [new branch]      branch227  -> origin/branch227
 * [new branch]      branch228  -> origin/branch228
 * [new branch]      branch229  -> origin/branch229
 * [new branch]      branch230  -> origin/branch230
 * [new branch]      branch231  -> origin/branch231
 * [new branch]      branch232  -> origin/branch232
 * [new branch]      branch233  -> origin/branch233
 * [new branch]      branch234  -> origin/branch234
 * [new branch]      branch235  -> origin/branch235
 * [new branch]      branch236  -> origin/branch236
 * [new branch]      branch237  -> origin/branch237
 * [new branch]      branch238  -> origin/branch238
 * [new branch]      branch239  -> origin/branch239
 * [new branch]      branch240  -> origin/branch240
 * [new branch]      branch241  -> origin/branch241
 * [new branch]      branch242  -> origin/branch242
 * [new branch]      branch243  -> origin/branch243
 * [new branch]      branch244  -> origin/branch244
 * [new branch]      branch245  -> origin/branch245
 * [new branch]      branch246  -> origin/branch246
 * [new branch]      branch247  -> origin/branch247
 * [new branch]      branch248  -> origin/branch248
 * [new branch]      branch249  -> origin/branch249
 * [new branch]      branch250  -> origin/branch250
 * [new branch]      branch251  -> origin/branch251
 * [new branch]      branch252  -> origin/branch252
 * [new branch]      branch253  -> origin/branch253
 * [new branch]      branch254  -> origin/branch254
 * [new branch]      branch255  -> origin/branch255
 * [new branch]      branch256  -> origin/branch256
 * [new branch]      branch257  -> origin/branch257
From ..
   6a9c5e4..c06aaaf  master     -> origin/master
 * [new branch]      branch258  -> origin/branch258
 * [new branch]      branch259  -> origin/branch259
 * [new branch]      branch260  -> origin/branch260
 * [new branch]      branch261  -> origin/branch261
 * [new branch]      branch262  -> origin/branch262
 * [new branch]      branch263  -> origin/branch263
 * [new branch]      branch264  -> origin/branch264
 * [new branch]      branch265  -> origin/branch265
 * [new branch]      branch266  -> origin/branch266
 * [new branch]      branch267  -> origin/branch267
 * [new branch]      branch268  -> origin/branch268
 * [new branch]      branch269  -> origin/branch269
 * [new branch]      branch270  -> origin/branch270
 * [new branch]      branch271  -> origin/branch271
 * [new branch]      branch272  -> origin/branch272
 * [new branch]      branch273  -> origin/branch273
 * [new branch]      branch274  -> origin/branch274
 * [new branch]      branch275  -> origin/branch275
ok 3 - fetch A (new commit : 1 connection)

 * [new branch]      branch276  -> origin/branch276
Note: checking out '12506236f9d4e4c1150d951940e54aa6ef43c8d3'.

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>

expecting success: 
	git tag -a -m tag1 tag1 $A &&
	T=$(git rev-parse --verify tag1) &&

	git checkout -b cat &&
	echo C >file &&
	git add file &&
	git commit -m C &&
	C=$(git rev-parse --verify HEAD) &&
	git checkout master

 * [new branch]      branch277  -> origin/branch277
 * [new branch]      branch278  -> origin/branch278
 * [new branch]      branch279  -> origin/branch279
 * [new branch]      branch280  -> origin/branch280
 * [new branch]      branch281  -> origin/branch281
 * [new branch]      branch282  -> origin/branch282
 * [new branch]      branch283  -> origin/branch283
 * [new branch]      branch284  -> origin/branch284
 * [new branch]      branch285  -> origin/branch285
 * [new branch]      branch286  -> origin/branch286
 * [new branch]      branch287  -> origin/branch287
 * [new branch]      branch288  -> origin/branch288
 * [new branch]      branch289  -> origin/branch289
 * [new branch]      branch290  -> origin/branch290
 * [new branch]      branch291  -> origin/branch291
Previous HEAD position was 1250623... B68 437bc546da4e1741a26c6bfb6b7eeb6e56e2677f
Switched to branch 'B'
 * [new branch]      branch292  -> origin/branch292
 * [new branch]      branch293  -> origin/branch293
 * [new branch]      branch294  -> origin/branch294
 * [new branch]      branch295  -> origin/branch295
 * [new branch]      branch296  -> origin/branch296
 * [new branch]      branch297  -> origin/branch297
 * [new branch]      branch298  -> origin/branch298
 * [new branch]      branch299  -> origin/branch299
 * [new branch]      branch300  -> origin/branch300
 * [new branch]      branch301  -> origin/branch301
 * [new branch]      branch302  -> origin/branch302
Switched to a new branch 'cat'
 * [new branch]      branch303  -> origin/branch303
 * [new branch]      branch304  -> origin/branch304
 * [new branch]      branch305  -> origin/branch305
 * [new branch]      branch306  -> origin/branch306
 * [new branch]      branch307  -> origin/branch307
 * [new branch]      branch308  -> origin/branch308
 * [new branch]      branch309  -> origin/branch309
 * [new branch]      branch310  -> origin/branch310
 * [new branch]      branch311  -> origin/branch311
ok 39 - clone shallow with detached HEAD

expecting success: 
	git tag -a -m A TAGA1 A &&
	git tag -a -m B TAGB1 B &&
	git tag TAGA2 A &&
	git tag TAGB2 B &&
	git clone --depth 1 "file://$(pwd)/." shallow6 &&

	cat >taglist.expected <<\EOF &&
TAGB1
TAGB2
EOF
	GIT_DIR=shallow6/.git git tag -l >taglist.actual &&
	test_cmp taglist.expected taglist.actual &&

	echo "in-pack: 4" > count6.expected &&
	GIT_DIR=shallow6/.git git count-objects -v |
		grep "^in-pack" > count6.actual &&
	test_cmp count6.expected count6.actual

 * [new branch]      branch312  -> origin/branch312
 * [new branch]      branch313  -> origin/branch313
 * [new branch]      branch314  -> origin/branch314
 * [new branch]      branch315  -> origin/branch315
 * [new branch]      branch316  -> origin/branch316
 * [new branch]      branch317  -> origin/branch317
 * [new branch]      branch318  -> origin/branch318
 * [new branch]      branch319  -> origin/branch319
 * [new branch]      branch320  -> origin/branch320
 * [new branch]      branch321  -> origin/branch321
 * [new branch]      branch322  -> origin/branch322
 * [new branch]      branch323  -> origin/branch323
 * [new branch]      branch324  -> origin/branch324
 * [new branch]      branch325  -> origin/branch325
[detached HEAD 488028e] C
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 bar
 * [new branch]      branch326  -> origin/branch326
 * [new branch]      branch327  -> origin/branch327
 * [new branch]      branch328  -> origin/branch328
 * [new branch]      branch329  -> origin/branch329
[cat f888ed6] C
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
 * [new branch]      branch330  -> origin/branch330
 * [new branch]      branch331  -> origin/branch331
 * [new branch]      branch332  -> origin/branch332
 * [new branch]      branch333  -> origin/branch333
 * [new branch]      branch334  -> origin/branch334
 * [new branch]      branch335  -> origin/branch335
 * [new branch]      branch336  -> origin/branch336
 * [new branch]      branch337  -> origin/branch337
 * [new branch]      branch338  -> origin/branch338
 * [new branch]      branch339  -> origin/branch339
 * [new branch]      branch340  -> origin/branch340
 * [new branch]      branch341  -> origin/branch341
 * [new branch]      branch342  -> origin/branch342
 * [new branch]      branch343  -> origin/branch343
Switched to branch 'master'
 * [new branch]      branch344  -> origin/branch344
 * [new branch]      branch345  -> origin/branch345
ok 4 - create tag T on A, create C on branch cat

expecting success: 
cat - <<EOF >expect
want $C
want $T
EOF

 * [new branch]      branch346  -> origin/branch346
 * [new branch]      branch347  -> origin/branch347
 * [new branch]      branch348  -> origin/branch348
 * [new branch]      branch349  -> origin/branch349
 * [new branch]      branch350  -> origin/branch350
ok 5 - setup expect

expecting success: 
	rm -f $U &&
	(
		cd cloned &&
		GIT_TRACE_PACKET=$UPATH git fetch &&
		test $C = $(git rev-parse --verify origin/cat) &&
		test $T = $(git rev-parse --verify tag1) &&
		test $A = $(git rev-parse --verify tag1^0)
	) &&
	get_needs $U >actual &&
	test_cmp expect actual

 * [new branch]      branch351  -> origin/branch351
 * [new branch]      branch352  -> origin/branch352
 * [new branch]      branch353  -> origin/branch353
 * [new branch]      branch354  -> origin/branch354
 * [new branch]      branch355  -> origin/branch355
 * [new branch]      branch356  -> origin/branch356
 * [new branch]      branch357  -> origin/branch357
 * [new branch]      branch358  -> origin/branch358
 * [new branch]      branch359  -> origin/branch359
 * [new branch]      branch360  -> origin/branch360
 * [new branch]      branch361  -> origin/branch361
Cloning into 'shallow6'...
 * [new branch]      branch362  -> origin/branch362
 * [new branch]      branch363  -> origin/branch363
 * [new branch]      branch364  -> origin/branch364
 * [new branch]      branch365  -> origin/branch365
 * [new branch]      branch366  -> origin/branch366
 * [new branch]      branch367  -> origin/branch367
 * [new branch]      branch368  -> origin/branch368
 * [new branch]      branch369  -> origin/branch369
 * [new branch]      branch370  -> origin/branch370
 * [new branch]      branch371  -> origin/branch371
 * [new branch]      branch372  -> origin/branch372
 * [new branch]      branch373  -> origin/branch373
 * [new branch]      branch374  -> origin/branch374
 * [new branch]      branch375  -> origin/branch375
 * [new branch]      branch376  -> origin/branch376
 * [new branch]      branch377  -> origin/branch377
 * [new branch]      branch378  -> origin/branch378
 * [new branch]      branch379  -> origin/branch379
 * [new branch]      branch380  -> origin/branch380
 * [new branch]      branch381  -> origin/branch381
 * [new branch]      branch382  -> origin/branch382
 * [new branch]      branch383  -> origin/branch383
 * [new branch]      branch384  -> origin/branch384
 * [new branch]      branch385  -> origin/branch385
 * [new branch]      branch386  -> origin/branch386
 * [new branch]      branch387  -> origin/branch387
 * [new branch]      branch388  -> origin/branch388
 * [new branch]      branch389  -> origin/branch389
 * [new branch]      branch390  -> origin/branch390
 * [new branch]      branch391  -> origin/branch391
 * [new branch]      branch392  -> origin/branch392
 * [new branch]      branch393  -> origin/branch393
 * [new branch]      branch394  -> origin/branch394
 * [new branch]      branch395  -> origin/branch395
 * [new branch]      branch396  -> origin/branch396
 * [new branch]      branch397  -> origin/branch397
 * [new branch]      branch398  -> origin/branch398
 * [new branch]      branch399  -> origin/branch399
 * [new branch]      branch400  -> origin/branch400
 * [new branch]      branch401  -> origin/branch401
 * [new branch]      branch402  -> origin/branch402
 * [new branch]      branch403  -> origin/branch403
 * [new branch]      branch404  -> origin/branch404
 * [new branch]      branch405  -> origin/branch405
 * [new branch]      branch406  -> origin/branch406
 * [new branch]      branch407  -> origin/branch407
 * [new branch]      branch408  -> origin/branch408
 * [new branch]      branch409  -> origin/branch409
 * [new branch]      branch410  -> origin/branch410
From ..
 * [new branch]      cat        -> origin/cat
Rebasing (2/3)
Executing: false
 * [new branch]      branch411  -> origin/branch411
 * [new tag]         tag1       -> tag1
 * [new branch]      branch412  -> origin/branch412
 * [new branch]      branch413  -> origin/branch413
 * [new branch]      branch414  -> origin/branch414
 * [new branch]      branch415  -> origin/branch415
 * [new branch]      branch416  -> origin/branch416
 * [new branch]      branch417  -> origin/branch417
 * [new branch]      branch418  -> origin/branch418
 * [new branch]      branch419  -> origin/branch419
 * [new branch]      branch420  -> origin/branch420
 * [new branch]      branch421  -> origin/branch421
 * [new branch]      branch422  -> origin/branch422
 * [new branch]      branch423  -> origin/branch423
 * [new branch]      branch424  -> origin/branch424
 * [new branch]      branch425  -> origin/branch425
 * [new branch]      branch426  -> origin/branch426
 * [new branch]      branch427  -> origin/branch427
 * [new branch]      branch428  -> origin/branch428
 * [new branch]      branch429  -> origin/branch429
 * [new branch]      branch430  -> origin/branch430
 * [new branch]      branch431  -> origin/branch431
 * [new branch]      branch432  -> origin/branch432
Execution failed: false
You can fix the problem, and then run

	git rebase --continue

 * [new branch]      branch433  -> origin/branch433
 * [new branch]      branch434  -> origin/branch434
 * [new branch]      branch435  -> origin/branch435
 * [new branch]      branch436  -> origin/branch436
 * [new branch]      branch437  -> origin/branch437
 * [new branch]      branch438  -> origin/branch438
 * [new branch]      branch439  -> origin/branch439
 * [new branch]      branch440  -> origin/branch440
 * [new branch]      branch441  -> origin/branch441
 * [new branch]      branch442  -> origin/branch442
ok 6 - fetch C, T (new branch, tag : 1 connection)

expecting success: 
	test_tick &&
	echo O >file &&
	git add file &&
	git commit -m O &&

	test_tick &&
	echo B >file &&
	git add file &&
	git commit -m B &&
	B=$(git rev-parse --verify HEAD) &&

	git tag -a -m tag2 tag2 $B &&
	S=$(git rev-parse --verify tag2)

 * [new branch]      branch443  -> origin/branch443
 * [new branch]      branch444  -> origin/branch444
 * [new branch]      branch445  -> origin/branch445
 * [new branch]      branch446  -> origin/branch446
 * [new branch]      branch447  -> origin/branch447
 * [new branch]      branch448  -> origin/branch448
 * [new branch]      branch449  -> origin/branch449
 * [new branch]      branch450  -> origin/branch450
 * [new branch]      branch451  -> origin/branch451
 * [new branch]      branch452  -> origin/branch452
 * [new branch]      branch453  -> origin/branch453
 * [new branch]      branch454  -> origin/branch454
 * [new branch]      branch455  -> origin/branch455
 * [new branch]      branch456  -> origin/branch456
 * [new branch]      branch457  -> origin/branch457
 * [new branch]      branch458  -> origin/branch458
 * [new branch]      branch459  -> origin/branch459
 * [new branch]      branch460  -> origin/branch460
 * [new branch]      branch461  -> origin/branch461
 * [new branch]      branch462  -> origin/branch462
 * [new branch]      branch463  -> origin/branch463
 * [new branch]      branch464  -> origin/branch464
 * [new branch]      branch465  -> origin/branch465
 * [new branch]      branch466  -> origin/branch466
 * [new branch]      branch467  -> origin/branch467
 * [new branch]      branch468  -> origin/branch468
 * [new branch]      branch469  -> origin/branch469
 * [new branch]      branch470  -> origin/branch470
 * [new branch]      branch471  -> origin/branch471
 * [new branch]      branch472  -> origin/branch472
 * [new branch]      branch473  -> origin/branch473
 * [new branch]      branch474  -> origin/branch474
[master 0129221] O
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
 * [new branch]      branch475  -> origin/branch475
 * [new branch]      branch476  -> origin/branch476
 * [new branch]      branch477  -> origin/branch477
 * [new branch]      branch478  -> origin/branch478
 * [new branch]      branch479  -> origin/branch479
 * [new branch]      branch480  -> origin/branch480
 * [new branch]      branch481  -> origin/branch481
 * [new branch]      branch482  -> origin/branch482
 * [new branch]      branch483  -> origin/branch483
 * [new branch]      branch484  -> origin/branch484
 * [new branch]      branch485  -> origin/branch485
 * [new branch]      branch486  -> origin/branch486
 * [new branch]      branch487  -> origin/branch487
 * [new branch]      branch488  -> origin/branch488
 * [new branch]      branch489  -> origin/branch489
 * [new branch]      branch490  -> origin/branch490
 * [new branch]      branch491  -> origin/branch491
 * [new branch]      branch492  -> origin/branch492
 * [new branch]      branch493  -> origin/branch493
 * [new branch]      branch494  -> origin/branch494
 * [new branch]      branch495  -> origin/branch495
 * [new branch]      branch496  -> origin/branch496
 * [new branch]      branch497  -> origin/branch497
ok 40 - shallow clone pulling tags

expecting success: 
	git clone --depth 1 --branch=TAGB1 "file://$(pwd)/." shallow7 &&
	cat >taglist.expected <<\EOF &&
TAGB1
TAGB2
EOF
	GIT_DIR=shallow7/.git git tag -l >taglist.actual &&
	test_cmp taglist.expected taglist.actual &&
 * [new branch]      branch498  -> origin/branch498

	echo "in-pack: 4" > count7.expected &&
	GIT_DIR=shallow7/.git git count-objects -v |
		grep "^in-pack" > count7.actual &&
	test_cmp count7.expected count7.actual

 * [new branch]      branch499  -> origin/branch499
 * [new branch]      branch500  -> origin/branch500
 * [new branch]      branch501  -> origin/branch501
 * [new branch]      branch502  -> origin/branch502
 * [new branch]      branch503  -> origin/branch503
 * [new branch]      branch504  -> origin/branch504
[master 8e10cf4] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
 * [new branch]      branch505  -> origin/branch505
 * [new branch]      branch506  -> origin/branch506
 * [new branch]      branch507  -> origin/branch507
 * [new branch]      branch508  -> origin/branch508
 * [new branch]      branch509  -> origin/branch509
 * [new branch]      branch510  -> origin/branch510
Cloning into 'shallow7'...
 * [new branch]      branch511  -> origin/branch511
 * [new branch]      branch512  -> origin/branch512
 * [new branch]      branch513  -> origin/branch513
 * [new branch]      branch514  -> origin/branch514
 * [new branch]      branch515  -> origin/branch515
 * [new branch]      branch516  -> origin/branch516
 * [new branch]      branch517  -> origin/branch517
 * [new branch]      branch518  -> origin/branch518
 * [new branch]      branch519  -> origin/branch519
 * [new branch]      branch520  -> origin/branch520
 * [new branch]      branch521  -> origin/branch521
 * [new branch]      branch522  -> origin/branch522
ok 7 - create commits O, B, tag S on B

expecting success: 
cat - <<EOF >expect
want $B
want $S
EOF

 * [new branch]      branch523  -> origin/branch523
 * [new branch]      branch524  -> origin/branch524
 * [new branch]      branch525  -> origin/branch525
 * [new branch]      branch526  -> origin/branch526
 * [new branch]      branch527  -> origin/branch527
ok 8 - setup expect

expecting success: 
	rm -f $U &&
	(
		cd cloned &&
		GIT_TRACE_PACKET=$UPATH git fetch &&
		test $B = $(git rev-parse --verify origin/master) &&
		test $B = $(git rev-parse --verify tag2^0) &&
		test $S = $(git rev-parse --verify tag2)
 * [new branch]      branch528  -> origin/branch528
	) &&
	get_needs $U >actual &&
	test_cmp expect actual

 * [new branch]      branch529  -> origin/branch529
 * [new branch]      branch530  -> origin/branch530
 * [new branch]      branch531  -> origin/branch531
 * [new branch]      branch532  -> origin/branch532
 * [new branch]      branch533  -> origin/branch533
 * [new branch]      branch534  -> origin/branch534
 * [new branch]      branch535  -> origin/branch535
 * [new branch]      branch536  -> origin/branch536
 * [new branch]      branch537  -> origin/branch537
 * [new branch]      branch538  -> origin/branch538
 * [new branch]      branch539  -> origin/branch539
 * [new branch]      branch540  -> origin/branch540
 * [new branch]      branch541  -> origin/branch541
 * [new branch]      branch542  -> origin/branch542
 * [new branch]      branch543  -> origin/branch543
 * [new branch]      branch544  -> origin/branch544
 * [new branch]      branch545  -> origin/branch545
 * [new branch]      branch546  -> origin/branch546
 * [new branch]      branch547  -> origin/branch547
 * [new branch]      branch548  -> origin/branch548
 * [new branch]      branch549  -> origin/branch549
 * [new branch]      branch550  -> origin/branch550
 * [new branch]      branch551  -> origin/branch551
 * [new branch]      branch552  -> origin/branch552
 * [new branch]      branch553  -> origin/branch553
 * [new branch]      branch554  -> origin/branch554
 * [new branch]      branch555  -> origin/branch555
 * [new branch]      branch556  -> origin/branch556
 * [new branch]      branch557  -> origin/branch557
 * [new branch]      branch558  -> origin/branch558
 * [new branch]      branch559  -> origin/branch559
 * [new branch]      branch560  -> origin/branch560
 * [new branch]      branch561  -> origin/branch561
 * [new branch]      branch562  -> origin/branch562
 * [new branch]      branch563  -> origin/branch563
 * [new branch]      branch564  -> origin/branch564
 * [new branch]      branch565  -> origin/branch565
 * [new branch]      branch566  -> origin/branch566
 * [new branch]      branch567  -> origin/branch567
 * [new branch]      branch568  -> origin/branch568
 * [new branch]      branch569  -> origin/branch569
 * [new branch]      branch570  -> origin/branch570
 * [new branch]      branch571  -> origin/branch571
 * [new branch]      branch572  -> origin/branch572
 * [new branch]      branch573  -> origin/branch573
 * [new branch]      branch574  -> origin/branch574
 * [new branch]      branch575  -> origin/branch575
 * [new branch]      branch576  -> origin/branch576
 * [new branch]      branch577  -> origin/branch577
 * [new branch]      branch578  -> origin/branch578
 * [new branch]      branch579  -> origin/branch579
 * [new branch]      branch580  -> origin/branch580
 * [new branch]      branch581  -> origin/branch581
 * [new branch]      branch582  -> origin/branch582
 * [new branch]      branch583  -> origin/branch583
 * [new branch]      branch584  -> origin/branch584
From ..
   c06aaaf..8e10cf4  master     -> origin/master
 * [new branch]      branch585  -> origin/branch585
 * [new tag]         tag2       -> tag2
 * [new branch]      branch586  -> origin/branch586
 * [new branch]      branch587  -> origin/branch587
 * [new branch]      branch588  -> origin/branch588
 * [new branch]      branch589  -> origin/branch589
 * [new branch]      branch590  -> origin/branch590
 * [new branch]      branch591  -> origin/branch591
 * [new branch]      branch592  -> origin/branch592
 * [new branch]      branch593  -> origin/branch593
 * [new branch]      branch594  -> origin/branch594
 * [new branch]      branch595  -> origin/branch595
 * [new branch]      branch596  -> origin/branch596
 * [new branch]      branch597  -> origin/branch597
 * [new branch]      branch598  -> origin/branch598
Note: checking out '9ca64d8fd8038b086badca1d11ccd8bbcfdeace1'.

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>

 * [new branch]      branch599  -> origin/branch599
 * [new branch]      branch600  -> origin/branch600
 * [new branch]      branch601  -> origin/branch601
 * [new branch]      branch602  -> origin/branch602
 * [new branch]      branch603  -> origin/branch603
 * [new branch]      branch604  -> origin/branch604
 * [new branch]      branch605  -> origin/branch605
 * [new branch]      branch606  -> origin/branch606
 * [new branch]      branch607  -> origin/branch607
 * [new branch]      branch608  -> origin/branch608
 * [new branch]      branch609  -> origin/branch609
 * [new branch]      branch610  -> origin/branch610
 * [new branch]      branch611  -> origin/branch611
 * [new branch]      branch612  -> origin/branch612
 * [new branch]      branch613  -> origin/branch613
 * [new branch]      branch614  -> origin/branch614
 * [new branch]      branch615  -> origin/branch615
 * [new branch]      branch616  -> origin/branch616
 * [new branch]      branch617  -> origin/branch617
 * [new branch]      branch618  -> origin/branch618
 * [new branch]      branch619  -> origin/branch619
 * [new branch]      branch620  -> origin/branch620
 * [new branch]      branch621  -> origin/branch621
 * [new branch]      branch622  -> origin/branch622
Rebasing (3/3)
ok 9 - fetch B, S (commit and tag : 1 connection)

expecting success: 
cat - <<EOF >expect
want $B
want $S
EOF

 * [new branch]      branch623  -> origin/branch623
 * [new branch]      branch624  -> origin/branch624
 * [new branch]      branch625  -> origin/branch625
 * [new branch]      branch626  -> origin/branch626
 * [new branch]      branch627  -> origin/branch627
ok 10 - setup expect

 * [new branch]      branch628  -> origin/branch628
expecting success: 
	test_might_fail git branch -D cat &&
	rm -f $U &&
	(
		mkdir clone2 &&
		cd clone2 &&
		git init &&
		git remote add origin .. &&
		GIT_TRACE_PACKET=$UPATH git fetch &&
		test $B = $(git rev-parse --verify origin/master) &&
		test $S = $(git rev-parse --verify tag2) &&
		test $B = $(git rev-parse --verify tag2^0) &&
		test $T = $(git rev-parse --verify tag1) &&
		test $A = $(git rev-parse --verify tag1^0)
	) &&
	get_needs $U >actual &&
	test_cmp expect actual

 * [new branch]      branch629  -> origin/branch629
 * [new branch]      branch630  -> origin/branch630
ok 41 - shallow cloning single tag

 * [new branch]      branch631  -> origin/branch631
expecting success: 
	git pack-refs --all &&
	git clone --depth 1 --branch A "file://$(pwd)/." shallow8 &&
	echo "in-pack: 4" > count8.expected &&
	GIT_DIR=shallow8/.git git count-objects -v |
		grep "^in-pack" > count8.actual &&
	test_cmp count8.expected count8.actual

 * [new branch]      branch632  -> origin/branch632
 * [new branch]      branch633  -> origin/branch633
 * [new branch]      branch634  -> origin/branch634
 * [new branch]      branch635  -> origin/branch635
 * [new branch]      branch636  -> origin/branch636
 * [new branch]      branch637  -> origin/branch637
 * [new branch]      branch638  -> origin/branch638
 * [new branch]      branch639  -> origin/branch639
 * [new branch]      branch640  -> origin/branch640
 * [new branch]      branch641  -> origin/branch641
 * [new branch]      branch642  -> origin/branch642
Deleted branch cat (was f888ed6).
 * [new branch]      branch643  -> origin/branch643
 * [new branch]      branch644  -> origin/branch644
 * [new branch]      branch645  -> origin/branch645
 * [new branch]      branch646  -> origin/branch646
 * [new branch]      branch647  -> origin/branch647
 * [new branch]      branch648  -> origin/branch648
 * [new branch]      branch649  -> origin/branch649
 * [new branch]      branch650  -> origin/branch650
 * [new branch]      branch651  -> origin/branch651
 * [new branch]      branch652  -> origin/branch652
 * [new branch]      branch653  -> origin/branch653
Cloning into 'shallow8'...
 * [new branch]      branch654  -> origin/branch654
 * [new branch]      branch655  -> origin/branch655
Successfully rebased and updated refs/heads/master.
 * [new branch]      branch656  -> origin/branch656
 * [new branch]      branch657  -> origin/branch657
 * [new branch]      branch658  -> origin/branch658
 * [new branch]      branch659  -> origin/branch659
 * [new branch]      branch660  -> origin/branch660
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5503-tagfollow/clone2/.git/
 * [new branch]      branch661  -> origin/branch661
 * [new branch]      branch662  -> origin/branch662
 * [new branch]      branch663  -> origin/branch663
 * [new branch]      branch664  -> origin/branch664
 * [new branch]      branch665  -> origin/branch665
 * [new branch]      branch666  -> origin/branch666
 * [new branch]      branch667  -> origin/branch667
 * [new branch]      branch668  -> origin/branch668
 * [new branch]      branch669  -> origin/branch669
 * [new branch]      branch670  -> origin/branch670
 * [new branch]      branch671  -> origin/branch671
 * [new branch]      branch672  -> origin/branch672
 * [new branch]      branch673  -> origin/branch673
 * [new branch]      branch674  -> origin/branch674
 * [new branch]      branch675  -> origin/branch675
 * [new branch]      branch676  -> origin/branch676
 * [new branch]      branch677  -> origin/branch677
 * [new branch]      branch678  -> origin/branch678
 * [new branch]      branch679  -> origin/branch679
 * [new branch]      branch680  -> origin/branch680
 * [new branch]      branch681  -> origin/branch681
 * [new branch]      branch682  -> origin/branch682
 * [new branch]      branch683  -> origin/branch683
 * [new branch]      branch684  -> origin/branch684
 * [new branch]      branch685  -> origin/branch685
 * [new branch]      branch686  -> origin/branch686
 * [new branch]      branch687  -> origin/branch687
 * [new branch]      branch688  -> origin/branch688
 * [new branch]      branch689  -> origin/branch689
 * [new branch]      branch690  -> origin/branch690
 * [new branch]      branch691  -> origin/branch691
 * [new branch]      branch692  -> origin/branch692
 * [new branch]      branch693  -> origin/branch693
 * [new branch]      branch694  -> origin/branch694
 * [new branch]      branch695  -> origin/branch695
 * [new branch]      branch696  -> origin/branch696
 * [new branch]      branch697  -> origin/branch697
 * [new branch]      branch698  -> origin/branch698
 * [new branch]      branch699  -> origin/branch699
 * [new branch]      branch700  -> origin/branch700
ok 14 - git rebase -i (exec)

 * [new branch]      branch701  -> origin/branch701
 * [new branch]      branch702  -> origin/branch702
 * [new branch]      branch703  -> origin/branch703
 * [new branch]      branch704  -> origin/branch704
 * [new branch]      branch705  -> origin/branch705
# passed all 14 test(s)
1..14
 * [new branch]      branch706  -> origin/branch706
 * [new branch]      branch707  -> origin/branch707
 * [new branch]      branch708  -> origin/branch708
 * [new branch]      branch709  -> origin/branch709
 * [new branch]      branch710  -> origin/branch710
 * [new branch]      branch711  -> origin/branch711
 * [new branch]      branch712  -> origin/branch712
 * [new branch]      branch713  -> origin/branch713
 * [new branch]      branch714  -> origin/branch714
 * [new branch]      branch715  -> origin/branch715
 * [new branch]      branch716  -> origin/branch716
 * [new branch]      branch717  -> origin/branch717
 * [new branch]      branch718  -> origin/branch718
 * [new branch]      branch719  -> origin/branch719
 * [new branch]      branch720  -> origin/branch720
 * [new branch]      branch721  -> origin/branch721
 * [new branch]      branch722  -> origin/branch722
 * [new branch]      branch723  -> origin/branch723
 * [new branch]      branch724  -> origin/branch724
 * [new branch]      branch725  -> origin/branch725
 * [new branch]      branch726  -> origin/branch726
From ..
 * [new branch]      master     -> origin/master
 * [new branch]      branch727  -> origin/branch727
 * [new tag]         tag2       -> tag2
 * [new branch]      branch728  -> origin/branch728
 * [new branch]      branch729  -> origin/branch729
 * [new branch]      branch730  -> origin/branch730
 * [new branch]      branch731  -> origin/branch731
 * [new branch]      branch732  -> origin/branch732
 * [new branch]      branch733  -> origin/branch733
 * [new branch]      branch734  -> origin/branch734
 * [new branch]      branch735  -> origin/branch735
 * [new branch]      branch736  -> origin/branch736
 * [new branch]      branch737  -> origin/branch737
 * [new branch]      branch738  -> origin/branch738
 * [new branch]      branch739  -> origin/branch739
 * [new branch]      branch740  -> origin/branch740
 * [new branch]      branch741  -> origin/branch741
 * [new branch]      branch742  -> origin/branch742
 * [new branch]      branch743  -> origin/branch743
 * [new branch]      branch744  -> origin/branch744
 * [new branch]      branch745  -> origin/branch745
 * [new tag]         tag1       -> tag1
 * [new branch]      branch746  -> origin/branch746
 * [new branch]      branch747  -> origin/branch747
 * [new branch]      branch748  -> origin/branch748
 * [new branch]      branch749  -> origin/branch749
ok 42 - clone shallow with packed refs

expecting success: 
	(
		git clone --bare --branch B --single-branch "file://$(pwd)/." no-reflog &&
		git clone --depth 1 "file://$(pwd)/no-reflog" shallow9 &&
		cd no-reflog &&
		git tag -d TAGB1 TAGB2 &&
		git update-ref refs/heads/B B~~ &&
		git gc --prune=now &&
		cd ../shallow9 &&
		git fetch origin &&
		git fsck --no-dangling
	)

 * [new branch]      branch750  -> origin/branch750
 * [new branch]      branch751  -> origin/branch751
 * [new branch]      branch752  -> origin/branch752
 * [new branch]      branch753  -> origin/branch753
 * [new branch]      branch754  -> origin/branch754
 * [new branch]      branch755  -> origin/branch755
*** t5504-fetch-receive-strict.sh ***
 * [new branch]      branch756  -> origin/branch756
 * [new branch]      branch757  -> origin/branch757
Cloning into bare repository 'no-reflog'...
 * [new branch]      branch758  -> origin/branch758
 * [new branch]      branch759  -> origin/branch759
 * [new branch]      branch760  -> origin/branch760
 * [new branch]      branch761  -> origin/branch761
 * [new branch]      branch762  -> origin/branch762
 * [new branch]      branch763  -> origin/branch763
 * [new branch]      branch764  -> origin/branch764
 * [new branch]      branch765  -> origin/branch765
 * [new branch]      branch766  -> origin/branch766
 * [new branch]      branch767  -> origin/branch767
 * [new branch]      branch768  -> origin/branch768
 * [new branch]      branch769  -> origin/branch769
 * [new branch]      branch770  -> origin/branch770
 * [new branch]      branch771  -> origin/branch771
 * [new branch]      branch772  -> origin/branch772
 * [new branch]      branch773  -> origin/branch773
 * [new branch]      branch774  -> origin/branch774
 * [new branch]      branch775  -> origin/branch775
 * [new branch]      branch776  -> origin/branch776
 * [new branch]      branch777  -> origin/branch777
 * [new branch]      branch778  -> origin/branch778
 * [new branch]      branch779  -> origin/branch779
 * [new branch]      branch780  -> origin/branch780
 * [new branch]      branch781  -> origin/branch781
 * [new branch]      branch782  -> origin/branch782
 * [new branch]      branch783  -> origin/branch783
 * [new branch]      branch784  -> origin/branch784
 * [new branch]      branch785  -> origin/branch785
 * [new branch]      branch786  -> origin/branch786
 * [new branch]      branch787  -> origin/branch787
 * [new branch]      branch788  -> origin/branch788
 * [new branch]      branch789  -> origin/branch789
 * [new branch]      branch790  -> origin/branch790
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5504-fetch-receive-strict/.git/
 * [new branch]      branch791  -> origin/branch791
 * [new branch]      branch792  -> origin/branch792
 * [new branch]      branch793  -> origin/branch793
 * [new branch]      branch794  -> origin/branch794
 * [new branch]      branch795  -> origin/branch795
ok 11 - new clone fetch master and tags

 * [new branch]      branch796  -> origin/branch796
 * [new branch]      branch797  -> origin/branch797
 * [new branch]      branch798  -> origin/branch798
 * [new branch]      branch799  -> origin/branch799
expecting success: 
	echo hello >greetings &&
	git add greetings &&
	git commit -m greetings &&

	S=$(git rev-parse :greetings | sed -e "s|^..|&/|") &&
	X=$(echo bye | git hash-object -w --stdin | sed -e "s|^..|&/|") &&
	mv -f .git/objects/$X .git/objects/$S &&

	test_must_fail git fsck

 * [new branch]      branch800  -> origin/branch800
 * [new branch]      branch801  -> origin/branch801
# passed all 11 test(s)
1..11
 * [new branch]      branch802  -> origin/branch802
 * [new branch]      branch803  -> origin/branch803
 * [new branch]      branch804  -> origin/branch804
 * [new branch]      branch805  -> origin/branch805
 * [new branch]      branch806  -> origin/branch806
 * [new branch]      branch807  -> origin/branch807
 * [new branch]      branch808  -> origin/branch808
 * [new branch]      branch809  -> origin/branch809
 * [new branch]      branch810  -> origin/branch810
 * [new branch]      branch811  -> origin/branch811
 * [new branch]      branch812  -> origin/branch812
 * [new branch]      branch813  -> origin/branch813
 * [new branch]      branch814  -> origin/branch814
 * [new branch]      branch815  -> origin/branch815
 * [new branch]      branch816  -> origin/branch816
 * [new branch]      branch817  -> origin/branch817
 * [new branch]      branch818  -> origin/branch818
[master (root-commit) 5d4bad8] greetings
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 greetings
 * [new branch]      branch819  -> origin/branch819
 * [new branch]      branch820  -> origin/branch820
 * [new branch]      branch821  -> origin/branch821
 * [new branch]      branch822  -> origin/branch822
 * [new branch]      branch823  -> origin/branch823
 * [new branch]      branch824  -> origin/branch824
 * [new branch]      branch825  -> origin/branch825
 * [new branch]      branch826  -> origin/branch826
 * [new branch]      branch827  -> origin/branch827
 * [new branch]      branch828  -> origin/branch828
 * [new branch]      branch829  -> origin/branch829
 * [new branch]      branch830  -> origin/branch830
 * [new branch]      branch831  -> origin/branch831
 * [new branch]      branch832  -> origin/branch832
 * [new branch]      branch833  -> origin/branch833
 * [new branch]      branch834  -> origin/branch834
 * [new branch]      branch835  -> origin/branch835
 * [new branch]      branch836  -> origin/branch836
 * [new branch]      branch837  -> origin/branch837
 * [new branch]      branch838  -> origin/branch838
 * [new branch]      branch839  -> origin/branch839
 * [new branch]      branch840  -> origin/branch840
 * [new branch]      branch841  -> origin/branch841
 * [new branch]      branch842  -> origin/branch842
 * [new branch]      branch843  -> origin/branch843
 * [new branch]      branch844  -> origin/branch844
error: sha1 mismatch ce013625030ba8dba906f756967f9e9ca394464a
error: ce013625030ba8dba906f756967f9e9ca394464a: object corrupt or missing
 * [new branch]      branch845  -> origin/branch845
 * [new branch]      branch846  -> origin/branch846
missing blob ce013625030ba8dba906f756967f9e9ca394464a
 * [new branch]      branch847  -> origin/branch847
ok 1 - setup

expecting success: 
	rm -rf dst &&
	git init dst &&
	(
		cd dst &&
		git config fetch.fsckobjects false &&
		git config transfer.fsckobjects false &&
		test_must_fail git fetch ../.git master
	)

 * [new branch]      branch848  -> origin/branch848
 * [new branch]      branch849  -> origin/branch849
 * [new branch]      branch850  -> origin/branch850
 * [new branch]      branch851  -> origin/branch851
 * [new branch]      branch852  -> origin/branch852
 * [new branch]      branch853  -> origin/branch853
 * [new branch]      branch854  -> origin/branch854
 * [new branch]      branch855  -> origin/branch855
 * [new branch]      branch856  -> origin/branch856
*** t5505-remote.sh ***
 * [new branch]      branch857  -> origin/branch857
 * [new branch]      branch858  -> origin/branch858
 * [new branch]      branch859  -> origin/branch859
 * [new branch]      branch860  -> origin/branch860
 * [new branch]      branch861  -> origin/branch861
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5504-fetch-receive-strict/dst/.git/
 * [new branch]      branch862  -> origin/branch862
 * [new branch]      branch863  -> origin/branch863
 * [new branch]      branch864  -> origin/branch864
 * [new branch]      branch865  -> origin/branch865
 * [new branch]      branch866  -> origin/branch866
 * [new branch]      branch867  -> origin/branch867
 * [new branch]      branch868  -> origin/branch868
 * [new branch]      branch869  -> origin/branch869
 * [new branch]      branch870  -> origin/branch870
 * [new branch]      branch871  -> origin/branch871
 * [new branch]      branch872  -> origin/branch872
 * [new branch]      branch873  -> origin/branch873
 * [new branch]      branch874  -> origin/branch874
 * [new branch]      branch875  -> origin/branch875
 * [new branch]      branch876  -> origin/branch876
 * [new branch]      branch877  -> origin/branch877
 * [new branch]      branch878  -> origin/branch878
 * [new branch]      branch879  -> origin/branch879
 * [new branch]      branch880  -> origin/branch880
 * [new branch]      branch881  -> origin/branch881
 * [new branch]      branch882  -> origin/branch882
 * [new branch]      branch883  -> origin/branch883
 * [new branch]      branch884  -> origin/branch884
 * [new branch]      branch885  -> origin/branch885
 * [new branch]      branch886  -> origin/branch886
 * [new branch]      branch887  -> origin/branch887
 * [new branch]      branch888  -> origin/branch888
 * [new branch]      branch889  -> origin/branch889
 * [new branch]      branch890  -> origin/branch890
 * [new branch]      branch891  -> origin/branch891
 * [new branch]      branch892  -> origin/branch892
 * [new branch]      branch893  -> origin/branch893
 * [new branch]      branch894  -> origin/branch894
 * [new branch]      branch895  -> origin/branch895
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5505-remote/.git/
 * [new branch]      branch896  -> origin/branch896
 * [new branch]      branch897  -> origin/branch897
 * [new branch]      branch898  -> origin/branch898
 * [new branch]      branch899  -> origin/branch899
 * [new branch]      branch900  -> origin/branch900
 * [new branch]      branch901  -> origin/branch901
 * [new branch]      branch902  -> origin/branch902
 * [new branch]      branch903  -> origin/branch903
expecting success: 
	setup_repository one &&
	setup_repository two &&
	(
		cd two &&
		git branch another
	) &&
	git clone one test

 * [new branch]      branch904  -> origin/branch904
 * [new branch]      branch905  -> origin/branch905
 * [new branch]      branch906  -> origin/branch906
 * [new branch]      branch907  -> origin/branch907
 * [new branch]      branch908  -> origin/branch908
 * [new branch]      branch909  -> origin/branch909
fatal: missing blob object 'ce013625030ba8dba906f756967f9e9ca394464a'
 * [new branch]      branch910  -> origin/branch910
error: ../.git did not send all necessary objects

 * [new branch]      branch911  -> origin/branch911
 * [new branch]      branch912  -> origin/branch912
 * [new branch]      branch913  -> origin/branch913
 * [new branch]      branch914  -> origin/branch914
 * [new branch]      branch915  -> origin/branch915
 * [new branch]      branch916  -> origin/branch916
ok 2 - fetch without strict

expecting success: 
	rm -rf dst &&
	git init dst &&
	(
		cd dst &&
		git config fetch.fsckobjects false &&
		git config transfer.fsckobjects true &&
		test_must_fail git fetch ../.git master
	)

 * [new branch]      branch917  -> origin/branch917
 * [new branch]      branch918  -> origin/branch918
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5505-remote/one/.git/
 * [new branch]      branch919  -> origin/branch919
 * [new branch]      branch920  -> origin/branch920
 * [new branch]      branch921  -> origin/branch921
 * [new branch]      branch922  -> origin/branch922
 * [new branch]      branch923  -> origin/branch923
 * [new branch]      branch924  -> origin/branch924
 * [new branch]      branch925  -> origin/branch925
 * [new branch]      branch926  -> origin/branch926
 * [new branch]      branch927  -> origin/branch927
 * [new branch]      branch928  -> origin/branch928
 * [new branch]      branch929  -> origin/branch929
 * [new branch]      branch930  -> origin/branch930
 * [new branch]      branch931  -> origin/branch931
 * [new branch]      branch932  -> origin/branch932
 * [new branch]      branch933  -> origin/branch933
 * [new branch]      branch934  -> origin/branch934
 * [new branch]      branch935  -> origin/branch935
 * [new branch]      branch936  -> origin/branch936
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5504-fetch-receive-strict/dst/.git/
 * [new branch]      branch937  -> origin/branch937
[master (root-commit) 9d34b14] Initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file
 * [new branch]      branch938  -> origin/branch938
 * [new branch]      branch939  -> origin/branch939
 * [new branch]      branch940  -> origin/branch940
 * [new branch]      branch941  -> origin/branch941
 * [new branch]      branch942  -> origin/branch942
 * [new branch]      branch943  -> origin/branch943
 * [new branch]      branch944  -> origin/branch944
 * [new branch]      branch945  -> origin/branch945
 * [new branch]      branch946  -> origin/branch946
 * [new branch]      branch947  -> origin/branch947
 * [new branch]      branch948  -> origin/branch948
 * [new branch]      branch949  -> origin/branch949
Switched to a new branch 'side'
 * [new branch]      branch950  -> origin/branch950
 * [new branch]      branch951  -> origin/branch951
 * [new branch]      branch952  -> origin/branch952
 * [new branch]      branch953  -> origin/branch953
 * [new branch]      branch954  -> origin/branch954
 * [new branch]      branch955  -> origin/branch955
 * [new branch]      branch956  -> origin/branch956
 * [new branch]      branch957  -> origin/branch957
 * [new branch]      branch958  -> origin/branch958
 * [new branch]      branch959  -> origin/branch959
 * [new branch]      branch960  -> origin/branch960
 * [new branch]      branch961  -> origin/branch961
 * [new branch]      branch962  -> origin/branch962
 * [new branch]      branch963  -> origin/branch963
 * [new branch]      branch964  -> origin/branch964
 * [new branch]      branch965  -> origin/branch965
 * [new branch]      branch966  -> origin/branch966
Cloning into 'shallow9'...
 * [new branch]      branch967  -> origin/branch967
 * [new branch]      branch968  -> origin/branch968
[side 2ce9c50] Second
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 elif
 * [new branch]      branch969  -> origin/branch969
 * [new branch]      branch970  -> origin/branch970
 * [new branch]      branch971  -> origin/branch971
 * [new branch]      branch972  -> origin/branch972
 * [new branch]      branch973  -> origin/branch973
 * [new branch]      branch974  -> origin/branch974
 * [new branch]      branch975  -> origin/branch975
 * [new branch]      branch976  -> origin/branch976
 * [new branch]      branch977  -> origin/branch977
Switched to branch 'master'
 * [new branch]      branch978  -> origin/branch978
 * [new branch]      branch979  -> origin/branch979
 * [new branch]      branch980  -> origin/branch980
 * [new branch]      branch981  -> origin/branch981
 * [new branch]      branch982  -> origin/branch982
 * [new branch]      branch983  -> origin/branch983
 * [new branch]      branch984  -> origin/branch984
 * [new branch]      branch985  -> origin/branch985
 * [new branch]      branch986  -> origin/branch986
 * [new branch]      branch987  -> origin/branch987
 * [new branch]      branch988  -> origin/branch988
 * [new branch]      branch989  -> origin/branch989
 * [new branch]      branch990  -> origin/branch990
 * [new branch]      branch991  -> origin/branch991
 * [new branch]      branch992  -> origin/branch992
 * [new branch]      branch993  -> origin/branch993
 * [new branch]      branch994  -> origin/branch994
 * [new branch]      branch995  -> origin/branch995
fatal: missing blob object 'ce013625030ba8dba906f756967f9e9ca394464a'
error: ../.git did not send all necessary objects

 * [new branch]      branch996  -> origin/branch996
 * [new branch]      branch997  -> origin/branch997
 * [new branch]      branch998  -> origin/branch998
 * [new branch]      branch999  -> origin/branch999
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5505-remote/two/.git/
ok 3 - fetch with !fetch.fsckobjects

expecting success: 
	rm -rf dst &&
	git init dst &&
	(
		cd dst &&
		git config fetch.fsckobjects true &&
		git config transfer.fsckobjects false &&
		test_must_fail git fetch ../.git master
	)

[master (root-commit) 9d34b14] Initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5504-fetch-receive-strict/dst/.git/
Switched to a new branch 'side'
[side 2ce9c50] Second
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 elif
Switched to branch 'master'
Cloning into 'test'...
fatal: object of unexpected type
fatal: unpack-objects failed
ok 4 - fetch with fetch.fsckobjects

expecting success: 
	rm -rf dst &&
	git init dst &&
	(
		cd dst &&
		git config transfer.fsckobjects true &&
		test_must_fail git fetch ../.git master
	)

done.
Deleted tag 'TAGB1' (was a540a4d)
Deleted tag 'TAGB2' (was 9ca64d8)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5504-fetch-receive-strict/dst/.git/
ok 1 - setup

expecting success: 
	(
		cd test &&
		tokens_match origin "$(git remote)" &&
		check_remote_track origin master side &&
		check_tracking_branch origin HEAD master side
	)

fatal: object of unexpected type
fatal: unpack-objects failed
ok 5 - fetch with transfer.fsckobjects

expecting success: 
	rm -rf dst &&
	git init dst &&
	(
		cd dst &&
		git config fetch.fsckobjects false &&
		git config transfer.fsckobjects false
	) &&
	test_must_fail git push --porcelain dst master:refs/heads/test >act &&
	test_cmp exp act

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5504-fetch-receive-strict/dst/.git/
fatal: missing blob object 'ce013625030ba8dba906f756967f9e9ca394464a'
ok 2 - remote information for the origin

expecting success: 
	(
		cd test &&
		git remote add -f second ../two &&
		tokens_match "origin second" "$(git remote)" &&
		check_tracking_branch second master side another &&
		git for-each-ref "--format=%(refname)" refs/remotes |
		sed -e "/^refs\/remotes\/origin\//d" \
		    -e "/^refs\/remotes\/second\//d" >actual &&
		>expect &&
		test_cmp expect actual
	)

fatal: missing blob object 'ce013625030ba8dba906f756967f9e9ca394464a'
error: failed to push some refs to 'dst'
ok 6 - push without strict

Updating second
expecting success: 
	rm -rf dst &&
	git init dst &&
	(
		cd dst &&
		git config receive.fsckobjects false &&
		git config transfer.fsckobjects true
	) &&
	test_must_fail git push --porcelain dst master:refs/heads/test >act &&
	test_cmp exp act

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5504-fetch-receive-strict/dst/.git/
From ../two
 * [new branch]      another    -> second/another
 * [new branch]      master     -> second/master
warning: no common commits
 * [new branch]      side       -> second/side
fatal: missing blob object 'ce013625030ba8dba906f756967f9e9ca394464a'
fatal: missing blob object 'ce013625030ba8dba906f756967f9e9ca394464a'
error: failed to push some refs to 'dst'
ok 7 - push with !receive.fsckobjects

expecting success: 
	rm -rf dst &&
	git init dst &&
	(
		cd dst &&
		git config receive.fsckobjects true &&
		git config transfer.fsckobjects false
	) &&
	test_must_fail git push --porcelain dst master:refs/heads/test >act &&
	test_cmp exp act

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5504-fetch-receive-strict/dst/.git/
ok 3 - add another remote

expecting success: 
	(
		cd test &&
		check_remote_track origin master side &&
		check_remote_track second master side another
	)

From file:///«PKGBUILDDIR»/t/trash directory.t5500-fetch-pack/no-reflog
 + 9ca64d8...437bc54 B          -> origin/B  (forced update)
remote: fatal: object of unexpected type        
error: unpack failed: unpack-objects abnormal exit
ok 43 - fetch in shallow repo unreachable shallow objects

expecting success: 
	(
		git clone "file://$(pwd)/." shallow10 &&
		git commit --allow-empty -m empty &&
		cd shallow10 &&
		git fetch --depth=1 --progress 2>actual &&
		# This should fetch only the empty commit, no tree or
		# blob objects
		grep "remote: Total 1" actual
	)

ok 7 - quickfetch should handle ~1000 refs (on Windows)

error: failed to push some refs to 'dst'
ok 8 - push with receive.fsckobjects

expecting success: 
	rm -rf dst &&
	git init dst &&
	(
		cd dst &&
		git config transfer.fsckobjects true
	) &&
	test_must_fail git push --porcelain dst master:refs/heads/test >act &&
	test_cmp exp act

# passed all 7 test(s)
1..7
Cloning into 'shallow10'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5504-fetch-receive-strict/dst/.git/
ok 4 - check remote-tracking

expecting success: 
	(
		cd test &&
		case `git config remote.second.fetch` in
		+*) true ;;
		 *) false ;;
		esac
	)

ok 5 - remote forces tracking branches

expecting success: 
	(
		cd test &&
		git symbolic-ref refs/remotes/second/HEAD refs/remotes/second/master &&
		git remote rm second
	)

ok 6 - remove remote

expecting success: 
	(
		cd test &&
		tokens_match origin "$(git remote)" &&
		check_remote_track origin master side &&
		git for-each-ref "--format=%(refname)" refs/remotes |
		sed -e "/^refs\/remotes\/origin\//d" >actual &&
		>expect &&
		test_cmp expect actual
	)

remote: fatal: object of unexpected type        
error: unpack failed: unpack-objects abnormal exit
error: failed to push some refs to 'dst'
ok 9 - push with transfer.fsckobjects

expecting success: 
	commit="$(git hash-object -t commit -w --stdin <bogus-commit)" &&
	git push . $commit:refs/heads/bogus &&
	rm -rf dst &&
	git init dst &&
	git --git-dir=dst/.git config receive.fsckObjects true &&
	test_must_fail git push --porcelain dst bogus &&
	git --git-dir=dst/.git config receive.fsck.skipList SKIP &&
	echo $commit >dst/.git/SKIP &&
	git push --porcelain dst bogus

To .
 * [new branch]      6516fe4a6d0c9202861748d549d2e2b20e5210c9 -> bogus
ok 7 - remove remote

expecting success: 
	(
		cd test &&
		cat >expect1 <<-\EOF &&
		Note: A branch outside the refs/remotes/ hierarchy was not removed;
		to delete it, use:
		  git branch -d master
		EOF
		cat >expect2 <<-\EOF &&
		Note: Some branches outside the refs/remotes/ hierarchy were not removed;
		to delete them, use:
		  git branch -d foobranch
		  git branch -d master
		EOF
		git tag footag &&
		git config --add remote.oops.fetch "+refs/*:refs/*" &&
		git remote remove oops 2>actual1 &&
		git branch foobranch &&
		git config --add remote.oops.fetch "+refs/*:refs/*" &&
		git remote rm oops 2>actual2 &&
		git branch -d foobranch &&
		git tag -d footag &&
		test_i18ncmp expect1 actual1 &&
		test_i18ncmp expect2 actual2
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5504-fetch-receive-strict/dst/.git/
remote: error: object 6516fe4a6d0c9202861748d549d2e2b20e5210c9: missingEmail: invalid author/committer line - missing email        
remote: fatal: Error in object        
error: unpack failed: unpack-objects abnormal exit
error: failed to push some refs to 'dst'
To dst
!	refs/heads/bogus:refs/heads/bogus	[remote rejected] (unpacker error)
Deleted branch foobranch (was 9d34b14).
[B 4408587] empty
 Author: A U Thor <author@example.com>
Deleted tag 'footag' (was 9d34b14)
ok 8 - remove remote protects local branches

expecting success: 
	(
		cd test &&
		git config --add remote.origin.fetch refs/heads/master:refs/heads/upstream &&
		git fetch &&
		git checkout -b ahead origin/master &&
		echo 1 >>file &&
		test_tick &&
		git commit -m update file &&
		git checkout master &&
		git branch --track octopus origin/master &&
		git branch --track rebase origin/master &&
		git branch -d -r origin/master &&
		git config --add remote.two.url ../two &&
		git config --add remote.two.pushurl ../three &&
		git config branch.rebase.rebase true &&
		git config branch.octopus.merge "topic-a topic-b topic-c" &&
		(
			cd ../one &&
			echo 1 >file &&
			test_tick &&
			git commit -m update file
		) &&
		git config --add remote.origin.push : &&
		git config --add remote.origin.push refs/heads/master:refs/heads/upstream &&
		git config --add remote.origin.push +refs/tags/lastbackup &&
		git config --add remote.two.push +refs/heads/ahead:refs/heads/master &&
		git config --add remote.two.push refs/heads/master:refs/heads/another &&
		git remote show origin two >output &&
		git branch -d rebase octopus &&
		test_i18ncmp expect output
	)

To dst
*	refs/heads/bogus:refs/heads/bogus	[new branch]
Done
ok 10 - push with receive.fsck.skipList

expecting success: 
	commit="$(git hash-object -t commit -w --stdin <bogus-commit)" &&
	git push . $commit:refs/heads/bogus &&
	rm -rf dst &&
	git init dst &&
	git --git-dir=dst/.git config receive.fsckobjects true &&
	test_must_fail git push --porcelain dst bogus &&
	git --git-dir=dst/.git config \
		receive.fsck.missingEmail warn &&
	git push --porcelain dst bogus >act 2>&1 &&
	grep "missingEmail" act &&
	git --git-dir=dst/.git branch -D bogus &&
	git --git-dir=dst/.git config --add \
		receive.fsck.missingEmail ignore &&
	git --git-dir=dst/.git config --add \
		receive.fsck.badDate warn &&
	git push --porcelain dst bogus >act 2>&1 &&
	test_must_fail grep "missingEmail" act

remote: Total 1 (delta 0), reused 0 (delta 0)        
ok 44 - fetch creating new shallow root

expecting success: 
	for head in C D E F
	do
		add $head
	done &&
	for head in A B C D E F
	do
		git tag $head $head
	done &&
	cat >input <<-\EOF &&
	refs/heads/C
	refs/heads/A
	refs/heads/D
	refs/tags/C
	refs/heads/B
	refs/tags/A
	refs/heads/E
	refs/tags/B
	refs/tags/E
	refs/tags/D
	EOF
	sort <input >expect &&
	(
		echo refs/heads/E &&
		echo refs/tags/E &&
		cat input
	) >input.dup

Everything up-to-date
From /«PKGBUILDDIR»/t/trash directory.t5505-remote/one
 * [new branch]      master     -> upstream
Switched to a new branch 'ahead'
Branch ahead set up to track remote branch master from origin.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5504-fetch-receive-strict/dst/.git/
[ahead 847549e] update
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
Branch octopus set up to track remote branch master from origin.
*** t5506-remote-groups.sh ***
remote: error: object 6516fe4a6d0c9202861748d549d2e2b20e5210c9: missingEmail: invalid author/committer line - missing email        
remote: fatal: Error in object        
error: unpack failed: unpack-objects abnormal exit
Branch rebase set up to track remote branch master from origin.
error: failed to push some refs to 'dst'
To dst
!	refs/heads/bogus:refs/heads/bogus	[remote rejected] (unpacker error)
Deleted remote-tracking branch origin/master (was 9d34b14).
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5506-remote-groups/.git/
expecting success: 
	mkdir one && (cd one && git init) &&
	mkdir two && (cd two && git init) &&
	git remote add -m master one one &&
	git remote add -m master two two

[master 6329a3c] update
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
remote: warning: object 6516fe4a6d0c9202861748d549d2e2b20e5210c9: missingEmail: invalid author/committer line - missing email        
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5506-remote-groups/one/.git/
Deleted branch bogus (was 6516fe4).
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5506-remote-groups/two/.git/
ok 1 - setup

expecting success: 
	mark update-all &&
	update_repos &&
	git remote update &&
	repo_fetched one &&
	repo_fetched two

error: src refspec refs/tags/lastbackup does not match any.
ok 45 - setup tests for the --stdin parameter

expecting success: 
	(
		cd client &&
		git fetch-pack --no-progress .. $(cat ../input)
	) >output &&
	cut -d " " -f 2 <output | sort >actual &&
	test_cmp expect actual

Deleted branch rebase (was 9d34b14).
Deleted branch octopus (was 9d34b14).
[master (root-commit) 63073a8] update-all
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 11 - push with receive.fsck.missingEmail=warn

expecting success: 
	rm -rf dst &&
	git init dst &&
	git --git-dir=dst/.git config receive.fsckobjects true &&
	git --git-dir=dst/.git config \
		receive.fsck.unterminatedheader warn &&
	test_must_fail git push --porcelain dst HEAD >act 2>&1 &&
	grep "Cannot demote unterminatedheader" act

ok 9 - show

expecting success: 
	mv one one.unreachable &&
	(
		cd test &&
		git remote show -n origin >output &&
		mv ../one.unreachable ../one &&
		test_i18ncmp expect output
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5504-fetch-receive-strict/dst/.git/
ok 10 - show -n

expecting success: 
	(
		cd one &&
		git branch -m side side2
	) &&
	(
		cd test &&
		git fetch origin &&
		git remote prune origin &&
		git rev-parse refs/remotes/origin/side2 &&
		test_must_fail git rev-parse refs/remotes/origin/side
	)

[master (root-commit) 63073a8] update-all
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
Fetching one
ok 46 - fetch refs from cmdline

expecting success: 
	(
		cd client &&
		git fetch-pack --stdin --no-progress .. <../input
	) >output &&
	cut -d " " -f 2 <output | sort >actual &&
	test_cmp expect actual

remote: fatal: Cannot demote unterminatedheader to warn        
ok 12 - receive.fsck.unterminatedHeader=warn triggers error

# passed all 12 test(s)
1..12
From /«PKGBUILDDIR»/t/trash directory.t5505-remote/one
 * [new branch]      master     -> origin/master
From one
 * [new branch]      master     -> one/master
 * [new branch]      side2      -> origin/side2
   9d34b14..6329a3c  master     -> upstream
Fetching two
*** t5507-remote-environment.sh ***
Pruning origin
URL: /«PKGBUILDDIR»/t/trash directory.t5505-remote/one
 * [pruned] origin/side
2ce9c504874e3f0ce77f83c0bb0b1024c7a6387f
From two
 * [new branch]      master     -> two/master
fatal: ambiguous argument 'refs/remotes/origin/side': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
refs/remotes/origin/side
ok 11 - prune

expecting success: 
	(
		cd test &&
		git symbolic-ref refs/remotes/origin/HEAD &&
		git remote set-head --delete origin &&
		test_must_fail git symbolic-ref refs/remotes/origin/HEAD
	)

refs/remotes/origin/master
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5507-remote-environment/.git/
ok 47 - fetch refs from stdin

expecting success: 
	(
		cd client &&
		tail -n +5 ../input |
		git fetch-pack --stdin --no-progress .. $(head -n 4 ../input)
	) >output &&
	cut -d " " -f 2 <output | sort >actual &&
	test_cmp expect actual

repo was fetched: one
expecting success: 
	test_commit one &&
	git config push.default current &&
	git init remote

fatal: ref refs/remotes/origin/HEAD is not a symbolic ref
ok 12 - set-head --delete

expecting success: 
	(
		cd test &&
		git remote set-head --auto origin &&
		echo refs/remotes/origin/master >expect &&
		git symbolic-ref refs/remotes/origin/HEAD >output &&
		test_cmp expect output
	)

repo was fetched: two
ok 2 - no group updates all

expecting success: 
	mark nonexistent &&
	update_repos &&
	test_must_fail git remote update nonexistent &&
	! repo_fetched one &&
	! repo_fetched two

origin/HEAD set to master
[master (root-commit) d79ce16] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
ok 13 - set-head --auto

expecting success: 
	(
		cd test &&
		git fetch two "refs/heads/*:refs/remotes/two/*" &&
		git remote set-head --auto two >output 2>&1 &&
		echo "two/HEAD set to master" >expect &&
		test_i18ncmp expect output
	)

[master 84e836f] nonexistent
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5507-remote-environment/remote/.git/
ok 1 - set up "remote" push situation

expecting success: 
	GIT_SSH_COMMAND="f() {
		cd \"\$TRASH_DIRECTORY\" &&
		eval \"\$2\"
	}; f" &&
	export GIT_SSH_COMMAND &&
	export TRASH_DIRECTORY

ok 2 - set up fake ssh

expecting success: 
	test_must_fail git push remote

ok 48 - fetch mixed refs from cmdline and stdin

expecting success: 
	(
	cd client &&
	git fetch-pack --stdin --no-progress .. <../input.dup
	) >output &&
	cut -d " " -f 2 <output | sort >actual &&
	test_cmp expect actual

From ../two
 * [new branch]      another    -> two/another
[master 84e836f] nonexistent
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 * [new branch]      master     -> two/master
 * [new branch]      side       -> two/side
fatal: No such remote or remote group: nonexistent
repo was not fetched: one
remote: error: refusing to update checked out branch: refs/heads/master        
remote: error: By default, updating the current branch in a non-bare repository        
remote: error: is denied, because it will make the index and work tree inconsistent        
remote: error: with what you pushed, and will require 'git reset --hard' to match        
remote: error: the work tree to HEAD.        
remote: error:         
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to        
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into        
remote: error: its current branch; however, this is not recommended unless you        
remote: error: arranged to update its work tree to match what you pushed in some        
remote: error: other way.        
remote: error:         
remote: error: To squelch this message and still keep the default behaviour, set        
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.        
ok 14 - set-head --auto has no problem w/multiple HEADs

To remote
 ! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'remote'
ok 3 - confirm default push fails

expecting success: 
	test_must_fail git -c receive.denyCurrentBranch=false push remote

expecting success: 
	(
		cd test &&
		git remote set-head origin side2 &&
		git symbolic-ref refs/remotes/origin/HEAD >output &&
		git remote set-head origin master &&
		test_cmp expect output
	)

repo was not fetched: two
ok 3 - nonexistent group produces error

expecting success: 
	mark group-all &&
	update_repos &&
	git config --add remotes.all one &&
	git config --add remotes.all two &&
	git remote update all &&
	repo_fetched one &&
	repo_fetched two

ok 15 - set-head explicit

[master ed0bb00] group-all
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
expecting success: 
	(
		cd one &&
		git branch -m side2 side) &&
	(
		cd test &&
		git remote prune --dry-run origin >output &&
		git rev-parse refs/remotes/origin/side2 &&
		test_must_fail git rev-parse refs/remotes/origin/side &&
	(
		cd ../one &&
		git branch -m side side2) &&
		test_i18ncmp expect output
	)

ok 49 - test duplicate refs from stdin

expecting success: 
	cat >expect-error <<-\EOF
	error: no such remote ref refs/heads/xyzzy
	EOF

remote: error: refusing to update checked out branch: refs/heads/master        
remote: error: By default, updating the current branch in a non-bare repository        
remote: error: is denied, because it will make the index and work tree inconsistent        
remote: error: with what you pushed, and will require 'git reset --hard' to match        
remote: error: the work tree to HEAD.        
remote: error:         
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to        
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into        
remote: error: its current branch; however, this is not recommended unless you        
remote: error: arranged to update its work tree to match what you pushed in some        
remote: error: other way.        
remote: error:         
remote: error: To squelch this message and still keep the default behaviour, set        
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.        
ok 50 - set up tests of missing reference

expecting success: 
	(
		cd client &&
		test_must_fail git fetch-pack --no-progress .. refs/heads/xyzzy
	) >/dev/null 2>error-m &&
	test_cmp expect-error error-m

To remote
 ! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'remote'
ok 4 - config does not travel over same-machine push

expecting success: 
	test_must_fail git -c receive.denyCurrentBranch=false push host:remote

[master ed0bb00] group-all
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
2ce9c504874e3f0ce77f83c0bb0b1024c7a6387f
ok 51 - test lonely missing ref

expecting success: 
	(
		cd client &&
		test_must_fail git fetch-pack --no-progress .. refs/heads/A refs/heads/xyzzy
	) >/dev/null 2>error-em &&
	test_cmp expect-error error-em

fatal: ambiguous argument 'refs/remotes/origin/side': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
refs/remotes/origin/side
Fetching one
remote: error: refusing to update checked out branch: refs/heads/master        
remote: error: By default, updating the current branch in a non-bare repository        
remote: error: is denied, because it will make the index and work tree inconsistent        
remote: error: with what you pushed, and will require 'git reset --hard' to match        
remote: error: the work tree to HEAD.        
remote: error:         
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to        
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into        
remote: error: its current branch; however, this is not recommended unless you        
remote: error: arranged to update its work tree to match what you pushed in some        
remote: error: other way.        
remote: error:         
remote: error: To squelch this message and still keep the default behaviour, set        
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.        
ok 16 - prune --dry-run

expecting success: 
	mkdir mirror &&
	(
		cd mirror &&
		git init --bare &&
		git remote add --mirror -f origin ../one
	) &&
	(
		cd one &&
		git branch -m side2 side
	) &&
	(
		cd mirror &&
		git rev-parse --verify refs/heads/side2 &&
		test_must_fail git rev-parse --verify refs/heads/side &&
		git fetch origin &&
		git remote prune origin &&
		test_must_fail git rev-parse --verify refs/heads/side2 &&
		git rev-parse --verify refs/heads/side
	)

To host:remote
 ! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'host:remote'
ok 5 - config does not travel over ssh push

ok 52 - test missing ref after existing

expecting success: 
	(
		cd client &&
		test_must_fail git fetch-pack --no-progress .. refs/heads/xyzzy refs/heads/A
	) >/dev/null 2>error-me &&
	test_cmp expect-error error-me

# passed all 5 test(s)
1..5
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5505-remote/mirror/
warning: --mirror is dangerous and deprecated; please
	 use --mirror=fetch or --mirror=push instead
Updating origin
ok 53 - test missing ref before existing

expecting success: 
	(
		cd client &&
		git fetch-pack --no-progress --all --depth=1 .. refs/heads/A
	) >out-adh 2>error-adh

*** t5509-fetch-push-namespaces.sh ***
From one
   63073a8..ed0bb00  master     -> one/master
Fetching two
ok 54 - test --all, --depth, and explicit head

expecting success: 
	git tag OLDTAG refs/heads/B~5 &&
	(
		cd client &&
		git fetch-pack --no-progress --all --depth=1 .. refs/tags/OLDTAG
	) >out-adt 2>error-adt

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5509-fetch-push-namespaces/.git/
From two
   63073a8..ed0bb00  master     -> two/master
From ../one
 * [new branch]      master     -> master
 * [new branch]      side2      -> side2
expecting success: 
	test_tick &&
	git init original &&
	(
		cd original &&
		echo 0 >count &&
		git add count &&
		test_commit 0 &&
		echo 1 >count &&
		git add count &&
		test_commit 1 &&
		git remote add pushee-namespaced "ext::git --namespace=namespace %s ../pushee" &&
		git remote add pushee-unnamespaced ../pushee
	) &&
	commit0=$(cd original && git rev-parse HEAD^) &&
	commit1=$(cd original && git rev-parse HEAD) &&
	git init pushee &&
	git init puller

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5509-fetch-push-namespaces/original/.git/
repo was fetched: one
2ce9c504874e3f0ce77f83c0bb0b1024c7a6387f
repo was fetched: two
ok 4 - updating group updates all members (remote update)

expecting success: 
	mark fetch-group-all &&
	update_repos &&
	git fetch all &&
	repo_fetched one &&
	repo_fetched two

fatal: Needed a single revision
[master (root-commit) fbdf431] 0
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 0.t
 create mode 100644 count
ok 55 - test --all, --depth, and explicit tag

expecting success: 
	mkdir repo1 &&
	(
		cd repo1 &&
		git init &&
		test_commit 1 &&
		test_commit 2 &&
		test_commit 3 &&
		mkdir repo2 &&
		cd repo2 &&
		git init &&
		git fetch --depth=2 ../.git master:branch &&
		git fsck
	)

[master c4adb83] fetch-group-all
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
From ../one
 * [new branch]      side       -> side
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5500-fetch-pack/repo1/.git/
Pruning origin
URL: ../one
 * [pruned] refs/heads/side2
[master c4adb83] fetch-group-all
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master (root-commit) 509138d] 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 1.t
[master dc65a2e] 1
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 1.t
Fetching one
fatal: Needed a single revision
2ce9c504874e3f0ce77f83c0bb0b1024c7a6387f
ok 17 - add --mirror && prune

expecting success: 
	mkdir mirror-fetch &&
	git init mirror-fetch/parent &&
	(
		cd mirror-fetch/parent &&
		test_commit one
	) &&
	git init --bare mirror-fetch/child &&
	(
		cd mirror-fetch/child &&
		git remote add --mirror=fetch -f parent ../parent
	)

[master e67c205] 2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 2.t
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5505-remote/mirror-fetch/parent/.git/
[master (root-commit) d79ce16] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5509-fetch-push-namespaces/pushee/.git/
From one
   ed0bb00..c4adb83  master     -> one/master
Fetching two
[master 76e17df] 3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 3.t
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5509-fetch-push-namespaces/puller/.git/
ok 1 - setup

expecting success: 
	(
		cd original &&
		git push pushee-namespaced master &&
		git ls-remote pushee-namespaced >actual &&
		printf "$commit1\trefs/heads/master\n" >expected &&
		test_cmp expected actual &&
		git push pushee-namespaced --tags &&
		git ls-remote pushee-namespaced >actual &&
		printf "$commit0\trefs/tags/0\n" >>expected &&
		printf "$commit1\trefs/tags/1\n" >>expected &&
		test_cmp expected actual &&
		# Verify that the GIT_NAMESPACE environment variable works as well
		GIT_NAMESPACE=namespace git ls-remote "ext::git %s ../pushee" >actual &&
		test_cmp expected actual &&
		# Verify that --namespace overrides GIT_NAMESPACE
		GIT_NAMESPACE=garbage git ls-remote pushee-namespaced >actual &&
		test_cmp expected actual &&
		# Try a namespace with no content
		git ls-remote "ext::git --namespace=garbage %s ../pushee" >actual &&
		test_cmp /dev/null actual &&
		git ls-remote pushee-unnamespaced >actual &&
		sed -e "s|refs/|refs/namespaces/namespace/refs/|" expected >expected.unnamespaced &&
		test_cmp expected.unnamespaced actual
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5505-remote/mirror-fetch/child/
Updating parent
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5500-fetch-pack/repo1/repo2/.git/
From two
   ed0bb00..c4adb83  master     -> two/master
repo was fetched: one
To ext::git --namespace=namespace %s ../pushee
 * [new branch]      master -> master
From ../parent
 * [new branch]      master     -> master
 * [new tag]         one        -> one
repo was fetched: two
ok 5 - updating group updates all members (fetch)

expecting success: 
	mark group-some &&
	update_repos &&
	git config --add remotes.some one &&
	git remote update some &&
	repo_fetched one &&
	! repo_fetched two

ok 18 - add --mirror=fetch

expecting success: 
	(
		cd mirror-fetch/parent &&
		git branch new &&
		git branch -m master renamed
	) &&
	(
		cd mirror-fetch/child &&
		git fetch parent &&
		git rev-parse --verify refs/heads/new &&
		git rev-parse --verify refs/heads/renamed
	)

From ../
 * [new branch]      master     -> branch
 * [new tag]         3          -> 3
[master 5163b26] group-some
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 * [new tag]         2          -> 2
notice: HEAD points to an unborn branch (master)
[master 5163b26] group-some
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 56 - shallow fetch with tags does not break the repository

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
From ../parent
 * [new branch]      new        -> new
 * [new branch]      renamed    -> renamed
Fetching one
To ext::git --namespace=namespace %s ../pushee
 * [new tag]         0 -> 0
 * [new tag]         1 -> 1
ok 57 - fetch-pack --diag-url ssh+git://host/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
d79ce1670bdcb76e6d1da2ae095e890ccb326ae9
d79ce1670bdcb76e6d1da2ae095e890ccb326ae9
ok 19 - fetch mirrors act as mirrors during fetch

expecting success: 
	(
		cd mirror-fetch/child &&
		git remote prune parent &&
		test_must_fail git rev-parse --verify refs/heads/master
	)

ok 58 - fetch-pack --diag-url ssh+git://host/~repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
Pruning parent
URL: ../parent
 * [pruned] refs/heads/master
fatal: Needed a single revision
ok 20 - fetch mirrors can prune

expecting success: 
	(
		cd mirror-fetch/parent &&
		git checkout HEAD^0
	) &&
	(
		cd mirror-fetch/child &&
		git branch -m renamed renamed2 &&
		git push parent :
	) &&
	(
		cd mirror-fetch/parent &&
		git rev-parse --verify renamed &&
		test_must_fail git rev-parse --verify refs/heads/renamed2
	)

From one
   c4adb83..5163b26  master     -> one/master
ok 59 - fetch-pack --diag-url ssh+git://host:/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
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 d79ce16... one
ok 60 - fetch-pack --diag-url ssh+git://host:/~repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
repo was fetched: one
repo was not fetched: two
ok 6 - updating group does not update non-members (remote update)

expecting success: 
	mark fetch-group-some &&
	update_repos &&
	git config --add remotes.some one &&
	git remote update some &&
	repo_fetched one &&
	! repo_fetched two

Everything up-to-date
d79ce1670bdcb76e6d1da2ae095e890ccb326ae9
ok 61 - fetch-pack --diag-url ssh+git://user@host/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
fatal: Needed a single revision
ok 21 - fetch mirrors do not act as mirrors during push

expecting success: 
	git init --bare mirror-fetch/track &&
	(
		cd mirror-fetch/track &&
		git remote add --mirror=fetch -t heads/new parent ../parent
	)

[master 311125f] fetch-group-some
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 62 - fetch-pack --diag-url ssh+git://user@host/~repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 2 - pushing into a repository using a ref namespace

expecting success: 
	(
		cd puller &&
		git remote add -f pushee-namespaced "ext::git --namespace=namespace %s ../pushee" &&
		git for-each-ref refs/ >actual &&
		printf "$commit1 commit\trefs/remotes/pushee-namespaced/master\n" >expected &&
		printf "$commit0 commit\trefs/tags/0\n" >>expected &&
		printf "$commit1 commit\trefs/tags/1\n" >>expected &&
		test_cmp expected actual
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5505-remote/mirror-fetch/track/
Updating pushee-namespaced
ok 22 - add fetch mirror with specific branches

expecting success: 
	(
		cd mirror-fetch/track &&
		git fetch parent &&
		git rev-parse --verify refs/heads/new &&
		test_must_fail git rev-parse --verify refs/heads/renamed
	)

ok 63 - fetch-pack --diag-url ssh+git://user@host:/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
[master 311125f] fetch-group-some
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Fetching one
ok 64 - fetch-pack --diag-url ssh+git://user@host:/~repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 65 - fetch-pack --diag-url ssh+git://user@[::1]/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
From ../parent
 * [new branch]      new        -> new
 * [new tag]         one        -> one
From ext::git --namespace=namespace %s ../pushee
 * [new branch]      master     -> pushee-namespaced/master
 * [new tag]         1          -> 1
ok 66 - fetch-pack --diag-url ssh+git://user@[::1]/~repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
d79ce1670bdcb76e6d1da2ae095e890ccb326ae9
From one
   5163b26..311125f  master     -> one/master
fatal: Needed a single revision
ok 23 - fetch mirror respects specific branches

expecting success: 
	mkdir mirror-push &&
	git init --bare mirror-push/public &&
	git init mirror-push/private &&
	(
		cd mirror-push/private &&
		test_commit one &&
		git remote add --mirror=push public ../public
	)

Fetching one
 * [new tag]         0          -> 0
Bad commandok 67 - fetch-pack --diag-url ssh+git://user@[::1]:/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5505-remote/mirror-push/public/
ok 3 - pulling from a repository using a ref namespace

expecting success: 
	git clone --mirror pushee mirror &&
	(
		cd mirror &&
		git for-each-ref refs/ >actual &&
		printf "$commit1 commit\trefs/namespaces/namespace/refs/heads/master\n" >expected &&
		printf "$commit0 commit\trefs/namespaces/namespace/refs/tags/0\n" >>expected &&
		printf "$commit1 commit\trefs/namespaces/namespace/refs/tags/1\n" >>expected &&
		test_cmp expected actual
	)

Cloning into bare repository 'mirror'...
ok 68 - fetch-pack --diag-url ssh+git://user@[::1]:/~repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5505-remote/mirror-push/private/.git/
done.
[master (root-commit) d79ce16] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
ok 69 - fetch-pack --diag-url ssh+git://user@::1/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
repo was fetched: one
repo was not fetched: two
ok 7 - updating group does not update non-members (fetch)

expecting success: 
	mark remote-name &&
	update_repos &&
	git remote update one &&
	repo_fetched one &&
	! repo_fetched two

ok 24 - add --mirror=push

expecting success: 
	(
		cd mirror-push/private &&
		git branch new &&
		git branch -m master renamed &&
		git push public
	) &&
	(
		cd mirror-push/private &&
		git rev-parse --verify refs/heads/new &&
		git rev-parse --verify refs/heads/renamed &&
		test_must_fail git rev-parse --verify refs/heads/master
	)

ok 4 - mirroring a repository using a ref namespace

# passed all 4 test(s)
1..4
ok 70 - fetch-pack --diag-url ssh+git://user@::1/~repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
[master 37bb63e] remote-name
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 71 - fetch-pack --diag-url ssh+git://user@::1:/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
ok 72 - fetch-pack --diag-url ssh+git://user@::1:/~repo

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
[master 37bb63e] remote-name
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
*** t5510-fetch.sh ***
Fetching one
ok 73 - fetch-pack --diag-url ssh+git://host:22/repo

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
To ../public
 * [new branch]      new -> new
 * [new branch]      renamed -> renamed
 * [new tag]         one -> one
d79ce1670bdcb76e6d1da2ae095e890ccb326ae9
d79ce1670bdcb76e6d1da2ae095e890ccb326ae9
fatal: Needed a single revision
ok 25 - push mirrors act as mirrors during push

expecting success: 
	(
		cd mirror-push/public &&
		git branch -m renamed renamed2 &&
		git symbolic-ref HEAD refs/heads/renamed2
	) &&
	(
		cd mirror-push/private &&
		git fetch public &&
		git rev-parse --verify refs/heads/renamed &&
		test_must_fail git rev-parse --verify refs/heads/renamed2
	)

ok 74 - fetch-pack --diag-url ssh+git://User@host:22/repo

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
ok 75 - fetch-pack --diag-url ssh+git://User@[::1]:22/repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.git/
From one
   311125f..37bb63e  master     -> one/master
expecting success: 
	echo >file original &&
	git add file &&
	git commit -a -m original
ok 76 - fetch-pack --diag-url git+ssh://host/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
repo was fetched: one
From ../public
 * branch            HEAD       -> FETCH_HEAD
[master (root-commit) 928eacd] original
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 1 - setup

expecting success: 
	git clone . one &&
	(
		cd one &&
		echo >file updated by one &&
		git commit -a -m "updated by one"
	) &&
	git clone . two &&
	(
		cd two &&
		git config branch.master.remote one &&
		git config remote.one.url ../one/.git/ &&
		git config remote.one.fetch refs/heads/master:refs/heads/one
	) &&
	git clone . three &&
	(
		cd three &&
		git config branch.master.remote two &&
		git config branch.master.merge refs/heads/one &&
		mkdir -p .git/remotes &&
		{
			echo "URL: ../two/.git/"
			echo "Pull: refs/heads/master:refs/heads/two"
			echo "Pull: refs/heads/one:refs/heads/one"
		} >.git/remotes/two
	) &&
	git clone . bundle &&
	git clone . seven

ok 77 - fetch-pack --diag-url git+ssh://host/~repo

repo was not fetched: two
expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 8 - updating remote name updates that remote

Cloning into 'one'...
d79ce1670bdcb76e6d1da2ae095e890ccb326ae9
# passed all 8 test(s)
1..8
fatal: Needed a single revision
ok 26 - push mirrors do not act as mirrors during fetch

expecting success: 
	git init mirror-push/track &&
	(
		cd mirror-push/track &&
		test_must_fail git remote add --mirror=push -t new public ../public
	)

ok 78 - fetch-pack --diag-url git+ssh://host:/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5505-remote/mirror-push/track/.git/
fatal: specifying branches to track makes sense only with fetch mirrors
ok 27 - push mirrors do not allow you to specify refs

expecting success: 
	mkdir alttst &&
	(
		cd alttst &&
		git init &&
		git remote add -f origin ../one &&
		git config remote.alt.url ../one &&
		git config remote.alt.fetch "+refs/heads/*:refs/remotes/origin/*"
	) &&
	(
		cd one &&
		git branch -m side side2
	) &&
	(
		cd alttst &&
		git rev-parse --verify refs/remotes/origin/side &&
		test_must_fail git rev-parse --verify refs/remotes/origin/side2 &&
		git fetch alt &&
		git remote prune alt &&
		test_must_fail git rev-parse --verify refs/remotes/origin/side &&
		git rev-parse --verify refs/remotes/origin/side2
	)

ok 79 - fetch-pack --diag-url git+ssh://host:/~repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
[master aeeaa8a] updated by one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5505-remote/alttst/.git/
Cloning into 'two'...
Updating origin
ok 80 - fetch-pack --diag-url git+ssh://user@host/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
*** t5511-refspec.sh ***
done.
ok 81 - fetch-pack --diag-url git+ssh://user@host/~repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 82 - fetch-pack --diag-url git+ssh://user@host:/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5511-refspec/.git/
From ../one
 * [new branch]      master     -> origin/master
Cloning into 'three'...
 * [new branch]      side       -> origin/side
ok 83 - fetch-pack --diag-url git+ssh://user@host:/~repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
done.
expecting success: test_must_fail git ls-remote frotz
fatal: Invalid refspec ''
ok 84 - fetch-pack --diag-url git+ssh://user@[::1]/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
ok 1 - push  (invalid)

2ce9c504874e3f0ce77f83c0bb0b1024c7a6387f
Cloning into 'bundle'...
ok 85 - fetch-pack --diag-url git+ssh://user@[::1]/~repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
fatal: Needed a single revision
expecting success: git ls-remote frotz
ok 86 - fetch-pack --diag-url git+ssh://user@[::1]:/repo

done.
expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
ok 2 - push :

From ../one
 * [new branch]      side2      -> origin/side2
Cloning into 'seven'...
ok 87 - fetch-pack --diag-url git+ssh://user@[::1]:/~repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
expecting success: test_must_fail git ls-remote frotz
done.
Pruning alt
URL: ../one
 * [pruned] origin/side
fatal: Needed a single revision
fatal: Invalid refspec '::'
ok 3 - push :: (invalid)

ok 88 - fetch-pack --diag-url git+ssh://user@::1/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
ok 2 - clone and setup child repos

expecting success: 
	cd "$D" &&
	echo >file updated by origin &&
	git commit -a -m "updated by origin" &&
	cd two &&
	git fetch &&
	test -f .git/refs/heads/one &&
	mine=`git rev-parse refs/heads/one` &&
	his=`cd ../one && git rev-parse refs/heads/master` &&
	test "z$mine" = "z$his"

2ce9c504874e3f0ce77f83c0bb0b1024c7a6387f
ok 28 - add alt && prune

expecting success: 
	(
		cd one &&
		>foobar &&
		git add foobar &&
		git commit -m "Foobar" &&
		git tag -a -m "Foobar tag" foobar-tag &&
		git reset --hard HEAD~1 &&
		git tag -a -m "Some tag" some-tag
	) &&
	mkdir add-tags &&
	(
		cd add-tags &&
		git init &&
		git remote add -f origin ../one &&
		git tag -l some-tag >../test/output &&
		git tag -l foobar-tag >>../test/output &&
		test_must_fail git config remote.origin.tagopt
	) &&
	test_cmp test/expect test/output

[master e52175f] updated by origin
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 89 - fetch-pack --diag-url git+ssh://user@::1/~repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
[master 5399255] Foobar
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 foobar
expecting success: git ls-remote frotz
ok 90 - fetch-pack --diag-url git+ssh://user@::1:/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
ok 4 - push +:

HEAD is now at 6329a3c update
ok 91 - fetch-pack --diag-url git+ssh://user@::1:/~repo

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
From ../one/
 * [new branch]      master     -> one
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5505-remote/add-tags/.git/
expecting success: git ls-remote frotz
ok 92 - fetch-pack --diag-url git+ssh://host:22/repo

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
Updating origin
ok 5 - fetch 

ok 3 - fetch test

expecting success: 
	cd "$D" &&
	cd three &&
	git fetch &&
	test -f .git/refs/heads/two &&
	test -f .git/refs/heads/one &&
	master_in_two=`cd ../two && git rev-parse master` &&
	one_in_two=`cd ../two && git rev-parse one` &&
	{
		echo "$one_in_two	"
		echo "$master_in_two	not-for-merge"
	} >expected &&
	cut -f -2 .git/FETCH_HEAD >actual &&
	test_cmp expected actual
ok 93 - fetch-pack --diag-url git+ssh://User@host:22/repo

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
expecting success: git ls-remote frotz
ok 94 - fetch-pack --diag-url git+ssh://User@[::1]:22/repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 6 - fetch :

From ../one
 * [new branch]      master     -> origin/master
 * [new branch]      side2      -> origin/side2
ok 95 - fetch-pack --diag-url git://host/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
 * [new tag]         some-tag   -> some-tag
From ../two/
 * [new branch]      one        -> one
 * [new branch]      master     -> two
expecting success: test_must_fail git ls-remote frotz
fatal: Invalid refspec '::'
ok 96 - fetch-pack --diag-url git://host/~repo

ok 7 - fetch :: (invalid)

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 4 - fetch test for-merge

expecting success: 
	cd "$D" &&
	git clone . prune &&
	cd prune &&
	git update-ref refs/remotes/origin/extrabranch master &&

	git fetch --prune origin &&
	test_must_fail git rev-parse origin/extrabranch

ok 29 - add with reachable tags (default)

expecting success: 
	rm -rf add-tags &&
	(
		mkdir add-tags &&
		cd add-tags &&
		git init &&
		git remote add -f --tags origin ../one &&
		git tag -l some-tag >../test/output &&
		git tag -l foobar-tag >>../test/output &&
		git config remote.origin.tagopt >>../test/output
	) &&
	test_cmp test/expect test/output

Cloning into 'prune'...
ok 97 - fetch-pack --diag-url git://host:/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
expecting success: git ls-remote frotz
done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5505-remote/add-tags/.git/
ok 8 - push refs/heads/*:refs/remotes/frotz/*

ok 98 - fetch-pack --diag-url git://host:/~repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
Updating origin
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 x [deleted]         (none)     -> origin/extrabranch
ok 99 - fetch-pack --diag-url git://user@host/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
expecting success: test_must_fail git ls-remote frotz
fatal: Invalid refspec 'refs/heads/*:refs/remotes/frotz'
ok 9 - push refs/heads/*:refs/remotes/frotz (invalid)

ok 100 - fetch-pack --diag-url git://user@host/~repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
fatal: ambiguous argument 'origin/extrabranch': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
origin/extrabranch
ok 5 - fetch --prune on its own works as expected

expecting success: 
	cd "$D" &&
	git clone . prune-branch &&
	cd prune-branch &&
	git update-ref refs/remotes/origin/extrabranch master &&

	git fetch --prune origin master &&
	git rev-parse origin/extrabranch

Cloning into 'prune-branch'...
From ../one
expecting success: test_must_fail git ls-remote frotz
 * [new branch]      master     -> origin/master
ok 101 - fetch-pack --diag-url git://user@host:/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
 * [new branch]      side2      -> origin/side2
 * [new tag]         foobar-tag -> foobar-tag
 * [new tag]         some-tag   -> some-tag
fatal: Invalid refspec 'refs/heads:refs/remotes/frotz/*'
ok 10 - push refs/heads:refs/remotes/frotz/* (invalid)

done.
ok 102 - fetch-pack --diag-url git://user@host:/~repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 30 - add --tags

expecting success: 
	rm -rf add-tags &&
	(
		mkdir add-no-tags &&
		cd add-no-tags &&
		git init &&
		git remote add -f --no-tags origin ../one &&
		git tag -l some-tag >../test/output &&
		git tag -l foobar-tag >../test/output &&
		git config remote.origin.tagopt >>../test/output
	) &&
	(
		cd one &&
		git tag -d some-tag foobar-tag
	) &&
	test_cmp test/expect test/output

expecting success: git ls-remote frotz
ok 103 - fetch-pack --diag-url git://user@[::1]/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
ok 11 - push refs/heads/master:refs/remotes/frotz/xyzzy

ok 104 - fetch-pack --diag-url git://user@[::1]/~repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5505-remote/add-no-tags/.git/
 * branch            master     -> FETCH_HEAD
Updating origin
e52175f10b369d5c5b221eca78abc3921fb68ccb
ok 6 - fetch --prune with a branch name keeps branches

expecting success: 
	cd "$D" &&
	git clone . prune-namespace &&
	cd prune-namespace &&

	git fetch --prune origin refs/heads/a/*:refs/remotes/origin/a/* &&
	git rev-parse origin/master

expecting success: git ls-remote frotz
ok 105 - fetch-pack --diag-url git://user@[::1]:/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
Cloning into 'prune-namespace'...
ok 12 - fetch refs/heads/*:refs/remotes/frotz/*

ok 106 - fetch-pack --diag-url git://user@[::1]:/~repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
done.
expecting success: test_must_fail git ls-remote frotz
fatal: Invalid refspec 'refs/heads/*:refs/remotes/frotz'
ok 107 - fetch-pack --diag-url git://user@::1/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
ok 13 - fetch refs/heads/*:refs/remotes/frotz (invalid)

From ../one
 * [new branch]      master     -> origin/master
 * [new branch]      side2      -> origin/side2
e52175f10b369d5c5b221eca78abc3921fb68ccb
ok 7 - fetch --prune with a namespace keeps other namespaces

expecting success: 
	cd "$D" &&
	git update-ref refs/pull/42/head master &&
	git clone . prune-overlapping &&
	cd prune-overlapping &&
	git config --add remote.origin.fetch refs/pull/*/head:refs/remotes/origin/pr/* &&

	git fetch --prune origin &&
	git rev-parse origin/master &&
	git rev-parse origin/pr/42 &&

	git config --unset-all remote.origin.fetch &&
	git config remote.origin.fetch refs/pull/*/head:refs/remotes/origin/pr/* &&
	git config --add remote.origin.fetch refs/heads/*:refs/remotes/origin/* &&

	git fetch --prune origin &&
	git rev-parse origin/master &&
	git rev-parse origin/pr/42

ok 108 - fetch-pack --diag-url git://user@::1/~repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
expecting success: test_must_fail git ls-remote frotz
fatal: Invalid refspec 'refs/heads:refs/remotes/frotz/*'
ok 14 - fetch refs/heads:refs/remotes/frotz/* (invalid)

Cloning into 'prune-overlapping'...
Deleted tag 'some-tag' (was 46c95d4)
Deleted tag 'foobar-tag' (was 8b38df3)
ok 109 - fetch-pack --diag-url git://user@::1:/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
ok 31 - add --no-tags

expecting success: 
	(
		cd add-no-tags &&
		test_must_fail git remote add -f --no-no-tags neworigin ../one
	)

done.
error: unknown option `no-no-tags'
usage: git remote add [<options>] <name> <url>

    -f, --fetch           fetch the remote branches
    --tags                import all tags and associated objects when fetching
                          or do not fetch any tag at all (--no-tags)
    -t, --track <branch>  branch(es) to track
    -m, --master <branch>
                          master branch
    --mirror[=<push|fetch>]
                          set up remote as a mirror to push to or fetch from

ok 32 - reject --no-no-tags

expecting success: git ls-remote frotz
expecting success: 
	(
		cd one &&
		git remote add drosophila ../two &&
		git remote add apis ../mirror &&
		git remote update &&
		git branch -r >output &&
		test_cmp expect output
	)

ok 110 - fetch-pack --diag-url git://user@::1:/~repo

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
ok 15 - fetch refs/heads/master:refs/remotes/frotz/xyzzy

Fetching drosophila
ok 111 - fetch-pack --diag-url git://host:22/repo

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
expecting success: test_must_fail git ls-remote frotz
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 * [new ref]         refs/pull/42/head -> origin/pr/42
fatal: Invalid refspec 'refs/heads/master::refs/remotes/frotz/xyzzy'
ok 16 - fetch refs/heads/master::refs/remotes/frotz/xyzzy (invalid)

ok 112 - fetch-pack --diag-url git://User@host:22/repo

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
e52175f10b369d5c5b221eca78abc3921fb68ccb
From ../two
 * [new branch]      another    -> drosophila/another
 * [new branch]      master     -> drosophila/master
 * [new branch]      side       -> drosophila/side
e52175f10b369d5c5b221eca78abc3921fb68ccb
Fetching apis
ok 113 - fetch-pack --diag-url git://User@[::1]:22/repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
expecting success: test_must_fail git ls-remote frotz
fatal: Invalid refspec 'refs/heads/maste :refs/remotes/frotz/xyzzy'
ok 17 - fetch refs/heads/maste :refs/remotes/frotz/xyzzy (invalid)

ok 114 - fetch-pack --diag-url ssh://host/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
From ../mirror
 * [new branch]      master     -> apis/master
 * [new branch]      side       -> apis/side
expecting success: git ls-remote frotz
ok 115 - fetch-pack --diag-url ssh://host/~repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 18 - push master~1:refs/remotes/frotz/backup

ok 33 - update

e52175f10b369d5c5b221eca78abc3921fb68ccb
expecting success: 
	(
		cd one &&
		for b in $(git branch -r)
		do
		git branch -r -d $b || exit 1
		done &&
		git remote add manduca ../mirror &&
		git remote add megaloprepus ../mirror &&
		git config remotes.phobaeticus "drosophila megaloprepus" &&
		git config remotes.titanus manduca &&
		git remote update phobaeticus titanus &&
		git branch -r >output &&
		test_cmp expect output
	)

ok 116 - fetch-pack --diag-url ssh://host:/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
e52175f10b369d5c5b221eca78abc3921fb68ccb
ok 8 - fetch --prune handles overlapping refspecs

expecting success: 
	cd "$D" &&
	git clone . prune-tags &&
	cd prune-tags &&
	git tag sometag master &&
	# Create what looks like a remote-tracking branch from an earlier
	# fetch that has since been deleted from the remote:
	git update-ref refs/remotes/origin/fake-remote master &&

	git fetch --prune --tags origin &&
	git rev-parse origin/master &&
	test_must_fail git rev-parse origin/fake-remote &&
	git rev-parse sometag

Cloning into 'prune-tags'...
expecting success: test_must_fail git ls-remote frotz
Deleted remote-tracking branch apis/master (was 6329a3c).
ok 117 - fetch-pack --diag-url ssh://host:/~repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
fatal: Invalid refspec 'master~1:refs/remotes/frotz/backup'
ok 19 - fetch master~1:refs/remotes/frotz/backup (invalid)

Deleted remote-tracking branch apis/side (was 2ce9c50).
done.
Deleted remote-tracking branch drosophila/another (was 9d34b14).
ok 118 - fetch-pack --diag-url ssh://user@host/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
Deleted remote-tracking branch drosophila/master (was 9d34b14).
expecting success: git ls-remote frotz
Deleted remote-tracking branch drosophila/side (was 2ce9c50).
ok 119 - fetch-pack --diag-url ssh://user@host/~repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 20 - push HEAD~4:refs/remotes/frotz/new

From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 x [deleted]         (none)     -> origin/fake-remote
ok 120 - fetch-pack --diag-url ssh://user@host:/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
expecting success: test_must_fail git ls-remote frotz
fatal: Invalid refspec 'HEAD~4:refs/remotes/frotz/new'
ok 21 - fetch HEAD~4:refs/remotes/frotz/new (invalid)

Fetching drosophila
ok 121 - fetch-pack --diag-url ssh://user@host:/~repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
e52175f10b369d5c5b221eca78abc3921fb68ccb
fatal: ambiguous argument 'origin/fake-remote': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
origin/fake-remote
ok 122 - fetch-pack --diag-url ssh://user@[::1]/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
e52175f10b369d5c5b221eca78abc3921fb68ccb
ok 9 - fetch --prune --tags prunes branches but not tags

expecting success: 
	cd "$D" &&
	git clone . prune-tags-branch &&
	cd prune-tags-branch &&
	git tag sometag master &&
	git update-ref refs/remotes/origin/extrabranch master &&

	git fetch --prune --tags origin master &&
	git rev-parse origin/extrabranch &&
	git rev-parse sometag

From ../two
 * [new branch]      another    -> drosophila/another
expecting success: git ls-remote frotz
 * [new branch]      master     -> drosophila/master
 * [new branch]      side       -> drosophila/side
Cloning into 'prune-tags-branch'...
Fetching megaloprepus
ok 123 - fetch-pack --diag-url ssh://user@[::1]/~repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 22 - push HEAD

done.
ok 124 - fetch-pack --diag-url ssh://user@[::1]:/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
From ../mirror
 * [new branch]      master     -> megaloprepus/master
 * [new branch]      side       -> megaloprepus/side
expecting success: git ls-remote frotz
Fetching manduca
ok 125 - fetch-pack --diag-url ssh://user@[::1]:/~repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 23 - fetch HEAD

ok 126 - fetch-pack --diag-url ssh://user@::1/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
From ../mirror
 * [new branch]      master     -> manduca/master
 * [new branch]      side       -> manduca/side
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
expecting success: test_must_fail git ls-remote frotz
 * branch            master     -> FETCH_HEAD
fatal: Invalid refspec 'refs/heads/ nitfol'
ok 24 - push refs/heads/ nitfol (invalid)

ok 127 - fetch-pack --diag-url ssh://user@::1/~repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
e52175f10b369d5c5b221eca78abc3921fb68ccb
e52175f10b369d5c5b221eca78abc3921fb68ccb
ok 10 - fetch --prune --tags with branch does not prune other things

expecting success: 
	cd "$D" &&
	git clone . prune-tags-refspec &&
	cd prune-tags-refspec &&
	git tag sometag master &&
	git update-ref refs/remotes/origin/foo/otherbranch master &&
	git update-ref refs/remotes/origin/extrabranch master &&

	git fetch --prune --tags origin refs/heads/foo/*:refs/remotes/origin/foo/* &&
	test_must_fail git rev-parse refs/remotes/origin/foo/otherbranch &&
	git rev-parse origin/extrabranch &&
	git rev-parse sometag

ok 34 - update with arguments

expecting success: 
	(
		cd one &&
		git branch -m side2 side3
	) &&
	(
		cd test &&
		git remote update --prune &&
		(
			cd ../one &&
			git branch -m side3 side2
		) &&
		git rev-parse refs/remotes/origin/side3 &&
		test_must_fail git rev-parse refs/remotes/origin/side2
	)

Cloning into 'prune-tags-refspec'...
ok 128 - fetch-pack --diag-url ssh://user@::1:/repo

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
expecting success: test_must_fail git ls-remote frotz
done.
fatal: Invalid refspec 'refs/heads/ nitfol'
ok 25 - fetch refs/heads/ nitfol (invalid)

ok 129 - fetch-pack --diag-url ssh://user@::1:/~repo

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
Fetching origin
From /«PKGBUILDDIR»/t/trash directory.t5505-remote/one
 x [deleted]         (none)     -> origin/side2
ok 130 - fetch-pack --diag-url ssh://host:22/repo

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
expecting success: test_must_fail git ls-remote frotz
fatal: Invalid refspec 'HEAD:'
ok 26 - push HEAD: (invalid)

ok 131 - fetch-pack --diag-url ssh://User@host:22/repo

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
 * [new branch]      side3      -> origin/side3
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 x [deleted]         (none)     -> origin/foo/otherbranch
Fetching two
ok 132 - fetch-pack --diag-url ssh://User@[::1]:22/repo

expecting success: 
			check_prot_path $p://$h/$r $p "/$r"
		
expecting success: git ls-remote frotz
fatal: ambiguous argument 'refs/remotes/origin/foo/otherbranch': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
refs/remotes/origin/foo/otherbranch
e52175f10b369d5c5b221eca78abc3921fb68ccb
ok 133 - fetch-pack --diag-url file://User@[::1]/repo

expecting success: 
			check_prot_path $p://$h/~$r $p "/~$r"
		
e52175f10b369d5c5b221eca78abc3921fb68ccb
ok 27 - fetch HEAD:

ok 11 - fetch --prune --tags with refspec prunes based on refspec

expecting success: 

    cd "$D" &&

    mkdir notags &&
    cd notags &&
    git init &&

    git fetch -t ..


From ../two
 * branch            HEAD       -> FETCH_HEAD
ok 134 - fetch-pack --diag-url file://User@[::1]/~repo

expecting success: 
			check_prot_path ./$h:$r $p "./$h:$r"
		
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5510-fetch/notags/.git/
ok 135 - fetch-pack --diag-url ./nohost:repo

expecting success: 
		check_prot_path ./$p:$h/~$r $p "./$p:$h/~$r"
		
expecting success: test_must_fail git ls-remote frotz
fatal: Invalid refspec 'refs/heads/ nitfol:'
ok 28 - push refs/heads/ nitfol: (invalid)

2ce9c504874e3f0ce77f83c0bb0b1024c7a6387f
ok 136 - fetch-pack --diag-url ./file:nohost/~repo

expecting success: 
			check_prot_path ./$h:$r $p "./$h:$r"
		
fatal: ambiguous argument 'refs/remotes/origin/side2': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
refs/remotes/origin/side2
ok 35 - update --prune

expecting success: 
	(
		cd one &&
		for b in $(git branch -r)
		do
		git branch -r -d $b || exit 1
		done &&
		git config remote.drosophila.skipDefaultUpdate true &&
		git remote update default &&
		git branch -r >output &&
		test_cmp expect output
	)

ok 137 - fetch-pack --diag-url ./nohost:12:repo

expecting success: 
		check_prot_path ./$p:$h/~$r $p "./$p:$h/~$r"
		
ok 138 - fetch-pack --diag-url ./file:nohost:12/~repo

expecting success: 
			check_prot_path ./$h:$r $p "./$h:$r"
		
expecting success: test_must_fail git ls-remote frotz
Deleted remote-tracking branch drosophila/another (was 9d34b14).
From ..
 * branch            HEAD       -> FETCH_HEAD
fatal: Invalid refspec 'refs/heads/ nitfol:'
ok 29 - fetch refs/heads/ nitfol: (invalid)

Deleted remote-tracking branch drosophila/master (was 9d34b14).
ok 139 - fetch-pack --diag-url ./[::1]:repo

expecting success: 
		check_prot_path ./$p:$h/~$r $p "./$p:$h/~$r"
		
ok 12 - fetch tags when there is no tags

expecting success: 

	cd "$D" &&
	git tag -a -m annotated anno HEAD &&
	git tag light HEAD &&

	mkdir four &&
	cd four &&
	git init &&

	git fetch .. :track &&
	git show-ref --verify refs/tags/anno &&
	git show-ref --verify refs/tags/light


Deleted remote-tracking branch drosophila/side (was 2ce9c50).
ok 140 - fetch-pack --diag-url ./file:[::1]/~repo

expecting success: 
			check_prot_path ./$h:$r $p "./$h:$r"
		
Deleted remote-tracking branch manduca/master (was 6329a3c).
expecting success: git ls-remote frotz
ok 141 - fetch-pack --diag-url ./[::1]:23:repo

expecting success: 
		check_prot_path ./$p:$h/~$r $p "./$p:$h/~$r"
		
Deleted remote-tracking branch manduca/side (was 2ce9c50).
ok 30 - push :refs/remotes/frotz/deleteme

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5510-fetch/four/.git/
ok 142 - fetch-pack --diag-url ./file:[::1]:23/~repo

expecting success: 
			check_prot_path ./$h:$r $p "./$h:$r"
		
Deleted remote-tracking branch megaloprepus/master (was 6329a3c).
ok 143 - fetch-pack --diag-url ./[:repo

expecting success: 
		check_prot_path ./$p:$h/~$r $p "./$p:$h/~$r"
		
Deleted remote-tracking branch megaloprepus/side (was 2ce9c50).
expecting success: git ls-remote frotz
ok 144 - fetch-pack --diag-url ./file:[/~repo

expecting success: 
			check_prot_path ./$h:$r $p "./$h:$r"
		
Fetching apis
ok 31 - fetch :refs/remotes/frotz/HEAD-to-me

ok 145 - fetch-pack --diag-url ./[:aa:repo

expecting success: 
		check_prot_path ./$p:$h/~$r $p "./$p:$h/~$r"
		
From ..
 * [new ref]                    -> track
ok 146 - fetch-pack --diag-url ./file:[:aa/~repo

expecting success: 
			check_prot_host_port_path $h:$r $p "$h" NONE "$r"
		
 * [new tag]         anno       -> anno
 * [new tag]         light      -> light
expecting success: test_must_fail git ls-remote frotz
From ../mirror
 * [new branch]      master     -> apis/master
 * [new branch]      side       -> apis/side
fatal: Invalid refspec ':refs/remotes/frotz/delete me'
ok 32 - push :refs/remotes/frotz/delete me (invalid)

a9b14ff61c873136541d69a45c41bef93b54d57a refs/tags/anno
Fetching manduca
ok 147 - fetch-pack --diag-url host:repo

expecting success: 
			check_prot_host_port_path $h:/~$r $p "$h" NONE "~$r"
		
e52175f10b369d5c5b221eca78abc3921fb68ccb refs/tags/light
ok 13 - fetch following tags

expecting success: 
	cd "$D" &&
	git init descriptive &&
	(
		cd descriptive &&
		git config remote.o.url .. &&
		git config remote.o.fetch "refs/heads/*:refs/crazyheads/*" &&
		git config --add remote.o.fetch "refs/others/*:refs/heads/*" &&
		git fetch o
	) &&
	git tag -a -m "Descriptive tag" descriptive-tag &&
	git branch descriptive-branch &&
	git checkout descriptive-branch &&
	echo "Nuts" >crazy &&
	git add crazy &&
	git commit -a -m "descriptive commit" &&
	git update-ref refs/others/crazy HEAD &&
	(
		cd descriptive &&
		git fetch o 2>actual &&
		grep " -> refs/crazyheads/descriptive-branch$" actual |
		test_i18ngrep "new branch" &&
		grep " -> descriptive-tag$" actual |
		test_i18ngrep "new tag" &&
		grep " -> crazy$" actual |
		test_i18ngrep "new ref"
	) &&
	git checkout master

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5510-fetch/descriptive/.git/
ok 148 - fetch-pack --diag-url host:/~repo

expecting success: 
			check_prot_host_port_path $h:$r $p "$h" NONE "$r"
		
expecting success: test_must_fail git ls-remote frotz
From ../mirror
 * [new branch]      master     -> manduca/master
 * [new branch]      side       -> manduca/side
fatal: Invalid refspec ':refs/remotes/frotz/HEAD to me'
ok 33 - fetch :refs/remotes/frotz/HEAD to me (invalid)

Fetching megaloprepus
ok 149 - fetch-pack --diag-url [::1]:repo

expecting success: 
			check_prot_host_port_path $h:/~$r $p "$h" NONE "~$r"
		
expecting success: git ls-remote frotz
ok 150 - fetch-pack --diag-url [::1]:/~repo

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
From ../mirror
 * [new branch]      master     -> megaloprepus/master
 * [new branch]      side       -> megaloprepus/side
ok 34 - fetch refs/heads/*/for-linus:refs/remotes/mine/*-blah

ok 151 - fetch-pack --diag-url ssh+git://host/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
ok 36 - update default

expecting success: 
	(
		cd one &&
		for b in $(git branch -r)
		do
		git branch -r -d $b || exit 1
		done &&
		git config remotes.default "$(printf "\t drosophila  \n")" &&
		git remote update default &&
		git branch -r >output &&
		test_cmp expect output
	)

From ..
ok 152 - fetch-pack --diag-url ssh+git://host/~re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
 * [new branch]      master     -> refs/crazyheads/master
expecting success: git ls-remote frotz
 * [new tag]         anno       -> anno
 * [new tag]         light      -> light
Deleted remote-tracking branch apis/master (was 6329a3c).
ok 35 - push refs/heads/*/for-linus:refs/remotes/mine/*-blah

ok 153 - fetch-pack --diag-url ssh+git://host:/re:po

Deleted remote-tracking branch apis/side (was 2ce9c50).
expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
Deleted remote-tracking branch manduca/master (was 6329a3c).
Switched to branch 'descriptive-branch'
Deleted remote-tracking branch manduca/side (was 2ce9c50).
ok 154 - fetch-pack --diag-url ssh+git://host:/~re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
expecting success: git ls-remote frotz
Deleted remote-tracking branch megaloprepus/master (was 6329a3c).
Deleted remote-tracking branch megaloprepus/side (was 2ce9c50).
ok 36 - fetch refs/heads*/for-linus:refs/remotes/mine/*

[descriptive-branch 8694717] descriptive commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 crazy
ok 155 - fetch-pack --diag-url ssh+git://user@host/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
Fetching drosophila
ok 156 - fetch-pack --diag-url ssh+git://user@host/~re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
expecting success: git ls-remote frotz
ok 37 - push refs/heads*/for-linus:refs/remotes/mine/*

From ../two
 * [new branch]      another    -> drosophila/another
 * [new branch]      master     -> drosophila/master
ok 157 - fetch-pack --diag-url ssh+git://user@host:/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
 * [new branch]      side       -> drosophila/side
ok 158 - fetch-pack --diag-url ssh+git://user@host:/~re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 37 - update default (overridden, with funny whitespace)

expecting success: 
	(
		cd one &&
		for b in $(git branch -r)
		do
		git branch -r -d $b || exit 1
		done &&
		git config remotes.default "drosophila" &&
		git remote update &&
		git branch -r >output &&
		test_cmp expect output
	)

expecting success: test_must_fail git ls-remote frotz
fatal: Invalid refspec 'refs/heads/*/*/for-linus:refs/remotes/mine/*'
ok 38 - fetch refs/heads/*/*/for-linus:refs/remotes/mine/* (invalid)

 * [new branch]      descriptive-branch -> refs/crazyheads/descriptive-branch
ok 159 - fetch-pack --diag-url ssh+git://user@[::1]/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
Deleted remote-tracking branch drosophila/another (was 9d34b14).
 * [new tag]         descriptive-tag -> descriptive-tag
 * [new ref]         refs/others/crazy -> crazy
Deleted remote-tracking branch drosophila/master (was 9d34b14).
Switched to branch 'master'
ok 14 - fetch uses remote ref names to describe new refs

expecting success: 

	cd "$D" &&

	mkdir five &&
	cd five &&
	git init &&

	test_must_fail git fetch .. anno:five


ok 160 - fetch-pack --diag-url ssh+git://user@[::1]/~re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
expecting success: test_must_fail git ls-remote frotz
Deleted remote-tracking branch drosophila/side (was 2ce9c50).
fatal: Invalid refspec 'refs/heads/*/*/for-linus:refs/remotes/mine/*'
ok 39 - push refs/heads/*/*/for-linus:refs/remotes/mine/* (invalid)

Fetching drosophila
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5510-fetch/five/.git/
ok 161 - fetch-pack --diag-url ssh+git://user@[::1]:/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
expecting success: test_must_fail git ls-remote frotz
ok 162 - fetch-pack --diag-url ssh+git://user@[::1]:/~re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
fatal: Invalid refspec 'refs/heads/*g*/for-linus:refs/remotes/mine/*'
ok 40 - fetch refs/heads/*g*/for-linus:refs/remotes/mine/* (invalid)

From ../two
 * [new branch]      another    -> drosophila/another
 * [new branch]      master     -> drosophila/master
 * [new branch]      side       -> drosophila/side
ok 163 - fetch-pack --diag-url ssh+git://user@::1/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
expecting success: test_must_fail git ls-remote frotz
ok 38 - update (with remotes.default defined)

expecting success: 
	git clone one three &&
	(
		cd three &&
		git remote show origin >output &&
		! grep "^ *HEAD$" < output &&
		! grep -i stale < output
	)

fatal: Invalid refspec 'refs/heads/*g*/for-linus:refs/remotes/mine/*'
ok 41 - push refs/heads/*g*/for-linus:refs/remotes/mine/* (invalid)

error: cannot update the ref 'refs/heads/five': Trying to write non-commit object a9b14ff61c873136541d69a45c41bef93b54d57a to branch refs/heads/five
From ..
 ! [new tag]         anno       -> five  (unable to update local ref)
 * [new tag]         anno       -> anno
Cloning into 'three'...
ok 15 - fetch must not resolve short tag name

expecting success: 

	cd "$D" &&
	git update-ref refs/remotes/six/HEAD HEAD &&

	mkdir six &&
	cd six &&
	git init &&

	git fetch .. six:six

ok 164 - fetch-pack --diag-url ssh+git://user@::1/~re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
done.
expecting success: git ls-remote frotz
ok 165 - fetch-pack --diag-url ssh+git://user@::1:/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5510-fetch/six/.git/
ok 42 - fetch refs/heads/*/for-linus:refs/remotes/mine/*

ok 166 - fetch-pack --diag-url ssh+git://user@::1:/~re:po

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
ok 39 - "remote show" does not show symbolic refs

expecting success: 
	test_must_fail git remote add some:url desired-name

fatal: 'some:url' is not a valid remote name
ok 40 - reject adding remote with an invalid name

expecting success: 
	git clone one four &&
	(
		cd four &&
		git remote rename origin upstream &&
		rmdir .git/refs/remotes/origin &&
		test "$(git symbolic-ref refs/remotes/upstream/HEAD)" = "refs/remotes/upstream/master" &&
		test "$(git rev-parse upstream/master)" = "$(git rev-parse master)" &&
		test "$(git config remote.upstream.fetch)" = "+refs/heads/*:refs/remotes/upstream/*" &&
		test "$(git config branch.master.remote)" = "upstream"
	)

ok 167 - fetch-pack --diag-url ssh+git://host:22/re:po

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
expecting success: git ls-remote frotz
Cloning into 'four'...
ok 43 - push refs/heads/*/for-linus:refs/remotes/mine/*

ok 168 - fetch-pack --diag-url ssh+git://User@host:22/re:po

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
From ..
 * [new ref]         six/HEAD   -> six
 * [new tag]         anno       -> anno
 * [new tag]         descriptive-tag -> descriptive-tag
 * [new tag]         light      -> light
done.
ok 16 - fetch can now resolve short remote name

expecting success: 
	cd "$D" &&
	echo >file updated again by origin &&
	git commit -a -m "tip" &&
	git bundle create bundle1 master^..master

ok 169 - fetch-pack --diag-url ssh+git://User@[::1]:22/re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
expecting success: git ls-remote frotz
[master 395220a] tip
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 44 - fetch refs/heads/Ä

ok 170 - fetch-pack --diag-url git+ssh://host/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
ok 17 - create bundle 1

expecting success: 
	head -n 1 "$D"/bundle1 | grep "^#" &&
	head -n 2 "$D"/bundle1 | grep "^-[0-9a-f]\{40\} " &&
	head -n 3 "$D"/bundle1 | grep "^[0-9a-f]\{40\} " &&
	head -n 4 "$D"/bundle1 | grep "^$"

# v2 git bundle
expecting success: test_must_fail git ls-remote frotz
ok 171 - fetch-pack --diag-url git+ssh://host/~re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
-e52175f10b369d5c5b221eca78abc3921fb68ccb updated by origin
395220a841a1cbbbfe693bf51df64e7837728a1e refs/heads/master
fatal: Invalid refspec 'refs/heads/	tab'
ok 45 - fetch refs/heads/	tab (invalid)


ok 18 - header of bundle looks right

expecting success: 
	cd "$D" &&
	git bundle create bundle2 master~2..master

# passed all 45 test(s)
1..45
ok 172 - fetch-pack --diag-url git+ssh://host:/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
ok 41 - rename a remote

expecting success: 
	git clone one four.one &&
	(
		cd four.one &&
		git config remote.origin.fetch +refs/heads/*:refs/heads/origin/* &&
		git remote rename origin upstream &&
		test "$(git config remote.upstream.fetch)" = "+refs/heads/*:refs/heads/origin/*" &&
		git rev-parse -q origin/master
	)

Cloning into 'four.one'...
*** t5512-ls-remote.sh ***
ok 19 - create bundle 2

expecting success: 
	cd "$D/bundle" &&
	git checkout -b some-branch &&
	test_must_fail git fetch "$D/bundle1" master:master

ok 173 - fetch-pack --diag-url git+ssh://host:/~re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
Switched to a new branch 'some-branch'
done.
ok 174 - fetch-pack --diag-url git+ssh://user@host/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
error: Repository lacks these prerequisite commits:
error: e52175f10b369d5c5b221eca78abc3921fb68ccb 
ok 20 - unbundle 1

expecting success: 
	cd "$D" &&
	convert_bundle_to_pack <bundle1 >bundle.pack &&
	git index-pack bundle.pack &&
	test_bundle_object_count bundle.pack 3

ok 175 - fetch-pack --diag-url git+ssh://user@host/~re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5512-ls-remote/.git/
warning: Not updating non-default fetch refspec
	+refs/heads/*:refs/heads/origin/*
	Please update the configuration manually if necessary.
expecting success: 
	>file &&
	git add file &&
	test_tick &&
	git commit -m initial &&
	git tag mark &&
	git show-ref --tags -d | sed -e "s/ /	/" >expected.tag &&
	(
		echo "$(git rev-parse HEAD)	HEAD"
		git show-ref -d	| sed -e "s/ /	/"
	) >expected.all &&

	git remote add self "$(pwd)/.git"

6329a3ca5268a0b28a1dc29b602e8b72a0bc1b37
ok 42 - rename does not update a non-default fetch refspec

ok 176 - fetch-pack --diag-url git+ssh://user@host:/re:po

expecting success: 
	git clone one four.two &&
	(
		cd four.two &&
		git remote rename origin remote &&
		git remote rename remote upstream &&
		test "$(git config remote.upstream.fetch)" = "+refs/heads/*:refs/remotes/upstream/*"
	)

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
Cloning into 'four.two'...
[master (root-commit) 1bd44cb] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file
ok 177 - fetch-pack --diag-url git+ssh://user@host:/~re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
done.
b98c8383bb6e0b936b95e70fd37b5c5b6a9137d5
ok 178 - fetch-pack --diag-url git+ssh://user@[::1]/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
ok 21 - bundle 1 has only 3 files 

expecting success: 
	cd "$D/bundle" &&
	git fetch ../bundle2 master:master &&
	test "tip" = "$(git log -1 --pretty=oneline master | cut -b42-)"

ok 1 - setup

expecting success: 
	git ls-remote --tags .git >actual &&
	test_cmp expected.tag actual

ok 179 - fetch-pack --diag-url git+ssh://user@[::1]/~re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 2 - ls-remote --tags .git

expecting success: 
	git ls-remote .git >actual &&
	test_cmp expected.all actual

ok 180 - fetch-pack --diag-url git+ssh://user@[::1]:/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
ok 3 - ls-remote .git

expecting success: 
	git ls-remote --tags self >actual &&
	test_cmp expected.tag actual

ok 43 - rename a remote with name part of fetch spec

expecting success: 
	git clone one four.three &&
	(
		cd four.three &&
		git remote add o git://example.com/repo.git &&
		git remote rename o upstream &&
		test "$(git rev-parse origin/master)" = "$(git rev-parse master)"
	)

Cloning into 'four.three'...
ok 181 - fetch-pack --diag-url git+ssh://user@[::1]:/~re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 4 - ls-remote --tags self

expecting success: 
	git ls-remote self >actual &&
	test_cmp expected.all actual

From ../bundle2
   928eacd..395220a  master     -> master
done.
ok 182 - fetch-pack --diag-url git+ssh://user@::1/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
ok 5 - ls-remote self

expecting success: 
	test_must_fail git ls-remote

ok 22 - unbundle 2

expecting success: 
	cd "$D" &&
fatal: No remote configured to list refs from.
	touch file2 &&
	git add file2 &&
	git commit -m add.file2 file2 &&
	git bundle create bundle3 -1 HEAD &&
	convert_bundle_to_pack <bundle3 >bundle.pack &&
	git index-pack bundle.pack &&
	test_bundle_object_count bundle.pack 3

ok 6 - dies when no remote specified and no default remotes found

expecting success: 
	URL="$(pwd)/.git" &&
	echo "From $URL" >exp_err &&

	git remote add origin "$URL" &&
	git ls-remote 2>actual_err >actual &&

	test_cmp exp_err actual_err &&
	test_cmp expected.all actual

ok 183 - fetch-pack --diag-url git+ssh://user@::1/~re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 7 - use "origin" when no remote specified

expecting success: 
	git ls-remote -q 2>actual_err &&
	test_must_fail test_cmp exp_err actual_err

[master 38d42f1] add.file2
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file2
ok 184 - fetch-pack --diag-url git+ssh://user@::1:/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
ok 44 - rename a remote with name prefix of other remote

expecting success: 
	git clone one five &&
	origin_url=$(pwd)/one &&
	(
		cd five &&
		git remote remove origin &&
		mkdir -p .git/remotes &&
		cat ../remotes_origin >.git/remotes/origin &&
		git remote rename origin origin &&
		test_path_is_missing .git/remotes/origin &&
		test "$(git config remote.origin.url)" = "$origin_url" &&
		cat >push_expected <<-\EOF &&
		refs/heads/master:refs/heads/upstream
		refs/heads/next:refs/heads/upstream2
		EOF
		cat >fetch_expected <<-\EOF &&
		refs/heads/master:refs/heads/origin
		refs/heads/next:refs/heads/origin2
		EOF
		git config --get-all remote.origin.push >push_actual &&
		git config --get-all remote.origin.fetch >fetch_actual &&
		test_cmp push_expected push_actual &&
		test_cmp fetch_expected fetch_actual
	)

1bd44cb9d13204b0fe1958db0082f5028a16eb3a	HEAD
1bd44cb9d13204b0fe1958db0082f5028a16eb3a	refs/heads/master
1bd44cb9d13204b0fe1958db0082f5028a16eb3a	refs/tags/mark
--- exp_err	2015-12-16 10:59:52.745564845 +0000
+++ actual_err	2015-12-16 10:59:52.829564845 +0000
@@ -1 +0,0 @@
-From /«PKGBUILDDIR»/t/trash directory.t5512-ls-remote/.git
ok 8 - suppress "From <url>" with -q

expecting success: 
	#
	# Test that we are indeed using branch.<name>.remote, not "origin", even
	# though the "origin" remote has been set.
	#

	# setup a new remote to differentiate from "origin"
	git clone . other.git &&
	(
		cd other.git &&
		echo "$(git rev-parse HEAD)	HEAD"
		git show-ref	| sed -e "s/ /	/"
	) >exp &&

	URL="other.git" &&
	echo "From $URL" >exp_err &&

	git remote add other $URL &&
	git config branch.master.remote other &&

	git ls-remote 2>actual_err >actual &&
	test_cmp exp_err actual_err &&
	test_cmp exp actual

Cloning into 'five'...
Cloning into 'other.git'...
ok 185 - fetch-pack --diag-url git+ssh://user@::1:/~re:po

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
done.
done.
ok 186 - fetch-pack --diag-url git+ssh://host:22/re:po

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
423b39ae4518d86efcad64041f9a880987bb53bd
ok 187 - fetch-pack --diag-url git+ssh://User@host:22/re:po

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
ok 23 - bundle does not prerequisite objects

expecting success: 

	cd "$D" &&
	git tag -a -m 1.0 v1.0 master &&
	git bundle create bundle4 v1.0


ok 188 - fetch-pack --diag-url git+ssh://User@[::1]:22/re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 9 - use branch.<name>.remote if possible

expecting success: 
	cat >exp <<-\EOF &&
	fatal: 'refs*master' does not appear to be a git repository
	fatal: Could not read from remote repository.

	Please make sure you have the correct access rights
	and the repository exists.
	EOF
	#
	# Do not expect "git ls-remote <pattern>" to work; ls-remote needs
	# <remote> if you want to feed <pattern>, just like you cannot say
	# fetch <branch>.
	# We could just as easily have used "master"; the "*" emphasizes its
	# role as a pattern.
	test_must_fail git ls-remote refs*master >actual 2>&1 &&
	test_cmp exp actual

ok 45 - migrate a remote from named file in $GIT_DIR/remotes

expecting success: 
	git clone one six &&
	origin_url=$(pwd)/one &&
	(
		cd six &&
		git remote rm origin &&
		echo "$origin_url" >.git/branches/origin &&
		git remote rename origin origin &&
		test_path_is_missing .git/branches/origin &&
		test "$(git config remote.origin.url)" = "$origin_url" &&
		test "$(git config remote.origin.fetch)" = "refs/heads/master:refs/heads/origin" &&
		test "$(git config remote.origin.push)" = "HEAD:refs/heads/master"
	)

ok 189 - fetch-pack --diag-url git://host/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
Cloning into 'six'...
ok 10 - confuses pattern as remote when no remote specified

expecting success: 
	{
		git ls-remote --exit-code ./no-such-repository
		status=$?
	} &&
	test $status != 2 && test $status != 0

ok 24 - bundle should be able to create a full history

Skipping rsync tests because rsync was not found
expecting success: 
	git config branch.master.remote yeti &&
	git config branch.master.merge refs/heads/bigfoot &&
	git config remote.blub.url one &&
	git config remote.blub.fetch "refs/heads/*:refs/remotes/one/*" &&
	git fetch blub

ok 190 - fetch-pack --diag-url git://host/~re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
fatal: './no-such-repository' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ok 11 - die with non-2 for wrong repository even with --exit-code

expecting success: 
	git ls-remote other.git "refs/nsn/*" >actual &&
	>expect &&
	test_cmp expect actual

done.
ok 191 - fetch-pack --diag-url git://host:/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
ok 12 - Report success even when nothing matches

expecting success: 
	test_expect_code 2 git ls-remote --exit-code other.git "refs/nsn/*" >actual &&
	>expect &&
	test_cmp expect actual

ok 192 - fetch-pack --diag-url git://host:/~re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 13 - Report no-match with --exit-code

expecting success: 
	git ls-remote --exit-code other.git "refs/tags/*" >actual &&
	git ls-remote . tags/mark >expect &&
	test_cmp expect actual

ok 46 - migrate a remote from named file in $GIT_DIR/branches

expecting success: 
	git clone one seven &&
	(
		cd seven &&
		git remote rm origin &&
		echo "quux#foom" > .git/branches/origin &&
		git remote rename origin origin &&
		test_path_is_missing .git/branches/origin &&
		test "$(git config remote.origin.url)" = "quux" &&
		test "$(git config remote.origin.fetch)" = "refs/heads/foom:refs/heads/origin"
		test "$(git config remote.origin.push)" = "HEAD:refs/heads/foom"
	)

ok 193 - fetch-pack --diag-url git://user@host/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
Cloning into 'seven'...
From one
 * [new branch]      master     -> one/master
ok 194 - fetch-pack --diag-url git://user@host/~re:po

done.
expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 25 - fetch with a non-applying branch.<name>.merge

ok 14 - Report match with --exit-code

expecting success: 
	one_head=$(cd one && git rev-parse HEAD) &&
	this_head=$(git rev-parse HEAD) &&
	git update-ref -d FETCH_HEAD &&
	git fetch one &&
	test $one_head = "$(git rev-parse --verify FETCH_HEAD)" &&
	test $this_head = "$(git rev-parse --verify HEAD)"

expecting success: 
	git tag magic/one &&
	git tag magic/two

ok 15 - set up some extra tags for ref hiding

expecting success: 
		test_config $configsection.hiderefs refs/tags &&
		git ls-remote . >actual &&
		test_unconfig $configsection.hiderefs &&
		git ls-remote . |
		sed -e "/	refs\/tags\//d" >expect &&
		test_cmp expect actual
	
ok 195 - fetch-pack --diag-url git://user@host:/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
ok 196 - fetch-pack --diag-url git://user@host:/~re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 47 - migrate a remote from named file in $GIT_DIR/branches (2)

expecting success: 
	git clone one eight &&
	(
		cd one &&
		git checkout side2 &&
		git branch -D master
	) &&
	(
		cd eight &&
		git remote prune origin
	) >err 2>&1 &&
	test_i18ngrep "has become dangling" err &&

	: And the dangling symref will not cause other annoying errors &&
	(
		cd eight &&
		git branch -a
	) 2>err &&
	! grep "points nowhere" err &&
	(
		cd eight &&
		test_must_fail git branch nomore origin
	) 2>err &&
	grep "dangling symref" err

Cloning into 'eight'...
From one
 * branch            HEAD       -> FETCH_HEAD
ok 197 - fetch-pack --diag-url git://user@[::1]/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
ok 26 - fetch from GIT URL with a non-applying branch.<name>.merge [1]

expecting success: 
	one_ref=$(cd one && git symbolic-ref HEAD) &&
	git config branch.master.remote blub &&
	git config branch.master.merge "$one_ref" &&
	git update-ref -d FETCH_HEAD &&
	git fetch one &&
	test $one_head = "$(git rev-parse --verify FETCH_HEAD)" &&
	test $this_head = "$(git rev-parse --verify HEAD)"

ok 16 - Hide some refs with transfer.hiderefs

expecting success: 
		test_when_finished "test_unconfig $configsection.hiderefs" &&
		git config --add $configsection.hiderefs refs/tags &&
		git config --add $configsection.hiderefs "!refs/tags/magic" &&
		git config --add $configsection.hiderefs refs/tags/magic/one &&
		git ls-remote . >actual &&
		grep refs/tags/magic/two actual &&
		! grep refs/tags/magic/one actual
	
done.
ok 198 - fetch-pack --diag-url git://user@[::1]/~re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
Switched to branch 'side2'
Deleted branch master (was 6329a3c).
ok 199 - fetch-pack --diag-url git://user@[::1]:/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
1bd44cb9d13204b0fe1958db0082f5028a16eb3a	refs/tags/magic/two
 refs/remotes/origin/HEAD has become dangling!
ok 17 - Override hiding of transfer.hiderefs

expecting success: 
		test_config $configsection.hiderefs refs/tags &&
		git ls-remote . >actual &&
		test_unconfig $configsection.hiderefs &&
		git ls-remote . |
		sed -e "/	refs\/tags\//d" >expect &&
		test_cmp expect actual
	
ok 200 - fetch-pack --diag-url git://user@[::1]:/~re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
From one
 * branch            HEAD       -> FETCH_HEAD
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/side2
warning: ignoring dangling symref refs/remotes/origin/HEAD.
ok 48 - remote prune to cause a dangling symref

expecting success: 
	test_create_repo empty &&
	git clone empty empty-clone &&
	(
		cd empty-clone &&
		git remote show origin
	)

ok 27 - fetch from GIT URL with a non-applying branch.<name>.merge [2]

expecting success: 
	git config branch.master.merge "${one_ref}_not" &&
	git update-ref -d FETCH_HEAD &&
	git fetch one &&
	test $one_head = "$(git rev-parse --verify FETCH_HEAD)" &&
	test $this_head = "$(git rev-parse --verify HEAD)"

ok 201 - fetch-pack --diag-url git://user@::1/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5505-remote/empty/.git/
Cloning into 'empty-clone'...
ok 202 - fetch-pack --diag-url git://user@::1/~re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 18 - Hide some refs with uploadpack.hiderefs

expecting success: 
		test_when_finished "test_unconfig $configsection.hiderefs" &&
		git config --add $configsection.hiderefs refs/tags &&
		git config --add $configsection.hiderefs "!refs/tags/magic" &&
		git config --add $configsection.hiderefs refs/tags/magic/one &&
		git ls-remote . >actual &&
		grep refs/tags/magic/two actual &&
		! grep refs/tags/magic/one actual
	
warning: You appear to have cloned an empty repository.
done.
ok 203 - fetch-pack --diag-url git://user@::1:/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
* remote origin
  Fetch URL: /«PKGBUILDDIR»/t/trash directory.t5505-remote/empty
  Push  URL: /«PKGBUILDDIR»/t/trash directory.t5505-remote/empty
  HEAD branch: (unknown)
  Local branch configured for 'git pull':
    master merges with remote master
ok 49 - show empty remote

expecting success: 
	test_must_fail git remote set-branches &&
	test_must_fail git remote set-branches --add

From one
 * branch            HEAD       -> FETCH_HEAD
error: no remote specified
usage: git remote set-branches <name> <branch>...
   or: git remote set-branches --add <name> <branch>...

    --add                 add branch

ok 204 - fetch-pack --diag-url git://user@::1:/~re:po

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
1bd44cb9d13204b0fe1958db0082f5028a16eb3a	refs/tags/magic/two
error: no remote specified
usage: git remote set-branches <name> <branch>...
   or: git remote set-branches --add <name> <branch>...

    --add                 add branch

ok 50 - remote set-branches requires a remote

expecting success: 
	echo "+refs/heads/*:refs/remotes/scratch/*" >expect.initial &&
	sort <<-\EOF >expect.add &&
	+refs/heads/*:refs/remotes/scratch/*
	+refs/heads/other:refs/remotes/scratch/other
	EOF
	sort <<-\EOF >expect.replace &&
	+refs/heads/maint:refs/remotes/scratch/maint
	+refs/heads/master:refs/remotes/scratch/master
	+refs/heads/next:refs/remotes/scratch/next
	EOF
	sort <<-\EOF >expect.add-two &&
	+refs/heads/maint:refs/remotes/scratch/maint
	+refs/heads/master:refs/remotes/scratch/master
	+refs/heads/next:refs/remotes/scratch/next
	+refs/heads/pu:refs/remotes/scratch/pu
	+refs/heads/t/topic:refs/remotes/scratch/t/topic
	EOF
	sort <<-\EOF >expect.setup-ffonly &&
	refs/heads/master:refs/remotes/scratch/master
	+refs/heads/next:refs/remotes/scratch/next
	EOF
	sort <<-\EOF >expect.respect-ffonly &&
	refs/heads/master:refs/remotes/scratch/master
	+refs/heads/next:refs/remotes/scratch/next
	+refs/heads/pu:refs/remotes/scratch/pu
	EOF

	git clone .git/ setbranches &&
	(
		cd setbranches &&
		git remote rename origin scratch &&
		git config --get-all remote.scratch.fetch >config-result &&
		sort <config-result >../actual.initial &&

		git remote set-branches scratch --add other &&
		git config --get-all remote.scratch.fetch >config-result &&
		sort <config-result >../actual.add &&

		git remote set-branches scratch maint master next &&
		git config --get-all remote.scratch.fetch >config-result &&
		sort <config-result >../actual.replace &&

		git remote set-branches --add scratch pu t/topic &&
		git config --get-all remote.scratch.fetch >config-result &&
		sort <config-result >../actual.add-two &&

		git config --unset-all remote.scratch.fetch &&
		git config remote.scratch.fetch \
			refs/heads/master:refs/remotes/scratch/master &&
		git config --add remote.scratch.fetch \
			+refs/heads/next:refs/remotes/scratch/next &&
		git config --get-all remote.scratch.fetch >config-result &&
		sort <config-result >../actual.setup-ffonly &&

		git remote set-branches --add scratch pu &&
		git config --get-all remote.scratch.fetch >config-result &&
		sort <config-result >../actual.respect-ffonly
	) &&
	test_cmp expect.initial actual.initial &&
	test_cmp expect.add actual.add &&
	test_cmp expect.replace actual.replace &&
	test_cmp expect.add-two actual.add-two &&
	test_cmp expect.setup-ffonly actual.setup-ffonly &&
	test_cmp expect.respect-ffonly actual.respect-ffonly

ok 28 - fetch from GIT URL with a non-applying branch.<name>.merge [3]

expecting success: 
	test_must_fail git fetch "a\\!'b" > result 2>&1 &&
	cat result &&
	grep "fatal: 'a\\\\!'b'" result

ok 19 - Override hiding of uploadpack.hiderefs

expecting success: 
	test_config uploadpack.hiderefs refs/tags &&
	test_config transfer.hiderefs "!refs/tags/magic" &&
	git ls-remote . >actual &&
	grep refs/tags/magic actual

ok 205 - fetch-pack --diag-url git://host:22/re:po

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
fatal: 'a\!'b' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: 'a\!'b' does not appear to be a git repository
ok 29 - quoting of a strangely named repo

expecting success: 

	cd "$D" &&
	git bundle create bundle5 HEAD master &&
	git bundle list-heads bundle5 >actual &&
	for h in HEAD refs/heads/master
	do
		echo "$(git rev-parse --verify $h) $h"
	done >expect &&
	test_cmp expect actual


ok 206 - fetch-pack --diag-url git://User@host:22/re:po

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
1bd44cb9d13204b0fe1958db0082f5028a16eb3a	refs/tags/magic/one
1bd44cb9d13204b0fe1958db0082f5028a16eb3a	refs/tags/magic/two
ok 207 - fetch-pack --diag-url git://User@[::1]:22/re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
Cloning into 'setbranches'...
ok 20 - overrides work between mixed transfer/upload-pack hideRefs

# passed all 20 test(s)
1..20
ok 208 - fetch-pack --diag-url ssh://host/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
warning: You appear to have cloned an empty repository.
ok 30 - bundle should record HEAD correctly

expecting success: 
	(
		cd three &&
		git tag base-origin-master refs/remotes/origin/master
	)

done.
ok 31 - mark initial state of origin/master

expecting success: 

	cd "$D" &&
	git branch -f side &&
	(
		cd three &&
		git update-ref refs/remotes/origin/master base-origin-master &&
		o=$(git rev-parse --verify refs/remotes/origin/master) &&
		git fetch origin master &&
		n=$(git rev-parse --verify refs/remotes/origin/master) &&
		test "$o" != "$n" &&
		test_must_fail git rev-parse --verify refs/remotes/origin/side
	)

*** t5513-fetch-track.sh ***
ok 209 - fetch-pack --diag-url ssh://host/~re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 210 - fetch-pack --diag-url ssh://host:/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
ok 211 - fetch-pack --diag-url ssh://host:/~re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5513-fetch-track/.git/
expecting success: 
	>file &&
	git add . &&
	test_tick &&
	git commit -m Initial &&
	git branch b-0 &&
	git branch b1 &&
	git branch b/one &&
	test_create_repo other &&
	(
		cd other &&
		git config remote.origin.url .. &&
		git config remote.origin.fetch "+refs/heads/b/*:refs/remotes/b/*"
	)

ok 212 - fetch-pack --diag-url ssh://user@host/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 * branch            master     -> FETCH_HEAD
   928eacd..38d42f1  master     -> origin/master
ok 213 - fetch-pack --diag-url ssh://user@host/~re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
[master (root-commit) 9d34b14] Initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file
fatal: Needed a single revision
ok 214 - fetch-pack --diag-url ssh://user@host:/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
ok 32 - explicit fetch should update tracking

expecting success: 

	cd "$D" &&
	git branch -f side &&
	(
		cd three &&
		git update-ref refs/remotes/origin/master base-origin-master &&
		o=$(git rev-parse --verify refs/remotes/origin/master) &&
		git pull origin master &&
		n=$(git rev-parse --verify refs/remotes/origin/master) &&
		test "$o" != "$n" &&
		test_must_fail git rev-parse --verify refs/remotes/origin/side
	)

ok 215 - fetch-pack --diag-url ssh://user@host:/~re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 51 - remote set-branches

expecting success: 
	echo "+refs/*:refs/*" >expect.initial &&
	echo "+refs/heads/master:refs/heads/master" >expect.replace &&
	git clone --mirror .git/ setbranches-mirror &&
	(
		cd setbranches-mirror &&
		git remote rename origin scratch &&
		git config --get-all remote.scratch.fetch >../actual.initial &&

		git remote set-branches scratch heads/master &&
		git config --get-all remote.scratch.fetch >../actual.replace
	) &&
	test_cmp expect.initial actual.initial &&
	test_cmp expect.replace actual.replace

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5513-fetch-track/other/.git/
Cloning into bare repository 'setbranches-mirror'...
ok 216 - fetch-pack --diag-url ssh://user@[::1]/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
ok 1 - setup

expecting success: 
	(
		cd other && git fetch origin &&
		test "$(git for-each-ref --format="%(refname)")" = refs/remotes/b/one
	)

warning: You appear to have cloned an empty repository.
done.
ok 217 - fetch-pack --diag-url ssh://user@[::1]/~re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
warning: Not updating non-default fetch refspec
	+refs/*:refs/*
	Please update the configuration manually if necessary.
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 * branch            master     -> FETCH_HEAD
   928eacd..38d42f1  master     -> origin/master
ok 218 - fetch-pack --diag-url ssh://user@[::1]:/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
Updating 928eacd..38d42f1
Fast-forward
ok 52 - remote set-branches with --mirror

expecting success: 
	git remote add someremote foo &&
	echo foo >expect &&
	git config --get-all remote.someremote.url >actual &&
	cmp expect actual

 file  | 2 +-
 file2 | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 create mode 100644 file2
From ..
 * [new branch]      b/one      -> b/one
ok 219 - fetch-pack --diag-url ssh://user@[::1]:/~re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 53 - new remote

expecting success: 
	git remote set-url someremote bar &&
	echo bar >expect &&
	git config --get-all remote.someremote.url >actual &&
	cmp expect actual

fatal: Needed a single revision
ok 33 - explicit pull should update tracking

expecting success: 
	cd "$D" &&
	(
		cd three &&
		test_must_fail git fetch --refmap="*:refs/remotes/none/*"
	)

ok 2 - fetch

# passed all 2 test(s)
1..2
ok 220 - fetch-pack --diag-url ssh://user@::1/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
ok 54 - remote set-url bar

expecting success: 
	git remote set-url someremote baz bar &&
	echo baz >expect &&
	git config --get-all remote.someremote.url >actual &&
	cmp expect actual

fatal: --refmap option is only meaningful with command-line refspec(s).
fatal: The remote end hung up unexpectedly
ok 34 - explicit --refmap is allowed only with command-line refspec

expecting success: 
	cd "$D" &&
	git branch -f side &&
	(
		cd three &&
		git update-ref refs/remotes/origin/master base-origin-master &&
		o=$(git rev-parse --verify refs/remotes/origin/master) &&
		git fetch --refmap="refs/heads/*:refs/remotes/other/*" origin master &&
		n=$(git rev-parse --verify refs/remotes/origin/master) &&
		test "$o" = "$n" &&
		test_must_fail git rev-parse --verify refs/remotes/origin/side &&
		git rev-parse --verify refs/remotes/other/master
	)

ok 221 - fetch-pack --diag-url ssh://user@::1/~re:po
ok 55 - remote set-url baz bar


expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
expecting success: 
	test_must_fail git remote set-url someremote zot bar &&
	echo baz >expect &&
	git config --get-all remote.someremote.url >actual &&
	cmp expect actual

*** t5514-fetch-multiple.sh ***
fatal: No such URL found: bar
ok 222 - fetch-pack --diag-url ssh://user@::1:/re:po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
ok 56 - remote set-url zot bar

expecting success: 
	test_must_fail git remote set-url --push someremote zot baz &&
	echo "YYY" >expect &&
	echo baz >>expect &&
	test_must_fail git config --get-all remote.someremote.pushurl >actual &&
	echo "YYY" >>actual &&
	git config --get-all remote.someremote.url >>actual &&
	cmp expect actual

fatal: No such URL found: baz
ok 223 - fetch-pack --diag-url ssh://user@::1:/~re:po

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 * branch            master     -> FETCH_HEAD
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5514-fetch-multiple/.git/
 * [new branch]      master     -> other/master
ok 57 - remote set-url --push zot baz

expecting success: 
	git remote set-url --push someremote zot &&
	echo zot >expect &&
	echo "YYY" >>expect &&
	echo baz >>expect &&
	git config --get-all remote.someremote.pushurl >actual &&
	echo "YYY" >>actual &&
	git config --get-all remote.someremote.url >>actual &&
	cmp expect actual

expecting success: 
	setup_repository one &&
	setup_repository two &&
	(
		cd two && git branch another
	) &&
	git clone --mirror two three &&
	git clone one test

ok 224 - fetch-pack --diag-url ssh://host:22/re:po

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
ok 58 - remote set-url --push zot

expecting success: 
	git remote set-url --push someremote qux zot &&
	echo qux >expect &&
	echo "YYY" >>expect &&
	echo baz >>expect &&
	git config --get-all remote.someremote.pushurl >actual &&
	echo "YYY" >>actual &&
	git config --get-all remote.someremote.url >>actual &&
	cmp expect actual

fatal: Needed a single revision
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5514-fetch-multiple/one/.git/
ok 225 - fetch-pack --diag-url ssh://User@host:22/re:po

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
ok 35 - explicit --refmap option overrides remote.*.fetch

expecting success: 
	cd "$D" &&
	git branch -f side &&
	(
		cd three &&
		git update-ref refs/remotes/origin/master base-origin-master &&
		o=$(git rev-parse --verify refs/remotes/origin/master) &&
		git fetch --refmap="" origin master &&
		n=$(git rev-parse --verify refs/remotes/origin/master) &&
		test "$o" = "$n" &&
		test_must_fail git rev-parse --verify refs/remotes/origin/side
	)

ok 59 - remote set-url --push qux zot

expecting success: 
	git remote set-url --push someremote foo qu+x &&
	echo foo >expect &&
	echo "YYY" >>expect &&
	echo baz >>expect &&
	git config --get-all remote.someremote.pushurl >actual &&
	echo "YYY" >>actual &&
	git config --get-all remote.someremote.url >>actual &&
	cmp expect actual

ok 226 - fetch-pack --diag-url ssh://User@[::1]:22/re:po

expecting success: 
			check_prot_path $p://$h/$r $p "/$r"
		
[master (root-commit) 9d34b14] Initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file
ok 227 - fetch-pack --diag-url file://User@[::1]/re:po

expecting success: 
			check_prot_path $p://$h/~$r $p "/~$r"
		
Switched to a new branch 'side'
ok 60 - remote set-url --push foo qu+x

expecting success: 
	git remote set-url --push --add someremote aaa &&
	echo foo >expect &&
	echo aaa >>expect &&
	echo "YYY" >>expect &&
	echo baz >>expect &&
	git config --get-all remote.someremote.pushurl >actual &&
	echo "YYY" >>actual &&
	git config --get-all remote.someremote.url >>actual &&
	cmp expect actual

ok 228 - fetch-pack --diag-url file://User@[::1]/~re:po

expecting success: 
			check_prot_path ./$h:$r $p "./$h:$r"
		
[side 2ce9c50] Second
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 elif
ok 229 - fetch-pack --diag-url ./nohost:re:po

expecting success: 
		check_prot_path ./$p:$h/~$r $p "./$p:$h/~$r"
		
ok 61 - remote set-url --push --add aaa

expecting success: 
	git remote set-url --push someremote bar aaa &&
	echo foo >expect &&
	echo bar >>expect &&
	echo "YYY" >>expect &&
	echo baz >>expect &&
	git config --get-all remote.someremote.pushurl >actual &&
	echo "YYY" >>actual &&
	git config --get-all remote.someremote.url >>actual &&
	cmp expect actual

From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 * branch            master     -> FETCH_HEAD
Switched to branch 'master'
ok 230 - fetch-pack --diag-url ./file:nohost/~re:po

expecting success: 
			check_prot_path ./$h:$r $p "./$h:$r"
		
fatal: Needed a single revision
ok 231 - fetch-pack --diag-url ./nohost:12:re:po

expecting success: 
		check_prot_path ./$p:$h/~$r $p "./$p:$h/~$r"
		
ok 36 - explicitly empty --refmap option disables remote.*.fetch

expecting success: 

	cd "$D" &&
	git branch -f side &&
	(
		cd three &&
		git update-ref refs/remotes/origin/master base-origin-master &&
		o=$(git rev-parse --verify refs/remotes/origin/master) &&
		git fetch origin &&
		n=$(git rev-parse --verify refs/remotes/origin/master) &&
		test "$o" != "$n" &&
		git rev-parse --verify refs/remotes/origin/side
	)

ok 62 - remote set-url --push bar aaa

expecting success: 
	git remote set-url --push --delete someremote bar &&
	echo foo >expect &&
	echo "YYY" >>expect &&
	echo baz >>expect &&
	git config --get-all remote.someremote.pushurl >actual &&
	echo "YYY" >>actual &&
	git config --get-all remote.someremote.url >>actual &&
	cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5514-fetch-multiple/two/.git/
ok 232 - fetch-pack --diag-url ./file:nohost:12/~re:po

expecting success: 
			check_prot_path ./$h:$r $p "./$h:$r"
		
ok 233 - fetch-pack --diag-url ./[::1]:re:po

expecting success: 
		check_prot_path ./$p:$h/~$r $p "./$p:$h/~$r"
		
ok 63 - remote set-url --push --delete bar

expecting success: 
	git remote set-url --push --delete someremote foo &&
	echo "YYY" >expect &&
	echo baz >>expect &&
	test_must_fail git config --get-all remote.someremote.pushurl >actual &&
	echo "YYY" >>actual &&
	git config --get-all remote.someremote.url >>actual &&
	cmp expect actual

[master (root-commit) 9d34b14] Initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file
ok 234 - fetch-pack --diag-url ./file:[::1]/~re:po

expecting success: 
			check_prot_path ./$h:$r $p "./$h:$r"
		
Switched to a new branch 'side'
ok 235 - fetch-pack --diag-url ./[::1]:23:re:po

expecting success: 
		check_prot_path ./$p:$h/~$r $p "./$p:$h/~$r"
		
ok 64 - remote set-url --push --delete foo

expecting success: 
	git remote set-url --add someremote bbb &&
	echo "YYY" >expect &&
	echo baz >>expect &&
	echo bbb >>expect &&
	test_must_fail git config --get-all remote.someremote.pushurl >actual &&
	echo "YYY" >>actual &&
	git config --get-all remote.someremote.url >>actual &&
	cmp expect actual

ok 236 - fetch-pack --diag-url ./file:[::1]:23/~re:po

expecting success: 
			check_prot_path ./$h:$r $p "./$h:$r"
		
[side 2ce9c50] Second
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 elif
ok 237 - fetch-pack --diag-url ./[:re:po

expecting success: 
		check_prot_path ./$p:$h/~$r $p "./$p:$h/~$r"
		
Switched to branch 'master'
ok 65 - remote set-url --add bbb

expecting success: 
	test_must_fail git remote set-url --delete someremote .\* &&
	echo "YYY" >expect &&
	echo baz >>expect &&
	echo bbb >>expect &&
	test_must_fail git config --get-all remote.someremote.pushurl >actual &&
	echo "YYY" >>actual &&
	git config --get-all remote.someremote.url >>actual &&
	cmp expect actual

From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 * [new branch]      descriptive-branch -> origin/descriptive-branch
   928eacd..38d42f1  master     -> origin/master
 * [new branch]      side       -> origin/side
 * [new tag]         anno       -> anno
fatal: Will not delete all non-push URLs
 * [new tag]         descriptive-tag -> descriptive-tag
 * [new tag]         light      -> light
 * [new tag]         v1.0       -> v1.0
ok 238 - fetch-pack --diag-url ./file:[/~re:po

expecting success: 
			check_prot_path ./$h:$r $p "./$h:$r"
		
Cloning into bare repository 'three'...
ok 239 - fetch-pack --diag-url ./[:aa:re:po

expecting success: 
		check_prot_path ./$p:$h/~$r $p "./$p:$h/~$r"
		
ok 66 - remote set-url --delete .*

expecting success: 
	git remote set-url --delete someremote bbb &&
	echo "YYY" >expect &&
	echo baz >>expect &&
	test_must_fail git config --get-all remote.someremote.pushurl >actual &&
	echo "YYY" >>actual &&
	git config --get-all remote.someremote.url >>actual &&
	cmp expect actual

38d42f181f21cdea0c77ef4c3987ead3de8a5a52
ok 37 - configured fetch updates tracking

expecting success: 
	cd "$D" &&
	git update-ref refs/odd/location HEAD &&
	(
		cd three &&
		git update-ref refs/remotes/origin/master base-origin-master &&
		git config --add remote.origin.fetch \
			refs/odd/location:refs/remotes/origin/odd &&
		o=$(git rev-parse --verify refs/remotes/origin/master) &&
		git fetch origin master &&
		n=$(git rev-parse --verify refs/remotes/origin/master) &&
		test "$o" != "$n" &&
		test_must_fail git rev-parse --verify refs/remotes/origin/odd
	)

done.
ok 240 - fetch-pack --diag-url ./file:[:aa/~re:po

expecting success: 
			check_prot_host_port_path $h:$r $p "$h" NONE "$r"
		
Cloning into 'test'...
ok 67 - remote set-url --delete bbb

expecting success: 
	test_must_fail git remote set-url --delete someremote baz &&
	echo "YYY" >expect &&
	echo baz >>expect &&
	test_must_fail git config --get-all remote.someremote.pushurl >actual &&
	echo "YYY" >>actual &&
	git config --get-all remote.someremote.url >>actual &&
	cmp expect actual

fatal: Will not delete all non-push URLs
ok 241 - fetch-pack --diag-url host:re:po

expecting success: 
			check_prot_host_port_path $h:/~$r $p "$h" NONE "~$r"
		
ok 68 - remote set-url --delete baz

expecting success: 
	git remote set-url --add someremote ccc &&
	echo "YYY" >expect &&
	echo baz >>expect &&
	echo ccc >>expect &&
	test_must_fail git config --get-all remote.someremote.pushurl >actual &&
	echo "YYY" >>actual &&
	git config --get-all remote.someremote.url >>actual &&
	cmp expect actual

done.
ok 242 - fetch-pack --diag-url host:/~re:po

expecting success: 
			check_prot_host_port_path $h:$r $p "$h" NONE "$r"
		
ok 1 - setup

expecting success: 
	(cd test &&
	 git remote add one ../one &&
	 git remote add two ../two &&
	 git remote add three ../three &&
	 git fetch --all &&
	 git branch -r > output &&
	 test_cmp expect output)

ok 69 - remote set-url --add ccc

expecting success: 
	git remote set-url --delete someremote baz &&
	echo "YYY" >expect &&
	echo ccc >>expect &&
	test_must_fail git config --get-all remote.someremote.pushurl >actual &&
	echo "YYY" >>actual &&
	git config --get-all remote.someremote.url >>actual &&
	cmp expect actual

From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 * branch            master     -> FETCH_HEAD
ok 243 - fetch-pack --diag-url [::1]:re:po

expecting success: 
			check_prot_host_port_path $h:/~$r $p "$h" NONE "~$r"
		
   928eacd..38d42f1  master     -> origin/master
ok 70 - remote set-url --delete baz

expecting success: 
	# add a dummy origin so that this does not trigger failure
	git remote add origin .

ok 244 - fetch-pack --diag-url [::1]:/~re:po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
fatal: Needed a single revision
Fetching origin
ok 38 - non-matching refspecs do not confuse tracking update

expecting success: 

	cd "$D" &&
	test_must_fail git push seven no:no


ok 71 - extra args: setup

expecting success: 
		test_must_fail git remote add nick url bogus_extra_arg 2>actual &&
		grep '^usage:' actual
	
error: src refspec no does not match any.
error: failed to push some refs to 'seven'
usage: git remote add [<options>] <name> <url>
ok 39 - pushing nonexistent branch by mistake should not segv

ok 72 - extra args: add nick url

expecting success: 

	cd "$D" &&
	git clone .git follow &&
	git checkout HEAD^0 &&
	(
		for i in 1 2 3 4 5 6 7
		do
			echo $i >>file &&
			git commit -m $i -a &&
			git tag -a -m $i excess-$i || exit 1
		done
	) &&
	git checkout master &&
	(
		cd follow &&
		git fetch
	)

expecting success: 
		test_must_fail git remote rename origin newname bogus_extra_arg 2>actual &&
		grep '^usage:' actual
	
ok 245 - fetch-pack --diag-url ssh+git://host/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
Cloning into 'follow'...
usage: git remote rename <old> <new>
ok 73 - extra args: rename origin newname

expecting success: 
		test_must_fail git remote remove origin bogus_extra_arg 2>actual &&
		grep '^usage:' actual
	
usage: git remote remove <name>
ok 74 - extra args: remove origin

expecting success: 
		test_must_fail git remote set-head origin master bogus_extra_arg 2>actual &&
		grep '^usage:' actual
	
ok 246 - fetch-pack --diag-url ssh+git://host/~re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
Fetching one
usage: git remote set-head <name> (-a | --auto | -d | --delete | <branch>)
ok 75 - extra args: set-head origin master

expecting success: 
		test_must_fail git remote set-url origin newurl oldurl bogus_extra_arg 2>actual &&
		grep '^usage:' actual
	
done.
usage: git remote set-url [--push] <name> <newurl> [<oldurl>]
ok 76 - extra args: set-url origin newurl oldurl

expecting success: 
	git config url.xyz@example.com.insteadOf backup &&
	git remote add backup xyz@example.com

ok 247 - fetch-pack --diag-url ssh+git://host:/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
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 38d42f1... add.file2
From ../one
 * [new branch]      master     -> one/master
 * [new branch]      side       -> one/side
ok 77 - add remote matching the "insteadOf" URL

# passed all 77 test(s)
1..77
Fetching two
ok 248 - fetch-pack --diag-url ssh+git://host:/~re/po
[detached HEAD 59b44cc] 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
[detached HEAD e2e55a5] 2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 249 - fetch-pack --diag-url ssh+git://user@host/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
From ../two
 * [new branch]      another    -> two/another
 * [new branch]      master     -> two/master
 * [new branch]      side       -> two/side
Fetching three
ok 250 - fetch-pack --diag-url ssh+git://user@host/~re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
[detached HEAD fe76b61] 3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 251 - fetch-pack --diag-url ssh+git://user@host:/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
[detached HEAD ce2f79c] 4
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
From ../three
 * [new branch]      another    -> three/another
 * [new branch]      master     -> three/master
 * [new branch]      side       -> three/side
ok 252 - fetch-pack --diag-url ssh+git://user@host:/~re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 2 - git fetch --all

expecting success: 
	(git clone one test2 &&
	 cd test2 &&
	 git remote add bad ../non-existing &&
	 git remote add one ../one &&
	 git remote add two ../two &&
	 git remote add three ../three &&
	 test_must_fail git fetch --all &&
	 git branch -r > output &&
	 test_cmp ../test/expect output)

[detached HEAD 2245e7b] 5
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 253 - fetch-pack --diag-url ssh+git://user@[::1]/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
Cloning into 'test2'...
done.
[detached HEAD e48eb46] 6
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 254 - fetch-pack --diag-url ssh+git://user@[::1]/~re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 255 - fetch-pack --diag-url ssh+git://user@[::1]:/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
[detached HEAD 382d9b2] 7
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 256 - fetch-pack --diag-url ssh+git://user@[::1]:/~re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
Previous HEAD position was 382d9b2... 7
Switched to branch 'master'
Fetching origin
Your branch is based on 'one/master_not', but the upstream is gone.
  (use "git branch --unset-upstream" to fixup)
ok 257 - fetch-pack --diag-url ssh+git://user@::1/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
ok 258 - fetch-pack --diag-url ssh+git://user@::1/~re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
Fetching bad
ok 40 - auto tag following fetches minimum

expecting success: 

	test_must_fail git fetch . side:master


ok 259 - fetch-pack --diag-url ssh+git://user@::1:/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
fatal: '../non-existing' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
error: Could not fetch bad
Fetching one
*** t5515-fetch-merge-logic.sh ***
fatal: Refusing to fetch into current branch refs/heads/master of non-bare repository
ok 41 - refuse to fetch into the current branch

expecting success: 

	git fetch --update-head-ok . side:master


ok 260 - fetch-pack --diag-url ssh+git://user@::1:/~re/po

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
fatal: The remote end hung up unexpectedly
From ../one
 * [new branch]      master     -> one/master
 * [new branch]      side       -> one/side
ok 261 - fetch-pack --diag-url ssh+git://host:22/re/po

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
Fetching two
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5515-fetch-merge-logic/.git/
ok 262 - fetch-pack --diag-url ssh+git://User@host:22/re/po

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
expecting success: 
	GIT_AUTHOR_DATE="2006-06-26 00:00:00 +0000" &&
	GIT_COMMITTER_DATE="2006-06-26 00:00:00 +0000" &&
	export GIT_AUTHOR_DATE GIT_COMMITTER_DATE &&

	echo >file original &&
	git add file &&
	git commit -a -m One &&
	git tag tag-one &&
	git tag tag-one-tree HEAD^{tree} &&
	git branch one &&

	echo two >> file &&
	git commit -a -m Two &&
	git tag -a -m "Tag Two" tag-two &&
	git branch two &&

	echo three >> file &&
	git commit -a -m Three &&
	git tag -a -m "Tag Three" tag-three &&
	git tag -a -m "Tag Three file" tag-three-file HEAD^{tree}:file &&
	git branch three &&

	echo master >> file &&
	git commit -a -m Master &&
	git tag -a -m "Tag Master" tag-master &&

	git checkout three &&

	git clone . cloned &&
	cd cloned &&
	git config remote.origin.url ../.git/ &&

	git config remote.config-explicit.url ../.git/ &&
	git config remote.config-explicit.fetch refs/heads/master:remotes/rem/master &&
	git config --add remote.config-explicit.fetch refs/heads/one:remotes/rem/one &&
	git config --add remote.config-explicit.fetch two:remotes/rem/two &&
	git config --add remote.config-explicit.fetch refs/heads/three:remotes/rem/three &&
	remotes="config-explicit" &&

	git config remote.config-glob.url ../.git/ &&
	git config remote.config-glob.fetch refs/heads/*:refs/remotes/rem/* &&
	remotes="$remotes config-glob" &&

	mkdir -p .git/remotes &&
	{
		echo "URL: ../.git/"
		echo "Pull: refs/heads/master:remotes/rem/master"
		echo "Pull: refs/heads/one:remotes/rem/one"
		echo "Pull: two:remotes/rem/two"
		echo "Pull: refs/heads/three:remotes/rem/three"
	} >.git/remotes/remote-explicit &&
	remotes="$remotes remote-explicit" &&

	{
		echo "URL: ../.git/"
		echo "Pull: refs/heads/*:refs/remotes/rem/*"
	} >.git/remotes/remote-glob &&
	remotes="$remotes remote-glob" &&

	mkdir -p .git/branches &&
	echo "../.git" > .git/branches/branches-default &&
	remotes="$remotes branches-default" &&

	echo "../.git#one" > .git/branches/branches-one &&
	remotes="$remotes branches-one" &&

	for remote in $remotes ; do
		git config branch.br-$remote.remote $remote &&
		git config branch.br-$remote-merge.remote $remote &&
		git config branch.br-$remote-merge.merge refs/heads/three &&
		git config branch.br-$remote-octopus.remote $remote &&
		git config branch.br-$remote-octopus.merge refs/heads/one &&
		git config --add branch.br-$remote-octopus.merge two
	done

ok 42 - fetch into the current branch with --update-head-ok

expecting success: 

	rm -f .git/FETCH_HEAD &&
	git fetch --dry-run . &&
	! test -f .git/FETCH_HEAD

ok 263 - fetch-pack --diag-url ssh+git://User@[::1]:22/re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
From ../two
 * [new branch]      another    -> two/another
 * [new branch]      master     -> two/master
 * [new branch]      side       -> two/side
Fetching three
[master (root-commit) 8e32a6d] One
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 264 - fetch-pack --diag-url git+ssh://host/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
ok 265 - fetch-pack --diag-url git+ssh://host/~re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
From .
 * branch            HEAD       -> FETCH_HEAD
From ../three
 * [new branch]      another    -> three/another
 * [new branch]      master     -> three/master
[master 6134ee8] Two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 * [new branch]      side       -> three/side
ok 43 - fetch --dry-run

expecting success: 
	mkdir dups &&
	(
		cd dups &&
		git init &&
		git config branch.master.remote three &&
		git config remote.three.url ../three/.git &&
		git config remote.three.fetch +refs/heads/*:refs/remotes/origin/* &&
		git config --add remote.three.fetch +refs/heads/*:refs/remotes/origin/* &&
		git fetch three
	)

ok 266 - fetch-pack --diag-url git+ssh://host:/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5510-fetch/dups/.git/
ok 3 - git fetch --all should continue if a remote has errors

expecting success: 
	(cd test &&
	 test_must_fail git fetch --all origin &&
	 test_must_fail git fetch --all origin master)

ok 267 - fetch-pack --diag-url git+ssh://host:/~re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
[master 0567da4] Three
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
fatal: fetch --all does not take a repository argument
fatal: fetch --all does not make sense with refspecs
ok 4 - git fetch --all does not allow non-option arguments

expecting success: 
	(git clone one test3 &&
	 cd test3 &&
	 git remote add three ../three &&
	 git fetch --multiple three &&
	 git branch -r > output &&
	 test_cmp ../expect output)

ok 268 - fetch-pack --diag-url git+ssh://user@host/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
Cloning into 'test3'...
ok 269 - fetch-pack --diag-url git+ssh://user@host/~re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
done.
[master 754b754] Master
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 270 - fetch-pack --diag-url git+ssh://user@host:/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
Switched to branch 'three'
Fetching three
Cloning into 'cloned'...
ok 271 - fetch-pack --diag-url git+ssh://user@host:/~re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
done.
ok 272 - fetch-pack --diag-url git+ssh://user@[::1]/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
From ../three
 * [new branch]      another    -> three/another
 * [new branch]      master     -> three/master
From ../three/
 * [new branch]      side       -> three/side
 * [new branch]      master     -> origin/master
 * [new branch]      one        -> origin/one
 * [new branch]      two        -> origin/two
 * [new tag]         base-origin-master -> base-origin-master
 * [new tag]         v1.0       -> v1.0
ok 273 - fetch-pack --diag-url git+ssh://user@[::1]/~re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 5 - git fetch --multiple (but only one remote)

 * [new tag]         anno       -> anno
expecting success: 
	(git clone one test4 &&
	 cd test4 &&
	 git remote rm origin &&
	 git remote add one ../one &&
	 git remote add two ../two &&
	 git fetch --multiple one two &&
	 git branch -r > output &&
	 test_cmp ../expect output)

 * [new tag]         descriptive-tag -> descriptive-tag
 * [new tag]         light      -> light
ok 274 - fetch-pack --diag-url git+ssh://user@[::1]:/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
ok 44 - should be able to fetch with duplicate refspecs

expecting success: 
		# make sure a newbranch is there in . and also in one
		git branch -f newbranch &&
		(
			cd one &&
			test_unconfig fetch.prune &&
			test_unconfig remote.origin.prune &&
			git fetch &&
			git rev-parse --verify refs/remotes/origin/newbranch
		) &&

		# now remove it
		git branch -d newbranch &&

		# then test
		(
			cd one &&
			set_config_tristate fetch.prune $fetch_prune &&
			set_config_tristate remote.origin.prune $remote_origin_prune &&

			git fetch $cmdline &&
			case "$expected" in
			pruned)
				test_must_fail git rev-parse --verify refs/remotes/origin/newbranch
				;;
			kept)
				git rev-parse --verify refs/remotes/origin/newbranch
				;;
			esac
		)
	
Cloning into 'test4'...
done.
ok 275 - fetch-pack --diag-url git+ssh://user@[::1]:/~re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 276 - fetch-pack --diag-url git+ssh://user@::1/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
Fetching one
ok 277 - fetch-pack --diag-url git+ssh://user@::1/~re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 278 - fetch-pack --diag-url git+ssh://user@::1:/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
From ../one
 * [new branch]      master     -> one/master
 * [new branch]      side       -> one/side
Fetching two
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
   928eacd..38d42f1  master     -> origin/master
 * [new branch]      descriptive-branch -> origin/descriptive-branch
ok 279 - fetch-pack --diag-url git+ssh://user@::1:/~re/po

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
 * [new branch]      newbranch  -> origin/newbranch
 * [new branch]      side       -> origin/side
 * [new tag]         v1.0       -> v1.0
ok 280 - fetch-pack --diag-url git+ssh://host:22/re/po

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
From ../two
 * [new branch]      another    -> two/another
 * [new branch]      master     -> two/master
 * [new branch]      side       -> two/side
 * [new tag]         anno       -> anno
 * [new tag]         descriptive-tag -> descriptive-tag
 * [new tag]         light      -> light
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
ok 281 - fetch-pack --diag-url git+ssh://User@host:22/re/po

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
ok 6 - git fetch --multiple (two remotes)

expecting success: 
	(cd test4 &&
	 test_must_fail git fetch --multiple four)

Deleted branch newbranch (was 38d42f1).
fatal: No such remote or remote group: four
ok 7 - git fetch --multiple (bad remote names)

expecting success: 
	(cd test4 &&
	 for b in $(git branch -r)
	 do
		git branch -r -d $b || exit 1
	 done &&
	 git remote add three ../three &&
	 git config remote.three.skipFetchAll true &&
	 git fetch --all &&
	 git branch -r > output &&
	 test_cmp ../expect output)

ok 282 - fetch-pack --diag-url git+ssh://User@[::1]:22/re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
Deleted remote-tracking branch one/master (was 9d34b14).
ok 283 - fetch-pack --diag-url git://host/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
Deleted remote-tracking branch one/side (was 2ce9c50).
Deleted remote-tracking branch two/another (was 9d34b14).
ok 284 - fetch-pack --diag-url git://host/~re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
Deleted remote-tracking branch two/master (was 9d34b14).
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
ok 45 - prune fetch.prune=unset remote.origin.prune=unset; kept

expecting success: 
		# make sure a newbranch is there in . and also in one
		git branch -f newbranch &&
		(
			cd one &&
			test_unconfig fetch.prune &&
			test_unconfig remote.origin.prune &&
			git fetch &&
			git rev-parse --verify refs/remotes/origin/newbranch
		) &&

		# now remove it
		git branch -d newbranch &&

		# then test
		(
			cd one &&
			set_config_tristate fetch.prune $fetch_prune &&
			set_config_tristate remote.origin.prune $remote_origin_prune &&

			git fetch $cmdline &&
			case "$expected" in
			pruned)
				test_must_fail git rev-parse --verify refs/remotes/origin/newbranch
				;;
			kept)
				git rev-parse --verify refs/remotes/origin/newbranch
				;;
			esac
		)
	
Deleted remote-tracking branch two/side (was 2ce9c50).
ok 285 - fetch-pack --diag-url git://host:/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
Fetching one
ok 286 - fetch-pack --diag-url git://host:/~re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 287 - fetch-pack --diag-url git://user@host/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
From ../one
 * [new branch]      master     -> one/master
 * [new branch]      side       -> one/side
Fetching two
ok 288 - fetch-pack --diag-url git://user@host/~re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
ok 1 - setup

Deleted branch newbranch (was 38d42f1).
ok 289 - fetch-pack --diag-url git://user@host:/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
From ../two
 * [new branch]      another    -> two/another
 * [new branch]      master     -> two/master
 * [new branch]      side       -> two/side
ok 290 - fetch-pack --diag-url git://user@host:/~re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 8 - git fetch --all (skipFetchAll)

expecting success: 
	(cd test4 &&
	 for b in $(git branch -r)
	 do
		git branch -r -d $b || exit 1
	 done &&
	 git fetch --multiple one two three &&
	 git branch -r > output &&
	 test_cmp ../expect output)

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
ok 291 - fetch-pack --diag-url git://user@[::1]/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
Deleted remote-tracking branch one/master (was 9d34b14).
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
ok 46 - prune fetch.prune=unset remote.origin.prune=unset --no-prune; kept

Deleted remote-tracking branch one/side (was 2ce9c50).
expecting success: 
		# make sure a newbranch is there in . and also in one
		git branch -f newbranch &&
		(
			cd one &&
			test_unconfig fetch.prune &&
			test_unconfig remote.origin.prune &&
			git fetch &&
			git rev-parse --verify refs/remotes/origin/newbranch
		) &&

		# now remove it
		git branch -d newbranch &&

		# then test
		(
			cd one &&
			set_config_tristate fetch.prune $fetch_prune &&
			set_config_tristate remote.origin.prune $remote_origin_prune &&

			git fetch $cmdline &&
			case "$expected" in
			pruned)
				test_must_fail git rev-parse --verify refs/remotes/origin/newbranch
				;;
			kept)
				git rev-parse --verify refs/remotes/origin/newbranch
				;;
			esac
		)
	
ok 292 - fetch-pack --diag-url git://user@[::1]/~re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
Deleted remote-tracking branch two/another (was 9d34b14).
Deleted remote-tracking branch two/master (was 9d34b14).
ok 293 - fetch-pack --diag-url git://user@[::1]:/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
Deleted remote-tracking branch two/side (was 2ce9c50).
Fetching one
ok 294 - fetch-pack --diag-url git://user@[::1]:/~re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 295 - fetch-pack --diag-url git://user@::1/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
From ../one
 * [new branch]      master     -> one/master
 * [new branch]      side       -> one/side
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
Fetching two
Deleted branch newbranch (was 38d42f1).
ok 296 - fetch-pack --diag-url git://user@::1/~re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
From ../
 * [new branch]      master     -> rem/master
 * [new branch]      one        -> rem/one
 * [new branch]      two        -> rem/two
 * [new branch]      three      -> rem/three
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
ok 297 - fetch-pack --diag-url git://user@::1:/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
From ../two
 * [new branch]      another    -> two/another
 * [new tag]         tag-two    -> tag-two
 * [new branch]      master     -> two/master
 * [new branch]      side       -> two/side
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 x [deleted]         (none)     -> origin/newbranch
Fetching three
ok 298 - fetch-pack --diag-url git://user@::1:/~re/po

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
ok 2 - br-config-explicit

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
fatal: Needed a single revision
ok 47 - prune fetch.prune=unset remote.origin.prune=unset --prune; pruned

expecting success: 
		# make sure a newbranch is there in . and also in one
		git branch -f newbranch &&
		(
			cd one &&
			test_unconfig fetch.prune &&
			test_unconfig remote.origin.prune &&
			git fetch &&
			git rev-parse --verify refs/remotes/origin/newbranch
		) &&

		# now remove it
		git branch -d newbranch &&

		# then test
		(
			cd one &&
			set_config_tristate fetch.prune $fetch_prune &&
			set_config_tristate remote.origin.prune $remote_origin_prune &&

			git fetch $cmdline &&
			case "$expected" in
			pruned)
				test_must_fail git rev-parse --verify refs/remotes/origin/newbranch
				;;
			kept)
				git rev-parse --verify refs/remotes/origin/newbranch
				;;
			esac
		)
	
From ../three
 * [new branch]      another    -> three/another
 * [new branch]      master     -> three/master
 * [new branch]      side       -> three/side
ok 299 - fetch-pack --diag-url git://host:22/re/po

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
ok 300 - fetch-pack --diag-url git://User@host:22/re/po

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
ok 9 - git fetch --multiple (ignoring skipFetchAll)

expecting success: 
	>expect &&
	git clone one test5 &&
	git clone test5 test6 &&
	(cd test5 && git tag test-tag) &&
	(
		cd test6 &&
		git fetch --all --no-tags &&
		git tag >output
	) &&
	test_cmp expect test6/output

Cloning into 'test5'...
ok 301 - fetch-pack --diag-url git://User@[::1]:22/re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
done.
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 * [new branch]      newbranch  -> origin/newbranch
ok 302 - fetch-pack --diag-url ssh://host/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
Cloning into 'test6'...
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
ok 303 - fetch-pack --diag-url ssh://host/~re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
Deleted branch newbranch (was 38d42f1).
done.
ok 304 - fetch-pack --diag-url ssh://host:/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
ok 305 - fetch-pack --diag-url ssh://host:/~re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
Fetching origin
From ../
 * [new branch]      master     -> rem/master
 * [new branch]      one        -> rem/one
 * [new branch]      two        -> rem/two
 * [new branch]      three      -> rem/three
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
ok 306 - fetch-pack --diag-url ssh://user@host/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
 * [new tag]         tag-two    -> tag-two
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
ok 48 - prune fetch.prune=false remote.origin.prune=unset; kept

expecting success: 
		# make sure a newbranch is there in . and also in one
		git branch -f newbranch &&
		(
			cd one &&
			test_unconfig fetch.prune &&
			test_unconfig remote.origin.prune &&
			git fetch &&
			git rev-parse --verify refs/remotes/origin/newbranch
		) &&

		# now remove it
		git branch -d newbranch &&

		# then test
		(
			cd one &&
			set_config_tristate fetch.prune $fetch_prune &&
			set_config_tristate remote.origin.prune $remote_origin_prune &&

			git fetch $cmdline &&
			case "$expected" in
			pruned)
				test_must_fail git rev-parse --verify refs/remotes/origin/newbranch
				;;
			kept)
				git rev-parse --verify refs/remotes/origin/newbranch
				;;
			esac
		)
	
ok 307 - fetch-pack --diag-url ssh://user@host/~re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
ok 10 - git fetch --all --no-tags

expecting success: 
	echo test-tag >expect &&
	git clone one test7 &&
	git clone test7 test8 &&
	(
		cd test7 &&
		test_commit test-tag &&
		git reset --hard HEAD^
	) &&
	(
		cd test8 &&
		git fetch --all --tags &&
		git tag >output
	) &&
	test_cmp expect test8/output

ok 3 - br-config-explicit config-explicit

ok 308 - fetch-pack --diag-url ssh://user@host:/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
Cloning into 'test7'...
ok 309 - fetch-pack --diag-url ssh://user@host:/~re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
done.
Cloning into 'test8'...
ok 310 - fetch-pack --diag-url ssh://user@[::1]/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
done.
ok 311 - fetch-pack --diag-url ssh://user@[::1]/~re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
Deleted branch newbranch (was 38d42f1).
ok 312 - fetch-pack --diag-url ssh://user@[::1]:/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
[master 09d3cd3] test-tag
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 test-tag.t
ok 313 - fetch-pack --diag-url ssh://user@[::1]:/~re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
HEAD is now at 9d34b14 Initial
Fetching origin
ok 314 - fetch-pack --diag-url ssh://user@::1/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
ok 49 - prune fetch.prune=false remote.origin.prune=unset --no-prune; kept

expecting success: 
		# make sure a newbranch is there in . and also in one
		git branch -f newbranch &&
		(
			cd one &&
			test_unconfig fetch.prune &&
			test_unconfig remote.origin.prune &&
			git fetch &&
			git rev-parse --verify refs/remotes/origin/newbranch
		) &&

		# now remove it
		git branch -d newbranch &&

		# then test
		(
			cd one &&
			set_config_tristate fetch.prune $fetch_prune &&
			set_config_tristate remote.origin.prune $remote_origin_prune &&

			git fetch $cmdline &&
			case "$expected" in
			pruned)
				test_must_fail git rev-parse --verify refs/remotes/origin/newbranch
				;;
			kept)
				git rev-parse --verify refs/remotes/origin/newbranch
				;;
			esac
		)
	
From ../
 * [new branch]      three      -> rem/three
ok 315 - fetch-pack --diag-url ssh://user@::1/~re/po

expecting success: 
					check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
				
 * [new branch]      master     -> rem/master
 * [new branch]      one        -> rem/one
 * [new branch]      two        -> rem/two
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
ok 316 - fetch-pack --diag-url ssh://user@::1:/re/po

expecting success: 
					check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
				
From /«PKGBUILDDIR»/t/trash directory.t5514-fetch-multiple/test7
 * [new tag]         test-tag   -> test-tag
ok 4 - br-config-explicit-merge

ok 317 - fetch-pack --diag-url ssh://user@::1:/~re/po

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
ok 11 - git fetch --all --tags

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
# passed all 11 test(s)
1..11
ok 318 - fetch-pack --diag-url ssh://host:22/re/po

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
ok 319 - fetch-pack --diag-url ssh://User@host:22/re/po

expecting success: 
				check_prot_host_port_path $p://$h:22/$r $p "$h" 22 "/$r"
			
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
Deleted branch newbranch (was 38d42f1).
ok 320 - fetch-pack --diag-url ssh://User@[::1]:22/re/po

expecting success: 
			check_prot_path $p://$h/$r $p "/$r"
		
ok 321 - fetch-pack --diag-url file://User@[::1]/re/po

expecting success: 
			check_prot_path $p://$h/~$r $p "/~$r"
		
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 x [deleted]         (none)     -> origin/newbranch
ok 322 - fetch-pack --diag-url file://User@[::1]/~re/po

expecting success: 
			check_prot_path ./$h:$r $p "./$h:$r"
		
ok 323 - fetch-pack --diag-url ./nohost:re/po

expecting success: 
		check_prot_path ./$p:$h/~$r $p "./$p:$h/~$r"
		
fatal: Needed a single revision
ok 50 - prune fetch.prune=false remote.origin.prune=unset --prune; pruned

expecting success: 
		# make sure a newbranch is there in . and also in one
		git branch -f newbranch &&
		(
			cd one &&
			test_unconfig fetch.prune &&
			test_unconfig remote.origin.prune &&
			git fetch &&
			git rev-parse --verify refs/remotes/origin/newbranch
		) &&

		# now remove it
		git branch -d newbranch &&

		# then test
		(
			cd one &&
			set_config_tristate fetch.prune $fetch_prune &&
			set_config_tristate remote.origin.prune $remote_origin_prune &&

			git fetch $cmdline &&
			case "$expected" in
			pruned)
				test_must_fail git rev-parse --verify refs/remotes/origin/newbranch
				;;
			kept)
				git rev-parse --verify refs/remotes/origin/newbranch
				;;
			esac
		)
	
ok 324 - fetch-pack --diag-url ./file:nohost/~re/po

expecting success: 
			check_prot_path ./$h:$r $p "./$h:$r"
		
ok 325 - fetch-pack --diag-url ./nohost:12:re/po

expecting success: 
		check_prot_path ./$p:$h/~$r $p "./$p:$h/~$r"
		
From ../
 * [new branch]      three      -> rem/three
ok 326 - fetch-pack --diag-url ./file:nohost:12/~re/po

expecting success: 
			check_prot_path ./$h:$r $p "./$h:$r"
		
 * [new branch]      master     -> rem/master
 * [new branch]      one        -> rem/one
 * [new branch]      two        -> rem/two
 * [new tag]         tag-master -> tag-master
*** t5516-fetch-push.sh ***
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
ok 327 - fetch-pack --diag-url ./[::1]:re/po

expecting success: 
		check_prot_path ./$p:$h/~$r $p "./$p:$h/~$r"
		
ok 328 - fetch-pack --diag-url ./file:[::1]/~re/po

expecting success: 
			check_prot_path ./$h:$r $p "./$h:$r"
		
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 * [new branch]      newbranch  -> origin/newbranch
ok 329 - fetch-pack --diag-url ./[::1]:23:re/po

expecting success: 
		check_prot_path ./$p:$h/~$r $p "./$p:$h/~$r"
		
ok 5 - br-config-explicit-merge config-explicit

38d42f181f21cdea0c77ef4c3987ead3de8a5a52
expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/.git/
ok 330 - fetch-pack --diag-url ./file:[::1]:23/~re/po

expecting success: 
			check_prot_path ./$h:$r $p "./$h:$r"
		
Deleted branch newbranch (was 38d42f1).
expecting success: 

	>path1 &&
	git add path1 &&
	test_tick &&
	git commit -a -m repo &&
	the_first_commit=$(git show-ref -s --verify refs/heads/master) &&

	>path2 &&
	git add path2 &&
	test_tick &&
	git commit -a -m second &&
	the_commit=$(git show-ref -s --verify refs/heads/master)


ok 331 - fetch-pack --diag-url ./[:re/po

expecting success: 
		check_prot_path ./$p:$h/~$r $p "./$p:$h/~$r"
		
ok 332 - fetch-pack --diag-url ./file:[/~re/po

expecting success: 
			check_prot_path ./$h:$r $p "./$h:$r"
		
[master (root-commit) b9c09d6] repo
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 path1
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 x [deleted]         (none)     -> origin/newbranch
ok 333 - fetch-pack --diag-url ./[:aa:re/po

expecting success: 
		check_prot_path ./$p:$h/~$r $p "./$p:$h/~$r"
		
ok 334 - fetch-pack --diag-url ./file:[:aa/~re/po

expecting success: 
			check_prot_host_port_path $h:$r $p "$h" NONE "$r"
		
[master 9ad36e1] second
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 path2
ok 1 - setup

expecting success: 
	mk_empty testrepo &&
	(
		cd testrepo &&
		git fetch .. refs/heads/master:refs/remotes/origin/master &&

		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
		git for-each-ref refs/remotes/origin >actual &&
		test_cmp expect actual
	)

fatal: Needed a single revision
ok 51 - prune fetch.prune=true remote.origin.prune=unset; pruned

expecting success: 
		# make sure a newbranch is there in . and also in one
		git branch -f newbranch &&
		(
			cd one &&
			test_unconfig fetch.prune &&
			test_unconfig remote.origin.prune &&
			git fetch &&
			git rev-parse --verify refs/remotes/origin/newbranch
		) &&

		# now remove it
		git branch -d newbranch &&

		# then test
		(
			cd one &&
			set_config_tristate fetch.prune $fetch_prune &&
			set_config_tristate remote.origin.prune $remote_origin_prune &&

			git fetch $cmdline &&
			case "$expected" in
			pruned)
				test_must_fail git rev-parse --verify refs/remotes/origin/newbranch
				;;
			kept)
				git rev-parse --verify refs/remotes/origin/newbranch
				;;
			esac
		)
	
ok 335 - fetch-pack --diag-url host:re/po

expecting success: 
			check_prot_host_port_path $h:/~$r $p "$h" NONE "~$r"
		
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
ok 336 - fetch-pack --diag-url host:/~re/po

expecting success: 
			check_prot_host_port_path $h:$r $p "$h" NONE "$r"
		
ok 337 - fetch-pack --diag-url [::1]:re/po

expecting success: 
			check_prot_host_port_path $h:/~$r $p "$h" NONE "~$r"
		
From ../
 * [new branch]      one        -> rem/one
 * [new branch]      two        -> rem/two
 * [new branch]      master     -> rem/master
 * [new branch]      three      -> rem/three
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 * [new branch]      newbranch  -> origin/newbranch
ok 338 - fetch-pack --diag-url [::1]:/~re/po

skipping test: fetch-pack --diag-url file://c:/repo 
	check_prot_path file://c:/repo file c:/repo

ok 339 # skip fetch-pack --diag-url file://c:/repo (missing MINGW)

skipping test: fetch-pack --diag-url c:repo 
	check_prot_path c:repo file c:repo

ok 340 # skip fetch-pack --diag-url c:repo (missing MINGW)

# passed all 340 test(s)
1..340
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
From ..
 * [new branch]      master     -> origin/master
ok 6 - br-config-explicit-octopus

Deleted branch newbranch (was 38d42f1).
expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
ok 2 - fetch without wildcard

expecting success: 
	mk_empty testrepo &&
	(
		cd testrepo &&
		git config remote.up.url .. &&
		git config remote.up.fetch "refs/heads/*:refs/remotes/origin/*" &&
		git fetch up &&

		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
		git for-each-ref refs/remotes/origin >actual &&
		test_cmp expect actual
	)

From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 x [deleted]         (none)     -> origin/newbranch
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
fatal: Needed a single revision
ok 52 - prune fetch.prune=true remote.origin.prune=unset --prune; pruned

expecting success: 
		# make sure a newbranch is there in . and also in one
		git branch -f newbranch &&
		(
			cd one &&
			test_unconfig fetch.prune &&
			test_unconfig remote.origin.prune &&
			git fetch &&
			git rev-parse --verify refs/remotes/origin/newbranch
		) &&

		# now remove it
		git branch -d newbranch &&

		# then test
		(
			cd one &&
			set_config_tristate fetch.prune $fetch_prune &&
			set_config_tristate remote.origin.prune $remote_origin_prune &&

			git fetch $cmdline &&
			case "$expected" in
			pruned)
				test_must_fail git rev-parse --verify refs/remotes/origin/newbranch
				;;
			kept)
				git rev-parse --verify refs/remotes/origin/newbranch
				;;
			esac
		)
	
From ..
 * [new branch]      master     -> origin/master
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 * [new branch]      newbranch  -> origin/newbranch
ok 3 - fetch with wildcard

expecting success: 
	mk_empty testrepo &&
	(
		TRASH=$(pwd)/ &&
		cd testrepo &&
		git config "url.$TRASH.insteadOf" trash/ &&
		git config remote.up.url trash/. &&
		git config remote.up.fetch "refs/heads/*:refs/remotes/origin/*" &&
		git fetch up &&

		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
		git for-each-ref refs/remotes/origin >actual &&
		test_cmp expect actual
	)

From ../
 * [new branch]      one        -> rem/one
 * [new branch]      two        -> rem/two
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
 * [new branch]      master     -> rem/master
 * [new branch]      three      -> rem/three
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
Deleted branch newbranch (was 38d42f1).
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
ok 7 - br-config-explicit-octopus config-explicit

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
ok 53 - prune fetch.prune=true remote.origin.prune=unset --no-prune; kept

expecting success: 
		# make sure a newbranch is there in . and also in one
		git branch -f newbranch &&
		(
			cd one &&
			test_unconfig fetch.prune &&
			test_unconfig remote.origin.prune &&
			git fetch &&
			git rev-parse --verify refs/remotes/origin/newbranch
		) &&

		# now remove it
		git branch -d newbranch &&

		# then test
		(
			cd one &&
			set_config_tristate fetch.prune $fetch_prune &&
			set_config_tristate remote.origin.prune $remote_origin_prune &&

			git fetch $cmdline &&
			case "$expected" in
			pruned)
				test_must_fail git rev-parse --verify refs/remotes/origin/newbranch
				;;
			kept)
				git rev-parse --verify refs/remotes/origin/newbranch
				;;
			esac
		)
	
From /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/.
 * [new branch]      master     -> origin/master
ok 4 - fetch with insteadOf

expecting success: 
	mk_empty testrepo &&
	(
		TRASH=$(pwd)/ &&
		cd testrepo &&
		git config "url.trash/.pushInsteadOf" "$TRASH" &&
		git config remote.up.url "$TRASH." &&
		git config remote.up.fetch "refs/heads/*:refs/remotes/origin/*" &&
		git fetch up &&

		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
		git for-each-ref refs/remotes/origin >actual &&
		test_cmp expect actual
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
Deleted branch newbranch (was 38d42f1).
From ../
 * [new branch]      master     -> rem/master
 * [new branch]      one        -> rem/one
 * [new branch]      three      -> rem/three
 * [new branch]      two        -> rem/two
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
*** t5517-push-mirror.sh ***
From /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/.
 * [new branch]      master     -> origin/master
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
ok 54 - prune fetch.prune=unset remote.origin.prune=false; kept

expecting success: 
		# make sure a newbranch is there in . and also in one
		git branch -f newbranch &&
		(
			cd one &&
			test_unconfig fetch.prune &&
			test_unconfig remote.origin.prune &&
			git fetch &&
			git rev-parse --verify refs/remotes/origin/newbranch
		) &&

		# now remove it
		git branch -d newbranch &&

		# then test
		(
			cd one &&
			set_config_tristate fetch.prune $fetch_prune &&
			set_config_tristate remote.origin.prune $remote_origin_prune &&

			git fetch $cmdline &&
			case "$expected" in
			pruned)
				test_must_fail git rev-parse --verify refs/remotes/origin/newbranch
				;;
			kept)
				git rev-parse --verify refs/remotes/origin/newbranch
				;;
			esac
		)
	
ok 8 - br-config-glob

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
ok 5 - fetch with pushInsteadOf (should not rewrite)

expecting success: 
	mk_empty testrepo &&

	git push testrepo refs/heads/master:refs/remotes/origin/master &&
	(
		cd testrepo &&
		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
		git for-each-ref refs/remotes/origin >actual &&
		test_cmp expect actual
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5517-push-mirror/.git/
expecting success: 

	mk_repo_pair &&
	(
		cd master &&
		echo one >foo && git add foo && git commit -m one &&
		git push --mirror up
	) &&
	master_master=$(cd master && git show-ref -s --verify refs/heads/master) &&
	mirror_master=$(cd mirror && git show-ref -s --verify refs/heads/master) &&
	test "$master_master" = "$mirror_master"


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5517-push-mirror/mirror/.git/
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5517-push-mirror/master/.git/
Deleted branch newbranch (was 38d42f1).
[master (root-commit) 8ca4969] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
To testrepo
 * [new branch]      master -> origin/master
ok 6 - push without wildcard

expecting success: 
	mk_empty testrepo &&

	git push testrepo "refs/heads/*:refs/remotes/origin/*" &&
	(
		cd testrepo &&
		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
		git for-each-ref refs/remotes/origin >actual &&
		test_cmp expect actual
	)

38d42f181f21cdea0c77ef4c3987ead3de8a5a52
remote: warning: updating the current branch        
From ../
 * [new branch]      master     -> rem/master
ok 55 - prune fetch.prune=unset remote.origin.prune=false --no-prune; kept

expecting success: 
		# make sure a newbranch is there in . and also in one
		git branch -f newbranch &&
		(
			cd one &&
			test_unconfig fetch.prune &&
			test_unconfig remote.origin.prune &&
			git fetch &&
			git rev-parse --verify refs/remotes/origin/newbranch
		) &&

		# now remove it
		git branch -d newbranch &&

		# then test
		(
			cd one &&
			set_config_tristate fetch.prune $fetch_prune &&
			set_config_tristate remote.origin.prune $remote_origin_prune &&

			git fetch $cmdline &&
			case "$expected" in
			pruned)
				test_must_fail git rev-parse --verify refs/remotes/origin/newbranch
				;;
			kept)
				git rev-parse --verify refs/remotes/origin/newbranch
				;;
			esac
		)
	
 * [new branch]      one        -> rem/one
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
 * [new branch]      three      -> rem/three
 * [new branch]      two        -> rem/two
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
To ../mirror
 * [new branch]      master -> master
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
ok 1 - push mirror creates new branches

expecting success: 

	mk_repo_pair &&
	(
		cd master &&
		echo one >foo && git add foo && git commit -m one &&
		git push --mirror up &&
		echo two >foo && git add foo && git commit -m two &&
		git push --mirror up
	) &&
	master_master=$(cd master && git show-ref -s --verify refs/heads/master) &&
	mirror_master=$(cd mirror && git show-ref -s --verify refs/heads/master) &&
	test "$master_master" = "$mirror_master"


ok 9 - br-config-glob config-glob

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
To testrepo
 * [new branch]      master -> origin/master
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5517-push-mirror/mirror/.git/
ok 7 - push with wildcard

expecting success: 
	mk_empty testrepo &&
	TRASH="$(pwd)/" &&
	test_config "url.$TRASH.insteadOf" trash/ &&
	git push trash/testrepo refs/heads/master:refs/remotes/origin/master &&
	(
		cd testrepo &&
		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
		git for-each-ref refs/remotes/origin >actual &&
		test_cmp expect actual
	)

38d42f181f21cdea0c77ef4c3987ead3de8a5a52
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5517-push-mirror/master/.git/
Deleted branch newbranch (was 38d42f1).
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
[master (root-commit) 9cfee1a] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 x [deleted]         (none)     -> origin/newbranch
remote: warning: updating the current branch        
fatal: Needed a single revision
ok 56 - prune fetch.prune=unset remote.origin.prune=false --prune; pruned

expecting success: 
		# make sure a newbranch is there in . and also in one
		git branch -f newbranch &&
		(
			cd one &&
			test_unconfig fetch.prune &&
			test_unconfig remote.origin.prune &&
			git fetch &&
			git rev-parse --verify refs/remotes/origin/newbranch
		) &&

		# now remove it
		git branch -d newbranch &&

		# then test
		(
			cd one &&
			set_config_tristate fetch.prune $fetch_prune &&
			set_config_tristate remote.origin.prune $remote_origin_prune &&

			git fetch $cmdline &&
			case "$expected" in
			pruned)
				test_must_fail git rev-parse --verify refs/remotes/origin/newbranch
				;;
			kept)
				git rev-parse --verify refs/remotes/origin/newbranch
				;;
			esac
		)
	
To ../mirror
 * [new branch]      master -> master
To /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo
 * [new branch]      master -> origin/master
From ../
 * [new branch]      three      -> rem/three
 * [new branch]      master     -> rem/master
ok 8 - push with insteadOf

expecting success: 
	mk_empty testrepo &&
	TRASH="$(pwd)/" &&
	test_config "url.$TRASH.pushInsteadOf" trash/ &&
	git push trash/testrepo refs/heads/master:refs/remotes/origin/master &&
	(
		cd testrepo &&
		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
		git for-each-ref refs/remotes/origin >actual &&
		test_cmp expect actual
	)

 * [new branch]      one        -> rem/one
[master e307f47] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
 * [new branch]      two        -> rem/two
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
ok 10 - br-config-glob-merge

remote: warning: updating the current branch        
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 * [new branch]      newbranch  -> origin/newbranch
expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
To ../mirror
   9cfee1a..e307f47  master -> master
 * [new branch]      up/master -> up/master
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
ok 2 - push mirror updates existing branches

expecting success: 

	mk_repo_pair &&
	(
		cd master &&
		echo one >foo && git add foo && git commit -m one &&
		git push --mirror up &&
		echo two >foo && git add foo && git commit -m two &&
		git push --mirror up &&
		git reset --hard HEAD^
		git push --mirror up
	) &&
	master_master=$(cd master && git show-ref -s --verify refs/heads/master) &&
	mirror_master=$(cd mirror && git show-ref -s --verify refs/heads/master) &&
	test "$master_master" = "$mirror_master"


Deleted branch newbranch (was 38d42f1).
To /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo
 * [new branch]      master -> origin/master
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5517-push-mirror/mirror/.git/
ok 9 - push with pushInsteadOf

expecting success: 
	mk_empty testrepo &&
	test_config "url.trash2/.pushInsteadOf" testrepo/ &&
	test_config "url.trash3/.pushInsteadOf" trash/wrong &&
	test_config remote.r.url trash/wrong &&
	test_config remote.r.pushurl "testrepo/" &&
	git push r refs/heads/master:refs/remotes/origin/master &&
	(
		cd testrepo &&
		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
		git for-each-ref refs/remotes/origin >actual &&
		test_cmp expect actual
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5517-push-mirror/master/.git/
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
ok 57 - prune fetch.prune=false remote.origin.prune=false; kept

expecting success: 
		# make sure a newbranch is there in . and also in one
		git branch -f newbranch &&
		(
			cd one &&
			test_unconfig fetch.prune &&
			test_unconfig remote.origin.prune &&
			git fetch &&
			git rev-parse --verify refs/remotes/origin/newbranch
		) &&

		# now remove it
		git branch -d newbranch &&

		# then test
		(
			cd one &&
			set_config_tristate fetch.prune $fetch_prune &&
			set_config_tristate remote.origin.prune $remote_origin_prune &&

			git fetch $cmdline &&
			case "$expected" in
			pruned)
				test_must_fail git rev-parse --verify refs/remotes/origin/newbranch
				;;
			kept)
				git rev-parse --verify refs/remotes/origin/newbranch
				;;
			esac
		)
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
[master (root-commit) d06bc92] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
From ../
 * [new branch]      three      -> rem/three
 * [new branch]      master     -> rem/master
 * [new branch]      one        -> rem/one
 * [new branch]      two        -> rem/two
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
remote: warning: updating the current branch        
To ../mirror
 * [new branch]      master -> master
ok 11 - br-config-glob-merge config-glob

38d42f181f21cdea0c77ef4c3987ead3de8a5a52
expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
Deleted branch newbranch (was 38d42f1).
[master 5980dfb] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
To testrepo/
 * [new branch]      master -> origin/master
remote: warning: updating the current branch        
To ../mirror
   d06bc92..5980dfb  master -> master
 * [new branch]      up/master -> up/master
ok 10 - push with pushInsteadOf and explicit pushurl (pushInsteadOf should not rewrite)

expecting success: 

	mk_test testrepo heads/master &&
	git push testrepo : &&
	check_push_result testrepo $the_commit heads/master


38d42f181f21cdea0c77ef4c3987ead3de8a5a52
ok 58 - prune fetch.prune=false remote.origin.prune=false --no-prune; kept

expecting success: 
		# make sure a newbranch is there in . and also in one
		git branch -f newbranch &&
		(
			cd one &&
			test_unconfig fetch.prune &&
			test_unconfig remote.origin.prune &&
			git fetch &&
			git rev-parse --verify refs/remotes/origin/newbranch
		) &&

		# now remove it
		git branch -d newbranch &&

		# then test
		(
			cd one &&
			set_config_tristate fetch.prune $fetch_prune &&
			set_config_tristate remote.origin.prune $remote_origin_prune &&

			git fetch $cmdline &&
			case "$expected" in
			pruned)
				test_must_fail git rev-parse --verify refs/remotes/origin/newbranch
				;;
			kept)
				git rev-parse --verify refs/remotes/origin/newbranch
				;;
			esac
		)
	
HEAD is now at d06bc92 one
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
remote: warning: updating the current branch        
To ../mirror
 + 5980dfb...d06bc92 master -> master (forced update)
   d06bc92..5980dfb  up/master -> up/master
ok 3 - push mirror force updates existing branches

expecting success: 

	mk_repo_pair &&
	(
		cd master &&
		echo one >foo && git add foo && git commit -m one &&
		git branch remove master &&
		git push --mirror up &&
		git branch -D remove
		git push --mirror up
	) &&
	(
		cd mirror &&
		invert git show-ref -s --verify refs/heads/remove
	)


remote: warning: updating the current branch        
From ../
 * [new branch]      one        -> rem/one
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
 * [new branch]      two        -> rem/two
 * [new branch]      master     -> rem/master
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
 * [new branch]      three      -> rem/three
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
Deleted branch newbranch (was 38d42f1).
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5517-push-mirror/mirror/.git/
ok 12 - br-config-glob-octopus

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 x [deleted]         (none)     -> origin/newbranch
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5517-push-mirror/master/.git/
remote: warning: updating the current branch        
To testrepo
   b9c09d6..9ad36e1  master -> master
fatal: Needed a single revision
ok 59 - prune fetch.prune=false remote.origin.prune=false --prune; pruned

expecting success: 
		# make sure a newbranch is there in . and also in one
		git branch -f newbranch &&
		(
			cd one &&
			test_unconfig fetch.prune &&
			test_unconfig remote.origin.prune &&
			git fetch &&
			git rev-parse --verify refs/remotes/origin/newbranch
		) &&

		# now remove it
		git branch -d newbranch &&

		# then test
		(
			cd one &&
			set_config_tristate fetch.prune $fetch_prune &&
			set_config_tristate remote.origin.prune $remote_origin_prune &&

			git fetch $cmdline &&
			case "$expected" in
			pruned)
				test_must_fail git rev-parse --verify refs/remotes/origin/newbranch
				;;
			kept)
				git rev-parse --verify refs/remotes/origin/newbranch
				;;
			esac
		)
	
[master (root-commit) d06bc92] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
ok 11 - push with matching heads

expecting success: 

	mk_test testrepo heads/master &&
	git push testrepo : &&
	check_push_result testrepo $the_commit heads/master


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
remote: warning: updating the current branch        
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 * [new branch]      newbranch  -> origin/newbranch
To ../mirror
 * [new branch]      master -> master
 * [new branch]      remove -> remove
Deleted branch remove (was d06bc92).
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
From ../
remote: warning: updating the current branch        
 * [new branch]      one        -> rem/one
 * [new branch]      two        -> rem/two
 * [new branch]      master     -> rem/master
 * [new branch]      three      -> rem/three
 * [new tag]         tag-master -> tag-master
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
Deleted branch newbranch (was 38d42f1).
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
To ../mirror
 - [deleted]         remove
 * [new branch]      up/master -> up/master
 * [new branch]      up/remove -> up/remove
ok 13 - br-config-glob-octopus config-glob

fatal: 'refs/heads/remove' - not a valid ref
ok 4 - push mirror removes branches

expecting success: 

	mk_repo_pair &&
	(
		cd master &&
		echo one >foo && git add foo && git commit -m one &&
		git branch remove master &&
		git push --mirror up &&
		git branch -D remove &&
		git branch add master &&
		echo two >foo && git add foo && git commit -m two &&
		git push --mirror up
	) &&
	master_master=$(cd master && git show-ref -s --verify refs/heads/master) &&
	master_add=$(cd master && git show-ref -s --verify refs/heads/add) &&
	mirror_master=$(cd mirror && git show-ref -s --verify refs/heads/master) &&
	mirror_add=$(cd mirror && git show-ref -s --verify refs/heads/add) &&
	test "$master_master" = "$mirror_master" &&
	test "$master_add" = "$mirror_add" &&
	(
		cd mirror &&
		invert git show-ref -s --verify refs/heads/remove
	)


expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
remote: warning: updating the current branch        
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
To testrepo
   b9c09d6..9ad36e1  master -> master
ok 60 - prune fetch.prune=true remote.origin.prune=false; kept

expecting success: 
		# make sure a newbranch is there in . and also in one
		git branch -f newbranch &&
		(
			cd one &&
			test_unconfig fetch.prune &&
			test_unconfig remote.origin.prune &&
			git fetch &&
			git rev-parse --verify refs/remotes/origin/newbranch
		) &&

		# now remove it
		git branch -d newbranch &&

		# then test
		(
			cd one &&
			set_config_tristate fetch.prune $fetch_prune &&
			set_config_tristate remote.origin.prune $remote_origin_prune &&

			git fetch $cmdline &&
			case "$expected" in
			pruned)
				test_must_fail git rev-parse --verify refs/remotes/origin/newbranch
				;;
			kept)
				git rev-parse --verify refs/remotes/origin/newbranch
				;;
			esac
		)
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5517-push-mirror/mirror/.git/
ok 12 - push with matching heads on the command line

expecting success: 

	mk_test testrepo heads/master &&
	git push testrepo : &&
	git commit --amend -massaged &&
	test_must_fail git push testrepo &&
	check_push_result testrepo $the_commit heads/master &&
	git reset --hard $the_commit


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5517-push-mirror/master/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
Deleted branch newbranch (was 38d42f1).
[master (root-commit) 507bc17] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 x [deleted]         (none)     -> origin/newbranch
remote: warning: updating the current branch        
From ../
 * [new branch]      master     -> rem/master
 * [new branch]      one        -> rem/one
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
 * [new branch]      two        -> rem/two
 * [new branch]      three      -> rem/three
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
remote: warning: updating the current branch        
fatal: Needed a single revision
ok 61 - prune fetch.prune=true remote.origin.prune=false --prune; pruned

expecting success: 
		# make sure a newbranch is there in . and also in one
		git branch -f newbranch &&
		(
			cd one &&
			test_unconfig fetch.prune &&
			test_unconfig remote.origin.prune &&
			git fetch &&
			git rev-parse --verify refs/remotes/origin/newbranch
		) &&

		# now remove it
		git branch -d newbranch &&

		# then test
		(
			cd one &&
			set_config_tristate fetch.prune $fetch_prune &&
			set_config_tristate remote.origin.prune $remote_origin_prune &&

			git fetch $cmdline &&
			case "$expected" in
			pruned)
				test_must_fail git rev-parse --verify refs/remotes/origin/newbranch
				;;
			kept)
				git rev-parse --verify refs/remotes/origin/newbranch
				;;
			esac
		)
	
To ../mirror
 * [new branch]      master -> master
 * [new branch]      remove -> remove
ok 14 - br-remote-explicit

Deleted branch remove (was 507bc17).
expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
remote: warning: updating the current branch        
To testrepo
   b9c09d6..9ad36e1  master -> master
[master 29d07cc] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master ead0604] assaged
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 path2
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream testrepo master

From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 * [new branch]      newbranch  -> origin/newbranch
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
remote: warning: updating the current branch        
Deleted branch newbranch (was 38d42f1).
HEAD is now at 9ad36e1 second
ok 13 - failed (non-fast-forward) push with matching heads

expecting success: 

	mk_test testrepo heads/master &&
	git push testrepo : &&
	git commit --amend -massaged &&
	git push --force testrepo : &&
	! check_push_result testrepo $the_commit heads/master &&
	git reset --hard $the_commit


To ../mirror
   507bc17..29d07cc  master -> master
 - [deleted]         remove
 * [new branch]      add -> add
 * [new branch]      up/master -> up/master
 * [new branch]      up/remove -> up/remove
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
fatal: 'refs/heads/remove' - not a valid ref
ok 5 - push mirror adds, updates and removes branches together

expecting success: 

	mk_repo_pair &&
	(
		cd master &&
		echo one >foo && git add foo && git commit -m one &&
		git tag -f tmaster master &&
		git push --mirror up
	) &&
	master_master=$(cd master && git show-ref -s --verify refs/tags/tmaster) &&
	mirror_master=$(cd mirror && git show-ref -s --verify refs/tags/tmaster) &&
	test "$master_master" = "$mirror_master"


38d42f181f21cdea0c77ef4c3987ead3de8a5a52
ok 62 - prune fetch.prune=true remote.origin.prune=false --no-prune; kept

expecting success: 
		# make sure a newbranch is there in . and also in one
		git branch -f newbranch &&
		(
			cd one &&
			test_unconfig fetch.prune &&
			test_unconfig remote.origin.prune &&
			git fetch &&
			git rev-parse --verify refs/remotes/origin/newbranch
		) &&

		# now remove it
		git branch -d newbranch &&

		# then test
		(
			cd one &&
			set_config_tristate fetch.prune $fetch_prune &&
			set_config_tristate remote.origin.prune $remote_origin_prune &&

			git fetch $cmdline &&
			case "$expected" in
			pruned)
				test_must_fail git rev-parse --verify refs/remotes/origin/newbranch
				;;
			kept)
				git rev-parse --verify refs/remotes/origin/newbranch
				;;
			esac
		)
	
From ../
 * [new branch]      master     -> rem/master
 * [new branch]      one        -> rem/one
 * [new branch]      two        -> rem/two
 * [new branch]      three      -> rem/three
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
remote: warning: updating the current branch        
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
ok 15 - br-remote-explicit remote-explicit

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5517-push-mirror/mirror/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5517-push-mirror/master/.git/
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
remote: warning: updating the current branch        
To testrepo
   b9c09d6..9ad36e1  master -> master
Deleted branch newbranch (was 38d42f1).
[master (root-commit) 891a3b9] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
[master ead0604] assaged
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 path2
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 x [deleted]         (none)     -> origin/newbranch
remote: warning: updating the current branch        
remote: warning: updating the current branch        
To testrepo
 + 9ad36e1...ead0604 master -> master (forced update)
To ../mirror
 * [new branch]      master -> master
 * [new tag]         tmaster -> tmaster
--- expect	2015-12-16 11:00:07.941564847 +0000
+++ actual	2015-12-16 11:00:07.957564847 +0000
@@ -1 +1 @@
-9ad36e1e54b2130a20d55abb4f0f3ca8494ead3f
+ead060494eed34a0810ba15d500e7ac4ecaa2560
fatal: Needed a single revision
ok 63 - prune fetch.prune=unset remote.origin.prune=true; pruned

expecting success: 
		# make sure a newbranch is there in . and also in one
		git branch -f newbranch &&
		(
			cd one &&
			test_unconfig fetch.prune &&
			test_unconfig remote.origin.prune &&
			git fetch &&
			git rev-parse --verify refs/remotes/origin/newbranch
		) &&

		# now remove it
		git branch -d newbranch &&

		# then test
		(
			cd one &&
			set_config_tristate fetch.prune $fetch_prune &&
			set_config_tristate remote.origin.prune $remote_origin_prune &&

			git fetch $cmdline &&
			case "$expected" in
			pruned)
				test_must_fail git rev-parse --verify refs/remotes/origin/newbranch
				;;
			kept)
				git rev-parse --verify refs/remotes/origin/newbranch
				;;
			esac
		)
	
ok 6 - push mirror creates new tags

expecting success: 

	mk_repo_pair &&
	(
		cd master &&
		echo one >foo && git add foo && git commit -m one &&
		git tag -f tmaster master &&
		git push --mirror up &&
		echo two >foo && git add foo && git commit -m two &&
		git tag -f tmaster master &&
		git push --mirror up
	) &&
	master_master=$(cd master && git show-ref -s --verify refs/tags/tmaster) &&
	mirror_master=$(cd mirror && git show-ref -s --verify refs/tags/tmaster) &&
	test "$master_master" = "$mirror_master"


HEAD is now at 9ad36e1 second
ok 14 - push --force with matching heads

expecting success: 

	mk_test testrepo heads/master &&
	git push testrepo : &&
	git commit --amend -massaged &&
	git push testrepo +: &&
	! check_push_result testrepo $the_commit heads/master &&
	git reset --hard $the_commit


From ../
 * [new branch]      three      -> rem/three
 * [new branch]      master     -> rem/master
 * [new branch]      one        -> rem/one
 * [new branch]      two        -> rem/two
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5517-push-mirror/mirror/.git/
ok 16 - br-remote-explicit-merge

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5517-push-mirror/master/.git/
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 * [new branch]      newbranch  -> origin/newbranch
remote: warning: updating the current branch        
[master (root-commit) 6a1be37] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
Deleted branch newbranch (was 38d42f1).
remote: warning: updating the current branch        
To ../mirror
 * [new branch]      master -> master
 * [new tag]         tmaster -> tmaster
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
remote: warning: updating the current branch        
ok 64 - prune fetch.prune=unset remote.origin.prune=true --no-prune; kept

expecting success: 
		# make sure a newbranch is there in . and also in one
		git branch -f newbranch &&
		(
			cd one &&
			test_unconfig fetch.prune &&
			test_unconfig remote.origin.prune &&
			git fetch &&
			git rev-parse --verify refs/remotes/origin/newbranch
		) &&

		# now remove it
		git branch -d newbranch &&

		# then test
		(
			cd one &&
			set_config_tristate fetch.prune $fetch_prune &&
			set_config_tristate remote.origin.prune $remote_origin_prune &&

			git fetch $cmdline &&
			case "$expected" in
			pruned)
				test_must_fail git rev-parse --verify refs/remotes/origin/newbranch
				;;
			kept)
				git rev-parse --verify refs/remotes/origin/newbranch
				;;
			esac
		)
	
[master 764f535] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
To testrepo
   b9c09d6..9ad36e1  master -> master
Updated tag 'tmaster' (was 6a1be37)
[master ead0604] assaged
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 path2
From ../
 * [new branch]      three      -> rem/three
 * [new branch]      master     -> rem/master
 * [new branch]      one        -> rem/one
 * [new branch]      two        -> rem/two
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
remote: warning: updating the current branch        
remote: warning: updating the current branch        
To testrepo
 + 9ad36e1...ead0604 master -> master (forced update)
To ../mirror
   6a1be37..764f535  master -> master
 + 6a1be37...764f535 tmaster -> tmaster (forced update)
 * [new branch]      up/master -> up/master
ok 17 - br-remote-explicit-merge remote-explicit

--- expect	2015-12-16 11:00:08.697564847 +0000
+++ actual	2015-12-16 11:00:08.713564847 +0000
@@ -1 +1 @@
-9ad36e1e54b2130a20d55abb4f0f3ca8494ead3f
+ead060494eed34a0810ba15d500e7ac4ecaa2560
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
ok 7 - push mirror updates existing tags

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
expecting success: 

	mk_repo_pair &&
	(
		cd master &&
		echo one >foo && git add foo && git commit -m one &&
		git tag -f tmaster master &&
		git push --mirror up &&
		echo two >foo && git add foo && git commit -m two &&
		git tag -f tmaster master &&
		git push --mirror up &&
		git reset --hard HEAD^
		git tag -f tmaster master &&
		git push --mirror up
	) &&
	master_master=$(cd master && git show-ref -s --verify refs/tags/tmaster) &&
	mirror_master=$(cd mirror && git show-ref -s --verify refs/tags/tmaster) &&
	test "$master_master" = "$mirror_master"


Deleted branch newbranch (was 38d42f1).
HEAD is now at 9ad36e1 second
ok 15 - push with matching heads and forced update

expecting success: 

	mk_test testrepo heads/master &&
	git push testrepo master:master &&
	check_push_result testrepo $the_commit heads/master


From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 x [deleted]         (none)     -> origin/newbranch
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5517-push-mirror/mirror/.git/
fatal: Needed a single revision
ok 65 - prune fetch.prune=unset remote.origin.prune=true --prune; pruned

expecting success: 
		# make sure a newbranch is there in . and also in one
		git branch -f newbranch &&
		(
			cd one &&
			test_unconfig fetch.prune &&
			test_unconfig remote.origin.prune &&
			git fetch &&
			git rev-parse --verify refs/remotes/origin/newbranch
		) &&

		# now remove it
		git branch -d newbranch &&

		# then test
		(
			cd one &&
			set_config_tristate fetch.prune $fetch_prune &&
			set_config_tristate remote.origin.prune $remote_origin_prune &&

			git fetch $cmdline &&
			case "$expected" in
			pruned)
				test_must_fail git rev-parse --verify refs/remotes/origin/newbranch
				;;
			kept)
				git rev-parse --verify refs/remotes/origin/newbranch
				;;
			esac
		)
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5517-push-mirror/master/.git/
remote: warning: updating the current branch        
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
[master (root-commit) 218fbb3] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
From ../
 * [new branch]      one        -> rem/one
 * [new branch]      two        -> rem/two
 * [new branch]      master     -> rem/master
 * [new branch]      three      -> rem/three
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 * [new branch]      newbranch  -> origin/newbranch
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
remote: warning: updating the current branch        
remote: warning: updating the current branch        
To ../mirror
 * [new branch]      master -> master
 * [new tag]         tmaster -> tmaster
To testrepo
   b9c09d6..9ad36e1  master -> master
Deleted branch newbranch (was 38d42f1).
ok 18 - br-remote-explicit-octopus

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
ok 16 - push with no ambiguity (1)

expecting success: 

	mk_test testrepo remotes/origin/master &&
	git push testrepo master:origin/master &&
	check_push_result testrepo $the_commit remotes/origin/master


[master 2e9318b] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Updated tag 'tmaster' (was 218fbb3)
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 x [deleted]         (none)     -> origin/newbranch
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
fatal: Needed a single revision
ok 66 - prune fetch.prune=false remote.origin.prune=true; pruned

expecting success: 
		# make sure a newbranch is there in . and also in one
		git branch -f newbranch &&
		(
			cd one &&
			test_unconfig fetch.prune &&
			test_unconfig remote.origin.prune &&
			git fetch &&
			git rev-parse --verify refs/remotes/origin/newbranch
		) &&

		# now remove it
		git branch -d newbranch &&

		# then test
		(
			cd one &&
			set_config_tristate fetch.prune $fetch_prune &&
			set_config_tristate remote.origin.prune $remote_origin_prune &&

			git fetch $cmdline &&
			case "$expected" in
			pruned)
				test_must_fail git rev-parse --verify refs/remotes/origin/newbranch
				;;
			kept)
				git rev-parse --verify refs/remotes/origin/newbranch
				;;
			esac
		)
	
remote: warning: updating the current branch        
To ../mirror
   218fbb3..2e9318b  master -> master
 + 218fbb3...2e9318b tmaster -> tmaster (forced update)
 * [new branch]      up/master -> up/master
HEAD is now at 218fbb3 one
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> origin/master
Updated tag 'tmaster' (was 2e9318b)
notice: HEAD points to an unborn branch (master)
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 * [new branch]      newbranch  -> origin/newbranch
remote: warning: updating the current branch        
To ../mirror
 + 2e9318b...218fbb3 master -> master (forced update)
   218fbb3..2e9318b  up/master -> up/master
 + 2e9318b...218fbb3 tmaster -> tmaster (forced update)
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
From ../
 * [new branch]      one        -> rem/one
 * [new branch]      two        -> rem/two
 * [new branch]      master     -> rem/master
 * [new branch]      three      -> rem/three
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
ok 8 - push mirror force updates existing tags

expecting success: 

	mk_repo_pair &&
	(
		cd master &&
		echo one >foo && git add foo && git commit -m one &&
		git tag -f tremove master &&
		git push --mirror up &&
		git tag -d tremove
		git push --mirror up
	) &&
	(
		cd mirror &&
		invert git show-ref -s --verify refs/tags/tremove
	)


 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
Deleted branch newbranch (was 38d42f1).
To testrepo
   b9c09d6..9ad36e1  master -> origin/master
notice: HEAD points to an unborn branch (master)
ok 17 - push with no ambiguity (2)

expecting success: 

	mk_test testrepo heads/master heads/t/master &&
	git branch -f t/master master &&
	git push testrepo master &&
	check_push_result testrepo $the_commit heads/master &&
	check_push_result testrepo $the_first_commit heads/t/master


ok 19 - br-remote-explicit-octopus remote-explicit

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5517-push-mirror/mirror/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5517-push-mirror/master/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
ok 67 - prune fetch.prune=false remote.origin.prune=true --no-prune; kept

expecting success: 
		# make sure a newbranch is there in . and also in one
		git branch -f newbranch &&
		(
			cd one &&
			test_unconfig fetch.prune &&
			test_unconfig remote.origin.prune &&
			git fetch &&
			git rev-parse --verify refs/remotes/origin/newbranch
		) &&

		# now remove it
		git branch -d newbranch &&

		# then test
		(
			cd one &&
			set_config_tristate fetch.prune $fetch_prune &&
			set_config_tristate remote.origin.prune $remote_origin_prune &&

			git fetch $cmdline &&
			case "$expected" in
			pruned)
				test_must_fail git rev-parse --verify refs/remotes/origin/newbranch
				;;
			kept)
				git rev-parse --verify refs/remotes/origin/newbranch
				;;
			esac
		)
	
[master (root-commit) 4be1f5b] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
remote: warning: updating the current branch        
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
remote: warning: updating the current branch        
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
To ../mirror
 * [new branch]      master -> master
 * [new tag]         tremove -> tremove
Deleted branch newbranch (was 38d42f1).
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> t/master
Deleted tag 'tremove' (was 4be1f5b)
From ../
 * [new branch]      master     -> rem/master
 * [new branch]      one        -> rem/one
 * [new branch]      three      -> rem/three
 * [new branch]      two        -> rem/two
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 x [deleted]         (none)     -> origin/newbranch
ok 20 - br-remote-glob

To ../mirror
 - [deleted]         tremove
 * [new branch]      up/master -> up/master
expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
fatal: 'refs/tags/tremove' - not a valid ref
ok 9 - push mirror removes tags

expecting success: 

	mk_repo_pair &&
	(
		cd master &&
		echo one >foo && git add foo && git commit -m one &&
		git tag -f tmaster master &&
		git tag -f tremove master &&
		git push --mirror up &&
		git tag -d tremove &&
		git tag tadd master &&
		echo two >foo && git add foo && git commit -m two &&
		git tag -f tmaster master &&
		git push --mirror up
	) &&
	master_master=$(cd master && git show-ref -s --verify refs/tags/tmaster) &&
	master_add=$(cd master && git show-ref -s --verify refs/tags/tadd) &&
	mirror_master=$(cd mirror && git show-ref -s --verify refs/tags/tmaster) &&
	mirror_add=$(cd mirror && git show-ref -s --verify refs/tags/tadd) &&
	test "$master_master" = "$mirror_master" &&
	test "$master_add" = "$mirror_add" &&
	(
		cd mirror &&
		invert git show-ref -s --verify refs/tags/tremove
	)


fatal: Needed a single revision
ok 68 - prune fetch.prune=false remote.origin.prune=true --prune; pruned

expecting success: 
		# make sure a newbranch is there in . and also in one
		git branch -f newbranch &&
		(
			cd one &&
			test_unconfig fetch.prune &&
			test_unconfig remote.origin.prune &&
			git fetch &&
			git rev-parse --verify refs/remotes/origin/newbranch
		) &&

		# now remove it
		git branch -d newbranch &&

		# then test
		(
			cd one &&
			set_config_tristate fetch.prune $fetch_prune &&
			set_config_tristate remote.origin.prune $remote_origin_prune &&

			git fetch $cmdline &&
			case "$expected" in
			pruned)
				test_must_fail git rev-parse --verify refs/remotes/origin/newbranch
				;;
			kept)
				git rev-parse --verify refs/remotes/origin/newbranch
				;;
			esac
		)
	
remote: warning: updating the current branch        
To testrepo
   b9c09d6..9ad36e1  master -> master
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5517-push-mirror/mirror/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5517-push-mirror/master/.git/
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 * [new branch]      newbranch  -> origin/newbranch
ok 18 - push with colon-less refspec, no ambiguity

expecting success: 

	mk_test testrepo heads/master remotes/origin/master &&
	git push testrepo master:master &&
	check_push_result testrepo $the_commit heads/master &&
	check_push_result testrepo $the_first_commit remotes/origin/master


38d42f181f21cdea0c77ef4c3987ead3de8a5a52
[master (root-commit) 4be1f5b] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
Deleted branch newbranch (was 38d42f1).
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 x [deleted]         (none)     -> origin/newbranch
From ../
 * [new branch]      master     -> rem/master
 * [new branch]      one        -> rem/one
 * [new branch]      three      -> rem/three
 * [new branch]      two        -> rem/two
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
remote: warning: updating the current branch        
remote: warning: updating the current branch        
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
To ../mirror
 * [new branch]      master -> master
 * [new tag]         tmaster -> tmaster
 * [new tag]         tremove -> tremove
Deleted tag 'tremove' (was 4be1f5b)
fatal: Needed a single revision
ok 69 - prune fetch.prune=true remote.origin.prune=true; pruned

expecting success: 
		# make sure a newbranch is there in . and also in one
		git branch -f newbranch &&
		(
			cd one &&
			test_unconfig fetch.prune &&
			test_unconfig remote.origin.prune &&
			git fetch &&
			git rev-parse --verify refs/remotes/origin/newbranch
		) &&

		# now remove it
		git branch -d newbranch &&

		# then test
		(
			cd one &&
			set_config_tristate fetch.prune $fetch_prune &&
			set_config_tristate remote.origin.prune $remote_origin_prune &&

			git fetch $cmdline &&
			case "$expected" in
			pruned)
				test_must_fail git rev-parse --verify refs/remotes/origin/newbranch
				;;
			kept)
				git rev-parse --verify refs/remotes/origin/newbranch
				;;
			esac
		)
	
ok 21 - br-remote-glob remote-glob

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> origin/master
[master 3ad0302] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Updated tag 'tmaster' (was 4be1f5b)
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 * [new branch]      newbranch  -> origin/newbranch
remote: warning: updating the current branch        
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
To ../mirror
   4be1f5b..3ad0302  master -> master
 + 4be1f5b...3ad0302 tmaster -> tmaster (forced update)
 - [deleted]         tremove
 * [new branch]      up/master -> up/master
 * [new tag]         tadd -> tadd
Deleted branch newbranch (was 38d42f1).
remote: warning: updating the current branch        
To testrepo
   b9c09d6..9ad36e1  master -> master
fatal: 'refs/tags/tremove' - not a valid ref
ok 10 - push mirror adds, updates and removes tags together

expecting success: 

	mk_repo_pair --mirror &&
	(
		cd master &&
		echo one >foo && git add foo && git commit -m one &&
		git branch keep master &&
		git branch remove master &&
		git push up &&
		git branch -D remove
		git push up
	) &&
	(
		cd mirror &&
		git show-ref -s --verify refs/heads/keep &&
		invert git show-ref -s --verify refs/heads/remove
	)


From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 x [deleted]         (none)     -> origin/newbranch
From ../
 * [new branch]      three      -> rem/three
 * [new branch]      master     -> rem/master
 * [new branch]      one        -> rem/one
 * [new branch]      two        -> rem/two
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
ok 19 - push with weak ambiguity (1)

expecting success: 

	mk_test testrepo heads/master remotes/origin/master remotes/another/master &&
	git push testrepo master:master &&
	check_push_result testrepo $the_commit heads/master &&
	check_push_result testrepo $the_first_commit remotes/origin/master remotes/another/master


 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
fatal: Needed a single revision
ok 70 - prune fetch.prune=true remote.origin.prune=true --prune; pruned

expecting success: 
		# make sure a newbranch is there in . and also in one
		git branch -f newbranch &&
		(
			cd one &&
			test_unconfig fetch.prune &&
			test_unconfig remote.origin.prune &&
			git fetch &&
			git rev-parse --verify refs/remotes/origin/newbranch
		) &&

		# now remove it
		git branch -d newbranch &&

		# then test
		(
			cd one &&
			set_config_tristate fetch.prune $fetch_prune &&
			set_config_tristate remote.origin.prune $remote_origin_prune &&

			git fetch $cmdline &&
			case "$expected" in
			pruned)
				test_must_fail git rev-parse --verify refs/remotes/origin/newbranch
				;;
			kept)
				git rev-parse --verify refs/remotes/origin/newbranch
				;;
			esac
		)
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5517-push-mirror/mirror/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5517-push-mirror/master/.git/
ok 22 - br-remote-glob-merge

warning: --mirror is dangerous and deprecated; please
	 use --mirror=fetch or --mirror=push instead
expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
[master (root-commit) 21cb828] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 * [new branch]      newbranch  -> origin/newbranch
Branch keep set up to track remote branch master from up.
remote: warning: updating the current branch        
Branch remove set up to track remote branch master from up.
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
Deleted branch newbranch (was 38d42f1).
remote: warning: updating the current branch        
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> origin/master
To ../mirror
 * [new branch]      keep -> keep
 * [new branch]      master -> master
 * [new branch]      remove -> remove
Deleted branch remove (was 21cb828).
38d42f181f21cdea0c77ef4c3987ead3de8a5a52
ok 71 - prune fetch.prune=true remote.origin.prune=true --no-prune; kept

expecting success: 
	test_commit base &&
	test_commit oneside &&
	git checkout HEAD^ &&
	test_commit otherside &&
	git checkout master &&
	test_tick &&
	git merge otherside &&
	ad=$(git log --no-walk --format=%ad HEAD) &&
	git bundle create twoside-boundary.bdl master --since="$ad" &&
	convert_bundle_to_pack <twoside-boundary.bdl >twoside-boundary.pack &&
	pack=$(git index-pack --fix-thin --stdin <twoside-boundary.pack) &&
	test_bundle_object_count .git/objects/pack/pack-${pack##pack	}.pack 3

To ../mirror
 - [deleted]         remove
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> another/master
21cb828f81d92e005f70cde93743c249b50d2d3a
fatal: 'refs/heads/remove' - not a valid ref
From ../
 * [new branch]      three      -> rem/three
ok 11 - remote.foo.mirror adds and removes branches

expecting success: 

	mk_repo_pair &&
	(
		cd master &&
		echo one >foo && git add foo && git commit -m one &&
		git config --add remote.up.mirror no &&
		git branch keep master &&
		git push --mirror up &&
		git branch -D keep &&
		git push up :
	) &&
	(
		cd mirror &&
		git show-ref -s --verify refs/heads/keep
	)


 * [new branch]      master     -> rem/master
 * [new branch]      one        -> rem/one
 * [new branch]      two        -> rem/two
[master ffe6657] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 base.t
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
ok 23 - br-remote-glob-merge remote-glob

[master 7233484] oneside
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 oneside.t
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5517-push-mirror/mirror/.git/
expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
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 ffe6657... base
remote: warning: updating the current branch        
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5517-push-mirror/master/.git/
To testrepo
   b9c09d6..9ad36e1  master -> master
[detached HEAD a380cf8] otherside
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 otherside.t
[master (root-commit) d2ec3d6] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
Previous HEAD position was a380cf8... otherside
Switched to branch 'master'
Your branch is based on 'one/master_not', but the upstream is gone.
  (use "git branch --unset-upstream" to fixup)
Merging:
7233484 oneside
virtual otherside
found 1 common ancestor:
ffe6657 base
Merge made by the 'recursive' strategy.
ok 20 - push with weak ambiguity (2)

expecting success: 

	mk_test testrepo heads/frotz tags/frotz &&
	test_must_fail git push testrepo master:frotz &&
	check_push_result testrepo $the_first_commit heads/frotz tags/frotz


 otherside.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 otherside.t
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
remote: warning: updating the current branch        
From ../
To ../mirror
 * [new branch]      keep -> keep
 * [new branch]      master -> master
 * [new branch]      one        -> rem/one
 * [new branch]      two        -> rem/two
 * [new branch]      master     -> rem/master
 * [new branch]      three      -> rem/three
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
Deleted branch keep (was d2ec3d6).
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
Everything up-to-date
d2ec3d6d80bdccbacb45b19450beffab6399e091
ok 12 - remote.foo.mirror=no has no effect

# passed all 12 test(s)
1..12
ok 24 - br-remote-glob-octopus

To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> frotz
expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
*** t5518-fetch-exit-status.sh ***
To testrepo
 * [new tag]         b9c09d6cc74d3857142fb7c082dca65b88254c6d -> frotz
ok 72 - all boundary commits are excluded

expecting success: 
	git branch goodbye &&
	git clone . only-prunes &&
	git branch -D goodbye &&
	(
		cd only-prunes &&
		git fetch --prune origin 2>&1 | head -n1 >../actual
	) &&
	echo "From ${D}/." >expect &&
	test_cmp expect actual

notice: HEAD points to an unborn branch (master)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5518-fetch-exit-status/.git/
Cloning into 'only-prunes'...
expecting success: 

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

	git checkout -b side &&
	echo side >file &&
	git commit -a -m side &&

	git checkout master &&
	echo next >file &&
	git commit -a -m next

error: dst refspec frotz matches more than one.
error: failed to push some refs to 'testrepo'
[master (root-commit) 6e711b1] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file
Switched to a new branch 'side'
done.
[side 8a15698] side
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
notice: HEAD points to an unborn branch (master)
Switched to branch 'master'
ok 21 - push with ambiguity

expecting success: 

	mk_test testrepo heads/frotz tags/frotz &&
	git branch -f frotz master &&
	git push testrepo frotz &&
	check_push_result testrepo $the_commit heads/frotz &&
	check_push_result testrepo $the_first_commit tags/frotz


From ../
 * [new branch]      one        -> rem/one
 * [new branch]      two        -> rem/two
 * [new branch]      master     -> rem/master
Deleted branch goodbye (was 884c27b).
 * [new branch]      three      -> rem/three
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
[master e0d258f] next
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 1 - setup

expecting success: 

	test_must_fail git fetch . master:side


 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
ok 73 - fetch --prune prints the remotes url

expecting success: 
	git branch dir/file &&
	git clone . prune-df-conflict &&
	git branch -D dir/file &&
	git branch dir &&
	(
		cd prune-df-conflict &&
		git fetch --prune &&
		git rev-parse origin/dir >../actual
	) &&
	git rev-parse dir >expect &&
	test_cmp expect actual

From .
 ! [rejected]        master     -> side  (non-fast-forward)
ok 25 - br-remote-glob-octopus remote-glob

ok 2 - non-fast-forward fetch

expecting success: 

	git fetch . +master:side


expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
Cloning into 'prune-df-conflict'...
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> frotz
From .
 + 8a15698...e0d258f master     -> side  (forced update)
ok 3 - forced update

# passed all 3 test(s)
1..3
done.
*** t5519-push-alternates.sh ***
To testrepo
 * [new tag]         b9c09d6cc74d3857142fb7c082dca65b88254c6d -> frotz
Deleted branch dir/file (was 884c27b).
notice: HEAD points to an unborn branch (master)
From /«PKGBUILDDIR»/t/trash directory.t5510-fetch/.
 x [deleted]         (none)     -> origin/dir/file
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5519-push-alternates/.git/
expecting success: 
	mkdir alice-pub &&
	(
		cd alice-pub &&
		GIT_DIR=. git init
	) &&
	mkdir alice-work &&
	(
		cd alice-work &&
		git init &&
		>file &&
		git add . &&
		git commit -m initial &&
		git push ../alice-pub master
	) &&

	# Project Bob is a fork of project Alice
	mkdir bob-pub &&
	(
		cd bob-pub &&
		GIT_DIR=. git init &&
		mkdir -p objects/info &&
		echo ../../alice-pub/objects >objects/info/alternates
	) &&
	git clone alice-pub bob-work &&
	(
		cd bob-work &&
		git push ../bob-pub master
	)

 * [new branch]      dir        -> origin/dir
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5519-push-alternates/alice-pub/
From ../
 * [new branch]      master     -> branches-default
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
ok 74 - branchname D/F conflict resolved by --prune

expecting success: 
	test_commit extra &&
	git reset --hard HEAD^ &&
	git update-ref refs/foo extra &&
	git init one-level &&
	(
		cd one-level &&
		git fetch .. HEAD refs/foo
	)

 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5519-push-alternates/alice-work/.git/
To testrepo
   b9c09d6..9ad36e1  frotz -> frotz
[master (root-commit) 971fa83] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file
[master 3773d1b] extra
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 extra.t
ok 26 - br-branches-default

notice: HEAD points to an unborn branch (master)
expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
HEAD is now at 884c27b Merge tag 'otherside'
notice: HEAD points to an unborn branch (master)
ok 22 - push with colon-less refspec (1)

expecting success: 

	mk_test testrepo heads/frotz tags/frotz &&
	if git show-ref --verify -q refs/heads/frotz
	then
		git branch -D frotz
	fi &&
	git tag -f frotz &&
	git push -f testrepo frotz &&
	check_push_result testrepo $the_commit tags/frotz &&
	check_push_result testrepo $the_first_commit heads/frotz


To ../alice-pub
 * [new branch]      master -> master
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5510-fetch/one-level/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5519-push-alternates/bob-pub/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
Cloning into 'bob-work'...
done.
From ../
 * [new branch]      master     -> branches-default
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> frotz
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
From ..
 * branch            HEAD       -> FETCH_HEAD
 * branch            refs/foo   -> FETCH_HEAD
To ../bob-pub
 * [new branch]      master -> master
ok 75 - fetching a one-level ref works

ok 1 - setup

expecting success: 
	(
		cd alice-work &&
		echo more >file &&
		git commit -a -m second &&
		git push ../alice-pub :
	)

# passed all 75 test(s)
1..75
ok 27 - br-branches-default branches-default

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
[master e21e2ac] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
To testrepo
 * [new tag]         b9c09d6cc74d3857142fb7c082dca65b88254c6d -> frotz
notice: HEAD points to an unborn branch (master)
Deleted branch frotz (was 9ad36e1).
To ../alice-pub
   971fa83..e21e2ac  master -> master
ok 2 - alice works and pushes

expecting success: 
	(
		# Bob acquires what Alice did in his work tree first.
		# Even though these objects are not directly in
		# the public repository of Bob, this push does not
		# need to send the commit Bob received from Alice
		# to his public repository, as all the object Alice
		# has at her public repository are available to it
		# via its alternates.
		cd bob-work &&
		git pull ../alice-pub master &&
		echo more bob >file &&
		git commit -a -m third &&
		git push ../bob-pub :
	) &&

	# Check that the second commit by Alice is not sent
	# to ../bob-pub
	(
		cd bob-pub &&
		second=$(git rev-parse HEAD^) &&
		rm -f objects/info/alternates &&
		test_must_fail git cat-file -t $second &&
		echo ../../alice-pub/objects >objects/info/alternates
	)

To testrepo
 + b9c09d6...9ad36e1 frotz -> frotz (forced update)
From ../alice-pub
 * branch            master     -> FETCH_HEAD
From ../
 * branch            three      -> FETCH_HEAD
 * [new branch]      master     -> branches-default
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
notice: HEAD points to an unborn branch (master)
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
Updating 971fa83..e21e2ac
Fast-forward
notice: HEAD points to an unborn branch (master)
ok 23 - push with colon-less refspec (2)

expecting success: 

	mk_test testrepo &&
	if git show-ref --verify -q refs/tags/frotz
	then
		git tag -d frotz
	fi &&
	git branch -f frotz master &&
	git push testrepo frotz &&
	check_push_result testrepo $the_commit heads/frotz &&
	test 1 = $( cd testrepo && git show-ref | wc -l )

 file | 1 +
 1 file changed, 1 insertion(+)
ok 28 - br-branches-default-merge

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
[master 6a4d01f] third
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
notice: HEAD points to an unborn branch (master)
notice: No default references
Deleted tag 'frotz' (was 9ad36e1)
To ../bob-pub
   971fa83..6a4d01f  master -> master
fatal: git cat-file: could not get object info
ok 3 - bob fetches from alice, works and pushes

expecting success: 
	(
		cd bob-pub &&
		echo ../../alice-pub/objects >objects/info/alternates
	)

ok 4 - clean-up in case the previous failed

expecting success: 
	(
		# Alice does not care what Bob does.  She does not
		# even have to be aware of his existence.  She just
		# keeps working and pushing
		cd alice-work &&
		echo more alice >file &&
		git commit -a -m fourth &&
		git push ../alice-pub :
	)

[master 1153b1a] fourth
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
To testrepo
 * [new branch]      frotz -> frotz
From ../
 * branch            three      -> FETCH_HEAD
 * [new branch]      master     -> branches-default
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
notice: HEAD points to an unborn branch (master)
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
ok 24 - push with colon-less refspec (3)

expecting success: 

	mk_test testrepo &&
	if git show-ref --verify -q refs/heads/frotz
	then
		git branch -D frotz
	fi &&
	git tag -f frotz &&
	git push testrepo frotz &&
	check_push_result testrepo $the_commit tags/frotz &&
	test 1 = $( cd testrepo && git show-ref | wc -l )


*** t5520-pull.sh ***
To ../alice-pub
   e21e2ac..1153b1a  master -> master
ok 29 - br-branches-default-merge branches-default

ok 5 - alice works and pushes again

expecting success: 
	(
		# This time Bob does not pull from Alice, and
		# the master branch at her public repository points
		# at a commit Bob does not know about.  This should
		# not prevent the push by Bob from succeeding.
		cd bob-work &&
		echo yet more bob >file &&
		git commit -a -m fifth &&
		git push ../bob-pub :
	)

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
[master 991e666] fifth
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
notice: HEAD points to an unborn branch (master)
notice: No default references
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5520-pull/.git/
expecting success: 
	echo file >file &&
	git add file &&
	git commit -a -m original

Deleted branch frotz (was 9ad36e1).
To ../bob-pub
   6a4d01f..991e666  master -> master
ok 6 - bob works and pushes

expecting success: 
	(
		# Alice does not care what Bob does.  She does not
		# even have to be aware of his existence.  She just
		# keeps working and pushing
		cd alice-work &&
		echo more and more alice >file &&
		git commit -a -m sixth.1 &&
		echo more and more alice >>file &&
		git commit -a -m sixth.2 &&
		echo more and more alice >>file &&
		git commit -a -m sixth.3 &&
		git push ../alice-pub :
	)

[master (root-commit) ef93587] original
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 1 - setup

expecting success: 
	git init cloned &&
	(
		cd cloned &&
		git pull ..
	) &&
	test -f file &&
	test -f cloned/file &&
	test_cmp file cloned/file

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5520-pull/cloned/.git/
[master 18a0f63] sixth.1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
From ../
 * branch            one        -> FETCH_HEAD
 * branch            two        -> FETCH_HEAD
 * [new branch]      master     -> branches-default
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
[master 0b26028] sixth.2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
To testrepo
 * [new tag]         frotz -> frotz
notice: HEAD points to an unborn branch (master)
[master 4d5f7e4] sixth.3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 30 - br-branches-default-octopus

ok 25 - push with colon-less refspec (4)

expecting success: 

	mk_test testrepo &&
	git push testrepo master:branch &&
	check_push_result testrepo $the_commit heads/branch


From ..
 * branch            HEAD       -> FETCH_HEAD
expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
ok 2 - pulling into void

expecting success: 
	git init cloned-uho &&
	(
		cd cloned-uho &&
		git pull .. master:master
	) &&
	test -f file &&
	test -f cloned-uho/file &&
	test_cmp file cloned-uho/file

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5520-pull/cloned-uho/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
To ../alice-pub
   1153b1a..4d5f7e4  master -> master
ok 7 - alice works and pushes yet again

expecting success: 
	(
		cd alice-pub &&
		git cat-file commit master >../bob-work/commit
	) &&
	(
		# This time Bob does not pull from Alice, and
		# the master branch at her public repository points
		# at a commit Bob does not fully know about, but
		# he happens to have the commit object (but not the
		# necessary tree) in his repository from Alice.
		# This should not prevent the push by Bob from
		# succeeding.
		cd bob-work &&
		git hash-object -t commit -w commit &&
		echo even more bob >file &&
		git commit -a -m seventh &&
		git push ../bob-pub :
	)

notice: HEAD points to an unborn branch (master)
notice: No default references
4d5f7e45091d9e2f560943996e39e94dbbed9959
[master 49bf871] seventh
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
From ..
 * [new branch]      master     -> master
ok 3 - pulling into void using master:master

expecting success: 
	git init cloned-untracked &&
	(
		cd cloned-untracked &&
		echo untracked >file &&
		test_must_fail git pull .. master &&
		echo untracked >expect &&
		test_cmp expect file
	)

To testrepo
 * [new branch]      master -> branch
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5520-pull/cloned-untracked/.git/
notice: HEAD points to an unborn branch (master)
From ../
 * branch            one        -> FETCH_HEAD
 * branch            two        -> FETCH_HEAD
 * [new branch]      master     -> branches-default
ok 26 - push head with non-existent, incomplete dest

expecting success: 

	mk_test testrepo &&
	git tag -f v1.0 &&
	git push testrepo v1.0:tag &&
	check_push_result testrepo $the_commit tags/tag


 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
To ../bob-pub
   991e666..49bf871  master -> master
ok 8 - bob works and pushes again

# passed all 8 test(s)
1..8
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
ok 31 - br-branches-default-octopus branches-default

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
From ..
 * branch            master     -> FETCH_HEAD
notice: HEAD points to an unborn branch (master)
notice: No default references
error: The following untracked working tree files would be overwritten by merge:
	file
Please move or remove them before you can merge.
Aborting
ok 4 - pulling into void does not overwrite untracked files

expecting success: 
	git init cloned-staged-colliding &&
	(
		cd cloned-staged-colliding &&
		echo "alternate content" >file &&
		git add file &&
		test_must_fail git pull .. master &&
		echo "alternate content" >expect &&
		test_cmp expect file &&
		git cat-file blob :file >file.index &&
		test_cmp expect file.index
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5520-pull/cloned-staged-colliding/.git/
*** t5521-pull-options.sh ***
To testrepo
 * [new tag]         v1.0 -> tag
notice: HEAD points to an unborn branch (master)
ok 27 - push tag with non-existent, incomplete dest

expecting success: 

	mk_test testrepo &&
	test_must_fail git push testrepo `git rev-parse master`:foo


From ..
 * branch            master     -> FETCH_HEAD
error: Your local changes to the following files would be overwritten by merge:
	file
Please, commit your changes or stash them before you can merge.
Aborting
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5521-pull-options/.git/
From ../
 * [new branch]      one        -> branches-one
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
ok 5 - pulling into void does not overwrite staged files

expecting success: 
	git init cloned-staged-new &&
	(
		cd cloned-staged-new &&
		echo "new tracked file" >newfile &&
		git add newfile &&
		git pull .. master &&
		echo "new tracked file" >expect &&
		test_cmp expect newfile &&
		git cat-file blob :newfile >newfile.index &&
		test_cmp expect newfile.index
	)

 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
expecting success: 
	mkdir parent &&
	(cd parent && git init &&
	 echo one >file && git add file &&
	 git commit -m one)

 * [new tag]         tag-two    -> tag-two
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5520-pull/cloned-staged-new/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5521-pull-options/parent/.git/
notice: HEAD points to an unborn branch (master)
notice: No default references
ok 32 - br-branches-one

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
[master (root-commit) fd6fbd6] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 1 - setup

expecting success: 
	mkdir clonedq &&
	(cd clonedq && git init &&
	git pull -q "../parent" >out 2>err &&
	test_must_be_empty err &&
	test_must_be_empty out)

error: unable to push to unqualified destination: foo
The destination refspec neither matches an existing ref on the remote nor
begins with refs/, and we are unable to guess a prefix based on the source ref.
error: failed to push some refs to 'testrepo'
ok 28 - push sha1 with non-existent, incomplete dest

expecting success: 

	mk_test testrepo &&
	test_must_fail git push testrepo master^:branch


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5521-pull-options/clonedq/.git/
From ..
 * branch            master     -> FETCH_HEAD
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
ok 6 - pulling into void does not remove new staged files

expecting success: 
	git init cloned-octopus &&
	(
		cd cloned-octopus &&
		test_must_fail git pull .. master master &&
		! test -f file
	)

notice: HEAD points to an unborn branch (master)
notice: No default references
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5520-pull/cloned-octopus/.git/
error: unable to push to unqualified destination: branch
The destination refspec neither matches an existing ref on the remote nor
begins with refs/, and we are unable to guess a prefix based on the source ref.
error: failed to push some refs to 'testrepo'
ok 29 - push ref expression with non-existent, incomplete dest

expecting success: 

	mk_test testrepo heads/master &&
	git checkout master &&
	git push testrepo HEAD &&
	check_push_result testrepo $the_commit heads/master


ok 2 - git pull -q

expecting success: 
	mkdir clonedqrb &&
	(cd clonedqrb && git init &&
	git pull -q --rebase "../parent" >out 2>err &&
	test_must_be_empty err &&
	test_must_be_empty out &&
	git pull -q --rebase "../parent" >out 2>err &&
	test_must_be_empty err &&
	test_must_be_empty out)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5521-pull-options/clonedqrb/.git/
From ..
 * branch            master     -> FETCH_HEAD
 * branch            master     -> FETCH_HEAD
From ../
 * [new branch]      one        -> branches-one
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
fatal: Cannot merge multiple branches into empty head.
ok 7 - pulling into void must not create an octopus

expecting success: 
	git branch copy master &&
	git config branch.copy.remote . &&
	git config branch.copy.merge refs/heads/master &&
	echo updated >file &&
	git commit -a -m updated &&
	git checkout copy &&
	test "$(cat file)" = file &&
	git pull &&
	test "$(cat file)" = updated &&
	git reflog -1 >reflog.actual &&
	sed "s/^[0-9a-f][0-9a-f]*/OBJID/" reflog.actual >reflog.fuzzy &&
	echo "OBJID HEAD@{0}: pull: Fast-forward" >reflog.expected &&
	test_cmp reflog.expected reflog.fuzzy

ok 33 - br-branches-one branches-one

[master bdf4639] updated
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
remote: warning: updating the current branch        
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
Switched to branch 'copy'
Your branch is behind 'master' by 1 commit, and can be fast-forwarded.
  (use "git pull" to update your local branch)
Already on 'master'
From .
 * branch            master     -> FETCH_HEAD
Updating ef93587..bdf4639
Fast-forward
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
remote: warning: updating the current branch        
To testrepo
   b9c09d6..9ad36e1  HEAD -> master
ok 8 - test . as a remote

expecting success: 
	git checkout -b second master^ &&
	echo modified >file &&
	git commit -a -m modified &&
	git checkout copy &&
	git reset --hard HEAD^ &&
	test "$(cat file)" = file &&
	git pull . second &&
	test "$(cat file)" = modified &&
	git reflog -1 >reflog.actual &&
	sed "s/^[0-9a-f][0-9a-f]*/OBJID/" reflog.actual >reflog.fuzzy &&
	echo "OBJID HEAD@{0}: pull . second: Fast-forward" >reflog.expected &&
	test_cmp reflog.expected reflog.fuzzy

Switched to a new branch 'second'
ok 30 - push with HEAD

expecting success: 

	mk_test testrepo heads/master &&
	git checkout -b local master &&
	git push testrepo HEAD &&
	check_push_result testrepo $the_commit heads/local

From ../
 * branch            three      -> FETCH_HEAD
 * [new branch]      one        -> branches-one
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
[second 73b69f5] modified
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to branch 'copy'
Your branch is up-to-date with 'master'.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
HEAD is now at ef93587 original
ok 34 - br-branches-one-merge

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
ok 3 - git pull -q --rebase

expecting success: 
	mkdir cloned &&
	(cd cloned && git init &&
	git pull "../parent" >out 2>err &&
	test -s err &&
	test_must_be_empty out)

remote: warning: updating the current branch        
From .
 * branch            second     -> FETCH_HEAD
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5521-pull-options/cloned/.git/
Updating ef93587..73b69f5
Fast-forward
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'local'
ok 9 - the default remote . should not break explicit pull

expecting success: 
	git checkout -b test copy^ &&
	test_when_finished "git checkout -f copy && git branch -D test" &&
	test "$(cat file)" = file &&
	test_must_fail git pull . "refs/nonexisting1/*:refs/nonexisting2/*" 2>err &&
	test_i18ngrep "no candidates for merging" err &&
	test "$(cat file)" = file

Switched to a new branch 'test'
From ../
 * branch            three      -> FETCH_HEAD
 * [new branch]      one        -> branches-one
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
ok 4 - git pull

expecting success: 
	mkdir clonedrb &&
	(cd clonedrb && git init &&
	git pull --rebase "../parent" >out 2>err &&
	test -s err &&
	test_must_be_empty out)

 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
There are no candidates for merging among the refs that you just fetched.
To testrepo
 * [new branch]      HEAD -> local
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5521-pull-options/clonedrb/.git/
Switched to branch 'copy'
Your branch and 'master' have diverged,
and have 1 and 1 different commit each, respectively.
  (use "git pull" to merge the remote branch into yours)
ok 31 - push with HEAD nonexisting at remote

Deleted branch test (was ef93587).
expecting success: 

	mk_test testrepo heads/master &&
	git checkout master &&
	git branch -D local &&
	git checkout -b local &&
	git push testrepo master local &&
	check_push_result testrepo $the_commit heads/master &&
	check_push_result testrepo $the_commit heads/local &&

	# Without force rewinding should fail
	git reset --hard HEAD^ &&
	test_must_fail git push testrepo HEAD &&
	check_push_result testrepo $the_commit heads/local &&

	# With force rewinding should succeed
	git push testrepo +HEAD &&
	check_push_result testrepo $the_first_commit heads/local


ok 10 - fail if wildcard spec does not match any refs

expecting success: 
	git remote add test_remote . &&
	test_when_finished "git remote remove test_remote" &&
	git checkout -b test copy^ &&
	test_when_finished "git checkout -f copy && git branch -D test" &&
	test "$(cat file)" = file &&
	test_config branch.test.remote origin &&
	test_must_fail git pull test_remote 2>err &&
	test_i18ngrep "specify a branch on the command line" err &&
	test "$(cat file)" = file

ok 35 - br-branches-one-merge branches-one

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
Switched to a new branch 'test'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
ok 5 - git pull --rebase

expecting success: 
	mkdir clonedv &&
	(cd clonedv && git init &&
	git pull -v "../parent" >out 2>err &&
	test -s err &&
	test_must_be_empty out)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5521-pull-options/clonedv/.git/
for your current branch, you must specify a branch on the command line.
remote: warning: updating the current branch        
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
Switched to branch 'copy'
Your branch and 'master' have diverged,
and have 1 and 1 different commit each, respectively.
  (use "git pull" to merge the remote branch into yours)
Deleted branch test (was ef93587).
From ../
 * [new branch]      one        -> branches-one
 * branch            two        -> FETCH_HEAD
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
Switched to branch 'master'
ok 6 - git pull -v

expecting success: 
	mkdir clonedvrb &&
	(cd clonedvrb && git init &&
	git pull -v --rebase "../parent" >out 2>err &&
	test -s err &&
	test_must_be_empty out)

ok 11 - fail if no branches specified with non-default remote

expecting success: 
	git remote add origin . &&
	test_when_finished "git remote remove origin" &&
	git checkout HEAD^ &&
	test_when_finished "git checkout -f copy" &&
	test "$(cat file)" = file &&
	test_must_fail git pull 2>err &&
	test_i18ngrep "not currently on a branch" err &&
	test "$(cat file)" = file

Deleted branch local (was 9ad36e1).
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5521-pull-options/clonedvrb/.git/
Switched to a new branch 'local'
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 ef93587... original
ok 36 - br-branches-one-octopus

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
remote: warning: updating the current branch        
To testrepo
   b9c09d6..9ad36e1  master -> master
 * [new branch]      local -> local
You are not currently on a branch.
ok 7 - git pull -v --rebase

expecting success: 
	mkdir clonedvq &&
	(cd clonedvq && git init &&
	git pull -v -q "../parent" >out 2>err &&
	test_must_be_empty out &&
	test_must_be_empty err)

Previous HEAD position was ef93587... original
Switched to branch 'copy'
Your branch and 'master' have diverged,
and have 1 and 1 different commit each, respectively.
  (use "git pull" to merge the remote branch into yours)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5521-pull-options/clonedvq/.git/
ok 12 - fail if not on a branch

expecting success: 
	git remote add test_remote . &&
	test_when_finished "git remote remove test_remote" &&
	git checkout -b test copy^ &&
	test_when_finished "git checkout -f copy && git branch -D test" &&
	test_config branch.test.remote test_remote &&
	test "$(cat file)" = file &&
	test_must_fail git pull 2>err &&
	test_i18ngrep "no tracking information" err &&
	test "$(cat file)" = file

HEAD is now at b9c09d6 repo
Switched to a new branch 'test'
To testrepo
 ! [rejected]        HEAD -> local (non-fast-forward)
error: failed to push some refs to 'testrepo'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
From ../
 * [new branch]      one        -> branches-one
 * branch            two        -> FETCH_HEAD
ok 8 - git pull -v -q

expecting success: 
	mkdir clonedqv &&
	(cd clonedqv && git init &&
	git pull -q -v "../parent" >out 2>err &&
	test_must_be_empty out &&
	test -s err)

 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5521-pull-options/clonedqv/.git/
There is no tracking information for the current branch.
ok 37 - br-branches-one-octopus branches-one

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
To testrepo
 + 9ad36e1...b9c09d6 HEAD -> local (forced update)
Switched to branch 'copy'
Your branch and 'master' have diverged,
and have 1 and 1 different commit each, respectively.
  (use "git pull" to merge the remote branch into yours)
Deleted branch test (was ef93587).
ok 32 - push with +HEAD

expecting success: 

	mk_test testrepo &&
	git checkout master &&
	git push testrepo HEAD:branch &&
	check_push_result testrepo $the_commit heads/branch


ok 9 - git pull -q -v

expecting success: 
	mkdir clonedoldstyle &&
	(cd clonedoldstyle && git init &&
	cat >>.git/config <<-\EOF &&
	[remote "one"]
		url = ../parent
		fetch = refs/heads/master:refs/heads/mirror
	[remote "two"]
		url = ../parent
		fetch = refs/heads/master:refs/heads/origin
	[branch "master"]
		remote = two
		merge = refs/heads/master
	EOF
	git pull two &&
	test_commit A &&
	git branch -f origin &&
	git pull --all --force
	)

ok 13 - fail if no configuration for current branch

expecting success: 
	git remote add test_remote . &&
	test_when_finished "git remote remove test_remote" &&
	git checkout -b test copy^ &&
	test_when_finished "git checkout -f copy && git branch -D test" &&
	test_config branch.test.remote test_remote &&
	test "$(cat file)" = file &&
	test_must_fail git pull --all 2>err &&
	test_i18ngrep "There is no tracking information" err &&
	test "$(cat file)" = file

Switched to a new branch 'test'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5521-pull-options/clonedoldstyle/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
Fetching test_remote
notice: HEAD points to an unborn branch (master)
notice: No default references
Switched to branch 'master'
From ../
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
From ../parent
 * [new branch]      master     -> origin
There is no tracking information for the current branch.
ok 38 - master

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
To testrepo
 * [new branch]      HEAD -> branch
Switched to branch 'copy'
Your branch and 'master' have diverged,
and have 1 and 1 different commit each, respectively.
  (use "git pull" to merge the remote branch into yours)
[master 7dcb71b] A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 A.t
Deleted branch test (was ef93587).
notice: HEAD points to an unborn branch (master)
ok 33 - push HEAD with non-existent, incomplete dest

expecting success: 

	mk_test testrepo heads/local &&
	git checkout master &&
	git branch -f local $the_commit &&
	(
		cd testrepo &&
		git checkout local &&
		git reset --hard $the_first_commit
	) &&
	test_config remote.there.url testrepo &&
	test_config remote.there.push HEAD &&
	test_config branch.master.remote there &&
	git push &&
	check_push_result testrepo $the_commit heads/master &&
	check_push_result testrepo $the_first_commit heads/local

ok 14 - pull --all: fail if no configuration for current branch

expecting success: 
	git checkout -b test copy^ &&
	test_when_finished "git checkout -f copy && git branch -D test" &&
	test_config branch.test.remote . &&
	test_config branch.test.merge refs/heads/nonexisting &&
	test "$(cat file)" = file &&
	test_must_fail git pull 2>err &&
	test_i18ngrep "no such ref was fetched" err &&
	test "$(cat file)" = file

Fetching one
Switched to a new branch 'test'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
From ../parent
 * [new branch]      master     -> mirror
Fetching two
from the remote, but no such ref was fetched.
From ../parent
 + 7dcb71b...fd6fbd6 master     -> origin  (forced update)
From ../
 * [new branch]      master     -> rem/master
 * [new branch]      one        -> rem/one
 * [new branch]      two        -> rem/two
 * [new branch]      three      -> rem/three
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
Switched to branch 'copy'
 * [new tag]         tag-one-tree -> tag-one-tree
Your branch and 'master' have diverged,
and have 1 and 1 different commit each, respectively.
  (use "git pull" to merge the remote branch into yours)
Already up-to-date.
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
ok 10 - git pull --force

expecting success: 
	mkdir clonedmulti &&
	(cd clonedmulti && git init &&
	cat >>.git/config <<-\EOF &&
	[remote "one"]
		url = ../parent
		fetch = refs/heads/*:refs/remotes/one/*
	[remote "two"]
		url = ../parent
		fetch = refs/heads/*:refs/remotes/two/*
	[branch "master"]
		remote = one
		merge = refs/heads/master
	EOF
	git pull --all
	)

To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> local
 * [new tag]         tag-two    -> tag-two
Deleted branch test (was ef93587).
ok 15 - fail if upstream branch does not exist

expecting success: 
	git checkout -b third second^ &&
	test_when_finished "git checkout -f copy && git branch -D third" &&
	test "$(cat file)" = file &&
	test_commit modified2 file &&
	test -z "$(git ls-files -u)" &&
	test_must_fail git pull . second &&
	test -n "$(git ls-files -u)" &&
	cp file expected &&
	test_must_fail git pull . second 2>err &&
	test_i18ngrep "Pull is not possible because you have unmerged files" err &&
	test_cmp expected file &&
	git add file &&
	test -z "$(git ls-files -u)" &&
	test_must_fail git pull . second 2>err &&
	test_i18ngrep "You have not concluded your merge" err &&
	test_cmp expected file

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5521-pull-options/clonedmulti/.git/
notice: HEAD points to an unborn branch (master)
Switched to a new branch 'third'
Fetching one
ok 39 - master config-explicit

Already on 'master'
expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
[third 0c2eeb1] modified2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to branch 'local'
HEAD is now at b9c09d6 repo
From ../parent
 * [new branch]      master     -> one/master
Fetching two
From .
 * branch            second     -> FETCH_HEAD
From ../parent
 * [new branch]      master     -> two/master
Merging:
0c2eeb1 modified2
virtual 73b69f5771e49ab0dbc2bf47e640c7c42a209421
found 1 common ancestor:
ef93587 original
Auto-merging file
CONFLICT (content): Merge conflict in file
Automatic merge failed; fix conflicts and then commit the result.
ok 11 - git pull --all

expecting success: 
	test_when_finished "rm -rf clonedry" &&
	git init clonedry &&
	(
		cd clonedry &&
		git pull --dry-run ../parent &&
		test_path_is_missing .git/FETCH_HEAD &&
		test_path_is_missing .git/refs/heads/master &&
		test_path_is_missing .git/index &&
		test_path_is_missing file
	)

error: Pull is not possible because you have unmerged files.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5521-pull-options/clonedry/.git/
To testrepo
 * [new branch]      HEAD -> master
error: You have not concluded your merge (MERGE_HEAD exists).
From ../
 * [new branch]      master     -> rem/master
 * [new branch]      one        -> rem/one
 * [new branch]      three      -> rem/three
 * [new branch]      two        -> rem/two
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
Switched to branch 'copy'
Your branch and 'master' have diverged,
and have 1 and 1 different commit each, respectively.
  (use "git pull" to merge the remote branch into yours)
Deleted branch third (was 0c2eeb1).
ok 16 - fail if the index has unresolved entries

expecting success: 
	git checkout -b third second^ &&
	test_when_finished "git checkout -f copy && git branch -D third" &&
	test "$(cat file)" = file &&
	git pull . second:third 2>err &&
	test_i18ngrep "fetch updated the current branch head" err &&
	test "$(cat file)" = modified &&
	test "$(git rev-parse third)" = "$(git rev-parse second)"

From ../parent
 * branch            HEAD       -> FETCH_HEAD
ok 40 - master config-glob

Switched to a new branch 'third'
expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
ok 34 - push with config remote.*.push = HEAD

expecting success: 
	mk_test up_repo heads/master &&
	mk_test down_repo heads/master &&
	test_config remote.up.url up_repo &&
	test_config remote.down.url down_repo &&
	test_config branch.master.remote up &&
	test_config remote.pushdefault down &&
	test_config push.default matching &&
	git push &&
	check_push_result up_repo $the_first_commit heads/master &&
	check_push_result down_repo $the_commit heads/master

ok 12 - git pull --dry-run

expecting success: 
	test_when_finished "rm -rf cloneddry" &&
	git init clonedry &&
	(
		cd clonedry &&
		git remote add origin ../parent &&
		git pull --all --dry-run &&
		test_path_is_missing .git/FETCH_HEAD &&
		test_path_is_missing .git/refs/remotes/origin/master &&
		test_path_is_missing .git/index &&
		test_path_is_missing file
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5521-pull-options/clonedry/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/up_repo/.git/
Fetching origin
Already up-to-date.
warning: fetch updated the current branch head.
remote: warning: updating the current branch        
To up_repo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
Switched to branch 'copy'
Your branch and 'master' have diverged,
From ../parent
and have 1 and 1 different commit each, respectively.
 * [new branch]      master     -> origin/master
  (use "git pull" to merge the remote branch into yours)
Deleted branch third (was 73b69f5).
ok 17 - fast-forwards working tree if branch head is updated

expecting success: 
	git checkout -b third second^ &&
	test_when_finished "git checkout -f copy && git branch -D third" &&
	test "$(cat file)" = file &&
	echo conflict >file &&
	test_must_fail git pull . second:third 2>err &&
	test_i18ngrep "Cannot fast-forward your working tree" err &&
	test "$(cat file)" = conflict &&
	test "$(git rev-parse third)" = "$(git rev-parse second)"

ok 13 - git pull --all --dry-run

# passed all 13 test(s)
1..13
Switched to a new branch 'third'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/down_repo/.git/
From ../
 * [new branch]      master     -> rem/master
 * [new branch]      one        -> rem/one
 * [new branch]      two        -> rem/two
 * [new branch]      three      -> rem/three
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
fatal: Cannot fast-forward your working tree.
remote: warning: updating the current branch        
ok 41 - master remote-explicit

To down_repo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
Switched to branch 'copy'
expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
Your branch and 'master' have diverged,
and have 1 and 1 different commit each, respectively.
  (use "git pull" to merge the remote branch into yours)
Deleted branch third (was 73b69f5).
ok 18 - fast-forward fails with conflicting work tree

expecting success: 
	git branch to-rebase &&
	echo modified again > file &&
	git commit -m file file &&
	git checkout to-rebase &&
	echo new > file2 &&
	git add file2 &&
	git commit -m "new file" &&
	git tag before-rebase &&
	git pull --rebase . copy &&
	test "$(git rev-parse HEAD^)" = "$(git rev-parse copy)" &&
	test new = "$(git show HEAD:file2)"

*** t5522-pull-symlink.sh ***
[copy 6d7007e] file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to branch 'to-rebase'
[to-rebase 13c91a5] new file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file2
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5522-pull-symlink/.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

)
prerequisite SYMLINKS ok
expecting success: 
	mkdir subdir &&
	echo file >subdir/file &&
	git add subdir/file &&
	git commit -q -m file &&
	git clone -q . clone-repo &&
	ln -s clone-repo/subdir/ subdir-link &&
	(
		cd clone-repo &&
		git config receive.denyCurrentBranch warn
	) &&
	git config receive.denyCurrentBranch warn

remote: warning: updating the current branch        
To down_repo
   b9c09d6..9ad36e1  master -> master
From .
 * branch            copy       -> FETCH_HEAD
From ../
 * [new branch]      master     -> rem/master
 * [new branch]      one        -> rem/one
 * [new branch]      three      -> rem/three
 * [new branch]      two        -> rem/two
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
ok 42 - master remote-glob

ok 1 - setup

expecting success: 
	(
		echo real >subdir/file &&
		git commit -m real subdir/file &&
		cd clone-repo/subdir/ &&
		git pull &&
		test real = $(cat file)
	)

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
ok 35 - push with remote.pushdefault

expecting success: 

	mk_test testrepo heads/master &&
	git checkout master &&
	test_config remote.there.url test2repo &&
	test_config remote.there.pushurl testrepo &&
	git push there : &&
	check_push_result testrepo $the_commit heads/master

[master 33c49d7] real
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
First, rewinding head to replay your work on top of it...
remote: warning: updating the current branch        
From /«PKGBUILDDIR»/t/trash directory.t5522-pull-symlink/.
   c2c630b..33c49d7  master     -> origin/master
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
Updating c2c630b..33c49d7
Fast-forward
Applying: new file
 subdir/file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 2 - pulling from real subdir

expecting success: 
	(
		echo link >subdir/file &&
		git commit -m link subdir/file &&
		cd subdir-link/ &&
		git pull &&
		test link = $(cat file)
	)

Already on 'master'
From ../
 * [new branch]      master     -> branches-default
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
[master 7c28dc2] link
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
ok 43 - master branches-default

ok 19 - --rebase

expecting success: 
	git reset --hard before-rebase &&
	test_must_fail git pull --rebase . copy master 2>err &&
	test "$(git rev-parse HEAD)" = "$(git rev-parse before-rebase)" &&
	test_i18ngrep "Cannot rebase onto multiple branches" err &&
	test modified = "$(git show HEAD:file)"

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
remote: warning: updating the current branch        
HEAD is now at 13c91a5 new file
To testrepo
   b9c09d6..9ad36e1  master -> master
From /«PKGBUILDDIR»/t/trash directory.t5522-pull-symlink/.
   33c49d7..7c28dc2  master     -> origin/master
Updating 33c49d7..7c28dc2
Fast-forward
 subdir/file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 36 - push with config remote.*.pushurl

expecting success: 
	mk_test up_repo heads/master &&
	mk_test side_repo heads/master &&
	mk_test down_repo heads/master &&
	test_config remote.up.url up_repo &&
	test_config remote.pushdefault side_repo &&
	test_config remote.down.url down_repo &&
	test_config branch.master.remote up &&
	test_config branch.master.pushremote down &&
	test_config push.default matching &&
	git push &&
	check_push_result up_repo $the_first_commit heads/master &&
	check_push_result side_repo $the_first_commit heads/master &&
	check_push_result down_repo $the_commit heads/master

ok 3 - pulling from symlinked subdir

expecting success: 
	(
		cd subdir-link/ &&
		echo push >file &&
		git commit -m push ./file &&
		git push
	) &&
	test push = $(git show HEAD:subdir/file)

[master 4fd59c9] push
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/up_repo/.git/
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

fatal: Cannot rebase onto multiple branches.
ok 20 - --rebase fails with multiple branches

expecting success: 
	test_config rebase.autostash true &&
	git reset --hard before-rebase &&
	echo dirty >new_file &&
	git add new_file &&
	git pull --rebase . copy &&
	test_cmp_rev HEAD^ copy &&
	test "$(cat new_file)" = dirty &&
	test "$(cat file)" = "modified again"

From ../
 * [new branch]      one        -> branches-one
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
HEAD is now at 13c91a5 new file
remote: warning: updating the current branch        
To /«PKGBUILDDIR»/t/trash directory.t5522-pull-symlink/.
   7c28dc2..4fd59c9  master -> master
ok 4 - pushing from symlinked subdir

remote: warning: updating the current branch        
ok 44 - master branches-one

# passed all 4 test(s)
1..4
To up_repo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
From .
 * branch            copy       -> FETCH_HEAD
*** t5523-push-upstream.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/side_repo/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5523-push-upstream/.git/
expecting success: 
	ensure_fresh_upstream &&
	git remote add upstream parent

remote: warning: updating the current branch        
To side_repo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5523-push-upstream/parent/
ok 1 - setup bare parent

expecting success: 
	echo content >file &&
	git add file &&
	git commit -m one

From ../
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
[master (root-commit) bf3cfd6] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 2 - setup local commit

expecting success: 
	git push -u upstream master:master &&
	check_config master upstream refs/heads/master

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/down_repo/.git/
ok 45 - br-unconfig

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
To parent
 * [new branch]      master -> master
remote: warning: updating the current branch        
Branch master set up to track remote branch master from upstream.
To down_repo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
ok 3 - push -u master:master

expecting success: 
	git push -u upstream master:other &&
	check_config master upstream refs/heads/other

To parent
 * [new branch]      master -> other
Branch master set up to track remote branch other from upstream.
From ../
 * [new branch]      master     -> rem/master
 * [new branch]      one        -> rem/one
 * [new branch]      two        -> rem/two
 * [new branch]      three      -> rem/three
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
ok 4 - push -u master:other

expecting success: 
	git push -u --dry-run upstream master:otherX &&
	check_config master upstream refs/heads/other

Created autostash: 979a09b
HEAD is now at 13c91a5 new file
To parent
 * [new branch]      master -> otherX
Would set upstream of 'master' to 'otherX' of 'upstream'
ok 46 - br-unconfig config-explicit

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
remote: warning: updating the current branch        
ok 5 - push -u --dry-run master:otherX

expecting success: 
	git branch master2 &&
	git push -u upstream master2:master2 &&
	check_config master2 upstream refs/heads/master2

To down_repo
   b9c09d6..9ad36e1  master -> master
First, rewinding head to replay your work on top of it...
To parent
 * [new branch]      master2 -> master2
Branch master2 set up to track remote branch master2 from upstream.
Applying: new file
ok 6 - push -u master2:master2

expecting success: 
	git push -u upstream master2:other2 &&
	check_config master2 upstream refs/heads/other2

ok 37 - push with config branch.*.pushremote

expecting success: 
	mk_test one_repo heads/master &&
	mk_test two_repo heads/master &&
	test_config remote.one.url one_repo &&
	test_config remote.two.url two_repo &&
	test_config branch.master.pushremote two_repo &&
	test_config remote.pushdefault one_repo &&
	test_config push.default matching &&
	git push &&
	check_push_result one_repo $the_first_commit heads/master &&
	check_push_result two_repo $the_commit heads/master

To parent
 * [new branch]      master2 -> other2
Branch master2 set up to track remote branch other2 from upstream.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/one_repo/.git/
From ../
 * [new branch]      master     -> rem/master
 * [new branch]      one        -> rem/one
 * [new branch]      three      -> rem/three
 * [new branch]      two        -> rem/two
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
ok 7 - push -u master2:other2

expecting success: 
	git push -u upstream :master2 &&
	check_config master2 upstream refs/heads/other2
 * [new tag]         tag-three  -> tag-three

 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
To parent
 - [deleted]         master2
ok 47 - br-unconfig config-glob

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
remote: warning: updating the current branch        
ok 8 - push -u :master2

expecting success: 
	git branch all1 &&
	git branch all2 &&
	git push -u --all &&
	check_config all1 upstream refs/heads/all1 &&
	check_config all2 upstream refs/heads/all2

To one_repo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/two_repo/.git/
Applied autostash.
To parent
 * [new branch]      all1 -> all1
 * [new branch]      all2 -> all2
 * [new branch]      master2 -> master2
Branch master set up to track remote branch master from upstream.
Branch all1 set up to track remote branch all1 from upstream.
Branch all2 set up to track remote branch all2 from upstream.
Branch master2 set up to track remote branch master2 from upstream.
ok 21 - pull --rebase succeeds with dirty working directory and rebase.autostash set

expecting success: 
	git reset --hard before-rebase &&
	test_config pull.rebase true &&
	git pull . copy &&
	test "$(git rev-parse HEAD^)" = "$(git rev-parse copy)" &&
	test new = "$(git show HEAD:file2)"

remote: warning: updating the current branch        
To two_repo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
HEAD is now at 13c91a5 new file
ok 9 - push -u --all

expecting success: 
	git checkout -b headbranch &&
	git push -u upstream HEAD &&
	check_config headbranch upstream refs/heads/headbranch

Switched to a new branch 'headbranch'
From ../
 * [new branch]      master     -> rem/master
 * [new branch]      one        -> rem/one
 * [new branch]      two        -> rem/two
 * [new branch]      three      -> rem/three
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
From .
 * branch            copy       -> FETCH_HEAD
ok 48 - br-unconfig remote-explicit

To parent
 * [new branch]      HEAD -> headbranch
Branch headbranch set up to track remote branch headbranch from upstream.
expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
ok 10 - push -u HEAD

checking prerequisite: TTY

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	test_have_prereq PERL &&

	# Reading from the pty master seems to get stuck _sometimes_
	# on Mac OS X 10.5.0, using Perl 5.10.0 or 5.8.9.
	#
	# Reproduction recipe: run
	#
	#	i=0
	#	while ./test-terminal.perl echo hi $i
	#	do
	#		: $((i = $i + 1))
	#	done
	#
	# After 2000 iterations or so it hangs.
	# https://rt.cpan.org/Ticket/Display.html?id=65692
	#
	test "$(uname -s)" != Darwin &&

	perl "$TEST_DIRECTORY"/test-terminal.perl \
		sh -c "test -t 1 && test -t 2"

)
remote: warning: updating the current branch        
To two_repo
   b9c09d6..9ad36e1  master -> master
First, rewinding head to replay your work on top of it...
ok 38 - branch.*.pushremote config order is irrelevant

expecting success: 

	mk_test testrepo heads/master &&
	(
		cd testrepo &&
		old_commit=$(git show-ref -s --verify refs/heads/master)
	) &&
	git push --dry-run testrepo : &&
	check_push_result testrepo $old_commit heads/master

From ../
 * [new branch]      master     -> rem/master
 * [new branch]      one        -> rem/one
 * [new branch]      three      -> rem/three
 * [new branch]      two        -> rem/two
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
Applying: new file
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
ok 49 - br-unconfig remote-glob

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
remote: warning: updating the current branch        
died of signal 15 at /«PKGBUILDDIR»/t/test-terminal.perl line 35.
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
prerequisite TTY ok
expecting success: 
	ensure_fresh_upstream &&

	test_terminal git push -u upstream master >out 2>err &&
	grep "Writing objects" err

ok 22 - pull.rebase

expecting success: 
	git reset --hard before-rebase &&
	test_config branch.to-rebase.rebase true &&
	git pull . copy &&
	test "$(git rev-parse HEAD^)" = "$(git rev-parse copy)" &&
	test new = "$(git show HEAD:file2)"

HEAD is now at 13c91a5 new file
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5523-push-upstream/parent/
To testrepo
   b9c09d6..9ad36e1  master -> master
ok 39 - push with dry-run

expecting success: 

	mk_test testrepo heads/master &&
	mk_child testrepo child &&
	(
		cd child &&
		git pull .. master &&
		git push &&
		test $(git rev-parse master) = \
			$(git rev-parse remotes/origin/master)
	)


From .
 * branch            copy       -> FETCH_HEAD
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
From ../
 * [new branch]      master     -> branches-default
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
remote: warning: updating the current branch        
ok 50 - br-unconfig branches-default

To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
Cloning into 'child'...
done.
First, rewinding head to replay your work on top of it...
Applying: new file
From ../
 * [new branch]      one        -> branches-one
From ..
 * branch            master     -> FETCH_HEAD
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
Writing objects:  33% (1/3)   
Writing objects:  66% (2/3)   
Writing objects: 100% (3/3)   
Writing objects: 100% (3/3), 219 bytes | 0 bytes/s, done.
ok 11 - progress messages go to tty

expecting success: 
	ensure_fresh_upstream &&

	# skip progress messages, since stderr is non-tty
	git push -u upstream master >out 2>err &&
	! grep "Writing objects" err

 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
Updating b9c09d6..9ad36e1
Fast-forward
 path2 | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 path2
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5523-push-upstream/parent/
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

ok 51 - br-unconfig branches-one

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
ok 23 - branch.to-rebase.rebase

expecting success: 
	git reset --hard before-rebase &&
	test_config pull.rebase true &&
	test_config branch.to-rebase.rebase false &&
	git pull . copy &&
	test "$(git rev-parse HEAD^)" != "$(git rev-parse copy)" &&
	test new = "$(git show HEAD:file2)"

HEAD is now at 13c91a5 new file
remote: warning: updating the current branch        
To /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo
   b9c09d6..9ad36e1  master -> master
ok 12 - progress messages do not go to non-tty

expecting success: 
	ensure_fresh_upstream &&

	# force progress messages to stderr, even though it is non-tty
	git push -u --progress upstream master >out 2>err &&
	grep "Writing objects" err

ok 40 - push updates local refs

expecting success: 

	mk_test testrepo heads/master &&
	mk_child testrepo child1 &&
	mk_child testrepo child2 &&
	(cd child1 && git pull .. master && git push) &&
	(
		cd child2 &&
		git pull ../child1 master &&
		git push &&
		test $(git rev-parse master) = \
			$(git rev-parse remotes/origin/master)
	)


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5523-push-upstream/parent/
From .
 * branch            copy       -> FETCH_HEAD
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
Merging:
13c91a5 new file
virtual 6d7007e01d554c39852974f760e0115e8613cf19
found 1 common ancestor:
73b69f5 modified
Merge made by the 'recursive' strategy.
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
From ../
 * branch            HEAD       -> FETCH_HEAD
Writing objects:  33% (1/3)   
Writing objects:  66% (2/3)   
Writing objects: 100% (3/3)   
Writing objects: 100% (3/3), 219 bytes | 0 bytes/s, done.
ok 13 - progress messages go to non-tty (forced)

expecting success: 
	ensure_fresh_upstream &&

	test_terminal git push -u -q upstream master >out 2>err &&
	! grep "Writing objects" err

ok 52 - master ../.git

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
remote: warning: updating the current branch        
ok 24 - branch.to-rebase.rebase should override pull.rebase

expecting success: 
	git reset --hard before-rebase &&
	git checkout -b keep-merge second^ &&
	test_commit file3 &&
	git checkout to-rebase &&
	git merge keep-merge &&
	git tag before-preserve-rebase

To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5523-push-upstream/parent/
HEAD is now at 13c91a5 new file
Switched to a new branch 'keep-merge'
Cloning into 'child1'...
[keep-merge 07c0b44] file3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file3.t
done.
From ../
 * branch            one        -> FETCH_HEAD
Switched to branch 'to-rebase'
Cloning into 'child2'...
Merging:
13c91a5 new file
virtual keep-merge
found 1 common ancestor:
ef93587 original
Merge made by the 'recursive' strategy.
ok 53 - master ../.git one

 file3.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 file3.t
expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
done.
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
ok 25 - preserve merge setup

expecting success: 
	git reset --hard before-preserve-rebase &&
	test_config pull.rebase false &&
	git pull . copy &&
	test "$(git rev-parse HEAD^1)" = "$(git rev-parse before-preserve-rebase)" &&
	test "$(git rev-parse HEAD^2)" = "$(git rev-parse copy)" &&
	test file3 = "$(git show HEAD:file3.t)"

HEAD is now at bd5beb6 Merge branch 'keep-merge' into to-rebase
From ../
 * branch            one        -> FETCH_HEAD
 * branch            two        -> FETCH_HEAD
From ..
 * branch            master     -> FETCH_HEAD
From .
 * branch            copy       -> FETCH_HEAD
Updating b9c09d6..9ad36e1
Fast-forward
 path2 | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 path2
ok 54 - master ../.git one two

warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
Merging:
bd5beb6 Merge branch 'keep-merge' into to-rebase
virtual 6d7007e01d554c39852974f760e0115e8613cf19
found 1 common ancestor:
73b69f5 modified
Merge made by the 'recursive' strategy.
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
remote: warning: updating the current branch        
To /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo
   b9c09d6..9ad36e1  master -> master
From ../
 * branch            HEAD       -> FETCH_HEAD
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
ok 26 - pull.rebase=false create a new merge commit

expecting success: 
	git reset --hard before-preserve-rebase &&
	test_config pull.rebase true &&
	git pull . copy &&
	test "$(git rev-parse HEAD^^)" = "$(git rev-parse copy)" &&
	test file3 = "$(git show HEAD:file3.t)"

ok 14 - push -q suppresses progress

expecting success: 
	ensure_fresh_upstream &&

	test_terminal git push -u --no-progress upstream master >out 2>err &&
	! grep "Unpacking objects" err &&
	! grep "Writing objects" err

HEAD is now at bd5beb6 Merge branch 'keep-merge' into to-rebase
ok 55 - master --tags ../.git

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5523-push-upstream/parent/
From ../child1
 * branch            master     -> FETCH_HEAD
Updating b9c09d6..9ad36e1
Fast-forward
 path2 | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 path2
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

From .
 * branch            copy       -> FETCH_HEAD
Everything up-to-date
ok 41 - push updates up-to-date local refs

expecting success: 

	mk_test testrepo heads/master &&
	mk_child testrepo child &&
	(
		cd child &&
		git push &&
		! test -f .git/refs/remotes/origin/master
	)


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
From ../
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
ok 56 - master ../.git tag tag-one tag tag-three

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
remote: warning: updating the current branch        
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
First, rewinding head to replay your work on top of it...
Cloning into 'child'...
Applying: new file
done.
Applying: file3
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

Everything up-to-date
ok 42 - push preserves up-to-date packed refs

expecting success: 

	mk_test testrepo heads/master &&
	mk_child testrepo child &&
	mkdir testrepo/.git/hooks &&
	echo "#!/no/frobnication/today" >testrepo/.git/hooks/pre-receive &&
	chmod +x testrepo/.git/hooks/pre-receive &&
	(
		cd child &&
		git pull .. master
		test_must_fail git push &&
		test $(git rev-parse master) != \
			$(git rev-parse remotes/origin/master)
	)


ok 15 - push --no-progress suppresses progress

From ../
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-master -> tag-master
expecting success: 
	ensure_fresh_upstream &&

	test_terminal git push --quiet --no-progress upstream master 2>&1 | tee output &&
	test_cmp /dev/null output

 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-two    -> tag-two
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5523-push-upstream/parent/
ok 57 - master ../.git tag tag-one-tree tag tag-three-file

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
ok 27 - pull.rebase=true flattens keep-merge

expecting success: 
	git reset --hard before-preserve-rebase &&
	test_config pull.rebase 1 &&
	git pull . copy &&
	test "$(git rev-parse HEAD^^)" = "$(git rev-parse copy)" &&
	test file3 = "$(git show HEAD:file3.t)"

remote: warning: updating the current branch        
HEAD is now at bd5beb6 Merge branch 'keep-merge' into to-rebase
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
Cloning into 'child'...
done.
From .
 * branch            copy       -> FETCH_HEAD
From ../
 * branch            one        -> FETCH_HEAD
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-two    -> tag-two
ok 58 - master ../.git one tag tag-one tag tag-three-file

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
From ..
 * branch            master     -> FETCH_HEAD
Updating b9c09d6..9ad36e1
Fast-forward
 path2 | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 path2
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

First, rewinding head to replay your work on top of it...
ok 16 - quiet push

remote: error: cannot run hooks/pre-receive: No such file or directory        
# passed all 16 test(s)
1..16
To /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '/«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo'
ok 43 - push does not update local refs on failure

expecting success: 

	mk_test testrepo heads/master &&
	rm -f testrepo/.git/objects/??/* &&
	git push testrepo :refs/heads/master &&
	(cd testrepo && test_must_fail git rev-parse --verify refs/heads/master)


From ../
 * branch            HEAD       -> FETCH_HEAD
*** t5524-pull-msg.sh ***
Applying: new file
Applying: file3
ok 59 - br-unconfig ../.git

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5524-pull-msg/.git/
expecting success: 
	test_commit initial afile original &&
	git clone . cloned &&
	(
		cd cloned &&
		echo added >bfile &&
		git add bfile &&
		test_tick &&
		git commit -m "add bfile"
	) &&
	test_tick && test_tick &&
	echo "second" >afile &&
	git add afile &&
	git commit -m "second commit" &&
	echo "original $dollar" >afile &&
	git add afile &&
	git commit -m "do not clobber $dollar signs"

remote: warning: updating the current branch        
[master (root-commit) f176df3] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 afile
From ../
 * branch            one        -> FETCH_HEAD
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
Cloning into 'cloned'...
ok 28 - pull.rebase=1 is treated as true and flattens keep-merge

expecting success: 
	git reset --hard before-preserve-rebase &&
	test_config pull.rebase preserve &&
	git pull . copy &&
	test "$(git rev-parse HEAD^^)" = "$(git rev-parse copy)" &&
	test "$(git rev-parse HEAD^2)" = "$(git rev-parse keep-merge)"

ok 60 - br-unconfig ../.git one

HEAD is now at bd5beb6 Merge branch 'keep-merge' into to-rebase
done.
expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
error: refs/heads/master does not point to a valid object!
remote: warning: updating the current branch        
remote: warning: Allowing deletion of corrupt ref.        
To testrepo
 - [deleted]         master
[master 1facbb5] add bfile
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bfile
fatal: Needed a single revision
ok 44 - allow deleting an invalid remote ref

expecting success: 
	mk_test_with_hooks testrepo heads/master heads/next &&
	orgmaster=$(cd testrepo && git show-ref -s --verify refs/heads/master) &&
	newmaster=$(git show-ref -s --verify refs/heads/master) &&
	orgnext=$(cd testrepo && git show-ref -s --verify refs/heads/next) &&
	newnext=$_z40 &&
	git push testrepo refs/heads/master:refs/heads/master :refs/heads/next &&
	(
		cd testrepo/.git &&
		cat >pre-receive.expect <<-EOF &&
		$orgmaster $newmaster refs/heads/master
		$orgnext $newnext refs/heads/next
		EOF

		cat >update.expect <<-EOF &&
		refs/heads/master $orgmaster $newmaster
		refs/heads/next $orgnext $newnext
		EOF

		cat >post-receive.expect <<-EOF &&
		$orgmaster $newmaster refs/heads/master
		$orgnext $newnext refs/heads/next
		EOF

		cat >post-update.expect <<-EOF &&
		refs/heads/master
		refs/heads/next
		EOF

		test_cmp pre-receive.expect pre-receive.actual &&
		test_cmp update.expect update.actual &&
		test_cmp post-receive.expect post-receive.actual &&
		test_cmp post-update.expect post-update.actual
	)

From .
 * branch            copy       -> FETCH_HEAD
[master 4db85b7] second commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
From ../
 * branch            one        -> FETCH_HEAD
 * branch            two        -> FETCH_HEAD
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
[master 8393f95] do not clobber $Dollar signs
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - setup

expecting success: 
(
	cd cloned &&
	git pull --log &&
	git log -2 &&
	git cat-file commit HEAD >result &&
	grep Dollar result
)

ok 61 - br-unconfig ../.git one two

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
remote: warning: updating the current branch        
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
From /«PKGBUILDDIR»/t/trash directory.t5524-pull-msg/.
   f176df3..8393f95  master     -> origin/master
From ../
 * branch            HEAD       -> FETCH_HEAD
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
Merging:
1facbb5 add bfile
virtual 8393f95971e86cb10f5e23411fa764a2751859f1
found 1 common ancestor:
f176df3 initial
Merge made by the 'recursive' strategy.
 afile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> next
commit 86c8289f8a189f9a4acdc80291cd2fa0d2a6ccbe
Merge: 1facbb5 8393f95
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:15:13 2005 -0700

    Merge branch 'master' of /«PKGBUILDDIR»/t/trash directory.t5524-pull-msg/.
    
    * 'master' of /«PKGBUILDDIR»/t/trash directory.t5524-pull-msg/.:
      do not clobber $Dollar signs
      second commit

commit 8393f95971e86cb10f5e23411fa764a2751859f1
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:15:13 2005 -0700

    do not clobber $Dollar signs
ok 62 - br-unconfig --tags ../.git

  do not clobber $Dollar signs
ok 2 - pull

expecting success: 
(
	cd cloned &&
	git reset --hard HEAD^ &&
	test "$(cat afile)" = original &&
	test "$(cat bfile)" = added &&
	git pull --log=1 &&
	git log -3 &&
	git cat-file commit HEAD >result &&
	grep Dollar result &&
	! grep "second commit" result
)

expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
HEAD is now at 1facbb5 add bfile
Merging:
1facbb5 add bfile
virtual 8393f95971e86cb10f5e23411fa764a2751859f1
found 1 common ancestor:
f176df3 initial
Merge made by the 'recursive' strategy.
 afile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
commit e62720f80cd7baf53df556b350ec4ae4e7c81e0e
Merge: 1facbb5 8393f95
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:15:13 2005 -0700

    Merge branch 'master' of /«PKGBUILDDIR»/t/trash directory.t5524-pull-msg/.
    
    * 'master' of /«PKGBUILDDIR»/t/trash directory.t5524-pull-msg/.: (2 commits)
      do not clobber $Dollar signs
      ...

commit 8393f95971e86cb10f5e23411fa764a2751859f1
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:15:13 2005 -0700

    do not clobber $Dollar signs

commit 4db85b7332a1f2dd47ed83e51fbde7f24b2baa43
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:15:13 2005 -0700

    second commit
  do not clobber $Dollar signs
remote: warning: updating the current branch        
ok 3 - --log=1 limits shortlog length

From ../
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-three  -> tag-three
# passed all 3 test(s)
1..3
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-two    -> tag-two
To testrepo
   b9c09d6..9ad36e1  master -> master
 - [deleted]         next
ok 63 - br-unconfig ../.git tag tag-one tag tag-three

*** t5525-fetch-tagopt.sh ***
expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
ok 45 - pushing valid refs triggers post-receive and post-update hooks

expecting success: 
	mk_test_with_hooks testrepo heads/master &&
	rm -f testrepo/.git/objects/??/* &&
	git push testrepo :refs/heads/master &&
	(
		cd testrepo/.git &&
		cat >pre-receive.expect <<-EOF &&
		$_z40 $_z40 refs/heads/master
		EOF

		cat >update.expect <<-EOF &&
		refs/heads/master $_z40 $_z40
		EOF

		cat >post-receive.expect <<-EOF &&
		$_z40 $_z40 refs/heads/master
		EOF

		cat >post-update.expect <<-EOF &&
		refs/heads/master
		EOF

		test_cmp pre-receive.expect pre-receive.actual &&
		test_cmp update.expect update.actual &&
		test_cmp post-receive.expect post-receive.actual &&
		test_cmp post-update.expect post-update.actual
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5525-fetch-tagopt/.git/
expecting success: 
	test_commit test &&
	setup_clone one &&
	git config remote.remote_one.tagopt --no-tags &&
	setup_clone two &&
	git config remote.remote_two.tagopt --tags
	
[master (root-commit) 14f901a] test
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 test.t
remote: warning: updating the current branch        
Cloning into bare repository 'one'...
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
From ../
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-two    -> tag-two
done.
ok 64 - br-unconfig ../.git tag tag-one-tree tag tag-three-file

Branch branch_one set up to track remote branch master from origin.
expecting success: 
		{
			echo "# $cmd"
			set x $cmd; shift
			git symbolic-ref HEAD refs/heads/$1 ; shift
			rm -f .git/FETCH_HEAD
			git for-each-ref \
				refs/heads refs/remotes/rem refs/tags |
			while read val type refname
			do
				git update-ref -d "$refname" "$val"
			done
			git fetch "$@" >/dev/null
			cat .git/FETCH_HEAD
		} >"$actual_f" &&
		git show-ref >"$actual_r" &&
		if test -f "$expect_f"
		then
			test_cmp "$expect_f" "$actual_f" &&
			rm -f "$actual_f"
		else
			# this is to help developing new tests.
			cp "$actual_f" "$expect_f"
			false
		fi &&
		if test -f "$expect_r"
		then
			test_cmp "$expect_r" "$actual_r" &&
			rm -f "$actual_r"
		else
			# this is to help developing new tests.
			cp "$actual_r" "$expect_r"
			false
		fi
	
Cloning into bare repository 'two'...
error: refs/heads/master does not point to a valid object!
remote: warning: updating the current branch        
remote: warning: Allowing deletion of corrupt ref.        
done.
To testrepo
 - [deleted]         master
Rebasing (1/2)
Branch branch_two set up to track remote branch master from origin.
ok 46 - deleting dangling ref triggers hooks with correct args

expecting success: 
	mk_test_with_hooks testrepo heads/master &&
	orgmaster=$(cd testrepo && git show-ref -s --verify refs/heads/master) &&
	newmaster=$(git show-ref -s --verify refs/heads/master) &&
	git push testrepo master :refs/heads/nonexistent &&
	(
		cd testrepo/.git &&
		cat >pre-receive.expect <<-EOF &&
		$orgmaster $newmaster refs/heads/master
		$_z40 $_z40 refs/heads/nonexistent
		EOF

		cat >update.expect <<-EOF &&
		refs/heads/master $orgmaster $newmaster
		refs/heads/nonexistent $_z40 $_z40
		EOF

		cat >post-receive.expect <<-EOF &&
		$orgmaster $newmaster refs/heads/master
		EOF

		cat >post-update.expect <<-EOF &&
		refs/heads/master
		EOF

		test_cmp pre-receive.expect pre-receive.actual &&
		test_cmp update.expect update.actual &&
		test_cmp post-receive.expect post-receive.actual &&
		test_cmp post-update.expect post-update.actual
	)

ok 1 - setup

expecting success: 
	git fetch remote_one &&
	test_must_fail git show-ref tag_one &&
	git show-ref remote_one/branch_one
	
From one
 * [new branch]      branch_one -> remote_one/branch_one
 * [new branch]      master     -> remote_one/master
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
From ../
 * branch            one        -> FETCH_HEAD
 * [new tag]         tag-one    -> tag-one
 * [new tag]         tag-three-file -> tag-three-file
 * [new tag]         tag-master -> tag-master
 * [new tag]         tag-one-tree -> tag-one-tree
 * [new tag]         tag-three  -> tag-three
 * [new tag]         tag-two    -> tag-two
14f901a95ebae912feb4805f40ef68f15b0192c2 refs/remotes/remote_one/branch_one
ok 2 - fetch with tagopt=--no-tags does not get tag

expecting success: 
	(
		cd one &&
		git branch second_branch_one
	) &&
	git fetch --tags remote_one &&
	git show-ref tag_one &&
	git show-ref remote_one/second_branch_one
	
ok 65 - br-unconfig ../.git one tag tag-one tag tag-three-file

Branch second_branch_one set up to track remote branch master from origin.
Rebasing (2/2)
# passed all 65 test(s)
1..65
remote: warning: updating the current branch        
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
From one
 * [new branch]      second_branch_one -> remote_one/second_branch_one
 * [new tag]         tag_one    -> tag_one
*** t5526-fetch-submodules.sh ***
14f901a95ebae912feb4805f40ef68f15b0192c2 refs/tags/tag_one
14f901a95ebae912feb4805f40ef68f15b0192c2 refs/remotes/remote_one/second_branch_one
ok 3 - fetch --tags with tagopt=--no-tags gets tag

expecting success: 
	git fetch --no-tags remote_two &&
	test_must_fail git show-ref tag_two &&
	git show-ref remote_two/branch_two
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5526-fetch-submodules/.git/
From two
 * [new branch]      branch_two -> remote_two/branch_two
expecting success: 
	mkdir deepsubmodule &&
	(
		cd deepsubmodule &&
		git init &&
		echo deepsubcontent > deepsubfile &&
		git add deepsubfile &&
		git commit -m new deepsubfile
	) &&
	mkdir submodule &&
	(
		cd submodule &&
		git init &&
		echo subcontent > subfile &&
		git add subfile &&
		git submodule add "$pwd/deepsubmodule" subdir/deepsubmodule &&
		git commit -a -m new
	) &&
	git submodule add "$pwd/submodule" submodule &&
	git commit -am initial &&
	git clone . downstream &&
	(
		cd downstream &&
		git submodule update --init --recursive
	) &&
	echo "Fetching submodule submodule" > expect.out &&
	echo "Fetching submodule submodule/subdir/deepsubmodule" >> expect.out

 * [new branch]      master     -> remote_two/master
14f901a95ebae912feb4805f40ef68f15b0192c2 refs/remotes/remote_two/branch_two
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5526-fetch-submodules/deepsubmodule/.git/
ok 4 - fetch --no-tags with tagopt=--tags does not get tag

expecting success: 
	(
		cd two &&
		git branch second_branch_two
	) &&
	git fetch remote_two &&
	git show-ref tag_two &&
	git show-ref remote_two/second_branch_two
	
Branch second_branch_two set up to track remote branch master from origin.
remote: warning: updating the current branch        
remote: warning: Deleting a non-existent ref.        
[master (root-commit) 59a192f] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 deepsubfile
To testrepo
   b9c09d6..9ad36e1  master -> master
 - [deleted]         nonexistent
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5526-fetch-submodules/submodule/.git/
From two
 * [new branch]      second_branch_two -> remote_two/second_branch_two
 * [new tag]         tag_two    -> tag_two
ok 47 - deletion of a non-existent ref is not fed to post-receive and post-update hooks

expecting success: 
	mk_test_with_hooks testrepo heads/master &&
	git push testrepo :refs/heads/nonexistent &&
	(
		cd testrepo/.git &&
		cat >pre-receive.expect <<-EOF &&
		$_z40 $_z40 refs/heads/nonexistent
		EOF

		cat >update.expect <<-EOF &&
		refs/heads/nonexistent $_z40 $_z40
		EOF

		test_cmp pre-receive.expect pre-receive.actual &&
		test_cmp update.expect update.actual &&
		test_path_is_missing post-receive.actual &&
		test_path_is_missing post-update.actual
	)

14f901a95ebae912feb4805f40ef68f15b0192c2 refs/tags/tag_two
14f901a95ebae912feb4805f40ef68f15b0192c2 refs/remotes/remote_two/second_branch_two
ok 5 - fetch with tagopt=--tags gets tag

# passed all 5 test(s)
1..5
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
*** t5527-fetch-odd-refs.sh ***
Cloning into 'subdir/deepsubmodule'...
remote: warning: updating the current branch        
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5527-fetch-odd-refs/.git/
expecting success: 
	echo content >file &&
	git add . &&
	git commit -m one &&
	git update-ref refs/for/refs/heads/master HEAD &&
	echo content >>file &&
	git commit -a -m two &&
	echo content >>file &&
	git commit -a -m three &&
	git checkout HEAD^

[master (root-commit) d24aa62] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
remote: warning: Deleting a non-existent ref.        
To testrepo
 - [deleted]         nonexistent
[master 730ff2f] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 48 - deletion of a non-existent ref alone does trigger post-receive and post-update hooks

expecting success: 
	mk_test_with_hooks testrepo heads/master heads/next heads/pu &&
	orgmaster=$(cd testrepo && git show-ref -s --verify refs/heads/master) &&
	newmaster=$(git show-ref -s --verify refs/heads/master) &&
	orgnext=$(cd testrepo && git show-ref -s --verify refs/heads/next) &&
	newnext=$_z40 &&
	orgpu=$(cd testrepo && git show-ref -s --verify refs/heads/pu) &&
	newpu=$(git show-ref -s --verify refs/heads/master) &&
	git push testrepo refs/heads/master:refs/heads/master \
	    refs/heads/master:refs/heads/pu :refs/heads/next \
	    :refs/heads/nonexistent &&
	(
		cd testrepo/.git &&
		cat >pre-receive.expect <<-EOF &&
		$orgmaster $newmaster refs/heads/master
		$orgnext $newnext refs/heads/next
		$orgpu $newpu refs/heads/pu
		$_z40 $_z40 refs/heads/nonexistent
		EOF

		cat >update.expect <<-EOF &&
		refs/heads/master $orgmaster $newmaster
		refs/heads/next $orgnext $newnext
		refs/heads/pu $orgpu $newpu
		refs/heads/nonexistent $_z40 $_z40
		EOF

		cat >post-receive.expect <<-EOF &&
		$orgmaster $newmaster refs/heads/master
		$orgnext $newnext refs/heads/next
		$orgpu $newpu refs/heads/pu
		EOF

		cat >post-update.expect <<-EOF &&
		refs/heads/master
		refs/heads/next
		refs/heads/pu
		EOF

		test_cmp pre-receive.expect pre-receive.actual &&
		test_cmp update.expect update.actual &&
		test_cmp post-receive.expect post-receive.actual &&
		test_cmp post-update.expect post-update.actual
	)

[master b617376] three
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
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 730ff2f... two
ok 1 - setup repo with odd suffix ref

expecting success: 
	git clone --bare file://"$PWD" suffix &&
	echo three >expect &&
	git --git-dir=suffix log -1 --format=%s refs/heads/master >actual &&
	test_cmp expect actual

Cloning into bare repository 'suffix'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
[master (root-commit) b7ebd72] new
 Author: A U Thor <author@example.com>
 3 files changed, 5 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 subdir/deepsubmodule
 create mode 100644 subfile
remote: warning: updating the current branch        
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
Adding existing repo at 'submodule' to the index
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> next
ok 2 - suffix ref is ignored during fetch

expecting success: 
	ref240=$_z40/$_z40/$_z40/$_z40/$_z40/$_z40 &&
	ref1440=$ref240/$ref240/$ref240/$ref240/$ref240/$ref240 &&
	git init long &&
	(
		cd long &&
		test_commit long &&
		test_commit master
	) &&
	if git -C long update-ref refs/heads/$ref1440 long; then
		test_set_prereq LONG_REF
	else
		echo >&2 "long refs not supported"
	fi

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5527-fetch-odd-refs/long/.git/
[master (root-commit) 0411bac] initial
 Author: A U Thor <author@example.com>
 2 files changed, 4 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 submodule
Cloning into 'downstream'...
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> pu
[master (root-commit) 92be28b] long
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 long.t
done.
[master f3bdd7b] master
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 master.t
ok 3 - try to create repo with absurdly long refname

expecting success: 
	git fetch long refs/heads/*:refs/remotes/long/* &&
	cat >expect <<-\EOF &&
	long
	master
	EOF
	git for-each-ref --format="%(subject)" refs/remotes/long >actual &&
	test_cmp expect actual

warning: no common commits
Submodule 'submodule' (/«PKGBUILDDIR»/t/trash directory.t5526-fetch-submodules/submodule) registered for path 'submodule'
Successfully rebased and updated refs/heads/to-rebase.
remote: warning: updating the current branch        
From long
 * [new branch]      0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000 -> long/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000
 * [new branch]      master     -> long/master
 * [new tag]         long       -> long
 * [new tag]         master     -> master
remote: warning: Deleting a non-existent ref.        
To testrepo
   b9c09d6..9ad36e1  master -> master
 - [deleted]         next
   b9c09d6..9ad36e1  master -> pu
 - [deleted]         nonexistent
ok 29 - pull.rebase=preserve rebases and merges keep-merge

expecting success: 
	git reset --hard before-preserve-rebase &&
	test_config pull.rebase invalid &&
	! git pull . copy

ok 4 - fetch handles extremely long refname

expecting success: 
	git push long :refs/heads/$ref1440 &&
	git -C long for-each-ref --format="%(subject)" refs/heads >actual &&
	echo master >expect &&
	test_cmp expect actual

HEAD is now at bd5beb6 Merge branch 'keep-merge' into to-rebase
ok 49 - mixed ref updates, deletes, invalid deletes trigger hooks with correct input

expecting success: 
	mk_test testrepo heads/master &&
	(cd testrepo && git config receive.denyDeleteCurrent warn) &&
	git push testrepo --delete master &&
	(cd testrepo && test_must_fail git rev-parse --verify refs/heads/master)

Cloning into 'submodule'...
fatal: Invalid value for pull.rebase: invalid
ok 30 - pull.rebase=invalid fails

expecting success: 
	git reset --hard before-preserve-rebase &&
	test_config pull.rebase true &&
	git pull --rebase=false . copy &&
	test "$(git rev-parse HEAD^1)" = "$(git rev-parse before-preserve-rebase)" &&
	test "$(git rev-parse HEAD^2)" = "$(git rev-parse copy)" &&
	test file3 = "$(git show HEAD:file3.t)"

To long
 - [deleted]         0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000/0000000000000000000000000000000000000000
done.
HEAD is now at bd5beb6 Merge branch 'keep-merge' into to-rebase
ok 5 - push handles extremely long refname

# passed all 5 test(s)
1..5
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
From .
 * branch            copy       -> FETCH_HEAD
remote: warning: updating the current branch        
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
Merging:
bd5beb6 Merge branch 'keep-merge' into to-rebase
virtual 6d7007e01d554c39852974f760e0115e8613cf19
found 1 common ancestor:
73b69f5 modified
Merge made by the 'recursive' strategy.
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Submodule path 'submodule': checked out 'b7ebd72d3727acb2a4efde60836e4414425c2dc3'
*** t5528-push-default.sh ***
remote: warning: updating the current branch        
remote: warning: deleting the current branch        
To testrepo
 - [deleted]         master
ok 31 - --rebase=false create a new merge commit

expecting success: 
	git reset --hard before-preserve-rebase &&
	test_config pull.rebase preserve &&
	git pull --rebase=true . copy &&
	test "$(git rev-parse HEAD^^)" = "$(git rev-parse copy)" &&
	test file3 = "$(git show HEAD:file3.t)"

fatal: Needed a single revision
ok 50 - allow deleting a ref using --delete

expecting success: 
	mk_test testrepo heads/master &&
	git tag -a -m dummy_message deltag heads/master &&
	git push testrepo --tags &&
	(cd testrepo && git rev-parse --verify -q refs/tags/deltag) &&
	git push testrepo --delete tag deltag &&
	(cd testrepo && test_must_fail git rev-parse --verify refs/tags/deltag)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5528-push-default/.git/
HEAD is now at bd5beb6 Merge branch 'keep-merge' into to-rebase
Submodule 'subdir/deepsubmodule' (/«PKGBUILDDIR»/t/trash directory.t5526-fetch-submodules/deepsubmodule) registered for path 'subdir/deepsubmodule'
expecting success: 
	git init --bare repo1 &&
	git remote add parent1 repo1 &&
	git init --bare repo2 &&
	git remote add parent2 repo2 &&
	test_commit one &&
	git push parent1 HEAD &&
	git push parent2 HEAD

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5528-push-default/repo1/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5528-push-default/repo2/
From .
 * branch            copy       -> FETCH_HEAD
[master (root-commit) d79ce16] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
remote: warning: updating the current branch        
Cloning into 'subdir/deepsubmodule'...
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
done.
To repo1
 * [new branch]      HEAD -> master
To testrepo
 * [new tag]         deltag -> deltag
 * [new tag]         frotz -> frotz
 * [new tag]         v1.0 -> v1.0
6e5fba4679ec93de5598d25f1c27f6b6073c29fe
Submodule path 'submodule/subdir/deepsubmodule': checked out '59a192f3bc66732cba7354010b35dab1f3d2bd3c'
To repo2
 * [new branch]      HEAD -> master
First, rewinding head to replay your work on top of it...
ok 1 - setup bare remotes

expecting success: 
	git checkout master &&
	test_config branch.master.remote parent1 &&
	test_config branch.master.merge refs/heads/foo &&
	test_commit two &&
	test_push_success upstream foo

To testrepo
 - [deleted]         deltag
Already on 'master'
fatal: Needed a single revision
ok 51 - allow deleting a tag using --delete

expecting success: 
	mk_test testrepo heads/master &&
	test_must_fail git push testrepo --delete

ok 1 - setup

expecting success: 
	add_upstream_commit &&
	(
		cd downstream &&
		git fetch --recurse-submodules >../actual.out 2>../actual.err
	) &&
	test_i18ncmp expect.out actual.out &&
	test_i18ncmp expect.err actual.err

Applying: new file
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
[master 139b20d] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two.t
Applying: file3
[master db0ba36] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
remote: warning: updating the current branch        
[master ba31311] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
To repo1
 * [new branch]      master -> foo
ok 32 - --rebase=true rebases and flattens keep-merge

expecting success: 
	git reset --hard before-preserve-rebase &&
	test_config pull.rebase true &&
	git pull --rebase=preserve . copy &&
	test "$(git rev-parse HEAD^^)" = "$(git rev-parse copy)" &&
	test "$(git rev-parse HEAD^2)" = "$(git rev-parse keep-merge)"

fatal: --delete doesn't make sense without any refs
ok 52 - push --delete without args aborts

expecting success: 
	mk_test testrepo heads/master &&
	test_must_fail git push testrepo --delete master:foo

HEAD is now at bd5beb6 Merge branch 'keep-merge' into to-rebase
ok 2 - "upstream" pushes to configured upstream

expecting success: 
	git checkout master &&
	test_unconfig branch.master.remote &&
	test_commit three &&
	test_push_failure upstream

Already on 'master'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
[master 7c7cd71] three
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 three.t
From .
 * branch            copy       -> FETCH_HEAD
fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using

    git remote add <name> <url>

and then push using the remote name

    git push <name>

remote: warning: updating the current branch        
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
ok 3 - "upstream" does not push on unconfigured remote

expecting success: 
	git checkout master &&
	test_config branch.master.remote parent1 &&
	test_unconfig branch.master.merge &&
	test_commit four &&
	test_push_failure upstream

Already on 'master'
fatal: --delete only accepts plain target ref names
ok 53 - push --delete refuses src:dest refspecs

expecting success: 
	mk_test testrepo heads/master &&
	(
		cd testrepo &&
		git checkout master &&
		git config receive.denyCurrentBranch warn
	) &&
	git push testrepo master 2>stderr &&
	grep "warning: updating the current branch" stderr

ok 2 - fetch --recurse-submodules recurses into submodules

expecting success: 
	add_upstream_commit &&
	(
		cd downstream &&
		git fetch >../actual.out 2>../actual.err
	) &&
	! test -s actual.out &&
	! test -s actual.err

[master fd8d77e] four
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 four.t
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream parent1 master

[master 91ff4f5] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 4 - "upstream" does not push on unconfigured branch

expecting success: 
	git checkout master &&
	test_config branch.master.remote parent1 &&
	test_config branch.master.merge refs/heads/foo &&
	test_config push.default upstream &&
	test_commit five &&
	test_must_fail git push parent2

Already on 'master'
remote: warning: updating the current branch        
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
[master 281b2bc] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Already on 'master'
[master a383792] five
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 five.t
fatal: You are pushing to remote 'parent2', which is not the upstream of
your current branch 'master', without telling me what to push
to update which remote branch.
ok 3 - fetch alone only fetches superproject

expecting success: 
	(
		cd downstream &&
		git fetch --no-recurse-submodules >../actual.out 2>../actual.err
	) &&
	! test -s actual.out &&
	! test -s actual.err

ok 5 - "upstream" does not push when remotes do not match

expecting success: 
	git checkout -b new-branch &&
	test_push_failure simple &&
	test_push_failure matching &&
	test_push_failure upstream

remote: warning: updating the current branch        
Switched to a new branch 'new-branch'
ok 54 - warn on push to HEAD of non-bare repository

expecting success: 
	mk_test testrepo heads/master &&
	(
		cd testrepo &&
		git checkout master &&
		git config receive.denyCurrentBranch true
	) &&
	test_must_fail git push testrepo master

ok 4 - fetch --no-recurse-submodules only fetches superproject

expecting success: 
	(
		cd downstream &&
		git config -f .gitmodules submodule.submodule.fetchRecurseSubmodules true &&
		git fetch >../actual.out 2>../actual.err
	) &&
	test_i18ncmp expect.out actual.out &&
	test_i18ncmp expect.err actual.err

fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using

    git remote add <name> <url>

and then push using the remote name

    git push <name>

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using

    git remote add <name> <url>

and then push using the remote name

    git push <name>

fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using

    git remote add <name> <url>

and then push using the remote name

    git push <name>

ok 6 - push from/to new branch with upstream, matching and simple

expecting success: 
	test_config branch.new-branch.remote repo1 &&
	git checkout new-branch &&
	test_push_success current new-branch

Already on 'new-branch'
remote: warning: updating the current branch        
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
Already on 'master'
To repo1
 * [new branch]      new-branch -> new-branch
remote: error: refusing to update checked out branch: refs/heads/master        
To testrepo
 ! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'testrepo'
ok 7 - push from/to new branch with current creates remote branch

expecting success: 
	test_config branch.master.remote repo1 &&
	git checkout master &&
	test_push_failure simple &&
	test_push_failure upstream

ok 55 - deny push to HEAD of non-bare repository

expecting success: 
	mk_test testrepo heads/master &&
	(
		cd testrepo &&
		git checkout master &&
		git config receive.denyCurrentBranch true &&
		git config core.bare true
	) &&
	git push testrepo master 2>stderr &&
	! grep "warning: updating the current branch" stderr

ok 5 - using fetchRecurseSubmodules=true in .gitmodules recurses into submodules

expecting success: 
	add_upstream_commit &&
	(
		cd downstream &&
		git fetch --no-recurse-submodules >../actual.out 2>../actual.err
	) &&
	! test -s actual.out &&
	! test -s actual.err

Switched to branch 'master'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream repo1 master

Rebasing (1/2)
[master d7def39] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream repo1 master

ok 8 - push to existing branch, with no upstream configured

expecting success: 
	test_config branch.master.remote repo1 &&
	test_config branch.master.merge refs/heads/master &&
	git checkout master &&
	test_commit six &&
	test_push_success upstream master &&
	test_commit seven &&
	test_push_success simple master

[master 57f90e6] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
remote: warning: updating the current branch        
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
Already on 'master'
ok 6 - --no-recurse-submodules overrides .gitmodules config

expecting success: 
	(
		cd downstream &&
		git config submodule.submodule.fetchRecurseSubmodules false &&
		git fetch >../actual.out 2>../actual.err
	) &&
	! test -s actual.out &&
	! test -s actual.err

Already on 'master'
[master 5891a38] six
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 six.t
Rebasing (2/2)
ok 7 - using fetchRecurseSubmodules=false in .git/config overrides setting in .gitmodules

expecting success: 
	(
		cd downstream &&
		git fetch --recurse-submodules >../actual.out 2>../actual.err &&
		git config --unset -f .gitmodules submodule.submodule.fetchRecurseSubmodules &&
		git config --unset submodule.submodule.fetchRecurseSubmodules
	) &&
	test_i18ncmp expect.out actual.out &&
	test_i18ncmp expect.err actual.err

To repo1
   d79ce16..5891a38  master -> master
ok 56 - allow push to HEAD of bare repository (bare)

expecting success: 
	mk_test testrepo heads/master &&
	(
		cd testrepo &&
		git checkout master &&
		git config receive.denyCurrentBranch false
	) &&
	git push testrepo master 2>stderr &&
	! grep "warning: updating the current branch" stderr

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
[master c9b0832] seven
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 seven.t
remote: warning: updating the current branch        
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
To repo1
   5891a38..c9b0832  master -> master
Already on 'master'
ok 9 - push to existing branch, upstream configured with same name

expecting success: 
	test_config branch.master.remote repo1 &&
	test_config branch.master.merge refs/heads/other-name &&
	git checkout master &&
	test_commit eight &&
	test_push_success upstream other-name &&
	test_commit nine &&
	test_push_failure simple &&
	git --git-dir=repo1 log -1 --format="%h %s" "other-name" >expect-other-name &&
	test_push_success current master &&
	git --git-dir=repo1 log -1 --format="%h %s" "other-name" >actual-other-name &&
	test_cmp expect-other-name actual-other-name

ok 8 - --recurse-submodules overrides fetchRecurseSubmodules setting from .git/config

expecting success: 
	(
		cd downstream &&
		git fetch --recurse-submodules --quiet >../actual.out 2>../actual.err
	) &&
	! test -s actual.out &&
	! test -s actual.err

Already on 'master'
ok 57 - allow push to HEAD of non-bare repository (config)

expecting success: 
	mk_empty testrepo &&
	git branch second $the_first_commit &&
	git checkout second &&
	echo ".." > testrepo/.git/branches/branch1 &&
	(
		cd testrepo &&
		git fetch branch1 &&
		echo "$the_commit commit	refs/heads/branch1" >expect &&
		git for-each-ref refs/heads >actual &&
		test_cmp expect actual
	) &&
	git checkout master

[master 6d8952b] eight
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 eight.t
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
Switched to branch 'second'
To repo1
 * [new branch]      master -> other-name
ok 9 - --quiet propagates to submodules

expecting success: 
	add_upstream_commit &&
	(
		cd downstream &&
		git fetch --recurse-submodules --dry-run >../actual.out 2>../actual.err
	) &&
	test_i18ncmp expect.out actual.out &&
	test_i18ncmp expect.err actual.err

[master e7406c7] nine
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 nine.t
From ..
 * [new branch]      master     -> branch1
 * [new tag]         deltag     -> deltag
 * [new tag]         frotz      -> frotz
 * [new tag]         v1.0       -> v1.0
[master f2f86e1] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
fatal: The upstream branch of your current branch does not match
the name of your current branch.  To push to the upstream branch
on the remote, use

    git push repo1 HEAD:other-name

To push to the branch of the same name on the remote, use

    git push repo1 master

Switched to branch 'master'
ok 58 - fetch with branches

expecting success: 
	mk_empty testrepo &&
	echo "..#second" > testrepo/.git/branches/branch2 &&
	(
		cd testrepo &&
		git fetch branch2 &&
		echo "$the_first_commit commit	refs/heads/branch2" >expect &&
		git for-each-ref refs/heads >actual &&
		test_cmp expect actual
	) &&
	git checkout master

[master 7346a97] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
To repo1
   c9b0832..e7406c7  master -> master
From ..
 * [new branch]      second     -> branch2
ok 10 - push to existing branch, upstream configured with different name

expecting success: 
		test_config branch.master.remote parent1 &&
		test_config branch.master.merge refs/heads/foo &&
		test_config remote.pushdefault parent1 &&
		test_commit commit-for-current &&
		test_push_success current master 
	
Already on 'master'
ok 59 - fetch with branches containing #

expecting success: 
	mk_empty testrepo &&
	git checkout second &&
	echo "testrepo" > .git/branches/branch1 &&
	git push branch1 &&
	(
		cd testrepo &&
		echo "$the_first_commit commit	refs/heads/master" >expect &&
		git for-each-ref refs/heads >actual &&
		test_cmp expect actual
	)

[master f3846c5] commit-for-current
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 commit-for-current.t
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
Switched to branch 'second'
ok 10 - --dry-run propagates to submodules

expecting success: 
	(
		cd downstream &&
		git fetch --recurse-submodules >../actual.out 2>../actual.err
	) &&
	test_i18ncmp expect.out actual.out &&
	test_i18ncmp expect.err actual.err

To repo1
   e7406c7..f3846c5  master -> master
remote: warning: updating the current branch        
To testrepo
 * [new branch]      HEAD -> master
ok 60 - push with branches

expecting success: 
	mk_empty testrepo &&
	echo "testrepo#branch3" > .git/branches/branch2 &&
	git push branch2 &&
	(
		cd testrepo &&
		echo "$the_first_commit commit	refs/heads/branch3" >expect &&
		git for-each-ref refs/heads >actual &&
		test_cmp expect actual
	) &&
	git checkout master

Successfully rebased and updated refs/heads/to-rebase.
ok 11 - push.default = current success in central workflows

expecting success: 
		test_config branch.master.remote parent1 &&
		test_config branch.master.merge refs/heads/foo &&
		test_config remote.pushdefault parent1 &&
		test_commit commit-for-upstream &&
		test_push_success upstream foo 
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
[master 4cda86c] commit-for-upstream
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 commit-for-upstream.t
ok 33 - --rebase=preserve rebases and merges keep-merge

expecting success: 
	git reset --hard before-preserve-rebase &&
	! git pull --rebase=invalid . copy

ok 11 - Without --dry-run propagates to submodules

expecting success: 
	add_upstream_commit &&
	(
		cd downstream &&
		git config fetch.recurseSubmodules true
		git fetch >../actual.out 2>../actual.err
	) &&
	test_i18ncmp expect.out actual.out &&
	test_i18ncmp expect.err actual.err

HEAD is now at bd5beb6 Merge branch 'keep-merge' into to-rebase
error: Invalid value for --rebase: invalid
usage: git pull [<options>] [<repository> [<refspec>...]]

    -v, --verbose         be more verbose
    -q, --quiet           be more quiet
    --progress            force progress reporting

Options related to merging
To testrepo
 * [new branch]      HEAD -> branch3
    -r, --rebase[=<false|true|preserve>]
                          incorporate changes by rebasing rather than merging
    -n                    do not show a diffstat at the end of the merge
    --stat                show a diffstat at the end of the merge
    --log[=<n>]           add (at most <n>) entries from shortlog to merge commit message
    --squash              create a single commit instead of doing a merge
    --commit              perform a commit if the merge succeeds (default)
    --edit                edit message before committing
    --ff                  allow fast-forward
    --ff-only             abort if fast-forward is not possible
    --verify-signatures   verify that the named commit has a valid GPG signature
    -s, --strategy <strategy>
                          merge strategy to use
    -X, --strategy-option <option=value>
                          option for selected merge strategy
    -S, --gpg-sign[=<key-id>]
                          GPG sign commit

Options related to fetching
    --all                 fetch from all remotes
    -a, --append          append to .git/FETCH_HEAD instead of overwriting
    --upload-pack <path>  path to upload pack on remote end
    -f, --force           force overwrite of local branch
    -t, --tags            fetch all tags and associated objects
    -p, --prune           prune remote-tracking branches no longer on remote
    --recurse-submodules[=<on-demand>]
                          control recursive fetching of submodules
    --dry-run             dry run
    -k, --keep            keep downloaded pack
    --depth <depth>       deepen history of shallow clone
    --unshallow           convert to a complete repository
    --update-shallow      accept refs that update .git/shallow
    --refmap <refmap>     specify fetch refmap

ok 34 - --rebase=invalid fails

expecting success: 
	git reset --hard before-preserve-rebase &&
	test_config pull.rebase preserve &&
	git pull --rebase . copy &&
	test "$(git rev-parse HEAD^^)" = "$(git rev-parse copy)" &&
	test file3 = "$(git show HEAD:file3.t)"

[master 96ce4bd] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
HEAD is now at bd5beb6 Merge branch 'keep-merge' into to-rebase
Switched to branch 'master'
ok 61 - push with branches containing #

expecting success: 
	mk_test testrepo heads/master &&
	mk_child testrepo child1 &&
	mk_child testrepo child2 &&
	(
		cd child1 &&
		git branch foo &&
		git symbolic-ref refs/heads/bar refs/heads/foo
		git config receive.denyCurrentBranch false
	) &&
	(
		cd child2 &&
		>path2 &&
		git add path2 &&
		test_tick &&
		git commit -a -m child2 &&
		git branch foo &&
		git branch bar &&
		git push ../child1 foo bar
	)

To repo1
   139b20d..4cda86c  master -> foo
[master 1f46f97] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
From .
 * branch            copy       -> FETCH_HEAD
ok 12 - push.default = upstream success in central workflows

expecting success: 
		test_config branch.master.remote parent1 &&
		test_config branch.master.merge refs/heads/foo &&
		test_config remote.pushdefault parent1 &&
		test_commit commit-for-simple &&
		test_push_failure simple master 
	
remote: warning: updating the current branch        
[master c70813c] commit-for-simple
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 commit-for-simple.t
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
fatal: The upstream branch of your current branch does not match
the name of your current branch.  To push to the upstream branch
on the remote, use

    git push parent1 HEAD:foo

To push to the branch of the same name on the remote, use

    git push parent1 master

Cloning into 'child1'...
ok 13 - push.default = simple failure in central workflows

expecting success: 
		test_config branch.master.remote parent1 &&
		test_config branch.master.merge refs/heads/foo &&
		test_config remote.pushdefault parent1 &&
		test_commit commit-for-matching &&
		test_push_success matching master 
	
done.
First, rewinding head to replay your work on top of it...
Cloning into 'child2'...
done.
[master 5b5f0b1] commit-for-matching
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 commit-for-matching.t
ok 12 - recurseSubmodules=true propagates into submodules

expecting success: 
	add_upstream_commit &&
	(
		cd downstream &&
		(
			cd submodule &&
			git config fetch.recurseSubmodules false
		) &&
		git fetch --recurse-submodules >../actual.out 2>../actual.err
	) &&
	test_i18ncmp expect.out actual.out &&
	test_i18ncmp expect.err actual.err

Applying: new file
Applying: file3
[master 0dbe515] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master 730546d] child2
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 path2
To repo1
   f3846c5..5b5f0b1  master -> master
[master 9e0f617] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 35 - --rebase overrides pull.rebase=preserve and flattens keep-merge

expecting success: 

	git remote add -f me . &&
	git checkout copy &&
	git tag copy-orig &&
	git reset --hard HEAD^ &&
	echo conflicting modification > file &&
	git commit -m conflict file &&
	git checkout to-rebase &&
	echo file > file2 &&
	git commit -m to-rebase file2 &&
	git tag to-rebase-orig &&
	git pull --rebase me copy &&
	test "conflicting modification" = "$(cat file)" &&
	test file = "$(cat file2)"


Updating me
ok 14 - push.default = matching success in central workflows

expecting success: 
		test_config branch.master.remote parent1 &&
		test_config branch.master.merge refs/heads/foo &&
		test_config remote.pushdefault parent2 &&
		test_commit commit-for-current-triangular &&
		test_push_success current master repo2
	
To ../child1
   b9c09d6..730546d  bar -> bar
   b9c09d6..730546d  foo -> foo
ok 62 - push into aliased refs (consistent)

expecting success: 
	mk_test testrepo heads/master &&
	mk_child testrepo child1 &&
	mk_child testrepo child2 &&
	(
		cd child1 &&
		git branch foo &&
		git symbolic-ref refs/heads/bar refs/heads/foo
		git config receive.denyCurrentBranch false
	) &&
	(
		cd child2 &&
		>path2 &&
		git add path2 &&
		test_tick &&
		git commit -a -m child2 &&
		git branch foo &&
		>path3 &&
		git add path3 &&
		test_tick &&
		git commit -a -m child2 &&
		git branch bar &&
		test_must_fail git push ../child1 foo bar 2>stderr &&
		grep "refusing inconsistent update" stderr
	)

From .
 * [new branch]      copy       -> me/copy
 * [new branch]      keep-merge -> me/keep-merge
 * [new branch]      master     -> me/master
 * [new branch]      second     -> me/second
 * [new branch]      to-rebase  -> me/to-rebase
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
[master 851f765] commit-for-current-triangular
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 commit-for-current-triangular.t
Switched to branch 'copy'
Your branch and 'master' have diverged,
and have 2 and 1 different commit each, respectively.
  (use "git pull" to merge the remote branch into yours)
HEAD is now at 73b69f5 modified
remote: warning: updating the current branch        
[copy b01e4b5] conflict
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
Switched to branch 'to-rebase'
[to-rebase 52fd8ad] to-rebase
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'child1'...
To repo2
   d79ce16..851f765  master -> master
done.
ok 13 - --recurse-submodules overrides config in submodule

expecting success: 
	add_upstream_commit &&
	(
		cd downstream &&
		git config fetch.recurseSubmodules true
		git fetch --no-recurse-submodules >../actual.out 2>../actual.err
	) &&
	! test -s actual.out &&
	! test -s actual.err

From .
 * branch            copy       -> FETCH_HEAD
 + 6d7007e...b01e4b5 copy       -> me/copy  (forced update)
Cloning into 'child2'...
[master b23f798] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 15 - push.default = current success in triangular workflows

expecting success: 
		test_config branch.master.remote parent1 &&
		test_config branch.master.merge refs/heads/foo &&
		test_config remote.pushdefault parent2 &&
		test_commit commit-for-upstream-triangular &&
		test_push_failure upstream foo repo2
	
done.
[master 083afae] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master 5aea25e] commit-for-upstream-triangular
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 commit-for-upstream-triangular.t
[master 730546d] child2
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 path2
fatal: You are pushing to remote 'parent2', which is not the upstream of
your current branch 'master', without telling me what to push
to update which remote branch.
ok 14 - --no-recurse-submodules overrides config setting

expecting success: 
	(
		cd downstream &&
		(
			cd submodule &&
			git config --unset fetch.recurseSubmodules
		) &&
		git config --unset fetch.recurseSubmodules
		git fetch >../actual.out 2>../actual.err
	) &&
	! test -s actual.out &&
	! test -s actual.err

[master 2ba6bb5] child2
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 path3
ok 16 - push.default = upstream failure in triangular workflows

First, rewinding head to replay your work on top of it...
expecting success: 
		test_config branch.master.remote parent1 &&
		test_config branch.master.merge refs/heads/foo &&
		test_config remote.pushdefault parent2 &&
		test_commit commit-for-simple-triangular &&
		test_push_success simple master repo2
	
ok 15 - Recursion doesn't happen when no new commits are fetched in the superproject

expecting success: 
	head1=$(git rev-parse --short HEAD) &&
	git add submodule &&
	git commit -m "new submodule" &&
	head2=$(git rev-parse --short HEAD) &&
	echo "Fetching submodule submodule" > expect.out.sub &&
	echo "From $pwd/." > expect.err.sub &&
	echo "   $head1..$head2  master     -> origin/master" >>expect.err.sub &&
	head -2 expect.err >> expect.err.sub &&
	(
		cd downstream &&
		git fetch >../actual.out 2>../actual.err
	) &&
	test_i18ncmp expect.err.sub actual.err &&
	test_i18ncmp expect.out.sub actual.out

Applying: new file
[master 19194cb] commit-for-simple-triangular
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 commit-for-simple-triangular.t
remote: error: refusing inconsistent update between symref 'refs/heads/bar' (b9c09d6..2ba6bb5) and its target 'refs/heads/foo' (b9c09d6..730546d)        
ok 63 - push into aliased refs (inconsistent)

expecting success: 
	mk_test testrepo heads/master &&
	mk_child testrepo child1 &&
	mk_child testrepo child2 &&
	(
		cd child1 &&
		git tag Tag &&
		git push ../child2 Tag &&
		git push ../child2 Tag &&
		>file1 &&
		git add file1 &&
		git commit -m "file1" &&
		git tag -f Tag &&
		test_must_fail git push ../child2 Tag &&
		git push --force ../child2 Tag &&
		git tag -f Tag &&
		test_must_fail git push ../child2 Tag HEAD~ &&
		git push --force ../child2 Tag
	)

Applying: file3
[master 1b141d6] new submodule
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Applying: to-rebase
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
To repo2
   851f765..19194cb  master -> master
ok 36 - --rebase with rebased upstream

expecting success: 
	test_when_finished "test_might_fail git rebase --abort" &&
	git reset --hard to-rebase-orig &&
	git pull --rebase -f me copy &&
	test "conflicting modification" = "$(cat file)" &&
	test file = "$(cat file2)"

remote: warning: updating the current branch        
HEAD is now at 52fd8ad to-rebase
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
ok 17 - push.default = simple success in triangular workflows

expecting success: 
		test_config branch.master.remote parent1 &&
		test_config branch.master.merge refs/heads/foo &&
		test_config remote.pushdefault parent2 &&
		test_commit commit-for-matching-triangular &&
		test_push_success matching master repo2
	
Cloning into 'child1'...
From .
 * branch            copy       -> FETCH_HEAD
[master 8956523] commit-for-matching-triangular
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 commit-for-matching-triangular.t
ok 16 - Recursion stops when no new submodule commits are fetched

expecting success: 
	add_upstream_commit &&
	head1=$(git rev-parse --short HEAD) &&
	echo a > file &&
	git add file &&
	git commit -m "new file" &&
	head2=$(git rev-parse --short HEAD) &&
	echo "From $pwd/." > expect.err.file &&
	echo "   $head1..$head2  master     -> origin/master" >> expect.err.file &&
	(
		cd downstream &&
		git fetch >../actual.out 2>../actual.err
	) &&
	! test -s actual.out &&
	test_i18ncmp expect.err.file actual.err

done.
Cloning into 'child2'...
[master 0eec3ca] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
done.
To repo2
   19194cb..8956523  master -> master
[master 1befa7e] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 18 - push.default = matching success in triangular workflows

expecting success: 
	test_config branch.master.remote parent1 &&
	test_config branch.master.merge refs/heads/master &&
	test_config remote.pushdefault parent1 &&
	test_commit default-master-master &&
	test_push_success "" master

First, rewinding head to replay your work on top of it...
[master ec2426d] new file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
To ../child2
 * [new tag]         Tag -> Tag
Everything up-to-date
[master f163556] default-master-master
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 default-master-master.t
[master 1da25e3] file1
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file1
Applying: new file
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
Updated tag 'Tag' (was b9c09d6)
'current' instead of 'simple' if you sometimes use older versions of Git)

Applying: file3
Applying: to-rebase
To ../child2
 ! [rejected]        Tag -> Tag (already exists)
error: failed to push some refs to '../child2'
hint: Updates were rejected because the tag already exists in the remote.
ok 17 - Recursion doesn't happen when new superproject commits don't change any submodules

expecting success: 
	(
		cd downstream &&
		git fetch --recurse-submodules &&
		(
			cd submodule &&
			git config fetch.recurseSubmodules true
		)
	) &&
	add_upstream_commit &&
	head1=$(git rev-parse --short HEAD) &&
	git add submodule &&
	git commit -m "new submodule" &&
	head2=$(git rev-parse --short HEAD) &&
	echo "From $pwd/." > expect.err.sub &&
	echo "   $head1..$head2  master     -> origin/master" >> expect.err.sub &&
	cat expect.err >> expect.err.sub &&
	(
		cd downstream &&
		git fetch >../actual.out 2>../actual.err &&
		(
			cd submodule &&
			git config --unset fetch.recurseSubmodules
		)
	) &&
	test_i18ncmp expect.err.sub actual.err &&
	test_i18ncmp expect.out actual.out

Fetching submodule submodule
To repo1
   5b5f0b1..f163556  master -> master
To ../child2
 + b9c09d6...1da25e3 Tag -> Tag (forced update)
fatal: remote part of refspec is not a valid name in HEAD~
Everything up-to-date
ok 64 - push requires --force to update lightweight tag

expecting success: 
	mk_empty testrepo &&
	echo >.git/foo  "To testrepo" &&
	echo >>.git/foo "*	refs/heads/master:refs/remotes/origin/master	[new branch]"  &&
	echo >>.git/foo "Done" &&
	git push >.git/bar --porcelain  testrepo refs/heads/master:refs/remotes/origin/master &&
	(
		cd testrepo &&
		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
		git for-each-ref refs/remotes/origin >actual &&
		test_cmp expect actual
	) &&
	test_cmp .git/foo .git/bar

From /«PKGBUILDDIR»/t/trash directory.t5526-fetch-submodules/submodule
   b23f798..0eec3ca  master     -> origin/master
Fetching submodule submodule/subdir/deepsubmodule
ok 19 - default behavior allows "simple" push

expecting success: 
	test_config branch.master.remote parent1 &&
	test_config branch.master.merge refs/heads/foo &&
	test_config remote.pushdefault parent1 &&
	test_commit default-master-foo &&
	test_push_failure ""

No rebase in progress?
ok 37 - --rebase -f with rebased upstream

expecting success: 

	git update-ref refs/remotes/me/copy copy-orig &&
	git checkout --track -b to-rebase2 me/copy &&
	git reset --hard to-rebase-orig &&
	git pull --rebase &&
	test "conflicting modification" = "$(cat file)" &&
	test file = "$(cat file2)"


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
Switched to a new branch 'to-rebase2'
Branch to-rebase2 set up to track remote branch copy from me.
[master accfd16] default-master-foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 default-master-foo.t
HEAD is now at 52fd8ad to-rebase
From /«PKGBUILDDIR»/t/trash directory.t5526-fetch-submodules/deepsubmodule
   9e0f617..1befa7e  master     -> origin/master
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

fatal: The upstream branch of your current branch does not match
the name of your current branch.  To push to the upstream branch
on the remote, use

    git push parent1 HEAD:foo

To push to the branch of the same name on the remote, use

    git push parent1 master

To choose either option permanently, see push.default in 'git help config'.
ok 65 - push --porcelain

expecting success: 
	mk_empty testrepo &&
	test_must_fail git push >.git/bar --porcelain asdfasdfasd refs/heads/master:refs/remotes/origin/master &&
	test_must_fail grep -q Done .git/bar

From .
 + 6d7007e...b01e4b5 copy       -> me/copy  (forced update)
ok 20 - default behavior rejects non-simple push

expecting success: 
	test_config branch.master.remote parent1 &&
	test_config branch.master.merge refs/heads/foo &&
	test_config remote.pushdefault parent2 &&
	test_commit default-triangular &&
	test_push_success "" master repo2

 + b00fa74...b854014 to-rebase  -> me/to-rebase  (forced update)
 * [new branch]      to-rebase2 -> me/to-rebase2
[master f2d1330] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
[master 0f29fa4] default-triangular
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 default-triangular.t
fatal: 'asdfasdfasd' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
[master 9cf554b] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 66 - push --porcelain bad url

expecting success: 
	mk_empty testrepo &&
	git push testrepo refs/heads/master:refs/remotes/origin/master &&
	(cd testrepo &&
		git reset --hard origin/master^
		git config receive.denyCurrentBranch true) &&

	echo >.git/foo  "To testrepo"  &&
	echo >>.git/foo "!	refs/heads/master:refs/heads/master	[remote rejected] (branch is currently checked out)" &&

	test_must_fail git push >.git/bar --porcelain  testrepo refs/heads/master:refs/heads/master &&
	test_cmp .git/foo .git/bar

warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
[master 37fb9d2] new submodule
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
To repo2
   8956523..0f29fa4  master -> master
First, rewinding head to replay your work on top of it...
To testrepo
 * [new branch]      master -> origin/master
HEAD is now at b9c09d6 repo
ok 21 - default triangular behavior acts like "current"

# passed all 21 test(s)
1..21
Applying: new file
Applying: file3
Applying: to-rebase
remote: error: refusing to update checked out branch: refs/heads/master        
error: failed to push some refs to 'testrepo'
ok 67 - push --porcelain rejected

expecting success: 
	mk_empty testrepo &&
	git push testrepo refs/heads/master:refs/remotes/origin/master &&
	(cd testrepo &&
		git reset --hard origin/master
		git config receive.denyCurrentBranch true) &&

	echo >.git/foo  "To testrepo"  &&
	echo >>.git/foo "!	refs/heads/master^:refs/heads/master	[rejected] (non-fast-forward)" &&
	echo >>.git/foo "Done" &&

	test_must_fail git push >.git/bar --porcelain  --dry-run testrepo refs/heads/master^:refs/heads/master &&
	test_cmp .git/foo .git/bar

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
ok 38 - --rebase with rebased default upstream

expecting success: 

	git update-ref refs/remotes/me/copy copy-orig &&
	git reset --hard to-rebase-orig &&
	git checkout --track -b to-rebase3 me/copy &&
	git reset --hard to-rebase-orig &&
	git fetch &&
	git pull --rebase &&
	test "conflicting modification" = "$(cat file)" &&
	test file = "$(cat file2)"


HEAD is now at 52fd8ad to-rebase
Switched to a new branch 'to-rebase3'
Branch to-rebase3 set up to track remote branch copy from me.
*** t5529-push-errors.sh ***
HEAD is now at 52fd8ad to-rebase
ok 18 - Recursion picks up config in submodule

expecting success: 
	add_upstream_commit &&
	(
		cd submodule &&
		(
			cd subdir/deepsubmodule &&
			git fetch &&
			git checkout -q FETCH_HEAD
		) &&
		head1=$(git rev-parse --short HEAD^) &&
		git add subdir/deepsubmodule &&
		git commit -m "new deepsubmodule"
		head2=$(git rev-parse --short HEAD) &&
		echo "From $pwd/submodule" > ../expect.err.sub &&
		echo "   $head1..$head2  master     -> origin/master" >> ../expect.err.sub
	) &&
	head1=$(git rev-parse --short HEAD) &&
	git add submodule &&
	git commit -m "new submodule" &&
	head2=$(git rev-parse --short HEAD) &&
	echo "From $pwd/." > expect.err.2 &&
	echo "   $head1..$head2  master     -> origin/master" >> expect.err.2 &&
	cat expect.err.sub >> expect.err.2 &&
	tail -2 expect.err >> expect.err.2 &&
	(
		cd downstream &&
		git fetch >../actual.out 2>../actual.err
	) &&
	test_i18ncmp expect.err.2 actual.err &&
	test_i18ncmp expect.out actual.out

To testrepo
 * [new branch]      master -> origin/master
HEAD is now at 9ad36e1 second
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5529-push-errors/.git/
From .
 + 6d7007e...b01e4b5 copy       -> me/copy  (forced update)
[master a583e38] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 * [new branch]      to-rebase3 -> me/to-rebase3
expecting success: 
	test_commit one

error: failed to push some refs to 'testrepo'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
ok 68 - push --porcelain --dry-run rejected

expecting success: 
	mk_test testrepo heads/master heads/second heads/foo heads/bar &&
	git push --prune testrepo : &&
	check_push_result testrepo $the_commit heads/master &&
	check_push_result testrepo $the_first_commit heads/second &&
	! check_push_result testrepo $the_first_commit heads/foo heads/bar

[master (root-commit) d79ce16] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
ok 1 - setup commits

expecting success: 
	git init --bare remote.git &&
	git remote add origin remote.git

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
[master f96020c] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5529-push-errors/remote.git/
ok 2 - setup remote

expecting success: 
	FAKE_RP_ROOT=$(pwd) &&
	export FAKE_RP_ROOT &&
	write_script fake-rp <<-\EOF &&
	echo yes >"$FAKE_RP_ROOT"/rp-ran
	exit 1
	EOF
	git config remote.origin.receivepack "\"\$FAKE_RP_ROOT/fake-rp\""

ok 3 - setup fake receive-pack

expecting success: 
	echo no >rp-ran &&
	echo no >expect &&
	test_must_fail git push origin missing &&
	test_cmp expect rp-ran

error: src refspec missing does not match any.
error: failed to push some refs to 'remote.git'
ok 4 - detect missing branches early

expecting success: 
	echo no >rp-ran &&
	echo no >expect &&
	test_must_fail git push origin master~2:master &&
	test_cmp expect rp-ran

remote: warning: updating the current branch        
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
error: src refspec master~2 does not match any.
error: failed to push some refs to 'remote.git'
ok 5 - detect missing sha1 expressions early

expecting success: 
	git branch foo &&
	git tag foo &&
	echo no >rp-ran &&
	echo no >expect &&
	test_must_fail git push origin foo &&
	test_cmp expect rp-ran

error: src refspec foo matches more than one.
error: failed to push some refs to 'remote.git'
ok 6 - detect ambiguous refs early

To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> second
# passed all 6 test(s)
1..6
From /«PKGBUILDDIR»/t/trash directory.t5526-fetch-submodules/deepsubmodule
   59a192f..f96020c  master     -> origin/master
*** t5530-upload-pack-error.sh ***
First, rewinding head to replay your work on top of it...
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> foo
[master f95b1bb] new deepsubmodule
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5530-upload-pack-error/.git/
Applying: new file
expecting success: 

	echo file >file &&
	git add file &&
	git rev-parse :file &&
	git commit -a -m original &&
	test_tick &&
	echo changed >file &&
	git commit -a -m changed &&
	corrupt_repo HEAD:file


To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> bar
Applying: file3
f73f3093ff865c514c6c51f867e35f693487d0d3
Applying: to-rebase
[master 5a403c3] new submodule
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master (root-commit) eb14254] original
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
[master fecc147] changed
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - setup and corrupt repository
ok 39 - rebased upstream + fetch + pull --rebase


expecting success: 
	test_must_fail git fsck

expecting success: 

	git checkout to-rebase &&
	git update-ref refs/remotes/me/copy copy^ &&
	COPY="$(git rev-parse --verify me/copy)" &&
	git rebase --onto $COPY copy &&
	test_config branch.to-rebase.remote me &&
	test_config branch.to-rebase.merge refs/heads/copy &&
	test_config branch.to-rebase.rebase true &&
	echo dirty >> file &&
	git add file &&
	test_must_fail git pull &&
	test "$COPY" = "$(git rev-parse --verify me/copy)" &&
	git checkout HEAD -- file &&
	git pull &&
	test "$COPY" != "$(git rev-parse --verify me/copy)"


Switched to branch 'to-rebase'
missing blob 5ea2ed416fbd4a4cbe227b75fe255dd7fa6bd4d6
ok 2 - fsck fails

expecting success: 

	printf "0032want %s\n00000009done\n0000" \
		$(git rev-parse HEAD) >input &&
	test_must_fail git upload-pack . <input >/dev/null 2>output.err &&
	test_i18ngrep "unable to read" output.err &&
	test_i18ngrep "pack-objects died" output.err

remote: warning: updating the current branch        
To testrepo
 - [deleted]         bar
 - [deleted]         foo
   b9c09d6..9ad36e1  master -> master
Binary file output.err matches
Binary file output.err matches
ok 3 - upload-pack fails due to error in pack-objects packing

expecting success: 

	git hash-object -w file &&
	corrupt_repo HEAD^^{tree}


5ea2ed416fbd4a4cbe227b75fe255dd7fa6bd4d6
ok 4 - corrupt repo differently

expecting success: 
	test_must_fail git fsck

fatal: 'refs/heads/foo' - not a valid ref
ok 69 - push --prune

expecting success: 
	mk_test testrepo tmp/master tmp/second tmp/foo tmp/bar &&
	git push --prune testrepo "refs/heads/*:refs/tmp/*" &&
	check_push_result testrepo $the_commit tmp/master &&
	check_push_result testrepo $the_first_commit tmp/second &&
	! check_push_result testrepo $the_first_commit tmp/foo tmp/bar

broken link from  commit eb142546ccf5c9ea5234cf35085b63866aa44c5d
              to    tree bec63e37d08c454ad3a60cde90b70f3f7d077852
dangling blob f73f3093ff865c514c6c51f867e35f693487d0d3
missing tree bec63e37d08c454ad3a60cde90b70f3f7d077852
ok 5 - fsck fails

expecting success: 

	printf "0032want %s\n0034shallow %s00000009done\n0000" \
		$(git rev-parse HEAD) $(git rev-parse HEAD^) >input &&
	test_must_fail git upload-pack . <input >/dev/null 2>output.err &&
	grep "bad tree object" output.err

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
Binary file output.err matches
ok 6 - upload-pack fails due to error in rev-list

expecting success: 

	printf "0045want %s multi_ack_detailed\n00000009done\n0000" \
		"deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" >input &&
	test_must_fail git upload-pack . <input >output 2>output.err &&
	grep -q "not our ref" output.err &&
	! grep -q multi_ack_detailed output.err

First, rewinding head to replay your work on top of it...
ok 7 - upload-pack error message when bad ref requested

expecting success: 

	printf "0032want %s\n00000009done\n0000" \
		$(git rev-parse HEAD) >input &&
	test_must_fail git upload-pack . <input >/dev/null 2>output.err &&
	grep "bad tree object" output.err &&
	grep "pack-objects died" output.err

ok 19 - Recursion picks up all submodules when necessary

expecting success: 
	add_upstream_commit &&
	(
		cd submodule &&
		(
			cd subdir/deepsubmodule &&
			git fetch &&
			git checkout -q FETCH_HEAD
		) &&
		head1=$(git rev-parse --short HEAD^) &&
		git add subdir/deepsubmodule &&
		git commit -m "new deepsubmodule" &&
		head2=$(git rev-parse --short HEAD) &&
		echo "From $pwd/submodule" > ../expect.err.sub &&
		echo "   $head1..$head2  master     -> origin/master" >> ../expect.err.sub
	) &&
	(
		cd downstream &&
		git config fetch.recurseSubmodules true &&
		git fetch --recurse-submodules=on-demand >../actual.out 2>../actual.err &&
		git config --unset fetch.recurseSubmodules
	) &&
	! test -s actual.out &&
	! test -s actual.err

To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> refs/tmp/master
Applying: new file
Binary file output.err matches
Applying: file3
Binary file output.err matches
ok 8 - upload-pack fails due to error in pack-objects enumeration

expecting success: 

	mkdir foo &&
	cd foo &&
	git init


[master d9945b8] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Applying: to-rebase
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> refs/tmp/second
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5530-upload-pack-error/foo/.git/
ok 9 - create empty repository

expecting success: 

	test_must_fail git fetch .. master


[master ac17407] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
remote: error: Could not read bec63e37d08c454ad3a60cde90b70f3f7d077852        
remote: fatal: bad tree object bec63e37d08c454ad3a60cde90b70f3f7d077852        
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: protocol error: bad pack header
ok 10 - fetch fails

# passed all 10 test(s)
1..10
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> refs/tmp/foo
*** t5531-deep-submodule-push.sh ***
error: Cannot pull with rebase: Your index contains uncommitted changes.
From /«PKGBUILDDIR»/t/trash directory.t5526-fetch-submodules/deepsubmodule
   f96020c..ac17407  master     -> origin/master
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> refs/tmp/bar
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5531-deep-submodule-push/.git/
expecting success: 
	mkdir pub.git &&
	GIT_DIR=pub.git git init --bare &&
	GIT_DIR=pub.git git config receive.fsckobjects true &&
	mkdir work &&
	(
		cd work &&
		git init &&
		git config push.default matching &&
		mkdir -p gar/bage &&
		(
			cd gar/bage &&
			git init &&
			git config push.default matching &&
			>junk &&
			git add junk &&
			git commit -m "Initial junk"
		) &&
		git add gar/bage &&
		git commit -m "Initial superproject"
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5531-deep-submodule-push/pub.git/
notice: HEAD points to an unborn branch (master)
[master ba15c11] new deepsubmodule
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
From .
   73b69f5..b01e4b5  copy       -> me/copy
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5531-deep-submodule-push/work/.git/
 + b854014...399b37d to-rebase  -> me/to-rebase  (forced update)
 + 52fd8ad...b854014 to-rebase3 -> me/to-rebase3  (forced update)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5531-deep-submodule-push/work/gar/bage/.git/
ok 20 - '--recurse-submodules=on-demand' doesn't recurse when no new commits are fetched in the superproject (and ignores config)

expecting success: 
	head1=$(git rev-parse --short HEAD) &&
	git add submodule &&
	git commit -m "new submodule" &&
	head2=$(git rev-parse --short HEAD) &&
	tail -2 expect.err > expect.err.deepsub &&
	echo "From $pwd/." > expect.err &&
	echo "   $head1..$head2  master     -> origin/master" >>expect.err &&
	cat expect.err.sub >> expect.err &&
	cat expect.err.deepsub >> expect.err &&
	(
		cd downstream &&
		git config fetch.recurseSubmodules false &&
		(
			cd submodule &&
			git config -f .gitmodules submodule.subdir/deepsubmodule.fetchRecursive false
		) &&
		git fetch --recurse-submodules=on-demand >../actual.out 2>../actual.err &&
		git config --unset fetch.recurseSubmodules
		(
			cd submodule &&
			git config --unset -f .gitmodules submodule.subdir/deepsubmodule.fetchRecursive
		)
	) &&
	test_i18ncmp expect.out actual.out &&
	test_i18ncmp expect.err actual.err

To testrepo
 - [deleted]         refs/tmp/bar
 - [deleted]         refs/tmp/foo
   b9c09d6..9ad36e1  master -> refs/tmp/master
 * [new branch]      branch1 -> refs/tmp/branch1
 * [new branch]      branch2 -> refs/tmp/branch2
 * [new branch]      local -> refs/tmp/local
 * [new branch]      t/master -> refs/tmp/t/master
[master (root-commit) 1c24869] Initial junk
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 junk
notice: HEAD points to an unborn branch (master)
[master b80e390] new submodule
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master (root-commit) 2ae436a] Initial superproject
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 160000 gar/bage
ok 1 - setup

expecting success: 
	(
		cd work &&
		git push ../pub.git master
	)

notice: HEAD points to an unborn branch (master)
fatal: 'refs/tmp/foo' - not a valid ref
ok 70 - push --prune refspec

expecting success: 
		mk_test testrepo heads/master hidden/one hidden/two hidden/three &&
		(
			cd testrepo &&
			git config $configsection.hiderefs refs/hidden
		) &&

		# push to unhidden ref succeeds normally
		git push testrepo master:refs/heads/master &&
		check_push_result testrepo $the_commit heads/master &&

		# push to update a hidden ref should fail
		test_must_fail git push testrepo master:refs/hidden/one &&
		check_push_result testrepo $the_first_commit hidden/one &&

		# push to delete a hidden ref should fail
		test_must_fail git push testrepo :refs/hidden/two &&
		check_push_result testrepo $the_first_commit hidden/two &&

		# idempotent push to update a hidden ref should fail
		test_must_fail git push testrepo $the_first_commit:refs/hidden/three &&
		check_push_result testrepo $the_first_commit hidden/three
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
To ../pub.git
 * [new branch]      master -> master
ok 2 - push

expecting success: 
	(
		cd work/gar/bage &&
		>junk2 &&
		git add junk2 &&
		git commit -m "Second junk"
	) &&
	(
		cd work &&
		git add gar/bage &&
		git commit -m "Second commit for gar/bage" &&
		git push --recurse-submodules=check ../pub.git master
	)

First, rewinding head to replay your work on top of it...
[master c56d118] Second junk
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 junk2
remote: warning: updating the current branch        
Applying: new file
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
[master c05ddd1] Second commit for gar/bage
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Applying: file3
Applying: to-rebase
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> refs/hidden/one
To ../pub.git
   2ae436a..c05ddd1  master -> master
ok 3 - push if submodule has no remote

expecting success: 
	(
		cd work/gar &&
		git clone --bare bage ../../submodule.git &&
		cd bage &&
		git remote add origin ../../../submodule.git &&
		git fetch &&
		>junk3 &&
		git add junk3 &&
		git commit -m "Third junk"
	) &&
	(
		cd work &&
		git add gar/bage &&
		git commit -m "Third commit for gar/bage" &&
		test_must_fail git push --recurse-submodules=check ../pub.git master
	)

Cloning into bare repository '../../submodule.git'...
done.
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> refs/hidden/two
ok 40 - pull --rebase dies early with dirty working directory

expecting success: 
	git rev-parse master >expect &&
	mkdir empty_repo &&
	(cd empty_repo &&
	 git init &&
	 git pull --rebase .. master &&
	 git rev-parse HEAD >../actual
	) &&
	test_cmp expect actual

From ../../../submodule
 * [new branch]      master     -> origin/master
ok 21 - '--recurse-submodules=on-demand' recurses as deep as necessary (and ignores config)

expecting success: 
	add_upstream_commit &&
	head1=$(git rev-parse --short HEAD) &&
	echo a >> file &&
	git add file &&
	git commit -m "new file" &&
	head2=$(git rev-parse --short HEAD) &&
	echo "From $pwd/." > expect.err.file &&
	echo "   $head1..$head2  master     -> origin/master" >> expect.err.file &&
	(
		cd downstream &&
		git fetch --recurse-submodules=on-demand >../actual.out 2>../actual.err
	) &&
	! test -s actual.out &&
	test_i18ncmp expect.err.file actual.err

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5520-pull/empty_repo/.git/
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> refs/hidden/three
[master 82e6516] Third junk
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 junk3
[master d33f45c] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master 03c613c] Third commit for gar/bage
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
From ..
 * branch            master     -> FETCH_HEAD
[master 3d38119] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
The following submodule paths contain changes that can
not be found on any remote:

Please try

	git push --recurse-submodules=on-demand

or cd to the path and use

	git push

to push them to a remote.

fatal: Aborting.
fatal: The remote end hung up unexpectedly
  gar/bage
ok 4 - push fails if submodule commit not on remote

expecting success: 
	(
		cd work/gar/bage &&
		git push origin master
	) &&
	(
		cd work &&
		git push --recurse-submodules=check ../pub.git master
	)

ok 41 - pull --rebase works on branch yet to be born

expecting success: 
	test_when_finished "rm -rf empty_repo2" &&
	git init empty_repo2 &&
	(
		cd empty_repo2 &&
		echo staged-file >staged-file &&
		git add staged-file &&
		test "$(git ls-files)" = staged-file &&
		test_must_fail git pull --rebase .. master 2>err &&
		test "$(git ls-files)" = staged-file &&
		test "$(git show :staged-file)" = staged-file &&
		test_i18ngrep "unborn branch with changes added to the index" err
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5520-pull/empty_repo2/.git/
remote: warning: updating the current branch        
[master 0821a80] new file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
To testrepo
   b9c09d6..9ad36e1  master -> master
To ../../../submodule.git
   c56d118..82e6516  master -> master
fatal: Updating an unborn branch with changes added to the index.
ok 42 - pull --rebase fails on unborn branch with staged changes

expecting success: 
	mkdir src &&
	(cd src &&
	 git init &&
	 printf "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n" > stuff &&
	 git add stuff &&
	 git commit -m "Initial revision"
	) &&
	git clone src dst &&
	(cd src &&
	 modify s/5/43/ stuff &&
	 git commit -a -m "5->43" &&
	 modify s/6/42/ stuff &&
	 git commit -a -m "Make it bigger"
	) &&
	(cd dst &&
	 modify s/5/43/ stuff &&
	 git commit -a -m "Independent discovery of 5->43"
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5520-pull/src/.git/
To testrepo
 ! [remote rejected] master -> refs/hidden/one (deny updating a hidden ref)
error: failed to push some refs to 'testrepo'
ok 22 - '--recurse-submodules=on-demand' stops when no new submodule commits are found in the superproject (and ignores config)

expecting success: 
	(
		cd downstream &&
		git fetch --recurse-submodules
	) &&
	add_upstream_commit &&
	git config --global fetch.recurseSubmodules false &&
	head1=$(git rev-parse --short HEAD) &&
	git add submodule &&
	git commit -m "new submodule" &&
	head2=$(git rev-parse --short HEAD) &&
	echo "From $pwd/." > expect.err.2 &&
	echo "   $head1..$head2  master     -> origin/master" >>expect.err.2 &&
	head -2 expect.err >> expect.err.2 &&
	(
		cd downstream &&
		git config fetch.recurseSubmodules on-demand &&
		git fetch >../actual.out 2>../actual.err
	) &&
	git config --global --unset fetch.recurseSubmodules &&
	(
		cd downstream &&
		git config --unset fetch.recurseSubmodules
	) &&
	test_i18ncmp expect.out.sub actual.out &&
	test_i18ncmp expect.err.2 actual.err

[master (root-commit) 1d959c4] Initial revision
 Author: A U Thor <author@example.com>
 1 file changed, 10 insertions(+)
 create mode 100644 stuff
To ../pub.git
   c05ddd1..03c613c  master -> master
ok 5 - push succeeds after commit was pushed to remote

expecting success: 
	(
		cd work/gar/bage &&
		>junk4 &&
		git add junk4 &&
		git commit -m "Fourth junk"
	) &&
	(
		cd work &&
		git branch branch2 &&
		git add gar/bage &&
		git commit -m "Fourth commit for gar/bage" &&
		git checkout branch2 &&
		(
			cd gar/bage &&
			git checkout HEAD~1
		) &&
		>junk1 &&
		git add junk1 &&
		git commit -m "First junk" &&
		test_must_fail git push --recurse-submodules=check ../pub.git
	)

Cloning into 'dst'...
Fetching submodule submodule
To testrepo
 ! [remote rejected] refs/hidden/two (deny deleting a hidden ref)
error: failed to push some refs to 'testrepo'
done.
[master 9c14cd4] Fourth junk
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 junk4
[master 78a058a] 5->43
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 830c0ff] Fourth commit for gar/bage
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to branch 'branch2'
M	gar/bage
From /«PKGBUILDDIR»/t/trash directory.t5526-fetch-submodules/submodule
   ba15c11..d33f45c  master     -> origin/master
Fetching submodule submodule/subdir/deepsubmodule
[master fd62e6a] Make it bigger
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
To testrepo
 ! [remote rejected] b9c09d6cc74d3857142fb7c082dca65b88254c6d -> refs/hidden/three (deny updating a hidden ref)
error: failed to push some refs to 'testrepo'
Note: checking out 'HEAD~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 82e6516... Third junk
[master aaa7a56] Independent discovery of 5->43
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 43 - setup for detecting upstreamed changes

expecting success: 
	(cd dst &&
	 git pull --rebase &&
	 test -z "$(git ls-files -u)"
	)

ok 71 - push to update a ref hidden by transfer.hiderefs

expecting success: 
		mk_test testrepo heads/master hidden/one hidden/two hidden/three &&
		(
			cd testrepo &&
			git config $configsection.hiderefs refs/hidden
		) &&

		# push to unhidden ref succeeds normally
		git push testrepo master:refs/heads/master &&
		check_push_result testrepo $the_commit heads/master &&

		# push to update a hidden ref should fail
		test_must_fail git push testrepo master:refs/hidden/one &&
		check_push_result testrepo $the_first_commit hidden/one &&

		# push to delete a hidden ref should fail
		test_must_fail git push testrepo :refs/hidden/two &&
		check_push_result testrepo $the_first_commit hidden/two &&

		# idempotent push to update a hidden ref should fail
		test_must_fail git push testrepo $the_first_commit:refs/hidden/three &&
		check_push_result testrepo $the_first_commit hidden/three
	
[branch2 6802635] First junk
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 junk1
From /«PKGBUILDDIR»/t/trash directory.t5526-fetch-submodules/deepsubmodule
   ac17407..3d38119  master     -> origin/master
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
The following submodule paths contain changes that can
not be found on any remote:

Please try

	git push --recurse-submodules=on-demand

or cd to the path and use

	git push

to push them to a remote.

fatal: Aborting.
  gar/bage
fatal: The remote end hung up unexpectedly
ok 6 - push fails when commit on multiple branches if one branch has no remote

expecting success: 
	git init --bare a &&
	git clone a a1 &&
	(
		cd a1 &&
		git init b
		(
			cd b &&
			>junk &&
			git add junk &&
			git commit -m "initial"
		) &&
		git add b &&
		git commit -m "added submodule" &&
		git push --recurse-submodule=check origin master
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5531-deep-submodule-push/a/
Cloning into 'a1'...
From /«PKGBUILDDIR»/t/trash directory.t5520-pull/src
   1d959c4..fd62e6a  master     -> origin/master
remote: warning: updating the current branch        
warning: You appear to have cloned an empty repository.
done.
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
[master 9040f86] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5531-deep-submodule-push/a1/b/.git/
[master d8e60f5] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master (root-commit) d061b42] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
To testrepo
 create mode 100644 junk
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> refs/hidden/one
[master (root-commit) e5a5be7] added submodule
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 160000 b
[master 8cc0c37] new submodule
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> refs/hidden/two
First, rewinding head to replay your work on top of it...
To /«PKGBUILDDIR»/t/trash directory.t5531-deep-submodule-push/a
 * [new branch]      master -> master
ok 7 - push succeeds if submodule has no remote and is on the first superproject commit

expecting success: 
	(
		cd work &&
		(
			cd gar/bage &&
			git checkout master &&
			>junk5 &&
			git add junk5 &&
			git commit -m "Fifth junk" &&
			git push &&
			git rev-parse origin/master >../../../expected
		) &&
		git checkout master &&
		git add gar/bage &&
		git commit -m "Fifth commit for gar/bage" &&
		git push --recurse-submodules=on-demand ../pub.git master
	) &&
	(
		cd submodule.git &&
		git rev-parse master >../actual
	) &&
	test_cmp expected actual

To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> refs/hidden/three
Previous HEAD position was 82e6516... Third junk
Switched to branch 'master'
[master 7043ae6] Fifth junk
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 junk5
ok 44 - git pull --rebase detects upstreamed changes

expecting success: 
	(cd dst &&
	 test_might_fail git rebase --abort &&
	 git reset --hard origin/master
	) &&
	git clone --bare src src-replace.git &&
	rm -rf src &&
	mv src-replace.git src &&
	(cd dst &&
	 modify s/2/22/ stuff &&
	 git commit -a -m "Change 2" &&
	 modify s/3/33/ stuff &&
	 git commit -a -m "Change 3" &&
	 modify s/4/44/ stuff &&
	 git commit -a -m "Change 4" &&
	 git push &&

	 modify s/44/55/ stuff &&
	 git commit --amend -a -m "Modified Change 4"
	)

To ../../../submodule.git
   82e6516..7043ae6  master -> master
Switched to branch 'master'
M	gar/bage
remote: warning: updating the current branch        
To testrepo
   b9c09d6..9ad36e1  master -> master
ok 23 - 'fetch.recurseSubmodules=on-demand' overrides global config

expecting success: 
	(
		cd downstream &&
		git fetch --recurse-submodules
	) &&
	add_upstream_commit &&
	git config fetch.recurseSubmodules false &&
	head1=$(git rev-parse --short HEAD) &&
	git add submodule &&
	git commit -m "new submodule" &&
	head2=$(git rev-parse --short HEAD) &&
	echo "From $pwd/." > expect.err.2 &&
	echo "   $head1..$head2  master     -> origin/master" >>expect.err.2 &&
	head -2 expect.err >> expect.err.2 &&
	(
		cd downstream &&
		git config submodule.submodule.fetchRecurseSubmodules on-demand &&
		git fetch >../actual.out 2>../actual.err
	) &&
	git config --unset fetch.recurseSubmodules &&
	(
		cd downstream &&
		git config --unset submodule.submodule.fetchRecurseSubmodules
	) &&
	test_i18ncmp expect.out.sub actual.out &&
	test_i18ncmp expect.err.2 actual.err

[master e9f1e07] Fifth commit for gar/bage
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
No rebase in progress?
HEAD is now at fd62e6a Make it bigger
Cloning into bare repository 'src-replace.git'...
done.
Fetching submodule submodule
To testrepo
 ! [remote rejected] master -> refs/hidden/one (deny updating a hidden ref)
error: failed to push some refs to 'testrepo'
Fetching submodule submodule/subdir/deepsubmodule
[master 773a86c] Change 2
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+), 2 deletions(-)
[master 0dcfc05] Change 3
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+), 2 deletions(-)
To testrepo
 ! [remote rejected] refs/hidden/two (deny deleting a hidden ref)
error: failed to push some refs to 'testrepo'
To ../pub.git
   03c613c..e9f1e07  master -> master
ok 8 - push unpushed submodules when not needed

[master dbf6bbf] Change 4
 Author: A U Thor <author@example.com>
 1 file changed, 3 insertions(+), 3 deletions(-)
expecting success: 
	(
		cd submodule.git &&
		git rev-parse master >../expected
	) &&
	(
		cd work &&
		(
			cd gar/bage &&
			>junk6 &&
			git add junk6 &&
			git commit -m "Sixth junk"
		) &&
		>junk2 &&
		git add junk2 &&
		git commit -m "Second junk for work" &&
		git push --recurse-submodules=on-demand ../pub.git master
	) &&
	(
		cd submodule.git &&
		git rev-parse master >../actual
	) &&
	test_cmp expected actual

From /«PKGBUILDDIR»/t/trash directory.t5526-fetch-submodules/deepsubmodule
   3d38119..d8e60f5  master     -> origin/master
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

[master 20af53f] Sixth junk
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 junk6
To testrepo
 ! [remote rejected] b9c09d6cc74d3857142fb7c082dca65b88254c6d -> refs/hidden/three (deny updating a hidden ref)
error: failed to push some refs to 'testrepo'
[master 9a1acfb] Second junk for work
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 junk2
ok 72 - push to update a ref hidden by receive.hiderefs

expecting success: 
	mk_test testrepo heads/master hidden/one &&
	git push testrepo master:refs/hidden/one &&
	(
		cd testrepo &&
		git config transfer.hiderefs refs/hidden
	) &&
	check_push_result testrepo $the_commit hidden/one &&

	mk_child testrepo child &&
	(
		cd child &&

		# make sure $the_commit does not exist here
		git repack -a -d &&
		git prune &&
		test_must_fail git cat-file -t $the_commit &&

		# fetching the hidden object should fail by default
		test_must_fail git fetch -v ../testrepo $the_commit:refs/heads/copy &&
		test_must_fail git rev-parse --verify refs/heads/copy &&

		# the server side can allow it to succeed
		(
			cd ../testrepo &&
			git config uploadpack.allowtipsha1inwant true
		) &&

		git fetch -v ../testrepo $the_commit:refs/heads/copy master:refs/heads/extra &&
		cat >expect <<-EOF &&
		$the_commit
		$the_first_commit
		EOF
		{
			git rev-parse --verify refs/heads/copy &&
			git rev-parse --verify refs/heads/extra
		} >actual &&
		test_cmp expect actual
	)

[master 92207bc] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
To /«PKGBUILDDIR»/t/trash directory.t5520-pull/src
   fd62e6a..dbf6bbf  master -> master
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
[master 02f2331] Modified Change 4
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 1 file changed, 3 insertions(+), 3 deletions(-)
ok 45 - setup for avoiding reapplying old patches

expecting success: 
	(cd dst &&
	 test_must_fail git pull --rebase &&
	 test 1 = $(find .git/rebase-apply -name "000*" | wc -l)
	)

[master 52a73a2] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master eb46348] new submodule
remote: warning: updating the current branch        
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
To ../pub.git
   e9f1e07..9a1acfb  master -> master
ok 9 - push unpushed submodules when not needed 2

expecting success: 
	(
		cd work &&
		(
			cd gar/bage &&
			git checkout master &&
			> junk7 &&
			git add junk7 &&
			git commit -m "Seventh junk" &&
			git rev-parse master >../../../expected
		) &&
		git checkout master &&
		git add gar/bage &&
		git commit -m "Seventh commit for gar/bage" &&
		git push --recurse-submodules=on-demand ../pub.git master
	) &&
	(
		cd submodule.git &&
		git rev-parse master >../actual
	) &&
	test_cmp expected actual

To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> refs/hidden/one
Already on 'master'
[master 4886cff] Seventh junk
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 junk7
Already on 'master'
M	gar/bage
[master 9432835] Seventh commit for gar/bage
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
To testrepo
   b9c09d6..9ad36e1  master -> refs/hidden/one
First, rewinding head to replay your work on top of it...
ok 24 - 'submodule.<sub>.fetchRecurseSubmodules=on-demand' overrides fetch.recurseSubmodules

expecting success: 
	(
		cd submodule &&
		git checkout -q HEAD^^
	) &&
	head1=$(git rev-parse --short HEAD) &&
	git add submodule &&
	git commit -m "submodule rewound" &&
	head2=$(git rev-parse --short HEAD) &&
	echo "From $pwd/." > expect.err &&
	echo "   $head1..$head2  master     -> origin/master" >> expect.err &&
	(
		cd downstream &&
		git fetch >../actual.out 2>../actual.err
	) &&
	! test -s actual.out &&
	test_i18ncmp expect.err actual.err

Pushing submodule 'gar/bage'
Cloning into 'child'...
Applying: Modified Change 4
done.
Using index info to reconstruct a base tree...
M	stuff
Falling back to patching base and 3-way merge...
[master 016ed37] submodule rewound
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Merging dbf6bbff6d001f1795b1d538f964861c9e1d0709 with Modified Change 4
Merging:
dbf6bbf Change 4
virtual Modified Change 4
found 1 common ancestor:
virtual e369e858ec1aa73d497d02c4f23e5cf4ae2d3c3b
Auto-merging stuff
CONFLICT (content): Merge conflict in stuff
error: Failed to merge in the changes.
Patch failed at 0001 Modified Change 4
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

To ../../../submodule.git
   7043ae6..4886cff  master -> master
ok 46 - git pull --rebase does not reapply old patches

expecting success: 
	git checkout -b copy2 to-rebase-orig &&
	git pull --rebase . to-rebase &&
	test "conflicting modification" = "$(cat file)" &&
	test file = "$(cat file2)"

Switched to a new branch 'copy2'
From .
 * branch            to-rebase  -> FETCH_HEAD
ok 25 - don't fetch submodule when newly recorded commits are already present

# passed all 25 test(s)
1..25
fatal: git cat-file: could not get object info
To ../pub.git
   9a1acfb..9432835  master -> master
ok 10 - push unpushed submodules recursively

expecting success: 
	(
		cd work &&
		(
			cd gar/bage &&
			git rev-parse origin/master >../../../expected &&
			git checkout master~0 &&
			> junk8 &&
			git add junk8 &&
			git commit -m "Eighth junk"
		) &&
		git add gar/bage &&
		git commit -m "Eighth commit for gar/bage" &&
		test_must_fail git push --recurse-submodules=on-demand ../pub.git master
	) &&
	(
		cd submodule.git &&
		git rev-parse master >../actual
	) &&
	test_cmp expected actual

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 4886cff... Seventh junk
fatal: Needed a single revision
[detached HEAD db3b2a1] Eighth junk
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 junk8
[master fd24f78] Eighth commit for gar/bage
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
From ../testrepo
 * [new ref]         9ad36e1e54b2130a20d55abb4f0f3ca8494ead3f -> copy
 * [new branch]      master     -> extra
First, rewinding head to replay your work on top of it...
ok 73 - fetch exact SHA1

expecting success: 
		mk_empty testrepo &&
		(
			cd testrepo &&
			git config uploadpack.allowtipsha1inwant $configallowtipsha1inwant &&
			git commit --allow-empty -m foo &&
			git commit --allow-empty -m bar
		) &&
		SHA1=$(git --git-dir=testrepo/.git rev-parse HEAD^) &&
		mk_empty shallow &&
		(
			cd shallow &&
			test_must_fail git fetch --depth=1 ../testrepo/.git $SHA1 &&
			git --git-dir=../testrepo/.git config uploadpack.allowreachablesha1inwant true &&
			git fetch --depth=1 ../testrepo/.git $SHA1 &&
			git cat-file commit $SHA1
		)
	
Pushing submodule 'gar/bage'
Everything up-to-date
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
*** t5532-fetch-proxy.sh ***
ok 47 - git pull --rebase against local branch

[master (root-commit) a6b22ca] foo
 Author: A U Thor <author@example.com>
# passed all 47 test(s)
1..47
[master 5e26403] bar
 Author: A U Thor <author@example.com>
The following submodule paths contain changes that can
not be found on any remote:

Please try

	git push --recurse-submodules=on-demand

or cd to the path and use

	git push

to push them to a remote.

fatal: Aborting.
  gar/bage
fatal: The remote end hung up unexpectedly
ok 11 - push unpushable submodule recursively fails

# passed all 11 test(s)
1..11
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/shallow/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5532-fetch-proxy/.git/
expecting success: 
	git init remote &&
	(cd remote &&
	 echo content >file &&
	 git add file &&
	 git commit -m one
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5532-fetch-proxy/remote/.git/
fatal: git upload-pack: not our ref a6b22cab249ba5160facc1657eff7e4bbd9ed808
fatal: The remote end hung up unexpectedly
[master (root-commit) 525bfa8] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 1 - setup remote repo

expecting success: 
	git remote add fake git://example.com/remote &&
	git config core.gitproxy ./proxy

ok 2 - setup local repo

expecting success: 
	git fetch fake &&
	echo one >expect &&
	git log -1 --format=%s FETCH_HEAD >actual &&
	test_cmp expect actual

proxying for example.com 9418
From ../testrepo/
 * branch            a6b22cab249ba5160facc1657eff7e4bbd9ed808 -> FETCH_HEAD
Running 'git-upload-pack remote'
*** t5533-push-cas.sh ***
tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
author A U Thor <author@example.com> 1112912053 -0700
committer C O Mitter <committer@example.com> 1112912053 -0700

foo
ok 74 - shallow fetch reachable SHA1 (but not a ref), allowtipsha1inwant=true

expecting success: 
		mk_empty testrepo &&
		(
			cd testrepo &&
			git config uploadpack.allowtipsha1inwant $configallowtipsha1inwant &&
			git commit --allow-empty -m foo &&
			git commit --allow-empty -m bar &&
			git commit --allow-empty -m xyz
		) &&
		SHA1_1=$(git --git-dir=testrepo/.git rev-parse HEAD^^) &&
		SHA1_2=$(git --git-dir=testrepo/.git rev-parse HEAD^) &&
		SHA1_3=$(git --git-dir=testrepo/.git rev-parse HEAD) &&
		(
			cd testrepo &&
			git reset --hard $SHA1_2 &&
			git cat-file commit $SHA1_1 &&
			git cat-file commit $SHA1_3
		) &&
		mk_empty shallow &&
		(
			cd shallow &&
			test_must_fail git fetch ../testrepo/.git $SHA1_3 &&
			test_must_fail git fetch ../testrepo/.git $SHA1_1 &&
			git --git-dir=../testrepo/.git config uploadpack.allowreachablesha1inwant true &&
			git fetch ../testrepo/.git $SHA1_1 &&
			git cat-file commit $SHA1_1 &&
			test_must_fail git cat-file commit $SHA1_2 &&
			git fetch ../testrepo/.git $SHA1_2 &&
			git cat-file commit $SHA1_2 &&
			test_must_fail git fetch ../testrepo/.git $SHA1_3
		)
	
*** t5534-push-signed.sh ***
From git://example.com/remote
 * [new branch]      master     -> fake/master
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
ok 3 - fetch through proxy works

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5533-push-cas/.git/
# passed all 3 test(s)
1..3
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5534-push-signed/.git/
expecting success: 
	# create template repository
	test_commit A &&
	test_commit B &&
	test_commit C

[master (root-commit) a6b22ca] foo
 Author: A U Thor <author@example.com>
*** t5535-fetch-push-symref.sh ***
[master (root-commit) 0ddfaf1] A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 A.t
[master 5e26403] bar
 Author: A U Thor <author@example.com>
[master 64ea4c1] xyz
 Author: A U Thor <author@example.com>
[master d9df450] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 B.t
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5535-fetch-push-symref/.git/
expecting success: 
	test_commit one &&
	git clone . src &&
	git clone src dst1 &&
	git clone src dst2 &&
	test_commit two &&
	( cd src && git pull )

HEAD is now at 5e26403 bar
tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
author A U Thor <author@example.com> 1112912053 -0700
committer C O Mitter <committer@example.com> 1112912053 -0700

foo
[master 35a8500] C
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 C.t
tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
parent 5e26403b4485d7a44fd8b65dc3f71e21c0dd6fad
author A U Thor <author@example.com> 1112912053 -0700
committer C O Mitter <committer@example.com> 1112912053 -0700

xyz
[master (root-commit) d79ce16] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
ok 1 - setup

expecting success: 
	setup_srcdst_basic &&
	(
		cd dst &&
		test_commit D &&
		test_must_fail git push --force-with-lease=master:master origin master
	) &&
	git ls-remote . refs/heads/master >expect &&
	git ls-remote src refs/heads/master >actual &&
	test_cmp expect actual

Cloning into 'src'...
Cloning into 'src'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/shallow/.git/
done.
Cloning into 'dst1'...
fatal: git upload-pack: not our ref 64ea4c133d59fa98e86a771eda009872d6ab2886
fatal: The remote end hung up unexpectedly
done.
fatal: git upload-pack: not our ref a6b22cab249ba5160facc1657eff7e4bbd9ed808
fatal: The remote end hung up unexpectedly
Cloning into 'dst2'...
expecting success: 
	# master, ff and noff branches pointing at the same commit
	test_tick &&
	git commit --allow-empty -m initial &&

	git checkout -b noop &&
	git checkout -b ff &&
	git checkout -b noff &&

	# noop stays the same, ff advances, noff rewrites
	test_tick &&
	git commit --allow-empty --amend -m rewritten &&
	git checkout ff &&

	test_tick &&
	git commit --allow-empty -m second

done.
[master (root-commit) 66fe8b3] initial
 Author: A U Thor <author@example.com>
Switched to a new branch 'noop'
Switched to a new branch 'ff'
Cloning into 'dst'...
From ../testrepo/
 * branch            a6b22cab249ba5160facc1657eff7e4bbd9ed808 -> FETCH_HEAD
[master 139b20d] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two.t
Switched to a new branch 'noff'
[noff 6391b7f] rewritten
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
author A U Thor <author@example.com> 1112912053 -0700
committer C O Mitter <committer@example.com> 1112912053 -0700

foo
fatal: git cat-file 5e26403b4485d7a44fd8b65dc3f71e21c0dd6fad: bad file
Switched to branch 'ff'
[ff 566fbd3] second
 Author: A U Thor <author@example.com>
ok 1 - setup

expecting success: 
	prepare_dst &&
	mkdir -p dst/.git/hooks &&
	write_script dst/.git/hooks/post-receive <<-\EOF &&
	# discard the update list
	cat >/dev/null
	# record the push certificate
	if test -n "${GIT_PUSH_CERT-}"
	then
		git cat-file blob $GIT_PUSH_CERT >../push-cert
	fi
	EOF

	git push dst noop ff +noff &&
	! test -f dst/push-cert

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5534-push-signed/dst/.git/
From ../testrepo/
 * branch            5e26403b4485d7a44fd8b65dc3f71e21c0dd6fad -> FETCH_HEAD
From /«PKGBUILDDIR»/t/trash directory.t5535-fetch-push-symref/.
   d79ce16..139b20d  master     -> origin/master
 * [new tag]         two        -> two
tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
parent a6b22cab249ba5160facc1657eff7e4bbd9ed808
author A U Thor <author@example.com> 1112912053 -0700
committer C O Mitter <committer@example.com> 1112912053 -0700

bar
Updating d79ce16..139b20d
Fast-forward
 two.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 two.t
ok 1 - setup

expecting success: 
	(
		cd src &&
		git push ../dst1 "refs/remotes/*:refs/remotes/*"
	) &&
	git ls-remote src "refs/remotes/*" >expect &&
	git ls-remote dst1 "refs/remotes/*" >actual &&
	test_cmp expect actual &&
	( cd src && git symbolic-ref refs/remotes/origin/HEAD ) >expect &&
	( cd dst1 && git symbolic-ref refs/remotes/origin/HEAD ) >actual &&
	test_cmp expect actual

To dst
 * [new branch]      master -> noop
 * [new branch]      master -> ff
 * [new branch]      master -> noff
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 35a8500... C
fatal: git upload-pack: not our ref 64ea4c133d59fa98e86a771eda009872d6ab2886
fatal: The remote end hung up unexpectedly
ok 75 - deny fetch unreachable SHA1, allowtipsha1inwant=true

expecting success: 
		mk_empty testrepo &&
		(
			cd testrepo &&
			git config uploadpack.allowtipsha1inwant $configallowtipsha1inwant &&
			git commit --allow-empty -m foo &&
			git commit --allow-empty -m bar
		) &&
		SHA1=$(git --git-dir=testrepo/.git rev-parse HEAD^) &&
		mk_empty shallow &&
		(
			cd shallow &&
			test_must_fail git fetch --depth=1 ../testrepo/.git $SHA1 &&
			git --git-dir=../testrepo/.git config uploadpack.allowreachablesha1inwant true &&
			git fetch --depth=1 ../testrepo/.git $SHA1 &&
			git cat-file commit $SHA1
		)
	
[master be8f64f] D
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 D.t
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
To ../dst1
   d79ce16..139b20d  origin/HEAD -> origin/HEAD
   d79ce16..139b20d  origin/master -> origin/master
To /«PKGBUILDDIR»/t/trash directory.t5533-push-cas/src
 ! [rejected]        master -> master (stale info)
error: failed to push some refs to '/«PKGBUILDDIR»/t/trash directory.t5533-push-cas/src'
To dst
   66fe8b3..566fbd3  ff -> ff
 + 66fe8b3...6391b7f noff -> noff (forced update)
ok 2 - unsigned push does not send push certificate

expecting success: 
	prepare_dst &&
	mkdir -p dst/.git/hooks &&
	write_script dst/.git/hooks/post-receive <<-\EOF &&
	# discard the update list
	cat >/dev/null
	# record the push certificate
	if test -n "${GIT_PUSH_CERT-}"
	then
		git cat-file blob $GIT_PUSH_CERT >../push-cert
	fi
	EOF

	git push dst noop ff +noff &&
	! test -f dst/push-cert

[master (root-commit) a6b22ca] foo
 Author: A U Thor <author@example.com>
[master 5e26403] bar
 Author: A U Thor <author@example.com>
ok 2 - push to update (protected)

expecting success: 
	setup_srcdst_basic &&
	(
		cd dst &&
		test_commit D &&
		git push --force --force-with-lease=master:master origin master
	) &&
	git ls-remote dst refs/heads/master >expect &&
	git ls-remote src refs/heads/master >actual &&
	test_cmp expect actual

ok 2 - push

expecting success: 
	(
		cd dst2 &&
		git fetch ../src "refs/remotes/*:refs/remotes/*"
	) &&
	git ls-remote src "refs/remotes/*" >expect &&
	git ls-remote dst2 "refs/remotes/*" >actual &&
	test_cmp expect actual &&
	( cd src && git symbolic-ref refs/remotes/origin/HEAD ) >expect &&
	( cd dst2 && git symbolic-ref refs/remotes/origin/HEAD ) >actual &&
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5534-push-signed/dst/.git/
Cloning into 'src'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/shallow/.git/
To dst
 * [new branch]      master -> noop
 * [new branch]      master -> ff
 * [new branch]      master -> noff
From ../src
   d79ce16..139b20d  origin/master -> origin/master
 * [new tag]         two        -> two
ok 3 - fetch

# passed all 3 test(s)
1..3
To dst
   66fe8b3..566fbd3  ff -> ff
 + 66fe8b3...6391b7f noff -> noff (forced update)
ok 3 - talking with a receiver without push certificate support

expecting success: 
	prepare_dst &&
	mkdir -p dst/.git/hooks &&
	test_must_fail git push --signed dst noop ff +noff 2>err &&
	test_i18ngrep "the receiving end does not support" err

From ../testrepo/
 * branch            a6b22cab249ba5160facc1657eff7e4bbd9ed808 -> FETCH_HEAD
tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
author A U Thor <author@example.com> 1112912053 -0700
committer C O Mitter <committer@example.com> 1112912053 -0700

foo
ok 76 - shallow fetch reachable SHA1 (but not a ref), allowtipsha1inwant=false

expecting success: 
		mk_empty testrepo &&
		(
			cd testrepo &&
			git config uploadpack.allowtipsha1inwant $configallowtipsha1inwant &&
			git commit --allow-empty -m foo &&
			git commit --allow-empty -m bar &&
			git commit --allow-empty -m xyz
		) &&
		SHA1_1=$(git --git-dir=testrepo/.git rev-parse HEAD^^) &&
		SHA1_2=$(git --git-dir=testrepo/.git rev-parse HEAD^) &&
		SHA1_3=$(git --git-dir=testrepo/.git rev-parse HEAD) &&
		(
			cd testrepo &&
			git reset --hard $SHA1_2 &&
			git cat-file commit $SHA1_1 &&
			git cat-file commit $SHA1_3
		) &&
		mk_empty shallow &&
		(
			cd shallow &&
			test_must_fail git fetch ../testrepo/.git $SHA1_3 &&
			test_must_fail git fetch ../testrepo/.git $SHA1_1 &&
			git --git-dir=../testrepo/.git config uploadpack.allowreachablesha1inwant true &&
			git fetch ../testrepo/.git $SHA1_1 &&
			git cat-file commit $SHA1_1 &&
			test_must_fail git cat-file commit $SHA1_2 &&
			git fetch ../testrepo/.git $SHA1_2 &&
			git cat-file commit $SHA1_2 &&
			test_must_fail git fetch ../testrepo/.git $SHA1_3
		)
	
Cloning into 'dst'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5534-push-signed/dst/.git/
*** t5536-fetch-conflicts.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
[master (root-commit) a6b22ca] foo
 Author: A U Thor <author@example.com>
To dst
 * [new branch]      master -> noop
 * [new branch]      master -> ff
 * [new branch]      master -> noff
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5536-fetch-conflicts/.git/
[master 5e26403] bar
 Author: A U Thor <author@example.com>
expecting success: 
	git commit --allow-empty -m "Initial" &&
	git branch branch1 &&
	git tag tag1 &&
	git commit --allow-empty -m "First" &&
	git branch branch2 &&
	git tag tag2

[master 64ea4c1] xyz
 Author: A U Thor <author@example.com>
fatal: the receiving end does not support --signed push
ok 4 - push --signed fails with a receiver without push certificate support

expecting success: 
	prepare_dst &&
	mkdir -p dst/.git/hooks &&
	write_script dst/.git/hooks/post-receive <<-\EOF &&
	if test -n "${GIT_PUSH_CERT-}"
	then
		git cat-file blob $GIT_PUSH_CERT >../push-cert
	fi
	EOF
	git push dst noop &&
	! test -f dst/push-cert

[master (root-commit) 276b0da] Initial
 Author: A U Thor <author@example.com>
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 35a8500... C
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5534-push-signed/dst/.git/
HEAD is now at 5e26403 bar
[master b6fdaa6] First
 Author: A U Thor <author@example.com>
tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
author A U Thor <author@example.com> 1112912053 -0700
committer C O Mitter <committer@example.com> 1112912053 -0700

foo
[master be8f64f] D
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 D.t
tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
parent 5e26403b4485d7a44fd8b65dc3f71e21c0dd6fad
author A U Thor <author@example.com> 1112912053 -0700
committer C O Mitter <committer@example.com> 1112912053 -0700

xyz
ok 1 - setup

expecting success: 
	setup_repository ok "+refs/heads/*:refs/remotes/origin/*" && (
		cd ok &&
		git fetch origin
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5536-fetch-conflicts/ok/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/shallow/.git/
To dst
 * [new branch]      master -> noop
 * [new branch]      master -> ff
 * [new branch]      master -> noff
To /«PKGBUILDDIR»/t/trash directory.t5533-push-cas/src
 + 35a8500...be8f64f master -> master (forced update)
Everything up-to-date
ok 5 - no certificate for a signed push with no update

expecting success: 
	prepare_dst &&
	mkdir -p dst/.git/hooks &&
	git -C dst config receive.certnonceseed sekrit &&
	write_script dst/.git/hooks/post-receive <<-\EOF &&
	# discard the update list
	cat >/dev/null
	# record the push certificate
	if test -n "${GIT_PUSH_CERT-}"
	then
		git cat-file blob $GIT_PUSH_CERT >../push-cert
	fi &&

	cat >../push-cert-status <<E_O_F
	SIGNER=${GIT_PUSH_CERT_SIGNER-nobody}
	KEY=${GIT_PUSH_CERT_KEY-nokey}
	STATUS=${GIT_PUSH_CERT_STATUS-nostatus}
	NONCE_STATUS=${GIT_PUSH_CERT_NONCE_STATUS-nononcestatus}
	NONCE=${GIT_PUSH_CERT_NONCE-nononce}
	E_O_F

	EOF

	git push --signed dst noop ff +noff &&

	(
		cat <<-\EOF &&
		SIGNER=C O Mitter <committer@example.com>
		KEY=13B6F51ECDDE430D
		STATUS=G
		NONCE_STATUS=OK
		EOF
		sed -n -e "s/^nonce /NONCE=/p" -e "/^$/q" dst/push-cert
	) >expect &&

	grep "$(git rev-parse noop ff) refs/heads/ff" dst/push-cert &&
	grep "$(git rev-parse noop noff) refs/heads/noff" dst/push-cert &&
	test_cmp expect dst/push-cert-status

From /«PKGBUILDDIR»/t/trash directory.t5536-fetch-conflicts
 * [new branch]      branch1    -> origin/branch1
 * [new branch]      branch2    -> origin/branch2
 * [new branch]      master     -> origin/master
 * [new tag]         tag1       -> tag1
 * [new tag]         tag2       -> tag2
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5534-push-signed/dst/.git/
ok 3 - push to update (protected, forced)

expecting success: 
	setup_srcdst_basic &&
	(
		cd src &&
		git checkout master &&
		test_commit D &&
		git checkout HEAD^0
	) &&
	git ls-remote src refs/heads/master >expect &&
	(
		cd dst &&
		test_commit E &&
		git ls-remote . refs/remotes/origin/master >expect &&
		test_must_fail git push --force-with-lease=master origin master &&
		git ls-remote . refs/remotes/origin/master >actual &&
		test_cmp expect actual
	) &&
	git ls-remote src refs/heads/master >actual &&
	test_cmp expect actual

ok 2 - fetch with no conflict

expecting success: 
	setup_repository ccc \
		"+refs/heads/branch1:refs/remotes/origin/branch1" \
		"+refs/heads/branch2:refs/remotes/origin/branch1" && (
		cd ccc &&
		test_must_fail git fetch origin 2>error &&
		verify_stderr <<-\EOF
		fatal: Cannot fetch both refs/heads/branch1 and refs/heads/branch2 to refs/remotes/origin/branch1
		EOF
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5536-fetch-conflicts/ccc/.git/
Cloning into 'src'...
To dst
 * [new branch]      master -> noop
 * [new branch]      master -> ff
 * [new branch]      master -> noff
From ../testrepo/
 * branch            a6b22cab249ba5160facc1657eff7e4bbd9ed808 -> FETCH_HEAD
tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
author A U Thor <author@example.com> 1112912053 -0700
committer C O Mitter <committer@example.com> 1112912053 -0700

foo
fatal: git cat-file 5e26403b4485d7a44fd8b65dc3f71e21c0dd6fad: bad file
ok 3 - fetch conflict: config vs. config

expecting success: 
	setup_repository dcc \
		"+refs/heads/*:refs/remotes/origin/*" \
		"+refs/heads/branch1:refs/remotes/origin/branch1" && (
		cd dcc &&
		git fetch origin
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5536-fetch-conflicts/dcc/.git/
From ../testrepo/
 * branch            5e26403b4485d7a44fd8b65dc3f71e21c0dd6fad -> FETCH_HEAD
tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
parent a6b22cab249ba5160facc1657eff7e4bbd9ed808
author A U Thor <author@example.com> 1112912053 -0700
committer C O Mitter <committer@example.com> 1112912053 -0700

bar
fatal: git upload-pack: not our ref 64ea4c133d59fa98e86a771eda009872d6ab2886
fatal: The remote end hung up unexpectedly
ok 77 - deny fetch unreachable SHA1, allowtipsha1inwant=false

expecting success: 
	mk_test testrepo heads/master &&
	rm -fr src dst &&
	git init src &&
	(
		cd src &&
		git pull ../testrepo master &&
		git tag -m "annotated" tag &&
		git for-each-ref >tmp1 &&
		(
			cat tmp1
			sed -n "s|refs/heads/master$|refs/remotes/origin/master|p" tmp1
		) |
		sort -k 3 >../expect
	) &&
	git init dst &&
	(
		cd dst &&
		git remote add origin ../src &&
		git config branch.master.remote origin &&
		git config branch.master.merge refs/heads/master &&
		git pull &&
		git for-each-ref >../actual
	) &&
	test_cmp expect actual

Cloning into 'dst'...
To dst
   66fe8b3..566fbd3  ff -> ff
 + 66fe8b3...6391b7f noff -> noff (forced update)
From /«PKGBUILDDIR»/t/trash directory.t5536-fetch-conflicts
 * [new branch]      branch1    -> origin/branch1
 * [new branch]      branch2    -> origin/branch2
 * [new branch]      master     -> origin/master
 * [new tag]         tag1       -> tag1
 * [new tag]         tag2       -> tag2
ok 4 - fetch duplicate: config vs. config

expecting success: 
	setup_repository aoc \
		"+refs/heads/*:refs/remotes/origin/*" && (
		cd aoc &&
		git fetch origin refs/heads/branch2:refs/remotes/origin/branch1
	)

66fe8b3f2df5c2a6e67944af865f3a0893093d69 566fbd34a75c18947f0bcd052512caf55e7144ba refs/heads/ff
66fe8b3f2df5c2a6e67944af865f3a0893093d69 6391b7f36bc1393eab3cad0aaf8c08cdacbe78fa refs/heads/noff
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
66fe8b3f2df5c2a6e67944af865f3a0893093d69 566fbd34a75c18947f0bcd052512caf55e7144ba refs/heads/ff
66fe8b3f2df5c2a6e67944af865f3a0893093d69 6391b7f36bc1393eab3cad0aaf8c08cdacbe78fa refs/heads/noff
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5536-fetch-conflicts/aoc/.git/
ok 6 - signed push sends push certificate

expecting success: 
	prepare_dst &&
	mkdir -p dst/.git/hooks &&
	git -C dst config receive.certnonceseed sekrit &&
	write_script dst/.git/hooks/post-receive <<-\EOF &&
	# discard the update list
	cat >/dev/null
	# record the push certificate
	if test -n "${GIT_PUSH_CERT-}"
	then
		git cat-file blob $GIT_PUSH_CERT >../push-cert
	fi &&

	cat >../push-cert-status <<E_O_F
	SIGNER=${GIT_PUSH_CERT_SIGNER-nobody}
	KEY=${GIT_PUSH_CERT_KEY-nokey}
	STATUS=${GIT_PUSH_CERT_STATUS-nostatus}
	NONCE_STATUS=${GIT_PUSH_CERT_NONCE_STATUS-nononcestatus}
	NONCE=${GIT_PUSH_CERT_NONCE-nononce}
	E_O_F

	EOF

	unset GIT_COMMITTER_EMAIL &&
	git config user.email hasnokey@nowhere.com &&
	test_must_fail git push --signed dst noop ff +noff &&
	git config user.signingkey committer@example.com &&
	git push --signed dst noop ff +noff &&

	(
		cat <<-\EOF &&
		SIGNER=C O Mitter <committer@example.com>
		KEY=13B6F51ECDDE430D
		STATUS=G
		NONCE_STATUS=OK
		EOF
		sed -n -e "s/^nonce /NONCE=/p" -e "/^$/q" dst/push-cert
	) >expect &&

	grep "$(git rev-parse noop ff) refs/heads/ff" dst/push-cert &&
	grep "$(git rev-parse noop noff) refs/heads/noff" dst/push-cert &&
	test_cmp expect dst/push-cert-status

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5534-push-signed/dst/.git/
remote: warning: updating the current branch        
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
From /«PKGBUILDDIR»/t/trash directory.t5536-fetch-conflicts
 * [new branch]      branch2    -> origin/branch1
 * [new tag]         tag2       -> tag2
 * [new branch]      branch2    -> origin/branch2
To dst
 * [new branch]      master -> noop
 * [new branch]      master -> ff
 * [new branch]      master -> noff
 * [new tag]         tag1       -> tag1
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/src/.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 35a8500... C
ok 5 - fetch conflict: arg overrides config

expecting success: 
	setup_repository caa && (
		cd caa &&
		test_must_fail git fetch origin \
			refs/heads/*:refs/remotes/origin/* \
			refs/heads/branch2:refs/remotes/origin/branch1 2>error &&
		verify_stderr <<-\EOF
		fatal: Cannot fetch both refs/heads/branch1 and refs/heads/branch2 to refs/remotes/origin/branch1
		EOF
	)

Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5536-fetch-conflicts/caa/.git/
gpg: skipped "C O Mitter <hasnokey@nowhere.com>": secret key not available
gpg: signing failed: secret key not available
[master be8f64f] D
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 D.t
error: gpg failed to sign the data
fatal: failed to sign the push certificate
fatal: The remote end hung up unexpectedly
From ../testrepo
 * branch            master     -> FETCH_HEAD
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 be8f64f... D
ok 6 - fetch conflict: arg vs. arg

expecting success: 
	setup_repository xaa \
		"+refs/heads/*:refs/remotes/origin/*" && (
		cd xaa &&
		git fetch origin \
			refs/heads/branch1:refs/remotes/origin/branch2 \
			refs/heads/branch2:refs/remotes/origin/branch1 2>error &&
		verify_stderr <<-\EOF
		warning: refs/remotes/origin/branch1 usually tracks refs/heads/branch1, not refs/heads/branch2
		warning: refs/remotes/origin/branch2 usually tracks refs/heads/branch2, not refs/heads/branch1
		EOF
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5536-fetch-conflicts/xaa/.git/
[master 3e7056f] E
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 E.t
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/dst/.git/
To /«PKGBUILDDIR»/t/trash directory.t5533-push-cas/src
 ! [rejected]        master -> master (stale info)
error: failed to push some refs to '/«PKGBUILDDIR»/t/trash directory.t5533-push-cas/src'
To dst
   66fe8b3..566fbd3  ff -> ff
 + 66fe8b3...6391b7f noff -> noff (forced update)
66fe8b3f2df5c2a6e67944af865f3a0893093d69 566fbd34a75c18947f0bcd052512caf55e7144ba refs/heads/ff
66fe8b3f2df5c2a6e67944af865f3a0893093d69 6391b7f36bc1393eab3cad0aaf8c08cdacbe78fa refs/heads/noff
ok 4 - push to update (protected, tracking)

expecting success: 
	setup_srcdst_basic &&
	(
		cd src &&
		git checkout master &&
		test_commit D &&
		git checkout HEAD^0
	) &&
	(
		cd dst &&
		test_commit E &&
		git ls-remote . refs/remotes/origin/master >expect &&
		git push --force --force-with-lease=master origin master
	) &&
	git ls-remote dst refs/heads/master >expect &&
	git ls-remote src refs/heads/master >actual &&
	test_cmp expect actual

ok 7 - fetch conflict: criss-cross args

# passed all 7 test(s)
1..7
66fe8b3f2df5c2a6e67944af865f3a0893093d69 566fbd34a75c18947f0bcd052512caf55e7144ba refs/heads/ff
66fe8b3f2df5c2a6e67944af865f3a0893093d69 6391b7f36bc1393eab3cad0aaf8c08cdacbe78fa refs/heads/noff
ok 7 - fail without key and heed user.signingkey

From ../src
 * [new branch]      master     -> origin/master
 * [new tag]         tag        -> tag
# passed all 7 test(s)
1..7
Cloning into 'src'...
ok 78 - fetch follows tags by default

expecting success: 
	mk_test testrepo heads/master &&
	rm -fr src dst &&
	git init src &&
	git init --bare dst &&
	(
		cd src &&
		git pull ../testrepo master &&
		git branch next &&
		git config remote.dst.url ../dst &&
		git config remote.dst.push "+refs/heads/*:refs/remotes/src/*" &&
		git push dst master &&
		git show-ref refs/heads/master |
		sed -e "s|refs/heads/|refs/remotes/src/|" >../dst/expect
	) &&
	(
		cd dst &&
		test_must_fail git show-ref refs/heads/next &&
		test_must_fail git show-ref refs/heads/master &&
		git show-ref refs/remotes/src/master >actual
	) &&
	test_cmp dst/expect dst/actual

*** t5537-fetch-shallow.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
*** t5538-push-shallow.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5537-fetch-shallow/.git/
expecting success: 
	commit 1 &&
	commit 2 &&
	commit 3 &&
	commit 4 &&
	git config --global transfer.fsckObjects true

remote: warning: updating the current branch        
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
[master (root-commit) 295f0d6] 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 tracked
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5538-push-shallow/.git/
expecting success: 
	git config --global transfer.fsckObjects true &&
	commit 1 &&
	commit 2 &&
	commit 3 &&
	commit 4 &&
	git clone . full &&
	(
	git init full-abc &&
	cd full-abc &&
	commit a &&
	commit b &&
	commit c
	) &&
	git clone --no-local --depth=2 .git shallow &&
	git --git-dir=shallow/.git log --format=%s >actual &&
	cat <<EOF >expect &&
4
3
EOF
	test_cmp expect actual &&
	git clone --no-local --depth=2 full-abc/.git shallow2 &&
	git --git-dir=shallow2/.git log --format=%s >actual &&
	cat <<EOF >expect &&
c
b
EOF
	test_cmp expect actual

[master e82d92e] 2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'dst'...
[master (root-commit) 295f0d6] 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 tracked
[master 433a7d8] 3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/src/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/dst/
[master b59a05e] 4
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master e82d92e] 2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - setup

expecting success: 
	git clone --no-local --depth=2 .git shallow &&
	git --git-dir=shallow/.git log --format=%s >actual &&
	cat <<EOF >expect &&
4
3
EOF
	test_cmp expect actual

Cloning into 'shallow'...
[master 433a7d8] 3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
From ../testrepo
 * branch            master     -> FETCH_HEAD
[master b59a05e] 4
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'full'...
done.
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 35a8500... C
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5538-push-shallow/full-abc/.git/
[master be8f64f] D
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 D.t
To ../dst
 * [new branch]      master -> src/master
[master (root-commit) 349fcfe] a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 tracked
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 be8f64f... D
ok 2 - setup shallow clone

expecting success: 
	git clone --no-local shallow shallow2 &&
	(
	cd shallow2 &&
	git fsck &&
	git log --format=%s >actual &&
	cat <<EOF >expect &&
4
3
EOF
	test_cmp expect actual
	)

ok 79 - pushing a specific ref applies remote.$name.push as refmap

expecting success: 
	mk_test testrepo heads/master &&
	rm -fr src dst &&
	git init src &&
	git init --bare dst &&
	(
		cd src &&
		git pull ../testrepo master &&
		git branch next &&
		git config remote.dst.url ../dst &&
		git config push.default matching &&
		git push dst master &&
		git show-ref refs/heads/master >../dst/expect
	) &&
	(
		cd dst &&
		test_must_fail git show-ref refs/heads/next &&
		git show-ref refs/heads/master >actual
	) &&
	test_cmp dst/expect dst/actual

[master eb9f896] b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'shallow2'...
[master 3e7056f] E
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 E.t
[master 3317c0a] c
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'shallow'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
remote: warning: updating the current branch        
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
To /«PKGBUILDDIR»/t/trash directory.t5533-push-cas/src
 + be8f64f...3e7056f master -> master (forced update)
ok 5 - push to update (protected, tracking, forced)

expecting success: 
	setup_srcdst_basic &&
	(
		cd dst &&
		test_commit D &&
		git push --force-with-lease=master:master^ origin master
	) &&
	git ls-remote dst refs/heads/master >expect &&
	git ls-remote src refs/heads/master >actual &&
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/src/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/dst/
ok 3 - clone from shallow clone

expecting success: 
	(
	cd shallow &&
	commit 5
	) &&
	(
	cd shallow2 &&
	git fetch &&
	git fsck &&
	git log --format=%s origin/master >actual &&
	cat <<EOF >expect &&
5
4
3
EOF
	test_cmp expect actual
	)

Cloning into 'src'...
Cloning into 'shallow2'...
[master be24cc4] 5
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
From ../testrepo
 * branch            master     -> FETCH_HEAD
From /«PKGBUILDDIR»/t/trash directory.t5537-fetch-shallow/shallow
   b59a05e..be24cc4  master     -> origin/master
ok 4 - fetch from shallow clone

expecting success: 
	(
	cd shallow &&
	commit 6
	) &&
	(
	cd shallow2 &&
	git fetch --depth=2 &&
	git fsck &&
	git log --format=%s origin/master >actual &&
	cat <<EOF >expect &&
6
5
EOF
	test_cmp expect actual
	)

To ../dst
 * [new branch]      master -> master
[master eab55ab] 6
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 80 - with no remote.$name.push, it is not used as refmap

expecting success: 
	mk_test testrepo heads/master &&
	rm -fr src dst &&
	git init src &&
	git init --bare dst &&
	(
		cd src &&
		git pull ../testrepo master &&
		git branch next &&
		git config remote.dst.url ../dst &&
		git config remote.dst.fetch "+refs/heads/*:refs/remotes/dst/*" &&
		git config push.default upstream &&

		git config branch.master.merge refs/heads/trunk &&
		git config branch.master.remote dst &&

		git push dst master &&
		git show-ref refs/heads/master |
		sed -e "s|refs/heads/master|refs/heads/trunk|" >../dst/expect
	) &&
	(
		cd dst &&
		test_must_fail git show-ref refs/heads/master &&
		test_must_fail git show-ref refs/heads/next &&
		git show-ref refs/heads/trunk >actual
	) &&
	test_cmp dst/expect dst/actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
Cloning into 'dst'...
From /«PKGBUILDDIR»/t/trash directory.t5537-fetch-shallow/shallow
   be24cc4..eab55ab  master     -> origin/master
ok 1 - setup

expecting success: 
	(
	cd shallow &&
	commit 5 &&
	git push ../.git +master:refs/remotes/shallow/master
	) &&
	git log --format=%s shallow/master >actual &&
	git fsck &&
	cat <<EOF >expect &&
5
4
3
2
1
EOF
	test_cmp expect actual

ok 5 - fetch --depth from shallow clone

expecting success: 
	(
	cd shallow2 &&
	git fetch --unshallow &&
	git fsck &&
	git log --format=%s origin/master >actual &&
	cat <<EOF >expect &&
6
5
4
3
EOF
	test_cmp expect actual
	)

remote: warning: updating the current branch        
[master be24cc4] 5
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
To ../.git
 * [new branch]      master -> shallow/master
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/src/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/dst/
ok 6 - fetch --unshallow from shallow clone

expecting success: 
	# the blob "1" is available in .git but hidden by the
	# shallow2/.git/shallow and it should be resent
	! git --git-dir=shallow2/.git cat-file blob `echo 1|git hash-object --stdin` >/dev/null &&
	echo 1 >1.t &&
	git add 1.t &&
	git commit -m add-1-back &&
	(
	cd shallow2 &&
	git fetch ../.git +refs/heads/master:refs/remotes/top/master &&
	git fsck &&
	git log --format=%s top/master >actual &&
	cat <<EOF >expect &&
add-1-back
4
3
EOF
	test_cmp expect actual
	) &&
	git --git-dir=shallow2/.git cat-file blob `echo 1|git hash-object --stdin` >/dev/null


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 35a8500... C
ok 2 - push from shallow clone

expecting success: 
	(
	cd shallow2 &&
	test_must_fail git push ../.git +master:refs/remotes/shallow2/master 2>err &&
	grep "shallow2/master.*shallow update not allowed" err
	) &&
	test_must_fail git rev-parse shallow2/master &&
	git fsck

fatal: git cat-file d00491fd7e5bb6fa28c517a0bb32b8b506539d4d: bad file
[master be8f64f] D
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 D.t
[master 4184a5b] add-1-back
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 1.t
From ../testrepo
 * branch            master     -> FETCH_HEAD
 ! [remote rejected] master -> shallow2/master (shallow update not allowed)
fatal: ambiguous argument 'shallow2/master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
shallow2/master
dangling commit 3317c0a1bec5e3d0c89ba69f802a1d0f8f6f67bd
ok 3 - push from shallow clone, with grafted roots

expecting success: 
	test_config receive.shallowupdate true &&
	(
	cd shallow2 &&
	git push ../.git +master:refs/remotes/shallow2/master
	) &&
	git log --format=%s shallow2/master >actual &&
	git fsck &&
	cat <<EOF >expect &&
c
b
EOF
	test_cmp expect actual

From ../
 * [new branch]      master     -> top/master
To /«PKGBUILDDIR»/t/trash directory.t5533-push-cas/src
   35a8500..be8f64f  master -> master
ok 6 - push to update (allowed)

expecting success: 
	setup_srcdst_basic &&
	(
		cd dst &&
		test_commit D &&
		git push --force-with-lease=master origin master
	) &&
	git ls-remote dst refs/heads/master >expect &&
	git ls-remote src refs/heads/master >actual &&
	test_cmp expect actual

error: Could not read 349fcfe9a23a595e4b83119bc19c50d00bd78646
ok 7 - fetch something upstream has but hidden by clients shallow boundaries

expecting success: 
	(
	cd shallow &&
	git checkout --orphan no-shallow &&
	commit no-shallow
	) &&
	git init notshallow &&
	(
	cd notshallow &&
	git fetch ../shallow/.git refs/heads/*:refs/remotes/shallow/*&&
	git for-each-ref --format="%(refname)" >actual.refs &&
	cat <<EOF >expect.refs &&
refs/remotes/shallow/no-shallow
EOF
	test_cmp expect.refs actual.refs &&
	git log --format=%s shallow/no-shallow >actual &&
	cat <<EOF >expect &&
no-shallow
EOF
	test_cmp expect actual
	)

To ../.git
 * [new branch]      master -> shallow2/master
Switched to a new branch 'no-shallow'
To ../dst
 * [new branch]      master -> trunk
Cloning into 'src'...
[no-shallow (root-commit) 9049a79] no-shallow
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 tracked
ok 4 - add new shallow root with receive.updateshallow on

expecting success: 
	(
	cd shallow &&
	git --git-dir=../shallow2/.git config receive.shallowupdate true &&
	git push ../shallow2/.git +master:refs/remotes/shallow/master &&
	git --git-dir=../shallow2/.git config receive.shallowupdate false
	) &&
	(
	cd shallow2 &&
	git log --format=%s shallow/master >actual &&
	git fsck &&
	cat <<EOF >expect &&
5
4
3
EOF
	test_cmp expect actual
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5537-fetch-shallow/notshallow/.git/
ok 81 - with no remote.$name.push, upstream mapping is used

expecting success: 
	mk_test testrepo heads/master &&
	rm -fr src dst &&
	git init src &&
	git init --bare dst &&
	(
		cd src &&
		git pull ../testrepo master &&
		git tag -m "annotated" tag &&
		git checkout -b another &&
		git commit --allow-empty -m "future commit" &&
		git tag -m "future" future &&
		git checkout master &&
		git for-each-ref refs/heads/master >../expect &&
		git push ../dst master
	) &&
	(
		cd dst &&
		git for-each-ref >../actual
	) &&
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
To ../shallow2/.git
 * [new branch]      master -> shallow/master
warning: reject refs/remotes/shallow/master because shallow roots are not allowed to be updated
From ../shallow/
 * [new branch]      no-shallow -> shallow/no-shallow
remote: warning: updating the current branch        
ok 5 - push from shallow to shallow

expecting success: 
	! git --git-dir=shallow2/.git cat-file blob `echo 1|git hash-object --stdin` &&
	commit 1 &&
	git push shallow2/.git +master:refs/remotes/top/master &&
	(
	cd shallow2 &&
	git log --format=%s top/master >actual &&
	git fsck &&
	cat <<EOF >expect &&
1
4
3
EOF
	test_cmp expect actual &&
	git cat-file blob `echo 1|git hash-object --stdin` >/dev/null
	)

To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
ok 8 - fetch that requires changes in .git/shallow is filtered

expecting success: 
	(
	cd shallow &&
	git checkout master &&
	commit 7 &&
	git tag -m foo heavy-tag HEAD^ &&
	git tag light-tag HEAD^:tracked
	) &&
	(
	cd notshallow &&
	git fetch --update-shallow ../shallow/.git refs/heads/*:refs/remotes/shallow/* &&
	git fsck &&
	git for-each-ref --sort=refname --format="%(refname)" >actual.refs &&
	cat <<EOF >expect.refs &&
refs/remotes/shallow/master
refs/remotes/shallow/no-shallow
refs/tags/heavy-tag
refs/tags/light-tag
EOF
	test_cmp expect.refs actual.refs &&
	git log --format=%s shallow/master >actual &&
	cat <<EOF >expect &&
7
6
5
4
3
EOF
	test_cmp expect actual
	)

fatal: git cat-file d00491fd7e5bb6fa28c517a0bb32b8b506539d4d: bad file
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 2 commits.
  (use "git push" to publish your local commits)
[master 5263165] 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'dst'...
[master bd6e0fb] 7
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/src/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/dst/
To shallow2/.git
 * [new branch]      master -> top/master
error: Could not read e82d92e599306cd6533ec33f11de1883ec66f3a8
From ../testrepo
 * branch            master     -> FETCH_HEAD
From ../shallow/
 * [new branch]      master     -> shallow/master
 * [new tag]         heavy-tag  -> heavy-tag
 * [new tag]         light-tag  -> light-tag
ok 6 - push from full to shallow

# passed all 6 test(s)
1..6
notice: HEAD points to an unborn branch (master)
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 35a8500... C
Switched to a new branch 'another'
[another 951b7f2] future commit
 Author: A U Thor <author@example.com>
ok 9 - fetch --update-shallow

[master be8f64f] D
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 D.t
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

)
Switched to branch 'master'
rm: cannot remove 'SANETESTD.1/x': Permission denied
prerequisite SANITY ok
expecting success: 
	cp -R .git read-only.git &&
	find read-only.git -print | xargs chmod -w &&
	test_when_finished "find read-only.git -type d -print | xargs chmod +w" &&
	git clone --no-local --depth=2 read-only.git from-read-only &&
	git --git-dir=from-read-only/.git log --format=%s >actual &&
	cat >expect <<EOF &&
add-1-back
4
EOF
	test_cmp expect actual

*** t5539-fetch-http-shallow.sh ***
To ../dst
 * [new branch]      master -> master
To /«PKGBUILDDIR»/t/trash directory.t5533-push-cas/src
   35a8500..be8f64f  master -> master
ok 82 - push does not follow tags by default

expecting success: 
	mk_test testrepo heads/master &&
	rm -fr src dst &&
	git init src &&
	git init --bare dst &&
	(
		cd src &&
		git pull ../testrepo master &&
		git tag -m "annotated" tag &&
		git checkout -b another &&
		git commit --allow-empty -m "future commit" &&
		git tag -m "future" future &&
		git checkout master &&
		git for-each-ref refs/heads/master refs/tags/tag >../expect
		git push --follow-tag ../dst master
	) &&
	(
		cd dst &&
		git for-each-ref >../actual
	) &&
	test_cmp expect actual

Cloning into 'from-read-only'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5539-fetch-http-shallow/.git/
checking prerequisite: NOT_ROOT

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	uid=$(id -u) &&
	test "$uid" != 0

)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
ok 7 - push to update (allowed, tracking)

expecting success: 
	setup_srcdst_basic &&
	(
		cd dst &&
		git reset --hard HEAD^ &&
		test_commit D &&
		git push --force-with-lease=master origin master
	) &&
	git ls-remote dst refs/heads/master >expect &&
	git ls-remote src refs/heads/master >actual &&
	test_cmp expect actual

prerequisite NOT_ROOT ok
1..0 # SKIP no web server found at '/usr/sbin/apache2'
*** t5540-http-push-webdav.sh ***
Cloning into 'src'...
remote: warning: updating the current branch        
To testrepo
 * [new branch]      b9c09d6cc74d3857142fb7c082dca65b88254c6d -> master
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5540-http-push-webdav/.git/
ok 10 - shallow fetch from a read-only repo

checking prerequisite: NOT_ROOT

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	uid=$(id -u) &&
	test "$uid" != 0

)
# passed all 10 test(s)
1..10
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/src/.git/
prerequisite NOT_ROOT ok
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/dst/
1..0 # SKIP no web server found at '/usr/sbin/apache2'
*** t5541-http-push-smart.sh ***
Cloning into 'dst'...
From ../testrepo
 * branch            master     -> FETCH_HEAD
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5541-http-push-smart/.git/
*** t5542-push-http-shallow.sh ***
Switched to a new branch 'another'
[another 951b7f2] future commit
 Author: A U Thor <author@example.com>
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5542-push-http-shallow/.git/
Switched to branch 'master'
checking prerequisite: NOT_ROOT

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	uid=$(id -u) &&
	test "$uid" != 0

)
prerequisite NOT_ROOT ok
1..0 # SKIP no web server found at '/usr/sbin/apache2'
*** t5543-atomic-push.sh ***
To ../dst
 * [new branch]      master -> master
 * [new tag]         tag -> tag
ok 83 - push --follow-tag only pushes relevant tags

expecting success: 
	cat >>path1 <<\EOF &&
keep base version of path1 big enough, compared to the new changes
later, in order to pass size heuristics in
builtin/pack-objects.c:try_delta()
EOF
	git commit -am initial &&
	git init no-thin &&
	git --git-dir=no-thin/.git config receive.unpacklimit 0 &&
	git push no-thin/.git refs/heads/master:refs/heads/foo &&
	echo modified >> path1 &&
	git commit -am modified &&
	git repack -adf &&
	rcvpck="git receive-pack --reject-thin-pack-for-testing" &&
	git push --no-thin --receive-pack="$rcvpck" no-thin/.git refs/heads/master:refs/heads/foo

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>

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5543-atomic-push/.git/
HEAD is now at 35a8500... C
[master 40adbea] initial
 Author: A U Thor <author@example.com>
 1 file changed, 3 insertions(+)
expecting success: 
	mk_repo_pair &&
	(
		cd workbench &&
		test_commit one &&
		git push --mirror up &&
		test_commit two &&
		git push --atomic up master
	) &&
	test_refs master master

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/no-thin/.git/
HEAD is now at d9df450 B
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5543-atomic-push/upstream/.git/
[master 3e6e33e] D
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 D.t
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5543-atomic-push/workbench/.git/
[master (root-commit) d79ce16] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
checking prerequisite: NOT_ROOT

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	uid=$(id -u) &&
	test "$uid" != 0

)
To /«PKGBUILDDIR»/t/trash directory.t5533-push-cas/src
   35a8500..3e6e33e  master -> master
prerequisite NOT_ROOT ok
1..0 # SKIP no web server found at '/usr/sbin/apache2'
*** t5550-http-fetch-dumb.sh ***
remote: warning: updating the current branch        
ok 8 - push to update (allowed even though no-ff)

expecting success: 
	setup_srcdst_basic &&
	git ls-remote src refs/heads/master >expect &&
	(
		cd dst &&
		test_must_fail git push --force-with-lease=master:master^ origin :master
	) &&
	git ls-remote src refs/heads/master >actual &&
	test_cmp expect actual

To ../upstream
 * [new branch]      master -> master
 * [new tag]         one -> one
To no-thin/.git
 * [new branch]      master -> foo
[master 7ee1f22] modified
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master 139b20d] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two.t
Cloning into 'src'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5550-http-fetch-dumb/.git/
checking prerequisite: NOT_ROOT

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	uid=$(id -u) &&
	test "$uid" != 0

)
prerequisite NOT_ROOT ok
1..0 # SKIP no web server found at '/usr/sbin/apache2'
*** t5551-http-fetch-smart.sh ***
remote: warning: updating the current branch        
To ../upstream
   d79ce16..139b20d  master -> master
ok 1 - atomic push works for a single branch

expecting success: 
	mk_repo_pair &&
	(
		cd workbench &&
		test_commit one &&
		git branch second &&
		git push --mirror up &&
		test_commit two &&
		git checkout second &&
		test_commit three &&
		git push --atomic up master second
	) &&
	test_refs master master &&
	test_refs second second

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5551-http-fetch-smart/.git/
checking prerequisite: NOT_ROOT

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	uid=$(id -u) &&
	test "$uid" != 0

)
prerequisite NOT_ROOT ok
1..0 # SKIP no web server found at '/usr/sbin/apache2'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5543-atomic-push/upstream/.git/
*** t5560-http-backend-noserver.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5543-atomic-push/workbench/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5560-http-backend-noserver/.git/
Cloning into 'dst'...
expecting success: 
	echo content >file &&
	git add file &&
	git commit -m one &&

	mkdir "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
	(cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
	 git --bare init &&
	 : >objects/info/alternates &&
	 : >objects/info/http-alternates
	) &&
	git remote add public "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
	git push public master:master &&

	(cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
	 git repack -a -d
	) &&

	echo other >file &&
	git add file &&
	git commit -m two &&
	git push public master:master &&

	LOOSE_URL=$(find_file objects/??) &&
	PACK_URL=$(find_file objects/pack/*.pack) &&
	IDX_URL=$(find_file objects/pack/*.idx)

[master (root-commit) d79ce16] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
[master (root-commit) 77e1a54] one
 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.t5560-http-backend-noserver/repo.git/
remote: warning: updating the current branch        
To no-thin/.git
   40adbea..7ee1f22  master -> foo
To ../upstream
 * [new branch]      master -> master
 * [new branch]      second -> second
 * [new tag]         one -> one
ok 84 - push --no-thin must produce non-thin pack

expecting success: 
	rm -rf dst.git &&
	blob=$(echo unreferenced | git hash-object -w --stdin) &&
	git tag -m foo tag-of-blob $blob &&
	git init --bare dst.git &&
	git push dst.git tag-of-blob &&
	# the receiving index-pack should have noticed
	# any problems, but we double check
	echo unreferenced >expect &&
	git --git-dir=dst.git cat-file blob tag-of-blob >actual &&
	test_cmp expect actual

To /«PKGBUILDDIR»/t/trash directory.t5560-http-backend-noserver/repo.git
 * [new branch]      master -> master
[master 139b20d] 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.t5516-fetch-push/dst.git/
Switched to branch 'second'
[second 897c206] three
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 three.t
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 35a8500... C
To dst.git
 * [new tag]         tag-of-blob -> tag-of-blob
ok 85 - pushing a tag pushes the tagged object

expecting success: 
	rm -rf dst.git &&
	git init --bare dst.git &&
	git -C dst.git config core.logallrefupdates true &&

	# double push to test both with and without
	# the actual pack transfer
	git push dst.git master:one &&
	echo "one@{0} push" >expect &&
	git -C dst.git log -g --format="%gd %gs" one >actual &&
	test_cmp expect actual &&

	git push dst.git master:two &&
	echo "two@{0} push" >expect &&
	git -C dst.git log -g --format="%gd %gs" two >actual &&
	test_cmp expect actual

To /«PKGBUILDDIR»/t/trash directory.t5533-push-cas/src
 ! [rejected]        (delete) -> master (stale info)
error: failed to push some refs to '/«PKGBUILDDIR»/t/trash directory.t5533-push-cas/src'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/dst.git/
ok 9 - push to delete (protected)

expecting success: 
	setup_srcdst_basic &&
	(
		cd dst &&
		git push --force --force-with-lease=master:master^ origin :master
	) &&
	>expect &&
	git ls-remote src refs/heads/master >actual &&
	test_cmp expect actual

remote: warning: updating the current branch        
To ../upstream
   d79ce16..139b20d  master -> master
   d79ce16..897c206  second -> second
Cloning into 'src'...
ok 2 - atomic push works for two branches

expecting success: 
	mk_repo_pair &&
	(
		cd workbench &&
		test_commit one &&
		git checkout -b second &&
		test_commit two &&
		git push --atomic --mirror up
	) &&
	test_refs master master &&
	test_refs second second

[master f3145f9] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
To dst.git
 * [new branch]      master -> one
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5543-atomic-push/upstream/.git/
To /«PKGBUILDDIR»/t/trash directory.t5560-http-backend-noserver/repo.git
   77e1a54..f3145f9  master -> master
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5543-atomic-push/workbench/.git/
To dst.git
 * [new branch]      master -> two
ok 1 - setup repository

expecting success: 
	GET refs/heads/master "404 Not Found"

ok 86 - push into bare respects core.logallrefupdates

expecting success: 
	rm -rf dst.git &&
	git init --bare dst.git &&
	(
		cd dst.git &&
		git config core.logallrefupdates true &&

		# as above, we double-fetch to test both
		# with and without pack transfer
		git fetch .. master:one &&
		echo "one@{0} fetch .. master:one: storing head" >expect &&
		git log -g --format="%gd %gs" one >actual &&
		test_cmp expect actual &&

		git fetch .. master:two &&
		echo "two@{0} fetch .. master:two: storing head" >expect &&
		git log -g --format="%gd %gs" two >actual &&
		test_cmp expect actual
	)

ok 2 - direct refs/heads/master not found

expecting success: 
	get_static_files "200 OK"

[master (root-commit) d79ce16] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/dst.git/
Cloning into 'dst'...
Switched to a new branch 'second'
[second 139b20d] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two.t
From ..
 * [new branch]      master     -> one
 * [new tag]         deltag     -> deltag
 * [new tag]         frotz      -> frotz
 * [new tag]         v1.0       -> v1.0
remote: warning: updating the current branch        
To ../upstream
 * [new branch]      master -> master
 * [new branch]      second -> second
 * [new tag]         one -> one
 * [new tag]         two -> two
From ..
 * [new branch]      master     -> two
ok 3 - atomic push works in combination with --mirror

expecting success: 
	mk_repo_pair &&
	(
		cd workbench &&
		test_commit one &&
		git branch second master &&
		test_commit two_a &&
		git checkout second &&
		test_commit two_b &&
		test_commit three_b &&
		test_commit four &&
		git push --mirror up &&
		# The actual test is below
		git checkout master &&
		test_commit three_a &&
		git checkout second &&
		git reset --hard HEAD^ &&
		git push --force --atomic up master second
	) &&
	test_refs master master &&
	test_refs second second

ok 3 - static file is ok

expecting success: 
	get_static_files "404 Not Found"

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 35a8500... C
ok 87 - fetch into bare respects core.logallrefupdates

expecting success: 
	git push testrepo master &&
	(
		cd testrepo &&
		git reset --hard &&
		git config receive.denyCurrentBranch updateInstead
	) &&
	test_commit third path2 &&

	# Try pushing into a repository with pristine working tree
	git push testrepo master &&
	(
		cd testrepo &&
		git update-index -q --refresh &&
		git diff-files --quiet -- &&
		git diff-index --quiet --cached HEAD -- &&
		test third = "$(cat path2)" &&
		test $(git -C .. rev-parse HEAD) = $(git rev-parse HEAD)
	) &&

	# Try pushing into a repository with working tree needing a refresh
	(
		cd testrepo &&
		git reset --hard HEAD^ &&
		test $(git -C .. rev-parse HEAD^) = $(git rev-parse HEAD) &&
		test-chmtime +100 path1
	) &&
	git push testrepo master &&
	(
		cd testrepo &&
		git update-index -q --refresh &&
		git diff-files --quiet -- &&
		git diff-index --quiet --cached HEAD -- &&
		test_cmp ../path1 path1 &&
		test third = "$(cat path2)" &&
		test $(git -C .. rev-parse HEAD) = $(git rev-parse HEAD)
	) &&

	# Update what is to be pushed
	test_commit fourth path2 &&

	# Try pushing into a repository with a dirty working tree
	# (1) the working tree updated
	(
		cd testrepo &&
		echo changed >path1
	) &&
	test_must_fail git push testrepo master &&
	(
		cd testrepo &&
		test $(git -C .. rev-parse HEAD^) = $(git rev-parse HEAD) &&
		git diff --quiet --cached &&
		test changed = "$(cat path1)"
	) &&

	# (2) the index updated
	(
		cd testrepo &&
		echo changed >path1 &&
		git add path1
	) &&
	test_must_fail git push testrepo master &&
	(
		cd testrepo &&
		test $(git -C .. rev-parse HEAD^) = $(git rev-parse HEAD) &&
		git diff --quiet &&
		test changed = "$(cat path1)"
	) &&

	# Introduce a new file in the update
	test_commit fifth path3 &&

	# (3) the working tree has an untracked file that would interfere
	(
		cd testrepo &&
		git reset --hard &&
		echo changed >path3
	) &&
	test_must_fail git push testrepo master &&
	(
		cd testrepo &&
		test $(git -C .. rev-parse HEAD^^) = $(git rev-parse HEAD) &&
		git diff --quiet &&
		git diff --quiet --cached &&
		test changed = "$(cat path3)"
	) &&

	# (4) the target changes to what gets pushed but it still is a change
	(
		cd testrepo &&
		git reset --hard &&
		echo fifth >path3 &&
		git add path3
	) &&
	test_must_fail git push testrepo master &&
	(
		cd testrepo &&
		test $(git -C .. rev-parse HEAD^^) = $(git rev-parse HEAD) &&
		git diff --quiet &&
		test fifth = "$(cat path3)"
	) &&

	# (5) push into void
	rm -fr void &&
	git init void &&
	(
		cd void &&
		git config receive.denyCurrentBranch updateInstead
	) &&
	git push void master &&
	(
		cd void &&
		test $(git -C .. rev-parse master) = $(git rev-parse HEAD) &&
		git diff --quiet &&
		git diff --cached --quiet
	)

To /«PKGBUILDDIR»/t/trash directory.t5533-push-cas/src
 - [deleted]         master
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5543-atomic-push/upstream/.git/
ok 10 - push to delete (protected, forced)

expecting success: 
	setup_srcdst_basic &&
	(
		cd dst &&
		git push --force-with-lease=master origin :master
	) &&
	>expect &&
	git ls-remote src refs/heads/master >actual &&
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5543-atomic-push/workbench/.git/
remote: warning: updating the current branch        
To testrepo
   b9c09d6..7ee1f22  master -> master
Cloning into 'src'...
HEAD is now at 7ee1f22 modified
[master (root-commit) d79ce16] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
[master af7aa26] third
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master 0fd3f08] two_a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two_a.t
ok 4 - no export by default

expecting success: 
        (cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
	 touch git-daemon-export-ok
	) &&
        get_static_files "200 OK"

Switched to branch 'second'
[second 476acd6] two_b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two_b.t
Cloning into 'dst'...
To testrepo
   7ee1f22..af7aa26  master -> master
[second 04c72ee] three_b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 three_b.t
HEAD is now at 7ee1f22 modified
[second f7b7ae4] four
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 four.t
ok 5 - export if git-daemon-export-ok

expecting success: 
	config http.getanyfile true &&
	get_static_files "200 OK"

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 35a8500... C
remote: warning: updating the current branch        
To /«PKGBUILDDIR»/t/trash directory.t5533-push-cas/src
 - [deleted]         master
To ../upstream
 * [new branch]      master -> master
 * [new branch]      second -> second
 * [new tag]         four -> four
 * [new tag]         one -> one
 * [new tag]         three_b -> three_b
 * [new tag]         two_a -> two_a
 * [new tag]         two_b -> two_b
To testrepo
   7ee1f22..af7aa26  master -> master
ok 11 - push to delete (allowed)

expecting success: 
	setup_srcdst_basic &&
	(
		cd src &&
		git branch naster master^
	) &&
	git ls-remote src refs/heads/\* >expect &&
	(
		cd dst &&
		test_must_fail git push --force-with-lease origin master master:naster
	) &&
	git ls-remote src refs/heads/\* >actual &&
	test_cmp expect actual

Switched to branch 'master'
[master 6413866] three_a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 three_a.t
Cloning into 'src'...
Switched to branch 'second'
[master 1b12869] fourth
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
HEAD is now at 04c72ee three_b
ok 6 - static file if http.getanyfile true is ok

expecting success: 
	config http.getanyfile false &&
	get_static_files "403 Forbidden"

remote: warning: updating the current branch        
To ../upstream
   0fd3f08..6413866  master -> master
 + f7b7ae4...04c72ee second -> second (forced update)
To testrepo
 ! [remote rejected] master -> master (Working directory has unstaged changes)
error: failed to push some refs to 'testrepo'
ok 4 - atomic push works in combination with --force

expecting success: 
	mk_repo_pair &&
	(
		cd workbench &&
		test_commit one &&
		git checkout -b second master &&
		test_commit two &&
		test_commit three &&
		test_commit four &&
		git push --mirror up &&
		git reset --hard HEAD~2 &&
		test_commit five &&
		git checkout master &&
		test_commit six &&
		test_must_fail git push --atomic --all up
	) &&
	test_refs master HEAD@{7} &&
	test_refs second HEAD@{4}

Cloning into 'dst'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5543-atomic-push/upstream/.git/
To testrepo
 ! [remote rejected] master -> master (Working directory has staged changes)
error: failed to push some refs to 'testrepo'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5543-atomic-push/workbench/.git/
ok 7 - static file if http.getanyfile false fails

expecting success: 
	GET info/refs?service=git-upload-pack "200 OK"  &&
	POST git-upload-pack 0000 "200 OK"

[master 99d9406] fifth
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 path3
[master (root-commit) d79ce16] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
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 35a8500... C
HEAD is now at af7aa26 third
Switched to a new branch 'second'
[second 139b20d] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two.t
ok 8 - http.uploadpack default enabled

expecting success: 
	config http.uploadpack true &&
	GET info/refs?service=git-upload-pack "200 OK" &&
	POST git-upload-pack 0000 "200 OK"

To /«PKGBUILDDIR»/t/trash directory.t5533-push-cas/src
 ! [rejected]        master -> naster (stale info)
error: failed to push some refs to '/«PKGBUILDDIR»/t/trash directory.t5533-push-cas/src'
ok 12 - cover everything with default force-with-lease (protected)

expecting success: 
	setup_srcdst_basic &&
	(
		cd src &&
		git branch naster master^
	) &&
	(
		cd dst &&
		git fetch &&
		git push --force-with-lease origin master master:naster
	) &&
	git ls-remote dst refs/heads/master |
	sed -e "s/master/naster/" >expect &&
	git ls-remote src refs/heads/naster >actual &&
	test_cmp expect actual

[second 7c7cd71] three
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 three.t
error: Untracked working tree file 'path3' would be overwritten by merge.
To testrepo
 ! [remote rejected] master -> master (Could not update working tree to new HEAD)
error: failed to push some refs to 'testrepo'
Cloning into 'src'...
[second fd8d77e] four
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 four.t
ok 9 - http.uploadpack true

expecting success: 
	config http.uploadpack false &&
	GET info/refs?service=git-upload-pack "403 Forbidden" &&
	POST git-upload-pack 0000 "403 Forbidden"

HEAD is now at af7aa26 third
ok 10 - http.uploadpack false

expecting success: 
	GET info/refs?service=git-receive-pack "403 Forbidden"  &&
	POST git-receive-pack 0000 "403 Forbidden"

remote: warning: updating the current branch        
To ../upstream
 * [new branch]      master -> master
 * [new branch]      second -> second
 * [new tag]         four -> four
 * [new tag]         one -> one
 * [new tag]         three -> three
 * [new tag]         two -> two
ok 11 - http.receivepack default disabled

expecting success: 
	config http.receivepack true &&
	GET info/refs?service=git-receive-pack "200 OK" &&
	POST git-receive-pack 0000 "200 OK"

HEAD is now at 139b20d two
Cloning into 'dst'...
[second a9f66f4] five
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 five.t
To testrepo
 ! [remote rejected] master -> master (Working directory has staged changes)
error: failed to push some refs to 'testrepo'
Switched to branch 'master'
ok 12 - http.receivepack true

expecting success: 
	config http.receivepack false &&
	GET info/refs?service=git-receive-pack "403 Forbidden" &&
	POST git-receive-pack 0000 "403 Forbidden"

[master 29c9ea2] six
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 six.t
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/void/.git/
error: atomic push failed for ref refs/heads/second. status: 2

fatal: The remote end hung up unexpectedly
To ../upstream
 ! [rejected]        master -> master (atomic push failed)
 ! [rejected]        second -> second (non-fast-forward)
error: failed to push some refs to '../upstream'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
ok 13 - http.receivepack false

expecting success: 
	config http.getanyfile true &&

	expect_aliased 0 /repo.git/HEAD &&

	expect_aliased 1 /repo.git/../HEAD &&
	expect_aliased 1 /../etc/passwd &&
	expect_aliased 1 ../etc/passwd &&
	expect_aliased 1 /etc//passwd &&
	expect_aliased 1 /etc/./passwd &&
	expect_aliased 1 //domain/data.txt

ok 5 - atomic push fails if one branch fails

expecting success: 
	# prepare the repo
	mk_repo_pair &&
	(
		cd workbench &&
		test_commit one &&
		git checkout -b second master &&
		test_commit two &&
		git push --mirror up
	) &&
	# a third party modifies the server side:
	(
		cd upstream &&
		git checkout second &&
		git tag test_tag second
	) &&
	# see if we can now push both branches.
	(
		cd workbench &&
		git checkout master &&
		test_commit three &&
		git checkout second &&
		test_commit four &&
		git tag test_tag &&
		test_must_fail git push --tags --atomic up master second
	) &&
	test_refs master HEAD@{3} &&
	test_refs second HEAD@{1}

--- exp.err	2015-12-16 11:01:05.909564854 +0000
+++ act.err	2015-12-16 11:01:05.877564854 +0000
@@ -1 +0,0 @@
-fatal: '/repo.git/../HEAD': aliased
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 35a8500... C
--- exp.err	2015-12-16 11:01:05.949564854 +0000
+++ act.err	2015-12-16 11:01:05.949564854 +0000
@@ -1 +1 @@
-fatal: '/../etc/passwd': aliased
+Request not supported: '/«PKGBUILDDIR»/t/trash directory.t5560-http-backend-noserver//../etc/passwd'
\ No newline at end of file
--- exp.err	2015-12-16 11:01:05.997564854 +0000
+++ act.err	2015-12-16 11:01:05.993564854 +0000
@@ -1 +1 @@
-fatal: '../etc/passwd': aliased
+Request not supported: '/«PKGBUILDDIR»/t/trash directory.t5560-http-backend-noserver/../etc/passwd'
\ No newline at end of file
To void
 * [new branch]      master -> master
--- exp.err	2015-12-16 11:01:06.041564854 +0000
+++ act.err	2015-12-16 11:01:06.037564854 +0000
@@ -1 +1 @@
-fatal: '/etc//passwd': aliased
+Request not supported: '/«PKGBUILDDIR»/t/trash directory.t5560-http-backend-noserver//etc//passwd'
\ No newline at end of file
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5543-atomic-push/upstream/.git/
From /«PKGBUILDDIR»/t/trash directory.t5533-push-cas/src
 * [new branch]      naster     -> origin/naster
--- exp.err	2015-12-16 11:01:06.089564854 +0000
+++ act.err	2015-12-16 11:01:06.089564854 +0000
@@ -1 +1 @@
-fatal: '/etc/./passwd': aliased
+Request not supported: '/«PKGBUILDDIR»/t/trash directory.t5560-http-backend-noserver//etc/./passwd'
\ No newline at end of file
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5543-atomic-push/workbench/.git/
ok 88 - receive.denyCurrentBranch = updateInstead

expecting success: 
	rm -fr testrepo &&
	git init testrepo &&
	(
		cd testrepo &&
		git pull .. master &&
		git reset --hard HEAD^^ &&
		git tag initial &&
		git config receive.denyCurrentBranch updateInstead &&
		write_script .git/hooks/push-to-checkout <<-\EOF
		echo >&2 updating from $(git rev-parse HEAD)
		echo >&2 updating to "$1"

		git update-index -q --refresh &&
		git read-tree -u -m HEAD "$1" || {
			status=$?
			echo >&2 read-tree failed
			exit $status
		}
		EOF
	) &&

	# Try pushing into a pristine
	git push testrepo master &&
	(
		cd testrepo &&
		git diff --quiet &&
		git diff HEAD --quiet &&
		test $(git -C .. rev-parse HEAD) = $(git rev-parse HEAD)
	) &&

	# Try pushing into a repository with conflicting change
	(
		cd testrepo &&
		git reset --hard initial &&
		echo conflicting >path2
	) &&
	test_must_fail git push testrepo master &&
	(
		cd testrepo &&
		test $(git rev-parse initial) = $(git rev-parse HEAD) &&
		test conflicting = "$(cat path2)" &&
		git diff-index --quiet --cached HEAD
	) &&

	# Try pushing into a repository with unrelated change
	(
		cd testrepo &&
		git reset --hard initial &&
		echo unrelated >path1 &&
		echo irrelevant >path5 &&
		git add path5
	) &&
	git push testrepo master &&
	(
		cd testrepo &&
		test "$(cat path1)" = unrelated &&
		test "$(cat path5)" = irrelevant &&
		test "$(git diff --name-only --cached HEAD)" = path5 &&
		test $(git -C .. rev-parse HEAD) = $(git rev-parse HEAD)
	) &&

	# push into void
	rm -fr void &&
	git init void &&
	(
		cd void &&
		git config receive.denyCurrentBranch updateInstead &&
		write_script .git/hooks/push-to-checkout <<-\EOF
		if git rev-parse --quiet --verify HEAD
		then
			has_head=yes
			echo >&2 updating from $(git rev-parse HEAD)
		else
			has_head=no
			echo >&2 pushing into void
		fi
		echo >&2 updating to "$1"

		git update-index -q --refresh &&
		case "$has_head" in
		yes)
			git read-tree -u -m HEAD "$1" ;;
		no)
			git read-tree -u -m "$1" ;;
		esac || {
			status=$?
			echo >&2 read-tree failed
			exit $status
		}
		EOF
	) &&

	git push void master &&
	(
		cd void &&
		git diff --quiet &&
		git diff --cached --quiet &&
		test $(git -C .. rev-parse HEAD) = $(git rev-parse HEAD)
	)

--- exp.err	2015-12-16 11:01:06.133564854 +0000
+++ act.err	2015-12-16 11:01:06.129564854 +0000
@@ -1 +1 @@
-fatal: '//domain/data.txt': aliased
+Request not supported: '/«PKGBUILDDIR»/t/trash directory.t5560-http-backend-noserver///domain/data.txt'
\ No newline at end of file
ok 14 - http-backend blocks bad PATH_INFO

# passed all 14 test(s)
1..14
To /«PKGBUILDDIR»/t/trash directory.t5533-push-cas/src
   d9df450..35a8500  master -> naster
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/testrepo/.git/
[master (root-commit) d79ce16] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
*** t5561-http-backend.sh ***
Switched to a new branch 'second'
ok 13 - cover everything with default force-with-lease (allowed)

# passed all 13 test(s)
1..13
[second 139b20d] 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.t5561-http-backend/.git/
checking prerequisite: NOT_ROOT

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	uid=$(id -u) &&
	test "$uid" != 0

)
prerequisite NOT_ROOT ok
From ..
 * branch            master     -> FETCH_HEAD
1..0 # SKIP no web server found at '/usr/sbin/apache2'
*** t5570-git-daemon.sh ***
*** t5571-pre-push-hook.sh ***
remote: warning: updating the current branch        
HEAD is now at af7aa26 third
To ../upstream
 * [new branch]      master -> master
 * [new branch]      second -> second
 * [new tag]         one -> one
 * [new tag]         two -> two
Switched to branch 'second'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5570-git-daemon/.git/
Starting git daemon ...
Switched to branch 'master'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5571-pre-push-hook/.git/
[6807] Ready to rumble
expecting success: 
	git config push.default matching &&
	echo content >file &&
	git add file &&
	git commit -m one

expecting success: 
	git config push.default upstream &&
	git init --bare repo1 &&
	git remote add parent1 repo1 &&
	test_commit one &&
	git push parent1 HEAD:foreign

updating from af7aa264a0612fd7ca196f597c95342395812771
updating to 99d9406f2b363e93b6b8521b55ba2802ef67586a
[master 846d065] three
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 three.t
[master (root-commit) 8d83b8e] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 1 - setup repository

expecting success: 
	mkdir "$GIT_DAEMON_DOCUMENT_ROOT_PATH/repo.git" &&
	(cd "$GIT_DAEMON_DOCUMENT_ROOT_PATH/repo.git" &&
	 git --bare init &&
	 : >git-daemon-export-ok
	) &&
	git remote add public "$GIT_DAEMON_DOCUMENT_ROOT_PATH/repo.git" &&
	git push public master:master

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5571-pre-push-hook/repo1/
To testrepo
   af7aa26..99d9406  master -> master
Switched to branch 'second'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5570-git-daemon/repo/repo.git/
[second b6d6c1f] four
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 four.t
[master (root-commit) d79ce16] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
HEAD is now at af7aa26 third
To /«PKGBUILDDIR»/t/trash directory.t5570-git-daemon/repo/repo.git
 * [new branch]      master -> master
ok 2 - create git-accessible bare repository

expecting success: 
	git clone "$GIT_DAEMON_URL/repo.git" clone &&
	test_cmp file clone/file

error: atomic push failed for ref refs/tags/test_tag. status: 3

fatal: The remote end hung up unexpectedly
To ../upstream
 ! [rejected]        master -> master (atomic push failed)
 ! [rejected]        second -> second (atomic push failed)
 ! [rejected]        test_tag -> test_tag (already exists)
error: failed to push some refs to '../upstream'
hint: Updates were rejected because the tag already exists in the remote.
Cloning into 'clone'...
[6888] Connection from 127.0.0.1:47173
[6888] Extended attributes (21 bytes) exist <host=127.0.0.1:5570>
[6888] Request upload-pack for '/repo.git'
To repo1
 * [new branch]      HEAD -> foreign
ok 1 - setup

expecting success: 
	test_commit two &&
	test_must_fail git push parent1 HEAD

updating from af7aa264a0612fd7ca196f597c95342395812771
updating to 99d9406f2b363e93b6b8521b55ba2802ef67586a
ok 6 - atomic push fails if one tag fails remotely

expecting success: 
	mk_repo_pair &&
	(
		cd workbench &&
		test_commit one &&
		git checkout -b second master &&
		test_commit two &&
		git push --mirror up
	) &&
	(
		cd upstream &&
		HOOKDIR="$(git rev-parse --git-dir)/hooks" &&
		HOOK="$HOOKDIR/update" &&
		mkdir -p "$HOOKDIR" &&
		write_script "$HOOK" <<-\EOF
			# only allow update to master from now on
			test "$1" = "refs/heads/master"
		EOF
	) &&
	(
		cd workbench &&
		git checkout master &&
		test_commit three &&
		git checkout second &&
		test_commit four &&
		test_must_fail git push --atomic up master second
	) &&
	test_refs master HEAD@{3} &&
	test_refs second HEAD@{1}

error: Entry 'path2' not uptodate. Cannot merge.
read-tree failed
[6807] [6888] Disconnected
To testrepo
 ! [remote rejected] master -> master (push-to-checkout hook declined)
error: failed to push some refs to 'testrepo'
[master 139b20d] 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.t5543-atomic-push/upstream/.git/
error: failed to push some refs to 'repo1'
ok 2 - push with failing hook

HEAD is now at af7aa26 third
expecting success: 
	git push --no-verify parent1 HEAD

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5543-atomic-push/workbench/.git/
To repo1
 * [new branch]      HEAD -> master
[master (root-commit) d79ce16] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
ok 3 - --no-verify bypasses hook

updating from af7aa264a0612fd7ca196f597c95342395812771
updating to 99d9406f2b363e93b6b8521b55ba2802ef67586a
expecting success: 
	git push parent1 master:foreign &&
	diff expected actual

Switched to a new branch 'second'
ok 3 - clone git repository

expecting success: 
	echo content >>file &&
	git commit -a -m two &&
	git push public &&
	(cd clone && git pull) &&
	test_cmp file clone/file

To testrepo
   af7aa26..99d9406  master -> master
[master 908f5c1] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[second 139b20d] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two.t
To repo1
   d79ce16..139b20d  master -> foreign
ok 4 - push with hook

expecting success: 
	git checkout -b other parent1/foreign &&
	test_commit three

Switched to a new branch 'other'
Branch other set up to track remote branch foreign from parent1.
To /«PKGBUILDDIR»/t/trash directory.t5570-git-daemon/repo/repo.git
   8d83b8e..908f5c1  master -> master
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5516-fetch-push/void/.git/
remote: warning: updating the current branch        
[7019] Connection from 127.0.0.1:47174
[7019] Extended attributes (21 bytes) exist <host=127.0.0.1:5570>
[7019] Request upload-pack for '/repo.git'
[other 7c7cd71] three
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 three.t
To ../upstream
 * [new branch]      master -> master
 * [new branch]      second -> second
 * [new tag]         one -> one
 * [new tag]         two -> two
ok 5 - add a branch

expecting success: 
	git push &&
	diff expected actual

[6807] [7019] Disconnected
Switched to branch 'master'
From git://127.0.0.1:5570/repo
   8d83b8e..908f5c1  master     -> origin/master
[master 846d065] three
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 three.t
pushing into void
updating to 99d9406f2b363e93b6b8521b55ba2802ef67586a
Updating 8d83b8e..908f5c1
Fast-forward
To repo1
   139b20d..7c7cd71  other -> foreign
 file | 1 +
 1 file changed, 1 insertion(+)
ok 6 - push to default

To void
 * [new branch]      master -> master
ok 4 - fetch changes via git protocol

Switched to branch 'second'
expecting success: 
	git push public master:other &&
	(cd clone &&
	 git remote set-head -d origin &&
	 git remote set-head -a origin &&
	 git symbolic-ref refs/remotes/origin/HEAD > output &&
	 echo refs/remotes/origin/master > expect &&
	 test_cmp expect output
	)

expecting success: 
	git push parent1 one:tag1 HEAD~:refs/heads/prev &&
	diff expected actual

[second b6d6c1f] four
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 four.t
ok 89 - updateInstead with push-to-checkout hook

# passed all 89 test(s)
1..89
To /«PKGBUILDDIR»/t/trash directory.t5570-git-daemon/repo/repo.git
 * [new branch]      master -> other
To repo1
 * [new tag]         one -> tag1
 * [new branch]      HEAD~ -> prev
ok 7 - push non-branches

expecting success: 
	git push parent1 :prev &&
	diff expected actual

[7122] Connection from 127.0.0.1:47175
[7122] Extended attributes (21 bytes) exist <host=127.0.0.1:5570>
[7122] Request upload-pack for '/repo.git'
origin/HEAD set to master
[6807] [7122] Disconnected
ok 5 - remote detects correct HEAD

expecting success: 
	cp -R "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo.git "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_pack.git &&
	(cd "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_pack.git &&
	 git --bare repack -a -d
	)

remote: warning: updating the current branch        
To repo1
 - [deleted]         prev
remote: error: hook declined to update refs/heads/second        
ok 8 - push delete

expecting success: 
	git push repo1 HEAD &&
	diff expected actual

To ../upstream
 ! [remote rejected] master -> master (atomic push failure)
 ! [remote rejected] second -> second (hook declined)
error: failed to push some refs to '../upstream'
ok 7 - atomic push obeys update hook preventing a branch to be pushed

expecting success: 
	mk_repo_pair &&
	(
		cd upstream
		git config receive.advertiseatomic 0
	) &&
	(
		cd workbench &&
		test_commit one &&
		git push --mirror up &&
		test_commit two &&
		test_must_fail git push --atomic up master
	) &&
	test_refs master HEAD@{1}

To repo1
 * [new branch]      HEAD -> other
ok 9 - push to URL

expecting success: 
	{
		nr=1000
		while test $nr -lt 2000
		do
			nr=$(( $nr + 1 ))
			echo "create refs/heads/b/$nr $COMMIT3"
		done
	} | git update-ref --stdin

ok 6 - prepare pack objects

expecting success: 
	cp -R "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_pack.git "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_bad1.git &&
	(cd "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_bad1.git &&
	 p=`ls objects/pack/pack-*.pack` &&
	 chmod u+w $p &&
	 printf %0256d 0 | dd of=$p bs=256 count=1 seek=1 conv=notrunc
	) &&
	mkdir repo_bad1.git &&
	(cd repo_bad1.git &&
	 git --bare init &&
	 test_must_fail git --bare fetch "$GIT_DAEMON_URL/repo_bad1.git" &&
	 test 0 = `ls objects/pack/pack-*.pack | wc -l`
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5543-atomic-push/upstream/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5543-atomic-push/workbench/.git/
1+0 records in
1+0 records out
256 bytes (256 B) copied, 0.00119367 s, 214 kB/s
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5570-git-daemon/repo_bad1.git/
[7195] Connection from 127.0.0.1:47176
[7195] Extended attributes (21 bytes) exist <host=127.0.0.1:5570>
[7195] Request upload-pack for '/repo_bad1.git'
*** t5572-pull-submodule.sh ***
[7195] error: packfile ./objects/pack/pack-ebe2cd8a13f20a8bcdc008b5a35b5ef2ac13f2b3.pack does not match index
[7195] error: packfile ./objects/pack/pack-ebe2cd8a13f20a8bcdc008b5a35b5ef2ac13f2b3.pack does not match index
[7195] error: packfile ./objects/pack/pack-ebe2cd8a13f20a8bcdc008b5a35b5ef2ac13f2b3.pack does not match index
[7195] error: packfile ./objects/pack/pack-ebe2cd8a13f20a8bcdc008b5a35b5ef2ac13f2b3.pack does not match index
[7195] error: refs/heads/master does not point to a valid object!
[7195] error: packfile ./objects/pack/pack-ebe2cd8a13f20a8bcdc008b5a35b5ef2ac13f2b3.pack does not match index
[7195] error: packfile ./objects/pack/pack-ebe2cd8a13f20a8bcdc008b5a35b5ef2ac13f2b3.pack does not match index
[7195] error: refs/heads/other does not point to a valid object!
[master (root-commit) d79ce16] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
[7195] error: packfile ./objects/pack/pack-ebe2cd8a13f20a8bcdc008b5a35b5ef2ac13f2b3.pack does not match index
[7195] error: packfile ./objects/pack/pack-ebe2cd8a13f20a8bcdc008b5a35b5ef2ac13f2b3.pack does not match index
[7195] fatal: git upload-pack: not our ref 908f5c1533f373b2ee39e49c4c477ee787297465
fatal: read error: Connection reset by peer
[6807] [7195] Disconnected (with error)
ls: cannot access objects/pack/pack-*.pack: No such file or directory
ok 7 - fetch notices corrupt pack

expecting success: 
	cp -R "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_pack.git "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_bad2.git &&
	(cd "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_bad2.git &&
	 p=`ls objects/pack/pack-*.idx` &&
	 chmod u+w $p &&
	 printf %0256d 0 | dd of=$p bs=256 count=1 seek=1 conv=notrunc
	) &&
	mkdir repo_bad2.git &&
	(cd repo_bad2.git &&
	 git --bare init &&
	 test_must_fail git --bare fetch "$GIT_DAEMON_URL/repo_bad2.git" &&
	 test 0 = `ls objects/pack | wc -l`
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/.git/
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
		)
	
1+0 records in
1+0 records out
256 bytes (256 B) copied, 0.00151767 s, 169 kB/s
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.git/
remote: warning: updating the current branch        
To ../upstream
 * [new branch]      master -> master
 * [new tag]         one -> one
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5570-git-daemon/repo_bad2.git/
[7249] Connection from 127.0.0.1:47177
[7249] Extended attributes (21 bytes) exist <host=127.0.0.1:5570>
[7249] Request upload-pack for '/repo_bad2.git'
[master (root-commit) aca6d60] 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
[master 139b20d] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two.t
[7249] error: non-monotonic index ./objects/pack/pack-ebe2cd8a13f20a8bcdc008b5a35b5ef2ac13f2b3.idx
[7249] error: non-monotonic index ./objects/pack/pack-ebe2cd8a13f20a8bcdc008b5a35b5ef2ac13f2b3.idx
[7249] error: non-monotonic index ./objects/pack/pack-ebe2cd8a13f20a8bcdc008b5a35b5ef2ac13f2b3.idx
[7249] error: non-monotonic index ./objects/pack/pack-ebe2cd8a13f20a8bcdc008b5a35b5ef2ac13f2b3.idx
[7249] error: refs/heads/master does not point to a valid object!
[7249] error: non-monotonic index ./objects/pack/pack-ebe2cd8a13f20a8bcdc008b5a35b5ef2ac13f2b3.idx
[7249] error: non-monotonic index ./objects/pack/pack-ebe2cd8a13f20a8bcdc008b5a35b5ef2ac13f2b3.idx
[7249] error: refs/heads/other does not point to a valid object!
[7249] error: non-monotonic index ./objects/pack/pack-ebe2cd8a13f20a8bcdc008b5a35b5ef2ac13f2b3.idx
[7249] error: non-monotonic index ./objects/pack/pack-ebe2cd8a13f20a8bcdc008b5a35b5ef2ac13f2b3.idx
[7249] fatal: git upload-pack: not our ref 908f5c1533f373b2ee39e49c4c477ee787297465
[6807] [7249] Disconnected (with error)
fatal: read error: Connection reset by peer
Switched to a new branch 'add_sub1'
ok 8 - fetch notices corrupt idx

expecting success: test_remote_error    'access denied or repository not exported' clone nowhere.git    
fatal: the receiving end does not support --atomic push
fatal: The remote end hung up unexpectedly
[7272] Connection from 127.0.0.1:47178
[7272] Extended attributes (21 bytes) exist <host=127.0.0.1:5570>
[7272] Request upload-pack for '/nowhere.git'
[7272] '/«PKGBUILDDIR»/t/trash directory.t5570-git-daemon/repo/nowhere.git' does not appear to be a git repository
[6807] [7272] Disconnected (with error)
fatal: remote error: access denied or repository not exported: /nowhere.git
ok 8 - atomic push is not advertised if configured

ok 9 - clone non-existent

expecting success: test_remote_error    'access denied or repository not exported' push  repo.git master
# passed all 8 test(s)
1..8
[7293] Connection from 127.0.0.1:47179
[7293] Extended attributes (21 bytes) exist <host=127.0.0.1:5570>
[7293] Request receive-pack for '/repo.git'
[7293] 'receive-pack': service not enabled for '/«PKGBUILDDIR»/t/trash directory.t5570-git-daemon/repo/repo.git'
[6807] [7293] Disconnected (with error)
fatal: remote error: access denied or repository not exported: /repo.git
ok 10 - push disabled

expecting success: test_remote_error -x 'access denied or repository not exported' fetch repo.git       
[7308] Connection from 127.0.0.1:47180
[7308] Extended attributes (21 bytes) exist <host=127.0.0.1:5570>
[7308] Request upload-pack for '/repo.git'
[7308] '/«PKGBUILDDIR»/t/trash directory.t5570-git-daemon/repo/repo.git' does not appear to be a git repository
[6807] [7308] Disconnected (with error)
fatal: remote error: access denied or repository not exported: /repo.git
*** t5600-clone-fail-cleanup.sh ***
ok 11 - read access denied

expecting success: test_remote_error -n 'access denied or repository not exported' fetch repo.git       
[7328] Connection from 127.0.0.1:47181
[7328] Extended attributes (21 bytes) exist <host=127.0.0.1:5570>
[7328] Request upload-pack for '/repo.git'
[7328] '/«PKGBUILDDIR»/t/trash directory.t5570-git-daemon/repo/repo.git': repository not exported.
[6807] [7328] Disconnected (with error)
fatal: remote error: access denied or repository not exported: /repo.git
ok 12 - not exported

Stopping git daemon ...
Cloning into 'sub1'...
Starting git daemon ...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5600-clone-fail-cleanup/.git/
expecting success: test_must_fail git clone foo bar
[7353] Ready to rumble
expecting success: test_remote_error    'no such repository'      clone nowhere.git    
done.
fatal: repository 'foo' does not exist
ok 1 - clone of non-existent source should fail

expecting success: ! test -d bar
ok 2 - failed clone should not leave a directory

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5600-clone-fail-cleanup/foo/.git/
[7370] Connection from 127.0.0.1:47182
[7370] Extended attributes (21 bytes) exist <host=127.0.0.1:5570>
[7370] Request upload-pack for '/nowhere.git'
[7370] '/«PKGBUILDDIR»/t/trash directory.t5570-git-daemon/repo/nowhere.git' does not appear to be a git repository
[7353] [7370] Disconnected (with error)
fatal: remote error: no such repository: /nowhere.git
ok 13 - clone non-existent

expecting success: test_remote_error    'service not enabled'     push  repo.git master
expecting success: test_must_fail git clone ../foo baz
[7389] Connection from 127.0.0.1:47183
[7389] Extended attributes (21 bytes) exist <host=127.0.0.1:5570>
[7389] Request receive-pack for '/repo.git'
[7389] 'receive-pack': service not enabled for '/«PKGBUILDDIR»/t/trash directory.t5570-git-daemon/repo/repo.git'
[7353] [7389] Disconnected (with error)
fatal: repository '../foo' does not exist
fatal: remote error: service not enabled: /repo.git
ok 3 - clone of non-existent (relative to $PWD) source should fail

expecting success: git clone foo bar
ok 14 - push disabled

expecting success: test_remote_error -x 'no such repository'      fetch repo.git       
Cloning into 'bar'...
done.
[7404] Connection from 127.0.0.1:47184
[7404] Extended attributes (21 bytes) exist <host=127.0.0.1:5570>
[7404] Request upload-pack for '/repo.git'
[7404] '/«PKGBUILDDIR»/t/trash directory.t5570-git-daemon/repo/repo.git' does not appear to be a git repository
[7353] [7404] Disconnected (with error)
fatal: remote error: no such repository: /repo.git
ok 4 - clone should work now that source exists

ok 15 - read access denied

expecting success: test -d bar
expecting success: test_remote_error -n 'repository not exported' fetch repo.git       
ok 5 - successful clone must leave the directory

expecting success: 
	mkdir foo/.git/objects.bak/ &&
	mv foo/.git/objects/* foo/.git/objects.bak/ &&
	test_must_fail git clone --separate-git-dir gitdir foo worktree &&
	test_must_fail test -e gitdir &&
	test_must_fail test -e worktree &&
	mv foo/.git/objects.bak/* foo/.git/objects/ &&
	rmdir foo/.git/objects.bak

[7419] Connection from 127.0.0.1:47185
[7419] Extended attributes (21 bytes) exist <host=127.0.0.1:5570>
[7419] Request upload-pack for '/repo.git'
[7419] '/«PKGBUILDDIR»/t/trash directory.t5570-git-daemon/repo/repo.git': repository not exported.
[7353] [7419] Disconnected (with error)
fatal: remote error: repository not exported: /repo.git
Cloning into 'worktree'...
ok 16 - not exported

Stopping git daemon ...
Starting git daemon ...
error: refs/heads/master does not point to a valid object!
done.
fatal: update_ref failed for ref 'HEAD': cannot update the ref 'HEAD': Trying to write ref HEAD with nonexistent object 4b29aaf7f4a4dc09659c36106a112c081e417dd8
fatal: The remote end hung up unexpectedly
[7433] Ready to rumble
ok 6 - failed clone --separate-git-dir should not leave any directories

expecting success: 
	repo="$GIT_DAEMON_DOCUMENT_ROOT_PATH/localhost/interp.git" &&
	git init --bare "$repo" &&
	git push "$repo" HEAD &&
	>"$repo"/git-daemon-export-ok &&
	rm -rf tmp.git &&
	GIT_OVERRIDE_VIRTUAL_HOST=localhost \
		git clone --bare "$GIT_DAEMON_URL/interp.git" tmp.git &&
	rm -rf tmp.git &&
	GIT_OVERRIDE_VIRTUAL_HOST=LOCALHOST \
		git clone --bare "$GIT_DAEMON_URL/interp.git" tmp.git

[add_sub1 041e421] Add sub1
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
# passed all 6 test(s)
1..6
Switched to a new branch 'remove_sub1'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5570-git-daemon/repo/localhost/interp.git/
Removing sub1
Removing .gitmodules
[remove_sub1 e68bdee] Revert "Add sub1"
 Author: A U Thor <author@example.com>
 2 files changed, 5 deletions(-)
 delete mode 100644 .gitmodules
 delete mode 160000 sub1
*** t5601-clone.sh ***
Switched to a new branch 'modify_sub1'
To /«PKGBUILDDIR»/t/trash directory.t5570-git-daemon/repo/localhost/interp.git
 * [new branch]      HEAD -> master
Cloning into bare repository 'tmp.git'...
[7486] Connection from 127.0.0.1:47186
[7486] Extended attributes (16 bytes) exist <host=localhost>
[7486] Request upload-pack for '/interp.git'
[7486] Interpolated dir '/«PKGBUILDDIR»/t/trash directory.t5570-git-daemon/repo/localhost/interp.git'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5601-clone/.git/
expecting success: 

	rm -fr .git &&
	test_create_repo src &&
	(
		cd src &&
		>file &&
		git add file &&
		git commit -m initial &&
		echo 1 >file &&
		git add file &&
		git commit -m updated
	)


[7433] [7486] Disconnected
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5601-clone/src/.git/
[master (root-commit) 489c7a6] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file
[master 823ab6d] updated
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 1 - setup

expecting success: 

	rm -fr dst &&
	test_must_fail git clone -n src dst junk


Too many arguments.

Cloning into bare repository 'tmp.git'...
usage: git clone [<options>] [--] <repo> [<dir>]

    -v, --verbose         be more verbose
    -q, --quiet           be more quiet
    --progress            force progress reporting
    -n, --no-checkout     don't create a checkout
    --bare                create a bare repository
    --mirror              create a mirror repository (implies bare)
    -l, --local           to clone from a local repository
    --no-hardlinks        don't use local hardlinks, always copy
    -s, --shared          setup as shared repository
    --recursive           initialize submodules in the clone
    --recurse-submodules  initialize submodules in the clone
    --template <template-directory>
                          directory from which templates will be used
    --reference <repo>    reference repository
    --dissociate          use --reference only while cloning
    -o, --origin <name>   use <name> instead of 'origin' to track upstream
    -b, --branch <branch>
                          checkout <branch> instead of the remote's HEAD
    -u, --upload-pack <path>
                          path to git-upload-pack on the remote
    --depth <depth>       create a shallow clone of that depth
    --single-branch       clone only one branch, HEAD or --branch
    --separate-git-dir <gitdir>
                          separate git dir from working tree
    -c, --config <key=value>
                          set config inside the new repository

ok 2 - clone with excess parameters (1)

expecting success: 

	rm -fr dst &&
	test_must_fail git clone -n "file://$(pwd)/src" dst junk


[7549] Connection from 127.0.0.1:47187
[7549] Extended attributes (16 bytes) exist <host=LOCALHOST>
[7549] Request upload-pack for '/interp.git'
[7549] Interpolated dir '/«PKGBUILDDIR»/t/trash directory.t5570-git-daemon/repo/localhost/interp.git'
Too many arguments.

usage: git clone [<options>] [--] <repo> [<dir>]

    -v, --verbose         be more verbose
    -q, --quiet           be more quiet
    --progress            force progress reporting
    -n, --no-checkout     don't create a checkout
    --bare                create a bare repository
    --mirror              create a mirror repository (implies bare)
    -l, --local           to clone from a local repository
    --no-hardlinks        don't use local hardlinks, always copy
    -s, --shared          setup as shared repository
    --recursive           initialize submodules in the clone
    --recurse-submodules  initialize submodules in the clone
    --template <template-directory>
                          directory from which templates will be used
    --reference <repo>    reference repository
    --dissociate          use --reference only while cloning
    -o, --origin <name>   use <name> instead of 'origin' to track upstream
    -b, --branch <branch>
                          checkout <branch> instead of the remote's HEAD
    -u, --upload-pack <path>
                          path to git-upload-pack on the remote
    --depth <depth>       create a shallow clone of that depth
    --single-branch       clone only one branch, HEAD or --branch
    --separate-git-dir <gitdir>
                          separate git dir from working tree
    -c, --config <key=value>
                          set config inside the new repository

ok 3 - clone with excess parameters (2)

expecting success: 
	rm -fr dst &&
	git clone -n "file://$(pwd)/src" dst >output 2>&1 &&
	test $(grep Clon output | wc -l) = 1

[7433] [7549] Disconnected
From /«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.
   aca6d60..041e421  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 eedcaeb] modified file2 and added file3
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 file3
ok 17 - access repo via interpolated hostname

expecting success: 
	rm -rf tmp.git &&
	repo="$GIT_DAEMON_DOCUMENT_ROOT_PATH/../escape.git" &&
	git init --bare "$repo" &&
	git push "$repo" HEAD &&
	>"$repo"/git-daemon-export-ok &&
	test_must_fail \
		env GIT_OVERRIDE_VIRTUAL_HOST=.. \
		git clone --bare "$GIT_DAEMON_URL/escape.git" tmp.git

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5570-git-daemon/escape.git/
To /«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.
 * [new branch]      modifications -> modifications
[modify_sub1 85dfe6e] Modify sub1
 Author: A U Thor <author@example.com>
ok 4 - output from clone

expecting success: 

	rm -fr dst &&
	git clone -n "file://$(pwd)/src" dst &&
	! test -f dst/file &&
	! (echo dst/.git/objects/pack/pack-* | grep "\.keep")


To /«PKGBUILDDIR»/t/trash directory.t5570-git-daemon/repo/../escape.git
 * [new branch]      HEAD -> master
Switched to a new branch 'replace_sub1_with_directory'
Cloning into bare repository 'tmp.git'...
Cloning into 'dst'...
[7620] Connection from 127.0.0.1:47188
[7620] Extended attributes (9 bytes) exist <host=..>
[7620] Request upload-pack for '/escape.git'
[7620] Interpolated dir '/«PKGBUILDDIR»/t/trash directory.t5570-git-daemon/repo//escape.git'
[7620] '/«PKGBUILDDIR»/t/trash directory.t5570-git-daemon/repo//escape.git' does not appear to be a git repository
fatal: remote error: access denied or repository not exported: /escape.git
[7433] [7620] Disconnected (with error)
ok 18 - hostname cannot break out of directory

Stopping git daemon ...
ok 10 - set up many-ref tests

expecting success: 
	echo "exit 0" | write_script "$HOOK" &&
	git push parent1 "refs/heads/b/*:refs/heads/b/*"

# passed all 18 test(s)
1..18
ok 5 - clone does not keep pack

expecting success: 

	rm -fr dst &&
	git clone src dst &&
	test -f dst/file


Cloning into 'dst'...
*** t5602-clone-remote-exec.sh ***
done.
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
ok 6 - clone checks out files

expecting success: 

	GIT_WORK_TREE=worktree git clone src bare &&
	test -f bare/config &&
	test -f worktree/file


Cloning into 'bare'...
Previous HEAD position was aca6d60... Base
Switched to branch 'modifications'
rm 'sub1'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5602-clone-remote-exec/.git/
done.
expecting success: 
	echo "#!/bin/sh" > not_ssh &&
	echo "echo \"\$*\" > not_ssh_output" >> not_ssh &&
	echo "exit 1" >> not_ssh &&
	chmod +x not_ssh

ok 1 - setup

expecting success: 
	test_must_fail env GIT_SSH=./not_ssh git clone localhost:/path/to/repo junk &&
	echo "localhost git-upload-pack '/path/to/repo'" >expected &&
	test_cmp expected not_ssh_output

ok 7 - clone respects GIT_WORK_TREE

expecting success: 

	git clone src long/path/to/dst &&
	test -f long/path/to/dst/file


Cloning into 'long/path/to/dst'...
Cloning into 'junk'...
[replace_sub1_with_directory 48ceb4d] 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
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ok 2 - clone calls git upload-pack unqualified with no -u option

expecting success: 
	test_must_fail env GIT_SSH=./not_ssh \
		git clone -u ./something/bin/git-upload-pack localhost:/path/to/repo junk &&
	echo "localhost ./something/bin/git-upload-pack '/path/to/repo'" >expected &&
	test_cmp expected not_ssh_output

Switched to a new branch 'replace_directory_with_sub1'
done.
Cloning into 'junk'...
ok 8 - clone creates intermediate directories

expecting success: 

	git clone --bare src long/path/to/bare/dst &&
	test -f long/path/to/bare/dst/config


Removing sub1/file3
Removing sub1/file2
Removing sub1/file1
Adding sub1
Cloning into bare repository 'long/path/to/bare/dst'...
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ok 3 - clone calls specified git upload-pack with -u option

[replace_directory_with_sub1 99dcd27] 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
# passed all 3 test(s)
1..3
done.
Switched to a new branch 'replace_sub1_with_file'
ok 9 - clone creates intermediate directories for bare repo

expecting success: 

	git clone --mirror src mirror &&
	test -f mirror/HEAD &&
	test ! -f mirror/file &&
	FETCH="$(cd mirror && git config remote.origin.fetch)" &&
	test "+refs/*:refs/*" = "$FETCH" &&
	MIRROR="$(cd mirror && git config --bool remote.origin.mirror)" &&
	test "$MIRROR" = true


Cloning into bare repository 'mirror'...
rm 'sub1'
*** t5603-clone-dirname.sh ***
done.
[replace_sub1_with_file 88f15cf] Replace sub1 with file
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
Switched to a new branch 'replace_file_with_sub1'
ok 10 - clone --mirror

expecting success: 

	( cd src && git checkout HEAD^ && git rev-parse HEAD >../expected ) &&
	git clone --mirror src mirror.detached &&
	( cd src && git checkout - ) &&
	GIT_DIR=mirror.detached git rev-parse HEAD >actual &&
	test_cmp expected actual


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5603-clone-dirname/.git/
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 489c7a6... initial
expecting success: 
	write_script "$TRASH_DIRECTORY/ssh-wrapper" <<-\EOF &&
	git upload-pack "$TRASH_DIRECTORY"
	EOF
	GIT_SSH="$TRASH_DIRECTORY/ssh-wrapper" &&
	export GIT_SSH &&
	export TRASH_DIRECTORY

[replace_file_with_sub1 1bf82f3] Revert "Replace sub1 with file"
 Author: A U Thor <author@example.com>
 2 files changed, 5 insertions(+), 1 deletion(-)
 mode change 100644 => 160000 sub1
ok 1 - setup ssh wrapper

expecting success: 
		rm -rf foo &&
		git clone  host:foo &&
		test_path_is_dir foo
	
Switched to a new branch 'invalid_sub1'
Cloning into bare repository 'mirror.detached'...
Cloning into 'foo'...
done.
warning: You appear to have cloned an empty repository.
[invalid_sub1 e730a90] Invalid sub1 commit
 Author: A U Thor <author@example.com>
ok 2 - clone of host:foo goes to foo (non-bare)

expecting success: 
		rm -rf foo.git &&
		git clone --bare host:foo &&
		test_path_is_dir foo.git
	
Switched to a new branch 'valid_sub1'
Cloning into bare repository 'foo.git'...
Previous HEAD position was 489c7a6... initial
Switched to branch 'master'
ok 11 - clone --mirror with detached HEAD

expecting success: 

	( cd src && git checkout HEAD^ && git rev-parse HEAD >../expected ) &&
	git clone --bare src bare.detached &&
	( cd src && git checkout - ) &&
	GIT_DIR=bare.detached git rev-parse HEAD >actual &&
	test_cmp expected actual


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>

warning: You appear to have cloned an empty repository.
[valid_sub1 1ca87d6] Revert "Invalid sub1 commit"
 Author: A U Thor <author@example.com>
HEAD is now at 489c7a6... initial
ok 3 - clone of host:foo goes to foo.git (bare)

expecting success: 
		rm -rf foo &&
		git clone  host:foo.git &&
		test_path_is_dir foo
	
Switched to branch 'master'
Cloning into bare repository 'bare.detached'...
Cloning into 'foo'...
Cloning into 'submodule_update'...
done.
warning: You appear to have cloned an empty repository.
ok 4 - clone of host:foo.git goes to foo (non-bare)

expecting success: 
		rm -rf foo.git &&
		git clone --bare host:foo.git &&
		test_path_is_dir foo.git
	
Previous HEAD position was 489c7a6... initial
Switched to branch 'master'
Cloning into bare repository 'foo.git'...
ok 12 - clone --bare with detached HEAD

expecting success: 

	git clone --bare src &&
	test -d src.git


done.
Cloning into bare repository 'src.git'...
warning: You appear to have cloned an empty repository.
ok 5 - clone of host:foo.git goes to foo.git (bare)

expecting success: 
		rm -rf foo &&
		git clone  host:foo/.git &&
		test_path_is_dir foo
	
done.
Cloning into 'foo'...
ok 13 - clone --bare names the local repository <name>.git

expecting success: 

	(cd src &&
	 git tag some-tag HEAD) &&
	git clone --mirror src mirror2 &&
	(cd mirror2 &&
	 git show-ref 2> clone.err > clone.out) &&
	test_must_fail grep Duplicate mirror2/clone.err &&
	grep some-tag mirror2/clone.out


Cloning into bare repository 'mirror2'...
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
warning: You appear to have cloned an empty repository.
ok 6 - clone of host:foo/.git goes to foo (non-bare)

expecting success: 
		rm -rf foo.git &&
		git clone --bare host:foo/.git &&
		test_path_is_dir foo.git
	
done.
Cloning into bare repository 'foo.git'...
Branch add_sub1 set up to track remote branch add_sub1 from origin.
823ab6d316d3b4b835b2496ee9104c55450fe8f0 refs/tags/some-tag
ok 14 - clone --mirror does not repeat tags

expecting success: 

	git clone src target-1/ &&
	T=$( cd target-1 && git rev-parse HEAD ) &&
	S=$( cd src && git rev-parse HEAD ) &&
	test "$T" = "$S"


Deleted branch add_sub1 (was 041e421).
Cloning into 'target-1'...
warning: You appear to have cloned an empty repository.
ok 7 - clone of host:foo/.git goes to foo.git (bare)

expecting success: 
		rm -rf foo &&
		git clone  ssh://host/foo &&
		test_path_is_dir foo
	
Switched to a new branch 'add_sub1'
Cloning into 'foo'...
done.
Branch add_sub1 set up to track remote branch add_sub1 from origin.
warning: You appear to have cloned an empty repository.
ok 15 - clone to destination with trailing /

expecting success: 

	git clone src target-2/// &&
	T=$( cd target-2 && git rev-parse HEAD ) &&
	S=$( cd src && git rev-parse HEAD ) &&
	test "$T" = "$S"


ok 8 - clone of ssh://host/foo goes to foo (non-bare)

expecting success: 
		rm -rf foo.git &&
		git clone --bare ssh://host/foo &&
		test_path_is_dir foo.git
	
Cloning into 'target-2'...
Cloning into bare repository 'foo.git'...
done.
warning: You appear to have cloned an empty repository.
ok 9 - clone of ssh://host/foo goes to foo.git (bare)

expecting success: 
		rm -rf foo &&
		git clone  ssh://host/foo.git &&
		test_path_is_dir foo
	
Updating aca6d60..041e421
Fast-forward
ok 16 - clone to destination with extra trailing /

expecting success: 
	mkdir target-3 &&
	git clone src target-3 &&
	T=$( cd target-3 && git rev-parse HEAD ) &&
	S=$( cd src && git rev-parse HEAD ) &&
	test "$T" = "$S"

 .gitmodules | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
Cloning into 'foo'...
Cloning into 'target-3'...
warning: You appear to have cloned an empty repository.
done.
ok 10 - clone of ssh://host/foo.git goes to foo (non-bare)

expecting success: 
		rm -rf foo.git &&
		git clone --bare ssh://host/foo.git &&
		test_path_is_dir foo.git
	
Cloning into bare repository 'foo.git'...
ok 17 - clone to an existing empty directory

expecting success: 
	mkdir target-4 &&
	>target-4/Fakefile &&
	test_must_fail git clone src target-4

warning: You appear to have cloned an empty repository.
ok 11 - clone of ssh://host/foo.git goes to foo.git (bare)

expecting success: 
		rm -rf foo &&
		git clone  ssh://host/foo/.git &&
		test_path_is_dir foo
	
fatal: destination path 'target-4' already exists and is not an empty directory.
ok 18 - clone to an existing non-empty directory

expecting success: 
	>target-5 &&
	test_must_fail git clone src target-5

Cloning into 'foo'...
fatal: destination path 'target-5' already exists and is not an empty directory.
ok 19 - clone to an existing path

expecting success: 
	mkdir src-0 &&
	(
		cd src-0 && git init
	) &&
	git clone "file://$(pwd)/src-0" target-6 2>err-6 &&
	! grep "fatal:" err-6 &&
	(
		cd src-0 && test_commit A
	) &&
	git clone "file://$(pwd)/src-0" target-7 2>err-7 &&
	! grep "fatal:" err-7 &&
	# There is no reason to insist they are bit-for-bit
	# identical, but this test should suffice for now.
	test_cmp target-6/.git/config target-7/.git/config

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5601-clone/src-0/.git/
warning: You appear to have cloned an empty repository.
ok 12 - clone of ssh://host/foo/.git goes to foo (non-bare)

expecting success: 
		rm -rf foo.git &&
		git clone --bare ssh://host/foo/.git &&
		test_path_is_dir foo.git
	
Cloning into bare repository 'foo.git'...
warning: You appear to have cloned an empty repository.
ok 13 - clone of ssh://host/foo/.git goes to foo.git (bare)

expecting success: 
		rm -rf foo &&
		git clone  ssh://host/foo/ &&
		test_path_is_dir foo
	
[master (root-commit) 0ddfaf1] A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 A.t
Cloning into 'foo'...
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
warning: You appear to have cloned an empty repository.
ok 14 - clone of ssh://host/foo/ goes to foo (non-bare)

expecting success: 
		rm -rf foo &&
		git clone  ssh://host/foo/// &&
		test_path_is_dir foo
	
To repo1
 * [new branch]      b/1001 -> b/1001
 * [new branch]      b/1002 -> b/1002
 * [new branch]      b/1003 -> b/1003
 * [new branch]      b/1004 -> b/1004
 * [new branch]      b/1005 -> b/1005
 * [new branch]      b/1006 -> b/1006
 * [new branch]      b/1007 -> b/1007
 * [new branch]      b/1008 -> b/1008
 * [new branch]      b/1009 -> b/1009
 * [new branch]      b/1010 -> b/1010
 * [new branch]      b/1011 -> b/1011
 * [new branch]      b/1012 -> b/1012
 * [new branch]      b/1013 -> b/1013
 * [new branch]      b/1014 -> b/1014
Cloning into 'foo'...
 * [new branch]      b/1015 -> b/1015
 * [new branch]      b/1016 -> b/1016
 * [new branch]      b/1017 -> b/1017
 * [new branch]      b/1018 -> b/1018
 * [new branch]      b/1019 -> b/1019
 * [new branch]      b/1020 -> b/1020
 * [new branch]      b/1021 -> b/1021
 * [new branch]      b/1022 -> b/1022
 * [new branch]      b/1023 -> b/1023
 * [new branch]      b/1024 -> b/1024
 * [new branch]      b/1025 -> b/1025
 * [new branch]      b/1026 -> b/1026
 * [new branch]      b/1027 -> b/1027
 * [new branch]      b/1028 -> b/1028
 * [new branch]      b/1029 -> b/1029
 * [new branch]      b/1030 -> b/1030
 * [new branch]      b/1031 -> b/1031
 * [new branch]      b/1032 -> b/1032
 * [new branch]      b/1033 -> b/1033
 * [new branch]      b/1034 -> b/1034
 * [new branch]      b/1035 -> b/1035
 * [new branch]      b/1036 -> b/1036
 * [new branch]      b/1037 -> b/1037
 * [new branch]      b/1038 -> b/1038
 * [new branch]      b/1039 -> b/1039
 * [new branch]      b/1040 -> b/1040
 * [new branch]      b/1041 -> b/1041
 * [new branch]      b/1042 -> b/1042
 * [new branch]      b/1043 -> b/1043
 * [new branch]      b/1044 -> b/1044
 * [new branch]      b/1045 -> b/1045
 * [new branch]      b/1046 -> b/1046
 * [new branch]      b/1047 -> b/1047
 * [new branch]      b/1048 -> b/1048
 * [new branch]      b/1049 -> b/1049
 * [new branch]      b/1050 -> b/1050
 * [new branch]      b/1051 -> b/1051
 * [new branch]      b/1052 -> b/1052
 * [new branch]      b/1053 -> b/1053
 * [new branch]      b/1054 -> b/1054
 * [new branch]      b/1055 -> b/1055
 * [new branch]      b/1056 -> b/1056
 * [new branch]      b/1057 -> b/1057
 * [new branch]      b/1058 -> b/1058
 * [new branch]      b/1059 -> b/1059
 * [new branch]      b/1060 -> b/1060
 * [new branch]      b/1061 -> b/1061
 * [new branch]      b/1062 -> b/1062
 * [new branch]      b/1063 -> b/1063
 * [new branch]      b/1064 -> b/1064
 * [new branch]      b/1065 -> b/1065
 * [new branch]      b/1066 -> b/1066
 * [new branch]      b/1067 -> b/1067
 * [new branch]      b/1068 -> b/1068
 * [new branch]      b/1069 -> b/1069
 * [new branch]      b/1070 -> b/1070
 * [new branch]      b/1071 -> b/1071
 * [new branch]      b/1072 -> b/1072
 * [new branch]      b/1073 -> b/1073
 * [new branch]      b/1074 -> b/1074
 * [new branch]      b/1075 -> b/1075
 * [new branch]      b/1076 -> b/1076
 * [new branch]      b/1077 -> b/1077
 * [new branch]      b/1078 -> b/1078
 * [new branch]      b/1079 -> b/1079
 * [new branch]      b/1080 -> b/1080
 * [new branch]      b/1081 -> b/1081
 * [new branch]      b/1082 -> b/1082
 * [new branch]      b/1083 -> b/1083
 * [new branch]      b/1084 -> b/1084
 * [new branch]      b/1085 -> b/1085
 * [new branch]      b/1086 -> b/1086
 * [new branch]      b/1087 -> b/1087
 * [new branch]      b/1088 -> b/1088
 * [new branch]      b/1089 -> b/1089
 * [new branch]      b/1090 -> b/1090
 * [new branch]      b/1091 -> b/1091
 * [new branch]      b/1092 -> b/1092
 * [new branch]      b/1093 -> b/1093
 * [new branch]      b/1094 -> b/1094
 * [new branch]      b/1095 -> b/1095
 * [new branch]      b/1096 -> b/1096
 * [new branch]      b/1097 -> b/1097
 * [new branch]      b/1098 -> b/1098
 * [new branch]      b/1099 -> b/1099
 * [new branch]      b/1100 -> b/1100
 * [new branch]      b/1101 -> b/1101
 * [new branch]      b/1102 -> b/1102
 * [new branch]      b/1103 -> b/1103
 * [new branch]      b/1104 -> b/1104
 * [new branch]      b/1105 -> b/1105
 * [new branch]      b/1106 -> b/1106
 * [new branch]      b/1107 -> b/1107
 * [new branch]      b/1108 -> b/1108
 * [new branch]      b/1109 -> b/1109
 * [new branch]      b/1110 -> b/1110
 * [new branch]      b/1111 -> b/1111
 * [new branch]      b/1112 -> b/1112
 * [new branch]      b/1113 -> b/1113
 * [new branch]      b/1114 -> b/1114
 * [new branch]      b/1115 -> b/1115
 * [new branch]      b/1116 -> b/1116
 * [new branch]      b/1117 -> b/1117
 * [new branch]      b/1118 -> b/1118
 * [new branch]      b/1119 -> b/1119
 * [new branch]      b/1120 -> b/1120
 * [new branch]      b/1121 -> b/1121
 * [new branch]      b/1122 -> b/1122
 * [new branch]      b/1123 -> b/1123
 * [new branch]      b/1124 -> b/1124
 * [new branch]      b/1125 -> b/1125
 * [new branch]      b/1126 -> b/1126
 * [new branch]      b/1127 -> b/1127
 * [new branch]      b/1128 -> b/1128
 * [new branch]      b/1129 -> b/1129
 * [new branch]      b/1130 -> b/1130
 * [new branch]      b/1131 -> b/1131
 * [new branch]      b/1132 -> b/1132
 * [new branch]      b/1133 -> b/1133
 * [new branch]      b/1134 -> b/1134
 * [new branch]      b/1135 -> b/1135
 * [new branch]      b/1136 -> b/1136
 * [new branch]      b/1137 -> b/1137
 * [new branch]      b/1138 -> b/1138
 * [new branch]      b/1139 -> b/1139
 * [new branch]      b/1140 -> b/1140
 * [new branch]      b/1141 -> b/1141
 * [new branch]      b/1142 -> b/1142
 * [new branch]      b/1143 -> b/1143
 * [new branch]      b/1144 -> b/1144
 * [new branch]      b/1145 -> b/1145
 * [new branch]      b/1146 -> b/1146
 * [new branch]      b/1147 -> b/1147
 * [new branch]      b/1148 -> b/1148
 * [new branch]      b/1149 -> b/1149
 * [new branch]      b/1150 -> b/1150
 * [new branch]      b/1151 -> b/1151
 * [new branch]      b/1152 -> b/1152
 * [new branch]      b/1153 -> b/1153
 * [new branch]      b/1154 -> b/1154
 * [new branch]      b/1155 -> b/1155
 * [new branch]      b/1156 -> b/1156
 * [new branch]      b/1157 -> b/1157
 * [new branch]      b/1158 -> b/1158
 * [new branch]      b/1159 -> b/1159
 * [new branch]      b/1160 -> b/1160
 * [new branch]      b/1161 -> b/1161
 * [new branch]      b/1162 -> b/1162
 * [new branch]      b/1163 -> b/1163
 * [new branch]      b/1164 -> b/1164
 * [new branch]      b/1165 -> b/1165
 * [new branch]      b/1166 -> b/1166
 * [new branch]      b/1167 -> b/1167
 * [new branch]      b/1168 -> b/1168
 * [new branch]      b/1169 -> b/1169
 * [new branch]      b/1170 -> b/1170
 * [new branch]      b/1171 -> b/1171
 * [new branch]      b/1172 -> b/1172
 * [new branch]      b/1173 -> b/1173
 * [new branch]      b/1174 -> b/1174
 * [new branch]      b/1175 -> b/1175
 * [new branch]      b/1176 -> b/1176
 * [new branch]      b/1177 -> b/1177
 * [new branch]      b/1178 -> b/1178
 * [new branch]      b/1179 -> b/1179
 * [new branch]      b/1180 -> b/1180
 * [new branch]      b/1181 -> b/1181
 * [new branch]      b/1182 -> b/1182
 * [new branch]      b/1183 -> b/1183
 * [new branch]      b/1184 -> b/1184
 * [new branch]      b/1185 -> b/1185
 * [new branch]      b/1186 -> b/1186
 * [new branch]      b/1187 -> b/1187
 * [new branch]      b/1188 -> b/1188
 * [new branch]      b/1189 -> b/1189
 * [new branch]      b/1190 -> b/1190
 * [new branch]      b/1191 -> b/1191
 * [new branch]      b/1192 -> b/1192
 * [new branch]      b/1193 -> b/1193
 * [new branch]      b/1194 -> b/1194
 * [new branch]      b/1195 -> b/1195
 * [new branch]      b/1196 -> b/1196
 * [new branch]      b/1197 -> b/1197
 * [new branch]      b/1198 -> b/1198
 * [new branch]      b/1199 -> b/1199
 * [new branch]      b/1200 -> b/1200
 * [new branch]      b/1201 -> b/1201
 * [new branch]      b/1202 -> b/1202
 * [new branch]      b/1203 -> b/1203
 * [new branch]      b/1204 -> b/1204
 * [new branch]      b/1205 -> b/1205
 * [new branch]      b/1206 -> b/1206
 * [new branch]      b/1207 -> b/1207
 * [new branch]      b/1208 -> b/1208
 * [new branch]      b/1209 -> b/1209
 * [new branch]      b/1210 -> b/1210
 * [new branch]      b/1211 -> b/1211
 * [new branch]      b/1212 -> b/1212
 * [new branch]      b/1213 -> b/1213
 * [new branch]      b/1214 -> b/1214
 * [new branch]      b/1215 -> b/1215
 * [new branch]      b/1216 -> b/1216
 * [new branch]      b/1217 -> b/1217
 * [new branch]      b/1218 -> b/1218
 * [new branch]      b/1219 -> b/1219
 * [new branch]      b/1220 -> b/1220
 * [new branch]      b/1221 -> b/1221
 * [new branch]      b/1222 -> b/1222
 * [new branch]      b/1223 -> b/1223
 * [new branch]      b/1224 -> b/1224
 * [new branch]      b/1225 -> b/1225
 * [new branch]      b/1226 -> b/1226
 * [new branch]      b/1227 -> b/1227
 * [new branch]      b/1228 -> b/1228
 * [new branch]      b/1229 -> b/1229
 * [new branch]      b/1230 -> b/1230
 * [new branch]      b/1231 -> b/1231
 * [new branch]      b/1232 -> b/1232
 * [new branch]      b/1233 -> b/1233
 * [new branch]      b/1234 -> b/1234
 * [new branch]      b/1235 -> b/1235
 * [new branch]      b/1236 -> b/1236
 * [new branch]      b/1237 -> b/1237
 * [new branch]      b/1238 -> b/1238
 * [new branch]      b/1239 -> b/1239
 * [new branch]      b/1240 -> b/1240
 * [new branch]      b/1241 -> b/1241
 * [new branch]      b/1242 -> b/1242
 * [new branch]      b/1243 -> b/1243
 * [new branch]      b/1244 -> b/1244
 * [new branch]      b/1245 -> b/1245
 * [new branch]      b/1246 -> b/1246
 * [new branch]      b/1247 -> b/1247
 * [new branch]      b/1248 -> b/1248
 * [new branch]      b/1249 -> b/1249
 * [new branch]      b/1250 -> b/1250
 * [new branch]      b/1251 -> b/1251
 * [new branch]      b/1252 -> b/1252
 * [new branch]      b/1253 -> b/1253
 * [new branch]      b/1254 -> b/1254
 * [new branch]      b/1255 -> b/1255
 * [new branch]      b/1256 -> b/1256
 * [new branch]      b/1257 -> b/1257
 * [new branch]      b/1258 -> b/1258
 * [new branch]      b/1259 -> b/1259
 * [new branch]      b/1260 -> b/1260
 * [new branch]      b/1261 -> b/1261
 * [new branch]      b/1262 -> b/1262
 * [new branch]      b/1263 -> b/1263
 * [new branch]      b/1264 -> b/1264
 * [new branch]      b/1265 -> b/1265
 * [new branch]      b/1266 -> b/1266
 * [new branch]      b/1267 -> b/1267
 * [new branch]      b/1268 -> b/1268
 * [new branch]      b/1269 -> b/1269
 * [new branch]      b/1270 -> b/1270
 * [new branch]      b/1271 -> b/1271
 * [new branch]      b/1272 -> b/1272
 * [new branch]      b/1273 -> b/1273
 * [new branch]      b/1274 -> b/1274
 * [new branch]      b/1275 -> b/1275
 * [new branch]      b/1276 -> b/1276
 * [new branch]      b/1277 -> b/1277
 * [new branch]      b/1278 -> b/1278
 * [new branch]      b/1279 -> b/1279
 * [new branch]      b/1280 -> b/1280
 * [new branch]      b/1281 -> b/1281
 * [new branch]      b/1282 -> b/1282
 * [new branch]      b/1283 -> b/1283
 * [new branch]      b/1284 -> b/1284
 * [new branch]      b/1285 -> b/1285
 * [new branch]      b/1286 -> b/1286
 * [new branch]      b/1287 -> b/1287
 * [new branch]      b/1288 -> b/1288
 * [new branch]      b/1289 -> b/1289
 * [new branch]      b/1290 -> b/1290
 * [new branch]      b/1291 -> b/1291
 * [new branch]      b/1292 -> b/1292
 * [new branch]      b/1293 -> b/1293
 * [new branch]      b/1294 -> b/1294
 * [new branch]      b/1295 -> b/1295
 * [new branch]      b/1296 -> b/1296
 * [new branch]      b/1297 -> b/1297
 * [new branch]      b/1298 -> b/1298
 * [new branch]      b/1299 -> b/1299
 * [new branch]      b/1300 -> b/1300
 * [new branch]      b/1301 -> b/1301
 * [new branch]      b/1302 -> b/1302
 * [new branch]      b/1303 -> b/1303
 * [new branch]      b/1304 -> b/1304
 * [new branch]      b/1305 -> b/1305
 * [new branch]      b/1306 -> b/1306
 * [new branch]      b/1307 -> b/1307
 * [new branch]      b/1308 -> b/1308
 * [new branch]      b/1309 -> b/1309
 * [new branch]      b/1310 -> b/1310
 * [new branch]      b/1311 -> b/1311
 * [new branch]      b/1312 -> b/1312
 * [new branch]      b/1313 -> b/1313
 * [new branch]      b/1314 -> b/1314
 * [new branch]      b/1315 -> b/1315
 * [new branch]      b/1316 -> b/1316
 * [new branch]      b/1317 -> b/1317
 * [new branch]      b/1318 -> b/1318
 * [new branch]      b/1319 -> b/1319
 * [new branch]      b/1320 -> b/1320
 * [new branch]      b/1321 -> b/1321
 * [new branch]      b/1322 -> b/1322
 * [new branch]      b/1323 -> b/1323
 * [new branch]      b/1324 -> b/1324
 * [new branch]      b/1325 -> b/1325
 * [new branch]      b/1326 -> b/1326
 * [new branch]      b/1327 -> b/1327
 * [new branch]      b/1328 -> b/1328
 * [new branch]      b/1329 -> b/1329
 * [new branch]      b/1330 -> b/1330
 * [new branch]      b/1331 -> b/1331
 * [new branch]      b/1332 -> b/1332
 * [new branch]      b/1333 -> b/1333
 * [new branch]      b/1334 -> b/1334
 * [new branch]      b/1335 -> b/1335
 * [new branch]      b/1336 -> b/1336
 * [new branch]      b/1337 -> b/1337
 * [new branch]      b/1338 -> b/1338
 * [new branch]      b/1339 -> b/1339
 * [new branch]      b/1340 -> b/1340
 * [new branch]      b/1341 -> b/1341
 * [new branch]      b/1342 -> b/1342
 * [new branch]      b/1343 -> b/1343
 * [new branch]      b/1344 -> b/1344
 * [new branch]      b/1345 -> b/1345
 * [new branch]      b/1346 -> b/1346
 * [new branch]      b/1347 -> b/1347
 * [new branch]      b/1348 -> b/1348
 * [new branch]      b/1349 -> b/1349
 * [new branch]      b/1350 -> b/1350
 * [new branch]      b/1351 -> b/1351
 * [new branch]      b/1352 -> b/1352
 * [new branch]      b/1353 -> b/1353
 * [new branch]      b/1354 -> b/1354
 * [new branch]      b/1355 -> b/1355
 * [new branch]      b/1356 -> b/1356
 * [new branch]      b/1357 -> b/1357
 * [new branch]      b/1358 -> b/1358
 * [new branch]      b/1359 -> b/1359
 * [new branch]      b/1360 -> b/1360
 * [new branch]      b/1361 -> b/1361
 * [new branch]      b/1362 -> b/1362
 * [new branch]      b/1363 -> b/1363
 * [new branch]      b/1364 -> b/1364
 * [new branch]      b/1365 -> b/1365
 * [new branch]      b/1366 -> b/1366
 * [new branch]      b/1367 -> b/1367
 * [new branch]      b/1368 -> b/1368
 * [new branch]      b/1369 -> b/1369
 * [new branch]      b/1370 -> b/1370
 * [new branch]      b/1371 -> b/1371
 * [new branch]      b/1372 -> b/1372
 * [new branch]      b/1373 -> b/1373
 * [new branch]      b/1374 -> b/1374
 * [new branch]      b/1375 -> b/1375
 * [new branch]      b/1376 -> b/1376
 * [new branch]      b/1377 -> b/1377
 * [new branch]      b/1378 -> b/1378
 * [new branch]      b/1379 -> b/1379
 * [new branch]      b/1380 -> b/1380
 * [new branch]      b/1381 -> b/1381
 * [new branch]      b/1382 -> b/1382
 * [new branch]      b/1383 -> b/1383
 * [new branch]      b/1384 -> b/1384
 * [new branch]      b/1385 -> b/1385
 * [new branch]      b/1386 -> b/1386
 * [new branch]      b/1387 -> b/1387
 * [new branch]      b/1388 -> b/1388
 * [new branch]      b/1389 -> b/1389
 * [new branch]      b/1390 -> b/1390
 * [new branch]      b/1391 -> b/1391
 * [new branch]      b/1392 -> b/1392
 * [new branch]      b/1393 -> b/1393
 * [new branch]      b/1394 -> b/1394
 * [new branch]      b/1395 -> b/1395
 * [new branch]      b/1396 -> b/1396
 * [new branch]      b/1397 -> b/1397
 * [new branch]      b/1398 -> b/1398
 * [new branch]      b/1399 -> b/1399
 * [new branch]      b/1400 -> b/1400
 * [new branch]      b/1401 -> b/1401
 * [new branch]      b/1402 -> b/1402
 * [new branch]      b/1403 -> b/1403
 * [new branch]      b/1404 -> b/1404
 * [new branch]      b/1405 -> b/1405
 * [new branch]      b/1406 -> b/1406
 * [new branch]      b/1407 -> b/1407
 * [new branch]      b/1408 -> b/1408
 * [new branch]      b/1409 -> b/1409
 * [new branch]      b/1410 -> b/1410
 * [new branch]      b/1411 -> b/1411
 * [new branch]      b/1412 -> b/1412
 * [new branch]      b/1413 -> b/1413
 * [new branch]      b/1414 -> b/1414
 * [new branch]      b/1415 -> b/1415
 * [new branch]      b/1416 -> b/1416
 * [new branch]      b/1417 -> b/1417
 * [new branch]      b/1418 -> b/1418
 * [new branch]      b/1419 -> b/1419
 * [new branch]      b/1420 -> b/1420
 * [new branch]      b/1421 -> b/1421
 * [new branch]      b/1422 -> b/1422
 * [new branch]      b/1423 -> b/1423
 * [new branch]      b/1424 -> b/1424
 * [new branch]      b/1425 -> b/1425
 * [new branch]      b/1426 -> b/1426
 * [new branch]      b/1427 -> b/1427
 * [new branch]      b/1428 -> b/1428
 * [new branch]      b/1429 -> b/1429
 * [new branch]      b/1430 -> b/1430
 * [new branch]      b/1431 -> b/1431
 * [new branch]      b/1432 -> b/1432
 * [new branch]      b/1433 -> b/1433
 * [new branch]      b/1434 -> b/1434
 * [new branch]      b/1435 -> b/1435
 * [new branch]      b/1436 -> b/1436
 * [new branch]      b/1437 -> b/1437
 * [new branch]      b/1438 -> b/1438
 * [new branch]      b/1439 -> b/1439
 * [new branch]      b/1440 -> b/1440
 * [new branch]      b/1441 -> b/1441
 * [new branch]      b/1442 -> b/1442
 * [new branch]      b/1443 -> b/1443
 * [new branch]      b/1444 -> b/1444
 * [new branch]      b/1445 -> b/1445
 * [new branch]      b/1446 -> b/1446
 * [new branch]      b/1447 -> b/1447
 * [new branch]      b/1448 -> b/1448
 * [new branch]      b/1449 -> b/1449
 * [new branch]      b/1450 -> b/1450
 * [new branch]      b/1451 -> b/1451
 * [new branch]      b/1452 -> b/1452
 * [new branch]      b/1453 -> b/1453
 * [new branch]      b/1454 -> b/1454
 * [new branch]      b/1455 -> b/1455
 * [new branch]      b/1456 -> b/1456
 * [new branch]      b/1457 -> b/1457
 * [new branch]      b/1458 -> b/1458
 * [new branch]      b/1459 -> b/1459
 * [new branch]      b/1460 -> b/1460
 * [new branch]      b/1461 -> b/1461
 * [new branch]      b/1462 -> b/1462
 * [new branch]      b/1463 -> b/1463
 * [new branch]      b/1464 -> b/1464
 * [new branch]      b/1465 -> b/1465
 * [new branch]      b/1466 -> b/1466
 * [new branch]      b/1467 -> b/1467
 * [new branch]      b/1468 -> b/1468
 * [new branch]      b/1469 -> b/1469
 * [new branch]      b/1470 -> b/1470
 * [new branch]      b/1471 -> b/1471
 * [new branch]      b/1472 -> b/1472
 * [new branch]      b/1473 -> b/1473
 * [new branch]      b/1474 -> b/1474
 * [new branch]      b/1475 -> b/1475
 * [new branch]      b/1476 -> b/1476
 * [new branch]      b/1477 -> b/1477
 * [new branch]      b/1478 -> b/1478
 * [new branch]      b/1479 -> b/1479
 * [new branch]      b/1480 -> b/1480
 * [new branch]      b/1481 -> b/1481
 * [new branch]      b/1482 -> b/1482
 * [new branch]      b/1483 -> b/1483
 * [new branch]      b/1484 -> b/1484
 * [new branch]      b/1485 -> b/1485
 * [new branch]      b/1486 -> b/1486
 * [new branch]      b/1487 -> b/1487
 * [new branch]      b/1488 -> b/1488
 * [new branch]      b/1489 -> b/1489
 * [new branch]      b/1490 -> b/1490
 * [new branch]      b/1491 -> b/1491
 * [new branch]      b/1492 -> b/1492
 * [new branch]      b/1493 -> b/1493
 * [new branch]      b/1494 -> b/1494
 * [new branch]      b/1495 -> b/1495
 * [new branch]      b/1496 -> b/1496
 * [new branch]      b/1497 -> b/1497
 * [new branch]      b/1498 -> b/1498
 * [new branch]      b/1499 -> b/1499
 * [new branch]      b/1500 -> b/1500
 * [new branch]      b/1501 -> b/1501
 * [new branch]      b/1502 -> b/1502
 * [new branch]      b/1503 -> b/1503
 * [new branch]      b/1504 -> b/1504
 * [new branch]      b/1505 -> b/1505
 * [new branch]      b/1506 -> b/1506
 * [new branch]      b/1507 -> b/1507
 * [new branch]      b/1508 -> b/1508
 * [new branch]      b/1509 -> b/1509
 * [new branch]      b/1510 -> b/1510
 * [new branch]      b/1511 -> b/1511
 * [new branch]      b/1512 -> b/1512
 * [new branch]      b/1513 -> b/1513
 * [new branch]      b/1514 -> b/1514
 * [new branch]      b/1515 -> b/1515
 * [new branch]      b/1516 -> b/1516
 * [new branch]      b/1517 -> b/1517
 * [new branch]      b/1518 -> b/1518
 * [new branch]      b/1519 -> b/1519
 * [new branch]      b/1520 -> b/1520
 * [new branch]      b/1521 -> b/1521
 * [new branch]      b/1522 -> b/1522
 * [new branch]      b/1523 -> b/1523
 * [new branch]      b/1524 -> b/1524
 * [new branch]      b/1525 -> b/1525
 * [new branch]      b/1526 -> b/1526
 * [new branch]      b/1527 -> b/1527
 * [new branch]      b/1528 -> b/1528
 * [new branch]      b/1529 -> b/1529
 * [new branch]      b/1530 -> b/1530
 * [new branch]      b/1531 -> b/1531
 * [new branch]      b/1532 -> b/1532
 * [new branch]      b/1533 -> b/1533
 * [new branch]      b/1534 -> b/1534
 * [new branch]      b/1535 -> b/1535
 * [new branch]      b/1536 -> b/1536
 * [new branch]      b/1537 -> b/1537
 * [new branch]      b/1538 -> b/1538
 * [new branch]      b/1539 -> b/1539
 * [new branch]      b/1540 -> b/1540
 * [new branch]      b/1541 -> b/1541
 * [new branch]      b/1542 -> b/1542
 * [new branch]      b/1543 -> b/1543
 * [new branch]      b/1544 -> b/1544
 * [new branch]      b/1545 -> b/1545
 * [new branch]      b/1546 -> b/1546
 * [new branch]      b/1547 -> b/1547
 * [new branch]      b/1548 -> b/1548
 * [new branch]      b/1549 -> b/1549
 * [new branch]      b/1550 -> b/1550
 * [new branch]      b/1551 -> b/1551
 * [new branch]      b/1552 -> b/1552
 * [new branch]      b/1553 -> b/1553
 * [new branch]      b/1554 -> b/1554
 * [new branch]      b/1555 -> b/1555
 * [new branch]      b/1556 -> b/1556
 * [new branch]      b/1557 -> b/1557
 * [new branch]      b/1558 -> b/1558
 * [new branch]      b/1559 -> b/1559
 * [new branch]      b/1560 -> b/1560
 * [new branch]      b/1561 -> b/1561
 * [new branch]      b/1562 -> b/1562
 * [new branch]      b/1563 -> b/1563
 * [new branch]      b/1564 -> b/1564
 * [new branch]      b/1565 -> b/1565
 * [new branch]      b/1566 -> b/1566
 * [new branch]      b/1567 -> b/1567
 * [new branch]      b/1568 -> b/1568
 * [new branch]      b/1569 -> b/1569
 * [new branch]      b/1570 -> b/1570
 * [new branch]      b/1571 -> b/1571
 * [new branch]      b/1572 -> b/1572
 * [new branch]      b/1573 -> b/1573
 * [new branch]      b/1574 -> b/1574
 * [new branch]      b/1575 -> b/1575
 * [new branch]      b/1576 -> b/1576
 * [new branch]      b/1577 -> b/1577
 * [new branch]      b/1578 -> b/1578
 * [new branch]      b/1579 -> b/1579
 * [new branch]      b/1580 -> b/1580
 * [new branch]      b/1581 -> b/1581
 * [new branch]      b/1582 -> b/1582
 * [new branch]      b/1583 -> b/1583
 * [new branch]      b/1584 -> b/1584
 * [new branch]      b/1585 -> b/1585
 * [new branch]      b/1586 -> b/1586
 * [new branch]      b/1587 -> b/1587
 * [new branch]      b/1588 -> b/1588
 * [new branch]      b/1589 -> b/1589
 * [new branch]      b/1590 -> b/1590
 * [new branch]      b/1591 -> b/1591
 * [new branch]      b/1592 -> b/1592
 * [new branch]      b/1593 -> b/1593
 * [new branch]      b/1594 -> b/1594
 * [new branch]      b/1595 -> b/1595
 * [new branch]      b/1596 -> b/1596
 * [new branch]      b/1597 -> b/1597
 * [new branch]      b/1598 -> b/1598
 * [new branch]      b/1599 -> b/1599
 * [new branch]      b/1600 -> b/1600
 * [new branch]      b/1601 -> b/1601
 * [new branch]      b/1602 -> b/1602
 * [new branch]      b/1603 -> b/1603
 * [new branch]      b/1604 -> b/1604
 * [new branch]      b/1605 -> b/1605
 * [new branch]      b/1606 -> b/1606
 * [new branch]      b/1607 -> b/1607
 * [new branch]      b/1608 -> b/1608
 * [new branch]      b/1609 -> b/1609
 * [new branch]      b/1610 -> b/1610
 * [new branch]      b/1611 -> b/1611
 * [new branch]      b/1612 -> b/1612
 * [new branch]      b/1613 -> b/1613
 * [new branch]      b/1614 -> b/1614
 * [new branch]      b/1615 -> b/1615
 * [new branch]      b/1616 -> b/1616
 * [new branch]      b/1617 -> b/1617
 * [new branch]      b/1618 -> b/1618
 * [new branch]      b/1619 -> b/1619
 * [new branch]      b/1620 -> b/1620
 * [new branch]      b/1621 -> b/1621
 * [new branch]      b/1622 -> b/1622
 * [new branch]      b/1623 -> b/1623
 * [new branch]      b/1624 -> b/1624
 * [new branch]      b/1625 -> b/1625
 * [new branch]      b/1626 -> b/1626
 * [new branch]      b/1627 -> b/1627
 * [new branch]      b/1628 -> b/1628
 * [new branch]      b/1629 -> b/1629
 * [new branch]      b/1630 -> b/1630
 * [new branch]      b/1631 -> b/1631
 * [new branch]      b/1632 -> b/1632
 * [new branch]      b/1633 -> b/1633
 * [new branch]      b/1634 -> b/1634
 * [new branch]      b/1635 -> b/1635
 * [new branch]      b/1636 -> b/1636
 * [new branch]      b/1637 -> b/1637
 * [new branch]      b/1638 -> b/1638
 * [new branch]      b/1639 -> b/1639
 * [new branch]      b/1640 -> b/1640
 * [new branch]      b/1641 -> b/1641
 * [new branch]      b/1642 -> b/1642
 * [new branch]      b/1643 -> b/1643
 * [new branch]      b/1644 -> b/1644
 * [new branch]      b/1645 -> b/1645
 * [new branch]      b/1646 -> b/1646
 * [new branch]      b/1647 -> b/1647
 * [new branch]      b/1648 -> b/1648
 * [new branch]      b/1649 -> b/1649
 * [new branch]      b/1650 -> b/1650
 * [new branch]      b/1651 -> b/1651
 * [new branch]      b/1652 -> b/1652
 * [new branch]      b/1653 -> b/1653
 * [new branch]      b/1654 -> b/1654
 * [new branch]      b/1655 -> b/1655
 * [new branch]      b/1656 -> b/1656
 * [new branch]      b/1657 -> b/1657
 * [new branch]      b/1658 -> b/1658
 * [new branch]      b/1659 -> b/1659
 * [new branch]      b/1660 -> b/1660
 * [new branch]      b/1661 -> b/1661
 * [new branch]      b/1662 -> b/1662
 * [new branch]      b/1663 -> b/1663
 * [new branch]      b/1664 -> b/1664
 * [new branch]      b/1665 -> b/1665
 * [new branch]      b/1666 -> b/1666
 * [new branch]      b/1667 -> b/1667
 * [new branch]      b/1668 -> b/1668
 * [new branch]      b/1669 -> b/1669
 * [new branch]      b/1670 -> b/1670
 * [new branch]      b/1671 -> b/1671
 * [new branch]      b/1672 -> b/1672
 * [new branch]      b/1673 -> b/1673
 * [new branch]      b/1674 -> b/1674
 * [new branch]      b/1675 -> b/1675
 * [new branch]      b/1676 -> b/1676
 * [new branch]      b/1677 -> b/1677
 * [new branch]      b/1678 -> b/1678
 * [new branch]      b/1679 -> b/1679
 * [new branch]      b/1680 -> b/1680
 * [new branch]      b/1681 -> b/1681
 * [new branch]      b/1682 -> b/1682
 * [new branch]      b/1683 -> b/1683
 * [new branch]      b/1684 -> b/1684
 * [new branch]      b/1685 -> b/1685
 * [new branch]      b/1686 -> b/1686
 * [new branch]      b/1687 -> b/1687
 * [new branch]      b/1688 -> b/1688
 * [new branch]      b/1689 -> b/1689
 * [new branch]      b/1690 -> b/1690
 * [new branch]      b/1691 -> b/1691
 * [new branch]      b/1692 -> b/1692
 * [new branch]      b/1693 -> b/1693
 * [new branch]      b/1694 -> b/1694
 * [new branch]      b/1695 -> b/1695
 * [new branch]      b/1696 -> b/1696
 * [new branch]      b/1697 -> b/1697
 * [new branch]      b/1698 -> b/1698
 * [new branch]      b/1699 -> b/1699
 * [new branch]      b/1700 -> b/1700
 * [new branch]      b/1701 -> b/1701
 * [new branch]      b/1702 -> b/1702
 * [new branch]      b/1703 -> b/1703
 * [new branch]      b/1704 -> b/1704
 * [new branch]      b/1705 -> b/1705
 * [new branch]      b/1706 -> b/1706
 * [new branch]      b/1707 -> b/1707
 * [new branch]      b/1708 -> b/1708
 * [new branch]      b/1709 -> b/1709
 * [new branch]      b/1710 -> b/1710
 * [new branch]      b/1711 -> b/1711
 * [new branch]      b/1712 -> b/1712
 * [new branch]      b/1713 -> b/1713
 * [new branch]      b/1714 -> b/1714
 * [new branch]      b/1715 -> b/1715
 * [new branch]      b/1716 -> b/1716
 * [new branch]      b/1717 -> b/1717
 * [new branch]      b/1718 -> b/1718
 * [new branch]      b/1719 -> b/1719
 * [new branch]      b/1720 -> b/1720
 * [new branch]      b/1721 -> b/1721
 * [new branch]      b/1722 -> b/1722
 * [new branch]      b/1723 -> b/1723
 * [new branch]      b/1724 -> b/1724
 * [new branch]      b/1725 -> b/1725
 * [new branch]      b/1726 -> b/1726
 * [new branch]      b/1727 -> b/1727
 * [new branch]      b/1728 -> b/1728
 * [new branch]      b/1729 -> b/1729
 * [new branch]      b/1730 -> b/1730
 * [new branch]      b/1731 -> b/1731
 * [new branch]      b/1732 -> b/1732
 * [new branch]      b/1733 -> b/1733
 * [new branch]      b/1734 -> b/1734
 * [new branch]      b/1735 -> b/1735
 * [new branch]      b/1736 -> b/1736
 * [new branch]      b/1737 -> b/1737
 * [new branch]      b/1738 -> b/1738
 * [new branch]      b/1739 -> b/1739
 * [new branch]      b/1740 -> b/1740
 * [new branch]      b/1741 -> b/1741
 * [new branch]      b/1742 -> b/1742
 * [new branch]      b/1743 -> b/1743
 * [new branch]      b/1744 -> b/1744
 * [new branch]      b/1745 -> b/1745
 * [new branch]      b/1746 -> b/1746
 * [new branch]      b/1747 -> b/1747
 * [new branch]      b/1748 -> b/1748
 * [new branch]      b/1749 -> b/1749
 * [new branch]      b/1750 -> b/1750
 * [new branch]      b/1751 -> b/1751
 * [new branch]      b/1752 -> b/1752
 * [new branch]      b/1753 -> b/1753
 * [new branch]      b/1754 -> b/1754
 * [new branch]      b/1755 -> b/1755
 * [new branch]      b/1756 -> b/1756
 * [new branch]      b/1757 -> b/1757
 * [new branch]      b/1758 -> b/1758
 * [new branch]      b/1759 -> b/1759
 * [new branch]      b/1760 -> b/1760
 * [new branch]      b/1761 -> b/1761
 * [new branch]      b/1762 -> b/1762
 * [new branch]      b/1763 -> b/1763
 * [new branch]      b/1764 -> b/1764
 * [new branch]      b/1765 -> b/1765
 * [new branch]      b/1766 -> b/1766
 * [new branch]      b/1767 -> b/1767
 * [new branch]      b/1768 -> b/1768
 * [new branch]      b/1769 -> b/1769
 * [new branch]      b/1770 -> b/1770
 * [new branch]      b/1771 -> b/1771
 * [new branch]      b/1772 -> b/1772
 * [new branch]      b/1773 -> b/1773
 * [new branch]      b/1774 -> b/1774
 * [new branch]      b/1775 -> b/1775
 * [new branch]      b/1776 -> b/1776
 * [new branch]      b/1777 -> b/1777
 * [new branch]      b/1778 -> b/1778
 * [new branch]      b/1779 -> b/1779
 * [new branch]      b/1780 -> b/1780
 * [new branch]      b/1781 -> b/1781
 * [new branch]      b/1782 -> b/1782
 * [new branch]      b/1783 -> b/1783
 * [new branch]      b/1784 -> b/1784
 * [new branch]      b/1785 -> b/1785
 * [new branch]      b/1786 -> b/1786
 * [new branch]      b/1787 -> b/1787
 * [new branch]      b/1788 -> b/1788
 * [new branch]      b/1789 -> b/1789
 * [new branch]      b/1790 -> b/1790
 * [new branch]      b/1791 -> b/1791
 * [new branch]      b/1792 -> b/1792
 * [new branch]      b/1793 -> b/1793
 * [new branch]      b/1794 -> b/1794
 * [new branch]      b/1795 -> b/1795
 * [new branch]      b/1796 -> b/1796
 * [new branch]      b/1797 -> b/1797
 * [new branch]      b/1798 -> b/1798
 * [new branch]      b/1799 -> b/1799
 * [new branch]      b/1800 -> b/1800
 * [new branch]      b/1801 -> b/1801
 * [new branch]      b/1802 -> b/1802
 * [new branch]      b/1803 -> b/1803
 * [new branch]      b/1804 -> b/1804
 * [new branch]      b/1805 -> b/1805
 * [new branch]      b/1806 -> b/1806
 * [new branch]      b/1807 -> b/1807
 * [new branch]      b/1808 -> b/1808
 * [new branch]      b/1809 -> b/1809
 * [new branch]      b/1810 -> b/1810
 * [new branch]      b/1811 -> b/1811
 * [new branch]      b/1812 -> b/1812
 * [new branch]      b/1813 -> b/1813
 * [new branch]      b/1814 -> b/1814
 * [new branch]      b/1815 -> b/1815
 * [new branch]      b/1816 -> b/1816
 * [new branch]      b/1817 -> b/1817
 * [new branch]      b/1818 -> b/1818
 * [new branch]      b/1819 -> b/1819
 * [new branch]      b/1820 -> b/1820
 * [new branch]      b/1821 -> b/1821
 * [new branch]      b/1822 -> b/1822
 * [new branch]      b/1823 -> b/1823
 * [new branch]      b/1824 -> b/1824
 * [new branch]      b/1825 -> b/1825
 * [new branch]      b/1826 -> b/1826
 * [new branch]      b/1827 -> b/1827
 * [new branch]      b/1828 -> b/1828
 * [new branch]      b/1829 -> b/1829
 * [new branch]      b/1830 -> b/1830
 * [new branch]      b/1831 -> b/1831
 * [new branch]      b/1832 -> b/1832
 * [new branch]      b/1833 -> b/1833
 * [new branch]      b/1834 -> b/1834
 * [new branch]      b/1835 -> b/1835
 * [new branch]      b/1836 -> b/1836
 * [new branch]      b/1837 -> b/1837
 * [new branch]      b/1838 -> b/1838
 * [new branch]      b/1839 -> b/1839
 * [new branch]      b/1840 -> b/1840
 * [new branch]      b/1841 -> b/1841
 * [new branch]      b/1842 -> b/1842
 * [new branch]      b/1843 -> b/1843
 * [new branch]      b/1844 -> b/1844
 * [new branch]      b/1845 -> b/1845
 * [new branch]      b/1846 -> b/1846
 * [new branch]      b/1847 -> b/1847
 * [new branch]      b/1848 -> b/1848
 * [new branch]      b/1849 -> b/1849
 * [new branch]      b/1850 -> b/1850
 * [new branch]      b/1851 -> b/1851
 * [new branch]      b/1852 -> b/1852
 * [new branch]      b/1853 -> b/1853
 * [new branch]      b/1854 -> b/1854
 * [new branch]      b/1855 -> b/1855
 * [new branch]      b/1856 -> b/1856
 * [new branch]      b/1857 -> b/1857
 * [new branch]      b/1858 -> b/1858
 * [new branch]      b/1859 -> b/1859
 * [new branch]      b/1860 -> b/1860
 * [new branch]      b/1861 -> b/1861
 * [new branch]      b/1862 -> b/1862
 * [new branch]      b/1863 -> b/1863
 * [new branch]      b/1864 -> b/1864
 * [new branch]      b/1865 -> b/1865
 * [new branch]      b/1866 -> b/1866
 * [new branch]      b/1867 -> b/1867
 * [new branch]      b/1868 -> b/1868
 * [new branch]      b/1869 -> b/1869
 * [new branch]      b/1870 -> b/1870
 * [new branch]      b/1871 -> b/1871
 * [new branch]      b/1872 -> b/1872
 * [new branch]      b/1873 -> b/1873
 * [new branch]      b/1874 -> b/1874
 * [new branch]      b/1875 -> b/1875
 * [new branch]      b/1876 -> b/1876
 * [new branch]      b/1877 -> b/1877
 * [new branch]      b/1878 -> b/1878
 * [new branch]      b/1879 -> b/1879
 * [new branch]      b/1880 -> b/1880
 * [new branch]      b/1881 -> b/1881
 * [new branch]      b/1882 -> b/1882
 * [new branch]      b/1883 -> b/1883
 * [new branch]      b/1884 -> b/1884
 * [new branch]      b/1885 -> b/1885
 * [new branch]      b/1886 -> b/1886
 * [new branch]      b/1887 -> b/1887
 * [new branch]      b/1888 -> b/1888
 * [new branch]      b/1889 -> b/1889
 * [new branch]      b/1890 -> b/1890
 * [new branch]      b/1891 -> b/1891
 * [new branch]      b/1892 -> b/1892
 * [new branch]      b/1893 -> b/1893
 * [new branch]      b/1894 -> b/1894
 * [new branch]      b/1895 -> b/1895
 * [new branch]      b/1896 -> b/1896
 * [new branch]      b/1897 -> b/1897
 * [new branch]      b/1898 -> b/1898
 * [new branch]      b/1899 -> b/1899
 * [new branch]      b/1900 -> b/1900
 * [new branch]      b/1901 -> b/1901
 * [new branch]      b/1902 -> b/1902
 * [new branch]      b/1903 -> b/1903
 * [new branch]      b/1904 -> b/1904
 * [new branch]      b/1905 -> b/1905
 * [new branch]      b/1906 -> b/1906
 * [new branch]      b/1907 -> b/1907
 * [new branch]      b/1908 -> b/1908
 * [new branch]      b/1909 -> b/1909
 * [new branch]      b/1910 -> b/1910
 * [new branch]      b/1911 -> b/1911
 * [new branch]      b/1912 -> b/1912
 * [new branch]      b/1913 -> b/1913
 * [new branch]      b/1914 -> b/1914
 * [new branch]      b/1915 -> b/1915
 * [new branch]      b/1916 -> b/1916
 * [new branch]      b/1917 -> b/1917
 * [new branch]      b/1918 -> b/1918
 * [new branch]      b/1919 -> b/1919
 * [new branch]      b/1920 -> b/1920
 * [new branch]      b/1921 -> b/1921
 * [new branch]      b/1922 -> b/1922
 * [new branch]      b/1923 -> b/1923
 * [new branch]      b/1924 -> b/1924
 * [new branch]      b/1925 -> b/1925
 * [new branch]      b/1926 -> b/1926
 * [new branch]      b/1927 -> b/1927
 * [new branch]      b/1928 -> b/1928
 * [new branch]      b/1929 -> b/1929
 * [new branch]      b/1930 -> b/1930
 * [new branch]      b/1931 -> b/1931
 * [new branch]      b/1932 -> b/1932
 * [new branch]      b/1933 -> b/1933
 * [new branch]      b/1934 -> b/1934
 * [new branch]      b/1935 -> b/1935
 * [new branch]      b/1936 -> b/1936
 * [new branch]      b/1937 -> b/1937
 * [new branch]      b/1938 -> b/1938
 * [new branch]      b/1939 -> b/1939
 * [new branch]      b/1940 -> b/1940
 * [new branch]      b/1941 -> b/1941
 * [new branch]      b/1942 -> b/1942
 * [new branch]      b/1943 -> b/1943
 * [new branch]      b/1944 -> b/1944
 * [new branch]      b/1945 -> b/1945
 * [new branch]      b/1946 -> b/1946
 * [new branch]      b/1947 -> b/1947
 * [new branch]      b/1948 -> b/1948
 * [new branch]      b/1949 -> b/1949
 * [new branch]      b/1950 -> b/1950
 * [new branch]      b/1951 -> b/1951
 * [new branch]      b/1952 -> b/1952
 * [new branch]      b/1953 -> b/1953
 * [new branch]      b/1954 -> b/1954
 * [new branch]      b/1955 -> b/1955
 * [new branch]      b/1956 -> b/1956
 * [new branch]      b/1957 -> b/1957
 * [new branch]      b/1958 -> b/1958
 * [new branch]      b/1959 -> b/1959
 * [new branch]      b/1960 -> b/1960
 * [new branch]      b/1961 -> b/1961
 * [new branch]      b/1962 -> b/1962
 * [new branch]      b/1963 -> b/1963
 * [new branch]      b/1964 -> b/1964
 * [new branch]      b/1965 -> b/1965
 * [new branch]      b/1966 -> b/1966
 * [new branch]      b/1967 -> b/1967
 * [new branch]      b/1968 -> b/1968
 * [new branch]      b/1969 -> b/1969
 * [new branch]      b/1970 -> b/1970
 * [new branch]      b/1971 -> b/1971
 * [new branch]      b/1972 -> b/1972
 * [new branch]      b/1973 -> b/1973
 * [new branch]      b/1974 -> b/1974
 * [new branch]      b/1975 -> b/1975
 * [new branch]      b/1976 -> b/1976
 * [new branch]      b/1977 -> b/1977
 * [new branch]      b/1978 -> b/1978
 * [new branch]      b/1979 -> b/1979
 * [new branch]      b/1980 -> b/1980
 * [new branch]      b/1981 -> b/1981
 * [new branch]      b/1982 -> b/1982
 * [new branch]      b/1983 -> b/1983
 * [new branch]      b/1984 -> b/1984
 * [new branch]      b/1985 -> b/1985
 * [new branch]      b/1986 -> b/1986
 * [new branch]      b/1987 -> b/1987
 * [new branch]      b/1988 -> b/1988
 * [new branch]      b/1989 -> b/1989
 * [new branch]      b/1990 -> b/1990
 * [new branch]      b/1991 -> b/1991
 * [new branch]      b/1992 -> b/1992
 * [new branch]      b/1993 -> b/1993
 * [new branch]      b/1994 -> b/1994
 * [new branch]      b/1995 -> b/1995
 * [new branch]      b/1996 -> b/1996
 * [new branch]      b/1997 -> b/1997
 * [new branch]      b/1998 -> b/1998
 * [new branch]      b/1999 -> b/1999
 * [new branch]      b/2000 -> b/2000
warning: You appear to have cloned an empty repository.
ok 15 - clone of ssh://host/foo/// goes to foo (non-bare)

expecting success: 
		rm -rf foo &&
		git clone  ssh://host/foo/.git/ &&
		test_path_is_dir foo
	
Cloning into 'sub1'...
Cloning into 'foo'...
warning: You appear to have cloned an empty repository.
done.
ok 16 - clone of ssh://host/foo/.git/ goes to foo (non-bare)

expecting success: 
		rm -rf foo &&
		git clone  ssh://host/foo.git/ &&
		test_path_is_dir foo
	
ok 20 - clone a void

expecting success: 
	(
		test_config="$HOME/.gitconfig" &&
		git config -f "$test_config" branch.autosetuprebase remote &&
		rm -fr dst &&
		git clone src dst &&
		cd dst &&
		actual="z$(git config branch.master.rebase)" &&
		test ztrue = $actual
	)

Cloning into 'foo'...
Cloning into 'dst'...
warning: You appear to have cloned an empty repository.
ok 17 - clone of ssh://host/foo.git/ goes to foo (non-bare)

expecting success: 
		rm -rf foo &&
		git clone  ssh://host/foo.git/// &&
		test_path_is_dir foo
	
done.
Cloning into 'foo'...
ok 21 - clone respects global branch.autosetuprebase

expecting success: 
	git init x+y &&
	git clone "file://$PWD/x+y" xy-url-1 &&
	git clone "file://$PWD/x%2By" xy-url-2

warning: You appear to have cloned an empty repository.
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
ok 18 - clone of ssh://host/foo.git/// goes to foo (non-bare)

expecting success: 
		rm -rf foo &&
		git clone  ssh://host/foo///.git/ &&
		test_path_is_dir foo
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5601-clone/x+y/.git/
Cloning into 'foo'...
Cloning into 'xy-url-1'...
warning: You appear to have cloned an empty repository.
warning: You appear to have cloned an empty repository.
ok 19 - clone of ssh://host/foo///.git/ goes to foo (non-bare)

expecting success: 
		rm -rf foo &&
		git clone  ssh://host/foo/.git/// &&
		test_path_is_dir foo
	
Cloning into 'xy-url-2'...
Cloning into 'foo'...
warning: You appear to have cloned an empty repository.
ok 22 - respect url-encoding of file://

expecting success: 
	rm -rf x+y &&
	git init "x y" &&
	test_must_fail git clone "file://$PWD/x+y" xy-no-plus

warning: You appear to have cloned an empty repository.
ok 20 - clone of ssh://host/foo/.git/// goes to foo (non-bare)

expecting success: 
		rm -rf foo &&
		git clone  host:foo/ &&
		test_path_is_dir foo
	
ok 1 - git_pull: 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
		)
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5601-clone/x y/.git/
Cloning into 'xy-no-plus'...
Cloning into 'foo'...
fatal: '/«PKGBUILDDIR»/t/trash directory.t5601-clone/x+y' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
warning: You appear to have cloned an empty repository.
ok 21 - clone of host:foo/ goes to foo (non-bare)

expecting success: 
		rm -rf foo &&
		git clone  host:foo/// &&
		test_path_is_dir foo
	
ok 23 - do not query-string-decode + in URLs

expecting success: 
	git init x+y &&
	test_must_fail git clone x%2By xy-regular &&
	git clone x+y xy-regular

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5601-clone/x+y/.git/
Cloning into 'foo'...
fatal: repository 'x%2By' does not exist
Cloning into 'submodule_update'...
Cloning into 'xy-regular'...
warning: You appear to have cloned an empty repository.
ok 22 - clone of host:foo/// goes to foo (non-bare)

expecting success: 
		rm -rf foo &&
		git clone  host:foo.git/ &&
		test_path_is_dir foo
	
warning: You appear to have cloned an empty repository.
done.
ok 24 - do not respect url-encoding of non-url path

expecting success: 
	rm -rf dst &&
	git clone --separate-git-dir realgitdir src dst &&
	test -d realgitdir/refs

done.
Cloning into 'foo'...
Cloning into 'dst'...
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
warning: You appear to have cloned an empty repository.
done.
ok 23 - clone of host:foo.git/ goes to foo (non-bare)

expecting success: 
		rm -rf foo &&
		git clone  host:foo/.git/ &&
		test_path_is_dir foo
	
ok 25 - clone separate gitdir

expecting success: 
	echo "gitdir: `pwd`/realgitdir" >expected &&
	test_cmp expected dst/.git

Cloning into 'foo'...
ok 26 - clone separate gitdir: output

expecting success: 
	git clone dst/.git dst2

Branch add_sub1 set up to track remote branch add_sub1 from origin.
Cloning into 'dst2'...
Deleted branch add_sub1 (was 041e421).
warning: You appear to have cloned an empty repository.
ok 24 - clone of host:foo/.git/ goes to foo (non-bare)

expecting success: 
		rm -rf foo &&
		git clone  host:foo.git/// &&
		test_path_is_dir foo
	
Switched to a new branch 'add_sub1'
done.
Cloning into 'foo'...
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 27 - clone from .git file

expecting success: 
	(
		cd dst2 &&
		git fetch ../dst/.git
	)

warning: You appear to have cloned an empty repository.
ok 25 - clone of host:foo.git/// goes to foo (non-bare)

expecting success: 
		rm -rf foo &&
		git clone  host:foo///.git/ &&
		test_path_is_dir foo
	
From ../dst/
 * branch            HEAD       -> FETCH_HEAD
Cloning into 'foo'...
ok 28 - fetch from .git gitfile

expecting success: 
	(
		cd dst2 &&
		git fetch ../dst
	)

warning: You appear to have cloned an empty repository.
Updating aca6d60..041e421
Fast-forward
ok 26 - clone of host:foo///.git/ goes to foo (non-bare)

expecting success: 
		rm -rf foo &&
		git clone  host:foo/.git/// &&
		test_path_is_dir foo
	
 .gitmodules | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
From ../dst
 * branch            HEAD       -> FETCH_HEAD
Cloning into 'foo'...
ok 29 - fetch from gitfile parent

expecting success: 
	rm -rf dst &&
	test_must_fail git clone --separate-git-dir realgitdir src dst

fatal: realgitdir already exists
ok 30 - clone separate gitdir where target already exists

expecting success: 
	git clone --shared --bare src src-1 &&
	git clone --bare src src-2 &&
	git clone --reference=src-2 --bare src-1 target-8 &&
	grep /src-2/ target-8/objects/info/alternates

warning: You appear to have cloned an empty repository.
Cloning into bare repository 'src-1'...
ok 27 - clone of host:foo/.git/// goes to foo (non-bare)

expecting success: 
		rm -rf host &&
		git clone  ssh://host/ &&
		test_path_is_dir host
	
Cloning into 'host'...
done.
Cloning into bare repository 'src-2'...
warning: You appear to have cloned an empty repository.
ok 28 - clone of ssh://host/ goes to host (non-bare)

expecting success: 
		rm -rf host &&
		git clone  ssh://host:1234/ &&
		test_path_is_dir host
	
Cloning into 'host'...
done.
Cloning into bare repository 'target-8'...
warning: You appear to have cloned an empty repository.
ok 29 - clone of ssh://host:1234/ goes to host (non-bare)

expecting success: 
		rm -rf host &&
		git clone  ssh://user@host/ &&
		test_path_is_dir host
	
done.
/«PKGBUILDDIR»/t/trash directory.t5601-clone/src-2/objects
ok 31 - clone --reference from original

expecting success: 
	git clone --bare src src-3 &&
	git clone --bare src src-4 &&
	git clone --reference=src-3 --reference=src-4 src target-9 &&
	grep /src-3/ target-9/.git/objects/info/alternates &&
	grep /src-4/ target-9/.git/objects/info/alternates

Cloning into bare repository 'src-3'...
Cloning into 'host'...
warning: You appear to have cloned an empty repository.
ok 30 - clone of ssh://user@host/ goes to host (non-bare)

expecting success: 
		rm -rf host &&
		git clone  host:/ &&
		test_path_is_dir host
	
done.
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into bare repository 'src-4'...
Cloning into 'host'...
done.
Cloning into 'target-9'...
warning: You appear to have cloned an empty repository.
ok 31 - clone of host:/ goes to host (non-bare)

expecting success: 
		rm -rf host &&
		git clone  ssh://user:password@host/ &&
		test_path_is_dir host
	
Cloning into 'host'...
done.
/«PKGBUILDDIR»/t/trash directory.t5601-clone/src-3/objects
warning: You appear to have cloned an empty repository.
ok 32 - clone of ssh://user:password@host/ goes to host (non-bare)

expecting success: 
		rm -rf host &&
		git clone  ssh://user:password@host:1234/ &&
		test_path_is_dir host
	
/«PKGBUILDDIR»/t/trash directory.t5601-clone/src-4/objects
ok 32 - clone with more than one --reference

expecting success: 
	mkdir nest &&
	git clone --bare src nest/src-5 &&
	echo ../../../src/.git/objects >nest/src-5/objects/info/alternates &&
	git clone --bare nest/src-5 target-10 &&
	grep /src/\\.git/objects target-10/objects/info/alternates

Cloning into 'sub1'...
Cloning into bare repository 'nest/src-5'...
Cloning into 'host'...
done.
warning: You appear to have cloned an empty repository.
ok 33 - clone of ssh://user:password@host:1234/ goes to host (non-bare)

expecting success: 
		rm -rf host &&
		git clone  ssh://user:passw@rd@host:1234/ &&
		test_path_is_dir host
	
Cloning into bare repository 'target-10'...
done.
Cloning into 'host'...
done.
/«PKGBUILDDIR»/t/trash directory.t5601-clone/src/.git/objects
ok 33 - clone from original with relative alternate

expecting success: 
	git clone --branch=some-tag src dst.tag &&
	GIT_DIR=src/.git git rev-parse some-tag >expected &&
	test_cmp expected dst.tag/.git/HEAD &&
	GIT_DIR=dst.tag/.git git config remote.origin.fetch >fetch.actual &&
	echo "+refs/heads/*:refs/remotes/origin/*" >fetch.expected &&
	test_cmp fetch.expected fetch.actual

warning: You appear to have cloned an empty repository.
Cloning into 'dst.tag'...
ok 34 - clone of ssh://user:passw@rd@host:1234/ goes to host (non-bare)

expecting success: 
		rm -rf host &&
		git clone  user@host:/ &&
		test_path_is_dir host
	
Cloning into 'host'...
done.
Note: checking out '823ab6d316d3b4b835b2496ee9104c55450fe8f0'.

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>

warning: You appear to have cloned an empty repository.
ok 11 - sigpipe does not cause pre-push hook failure

ok 35 - clone of user@host:/ goes to host (non-bare)

expecting success: 
		rm -rf host &&
		git clone  user:password@host:/ &&
		test_path_is_dir host
	
# passed all 11 test(s)
1..11
ok 34 - clone checking out a tag

expecting success: 
		write_script "$TRASH_DIRECTORY/ssh-wrapper" <<-\EOF &&
		echo >>"$TRASH_DIRECTORY/ssh-output" "ssh: $*" &&
		# throw away all but the last argument, which should be the
		# command
		while test $# -gt 1; do shift; done
		eval "$1"
		EOF
		GIT_SSH="$TRASH_DIRECTORY/ssh-wrapper" &&
		export GIT_SSH &&
		export TRASH_DIRECTORY &&
		>"$TRASH_DIRECTORY"/ssh-output
	
ok 35 - setup ssh wrapper

expecting success: 
	git clone myhost:src ssh-clone &&
	expect_ssh myhost src

Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
Cloning into 'ssh-clone'...
Cloning into 'host'...
warning: You appear to have cloned an empty repository.
ok 36 - clone of user:password@host:/ goes to host (non-bare)

expecting success: 
		rm -rf host &&
		git clone  user:passw@rd@host:/ &&
		test_path_is_dir host
	
Cloning into 'host'...
warning: You appear to have cloned an empty repository.
ok 37 - clone of user:passw@rd@host:/ goes to host (non-bare)

expecting success: 
		rm -rf foo@bar &&
		git clone  ssh://host/foo@bar &&
		test_path_is_dir foo@bar
	
ok 2 - git_pull: 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
		)
	
Cloning into 'foo@bar'...
warning: You appear to have cloned an empty repository.
ok 38 - clone of ssh://host/foo@bar goes to foo@bar (non-bare)

expecting success: 
		rm -rf foo@bar &&
		git clone  ssh://host/foo@bar.git &&
		test_path_is_dir foo@bar
	
ok 36 - clone myhost:src uses ssh

Cloning into 'foo@bar'...
expecting success: 
	cp -R src "foo:bar" &&
	git clone "foo:bar" foobar &&
	expect_ssh none

warning: You appear to have cloned an empty repository.
ok 39 - clone of ssh://host/foo@bar.git goes to foo@bar (non-bare)

expecting success: 
		rm -rf foo@bar &&
		git clone  ssh://user:password@host/foo@bar &&
		test_path_is_dir foo@bar
	
Cloning into 'foobar'...
Cloning into 'foo@bar'...
Cloning into 'submodule_update'...
done.
warning: You appear to have cloned an empty repository.
ok 40 - clone of ssh://user:password@host/foo@bar goes to foo@bar (non-bare)

expecting success: 
		rm -rf foo@bar &&
		git clone  ssh://user:passw@rd@host/foo@bar.git &&
		test_path_is_dir foo@bar
	
ok 37 - clone local path foo:bar

expecting success: 
	git clone "[myhost:123]:src" ssh-bracket-clone &&
	expect_ssh "-p 123" myhost src

Cloning into 'ssh-bracket-clone'...
done.
Cloning into 'foo@bar'...
warning: You appear to have cloned an empty repository.
ok 41 - clone of ssh://user:passw@rd@host/foo@bar.git goes to foo@bar (non-bare)

expecting success: 
		rm -rf foo@bar &&
		git clone  host:/foo@bar &&
		test_path_is_dir foo@bar
	
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Cloning into 'foo@bar'...
warning: You appear to have cloned an empty repository.
ok 42 - clone of host:/foo@bar goes to foo@bar (non-bare)

expecting success: 
		rm -rf foo@bar &&
		git clone  host:/foo@bar.git &&
		test_path_is_dir foo@bar
	
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Deleted branch add_sub1 (was 041e421).
Cloning into 'foo@bar'...
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
warning: You appear to have cloned an empty repository.
ok 43 - clone of host:/foo@bar.git goes to foo@bar (non-bare)

expecting success: 
		rm -rf foo@bar &&
		git clone  user:password@host:/foo@bar &&
		test_path_is_dir foo@bar
	
Cloning into 'foo@bar'...
ok 38 - bracketed hostnames are still ssh

expecting success: 
	copy_ssh_wrapper_as "$TRASH_DIRECTORY/uplink" &&
	git clone "[myhost:123]:src" ssh-bracket-clone-uplink &&
	expect_ssh "-p 123" myhost src

Cloning into 'ssh-bracket-clone-uplink'...
warning: You appear to have cloned an empty repository.
ok 44 - clone of user:password@host:/foo@bar goes to foo@bar (non-bare)

expecting success: 
		rm -rf foo@bar &&
		git clone  user:passw@rd@host:/foo@bar.git &&
		test_path_is_dir foo@bar
	
error: The following untracked working tree files would be overwritten by merge:
	sub1
Please move or remove them before you can merge.
Aborting
Updating aca6d60..041e421
Cloning into 'foo@bar'...
warning: You appear to have cloned an empty repository.
ok 45 - clone of user:passw@rd@host:/foo@bar.git goes to foo@bar (non-bare)

expecting success: 
		rm -rf 1234 &&
		git clone  ssh://user:password@host/test:1234 &&
		test_path_is_dir 1234
	
ok 3 - git_pull: 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
		)
	
Cloning into '1234'...
warning: You appear to have cloned an empty repository.
ok 46 - clone of ssh://user:password@host/test:1234 goes to 1234 (non-bare)

expecting success: 
		rm -rf 1234 &&
		git clone  ssh://user:password@host/test:1234.git &&
		test_path_is_dir 1234
	
Cloning into '1234'...
Cloning into 'submodule_update'...
ok 39 - uplink is not treated as putty

expecting success: 
	copy_ssh_wrapper_as "$TRASH_DIRECTORY/plink" &&
	git clone "[myhost:123]:src" ssh-bracket-clone-plink-0 &&
	expect_ssh "-P 123" myhost src

warning: You appear to have cloned an empty repository.
Cloning into 'ssh-bracket-clone-plink-0'...
ok 47 - clone of ssh://user:password@host/test:1234.git goes to 1234 (non-bare)

# passed all 47 test(s)
1..47
done.
Switched to a new branch 'replace_sub1_with_file'
*** t5700-clone-reference.sh ***
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
t5572-pull-submodule.sh: 159: cd: can't cd to sub1
Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5700-clone-reference/.git/
Deleted branch replace_file_with_sub1 (was 1bf82f3).
expecting success: 
	test_create_repo A &&
	commit_in A file1

Switched to a new branch 'replace_file_with_sub1'
Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5700-clone-reference/A/.git/
[master (root-commit) 1b37a18] file1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file1
ok 1 - preparing first repository

expecting success: 
	git clone A B &&
	commit_in B file2 &&
	git -C B repack -ad &&
	git -C B prune

Cloning into 'B'...
ok 40 - plink is treated specially (as putty)

expecting success: 
	copy_ssh_wrapper_as "$TRASH_DIRECTORY/plink.exe" &&
	git clone "[myhost:123]:src" ssh-bracket-clone-plink-1 &&
	expect_ssh "-P 123" myhost src

Cloning into 'ssh-bracket-clone-plink-1'...
done.
Updating 88f15cf..1bf82f3
Fast-forward
 .gitmodules | 4 ++++
 sub1        | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)
 mode change 100644 => 160000 sub1
[master 29c9e61] file2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file2
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 41 - plink.exe is treated specially (as putty)

expecting success: 
	copy_ssh_wrapper_as "$TRASH_DIRECTORY/tortoiseplink" &&
	git clone "[myhost:123]:src" ssh-bracket-clone-plink-2 &&
	expect_ssh "-batch -P 123" myhost src

Cloning into 'ssh-bracket-clone-plink-2'...
ok 2 - preparing second repository

expecting success: 
	git clone -l -s --reference B A C

Cloning into 'C'...
done.
ok 3 - cloning with reference (-l -s)

expecting success: 
	test_line_count = 2 C/.git/objects/info/alternates

Cloning into 'sub1'...
ok 4 - existence of info/alternates

expecting success: 
	git -C C pull ../B master

done.
From ../B
 * branch            master     -> FETCH_HEAD
ok 42 - tortoiseplink is like putty, with extra arguments

expecting success: 
		write_script "$TRASH_DIRECTORY/ssh-wrapper" <<-\EOF &&
		echo >>"$TRASH_DIRECTORY/ssh-output" "ssh: $*" &&
		# throw away all but the last argument, which should be the
		# command
		while test $# -gt 1; do shift; done
		eval "$1"
		EOF
		GIT_SSH="$TRASH_DIRECTORY/ssh-wrapper" &&
		export GIT_SSH &&
		export TRASH_DIRECTORY &&
		>"$TRASH_DIRECTORY"/ssh-output
	
ok 43 - setup ssh wrapper

expecting success: 
	test_clone_url c:temp c temp

Updating 1b37a18..29c9e61
Fast-forward
Cloning into 'tmp1'...
 file2 | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 file2
ok 5 - pulling from reference

expecting success: 
	test_objcount C 0

fatal: 'temp' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ok 6 - that reference gets used

expecting success: 
	GIT_TRACE_PACKET=$U.D git clone --reference B "file://$(pwd)/A" D

Cloning into 'D'...
ok 44 - clone c:temp is ssl

skipping test: clone c:temp is dos drive 
	test_clone_url c:temp none

ok 45 # skip clone c:temp is dos drive (missing MINGW)

expecting success: 
		test_clone_url host:$repo host $repo
	
Cloning into 'tmp2'...
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
fatal: 'rep' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ok 7 - cloning with reference (no -l -s)

expecting success: 
	test -s "$U.D" &&
	! grep " want" "$U.D"

*** t5701-clone-local.sh ***
ok 46 - clone host:rep

expecting success: 
		test_clone_url host:$repo host $repo
	
ok 8 - fetched no objects

expecting success: 
	test_line_count = 1 D/.git/objects/info/alternates

ok 9 - existence of info/alternates

Cloning into 'tmp3'...
expecting success: 
	git -C D pull ../B master

fatal: 'rep/home/project' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ok 47 - clone host:rep/home/project

expecting success: 
		test_clone_url host:$repo host $repo
	
Cloning into 'tmp4'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5701-clone-local/.git/
From ../B
 * branch            master     -> FETCH_HEAD
expecting success: 
	: >file && git add . && git commit -m1 &&
	git clone --bare . a.git &&
	git clone --bare . x &&
	test "$(cd a.git && git config --bool core.bare)" = true &&
	test "$(cd x && git config --bool core.bare)" = true &&
	git bundle create b1.bundle --all &&
	git bundle create b2.bundle master &&
	mkdir dir &&
	cp b1.bundle dir/b3 &&
	cp b1.bundle b4

fatal: '123' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ok 4 - git_pull: 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
		)
	
Updating 1b37a18..29c9e61
Fast-forward
ok 48 - clone host:123

expecting success: 
		test_clone_url [::1]:$repo ::1 "$repo"
	
 file2 | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 file2
ok 10 - pulling from reference

expecting success: 
	test_objcount D 0

Cloning into 'tmp5'...
[master (root-commit) 7f6713a] 1
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file
Cloning into bare repository 'a.git'...
ok 11 - that reference gets used

expecting success: 
	commit_in A file3 &&
	git -C A repack -ad &&
	git -C A prune

fatal: 'rep' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
done.
[master 8c6ca1a] file3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file3
ok 49 - clone [::1]:rep

expecting success: 
		test_clone_url [::1]:$repo ::1 "$repo"
	
Cloning into bare repository 'x'...
Cloning into 'tmp6'...
Cloning into 'submodule_update'...
fatal: 'rep/home/project' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
done.
ok 50 - clone [::1]:rep/home/project

expecting success: 
		test_clone_url [::1]:$repo ::1 "$repo"
	
Cloning into 'tmp7'...
done.
fatal: '123' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ok 51 - clone [::1]:123

expecting success: 
	test_clone_url host:/~repo host "~repo"

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.
Cloning into 'tmp8'...
fatal: '~repo' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ok 1 - preparing origin repository

expecting success: 
	git clone -l -s a b &&
	(cd b &&
	test "$(git config --bool core.bare)" = false &&
	git fetch)

error: 8ed2e6719f8484ce01fa3ce133fe42d25c2441b8^{commit}: expected commit type, but the object dereferences to tree type
fatal: Needed a single revision
ok 52 - clone host:/~repo

expecting success: 
	test_clone_url [::1]:/~repo ::1 "~repo"

Cloning into 'b'...
Cloning into 'tmp9'...
Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
ok 12 - updating origin

expecting success: 
	git -C C pull origin

done.
fatal: '~repo' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Deleted branch replace_directory_with_sub1 (was 99dcd27).
Switched to a new branch 'replace_directory_with_sub1'
ok 53 - clone [::1]:/~repo

expecting success: 
		test_clone_url $url none
	
Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
Cloning into 'tmp10'...
From /«PKGBUILDDIR»/t/trash directory.t5700-clone-reference/A
   1b37a18..8c6ca1a  master     -> origin/master
fatal: 'foo/bar:baz' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ok 54 - clone foo/bar:baz is not ssh
ok 2 - local clone without .git suffix


expecting success: 
		test_clone_url $url none
	
expecting success: 
	git clone -l -s a.git c &&
	(cd c && git fetch)

Merging:
29c9e61 file2
virtual 8c6ca1a09406613294c8ed4a8057b55785b4f825
found 1 common ancestor:
1b37a18 file1
Merge made by the 'recursive' strategy.
Cloning into 'c'...
Cloning into 'tmp11'...
 file3 | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 file3
ok 13 - pulling changes from origin

expecting success: 
	test_objcount C 2

fatal: ']bar/baz:qux' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ok 14 - that alternate to origin gets used

expecting success: 
	git -C D pull origin

done.
Updating 48ceb4d..99dcd27
Fast-forward
ok 55 - clone [foo]bar/baz:qux is not ssh

expecting success: 
		test_clone_url $url none
	
 .gitmodules | 4 ++++
 sub1/file1  | 1 -
 sub1/file2  | 1 -
 sub1/file3  | 1 -
 4 files changed, 4 insertions(+), 3 deletions(-)
 delete mode 100644 sub1/file1
 delete mode 100644 sub1/file2
 delete mode 100644 sub1/file3
Cloning into 'tmp12'...
fatal: ']:baz' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ok 3 - local clone with .git suffix

ok 56 - clone [foo/bar]:baz is not ssh

expecting success: 
	git clone -l -s x y &&
	(cd y && git fetch)

expecting success: 
		test_clone_url "ssh://host.xz$tcol/home/user/repo" host.xz /home/user/repo
	
Cloning into 'tmp13'...
Cloning into 'y'...
fatal: '/home/user/repo' does not appear to be a git repository
From file:///«PKGBUILDDIR»/t/trash directory.t5700-clone-reference/A
f   1b37a18..8c6ca1a  master     -> origin/master
atal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
done.
ok 57 - clone ssh://host.xz/home/user/repo

expecting success: 
	test_clone_url "ssh://host.xz$tcol/~repo" host.xz "~repo"

Cloning into 'tmp14'...
Merging:
29c9e61 file2
virtual 8c6ca1a09406613294c8ed4a8057b55785b4f825
found 1 common ancestor:
1b37a18 file1
Merge made by the 'recursive' strategy.
 file3 | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 file3
ok 15 - pulling changes from origin

expecting success: 
	test_objcount D 5

fatal: '~repo' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ok 16 - check objects expected to exist locally

expecting success: 
	test_create_repo F &&
	commit_in F file1

ok 58 - clone ssh://host.xz/~repo

expecting success: 
		test_clone_url "ssh://host.xz$tcol/home/user/repo" host.xz /home/user/repo
	
Cloning into 'tmp15'...
ok 4 - local clone from x

expecting success: 
	test_must_fail git clone -l -s x.git z

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5700-clone-reference/F/.git/
fatal: repository 'x.git' does not exist
ok 5 - local clone from x.git that does not exist

expecting success: 
	git clone --bare --no-hardlinks x w &&
	! repo_is_hardlinked w

fatal: '/home/user/repo' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Cloning into bare repository 'w'...
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 59 - clone ssh://host.xz:/home/user/repo

expecting success: 
	test_clone_url "ssh://host.xz$tcol/~repo" host.xz "~repo"

[master (root-commit) a4271f3] file1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file1
ok 17 - preparing alternate repository #1

expecting success: 
	git clone F G &&
	commit_in F file2

done.
Cloning into 'tmp16'...
Cloning into 'G'...
test_line_count: line count for output != 0
w/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391
w/objects/df/2b8fc99e1c1d4dbc0a854d9f72157f1d6ea078
w/objects/7f/6713a34e62b2edc30d989f1408ff0d74cacf4a
ok 6 - With -no-hardlinks, local will make a copy

expecting success: 
	rm -fr w &&
	git clone -l --bare x w &&
	repo_is_hardlinked w

fatal: '~repo' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Cloning into bare repository 'w'...
done.
ok 60 - clone ssh://host.xz:/~repo

expecting success: 
	test_clone_url "ssh://host.xz:22/home/user/repo" "-p 22 host.xz" "/home/user/repo"

Cloning into 'tmp17'...
done.
ok 7 - Even without -l, local will make a hardlink

expecting success: 
	echo "ref: refs/heads/nonexistent" > a.git/HEAD &&
	git clone a d &&
	(cd d &&
	git fetch &&
	test ! -e .git/refs/remotes/origin/HEAD)

fatal: '/home/user/repo' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
[master 9d3c431] file2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file2
ok 18 - cloning alternate repo #2 and adding changes to repo #1

expecting success: 
	git clone --reference G F H

Cloning into 'd'...
Cloning into 'H'...
Cloning into 'sub1'...
ok 61 - clone ssh://host.xz:22/home/user/repo

expecting success: 
	test_clone_url "ssh://host.xz:22/~repo" "-p 22 host.xz" "~repo"

Cloning into 'tmp18'...
done.
warning: remote HEAD refers to nonexistent ref, unable to checkout.

done.
fatal: '~repo' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ok 19 - cloning alternate repo #1, using #2 as reference

done.
expecting success: 
	git clone -l -s --reference A B E

Cloning into 'E'...
ok 62 - clone ssh://host.xz:22/~repo

ok 8 - local clone of repo with nonexistent ref in HEAD

expecting success: 
	git clone dir/b3 &&
	(cd b3 && git fetch)

expecting success: 
	  test_clone_url ssh://::1/home/user/repo ::1 /home/user/repo
	
Cloning into 'b3'...
Cloning into 'tmp19'...
done.
ok 20 - cloning with reference being subset of source (-l -s)

fatal: '/home/user/repo' does not appear to be a git repository
expecting success: 
	git clone -s --reference B --reference A --reference B A dups &&
	test_line_count = 2 dups/.git/objects/info/alternates

fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Cloning into 'dups'...
ok 63 - clone ssh://::1/home/user/repo

expecting success: 
	  test_clone_url ssh://[::1]/home/user/repo ::1 /home/user/repo
	
Cloning into 'tmp20'...
done.
fatal: '/home/user/repo' does not appear to be a git repository
ok 21 - cloning with multiple references drops duplicates

fexpecting success: 
atal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
	(
		cd A && git tag -a -m tagged HEAD
	) &&
	git clone --reference=A A I

ok 64 - clone ssh://[::1]/home/user/repo

Cloning into 'I'...
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
expecting success: 
	  test_clone_url ssh://[::1]:/home/user/repo ::1 /home/user/repo
	
Cloning into 'tmp21'...
done.
fatal: '/home/user/repo' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ok 22 - clone with reference from a tagged repository

expecting success: 
	git clone A J &&
	(
		cd J &&
		git checkout -b other master^ &&
		echo other >otherfile &&
		git add otherfile &&
		git commit -m other &&
		git checkout master
	)

Cloning into 'J'...
ok 65 - clone ssh://[::1]:/home/user/repo

expecting success: 
	  test_clone_url ssh://user@::1/home/user/repo user@::1 /home/user/repo
	
Cloning into 'tmp22'...
done.
ok 9 - bundle clone without .bundle suffix

expecting success: 
	git clone b1.bundle &&
	(cd b1 && git fetch)

fatal: '/home/user/repo' does not appear to be a git repository
Cloning into 'b1'...
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Switched to a new branch 'other'
ok 5 - git_pull: 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
		)
	
ok 66 - clone ssh://user@::1/home/user/repo

expecting success: 
	  test_clone_url ssh://user@[::1]/home/user/repo user@::1 /home/user/repo
	
warning: refname 'HEAD' is ambiguous.
warning: refname 'HEAD' is ambiguous.
warning: refname 'HEAD' is ambiguous.
Cloning into 'tmp23'...
[other 9d7d231] other
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 otherfile
Switched to branch 'master'
fatal: '/home/user/repo' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Your branch is up-to-date with 'origin/master'.
ok 23 - prepare branched repository

expecting success: 
	git init K &&
	echo "$base_dir/A/.git/objects" >K/.git/objects/info/alternates &&
	(
		cd K &&
		git remote add J "file://$base_dir/J" &&
		GIT_TRACE_PACKET=$U.K git fetch J
	) &&
	master_object=$(cd A && git for-each-ref --format="%(objectname)" refs/heads/master) &&
	test -s "$U.K" &&
	! grep " want $master_object" "$U.K" &&
	tag_object=$(cd A && git for-each-ref --format="%(objectname)" refs/tags/HEAD) &&
	! grep " want $tag_object" "$U.K"

ok 67 - clone ssh://user@[::1]/home/user/repo

expecting success: 
	  test_clone_url ssh://user@[::1]:/home/user/repo user@::1 /home/user/repo
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5700-clone-reference/K/.git/
Cloning into 'tmp24'...
Cloning into 'submodule_update'...
fatal: '/home/user/repo' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ok 68 - clone ssh://user@[::1]:/home/user/repo

done.
expecting success: 
	  test_clone_url ssh://[user@::1]/home/user/repo user@::1 /home/user/repo
	
Cloning into 'tmp25'...
fatal: '/home/user/repo' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 10 - bundle clone with .bundle suffix

expecting success: 
	git clone b4 bdl &&
	(cd bdl && git fetch)

ok 69 - clone ssh://[user@::1]/home/user/repo

expecting success: 
	  test_clone_url ssh://[user@::1]:/home/user/repo user@::1 /home/user/repo
	
From file:///«PKGBUILDDIR»/t/trash directory.t5700-clone-reference/J
 * [new branch]      master     -> J/master
Cloning into 'bdl'...
 * [new branch]      other      -> J/other
 * [new tag]         HEAD       -> HEAD
Cloning into 'tmp26'...
fatal: '/home/user/repo' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ok 24 - fetch with incomplete alternates

expecting success: 
	git clone --separate-git-dir=L A M &&
	git clone --reference=M A N &&
	echo "$base_dir/L/objects" >expected &&
	test_cmp expected "$base_dir/N/.git/objects/info/alternates"

ok 70 - clone ssh://[user@::1]:/home/user/repo

Cloning into 'M'...
expecting success: 
	  test_clone_url ssh://::1/~repo ::1 '~repo'
	
Cloning into 'tmp27'...
done.
fatal: '~repo' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Cloning into 'N'...
ok 71 - clone ssh://::1/~repo

expecting success: 
	  test_clone_url ssh://[::1]/~repo ::1 '~repo'
	
Cloning into 'tmp28'...
done.
fatal: '~repo' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ok 25 - clone using repo with gitfile as a reference

expecting success: 
	git clone --reference=M/.git A O &&
	echo "$base_dir/L/objects" >expected &&
	test_cmp expected "$base_dir/O/.git/objects/info/alternates"

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 72 - clone ssh://[::1]/~repo

Cloning into 'O'...
expecting success: 
	  test_clone_url ssh://user@::1/~repo user@::1 '~repo'
	
Cloning into 'tmp29'...
ok 11 - bundle clone from b4

expecting success: 
	test_must_fail git clone b4.bundle bb

fatal: repository 'b4.bundle' does not exist
ok 12 - bundle clone from b4.bundle that does not exist

expecting success: 
	git clone b2.bundle b2 &&
	(cd b2 &&
	git fetch &&
	test_must_fail git rev-parse --verify refs/heads/master)

done.
fatal: '~repo' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Cloning into 'b2'...
ok 26 - clone using repo pointed at by gitfile as reference

expecting success: 
	git init P &&
	(
		cd P &&	test_commit one
	) &&
	git clone P Q &&
	(
		cd Q && test_commit two
	) &&
	git clone --no-local --reference=P Q R &&
	git clone --no-local --reference=P --dissociate Q S &&
	# removing the reference P would corrupt R but not S
	rm -fr P &&
	test_must_fail git -C R fsck &&
	git -C S fsck

ok 73 - clone ssh://user@::1/~repo

expecting success: 
	  test_clone_url ssh://user@[::1]/~repo user@::1 '~repo'
	
Cloning into 'tmp30'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5700-clone-reference/P/.git/
fatal: '~repo' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Cloning into 'sub1'...
ok 74 - clone ssh://user@[::1]/~repo

expecting success: 
	  test_clone_url ssh://[user@::1]/~repo user@::1 '~repo'
	
[master (root-commit) d79ce16] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
Cloning into 'tmp31'...
Cloning into 'Q'...
fatal: '~repo' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
done.
ok 75 - clone ssh://[user@::1]/~repo

done.
expecting success: 
	  test_clone_url ssh://[::1]:22/home/user/repo '-p 22' ::1 /home/user/repo
	
Cloning into 'tmp32'...
warning: remote HEAD refers to nonexistent ref, unable to checkout.

fatal: '/home/user/repo' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ok 76 - clone ssh://[::1]:22/home/user/repo

[master 51ba0d2] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two.t
expecting success: 
	  test_clone_url ssh://user@[::1]:22/home/user/repo '-p 22' user@::1 /home/user/repo
	
Cloning into 'tmp33'...
fatal: Needed a single revision
ok 13 - bundle clone with nonexistent HEAD

expecting success: 
	mkdir empty &&
	(cd empty &&
	 git init &&
	 git config receive.denyCurrentBranch warn) &&
	git clone empty empty-clone &&
	test_tick &&
	(cd empty-clone
	 echo "content" >> foo &&
	 git add foo &&
	 git commit -m "Initial commit" &&
	 git push origin master &&
	 expected=$(git rev-parse master) &&
	 actual=$(git --git-dir=../empty/.git rev-parse master) &&
	 test $actual = $expected)

Cloning into 'R'...
fatal: '/home/user/repo' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5701-clone-local/empty/.git/
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
Cloning into 'empty-clone'...
ok 77 - clone ssh://user@[::1]:22/home/user/repo

expecting success: 
	  test_clone_url ssh://[user@::1]:22/home/user/repo '-p 22' user@::1 /home/user/repo
	
Cloning into 'tmp34'...
warning: You appear to have cloned an empty repository.
done.
fatal: '/home/user/repo' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
[master (root-commit) b8e7dd3] Initial commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
ok 78 - clone ssh://[user@::1]:22/home/user/repo

expecting success: 
	  test_clone_url ssh://[::1]:22/~repo '-p 22' ::1 '~repo'
	
Deleted branch remove_sub1 (was e68bdee).
Cloning into 'tmp35'...
Switched to a new branch 'remove_sub1'
fatal: '~repo' does not appear to be a git repository
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
remote: warning: updating the current branch        
ok 79 - clone ssh://[::1]:22/~repo

To /«PKGBUILDDIR»/t/trash directory.t5701-clone-local/empty
 * [new branch]      master -> master
expecting success: 
	  test_clone_url ssh://user@[::1]:22/~repo '-p 22' user@::1 '~repo'
	
Cloning into 'tmp36'...
ok 14 - clone empty repository

expecting success: 
	rm -fr empty/ empty-clone/ &&
	mkdir empty &&
	(cd empty && git init) &&
	git clone empty empty-clone &&
	(cd empty-clone &&
	test_must_fail git push)

fatal: '~repo' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Cloning into 'S'...
ok 80 - clone ssh://user@[::1]:22/~repo

expecting success: 
	  test_clone_url ssh://[user@::1]:22/~repo '-p 22' user@::1 '~repo'
	
warning: unable to rmdir sub1: Directory not empty
Updating 041e421..e68bdee
Fast-forward
Cloning into 'tmp37'...
 .gitmodules | 4 ----
 1 file changed, 4 deletions(-)
 delete mode 100644 .gitmodules
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5701-clone-local/empty/.git/
fatal: '~repo' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Cloning into 'empty-clone'...
ok 81 - clone ssh://[user@::1]:22/~repo

expecting success: 

	(
		cd src &&
		git checkout -b another master
	) &&
	git clone src target-11 &&
	test "z$( cd target-11 && git symbolic-ref HEAD )" = zrefs/heads/another


warning: You appear to have cloned an empty repository.
done.
Switched to a new branch 'another'
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

error: src refspec master does not match any.
error: failed to push some refs to '/«PKGBUILDDIR»/t/trash directory.t5701-clone-local/empty'
ok 15 - clone empty repository, and then push should not segfault.

expecting success: 
	rm -rf does-not-exist &&
	test_must_fail git clone does-not-exist

Cloning into 'target-11'...
fatal: repository 'does-not-exist' does not exist
ok 16 - cloning non-existent directory fails

expecting success: 
	rm -rf not-a-git-repo not-a-git-repo-clone &&
	mkdir not-a-git-repo &&
	test_must_fail git clone not-a-git-repo not-a-git-repo-clone

ok 6 - git_pull: 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
		)
	
done.
fatal: repository 'not-a-git-repo' does not exist
ok 17 - cloning non-git directory fails

expecting success: 
	git clone --bare file://"$(pwd)"/a non-local &&
	! repo_is_hardlinked non-local

Cloning into bare repository 'non-local'...
ok 82 - clone from a repository with two identical branches

expecting success: 
	git clone --depth=1 --no-local src ssrrcc &&
	git clone ssrrcc ddsstt &&
	test_cmp ssrrcc/.git/shallow ddsstt/.git/shallow &&
	( cd ddsstt && git fsck )

Cloning into 'ssrrcc'...
Cloning into 'submodule_update'...
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
test_line_count: line count for output != 0
non-local/objects/pack/pack-340714e0fa7504067f102e3300ab10e403b4879d.pack
non-local/objects/pack/pack-340714e0fa7504067f102e3300ab10e403b4879d.idx
ok 18 - cloning file:// does not hardlink

expecting success: 
	git clone --bare --no-local a force-nonlocal &&
	! repo_is_hardlinked force-nonlocal

Cloning into bare repository 'force-nonlocal'...
Cloning into 'ddsstt'...
error: object directory /«PKGBUILDDIR»/t/trash directory.t5700-clone-reference/P/.git/objects does not exist; check .git/objects/info/alternates.
error: refs/tags/one: invalid sha1 pointer d79ce1670bdcb76e6d1da2ae095e890ccb326ae9
broken link from  commit 51ba0d2036f9bf23b2826a3b2dcc450c417a1bc5
              to  commit d79ce1670bdcb76e6d1da2ae095e890ccb326ae9
missing blob 5626abf0f72e58d7a153368ba57db4c673c0e171
missing commit d79ce1670bdcb76e6d1da2ae095e890ccb326ae9
ok 27 - clone and dissociate from reference

expecting success: 
	rm -fr P Q R &&
	git init P &&
	(
		cd P &&
		test_commit one &&
		git repack &&
		test_commit two &&
		git repack
	) &&
	git clone --bare P Q &&
	(
		cd P &&
		git checkout -b second &&
		test_commit three &&
		git repack
	) &&
	git clone --bare --dissociate --reference=P Q R &&
	ls R/objects/pack/*.pack >packs.txt &&
	test_line_count = 1 packs.txt

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5700-clone-reference/P/.git/
test_line_count: line count for output != 0
force-nonlocal/objects/pack/pack-340714e0fa7504067f102e3300ab10e403b4879d.pack
force-nonlocal/objects/pack/pack-340714e0fa7504067f102e3300ab10e403b4879d.idx
ok 19 - cloning a local path with --no-local does not hardlink

expecting success: 
	test_must_fail git clone --bare -u false a should_not_work.git

Cloning into bare repository 'should_not_work.git'...
[master (root-commit) d79ce16] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
ok 83 - shallow clone locally

expecting success: 
	rm -rf dst.git &&
	GIT_TRACE_PACKFILE=$PWD/tmp.pack git clone --no-local --bare src dst.git &&
	git init --bare replay.git &&
	git -C replay.git index-pack -v --stdin <tmp.pack

fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ok 20 - cloning locally respects "-u" for fetching refs

Cloning into bare repository 'dst.git'...
# passed all 20 test(s)
1..20
Cloning into 'sub1'...
done.
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
*** t5702-clone-options.sh ***
[master 139b20d] 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.t5601-clone/replay.git/
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
Receiving objects:  16% (1/6)   
Receiving objects:  33% (2/6)   
Receiving objects:  50% (3/6)   
Receiving objects:  66% (4/6)   
Receiving objects:  83% (5/6)   
Receiving objects: 100% (6/6)   
Receiving objects: 100% (6/6), done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5702-clone-options/.git/
expecting success: 

	mkdir parent &&
	(cd parent && git init &&
	 echo one >file && git add file &&
	 git commit -m one)


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5702-clone-options/parent/.git/
Deleted branch remove_sub1 (was e68bdee).
[master (root-commit) 700f767] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 1 - setup

expecting success: 

	git clone -o foo parent clone-o &&
	(cd clone-o && git rev-parse --verify refs/remotes/foo/master)


Cloning into 'clone-o'...
Switched to a new branch 'remove_sub1'
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
done.
700f767f05f8bfa05fdde32f2e8b478e4f809de8
ok 2 - clone -o

expecting success: 

	git clone "file://$(pwd)/parent" clone-redirected >out 2>err &&
	! grep % err &&
	test_i18ngrep ! "Checking connectivity" err


Cloning into bare repository 'Q'...
done.
pack	b63b872d6b35f345fb9b72a5b3edfa3566213161
ok 84 - GIT_TRACE_PACKFILE produces a usable pack

warning: unable to rmdir sub1: Directory not empty
Updating 041e421..e68bdee
Fast-forward
# passed all 84 test(s)
1..84
Switched to a new branch 'second'
 .gitmodules | 4 ----
 1 file changed, 4 deletions(-)
 delete mode 100644 .gitmodules
[second 916c3f9] three
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 three.t
ok 3 - redirected clone does not show progress

expecting success: 

	git clone --progress "file://$(pwd)/parent" clone-redirected-progress \
		>out 2>err &&
	grep % err


ok 7 - git_pull: 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
		)
	
Cloning into bare repository 'R'...
done.
Cloning into 'submodule_update'...
Receiving objects:  33% (1/3)   
Receiving objects:  66% (2/3)   
Receiving objects: 100% (3/3)   
Receiving objects: 100% (3/3), 214 bytes | 0 bytes/s, done.
ok 4 - redirected clone -v does show progress

# passed all 4 test(s)
1..4
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 28 - clone, dissociate from partial reference and repack

*** t5704-bundle.sh ***
# passed all 28 test(s)
1..28
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5704-bundle/.git/
expecting success: 
	test_commit initial &&
	test_tick &&
	git tag -m tag tag &&
	test_commit second &&
	test_commit third &&
	git tag -d initial &&
	git tag -d second &&
	git tag -d third

[master (root-commit) 24b24cf] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 initial.t
*** t5705-clone-2gb.sh ***
[master 21f74a9] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 second.t
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5705-clone-2gb/.git/
Skipping expensive 2GB clone test; enable it with GIT_TEST_CLONE_2GB=t
[master d31729a] third
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 third.t
skipping test: setup 

	git config pack.compression 0 &&
	git config pack.depth 0 &&
	blobsize=$((100*1024*1024)) &&
	blobcount=$((2*1024*1024*1024/$blobsize+1)) &&
	i=1 &&
	(while test $i -le $blobcount
	 do
		printf "Generating blob $i/$blobcount\r" >&2 &&
		printf "blob\nmark :$i\ndata $blobsize\n" &&
		#test-genrandom $i $blobsize &&
		printf "%-${blobsize}s" $i &&
		echo "M 100644 :$i $i" >> commit
		i=$(($i+1)) ||
		echo $? > exit-status
	 done &&
	 echo "commit refs/heads/master" &&
	 echo "author A U Thor <author@email.com> 123456789 +0000" &&
	 echo "committer C O Mitter <committer@email.com> 123456789 +0000" &&
	 echo "data 5" &&
	 echo ">2gb" &&
	 cat commit) |
	git fast-import --big-file-threshold=2 &&
	test ! -f exit-status


ok 1 # skip setup (missing CLONE_2GB)

skipping test: clone - bare 

	git clone --bare --no-hardlinks . clone-bare


ok 2 # skip clone - bare (missing CLONE_2GB)

skipping test: clone - with worktree, file:// protocol 

	git clone "file://$(pwd)" clone-wt


ok 3 # skip clone - with worktree, file:// protocol (missing CLONE_2GB)

# passed all 3 test(s)
1..3
Deleted tag 'initial' (was 24b24cf)
*** t5706-clone-branch.sh ***
Deleted tag 'second' (was 21f74a9)
Deleted tag 'third' (was d31729a)
ok 1 - setup

expecting success: 
	git bundle create bundle --all --since=7.Apr.2005.15:14:00.-0700 &&
	git ls-remote bundle > output &&
	grep tag output &&
	git bundle create bundle --all --since=7.Apr.2005.15:16:00.-0700 &&
	git ls-remote bundle > output &&
	! grep tag output

*** t5707-clone-detached.sh ***
Cloning into 'sub1'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5706-clone-branch/.git/
e01ff0465079785b971390644b3ef4ec3a910f75	refs/tags/tag
expecting success: 
	mkdir parent &&
	(cd parent && git init &&
	 echo one >file && git add file && git commit -m one &&
	 git checkout -b two &&
	 echo two >file && git add file && git commit -m two &&
	 git checkout master) &&
	mkdir empty &&
	(cd empty && git init)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5707-clone-detached/.git/
done.
expecting success: 
	echo one >file &&
	git add file &&
	git commit -m one &&
	echo two >file &&
	git commit -a -m two &&
	git tag two &&
	echo three >file &&
	git commit -a -m three

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5706-clone-branch/parent/.git/
ok 2 - annotated tags can be excluded by rev-list options

expecting success: 
	mkdir adir &&
	test_must_fail git bundle create adir --all

[master (root-commit) f222c3e] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
[master (root-commit) f222c3e] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
Switched to a new branch 'two'
[master b83cd57] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
fatal: cannot create 'adir': Is a directory
ok 3 - die if bundle file cannot be created

checking known breakage: 
	echo master | git bundle create stdin-bundle.bdl --stdin &&
	git ls-remote stdin-bundle.bdl >output &&
	grep master output

[two b83cd57] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master ca05137] three
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - setup

expecting success: 
	git checkout master^0 &&
	git clone "file://$PWD" detached-branch

fatal: Refusing to create empty bundle.
Switched to branch 'master'
not ok 4 - bundle --stdin # TODO known breakage

checking known breakage: 
	echo master | git bundle create hybrid-bundle.bdl --stdin tag &&
	git ls-remote hybrid-bundle.bdl >output &&
	grep master output

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 ca05137... three
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
Cloning into 'detached-branch'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5706-clone-branch/empty/.git/
ok 1 - setup

expecting success: 
	git clone parent clone &&
	(cd clone &&
	 check_HEAD master &&
	 check_file one
	)

Cloning into 'clone'...
not ok 5 - bundle --stdin <rev-list options> # TODO known breakage

expecting success: 
	: >empty-bundle &&
	test_must_fail git fetch empty-bundle

done.
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
fatal: Invalid gitfile format: empty-bundle
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ok 6 - empty bundle file is rejected

expecting success: 
	: >file4 &&
	test_tick &&
	git add file4 &&
	printf "%01200d\n" 0 | git commit -F - &&
	test_commit fifth &&
	git bundle create long-subject-bundle.bdl HEAD^..HEAD &&
	git bundle list-heads long-subject-bundle.bdl >heads &&
	test -s heads &&
	git fetch long-subject-bundle.bdl &&
	sed -n "/^-/{p;q;}" long-subject-bundle.bdl >boundary &&
	grep "^-[0-9a-f]\\{40\\} " boundary

Deleted branch replace_sub1_with_directory (was 48ceb4d).
ok 2 - vanilla clone chooses HEAD

expecting success: 
	git clone -b two parent clone-two &&
	(cd clone-two &&
	 check_HEAD two &&
	 check_file two
	)

Cloning into 'clone-two'...
Switched to a new branch 'replace_sub1_with_directory'
[master 731e220] 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file4
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
done.
[master fc029ac] fifth
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 fifth.t
ok 3 - clone -b chooses specified branch

expecting success: 
	(cd clone-two &&
	 echo origin >expect &&
	 git config branch.two.remote >actual &&
	 echo refs/heads/two >>expect &&
	 git config branch.two.merge >>actual &&
	 test_cmp expect actual
	)

ok 4 - clone -b sets up tracking

expecting success: 
	(cd clone-two &&
	 echo refs/remotes/origin/master >expect &&
	 git symbolic-ref refs/remotes/origin/HEAD >actual &&
	 test_cmp expect actual
	)

ok 2 - clone repo (detached HEAD points to branch)

expecting success: 
	echo three >expect &&
	git --git-dir=detached-branch/.git log -1 --format=%s >actual &&
	test_cmp expect actual

ok 5 - clone -b does not munge remotes/origin/HEAD

expecting success: 
	test_must_fail git clone -b bogus parent clone-bogus

ok 3 - cloned HEAD matches

checking known breakage: 
	head_is_detached detached-branch

Cloning into 'clone-bogus'...
ca051371ee116d0abae99cbac78d930a1c024261
error: The following untracked working tree files would be overwritten by merge:
	sub1/file1
	sub1/file2
Please move or remove them before you can merge.
Aborting
Updating 041e421..48ceb4d
refs/heads/master
test_must_fail: command succeeded: git --git-dir=detached-branch/.git symbolic-ref HEAD
not ok 4 - cloned HEAD is detached # TODO known breakage

expecting success: 
	git checkout two^0 &&
	git clone "file://$PWD" detached-tag

fatal: Remote branch bogus not found in upstream origin
fatal: The remote end hung up unexpectedly
ok 6 - clone -b with bogus branch

expecting success: 
	test_must_fail git clone -b branch empty clone-branch-empty

Previous HEAD position was ca05137... three
HEAD is now at b83cd57... two
Cloning into 'clone-branch-empty'...
From long-subject-bundle.bdl
 * branch            HEAD       -> FETCH_HEAD
Cloning into 'detached-tag'...
-731e22069f935c2baa02a907c08e20d012404511 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
ok 7 - ridiculously long subject in boundary

expecting success: 
	: >file1 &&
	git add file1 &&
	test_tick &&
	git commit --allow-empty-message -m "" &&
	test_commit file2 &&
	git bundle create bundle HEAD^.. &&
	git bundle verify bundle

fatal: Remote branch branch not found in upstream origin
fatal: The remote end hung up unexpectedly
ok 7 - clone -b not allowed with empty repos

# passed all 7 test(s)
1..7
[master 1e44ac2] 
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file1
ok 8 - git_pull: 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
		)
	
[master 3fdaba7] file2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file2.t
*** t5708-clone-config.sh ***
bundle is okay
The bundle contains this ref:
3fdaba71a8ccb4d44ffe75938a9a115cfea4806a HEAD
The bundle requires this ref:
1e44ac2f9ccb8d3590010e3ee941dc1d4be2e304 
ok 8 - prerequisites with an empty commit message

Cloning into 'submodule_update'...
# still have 2 known breakage(s)
# passed all remaining 6 test(s)
1..8
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5708-clone-config/.git/
expecting success: 
	rm -rf child &&
	git clone -c core.foo=bar . child &&
	echo bar >expect &&
	git --git-dir=child/.git config core.foo >actual &&
	test_cmp expect actual

done.
Note: checking out 'b83cd570c8640e9d7a5d62858721f1ac53eeb25e'.

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>

*** t5709-clone-refspec.sh ***
ok 5 - clone repo (detached HEAD points to tag)

expecting success: 
	echo two >expect &&
	git --git-dir=detached-tag/.git log -1 --format=%s >actual &&
	test_cmp expect actual

Cloning into 'child'...
ok 6 - cloned HEAD matches

expecting success: 
	head_is_detached detached-tag

b83cd570c8640e9d7a5d62858721f1ac53eeb25e
warning: You appear to have cloned an empty repository.
done.
fatal: ref HEAD is not a symbolic ref
ok 7 - cloned HEAD is detached

expecting success: 
	git checkout two^ &&
	git clone "file://$PWD" detached-history

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 1 - clone -c sets config in cloned repo

expecting success: 
	rm -rf child &&
	git clone -c core.foo=bar -c core.foo=baz . child &&
	{ echo bar; echo baz; } >expect &&
	git --git-dir=child/.git config --get-all core.foo >actual &&
	test_cmp expect actual

Previous HEAD position was b83cd57... two
HEAD is now at f222c3e... one
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5709-clone-refspec/.git/
Cloning into 'child'...
Cloning into 'detached-history'...
expecting success: 
	# Make two branches, "master" and "side"
	echo one >file &&
	git add file &&
	git commit -m one &&
	echo two >file &&
	git commit -a -m two &&
	git tag two &&
	echo three >file &&
	git commit -a -m three &&
	git checkout -b side &&
	echo four >file &&
	git commit -a -m four &&
	git checkout master &&

	# default clone
	git clone . dir_all &&

	# default --single that follows HEAD=master
	git clone --single-branch . dir_master &&

	# default --single that follows HEAD=side
	git checkout side &&
	git clone --single-branch . dir_side &&

	# explicit --single that follows side
	git checkout master &&
	git clone --single-branch --branch side . dir_side2 &&

	# default --single with --mirror
	git clone --single-branch --mirror . dir_mirror &&

	# default --single with --branch and --mirror
	git clone --single-branch --mirror --branch side . dir_mirror_side &&

	# --single that does not know what branch to follow
	git checkout two^ &&
	git clone --single-branch . dir_detached &&

	# explicit --single with tag
	git clone --single-branch --branch two . dir_tag &&

	# advance both "master" and "side" branches
	git checkout side &&
	echo five >file &&
	git commit -a -m five &&
	git checkout master &&
	echo six >file &&
	git commit -a -m six &&

	# update tag
	git tag -d two && git tag two

warning: You appear to have cloned an empty repository.
done.
ok 2 - clone -c can set multi-keys

expecting success: 
	rm -rf child &&
	git clone -c core.foo . child &&
	echo true >expect &&
	git --git-dir=child/.git config --bool core.foo >actual &&
	test_cmp expect actual

[master (root-commit) a97e878] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
Cloning into 'child'...
[master ad0c30c] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
warning: You appear to have cloned an empty repository.
done.
[master ee35eed] three
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 3 - clone -c without a value is boolean true

expecting success: 
	echo content >file &&
	git add file &&
	git commit -m one &&
	rm -rf child &&
	git clone -c core.autocrlf . child &&
	printf "content\\r\\n" >expect &&
	test_cmp expect child/file

Switched to a new branch 'side'
[master (root-commit) 050ae87] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
[side 057bd16] four
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'child'...
Note: checking out 'f222c3eeb4d5e77ea0736d481b465634c8b1fc88'.

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>

ok 8 - clone repo (detached HEAD points to history)

expecting success: 
	echo one >expect &&
	git --git-dir=detached-history/.git log -1 --format=%s >actual &&
	test_cmp expect actual

Switched to branch 'master'
Cloning into 'dir_all'...
ok 9 - cloned HEAD matches

expecting success: 
	head_is_detached detached-history

f222c3eeb4d5e77ea0736d481b465634c8b1fc88
done.
fatal: ref HEAD is not a symbolic ref
ok 10 - cloned HEAD is detached

expecting success: 
	git checkout master^0 &&
	echo four >file &&
	git commit -a -m four &&
	git clone "file://$PWD" detached-orphan

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
done.
ok 4 - clone -c config is available during clone

Previous HEAD position was f222c3e... one
HEAD is now at ca05137... three
# passed all 4 test(s)
1..4
Cloning into 'dir_master'...
[detached HEAD fd8fbb8] four
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'detached-orphan'...
done.
*** t5710-info-alternate.sh ***
Switched to branch 'side'
Cloning into 'dir_side'...
Cloning into 'sub1'...
done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5710-info-alternate/.git/
done.
expecting success: test_create_repo A && cd A &&
echo "Hello World" > file1 &&
git add file1 &&
git commit -m "Initial commit" file1 &&
git repack -a -d &&
git prune
Switched to branch 'master'
Cloning into 'dir_side2'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5710-info-alternate/A/.git/
done.
Note: checking out 'fd8fbb899a4c7faec5e1f53ca4cc7a2870159eff'.

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>

ok 11 - clone repo (orphan detached HEAD)

expecting success: 
	echo four >expect &&
	git --git-dir=detached-orphan/.git log -1 --format=%s >actual &&
	test_cmp expect actual

[master (root-commit) 056d6e6] Initial commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file1
Cloning into bare repository 'dir_mirror'...
ok 12 - cloned HEAD matches

expecting success: 
	head_is_detached detached-orphan

fd8fbb899a4c7faec5e1f53ca4cc7a2870159eff
fatal: ref HEAD is not a symbolic ref
ok 13 - cloned HEAD is detached

done.
# still have 1 known breakage(s)
# passed all remaining 12 test(s)
1..13
Cloning into bare repository 'dir_mirror_side'...
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
done.
Note: checking out 'two^'.

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 a97e878... one
Cloning into 'dir_detached'...
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
*** t5801-remote-helpers.sh ***
done.
ok 1 - preparing first repository

expecting success: git clone -l -s A B && cd B &&
echo "foo bar" > file2 &&
git add file2 &&
git commit -m "next commit" file2 &&
git repack -a -d -l &&
git prune
Note: checking out 'a97e87803a9b784f7a8b0b7aad1086e93b08c94a'.

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>

Cloning into 'dir_tag'...
Cloning into 'B'...
done.
done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5801-remote-helpers/.git/
Note: checking out 'ad0c30c8557f3e5e101ae5bcbf61bb556d2a9b17'.

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>

Deleted branch replace_sub1_with_directory (was 48ceb4d).
Previous HEAD position was a97e878... one
Switched to branch 'side'
Switched to a new branch 'replace_sub1_with_directory'
[master ebc9373] next commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file2
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
[side 404b46d] five
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to branch 'master'
[master 78ebc7c] six
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Deleted tag 'two' (was ad0c30c)
ok 1 - setup

expecting success: 
	(
		cd dir_all && git fetch &&
		git for-each-ref refs/remotes/origin |
		sed -e "/HEAD$/d" \
		    -e "s|/remotes/origin/|/heads/|" >../actual
	) &&
	# follow both master and side
	git for-each-ref refs/heads >expect &&
	test_cmp expect actual

error: The following untracked working tree files would be overwritten by merge:
	sub1/file1
	sub1/file2
Please move or remove them before you can merge.
Aborting
Updating 041e421..48ceb4d
From /«PKGBUILDDIR»/t/trash directory.t5709-clone-refspec/.
   ee35eed..78ebc7c  master     -> origin/master
   057bd16..404b46d  side       -> origin/side
ok 2 - by default all branches will be kept updated

expecting success: 
	(
		cd dir_all && git fetch &&
		git for-each-ref refs/tags >../actual
	) &&
	git for-each-ref refs/tags >expect &&
	test_must_fail test_cmp expect actual

ok 2 - preparing second repository

expecting success: git clone -l -s B C && cd C &&
echo "Goodbye, cruel world" > file3 &&
git add file3 &&
git commit -m "one more" file3 &&
git repack -a -d -l &&
git prune
ok 9 - git_pull: 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
		)
	
Cloning into 'C'...
done.
--- expect	2015-12-16 11:01:29.197564856 +0000
+++ actual	2015-12-16 11:01:29.181564856 +0000
@@ -1 +1 @@
-78ebc7cdb128010cd3704416fb0b3eab9dae5e6a commit	refs/tags/two
+ad0c30c8557f3e5e101ae5bcbf61bb556d2a9b17 commit	refs/tags/two
ok 3 - by default no tags will be kept updated

expecting success: 
	(
		cd dir_master && git fetch &&
		git for-each-ref refs/remotes/origin |
		sed -e "/HEAD$/d" \
		    -e "s|/remotes/origin/|/heads/|" >../actual
	) &&
	# only follow master
	git for-each-ref refs/heads/master >expect &&
	test_cmp expect actual

expecting success: 
	git init server &&
	(cd server &&
	 echo content >file &&
	 git add file &&
	 git commit -m one)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5801-remote-helpers/server/.git/
[master 01d974c] one more
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file3
[master (root-commit) d54912c] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 1 - setup repository

expecting success: 
	git clone "testgit::${PWD}/server" local &&
	test_cmp server/file local/file

Cloning into 'local'...
From /«PKGBUILDDIR»/t/trash directory.t5709-clone-refspec/.
   ee35eed..78ebc7c  master     -> origin/master
Cloning into 'submodule_update'...
ok 4 - --single-branch while HEAD pointing at master

expecting success: 
	(
		cd dir_side && git fetch &&
		git for-each-ref refs/remotes/origin |
		sed -e "/HEAD$/d" \
		    -e "s|/remotes/origin/|/heads/|" >../actual
	) &&
	# only follow side
	git for-each-ref refs/heads/side >expect &&
	test_cmp expect actual

done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 3 - preparing third repository

expecting success: git clone -l -s C D &&
git clone -l -s D E &&
git clone -l -s E F &&
git clone -l -s F G &&
git clone --bare -l -s G H
From /«PKGBUILDDIR»/t/trash directory.t5709-clone-refspec/.
   057bd16..404b46d  side       -> origin/side
Cloning into 'D'...
done.
ok 5 - --single-branch while HEAD pointing at side

expecting success: 
	(
		cd dir_side2 && git fetch &&
		git for-each-ref refs/remotes/origin |
		sed -e "/HEAD$/d" \
		    -e "s|/remotes/origin/|/heads/|" >../actual
	) &&
	# only follow side
	git for-each-ref refs/heads/side >expect &&
	test_cmp expect actual

Cloning into 'E'...
done.
ok 2 - cloning from local repo

expecting success: 
	(cd server &&
	 echo content >>file &&
	 git commit -a -m two)

Cloning into 'F'...
[master 6d7db22] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 3 - create new commit on remote

expecting success: 
	(cd local && git pull) &&
	test_cmp server/file local/file

From /«PKGBUILDDIR»/t/trash directory.t5709-clone-refspec/.
   057bd16..404b46d  side       -> origin/side
done.
Cloning into 'G'...
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 6 - --single-branch with explicit --branch side

expecting success: 
	(
		cd dir_tag && git fetch &&
		git for-each-ref refs/tags >../actual
	) &&
	git for-each-ref refs/tags >expect &&
	test_cmp expect actual

done.
Cloning into bare repository 'H'...
done.
error: /«PKGBUILDDIR»/t/trash directory.t5710-info-alternate/B/.git/objects: ignoring alternate object stores, nesting too deep.
ok 4 - creating too deep nesting

expecting success: cd H && {
	test_valid_repo
	test $? -ne 0
}
From /«PKGBUILDDIR»/t/trash directory.t5709-clone-refspec/.
 - [tag update]      two        -> two
error: /«PKGBUILDDIR»/t/trash directory.t5710-info-alternate/B/.git/objects: ignoring alternate object stores, nesting too deep.
Cloning into 'sub1'...
ok 7 - --single-branch with explicit --branch with tag fetches updated tag

expecting success: 
	(
		cd dir_mirror && git fetch &&
		git for-each-ref refs > ../actual
	) &&
	git for-each-ref refs >expect &&
	test_cmp expect actual

ok 5 - invalidity of deepest repository

expecting success: cd C &&
test_valid_repo
done.
From testgit::/«PKGBUILDDIR»/t/trash directory.t5801-remote-helpers/server
   d54912c..6d7db22  master     -> origin/master
ok 6 - validity of third repository

expecting success: cd D &&
test_valid_repo
Updating d54912c..6d7db22
Fast-forward
From /«PKGBUILDDIR»/t/trash directory.t5709-clone-refspec/.
   ee35eed..78ebc7c  master     -> master
 * [new branch]      side       -> side
 - [tag update]      two        -> two
ok 7 - validity of fourth repository

 file | 1 +
 1 file changed, 1 insertion(+)
expecting success: echo "$base_dir"/B/.git/objects >> "$base_dir"/A/.git/objects/info/alternates&&
cd C &&
test_valid_repo
ok 4 - pulling from local repo

expecting success: 
	(cd local &&
	echo content >>file &&
	git commit -a -m three &&
	git push) &&
	compare_refs local HEAD server HEAD

ok 8 - breaking of loops

expecting success: cd C &&
rm -f .git/objects/info/alternates &&
! (test_valid_repo)
[master 01290de] three
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
ok 8 - --single-branch with --mirror

expecting success: 
	(
		cd dir_mirror_side && git fetch &&
		git for-each-ref refs > ../actual
	) &&
	git for-each-ref refs >expect &&
	test_cmp expect actual

'current' instead of 'simple' if you sometimes use older versions of Git)

error: refs/remotes/origin/HEAD: invalid sha1 pointer ebc9373923dff6331108928d4cecc07c98a1cbb5
error: refs/remotes/origin/master: invalid sha1 pointer ebc9373923dff6331108928d4cecc07c98a1cbb5
ok 9 - that info/alternates is necessary

expecting success: cd C &&
echo "../../../B/.git/objects" > .git/objects/info/alternates &&
test_valid_repo
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
ok 10 - that relative alternate is possible for current dir

expecting success: 
    cd D &&
    ! (test_valid_repo)

error: /«PKGBUILDDIR»/t/trash directory.t5710-info-alternate/C/.git/objects: ignoring relative alternate object store ../../../B/.git/objects
ok 11 - that relative alternate is only possible for current dir

# passed all 11 test(s)
1..11
From /«PKGBUILDDIR»/t/trash directory.t5709-clone-refspec/.
 * [new branch]      master     -> master
   057bd16..404b46d  side       -> side
 - [tag update]      two        -> two
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
Deleted branch replace_sub1_with_file (was 88f15cf).
ok 9 - --single-branch with explicit --branch and --mirror

expecting success: 
	(
		cd dir_detached && git fetch &&
		git for-each-ref refs/remotes/origin |
		sed -e "/HEAD$/d" \
		    -e "s|/remotes/origin/|/heads/|" >../actual
	) &&
	# nothing
	>expect &&
	test_cmp expect actual

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.
To testgit::/«PKGBUILDDIR»/t/trash directory.t5801-remote-helpers/server
   6d7db22..01290de  master -> master
*** t5802-connect-helper.sh ***
ok 5 - pushing to local repo

expecting success: 
	(cd server &&
	 git reset --hard &&
	 git checkout -b new &&
	 echo content >>file &&
	 git commit -a -m five
	) &&
	(cd local &&
	 git fetch origin new
	) &&
	compare_refs server HEAD local FETCH_HEAD

From /«PKGBUILDDIR»/t/trash directory.t5709-clone-refspec/.
 * branch            HEAD       -> FETCH_HEAD
HEAD is now at 01290de three
ok 10 - --single-branch with detached

Switched to a new branch 'new'
# passed all 10 test(s)
1..10
Updating 041e421..88f15cf
Fast-forward
[new a1b8eeb] five
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5802-connect-helper/.git/
 .gitmodules | 4 ----
 sub1        | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
test_must_fail: command succeeded: git_pull replace_sub1_with_file
expecting success: 
	test_tick &&
	git commit --allow-empty -m initial &&
	test_tick &&
	git commit --allow-empty -m second &&
	test_tick &&
	git commit --allow-empty -m third &&
	test_tick &&
	git tag -a -m "tip three" three &&

	test_tick &&
	git commit --allow-empty -m fourth

not ok 10 - git_pull: 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
		)
	
[master (root-commit) 66fe8b3] initial
 Author: A U Thor <author@example.com>
[master 5ce2b00] second
 Author: A U Thor <author@example.com>
[master 8019b76] third
 Author: A U Thor <author@example.com>
Cloning into 'submodule_update'...
[master b0c6cf2] fourth
 Author: A U Thor <author@example.com>
ok 1 - setup

expecting success: 
	cmd=$(echo "echo >&2 ext::sh invoked && %S .." | sed -e "s/ /% /g") &&
	git clone "ext::sh -c %S% ." dst &&
	git for-each-ref refs/heads/ refs/tags/ >expect &&
	(
		cd dst &&
		git config remote.origin.url "ext::sh -c $cmd" &&
		git for-each-ref refs/heads/ refs/tags/
	) >actual &&
	test_cmp expect actual

Cloning into 'dst'...
done.
From testgit::/«PKGBUILDDIR»/t/trash directory.t5801-remote-helpers/server
 * branch            new        -> FETCH_HEAD
 * [new branch]      new        -> origin/new
*** t5810-proto-disable-local.sh ***
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 6 - fetch new branch

expecting success: 
	(cd local &&
	 git fetch
	) &&
	compare_refs server master local refs/remotes/origin/master &&
	compare_refs server new local refs/remotes/origin/new

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5810-proto-disable-local/.git/
expecting success: 
	test_commit one

[master (root-commit) d79ce16] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
ok 1 - setup repository to clone

expecting success: 
		rm -rf tmp.git &&
		(
			GIT_ALLOW_PROTOCOL=$proto &&
			export GIT_ALLOW_PROTOCOL &&
			git clone --bare "$url" tmp.git
		)
	
Cloning into bare repository 'tmp.git'...
ok 2 - clone

expecting success: 
	test_tick &&
	git commit --allow-empty -m fifth &&
	test_tick &&
	git tag -a -m "tip five" five &&
	git for-each-ref refs/heads/ refs/tags/ >expect &&
	(
		cd dst &&
		git pull &&
		git for-each-ref refs/heads/ refs/tags/ >../actual
	) &&
	test_cmp expect actual

[master a643494] fifth
 Author: A U Thor <author@example.com>
ok 7 - fetch multiple branches

expecting success: 
	(cd local &&
	 git reset --hard origin/master &&
	 echo content >>file &&
	 git commit -a -m six &&
	 git push
	) &&
	compare_refs local master server master

HEAD is now at 01290de three
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
[master 3537161] six
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ext::sh invoked
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

ok 2 - clone file:// (enabled)

expecting success: 
		(
			cd tmp.git &&
			GIT_ALLOW_PROTOCOL=$proto &&
			export GIT_ALLOW_PROTOCOL &&
			git fetch
		)
	
From ext::sh -c echo% >&2% ext::sh% invoked% &&% %S% ..
   b0c6cf2..a643494  master     -> origin/master
 * [new tag]         five       -> five
Cloning into 'sub1'...
Updating b0c6cf2..a643494
Fast-forward
From file:///«PKGBUILDDIR»/t/trash directory.t5810-proto-disable-local
 * branch            HEAD       -> FETCH_HEAD
ok 3 - fetch file:// (enabled)
ok 3 - update following tag


expecting success: 
		(
			cd tmp.git &&
			GIT_ALLOW_PROTOCOL=$proto &&
			export GIT_ALLOW_PROTOCOL &&
			git push origin HEAD:pushed
		)
	
expecting success: 
	test_tick &&
	git commit --allow-empty -m sixth &&
	test_tick &&
	git tag -a -m "tip two" two three^1 &&
	git for-each-ref refs/heads/ refs/tags/ >expect &&
	(
		cd dst &&
		git pull &&
		git for-each-ref refs/heads/ refs/tags/ >../actual
	) &&
	test_cmp expect actual

done.
[master 06b114e] sixth
 Author: A U Thor <author@example.com>
To testgit::/«PKGBUILDDIR»/t/trash directory.t5801-remote-helpers/server
   01290de..3537161  master -> master
To file:///«PKGBUILDDIR»/t/trash directory.t5810-proto-disable-local
 * [new branch]      HEAD -> pushed
ok 4 - push file:// (enabled)

expecting success: 
		(
			cd tmp.git &&
			GIT_ALLOW_PROTOCOL=none &&
			export GIT_ALLOW_PROTOCOL &&
			test_must_fail git push origin HEAD:pushed
		)
	
fatal: transport 'file' not allowed
ext::sh invoked
ok 5 - push file:// (disabled)

expecting success: 
		(
			cd tmp.git &&
			GIT_ALLOW_PROTOCOL=none &&
			export GIT_ALLOW_PROTOCOL &&
			test_must_fail git fetch
		)
	
ok 8 - push when remote has extra refs

expecting success: 
	(cd local &&
	 git checkout -b new-name  &&
	 echo content >>file &&
	 git commit -a -m seven &&
	 git push origin new-name
	) &&
	compare_refs local HEAD server refs/heads/new-name

fatal: transport 'file' not allowed
ok 6 - fetch file:// (disabled)

expecting success: 
		rm -rf tmp.git &&
		(
			GIT_ALLOW_PROTOCOL=none &&
			export GIT_ALLOW_PROTOCOL &&
			test_must_fail git clone --bare "$url" tmp.git
		)
	
Switched to a new branch 'new-name'
Cloning into bare repository 'tmp.git'...
[new-name 2b17d0c] seven
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
fatal: transport 'file' not allowed
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
ok 7 - clone file:// (disabled)

expecting success: 
		rm -rf tmp.git &&
		(
			GIT_ALLOW_PROTOCOL=$proto &&
			export GIT_ALLOW_PROTOCOL &&
			git clone --bare "$url" tmp.git
		)
	
From ext::sh -c echo% >&2% ext::sh% invoked% &&% %S% ..
   a643494..06b114e  master     -> origin/master
 * [new tag]         two        -> two
Cloning into bare repository 'tmp.git'...
done.
Updating a643494..06b114e
Fast-forward
ok 8 - clone path (enabled)

expecting success: 
		(
			cd tmp.git &&
			GIT_ALLOW_PROTOCOL=$proto &&
			export GIT_ALLOW_PROTOCOL &&
			git fetch
		)
	
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
ok 4 - update backfilled tag

expecting success: 
	test_tick &&
	git tag -a -m "tip one " one two^1 &&
	git for-each-ref refs/heads/ refs/tags/ >expect &&
	(
		cd dst &&
		git pull &&
		git for-each-ref refs/heads/ refs/tags/ >../actual
	) &&
	test_cmp expect actual

From /«PKGBUILDDIR»/t/trash directory.t5810-proto-disable-local/.
 * branch            HEAD       -> FETCH_HEAD
ok 9 - fetch path (enabled)

expecting success: 
		(
			cd tmp.git &&
			GIT_ALLOW_PROTOCOL=$proto &&
			export GIT_ALLOW_PROTOCOL &&
			git push origin HEAD:pushed
		)
	
Everything up-to-date
ok 10 - push path (enabled)

expecting success: 
		(
			cd tmp.git &&
			GIT_ALLOW_PROTOCOL=none &&
			export GIT_ALLOW_PROTOCOL &&
			test_must_fail git push origin HEAD:pushed
		)
	
ext::sh invoked
fatal: transport 'file' not allowed
ok 11 - push path (disabled)

expecting success: 
		(
			cd tmp.git &&
			GIT_ALLOW_PROTOCOL=none &&
			export GIT_ALLOW_PROTOCOL &&
			test_must_fail git fetch
		)
	
fatal: transport 'file' not allowed
ok 12 - fetch path (disabled)

expecting success: 
		rm -rf tmp.git &&
		(
			GIT_ALLOW_PROTOCOL=none &&
			export GIT_ALLOW_PROTOCOL &&
			test_must_fail git clone --bare "$url" tmp.git
		)
	
Deleted branch replace_sub1_with_file (was 88f15cf).
Cloning into bare repository 'tmp.git'...
Switched to a new branch 'replace_sub1_with_file'
fatal: transport 'file' not allowed
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
ok 13 - clone path (disabled)

From ext::sh -c echo% >&2% ext::sh% invoked% &&% %S% ..
 * [new tag]         one        -> one
# passed all 13 test(s)
1..13
Already up-to-date.
To testgit::/«PKGBUILDDIR»/t/trash directory.t5801-remote-helpers/server
 * [new branch]      new-name -> new-name
*** t5811-proto-disable-git.sh ***
ok 5 - update backfilled tag without primary transfer

# passed all 5 test(s)
1..5
ok 9 - push new branch by name

expecting success: 
	(cd local &&
	 git push origin new-name:new-refspec
	) &&
	compare_refs local HEAD server refs/heads/new-refspec

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5811-proto-disable-git/.git/
*** t5812-proto-disable-http.sh ***
Starting git daemon ...
Updating 041e421..88f15cf
Fast-forward
[11880] Ready to rumble
To testgit::/«PKGBUILDDIR»/t/trash directory.t5801-remote-helpers/server
 * [new branch]      new-name -> new-refspec
expecting success: 
	bare="$GIT_DAEMON_DOCUMENT_ROOT_PATH/repo.git" &&
	test_commit one &&
	git --bare init "$bare" &&
	git push "$bare" HEAD &&
	>"$bare/git-daemon-export-ok" &&
	git -C "$bare" config daemon.receivepack true

 .gitmodules | 4 ----
 sub1        | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
test_must_fail: command succeeded: git_pull replace_sub1_with_file
ok 10 - push new branch with old:new refspec

expecting success: 
	(cd local &&
	 git checkout new-name
	 git push origin HEAD:new-refspec-2
	) &&
	compare_refs local HEAD server refs/heads/new-refspec-2

not ok 11 - git_pull: 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
		)
	
[master (root-commit) d79ce16] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5812-proto-disable-http/.git/
Already on 'new-name'
checking prerequisite: NOT_ROOT

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	uid=$(id -u) &&
	test "$uid" != 0

)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5811-proto-disable-git/repo/repo.git/
prerequisite NOT_ROOT ok
1..0 # SKIP no web server found at '/usr/sbin/apache2'
*** t5813-proto-disable-ssh.sh ***
To testgit::/«PKGBUILDDIR»/t/trash directory.t5801-remote-helpers/server
 * [new branch]      HEAD -> new-refspec-2
Cloning into 'submodule_update'...
To /«PKGBUILDDIR»/t/trash directory.t5811-proto-disable-git/repo/repo.git
 * [new branch]      HEAD -> master
ok 1 - create git-accessible repo

expecting success: 
		rm -rf tmp.git &&
		(
			GIT_ALLOW_PROTOCOL=$proto &&
			export GIT_ALLOW_PROTOCOL &&
			git clone --bare "$url" tmp.git
		)
	
ok 11 - push new branch with HEAD:new refspec

expecting success: 
	(cd local &&
	 git push origin :new-name
	) &&
	test_must_fail git --git-dir="server/.git" \
	 rev-parse --verify refs/heads/new-name

Cloning into bare repository 'tmp.git'...
done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5813-proto-disable-ssh/.git/
[11976] Connection from 127.0.0.1:49333
[11976] Extended attributes (21 bytes) exist <host=127.0.0.1:5811>
[11976] Request upload-pack for '/repo.git'
expecting success: 
		write_script ssh-wrapper <<-\EOF &&
		echo >&2 "ssh: $*"
		host=$1; shift
		cd "$TRASH_DIRECTORY/$host" &&
		eval "$*"
		EOF
		GIT_SSH="$PWD/ssh-wrapper" &&
		export GIT_SSH &&
		export TRASH_DIRECTORY
	
ok 1 - setup ssh wrapper

expecting success: 
	test_commit one &&
	mkdir remote &&
	git init --bare remote/repo.git &&
	git push remote/repo.git HEAD

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
[master (root-commit) d79ce16] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
[11880] [11976] Disconnected
Everything up-to-date
fatal: Needed a single revision
ok 12 - push delete branch

expecting success: 
	(cd local &&
	git checkout -b force-test &&
	echo content >> file &&
	git commit -a -m eight &&
	git push origin force-test &&
	echo content >> file &&
	git commit -a --amend -m eight-modified &&
	git push --force origin force-test
	) &&
	compare_refs local refs/heads/force-test server refs/heads/force-test

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5813-proto-disable-ssh/remote/repo.git/
Switched to a new branch 'force-test'
[force-test 33fc62c] eight
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
To remote/repo.git
 * [new branch]      HEAD -> master
ok 2 - setup repository to clone

expecting success: 
		rm -rf tmp.git &&
		(
			GIT_ALLOW_PROTOCOL=$proto &&
			export GIT_ALLOW_PROTOCOL &&
			git clone --bare "$url" tmp.git
		)
	
Cloning into bare repository 'tmp.git'...
ok 2 - clone git:// (enabled)

expecting success: 
		(
			cd tmp.git &&
			GIT_ALLOW_PROTOCOL=$proto &&
			export GIT_ALLOW_PROTOCOL &&
			git fetch
		)
	
ssh: remote git-upload-pack 'repo.git'
[12068] Connection from 127.0.0.1:49334
[12068] Extended attributes (21 bytes) exist <host=127.0.0.1:5811>
[12068] Request upload-pack for '/repo.git'
From git://127.0.0.1:5811/repo
 * branch            HEAD       -> FETCH_HEAD
[11880] [12068] Disconnected
ok 3 - fetch git:// (enabled)

expecting success: 
		(
			cd tmp.git &&
			GIT_ALLOW_PROTOCOL=$proto &&
			export GIT_ALLOW_PROTOCOL &&
			git push origin HEAD:pushed
		)
	
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
[12093] Connection from 127.0.0.1:49335
[12093] Extended attributes (21 bytes) exist <host=127.0.0.1:5811>
[12093] Request receive-pack for '/repo.git'
To testgit::/«PKGBUILDDIR»/t/trash directory.t5801-remote-helpers/server
 * [new branch]      force-test -> force-test
ok 3 - clone host:path (enabled)

expecting success: 
		(
			cd tmp.git &&
			GIT_ALLOW_PROTOCOL=$proto &&
			export GIT_ALLOW_PROTOCOL &&
			git fetch
		)
	
To git://127.0.0.1:5811/repo.git
 * [new branch]      HEAD -> pushed
[11880] [12093] Disconnected
ok 4 - push git:// (enabled)

expecting success: 
		(
			cd tmp.git &&
			GIT_ALLOW_PROTOCOL=none &&
			export GIT_ALLOW_PROTOCOL &&
			test_must_fail git push origin HEAD:pushed
		)
	
ssh: remote git-upload-pack 'repo.git'
fatal: transport 'git' not allowed
ok 5 - push git:// (disabled)

expecting success: 
		(
			cd tmp.git &&
			GIT_ALLOW_PROTOCOL=none &&
			export GIT_ALLOW_PROTOCOL &&
			test_must_fail git fetch
		)
	
[force-test 6e0abcb] eight-modified
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 11:01:33 2015 +0000
 1 file changed, 2 insertions(+)
fatal: transport 'git' not allowed
From remote:repo
 * branch            HEAD       -> FETCH_HEAD
ok 6 - fetch git:// (disabled)

expecting success: 
		rm -rf tmp.git &&
		(
			GIT_ALLOW_PROTOCOL=none &&
			export GIT_ALLOW_PROTOCOL &&
			test_must_fail git clone --bare "$url" tmp.git
		)
	
Cloning into 'sub1'...
ok 4 - fetch host:path (enabled)

expecting success: 
		(
			cd tmp.git &&
			GIT_ALLOW_PROTOCOL=$proto &&
			export GIT_ALLOW_PROTOCOL &&
			git push origin HEAD:pushed
		)
	
Cloning into bare repository 'tmp.git'...
ssh: remote git-receive-pack 'repo.git'
fatal: transport 'git' not allowed
done.
ok 7 - clone git:// (disabled)

# passed all 7 test(s)
1..7
To remote:repo.git
 * [new branch]      HEAD -> pushed
ok 5 - push host:path (enabled)

expecting success: 
		(
			cd tmp.git &&
			GIT_ALLOW_PROTOCOL=none &&
			export GIT_ALLOW_PROTOCOL &&
			test_must_fail git push origin HEAD:pushed
		)
	
fatal: transport 'ssh' not allowed
ok 6 - push host:path (disabled)

expecting success: 
		(
			cd tmp.git &&
			GIT_ALLOW_PROTOCOL=none &&
			export GIT_ALLOW_PROTOCOL &&
			test_must_fail git fetch
		)
	
Stopping git daemon ...
*** t5814-proto-disable-ext.sh ***
fatal: transport 'ssh' not allowed
ok 7 - fetch host:path (disabled)

expecting success: 
		rm -rf tmp.git &&
		(
			GIT_ALLOW_PROTOCOL=none &&
			export GIT_ALLOW_PROTOCOL &&
			test_must_fail git clone --bare "$url" tmp.git
		)
	
Cloning into bare repository 'tmp.git'...
fatal: transport 'ssh' not allowed
ok 8 - clone host:path (disabled)

expecting success: 
		rm -rf tmp.git &&
		(
			GIT_ALLOW_PROTOCOL=$proto &&
			export GIT_ALLOW_PROTOCOL &&
			git clone --bare "$url" tmp.git
		)
	
To testgit::/«PKGBUILDDIR»/t/trash directory.t5801-remote-helpers/server
   33fc62c..6e0abcb  force-test -> force-test
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5814-proto-disable-ext/.git/
Cloning into bare repository 'tmp.git'...
expecting success: 
		write_script fake-remote <<-\EOF &&
		echo >&2 "fake-remote: $*"
		cd "$TRASH_DIRECTORY/remote" &&
		eval "$*"
		EOF
		PATH=$TRASH_DIRECTORY:$PATH &&
		export TRASH_DIRECTORY
	
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
ssh: remote git-upload-pack '/«PKGBUILDDIR»/t/trash directory.t5813-proto-disable-ssh/remote/repo.git'
ok 1 - setup ext wrapper

expecting success: 
	test_commit one &&
	mkdir remote &&
	git init --bare remote/repo.git &&
	git push remote/repo.git HEAD

ok 13 - forced push

expecting success: 
	GIT_REMOTE_TESTGIT_REFSPEC="" \
	git clone "testgit::${PWD}/server" local2 2>error &&
	grep "This remote helper should implement refspec capability" error &&
	compare_refs local2 HEAD server HEAD

[master (root-commit) d79ce16] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5814-proto-disable-ext/remote/repo.git/
Deleted branch modify_sub1 (was 85dfe6e).
Switched to a new branch 'modify_sub1'
Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
ok 9 - clone ssh:// (enabled)

expecting success: 
		(
			cd tmp.git &&
			GIT_ALLOW_PROTOCOL=$proto &&
			export GIT_ALLOW_PROTOCOL &&
			git fetch
		)
	
ssh: remote git-upload-pack '/«PKGBUILDDIR»/t/trash directory.t5813-proto-disable-ssh/remote/repo.git'
To remote/repo.git
 * [new branch]      HEAD -> master
ok 2 - setup repository to clone

expecting success: 
		rm -rf tmp.git &&
		(
			GIT_ALLOW_PROTOCOL=$proto &&
			export GIT_ALLOW_PROTOCOL &&
			git clone --bare "$url" tmp.git
		)
	
Cloning into bare repository 'tmp.git'...
From ssh://remote/«PKGBUILDDIR»/t/trash directory.t5813-proto-disable-ssh/remote/repo
 * branch            HEAD       -> FETCH_HEAD
ok 10 - fetch ssh:// (enabled)

expecting success: 
		(
			cd tmp.git &&
			GIT_ALLOW_PROTOCOL=$proto &&
			export GIT_ALLOW_PROTOCOL &&
			git push origin HEAD:pushed
		)
	
fake-remote: git-upload-pack repo.git
ssh: remote git-receive-pack '/«PKGBUILDDIR»/t/trash directory.t5813-proto-disable-ssh/remote/repo.git'
Everything up-to-date
ok 11 - push ssh:// (enabled)

expecting success: 
		(
			cd tmp.git &&
			GIT_ALLOW_PROTOCOL=none &&
			export GIT_ALLOW_PROTOCOL &&
			test_must_fail git push origin HEAD:pushed
		)
	
Updating 041e421..85dfe6e
Fast-forward
fatal: transport 'ssh' not allowed
ok 12 - push ssh:// (disabled)

expecting success: 
		(
			cd tmp.git &&
			GIT_ALLOW_PROTOCOL=none &&
			export GIT_ALLOW_PROTOCOL &&
			test_must_fail git fetch
		)
	
fatal: transport 'ssh' not allowed
ok 13 - fetch ssh:// (disabled)

expecting success: 
		rm -rf tmp.git &&
		(
			GIT_ALLOW_PROTOCOL=none &&
			export GIT_ALLOW_PROTOCOL &&
			test_must_fail git clone --bare "$url" tmp.git
		)
	
Cloning into bare repository 'tmp.git'...
warning: This remote helper should implement refspec capability.
fatal: transport 'ssh' not allowed
ok 14 - clone ssh:// (disabled)

expecting success: 
		rm -rf tmp.git &&
		(
			GIT_ALLOW_PROTOCOL=$proto &&
			export GIT_ALLOW_PROTOCOL &&
			git clone --bare "$url" tmp.git
		)
	
ok 14 - cloning without refspec

expecting success: 
	(cd local2 &&
	git reset --hard &&
	GIT_REMOTE_TESTGIT_REFSPEC="" git pull 2>../error) &&
	grep "This remote helper should implement refspec capability" error &&
	compare_refs local2 HEAD server HEAD

Cloning into bare repository 'tmp.git'...
ok 3 - clone remote-helper (enabled)

expecting success: 
		(
			cd tmp.git &&
			GIT_ALLOW_PROTOCOL=$proto &&
			export GIT_ALLOW_PROTOCOL &&
			git fetch
		)
	
HEAD is now at a1b8eeb five
ssh: remote git-upload-pack '/«PKGBUILDDIR»/t/trash directory.t5813-proto-disable-ssh/remote/repo.git'
fake-remote: git-upload-pack repo.git
From ext::fake-remote %S repo
 * branch            HEAD       -> FETCH_HEAD
ok 4 - fetch remote-helper (enabled)

expecting success: 
		(
			cd tmp.git &&
			GIT_ALLOW_PROTOCOL=$proto &&
			export GIT_ALLOW_PROTOCOL &&
			git push origin HEAD:pushed
		)
	
fake-remote: git-receive-pack repo.git
ok 15 - clone git+ssh:// (enabled)

expecting success: 
		(
			cd tmp.git &&
			GIT_ALLOW_PROTOCOL=$proto &&
			export GIT_ALLOW_PROTOCOL &&
			git fetch
		)
	
ssh: remote git-upload-pack '/«PKGBUILDDIR»/t/trash directory.t5813-proto-disable-ssh/remote/repo.git'
Already up-to-date.
To ext::fake-remote %S repo.git
 * [new branch]      HEAD -> pushed
ok 5 - push remote-helper (enabled)

expecting success: 
		(
			cd tmp.git &&
			GIT_ALLOW_PROTOCOL=none &&
			export GIT_ALLOW_PROTOCOL &&
			test_must_fail git push origin HEAD:pushed
		)
	
warning: This remote helper should implement refspec capability.
fatal: transport 'ext' not allowed
From git+ssh://remote/«PKGBUILDDIR»/t/trash directory.t5813-proto-disable-ssh/remote/repo
 * branch            HEAD       -> FETCH_HEAD
ok 6 - push remote-helper (disabled)

expecting success: 
		(
			cd tmp.git &&
			GIT_ALLOW_PROTOCOL=none &&
			export GIT_ALLOW_PROTOCOL &&
			test_must_fail git fetch
		)
	
ok 16 - fetch git+ssh:// (enabled)

expecting success: 
		(
			cd tmp.git &&
			GIT_ALLOW_PROTOCOL=$proto &&
			export GIT_ALLOW_PROTOCOL &&
			git push origin HEAD:pushed
		)
	
fatal: transport 'ext' not allowed
ok 7 - fetch remote-helper (disabled)

expecting success: 
		rm -rf tmp.git &&
		(
			GIT_ALLOW_PROTOCOL=none &&
			export GIT_ALLOW_PROTOCOL &&
			test_must_fail git clone --bare "$url" tmp.git
		)
	
ok 15 - pulling without refspecs

expecting success: 
	test_when_finished "(cd local2 && git reset --hard origin)" &&
	(cd local2 &&
	echo content >>file &&
	git commit -a -m ten &&
	GIT_REMOTE_TESTGIT_REFSPEC="" &&
	export GIT_REMOTE_TESTGIT_REFSPEC &&
	test_must_fail git push 2>../error) &&
	grep "remote-helper doesn.t support push; refspec needed" error

ssh: remote git-receive-pack '/«PKGBUILDDIR»/t/trash directory.t5813-proto-disable-ssh/remote/repo.git'
Everything up-to-date
Cloning into bare repository 'tmp.git'...
ok 17 - push git+ssh:// (enabled)

expecting success: 
		(
			cd tmp.git &&
			GIT_ALLOW_PROTOCOL=none &&
			export GIT_ALLOW_PROTOCOL &&
			test_must_fail git push origin HEAD:pushed
		)
	
[new 1986129] ten
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
fatal: transport 'ssh' not allowed
ok 18 - push git+ssh:// (disabled)

expecting success: 
		(
			cd tmp.git &&
			GIT_ALLOW_PROTOCOL=none &&
			export GIT_ALLOW_PROTOCOL &&
			test_must_fail git fetch
		)
	
fatal: transport 'ext' not allowed
fatal: transport 'ssh' not allowed
ok 8 - clone remote-helper (disabled)

ok 19 - fetch git+ssh:// (disabled)

expecting success: 
		rm -rf tmp.git &&
		(
			GIT_ALLOW_PROTOCOL=none &&
			export GIT_ALLOW_PROTOCOL &&
			test_must_fail git clone --bare "$url" tmp.git
		)
	
# passed all 8 test(s)
1..8
Submodule path 'sub1': checked out 'eedcaeb9ebca3d956845c627772d7a68b8eec63e'
fatal: remote-helper doesn't support push; refspec needed
Cloning into bare repository 'tmp.git'...
HEAD is now at a1b8eeb five
fatal: transport 'ssh' not allowed
ok 16 - pushing without refspecs

expecting success: 
	(cd local2 &&
	GIT_REMOTE_TESTGIT_NO_MARKS=1 git pull) &&
	compare_refs local2 HEAD server HEAD

*** t5815-submodule-protos.sh ***
ok 20 - clone git+ssh:// (disabled)

# passed all 20 test(s)
1..20
*** t5900-repo-selection.sh ***
ok 12 - git_pull: 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
		)
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5815-submodule-protos/.git/
expecting success: 
		write_script fake-remote <<-\EOF &&
		echo >&2 "fake-remote: $*"
		cd "$TRASH_DIRECTORY/remote" &&
		eval "$*"
		EOF
		PATH=$TRASH_DIRECTORY:$PATH &&
		export TRASH_DIRECTORY
	
ok 1 - setup ext wrapper

expecting success: 
		write_script ssh-wrapper <<-\EOF &&
		echo >&2 "ssh: $*"
		host=$1; shift
		cd "$TRASH_DIRECTORY/$host" &&
		eval "$*"
		EOF
		GIT_SSH="$PWD/ssh-wrapper" &&
		export GIT_SSH &&
		export TRASH_DIRECTORY
	
ok 2 - setup ssh wrapper

expecting success: 
	mkdir remote &&
	git init remote/repo.git &&
	(cd remote/repo.git && test_commit one) &&
	# submodule-add should probably trust what we feed it on the cmdline,
	# but its implementation is overly conservative.
	GIT_ALLOW_PROTOCOL=ssh git submodule add remote:repo.git ssh-module &&
	GIT_ALLOW_PROTOCOL=ext git submodule add "ext::fake-remote %S repo.git" ext-module &&
	git commit -m "add submodules"

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5900-repo-selection/.git/
Already up-to-date.
expecting success: 
	reset &&
	make_tree foo &&
	get foo &&
	check foo

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5815-submodule-protos/remote/repo.git/.git/
Cloning into 'submodule_update'...
ok 17 - pulling without marks

checking known breakage: 
	test_when_finished "(cd local2 && git reset --hard origin)" &&
	(cd local2 &&
	echo content >>file &&
	git commit -a -m twelve &&
	GIT_REMOTE_TESTGIT_NO_MARKS=1 git push) &&
	compare_refs local2 HEAD server HEAD

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5900-repo-selection/foo/.git/
[master (root-commit) d79ce16] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
[new 7656df4] twelve
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

[master (root-commit) ddd63c9] foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo.t
done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5900-repo-selection/fetch/
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
From ../foo
 * branch            HEAD       -> FETCH_HEAD
Cloning into 'ssh-module'...
Cloning into 'clone'...
ssh: remote git-upload-pack 'repo.git'
warning: Not updating refs/heads/new (new tip 83610ce51e060a3dcc2a8740593681a8bb2d2892 does not contain a1b8eeb05ef6ae0fb169bbc4accac80c108a167d)
done.
Everything up-to-date
--- expect	2015-12-16 11:01:36.129564857 +0000
+++ actual	2015-12-16 11:01:36.145564857 +0000
@@ -1 +1 @@
-7656df4f797587ae606c1c6797acf4d7f957215c
+a1b8eeb05ef6ae0fb169bbc4accac80c108a167d
HEAD is now at a1b8eeb five
not ok 18 - pushing without marks # TODO known breakage

expecting success: 
	(cd local &&
	git branch dup2 master &&
	git push origin --all
	) &&
	compare_refs local dup2 server dup2

ok 1 - find .git dir in worktree

expecting success: 
	reset &&
	make_bare foo.git &&
	get foo &&
	check foo.git

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5900-repo-selection/foo.git/
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
To testgit::/«PKGBUILDDIR»/t/trash directory.t5801-remote-helpers/server
 * [new branch]      dup2 -> dup2
   2b17d0c..2b17d0c  new-name -> new-name
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5900-repo-selection/fetch/
ok 19 - push all with existing object

expecting success: 
	(cd local &&
	git branch dup master &&
	git push origin dup
	) &&
	compare_refs local dup server dup

From ../foo
 * branch            HEAD       -> FETCH_HEAD
Cloning into 'sub1'...
Cloning into 'clone'...
To testgit::/«PKGBUILDDIR»/t/trash directory.t5801-remote-helpers/server
 * [new branch]      dup -> dup
done.
done.
ok 20 - push ref with existing object

expecting success: 
	(cd local &&
	git checkout master &&
	git tag -s -m signed-tag signed-tag &&
	git push origin signed-tag
	) &&
	compare_refs local signed-tag^{} server signed-tag^{} &&
	test_must_fail compare_refs local signed-tag server signed-tag

ok 2 - automagically add .git suffix

expecting success: 
	reset &&
	make_tree foo.git &&
	get foo &&
	check foo.git

Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
Cloning into 'ext-module'...
fake-remote: git-upload-pack repo.git
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5900-repo-selection/foo.git/.git/
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
[master (root-commit) 98b6c1b] foo.git
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo.git.t
warning: Stripping signature from tag c72145038b275229a3ac6ad2ee8ae75b826f85d4
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5900-repo-selection/fetch/
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
Deleted branch invalid_sub1 (was e730a90).
Switched to a new branch 'invalid_sub1'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
From ../foo
 * branch            HEAD       -> FETCH_HEAD
Cloning into 'clone'...
done.
Updating 041e421..e730a90
Fast-forward
To testgit::/«PKGBUILDDIR»/t/trash directory.t5801-remote-helpers/server
 * [new tag]         signed-tag -> signed-tag
ok 3 - automagically add .git suffix to worktree

expecting success: 
	reset &&
	make_tree foo &&
	make_bare foo.git &&
	get foo &&
	check foo

--- expect	2015-12-16 11:01:37.377564857 +0000
+++ actual	2015-12-16 11:01:37.393564857 +0000
@@ -1 +1 @@
-c72145038b275229a3ac6ad2ee8ae75b826f85d4
+9b59a365067cfcb88b8d7214498d99b8488f7355
ok 21 - push signed tag

expecting success: 
	(cd local &&
	git checkout master &&
	git tag -s -m signed-tag signed-tag-2 &&
	GIT_REMOTE_TESTGIT_SIGNED_TAGS=1 git push origin signed-tag-2
	) &&
	compare_refs local signed-tag-2 server signed-tag-2

Already on 'master'
Your branch is up-to-date with 'origin/master'.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5900-repo-selection/foo/.git/
[master (root-commit) 0110758] add submodules
 Author: A U Thor <author@example.com>
 3 files changed, 8 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 ext-module
 create mode 160000 ssh-module
ok 3 - setup repository with submodules

expecting success: 
	test_must_fail git clone --recurse-submodules . dst

Cloning into 'dst'...
[master (root-commit) ddd63c9] foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo.t
done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5900-repo-selection/foo.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5900-repo-selection/fetch/
From ../foo
 * branch            HEAD       -> FETCH_HEAD
To testgit::/«PKGBUILDDIR»/t/trash directory.t5801-remote-helpers/server
 * [new tag]         signed-tag-2 -> signed-tag-2
Cloning into 'clone'...
Submodule 'ext-module' (ext::fake-remote %S repo.git) registered for path 'ext-module'
ok 22 - push signed tag with signed-tags capability

expecting success: 
	(cd local &&
	git checkout -b update master &&
	echo update >>file &&
	git commit -a -m update &&
	git push origin update &&
	git rev-parse --verify remotes/origin/update >expect &&
	git rev-parse --verify testgit/origin/heads/update >actual &&
	test_cmp expect actual
	)

done.
Switched to a new branch 'update'
fatal: reference is not a tree: 0123456789012345678901234567890123456789
Unable to checkout '0123456789012345678901234567890123456789' in submodule path 'sub1'
[update b452f80] update
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Submodule 'ssh-module' (remote:repo.git) registered for path 'ssh-module'
ok 4 - prefer worktree foo over bare foo.git

expecting success: 
	reset &&
	make_bare foo &&
	make_bare foo.git &&
	get foo &&
	check foo

ok 13 - git_pull: 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
		)
	
Cloning into 'ext-module'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5900-repo-selection/foo/
fatal: transport 'ext' not allowed
Clone of 'ext::fake-remote %S repo.git' into submodule path 'ext-module' failed
ok 4 - clone with recurse-submodules fails

expecting success: 
	rm -rf dst &&
	git clone . dst &&
	git -C dst submodule init

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5900-repo-selection/foo.git/
Cloning into 'dst'...
To testgit::/«PKGBUILDDIR»/t/trash directory.t5801-remote-helpers/server
 * [new branch]      update -> update
Cloning into 'submodule_update'...
done.
ok 23 - push update refs

expecting success: 
	(cd local &&
	echo more-update >>file &&
	git commit -a -m more-update &&
	git rev-parse --verify testgit/origin/heads/update >expect &&
	GIT_REMOTE_TESTGIT_NO_PRIVATE_UPDATE=t git push origin update &&
	git rev-parse --verify testgit/origin/heads/update >actual &&
	test_cmp expect actual
	)

done.
[update f711f22] more-update
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5900-repo-selection/fetch/
Switched to a new branch 'invalid_sub1'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
From ../foo
 * branch            HEAD       -> FETCH_HEAD
fatal: Needed a single revision
Cloning into 'clone'...
Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
Deleted branch valid_sub1 (was 1ca87d6).
done.
Switched to a new branch 'valid_sub1'
Submodule 'ext-module' (ext::fake-remote %S repo.git) registered for path 'ext-module'
Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
To testgit::/«PKGBUILDDIR»/t/trash directory.t5801-remote-helpers/server
   b452f80..f711f22  update -> update
ok 5 - prefer bare foo over bare foo.git

expecting success: 
	reset &&
	make_bare foo &&
	make_bare foo.git &&
	get foo.git &&
	check foo.git

ok 24 - push update refs disabled by no-private-update

expecting success: 
	(cd local &&
	git checkout update &&
	echo "update fail" >>file &&
	git commit -a -m "update fail" &&
	git rev-parse --verify testgit/origin/heads/update >expect &&
	test_expect_code 1 env GIT_REMOTE_TESTGIT_FAILURE="non-fast forward" \
		git push origin update &&
	git rev-parse --verify testgit/origin/heads/update >actual &&
	test_cmp expect actual
	)

Already on 'update'
Submodule 'ssh-module' (remote:repo.git) registered for path 'ssh-module'
ok 5 - setup individual updates

expecting success: 
	git -C dst submodule update ssh-module

[update 46836a0] update fail
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5900-repo-selection/foo/
Updating e730a90..1ca87d6
Fast-forward
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5900-repo-selection/foo.git/
error: failed to push some refs to 'testgit::/«PKGBUILDDIR»/t/trash directory.t5801-remote-helpers/server'
ok 25 - push update refs failure

expecting success: 
	(cd local &&
	test_must_fail env GIT_REMOTE_TESTGIT_FAILURE=1 git fetch 2>error &&
	cat error &&
	grep -q "Error while running fast-import" error
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5900-repo-selection/fetch/
Cloning into 'ssh-module'...
fatal: stream ends early
fast-import: dumping crash report to .git/fast_import_crash_13440
fatal: Error while running fast-import
ssh: remote git-upload-pack 'repo.git'
ok 26 - proper failure checks for fetching

expecting success: 
	(cd local &&
	git checkout -b crash master &&
	echo crash >>file &&
	git commit -a -m crash &&
	test_must_fail env GIT_REMOTE_TESTGIT_FAILURE=1 git push --all &&
	cmp_marks origin
	)

Switched to a new branch 'crash'
From ../foo
 * branch            HEAD       -> FETCH_HEAD
Cloning into 'clone'...
[crash 0c6435c] crash
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
done.
ok 6 - disambiguate with full foo.git

expecting success: 
	reset &&
	make_bare foo.git &&
	mkdir foo &&
	get foo &&
	check foo.git

error: failed to push some refs to 'testgit::/«PKGBUILDDIR»/t/trash directory.t5801-remote-helpers/server'
ok 27 - proper failure checks for pushing

expecting success: 
	(cd local &&
	git checkout -b new_branch master &&
	echo new >>file &&
	git commit -a -m new &&
	git push origin new_branch &&
	git fetch origin &&
	echo new >>file &&
	git commit -a -m new &&
	git push origin new_branch 2> msg &&
	! grep "\[new branch\]" msg
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5900-repo-selection/foo.git/
Cloning into 'sub1'...
Switched to a new branch 'new_branch'
[new_branch af9efd2] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
done.
Submodule path 'ssh-module': checked out 'd79ce1670bdcb76e6d1da2ae095e890ccb326ae9'
ok 6 - update of ssh allowed

expecting success: 
	test_must_fail git -C dst submodule update ext-module

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5900-repo-selection/fetch/
From ../foo
 * branch            HEAD       -> FETCH_HEAD
Cloning into 'clone'...
done.
To testgit::/«PKGBUILDDIR»/t/trash directory.t5801-remote-helpers/server
 * [new branch]      new_branch -> new_branch
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
ok 7 - we are not fooled by non-git foo directory

expecting success: 
	reset &&
	make_tree foo &&
	make_bare foo.git &&
	mv foo/.git foo.git &&
	get foo.git &&
	check foo

Cloning into 'ext-module'...
fatal: transport 'ext' not allowed
Clone of 'ext::fake-remote %S repo.git' into submodule path 'ext-module' failed
ok 7 - update of ext not allowed

expecting success: 
	GIT_ALLOW_PROTOCOL=ext git -C dst submodule update ext-module

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5900-repo-selection/foo/.git/
[master (root-commit) ddd63c9] foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo.t
ok 14 - git_pull: 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
		)
	
[new_branch 6265eb5] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5900-repo-selection/foo.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t5900-repo-selection/fetch/
Cloning into 'submodule_update'...
Cloning into 'ext-module'...
done.
fake-remote: git-upload-pack repo.git
From ../foo
 * branch            HEAD       -> FETCH_HEAD
Cloning into 'clone'...
Switched to a new branch 'no_submodule'
ok 28 - push messages

expecting success: 
	(cd server &&
	git checkout master &&
	echo more >>file &&
	git commit -a -m more
	) &&
	(cd local &&
	git fetch origin HEAD
	) &&
	compare_refs server HEAD local FETCH_HEAD

Branch no_submodule set up to track remote branch no_submodule from origin.
done.
Switched to branch 'master'
[master 9e51cec] more
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Deleted branch add_sub1 (was 041e421).
ok 8 - prefer inner .git over outer bare

# passed all 8 test(s)
1..8
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
*** t6000-rev-list-misc.sh ***
Updating aca6d60..041e421
Fast-forward
Submodule path 'ext-module': checked out 'd79ce1670bdcb76e6d1da2ae095e890ccb326ae9'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6000-rev-list-misc/.git/
ok 8 - user can override whitelist

# passed all 8 test(s)
1..8
expecting success: 
	echo content1 >wanted_file &&
	echo content2 >unwanted_file &&
	git add wanted_file unwanted_file &&
	git commit -m one

 .gitmodules | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
From testgit::/«PKGBUILDDIR»/t/trash directory.t5801-remote-helpers/server
 * branch            HEAD       -> FETCH_HEAD
ok 29 - fetch HEAD

expecting success: 
	(cd server &&
	git checkout master &&
	echo more >>file &&
	git commit -a -m more
	) &&
	(cd local &&
	git fetch "testgit::${PWD}/../server"
	) &&
	compare_refs server HEAD local FETCH_HEAD

[master (root-commit) ca94dd0] one
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 unwanted_file
 create mode 100644 wanted_file
ok 1 - setup

expecting success: 
	git rev-list --objects HEAD -- wanted_file >output &&
	grep wanted_file output &&
	! grep unwanted_file output

Already on 'master'
ac3e272b72bbf89def8657766b855d0656630ed4 wanted_file
[master 9700ae8] more
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 2 - rev-list --objects heeds pathspecs

expecting success: 
	mkdir foo &&
	>foo/file &&
	git add foo/file &&
	git commit -m two &&

	git rev-list --objects HEAD -- foo >output &&
	grep foo/file output &&

	git rev-list --objects HEAD -- foo/file >output &&
	grep foo/file output &&
	! grep unwanted_file output

[master b9a056b] two
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 foo/file
*** t6001-rev-list-graft.sh ***
e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 foo/file
e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 foo/file
ok 3 - rev-list --objects with pathspecs and deeper paths

expecting success: 
	git checkout --orphan junio-testcase &&
	git rm -rf . &&

	mkdir two &&
	echo frotz >one &&
	cp one two/three &&
	git add one two/three &&
	test_tick &&
	git commit -m that &&

	ONE=$(git rev-parse HEAD:one) &&
	git rev-list --objects HEAD two >output &&
	grep "$ONE two/three" output &&
	! grep one output

Switched to a new branch 'junio-testcase'
rm 'foo/file'
rm 'unwanted_file'
rm 'wanted_file'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6001-rev-list-graft/.git/
expecting success: 
	mkdir subdir &&
	echo >fileA fileA &&
	echo >subdir/fileB fileB &&
	git add fileA subdir/fileB &&
	git commit -a -m "Initial in one history." &&
	A0=`git rev-parse --verify HEAD` &&

	echo >fileA fileA modified &&
	git commit -a -m "Second in one history." &&
	A1=`git rev-parse --verify HEAD` &&

	echo >subdir/fileB fileB modified &&
	git commit -a -m "Third in one history." &&
	A2=`git rev-parse --verify HEAD` &&

	rm -f .git/refs/heads/master .git/index &&

	echo >fileA fileA again &&
	echo >subdir/fileB fileB again &&
	git add fileA subdir/fileB &&
	git commit -a -m "Initial in alternate history." &&
	B0=`git rev-parse --verify HEAD` &&

	echo >fileA fileA modified in alternate history &&
	git commit -a -m "Second in alternate history." &&
	B1=`git rev-parse --verify HEAD` &&

	echo >subdir/fileB fileB modified in alternate history &&
	git commit -a -m "Third in alternate history." &&
	B2=`git rev-parse --verify HEAD` &&
	: done

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
[junio-testcase (root-commit) f0a247c] that
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 one
 create mode 100644 two/three
From testgit::/«PKGBUILDDIR»/t/trash directory.t5801-remote-helpers/local/../server
 * branch            HEAD       -> FETCH_HEAD
[master (root-commit) e02d943] Initial in one history.
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 fileA
 create mode 100644 subdir/fileB
8e4020bb5a8d8c873b25de15933e75cc0fc275df two/three
ok 4 - rev-list --objects with pathspecs and copied files

expecting success: 
	git commit --allow-empty -m another &&
	git tag -a -m "annotated" v1.0 &&
	git rev-list --objects ^v1.0^ v1.0 >expect &&
	git rev-list --objects v1.0^..v1.0 >actual &&
	test_cmp expect actual

ok 30 - fetch url

[junio-testcase a6c6deb] another
 Author: A U Thor <author@example.com>
# still have 1 known breakage(s)
[master d226bb0] Second in one history.
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
# passed all remaining 29 test(s)
1..30
Cloning into 'sub1'...
[master 2e29152] Third in one history.
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 5 - rev-list A..B and rev-list ^A B are the same

expecting success: 
	git rev-list --objects ^HEAD^{tree} HEAD^{tree} >actual &&
	>expect &&
	test_cmp expect actual

ok 6 - propagate uninteresting flag down correctly

expecting success: 
	git log --format="%m %s" --left-right v1.0...master >actual &&
	cat >expect <<-\EOF &&
	> two
	> one
	< another
	< that
	EOF
	test_cmp expect actual

done.
ok 7 - symleft flag bit is propagated down from tag

expecting success: 
	# Of the blobs and trees in the index, note:
	#
	#   - we do not show two/three, because it is the
	#     same blob as "one", and we show objects only once
	#
	#   - we do show the tree "two", because it has a valid cache tree
	#     from the last commit
	#
	#   - we do not show the root tree; since we updated the index, it
	#     does not have a valid cache tree
	#
	cat >expect <<-\EOF &&
	8e4020bb5a8d8c873b25de15933e75cc0fc275df one
	d9d3a7417b9605cfd88ee6306b28dadc29e6ab08 only-in-index
	9200b628cf9dc883a85a7abc8d6e6730baee589c two
	EOF
	echo only-in-index >only-in-index &&
	git add only-in-index &&
	git rev-list --objects --indexed-objects >actual &&
	test_cmp expect actual

[master (root-commit) e4333d0] Initial in alternate history.
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 fileA
 create mode 100644 subdir/fileB
ok 8 - rev-list can show index objects

expecting success: 
	test_must_fail git rev-list --bisect --first-parent HEAD

fatal: --first-parent is incompatible with --bisect
ok 9 - --bisect and --first-parent can not be combined

# passed all 9 test(s)
1..9
[master a39b7a4] Second in alternate history.
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
*** t6002-rev-list-bisect.sh ***
[master 12b4630] Third in alternate history.
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
*** t6003-rev-list-topo-order.sh ***
ok 1 - setup

expecting success: 
		rm -f .git/info/grafts &&
		check basic 12b4630499b43ab0e861135ebac9dc35c7a0e40c -- 12b4630499b43ab0e861135ebac9dc35c7a0e40c a39b7a45794da67fa3299db2336b8502c01eedf9 e4333d0f62f04a3ed2233742e95b394e70eb39ac
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6002-rev-list-bisect/.git/
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
ok 2 - without grafts

expecting success: 
		echo 'e4333d0f62f04a3ed2233742e95b394e70eb39ac 2e29152862ae22e05ea1d795fd3de4c9d9a763f1' >.git/info/grafts &&
		check basic 12b4630499b43ab0e861135ebac9dc35c7a0e40c -- 12b4630499b43ab0e861135ebac9dc35c7a0e40c a39b7a45794da67fa3299db2336b8502c01eedf9 e4333d0f62f04a3ed2233742e95b394e70eb39ac 2e29152862ae22e05ea1d795fd3de4c9d9a763f1 d226bb0c73eb9216a81fe560ac79a424d9e77dba e02d9437fe2ad826e807ad601e9cc63835508ee9
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6003-rev-list-topo-order/.git/
ok 3 - with grafts

expecting success: 
		rm -f .git/info/grafts &&
		check basic 12b4630499b43ab0e861135ebac9dc35c7a0e40c subdir -- 12b4630499b43ab0e861135ebac9dc35c7a0e40c e4333d0f62f04a3ed2233742e95b394e70eb39ac
	
ok 4 - without grafts, with pathlimit

expecting success: 
		echo 'e4333d0f62f04a3ed2233742e95b394e70eb39ac 2e29152862ae22e05ea1d795fd3de4c9d9a763f1' >.git/info/grafts &&
		check basic 12b4630499b43ab0e861135ebac9dc35c7a0e40c subdir -- 12b4630499b43ab0e861135ebac9dc35c7a0e40c e4333d0f62f04a3ed2233742e95b394e70eb39ac 2e29152862ae22e05ea1d795fd3de4c9d9a763f1 e02d9437fe2ad826e807ad601e9cc63835508ee9
	
ok 5 - with grafts, with pathlimit

expecting success: 
		rm -f .git/info/grafts &&
		check parents 12b4630499b43ab0e861135ebac9dc35c7a0e40c -- 12b4630499b43ab0e861135ebac9dc35c7a0e40c a39b7a45794da67fa3299db2336b8502c01eedf9 e4333d0f62f04a3ed2233742e95b394e70eb39ac
	
ok 6 - without grafts

expecting success: 
		echo 'e4333d0f62f04a3ed2233742e95b394e70eb39ac 2e29152862ae22e05ea1d795fd3de4c9d9a763f1' >.git/info/grafts &&
		check parents 12b4630499b43ab0e861135ebac9dc35c7a0e40c -- 12b4630499b43ab0e861135ebac9dc35c7a0e40c a39b7a45794da67fa3299db2336b8502c01eedf9 e4333d0f62f04a3ed2233742e95b394e70eb39ac 2e29152862ae22e05ea1d795fd3de4c9d9a763f1 d226bb0c73eb9216a81fe560ac79a424d9e77dba e02d9437fe2ad826e807ad601e9cc63835508ee9
	
ok 15 - git_pull_ff: 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 7 - with grafts

expecting success: 
		rm -f .git/info/grafts &&
		check parents 12b4630499b43ab0e861135ebac9dc35c7a0e40c subdir -- 12b4630499b43ab0e861135ebac9dc35c7a0e40c e4333d0f62f04a3ed2233742e95b394e70eb39ac
	
ok 8 - without grafts, with pathlimit

expecting success: 
		echo 'e4333d0f62f04a3ed2233742e95b394e70eb39ac 2e29152862ae22e05ea1d795fd3de4c9d9a763f1' >.git/info/grafts &&
		check parents 12b4630499b43ab0e861135ebac9dc35c7a0e40c subdir -- 12b4630499b43ab0e861135ebac9dc35c7a0e40c e4333d0f62f04a3ed2233742e95b394e70eb39ac 2e29152862ae22e05ea1d795fd3de4c9d9a763f1 e02d9437fe2ad826e807ad601e9cc63835508ee9
	
ok 9 - with grafts, with pathlimit

expecting success: 
		rm -f .git/info/grafts &&
		check parents-raw 12b4630499b43ab0e861135ebac9dc35c7a0e40c -- 12b4630499b43ab0e861135ebac9dc35c7a0e40c a39b7a45794da67fa3299db2336b8502c01eedf9 e4333d0f62f04a3ed2233742e95b394e70eb39ac
	
Cloning into 'submodule_update'...
ok 10 - without grafts

expecting success: 
		echo 'e4333d0f62f04a3ed2233742e95b394e70eb39ac 2e29152862ae22e05ea1d795fd3de4c9d9a763f1' >.git/info/grafts &&
		check parents-raw 12b4630499b43ab0e861135ebac9dc35c7a0e40c -- 12b4630499b43ab0e861135ebac9dc35c7a0e40c a39b7a45794da67fa3299db2336b8502c01eedf9 e4333d0f62f04a3ed2233742e95b394e70eb39ac 2e29152862ae22e05ea1d795fd3de4c9d9a763f1 d226bb0c73eb9216a81fe560ac79a424d9e77dba e02d9437fe2ad826e807ad601e9cc63835508ee9
	
ok 11 - with grafts

expecting success: 
		rm -f .git/info/grafts &&
		check parents-raw 12b4630499b43ab0e861135ebac9dc35c7a0e40c subdir -- 12b4630499b43ab0e861135ebac9dc35c7a0e40c e4333d0f62f04a3ed2233742e95b394e70eb39ac
	
done.
ok 12 - without grafts, with pathlimit

expecting success: 
		echo 'e4333d0f62f04a3ed2233742e95b394e70eb39ac 2e29152862ae22e05ea1d795fd3de4c9d9a763f1' >.git/info/grafts &&
		check parents-raw 12b4630499b43ab0e861135ebac9dc35c7a0e40c subdir -- 12b4630499b43ab0e861135ebac9dc35c7a0e40c e4333d0f62f04a3ed2233742e95b394e70eb39ac 2e29152862ae22e05ea1d795fd3de4c9d9a763f1 e02d9437fe2ad826e807ad601e9cc63835508ee9
	
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
ok 13 - with grafts, with pathlimit

# passed all 13 test(s)
1..13
Branch add_sub1 set up to track remote branch add_sub1 from origin.
*** t6004-rev-list-path-optim.sh ***
Deleted branch add_sub1 (was 041e421).
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6004-rev-list-path-optim/.git/
expecting success: 
	echo Hello >a &&
	mkdir d &&
	echo World >d/f &&
	echo World >d/z &&
	git add a d &&
	test_tick &&
	git commit -m "Initial commit" &&
	git rev-parse --verify HEAD &&
	git tag initial

[master (root-commit) 5c8df84] Initial commit
 Author: A U Thor <author@example.com>
 3 files changed, 3 insertions(+)
 create mode 100644 a
 create mode 100644 d/f
 create mode 100644 d/z
5c8df8481b8e4f419cc2268f5e68a10e349bbe37
Updating aca6d60..041e421
Fast-forward
ok 1 - setup

expecting success: 
	test_tick &&
	commit=$(echo "Unchanged tree" | git commit-tree "HEAD^{tree}" -p HEAD) &&
	test $(git rev-list $commit | wc -l) = 2 &&
	test $(git rev-list $commit -- . | wc -l) = 1

 .gitmodules | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
ok 2 - path-optimization

expecting success: 
	git checkout -b side &&
	echo Irrelevant >c &&
	echo Irrelevant >d/f &&
	git add c d/f &&
	test_tick &&
	git commit -m "Side makes an irrelevant commit" &&
	git tag side_c0 &&
	echo "More Irrelevancy" >c &&
	git add c &&
	test_tick &&
	git commit -m "Side makes another irrelevant commit" &&
	echo Bye >a &&
	git add a &&
	test_tick &&
	git commit -m "Side touches a" &&
	git tag side_a1 &&
	echo "Yet more Irrelevancy" >c &&
	git add c &&
	test_tick &&
	git commit -m "Side makes yet another irrelevant commit" &&
	git checkout master &&
	echo Another >b &&
	echo Munged >d/z &&
	git add b d/z &&
	test_tick &&
	git commit -m "Master touches b" &&
	git tag master_b0 &&
	git merge side &&
	echo Touched >b &&
	git add b &&
	test_tick &&
	git commit -m "Master touches b again"

Switched to a new branch 'side'
[side d02d707] Side makes an irrelevant commit
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 c
[side 381f63c] Side makes another irrelevant commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[side e8cf16f] Side touches a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
[side edbc4dc] Side makes yet another irrelevant commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to branch 'master'
[master 4417088] Master touches b
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 b
Cloning into 'sub1'...
Merging:
4417088 Master touches b
virtual side
found 1 common ancestor:
5c8df84 Initial commit
Merge made by the 'recursive' strategy.
 a   | 2 +-
 c   | 1 +
 d/f | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)
 create mode 100644 c
done.
[master 6a8c990] Master touches b again
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 3 - further setup

expecting success: 
	git rev-parse side_a1 initial >expected &&
	git rev-list HEAD -- a >actual &&
	test_cmp expected actual

ok 4 - path optimization 2

expecting success: 
	git rev-parse master^ master_b0 side_c0 initial >expected &&
	git rev-list HEAD -- d >actual &&
	test_cmp expected actual

ok 5 - pathspec with leading path

expecting success: 
	git rev-parse master^ master_b0 side_c0 initial >expected &&
	git rev-list HEAD -- "d/*" >actual &&
	test_cmp expected actual

ok 6 - pathspec with glob (1)

expecting success: 
	git rev-parse side_c0 initial >expected &&
	git rev-list HEAD -- "d/[a-m]*" >actual &&
	test_cmp expected actual

Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
ok 7 - pathspec with glob (2)

# passed all 7 test(s)
1..7
*** t6005-rev-list-count.sh ***
ok 16 - git_pull_ff: 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.t6005-rev-list-count/.git/
expecting success: 
    for n in 1 2 3 4 5 ; do \
        echo $n > a ; \
        git add a ; \
        git commit -m "$n" ; \
    done

[master (root-commit) 5b082c6] 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a
Cloning into 'submodule_update'...
[master bdf945c] 2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 9caf9a3] 3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
done.
[master 1019e9c] 4
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
[master ed04753] 5
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - setup

expecting success: 
    test $(git rev-list HEAD | wc -l) = 5

ok 2 - no options

expecting success: 
    test $(git rev-list HEAD --max-count=0 | wc -l) = 0 &&
    test $(git rev-list HEAD --max-count=3 | wc -l) = 3 &&
    test $(git rev-list HEAD --max-count=5 | wc -l) = 5 &&
    test $(git rev-list HEAD --max-count=10 | wc -l) = 5

Branch add_sub1 set up to track remote branch add_sub1 from origin.
Deleted branch add_sub1 (was 041e421).
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 3 - --max-count

expecting success: 
    test $(git rev-list HEAD --max-count=1 | wc -l) = 1 &&
    test $(git rev-list HEAD -1 | wc -l) = 1 &&
    test $(git rev-list HEAD -n1 | wc -l) = 1 &&
    test $(git rev-list HEAD -n 1 | wc -l) = 1

ok 4 - --max-count all forms

expecting success: 
    test $(git rev-list HEAD --skip=0 | wc -l) = 5 &&
    test $(git rev-list HEAD --skip=3 | wc -l) = 2 &&
    test $(git rev-list HEAD --skip=5 | wc -l) = 0 &&
    test $(git rev-list HEAD --skip=10 | wc -l) = 0

error: The following untracked working tree files would be overwritten by merge:
	sub1
Please move or remove them before you can merge.
Aborting
Updating aca6d60..041e421
ok 5 - --skip

expecting success: 
    test $(git rev-list HEAD --skip=0 --max-count=0 | wc -l) = 0 &&
    test $(git rev-list HEAD --skip=0 --max-count=10 | wc -l) = 5 &&
    test $(git rev-list HEAD --skip=3 --max-count=0 | wc -l) = 0 &&
    test $(git rev-list HEAD --skip=3 --max-count=1 | wc -l) = 1 &&
    test $(git rev-list HEAD --skip=3 --max-count=2 | wc -l) = 2 &&
    test $(git rev-list HEAD --skip=3 --max-count=10 | wc -l) = 2 &&
    test $(git rev-list HEAD --skip=5 --max-count=10 | wc -l) = 0 &&
    test $(git rev-list HEAD --skip=10 --max-count=10 | wc -l) = 0

ok 17 - git_pull_ff: 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
		)
	
expecting success: test $_bisect_err -le $_max_diff
ok 1 - bisection diff --bisect l0 ^root <= 0

Cloning into 'submodule_update'...
expecting success: test $_bisect_err -le $_max_diff
ok 2 - bisection diff --bisect l1 ^root <= 0

ok 6 - --skip --max-count

done.
# passed all 6 test(s)
1..6
expecting success: test $_bisect_err -le $_max_diff
ok 3 - bisection diff --bisect l2 ^root <= 0

*** t6006-rev-list-format.sh ***
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.
expecting success: test $_bisect_err -le $_max_diff
ok 4 - bisection diff --bisect a0 ^root <= 0

t5572-pull-submodule.sh: 159: cd: can't cd to sub1
Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6006-rev-list-format/.git/
expecting success: test $_bisect_err -le $_max_diff
ok 5 - bisection diff --bisect a1 ^root <= 0

Deleted branch replace_file_with_sub1 (was 1bf82f3).
Switched to a new branch 'replace_file_with_sub1'
Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
expecting success: 
	: >foo &&
	git add foo &&
	git config i18n.commitEncoding $test_encoding &&
	echo "$added_iso88591" | git commit -F - &&
	head1=$(git rev-parse --verify HEAD) &&
	head1_short=$(git rev-parse --verify --short $head1) &&
	tree1=$(git rev-parse --verify HEAD:) &&
	tree1_short=$(git rev-parse --verify --short $tree1) &&
	echo "$changed" > foo &&
	echo "$changed_iso88591" | git commit -a -F - &&
	head2=$(git rev-parse --verify HEAD) &&
	head2_short=$(git rev-parse --verify --short $head2) &&
	tree2=$(git rev-parse --verify HEAD:) &&
	tree2_short=$(git rev-parse --verify --short $tree2) &&
	git config --unset i18n.commitEncoding

expecting success: test $_bisect_err -le $_max_diff
ok 6 - bisection diff --bisect a2 ^root <= 0

 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 foo
expecting success: test $_bisect_err -le $_max_diff
ok 7 - bisection diff --bisect a3 ^root <= 0

Updating 88f15cf..1bf82f3
Fast-forward
expecting success: test $_bisect_err -le $_max_diff
ok 8 - bisection diff --bisect b1 ^root <= 0

 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 .gitmodules | 4 ++++
 sub1        | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)
 mode change 100644 => 160000 sub1
expecting success: check_output rev-list-has-correct-number-of-entries "git rev-list HEAD | wc -l | tr -d \" \""
ok 1 - rev-list has correct number of entries

expecting success: test $_bisect_err -le $_max_diff
ok 9 - bisection diff --bisect b2 ^root <= 0

expecting success: check_output simple-topo-order "git rev-list --topo-order  HEAD"
ok 1 - setup

expecting success: 
		git rev-list --pretty=format:'%%h' master >output.percent &&
		test_cmp expect.percent output.percent
	
ok 2 - format percent

ok 2 - simple topo order

expecting success: 
		git rev-list --pretty=format:'%H%n%h' master >output.hash &&
		test_cmp expect.hash output.hash
	
expecting success: test $_bisect_err -le $_max_diff
ok 10 - bisection diff --bisect b3 ^root <= 0

expecting success: check_output simple-date-order "git rev-list --date-order  HEAD"
ok 3 - format hash

expecting success: 
		git rev-list --pretty=format:'%T%n%t' master >output.tree &&
		test_cmp expect.tree output.tree
	
ok 3 - simple date order

ok 4 - format tree

expecting success: test $_bisect_err -le $_max_diff
ok 11 - bisection diff --bisect c1 ^root <= 0

expecting success: 
		git rev-list --pretty=format:'%P%n%p' master >output.parents &&
		test_cmp expect.parents output.parents
	
expecting success: check_output simple-author-date-order "git rev-list --author-date-order  HEAD"
ok 5 - format parents

expecting success: 
		git rev-list --pretty=format:'%an%n%ae%n%ad%n%aD%n%at' master >output.author &&
		test_cmp expect.author output.author
	
ok 6 - format author

expecting success: 
		git rev-list --pretty=format:'%cn%n%ce%n%cd%n%cD%n%ct' master >output.committer &&
		test_cmp expect.committer output.committer
	
expecting success: test $_bisect_err -le $_max_diff
ok 12 - bisection diff --bisect c2 ^root <= 0

ok 4 - simple author-date order

ok 7 - format committer

expecting success: 
		git rev-list --pretty=format:'%e' master >output.encoding &&
		test_cmp expect.encoding output.encoding
	
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
expecting success: check_output two-diamonds-topo-order-g6 "git rev-list --topo-order  g4"
ok 8 - format encoding

expecting success: test $_bisect_err -le $_max_diff
expecting success: 
		git rev-list --pretty=format:'%s' master >output.subject &&
		test_cmp expect.subject output.subject
	
ok 13 - bisection diff --bisect c3 ^root <= 0

ok 5 - two diamonds topo order (g6)

expecting success: check_output multiple-heads "git rev-list --topo-order a3 b3 c3"
ok 9 - format subject

expecting success: 
		git rev-list --pretty=format:'%<(20,trunc)%s' master >output.subject-truncated &&
		test_cmp expect.subject-truncated output.subject-truncated
	
expecting success: test $_bisect_err -le $_max_diff
ok 14 - bisection diff --bisect E ^F <= 0

ok 10 - format subject-truncated

expecting success: 
		git rev-list --pretty=format:'%b' master >output.body &&
		test_cmp expect.body output.body
	
ok 6 - multiple heads

ok 11 - format body
expecting success: check_output multiple-heads-prune-at-a1 "git rev-list --topo-order a3 b3 c3 ^a1"

expecting success: 
		git rev-list --pretty=format:'%B' master >output.raw-body &&
		test_cmp expect.raw-body output.raw-body
	
Cloning into 'sub1'...
ok 12 - format raw-body

expecting success: 
		git rev-list --pretty=format:'%Credfoo%Cgreenbar%Cbluebaz%Cresetxyzzy' master >output.colors &&
		test_cmp expect.colors output.colors
	
expecting success: test $_bisect_err -le $_max_diff
ok 15 - bisection diff --bisect e1 ^F <= 0

ok 7 - multiple heads, prune at a1

ok 13 - format colors

expecting success: check_output multiple-heads-prune-at-l1 "git rev-list --topo-order a3 b3 c3 ^l1"
expecting success: 
		git rev-list --pretty=format:'%C(red yellow bold)foo%C(reset)' master >output.advanced-colors &&
		test_cmp expect.advanced-colors output.advanced-colors
	
done.
ok 14 - format advanced-colors

expecting success: 
	git log --format=$AUTO_COLOR -1 >actual &&
	has_no_color actual

ok 8 - multiple heads, prune at l1

expecting success: test $_bisect_err -le $_max_diff
ok 16 - bisection diff --bisect e2 ^F <= 0

ok 15 - %C(auto) does not enable color by default

expecting success: 
	git -c color.diff=always log --format=$AUTO_COLOR -1 >actual &&
	has_color actual

expecting success: check_output cross-epoch-head-at-l5-prune-at-l1 "git rev-list --topo-order l5 ^l1"
ok 16 - %C(auto) enables colors for color.diff

expecting success: 
	git -c color.ui=always log --format=$AUTO_COLOR -1 >actual &&
	has_color actual

ok 9 - cross-epoch, head at l5, prune at l1

expecting success: test $_bisect_err -le $_max_diff
ok 17 - bisection diff --bisect e3 ^F <= 0

ok 17 - %C(auto) enables colors for color.ui

expecting success: 
	git log --format=$AUTO_COLOR -1 --color >actual &&
	has_color actual

expecting success: check_output duplicated-head-arguments "git rev-list --topo-order l5 l5 ^l1"
ok 18 - %C(auto) respects --color

expecting success: 
	git -c color.ui=always log --format=$AUTO_COLOR -1 --no-color >actual &&
	has_no_color actual

ok 19 - %C(auto) respects --no-color
ok 10 - duplicated head arguments


checking prerequisite: TTY

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	test_have_prereq PERL &&

	# Reading from the pty master seems to get stuck _sometimes_
	# on Mac OS X 10.5.0, using Perl 5.10.0 or 5.8.9.
	#
	# Reproduction recipe: run
	#
	#	i=0
	#	while ./test-terminal.perl echo hi $i
	#	do
	#		: $((i = $i + 1))
	#	done
	#
	# After 2000 iterations or so it hangs.
	# https://rt.cpan.org/Ticket/Display.html?id=65692
	#
	test "$(uname -s)" != Darwin &&

	perl "$TEST_DIRECTORY"/test-terminal.perl \
		sh -c "test -t 1 && test -t 2"

)
expecting success: test $_bisect_err -le $_max_diff
ok 18 - bisection diff --bisect e4 ^F <= 0

expecting success: check_output prune-near-topo "git rev-list --topo-order a4 ^c3"
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
ok 11 - prune near topo

expecting success: test $_bisect_err -le $_max_diff
ok 19 - bisection diff --bisect e5 ^F <= 0

expecting success: check_output head-has-no-parent "git rev-list --topo-order  root"
ok 12 - head has no parent

expecting success: check_output two-nodes-one-head-one-base "git rev-list --topo-order  l0"
expecting success: test $_bisect_err -le $_max_diff
ok 20 - bisection diff --bisect e6 ^F <= 0

ok 13 - two nodes - one head, one base

expecting success: check_output three-nodes-one-head-one-internal-one-base "git rev-list --topo-order  l1"
expecting success: test $_bisect_err -le $_max_diff
ok 21 - bisection diff --bisect e7 ^F <= 0

ok 18 - git_pull_ff: 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
		)
	
ok 14 - three nodes one head, one internal, one base

expecting success: check_output linear-prune-l2-root "git rev-list --topo-order  l2 ^root"
expecting success: test $_bisect_err -le $_max_diff
ok 22 - bisection diff --bisect f1 ^F <= 0

ok 15 - linear prune l2 ^root

expecting success: check_output linear-prune-l2-l0 "git rev-list --topo-order  l2 ^l0"
Cloning into 'submodule_update'...
expecting success: test $_bisect_err -le $_max_diff
ok 23 - bisection diff --bisect f2 ^F <= 0

ok 16 - linear prune l2 ^l0

expecting success: check_output linear-prune-l2-l1 "git rev-list --topo-order  l2 ^l1"
prerequisite TTY ok
expecting success: 
	test_terminal env TERM=vt100 \
		git log --format=$AUTO_COLOR -1 --color=auto >actual &&
	has_color actual

ok 17 - linear prune l2 ^l1

expecting success: test $_bisect_err -le $_max_diff
done.
ok 24 - bisection diff --bisect f3 ^F <= 0

expecting success: check_output linear-prune-l5-a4 "git rev-list --topo-order  l5 ^a4"
ok 18 - linear prune l5 ^a4

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.
expecting success: check_output linear-prune-l5-l3 "git rev-list --topo-order  l5 ^l3"
expecting success: test $_bisect_err -le $_max_diff
ok 25 - bisection diff --bisect f4 ^F <= 0

error: 8ed2e6719f8484ce01fa3ce133fe42d25c2441b8^{commit}: expected commit type, but the object dereferences to tree type
fatal: Needed a single revision
ok 19 - linear prune l5 ^l3

expecting success: check_output linear-prune-l5-l4 "git rev-list --topo-order  l5 ^l4"
Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
Deleted branch replace_directory_with_sub1 (was 99dcd27).
ok 20 - linear prune l5 ^l4

expecting success: test $_bisect_err -le $_max_diff
ok 26 - bisection diff --bisect E ^F <= 0

Switched to a new branch 'replace_directory_with_sub1'
expecting success: check_output max-count-10-topo-order "git rev-list --topo-order  --max-count=10 l5"
Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
ok 21 - max-count 10 - topo order

expecting success: test $_bisect_err -le $_max_diff
ok 27 - bisection diff --bisect V ^U <= 1

expecting success: check_output max-count-10-non-topo-order "git rev-list --max-count=10 l5"
ok 22 - max-count 10 - non topo order

expecting success: test $_bisect_err -le $_max_diff
ok 28 - bisection diff --bisect V ^U ^u1 ^u2 ^u3 <= 0

Updating 48ceb4d..99dcd27
Fast-forward
expecting success: check_output max-age-c3-no-topo-order "git rev-list --max-age=51148811 l5"
 .gitmodules | 4 ++++
 sub1/file1  | 1 -
 sub1/file2  | 1 -
 sub1/file3  | 1 -
 4 files changed, 4 insertions(+), 3 deletions(-)
 delete mode 100644 sub1/file1
 delete mode 100644 sub1/file2
 delete mode 100644 sub1/file3
expecting success: test $_bisect_err -le $_max_diff
ok 23 - --max-age=c3, no --topo-order

ok 29 - bisection diff --bisect u1 ^U <= 0

expecting success: check_output one-specified-head-reachable-from-another-a4-c3-topo-order "list_duplicates git rev-list --topo-order a4 c3"
ok 24 - one specified head reachable from another a4, c3, --topo-order

expecting success: test $_bisect_err -le $_max_diff
ok 30 - bisection diff --bisect u2 ^U <= 0

ok 20 - %C(auto) respects --color=auto (stdout is tty)

expecting success: 
	(
		TERM=vt100 && export TERM &&
		git log --format=$AUTO_COLOR -1 --color=auto >actual &&
		has_no_color actual
	)

expecting success: check_output one-specified-head-reachable-from-another-c3-a4-topo-order "list_duplicates git rev-list --topo-order c3 a4"
ok 21 - %C(auto) respects --color=auto (stdout not tty)

expecting success: 
	git config i18n.commitencoding $test_encoding &&
	echo change2 >foo && git commit -a -F commit-msg &&
	head3=$(git rev-parse --verify HEAD) &&
	head3_short=$(git rev-parse --short $head3)

ok 25 - one specified head reachable from another c3, a4, --topo-order

expecting success: test $_bisect_err -le $_max_diff
ok 31 - bisection diff --bisect u3 ^U <= 0

expecting success: check_output one-specified-head-reachable-from-another-a4-c3-no-topo-order "list_duplicates git rev-list a4 c3"
[master 79c1a11] Test printing of complex bodies
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 26 - one specified head reachable from another a4, c3, no --topo-order

ok 22 - setup complex body

expecting success: 
		git rev-list --pretty=format:'%e' master >output.complex-encoding &&
		test_cmp expect.complex-encoding output.complex-encoding
	
expecting success: test $_bisect_err -le $_max_diff
ok 32 - bisection diff --bisect u4 ^U <= 0

expecting success: check_output one-specified-head-reachable-from-another-c3-a4-no-topo-order "list_duplicates git rev-list c3 a4"
ok 23 - format complex-encoding

expecting success: 
		git rev-list --pretty=format:'%s' master >output.complex-subject &&
		test_cmp expect.complex-subject output.complex-subject
	
ok 27 - one specified head reachable from another c3, a4, no --topo-order

ok 24 - format complex-subject

expecting success: 
		git rev-list --pretty=format:'%<(20,trunc)%s' master >output.complex-subject-trunc &&
		test_cmp expect.complex-subject-trunc output.complex-subject-trunc
	
expecting success: test $_bisect_err -le $_max_diff
ok 33 - bisection diff --bisect u5 ^U <= 0

expecting success: check_output graph-with-c3-and-a4-parents-of-head "list_duplicates git rev-list m1"
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
expecting success: check_output bisect-l5-root "git rev-list $_bisect_option l5 ^root"
ok 25 - format complex-subject-trunc

expecting success: 
		git rev-list --pretty=format:'%<(20,mtrunc)%s' master >output.complex-subject-mtrunc &&
		test_cmp expect.complex-subject-mtrunc output.complex-subject-mtrunc
	
ok 28 - graph with c3 and a4 parents of head

ok 34 - --bisect l5 ^root

ok 26 - format complex-subject-mtrunc

expecting success: check_output graph-with-a4-and-c3-parents-of-head "list_duplicates git rev-list m2"
expecting success: 
		git rev-list --pretty=format:'%<(20,ltrunc)%s' master >output.complex-subject-ltrunc &&
		test_cmp expect.complex-subject-ltrunc output.complex-subject-ltrunc
	
expecting success: check_output bisect-l5-root-c3 "git rev-list $_bisect_option l5 ^root ^c3"
ok 27 - format complex-subject-ltrunc

expecting success: 
	cat <<-EOF >expected.utf-8 &&
	commit $head3
	This commit message is much longer than the others,
	and it will be encoded in $test_encoding. We should therefore
	include an ISO8859 character: ¡bueno!

	commit $head2
	commit $head1
	EOF
	iconv -f utf-8 -t $test_encoding expected.utf-8 >expected.ISO8859-1

ok 29 - graph with a4 and c3 parents of head

expecting success: git rev-list --topo-order  a3 ^a3
ok 28 - prepare expected messages (for test %b)

expecting success: 
		git rev-list --pretty=format:'%b' master >output.complex-body &&
		test_cmp expect.complex-body output.complex-body
	
ok 30 - head ^head --topo-order

ok 35 - --bisect l5 ^root ^c3

expecting success: git rev-list a3 ^a3
expecting success: check_output bisect-l5-root-c3-b4 "git rev-list $_bisect_option l5 ^c3 ^b4"
ok 31 - head ^head no --topo-order

ok 29 - format complex-body

Cloning into 'sub1'...
expecting success: 
		git rev-list --pretty=format:'%s' master >output.complex-subject-commitencoding-unset &&
		test_cmp expect.complex-subject-commitencoding-unset output.complex-subject-commitencoding-unset
	
expecting success: check_output simple-topo-order-l5r1 "git rev-list --topo-order  l5r1"
ok 36 - --bisect l5 ^root ^c3 ^b4

ok 30 - format complex-subject-commitencoding-unset

expecting success: 
		git rev-list --pretty=format:'%<(20,trunc)%s' master >output.complex-subject-commitencoding-unset-trunc &&
		test_cmp expect.complex-subject-commitencoding-unset-trunc output.complex-subject-commitencoding-unset-trunc
	
expecting success: check_output bisect-l3-root-c3-b4 "git rev-list $_bisect_option l3 ^root ^c3 ^b4"
ok 31 - format complex-subject-commitencoding-unset-trunc

expecting success: 
		git rev-list --pretty=format:'%<(20,mtrunc)%s' master >output.complex-subject-commitencoding-unset-mtrunc &&
		test_cmp expect.complex-subject-commitencoding-unset-mtrunc output.complex-subject-commitencoding-unset-mtrunc
	
ok 32 - simple topo order (l5r1)

done.
ok 37 - --bisect l3 ^root ^c3 ^b4

expecting success: check_output simple-topo-order-r1l5 "git rev-list --topo-order  r1l5"
expecting success: check_output bisect-l5-b3-a3-b4-a4 "git rev-list $_bisect_option l3 ^b3 ^a3 ^a4"
ok 32 - format complex-subject-commitencoding-unset-mtrunc

expecting success: 
		git rev-list --pretty=format:'%<(20,ltrunc)%s' master >output.complex-subject-commitencoding-unset-ltrunc &&
		test_cmp expect.complex-subject-commitencoding-unset-ltrunc output.complex-subject-commitencoding-unset-ltrunc
	
ok 38 - --bisect l5 ^b3 ^a3 ^b4 ^a4

ok 33 - format complex-subject-commitencoding-unset-ltrunc

expecting success: 
		git rev-list --pretty=format:'%b' master >output.complex-body-commitencoding-unset &&
		test_cmp expect.complex-body-commitencoding-unset output.complex-body-commitencoding-unset
	
ok 33 - simple topo order (r1l5)

expecting success: check_output bisect-l4-a2-a3-b-a4 "git rev-list $_bisect_option l4 ^a2 ^a3 ^a4"
ok 34 - format complex-body-commitencoding-unset

expecting success: 
	echo  >expect commit $head3 &&
	echo >>expect fooQbar &&
	git rev-list -1 --format=foo%x00bar HEAD >actual.nul &&
	nul_to_q <actual.nul >actual &&
	test_cmp expect actual

expecting success: check_output don-t-print-things-unreachable-from-one-branch "git rev-list a3 ^b3 --topo-order"
ok 39 - --bisect l4 ^a2 ^a3 ^b ^a4

ok 34 - don't print things unreachable from one branch
ok 35 - %x00 shows NUL


expecting success: 
	echo 2005-04-07 >expect.ad-short &&
	git log -1 --date=short --pretty=tformat:%ad >output.ad-short master &&
	test_cmp expect.ad-short output.ad-short

expecting success: check_output bisect-l3-a2-a3-b-a4 "git rev-list $_bisect_option l3 ^a2 ^a3 ^a4"
expecting success: check_output topo-order-a4-l3 "git rev-list --topo-order a4 l3"
ok 36 - %ad respects --date=

expecting success: 
	test_tick &&
	C=$(GIT_AUTHOR_EMAIL= git commit-tree HEAD^{tree} </dev/null) &&
	A=$(git show --pretty=format:%an,%ae,%ad%n -s $C) &&
	verbose test "$A" = "A U Thor,,Thu Apr 7 15:14:13 2005 -0700"

ok 40 - --bisect l3 ^a2 ^a3 ^b ^a4

Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
ok 37 - empty email

ok 35 - --topo-order a4 l3

expecting success: 
	git show -s --pretty=format:"%s%n%-b%nThanks%n" HEAD^^ >actual &&
	test_line_count = 2 actual

expecting success: check_output bisect-a4-a2-a3-b4 "git rev-list $_bisect_option a4 ^a2 ^a3 ^b4"
# passed all 35 test(s)
1..35
ok 38 - del LF before empty (1)

expecting success: 
	git show -s --pretty=format:"%s%n%-b%nThanks%n" HEAD >actual &&
	test_line_count = 6 actual &&
	grep "^$" actual

ok 41 - --bisect a4 ^a2 ^a3 ^b4

expecting success: check_output bisect-a4-a2-a3-b4-c2 "git rev-list $_bisect_option a4 ^a2 ^a3 ^b4 ^c2"

ok 39 - del LF before empty (2)

expecting success: 
	git show -s --pretty=format:"%s%+b%nThanks%n" HEAD^^ >actual &&
	test_line_count = 2 actual

ok 42 - --bisect a4 ^a2 ^a3 ^b4 ^c2

ok 40 - add LF before non-empty (1)

expecting success: 
	git show -s --pretty=format:"%s%+b%nThanks%n" HEAD >actual &&
	test_line_count = 6 actual &&
	grep "^$" actual

expecting success: check_output bisect-a4-a2-a3-b4-c2-c3 "git rev-list $_bisect_option a4 ^a2 ^a3 ^b4 ^c2 ^c3"
*** t6007-rev-list-cherry-pick-file.sh ***

ok 41 - add LF before non-empty (2)

expecting success: 
	git show -s --pretty=format:"%s% bThanks" HEAD^^ >actual &&
	test $(wc -w <actual) = 3

ok 43 - --bisect a4 ^a2 ^a3 ^b4 ^c2 ^c3

expecting success: check_output bisect-a4-a2-a3-b4 "git rev-list $_bisect_option a4 ^a2 ^a3 ^b4"
ok 19 - git_pull_ff: replace directory with submodule

ok 42 - add SP before non-empty (1)

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: 
	git show -s --pretty=format:"%s% sThanks" HEAD^^ >actual &&
	test $(wc -w <actual) = 6

ok 43 - add SP before non-empty (2)

expecting success: 
	echo SHORT SHORT SHORT >expect2 &&
	echo LONG LONG LONG >expect3 &&
	git log -1 --format="%h %h %h" HEAD >actual1 &&
	git log -1 --abbrev=5 --format="%h %h %h" HEAD >actual2 &&
	git log -1 --abbrev=5 --format="%H %H %H" HEAD >actual3 &&
	sed -e "s/$_x40/LONG/g" -e "s/$_x05/SHORT/g" <actual2 >fuzzy2 &&
	sed -e "s/$_x40/LONG/g" -e "s/$_x05/SHORT/g" <actual3 >fuzzy3 &&
	test_cmp expect2 fuzzy2 &&
	test_cmp expect3 fuzzy3 &&
	! test_cmp actual1 actual2

ok 44 - --bisect a4 ^a2 ^a3 ^b4

expecting success: check_output bisect-c3-a2-a3-b4-c2 "git rev-list $_bisect_option c3 ^a2 ^a3 ^b4 ^c2"
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6007-rev-list-cherry-pick-file/.git/
expecting success: 
	echo Hallo > foo &&
	git add foo &&
	test_tick &&
	git commit -m "A" &&
	git tag A &&
	git checkout -b branch &&
	echo Bello > foo &&
	echo Cello > bar &&
	git add foo bar &&
	test_tick &&
	git commit -m "C" &&
	git tag C &&
	echo Dello > bar &&
	git add bar &&
	test_tick &&
	git commit -m "E" &&
	git tag E &&
	git checkout master &&
	git checkout branch foo &&
	test_tick &&
	git commit -m "B" &&
	git tag B &&
	echo Cello > bar &&
	git add bar &&
	test_tick &&
	git commit -m "D" &&
	git tag D &&
	echo Nello > bar &&
	git add bar &&
	test_tick &&
	git commit -m "F" &&
	git tag F

ok 45 - --bisect c3 ^a2 ^a3 ^b4 ^c2

# passed all 45 test(s)
1..45
[master (root-commit) 87a5b85] A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
--- actual1	2015-12-16 11:01:50.493564859 +0000
+++ actual2	2015-12-16 11:01:50.537564859 +0000
@@ -1 +1 @@
-79c1a11 79c1a11 79c1a11
+79c1a 79c1a 79c1a
ok 44 - --abbrev

expecting success: 
	git log -1 --format=%H --abbrev-commit --abbrev=20 HEAD >actual &&
	len=$(wc -c <actual) &&
	test $len = 41

Cloning into 'submodule_update'...
ok 45 - %H is not affected by --abbrev-commit

expecting success: 
	git log -1 --format=%h --abbrev-commit --abbrev=20 HEAD >actual &&
	len=$(wc -c <actual) &&
	test $len = 21

Switched to a new branch 'branch'
ok 46 - %h is not affected by --abbrev-commit

expecting success: 
	git reflog >expect &&
	git log -g --format="%h %gD: %gs" >actual &&
	test_cmp expect actual

*** t6008-rev-list-submodule.sh ***
done.
[branch d81b112] C
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 bar
ok 47 - "%h %gD: %gs" is same as git-reflog

expecting success: 
	git reflog --date=raw >expect &&
	git log -g --format="%h %gD: %gs" --date=raw >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.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6008-rev-list-submodule/.git/
ok 48 - "%h %gD: %gs" is same as git-reflog (with date)

expecting success: 
	git reflog --abbrev=13 --date=raw >expect &&
	git log -g --abbrev=13 --format="%h %gD: %gs" --date=raw >actual &&
	test_cmp expect actual

[branch 50f946e] E
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
expecting success: 
	: > file &&
	git add file &&
	test_tick &&
	git commit -m initial &&
	echo 1 > file &&
	test_tick &&
	git commit -m second file &&
	echo 2 > file &&
	test_tick &&
	git commit -m third file &&

	rm .git/index &&

	: > super-file &&
	git add super-file &&
	git submodule add "$(pwd)" sub &&
	git symbolic-ref HEAD refs/heads/super &&
	test_tick &&
	git commit -m super-initial &&
	echo 1 > super-file &&
	test_tick &&
	git commit -m super-first super-file &&
	echo 2 > super-file &&
	test_tick &&
	git commit -m super-second super-file

Switched to branch 'master'
ok 49 - "%h %gD: %gs" is same as git-reflog (with --abbrev)

expecting success: 
	echo "master@{0}" >expect.gd-short &&
	git log -g -1 --format=%gd refs/heads/master >actual.gd-short &&
	test_cmp expect.gd-short actual.gd-short

[master (root-commit) 1bd44cb] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file
ok 50 - %gd shortens ref name

expecting success: 
	echo "C O Mitter:committer@example.com" >expect &&
	git log -g -1 --format="%gn:%ge" >actual &&
	test_cmp expect actual

[master 9e00a87] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 534ad2c] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 51 - reflog identity

expecting success: 
	git commit -m "dummy" --allow-empty &&
	git commit -m "dummy" --allow-empty &&
	git filter-branch --msg-filter "sed -e s/dummy//" HEAD^^.. &&
	git rev-list --oneline HEAD >test.txt &&
	test_line_count = 5 test.txt &&
	git rev-list --oneline --graph HEAD >testg.txt &&
	test_line_count = 5 testg.txt

[master 1795412] third
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 5aa097f] dummy
 Author: A U Thor <author@example.com>
[master fa3a3fa] dummy
 Author: A U Thor <author@example.com>
[master 9c68531] D
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bar
[master 555ccf5] F
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - setup

expecting success: 
	git rev-list --left-right B...C > actual &&
	git name-rev --stdin --name-only --refs="*tags/*" \
		< actual > actual.named &&
	test_cmp actual.named expect

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 2 - --left-right

expecting success: 
	git rev-list --count B...C > actual &&
	test "$(cat actual)" = 2

ok 3 - --count

expecting success: 
	test -z "$(git rev-list --left-right --cherry-pick B...C -- foo)"

Cloning into 'sub'...
ok 4 - --cherry-pick foo comes up empty

expecting success: 
	git rev-list --left-right --cherry-pick B...C -- bar > actual &&
	git name-rev --stdin --name-only --refs="*tags/*" \
		< actual > actual.named &&
	test_cmp actual.named expect

done.
ok 5 - --cherry-pick bar does not come up empty

expecting success: 
	git rev-list --left-right B...C -- bar > actual &&
	git name-rev --stdin --name-only --refs="*tags/*" \
		< actual > actual.named &&
	test_cmp actual.named expect

Cloning into 'sub1'...

Rewrite 5aa097fabcc2e47c5f43f6ec1836bf401a2c6f69 (1/2)ok 6 - bar does not come up empty

expecting success: 
	git rev-list --left-right --cherry-pick F...E -- bar > actual &&
	git name-rev --stdin --name-only --refs="*tags/*" \
		< actual > actual.named &&
	test_cmp actual.named expect

done.

Rewrite fa3a3faef638b2d98ff91d77837c396b38c8dbbe (2/2)ok 7 - --cherry-pick bar does not come up empty (II)

expecting success: 
	git rev-list --cherry-mark F...E -- bar > actual &&
	git name-rev --stdin --name-only --refs="*tags/*" \
		< actual > actual.named &&
	test_cmp actual.named expect

ok 8 - --cherry-mark

expecting success: 
	git rev-list --cherry-mark --left-right F...E -- bar > actual &&
	git name-rev --stdin --name-only --refs="*tags/*" \
		< actual > actual.named &&
	test_cmp actual.named expect


[super (root-commit) 5d39741] super-initial
 Author: A U Thor <author@example.com>
 3 files changed, 4 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 sub
 create mode 100644 super-file
Ref 'refs/heads/master' was rewritten
[super 65a8156] super-first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 9 - --cherry-mark --left-right

expecting success: 
	git rev-list --cherry-pick --right-only F...E -- bar > actual &&
	git name-rev --stdin --name-only --refs="*tags/*" \
		< actual > actual.named &&
	test_cmp actual.named expect

[super 355b2d1] super-second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - setup

expecting success: 
	git rev-list --objects super master ^super^

Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
ok 10 - --cherry-pick --right-only

expecting success: 
	git rev-list --cherry-pick --left-only E...F -- bar > actual &&
	git name-rev --stdin --name-only --refs="*tags/*" \
		< actual > actual.named &&
	test_cmp actual.named expect

355b2d185bac30708bdc4c66ae603524f8891254
17954123b4d2a45f7e0fec2fea14972db2b90a1f
534ad2c6e7b5b68dcaa4f008327c6c2ab1fa47ff
1bd44cb9d13204b0fe1958db0082f5028a16eb3a
862da6d68ae9c927ff1b9444c612b702eca000b3 
0cfbf08886fca9a91cb753ec8734c84fcbe52c9f super-file
d9cc608eedd5d2cc63c262272b7a0f6ab6aed5dd 
f27c6ae26adb8396d3861976ba268f87ad8afa0b 
df2b8fc99e1c1d4dbc0a854d9f72157f1d6ea078 
e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 file
ok 2 - Ilari's test

# passed all 2 test(s)
1..2
ok 11 - --cherry-pick --left-only

ok 52 - oneline with empty message

expecting success: 
	git commit --author="a <a@example.com>" --allow-empty -m foo &&
	echo "a <a@example.com>" >expect &&
	git log -1 --format="%an <%ae>" >actual &&
	test_cmp expect actual

expecting success: 
	git rev-list --cherry F...E -- bar > actual &&
	git name-rev --stdin --name-only --refs="*tags/*" \
		< actual > actual.named &&
	test_cmp actual.named expect

[master 900520a] foo
 Author: a <a@example.com>
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
*** t6009-rev-list-parent.sh ***
ok 53 - single-character name is parsed correctly

expecting success: 
	echo "%GX %G" >expect &&
	git log -1 --format="%GX %G" >actual &&
	test_cmp expect actual

Deleted branch remove_sub1 (was e68bdee).
ok 12 - --cherry

expecting success: 
	git rev-list --cherry --count F...E -- bar > actual &&
	test_cmp actual expect

ok 54 - unused %G placeholders are passed through

Switched to a new branch 'remove_sub1'
# passed all 54 test(s)
1..54
ok 13 - --cherry --count

expecting success: 
	git rev-list --cherry-mark --count F...E -- bar > actual &&
	test_cmp actual expect

Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
ok 14 - --cherry-mark --count

expecting success: 
	git rev-list --cherry-mark --left-right --count F...E -- bar > actual &&
	test_cmp actual expect

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6009-rev-list-parent/.git/
expecting success: 

	touch file &&
	git add file &&

	test_commit one &&

	test_tick=$(($test_tick - 2400)) &&

	test_commit two &&
	test_commit three &&
	test_commit four &&

	git log --pretty=oneline --abbrev-commit

*** t6010-merge-base.sh ***
ok 15 - --cherry-mark --left-right --count

expecting success: 
	git symbolic-ref HEAD refs/heads/independent &&
	rm .git/index &&
	echo Hallo > foo &&
	git add foo &&
	test_tick &&
	git commit -m "independent" &&
	echo Bello > foo &&
	test_tick &&
	git commit -m "independent, too" foo &&
	test -z "$(git rev-list --left-right --cherry-pick \
		HEAD...master -- foo)"

warning: unable to rmdir sub1: Directory not empty
Updating 041e421..e68bdee
Fast-forward
[independent (root-commit) 5da548c] independent
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
[master (root-commit) e622cea] one
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
 create mode 100644 file
 create mode 100644 one.t
 .gitmodules | 4 ----
 1 file changed, 4 deletions(-)
 delete mode 100644 .gitmodules
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6010-merge-base/.git/
[independent de095d9] independent, too
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
expecting success: 
	T=$(git mktree </dev/null)

ok 16 - --cherry-pick with independent, but identical branches

expecting success: 
	git rev-list --count --left-right C...D > actual &&
	test_cmp expect actual

ok 1 - setup

expecting success: 
	# E---D---C---B---A
	# \"-_         \   \
	#  \  `---------G   \
	#   \                \
	#    F----------------H
	E=$(doit 5 E) &&
	D=$(doit 4 D $E) &&
	F=$(doit 6 F $E) &&
	C=$(doit 3 C $D) &&
	B=$(doit 2 B $C) &&
	A=$(doit 1 A $B) &&
	G=$(doit 7 G $B $E) &&
	H=$(doit 8 H $A $F)

[master bfa07e2] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two.t
ok 17 - --count --left-right

# passed all 17 test(s)
1..17
[master ecfa770] three
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 three.t
*** t6011-rev-list-with-bad-commit.sh ***
ok 20 - git_pull_ff: 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
		)
	
[master 0906875] four
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 four.t
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6011-rev-list-with-bad-commit/.git/
0906875 four
ecfa770 three
bfa07e2 two
e622cea one
ok 1 - setup

expecting success: 

	git rev-list one --not four >result &&
	>expect &&
	test_cmp expect result


ok 2 - set up G and H

expecting success: 
	git name-rev $B >expected &&

	MB=$(git merge-base G H) &&
	git name-rev "$MB" >actual.single &&

	MB=$(git merge-base --all G H) &&
	git name-rev "$MB" >actual.all &&

	MB=$(git show-branch --merge-base G H) &&
	git name-rev "$MB" >actual.sb &&

	test_cmp expected actual.single &&
	test_cmp expected actual.all &&
	test_cmp expected actual.sb

expecting success: 
   git init &&
   git config core.compression 0 &&
   git config core.logallrefupdates false &&
   echo "foo" > foo &&
   git add foo &&
   git commit -m "first commit" &&
   echo "bar" > bar &&
   git add bar &&
   git commit -m "second commit" &&
   echo "baz" > baz &&
   git add baz &&
   git commit -m "third commit" &&
   echo "foo again" >> foo &&
   git add foo &&
   git commit -m "fourth commit" &&
   git repack -a -f -d
   
ok 2 - one is ancestor of others and should not be shown

expecting success: 

	git checkout --orphan newroot &&
	test_commit five &&
	git checkout -b sidebranch two &&
	test_commit six &&
	git checkout -b anotherbranch three &&
	test_commit seven &&
	git checkout -b yetanotherbranch four &&
	test_commit eight &&
	git checkout master &&
	test_merge normalmerge newroot &&
	test_tick &&
	git merge -m tripus sidebranch anotherbranch &&
	git tag tripus &&
	git checkout -b tetrabranch normalmerge &&
	test_tick &&
	git merge -m tetrapus sidebranch anotherbranch yetanotherbranch &&
	git tag tetrapus &&
	git checkout master

Cloning into 'submodule_update'...
Reinitialized existing Git repository in /«PKGBUILDDIR»/t/trash directory.t6011-rev-list-with-bad-commit/.git/
Switched to a new branch 'newroot'
done.
[newroot (root-commit) 04238a1] five
 Author: A U Thor <author@example.com>
 6 files changed, 5 insertions(+)
 create mode 100644 file
 create mode 100644 five.t
 create mode 100644 four.t
 create mode 100644 one.t
 create mode 100644 three.t
 create mode 100644 two.t
[master (root-commit) 7fcafcf] first commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
ok 3 - merge-base G H

expecting success: 
	git name-rev "$H" >expected1 &&
	git name-rev "$H" "$G" >expected2 &&

	parents=$(git merge-base --independent H) &&
	git name-rev $parents >actual1.mb &&
	parents=$(git merge-base --independent A H G) &&
	git name-rev $parents >actual2.mb &&

	parents=$(git show-branch --independent H) &&
	git name-rev $parents >actual1.sb &&
	parents=$(git show-branch --independent A H G) &&
	git name-rev $parents >actual2.sb &&

	test_cmp expected1 actual1.mb &&
	test_cmp expected2 actual2.mb &&
	test_cmp expected1 actual1.sb &&
	test_cmp expected2 actual2.sb

Switched to a new branch 'sidebranch'
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
[master 0d433d7] second commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bar
[sidebranch e29a44f] six
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 six.t
[master b8b549a] third commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 baz
Switched to a new branch 'anotherbranch'
[master fc9dc2a] fourth commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[anotherbranch f863663] seven
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 seven.t
Switched to a new branch 'yetanotherbranch'
ok 4 - merge-base/show-branch --independent

expecting success: 
	# This test is to demonstrate that relying on timestamps in a distributed
	# SCM to provide a _consistent_ partial ordering of commits leads to
	# insanity.
	#
	#               Relative
	# Structure     timestamps
	#
	#   PL  PR        +4  +4
	#  /  \/  \      /  \/  \
	# L2  C2  R2    +3  -1  +3
	# |   |   |     |   |   |
	# L1  C1  R1    +2  -2  +2
	# |   |   |     |   |   |
	# L0  C0  R0    +1  -3  +1
	#   \ |  /        \ |  /
	#     S             0
	#
	# The left and right chains of commits can be of any length and complexity as
	# long as all of the timestamps are greater than that of S.

	S=$(doit  0 S) &&

	C0=$(doit -3 C0 $S) &&
	C1=$(doit -2 C1 $C0) &&
	C2=$(doit -1 C2 $C1) &&

	L0=$(doit  1 L0 $S) &&
	L1=$(doit  2 L1 $L0) &&
	L2=$(doit  3 L2 $L1) &&

	R0=$(doit  1 R0 $S) &&
	R1=$(doit  2 R1 $R0) &&
	R2=$(doit  3 R2 $R1) &&

	PL=$(doit  4 PL $L2 $C2) &&
	PR=$(doit  4 PR $C2 $R2) &&

	git name-rev $C2 >expected &&

	MB=$(git merge-base PL PR) &&
	git name-rev "$MB" >actual.single &&

	MB=$(git merge-base --all PL PR) &&
	git name-rev "$MB" >actual.all &&

	test_cmp expected actual.single &&
	test_cmp expected actual.all

[yetanotherbranch 3e13a02] eight
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 eight.t
Switched to branch 'master'
ok 1 - setup

expecting success: 
   revs=$(git rev-list --all | wc -l) &&
   test $revs -eq 4 &&
   first_commit=$(git rev-parse HEAD~3)
   
Merging:
0906875 four
virtual newroot
found 0 common ancestors:
Merge made by the 'recursive' strategy.
 five.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 five.t
ok 2 - verify number of revisions

expecting success: 
   perl -i.bak -pe "s/second commit/socond commit/" .git/objects/pack/*.pack &&
   test_must_fail git fsck --full
   
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
error: .git/objects/pack/pack-2f8d6f17cb7c436b13017aa26c55e87c12a3c896.pack SHA1 checksum mismatch
error: index CRC mismatch for object 0d433d77f188af0b6a8e4063187d8357c864c892 from .git/objects/pack/pack-2f8d6f17cb7c436b13017aa26c55e87c12a3c896.pack at offset 487
error: inflate: data stream error (incorrect data check)
error: cannot unpack 0d433d77f188af0b6a8e4063187d8357c864c892 from .git/objects/pack/pack-2f8d6f17cb7c436b13017aa26c55e87c12a3c896.pack at offset 487
dangling commit 7fcafcf7846116edb24fdd15307c77600e603539
ok 3 - corrupt second commit object

expecting success: 
   test_must_fail git rev-list --all > /dev/null
   
error: inflate: data stream error (incorrect data check)
error: failed to read object 0d433d77f188af0b6a8e4063187d8357c864c892 at offset 487 from .git/objects/pack/pack-2f8d6f17cb7c436b13017aa26c55e87c12a3c896.pack
fatal: packed object 0d433d77f188af0b6a8e4063187d8357c864c892 (stored in .git/objects/pack/pack-2f8d6f17cb7c436b13017aa26c55e87c12a3c896.pack) is corrupt
ok 4 - rev-list should fail

expecting success: 
   test_must_fail git repack -a -f -d
   
Trying simple merge with sidebranch
error: inflate: data stream error (incorrect data check)
error: failed to read object 0d433d77f188af0b6a8e4063187d8357c864c892 at offset 487 from .git/objects/pack/pack-2f8d6f17cb7c436b13017aa26c55e87c12a3c896.pack
fatal: packed object 0d433d77f188af0b6a8e4063187d8357c864c892 (stored in .git/objects/pack/pack-2f8d6f17cb7c436b13017aa26c55e87c12a3c896.pack) is corrupt
ok 5 - git repack _MUST_ fail

expecting success: 
   git log $first_commit
   
Trying simple merge with anotherbranch
commit 7fcafcf7846116edb24fdd15307c77600e603539
Author: A U Thor <author@example.com>
Date:   Wed Dec 16 11:01:52 2015 +0000

    first commit
ok 6 - first commit is still available

# passed all 6 test(s)
1..6
Cloning into 'sub1'...
Merge made by the 'octopus' strategy.
 seven.t | 1 +
 six.t   | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 seven.t
 create mode 100644 six.t
*** t6012-rev-list-simplify.sh ***
done.
Switched to a new branch 'tetrabranch'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6012-rev-list-simplify/.git/
ok 5 - unsynchronized clocks

expecting success: 
	IB=$(doit 0 IB) &&
	I1=$(doit -10 I1 $IB) &&
	I2=$(doit  -9 I2 $I1) &&
	I3=$(doit  -8 I3 $I2) &&
	I4=$(doit  -7 I4 $I3) &&
	I5=$(doit  -6 I5 $I4) &&
	I6=$(doit  -5 I6 $I5) &&
	I7=$(doit  -4 I7 $I6) &&
	I8=$(doit  -3 I8 $I7) &&
	IH=$(doit  -2 IH $I8) &&

	echo $IH >expected &&
	git merge-base --independent IB IH >actual &&
	test_cmp expected actual

expecting success: 
	echo "Hi there" >file &&
	echo "initial" >lost &&
	git add file lost &&
	test_tick && git commit -m "Initial file and lost" &&
	note A &&

	git branch other-branch &&

	echo "Hello" >file &&
	echo "second" >lost &&
	git add file lost &&
	test_tick && git commit -m "Modified file and lost" &&
	note B &&

	git checkout other-branch &&

	echo "Hello" >file &&
	>lost &&
	git add file lost &&
	test_tick && git commit -m "Modified the file identically" &&
	note C &&

	echo "This is a stupid example" >another-file &&
	git add another-file &&
	test_tick && git commit -m "Add another file" &&
	note D &&

	test_tick &&
	test_must_fail git merge -m "merge" master &&
	>lost && git commit -a -m "merge" &&
	note E &&

	echo "Yet another" >elif &&
	git add elif &&
	test_tick && git commit -m "Irrelevant change" &&
	note F &&

	git checkout master &&
	echo "Yet another" >elif &&
	git add elif &&
	test_tick && git commit -m "Another irrelevant change" &&
	note G &&

	test_tick && git merge -m "merge" other-branch &&
	note H &&

	echo "Final change" >file &&
	test_tick && git commit -a -m "Final change" &&
	note I &&

	git symbolic-ref HEAD refs/heads/unrelated &&
	git rm -f "*" &&
	echo "Unrelated branch" >side &&
	git add side &&
	test_tick && git commit -m "Side root" &&
	note J &&

	git checkout master &&
	test_tick && git merge -m "Coolest" unrelated &&
	note K &&

	echo "Immaterial" >elif &&
	git add elif &&
	test_tick && git commit -m "Last" &&
	note L

Trying simple merge with sidebranch
Trying simple merge with anotherbranch
[master (root-commit) 2ce5a1a] Initial file and lost
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 file
 create mode 100644 lost
Trying simple merge with yetanotherbranch
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
Merge made by the 'octopus' strategy.
[master 286b6a1] Modified file and lost
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 2 deletions(-)
 eight.t | 1 +
 seven.t | 1 +
 six.t   | 1 +
 3 files changed, 3 insertions(+)
 create mode 100644 eight.t
 create mode 100644 seven.t
 create mode 100644 six.t
Switched to branch 'master'
Switched to branch 'other-branch'
ok 3 - setup roots, merges and octopuses

expecting success: 

	check_revlist "--max-parents=0" one five

Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
ok 4 - rev-list roots

expecting success: 

	check_revlist "--max-parents=1" one eight seven six five four three two &&
	check_revlist "--no-merges" one eight seven six five four three two

[other-branch ff72f6c] Modified the file identically
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 2 deletions(-)
ok 6 - --independent with unsynchronized clocks

expecting success: 
	# Another set to demonstrate base between one commit and a merge
	# in the documentation.
	#
	# * C (MMC) * B (MMB) * A  (MMA)
	# * o       * o       * o
	# * o       * o       * o
	# * o       * o       * o
	# * o       | _______/
	# |         |/
	# |         * 1 (MM1)
	# | _______/
	# |/
	# * root (MMR)

	test_commit MMR &&
	test_commit MM1 &&
	test_commit MM-o &&
	test_commit MM-p &&
	test_commit MM-q &&
	test_commit MMA &&
	git checkout MM1 &&
	test_commit MM-r &&
	test_commit MM-s &&
	test_commit MM-t &&
	test_commit MMB &&
	git checkout MMR &&
	test_commit MM-u &&
	test_commit MM-v &&
	test_commit MM-w &&
	test_commit MM-x &&
	test_commit MMC

[other-branch 36dc6fe] Add another file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 another-file
ok 5 - rev-list no merges

expecting success: 

	check_revlist "--max-parents=2" one normalmerge eight seven six five four three two

[master (root-commit) 0075405] MMR
 Author: A U Thor <git@au.thor.xz>
 1 file changed, 1 insertion(+)
 create mode 100644 MMR.t
Deleted branch remove_sub1 (was e68bdee).
Merging:
36dc6fe Add another file
virtual master
found 1 common ancestor:
2ce5a1a Initial file and lost
Auto-merging lost
CONFLICT (content): Merge conflict in lost
Automatic merge failed; fix conflicts and then commit the result.
ok 6 - rev-list no octopuses

expecting success: 

	check_revlist "--min-parents=1" tetrapus tripus normalmerge eight seven six four three two

Switched to a new branch 'remove_sub1'
[other-branch 1ff505a] merge
 Author: A U Thor <author@example.com>
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
ok 7 - rev-list no roots

expecting success: 

	check_revlist "--min-parents=2" tetrapus tripus normalmerge &&
	check_revlist "--merges" tetrapus tripus normalmerge

[master 91243c1] MM1
 Author: A U Thor <git@au.thor.xz>
 1 file changed, 1 insertion(+)
 create mode 100644 MM1.t
[other-branch d02125d] Irrelevant change
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 elif
[master 4d5fde5] MM-o
 Author: A U Thor <git@au.thor.xz>
 1 file changed, 1 insertion(+)
 create mode 100644 MM-o.t
ok 8 - rev-list merges

expecting success: 

	check_revlist "--min-parents=3" tetrapus tripus

Switched to branch 'master'
ok 9 - rev-list octopus

expecting success: 

	check_revlist "--min-parents=1 --max-parents=1" eight seven six four three two

warning: unable to rmdir sub1: Directory not empty
Updating 041e421..e68bdee
Fast-forward
[master aa25f2c] Another irrelevant change
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 elif
[master ca22c18] MM-p
 Author: A U Thor <git@au.thor.xz>
 1 file changed, 1 insertion(+)
 create mode 100644 MM-p.t
 .gitmodules | 4 ----
 1 file changed, 4 deletions(-)
 delete mode 100644 .gitmodules
ok 10 - rev-list ordinary commits

expecting success: 

	check_revlist "--min-parents=2 --no-merges" &&
	check_revlist "--merges --no-merges" &&
	check_revlist "--no-merges --merges"

Merging:
aa25f2c Another irrelevant change
virtual other-branch
found 1 common ancestor:
286b6a1 Modified file and lost
Merge made by the 'recursive' strategy.
[master 2659ed6] MM-q
 Author: A U Thor <git@au.thor.xz>
 1 file changed, 1 insertion(+)
 create mode 100644 MM-q.t
 another-file | 1 +
 lost         | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
 create mode 100644 another-file
[master 0a8e50c] Final change
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master fdb9a8f] MMA
 Author: A U Thor <git@au.thor.xz>
 1 file changed, 1 insertion(+)
 create mode 100644 MMA.t
ok 11 - rev-list --merges --no-merges yields empty set

expecting success: 

	check_revlist "--min-parents=2 --max-parents=1 --max-parents=3" tripus normalmerge &&
	check_revlist "--min-parents=1 --min-parents=2 --max-parents=7" tetrapus tripus normalmerge &&
	check_revlist "--min-parents=2 --max-parents=8" tetrapus tripus normalmerge &&
	check_revlist "--min-parents=2 --max-parents=-1" tetrapus tripus normalmerge &&
	check_revlist "--min-parents=2 --no-max-parents" tetrapus tripus normalmerge &&
	check_revlist "--max-parents=0 --min-parents=1 --no-min-parents" one five

rm 'another-file'
rm 'elif'
rm 'file'
rm 'lost'
Note: checking out 'MM1'.

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 91243c1... MM1
ok 21 - git_pull_ff: 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
		)
	
[unrelated (root-commit) 2e5e0f8] Side root
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 side
[detached HEAD c35e31c] MM-r
 Author: A U Thor <git@au.thor.xz>
 1 file changed, 1 insertion(+)
 create mode 100644 MM-r.t
Switched to branch 'master'
[detached HEAD 44e361c] MM-s
 Author: A U Thor <git@au.thor.xz>
 1 file changed, 1 insertion(+)
 create mode 100644 MM-s.t
Merging:
0a8e50c Final change
virtual unrelated
found 0 common ancestors:
Merge made by the 'recursive' strategy.
 side | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 side
[detached HEAD a5daa7f] MM-t
 Author: A U Thor <git@au.thor.xz>
 1 file changed, 1 insertion(+)
 create mode 100644 MM-t.t
[master 3ce3663] Last
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 12 - rev-list override and infinities

expecting success: 

	roots= &&
	for i in 1 2 3 4 5 6 7 8 9 10 11
	do
		git checkout -b root$i five &&
		test_commit $i &&
		roots="$roots root$i" ||
		return
	done &&
	git checkout master &&
	test_tick &&
	git merge -m dodecapus $roots &&
	git tag dodecapus &&

	check_revlist "--min-parents=4" dodecapus tetrapus &&
	check_revlist "--min-parents=8" dodecapus &&
	check_revlist "--min-parents=12" dodecapus &&
	check_revlist "--min-parents=13" &&
	check_revlist "--min-parents=4 --max-parents=11" tetrapus

ok 1 - setup

expecting success: 
		git log --pretty="$FMT" --parents $param |
		unnote >actual &&
		sed -e "s/^.*	\([^ ]*\) .*/\1/" >check <actual &&
		test_cmp expect check
	
Cloning into 'submodule_update'...
[detached HEAD bca1425] MMB
 Author: A U Thor <git@au.thor.xz>
 1 file changed, 1 insertion(+)
 create mode 100644 MMB.t
Switched to a new branch 'root1'
ok 2 - log --full-history

expecting success: 
		git log --pretty="$FMT" --parents $param |
		unnote >actual &&
		sed -e "s/^.*	\([^ ]*\) .*/\1/" >check <actual &&
		test_cmp expect check
	
done.
Previous HEAD position was bca1425... MMB
HEAD is now at 0075405... MMR
[root1 9562ee3] 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 1.t
ok 3 - log --full-history -- file

expecting success: 
		git log --pretty="$FMT" --parents $param |
		unnote >actual &&
		sed -e "s/^.*	\([^ ]*\) .*/\1/" >check <actual &&
		test_cmp expect check
	
Switched to a new branch 'root2'
[detached HEAD 174b4d1] MM-u
 Author: A U Thor <git@au.thor.xz>
 1 file changed, 1 insertion(+)
 create mode 100644 MM-u.t
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 4 - log --full-history --topo-order -- file

expecting success: 
		git log --pretty="$FMT" --parents $param |
		unnote >actual &&
		sed -e "s/^.*	\([^ ]*\) .*/\1/" >check <actual &&
		test_cmp expect check
	
[root2 1779fe6] 2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 2.t
[detached HEAD c171a6c] MM-v
 Author: A U Thor <git@au.thor.xz>
 1 file changed, 1 insertion(+)
 create mode 100644 MM-v.t
ok 5 - log --full-history --date-order -- file

expecting success: 
		git log --pretty="$FMT" --parents $param |
		unnote >actual &&
		sed -e "s/^.*	\([^ ]*\) .*/\1/" >check <actual &&
		test_cmp expect check
	
Switched to a new branch 'root3'
[root3 cc9911e] 3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 3.t
ok 6 - log --simplify-merges -- file

expecting success: 
		git log --pretty="$FMT" --parents $param |
		unnote >actual &&
		sed -e "s/^.*	\([^ ]*\) .*/\1/" >check <actual &&
		test_cmp expect check
	
[detached HEAD c25d00b] MM-w
 Author: A U Thor <git@au.thor.xz>
 1 file changed, 1 insertion(+)
 create mode 100644 MM-w.t
Switched to a new branch 'root4'
ok 7 - log -- file

expecting success: 
		git log --pretty="$FMT" --parents $param |
		unnote >actual &&
		sed -e "s/^.*	\([^ ]*\) .*/\1/" >check <actual &&
		test_cmp expect check
	
[detached HEAD 610cc22] MM-x
 Author: A U Thor <git@au.thor.xz>
 1 file changed, 1 insertion(+)
 create mode 100644 MM-x.t
[root4 35b702f] 4
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 4.t
ok 8 - log --topo-order -- file

expecting success: 
		git log --pretty="$FMT" --parents $param |
		unnote >actual &&
		sed -e "s/^.*	\([^ ]*\) .*/\1/" >check <actual &&
		test_cmp expect check
	
Switched to a new branch 'root5'
ok 9 - log --first-parent -- another-file

expecting success: 
		git log --pretty="$FMT" --parents $param |
		unnote >actual &&
		sed -e "s/^.*	\([^ ]*\) .*/\1/" >check <actual &&
		test_cmp expect check
	
[detached HEAD 03ab457] MMC
 Author: A U Thor <git@au.thor.xz>
 1 file changed, 1 insertion(+)
 create mode 100644 MMC.t
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 7 - merge-base for octopus-step (setup)

expecting success: 
	git rev-parse --verify MM1 >expected &&
	git rev-parse --verify MMR >expected.sb &&

	git merge-base --all MMA MMB MMC >actual &&
	git merge-base --all --octopus MMA MMB MMC >actual.common &&
	git show-branch --merge-base MMA MMB MMC >actual.sb &&

	test_cmp expected actual &&
	test_cmp expected.sb actual.common &&
	test_cmp expected.sb actual.sb

ok 10 - log --full-history E -- lost

expecting success: 
	printf "%s\n" E C B A >expect &&
	git log --pretty="$FMT" --full-history E -- lost |
	unnote >actual &&
	sed -e "s/^.*	\([^ ]*\) .*/\1/" >check <actual &&
	test_cmp expect check

[root5 c532809] 5
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 5.t
Switched to a new branch 'root6'
ok 11 - full history simplification without parent

expecting success: 
	git log -p --pretty="%H" --full-diff -- file >expected &&
	git log -p --pretty="%H" --full-diff --parents -- file >actual &&
	test_cmp expected actual

[root6 f4a589f] 6
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 6.t
ok 8 - merge-base A B C

expecting success: 
	git reset --hard MMR &&
	test_commit CC1 &&
	git reset --hard E &&
	test_commit CC2 &&
	test_tick &&
	git merge -s ours CC1 &&
	test_commit CC-o &&
	test_commit CCB &&
	git reset --hard CC1 &&
	git merge -s ours CC2 &&
	test_commit CCA &&

	git rev-parse CC1 CC2 >expected &&
	git merge-base --all CCB CCA^^ CCA^^2 >actual &&

	sort expected >expected.sorted &&
	sort actual >actual.sorted &&
	test_cmp expected.sorted actual.sorted

ok 12 - --full-diff is not affected by --parents

Cloning into 'sub1'...
HEAD is now at 0075405 MMR
# passed all 12 test(s)
1..12
Switched to a new branch 'root7'
[detached HEAD 4141141] CC1
 Author: A U Thor <git@au.thor.xz>
 1 file changed, 1 insertion(+)
 create mode 100644 CC1.t
done.
[root7 4f77507] 7
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 7.t
*** t6013-rev-list-reverse-parents.sh ***
HEAD is now at e34970a E
Switched to a new branch 'root8'
[detached HEAD d33e00c] CC2
 Author: A U Thor <git@au.thor.xz>
 1 file changed, 1 insertion(+)
 create mode 100644 CC2.t
[root8 e4dbc7d] 8
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 8.t
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6013-rev-list-reverse-parents/.git/
expecting success: 
	commit one &&
	git tag root &&
	commit two &&
	git checkout -b side HEAD^ &&
	commit three &&
	git checkout master &&
	git merge -s ours side &&
	commit five
	
Merge made by the 'ours' strategy.
Switched to a new branch 'root9'
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
[master (root-commit) 86412ff] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
[root9 446b36e] 9
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 9.t
[detached HEAD 48e3312] CC-o
 Author: A U Thor <git@au.thor.xz>
 1 file changed, 1 insertion(+)
 create mode 100644 CC-o.t
Switched to a new branch 'root10'
[detached HEAD dda5641] CCB
 Author: A U Thor <git@au.thor.xz>
 1 file changed, 1 insertion(+)
 create mode 100644 CCB.t
[master 4931c53] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'side'
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
[root10 120147b] 10
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 10.t
Deleted branch replace_sub1_with_directory (was 48ceb4d).
HEAD is now at 4141141 CC1
Switched to a new branch 'replace_sub1_with_directory'
[side 0fcb03e] three
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'root11'
Switched to branch 'master'
Merge made by the 'ours' strategy.
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
[root11 ce99f6d] 11
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 11.t
Merge made by the 'ours' strategy.
[detached HEAD 6d30b69] CCA
 Author: A U Thor <git@au.thor.xz>
 1 file changed, 1 insertion(+)
 create mode 100644 CCA.t
Switched to branch 'master'
[master 2ed4a76] five
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - set up --reverse example

expecting success: 
	git rev-list --parents --full-history master -- foo |
		perl -e "print reverse <>" > expected &&
	git rev-list --reverse --parents --full-history master -- foo \
		> actual &&
	test_cmp actual expected
	
ok 9 - criss-cross merge-base for octopus-step

expecting success: 
	git reset --hard &&
	git checkout -b base $E &&

	(
		for count in 1 2 3
		do
			git commit --allow-empty -m "Base commit #$count" &&
			git rev-parse HEAD >expect$count &&
			git checkout -B derived &&
			git commit --allow-empty -m "Derived #$count" &&
			git rev-parse HEAD >derived$count &&
			git checkout -B base $E || exit 1
		done

		for count in 1 2 3
		do
			git merge-base --fork-point base $(cat derived$count) >actual &&
			test_cmp expect$count actual || exit 1
		done

	) &&
	# check that we correctly default to HEAD
	git checkout derived &&
	git merge-base --fork-point base >actual &&
	test_cmp expect3 actual

error: The following untracked working tree files would be overwritten by merge:
	sub1/file1
	sub1/file2
Please move or remove them before you can merge.
Aborting
Updating 041e421..48ceb4d
HEAD is now at 6d30b69 CCA
ok 2 - --reverse --parents --full-history combines correctly

expecting success: 
	git rev-list --boundary --parents --full-history master ^root -- foo |
		perl -e "print reverse <>" > expected &&
	git rev-list --boundary --reverse --parents --full-history \
		master ^root -- foo > actual &&
	test_cmp actual expected
	
Trying simple merge with root1
Previous HEAD position was 6d30b69... CCA
Switched to a new branch 'base'
ok 3 - --boundary does too

Trying simple merge with root2
# passed all 3 test(s)
1..3
[base 58b1909] Base commit #1
 Author: A U Thor <git@au.thor.xz>
Switched to a new branch 'derived'
*** t6014-rev-list-all.sh ***
ok 22 - git_pull_ff: 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
		)
	
Trying simple merge with root3
[derived 8ef5ddb] Derived #1
 Author: A U Thor <git@au.thor.xz>
Trying simple merge with root4
Switched to and reset branch 'base'
[base 9ef36f6] Base commit #2
 Author: A U Thor <git@au.thor.xz>
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6014-rev-list-all/.git/
expecting success: 

	commit one &&
	commit two &&
	git checkout HEAD^ &&
	commit detached


Trying simple merge with root5
Cloning into 'submodule_update'...
Switched to and reset branch 'derived'
Trying simple merge with root6
[master (root-commit) 86412ff] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
[derived 6c4d828] Derived #2
 Author: A U Thor <git@au.thor.xz>
done.
Switched to and reset branch 'base'
Trying simple merge with root7
[master 4931c53] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[base d6c9a6e] Base commit #3
 Author: A U Thor <git@au.thor.xz>
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 86412ff... one
Trying simple merge with root8
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Switched to and reset branch 'derived'
[detached HEAD 13d8fe0] detached
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - setup

expecting success: 

	test 3 = $(git rev-list --all | wc -l)


[derived 3768cdc] Derived #3
 Author: A U Thor <git@au.thor.xz>
Trying simple merge with root9
ok 2 - rev-list --all lists detached HEAD

expecting success: 

	git gc &&
	git prune --expire=now &&
	git show HEAD


Switched to and reset branch 'base'
Trying simple merge with root10
Trying simple merge with root11
Switched to branch 'derived'
Merge made by the 'octopus' strategy.
 1.t  | 1 +
 10.t | 1 +
 11.t | 1 +
 2.t  | 1 +
 3.t  | 1 +
 4.t  | 1 +
 5.t  | 1 +
 6.t  | 1 +
 7.t  | 1 +
 8.t  | 1 +
 9.t  | 1 +
 11 files changed, 11 insertions(+)
 create mode 100644 1.t
 create mode 100644 10.t
 create mode 100644 11.t
 create mode 100644 2.t
 create mode 100644 3.t
 create mode 100644 4.t
 create mode 100644 5.t
 create mode 100644 6.t
 create mode 100644 7.t
 create mode 100644 8.t
 create mode 100644 9.t
ok 10 - using reflog to find the fork point

expecting success: 
	# Best common ancestor for JE, JAA and JDD is JC
	#             JE
	#            / |
	#           /  |
	#          /   |
	#  JAA    /    |
	#   |\   /     |
	#   | \  | JDD |
	#   |  \ |/ |  |
	#   |   JC JD  |
	#   |    | /|  |
	#   |    |/ |  |
	#  JA    |  |  |
	#   |\  /|  |  |
	#   X JB |  X  X
	#   \  \ | /   /
	#    \__\|/___/
	#        J
	test_commit J &&
	test_commit JB &&
	git reset --hard J &&
	test_commit JC &&
	git reset --hard J &&
	test_commit JTEMP1 &&
	test_merge JA JB &&
	test_merge JAA JC &&
	git reset --hard J &&
	test_commit JTEMP2 &&
	test_merge JD JB &&
	test_merge JDD JC &&
	git reset --hard J &&
	test_commit JTEMP3 &&
	test_merge JE JC &&
	git rev-parse JC >expected &&
	git merge-base --all --octopus JAA JDD JE >actual &&
	test_cmp expected actual

[derived 3782338] J
 Author: A U Thor <git@au.thor.xz>
 1 file changed, 1 insertion(+)
 create mode 100644 J.t
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
[derived 83a274f] JB
 Author: A U Thor <git@au.thor.xz>
 1 file changed, 1 insertion(+)
 create mode 100644 JB.t
HEAD is now at 3782338 J
commit 13d8fe0bae4079d4dedb755a88319ddebda9a07b
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:15:13 2005 -0700

    detached

diff --git a/foo b/foo
index 5626abf..9aa4e2b 100644
--- a/foo
+++ b/foo
@@ -1 +1 @@
-one
+detached
ok 3 - repack does not lose detached HEAD

expecting success: 
	test_must_fail git rev-list --graph --no-walk HEAD

fatal: cannot combine --no-walk with --graph
ok 4 - rev-list --graph --no-walk is forbidden

# passed all 4 test(s)
1..4
[derived cb75edb] JC
 Author: A U Thor <git@au.thor.xz>
 1 file changed, 1 insertion(+)
 create mode 100644 JC.t
ok 13 - dodecapus

expecting success: 

	test_tick_keep=$test_tick &&
	for i in 1 2 3 4 5 6 7 8; do
		test_tick=$test_tick_keep
		test_commit t$i
	done &&
	git rev-list t1^! --not t$i >result &&
	>expect &&
	test_cmp expect result

*** t6015-rev-list-show-all-parents.sh ***
Cloning into 'sub1'...
HEAD is now at 3782338 J
[master 1bc0b48] t1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 t1.t
[derived e9767d0] JTEMP1
 Author: A U Thor <git@au.thor.xz>
 1 file changed, 1 insertion(+)
 create mode 100644 JTEMP1.t
done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6015-rev-list-show-all-parents/.git/
expecting success: 
	test_commit one foo.txt &&
	commit1=`git rev-list -1 HEAD` &&
	test_commit two bar.txt &&
	commit2=`git rev-list -1 HEAD` &&
	test_commit three foo.txt &&
	commit3=`git rev-list -1 HEAD`
	
Merging:
e9767d0 JTEMP1
virtual JB
found 1 common ancestor:
3782338 J
Merge made by the 'recursive' strategy.
[master 145e5ab] t2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 t2.t
 JB.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 JB.t
[master (root-commit) 4b09c9e] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo.txt
Merging:
20d1cc3 JA
virtual JC
found 1 common ancestor:
3782338 J
Merge made by the 'recursive' strategy.
 JC.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 JC.t
[master 17e63bf] t3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 t3.t
HEAD is now at 3782338 J
[master bea58ca] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bar.txt
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
[master 47d7b66] t4
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 t4.t
[derived d2ca2eb] JTEMP2
 Author: A U Thor <git@au.thor.xz>
 1 file changed, 1 insertion(+)
 create mode 100644 JTEMP2.t
[master 106a79f] three
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master a42aaab] t5
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 t5.t
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
Merging:
d2ca2eb JTEMP2
virtual JB
found 1 common ancestor:
3782338 J
Merge made by the 'recursive' strategy.
ok 1 - set up --show-all --parents test

expecting success: 
	echo $commit3 $commit1 > expected &&
	echo $commit1 >> expected &&
	git rev-list --parents HEAD -- foo.txt > actual &&
	test_cmp expected actual
	
 JB.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 JB.t
ok 2 - --parents rewrites TREESAME parents correctly

expecting success: 
	echo $commit3 $commit2 > expected &&
	echo $commit2 $commit1 >> expected &&
	echo $commit1 >> expected &&
	git rev-list --parents --show-all HEAD -- foo.txt > actual &&
	test_cmp expected actual
	
ok 3 - --parents --show-all does not rewrites TREESAME parents

# passed all 3 test(s)
1..3
Merging:
a0fc47f JD
virtual JC
found 1 common ancestor:
3782338 J
Merge made by the 'recursive' strategy.
[master aebfe15] t6
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 t6.t
 JC.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 JC.t
*** t6016-rev-list-graph-simplify-history.sh ***
HEAD is now at 3782338 J
Deleted branch replace_sub1_with_directory (was 48ceb4d).
[master 7cfb595] t7
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 t7.t
Switched to a new branch 'replace_sub1_with_directory'
[derived dc142e3] JTEMP3
 Author: A U Thor <git@au.thor.xz>
 1 file changed, 1 insertion(+)
 create mode 100644 JTEMP3.t
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6016-rev-list-graph-simplify-history/.git/
[master fea5200] t8
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 t8.t
expecting success: 
	# 3 commits on branch A
	test_commit A1 foo.txt &&
	test_commit A2 bar.txt &&
	test_commit A3 bar.txt &&
	git branch -m master A &&

	# 2 commits on branch B, started from A1
	git checkout -b B A1 &&
	test_commit B1 foo.txt &&
	test_commit B2 abc.txt &&

	# 2 commits on branch C, started from A2
	git checkout -b C A2 &&
	test_commit C1 xyz.txt &&
	test_commit C2 xyz.txt &&

	# Octopus merge B and C into branch A
	git checkout A &&
	git merge B C &&
	git tag A4 &&

	test_commit A5 bar.txt &&

	# More commits on C, then merge C into A
	git checkout C &&
	test_commit C3 foo.txt &&
	test_commit C4 bar.txt &&
	git checkout A &&
	git merge -s ours C &&
	git tag A6 &&

	test_commit A7 bar.txt &&

	# Store commit names in variables for later use
	A1=$(git rev-parse --verify A1) &&
	A2=$(git rev-parse --verify A2) &&
	A3=$(git rev-parse --verify A3) &&
	A4=$(git rev-parse --verify A4) &&
	A5=$(git rev-parse --verify A5) &&
	A6=$(git rev-parse --verify A6) &&
	A7=$(git rev-parse --verify A7) &&
	B1=$(git rev-parse --verify B1) &&
	B2=$(git rev-parse --verify B2) &&
	C1=$(git rev-parse --verify C1) &&
	C2=$(git rev-parse --verify C2) &&
	C3=$(git rev-parse --verify C3) &&
	C4=$(git rev-parse --verify C4)
	
Merging:
dc142e3 JTEMP3
virtual JC
found 1 common ancestor:
3782338 J
Merge made by the 'recursive' strategy.
 JC.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 JC.t
ok 14 - ancestors with the same commit time

[master (root-commit) 9b00348] A1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo.txt
# passed all 14 test(s)
1..14
ok 11 - merge-base --octopus --all for complex tree

# passed all 11 test(s)
1..11
error: The following untracked working tree files would be overwritten by merge:
	sub1/file1
	sub1/file2
Please move or remove them before you can merge.
Aborting
Updating 041e421..48ceb4d
[master 02e4832] A2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bar.txt
[master 993a1f0] A3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
*** t6017-rev-list-stdin.sh ***
Switched to a new branch 'B'
*** t6018-rev-list-glob.sh ***
[B 4accf7e] B1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 23 - git_pull_ff: 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
		)
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6017-rev-list-stdin/.git/
expecting success: 
	(
		for i in 0 $them
		do
			for j in $them
			do
				echo $i.$j >file-$j &&
				git add file-$j || exit
			done &&
			test_tick &&
			git commit -m $i || exit
		done &&
		for i in $them
		do
			git checkout -b side-$i master~$i &&
			echo updated $i >file-$i &&
			git add file-$i &&
			test_tick &&
			git commit -m side-$i || exit
		done
	)

[B e76ada1] B2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 abc.txt
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6018-rev-list-glob/.git/
expecting success: 

	commit master &&
	git checkout -b subspace/one master &&
	commit one &&
	git checkout -b subspace/two master &&
	commit two &&
	git checkout -b subspace-x master &&
	commit subspace-x &&
	git checkout -b other/three master &&
	commit three &&
	git checkout -b someref master &&
	commit some &&
	git checkout master &&
	commit master2 &&
	git tag foo/bar master &&
	commit master3 &&
	git update-ref refs/remotes/foo/baz master &&
	commit master4

Switched to a new branch 'C'
[master (root-commit) e1f5012] master
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
Switched to a new branch 'subspace/one'
[C 0c196cf] C1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 xyz.txt
[subspace/one 2eafb28] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master (root-commit) b2718df] 0
 Author: A U Thor <author@example.com>
 7 files changed, 7 insertions(+)
 create mode 100644 file-1
 create mode 100644 file-2
 create mode 100644 file-3
 create mode 100644 file-4
 create mode 100644 file-5
 create mode 100644 file-6
 create mode 100644 file-7
Cloning into 'submodule_update'...
Switched to a new branch 'subspace/two'
[C ea5d98c] C2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[subspace/two 8d58bb9] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to branch 'A'
done.
Switched to a new branch 'subspace-x'
Trying simple merge with B
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
[subspace-x a6204e5] subspace-x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 4c7c799] 1
 Author: A U Thor <author@example.com>
 7 files changed, 7 insertions(+), 7 deletions(-)
Switched to a new branch 'other/three'
Trying simple merge with C
Merge made by the 'octopus' strategy.
 abc.txt | 1 +
 foo.txt | 2 +-
 xyz.txt | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)
 create mode 100644 abc.txt
 create mode 100644 xyz.txt
[other/three 9f9c15a] three
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'someref'
[A 443d0d2] A5
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[someref 065b9f3] some
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to branch 'master'
[master a24e200] 2
 Author: A U Thor <author@example.com>
 7 files changed, 7 insertions(+), 7 deletions(-)
Switched to branch 'C'
[master 95cfde6] master2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[C f01c181] C3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 32e7f0b] master3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
[C 406947e] C4
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 427c67e] master4
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - setup

expecting success: 

	compare rev-parse "subspace/one subspace/two" "--glob=refs/heads/subspace/*"


[master 72c7eca] 3
 Author: A U Thor <author@example.com>
 7 files changed, 7 insertions(+), 7 deletions(-)
Switched to branch 'A'
ok 2 - rev-parse --glob=refs/heads/subspace/*

expecting success: 

	compare rev-parse "subspace/one subspace/two" "--glob=heads/subspace/*"


Merge made by the 'ours' strategy.
ok 3 - rev-parse --glob=heads/subspace/*

expecting success: 

	compare rev-parse "subspace/one subspace/two" "--glob=refs/heads/subspace/"


Cloning into 'sub1'...
ok 4 - rev-parse --glob=refs/heads/subspace/

expecting success: 

	compare rev-parse "subspace/one subspace/two" "--glob=heads/subspace/"


[A 806c60f] A7
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
done.
ok 5 - rev-parse --glob=heads/subspace/

expecting success: 

	compare rev-parse "subspace/one subspace/two" "--glob=heads/subspace"


[master 680e5c3] 4
 Author: A U Thor <author@example.com>
 7 files changed, 7 insertions(+), 7 deletions(-)
ok 6 - rev-parse --glob=heads/subspace

checking known breakage: 

	compare rev-parse "subspace/one subspace/two" "--glob heads/subspace"


fatal: ambiguous argument 'heads/subspace': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
not ok 7 - rev-parse accepts --glob as detached option # TODO known breakage

checking known breakage: 

	compare rev-parse "master" "--glob --symbolic master"


--- expected	2015-12-16 11:02:00.649564860 +0000
+++ actual	2015-12-16 11:02:00.665564860 +0000
@@ -1 +1,2 @@
-427c67e8294a2917294f816398b918414251bb36
+--glob
+master
not ok 8 - rev-parse is not confused by option-like glob # TODO known breakage

expecting success: 

	compare rev-parse "subspace/one subspace/two" "--branches=subspace/*"


ok 9 - rev-parse --branches=subspace/*

expecting success: 

	compare rev-parse "subspace/one subspace/two" "--branches=subspace/"


Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
ok 1 - set up rev-list --graph test

expecting success: 
	rm -f expected &&
	echo "* $A7" >> expected &&
	echo "*   $A6" >> expected &&
	echo "|\\  " >> expected &&
	echo "| * $C4" >> expected &&
	echo "| * $C3" >> expected &&
	echo "* | $A5" >> expected &&
	echo "| |     " >> expected &&
	echo "|  \\    " >> expected &&
	echo "*-. \\   $A4" >> expected &&
	echo "|\\ \\ \\  " >> expected &&
	echo "| | |/  " >> expected &&
	echo "| | * $C2" >> expected &&
	echo "| | * $C1" >> expected &&
	echo "| * | $B2" >> expected &&
	echo "| * | $B1" >> expected &&
	echo "* | | $A3" >> expected &&
	echo "| |/  " >> expected &&
	echo "|/|   " >> expected &&
	echo "* | $A2" >> expected &&
	echo "|/  " >> expected &&
	echo "* $A1" >> expected &&
	git rev-list --graph --all > actual &&
	test_cmp expected actual
	
ok 10 - rev-parse --branches=subspace/

expecting success: 

	compare rev-parse "subspace/one subspace/two" "--branches=subspace"


[master 496e2a9] 5
 Author: A U Thor <author@example.com>
 7 files changed, 7 insertions(+), 7 deletions(-)
ok 2 - --graph --all

expecting success: 
	rm -f expected &&
	git tag -d A4 &&
	echo "* $A7" >> expected &&
	echo "*   $A6" >> expected &&
	echo "|\\  " >> expected &&
	echo "| * $C4" >> expected &&
	echo "| * $C3" >> expected &&
	echo "* | $A5" >> expected &&
	echo "| |     " >> expected &&
	echo "|  \\    " >> expected &&
	echo "*-. \\   $A4" >> expected &&
	echo "|\\ \\ \\  " >> expected &&
	echo "| | |/  " >> expected &&
	echo "| | * $C2" >> expected &&
	echo "| | * $C1" >> expected &&
	echo "| * | $B2" >> expected &&
	echo "| * | $B1" >> expected &&
	echo "* | | $A3" >> expected &&
	echo "| |/  " >> expected &&
	echo "|/|   " >> expected &&
	echo "* | $A2" >> expected &&
	echo "|/  " >> expected &&
	echo "* $A1" >> expected &&
	git rev-list --graph --all --simplify-by-decoration > actual &&
	test_cmp expected actual
	
ok 11 - rev-parse --branches=subspace

expecting success: 

	compare rev-parse "subspace/one subspace/two other/three" "--glob=heads/subspace/* --glob=heads/other/*"


Deleted tag 'A4' (was e614451)
ok 12 - rev-parse --glob=heads/subspace/* --glob=heads/other/*

expecting success: 

	compare rev-parse "master" "--glob=heads/someref/* master"


Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
ok 3 - --graph --simplify-by-decoration

expecting success: 
	git tag -d B2 &&
	git tag -d B1 &&
	git branch -d B

Deleted tag 'B2' (was e76ada1)
Deleted branch replace_sub1_with_file (was 88f15cf).
Deleted tag 'B1' (was 4accf7e)
ok 13 - rev-parse --glob=heads/someref/* master

expecting success: 

	compare rev-parse "master other/three someref subspace-x subspace/one subspace/two" "--glob=heads/*"


Switched to a new branch 'replace_sub1_with_file'
Deleted branch B (was e76ada1).
ok 4 - setup: get rid of decorations on B

expecting success: 
	rm -f expected &&
	echo "* $A7" >> expected &&
	echo "*   $A6" >> expected &&
	echo "|\\  " >> expected &&
	echo "| * $C4" >> expected &&
	echo "| * $C3" >> expected &&
	echo "* | $A5" >> expected &&
	echo "* |   $A4" >> expected &&
	echo "|\\ \\  " >> expected &&
	echo "| |/  " >> expected &&
	echo "| * $C2" >> expected &&
	echo "| * $C1" >> expected &&
	echo "* | $A3" >> expected &&
	echo "|/  " >> expected &&
	echo "* $A2" >> expected &&
	echo "* $A1" >> expected &&
	git rev-list --graph --simplify-by-decoration --all > actual &&
	test_cmp expected actual
	
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
ok 14 - rev-parse --glob=heads/*

expecting success: 

	compare rev-parse "foo/bar" "--tags=foo"


ok 5 - --graph --simplify-by-decoration prune branch B

expecting success: 
	rm -f expected &&
	echo "* $A7" >> expected &&
	echo "*   $A6" >> expected &&
	echo "|\\  " >> expected &&
	echo "| * $C4" >> expected &&
	echo "* | $A5" >> expected &&
	echo "* |   $A4" >> expected &&
	echo "|\\ \\  " >> expected &&
	echo "| |/  " >> expected &&
	echo "* | $A3" >> expected &&
	echo "|/  " >> expected &&
	echo "* $A2" >> expected &&
	git rev-list --graph --full-history --all -- bar.txt > actual &&
	test_cmp expected actual
	
[master c5757f4] 6
 Author: A U Thor <author@example.com>
 7 files changed, 7 insertions(+), 7 deletions(-)
ok 15 - rev-parse --tags=foo

expecting success: 

	compare rev-parse "foo/baz" "--remotes=foo"


ok 6 - --graph --full-history -- bar.txt

expecting success: 
	rm -f expected &&
	echo "* $A7" >> expected &&
	echo "*   $A6" >> expected &&
	echo "|\\  " >> expected &&
	echo "| * $C4" >> expected &&
	echo "* | $A5" >> expected &&
	echo "* | $A3" >> expected &&
	echo "|/  " >> expected &&
	echo "* $A2" >> expected &&
	git rev-list --graph --full-history --simplify-merges --all \
		-- bar.txt > actual &&
	test_cmp expected actual
	
ok 16 - rev-parse --remotes=foo

expecting success: 
	compare rev-parse "--exclude=*/* --branches" "master someref subspace-x"

ok 7 - --graph --full-history --simplify-merges -- bar.txt

expecting success: 
	rm -f expected &&
	echo "* $A7" >> expected &&
	echo "* $A5" >> expected &&
	echo "* $A3" >> expected &&
	echo "| * $C4" >> expected &&
	echo "|/  " >> expected &&
	echo "* $A2" >> expected &&
	git rev-list --graph --all -- bar.txt > actual &&
	test_cmp expected actual
	
ok 17 - rev-parse --exclude with --branches

expecting success: 
	compare rev-parse "--exclude=refs/remotes/* --all" "--branches --tags"

Updating 041e421..88f15cf
Fast-forward
ok 8 - --graph -- bar.txt

expecting success: 
	rm -f expected &&
	echo "* $A7" >> expected &&
	echo "* $A6" >> expected &&
	echo "* $A5" >> expected &&
	echo "* $A4" >> expected &&
	echo "* $A3" >> expected &&
	echo "| * $C4" >> expected &&
	echo "| * $C3" >> expected &&
	echo "| * $C2" >> expected &&
	echo "| * $C1" >> expected &&
	echo "|/  " >> expected &&
	echo "* $A2" >> expected &&
	echo "* $A1" >> expected &&
	git rev-list --graph --sparse --all -- bar.txt > actual &&
	test_cmp expected actual
	
 .gitmodules | 4 ----
 sub1        | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
test_must_fail: command succeeded: git_pull_ff replace_sub1_with_file
ok 18 - rev-parse --exclude with --all

expecting success: 
	compare rev-parse "--exclude=refs/remotes/* --exclude=refs/tags/* --all" --branches

ok 9 - --graph --sparse -- bar.txt

expecting success: 
	rm -f expected &&
	echo "* $A7" >> expected &&
	echo "* $A6" >> expected &&
	echo "* $A5" >> expected &&
	echo "*   $A4" >> expected &&
	echo "|\\  " >> expected &&
	echo "| * $B2" >> expected &&
	echo "| * $B1" >> expected &&
	echo "* $A3" >> expected &&
	git rev-list --graph --all ^C4 > actual &&
	test_cmp expected actual
	
not ok 24 - git_pull_ff: 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
		)
	
[master a21e804] 7
 Author: A U Thor <author@example.com>
 7 files changed, 7 insertions(+), 7 deletions(-)
ok 19 - rev-parse accumulates multiple --exclude

expecting success: 

	compare rev-list "subspace/one subspace/two" "--glob=refs/heads/subspace/*"


ok 10 - --graph ^C4

expecting success: 
	rm -f expected &&
	echo "* $A7" >> expected &&
	echo "*   $A6" >> expected &&
	echo "|\\  " >> expected &&
	echo "| * $C4" >> expected &&
	echo "* $A5" >> expected &&
	echo "*   $A4" >> expected &&
	echo "|\\  " >> expected &&
	echo "| * $B2" >> expected &&
	echo "| * $B1" >> expected &&
	echo "* $A3" >> expected &&
	git rev-list --graph --all ^C3 > actual &&
	test_cmp expected actual
	
Switched to a new branch 'side-1'
ok 20 - rev-list --glob=refs/heads/subspace/*

expecting success: 

	compare rev-list "subspace/one subspace/two" "--glob refs/heads/subspace/*"


ok 11 - --graph ^C3

expecting success: 
	rm -f expected &&
	echo "* $A7" >> expected &&
	echo "*   $A6" >> expected &&
	echo "|\\  " >> expected &&
	echo "| * $C4" >> expected &&
	echo "* | $A5" >> expected &&
	echo "| |     " >> expected &&
	echo "|  \\    " >> expected &&
	echo "*-. \\   $A4" >> expected &&
	echo "|\\ \\ \\  " >> expected &&
	echo "| * | | $B2" >> expected &&
	echo "| * | | $B1" >> expected &&
	echo "* | | | $A3" >> expected &&
	echo "o | | | $A2" >> expected &&
	echo "|/ / /  " >> expected &&
	echo "o | | $A1" >> expected &&
	echo " / /  " >> expected &&
	echo "| o $C3" >> expected &&
	echo "|/  " >> expected &&
	echo "o $C2" >> expected &&
	git rev-list --graph --boundary --all ^C3 > actual &&
	test_cmp expected actual
	
[side-1 c52bcff] side-1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'side-2'
ok 21 - rev-list --glob refs/heads/subspace/*

expecting success: 

	compare rev-list "master" "--glob -0 master"


ok 12 - --graph --boundary ^C3

Cloning into 'submodule_update'...
# passed all 12 test(s)
1..12
[side-2 fe893aa] side-2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 22 - rev-list not confused by option-like --glob arg

expecting success: 

	compare rev-list "subspace/one subspace/two" "--glob=heads/subspace/*"


Switched to a new branch 'side-3'
done.
ok 23 - rev-list --glob=heads/subspace/*

expecting success: 

	compare rev-list "subspace/one subspace/two" "--glob=refs/heads/subspace/"


*** t6019-rev-list-ancestry-path.sh ***
[side-3 48694b2] side-3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 24 - rev-list --glob=refs/heads/subspace/

expecting success: 

	compare rev-list "subspace/one subspace/two" "--glob=heads/subspace/"


Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Switched to a new branch 'side-4'
ok 25 - rev-list --glob=heads/subspace/

expecting success: 

	compare rev-list "subspace/one subspace/two" "--glob=heads/subspace"


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6019-rev-list-ancestry-path/.git/
[side-4 e31c210] side-4
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
expecting success: 
	test_commit A &&
	test_commit B &&
	test_commit C &&
	test_commit D &&
	test_commit E &&
	test_commit F &&
	git reset --hard C &&
	test_commit G &&
	test_merge E H &&
	test_commit I &&
	test_merge F J &&
	git reset --hard A &&
	test_commit K &&
	test_merge J L &&
	test_commit M

ok 26 - rev-list --glob=heads/subspace

expecting success: 

	compare rev-list "subspace/one subspace/two" "--branches=subspace/*"


Switched to a new branch 'side-5'
[master (root-commit) 0ddfaf1] A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 A.t
ok 27 - rev-list --branches=subspace/*

expecting success: 

	compare rev-list "subspace/one subspace/two" "--branches=subspace/"


[side-5 5786a4a] side-5
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 28 - rev-list --branches=subspace/

expecting success: 

	compare rev-list "subspace/one subspace/two" "--branches=subspace"


[master d9df450] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 B.t
Switched to a new branch 'side-6'
ok 29 - rev-list --branches=subspace

expecting success: 

	compare rev-list "master subspace-x someref other/three subspace/one subspace/two" "--branches"


[side-6 6879e94] side-6
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 35a8500] C
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 C.t
Switched to a new branch 'side-7'
ok 30 - rev-list --branches

expecting success: 

	compare rev-list "master" "--glob=heads/someref/* master"


Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 31 - rev-list --glob=heads/someref/* master

expecting success: 

	compare rev-list "subspace/one subspace/two other/three" "--glob=heads/subspace/* --glob=heads/other/*"


[master be8f64f] D
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 D.t
[side-7 a65952b] side-7
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - setup

expecting success: 
			git $cmd $(cat input) >expect &&
			git $cmd --stdin <input >actual &&
			sed -e "s/^/input /" input &&
			sed -e "s/^/output /" expect &&
			test_cmp expect actual
		
ok 32 - rev-list --glob=heads/subspace/* --glob=heads/other/*

expecting success: 

	compare rev-list "master other/three someref subspace-x subspace/one subspace/two" "--glob=heads/*"


input master
[master ee2ad00] E
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 E.t
output a21e80422823d665efde155c070bfdfb97c997e8
output c5757f4c5b3e9d8ed81f0ef337de57e6bef4e611
output 496e2a9cb78c7f1f05c123ba68719cbb2850d28b
output 680e5c39478a7f99f59d423c9d29c54c4cf23f21
output 72c7ecae8123b34f77d6ec686c9dc4d38558e420
output a24e2002dc3e76acd7262fac9934308ed5876528
output 4c7c79994a10176d26cb379d2f480e705687de5f
output b2718dfcca09d482353ed124d94698c230076ecb
ok 2 - check rev-list master

expecting success: 
			git $cmd $(cat input) >expect &&
			git $cmd --stdin <input >actual &&
			sed -e "s/^/input /" input &&
			sed -e "s/^/output /" expect &&
			test_cmp expect actual
		
ok 33 - rev-list --glob=heads/*

expecting success: 

	compare rev-list "foo/bar" "--tags=foo"


Cloning into 'sub1'...
ok 34 - rev-list --tags=foo

expecting success: 

	compare rev-list "foo/bar" "--tags"


[master 5374d8c] F
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 F.t
input master
HEAD is now at 35a8500 C
ok 35 - rev-list --tags

expecting success: 

	compare rev-list "foo/baz" "--remotes=foo"


output commit a21e80422823d665efde155c070bfdfb97c997e8
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:20:13 2005 -0700
output 
output     7
output 
output  file-1 | 2 +-
output  file-2 | 2 +-
output  file-3 | 2 +-
output  file-4 | 2 +-
output  file-5 | 2 +-
output  file-6 | 2 +-
output  file-7 | 2 +-
output  7 files changed, 7 insertions(+), 7 deletions(-)
output 
output commit c5757f4c5b3e9d8ed81f0ef337de57e6bef4e611
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:19:13 2005 -0700
output 
output     6
output 
output  file-1 | 2 +-
output  file-2 | 2 +-
output  file-3 | 2 +-
output  file-4 | 2 +-
output  file-5 | 2 +-
output  file-6 | 2 +-
output  file-7 | 2 +-
output  7 files changed, 7 insertions(+), 7 deletions(-)
output 
output commit 496e2a9cb78c7f1f05c123ba68719cbb2850d28b
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:18:13 2005 -0700
output 
output     5
output 
output  file-1 | 2 +-
output  file-2 | 2 +-
output  file-3 | 2 +-
output  file-4 | 2 +-
output  file-5 | 2 +-
output  file-6 | 2 +-
output  file-7 | 2 +-
output  7 files changed, 7 insertions(+), 7 deletions(-)
output 
output commit 680e5c39478a7f99f59d423c9d29c54c4cf23f21
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:17:13 2005 -0700
output 
output     4
output 
output  file-1 | 2 +-
output  file-2 | 2 +-
output  file-3 | 2 +-
output  file-4 | 2 +-
output  file-5 | 2 +-
output  file-6 | 2 +-
output  file-7 | 2 +-
output  7 files changed, 7 insertions(+), 7 deletions(-)
output 
output commit 72c7ecae8123b34f77d6ec686c9dc4d38558e420
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:16:13 2005 -0700
output 
output     3
output 
output  file-1 | 2 +-
output  file-2 | 2 +-
output  file-3 | 2 +-
output  file-4 | 2 +-
output  file-5 | 2 +-
output  file-6 | 2 +-
output  file-7 | 2 +-
output  7 files changed, 7 insertions(+), 7 deletions(-)
output 
output commit a24e2002dc3e76acd7262fac9934308ed5876528
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:15:13 2005 -0700
output 
output     2
output 
output  file-1 | 2 +-
output  file-2 | 2 +-
output  file-3 | 2 +-
output  file-4 | 2 +-
output  file-5 | 2 +-
output  file-6 | 2 +-
output  file-7 | 2 +-
output  7 files changed, 7 insertions(+), 7 deletions(-)
output 
output commit 4c7c79994a10176d26cb379d2f480e705687de5f
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:14:13 2005 -0700
output 
output     1
output 
output  file-1 | 2 +-
output  file-2 | 2 +-
output  file-3 | 2 +-
output  file-4 | 2 +-
output  file-5 | 2 +-
output  file-6 | 2 +-
output  file-7 | 2 +-
output  7 files changed, 7 insertions(+), 7 deletions(-)
output 
output commit b2718dfcca09d482353ed124d94698c230076ecb
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:13:13 2005 -0700
output 
output     0
output 
output  file-1 | 1 +
output  file-2 | 1 +
output  file-3 | 1 +
output  file-4 | 1 +
output  file-5 | 1 +
output  file-6 | 1 +
output  file-7 | 1 +
output  7 files changed, 7 insertions(+)
done.
ok 3 - check log --stat master

expecting success: 
			git $cmd $(cat input) >expect &&
			git $cmd --stdin <input >actual &&
			sed -e "s/^/input /" input &&
			sed -e "s/^/output /" expect &&
			test_cmp expect actual
		
[master fa55005] G
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 G.t
ok 36 - rev-list --remotes=foo

expecting success: 
	compare rev-list "--exclude=*/* --branches" "master someref subspace-x"

input side-1
input ^side-4
output c52bcff3af5ff0d662f1e767ea6739034b17f0ea
output c5757f4c5b3e9d8ed81f0ef337de57e6bef4e611
output 496e2a9cb78c7f1f05c123ba68719cbb2850d28b
output 680e5c39478a7f99f59d423c9d29c54c4cf23f21
ok 4 - check rev-list side-1 ^side-4

ok 37 - rev-list --exclude with --branches

expecting success: 
	compare rev-list "--exclude=refs/remotes/* --all" "--branches --tags"

expecting success: 
			git $cmd $(cat input) >expect &&
			git $cmd --stdin <input >actual &&
			sed -e "s/^/input /" input &&
			sed -e "s/^/output /" expect &&
			test_cmp expect actual
		
Merge made by the 'ours' strategy.
ok 38 - rev-list --exclude with --all

expecting success: 
	compare rev-list "--exclude=refs/remotes/* --exclude=refs/tags/* --all" --branches

input side-1
input ^side-4
[master 4e719b9] I
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 I.t
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
output commit c52bcff3af5ff0d662f1e767ea6739034b17f0ea
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:21:13 2005 -0700
output 
output     side-1
output 
output  file-1 | 2 +-
output  1 file changed, 1 insertion(+), 1 deletion(-)
output 
output commit c5757f4c5b3e9d8ed81f0ef337de57e6bef4e611
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:19:13 2005 -0700
output 
output     6
output 
output  file-1 | 2 +-
output  file-2 | 2 +-
output  file-3 | 2 +-
output  file-4 | 2 +-
output  file-5 | 2 +-
output  file-6 | 2 +-
output  file-7 | 2 +-
output  7 files changed, 7 insertions(+), 7 deletions(-)
output 
output commit 496e2a9cb78c7f1f05c123ba68719cbb2850d28b
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:18:13 2005 -0700
output 
output     5
output 
output  file-1 | 2 +-
output  file-2 | 2 +-
output  file-3 | 2 +-
output  file-4 | 2 +-
output  file-5 | 2 +-
output  file-6 | 2 +-
output  file-7 | 2 +-
output  7 files changed, 7 insertions(+), 7 deletions(-)
output 
output commit 680e5c39478a7f99f59d423c9d29c54c4cf23f21
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:17:13 2005 -0700
output 
output     4
output 
output  file-1 | 2 +-
output  file-2 | 2 +-
output  file-3 | 2 +-
output  file-4 | 2 +-
output  file-5 | 2 +-
output  file-6 | 2 +-
output  file-7 | 2 +-
output  7 files changed, 7 insertions(+), 7 deletions(-)
ok 39 - rev-list accumulates multiple --exclude

ok 5 - check log --stat side-1 ^side-4

checking known breakage: 
	>expect &&
	git rev-list --stdin <expect >actual &&
	test_cmp expect actual

expecting success: 
			git $cmd $(cat input) >expect &&
			git $cmd --stdin <input >actual &&
			sed -e "s/^/input /" input &&
			sed -e "s/^/output /" expect &&
			test_cmp expect actual
		
usage: git rev-list [OPTION] <commit-id>... [ -- paths... ]
  limiting output:
    --max-count=<n>
    --max-age=<epoch>
    --min-age=<epoch>
    --sparse
    --no-merges
    --min-parents=<n>
    --no-min-parents
    --max-parents=<n>
    --no-max-parents
    --remove-empty
    --all
    --branches
    --tags
    --remotes
    --stdin
    --quiet
  ordering output:
    --topo-order
    --date-order
    --reverse
  formatting output:
    --parents
    --children
    --objects | --objects-edge
    --unpacked
    --header | --pretty
    --abbrev=<n> | --no-abbrev
    --abbrev-commit
    --left-right
    --count
  special purpose:
    --bisect
    --bisect-vars
    --bisect-all
not ok 40 - rev-list may want to succeed with empty output on no input (1) # TODO known breakage

checking known breakage: 
	>expect &&
	git rev-list --exclude=* --all >actual &&
	test_cmp expect actual

usage: git rev-list [OPTION] <commit-id>... [ -- paths... ]
  limiting output:
    --max-count=<n>
    --max-age=<epoch>
    --min-age=<epoch>
    --sparse
    --no-merges
    --min-parents=<n>
    --no-min-parents
    --max-parents=<n>
    --no-max-parents
    --remove-empty
    --all
    --branches
    --tags
    --remotes
    --stdin
    --quiet
  ordering output:
    --topo-order
    --date-order
    --reverse
  formatting output:
    --parents
    --children
    --objects | --objects-edge
    --unpacked
    --header | --pretty
    --abbrev=<n> | --no-abbrev
    --abbrev-commit
    --left-right
    --count
  special purpose:
    --bisect
    --bisect-vars
    --bisect-all
not ok 41 - rev-list may want to succeed with empty output on no input (2) # TODO known breakage

checking known breakage: 
	(
		test_create_repo empty &&
		cd empty &&
		>expect &&
		git rev-list --all >actual &&
		test_cmp expect actual
	)

Merge made by the 'ours' strategy.
input side-1
input ^side-7
input --
output c52bcff3af5ff0d662f1e767ea6739034b17f0ea
output c5757f4c5b3e9d8ed81f0ef337de57e6bef4e611
output 496e2a9cb78c7f1f05c123ba68719cbb2850d28b
output 680e5c39478a7f99f59d423c9d29c54c4cf23f21
output 72c7ecae8123b34f77d6ec686c9dc4d38558e420
output a24e2002dc3e76acd7262fac9934308ed5876528
output 4c7c79994a10176d26cb379d2f480e705687de5f
ok 6 - check rev-list side-1 ^side-7 --

expecting success: 
			git $cmd $(cat input) >expect &&
			git $cmd --stdin <input >actual &&
			sed -e "s/^/input /" input &&
			sed -e "s/^/output /" expect &&
			test_cmp expect actual
		
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6018-rev-list-glob/empty/.git/
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
usage: git rev-list [OPTION] <commit-id>... [ -- paths... ]
  limiting output:
    --max-count=<n>
    --max-age=<epoch>
    --min-age=<epoch>
    --sparse
    --no-merges
    --min-parents=<n>
    --no-min-parents
    --max-parents=<n>
    --no-max-parents
    --remove-empty
    --all
    --branches
    --tags
    --remotes
    --stdin
    --quiet
  ordering output:
    --topo-order
    --date-order
    --reverse
  formatting output:
    --parents
    --children
    --objects | --objects-edge
    --unpacked
    --header | --pretty
    --abbrev=<n> | --no-abbrev
    --abbrev-commit
    --left-right
    --count
  special purpose:
    --bisect
    --bisect-vars
HEAD is now at 0ddfaf1 A
    --bisect-all
not ok 42 - rev-list may want to succeed with empty output on no input (3) # TODO known breakage

expecting success: 

	compare shortlog "subspace/one subspace/two" --branches=subspace &&
	compare shortlog \
	  "master subspace-x someref other/three subspace/one subspace/two" \
	  --branches &&
	compare shortlog master "--glob=heads/someref/* master" &&
	compare shortlog "subspace/one subspace/two other/three" \
	  "--glob=heads/subspace/* --glob=heads/other/*" &&
	compare shortlog \
	  "master other/three someref subspace-x subspace/one subspace/two" \
	  "--glob=heads/*" &&
	compare shortlog foo/bar --tags=foo &&
	compare shortlog foo/bar --tags &&
	compare shortlog foo/baz --remotes=foo


[master 0f470b0] K
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 K.t
input side-1
input ^side-7
input --
output commit c52bcff3af5ff0d662f1e767ea6739034b17f0ea
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:21:13 2005 -0700
output 
output     side-1
output 
output  file-1 | 2 +-
output  1 file changed, 1 insertion(+), 1 deletion(-)
output 
output commit c5757f4c5b3e9d8ed81f0ef337de57e6bef4e611
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:19:13 2005 -0700
output 
output     6
output 
output  file-1 | 2 +-
output  file-2 | 2 +-
output  file-3 | 2 +-
output  file-4 | 2 +-
output  file-5 | 2 +-
output  file-6 | 2 +-
output  file-7 | 2 +-
output  7 files changed, 7 insertions(+), 7 deletions(-)
output 
output commit 496e2a9cb78c7f1f05c123ba68719cbb2850d28b
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:18:13 2005 -0700
output 
output     5
output 
output  file-1 | 2 +-
output  file-2 | 2 +-
output  file-3 | 2 +-
output  file-4 | 2 +-
output  file-5 | 2 +-
output  file-6 | 2 +-
output  file-7 | 2 +-
output  7 files changed, 7 insertions(+), 7 deletions(-)
output 
output commit 680e5c39478a7f99f59d423c9d29c54c4cf23f21
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:17:13 2005 -0700
output 
output     4
output 
output  file-1 | 2 +-
output  file-2 | 2 +-
output  file-3 | 2 +-
output  file-4 | 2 +-
output  file-5 | 2 +-
output  file-6 | 2 +-
output  file-7 | 2 +-
output  7 files changed, 7 insertions(+), 7 deletions(-)
output 
output commit 72c7ecae8123b34f77d6ec686c9dc4d38558e420
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:16:13 2005 -0700
output 
output     3
output 
output  file-1 | 2 +-
output  file-2 | 2 +-
output  file-3 | 2 +-
output  file-4 | 2 +-
output  file-5 | 2 +-
output  file-6 | 2 +-
output  file-7 | 2 +-
output  7 files changed, 7 insertions(+), 7 deletions(-)
output 
output commit a24e2002dc3e76acd7262fac9934308ed5876528
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:15:13 2005 -0700
output 
output     2
output 
output  file-1 | 2 +-
output  file-2 | 2 +-
output  file-3 | 2 +-
output  file-4 | 2 +-
output  file-5 | 2 +-
output  file-6 | 2 +-
output  file-7 | 2 +-
output  7 files changed, 7 insertions(+), 7 deletions(-)
output 
output commit 4c7c79994a10176d26cb379d2f480e705687de5f
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:14:13 2005 -0700
output 
output     1
output 
output  file-1 | 2 +-
output  file-2 | 2 +-
output  file-3 | 2 +-
output  file-4 | 2 +-
output  file-5 | 2 +-
output  file-6 | 2 +-
output  file-7 | 2 +-
output  7 files changed, 7 insertions(+), 7 deletions(-)
ok 7 - check log --stat side-1 ^side-7 --

expecting success: 
			git $cmd $(cat input) >expect &&
			git $cmd --stdin <input >actual &&
			sed -e "s/^/input /" input &&
			sed -e "s/^/output /" expect &&
			test_cmp expect actual
		
Merge made by the 'ours' strategy.
Deleted branch replace_sub1_with_file (was 88f15cf).
input side-1
input ^side-7
input --
input file-1
output c52bcff3af5ff0d662f1e767ea6739034b17f0ea
output c5757f4c5b3e9d8ed81f0ef337de57e6bef4e611
output 496e2a9cb78c7f1f05c123ba68719cbb2850d28b
output 680e5c39478a7f99f59d423c9d29c54c4cf23f21
output 72c7ecae8123b34f77d6ec686c9dc4d38558e420
output a24e2002dc3e76acd7262fac9934308ed5876528
output 4c7c79994a10176d26cb379d2f480e705687de5f
ok 8 - check rev-list side-1 ^side-7 -- file-1

expecting success: 
			git $cmd $(cat input) >expect &&
			git $cmd --stdin <input >actual &&
			sed -e "s/^/input /" input &&
			sed -e "s/^/output /" expect &&
			test_cmp expect actual
		
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.
[master bcafe1b] M
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 M.t
input side-1
input ^side-7
input --
input file-1
ok 1 - setup

expecting success: 
	for c in E F G H I J K L M; do echo $c; done >expect &&
	git rev-list --format=%s D..M |
	sed -e "/^commit /d" |
	sort >actual &&
	test_cmp expect actual

output commit c52bcff3af5ff0d662f1e767ea6739034b17f0ea
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:21:13 2005 -0700
output 
output     side-1
output 
output  file-1 | 2 +-
output  1 file changed, 1 insertion(+), 1 deletion(-)
output 
output commit c5757f4c5b3e9d8ed81f0ef337de57e6bef4e611
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:19:13 2005 -0700
output 
output     6
output 
output  file-1 | 2 +-
output  1 file changed, 1 insertion(+), 1 deletion(-)
output 
output commit 496e2a9cb78c7f1f05c123ba68719cbb2850d28b
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:18:13 2005 -0700
output 
output     5
output 
output  file-1 | 2 +-
output  1 file changed, 1 insertion(+), 1 deletion(-)
output 
output commit 680e5c39478a7f99f59d423c9d29c54c4cf23f21
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:17:13 2005 -0700
output 
output     4
output 
output  file-1 | 2 +-
output  1 file changed, 1 insertion(+), 1 deletion(-)
output 
output commit 72c7ecae8123b34f77d6ec686c9dc4d38558e420
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:16:13 2005 -0700
output 
output     3
output 
output  file-1 | 2 +-
output  1 file changed, 1 insertion(+), 1 deletion(-)
output 
output commit a24e2002dc3e76acd7262fac9934308ed5876528
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:15:13 2005 -0700
output 
output     2
output 
output  file-1 | 2 +-
output  1 file changed, 1 insertion(+), 1 deletion(-)
output 
output commit 4c7c79994a10176d26cb379d2f480e705687de5f
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:14:13 2005 -0700
output 
output     1
output 
output  file-1 | 2 +-
output  1 file changed, 1 insertion(+), 1 deletion(-)
ok 9 - check log --stat side-1 ^side-7 -- file-1

expecting success: 
			git $cmd $(cat input) >expect &&
			git $cmd --stdin <input >actual &&
			sed -e "s/^/input /" input &&
			sed -e "s/^/output /" expect &&
			test_cmp expect actual
		
ok 2 - rev-list D..M

expecting success: 
	for c in E F H I J L M; do echo $c; done >expect &&
	git rev-list --ancestry-path --format=%s D..M |
	sed -e "/^commit /d" |
	sort >actual &&
	test_cmp expect actual

input side-1
input ^side-7
input --
input file-2
ok 3 - rev-list --ancestry-path D..M

expecting success: 
	echo M >expect &&
	git rev-list --format=%s D..M -- M.t |
	sed -e "/^commit /d" >actual &&
	test_cmp expect actual

output c5757f4c5b3e9d8ed81f0ef337de57e6bef4e611
output 496e2a9cb78c7f1f05c123ba68719cbb2850d28b
output 680e5c39478a7f99f59d423c9d29c54c4cf23f21
output 72c7ecae8123b34f77d6ec686c9dc4d38558e420
output a24e2002dc3e76acd7262fac9934308ed5876528
output 4c7c79994a10176d26cb379d2f480e705687de5f
ok 10 - check rev-list side-1 ^side-7 -- file-2

expecting success: 
			git $cmd $(cat input) >expect &&
			git $cmd --stdin <input >actual &&
			sed -e "s/^/input /" input &&
			sed -e "s/^/output /" expect &&
			test_cmp expect actual
		
ok 4 - rev-list D..M -- M.t

expecting success: 
	echo M >expect &&
	git rev-list --ancestry-path --format=%s D..M -- M.t |
	sed -e "/^commit /d" >actual &&
	test_cmp expect actual

ok 43 - shortlog accepts --glob/--tags/--remotes

checking known breakage: 

	compare shortlog \
	  "master other/three someref subspace-x subspace/one subspace/two" \
	  "--glob heads/*"


Updating 041e421..88f15cf
Fast-forward
 .gitmodules | 4 ----
 sub1        | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
ok 5 - rev-list --ancestry-path D..M -- M.t

expecting success: 
	for c in F G H I; do echo $c; done >expect &&
	git rev-list --format=%s F...I |
	sed -e "/^commit /d" |
	sort >actual &&
	test_cmp expect actual

test_must_fail: command succeeded: git_pull_ff replace_sub1_with_file
error: unknown option `--glob'
usage: git shortlog [<options>] [<revision-range>] [[--] [<path>...]]

    -n, --numbered        sort output according to the number of commits per author
    -s, --summary         Suppress commit descriptions, only provides commit count
    -e, --email           Show the email address of each author
    -w[<w[,i1[,i2]]>]     Linewrap output

not ok 44 - shortlog accepts --glob as detached option # TODO known breakage

checking known breakage: 

	compare shortlog master "--glob -e master"


input side-1
input ^side-7
input --
input file-2
ok 6 - rev-list F...I

expecting success: 
	for c in F H I; do echo $c; done >expect &&
	git rev-list --ancestry-path --format=%s F...I |
	sed -e "/^commit /d" |
	sort >actual &&
	test_cmp expect actual

not ok 25 - git_pull_ff: 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
		)
	
output commit c5757f4c5b3e9d8ed81f0ef337de57e6bef4e611
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:19:13 2005 -0700
output 
output     6
output 
output  file-2 | 2 +-
output  1 file changed, 1 insertion(+), 1 deletion(-)
output 
output commit 496e2a9cb78c7f1f05c123ba68719cbb2850d28b
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:18:13 2005 -0700
output 
output     5
output 
output  file-2 | 2 +-
output  1 file changed, 1 insertion(+), 1 deletion(-)
output 
output commit 680e5c39478a7f99f59d423c9d29c54c4cf23f21
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:17:13 2005 -0700
output 
output     4
output 
output  file-2 | 2 +-
output  1 file changed, 1 insertion(+), 1 deletion(-)
output 
output commit 72c7ecae8123b34f77d6ec686c9dc4d38558e420
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:16:13 2005 -0700
output 
output     3
output 
output  file-2 | 2 +-
output  1 file changed, 1 insertion(+), 1 deletion(-)
output 
output commit a24e2002dc3e76acd7262fac9934308ed5876528
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:15:13 2005 -0700
output 
output     2
output 
output  file-2 | 2 +-
output  1 file changed, 1 insertion(+), 1 deletion(-)
output 
output commit 4c7c79994a10176d26cb379d2f480e705687de5f
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:14:13 2005 -0700
output 
output     1
output 
output  file-2 | 2 +-
output  1 file changed, 1 insertion(+), 1 deletion(-)
ok 11 - check log --stat side-1 ^side-7 -- file-2

expecting success: 
			git $cmd $(cat input) >expect &&
			git $cmd --stdin <input >actual &&
			sed -e "s/^/input /" input &&
			sed -e "s/^/output /" expect &&
			test_cmp expect actual
		
error: unknown option `--glob'
usage: git shortlog [<options>] [<revision-range>] [[--] [<path>...]]

    -n, --numbered        sort output according to the number of commits per author
    -s, --summary         Suppress commit descriptions, only provides commit count
    -e, --email           Show the email address of each author
    -w[<w[,i1[,i2]]>]     Linewrap output

not ok 45 - shortlog --glob is not confused by option-like argument # TODO known breakage

ok 7 - rev-list --ancestry-path F...I

expecting success: 
	>expect &&
	git rev-list --format=%s G..M -- G.t |
	sed -e "/^commit /d" >actual &&
	test_cmp expect actual

# still have 7 known breakage(s)
# passed all remaining 38 test(s)
1..45
ok 8 - rev-list G..M -- G.t

expecting success: 
	echo L >expect &&
	git rev-list --ancestry-path --format=%s G..M -- G.t |
	sed -e "/^commit /d" >actual &&
	test_cmp expect actual

input side-3
input ^side-4
input --
input file-3
output 48694b20de8c3a7d2a1cac0c842191d9a9f1dc4f
output 680e5c39478a7f99f59d423c9d29c54c4cf23f21
ok 12 - check rev-list side-3 ^side-4 -- file-3

expecting success: 
			git $cmd $(cat input) >expect &&
			git $cmd --stdin <input >actual &&
			sed -e "s/^/input /" input &&
			sed -e "s/^/output /" expect &&
			test_cmp expect actual
		
ok 9 - rev-list --ancestry-path G..M -- G.t

expecting success: 
	for c in G L; do echo $c; done >expect &&
	git rev-list --ancestry-path --simplify-merges --format=%s G^..M -- G.t |
	sed -e "/^commit /d" |
	sort >actual &&
	test_cmp expect actual

ok 10 - rev-list --ancestry-path --simplify-merges G^..M -- G.t

expecting success: 
	mkdir criss-cross &&
	(cd criss-cross &&
	 git init &&
	 test_commit A &&
	 git checkout -b xb master &&
	 test_commit B &&
	 git checkout -b xc master &&
	 test_commit C &&
	 git checkout -b xbc xb -- &&
	 git merge xc &&
	 git checkout -b xcb xc -- &&
	 git merge xb &&
	 git checkout master)

input side-3
input ^side-4
input --
input file-3
*** t6020-merge-df.sh ***
output commit 48694b20de8c3a7d2a1cac0c842191d9a9f1dc4f
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:23:13 2005 -0700
output 
output     side-3
output 
output  file-3 | 2 +-
output  1 file changed, 1 insertion(+), 1 deletion(-)
output 
output commit 680e5c39478a7f99f59d423c9d29c54c4cf23f21
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:17:13 2005 -0700
output 
output     4
output 
output  file-3 | 2 +-
output  1 file changed, 1 insertion(+), 1 deletion(-)
ok 13 - check log --stat side-3 ^side-4 -- file-3

expecting success: 
			git $cmd $(cat input) >expect &&
			git $cmd --stdin <input >actual &&
			sed -e "s/^/input /" input &&
			sed -e "s/^/output /" expect &&
			test_cmp expect actual
		
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6019-rev-list-ancestry-path/criss-cross/.git/
Cloning into 'submodule_update'...
[master (root-commit) 617a709] A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 A.t
input side-3
input ^side-2
output 48694b20de8c3a7d2a1cac0c842191d9a9f1dc4f
done.
ok 14 - check rev-list side-3 ^side-2

expecting success: 
			git $cmd $(cat input) >expect &&
			git $cmd --stdin <input >actual &&
			sed -e "s/^/input /" input &&
			sed -e "s/^/output /" expect &&
			test_cmp expect actual
		
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6020-merge-df/.git/
Switched to a new branch 'xb'
expecting success: 
	echo Hello >init &&
	git add init &&
	git commit -m initial &&

	git branch B &&
	mkdir dir &&
	echo foo >dir/foo &&
	git add dir/foo &&
	git commit -m "File: dir/foo" &&

	git checkout B &&
	echo file dir >dir &&
	git add dir &&
	git commit -m "File: dir"

input side-3
input ^side-2
output commit 48694b20de8c3a7d2a1cac0c842191d9a9f1dc4f
output Author: A U Thor <author@example.com>
output Date:   Thu Apr 7 15:23:13 2005 -0700
output 
output     side-3
output 
output  file-3 | 2 +-
output  1 file changed, 1 insertion(+), 1 deletion(-)
ok 15 - check log --stat side-3 ^side-2

expecting success: 
			git $cmd $(cat input) >expect &&
			git $cmd --stdin <input >actual &&
			sed -e "s/^/input /" input &&
			sed -e "s/^/output /" expect &&
			test_cmp expect actual
		
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
[xb 7dfaf8e] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 B.t
[master (root-commit) 05bb07b] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 init
input side-3
input ^side-2
input --
input file-1
Switched to a new branch 'xc'
ok 16 - check rev-list side-3 ^side-2 -- file-1

expecting success: 
			git $cmd $(cat input) >expect &&
			git $cmd --stdin <input >actual &&
			sed -e "s/^/input /" input &&
			sed -e "s/^/output /" expect &&
			test_cmp expect actual
		
[master c777f38] File: dir/foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 dir/foo
[xc cf5ea0b] C
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 C.t
Switched to branch 'B'
input side-3
input ^side-2
input --
input file-1
ok 17 - check log --stat side-3 ^side-2 -- file-1

expecting success: 
	cat >expect <<-EOF &&
	7

	file-1
	file-2
	EOF
	cat >input <<-EOF &&
	^master^
	--
	file-2
	EOF
	git log --pretty=tformat:%s --name-only --stdin master -- file-1 \
		<input >actual &&
	test_cmp expect actual

Switched to a new branch 'xbc'
[B cc42894] File: dir
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 dir
ok 1 - prepare repository

expecting success: 
	test_expect_code 1 git merge -m "merge msg" master

ok 18 - not only --stdin

# passed all 18 test(s)
1..18
Merging:
7dfaf8e B
virtual xc
found 1 common ancestor:
617a709 A
Merge made by the 'recursive' strategy.
Merging:
cc42894 File: dir
virtual master
found 1 common ancestor:
05bb07b initial
Adding dir/foo
Removing dir to make room for subdirectory

CONFLICT (file/directory): There is a directory with name dir in master. Adding dir as dir~HEAD
Automatic merge failed; fix conflicts and then commit the result.
ok 2 - Merge with d/f conflicts

expecting success: 
	git reset --hard &&
	git checkout master &&
	rm .git/index &&

	mkdir before &&
	echo FILE >before/one &&
	echo FILE >after &&
	git add . &&
	git commit -m first &&

	rm -f after &&
	git mv before after &&
	git commit -m move &&

	git checkout -b para HEAD^ &&
	echo COMPLETELY ANOTHER FILE >another &&
	git add . &&
	git commit -m para &&

	git merge master

 C.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 C.t
error: 'dir' appears as both a file and as a directory
error: dir: cannot drop to stage #0
Switched to a new branch 'xcb'
HEAD is now at cc42894 File: dir
Switched to branch 'master'
Merging:
cf5ea0b C
virtual xb
found 1 common ancestor:
617a709 A
Merge made by the 'recursive' strategy.
 B.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 B.t
Switched to branch 'master'
ok 11 - setup criss-cross

expecting success: 
	(cd criss-cross &&
	 git rev-list --ancestry-path xcb..xbc > actual &&
	 test -z "$(cat actual)")

*** t6021-merge-criss-cross.sh ***
[master d7087e4] first
 Author: A U Thor <author@example.com>
 3 files changed, 3 insertions(+)
 create mode 100644 after
 create mode 100644 before/one
 create mode 100644 dir~HEAD
ok 12 - criss-cross: rev-list --ancestry-path cb..bc

expecting success: 
	(cd criss-cross &&
	 git rev-list --ancestry-path --all ^xcb > actual &&
	 test -z "$(cat actual)")

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 13 - criss-cross: rev-list --ancestry-path --all ^cb

# passed all 13 test(s)
1..13
[master 8ba9665] move
 Author: A U Thor <author@example.com>
 2 files changed, 1 deletion(-)
 delete mode 100644 after
 rename {before => after}/one (100%)
Switched to a new branch 'para'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6021-merge-criss-cross/.git/
expecting success: echo "1
2
3
4
5
6
7
8
9" > file &&
git add file &&
git commit -m "Initial commit" file &&
git branch A &&
git branch B &&
git checkout A &&
echo "1
2
3
4
5
6
7
8 changed in B8, branch A
9" > file &&
git commit -m "B8" file &&
git checkout B &&
echo "1
2
3 changed in C3, branch B
4
5
6
7
8
9
" > file &&
git commit -m "C3" file &&
git branch C3 &&
git merge -m "pre E3 merge" A &&
echo "1
2
3 changed in E3, branch B. New file size
4
5
6
7
8 changed in B8, branch A
9
" > file &&
git commit -m "E3" file &&
git checkout A &&
git merge -m "pre D8 merge" C3 &&
echo "1
2
3 changed in C3, branch B
4
5
6
7
8 changed in D8, branch A. New file size 2
9" > file &&
git commit -m D8 file
[para 0b6d962] para
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 another
*** t6022-merge-rename.sh ***
[master (root-commit) 9487659] Initial commit
 Author: A U Thor <author@example.com>
 1 file changed, 9 insertions(+)
 create mode 100644 file
Merging:
0b6d962 para
virtual master
found 1 common ancestor:
d7087e4 first
Skipped after/one (merged same as existing)
Removing after to make room for subdirectory

Removing after
Merge made by the 'recursive' strategy.
Cloning into 'sub1'...
 after                 | 1 -
 {before => after}/one | 0
 2 files changed, 1 deletion(-)
 delete mode 100644 after
 rename {before => after}/one (100%)
ok 3 - F/D conflict

expecting success: 
	git checkout --orphan modify &&
	git rm -rf . &&
	git clean -fdqx &&

	printf "a\nb\nc\nd\ne\nf\ng\nh\n" >letters &&
	git add letters &&
	git commit -m initial &&

	# Throw in letters.txt for sorting order fun
	# ("letters.txt" sorts between "letters" and "letters/file")
	echo i >>letters &&
	echo "version 2" >letters.txt &&
	git add letters letters.txt &&
	git commit -m modified &&

	git checkout -b delete HEAD^ &&
	git rm letters &&
	mkdir letters &&
	>letters/file &&
	echo "version 1" >letters.txt &&
	git add letters letters.txt &&
	git commit -m deleted

Switched to a new branch 'modify'
Switched to branch 'A'
done.
rm 'after/one'
rm 'another'
rm 'dir/foo'
rm 'dir~HEAD'
rm 'init'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6022-merge-rename/.git/
[A fda49a0] B8
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
expecting success: 
cat >A <<\EOF &&
a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
c cccccccccccccccccccccccccccccccccccccccccccccccc
d dddddddddddddddddddddddddddddddddddddddddddddddd
e eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
f ffffffffffffffffffffffffffffffffffffffffffffffff
g gggggggggggggggggggggggggggggggggggggggggggggggg
h hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
i iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
j jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
k kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
l llllllllllllllllllllllllllllllllllllllllllllllll
m mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
n nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
o oooooooooooooooooooooooooooooooooooooooooooooooo
EOF

cat >M <<\EOF &&
A AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
B BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
D DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
E EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
F FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
G GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
H HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
I IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
J JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ
K KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
L LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
M MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
N NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
O OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
EOF

git add A M &&
git commit -m "initial has A and M" &&
git branch white &&
git branch red &&
git branch blue &&
git branch yellow &&
git branch change &&
git branch change+rename &&

sed -e "/^g /s/.*/g : master changes a line/" <A >A+ &&
mv A+ A &&
git commit -a -m "master updates A" &&

git checkout yellow &&
rm -f M &&
git commit -a -m "yellow removes M" &&

git checkout white &&
sed -e "/^g /s/.*/g : white changes a line/" <A >B &&
sed -e "/^G /s/.*/G : colored branch changes a line/" <M >N &&
rm -f A M &&
git update-index --add --remove A B M N &&
git commit -m "white renames A->B, M->N" &&

git checkout red &&
sed -e "/^g /s/.*/g : red changes a line/" <A >B &&
sed -e "/^G /s/.*/G : colored branch changes a line/" <M >N &&
rm -f A M &&
git update-index --add --remove A B M N &&
git commit -m "red renames A->B, M->N" &&

git checkout blue &&
sed -e "/^g /s/.*/g : blue changes a line/" <A >C &&
sed -e "/^G /s/.*/G : colored branch changes a line/" <M >N &&
rm -f A M &&
git update-index --add --remove A C M N &&
git commit -m "blue renames A->C, M->N" &&

git checkout change &&
sed -e "/^g /s/.*/g : changed line/" <A >A+ &&
mv A+ A &&
git commit -q -a -m "changed" &&

git checkout change+rename &&
sed -e "/^g /s/.*/g : changed line/" <A >B &&
rm A &&
git update-index --add B &&
git commit -q -a -m "changed and renamed" &&

git checkout master
Switched to branch 'B'
[modify (root-commit) 8e521e2] initial
 Author: A U Thor <author@example.com>
 1 file changed, 8 insertions(+)
 create mode 100644 letters
[B 8a513dc] C3
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+), 1 deletion(-)
[master (root-commit) b068a03] initial has A and M
 Author: A U Thor <author@example.com>
 2 files changed, 30 insertions(+)
 create mode 100644 A
 create mode 100644 M
[modify 23dc869] modified
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 letters.txt
Switched to a new branch 'delete'
Merging:
8a513dc C3
virtual A
found 1 common ancestor:
9487659 Initial commit
Auto-merging file
Merge made by the 'recursive' strategy.
rm 'letters'
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
[B 9cff933] E3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
[delete 169e74c] deleted
 Author: A U Thor <author@example.com>
 3 files changed, 1 insertion(+), 8 deletions(-)
 delete mode 100644 letters
 create mode 100644 letters.txt
 create mode 100644 letters/file
ok 4 - setup modify/delete + directory/file conflict

expecting success: 
	git checkout delete^0 &&
	test_must_fail git merge modify &&

	test 5 -eq $(git ls-files -s | wc -l) &&
	test 4 -eq $(git ls-files -u | wc -l) &&
	test 1 -eq $(git ls-files -o | wc -l) &&

	test -f letters/file &&
	test -f letters.txt &&
	test -f letters~modify

Switched to branch 'A'
Note: checking out 'delete^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 169e74c... deleted
Merging:
169e74c deleted
virtual modify
found 1 common ancestor:
8e521e2 initial
Adding letters/file
Auto-merging letters.txt
CONFLICT (add/add): Merge conflict in letters.txt
CONFLICT (modify/delete): letters deleted in HEAD and modified in modify. Version modify of letters left in tree at letters~modify.
Automatic merge failed; fix conflicts and then commit the result.
Merging:
fda49a0 B8
virtual C3
found 1 common ancestor:
9487659 Initial commit
Auto-merging file
Merge made by the 'recursive' strategy.
[master a9cc703] master updates A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
 file | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Switched to branch 'yellow'
Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
[A 71fd1c2] D8
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 2 deletions(-)
ok 1 - prepare repository

Deleted branch modify_sub1 (was 85dfe6e).
expecting success: git merge -m "final merge" B
ok 5 - modify/delete + directory/file conflict
[yellow 291bf34] yellow removes M
 Author: A U Thor <author@example.com>
 1 file changed, 15 deletions(-)
 delete mode 100644 M

expecting success: 
	# Yes, we really need the double reset since "letters" appears as
	# both a file and a directory.
	git reset --hard &&
	git reset --hard &&
	git clean -f &&
	git checkout modify^0 &&

	test_must_fail git merge delete &&

	test 5 -eq $(git ls-files -s | wc -l) &&
	test 4 -eq $(git ls-files -u | wc -l) &&
	test 1 -eq $(git ls-files -o | wc -l) &&

	test -f letters/file &&
	test -f letters.txt &&
	test -f letters~HEAD

error: 'letters' appears as both a file and as a directory
error: letters: cannot drop to stage #0
Switched to a new branch 'modify_sub1'
Switched to branch 'white'
HEAD is now at 169e74c deleted
Merging:
71fd1c2 D8
virtual B
found 2 common ancestors:
fda49a0 B8
8a513dc C3
  Merging:
  fda49a0 B8
  8a513dc C3
  found 1 common ancestor:
  9487659 Initial commit
  Auto-merging file
Auto-merging file
Merge made by the 'recursive' strategy.
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 2 - Criss-cross merge

Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
expecting success: cmp file file-expect
HEAD is now at 169e74c deleted
ok 3 - Criss-cross merge result

expecting success: git reset --hard A^ &&
test_must_fail git merge -s resolve -m "final merge" B
Removing letters~modify
HEAD is now at 71fd1c2 D8
[white 98d2859] white renames A->B, M->N
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 2 deletions(-)
 rename A => B (93%)
 rename M => N (93%)
Previous HEAD position was 169e74c... deleted
HEAD is now at 23dc869... modified
Switched to branch 'red'
Merging:
23dc869 modified
virtual delete
found 1 common ancestor:
8e521e2 initial
Adding letters/file
Removing letters to make room for subdirectory

Auto-merging letters.txt
CONFLICT (add/add): Merge conflict in letters.txt
CONFLICT (modify/delete): letters deleted in delete and modified in HEAD. Version HEAD of letters left in tree at letters~HEAD.
Automatic merge failed; fix conflicts and then commit the result.
Trying simple merge.
Simple merge failed, trying Automatic merge.
Updating 041e421..85dfe6e
Fast-forward
ok 6 - modify/delete + directory/file conflict; other way

[red 6f40a19] red renames A->B, M->N
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 2 deletions(-)
 rename A => B (93%)
 rename M => N (93%)
# passed all 6 test(s)
1..6
Switched to branch 'blue'
Auto-merging file
*** t6023-merge-file.sh ***
[blue f7efbf5] blue renames A->C, M->N
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 2 deletions(-)
 rename A => C (93%)
 rename M => N (93%)
ERROR: content conflict in file
fatal: merge program failed
Automatic merge failed; fix conflicts and then commit the result.
ok 4 - Criss-cross merge fails (-s resolve)

# passed all 4 test(s)
1..4
Switched to branch 'change'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6023-merge-file/.git/
*** t6024-recursive-merge.sh ***
Switched to branch 'change+rename'
expecting success: 
	cp orig.txt test.txt &&
	git merge-file test.txt orig.txt orig.txt &&
	test_cmp test.txt orig.txt

ok 1 - merge with no changes

expecting success: git merge-file test.txt orig.txt new2.txt
ok 2 - merge without conflict

expecting success: 
	mkdir dir &&
	cp new1.txt dir/a.txt &&
	cp orig.txt dir/o.txt &&
	cp new2.txt dir/b.txt &&
	( cd dir && git merge-file a.txt o.txt b.txt ) &&
	test_path_is_missing a.txt

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6024-recursive-merge/.git/
Switched to branch 'master'
ok 1 - setup

expecting success: 
	git show-branch &&
	test_expect_code 1 git pull . white &&
	git ls-files -s &&
	git ls-files -u B >b.stages &&
	test_line_count = 3 b.stages &&
	git ls-files -s N >n.stages &&
	test_line_count = 1 n.stages &&
	sed -ne "/^g/{
	p
	q
	}" B | grep master &&
	git diff --exit-code white N

expecting success: 
echo 1 > a1 &&
git add a1 &&
GIT_AUTHOR_DATE="2006-12-12 23:00:00" git commit -m 1 a1 &&

git checkout -b A master &&
echo A > a1 &&
GIT_AUTHOR_DATE="2006-12-12 23:00:01" git commit -m A a1 &&

git checkout -b B master &&
echo B > a1 &&
GIT_AUTHOR_DATE="2006-12-12 23:00:02" git commit -m B a1 &&

git checkout -b D A &&
git rev-parse B > .git/MERGE_HEAD &&
echo D > a1 &&
git update-index a1 &&
GIT_AUTHOR_DATE="2006-12-12 23:00:03" git commit -m D &&

git symbolic-ref HEAD refs/heads/other &&
echo 2 > a1 &&
GIT_AUTHOR_DATE="2006-12-12 23:00:04" git commit -m 2 a1 &&

git checkout -b C &&
echo C > a1 &&
GIT_AUTHOR_DATE="2006-12-12 23:00:05" git commit -m C a1 &&

git checkout -b E C &&
git rev-parse B > .git/MERGE_HEAD &&
echo E > a1 &&
git update-index a1 &&
GIT_AUTHOR_DATE="2006-12-12 23:00:06" git commit -m E &&

git checkout -b G E &&
git rev-parse A > .git/MERGE_HEAD &&
echo G > a1 &&
git update-index a1 &&
GIT_AUTHOR_DATE="2006-12-12 23:00:07" git commit -m G &&

git checkout -b F D &&
git rev-parse C > .git/MERGE_HEAD &&
echo F > a1 &&
git update-index a1 &&
GIT_AUTHOR_DATE="2006-12-12 23:00:08" git commit -m F

! [blue] blue renames A->C, M->N
 ! [change] changed
  ! [change+rename] changed and renamed
   * [master] master updates A
    ! [red] red renames A->B, M->N
     ! [white] white renames A->B, M->N
      ! [yellow] yellow removes M
-------
      + [yellow] yellow removes M
     +  [white] white renames A->B, M->N
    +   [red] red renames A->B, M->N
   *    [master] master updates A
  +     [change+rename] changed and renamed
 +      [change] changed
+       [blue] blue renames A->C, M->N
+++*+++ [yellow^] initial has A and M
ok 3 - works in subdirectory

expecting success: git merge-file --quiet test.txt orig.txt new2.txt
[master (root-commit) 2cb59ab] 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a1
ok 4 - merge without conflict (--quiet)

checking known breakage: git merge-file test2.txt orig.txt new4.txt
not ok 5 - merge without conflict (missing LF at EOF) # TODO known breakage

checking known breakage: test_cmp test.txt test2.txt
Switched to a new branch 'A'
From .
--- test.txt	2015-12-16 11:02:06.017564861 +0000
+++ test2.txt	2015-12-16 11:02:06.049564861 +0000
@@ -3,7 +3,11 @@
 super aquam refectionis educavit me;
 animam meam convertit,
 deduxit me super semitas jusitiae,
+<<<<<<< test2.txt
 propter nomen suum.
 Nam et si ambulavero in medio umbrae mortis,
 non timebo mala, quoniam tu mecum es:
 virga tua et baculus tuus ipsa me consolata sunt.
+=======
+propter nomen suum.
+>>>>>>> new4.txt
not ok 6 - merge result added missing LF # TODO known breakage

 * branch            white      -> FETCH_HEAD
expecting success: git merge-file --quiet test3.txt new2.txt new3.txt
ok 7 - merge without conflict (missing LF at EOF, away from change in the other file)

Submodule path 'sub1': checked out 'eedcaeb9ebca3d956845c627772d7a68b8eec63e'
[A 9d821b5] A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
expecting success: test_cmp test3.txt expect.txt
ok 8 - merge does not add LF away of change

expecting success: test_must_fail git merge-file test.txt orig.txt new3.txt
Merging:
a9cc703 master updates A
virtual 98d2859943e5dfe9606b5eaace5a57ec733b203b
found 1 common ancestor:
b068a03 initial has A and M
Auto-merging N
Auto-merging B
CONFLICT (content): Merge conflict in B
Automatic merge failed; fix conflicts and then commit the result.
Switched to a new branch 'B'
ok 9 - merge with conflicts

100644 aed72d761b68c20ffce8249a5a0426494098d376 1	B
100644 c68856fe0bfce4eb453d8e12329c47ab60c8107b 2	B
100644 2d603156dc5bdf6295c789cac08e3c9942a0b82a 3	B
100644 ba41fb96393979b22691106b06bf5231eab57b85 0	N
expecting success: test_cmp test.txt expect.txt
ok 10 - expected conflict markers

[B 7082aa6] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
expecting success: git merge-file --ours test.txt orig.txt new3.txt && test_cmp test.txt expect.txt
Switched to a new branch 'D'
ok 11 - merge conflicting with --ours

g : master changes a line
ok 26 - git_pull_ff: 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
		)
	
expecting success: git merge-file --theirs test.txt orig.txt new3.txt && test_cmp test.txt expect.txt
ok 2 - pull renaming branch into unrenaming one

expecting success: 
	rm -f B &&
	git reset --hard &&
	git checkout red &&
	test_expect_code 1 git pull . white &&
	git ls-files -u B >b.stages &&
	test_line_count = 3 b.stages &&
	git ls-files -s N >n.stages &&
	test_line_count = 1 n.stages &&
	sed -ne "/^g/{
	p
	q
	}" B | grep red &&
	git diff --exit-code white N

ok 12 - merge conflicting with --theirs

expecting success: git merge-file --union test.txt orig.txt new3.txt && test_cmp test.txt expect.txt
[D e1146db] D
 Author: A U Thor <author@example.com>
HEAD is now at a9cc703 master updates A
ok 13 - merge conflicting with --union

expecting success: test_must_fail git merge-file -L 1 -L 2 test.txt orig.txt new3.txt
Switched to branch 'red'
ok 14 - merge with conflicts, using -L
[other (root-commit) 216d386] 2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a1

expecting success: test_cmp test.txt expect.txt
ok 15 - expected conflict markers, with -L

expecting success: test_must_fail git merge-file -p orig.txt new1.txt new5.txt > out
Switched to a new branch 'C'
ok 16 - conflict in removed tail

expecting success: test_cmp expect out
ok 17 - expected conflict markers

expecting success: 
	test_must_fail git merge-file -p \
		orig.txt "$TEST_DIRECTORY"/test-binary-1.png new1.txt 2> merge.err &&
	grep "Cannot merge binary files" merge.err

Cloning into 'submodule_update'...
[C d264643] C
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
From .
 * branch            white      -> FETCH_HEAD
error: Cannot merge binary files: /«PKGBUILDDIR»/t/test-binary-1.png
ok 18 - binary files cannot be merged

Switched to a new branch 'E'
expecting success: 

	test_must_fail git merge-file -p new6.txt new5.txt new7.txt > output &&
	test 1 = $(grep ======= < output | wc -l)


Merging:
6f40a19 red renames A->B, M->N
virtual 98d2859943e5dfe9606b5eaace5a57ec733b203b
found 1 common ancestor:
b068a03 initial has A and M
Skipped N (merged same as existing)
Auto-merging B
CONFLICT (content): Merge conflict in B
Automatic merge failed; fix conflicts and then commit the result.
done.
ok 19 - MERGE_ZEALOUS simplifies non-conflicts

expecting success: 

	test_must_fail git merge-file -p \
		new8.txt new5.txt new9.txt > merge.out &&
	test 1 = $(grep ======= < merge.out | wc -l)


[E 939285a] E
 Author: A U Thor <author@example.com>
g : red changes a line
Switched to a new branch 'G'
ok 20 - ZEALOUS_ALNUM

ok 3 - pull renaming branch into another renaming one

Switched to a new branch 'add_sub1'
expecting success: 
	test_must_fail git merge-file -p --diff3 \
		new8.txt new5.txt new9.txt >actual &&
	test_cmp expect actual

expecting success: 
	git reset --hard &&
	git show-branch &&
	test_expect_code 1 git pull . master &&
	git ls-files -u B >b.stages &&
	test_line_count = 3 b.stages &&
	git ls-files -s N >n.stages &&
	test_line_count = 1 n.stages &&
	sed -ne "/^g/{
	p
	q
	}" B | grep red &&
	git diff --exit-code white N

Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 21 - "diff3 -m" style output (1)

expecting success: 
	git config merge.conflictstyle diff3 &&
	test_must_fail git merge-file -p \
		new8.txt new5.txt new9.txt >actual &&
	test_cmp expect actual

HEAD is now at 6f40a19 red renames A->B, M->N
! [blue] blue renames A->C, M->N
 ! [change] changed
  ! [change+rename] changed and renamed
   ! [master] master updates A
    * [red] red renames A->B, M->N
     ! [white] white renames A->B, M->N
      ! [yellow] yellow removes M
-------
      + [yellow] yellow removes M
     +  [white] white renames A->B, M->N
    *   [red] red renames A->B, M->N
   +    [master] master updates A
  +     [change+rename] changed and renamed
 +      [change] changed
+       [blue] blue renames A->C, M->N
++++*++ [yellow^] initial has A and M
[G ok 22 - "diff3 -m" style output (2)

26f86b6] G
 Author: A U Thor <author@example.com>
expecting success: 
	test_must_fail git merge-file -p --marker-size=10 \
		new8.txt new5.txt new9.txt >actual &&
	test_cmp expect actual

Switched to a new branch 'F'
ok 23 - marker size

expecting success: git merge-file -p --ours nolf-diff1.txt nolf-orig.txt nolf-diff2.txt >output.txt &&
	 printf "line1\nline2\nline3x" >expect.txt &&
	 test_cmp expect.txt output.txt
ok 24 - conflict at EOF without LF resolved by --ours

expecting success: git merge-file -p --theirs nolf-diff1.txt nolf-orig.txt nolf-diff2.txt >output.txt &&
	 printf "line1\nline2\nline3y" >expect.txt &&
	 test_cmp expect.txt output.txt
From .
 * branch            master     -> FETCH_HEAD
ok 25 - conflict at EOF without LF resolved by --theirs

expecting success: git merge-file -p --union nolf-diff1.txt nolf-orig.txt nolf-diff2.txt >output.txt &&
	 printf "line1\nline2\nline3x\nline3y" >expect.txt &&
	 test_cmp expect.txt output.txt
[F 71b2f3d] F
 Author: A U Thor <author@example.com>
ok 1 - setup tests

expecting success: 
	test_must_fail git merge -m final G

ok 26 - conflict at EOF without LF resolved by --union

Merging:
6f40a19 red renames A->B, M->N
virtual a9cc7034ca48aade9a0feed37feca6b7327cd9c3
found 1 common ancestor:
b068a03 initial has A and M
Skipped N (merged same as existing)
Auto-merging B
CONFLICT (content): Merge conflict in B
Automatic merge failed; fix conflicts and then commit the result.
# still have 2 known breakage(s)
# passed all remaining 24 test(s)
1..26
Merging:
71b2f3d F
virtual G
found 3 common ancestors:
d264643 C
7082aa6 B
9d821b5 A
  Merging:
  d264643 C
  7082aa6 B
  found 0 common ancestors:
  Auto-merging a1
  CONFLICT (add/add): Merge conflict in a1
  Merging:
  virtual merged tree
  9d821b5 A
  found 1 common ancestor:
  2cb59ab 1
  Auto-merging a1
  CONFLICT (content): Merge conflict in a1
Auto-merging a1
CONFLICT (content): Merge conflict in a1
Automatic merge failed; fix conflicts and then commit the result.
ok 2 - combined merge conflicts

expecting success: test_cmp expect a1
ok 3 - result contains a conflict

*** t6025-merge-symlinks.sh ***
g : red changes a line
expecting success: test_cmp expect out
ok 4 - virtual trees were processed

expecting success: 
	git reset --hard &&
	printf "\0" > binary-file &&
	git add binary-file &&
	git commit -m binary &&
	git checkout G &&
	printf "\0\0" > binary-file &&
	git add binary-file &&
	git commit -m binary2 &&
	test_must_fail git merge F > merge.out 2> merge.err &&
	grep "Cannot merge binary files: binary-file (HEAD vs. F)" merge.err

ok 4 - pull unrenaming branch into renaming one

expecting success: 
	git reset --hard &&
	git show-branch &&
	test_expect_code 1 git pull . blue &&
	git ls-files -u A >a.stages &&
	test_line_count = 1 a.stages &&
	git ls-files -u B >b.stages &&
	test_line_count = 1 b.stages &&
	git ls-files -u C >c.stages &&
	test_line_count = 1 c.stages &&
	git ls-files -s N >n.stages &&
	test_line_count = 1 n.stages &&
	sed -ne "/^g/{
	p
	q
	}" B | grep red &&
	git diff --exit-code white N

HEAD is now at 6f40a19 red renames A->B, M->N
HEAD is now at 71b2f3d F
! [blue] blue renames A->C, M->N
 ! [change] changed
  ! [change+rename] changed and renamed
   ! [master] master updates A
    * [red] red renames A->B, M->N
     ! [white] white renames A->B, M->N
      ! [yellow] yellow removes M
-------
      + [yellow] yellow removes M
     +  [white] white renames A->B, M->N
    *   [red] red renames A->B, M->N
   +    [master] master updates A
  +     [change+rename] changed and renamed
 +      [change] changed
+       [blue] blue renames A->C, M->N
++++*++ [yellow^] initial has A and M
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6025-merge-symlinks/.git/
[F 111b764] binary
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 binary-file
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
expecting success: 
git config core.symlinks false &&
> file &&
git add file &&
git commit -m initial &&
git branch b-symlink &&
git branch b-file &&
l=$(printf file | git hash-object -t blob -w --stdin) &&
echo "120000 $l	symlink" | git update-index --index-info &&
git commit -m master &&
git checkout b-symlink &&
l=$(printf file-different | git hash-object -t blob -w --stdin) &&
echo "120000 $l	symlink" | git update-index --index-info &&
git commit -m b-symlink &&
git checkout b-file &&
echo plain-file > symlink &&
git add symlink &&
git commit -m b-file
Switched to branch 'G'
From .
 * branch            blue       -> FETCH_HEAD
[G 9b6adb0] binary2
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 binary-file
[master (root-commit) 9b24095] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file
Merging:
6f40a19 red renames A->B, M->N
virtual f7efbf5039a465367ea51bd21106954acaa07867
found 1 common ancestor:
b068a03 initial has A and M
Skipped N (merged same as existing)
CONFLICT (rename/rename): Rename "A"->"B" in branch "HEAD" rename "A"->"C" in "f7efbf5039a465367ea51bd21106954acaa07867"
Automatic merge failed; fix conflicts and then commit the result.
warning: Cannot merge binary files: binary-file (HEAD vs. F)
ok 5 - refuse to merge binary files

expecting success: 

	git reset --hard &&
	git checkout -b delete &&
	git rm a1 &&
	test_tick &&
	git commit -m delete &&
	git checkout -b rename HEAD^ &&
	git mv a1 a2 &&
	test_tick &&
	git commit -m rename &&
	test_must_fail git merge delete &&
	test 1 = $(git ls-files --unmerged | wc -l) &&
	git rev-parse --verify :2:a2 &&
	test_must_fail git rev-parse --verify :3:a2 &&
	git checkout -f delete &&
	test_must_fail git merge rename &&
	test 1 = $(git ls-files --unmerged | wc -l) &&
	test_must_fail git rev-parse --verify :2:a2 &&
	git rev-parse --verify :3:a2


Cloning into 'sub1'...
HEAD is now at 9b6adb0 binary2
Switched to a new branch 'delete'
[master 81db09c] master
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 120000 symlink
g : red changes a line
rm 'a1'
ok 5 - pull conflicting renames

expecting success: 
	git reset --hard &&
	git show-branch &&
	echo >A this file should not matter &&
	test_expect_code 1 git pull . white &&
	test_path_is_file A

Switched to branch 'b-symlink'
done.
[delete 93afbfa] delete
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 a1
HEAD is now at 6f40a19 red renames A->B, M->N
Switched to a new branch 'rename'
! [blue] blue renames A->C, M->N
 ! [change] changed
  ! [change+rename] changed and renamed
   ! [master] master updates A
    * [red] red renames A->B, M->N
     ! [white] white renames A->B, M->N
      ! [yellow] yellow removes M
-------
      + [yellow] yellow removes M
     +  [white] white renames A->B, M->N
    *   [red] red renames A->B, M->N
   +    [master] master updates A
  +     [change+rename] changed and renamed
 +      [change] changed
+       [blue] blue renames A->C, M->N
++++*++ [yellow^] initial has A and M
[b-symlink bbc23ba] b-symlink
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 120000 symlink
[rename 7329fe1] rename
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename a1 => a2 (100%)
Switched to branch 'b-file'
Merging:
7329fe1 rename
virtual delete
found 1 common ancestor:
9b6adb0 binary2
CONFLICT (rename/delete): a2 deleted in delete and renamed in HEAD. Version HEAD of a2 left in tree.
Automatic merge failed; fix conflicts and then commit the result.
fd7923529855d0b274795ae3349c5e0438333979
From .
 * branch            white      -> FETCH_HEAD
[b-file 5f14a87] b-file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 symlink
ok 1 - setup

expecting success: 
git checkout b-symlink &&
test_must_fail git merge master
fatal: Needed a single revision
Switched to branch 'b-symlink'
Switched to branch 'delete'
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
Merging:
6f40a19 red renames A->B, M->N
virtual 98d2859943e5dfe9606b5eaace5a57ec733b203b
found 1 common ancestor:
b068a03 initial has A and M
Skipped N (merged same as existing)
Auto-merging B
CONFLICT (content): Merge conflict in B
Automatic merge failed; fix conflicts and then commit the result.
ok 6 - interference with untracked working tree file

expecting success: 
	git reset --hard &&
	git checkout white &&
	git show-branch &&
	rm -f A &&
	echo >A this file should not matter &&
	test_expect_code 1 git pull . red &&
	test_path_is_file A

Merging:
bbc23ba b-symlink
virtual master
found 1 common ancestor:
9b24095 initial
Auto-merging symlink
CONFLICT (add/add): Merge conflict in symlink
Automatic merge failed; fix conflicts and then commit the result.
ok 2 - merge master into b-symlink, which has a different symbolic link

expecting success: 
test -f symlink
ok 3 - the merge result must be a file

expecting success: 
git reset --hard && git checkout b-file &&
test_must_fail git merge master
Merging:
93afbfa delete
virtual rename
found 1 common ancestor:
9b6adb0 binary2
CONFLICT (rename/delete): a2 deleted in HEAD and renamed in rename. Version rename of a2 left in tree.
Automatic merge failed; fix conflicts and then commit the result.
HEAD is now at 6f40a19 red renames A->B, M->N
fatal: Needed a single revision
HEAD is now at bbc23ba b-symlink
Switched to branch 'white'
fd7923529855d0b274795ae3349c5e0438333979
ok 6 - mark rename/delete as unmerged

Switched to branch 'b-file'
# passed all 6 test(s)
1..6
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
! [blue] blue renames A->C, M->N
 ! [change] changed
  ! [change+rename] changed and renamed
   ! [master] master updates A
    ! [red] red renames A->B, M->N
     * [white] white renames A->B, M->N
      ! [yellow] yellow removes M
-------
      + [yellow] yellow removes M
     *  [white] white renames A->B, M->N
    +   [red] red renames A->B, M->N
   +    [master] master updates A
  +     [change+rename] changed and renamed
 +      [change] changed
+       [blue] blue renames A->C, M->N
+++++*+ [yellow^] initial has A and M
Merging:
5f14a87 b-file
virtual master
found 1 common ancestor:
9b24095 initial
Auto-merging symlink
CONFLICT (add/add): Merge conflict in symlink
Automatic merge failed; fix conflicts and then commit the result.
ok 4 - merge master into b-file, which has a file instead of a symbolic link

expecting success: 
test -f symlink
ok 5 - the merge result must be a file

expecting success: 
git reset --hard &&
git checkout master &&
test_must_fail git merge b-file
Deleted branch invalid_sub1 (was e730a90).
HEAD is now at 5f14a87 b-file
Switched to a new branch 'invalid_sub1'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
Switched to branch 'master'
*** t6026-merge-attr.sh ***
From .
 * branch            red        -> FETCH_HEAD
Merging:
81db09c master
virtual b-file
found 1 common ancestor:
9b24095 initial
Auto-merging symlink
CONFLICT (add/add): Merge conflict in symlink
Automatic merge failed; fix conflicts and then commit the result.
ok 6 - merge b-file, which has a file instead of a symbolic link, into master

expecting success: 
test -f symlink
ok 7 - the merge result must be a file

# passed all 7 test(s)
1..7
Merging:
98d2859 white renames A->B, M->N
virtual 6f40a194146b3c9cde27ceabc8becca9d67764bb
found 1 common ancestor:
b068a03 initial has A and M
Skipped N (merged same as existing)
Auto-merging B
CONFLICT (content): Merge conflict in B
Automatic merge failed; fix conflicts and then commit the result.
ok 7 - interference with untracked working tree file

expecting success: 
	git reset --hard &&
	rm -f A M &&
	git checkout -f master &&
	git tag -f anchor &&
	git show-branch &&
	git pull . yellow &&
	test_path_is_missing M &&
	git reset --hard anchor

*** t6027-merge-binary.sh ***
HEAD is now at 98d2859 white renames A->B, M->N
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6026-merge-attr/.git/
Updating 041e421..e730a90
Fast-forward
Switched to branch 'master'
expecting success: 

	for f in text binary union
	do
		echo Initial >$f && git add $f || return 1
	done &&
	test_tick &&
	git commit -m Initial &&

	git branch side &&
	for f in text binary union
	do
		echo Master >>$f && git add $f || return 1
	done &&
	test_tick &&
	git commit -m Master &&

	git checkout side &&
	for f in text binary union
	do
		echo Side >>$f && git add $f || return 1
	done &&
	test_tick &&
	git commit -m Side &&

	git tag anchor

! [blue] blue renames A->C, M->N
 ! [change] changed
  ! [change+rename] changed and renamed
   * [master] master updates A
    ! [red] red renames A->B, M->N
     ! [white] white renames A->B, M->N
      ! [yellow] yellow removes M
-------
      + [yellow] yellow removes M
     +  [white] white renames A->B, M->N
    +   [red] red renames A->B, M->N
   *    [master] master updates A
  +     [change+rename] changed and renamed
 +      [change] changed
+       [blue] blue renames A->C, M->N
+++*+++ [yellow^] initial has A and M
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6027-merge-binary/.git/
expecting success: 

	cat "$TEST_DIRECTORY"/test-binary-1.png >m &&
	git add m &&
	git ls-files -s | sed -e "s/ 0	/ 1	/" >E1 &&
	test_tick &&
	git commit -m "initial" &&

	git branch side &&
	echo frotz >a &&
	git add a &&
	echo nitfol >>m &&
	git add a m &&
	git ls-files -s a >E0 &&
	git ls-files -s m | sed -e "s/ 0	/ 3	/" >E3 &&
	test_tick &&
	git commit -m "master adds some" &&

	git checkout side &&
	echo rezrov >>m &&
	git add m &&
	git ls-files -s m | sed -e "s/ 0	/ 2	/" >E2 &&
	test_tick &&
	git commit -m "side modifies" &&

	git tag anchor &&

	cat E0 E1 E2 E3 >expect

[master (root-commit) 5f96ff8] Initial
 Author: A U Thor <author@example.com>
 3 files changed, 3 insertions(+)
 create mode 100644 binary
 create mode 100644 text
 create mode 100644 union
From .
 * branch            yellow     -> FETCH_HEAD
[master (root-commit) f315366] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 m
Merging:
a9cc703 master updates A
virtual 291bf34e9c62e1d3536f50935d6cdf31fc642cc1
found 1 common ancestor:
b068a03 initial has A and M
Removing M
Merge made by the 'recursive' strategy.
[master 5054610] Master
 Author: A U Thor <author@example.com>
 3 files changed, 3 insertions(+)
 M | 15 ---------------
 1 file changed, 15 deletions(-)
 delete mode 100644 M
Switched to branch 'side'
HEAD is now at a9cc703 master updates A
ok 8 - interference with untracked working tree file

expecting success: 
	git reset --hard &&
	rm -f A M &&
	git checkout -f master &&
	git tag -f anchor &&
	git show-branch &&
	echo >>M one line addition &&
	cat M >M.saved &&
	test_expect_code 128 git pull . yellow &&
	test_cmp M M.saved &&
	rm -f M.saved

HEAD is now at a9cc703 master updates A
[master a142ea1] master adds some
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
 create mode 100644 a
Already on 'master'
Switched to branch 'side'
[side 03d8861] Side
 Author: A U Thor <author@example.com>
 3 files changed, 3 insertions(+)
ok 1 - setup

expecting success: 

	{
		echo "binary -merge"
		echo "union merge=union"
	} >.gitattributes &&

	if git merge master
	then
		echo Gaah, should have conflicted
		false
	else
		echo Ok, conflicted.
	fi

! [blue] blue renames A->C, M->N
 ! [change] changed
  ! [change+rename] changed and renamed
   * [master] master updates A
    ! [red] red renames A->B, M->N
     ! [white] white renames A->B, M->N
      ! [yellow] yellow removes M
-------
      + [yellow] yellow removes M
     +  [white] white renames A->B, M->N
    +   [red] red renames A->B, M->N
   *    [master] master updates A
  +     [change+rename] changed and renamed
 +      [change] changed
+       [blue] blue renames A->C, M->N
+++*+++ [yellow^] initial has A and M
warning: Cannot merge binary files: binary (HEAD vs. master)
Merging:
03d8861 Side
virtual master
found 1 common ancestor:
5f96ff8 Initial
Auto-merging union
Auto-merging text
CONFLICT (content): Merge conflict in text
Auto-merging binary
CONFLICT (content): Merge conflict in binary
Automatic merge failed; fix conflicts and then commit the result.
[side 020cbcd] side modifies
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
Ok, conflicted.
ok 2 - merge

expecting success: 

	git ls-files -u | grep binary &&
	git ls-files -u | grep text &&
	! (git ls-files -u | grep union)


ok 1 - setup

expecting success: 

	rm -f a* m* &&
	git reset --hard anchor &&

	if git merge -s resolve master
	then
		echo Oops, should not have succeeded
		false
	else
		git ls-files -s >current
		test_cmp current expect
	fi

100644 a77fa514de2720c72c1a861de098595959a2c97a 1	binary
100644 fb25c069fdd4d47c6cf8d3a457b8f620064cba41 2	binary
100644 8950d9fdcf2dc4071be500e078831dbcfca693e1 3	binary
From .
 * branch            yellow     -> FETCH_HEAD
100644 a77fa514de2720c72c1a861de098595959a2c97a 1	text
100644 fb25c069fdd4d47c6cf8d3a457b8f620064cba41 2	text
100644 8950d9fdcf2dc4071be500e078831dbcfca693e1 3	text
ok 3 - check merge result in index

expecting success: 

	git cat-file -p HEAD:binary >binary-orig &&
	grep "<<<<<<<" text &&
	cmp binary-orig binary &&
	! grep "<<<<<<<" union &&
	grep Master union &&
	grep Side union


error: Your local changes to the following files would be overwritten by merge:
	M
Please, commit your changes or stash them before you can merge.
Aborting
fatal: merging of trees 327b18fcbf562119811a97f5b8ed9c8ef85d5c3d and 878bb4a74cc6b899e74bcd3b56352573baeb967d failed
Merging:
a9cc703 master updates A
virtual 291bf34e9c62e1d3536f50935d6cdf31fc642cc1
found 1 common ancestor:
b068a03 initial has A and M
HEAD is now at 020cbcd side modifies
ok 9 - updated working tree file should prevent the merge

expecting success: 
	git reset --hard &&
	rm -f A M &&
	git checkout -f master &&
	git tag -f anchor &&
	git show-branch &&
	echo >>M one line addition &&
	cat M >M.saved &&
	git update-index M &&
	test_expect_code 128 git pull . yellow &&
	test_cmp M M.saved &&
	rm -f M.saved

error: Merge requires file-level merging
Trying really trivial in-index merge...
Nope.
<<<<<<< HEAD
HEAD is now at a9cc703 master updates A
Master
Side
ok 4 - check merge result in working tree

expecting success: 
	echo text conflict-marker-size=32 >>.gitattributes &&
	git checkout -m text &&
	sed -ne "/^\([<=>]\)\1\1\1*/{
		s/ .*$//
		p
	}" >actual text &&
	grep ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" actual &&
	grep "================================" actual &&
	grep "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" actual

fatal: reference is not a tree: 0123456789012345678901234567890123456789
Unable to checkout '0123456789012345678901234567890123456789' in submodule path 'sub1'
Trying simple merge.
Already on 'master'
Simple merge failed, trying Automatic merge.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
================================
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
! [blue] blue renames A->C, M->N
 ! [change] changed
  ! [change+rename] changed and renamed
   * [master] master updates A
    ! [red] red renames A->B, M->N
     ! [white] white renames A->B, M->N
      ! [yellow] yellow removes M
-------
      + [yellow] yellow removes M
     +  [white] white renames A->B, M->N
    +   [red] red renames A->B, M->N
   *    [master] master updates A
  +     [change+rename] changed and renamed
 +      [change] changed
+       [blue] blue renames A->C, M->N
+++*+++ [yellow^] initial has A and M
ok 5 - retry the merge with longer context

expecting success: 

	echo "* merge=union" >.gitattributes &&
	echo "text merge=custom" >>.gitattributes &&

	git reset --hard anchor &&
	git config --replace-all \
	merge.custom.driver "./custom-merge %O %A %B 0 %P" &&
	git config --replace-all \
	merge.custom.name "custom merge driver for testing" &&

	git merge master &&

	cmp binary union &&
	sed -e 1,3d text >check-1 &&
	o=$(git unpack-file master^:text) &&
	a=$(git unpack-file side^:text) &&
	b=$(git unpack-file master:text) &&
	sh -c "./custom-merge $o $a $b 0 text" &&
	sed -e 1,3d $a >check-2 &&
	cmp check-1 check-2 &&
	rm -f $o $a $b

HEAD is now at 03d8861 Side
ok 27 - git_pull_ff: 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
		)
	
Auto-merging m
error: Cannot merge binary files: .merge_file_zFAFyh
Merging:
03d8861 Side
virtual master
found 1 common ancestor:
5f96ff8 Initial
Auto-merging union
From .
 * branch            yellow     -> FETCH_HEAD
ERROR: content conflict in m
fatal: merge program failed
Automatic merge failed; fix conflicts and then commit the result.
error: Your local changes to the following files would be overwritten by merge:
	M
ok 2 - resolve

expecting success: 

	rm -f a* m* &&
	git reset --hard anchor &&

	if git merge -s recursive master
	then
		echo Oops, should not have succeeded
		false
	else
		git ls-files -s >current
		test_cmp current expect
	fi

Please, commit your changes or stash them before you can merge.
Aborting
fatal: merging of trees 327b18fcbf562119811a97f5b8ed9c8ef85d5c3d and 878bb4a74cc6b899e74bcd3b56352573baeb967d failed
Merging:
a9cc703 master updates A
virtual 291bf34e9c62e1d3536f50935d6cdf31fc642cc1
found 1 common ancestor:
b068a03 initial has A and M
Auto-merging text
Auto-merging binary
Merge made by the 'recursive' strategy.
ok 10 - updated working tree file should prevent the merge

expecting success: 
	git reset --hard &&
	rm -f A M &&
	git checkout -f yellow &&
	git tag -f anchor &&
	git show-branch &&
	echo >M this file should not matter &&
	git pull . master &&
	test_path_is_file M &&
	! {
		git ls-files -s |
		grep M
	} &&
	git reset --hard anchor

 binary |  1 +
 text   | 10 ++++++++++
 union  |  1 +
 3 files changed, 12 insertions(+)
HEAD is now at 020cbcd side modifies
HEAD is now at a9cc703 master updates A
warning: Cannot merge binary files: m (HEAD vs. master)
Merging:
020cbcd side modifies
virtual master
found 1 common ancestor:
f315366 initial
Auto-merging m
CONFLICT (content): Merge conflict in m
Automatic merge failed; fix conflicts and then commit the result.
Cloning into 'submodule_update'...
Switched to branch 'yellow'
ok 3 - recursive

# passed all 3 test(s)
1..3
Updated tag 'anchor' (was a9cc703)
done.
! [blue] blue renames A->C, M->N
 ! [change] changed
  ! [change+rename] changed and renamed
   ! [master] master updates A
    ! [red] red renames A->B, M->N
     ! [white] white renames A->B, M->N
      * [yellow] yellow removes M
-------
      * [yellow] yellow removes M
     +  [white] white renames A->B, M->N
    +   [red] red renames A->B, M->N
   +    [master] master updates A
  +     [change+rename] changed and renamed
 +      [change] changed
+       [blue] blue renames A->C, M->N
++++++* [yellow^] initial has A and M
*** t6028-merge-up-to-date.sh ***
ok 6 - custom merge backend

expecting success: 

	git reset --hard anchor &&
	git config --replace-all \
	merge.custom.driver "./custom-merge %O %A %B 1 %P" &&
	git config --replace-all \
	merge.custom.name "custom merge driver for testing" &&

	if git merge master
	then
		echo "Eh? should have conflicted"
		false
	else
		echo "Ok, conflicted"
	fi &&

	cmp binary union &&
	sed -e 1,3d text >check-1 &&
	o=$(git unpack-file master^:text) &&
	a=$(git unpack-file anchor:text) &&
	b=$(git unpack-file master:text) &&
	sh -c "./custom-merge $o $a $b 0 text" &&
	sed -e 1,3d $a >check-2 &&
	cmp check-1 check-2 &&
	sed -e 1,3d -e 4q $a >check-3 &&
	echo "path is text" >expect &&
	cmp expect check-3 &&
	rm -f $o $a $b

HEAD is now at 03d8861 Side
Switched to a new branch 'invalid_sub1'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
From .
 * branch            master     -> FETCH_HEAD
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6028-merge-up-to-date/.git/
Merging:
03d8861 Side
virtual master
found 1 common ancestor:
5f96ff8 Initial
Auto-merging union
expecting success: 
	>file &&
	git add file &&
	test_tick &&
	git commit -m initial &&
	git tag c0 &&

	echo second >file &&
	git add file &&
	test_tick &&
	git commit -m second &&
	git tag c1 &&
	git branch test &&
	echo third >file &&
	git add file &&
	test_tick &&
	git commit -m third &&
	git tag c2

fatal: Needed a single revision
Merging:
291bf34 yellow removes M
virtual a9cc7034ca48aade9a0feed37feca6b7327cd9c3
found 1 common ancestor:
b068a03 initial has A and M
Merge made by the 'recursive' strategy.
 A | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
Auto-merging text
CONFLICT (content): Merge conflict in text
Auto-merging binary
Automatic merge failed; fix conflicts and then commit the result.
Ok, conflicted
HEAD is now at 291bf34 yellow removes M
[master (root-commit) 1bd44cb] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file
ok 11 - interference with untracked working tree file

expecting success: 
	rm -f A M N &&
	git reset --hard &&
	git checkout change+rename &&
	GIT_MERGE_VERBOSITY=3 git merge change | test_i18ngrep "^Skipped B" &&
	git reset --hard HEAD^ &&
	git checkout change &&
	GIT_MERGE_VERBOSITY=3 git merge change+rename | test_i18ngrep "^Skipped B"

Deleted branch valid_sub1 (was 1ca87d6).
HEAD is now at 291bf34 yellow removes M
Switched to a new branch 'valid_sub1'
Switched to branch 'change+rename'
Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
[master e042178] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Skipped B (merged same as existing)
ok 7 - custom merge backend

expecting success: 
	test_create_repo repo1 &&
	test_create_repo repo2 &&
	test_tick &&
	(
		cd repo1 &&
		>a &&
		git add a &&
		git commit -m initial
	) &&
	test_tick &&
	(
		cd repo2 &&
		git commit --allow-empty -m initial
	) &&
	test_tick &&
	(
		cd repo1 &&
		git pull ../repo2 master
	)

HEAD is now at 851b229 changed and renamed
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6026-merge-attr/repo1/.git/
Switched to branch 'change'
[master 52cad15] third
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6026-merge-attr/repo2/.git/
ok 1 - setup

expecting success: 

	git reset --hard c1 &&
	test_tick &&
	git merge -s recursive c0 &&
	expect=$(git rev-parse c1) &&
	current=$(git rev-parse HEAD) &&
	test "$expect" = "$current"


Updating e730a90..1ca87d6
Fast-forward
Skipped B (merged same as existing)
ok 12 - merge of identical changes in a renamed file

expecting success: 
	git reset --hard &&
	git checkout --orphan dir-in-way &&
	git rm -rf . &&
	git clean -fdqx &&

	mkdir sub &&
	mkdir dir &&
	printf "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n" >sub/file &&
	echo foo >dir/file-in-the-way &&
	git add -A &&
	git commit -m "Common commit" &&

	echo 11 >>sub/file &&
	echo more >>dir/file-in-the-way &&
	git add -u &&
	git commit -m "Commit to merge, with dir in the way" &&

	git checkout -b dir-not-in-way &&
	git reset --soft HEAD^ &&
	git rm -rf dir &&
	git commit -m "Commit to merge, with dir removed" -- dir sub/file &&

	git checkout -b renamed-file-has-no-conflicts dir-in-way~1 &&
	git rm -rf dir &&
	git rm sub/file &&
	printf "1\n2\n3\n4\n5555\n6\n7\n8\n9\n10\n" >dir &&
	git add dir &&
	git commit -m "Independent change" &&

	git checkout -b renamed-file-has-conflicts dir-in-way~1 &&
	git rm -rf dir &&
	git mv sub/file dir &&
	echo 12 >>dir &&
	git add dir &&
	git commit -m "Conflicting change"

HEAD is now at e042178 second
Already up-to-date.
HEAD is now at 7534155 Merge branch 'change+rename' into change
[master (root-commit) 94ef07c] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 a
Switched to a new branch 'dir-in-way'
ok 2 - merge -s recursive up-to-date

expecting success: 

	git reset --hard c0 &&
	test_tick &&
	git merge -s recursive c1 &&
	expect=$(git rev-parse c1) &&
	current=$(git rev-parse HEAD) &&
	test "$expect" = "$current"


[master (root-commit) de45b2c] initial
 Author: A U Thor <author@example.com>
rm 'B'
rm 'M'
HEAD is now at 1bd44cb initial
Updating 1bd44cb..e042178
Fast-forward
 file | 1 +
 1 file changed, 1 insertion(+)
warning: no common commits
ok 3 - merge -s recursive fast-forward

expecting success: 

	git reset --hard c1 &&
	test_tick &&
	git merge -s ours c0 &&
	expect=$(git rev-parse c1) &&
	current=$(git rev-parse HEAD) &&
	test "$expect" = "$current"


[dir-in-way (root-commit) e300687] Common commit
 Author: A U Thor <author@example.com>
 2 files changed, 11 insertions(+)
 create mode 100644 dir/file-in-the-way
 create mode 100644 sub/file
HEAD is now at e042178 second
From ../repo2
 * branch            master     -> FETCH_HEAD
[dir-in-way fc59de0] Commit to merge, with dir in the way
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
Already up-to-date.
Merging:
94ef07c initial
virtual de45b2cb2b3688a6b4f2efd536594a5028ea60ae
found 0 common ancestors:
Already up-to-date!
Merge made by the 'recursive' strategy.
Switched to a new branch 'dir-not-in-way'
ok 8 - up-to-date merge without common ancestor

ok 4 - merge -s ours up-to-date

expecting success: 

	git reset --hard c0 &&
	test_tick &&
	git merge -s ours c1 &&
	expect=$(git rev-parse c0^{tree}) &&
	current=$(git rev-parse HEAD^{tree}) &&
	test "$expect" = "$current"


# passed all 8 test(s)
1..8
rm 'dir/file-in-the-way'
HEAD is now at 1bd44cb initial
[dir-not-in-way 1a0dadd] Commit to merge, with dir removed
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 1 deletion(-)
 delete mode 100644 dir/file-in-the-way
Merge made by the 'ours' strategy.
Switched to a new branch 'renamed-file-has-no-conflicts'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
rm 'dir/file-in-the-way'
*** t6029-merge-subtree.sh ***
rm 'sub/file'
ok 5 - merge -s ours fast-forward

expecting success: 

	git reset --hard c1 &&
	test_tick &&
	git merge -s subtree c0 &&
	expect=$(git rev-parse c1) &&
	current=$(git rev-parse HEAD) &&
	test "$expect" = "$current"


HEAD is now at e042178 second
Already up-to-date.
[renamed-file-has-no-conflicts 3425e03] Independent change
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 2 deletions(-)
 rename sub/file => dir (79%)
 delete mode 100644 dir/file-in-the-way
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6029-merge-subtree/.git/
ok 6 - merge -s subtree up-to-date

expecting success: 

	git reset --hard c0 &&
	test_tick &&
	git merge c1 c2 &&
	expect=$(git rev-parse c2) &&
	current=$(git rev-parse HEAD) &&
	test "$expect" = "$current"

Switched to a new branch 'renamed-file-has-conflicts'
expecting success: 

	s="1 2 3 4 5 6 7 8" &&
	for i in $s; do echo $i; done >hello &&
	git add hello &&
	git commit -m initial &&
	git checkout -b side &&
	echo >>hello world &&
	git add hello &&
	git commit -m second &&
	git checkout master &&
	for i in mundo $s; do echo $i; done >hello &&
	git add hello &&
	git commit -m master


rm 'dir/file-in-the-way'
HEAD is now at 1bd44cb initial
Cloning into 'sub1'...
Updating 1bd44cb..52cad15
Fast-forward
[master (root-commit) 20462d1] initial
 Author: A U Thor <author@example.com>
 1 file changed, 8 insertions(+)
 create mode 100644 hello
 file | 1 +
 1 file changed, 1 insertion(+)
Switched to a new branch 'side'
[renamed-file-has-conflicts 4159951] Conflicting change
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename sub/file => dir (87%)
 delete mode 100644 dir/file-in-the-way
ok 13 - setup for rename + d/f conflicts

expecting success: 
	git reset --hard &&
	git checkout -q renamed-file-has-no-conflicts^0 &&
	git merge --strategy=recursive dir-not-in-way &&
	git diff --quiet &&
	test -f dir &&
	test_cmp expected dir

ok 7 - merge fast-forward octopus

done.
# passed all 7 test(s)
1..7
HEAD is now at 4159951 Conflicting change
[side dc35d98] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Switched to branch 'master'
*** t6030-bisect-porcelain.sh ***
Merging:
3425e03 Independent change
virtual dir-not-in-way
found 1 common ancestor:
e300687 Common commit
Auto-merging dir
Merge made by the 'recursive' strategy.
 dir | 1 +
 1 file changed, 1 insertion(+)
[master 0ceccb1] master
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 1 - setup

expecting success: 

	git merge -s subtree side &&
	for i in mundo $s world; do echo $i; done >expect &&
	test_cmp expect hello


ok 14 - Rename+D/F conflict; renamed file merges + dir not in way

expecting success: 
	git reset --hard &&
	rm -rf dir~* &&
	git checkout -q renamed-file-has-no-conflicts^0 &&
	test_must_fail git merge --strategy=recursive dir-in-way >output &&

	test_i18ngrep "CONFLICT (modify/delete): dir/file-in-the-way" output &&
	test_i18ngrep "Auto-merging dir" output &&
	test_i18ngrep "Adding as dir~HEAD instead" output &&

	test 3 -eq "$(git ls-files -u | wc -l)" &&
	test 2 -eq "$(git ls-files -u dir/file-in-the-way | wc -l)" &&

	test_must_fail git diff --quiet &&
	test_must_fail git diff --cached --quiet &&

	test -f dir/file-in-the-way &&
	test -f dir~HEAD &&
	test_cmp expected dir~HEAD

HEAD is now at d4d6d66 Merge branch 'dir-not-in-way' into HEAD
Merging:
0ceccb1 master
virtual side
found 1 common ancestor:
20462d1 initial
Auto-merging hello
Merge made by the 'subtree' strategy.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6030-bisect-porcelain/.git/
 hello | 1 +
 1 file changed, 1 insertion(+)
ok 2 - subtree available and works like recursive

expecting success: 
	mkdir git-gui &&
	cd git-gui &&
	git init &&
	echo git-gui > git-gui.sh &&
	o1=$(git hash-object git-gui.sh) &&
	git add git-gui.sh &&
	git commit -m "initial git-gui" &&
	cd .. &&
	mkdir git &&
	cd git &&
	git init &&
	echo git >git.c &&
	o2=$(git hash-object git.c) &&
	git add git.c &&
	git commit -m "initial git"

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)

Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6029-merge-subtree/git-gui/.git/
CONFLICT (modify/delete): dir/file-in-the-way deleted in HEAD and modified in dir-in-way. Version dir-in-way of dir/file-in-the-way left in tree.
Auto-merging dir
Adding as dir~HEAD instead
[master (root-commit) 4dc52d1] initial git-gui
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 git-gui.sh
ok 15 - Rename+D/F conflict; renamed file merges but dir in way

expecting success: 
	git reset --hard &&
	rm -rf dir~* &&
	git checkout -q dir-in-way^0 &&
	test_must_fail git merge --strategy=recursive renamed-file-has-no-conflicts >output 2>errors &&

	! grep "error: refusing to lose untracked file at" errors &&
	test_i18ngrep "CONFLICT (modify/delete): dir/file-in-the-way" output &&
	test_i18ngrep "Auto-merging dir" output &&
	test_i18ngrep "Adding as dir~renamed-file-has-no-conflicts instead" output &&

	test 3 -eq "$(git ls-files -u | wc -l)" &&
	test 2 -eq "$(git ls-files -u dir/file-in-the-way | wc -l)" &&

	test_must_fail git diff --quiet &&
	test_must_fail git diff --cached --quiet &&

	test -f dir/file-in-the-way &&
	test -f dir~renamed-file-has-no-conflicts &&
	test_cmp expected dir~renamed-file-has-no-conflicts

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6029-merge-subtree/git/.git/
error: 'dir/file-in-the-way' appears as both a file and as a directory
error: dir/file-in-the-way: cannot drop to stage #0
HEAD is now at 3425e03 Independent change
[master (root-commit) ea8616d] initial git
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 git.c
ok 1 - set up basic repo with 1 file (hello) and 4 commits

ok 3 - setup

expecting success: 
	git bisect reset &&
	git bisect start &&
	git bisect bad $HASH4 &&
	git bisect next

expecting success: 
	git remote add -f gui ../git-gui &&
	git merge -s ours --no-commit gui/master &&
	git read-tree --prefix=git-gui/ -u gui/master &&
	git commit -m "Merge git-gui as our subdirectory" &&
	git checkout -b work &&
	git ls-files -s >actual &&
	(
		echo "100644 $o1 0	git-gui/git-gui.sh"
		echo "100644 $o2 0	git.c"
	) >expected &&
	test_cmp expected actual

ok 28 - git_pull_ff: 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
		)
	
Updating gui
CONFLICT (modify/delete): dir/file-in-the-way deleted in renamed-file-has-no-conflicts and modified in HEAD. Version HEAD of dir/file-in-the-way left in tree.
Auto-merging dir
Adding as dir~renamed-file-has-no-conflicts instead
warning: no common commits
We are not bisecting.
From ../git-gui
 * [new branch]      master     -> gui/master
ok 16 - Same as previous, but merged other way

expecting success: 
	git reset --hard &&
	rm -rf dir~* &&
	git checkout -q renamed-file-has-conflicts^0 &&
	test_must_fail git merge --strategy=recursive dir-not-in-way &&

	test 3 -eq "$(git ls-files -u | wc -l)" &&
	test 3 -eq "$(git ls-files -u dir | wc -l)" &&

	test_must_fail git diff --quiet &&
	test_must_fail git diff --cached --quiet &&

	test -f dir &&
	test_cmp expected dir

Cloning into 'submodule_update'...
error: 'dir/file-in-the-way' appears as both a file and as a directory
error: dir/file-in-the-way: cannot drop to stage #0
warning: unable to unlink dir: Is a directory
HEAD is now at fc59de0 Commit to merge, with dir in the way
Automatic merge went well; stopped before committing as requested
done.
Merging:
4159951 Conflicting change
virtual dir-not-in-way
found 1 common ancestor:
e300687 Common commit
Auto-merging dir
CONFLICT (content): Merge conflict in dir
Automatic merge failed; fix conflicts and then commit the result.
[master 11ff3d6] Merge git-gui as our subdirectory
 Author: A U Thor <author@example.com>
Switched to a new branch 'work'
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
ok 4 - initial merge

expecting success: 
	cd ../git-gui &&
	echo git-gui2 > git-gui.sh &&
	o3=$(git hash-object git-gui.sh) &&
	git add git-gui.sh &&
	git checkout -b master2 &&
	git commit -m "update git-gui" &&
	cd ../git &&
	git pull -s subtree gui master2 &&
	git ls-files -s >actual &&
	(
		echo "100644 $o3 0	git-gui/git-gui.sh"
		echo "100644 $o2 0	git.c"
	) >expected &&
	test_cmp expected actual

ok 17 - Rename+D/F conflict; renamed file cannot merge, dir not in way

expecting success: 
	modify s/dir-not-in-way/dir-in-way/ expected &&

	git reset --hard &&
	rm -rf dir~* &&
	git checkout -q renamed-file-has-conflicts^0 &&
	test_must_fail git merge --strategy=recursive dir-in-way &&

	test 5 -eq "$(git ls-files -u | wc -l)" &&
	test 3 -eq "$(git ls-files -u dir | grep -v file-in-the-way | wc -l)" &&
	test 2 -eq "$(git ls-files -u dir/file-in-the-way | wc -l)" &&

	test_must_fail git diff --quiet &&
	test_must_fail git diff --cached --quiet &&

	test -f dir/file-in-the-way &&
	test -f dir~HEAD &&
	test_cmp expected dir~HEAD

Branch add_sub1 set up to track remote branch add_sub1 from origin.
Switched to a new branch 'master2'
M	git-gui.sh
Deleted branch add_sub1 (was 041e421).
HEAD is now at 4159951 Conflicting change
[master2 1c70fca] update git-gui
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Merging:
4159951 Conflicting change
virtual dir-in-way
found 1 common ancestor:
e300687 Common commit
CONFLICT (modify/delete): dir/file-in-the-way deleted in HEAD and modified in dir-in-way. Version dir-in-way of dir/file-in-the-way left in tree.
Removing dir to make room for subdirectory

Auto-merging dir
CONFLICT (content): Merge conflict in dir
Adding as dir~HEAD instead
Automatic merge failed; fix conflicts and then commit the result.
From ../git-gui
 * branch            master2    -> FETCH_HEAD
 * [new branch]      master2    -> gui/master2
ok 18 - Rename+D/F conflict; renamed file cannot merge and dir in the way

expecting success: 
	git reset --hard &&
	rm -rf dir~* &&
	git checkout -q dir-in-way^0 &&
	test_must_fail git merge --strategy=recursive renamed-file-has-conflicts &&

	test 5 -eq "$(git ls-files -u | wc -l)" &&
	test 3 -eq "$(git ls-files -u dir | grep -v file-in-the-way | wc -l)" &&
	test 2 -eq "$(git ls-files -u dir/file-in-the-way | wc -l)" &&

	test_must_fail git diff --quiet &&
	test_must_fail git diff --cached --quiet &&

	test -f dir/file-in-the-way &&
	test -f dir~renamed-file-has-conflicts &&
	test_cmp expected dir~renamed-file-has-conflicts

Warning: bisecting only with a bad commit.
Merging:
11ff3d6 Merge git-gui as our subdirectory
virtual 1c70fcabfe6bfaf89f9e0fe0bbf8542dce8a178d
found 1 common ancestor:
4dc52d1 initial git-gui
Merge made by the 'subtree' strategy.
error: 'dir/file-in-the-way' appears as both a file and as a directory
error: dir/file-in-the-way: cannot drop to stage #0
Bisecting: 1 revision left to test after this (roughly 1 step)
HEAD is now at 4159951 Conflicting change
 git-gui/git-gui.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Updating aca6d60..041e421
Fast-forward
 .gitmodules | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
ok 5 - merge update

expecting success: 
	cd ../git &&
	git reset --hard master &&
	git checkout -b master2 &&
	git merge -s ours --no-commit gui/master &&
	git read-tree --prefix=git-gui2/ -u gui/master &&
	git commit -m "Merge git-gui2 as our subdirectory" &&
	git checkout -b work2 &&
	git ls-files -s >actual &&
	(
		echo "100644 $o1 0	git-gui/git-gui.sh"
		echo "100644 $o1 0	git-gui2/git-gui.sh"
		echo "100644 $o2 0	git.c"
	) >expected &&
	test_cmp expected actual

[7b7f204a749c3125d5224ed61ea2ae1187ad046f] Add <2: A new day for git> into <hello>.
ok 2 - bisect starts with only one bad

expecting success: 
	git bisect reset &&
	git bisect start &&
	git bisect good $HASH1 &&
	test_must_fail git bisect next

Merging:
fc59de0 Commit to merge, with dir in the way
virtual renamed-file-has-conflicts
found 1 common ancestor:
e300687 Common commit
CONFLICT (modify/delete): dir/file-in-the-way deleted in renamed-file-has-conflicts and modified in HEAD. Version HEAD of dir/file-in-the-way left in tree.
Auto-merging dir
CONFLICT (content): Merge conflict in dir
Adding as dir~renamed-file-has-conflicts instead
Automatic merge failed; fix conflicts and then commit the result.
HEAD is now at 11ff3d6 Merge git-gui as our subdirectory
Switched to a new branch 'master2'
Already up-to-date.
Previous HEAD position was 7b7f204... Add <2: A new day for git> into <hello>.
Switched to branch 'master'
ok 19 - Same as previous, but merged other way

expecting success: 
	git reset --hard &&
	git checkout --orphan rename-dest &&
	git rm -rf . &&
	git clean -fdqx &&

	mkdir one &&
	echo stuff >one/file &&
	git add -A &&
	git commit -m "Common commit" &&

	git mv one/file destdir &&
	git commit -m "Renamed to destdir" &&

	git checkout -b source-conflict HEAD~1 &&
	git rm -rf one &&
	mkdir destdir &&
	touch one destdir/foo &&
	git add -A &&
	git commit -m "Conflicts in the way"

[master2 d077617] Merge git-gui2 as our subdirectory
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 git-gui2/git-gui.sh
error: 'dir/file-in-the-way' appears as both a file and as a directory
error: dir/file-in-the-way: cannot drop to stage #0
warning: unable to unlink dir: Is a directory
Switched to a new branch 'work2'
HEAD is now at fc59de0 Commit to merge, with dir in the way
ok 6 - initial ambiguous subtree

expecting success: 
	cd ../git &&
	git reset --hard master2 &&
	git pull -Xsubtree=git-gui gui master2 &&
	git ls-files -s >actual &&
	(
		echo "100644 $o3 0	git-gui/git-gui.sh"
		echo "100644 $o1 0	git-gui2/git-gui.sh"
		echo "100644 $o2 0	git.c"
	) >expected &&
	test_cmp expected actual

Switched to a new branch 'rename-dest'
rm 'dir/file-in-the-way'
rm 'sub/file'
HEAD is now at d077617 Merge git-gui2 as our subdirectory
[rename-dest (root-commit) bb8c7ea] Common commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one/file
From ../git-gui
 * branch            master2    -> FETCH_HEAD
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
[rename-dest 8656e69] Renamed to destdir
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename one/file => destdir (100%)
Merging:
d077617 Merge git-gui2 as our subdirectory
virtual 1c70fcabfe6bfaf89f9e0fe0bbf8542dce8a178d
found 1 common ancestor:
4dc52d1 initial git-gui
Merge made by the 'recursive' strategy.
Switched to a new branch 'source-conflict'
 git-gui/git-gui.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
rm 'one/file'
ok 7 - merge using explicit

expecting success: 
	cd ../git &&
	git reset --hard master2 &&
	git pull -Xsubtree=git-gui2 gui master2 &&
	git ls-files -s >actual &&
	(
		echo "100644 $o1 0	git-gui/git-gui.sh"
		echo "100644 $o3 0	git-gui2/git-gui.sh"
		echo "100644 $o2 0	git.c"
	) >expected &&
	test_cmp expected actual

HEAD is now at d077617 Merge git-gui2 as our subdirectory
[source-conflict 3c66002] Conflicts in the way
 Author: A U Thor <author@example.com>
 3 files changed, 1 deletion(-)
 create mode 100644 destdir/foo
 create mode 100644 one
 delete mode 100644 one/file
ok 20 - setup both rename source and destination involved in D/F conflict

expecting success: 
	git reset --hard &&
	rm -rf dir~* &&
	git checkout -q rename-dest^0 &&
	test_must_fail git merge --strategy=recursive source-conflict &&

	test 1 -eq "$(git ls-files -u | wc -l)" &&

	test_must_fail git diff --quiet &&

	test -f destdir/foo &&
	test -f one &&
	test -f destdir~HEAD &&
	test "stuff" = "$(cat destdir~HEAD)"

Cloning into 'sub1'...
HEAD is now at 3c66002 Conflicts in the way
From ../git-gui
 * branch            master2    -> FETCH_HEAD
done.
Merging:
8656e69 Renamed to destdir
virtual source-conflict
found 1 common ancestor:
bb8c7ea Common commit
Adding one
Adding destdir/foo
Removing destdir to make room for subdirectory

CONFLICT (rename/delete): destdir deleted in source-conflict and renamed in HEAD. Version HEAD of destdir left in tree at destdir~HEAD.
Automatic merge failed; fix conflicts and then commit the result.
Merging:
d077617 Merge git-gui2 as our subdirectory
virtual 1c70fcabfe6bfaf89f9e0fe0bbf8542dce8a178d
found 1 common ancestor:
4dc52d1 initial git-gui
Merge made by the 'recursive' strategy.
 git-gui2/git-gui.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 21 - both rename source and destination involved in D/F conflict

expecting success: 
	git reset --hard &&
	git checkout --orphan rename-two &&
	git rm -rf . &&
	git clean -fdqx &&

	mkdir one &&
	mkdir two &&
	echo stuff >one/file &&
	echo other >two/file &&
	git add -A &&
	git commit -m "Common commit" &&

	git rm -rf one &&
	git mv two/file one &&
	git commit -m "Rename two/file -> one" &&

	git checkout -b rename-one HEAD~1 &&
	git rm -rf two &&
	git mv one/file two &&
	rm -r one &&
	git commit -m "Rename one/file -> two"

ok 8 - merge2 using explicit

error: 'destdir' appears as both a file and as a directory
# passed all 8 test(s)
1..8
error: destdir: cannot drop to stage #0
HEAD is now at 8656e69 Renamed to destdir
Switched to a new branch 'rename-two'
You need to give me at least one bad and one good revision.
(You can use "git bisect bad" and "git bisect good" for that.)
ok 3 - bisect does not start with only one good

expecting success: 
	git bisect reset &&
	git bisect start &&
	git bisect good $HASH1 &&
	git bisect bad $HASH4 &&
	git bisect next

rm 'destdir'
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
*** t6031-merge-filemode.sh ***
[rename-two (root-commit) feadbd2] Common commit
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 one/file
 create mode 100644 two/file
Already on 'master'
rm 'one/file'
[rename-two 622985c] Rename two/file -> one
 Author: A U Thor <author@example.com>
 2 files changed, 1 deletion(-)
 rename two/file => one (100%)
 delete mode 100644 one/file
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6031-merge-filemode/.git/
Switched to a new branch 'rename-one'
expecting success: 
	: >file1 &&
	git add file1 &&
	git commit -m initial &&
	git checkout -b a1 master &&
	: >dummy &&
	git add dummy &&
	git commit -m a &&
	git checkout -b b1 master &&
	test_chmod +x file1 &&
	git add file1 &&
	git commit -m b1

rm 'two/file'
ok 29 - git_pull_ff_only: 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
		)
	
[master (root-commit) 3550705] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file1
[rename-one bffb3c0] Rename one/file -> two
 Author: A U Thor <author@example.com>
 2 files changed, 1 deletion(-)
 rename one/file => two (100%)
 delete mode 100644 two/file
ok 22 - setup pair rename to parent of other (D/F conflicts)

expecting success: 
	git checkout -q rename-one^0 &&
	mkdir one &&
	test_must_fail git merge --strategy=recursive rename-two &&

	test 2 -eq "$(git ls-files -u | wc -l)" &&
	test 1 -eq "$(git ls-files -u one | wc -l)" &&
	test 1 -eq "$(git ls-files -u two | wc -l)" &&

	test_must_fail git diff --quiet &&

	test 4 -eq $(find . | grep -v .git | wc -l) &&

	test -d one &&
	test -f one~rename-two &&
	test -f two &&
	test "other" = $(cat one~rename-two) &&
	test "stuff" = $(cat two)

Switched to a new branch 'a1'
[a1 2d69dd4] a
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 dummy
Merging:
bffb3c0 Rename one/file -> two
virtual rename-two
found 1 common ancestor:
feadbd2 Common commit
CONFLICT (rename/delete): two deleted in rename-two and renamed in HEAD. Version HEAD of two left in tree.
CONFLICT (rename/delete): one deleted in HEAD and renamed in rename-two. Version rename-two of one left in tree at one~rename-two.
Automatic merge failed; fix conflicts and then commit the result.
Cloning into 'submodule_update'...
Switched to a new branch 'b1'
done.
[b1 6523f21] b1
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 file1
ok 1 - set up mode change in one branch

expecting success: 
		git checkout -f $us &&
		git merge -s $strategy $them &&
		git ls-files -s file1 | grep ^100755
	
ok 23 - pair rename to parent of other (D/F conflicts) w/ untracked dir

Switched to branch 'a1'
expecting success: 
	git reset --hard &&
	git clean -fdqx &&
	test_must_fail git merge --strategy=recursive rename-two &&

	test 2 -eq "$(git ls-files -u | wc -l)" &&
	test 1 -eq "$(git ls-files -u one | wc -l)" &&
	test 1 -eq "$(git ls-files -u two | wc -l)" &&

	test_must_fail git diff --quiet &&

	test 3 -eq $(find . | grep -v .git | wc -l) &&

	test -f one &&
	test -f two &&
	test "other" = $(cat one) &&
	test "stuff" = $(cat two)

warning: unable to unlink one: Is a directory
HEAD is now at bffb3c0 Rename one/file -> two
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Merging:
2d69dd4 a
virtual b1
found 1 common ancestor:
3550705 initial
Merge made by the 'recursive' strategy.
 file1 | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 file1
100755 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0	file1
ok 2 - resolve single mode change (recursive, a1)

Merging:
bffb3c0 Rename one/file -> two
virtual rename-two
found 1 common ancestor:
feadbd2 Common commit
CONFLICT (rename/delete): two deleted in rename-two and renamed in HEAD. Version HEAD of two left in tree.
CONFLICT (rename/delete): one deleted in HEAD and renamed in rename-two. Version rename-two of one left in tree.
Automatic merge failed; fix conflicts and then commit the result.
checking prerequisite: FILEMODE

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	test "$(git config --bool core.filemode)" = true

)
prerequisite FILEMODE ok
expecting success: 
		test -x file1
	
ok 3 - verify executable bit on file (recursive, a1)

expecting success: 
		git checkout -f $us &&
		git merge -s $strategy $them &&
		git ls-files -s file1 | grep ^100755
	
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Switched to branch 'b1'
Deleted branch add_sub1 (was 041e421).
Updating 6523f21..754f100
Fast-forward
ok 24 - pair rename to parent of other (D/F conflicts) w/ clean start

expecting success: 
	git reset --hard &&
	git checkout --orphan first-rename &&
	git rm -rf . &&
	git clean -fdqx &&

	echo stuff >original &&
	git add -A &&
	git commit -m "Common commit" &&

	mkdir two &&
	>two/file &&
	git add two/file &&
	git mv original one &&
	git commit -m "Put two/file in the way, rename to one" &&

	git checkout -b second-rename HEAD~1 &&
	mkdir one &&
	>one/file &&
	git add one/file &&
	git mv original two &&
	git commit -m "Put one/file in the way, rename to two"

 dummy | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 dummy
Switched to a new branch 'add_sub1'
HEAD is now at bffb3c0 Rename one/file -> two
100755 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0	file1
ok 4 - resolve single mode change (recursive, b1)

expecting success: 
		test -x file1
	
ok 5 - verify executable bit on file (recursive, b1)

expecting success: 
		git checkout -f $us &&
		git merge -s $strategy $them &&
		git ls-files -s file1 | grep ^100755
	
Switched to a new branch 'first-rename'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
rm 'two'
Switched to branch 'a1'
Already up-to-date.
Bisecting: 0 revisions left to test after this (roughly 1 step)
100755 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0	file1
ok 6 - resolve single mode change (resolve, a1)

expecting success: 
		test -x file1
	
[first-rename (root-commit) 821dd72] Common commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 original
ok 7 - verify executable bit on file (resolve, a1)

expecting success: 
		git checkout -f $us &&
		git merge -s $strategy $them &&
		git ls-files -s file1 | grep ^100755
	
[3de952f2416b6084f557ec417709eac740c6818c] Add <3: Another new day for git> into <hello>.
Switched to branch 'b1'
Already up-to-date.
100755 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0	file1
ok 8 - resolve single mode change (resolve, b1)

expecting success: 
		test -x file1
	
ok 9 - verify executable bit on file (resolve, b1)

expecting success: 
	git reset --hard HEAD &&
	git checkout -b a2 master &&
	: >file2 &&
	H=$(git hash-object file2) &&
	test_chmod +x file2 &&
	git commit -m a2 &&
	git checkout -b b2 master &&
	: >file2 &&
	git add file2 &&
	git commit -m b2 &&
	{
		echo "100755 $H 2	file2"
		echo "100644 $H 3	file2"
	} >expect

Updating aca6d60..041e421
Fast-forward
[first-rename de9ca31] Put two/file in the way, rename to one
 Author: A U Thor <author@example.com>
 2 files changed, 0 insertions(+), 0 deletions(-)
 rename original => one (100%)
 create mode 100644 two/file
 .gitmodules | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
HEAD is now at 754f100 Merge branch 'b1' into a1
Switched to a new branch 'second-rename'
Switched to a new branch 'a2'
Bisecting: 0 revisions left to test after this (roughly 1 step)
[3de952f2416b6084f557ec417709eac740c6818c] Add <3: Another new day for git> into <hello>.
ok 4 - bisect start with one bad and good

expecting success: 
	git bisect reset &&
	test_must_fail git bisect start foo $HASH1 -- &&
	test_must_fail git bisect start $HASH4 $HASH1 bar -- &&
	test -z "$(git for-each-ref "refs/bisect/*")" &&
	test -z "$(ls .git/BISECT_* 2>/dev/null)" &&
	git bisect start &&
	test_must_fail git bisect good foo $HASH1 &&
	test_must_fail git bisect good $HASH1 bar &&
	test_must_fail git bisect bad frotz &&
	test_must_fail git bisect bad $HASH3 $HASH4 &&
	test_must_fail git bisect skip bar $HASH3 &&
	test_must_fail git bisect skip $HASH1 foo &&
	test -z "$(git for-each-ref "refs/bisect/*")" &&
	git bisect good $HASH1 &&
	git bisect bad $HASH4

[second-rename 449a337] Put one/file in the way, rename to two
 Author: A U Thor <author@example.com>
 2 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 one/file
 rename original => two (100%)
ok 25 - setup rename of one file to two, with directories in the way

expecting success: 
	git checkout -q first-rename^0 &&
	test_must_fail git merge --strategy=recursive second-rename &&

	test 5 -eq "$(git ls-files -s | wc -l)" &&
	test 3 -eq "$(git ls-files -u | wc -l)" &&
	test 1 -eq "$(git ls-files -u one | wc -l)" &&
	test 1 -eq "$(git ls-files -u two | wc -l)" &&
	test 1 -eq "$(git ls-files -u original | wc -l)" &&
	test 2 -eq "$(git ls-files -o | wc -l)" &&

	test -f one/file &&
	test -f two/file &&
	test -f one~HEAD &&
	test -f two~second-rename &&
	! test -f original

[a2 63b1cff] a2
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100755 file2
Switched to a new branch 'b2'
Merging:
de9ca31 Put two/file in the way, rename to one
virtual second-rename
found 1 common ancestor:
821dd72 Common commit
Adding two/file
Adding one/file
Removing one to make room for subdirectory

CONFLICT (rename/rename): Rename "original"->"one" in branch "HEAD" rename "original"->"two" in "second-rename"
one is a directory in second-rename adding as one~HEAD instead
two is a directory in HEAD adding as two~second-rename instead
Automatic merge failed; fix conflicts and then commit the result.
[b2 906b281] b2
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file2
ok 10 - set up mode change in both branches

expecting success: 
		git reset --hard &&
		git checkout -f a2 &&
		test_must_fail git merge -s $strategy b2 &&
		git ls-files -u >actual &&
		test_cmp actual expect &&
		git ls-files -s file2 | grep ^100755
	
Previous HEAD position was 3de952f... Add <3: Another new day for git> into <hello>.
Switched to branch 'master'
HEAD is now at 906b281 b2
Switched to branch 'a2'
ok 26 - check handling of differently renamed file with D/F conflicts

expecting success: 
	git reset --hard &&
	git checkout --orphan first-rename-redo &&
	git rm -rf . &&
	git clean -fdqx &&

	echo stuff >original &&
	mkdir one two &&
	touch one/file two/file &&
	git add -A &&
	git commit -m "Common commit" &&

	git rm -rf one &&
	git mv original one &&
	git commit -m "Rename to one" &&

	git checkout -b second-rename-redo HEAD~1 &&
	git rm -rf two &&
	git mv original two &&
	git commit -m "Rename to two"

Merging:
63b1cff a2
virtual b2
found 1 common ancestor:
3550705 initial
Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
Automatic merge failed; fix conflicts and then commit the result.
error: 'one' appears as both a file and as a directory
error: one: cannot drop to stage #0
warning: unable to unlink two: Is a directory
HEAD is now at de9ca31 Put two/file in the way, rename to one
100755 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 2	file2
ok 11 - detect conflict on double mode change (recursive)

expecting success: 
		test -x file2
	
ok 12 - verify executable bit on file (recursive)

expecting success: 
		git reset --hard &&
		git checkout -f a2 &&
		test_must_fail git merge -s $strategy b2 &&
		git ls-files -u >actual &&
		test_cmp actual expect &&
		git ls-files -s file2 | grep ^100755
	
Switched to a new branch 'first-rename-redo'
HEAD is now at 63b1cff a2
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
rm 'one'
rm 'two/file'
Already on 'a2'
error: Merge requires file-level merging
Trying really trivial in-index merge...
Nope.
'foo' does not appear to be a valid revision
[first-rename-redo (root-commit) dd1f79f] Common commit
 Author: A U Thor <author@example.com>
 3 files changed, 1 insertion(+)
 create mode 100644 one/file
 create mode 100644 original
 create mode 100644 two/file
Trying simple merge.
rm 'one/file'
Simple merge failed, trying Automatic merge.
[first-rename-redo c2767b2] Rename to one
 Author: A U Thor <author@example.com>
 2 files changed, 0 insertions(+), 0 deletions(-)
 rename original => one (100%)
 delete mode 100644 one/file
Cloning into 'sub1'...
Switched to a new branch 'second-rename-redo'
ERROR: File file2 added identically in both branches,
ERROR: but permissions conflict 100755->100644.
fatal: merge program failed
Automatic merge failed; fix conflicts and then commit the result.
rm 'two/file'
100755 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 2	file2
ok 13 - detect conflict on double mode change (resolve)

done.
expecting success: 
		test -x file2
	
ok 14 - verify executable bit on file (resolve)

expecting success: 
	git reset --hard &&
	git checkout -b deletion master &&
	git rm file1 &&
	git commit -m deletion

'bar' does not appear to be a valid revision
[second-rename-redo b8dcab1] Rename to two
 Author: A U Thor <author@example.com>
 2 files changed, 0 insertions(+), 0 deletions(-)
 rename original => two (100%)
 delete mode 100644 two/file
ok 27 - setup rename one file to two; directories moving out of the way

expecting success: 
	git checkout -q first-rename-redo^0 &&
	test_must_fail git merge --strategy=recursive second-rename-redo &&

	test 3 -eq "$(git ls-files -u | wc -l)" &&
	test 1 -eq "$(git ls-files -u one | wc -l)" &&
	test 1 -eq "$(git ls-files -u two | wc -l)" &&
	test 1 -eq "$(git ls-files -u original | wc -l)" &&
	test 0 -eq "$(git ls-files -o | wc -l)" &&

	test -f one &&
	test -f two &&
	! test -f original

HEAD is now at 63b1cff a2
Switched to a new branch 'deletion'
Merging:
c2767b2 Rename to one
virtual second-rename-redo
found 1 common ancestor:
dd1f79f Common commit
Removing two/file
CONFLICT (rename/rename): Rename "original"->"one" in branch "HEAD" rename "original"->"two" in "second-rename-redo"
Automatic merge failed; fix conflicts and then commit the result.
rm 'file1'
[deletion 0fb1635] deletion
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 delete mode 100644 file1
ok 15 - set up delete/modechange scenario

expecting success: 
		git reset --hard &&
		git checkout $us &&
		test_must_fail git merge -s $strategy $them
	
HEAD is now at 0fb1635 deletion
Switched to branch 'b1'
ok 28 - check handling of differently renamed file with D/F conflicts

expecting success: 
	git reset --hard &&
	git checkout --orphan avoid-unnecessary-update-1 &&
	git rm -rf . &&
	git clean -fdqx &&

	printf "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n" >original &&
	git add -A &&
	git commit -m "Common commit" &&

	git mv original rename &&
	echo 11 >>rename &&
	git add -u &&
	git commit -m "Renamed and modified" &&

	git checkout -b merge-branch-1 HEAD~1 &&
	echo "random content" >random-file &&
	git add -A &&
	git commit -m "Random, unrelated changes"

Merging:
754f100 Merge branch 'b1' into a1
virtual deletion
found 1 common ancestor:
3550705 initial
CONFLICT (modify/delete): file1 deleted in deletion and modified in HEAD. Version HEAD of file1 left in tree.
Automatic merge failed; fix conflicts and then commit the result.
ok 16 - detect delete/modechange conflict (recursive, b1)

expecting success: 
		git reset --hard &&
		git checkout $us &&
		test_must_fail git merge -s $strategy $them
	
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
HEAD is now at c2767b2 Rename to one
HEAD is now at 754f100 Merge branch 'b1' into a1
Switched to a new branch 'avoid-unnecessary-update-1'
Switched to branch 'deletion'
rm 'one'
rm 'two/file'
Merging:
0fb1635 deletion
virtual b1
found 1 common ancestor:
3550705 initial
CONFLICT (modify/delete): file1 deleted in HEAD and modified in b1. Version b1 of file1 left in tree.
Automatic merge failed; fix conflicts and then commit the result.
ok 17 - detect delete/modechange conflict (recursive, deletion)

expecting success: 
		git reset --hard &&
		git checkout $us &&
		test_must_fail git merge -s $strategy $them
	
HEAD is now at 0fb1635 deletion
fatal: Needed a single revision
Bad rev input: foo
[avoid-unnecessary-update-1 (root-commit) 0343ed9] Common commit
 Author: A U Thor <author@example.com>
 1 file changed, 10 insertions(+)
 create mode 100644 original
Switched to branch 'b1'
error: Merge requires file-level merging
Trying really trivial in-index merge...
Nope.
ok 30 - git_pull_ff_only: 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
		)
	
Trying simple merge.
[avoid-unnecessary-update-1 d688d85] Renamed and modified
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 rename original => rename (87%)
Simple merge failed, trying Automatic merge.
fatal: Needed a single revision
Switched to a new branch 'merge-branch-1'
Bad rev input: bar
[merge-branch-1 c4c6720] Random, unrelated changes
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 random-file
ok 29 - setup avoid unnecessary update, normal rename

expecting success: 
	git checkout -q avoid-unnecessary-update-1^0 &&
	test-chmtime =1000000000 rename &&
	test-chmtime -v +0 rename >expect &&
	git merge merge-branch-1 &&
	test-chmtime -v +0 rename >actual &&
	test_cmp expect actual # "rename" should have stayed intact

ERROR: File file1 deleted on one branch but had its
ERROR: permissions changed on the other.
fatal: merge program failed
Automatic merge failed; fix conflicts and then commit the result.
ok 18 - detect delete/modechange conflict (resolve, b1)

expecting success: 
		git reset --hard &&
		git checkout $us &&
		test_must_fail git merge -s $strategy $them
	
Cloning into 'submodule_update'...
HEAD is now at 754f100 Merge branch 'b1' into a1
fatal: Needed a single revision
Switched to branch 'deletion'
Bad rev input: frotz
error: Merge requires file-level merging
Trying really trivial in-index merge...
Nope.
done.
Merging:
d688d85 Renamed and modified
virtual merge-branch-1
found 1 common ancestor:
0343ed9 Common commit
Skipped rename (merged same as existing)
Merge made by the 'recursive' strategy.
 random-file | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 random-file
Trying simple merge.
ok 30 - avoid unnecessary update, normal rename

expecting success: 
	git reset --hard &&
	git checkout --orphan avoid-unnecessary-update-2 &&
	git rm -rf . &&
	git clean -fdqx &&

	mkdir df &&
	printf "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n" >df/file &&
	git add -A &&
	git commit -m "Common commit" &&

	git mv df/file temp &&
	rm -rf df &&
	git mv temp df &&
	echo 11 >>df &&
	git add -u &&
	git commit -m "Renamed and modified" &&

	git checkout -b merge-branch-2 HEAD~1 &&
	>unrelated-change &&
	git add unrelated-change &&
	git commit -m "Only unrelated changes"

Simple merge failed, trying Automatic merge.
Switched to a new branch 'no_submodule'
'git bisect bad' can take only one argument.
Branch no_submodule set up to track remote branch no_submodule from origin.
HEAD is now at f31649a Merge branch 'merge-branch-1' into HEAD
Switched to a new branch 'avoid-unnecessary-update-2'
rm 'random-file'
rm 'rename'
ERROR: File file1 deleted on one branch but had its
ERROR: permissions changed on the other.
fatal: merge program failed
Automatic merge failed; fix conflicts and then commit the result.
ok 19 - detect delete/modechange conflict (resolve, deletion)

Branch add_sub1 set up to track remote branch add_sub1 from origin.
# passed all 19 test(s)
1..19
Deleted branch add_sub1 (was 041e421).
fatal: Needed a single revision
Bad rev input: bar
Switched to a new branch 'add_sub1'
[avoid-unnecessary-update-2 (root-commit) f170714] Common commit
 Author: A U Thor <author@example.com>
 1 file changed, 10 insertions(+)
 create mode 100644 df/file
*** t6032-merge-large-rename.sh ***
Branch add_sub1 set up to track remote branch add_sub1 from origin.
[avoid-unnecessary-update-2 8fd808b] Renamed and modified
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 rename df/file => df (87%)
Switched to a new branch 'merge-branch-2'
fatal: Needed a single revision
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6032-merge-large-rename/.git/
Bad rev input: foo
expecting success: 
	touch file &&
	git add . &&
	git commit -m initial &&
	git tag initial

error: The following untracked working tree files would be overwritten by merge:
	sub1
Please move or remove them before you can merge.
Aborting
Updating aca6d60..041e421
[merge-branch-2 6cc6b99] Only unrelated changes
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 unrelated-change
ok 31 - setup to test avoiding unnecessary update, with D/F conflict

expecting success: 
	git checkout -q avoid-unnecessary-update-2^0 &&
	test-chmtime =1000000000 df &&
	test-chmtime -v +0 df >expect &&
	git merge merge-branch-2 &&
	test-chmtime -v +0 df >actual &&
	test_cmp expect actual # "df" should have stayed intact

[master (root-commit) aa9fb80] initial
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file
ok 31 - git_pull_ff_only: added submodule doesn't remove untracked unignored file with same name

ok 1 - setup (initial)

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
		)
	
expecting success: 
	n=5 &&
	expect=ok &&
	git checkout -f master &&
	test_might_fail git branch -D test$n &&
	git reset --hard initial &&
	for i in $(count $n); do
		make_text $i initial initial >$i
	done &&
	git add . &&
	git commit -m add=$n &&
	for i in $(count $n); do
		make_text $i changed initial >$i
	done &&
	git commit -a -m change=$n &&
	git checkout -b test$n HEAD^ &&
	for i in $(count $n); do
		git rm $i
		make_text $i initial changed >$i.moved
	done &&
	git add . &&
	git commit -m change+rename=$n &&
	case "$expect" in
		ok) git merge master ;;
		 *) test_must_fail git merge master ;;
	esac
	
Already on 'master'
Merging:
8fd808b Renamed and modified
virtual merge-branch-2
found 1 common ancestor:
f170714 Common commit
Skipped df (merged same as existing)
Merge made by the 'recursive' strategy.
error: branch 'test5' not found.
 unrelated-change | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 unrelated-change
ok 32 - avoid unnecessary update, with D/F conflict

expecting success: 
	git rm -rf . &&
	git clean -fdqx &&
	rm -rf .git &&
	git init &&

	>irrelevant &&
	mkdir df &&
	>df/file &&
	git add -A &&
	git commit -mA &&

	git checkout -b side &&
	git rm -rf df &&
	git commit -mB &&

	git checkout master &&
	git rm -rf df &&
	echo bla >df &&
	git add -A &&
	git commit -m "Add a newfile"

HEAD is now at aa9fb80 initial
rm 'df'
rm 'unrelated-change'
Cloning into 'submodule_update'...
done.
[master ff6f318] add=5
 Author: A U Thor <author@example.com>
 5 files changed, 110 insertions(+)
 create mode 100644 1
 create mode 100644 2
 create mode 100644 3
 create mode 100644 4
 create mode 100644 5
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.
[master 1b9321e] change=5
 Author: A U Thor <author@example.com>
 5 files changed, 5 insertions(+), 5 deletions(-)
t5572-pull-submodule.sh: 159: cd: can't cd to sub1
Switched to a new branch 'test5'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6022-merge-rename/.git/
Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
Bisecting: 0 revisions left to test after this (roughly 1 step)
rm '1'
Deleted branch replace_file_with_sub1 (was 1bf82f3).
rm '2'
[3de952f2416b6084f557ec417709eac740c6818c] Add <3: Another new day for git> into <hello>.
ok 5 - bisect fails if given any junk instead of revs

expecting success: 
	git bisect reset &&
	echo "* master" > branch.expect &&
	git branch > branch.output &&
	cmp branch.expect branch.output

[master (root-commit) 73f9d91] A
 Author: A U Thor <author@example.com>
 2 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 df/file
 create mode 100644 irrelevant
Switched to a new branch 'replace_file_with_sub1'
rm '3'
Switched to a new branch 'side'
rm '4'
Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
rm 'df/file'
rm '5'
[side 95f515b] B
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 delete mode 100644 df/file
Switched to branch 'master'
Previous HEAD position was 3de952f... Add <3: Another new day for git> into <hello>.
Switched to branch 'master'
rm 'df/file'
[test5 8fc1b5a] change+rename=5
 Author: A U Thor <author@example.com>
 5 files changed, 5 insertions(+), 5 deletions(-)
 rename 1 => 1.moved (91%)
 rename 2 => 2.moved (91%)
 rename 3 => 3.moved (91%)
 rename 4 => 4.moved (91%)
 rename 5 => 5.moved (91%)
[master ba459c7] Add a newfile
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
 create mode 100644 df
 delete mode 100644 df/file
ok 33 - setup avoid unnecessary update, dir->(file,nothing)

expecting success: 
	git checkout -q master^0 &&
	test-chmtime =1000000000 df &&
	test-chmtime -v +0 df >expect &&
	git merge side &&
	test-chmtime -v +0 df >actual &&
	test_cmp expect actual # "df" should have stayed intact

Updating 88f15cf..1bf82f3
Fast-forward
 .gitmodules | 4 ++++
 sub1        | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)
 mode change 100644 => 160000 sub1
Merging:
8fc1b5a change+rename=5
virtual master
found 1 common ancestor:
ff6f318 add=5
Auto-merging 5.moved
Auto-merging 4.moved
Auto-merging 3.moved
Auto-merging 2.moved
Auto-merging 1.moved
Merge made by the 'recursive' strategy.
ok 6 - bisect reset: back in the master branch

expecting success: 
	git checkout -b other &&
	git bisect start &&
	git bisect good $HASH1 &&
	git bisect bad $HASH3 &&
	git bisect reset &&
	echo "  master" > branch.expect &&
	echo "* other" >> branch.expect &&
	git branch > branch.output &&
	cmp branch.expect branch.output

 1.moved | 2 +-
 2.moved | 2 +-
 3.moved | 2 +-
 4.moved | 2 +-
 5.moved | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
ok 2 - rename (5, ok)

expecting success: 
	git config diff.renamelimit 4

ok 3 - set diff.renamelimit to 4

expecting success: 
	n=4 &&
	expect=ok &&
	git checkout -f master &&
	test_might_fail git branch -D test$n &&
	git reset --hard initial &&
	for i in $(count $n); do
		make_text $i initial initial >$i
	done &&
	git add . &&
	git commit -m add=$n &&
	for i in $(count $n); do
		make_text $i changed initial >$i
	done &&
	git commit -a -m change=$n &&
	git checkout -b test$n HEAD^ &&
	for i in $(count $n); do
		git rm $i
		make_text $i initial changed >$i.moved
	done &&
	git add . &&
	git commit -m change+rename=$n &&
	case "$expect" in
		ok) git merge master ;;
		 *) test_must_fail git merge master ;;
	esac
	
Merging:
ba459c7 Add a newfile
virtual side
found 1 common ancestor:
73f9d91 A
Adding df
Merge made by the 'recursive' strategy.
Switched to a new branch 'other'
ok 34 - avoid unnecessary update, dir->(file,nothing)

expecting success: 
	git rm -rf . &&
	git clean -fdqx &&
	rm -rf .git &&
	git init &&

	>irrelevant &&
	>file &&
	git add -A &&
	git commit -mA &&

	git checkout -b side &&
	git rm -f file &&
	git commit -m "Delete file" &&

	git checkout master &&
	echo bla >file &&
	git add -A &&
	git commit -m "Modify file"

Switched to branch 'master'
rm 'df'
error: branch 'test4' not found.
rm 'irrelevant'
HEAD is now at aa9fb80 initial
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6022-merge-rename/.git/
[master 635e0af] add=4
 Author: A U Thor <author@example.com>
 4 files changed, 88 insertions(+)
 create mode 100644 1
 create mode 100644 2
 create mode 100644 3
 create mode 100644 4
[master (root-commit) bc44fa8] A
 Author: A U Thor <author@example.com>
 2 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file
 create mode 100644 irrelevant
Switched to a new branch 'side'
[master 21c56c7] change=4
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+), 4 deletions(-)
rm 'file'
Switched to a new branch 'test4'
[side fff24a2] Delete file
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 delete mode 100644 file
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
rm '1'
Switched to branch 'master'
rm '2'
rm '3'
[master c1d52d7] Modify file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 35 - setup avoid unnecessary update, modify/delete

expecting success: 
	git checkout -q master^0 &&
	test-chmtime =1000000000 file &&
	test-chmtime -v +0 file >expect &&
	test_must_fail git merge side &&
	test-chmtime -v +0 file >actual &&
	test_cmp expect actual # "file" should have stayed intact

rm '4'
[test4 5a92d3d] change+rename=4
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+), 4 deletions(-)
 rename 1 => 1.moved (91%)
 rename 2 => 2.moved (91%)
 rename 3 => 3.moved (91%)
 rename 4 => 4.moved (91%)
Merging:
c1d52d7 Modify file
virtual side
found 1 common ancestor:
bc44fa8 A
CONFLICT (modify/delete): file deleted in side and modified in HEAD. Version HEAD of file left in tree.
Automatic merge failed; fix conflicts and then commit the result.
Cloning into 'sub1'...
ok 36 - avoid unnecessary update, modify/delete

expecting success: 
	git rm -rf . &&
	git clean -fdqx &&
	rm -rf .git &&
	git init &&

	printf "1\n2\n3\n4\n5\n6\n7\n8\n" >file &&
	git add -A &&
	git commit -mA &&

	git checkout -b side &&
	cp file newfile &&
	git add -A &&
	git commit -m "Add file copy" &&

	git checkout master &&
	git mv file newfile &&
	git commit -m "Rename file"

file: needs merge
rm 'file'
rm 'file'
rm 'irrelevant'
Merging:
5a92d3d change+rename=4
virtual master
found 1 common ancestor:
635e0af add=4
Auto-merging 4.moved
Auto-merging 3.moved
Auto-merging 2.moved
Auto-merging 1.moved
Merge made by the 'recursive' strategy.
 1.moved | 2 +-
 2.moved | 2 +-
 3.moved | 2 +-
 4.moved | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
ok 4 - rename (4, ok)

expecting success: 
	n=5 &&
	expect=fail &&
	git checkout -f master &&
	test_might_fail git branch -D test$n &&
	git reset --hard initial &&
	for i in $(count $n); do
		make_text $i initial initial >$i
	done &&
	git add . &&
	git commit -m add=$n &&
	for i in $(count $n); do
		make_text $i changed initial >$i
	done &&
	git commit -a -m change=$n &&
	git checkout -b test$n HEAD^ &&
	for i in $(count $n); do
		git rm $i
		make_text $i initial changed >$i.moved
	done &&
	git add . &&
	git commit -m change+rename=$n &&
	case "$expect" in
		ok) git merge master ;;
		 *) test_must_fail git merge master ;;
	esac
	
done.
Switched to branch 'master'
Deleted branch test5 (was 7bfd6d8).
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6022-merge-rename/.git/
HEAD is now at aa9fb80 initial
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[master (root-commit) 01f94f7] A
 Author: A U Thor <author@example.com>
 1 file changed, 8 insertions(+)
 create mode 100644 file
[master 26db10f] add=5
 Author: A U Thor <author@example.com>
 5 files changed, 110 insertions(+)
 create mode 100644 1
 create mode 100644 2
 create mode 100644 3
 create mode 100644 4
 create mode 100644 5
[7b7f204a749c3125d5224ed61ea2ae1187ad046f] Add <2: A new day for git> into <hello>.
Switched to a new branch 'side'
[side fcc9768] Add file copy
 Author: A U Thor <author@example.com>
 1 file changed, 8 insertions(+)
 create mode 100644 newfile
[master 18e1e86] change=5
 Author: A U Thor <author@example.com>
 5 files changed, 5 insertions(+), 5 deletions(-)
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
Switched to branch 'master'
Switched to a new branch 'test5'
Previous HEAD position was 7b7f204... Add <2: A new day for git> into <hello>.
Switched to branch 'other'
rm '1'
[master 68bb6dd] Rename file
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename file => newfile (100%)
ok 37 - setup avoid unnecessary update, rename/add-dest

expecting success: 
	git checkout -q master^0 &&
	test-chmtime =1000000000 newfile &&
	test-chmtime -v +0 newfile >expect &&
	git merge side &&
	test-chmtime -v +0 newfile >actual &&
	test_cmp expect actual # "file" should have stayed intact

rm '2'
rm '3'
rm '4'
Merging:
68bb6dd Rename file
virtual side
found 1 common ancestor:
01f94f7 A
Merge made by the 'recursive' strategy.
ok 7 - bisect reset: back in another branch

expecting success: 
	git bisect reset &&
	git branch > branch.output &&
	cmp branch.expect branch.output

rm '5'
ok 38 - avoid unnecessary update, rename/add-dest

expecting success: 
	git reset --hard &&
	git checkout --orphan rename-plus-small-change &&
	git rm -rf . &&
	git clean -fdqx &&

	echo ORIGINAL >file &&
	git add file &&

	test_tick &&
	git commit -m Initial &&
	git checkout -b rename_branch &&
	git mv file renamed_file &&
	git commit -m Rename &&
	git checkout rename-plus-small-change &&
	echo NEW-VERSION >file &&
	git commit -a -m Reformat

[test5 c261f97] change+rename=5
 Author: A U Thor <author@example.com>
 10 files changed, 110 insertions(+), 110 deletions(-)
 delete mode 100644 1
 create mode 100644 1.moved
 delete mode 100644 2
 create mode 100644 2.moved
 delete mode 100644 3
 create mode 100644 3.moved
 delete mode 100644 4
 create mode 100644 4.moved
 delete mode 100644 5
 create mode 100644 5.moved
ok 32 - git_pull_ff_only: replace tracked file with submodule creates empty directory

HEAD is now at f182518 Merge branch 'side' into HEAD
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
		)
	
Switched to a new branch 'rename-plus-small-change'
We are not bisecting.
warning: inexact rename detection was skipped due to too many files.
warning: you may want to set your merge.renamelimit variable to at least 5 and retry the command.
Merging:
c261f97 change+rename=5
virtual master
found 1 common ancestor:
26db10f add=5
CONFLICT (modify/delete): 5 deleted in HEAD and modified in master. Version master of 5 left in tree.
CONFLICT (modify/delete): 4 deleted in HEAD and modified in master. Version master of 4 left in tree.
CONFLICT (modify/delete): 3 deleted in HEAD and modified in master. Version master of 3 left in tree.
CONFLICT (modify/delete): 2 deleted in HEAD and modified in master. Version master of 2 left in tree.
CONFLICT (modify/delete): 1 deleted in HEAD and modified in master. Version master of 1 left in tree.
Automatic merge failed; fix conflicts and then commit the result.
rm 'newfile'
ok 5 - rename (5, fail)

expecting success: 
	git config merge.renamelimit 5

ok 8 - bisect reset when not bisecting

expecting success: 
	git bisect reset &&
	git bisect start &&
	git bisect good $HASH1 &&
	git bisect bad $HASH3 &&
	git pack-refs --all --prune &&
	git bisect next &&
	git bisect reset &&
	test -z "$(git for-each-ref "refs/bisect/*")" &&
	test -z "$(git for-each-ref "refs/heads/bisect")"

ok 6 - set merge.renamelimit to 5

expecting success: 
	n=5 &&
	expect=ok &&
	git checkout -f master &&
	test_might_fail git branch -D test$n &&
	git reset --hard initial &&
	for i in $(count $n); do
		make_text $i initial initial >$i
	done &&
	git add . &&
	git commit -m add=$n &&
	for i in $(count $n); do
		make_text $i changed initial >$i
	done &&
	git commit -a -m change=$n &&
	git checkout -b test$n HEAD^ &&
	for i in $(count $n); do
		git rm $i
		make_text $i initial changed >$i.moved
	done &&
	git add . &&
	git commit -m change+rename=$n &&
	case "$expect" in
		ok) git merge master ;;
		 *) test_must_fail git merge master ;;
	esac
	
Switched to branch 'master'
[rename-plus-small-change (root-commit) e44eadc] Initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
We are not bisecting.
Switched to a new branch 'rename_branch'
Deleted branch test5 (was c261f97).
Cloning into 'submodule_update'...
HEAD is now at aa9fb80 initial
[rename_branch f706812] Rename
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename file => renamed_file (100%)
done.
Switched to branch 'rename-plus-small-change'
[master c386ebf] add=5
 Author: A U Thor <author@example.com>
 5 files changed, 110 insertions(+)
 create mode 100644 1
 create mode 100644 2
 create mode 100644 3
 create mode 100644 4
 create mode 100644 5
[rename-plus-small-change 068ab66] Reformat
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 39 - setup merge of rename + small change

expecting success: 
	git merge rename_branch &&

	test 1 -eq $(git ls-files -s | wc -l) &&
	test 0 -eq $(git ls-files -o | wc -l) &&
	test $(git rev-parse HEAD:renamed_file) = $(git rev-parse HEAD~1:file)

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.
Merging:
068ab66 Reformat
virtual rename_branch
found 1 common ancestor:
e44eadc Initial
Skipped renamed_file (merged same as existing)
Merge made by the 'recursive' strategy.
[master 76dbebd] change=5
 Author: A U Thor <author@example.com>
 5 files changed, 5 insertions(+), 5 deletions(-)
 file => renamed_file | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename file => renamed_file (100%)
error: 8ed2e6719f8484ce01fa3ce133fe42d25c2441b8^{commit}: expected commit type, but the object dereferences to tree type
fatal: Needed a single revision
Switched to a new branch 'test5'
Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
rm '1'
Deleted branch replace_directory_with_sub1 (was 99dcd27).
rm '2'
ok 40 - merge rename + small change

expecting success: 
	git rm -rf . &&
	git clean -fdqx &&
	rm -rf .git &&
	git init &&

	printf "1\n2\n3\n4\n5\n6\n7\n8\n" >original_file &&
	git add original_file &&
	git commit -mA &&

	git checkout -b rename &&
	echo 9 >>original_file &&
	git add original_file &&
	git mv original_file renamed_file &&
	git commit -mB &&

	git checkout master &&
	echo 8.5 >>original_file &&
	git add original_file &&
	git commit -mC

rm 'renamed_file'
Switched to a new branch 'replace_directory_with_sub1'
rm '3'
rm '4'
Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
rm '5'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6022-merge-rename/.git/
[test5 11bd519] change+rename=5
 Author: A U Thor <author@example.com>
 10 files changed, 110 insertions(+), 110 deletions(-)
 delete mode 100644 1
 create mode 100644 1.moved
 delete mode 100644 2
 create mode 100644 2.moved
 delete mode 100644 3
 create mode 100644 3.moved
 delete mode 100644 4
 create mode 100644 4.moved
 delete mode 100644 5
 create mode 100644 5.moved
[master (root-commit) 4847e8a] A
 Author: A U Thor <author@example.com>
 1 file changed, 8 insertions(+)
 create mode 100644 original_file
Merging:
11bd519 change+rename=5
virtual master
found 1 common ancestor:
c386ebf add=5
Auto-merging 5.moved
Auto-merging 4.moved
Auto-merging 3.moved
Auto-merging 2.moved
Auto-merging 1.moved
Merge made by the 'recursive' strategy.
 1.moved | 2 +-
 2.moved | 2 +-
 3.moved | 2 +-
 4.moved | 2 +-
 5.moved | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
ok 7 - rename (5, ok)

expecting success: 
	n=6 &&
	expect=fail &&
	git checkout -f master &&
	test_might_fail git branch -D test$n &&
	git reset --hard initial &&
	for i in $(count $n); do
		make_text $i initial initial >$i
	done &&
	git add . &&
	git commit -m add=$n &&
	for i in $(count $n); do
		make_text $i changed initial >$i
	done &&
	git commit -a -m change=$n &&
	git checkout -b test$n HEAD^ &&
	for i in $(count $n); do
		git rm $i
		make_text $i initial changed >$i.moved
	done &&
	git add . &&
	git commit -m change+rename=$n &&
	case "$expect" in
		ok) git merge master ;;
		 *) test_must_fail git merge master ;;
	esac
	
Switched to a new branch 'rename'
Updating 48ceb4d..99dcd27
Fast-forward
Switched to branch 'master'
 .gitmodules | 4 ++++
 sub1/file1  | 1 -
 sub1/file2  | 1 -
 sub1/file3  | 1 -
 4 files changed, 4 insertions(+), 3 deletions(-)
 delete mode 100644 sub1/file1
 delete mode 100644 sub1/file2
 delete mode 100644 sub1/file3
error: branch 'test6' not found.
[rename e9adddb] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 rename original_file => renamed_file (88%)
HEAD is now at aa9fb80 initial
Switched to branch 'master'
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[master 0487bb6] C
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 41 - setup for use of extended merge markers

expecting success: 
	git checkout rename^0 &&
	test_must_fail git merge -s recursive master^0 &&
	test_cmp expected renamed_file

[master d354b54] add=6
 Author: A U Thor <author@example.com>
 6 files changed, 132 insertions(+)
 create mode 100644 1
 create mode 100644 2
 create mode 100644 3
 create mode 100644 4
 create mode 100644 5
 create mode 100644 6
[7b7f204a749c3125d5224ed61ea2ae1187ad046f] Add <2: A new day for git> into <hello>.
Note: checking out 'rename^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 e9adddb... B
Merging:
e9adddb B
virtual master^0
found 1 common ancestor:
4847e8a A
Auto-merging renamed_file
CONFLICT (content): Merge conflict in renamed_file
Automatic merge failed; fix conflicts and then commit the result.
[master 418aabd] change=6
 Author: A U Thor <author@example.com>
 6 files changed, 6 insertions(+), 6 deletions(-)
ok 42 - merge master into rename has correct extended markers

expecting success: 
	git reset --hard &&
	git checkout master^0 &&
	test_must_fail git merge -s recursive rename^0 &&
	test_cmp expected renamed_file

Switched to a new branch 'test6'
HEAD is now at e9adddb B
Previous HEAD position was e9adddb... B
HEAD is now at 0487bb6... C
rm '1'
rm '2'
Bisecting: 0 revisions left to test after this (roughly 0 steps)
Merging:
0487bb6 C
virtual rename^0
found 1 common ancestor:
4847e8a A
Auto-merging renamed_file
CONFLICT (content): Merge conflict in renamed_file
Automatic merge failed; fix conflicts and then commit the result.
ok 43 - merge rename into master has correct extended markers

expecting success: 
	git rm -rf . &&
	git clean -fdqx &&
	rm -rf .git &&
	git init &&

	> irrelevant_file &&
	printf "1\n2\n3\n4\n5\n6\n7\n8\n" >original_file &&
	git add irrelevant_file original_file &&
	git commit -mA &&

	git checkout -b rename &&
	git mv original_file renamed_file &&
	git commit -mB &&

	git checkout master &&
	git rm original_file &&
	git commit -mC

rm '3'
renamed_file: needs merge
rm 'renamed_file'
rm 'renamed_file'
rm 'renamed_file'
[7b7f204a749c3125d5224ed61ea2ae1187ad046f] Add <2: A new day for git> into <hello>.
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
rm '4'
rm '5'
rm '6'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6022-merge-rename/.git/
[test6 7939f3b] change+rename=6
 Author: A U Thor <author@example.com>
 12 files changed, 132 insertions(+), 132 deletions(-)
 delete mode 100644 1
 create mode 100644 1.moved
 delete mode 100644 2
 create mode 100644 2.moved
 delete mode 100644 3
 create mode 100644 3.moved
 delete mode 100644 4
 create mode 100644 4.moved
 delete mode 100644 5
 create mode 100644 5.moved
 delete mode 100644 6
 create mode 100644 6.moved
[master (root-commit) e476651] A
 Author: A U Thor <author@example.com>
 2 files changed, 8 insertions(+)
 create mode 100644 irrelevant_file
 create mode 100644 original_file
Previous HEAD position was 7b7f204... Add <2: A new day for git> into <hello>.
Switched to branch 'other'
Switched to a new branch 'rename'
warning: inexact rename detection was skipped due to too many files.
warning: you may want to set your merge.renamelimit variable to at least 6 and retry the command.
Merging:
7939f3b change+rename=6
virtual master
found 1 common ancestor:
d354b54 add=6
CONFLICT (modify/delete): 6 deleted in HEAD and modified in master. Version master of 6 left in tree.
CONFLICT (modify/delete): 5 deleted in HEAD and modified in master. Version master of 5 left in tree.
CONFLICT (modify/delete): 4 deleted in HEAD and modified in master. Version master of 4 left in tree.
CONFLICT (modify/delete): 3 deleted in HEAD and modified in master. Version master of 3 left in tree.
CONFLICT (modify/delete): 2 deleted in HEAD and modified in master. Version master of 2 left in tree.
CONFLICT (modify/delete): 1 deleted in HEAD and modified in master. Version master of 1 left in tree.
Automatic merge failed; fix conflicts and then commit the result.
ok 8 - rename (6, fail)

expecting success: 
	git config --unset merge.renamelimit &&
	git config --unset diff.renamelimit &&

	git reset --hard initial &&
	for i in $(count 200); do
		make_text foo bar baz >$i
	done &&
	git add . &&
	git commit -m create-files &&

	git branch simple-change &&
	git checkout -b simple-rename &&

	mkdir builtin &&
	git mv [0-9]* builtin/ &&
	git commit -m renamed &&

	git checkout simple-change &&
	>unrelated-change &&
	git add unrelated-change &&
	git commit -m unrelated-change

Cloning into 'sub1'...
[rename 951e2d3] B
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename original_file => renamed_file (100%)
HEAD is now at aa9fb80 initial
Switched to branch 'master'
done.
ok 9 - bisect reset removes packed refs

rm 'original_file'
expecting success: 
	git bisect reset &&
	git bisect start --no-checkout &&
	git bisect good $HASH1 &&
	git bisect bad $HASH3 &&
	git bisect next &&
	git bisect reset &&
	test -z "$(git for-each-ref "refs/bisect/*")" &&
	test -z "$(git for-each-ref "refs/heads/bisect")" &&
	test -z "$(git for-each-ref "BISECT_HEAD")"

[master 52b2874] C
 Author: A U Thor <author@example.com>
 1 file changed, 8 deletions(-)
 delete mode 100644 original_file
ok 44 - setup spurious "refusing to lose untracked" message

expecting success: 
	git checkout master^0 &&
	test_must_fail git merge rename^0 2>errors.txt &&
	! grep "refusing to lose untracked file" errors.txt

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 52b2874... C
We are not bisecting.
Merging:
52b2874 C
virtual rename^0
found 1 common ancestor:
e476651 A
CONFLICT (rename/delete): renamed_file deleted in HEAD and renamed in rename^0. Version rename^0 of renamed_file left in tree.
Automatic merge failed; fix conflicts and then commit the result.
ok 45 - no spurious "refusing to lose untracked" message

expecting success: 
	git checkout -f -b empty-base &&
	>empty1 &&
	git add empty1 &&
	git commit -m base &&
	echo content >empty1 &&
	git add empty1 &&
	git commit -m fill &&
	git checkout -b empty-topic HEAD^ &&
	git mv empty1 empty2 &&
	git commit -m rename &&
	test_must_fail git merge empty-base &&
	>expect &&
	test_cmp expect empty2

Switched to a new branch 'empty-base'
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
[empty-base a940ee2] base
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 empty1
[empty-base d42ce4d] fill
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Switched to a new branch 'empty-topic'
[empty-topic ab32619] rename
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename empty1 => empty2 (100%)
ok 33 - git_pull_ff_only: 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
		)
	
Merging:
ab32619 rename
virtual empty-base
found 1 common ancestor:
a940ee2 base
CONFLICT (modify/delete): empty1 deleted in HEAD and modified in empty-base. Version empty-base of empty1 left in tree.
Automatic merge failed; fix conflicts and then commit the result.
ok 46 - do not follow renames for empty files

# passed all 46 test(s)
1..46
*** t6033-merge-crlf.sh ***
Cloning into 'submodule_update'...
done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6033-merge-crlf/.git/
expecting success: 
	git config core.autocrlf true &&
	echo foo | append_cr >file &&
	git add file &&
	git commit -m "Initial" &&
	git tag initial &&
	git branch side &&
	echo line from a | append_cr >file &&
	git commit -m "add line from a" file &&
	git tag a &&
	git checkout side &&
	echo line from b | append_cr >file &&
	git commit -m "add line from b" file &&
	git tag b &&
	git checkout master

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[7b7f204a749c3125d5224ed61ea2ae1187ad046f] Add <2: A new day for git> into <hello>.
[master (root-commit) b2a17ac] Initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
[master 692b02e] add line from a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Bisecting: 0 revisions left to test after this (roughly 0 steps)
Switched to branch 'side'
[7b7f204a749c3125d5224ed61ea2ae1187ad046f] Add <2: A new day for git> into <hello>.
[side 2786e3b] add line from b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to branch 'master'
ok 1 - setup

expecting success: 
	git reset --hard initial &&
	git merge side -s ours &&
	cat file | remove_cr | append_cr >file.temp &&
	test_cmp file file.temp

HEAD is now at b2a17ac Initial
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
Merge made by the 'ours' strategy.
ok 2 - Check "ours" is CRLF

expecting success: 
	git reset --hard a &&
	test_must_fail git merge side &&
	cat file | remove_cr | append_cr >file.temp &&
	test_cmp file file.temp

HEAD is now at 692b02e add line from a
ok 10 - bisect reset removes bisect state after --no-checkout

expecting success: 
	git branch > branch.output &&
	grep "* other" branch.output > /dev/null &&
	git bisect start $HASH4 $HASH1 -- &&
	git bisect good &&
	git bisect start $HASH4 $HASH1 -- &&
	git bisect bad &&
	git bisect reset &&
	git branch > branch.output &&
	grep "* other" branch.output > /dev/null

Merging:
692b02e add line from a
virtual side
found 1 common ancestor:
b2a17ac Initial
Auto-merging file
CONFLICT (content): Merge conflict in file
Automatic merge failed; fix conflicts and then commit the result.
Cloning into 'sub1'...
ok 3 - Check that conflict file is CRLF

# passed all 3 test(s)
1..3
done.
*** t6034-merge-rename-nocruft.sh ***
[test6 0a6a38d] create-files
 Author: A U Thor <author@example.com>
 200 files changed, 4400 insertions(+)
 create mode 100644 1
 create mode 100644 10
 create mode 100644 100
 create mode 100644 101
 create mode 100644 102
 create mode 100644 103
 create mode 100644 104
 create mode 100644 105
 create mode 100644 106
 create mode 100644 107
 create mode 100644 108
 create mode 100644 109
 create mode 100644 11
 create mode 100644 110
 create mode 100644 111
 create mode 100644 112
 create mode 100644 113
 create mode 100644 114
 create mode 100644 115
 create mode 100644 116
 create mode 100644 117
 create mode 100644 118
 create mode 100644 119
 create mode 100644 12
 create mode 100644 120
 create mode 100644 121
 create mode 100644 122
 create mode 100644 123
 create mode 100644 124
 create mode 100644 125
 create mode 100644 126
 create mode 100644 127
 create mode 100644 128
 create mode 100644 129
 create mode 100644 13
 create mode 100644 130
 create mode 100644 131
 create mode 100644 132
 create mode 100644 133
 create mode 100644 134
 create mode 100644 135
 create mode 100644 136
 create mode 100644 137
 create mode 100644 138
 create mode 100644 139
 create mode 100644 14
 create mode 100644 140
 create mode 100644 141
 create mode 100644 142
 create mode 100644 143
 create mode 100644 144
 create mode 100644 145
 create mode 100644 146
 create mode 100644 147
 create mode 100644 148
 create mode 100644 149
 create mode 100644 15
 create mode 100644 150
 create mode 100644 151
 create mode 100644 152
 create mode 100644 153
 create mode 100644 154
 create mode 100644 155
 create mode 100644 156
 create mode 100644 157
 create mode 100644 158
 create mode 100644 159
 create mode 100644 16
 create mode 100644 160
 create mode 100644 161
 create mode 100644 162
 create mode 100644 163
 create mode 100644 164
 create mode 100644 165
 create mode 100644 166
 create mode 100644 167
 create mode 100644 168
 create mode 100644 169
 create mode 100644 17
 create mode 100644 170
 create mode 100644 171
 create mode 100644 172
 create mode 100644 173
 create mode 100644 174
 create mode 100644 175
 create mode 100644 176
 create mode 100644 177
 create mode 100644 178
 create mode 100644 179
 create mode 100644 18
 create mode 100644 180
 create mode 100644 181
 create mode 100644 182
 create mode 100644 183
 create mode 100644 184
 create mode 100644 185
 create mode 100644 186
 create mode 100644 187
 create mode 100644 188
 create mode 100644 189
 create mode 100644 19
 create mode 100644 190
 create mode 100644 191
 create mode 100644 192
 create mode 100644 193
 create mode 100644 194
 create mode 100644 195
 create mode 100644 196
 create mode 100644 197
 create mode 100644 198
 create mode 100644 199
 create mode 100644 2
 create mode 100644 20
 create mode 100644 200
 create mode 100644 21
 create mode 100644 22
 create mode 100644 23
 create mode 100644 24
 create mode 100644 25
 create mode 100644 26
 create mode 100644 27
 create mode 100644 28
 create mode 100644 29
 create mode 100644 3
 create mode 100644 30
 create mode 100644 31
 create mode 100644 32
 create mode 100644 33
 create mode 100644 34
 create mode 100644 35
 create mode 100644 36
 create mode 100644 37
 create mode 100644 38
 create mode 100644 39
 create mode 100644 4
 create mode 100644 40
 create mode 100644 41
 create mode 100644 42
 create mode 100644 43
 create mode 100644 44
 create mode 100644 45
 create mode 100644 46
 create mode 100644 47
 create mode 100644 48
 create mode 100644 49
 create mode 100644 5
 create mode 100644 50
 create mode 100644 51
 create mode 100644 52
 create mode 100644 53
 create mode 100644 54
 create mode 100644 55
 create mode 100644 56
 create mode 100644 57
 create mode 100644 58
 create mode 100644 59
 create mode 100644 6
 create mode 100644 60
 create mode 100644 61
 create mode 100644 62
 create mode 100644 63
 create mode 100644 64
 create mode 100644 65
 create mode 100644 66
 create mode 100644 67
 create mode 100644 68
 create mode 100644 69
 create mode 100644 7
 create mode 100644 70
 create mode 100644 71
 create mode 100644 72
 create mode 100644 73
 create mode 100644 74
 create mode 100644 75
 create mode 100644 76
 create mode 100644 77
 create mode 100644 78
 create mode 100644 79
 create mode 100644 8
 create mode 100644 80
 create mode 100644 81
 create mode 100644 82
 create mode 100644 83
 create mode 100644 84
 create mode 100644 85
 create mode 100644 86
 create mode 100644 87
 create mode 100644 88
 create mode 100644 89
 create mode 100644 9
 create mode 100644 90
 create mode 100644 91
 create mode 100644 92
 create mode 100644 93
 create mode 100644 94
 create mode 100644 95
 create mode 100644 96
 create mode 100644 97
 create mode 100644 98
 create mode 100644 99
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6034-merge-rename-nocruft/.git/
Switched to a new branch 'simple-rename'
expecting success: 
cat >A <<\EOF &&
a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
c cccccccccccccccccccccccccccccccccccccccccccccccc
d dddddddddddddddddddddddddddddddddddddddddddddddd
e eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
f ffffffffffffffffffffffffffffffffffffffffffffffff
g gggggggggggggggggggggggggggggggggggggggggggggggg
h hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
i iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
j jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
k kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
l llllllllllllllllllllllllllllllllllllllllllllllll
m mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
n nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
o oooooooooooooooooooooooooooooooooooooooooooooooo
EOF

cat >M <<\EOF &&
A AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
B BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
D DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
E EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
F FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
G GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
H HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
I IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
J JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ
K KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
L LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
M MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
N NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
O OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
EOF

git add A M &&
git commit -m "initial has A and M" &&
git branch white &&
git branch red &&
git branch blue &&

git checkout white &&
sed -e "/^g /s/.*/g : white changes a line/" <A >B &&
sed -e "/^G /s/.*/G : colored branch changes a line/" <M >N &&
rm -f A M &&
git update-index --add --remove A B M N &&
git commit -m "white renames A->B, M->N" &&

git checkout red &&
echo created by red >R &&
git update-index --add R &&
git commit -m "red creates R" &&

git checkout blue &&
sed -e "/^o /s/.*/g : blue changes a line/" <A >B &&
rm -f A &&
mv B A &&
git update-index A &&
git commit -m "blue modify A" &&

git checkout master
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
[master (root-commit) 1bd0502] initial has A and M
 Author: A U Thor <author@example.com>
 2 files changed, 30 insertions(+)
 create mode 100644 A
 create mode 100644 M
Bisecting: 0 revisions left to test after this (roughly 1 step)
[3de952f2416b6084f557ec417709eac740c6818c] Add <3: Another new day for git> into <hello>.
Switched to branch 'white'
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
Deleted branch remove_sub1 (was e68bdee).
Switched to a new branch 'remove_sub1'
[white 985b327] white renames A->B, M->N
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 2 deletions(-)
 rename A => B (93%)
 rename M => N (93%)
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
[simple-rename 852ccdf] renamed
 Author: A U Thor <author@example.com>
 200 files changed, 0 insertions(+), 0 deletions(-)
 rename 99 => builtin/1 (100%)
 rename 98 => builtin/10 (100%)
 rename 97 => builtin/100 (100%)
 rename 96 => builtin/101 (100%)
 rename 95 => builtin/102 (100%)
 rename 94 => builtin/103 (100%)
 rename 93 => builtin/104 (100%)
 rename 92 => builtin/105 (100%)
 rename 91 => builtin/106 (100%)
 rename 90 => builtin/107 (100%)
 rename 9 => builtin/108 (100%)
 rename 89 => builtin/109 (100%)
 rename 88 => builtin/11 (100%)
 rename 87 => builtin/110 (100%)
 rename 86 => builtin/111 (100%)
 rename 85 => builtin/112 (100%)
 rename 84 => builtin/113 (100%)
 rename 83 => builtin/114 (100%)
 rename 82 => builtin/115 (100%)
 rename 81 => builtin/116 (100%)
 rename 80 => builtin/117 (100%)
 rename 8 => builtin/118 (100%)
 rename 79 => builtin/119 (100%)
 rename 78 => builtin/12 (100%)
 rename 77 => builtin/120 (100%)
 rename 76 => builtin/121 (100%)
 rename 75 => builtin/122 (100%)
 rename 74 => builtin/123 (100%)
 rename 73 => builtin/124 (100%)
 rename 72 => builtin/125 (100%)
 rename 71 => builtin/126 (100%)
 rename 70 => builtin/127 (100%)
 rename 7 => builtin/128 (100%)
 rename 69 => builtin/129 (100%)
 rename 68 => builtin/13 (100%)
 rename 67 => builtin/130 (100%)
 rename 66 => builtin/131 (100%)
 rename 65 => builtin/132 (100%)
 rename 64 => builtin/133 (100%)
 rename 63 => builtin/134 (100%)
 rename 62 => builtin/135 (100%)
 rename 61 => builtin/136 (100%)
 rename 60 => builtin/137 (100%)
 rename 6 => builtin/138 (100%)
 rename 59 => builtin/139 (100%)
 rename 58 => builtin/14 (100%)
 rename 57 => builtin/140 (100%)
 rename 56 => builtin/141 (100%)
 rename 55 => builtin/142 (100%)
 rename 54 => builtin/143 (100%)
 rename 144 => builtin/144 (100%)
 rename 145 => builtin/145 (100%)
 rename 146 => builtin/146 (100%)
 rename 147 => builtin/147 (100%)
 rename 148 => builtin/148 (100%)
 rename 149 => builtin/149 (100%)
 rename 15 => builtin/15 (100%)
 rename 150 => builtin/150 (100%)
 rename 151 => builtin/151 (100%)
 rename 152 => builtin/152 (100%)
 rename 153 => builtin/153 (100%)
 rename 154 => builtin/154 (100%)
 rename 155 => builtin/155 (100%)
 rename 156 => builtin/156 (100%)
 rename 157 => builtin/157 (100%)
 rename 158 => builtin/158 (100%)
 rename 159 => builtin/159 (100%)
 rename 16 => builtin/16 (100%)
 rename 160 => builtin/160 (100%)
 rename 161 => builtin/161 (100%)
 rename 162 => builtin/162 (100%)
 rename 163 => builtin/163 (100%)
 rename 164 => builtin/164 (100%)
 rename 165 => builtin/165 (100%)
 rename 166 => builtin/166 (100%)
 rename 167 => builtin/167 (100%)
 rename 168 => builtin/168 (100%)
 rename 169 => builtin/169 (100%)
 rename 17 => builtin/17 (100%)
 rename 170 => builtin/170 (100%)
 rename 171 => builtin/171 (100%)
 rename 172 => builtin/172 (100%)
 rename 173 => builtin/173 (100%)
 rename 174 => builtin/174 (100%)
 rename 175 => builtin/175 (100%)
 rename 176 => builtin/176 (100%)
 rename 177 => builtin/177 (100%)
 rename 178 => builtin/178 (100%)
 rename 179 => builtin/179 (100%)
 rename 18 => builtin/18 (100%)
 rename 180 => builtin/180 (100%)
 rename 181 => builtin/181 (100%)
 rename 182 => builtin/182 (100%)
 rename 183 => builtin/183 (100%)
 rename 184 => builtin/184 (100%)
 rename 185 => builtin/185 (100%)
 rename 186 => builtin/186 (100%)
 rename 187 => builtin/187 (100%)
 rename 188 => builtin/188 (100%)
 rename 189 => builtin/189 (100%)
 rename 19 => builtin/19 (100%)
 rename 190 => builtin/190 (100%)
 rename 191 => builtin/191 (100%)
 rename 192 => builtin/192 (100%)
 rename 193 => builtin/193 (100%)
 rename 194 => builtin/194 (100%)
 rename 195 => builtin/195 (100%)
 rename 196 => builtin/196 (100%)
 rename 197 => builtin/197 (100%)
 rename 198 => builtin/198 (100%)
 rename 199 => builtin/199 (100%)
 rename 2 => builtin/2 (100%)
 rename 20 => builtin/20 (100%)
 rename 200 => builtin/200 (100%)
 rename 21 => builtin/21 (100%)
 rename 22 => builtin/22 (100%)
 rename 23 => builtin/23 (100%)
 rename 24 => builtin/24 (100%)
 rename 25 => builtin/25 (100%)
 rename 26 => builtin/26 (100%)
 rename 27 => builtin/27 (100%)
 rename 28 => builtin/28 (100%)
 rename 29 => builtin/29 (100%)
 rename 3 => builtin/3 (100%)
 rename 30 => builtin/30 (100%)
 rename 31 => builtin/31 (100%)
 rename 32 => builtin/32 (100%)
 rename 33 => builtin/33 (100%)
 rename 34 => builtin/34 (100%)
 rename 35 => builtin/35 (100%)
 rename 36 => builtin/36 (100%)
 rename 37 => builtin/37 (100%)
 rename 38 => builtin/38 (100%)
 rename 39 => builtin/39 (100%)
 rename 4 => builtin/4 (100%)
 rename 40 => builtin/40 (100%)
 rename 41 => builtin/41 (100%)
 rename 42 => builtin/42 (100%)
 rename 43 => builtin/43 (100%)
 rename 44 => builtin/44 (100%)
 rename 45 => builtin/45 (100%)
 rename 46 => builtin/46 (100%)
 rename 47 => builtin/47 (100%)
 rename 48 => builtin/48 (100%)
 rename 49 => builtin/49 (100%)
 rename 5 => builtin/5 (100%)
 rename 50 => builtin/50 (100%)
 rename 51 => builtin/51 (100%)
 rename 52 => builtin/52 (100%)
 rename 53 => builtin/53 (100%)
 rename 143 => builtin/54 (100%)
 rename 142 => builtin/55 (100%)
 rename 141 => builtin/56 (100%)
 rename 140 => builtin/57 (100%)
 rename 14 => builtin/58 (100%)
 rename 139 => builtin/59 (100%)
 rename 138 => builtin/6 (100%)
 rename 137 => builtin/60 (100%)
 rename 136 => builtin/61 (100%)
 rename 135 => builtin/62 (100%)
 rename 134 => builtin/63 (100%)
 rename 133 => builtin/64 (100%)
 rename 132 => builtin/65 (100%)
 rename 131 => builtin/66 (100%)
 rename 130 => builtin/67 (100%)
 rename 13 => builtin/68 (100%)
 rename 129 => builtin/69 (100%)
 rename 128 => builtin/7 (100%)
 rename 127 => builtin/70 (100%)
 rename 126 => builtin/71 (100%)
 rename 125 => builtin/72 (100%)
 rename 124 => builtin/73 (100%)
 rename 123 => builtin/74 (100%)
 rename 122 => builtin/75 (100%)
 rename 121 => builtin/76 (100%)
 rename 120 => builtin/77 (100%)
 rename 12 => builtin/78 (100%)
 rename 119 => builtin/79 (100%)
 rename 118 => builtin/8 (100%)
 rename 117 => builtin/80 (100%)
 rename 116 => builtin/81 (100%)
 rename 115 => builtin/82 (100%)
 rename 114 => builtin/83 (100%)
 rename 113 => builtin/84 (100%)
 rename 112 => builtin/85 (100%)
 rename 111 => builtin/86 (100%)
 rename 110 => builtin/87 (100%)
 rename 11 => builtin/88 (100%)
 rename 109 => builtin/89 (100%)
 rename 108 => builtin/9 (100%)
 rename 107 => builtin/90 (100%)
 rename 106 => builtin/91 (100%)
 rename 105 => builtin/92 (100%)
 rename 104 => builtin/93 (100%)
Switched to branch 'red'
 rename 103 => builtin/94 (100%)
 rename 102 => builtin/95 (100%)
 rename 101 => builtin/96 (100%)
 rename 100 => builtin/97 (100%)
 rename 10 => builtin/98 (100%)
 rename 1 => builtin/99 (100%)
[red 62bb19e] red creates R
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 R
Switched to branch 'blue'
32a594a3fdac2d57cf6d02987e30eec68511498c is the first bad commit
commit 32a594a3fdac2d57cf6d02987e30eec68511498c
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:16:13 2005 -0700

    Add <4: Ciao for now> into <hello>.

:100644 100644 2601b1193ce6251a6a1a51885a2f660dd931b5d8 af8e44a1153de8c58d0e2cfd9b1da2ac1959e9ff M	hello
[blue fe9f835] blue modify A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
warning: unable to rmdir sub1: Directory not empty
Updating 041e421..e68bdee
Fast-forward
 .gitmodules | 4 ----
 1 file changed, 4 deletions(-)
 delete mode 100644 .gitmodules
Switched to branch 'master'
ok 1 - setup

expecting success: 
	git checkout -b red-white red &&
	git merge white &&
	git write-tree &&
	test_path_is_file B &&
	test_path_is_file N &&
	test_path_is_file R &&
	test_path_is_missing A &&
	test_path_is_missing M

Switched to a new branch 'red-white'
Merging:
62bb19e red creates R
virtual white
found 1 common ancestor:
1bd0502 initial has A and M
Auto-merging N
Auto-merging B
Merge made by the 'recursive' strategy.
 A => B | 2 +-
 M => N | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
 rename A => B (93%)
 rename M => N (93%)
ok 34 - git_pull_ff_only: removed submodule leaves submodule directory and its contents in place

2f1341e5f32ecb7f45a35d122e62999a76d463cf
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 2 - merge white into red (A->B,M->N)

expecting success: 
	git checkout -b white-blue white &&
	echo dirty >A &&
	git merge blue &&
	git write-tree &&
	test_path_is_file A &&
	echo dirty >expect &&
	test_cmp expect A &&
	test_path_is_file B &&
	test_path_is_file N &&
	test_path_is_missing M

Previous HEAD position was 3de952f... Add <3: Another new day for git> into <hello>.
Switched to branch 'other'
Switched to branch 'simple-change'
Switched to a new branch 'white-blue'
Merging:
985b327 white renames A->B, M->N
virtual blue
found 1 common ancestor:
1bd0502 initial has A and M
Skipped N (merged same as existing)
Auto-merging B
Merge made by the 'recursive' strategy.
 B | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
1db6abaa095ec16043333967f8d0dbaa01cdf029
ok 3 - merge blue into white (A->B, mod A, A untracked)

# passed all 3 test(s)
1..3
[simple-change 2a86f4d] unrelated-change
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 unrelated-change
ok 9 - setup large simple rename

expecting success: 
	sane_unset GIT_MERGE_VERBOSITY &&
	git merge --no-stat simple-rename | grep -v Removing >output &&
	test_line_count -lt 5 output

Cloning into 'submodule_update'...
*** t6035-merge-dir-to-symlink.sh ***
done.
Bisecting: 0 revisions left to test after this (roughly 1 step)
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
[3de952f2416b6084f557ec417709eac740c6818c] Add <3: Another new day for git> into <hello>.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6035-merge-dir-to-symlink/.git/
expecting success: 
	mkdir -p a/b/c a/b-2/c &&
	> a/b/c/d &&
	> a/b-2/c/d &&
	> a/x &&
	git add -A &&
	git commit -m base &&
	git tag start &&
	rm -rf a/b &&
	git add -A &&
	test_ln_s_add b-2 a/b &&
	git commit -m "dir to symlink"

[master (root-commit) a475908] base
 Author: A U Thor <author@example.com>
 3 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 a/b-2/c/d
 create mode 100644 a/b/c/d
 create mode 100644 a/x
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
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[master 96cb6b3] dir to symlink
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
 create mode 120000 a/b
 delete mode 100644 a/b/c/d
ok 1 - create a commit where dir a/b changed to symlink

expecting success: 
	git checkout HEAD^0 &&
	git reset --hard master &&
	git rm --cached a/b &&
	git commit -m "untracked symlink remains" &&
	test_must_fail git checkout start^0

[7b7f204a749c3125d5224ed61ea2ae1187ad046f] Add <2: A new day for git> into <hello>.
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 96cb6b3... dir to symlink
HEAD is now at 96cb6b3 dir to symlink
rm 'a/b'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
[detached HEAD 727f741] untracked symlink remains
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 120000 a/b
Previous HEAD position was 7b7f204... Add <2: A new day for git> into <hello>.
Switched to branch 'other'
error: The following untracked working tree files would be overwritten by checkout:
	a/b
Please move or remove them before you can switch branches.
Aborting
ok 2 - checkout does not clobber untracked symlink

expecting success: 
	git checkout HEAD^0 &&
	git reset --hard master &&
	git rm --cached a/b &&
	git commit -m "untracked symlink remains" &&
	git checkout -f start^0 &&
	test -f a/b-2/c/d

HEAD is now at 727f741... untracked symlink remains
HEAD is now at 96cb6b3 dir to symlink
rm 'a/b'
[detached HEAD 727f741] untracked symlink remains
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 120000 a/b
ok 11 - bisect start: back in good branch

expecting success: 
	git bisect reset &&
	test_must_fail git bisect start $HASH4 foo -- &&
	git branch > branch.output &&
	grep "* other" branch.output > /dev/null &&
	test_must_fail test -e .git/BISECT_START

Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  727f741 untracked symlink remains

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> 727f741

HEAD is now at a475908... base
ok 3 - a/b-2/c/d is kept when clobbering symlink b

expecting success: 
	git checkout HEAD^0 &&
	git reset --hard master &&
	 git checkout start^0 &&
	 test -f a/b-2/c/d

Cloning into 'sub1'...
HEAD is now at a475908... base
HEAD is now at 96cb6b3 dir to symlink
We are not bisecting.
done.
ok 10 - massive simple rename does not spam added files

Previous HEAD position was 96cb6b3... dir to symlink
HEAD is now at a475908... base
ok 4 - checkout should not have deleted a/b-2/c/d

expecting success: 
	git reset --hard &&
	test -f a/b-2/c/d &&
	echo x > a/x &&
	git add a/x &&
	git commit -m x &&
	git tag baseline

# passed all 10 test(s)
1..10
HEAD is now at a475908 base
[detached HEAD 11fbe36] x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 5 - setup for merge test

expecting success: 
	git reset --hard &&
	git checkout baseline^0 &&
	git merge -s resolve master &&
	test -f a/b-2/c/d

'foo' does not appear to be a valid revision
ok 12 - bisect start: no ".git/BISECT_START" created if junk rev

expecting success: 
	git bisect start $HASH4 $HASH1 -- &&
	git bisect good &&
	cp .git/BISECT_START saved &&
	test_must_fail git bisect start $HASH4 foo -- &&
	git branch > branch.output &&
	test_i18ngrep "* (no branch, bisect started on other)" branch.output > /dev/null &&
	test_cmp saved .git/BISECT_START

HEAD is now at 11fbe36 x
HEAD is now at 11fbe36... x
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
*** t6036-recursive-corner-cases.sh ***
error: Merge requires file-level merging
Trying really trivial in-index merge...
Nope.
Trying simple merge.
Simple merge failed, trying Automatic merge.
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6036-recursive-corner-cases/.git/
expecting success: 
	ten="0 1 2 3 4 5 6 7 8 9" &&
	for i in $ten
	do
		echo line $i in a sample file
	done >one &&
	for i in $ten
	do
		echo line $i in another sample file
	done >two &&
	git add one two &&
	test_tick && git commit -m initial &&

	git branch L1 &&
	git checkout -b R1 &&
	git mv one three &&
	test_tick && git commit -m R1 &&

	git checkout L1 &&
	git mv two three &&
	test_tick && git commit -m L1 &&

	git checkout L1^0 &&
	test_tick && git merge -s ours R1 &&
	git tag L2 &&

	git checkout R1^0 &&
	test_tick && git merge -s ours L1 &&
	git tag R2

Adding a/b
[master (root-commit) 4871052] initial
 Author: A U Thor <author@example.com>
 2 files changed, 20 insertions(+)
 create mode 100644 one
 create mode 100644 two
Merge made by the 'resolve' strategy.
 a/b     | 1 +
 a/b/c/d | 0
 2 files changed, 1 insertion(+)
 create mode 120000 a/b
 delete mode 100644 a/b/c/d
ok 6 - Handle D/F conflict, do not lose a/b-2/c/d in merge (resolve)

expecting success: 
	test -h a/b

ok 7 - a/b was resolved as symlink

expecting success: 
	git reset --hard &&
	git checkout baseline^0 &&
	git merge -s recursive master &&
	test -f a/b-2/c/d

Deleted branch remove_sub1 (was e68bdee).
Switched to a new branch 'R1'
HEAD is now at 57efd62 Merge branch 'master' into HEAD
Switched to a new branch 'remove_sub1'
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  57efd62 Merge branch 'master' into HEAD

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> 57efd62

HEAD is now at 11fbe36... x
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
[R1 6592516] R1
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename one => three (100%)
Bisecting: 0 revisions left to test after this (roughly 1 step)
Merging:
11fbe36 x
virtual master
found 1 common ancestor:
a475908 base
Removing a/b/c/d
Adding a/b
Merge made by the 'recursive' strategy.
Switched to branch 'L1'
 a/b     | 1 +
 a/b/c/d | 0
 2 files changed, 1 insertion(+)
 create mode 120000 a/b
 delete mode 100644 a/b/c/d
ok 8 - Handle D/F conflict, do not lose a/b-2/c/d in merge (recursive)

expecting success: 
	test -h a/b

ok 9 - a/b was resolved as symlink

expecting success: 
	git reset --hard &&
	git checkout master^0 &&
	git merge -s resolve baseline^0 &&
	test -f a/b-2/c/d

[3de952f2416b6084f557ec417709eac740c6818c] Add <3: Another new day for git> into <hello>.
HEAD is now at 99e270c Merge branch 'master' into HEAD
[L1 bd99445] L1
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename two => three (100%)
Note: checking out 'L1^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 bd99445... L1
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  99e270c Merge branch 'master' into HEAD

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> 99e270c

HEAD is now at 96cb6b3... dir to symlink
error: Merge requires file-level merging
Trying really trivial in-index merge...
Nope.
warning: unable to rmdir sub1: Directory not empty
Updating 041e421..e68bdee
Fast-forward
Merge made by the 'ours' strategy.
 .gitmodules | 4 ----
 1 file changed, 4 deletions(-)
 delete mode 100644 .gitmodules
Trying simple merge.
Simple merge failed, trying Automatic merge.
Previous HEAD position was d46c613... Merge branch 'R1' into HEAD
HEAD is now at 6592516... R1
Merge made by the 'ours' strategy.
32a594a3fdac2d57cf6d02987e30eec68511498c is the first bad commit
commit 32a594a3fdac2d57cf6d02987e30eec68511498c
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:16:13 2005 -0700

    Add <4: Ciao for now> into <hello>.

:100644 100644 2601b1193ce6251a6a1a51885a2f660dd931b5d8 af8e44a1153de8c58d0e2cfd9b1da2ac1959e9ff M	hello
ok 1 - setup basic criss-cross + rename with no modifications

expecting success: 
	git reset --hard &&
	git checkout L2^0 &&

	test_must_fail git merge -s recursive R2^0 &&

	test 2 = $(git ls-files -s | wc -l) &&
	test 2 = $(git ls-files -u | wc -l) &&
	test 2 = $(git ls-files -o | wc -l) &&

	test $(git rev-parse :2:three) = $(git rev-parse L2:three) &&
	test $(git rev-parse :3:three) = $(git rev-parse R2:three) &&

	test $(git rev-parse L2:three) = $(git hash-object three~HEAD) &&
	test $(git rev-parse R2:three) = $(git hash-object three~R2^0)

Merge made by the 'resolve' strategy.
 a/x | 1 +
 1 file changed, 1 insertion(+)
ok 10 - Handle F/D conflict, do not lose a/b-2/c/d in merge (resolve)

expecting success: 
	test -h a/b

ok 11 - a/b was resolved as symlink

expecting success: 
	git reset --hard &&
	git checkout master^0 &&
	git merge -s recursive baseline^0 &&
	test -f a/b-2/c/d

HEAD is now at 01e4222 Merge branch 'L1' into HEAD
Previous HEAD position was 01e4222... Merge branch 'L1' into HEAD
HEAD is now at d46c613... Merge branch 'R1' into HEAD
HEAD is now at 933c05c Merge commit 'baseline^0' into HEAD
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  933c05c Merge commit 'baseline^0' into HEAD

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> 933c05c

HEAD is now at 96cb6b3... dir to symlink
Merging:
d46c613 Merge branch 'R1' into HEAD
virtual R2^0
found 2 common ancestors:
6592516 R1
bd99445 L1
  Merging:
  6592516 R1
  bd99445 L1
  found 1 common ancestor:
  4871052 initial
  CONFLICT (rename/rename): Rename one->three in Temporary merge branch 1. Rename two->three in Temporary merge branch 2
CONFLICT (rename/rename): Rename one->three in R2^0. Rename two->three in HEAD
Renaming one to three~R2^0 and two to three~HEAD instead
Automatic merge failed; fix conflicts and then commit the result.
Merging:
96cb6b3 dir to symlink
virtual baseline^0
found 1 common ancestor:
a475908 base
Adding a/b
Merge made by the 'recursive' strategy.
 a/x | 1 +
 1 file changed, 1 insertion(+)
ok 12 - Handle F/D conflict, do not lose a/b-2/c/d in merge (recursive)

ok 35 - git_pull_ff_only: removed submodule leaves submodule containing a .git directory alone

expecting success: 
		prolog &&
		reset_work_tree_to add_sub1 &&
		(
			cd submodule_update &&
'foo' does not appear to be a valid revision
			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
		)
	
expecting success: 
	test -h a/b

ok 13 - a/b was resolved as symlink

checking known breakage: 
	git reset --hard &&
	git checkout baseline^0 &&
	>a/b/c/e &&
	test_must_fail git merge -s resolve master &&
	test -f a/b/c/e &&
	test -f a/b-2/c/d

ok 13 - bisect start: existing ".git/BISECT_START" not modified if junk rev

expecting success: 
	git bisect start $HASH4 $HASH1 -- &&
	git bisect good &&
	test_must_fail git bisect start $HASH1 $HASH4 -- &&
	git branch > branch.output &&
	grep "* other" branch.output > /dev/null &&
	test_must_fail test -e .git/BISECT_START

HEAD is now at 933c05c Merge commit 'baseline^0' into HEAD
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  933c05c Merge commit 'baseline^0' into HEAD

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> 933c05c

HEAD is now at 11fbe36... x
error: Merge requires file-level merging
Trying really trivial in-index merge...
Nope.
ok 2 - merge simple rename+criss-cross with no modifications

expecting success: 
	git rm -rf . &&
	git clean -fdqx &&
	rm -rf .git &&
	git init &&

	ten="0 1 2 3 4 5 6 7 8 9" &&
	for i in $ten
	do
		echo line $i in a sample file
	done >one &&
	for i in $ten
	do
		echo line $i in another sample file
	done >two &&
	git add one two &&
	test_tick && git commit -m initial &&

	git branch L1 &&
	git checkout -b R1 &&
	git mv one three &&
	echo more >>two &&
	git add two &&
	test_tick && git commit -m R1 &&

	git checkout L1 &&
	git mv two three &&
	test_tick && git commit -m L1 &&

	git checkout L1^0 &&
	test_tick && git merge -s ours R1 &&
	git tag L2 &&

	git checkout R1^0 &&
	test_tick && git merge -s ours L1 &&
	git tag R2

three: needs merge
rm 'three'
rm 'three'
Trying simple merge.
Simple merge failed, trying Automatic merge.
Cloning into 'submodule_update'...
Previous HEAD position was 3de952f... Add <3: Another new day for git> into <hello>.
Switched to branch 'other'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6036-recursive-corner-cases/.git/
done.
Adding a/b
Merge made by the 'resolve' strategy.
[master (root-commit) a49a3c8] initial
 Author: A U Thor <author@example.com>
 2 files changed, 20 insertions(+)
 create mode 100644 one
 create mode 100644 two
 a/b     | 1 +
 a/b/c/d | 0
 2 files changed, 1 insertion(+)
 create mode 120000 a/b
 delete mode 100644 a/b/c/d
test_must_fail: command succeeded: git merge -s resolve master
not ok 14 - do not lose untracked in merge (resolve) # TODO known breakage

expecting success: 
	git reset --hard &&
	git checkout baseline^0 &&
	>a/b/c/e &&
	test_must_fail git merge -s recursive master &&
	test -f a/b/c/e &&
	test -f a/b-2/c/d

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
HEAD is now at 99e270c Merge branch 'master' into HEAD
Switched to a new branch 'R1'
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  99e270c Merge branch 'master' into HEAD

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> 99e270c

HEAD is now at 11fbe36... x
Merging:
11fbe36 x
virtual master
found 1 common ancestor:
a475908 base
Removing a/b/c/d
CONFLICT (directory/file): There is a directory with name a/b in HEAD. Adding a/b as a/b~master
Automatic merge failed; fix conflicts and then commit the result.
ok 15 - do not lose untracked in merge (recursive)

expecting success: 
	git reset --hard &&
	git checkout baseline^0 &&
	echo more content >>a/b/c/d &&
	test_must_fail git merge -s resolve master

warning: unable to unlink a/b: Is a directory
[R1 6cf23b5] R1
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
 rename one => three (100%)
HEAD is now at 11fbe36 x
HEAD is now at 11fbe36... x
Switched to branch 'L1'
Bisecting: 0 revisions left to test after this (roughly 1 step)
error: Entry 'a/b/c/d' not uptodate. Cannot merge.
Trying really trivial in-index merge...
Nope.
[L1 d6ff089] L1
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename two => three (100%)
[3de952f2416b6084f557ec417709eac740c6818c] Add <3: Another new day for git> into <hello>.
error: Entry 'a/b/c/d' not uptodate. Cannot merge.
Merge with strategy resolve failed.
ok 16 - do not lose modifications in merge (resolve)

expecting success: 
	git reset --hard &&
	git checkout baseline^0 &&
	echo more content >>a/b/c/d &&
	test_must_fail git merge -s recursive master

Note: checking out 'L1^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 d6ff089... L1
HEAD is now at 11fbe36 x
Merge made by the 'ours' strategy.
HEAD is now at 11fbe36... x
error: Your local changes to the following files would be overwritten by merge:
	a/b/c/d
Please, commit your changes or stash them before you can merge.
Aborting
fatal: merging of trees 695fce9fd104d35d689ea7465b7232978f5090fc and 9b692e5ee87aae16ad6ecbfd5cddc632859a1cca failed
Merging:
11fbe36 x
virtual master
found 1 common ancestor:
a475908 base
ok 17 - do not lose modifications in merge (recursive)

expecting success: 
	git reset --hard &&
	git checkout start^0 &&
	rm -rf a/b-2 &&
	git add -A &&
	test_ln_s_add b a/b-2 &&
	git commit -m "dir a/b-2 to symlink" &&
	git tag test2

Previous HEAD position was 71d3a95... Merge branch 'R1' into HEAD
HEAD is now at 6cf23b5... R1
HEAD is now at 11fbe36 x
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
Merge made by the 'ours' strategy.
Previous HEAD position was 11fbe36... x
HEAD is now at a475908... base
32a594a3fdac2d57cf6d02987e30eec68511498c is the first bad commit
commit 32a594a3fdac2d57cf6d02987e30eec68511498c
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:16:13 2005 -0700

    Add <4: Ciao for now> into <hello>.

:100644 100644 2601b1193ce6251a6a1a51885a2f660dd931b5d8 af8e44a1153de8c58d0e2cfd9b1da2ac1959e9ff M	hello
ok 3 - setup criss-cross + rename merges with basic modification

expecting success: 
	git reset --hard &&
	git checkout L2^0 &&

	test_must_fail git merge -s recursive R2^0 &&

	test 2 = $(git ls-files -s | wc -l) &&
	test 2 = $(git ls-files -u | wc -l) &&
	test 2 = $(git ls-files -o | wc -l) &&

	test $(git rev-parse :2:three) = $(git rev-parse L2:three) &&
	test $(git rev-parse :3:three) = $(git rev-parse R2:three) &&

	test $(git rev-parse L2:three) = $(git hash-object three~HEAD) &&
	test $(git rev-parse R2:three) = $(git hash-object three~R2^0)

HEAD is now at 7f8967e Merge branch 'L1' into HEAD
Previous HEAD position was 7f8967e... Merge branch 'L1' into HEAD
HEAD is now at 71d3a95... Merge branch 'R1' into HEAD
[detached HEAD 973f017] dir a/b-2 to symlink
 Author: A U Thor <author@example.com>
 3 files changed, 2 insertions(+)
 create mode 120000 a/b-2
 rename a/{b-2/c/d => b/c/e} (100%)
 create mode 120000 a/b~master
ok 18 - setup a merge where dir a/b-2 changed to symlink

expecting success: 
	git reset --hard &&
	git checkout baseline^0 &&
	git merge -s resolve test2 &&
	test -f a/b/c/d

Cloning into 'sub1'...
Merging:
71d3a95 Merge branch 'R1' into HEAD
virtual R2^0
found 2 common ancestors:
6cf23b5 R1
d6ff089 L1
  Merging:
  6cf23b5 R1
  d6ff089 L1
  found 1 common ancestor:
  a49a3c8 initial
  CONFLICT (rename/rename): Rename one->three in Temporary merge branch 1. Rename two->three in Temporary merge branch 2
CONFLICT (rename/rename): Rename one->three in R2^0. Rename two->three in HEAD
Renaming one to three~R2^0 and two to three~HEAD instead
Automatic merge failed; fix conflicts and then commit the result.
HEAD is now at 973f017 dir a/b-2 to symlink
Previous HEAD position was 973f017... dir a/b-2 to symlink
HEAD is now at 11fbe36... x
done.
error: Merge requires file-level merging
Trying really trivial in-index merge...
Nope.
Previous HEAD position was 3de952f... Add <3: Another new day for git> into <hello>.
Switched to branch 'other'
Trying simple merge.
Simple merge failed, trying Automatic merge.
ok 4 - merge criss-cross + rename merges with basic modification

expecting success: 
	git rm -rf . &&
	git clean -fdqx &&
	rm -rf .git &&
	git init &&

	printf "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n" >a &&
	git add a &&
	test_tick && git commit -m A &&

	git branch B &&
	git checkout -b C &&
	echo 10 >>a &&
	echo "other content" >>new_a &&
	git add a new_a &&
	test_tick && git commit -m C &&

	git checkout B &&
	git mv a new_a &&
	test_tick && git commit -m B &&

	git checkout B^0 &&
	test_must_fail git merge C &&
	git clean -f &&
	test_tick && git commit -m D &&
	git tag D &&

	git checkout C^0 &&
	test_must_fail git merge B &&
	rm new_a~HEAD new_a &&
	printf "Incorrectly merged content" >>new_a &&
	git add -u &&
	test_tick && git commit -m E &&
	git tag E

three: needs merge
rm 'three'
rm 'three'
Adding a/b-2
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
Merge made by the 'resolve' strategy.
 a/b-2                | 1 +
 a/{b-2/c/d => b/c/e} | 0
 a/b~master           | 1 +
 3 files changed, 2 insertions(+)
 create mode 120000 a/b-2
 rename a/{b-2/c/d => b/c/e} (100%)
 create mode 120000 a/b~master
ok 19 - merge should not have D/F conflicts (resolve)

expecting success: 
	test -h a/b-2

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6036-recursive-corner-cases/.git/
ok 20 - a/b-2 was resolved as symlink

expecting success: 
	git reset --hard &&
	git checkout baseline^0 &&
	git merge -s recursive test2 &&
	test -f a/b/c/d

HEAD is now at bb5a047 Merge tag 'test2' into HEAD
[master (root-commit) f139e5c] A
 Author: A U Thor <author@example.com>
 1 file changed, 10 insertions(+)
 create mode 100644 a
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  bb5a047 Merge tag 'test2' into HEAD

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> bb5a047

HEAD is now at 11fbe36... x
Some good revs are not ancestor of the bad rev.
git bisect cannot work properly in this case.
Maybe you mistook good and bad revs?
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
Switched to a new branch 'C'
Deleted branch replace_sub1_with_directory (was 48ceb4d).
Merging:
11fbe36 x
virtual test2
found 1 common ancestor:
a475908 base
Removing a/b-2/c/d
Adding a/b-2
Merge made by the 'recursive' strategy.
 a/b-2                | 1 +
 a/{b-2/c/d => b/c/e} | 0
 a/b~master           | 1 +
 3 files changed, 2 insertions(+)
 create mode 120000 a/b-2
 rename a/{b-2/c/d => b/c/e} (100%)
 create mode 120000 a/b~master
ok 21 - merge should not have D/F conflicts (recursive)

expecting success: 
	test -h a/b-2

ok 22 - a/b-2 was resolved as symlink

expecting success: 
	git reset --hard &&
	git checkout -b foo test2 &&
	git merge -s recursive baseline^0 &&
	test -f a/b/c/d

Switched to a new branch 'replace_sub1_with_directory'
[C cdf0ddb] C
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 new_a
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
HEAD is now at bb5a047 Merge tag 'test2' into HEAD
Switched to branch 'B'
ok 14 - bisect start: no ".git/BISECT_START" if mistaken rev

expecting success: 
	echo "temp stuff" > hello &&
	test_must_fail git bisect start $HASH4 $HASH1 -- &&
	git branch &&
	git branch > branch.output &&
	grep "* other" branch.output > /dev/null &&
	test_must_fail test -e .git/BISECT_START &&
	test -z "$(git for-each-ref "refs/bisect/*")" &&
	git checkout HEAD hello

Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  bb5a047 Merge tag 'test2' into HEAD

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> bb5a047

Switched to a new branch 'foo'
[B c866f72] B
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename a => new_a (100%)
Merging:
973f017 dir a/b-2 to symlink
virtual baseline^0
found 1 common ancestor:
a475908 base
Adding a/b-2
Merge made by the 'recursive' strategy.
Note: checking out 'B^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 c866f72... B
 a/x | 1 +
 1 file changed, 1 insertion(+)
ok 23 - merge should not have F/D conflicts (recursive)

expecting success: 
	test -h a/b-2

ok 24 - a/b-2 was resolved as symlink

Merging:
c866f72 B
virtual C
found 1 common ancestor:
f139e5c A
CONFLICT (rename/add): Rename a->new_a in HEAD. new_a added in C
Adding as new_a~C instead
Auto-merging new_a
Automatic merge failed; fix conflicts and then commit the result.
# still have 1 known breakage(s)
# passed all remaining 23 test(s)
1..24
Removing new_a~C
error: The following untracked working tree files would be overwritten by merge:
	sub1/file1
	sub1/file2
Please move or remove them before you can merge.
Aborting
Updating 041e421..48ceb4d
[detached HEAD 1871ea4] D
 Author: A U Thor <author@example.com>
*** t6037-merge-ours-theirs.sh ***
Previous HEAD position was 1871ea4... D
HEAD is now at cdf0ddb... C
Merging:
cdf0ddb C
virtual B
found 1 common ancestor:
f139e5c A
CONFLICT (rename/add): Rename a->new_a in B. new_a added in HEAD
Adding as new_a~HEAD instead
Skipped new_a (merged same as existing)
Automatic merge failed; fix conflicts and then commit the result.
ok 36 - git_pull_ff_only: 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
		)
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6037-merge-ours-theirs/.git/
expecting success: 
	for i in 1 2 3 4 5 6 7 8 9
	do
		echo "$i"
	done >file &&
	git add file &&
	cp file elif &&
	git commit -m initial &&

	sed -e "s/1/one/" -e "s/9/nine/" >file <elif &&
	git commit -a -m ours &&

	git checkout -b side HEAD^ &&

	sed -e "s/9/nueve/" >file <elif &&
	git commit -a -m theirs &&

	git checkout master^0

[detached HEAD 9e06e45] E
 Author: A U Thor <author@example.com>
ok 5 - setup differently handled merges of rename/add conflict

expecting success: 
	git reset --hard &&
	git checkout D^0 &&

	test_must_fail git merge -s recursive E^0 &&

	test 3 = $(git ls-files -s | wc -l) &&
	test 3 = $(git ls-files -u | wc -l) &&
	test 0 = $(git ls-files -o | wc -l) &&

	test $(git rev-parse :2:new_a) = $(git rev-parse D:new_a) &&
	test $(git rev-parse :3:new_a) = $(git rev-parse E:new_a) &&

	git cat-file -p B:new_a >>merged &&
	git cat-file -p C:new_a >>merge-me &&
	>empty &&
	test_must_fail git merge-file \
		-L "Temporary merge branch 2" \
		-L "" \
		-L "Temporary merge branch 1" \
		merged empty merge-me &&
	test $(git rev-parse :1:new_a) = $(git hash-object merged)

Bisecting: 0 revisions left to test after this (roughly 1 step)
error: Your local changes to the following files would be overwritten by checkout:
	hello
Please, commit your changes or stash them before you can switch branches.
Aborting
[master (root-commit) d2fcca2] initial
 Author: A U Thor <author@example.com>
 1 file changed, 9 insertions(+)
 create mode 100644 file
HEAD is now at 9e06e45 E
Previous HEAD position was 9e06e45... E
HEAD is now at 1871ea4... D
[master 6de31b9] ours
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+), 2 deletions(-)
Cloning into 'submodule_update'...
Switched to a new branch 'side'
Merging:
1871ea4 D
virtual E^0
found 2 common ancestors:
cdf0ddb C
c866f72 B
  Merging:
  cdf0ddb C
  c866f72 B
  found 1 common ancestor:
  f139e5c A
  CONFLICT (rename/add): Rename a->new_a in Temporary merge branch 2. new_a added in Temporary merge branch 1
  Adding merged new_a
Auto-merging new_a
CONFLICT (content): Merge conflict in new_a
Automatic merge failed; fix conflicts and then commit the result.
  master
* other
done.
[side c74819b] theirs
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
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>

ok 15 - bisect start: no ".git/BISECT_START" if checkout error

HEAD is now at 6de31b9... ours
expecting success: 
	test_when_finished git bisect reset &&
	git bisect reset &&
	git bisect start $HASH4 $HASH1 &&
	git bisect skip &&
	git bisect bad > my_bisect_log.txt &&
	grep "$HASH2 is the first bad commit" my_bisect_log.txt

ok 1 - setup

expecting success: 
	git reset --hard master &&
	test_must_fail git merge -s recursive side &&
	grep nine file &&
	grep nueve file &&
	! grep 9 file &&
	grep one file &&
	! grep 1 file

HEAD is now at 6de31b9 ours
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Merging:
6de31b9 ours
virtual side
found 1 common ancestor:
d2fcca2 initial
Auto-merging file
CONFLICT (content): Merge conflict in file
Automatic merge failed; fix conflicts and then commit the result.
We are not bisecting.
nine
nueve
one
ok 2 - plain recursive - should conflict

expecting success: 
	git reset --hard master &&
	git merge -s recursive -Xtheirs side &&
	! grep nine file &&
	grep nueve file &&
	! grep 9 file &&
	grep one file &&
	! grep 1 file

ok 6 - git detects differently handled merges conflict

expecting success: 
	git rm -rf . &&
	git clean -fdqx &&
	rm -rf .git &&
	git init &&

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

	git branch B &&
	git checkout -b C &&
	git rm file &&
	test_tick &&
	git commit -m C &&

	git checkout B &&
	echo B >file &&
	git add file &&
	test_tick &&
	git commit -m B &&

	git checkout B^0 &&
	test_must_fail git merge C &&
	echo B >file &&
	git add file &&
	test_tick &&
	git commit -m D &&
	git tag D &&

	git checkout C^0 &&
	test_must_fail git merge B &&
	git rm file &&
	test_tick &&
	git commit -m E &&
	git tag E

HEAD is now at 6de31b9 ours
new_a: needs merge
rm 'new_a'
rm 'new_a'
rm 'new_a'
Merging:
6de31b9 ours
virtual side
found 1 common ancestor:
d2fcca2 initial
Auto-merging file
Merge made by the 'recursive' strategy.
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
nueve
one
ok 3 - recursive favouring theirs

expecting success: 
	git reset --hard master &&
	git merge -s recursive -X ours side &&
	grep nine file &&
	! grep nueve file &&
	! grep 9 file &&
	grep one file &&
	! grep 1 file

HEAD is now at 6de31b9 ours
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6036-recursive-corner-cases/.git/
Merging:
6de31b9 ours
virtual side
found 1 common ancestor:
d2fcca2 initial
Skipped file (merged same as existing)
Merge made by the 'recursive' strategy.
[master (root-commit) f5d1a38] A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
nine
one
ok 4 - recursive favouring ours

expecting success: 
	echo file binary >.gitattributes &&

	git reset --hard master &&
	git merge -s recursive -X theirs side &&
	git diff --exit-code side HEAD -- file &&

	git reset --hard master &&
	git merge -s recursive -X ours side &&
	git diff --exit-code master HEAD -- file

Switched to a new branch 'C'
HEAD is now at 6de31b9 ours
rm 'file'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
Merging:
6de31b9 ours
virtual side
found 1 common ancestor:
d2fcca2 initial
Auto-merging file
Merge made by the 'recursive' strategy.
[C 57cc6eb] C
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 file
 file | Bin 23 -> 22 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
Bisecting: 0 revisions left to test after this (roughly 1 step)
Switched to branch 'B'
[3de952f2416b6084f557ec417709eac740c6818c] Add <3: Another new day for git> into <hello>.
HEAD is now at 6de31b9 ours
[B 7a418dd] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Merging:
6de31b9 ours
virtual side
found 1 common ancestor:
d2fcca2 initial
Skipped file (merged same as existing)
Merge made by the 'recursive' strategy.
Note: checking out 'B^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 7a418dd... B
Cloning into 'sub1'...
Merging:
7a418dd B
virtual C
found 1 common ancestor:
f5d1a38 A
CONFLICT (modify/delete): file deleted in C and modified in HEAD. Version HEAD of file left in tree.
Automatic merge failed; fix conflicts and then commit the result.
ok 5 - binary file with -Xours/-Xtheirs

expecting success: 
	git reset --hard master && git pull -s recursive -Xours . side &&
	git reset --hard master && git pull -s recursive -X ours . side &&
	git reset --hard master && git pull -s recursive -Xtheirs . side &&
	git reset --hard master && git pull -s recursive -X theirs . side &&
	git reset --hard master && test_must_fail git pull -s recursive -X bork . side

HEAD is now at 6de31b9 ours
[detached HEAD 5801a7b] D
 Author: A U Thor <author@example.com>
done.
Previous HEAD position was 5801a7b... D
HEAD is now at 57cc6eb... C
From .
 * branch            side       -> FETCH_HEAD
Bisecting: 0 revisions left to test after this (roughly 1 step)
Merging:
57cc6eb C
virtual B
found 1 common ancestor:
f5d1a38 A
CONFLICT (modify/delete): file deleted in HEAD and modified in B. Version B of file left in tree.
Automatic merge failed; fix conflicts and then commit the result.
file: needs merge
rm 'file'
Merging:
6de31b9 ours
virtual c74819b4bbc3e44c11ff20facd80e37c6befefe1
found 1 common ancestor:
d2fcca2 initial
Skipped file (merged same as existing)
Merge made by the 'recursive' strategy.
[7b7f204a749c3125d5224ed61ea2ae1187ad046f] Add <2: A new day for git> into <hello>.
[detached HEAD 4f63f96] E
 Author: A U Thor <author@example.com>
HEAD is now at 6de31b9 ours
ok 7 - setup criss-cross + modify/delete resolved differently

expecting success: 
	git checkout D^0 &&

	test_must_fail git merge -s recursive E^0 &&

	test 2 -eq $(git ls-files -s | wc -l) &&
	test 2 -eq $(git ls-files -u | wc -l) &&

	test $(git rev-parse :1:file) = $(git rev-parse master:file) &&
	test $(git rev-parse :2:file) = $(git rev-parse B:file)

Previous HEAD position was 4f63f96... E
HEAD is now at 5801a7b... D
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
From .
 * branch            side       -> FETCH_HEAD
Merging:
5801a7b D
virtual E^0
found 2 common ancestors:
57cc6eb C
7a418dd B
  Merging:
  57cc6eb C
  7a418dd B
  found 1 common ancestor:
  f5d1a38 A
CONFLICT (modify/delete): file deleted in E^0 and modified in HEAD. Version HEAD of file left in tree.
Automatic merge failed; fix conflicts and then commit the result.
Merging:
6de31b9 ours
virtual c74819b4bbc3e44c11ff20facd80e37c6befefe1
found 1 common ancestor:
d2fcca2 initial
Skipped file (merged same as existing)
Merge made by the 'recursive' strategy.
HEAD is now at 6de31b9 ours
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
ok 8 - git detects conflict merging criss-cross+modify/delete

expecting success: 
	git reset --hard &&
	git checkout E^0 &&

	test_must_fail git merge -s recursive D^0 &&

	test 2 -eq $(git ls-files -s | wc -l) &&
	test 2 -eq $(git ls-files -u | wc -l) &&

	test $(git rev-parse :1:file) = $(git rev-parse master:file) &&
	test $(git rev-parse :3:file) = $(git rev-parse B:file)

7b7f204a749c3125d5224ed61ea2ae1187ad046f is the first bad commit
HEAD is now at 5801a7b D
From .
 * branch            side       -> FETCH_HEAD
Previous HEAD position was 5801a7b... D
HEAD is now at 4f63f96... E
Merging:
6de31b9 ours
virtual c74819b4bbc3e44c11ff20facd80e37c6befefe1
found 1 common ancestor:
d2fcca2 initial
Auto-merging file
Merge made by the 'recursive' strategy.
Merging:
4f63f96 E
virtual D^0
found 2 common ancestors:
57cc6eb C
7a418dd B
  Merging:
  57cc6eb C
  7a418dd B
  found 1 common ancestor:
  f5d1a38 A
CONFLICT (modify/delete): file deleted in HEAD and modified in D^0. Version D^0 of file left in tree.
Automatic merge failed; fix conflicts and then commit the result.
 file | Bin 23 -> 22 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
HEAD is now at 6de31b9 ours
Previous HEAD position was 7b7f204... Add <2: A new day for git> into <hello>.
Switched to branch 'other'
Deleted branch replace_sub1_with_directory (was 48ceb4d).
Switched to a new branch 'replace_sub1_with_directory'
ok 9 - git detects conflict merging criss-cross+modify/delete, reverse direction

Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
expecting success: 
	git clean -fdqx &&
	rm -rf .git &&
	git init &&

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

	git branch B &&
	git checkout -b C &&
	echo C >file &&
	git add file &&
	test_tick &&
	git commit -m C &&

	git checkout B &&
	echo B >file &&
	git add file &&
	test_tick &&
	git commit -m B &&

	git checkout B^0 &&
	test_must_fail git merge C &&
	echo D >file &&
	git add file &&
	test_tick &&
	git commit -m D &&
	git tag D &&

	git checkout C^0 &&
	test_must_fail git merge B &&
	cat <<EOF >file &&
<<<<<<< Temporary merge branch 1
C
=======
B
>>>>>>> Temporary merge branch 2
EOF
	git add file &&
	test_tick &&
	git commit -m E &&
	git tag E

From .
 * branch            side       -> FETCH_HEAD
ok 16 - bisect skip: successful result

expecting success: 
	test_when_finished git bisect reset &&
	git bisect start $HASH4 $HASH1 &&
	git bisect skip &&
	test_expect_code 2 git bisect skip >my_bisect_log.txt &&
	grep "first bad commit could be any of" my_bisect_log.txt &&
	! grep $HASH1 my_bisect_log.txt &&
	grep $HASH2 my_bisect_log.txt &&
	grep $HASH3 my_bisect_log.txt &&
	grep $HASH4 my_bisect_log.txt

Merging:
6de31b9 ours
virtual c74819b4bbc3e44c11ff20facd80e37c6befefe1
found 1 common ancestor:
d2fcca2 initial
Auto-merging file
Merge made by the 'recursive' strategy.
 file | Bin 23 -> 22 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6036-recursive-corner-cases/.git/
HEAD is now at 6de31b9 ours
[master (root-commit) 7128a72] A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
error: The following untracked working tree files would be overwritten by merge:
	sub1/file1
	sub1/file2
Please move or remove them before you can merge.
Aborting
Updating 041e421..48ceb4d
From .
 * branch            side       -> FETCH_HEAD
Switched to a new branch 'C'
fatal: Unknown option for merge-recursive: -Xbork
ok 6 - pull passes -X to underlying merge

# passed all 6 test(s)
1..6
[C aebdd1f] C
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to branch 'B'
*** t6038-merge-text-auto.sh ***
[B 9698251] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Note: checking out 'B^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 9698251... B
Merging:
9698251 B
virtual C
found 1 common ancestor:
7128a72 A
Auto-merging file
CONFLICT (content): Merge conflict in file
Automatic merge failed; fix conflicts and then commit the result.
ok 37 - git_pull_ff_only: 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
		)
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6038-merge-text-auto/.git/
expecting success: 
	git config core.autocrlf false &&

	echo first line | append_cr >file &&
	echo first line >control_file &&
	echo only line >inert_file &&

	git add file control_file inert_file &&
	test_tick &&
	git commit -m "Initial" &&
	git tag initial &&
	git branch side &&

	echo "* text=auto" >.gitattributes &&
	touch file &&
	git add .gitattributes file &&
	test_tick &&
	git commit -m "normalize file" &&

	echo same line | append_cr >>file &&
	echo same line >>control_file &&
	git add file control_file &&
	test_tick &&
	git commit -m "add line from a" &&
	git tag a &&

	git rm .gitattributes &&
	rm file &&
	git checkout file &&
	test_tick &&
	git commit -m "remove .gitattributes" &&
	git tag c &&

	git checkout side &&
	echo same line | append_cr >>file &&
	echo same line >>control_file &&
	git add file control_file &&
	test_tick &&
	git commit -m "add line from b" &&
	git tag b &&

	git checkout master

Bisecting: 0 revisions left to test after this (roughly 1 step)
[detached HEAD c159e53] D
 Author: A U Thor <author@example.com>
[3de952f2416b6084f557ec417709eac740c6818c] Add <3: Another new day for git> into <hello>.
Previous HEAD position was c159e53... D
HEAD is now at aebdd1f... C
[master (root-commit) 1c56df1] Initial
 Author: A U Thor <author@example.com>
 3 files changed, 3 insertions(+)
 create mode 100644 control_file
 create mode 100644 file
 create mode 100644 inert_file
Merging:
aebdd1f C
virtual B
found 1 common ancestor:
7128a72 A
Auto-merging file
CONFLICT (content): Merge conflict in file
Automatic merge failed; fix conflicts and then commit the result.
warning: CRLF will be replaced by LF in file.
The file will have its original line endings in your working directory.
Cloning into 'submodule_update'...
[detached HEAD e49a02b] E
 Author: A U Thor <author@example.com>
warning: CRLF will be replaced by LF in file.
The file will have its original line endings in your working directory.
warning: CRLF will be replaced by LF in file.
The file will have its original line endings in your working directory.
[master 2747e77] normalize file
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 .gitattributes
ok 10 - setup differently handled merges of content conflict

checking known breakage: 
	git checkout D^0 &&

	test_must_fail git merge -s recursive E^0 &&

	test 3 -eq $(git ls-files -s | wc -l) &&
	test 3 -eq $(git ls-files -u | wc -l) &&
	test 0 -eq $(git ls-files -o | wc -l) &&

	test $(git rev-parse :2:file) = $(git rev-parse D:file) &&
	test $(git rev-parse :3:file) = $(git rev-parse E:file)

done.
Previous HEAD position was e49a02b... E
HEAD is now at c159e53... D
warning: CRLF will be replaced by LF in file.
The file will have its original line endings in your working directory.
Bisecting: 0 revisions left to test after this (roughly 1 step)
Merging:
c159e53 D
virtual E^0
found 2 common ancestors:
aebdd1f C
9698251 B
  Merging:
  aebdd1f C
  9698251 B
  found 1 common ancestor:
  7128a72 A
  Auto-merging file
  CONFLICT (content): Merge conflict in file
Already up-to-date!
Merge made by the 'recursive' strategy.
warning: CRLF will be replaced by LF in file.
The file will have its original line endings in your working directory.
warning: CRLF will be replaced by LF in file.
The file will have its original line endings in your working directory.
[master 99f8882] add line from a
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
test_must_fail: command succeeded: git merge -s recursive E^0
not ok 11 - git detects conflict w/ criss-cross+contrived resolution # TODO known breakage

expecting success: 
	git rm -rf . &&
	git clean -fdqx &&
	rm -rf .git &&
	git init &&

	>ignore-me &&
	git add ignore-me &&
	test_tick &&
	git commit -m A &&
	git tag A &&

	git branch B &&
	git checkout -b C &&
	mkdir a &&
	echo 10 >a/file &&
	git add a/file &&
	test_tick &&
	git commit -m C &&

	git checkout B &&
	echo 5 >a &&
	git add a &&
	test_tick &&
	git commit -m B &&

	git checkout B^0 &&
	test_must_fail git merge C &&
	git clean -f &&
	rm -rf a/ &&
	echo 5 >a &&
	git add a &&
	test_tick &&
	git commit -m D &&
	git tag D &&

	git checkout C^0 &&
	test_must_fail git merge B &&
	git clean -f &&
	git rm --cached a &&
	echo 10 >a/file &&
	git add a/file &&
	test_tick &&
	git commit -m E1 &&
	git tag E1 &&

	git checkout C^0 &&
	test_must_fail git merge B &&
	git clean -f &&
	git rm --cached a &&
	printf "10\n11\n" >a/file &&
	git add a/file &&
	test_tick &&
	git commit -m E2 &&
	git tag E2

[7b7f204a749c3125d5224ed61ea2ae1187ad046f] Add <2: A new day for git> into <hello>.
Switched to a new branch 'add_sub1'
rm 'file'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
rm '.gitattributes'
[master 2f716ad] remove .gitattributes
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 .gitattributes
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6036-recursive-corner-cases/.git/
Switched to branch 'side'
[master (root-commit) c4cc036] A
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 ignore-me
[side 0d9ffb6] add line from b
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
Switched to a new branch 'C'
Switched to branch 'master'
ok 1 - setup

expecting success: 
	fuzz_conflict() {
		sed $SED_OPTIONS -e "s/^\([<>=]......\) .*/\1/" "$@"
	}

ok 2 - set up fuzz_conflict() helper

expecting success: 
	cat <<-\EOF >expected &&
	first line
	same line
	EOF

	if test_have_prereq NATIVE_CRLF; then
		append_cr <expected >expected.temp &&
		mv expected.temp expected
	fi &&
	git config merge.renormalize true &&
	git rm -fr . &&
	rm -f .gitattributes &&
	git reset --hard a &&
	git merge b &&
	test_cmp expected file

[C 06f6dea] C
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a/file
The first bad commit could be any of:
Switched to branch 'B'
7b7f204a749c3125d5224ed61ea2ae1187ad046f
rm 'control_file'
rm 'file'
rm 'inert_file'
3de952f2416b6084f557ec417709eac740c6818c
32a594a3fdac2d57cf6d02987e30eec68511498c
HEAD is now at 99f8882 add line from a
[B daedbb5] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a
Note: checking out 'B^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>

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
HEAD is now at daedbb5... B
Merging:
99f8882 add line from a
virtual b
found 1 common ancestor:
1c56df1 Initial
Skipped file (merged same as existing)
Merge made by the 'recursive' strategy.
Merging:
daedbb5 B
virtual C
found 1 common ancestor:
c4cc036 A
Adding a/file
Removing a to make room for subdirectory

CONFLICT (file/directory): There is a directory with name a in C. Adding a as a~HEAD
Automatic merge failed; fix conflicts and then commit the result.
ok 3 - Merge after setting text=auto

expecting success: 
	cat <<-\EOF >expected &&
	first line
	same line
	EOF

	if test_have_prereq NATIVE_CRLF; then
		append_cr <expected >expected.temp &&
		mv expected.temp expected
	fi &&
	git config merge.renormalize true &&
	git rm -fr . &&
	rm -f .gitattributes &&
	git reset --hard b &&
	git merge a &&
	test_cmp expected file

Previous HEAD position was 7b7f204... Add <2: A new day for git> into <hello>.
Removing a~HEAD
Switched to branch 'other'
rm '.gitattributes'
rm 'control_file'
rm 'file'
rm 'inert_file'
[detached HEAD cde7987] D
 Author: A U Thor <author@example.com>
HEAD is now at 0d9ffb6 add line from b
Previous HEAD position was cde7987... D
HEAD is now at 06f6dea... C
Merging:
0d9ffb6 add line from b
virtual a
found 1 common ancestor:
1c56df1 Initial
Auto-merging file
Merge made by the 'recursive' strategy.
Cloning into 'sub1'...
ok 17 - bisect skip: cannot tell between 3 commits

expecting success: 
	test_when_finished git bisect reset &&
	git bisect start $HASH4 $HASH1 &&
	git bisect skip &&
	test_expect_code 2 git bisect good >my_bisect_log.txt &&
	grep "first bad commit could be any of" my_bisect_log.txt &&
	! grep $HASH1 my_bisect_log.txt &&
	! grep $HASH2 my_bisect_log.txt &&
	grep $HASH3 my_bisect_log.txt &&
	grep $HASH4 my_bisect_log.txt

Merging:
06f6dea C
virtual B
found 1 common ancestor:
c4cc036 A
Adding a/file
CONFLICT (directory/file): There is a directory with name a in HEAD. Adding a as a~B
Automatic merge failed; fix conflicts and then commit the result.
 .gitattributes | 1 +
 file           | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
 create mode 100644 .gitattributes
ok 4 - Merge addition of text=auto

expecting success: 
	echo "<<<<<<<" >expected &&
	if test_have_prereq NATIVE_CRLF; then
		echo first line | append_cr >>expected &&
		echo same line | append_cr >>expected &&
		echo ======= | append_cr >>expected
	else
		echo first line >>expected &&
		echo same line >>expected &&
		echo ======= >>expected
	fi &&
	echo first line | append_cr >>expected &&
	echo same line | append_cr >>expected &&
	echo ">>>>>>>" >>expected &&
	git config merge.renormalize false &&
	rm -f .gitattributes &&
	git reset --hard a &&
	test_must_fail git merge b &&
	fuzz_conflict file >file.fuzzy &&
	test_cmp expected file.fuzzy

Removing a~B
a: needs merge
rm 'a'
done.
HEAD is now at 99f8882 add line from a
[detached HEAD fc6ddd7] E1
 Author: A U Thor <author@example.com>
Merging:
99f8882 add line from a
virtual b
found 1 common ancestor:
1c56df1 Initial
Auto-merging file
CONFLICT (content): Merge conflict in file
Automatic merge failed; fix conflicts and then commit the result.
ok 5 - Detect CRLF/LF conflict after setting text=auto

expecting success: 
	echo "<<<<<<<" >expected &&
	echo first line | append_cr >>expected &&
	echo same line | append_cr >>expected &&
	if test_have_prereq NATIVE_CRLF; then
		echo ======= | append_cr >>expected &&
		echo first line | append_cr >>expected &&
		echo same line | append_cr >>expected
	else
		echo ======= >>expected &&
		echo first line >>expected &&
		echo same line >>expected
	fi &&
	echo ">>>>>>>" >>expected &&
	git config merge.renormalize false &&
	rm -f .gitattributes &&
	git reset --hard b &&
	test_must_fail git merge a &&
	fuzz_conflict file >file.fuzzy &&
	test_cmp expected file.fuzzy

Previous HEAD position was fc6ddd7... E1
HEAD is now at 06f6dea... C
Merging:
06f6dea C
virtual B
found 1 common ancestor:
c4cc036 A
Adding a/file
CONFLICT (directory/file): There is a directory with name a in HEAD. Adding a as a~B
Automatic merge failed; fix conflicts and then commit the result.
Removing a~B
a: needs merge
rm 'a'
HEAD is now at 0d9ffb6 add line from b
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
[detached HEAD Merging:
0d9ffb6 add line from b
virtual a
found 1 common ancestor:
1c56df1 Initial
Auto-merging file
CONFLICT (content): Merge conflict in file
Automatic merge failed; fix conflicts and then commit the result.
ded70fa] E2
 Author: A U Thor <author@example.com>
ok 12 - setup differently handled merges of directory/file conflict

ok 6 - Detect LF/CRLF conflict from addition of text=auto

expecting success: 
	get_clean_checkout D^0 &&

	test_must_fail git merge -s recursive E1^0 &&

	test 2 -eq $(git ls-files -s | wc -l) &&
	test 1 -eq $(git ls-files -u | wc -l) &&
	test 0 -eq $(git ls-files -o | wc -l) &&

	test $(git rev-parse :0:ignore-me) = $(git rev-parse A:ignore-me) &&
	test $(git rev-parse :2:a) = $(git rev-parse B:a)

checking known breakage: 
	cat <<-\EOF >expected &&
	first line
	same line
	EOF

	git config merge.renormalize true &&
	git rm -fr . &&
	rm -f .gitattributes &&
	git reset --hard initial &&
	git checkout a -- . &&
	git checkout -m b &&
	test_cmp expected file

HEAD is now at ded70fa E2
Bisecting: 0 revisions left to test after this (roughly 1 step)
file: needs merge
rm '.gitattributes'
rm 'control_file'
rm 'file'
rm 'file'
rm 'file'
rm 'inert_file'
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
Previous HEAD position was ded70fa... E2
HEAD is now at cde7987... D
Deleted branch replace_sub1_with_file (was 88f15cf).
[3de952f2416b6084f557ec417709eac740c6818c] Add <3: Another new day for git> into <hello>.
HEAD is now at 1c56df1 Initial
Merging:
cde7987 D
virtual E1^0
found 2 common ancestors:
06f6dea C
daedbb5 B
  Merging:
  06f6dea C
  daedbb5 B
  found 1 common ancestor:
  c4cc036 A
  Adding a/file
  CONFLICT (directory/file): There is a directory with name a in Temporary merge branch 1. Adding a as a~Temporary merge branch 2
CONFLICT (rename/delete): a deleted in E1^0 and renamed in HEAD. Version HEAD of a left in tree.
Automatic merge failed; fix conflicts and then commit the result.
Switched to a new branch 'replace_sub1_with_file'
Note: checking out 'b'.

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 0d9ffb6... add line from b
M	file
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
--- expected	2015-12-16 11:02:30.821564864 +0000
+++ file	2015-12-16 11:02:30.993564864 +0000
@@ -1,2 +1,7 @@
+<<<<<<< b
+first line
+same line
+=======
 first line
 same line
+>>>>>>> local
not ok 7 - checkout -m after setting text=auto # TODO known breakage

checking known breakage: 
	cat <<-\EOF >expected &&
	first line
	same line
	EOF

	git config merge.renormalize true &&
	git rm -fr . &&
	rm -f .gitattributes file &&
	git reset --hard initial &&
	git checkout b -- . &&
	git checkout -m a &&
	test_cmp expected file

file: needs merge
rm 'control_file'
rm 'file'
rm 'file'
rm 'file'
rm 'inert_file'
ok 13 - merge of D & E1 fails but has appropriate contents

expecting success: 
	get_clean_checkout E1^0 &&

	test_must_fail git merge -s recursive D^0 &&

	test 2 -eq $(git ls-files -s | wc -l) &&
	test 1 -eq $(git ls-files -u | wc -l) &&
	test 0 -eq $(git ls-files -o | wc -l) &&

	test $(git rev-parse :0:ignore-me) = $(git rev-parse A:ignore-me) &&
	test $(git rev-parse :3:a) = $(git rev-parse B:a)

HEAD is now at 1c56df1 Initial
HEAD is now at cde7987 D
Previous HEAD position was cde7987... D
HEAD is now at fc6ddd7... E1
Bisecting: 0 revisions left to test after this (roughly 1 step)
Previous HEAD position was 1c56df1... Initial
HEAD is now at 99f8882... add line from a
M	file
Updating 041e421..88f15cf
Fast-forward
--- expected	2015-12-16 11:02:31.021564864 +0000
+++ file	2015-12-16 11:02:31.201564864 +0000
@@ -1,2 +1,7 @@
+<<<<<<< a
 first line
 same line
+=======
+first line
+same line
+>>>>>>> local
not ok 8 - checkout -m addition of text=auto # TODO known breakage

checking known breakage: 
	append_cr <<-\EOF >expected &&
	first line
	same line
	EOF

	git config merge.renormalize true &&
	git rm -fr . &&
	git reset --hard b &&
	test_must_fail git cherry-pick a >err 2>&1 &&
	grep "[Nn]othing added" err &&
	test_cmp expected file

Merging:
fc6ddd7 E1
virtual D^0
found 2 common ancestors:
06f6dea C
daedbb5 B
  Merging:
  06f6dea C
  daedbb5 B
  found 1 common ancestor:
  c4cc036 A
  Adding a/file
  CONFLICT (directory/file): There is a directory with name a in Temporary merge branch 1. Adding a as a~Temporary merge branch 2
Removing a/file
CONFLICT (rename/delete): a deleted in HEAD and renamed in D^0. Version D^0 of a left in tree.
Automatic merge failed; fix conflicts and then commit the result.
 .gitmodules | 4 ----
 sub1        | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
test_must_fail: command succeeded: git_pull_ff_only replace_sub1_with_file
[7b7f204a749c3125d5224ed61ea2ae1187ad046f] Add <2: A new day for git> into <hello>.
file: needs merge
rm '.gitattributes'
rm 'control_file'
rm 'file'
rm 'file'
rm 'file'
rm 'inert_file'
not ok 38 - git_pull_ff_only: 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
		)
	
HEAD is now at 0d9ffb6 add line from b
not ok 9 - cherry-pick patch from after text=auto was added # TODO known breakage

expecting success: 
	git checkout -f side &&
	git rm -fr . &&
	rm -f .gitattributes &&
	git reset --hard initial &&
	git rm file &&
	git commit -m "remove file" &&
	git checkout master &&
	git reset --hard a^ &&
	git merge side

ok 14 - merge of E1 & D fails but has appropriate contents

expecting success: 
	get_clean_checkout D^0 &&

	test_must_fail git merge -s recursive E2^0 &&

	test 4 -eq $(git ls-files -s | wc -l) &&
	test 3 -eq $(git ls-files -u | wc -l) &&
	test 1 -eq $(git ls-files -o | wc -l) &&

	test $(git rev-parse :2:a) = $(git rev-parse B:a) &&
	test $(git rev-parse :3:a/file) = $(git rev-parse E2:a/file) &&
	test $(git rev-parse :1:a/file) = $(git rev-parse C:a/file) &&
	test $(git rev-parse :0:ignore-me) = $(git rev-parse A:ignore-me) &&

	test -f a~HEAD

Switched to branch 'side'
HEAD is now at fc6ddd7 E1
rm 'control_file'
rm 'file'
rm 'inert_file'
HEAD is now at 1c56df1 Initial
Previous HEAD position was fc6ddd7... E1
rm 'file'
HEAD is now at cde7987... D
Cloning into 'submodule_update'...
[side 7dc5d25] remove file
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 file
Merging:
cde7987 D
virtual E2^0
found 2 common ancestors:
06f6dea C
daedbb5 B
  Merging:
  06f6dea C
  daedbb5 B
  found 1 common ancestor:
  c4cc036 A
  Adding a/file
  CONFLICT (directory/file): There is a directory with name a in Temporary merge branch 1. Adding a as a~Temporary merge branch 2
CONFLICT (modify/delete): a/file deleted in HEAD and modified in E2^0. Version E2^0 of a/file left in tree.
Removing a to make room for subdirectory

CONFLICT (rename/delete): a deleted in E2^0 and renamed in HEAD. Version HEAD of a left in tree at a~HEAD.
Automatic merge failed; fix conflicts and then commit the result.
Switched to branch 'master'
done.
HEAD is now at 2747e77 normalize file
The first bad commit could be any of:
3de952f2416b6084f557ec417709eac740c6818c
32a594a3fdac2d57cf6d02987e30eec68511498c
Merging:
2747e77 normalize file
virtual side
found 1 common ancestor:
1c56df1 Initial
Removing file
Merge made by the 'recursive' strategy.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
 file | 1 -
 1 file changed, 1 deletion(-)
 delete mode 100644 file
ok 10 - Test delete/normalize conflict

# still have 3 known breakage(s)
# passed all remaining 7 test(s)
1..10
ok 15 - merge of D & E2 fails but has appropriate contents

*** t6039-merge-ignorecase.sh ***
expecting success: 
	get_clean_checkout E2^0 &&

	test_must_fail git merge -s recursive D^0 &&

	test 4 -eq $(git ls-files -s | wc -l) &&
	test 3 -eq $(git ls-files -u | wc -l) &&
	test 1 -eq $(git ls-files -o | wc -l) &&

	test $(git rev-parse :3:a) = $(git rev-parse B:a) &&
	test $(git rev-parse :2:a/file) = $(git rev-parse E2:a/file) &&
	test $(git rev-parse :1:a/file) = $(git rev-parse C:a/file) &&
	test $(git rev-parse :0:ignore-me) = $(git rev-parse A:ignore-me) &&

	test -f a~D^0

error: 'a/file' appears as both a file and as a directory
error: a/file: cannot drop to stage #0
Previous HEAD position was 7b7f204... Add <2: A new day for git> into <hello>.
Switched to branch 'other'
HEAD is now at cde7987 D
Previous HEAD position was cde7987... D
HEAD is now at ded70fa... E2
Merging:
ded70fa E2
virtual D^0
found 2 common ancestors:
06f6dea C
daedbb5 B
  Merging:
  06f6dea C
  daedbb5 B
  found 1 common ancestor:
  c4cc036 A
  Adding a/file
  CONFLICT (directory/file): There is a directory with name a in Temporary merge branch 1. Adding a as a~Temporary merge branch 2
CONFLICT (modify/delete): a/file deleted in D^0 and modified in HEAD. Version HEAD of a/file left in tree.
CONFLICT (rename/delete): a deleted in HEAD and renamed in D^0. Version D^0 of a left in tree at a~D^0.
Automatic merge failed; fix conflicts and then commit the result.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6039-merge-ignorecase/.git/
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 18 - bisect skip: cannot tell between 2 commits

expecting success: 
	test_when_finished git bisect reset &&
	git bisect start &&
	git bisect skip &&
	git bisect bad &&
	git bisect good $HASH1 &&
	git bisect skip &&
	test_expect_code 2 git bisect good >my_bisect_log.txt &&
	grep "first bad commit could be any of" my_bisect_log.txt &&
	! grep $HASH1 my_bisect_log.txt &&
	! grep $HASH2 my_bisect_log.txt &&
	grep $HASH3 my_bisect_log.txt &&
	grep $HASH4 my_bisect_log.txt

prerequisite CASE_INSENSITIVE_FS not satisfied
1..0 # SKIP skipping case insensitive tests - case sensitive file system
*** t6040-tracking-info.sh ***
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 16 - merge of E2 & D fails but has appropriate contents

expecting success: 
	git reset --hard &&
	git rm -rf . &&
	git clean -fdqx &&
	rm -rf .git &&
	git init &&

	printf "1\n2\n3\n4\n5\n6\n" >a &&
	git add a &&
	git commit -m A &&
	git tag A &&

	git checkout -b B A &&
	git mv a b &&
	echo 7 >>b &&
	git add -u &&
	git commit -m B &&

	git checkout -b C A &&
	git mv a c &&
	git commit -m C &&

	git checkout -q B^0 &&
	git merge --no-commit -s ours C^0 &&
	git mv b newname &&
	git commit -m "Merge commit C^0 into HEAD" &&
	git tag D &&

	git checkout -q C^0 &&
	git merge --no-commit -s ours B^0 &&
	git mv c newname &&
	printf "7\n8\n" >>newname &&
	git add -u &&
	git commit -m "Merge commit B^0 into HEAD" &&
	git tag E

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6040-tracking-info/.git/
error: 'a/file' appears as both a file and as a directory
error: a/file: cannot drop to stage #0
warning: unable to unlink a: Is a directory
expecting success: 
	advance a &&
	advance b &&
	advance c &&
	git clone . test &&
	(
		cd test &&
		git checkout -b b1 origin &&
		git reset --hard HEAD^ &&
		advance d &&
		git checkout -b b2 origin &&
		git reset --hard b1 &&
		git checkout -b b3 origin &&
		git reset --hard HEAD^ &&
		git checkout -b b4 origin &&
		advance e &&
		advance f &&
		git checkout -b brokenbase origin &&
		git checkout -b b5 --track brokenbase &&
		advance g &&
		git branch -d brokenbase &&
		git checkout -b b6 origin
	) &&
	git checkout -b follower --track master &&
	advance h

HEAD is now at ded70fa E2
rm 'a/file'
rm 'ignore-me'
[master (root-commit) cc33353] a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6036-recursive-corner-cases/.git/
Cloning into 'sub1'...
[master 7e1cf2d] b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 b
[master (root-commit) ceb5706] A
 Author: A U Thor <author@example.com>
 1 file changed, 6 insertions(+)
 create mode 100644 a
done.
[master ac11e55] c
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c
Cloning into 'test'...
Switched to a new branch 'B'
done.
[B ab8696c] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 rename a => b (85%)
Switched to a new branch 'b1'
Branch b1 set up to track remote branch master from origin.
Switched to a new branch 'C'
HEAD is now at 7e1cf2d b
[C 8e93417] C
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename a => c (100%)
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
[b1 afc0d66] d
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 d
Switched to a new branch 'b2'
Branch b2 set up to track remote branch master from origin.
Automatic merge went well; stopped before committing as requested
HEAD is now at afc0d66 d
[detached HEAD 3798476] Merge commit C^0 into HEAD
 Author: A U Thor <author@example.com>
Switched to a new branch 'b3'
Branch b3 set up to track remote branch master from origin.
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
HEAD is now at 7e1cf2d b
Switched to a new branch 'b4'
Branch b4 set up to track remote branch master from origin.
Bisecting: 0 revisions left to test after this (roughly 1 step)
Automatic merge went well; stopped before committing as requested
[3de952f2416b6084f557ec417709eac740c6818c] Add <3: Another new day for git> into <hello>.
[b4 ec9b031] e
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 e
Deleted branch replace_sub1_with_file (was 88f15cf).
[detached HEAD dbc4e55] Merge commit B^0 into HEAD
 Author: A U Thor <author@example.com>
[b4 59ecd1d] f
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 f
Switched to a new branch 'replace_sub1_with_file'
ok 17 - setup rename/rename(1to2)/modify followed by what looks like rename/rename(2to1)/modify

expecting success: 
	git checkout D^0 &&

	git merge -s recursive E^0 &&

	test 1 -eq $(git ls-files -s | wc -l) &&
	test 0 -eq $(git ls-files -u | wc -l) &&
	test 0 -eq $(git ls-files -o | wc -l) &&

	test $(git rev-parse HEAD:newname) = $(git rev-parse E:newname)

Switched to a new branch 'brokenbase'
Branch brokenbase set up to track remote branch master from origin.
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
Previous HEAD position was dbc4e55... Merge commit B^0 into HEAD
HEAD is now at 3798476... Merge commit C^0 into HEAD
Switched to a new branch 'b5'
Branch b5 set up to track local branch brokenbase.
Merging:
3798476 Merge commit C^0 into HEAD
virtual E^0
found 2 common ancestors:
8e93417 C
ab8696c B
  Merging:
  8e93417 C
  ab8696c B
  found 1 common ancestor:
  ceb5706 A
  CONFLICT (rename/rename): Rename "a"->"c" in branch "Temporary merge branch 1" rename "a"->"b" in "Temporary merge branch 2" (left unresolved)
Auto-merging newname
Merge made by the 'recursive' strategy.
[b5 d8d0202] g
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 g
 newname | 1 +
 1 file changed, 1 insertion(+)
Deleted branch brokenbase (was ac11e55).
Bisecting: 0 revisions left to test after this (roughly 1 step)
Switched to a new branch 'b6'
Branch b6 set up to track remote branch master from origin.
[7b7f204a749c3125d5224ed61ea2ae1187ad046f] Add <2: A new day for git> into <hello>.
Switched to a new branch 'follower'
Branch follower set up to track local branch master.
ok 18 - handle rename/rename(1to2)/modify followed by what looks like rename/rename(2to1)/modify

expecting success: 
	git rm -rf . &&
	git clean -fdqx &&
	rm -rf .git &&
	git init &&

	printf "lots\nof\nwords\nand\ncontent\n" >a &&
	git add a &&
	git commit -m A &&
	git tag A &&

	git checkout -b B A &&
	git mv a b &&
	git commit -m B &&

	git checkout -b C A &&
	git mv a c &&
	printf "2\n3\n4\n5\n6\n7\n" >a &&
	git add a &&
	git commit -m C &&

	git checkout B^0 &&
	git merge --no-commit -s ours C^0 &&
	git checkout C -- a c &&
	mv a old_a &&
	echo 1 >a &&
	cat old_a >>a &&
	rm old_a &&
	git add -u &&
	git commit -m "Merge commit C^0 into HEAD" &&
	git tag D &&

	git checkout C^0 &&
	git merge --no-commit -s ours B^0 &&
	git checkout B -- b &&
	echo 8 >>a &&
	git add -u &&
	git commit -m "Merge commit B^0 into HEAD" &&
	git tag E

rm 'newname'
Updating 041e421..88f15cf
Fast-forward
 .gitmodules | 4 ----
 sub1        | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
test_must_fail: command succeeded: git_pull_ff_only replace_sub1_with_file
[follower 21abfbd] h
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 h
ok 1 - setup

expecting success: 
	(
		cd test &&
		git branch -v
	) |
	sed -n -e "$script" >actual &&
	test_i18ncmp expect actual

not ok 39 - git_pull_ff_only: 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
		)
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6036-recursive-corner-cases/.git/
ok 2 - branch -v

expecting success: 
	(
		cd test &&
		git branch -vv
	) |
	sed -n -e "$script" >actual &&
	test_i18ncmp expect actual

[master (root-commit) d6963b2] A
 Author: A U Thor <author@example.com>
 1 file changed, 5 insertions(+)
 create mode 100644 a
ok 3 - branch -vv

expecting success: 
	(
		cd test && git checkout b1
	) >actual &&
	test_i18ngrep "have 1 and 1 different" actual

Switched to branch 'b1'
and have 1 and 1 different commit each, respectively.
ok 4 - checkout (diverged from upstream)

expecting success: 
	git checkout master &&
	git checkout follower >actual &&
	test_i18ngrep "is ahead of" actual

Switched to a new branch 'B'
Switched to branch 'master'
Cloning into 'submodule_update'...
[B f216d92] B
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename a => b (100%)
Switched to branch 'follower'
Your branch is ahead of 'master' by 1 commit.
The first bad commit could be any of:
ok 5 - checkout with local tracked branch

expecting success: 
	(
		cd test &&
		git checkout b5
	) >actual &&
	test_i18ngrep "is based on .*, but the upstream is gone." actual

Switched to a new branch 'C'
3de952f2416b6084f557ec417709eac740c6818c
done.
32a594a3fdac2d57cf6d02987e30eec68511498c
Switched to branch 'b5'
Your branch is based on 'brokenbase', but the upstream is gone.
ok 6 - checkout (upstream is gone)

expecting success: 
	(
		cd test && git checkout b6
	) >actual &&
	test_i18ngrep "Your branch is up-to-date with .origin/master" actual

Switched to branch 'b6'
Your branch is up-to-date with 'origin/master'.
ok 7 - checkout (up-to-date with upstream)

expecting success: 
	(
		cd test &&
		git checkout b1 >/dev/null &&
		# reports nothing to commit
		test_must_fail git commit --dry-run
	) >actual &&
	test_i18ngrep "have 1 and 1 different" actual

[C 7ea5636] C
 Author: A U Thor <author@example.com>
 2 files changed, 11 insertions(+), 5 deletions(-)
 create mode 100644 c
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Switched to branch 'b1'
Note: checking out 'B^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 f216d92... B
Previous HEAD position was 7b7f204... Add <2: A new day for git> into <hello>.
Switched to branch 'other'
and have 1 and 1 different commit each, respectively.
ok 8 - status (diverged from upstream)

expecting success: 
	(
		cd test &&
		git checkout b5 >/dev/null &&
		# reports nothing to commit
		test_must_fail git commit --dry-run
	) >actual &&
	test_i18ngrep "is based on .*, but the upstream is gone." actual

Automatic merge went well; stopped before committing as requested
Switched to branch 'b5'
Your branch is based on 'brokenbase', but the upstream is gone.
ok 9 - status (upstream is gone)

expecting success: 
	(
		cd test &&
		git checkout b6 >/dev/null &&
		# reports nothing to commit
		test_must_fail git commit --dry-run
	) >actual &&
	test_i18ngrep "Your branch is up-to-date with .origin/master" actual

Switched to branch 'b6'
[detached HEAD 7ac59d6] Merge commit C^0 into HEAD
 Author: A U Thor <author@example.com>
ok 19 - bisect skip: with commit both bad and skipped

expecting success: echo "#"\!"/bin/sh" > test_script.sh &&
     echo "grep Another hello > /dev/null" >> test_script.sh &&
     echo "test \$? -ne 0" >> test_script.sh &&
     chmod +x test_script.sh &&
     git bisect start &&
     git bisect good $HASH1 &&
     git bisect bad $HASH4 &&
     git bisect run ./test_script.sh > my_bisect_log.txt &&
     grep "$HASH3 is the first bad commit" my_bisect_log.txt &&
     git bisect reset
Your branch is up-to-date with 'origin/master'.
ok 10 - status (up-to-date with upstream)

expecting success: 
	(
		cd test &&
		git checkout b1 >/dev/null &&
		git status -s -b | head -1
	) >actual &&
	test_i18ncmp expect actual

Previous HEAD position was 7ac59d6... Merge commit C^0 into HEAD
HEAD is now at 7ea5636... C
Switched to branch 'b1'
Automatic merge went well; stopped before committing as requested
ok 11 - status -s -b (diverged from upstream)

expecting success: 
	(
		cd test &&
		git checkout b5 >/dev/null &&
		git status -s -b | head -1
	) >actual &&
	test_i18ncmp expect actual

Switched to branch 'b5'
[detached HEAD afd67f8] Merge commit B^0 into HEAD
 Author: A U Thor <author@example.com>
ok 12 - status -s -b (upstream is gone)

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
expecting success: 
	(
		cd test &&
		git checkout b6 >/dev/null &&
		git status -s -b | head -1
	) >actual &&
	test_i18ncmp expect actual

ok 19 - setup criss-cross + rename/rename/add + modify/modify

checking known breakage: 
	git checkout D^0 &&

	git merge -s recursive E^0 &&

	test 3 -eq $(git ls-files -s | wc -l) &&
	test 0 -eq $(git ls-files -u | wc -l) &&
	test 0 -eq $(git ls-files -o | wc -l) &&

	test $(git rev-parse HEAD:b) = $(git rev-parse A:a) &&
	test $(git rev-parse HEAD:c) = $(git rev-parse A:a) &&
	test "$(cat a)" = "$(printf "1\n2\n3\n4\n5\n6\n7\n8\n")"

Switched to branch 'b6'
Previous HEAD position was afd67f8... Merge commit B^0 into HEAD
HEAD is now at 7ac59d6... Merge commit C^0 into HEAD
ok 13 - status -s -b (up-to-date with upstream)

expecting success: 
	git checkout master &&
	git tag light &&
	test_must_fail git branch --track lighttrack light >actual &&
	test_i18ngrep ! "set up to track" actual &&
	test_must_fail git checkout lighttrack

Merging:
7ac59d6 Merge commit C^0 into HEAD
virtual E^0
found 2 common ancestors:
7ea5636 C
f216d92 B
  Merging:
  7ea5636 C
  f216d92 B
  found 1 common ancestor:
  d6963b2 A
  Skipped b (merged same as existing)
Auto-merging a
CONFLICT (add/add): Merge conflict in a
Automatic merge failed; fix conflicts and then commit the result.
Switched to branch 'master'
not ok 20 - detect rename/rename/add-source for virtual merge-base # TODO known breakage

expecting success: 
	git rm -rf . &&
	git clean -fdqx &&
	rm -rf .git &&
	git init &&

	>a &&
	git add a &&
	git commit -m A &&
	git tag A &&

	git checkout -b B A &&
	git mv a b &&
	printf "1\n2\n3\n4\n5\n6\n7\n" >c &&
	git add c &&
	git commit -m B &&

	git checkout -b C A &&
	git mv a c &&
	git commit -m C &&

	git checkout B^0 &&
	git merge --no-commit -s ours C^0 &&
	git mv b a &&
	git commit -m "D is like B but renames b back to a" &&
	git tag D &&

	git checkout B^0 &&
	git merge --no-commit -s ours C^0 &&
	git mv b a &&
	echo 8 >>c &&
	git add c &&
	git commit -m "E like D but has mod in c" &&
	git tag E

a: needs merge
rm 'a'
rm 'a'
rm 'b'
rm 'c'
fatal: Cannot setup tracking information; starting point 'light' is not a branch.
error: pathspec 'lighttrack' did not match any file(s) known to git.
ok 14 - fail to track lightweight tags

expecting success: 
	git checkout master &&
	git tag -m heavy heavy &&
	test_must_fail git branch --track heavytrack heavy >actual &&
	test_i18ngrep ! "set up to track" actual &&
	test_must_fail git checkout heavytrack

Cloning into 'sub1'...
Already on 'master'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6036-recursive-corner-cases/.git/
fatal: Cannot setup tracking information; starting point 'heavy' is not a branch.
done.
error: pathspec 'heavytrack' did not match any file(s) known to git.
ok 15 - fail to track annotated tags

expecting success: 
	git branch from-master master &&
	test_must_fail git config branch.from-master.merge > actual &&
	git branch --set-upstream from-master master &&
	git config branch.from-master.merge > actual &&
	grep -q "^refs/heads/master$" actual

[master (root-commit) 7e05d20] A
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 a
The --set-upstream flag is deprecated and will be removed. Consider using --track or --set-upstream-to
Switched to a new branch 'B'
Branch from-master set up to track local branch master.
ok 16 - setup tracking with branch --set-upstream on existing branch

expecting success: 
	git branch from-master2 master &&
	test_must_fail git config branch.from-master2.merge > actual &&
	git rev-list from-master2 &&
	git update-ref refs/heads/from-master2 from-master2^ &&
	git rev-parse from-master2 >expect2 &&
	git branch --set-upstream from-master2 master &&
	git config branch.from-master.merge > actual &&
	git rev-parse from-master2 >actual2 &&
	grep -q "^refs/heads/master$" actual &&
	cmp expect2 actual2

[B 29c39e6] B
 Author: A U Thor <author@example.com>
 2 files changed, 7 insertions(+)
 rename a => b (100%)
 create mode 100644 c
ac11e552c8e799a6af00e91a64888439b699d9fd
7e1cf2dc889e845623128125195d11533d8aef5e
cc33353f1c71fb0fa9b4671a6a0a8539ad9ecd0a
Bisecting: 0 revisions left to test after this (roughly 1 step)
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
Switched to a new branch 'C'
[3de952f2416b6084f557ec417709eac740c6818c] Add <3: Another new day for git> into <hello>.
The --set-upstream flag is deprecated and will be removed. Consider using --track or --set-upstream-to
Branch from-master2 set up to track local branch master.
[C 29df2a0] C
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename a => c (100%)
Note: checking out 'B^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 29c39e6... B
ok 17 - --set-upstream does not change branch

expecting success: 
	git checkout from-master &&
	git checkout from-master2 &&
	git config branch.from-master2.merge > expect2 &&
	git branch --set-upstream @{-1} follower &&
	git config branch.from-master.merge > actual &&
	git config branch.from-master2.merge > actual2 &&
	git branch --set-upstream from-master follower &&
	git config branch.from-master.merge > expect &&
	test_cmp expect2 actual2 &&
	test_cmp expect actual

Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
Switched to branch 'from-master'
Your branch is up-to-date with 'master'.
Automatic merge went well; stopped before committing as requested
Deleted branch modify_sub1 (was 85dfe6e).
Switched to branch 'from-master2'
Your branch is behind 'master' by 1 commit, and can be fast-forwarded.
  (use "git pull" to update your local branch)
Switched to a new branch 'modify_sub1'
The --set-upstream flag is deprecated and will be removed. Consider using --track or --set-upstream-to
[detached HEAD 974fc73] D is like B but renames b back to a
 Author: A U Thor <author@example.com>
Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
Branch from-master set up to track local branch follower.
Previous HEAD position was 974fc73... D is like B but renames b back to a
HEAD is now at 29c39e6... B
The --set-upstream flag is deprecated and will be removed. Consider using --track or --set-upstream-to
Branch from-master set up to track local branch follower.
Automatic merge went well; stopped before committing as requested
ok 18 - --set-upstream @{-1}

# passed all 18 test(s)
1..18
Updating 041e421..85dfe6e
Fast-forward
[detached HEAD 54537e4] E like D but has mod in c
 Author: A U Thor <author@example.com>
ok 21 - setup criss-cross+rename/rename/add-dest + simple modify

expecting success: 
	git checkout D^0 &&

	git merge -s recursive E^0 &&

	test 2 -eq $(git ls-files -s | wc -l) &&
	test 0 -eq $(git ls-files -u | wc -l) &&
	test 0 -eq $(git ls-files -o | wc -l) &&

	test $(git rev-parse HEAD:a) = $(git rev-parse A:a) &&
	test $(git rev-parse HEAD:c) = $(git rev-parse E:c)

Previous HEAD position was 54537e4... E like D but has mod in c
*** t6041-bisect-submodule.sh ***
HEAD is now at 974fc73... D is like B but renames b back to a
Merging:
974fc73 D is like B but renames b back to a
virtual E^0
found 2 common ancestors:
29df2a0 C
29c39e6 B
  Merging:
  29df2a0 C
  29c39e6 B
  found 1 common ancestor:
  7e05d20 A
  Auto-merging c
Merge made by the 'recursive' strategy.
 c | 1 +
 1 file changed, 1 insertion(+)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6041-bisect-submodule/.git/
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
		)
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6041-bisect-submodule/submodule_update_repo/.git/
3de952f2416b6084f557ec417709eac740c6818c is the first bad commit
ok 22 - virtual merge base handles rename/rename(1to2)/add-dest

# still have 2 known breakage(s)
# passed all remaining 20 test(s)
1..22
[master (root-commit) 7e9f791] 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
*** t6042-merge-rename-corner-cases.sh ***
Switched to a new branch 'add_sub1'
Previous HEAD position was 7b7f204... Add <2: A new day for git> into <hello>.
Switched to branch 'other'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6042-merge-rename-corner-cases/.git/
ok 20 - "git bisect run" simple case

expecting success: echo "#"\!"/bin/sh" > test_script.sh &&
     echo "grep Ciao hello > /dev/null" >> test_script.sh &&
     echo "test \$? -ne 0" >> test_script.sh &&
     chmod +x test_script.sh &&
     git bisect start $HASH4 $HASH1 &&
     git bisect run ./test_script.sh > my_bisect_log.txt &&
     grep "$HASH4 is the first bad commit" my_bisect_log.txt &&
     git bisect reset
expecting success: 
	echo "A pretty inscription" >ring &&
	git add ring &&
	test_tick &&
	git commit -m beginning &&

	git branch people &&
	git checkout -b rename-the-ring &&
	git mv ring one-ring-to-rule-them-all &&
	test_tick &&
	git commit -m fullname &&

	git checkout people &&
	git rm ring &&
	echo gollum >owner &&
	git add owner &&
	test_tick &&
	git commit -m track-people-instead-of-objects &&
	echo "Myyy PRECIOUSSS" >ring

Submodule path 'sub1': checked out 'eedcaeb9ebca3d956845c627772d7a68b8eec63e'
[master (root-commit) f8aae21] beginning
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 ring
Switched to a new branch 'rename-the-ring'
Cloning into 'sub1'...
ok 40 - git_pull_ff_only: 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
		)
	
[rename-the-ring a71a7c5] fullname
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename ring => one-ring-to-rule-them-all (100%)
done.
Switched to branch 'people'
rm 'ring'
[people e4672ee] track-people-instead-of-objects
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 1 deletion(-)
 create mode 100644 owner
 delete mode 100644 ring
ok 1 - setup rename/delete + untracked file

expecting success: 
	test_must_fail git merge -s recursive rename-the-ring &&

	# Make sure git did not delete an untracked file
	test -f ring

Cloning into 'submodule_update'...
Merging:
e4672ee track-people-instead-of-objects
virtual rename-the-ring
found 1 common ancestor:
f8aae21 beginning
CONFLICT (rename/delete): one-ring-to-rule-them-all deleted in HEAD and renamed in rename-the-ring. Version rename-the-ring of one-ring-to-rule-them-all left in tree.
Automatic merge failed; fix conflicts and then commit the result.
ok 2 - Does git preserve Gollum's precious artifact?

expecting success: 
	git rm -rf . &&
	git clean -fdqx &&
	rm -rf .git &&
	git init &&

	printf "1\n2\n3\n4\n5\n6\n7\n" >a &&
	git add a &&
	git commit -m A &&
	git tag A &&

	git checkout -b B A &&
	echo 8 >>a &&
	git add a &&
	git commit -m B &&

	git checkout -b C A &&
	git mv a b &&
	echo something completely different >a &&
	git add a &&
	git commit -m C

one-ring-to-rule-them-all: needs merge
rm 'one-ring-to-rule-them-all'
rm 'owner'
done.
Bisecting: 0 revisions left to test after this (roughly 1 step)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6042-merge-rename-corner-cases/.git/
[3de952f2416b6084f557ec417709eac740c6818c] Add <3: Another new day for git> into <hello>.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
[master (root-commit) ed708dc] A
 Author: A U Thor <author@example.com>
 1 file changed, 7 insertions(+)
 create mode 100644 a
[add_sub1 5369cc1] 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'
Switched to a new branch 'B'
Removing sub1
Removing .gitmodules
[remove_sub1 9106dfb] Revert "Add sub1"
 Author: A U Thor <author@example.com>
 2 files changed, 5 deletions(-)
 delete mode 100644 .gitmodules
 delete mode 160000 sub1
[B e168810] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Switched to a new branch 'C'
Switched to a new branch 'modify_sub1'
[C c68872a] C
 Author: A U Thor <author@example.com>
 2 files changed, 8 insertions(+), 7 deletions(-)
 create mode 100644 b
ok 3 - setup rename/modify/add-source conflict

checking known breakage: 
	git checkout B^0 &&

	git merge -s recursive C^0 &&

	test $(git rev-parse B:a) = $(git rev-parse b) &&
	test $(git rev-parse C:a) = $(git rev-parse a)

Note: checking out 'B^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 e168810... B
Merging:
e168810 B
virtual C^0
found 1 common ancestor:
ed708dc A
Auto-merging a
CONFLICT (content): Merge conflict in a
Automatic merge failed; fix conflicts and then commit the result.
not ok 4 - rename/modify/add-source conflict resolvable # TODO known breakage

expecting success: 
	git rm -rf . &&
	git clean -fdqx &&
	rm -rf .git &&
	git init &&

	printf "1\n2\n3\n4\n5\n" >a &&
	echo foo >b &&
	git add a b &&
	git commit -m A &&
	git tag A &&

	git checkout -b B A &&
	git mv a c &&
	echo "Completely different content" >a &&
	git add a &&
	git commit -m B &&

	git checkout -b C A &&
	echo 6 >>a &&
	git add a &&
	git commit -m C

32a594a3fdac2d57cf6d02987e30eec68511498c is the first bad commit
a: needs merge
rm 'a'
rm 'a'
rm 'a'
rm 'b'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6042-merge-rename-corner-cases/.git/
Previous HEAD position was 3de952f... Add <3: Another new day for git> into <hello>.
Switched to branch 'other'
[master (root-commit) 6e307ea] A
 Author: A U Thor <author@example.com>
 2 files changed, 6 insertions(+)
 create mode 100644 a
 create mode 100644 b
Switched to a new branch 'B'
Cloning into 'sub1'...
ok 21 - "git bisect run" with more complex "git bisect start"

expecting success: 
	add_line_into_file "5: Another new line." hello &&
	HASH5=$(git rev-parse --verify HEAD) &&
	git bisect start $HASH5 $HASH1 &&
	git bisect skip &&
	git bisect good > my_bisect_log.txt &&
	grep "$HASH5 is the first bad commit" my_bisect_log.txt &&
	git bisect log > log_to_replay.txt &&
	git bisect reset

[B d5544bc] B
 Author: A U Thor <author@example.com>
 2 files changed, 6 insertions(+), 5 deletions(-)
 create mode 100644 c
From /«PKGBUILDDIR»/t/trash directory.t6041-bisect-submodule/submodule_update_repo/.
   7e9f791..5369cc1  add_sub1   -> origin/add_sub1
 * [new branch]      modify_sub1 -> origin/modify_sub1
 * [new branch]      remove_sub1 -> origin/remove_sub1
done.
Switched to a new branch 'C'
Switched to a new branch 'modifications'
[C 7973767] C
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 5 - setup resolvable conflict missed if rename missed

checking known breakage: 
	git checkout -q C^0 &&
	git merge -s recursive B^0 &&

	test 3 -eq $(git ls-files -s | wc -l) &&
	test 0 -eq $(git ls-files -u | wc -l) &&
	test 0 -eq $(git ls-files -o | wc -l) &&

	test_line_count = 6 c &&
	test $(git rev-parse HEAD:a) = $(git rev-parse B:a) &&
	test $(git rev-parse HEAD:b) = $(git rev-parse A:b)

[modifications 19c057f] modified file2 and added file3
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 file3
Merging:
7973767 C
virtual B^0
found 1 common ancestor:
6e307ea A
Auto-merging a
CONFLICT (content): Merge conflict in a
Automatic merge failed; fix conflicts and then commit the result.
not ok 6 - conflict caused if rename not detected # TODO known breakage

expecting success: 
	git reset --hard &&
	git clean -f &&

	git checkout -b D A &&
	echo 7 >>a &&
	git add a &&
	git mv a c &&
	echo "Completely different content" >a &&
	git add a &&
	git commit -m D &&

	git checkout -b E A &&
	git rm a &&
	echo "Completely different content" >>a &&
	git add a &&
	git commit -m E

HEAD is now at 7973767 C
Previous HEAD position was 7973767... C
Switched to a new branch 'D'
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
To /«PKGBUILDDIR»/t/trash directory.t6041-bisect-submodule/submodule_update_repo/.
 * [new branch]      modifications -> modifications
[D ac5e74b] D
 Author: A U Thor <author@example.com>
 2 files changed, 7 insertions(+), 5 deletions(-)
 create mode 100644 c
Switched to a new branch 'E'
[modify_sub1 49ae895] Modify sub1
 Author: A U Thor <author@example.com>
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
rm 'a'
Deleted branch invalid_sub1 (was e730a90).
Switched to a new branch 'replace_sub1_with_directory'
Bisecting: 1 revision left to test after this (roughly 1 step)
Switched to a new branch 'invalid_sub1'
[E c9b5065] E
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 5 deletions(-)
ok 7 - setup conflict resolved wrong if rename missed

checking known breakage: 
	git checkout -q E^0 &&
	test_must_fail git merge -s recursive D^0

[3de952f2416b6084f557ec417709eac740c6818c] Add <3: Another new day for git> into <hello>.
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
Merging:
c9b5065 E
virtual D^0
found 1 common ancestor:
6e307ea A
Merge made by the 'recursive' strategy.
 c | 6 ++++++
 1 file changed, 6 insertions(+)
 create mode 100644 c
test_must_fail: command succeeded: git merge -s recursive D^0
not ok 8 - missed conflict if rename not detected # TODO known breakage

expecting success: 
	git rm -rf . &&
	git clean -fdqx &&
	rm -rf .git &&
	git init &&

	printf "1\n2\n3\n4\n5\n" >a &&
	git add a &&
	git commit -m A &&
	git tag A &&

	git checkout -b B A &&
	git mv a b &&
	git commit -m B &&

	git checkout -b C A &&
	git mv a b &&
	echo foobar >a &&
	git add a &&
	git commit -m C

rm 'a'
rm 'b'
rm 'c'
Updating 041e421..e730a90
Fast-forward
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6042-merge-rename-corner-cases/.git/
Bisecting: 1 revision left to test after this (roughly 1 step)
[master (root-commit) 7dae8c5] A
 Author: A U Thor <author@example.com>
 1 file changed, 5 insertions(+)
 create mode 100644 a
[32a594a3fdac2d57cf6d02987e30eec68511498c] Add <4: Ciao for now> into <hello>.
Switched to a new branch 'B'
Submodule path 'sub1': checked out '7e9f79116e21ad6a3ac18868cba45094b8cda241'
[B b89ebbc] B
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename a => b (100%)
Switched to a new branch 'C'
Previous HEAD position was 7e9f791... Base
Switched to branch 'modifications'
rm 'sub1'
[C e91e697] C
 Author: A U Thor <author@example.com>
 2 files changed, 6 insertions(+), 5 deletions(-)
 create mode 100644 b
ok 9 - setup undetected rename/add-source causes data loss

checking known breakage: 
	git checkout B^0 &&

	git merge -s recursive C^0 &&

	test 2 -eq $(git ls-files -s | wc -l) &&
	test 2 -eq $(git ls-files -u | wc -l) &&
	test 0 -eq $(git ls-files -o | wc -l) &&

	test -f a &&
	test -f b &&

	test $(git rev-parse HEAD:b) = $(git rev-parse A:a) &&
	test $(git rev-parse HEAD:a) = $(git rev-parse C:a)

Note: checking out 'B^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 b89ebbc... B
[replace_sub1_with_directory f9834e9] 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
Merging:
b89ebbc B
virtual C^0
found 1 common ancestor:
7dae8c5 A
Merge made by the 'recursive' strategy.
Switched to a new branch 'replace_directory_with_sub1'
not ok 10 - detect rename/add-source and preserve all data # TODO known breakage

checking known breakage: 
	git checkout C^0 &&

	git merge -s recursive B^0 &&

	test 2 -eq $(git ls-files -s | wc -l) &&
	test 2 -eq $(git ls-files -u | wc -l) &&
	test 0 -eq $(git ls-files -o | wc -l) &&

	test -f a &&
	test -f b &&

	test $(git rev-parse HEAD:b) = $(git rev-parse A:a) &&
	test $(git rev-parse HEAD:a) = $(git rev-parse C:a)

3082e11d3a0f2edca194c8ce1eb802256e38e75e is the first bad commit
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  d512eee Merge commit 'C^0' into HEAD

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> d512eee

HEAD is now at e91e697... C
Removing sub1/file3
Removing sub1/file2
Removing sub1/file1
Adding sub1
Merging:
e91e697 C
virtual B^0
found 1 common ancestor:
7dae8c5 A
Merge made by the 'recursive' strategy.
[replace_directory_with_sub1 25cca3d] 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
 a | 1 -
 1 file changed, 1 deletion(-)
 delete mode 100644 a
not ok 11 - detect rename/add-source and preserve all data, merge other way # TODO known breakage

expecting success: 
	git rm -rf . &&
	git clean -fdqx &&
	rm -rf .git &&
	git init &&

	printf "1\n2\n3\n4\n5\n6\n" >file &&
	git add file &&
	test_tick &&
	git commit -m base &&
	git tag base &&

	git checkout -b right &&
	echo 7 >>file &&
	mkdir newfile &&
	echo junk >newfile/realfile &&
	git add file newfile/realfile &&
	test_tick &&
	git commit -m right &&

	git checkout -b left-conflict base &&
	echo 8 >>file &&
	git add file &&
	git mv file newfile &&
	test_tick &&
	git commit -m left &&

	git checkout -b left-clean base &&
	echo 0 >newfile &&
	cat file >>newfile &&
	git add newfile &&
	git rm file &&
	test_tick &&
	git commit -m left

Switched to a new branch 'replace_sub1_with_file'
rm 'b'
rm 'sub1'
[replace_sub1_with_file b876fd1] Replace sub1 with file
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6042-merge-rename-corner-cases/.git/
Switched to a new branch 'replace_file_with_sub1'
Previous HEAD position was 32a594a... Add <4: Ciao for now> into <hello>.
Switched to branch 'other'
[master (root-commit) 5485bbc] base
 Author: A U Thor <author@example.com>
 1 file changed, 6 insertions(+)
 create mode 100644 file
fatal: reference is not a tree: 0123456789012345678901234567890123456789
Unable to checkout '0123456789012345678901234567890123456789' in submodule path 'sub1'
[replace_file_with_sub1 912b3c6] Revert "Replace sub1 with file"
 Author: A U Thor <author@example.com>
 2 files changed, 5 insertions(+), 1 deletion(-)
 mode change 100644 => 160000 sub1
Switched to a new branch 'right'
Switched to a new branch 'invalid_sub1'
ok 22 - bisect skip: add line and then a new test

expecting success: 
	git bisect replay log_to_replay.txt > my_bisect_log.txt &&
	grep "$HASH5 is the first bad commit" my_bisect_log.txt &&
	git bisect reset

[right ece62ea] right
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 newfile/realfile
[invalid_sub1 5c79e6e] Invalid sub1 commit
 Author: A U Thor <author@example.com>
ok 41 - git_pull_ff_only: 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
		)
	
Switched to a new branch 'left-conflict'
Switched to a new branch 'valid_sub1'
[valid_sub1 634f727] Revert "Invalid sub1 commit"
 Author: A U Thor <author@example.com>
[left-conflict 1020e18] left
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 rename file => newfile (85%)
Switched to branch 'master'
Switched to a new branch 'left-clean'
Cloning into 'submodule_update'...
rm 'file'
Cloning into 'submodule_update'...
[left-clean d8c7b5f] left
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 rename file => newfile (85%)
ok 12 - setup content merge + rename/directory conflict

expecting success: 
	git reset --hard &&
	git reset --hard &&
	git clean -fdqx &&

	git checkout left-clean^0 &&

	test_must_fail git merge -s recursive right^0 &&

	test 2 -eq $(git ls-files -s | wc -l) &&
	test 1 -eq $(git ls-files -u | wc -l) &&
	test 1 -eq $(git ls-files -o | wc -l) &&

	echo 0 >expect &&
	git cat-file -p base:file >>expect &&
	echo 7 >>expect &&
	test_cmp expect newfile~HEAD &&

	test $(git rev-parse :2:newfile) = $(git hash-object expect) &&

	test -f newfile/realfile &&
	test -f newfile~HEAD

done.
HEAD is now at d8c7b5f left
done.
HEAD is now at d8c7b5f left
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Note: checking out 'left-clean^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 d8c7b5f... left
Switched to a new branch 'invalid_sub1'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Merging:
d8c7b5f left
virtual right^0
found 1 common ancestor:
5485bbc base
Adding newfile/realfile
Removing newfile to make room for subdirectory

Auto-merging newfile
Adding as newfile~HEAD instead
Automatic merge failed; fix conflicts and then commit the result.
fatal: Needed a single revision
Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
Switched to branch 'add_sub1'
Your branch is up-to-date with 'origin/add_sub1'.
Deleted branch valid_sub1 (was 1ca87d6).
ok 13 - rename/directory conflict + clean content merge

expecting success: 
	git reset --hard &&
	git reset --hard &&
	git clean -fdqx &&

	git checkout left-conflict^0 &&

	test_must_fail git merge -s recursive right^0 &&

	test 4 -eq $(git ls-files -s | wc -l) &&
	test 3 -eq $(git ls-files -u | wc -l) &&
	test 1 -eq $(git ls-files -o | wc -l) &&

	git cat-file -p left-conflict:newfile >left &&
	git cat-file -p base:file    >base &&
	git cat-file -p right:file   >right &&
	test_must_fail git merge-file \
		-L "HEAD:newfile" \
		-L "" \
		-L "right^0:file" \
		left base right &&
	test_cmp left newfile~HEAD &&

	test $(git rev-parse :1:newfile) = $(git rev-parse base:file) &&
	test $(git rev-parse :2:newfile) = $(git rev-parse left-conflict:newfile) &&
	test $(git rev-parse :3:newfile) = $(git rev-parse right:file) &&

	test -f newfile/realfile &&
	test -f newfile~HEAD

Switched to a new branch 'valid_sub1'
error: 'newfile' appears as both a file and as a directory
error: newfile: cannot drop to stage #0
HEAD is now at d8c7b5f left
[add_sub1 bf23754] bisect bad
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bar
Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
HEAD is now at d8c7b5f left
3082e11d3a0f2edca194c8ce1eb802256e38e75e is the first bad commit
HEAD is now at 7e9f791 Base
Previous HEAD position was d8c7b5f... left
HEAD is now at 1020e18... left
Merging:
1020e18 left
virtual right^0
found 1 common ancestor:
5485bbc base
Adding newfile/realfile
Removing newfile to make room for subdirectory

Auto-merging newfile
CONFLICT (content): Merge conflict in newfile
Adding as newfile~HEAD instead
Automatic merge failed; fix conflicts and then commit the result.
Previous HEAD position was 3de952f... Add <3: Another new day for git> into <hello>.
Switched to branch 'other'
Updating e730a90..1ca87d6
Fast-forward
ok 23 - bisect skip and bisect replay

expecting success: 
	add_line_into_file "6: Yet a line." hello &&
	HASH6=$(git rev-parse --verify HEAD) &&
	echo "#"\!"/bin/sh" > test_script.sh &&
	echo "sed -ne \\\$p hello | grep Ciao > /dev/null && exit 125" >> test_script.sh &&
	echo "grep line hello > /dev/null" >> test_script.sh &&
	echo "test \$? -ne 0" >> test_script.sh &&
	chmod +x test_script.sh &&
	git bisect start $HASH6 $HASH1 &&
	if git bisect run ./test_script.sh > my_bisect_log.txt
	then
		echo Oops, should have failed.
		false
	else
		test $? -eq 2 &&
		grep "first bad commit could be any of" my_bisect_log.txt &&
		! grep $HASH3 my_bisect_log.txt &&
		! grep $HASH6 my_bisect_log.txt &&
		grep $HASH4 my_bisect_log.txt &&
		grep $HASH5 my_bisect_log.txt
	fi

ok 14 - rename/directory conflict + content merge conflict

expecting success: 
	git reset --hard &&
	git rm -rf . &&
	git clean -fdqx &&
	rm -rf .git &&
	git init &&

	mkdir sub &&
	printf "1\n2\n3\n4\n5\n6\n" >sub/file &&
	git add sub/file &&
	test_tick &&
	git commit -m base &&
	git tag base &&

	git checkout -b right &&
	echo 7 >>sub/file &&
	git add sub/file &&
	test_tick &&
	git commit -m right &&

	git checkout -b left base &&
	echo 0 >newfile &&
	cat sub/file >>newfile &&
	git rm sub/file &&
	mv newfile sub &&
	git add sub &&
	test_tick &&
	git commit -m left

error: 'newfile' appears as both a file and as a directory
error: newfile: cannot drop to stage #0
HEAD is now at 1020e18 left
rm 'newfile'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6042-merge-rename-corner-cases/.git/
[master (root-commit) 1a7e495] base
 Author: A U Thor <author@example.com>
 1 file changed, 6 insertions(+)
 create mode 100644 sub/file
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
Switched to a new branch 'right'
[right 26a9c87] right
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Switched to a new branch 'left'
rm 'sub/file'
Bisecting: 2 revisions left to test after this (roughly 1 step)
Cloning into 'sub1'...
[3de952f2416b6084f557ec417709eac740c6818c] Add <3: Another new day for git> into <hello>.
[left 560e470] left
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 rename sub/file => sub (85%)
ok 15 - setup content merge + rename/directory conflict w/ disappearing dir

expecting success: 
	git reset --hard &&
	git clean -fdqx &&

	git checkout left^0 &&

	git merge -s recursive right^0 &&

	test 1 -eq $(git ls-files -s | wc -l) &&
	test 0 -eq $(git ls-files -u | wc -l) &&
	test 0 -eq $(git ls-files -o | wc -l) &&

	echo 0 >expect &&
	git cat-file -p base:sub/file >>expect &&
	echo 7 >>expect &&
	test_cmp expect sub &&

	test -f sub

done.
HEAD is now at 560e470 left
Note: checking out 'left^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 560e470... left
Merging:
560e470 left
virtual right^0
found 1 common ancestor:
1a7e495 base
Auto-merging sub
Merge made by the 'recursive' strategy.
 sub | 1 +
 1 file changed, 1 insertion(+)
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[5369cc164bf5eb593f5888cf0a61aa2342b4e7c0] Add sub1
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
ok 16 - disappearing dir in rename/directory conflict handled

expecting success: 
	git rm -rf . &&
	git clean -fdqx &&
	rm -rf .git &&
	git init &&

	printf "1\n2\n3\n4\n5\n" >a &&
	printf "5\n4\n3\n2\n1\n" >b &&
	git add a b &&
	git commit -m A &&
	git tag A &&

	git checkout -b B A &&
	git mv a c &&
	echo 0 >>b &&
	git add b &&
	git commit -m B &&

	git checkout -b C A &&
	git mv b c &&
	echo 6 >>a &&
	git add a &&
	git commit -m C

rm 'sub'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6042-merge-rename-corner-cases/.git/
[master (root-commit) 591fea0] A
 Author: A U Thor <author@example.com>
 2 files changed, 10 insertions(+)
 create mode 100644 a
 create mode 100644 b
ok 42 - git_pull_ff_only: 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
		)
	
Switched to a new branch 'B'
[B 57089d3] B
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
 rename a => c (100%)
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t6041-bisect-submodule/submodule_update_repo/.) registered for path 'sub1'
Switched to a new branch 'C'
Cloning into 'submodule_update'...
[C e26c8cf] C
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
 rename b => c (100%)
ok 17 - setup rename/rename (2to1) + modify/modify

expecting success: 
	git checkout B^0 &&

	test_must_fail git merge -s recursive C^0 >out &&
	test_i18ngrep "CONFLICT (rename/rename)" out &&

	test 2 -eq $(git ls-files -s | wc -l) &&
	test 2 -eq $(git ls-files -u | wc -l) &&
	test 2 -eq $(git ls-files -u c | wc -l) &&
	test 3 -eq $(git ls-files -o | wc -l) &&

	test ! -f a &&
	test ! -f b &&
	test -f c~HEAD &&
	test -f c~C^0 &&

	test $(git hash-object c~HEAD) = $(git rev-parse C:a) &&
	test $(git hash-object c~C^0) = $(git rev-parse B:b)

done.
Note: checking out 'B^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 57089d3... B
Cloning into 'sub1'...
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
CONFLICT (rename/rename): Rename a->c in HEAD. Rename b->c in C^0
done.
Branch add_sub1 set up to track remote branch add_sub1 from origin.
bisect run cannot continue any more
The first bad commit could be any of:
Deleted branch add_sub1 (was 041e421).
[32a594a3fdac2d57cf6d02987e30eec68511498c] Add <4: Ciao for now> into <hello>.
32a594a3fdac2d57cf6d02987e30eec68511498c
[3082e11d3a0f2edca194c8ce1eb802256e38e75e] Add <5: Another new line.> into <hello>.
3082e11d3a0f2edca194c8ce1eb802256e38e75e
ok 24 - bisect run & skip: cannot tell between 2

expecting success: 
	git bisect reset &&
	add_line_into_file "7: Should be the last line." hello &&
	HASH7=$(git rev-parse --verify HEAD) &&
	echo "#"\!"/bin/sh" > test_script.sh &&
	echo "sed -ne \\\$p hello | grep Ciao > /dev/null && exit 125" >> test_script.sh &&
	echo "sed -ne \\\$p hello | grep day > /dev/null && exit 125" >> test_script.sh &&
	echo "grep Yet hello > /dev/null" >> test_script.sh &&
	echo "test \$? -ne 0" >> test_script.sh &&
	chmod +x test_script.sh &&
	git bisect start $HASH7 $HASH1 &&
	git bisect run ./test_script.sh > my_bisect_log.txt &&
	grep "$HASH6 is the first bad commit" my_bisect_log.txt

Switched to a new branch 'add_sub1'
ok 18 - handle rename/rename (2to1) conflict correctly

expecting success: 
	git rm -rf . &&
	git clean -fdqx &&
	rm -rf .git &&
	git init &&

	echo stuff >a &&
	git add a &&
	test_tick &&
	git commit -m A &&
	git tag A &&

	git checkout -b B A &&
	git mv a b &&
	test_tick &&
	git commit -m B &&

	git checkout -b C A &&
	git mv a c &&
	test_tick &&
	git commit -m C

Branch add_sub1 set up to track remote branch add_sub1 from origin.
c: needs merge
rm 'c'
rm 'c'
Previous HEAD position was 32a594a... Add <4: Ciao for now> into <hello>.
Switched to branch 'other'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6042-merge-rename-corner-cases/.git/
Submodule path 'sub1': checked out '7e9f79116e21ad6a3ac18868cba45094b8cda241'
[master (root-commit) 4bef8c3] A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a
Merging:
aca6d60 Base
virtual 041e4211db7ed532217ff038b324aebb8d486d4d
found 1 common ancestor:
aca6d60 Base
Merge made by the 'recursive' strategy.
 .gitmodules | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
Switched to a new branch 'B'
[B e3e22b6] B
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename a => b (100%)
Switched to a new branch 'C'
ok 1 - git_bisect: 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
		)
	
[C 298abcf] C
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename a => c (100%)
ok 19 - setup simple rename/rename (1to2) conflict

expecting success: 
	git checkout C^0 &&

	test_must_fail git merge -s recursive B^0 &&

	test 3 -eq $(git ls-files -s | wc -l) &&
	test 3 -eq $(git ls-files -u | wc -l) &&
	test 0 -eq $(git ls-files -o | wc -l) &&

	test $(git rev-parse :1:a) = $(git rev-parse A:a) &&
	test $(git rev-parse :3:b) = $(git rev-parse A:a) &&
	test $(git rev-parse :2:c) = $(git rev-parse A:a) &&

	test ! -f a &&
	test $(git hash-object b) = $(git rev-parse A:a) &&
	test $(git hash-object c) = $(git rev-parse A:a)

Note: checking out 'C^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 298abcf... C
Merging:
298abcf C
virtual B^0
found 1 common ancestor:
4bef8c3 A
CONFLICT (rename/rename): Rename "a"->"c" in branch "HEAD" rename "a"->"b" in "B^0"
Automatic merge failed; fix conflicts and then commit the result.
Cloning into 'submodule_update'...
done.
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
ok 20 - merge has correct working tree contents

expecting success: 
	git rm -rf . &&
	git clean -fdqx &&
	rm -rf .git &&
	git init &&

	printf "1\n2\n3\n4\n5\n6\n7\n" >a &&
	git add a &&
	git commit -m A &&
	git tag A &&

	git checkout -b B A &&
	git mv a b &&
	git commit -m B &&

	git checkout -b C A &&
	git mv a c &&
	echo something completely different >a &&
	git add a &&
	git commit -m C

Bisecting: 2 revisions left to test after this (roughly 2 steps)
a: needs merge
b: needs merge
c: needs merge
rm 'a'
rm 'b'
rm 'c'
[32a594a3fdac2d57cf6d02987e30eec68511498c] Add <4: Ciao for now> into <hello>.
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Cloning into 'sub1'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6042-merge-rename-corner-cases/.git/
done.
[master (root-commit) 84629f9] A
 Author: A U Thor <author@example.com>
 1 file changed, 7 insertions(+)
 create mode 100644 a
Switched to branch 'add_sub1'
Your branch is up-to-date with 'origin/add_sub1'.
Switched to a new branch 'B'
[add_sub1 031612d] bisect bad
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bar
[B b5e044c] B
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename a => b (100%)
Switched to a new branch 'C'
HEAD is now at 7e9f791 Base
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
[C f165c07] C
 Author: A U Thor <author@example.com>
 2 files changed, 8 insertions(+), 7 deletions(-)
 create mode 100644 c
ok 21 - setup rename/rename(1to2)/add-source conflict

checking known breakage: 
	git checkout B^0 &&

	test_must_fail git merge -s recursive C^0 &&

	test 4 -eq $(git ls-files -s | wc -l) &&
	test 0 -eq $(git ls-files -o | wc -l) &&

	test $(git rev-parse 3:a) = $(git rev-parse C:a) &&
	test $(git rev-parse 1:a) = $(git rev-parse A:a) &&
	test $(git rev-parse 2:b) = $(git rev-parse B:b) &&
	test $(git rev-parse 3:c) = $(git rev-parse C:c) &&

	test -f a &&
	test -f b &&
	test -f c

Note: checking out 'B^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 b5e044c... B
Merging:
b5e044c B
virtual C^0
found 1 common ancestor:
84629f9 A
Auto-merging b
Merge made by the 'recursive' strategy.
 b | 8 +-------
 c | 7 +++++++
 2 files changed, 8 insertions(+), 7 deletions(-)
 create mode 100644 c
test_must_fail: command succeeded: git merge -s recursive C^0
not ok 22 - detect conflict with rename/rename(1to2)/add-source merge # TODO known breakage

expecting success: 
	git rm -rf . &&
	git clean -fdqx &&
	rm -rf .git &&
	git init &&

	>a &&
	git add a &&
	test_tick &&
	git commit -m base &&
	git tag A &&

	git checkout -b B A &&
	git mv a b &&
	test_tick &&
	git commit -m one &&

	git checkout -b C A &&
	git mv a b &&
	echo important-info >a &&
	git add a &&
	test_tick &&
	git commit -m two

rm 'b'
rm 'c'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6042-merge-rename-corner-cases/.git/
ok 43 - git_pull_noff: 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
		)
	
[master (root-commit) 4e27982] base
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 a
Switched to a new branch 'B'
[B 7ee641c] one
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename a => b (100%)
Cloning into 'submodule_update'...
Switched to a new branch 'C'
done.
[C c7c8455] two
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
 create mode 100644 b
ok 23 - setup rename/rename(1to2)/add-source resolvable conflict

checking known breakage: 
	git checkout C^0 &&
	git merge -s recursive B^0 &&

	test 2 -eq $(git ls-files -s | wc -l) &&
	test 0 -eq $(git ls-files -o | wc -l) &&

	test $(git rev-parse HEAD:a) = $(git rev-parse C:a) &&
	test $(git rev-parse HEAD:b) = $(git rev-parse A:a)

Note: checking out 'C^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 c7c8455... two
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Merging:
c7c8455 two
virtual B^0
found 1 common ancestor:
4e27982 base
CONFLICT (modify/delete): a deleted in B^0 and modified in HEAD. Version HEAD of a left in tree.
Automatic merge failed; fix conflicts and then commit the result.
not ok 24 - rename/rename/add-source still tracks new a file # TODO known breakage

expecting success: 
	git rm -rf . &&
	git clean -fdqx &&
	rm -rf .git &&
	git init &&

	echo stuff >a &&
	git add a &&
	test_tick &&
	git commit -m base &&
	git tag A &&

	git checkout -b B A &&
	git mv a b &&
	echo precious-data >c &&
	git add c &&
	test_tick &&
	git commit -m one &&

	git checkout -b C A &&
	git mv a c &&
	echo important-info >b &&
	git add b &&
	test_tick &&
	git commit -m two

a: needs merge
rm 'a'
rm 'a'
rm 'b'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Deleted branch add_sub1 (was 041e421).
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6042-merge-rename-corner-cases/.git/
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
[master (root-commit) 8d35db4] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a
Bisecting: 0 revisions left to test after this (roughly 0 steps)
Switched to a new branch 'B'
ff29dcbe6fe49a0b462bddf0691a013c12a53316 is the first bad commit
ok 25 - bisect run & skip: find first bad

expecting success: 
	git bisect reset &&
	git bisect start $HASH7 $HASH1 &&
	git bisect skip $HASH1..$HASH5 &&
	test "$HASH6" = "$(git rev-parse --verify HEAD)" &&
	test_must_fail git bisect bad > my_bisect_log.txt &&
	grep "first bad commit could be any of" my_bisect_log.txt

[5369cc164bf5eb593f5888cf0a61aa2342b4e7c0] Add sub1
[B 06f1bab] one
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
 rename a => b (100%)
 create mode 100644 c
Merging:
aca6d60 Base
virtual 041e4211db7ed532217ff038b324aebb8d486d4d
found 1 common ancestor:
aca6d60 Base
Merge made by the 'recursive' strategy.
Switched to a new branch 'C'
 .gitmodules | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
Previous HEAD position was ff29dcb... Add <6: Yet a line.> into <hello>.
Switched to branch 'other'
[C b6fb8db] two
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
 create mode 100644 b
 rename a => c (100%)
ok 25 - setup rename/rename(1to2)/add-dest conflict

expecting success: 
	git checkout C^0 &&
	test_must_fail git merge -s recursive B^0 &&

	test 5 -eq $(git ls-files -s | wc -l) &&
	test 2 -eq $(git ls-files -u b | wc -l) &&
	test 2 -eq $(git ls-files -u c | wc -l) &&
	test 4 -eq $(git ls-files -o | wc -l) &&

	test $(git rev-parse :1:a) = $(git rev-parse A:a) &&
	test $(git rev-parse :2:b) = $(git rev-parse C:b) &&
	test $(git rev-parse :3:b) = $(git rev-parse B:b) &&
	test $(git rev-parse :2:c) = $(git rev-parse C:c) &&
	test $(git rev-parse :3:c) = $(git rev-parse B:c) &&

	test $(git hash-object c~HEAD) = $(git rev-parse C:c) &&
	test $(git hash-object c~B\^0) = $(git rev-parse B:c) &&
	test $(git hash-object b~HEAD) = $(git rev-parse C:b) &&
	test $(git hash-object b~B\^0) = $(git rev-parse B:b) &&

	test ! -f b &&
	test ! -f c

Note: checking out 'C^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 b6fb8db... two
Merging:
b6fb8db two
virtual B^0
found 1 common ancestor:
8d35db4 base
CONFLICT (rename/rename): Rename "a"->"c" in branch "HEAD" rename "a"->"b" in "B^0"
Automatic merge failed; fix conflicts and then commit the result.
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t6041-bisect-submodule/submodule_update_repo/.) registered for path 'sub1'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'sub1'...
Bisecting: 2 revisions left to test after this (roughly 2 steps)
ok 26 - rename/rename/add-dest merge still knows about conflicting file versions

# still have 7 known breakage(s)
# passed all remaining 19 test(s)
1..26
done.
[32a594a3fdac2d57cf6d02987e30eec68511498c] Add <4: Ciao for now> into <hello>.
*** t6050-replace.sh ***
Cloning into 'sub1'...
done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6050-replace/.git/
Submodule path 'sub1': checked out '7e9f79116e21ad6a3ac18868cba45094b8cda241'
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
Bisecting: 2 revisions left to test after this (roughly 2 steps)
ok 2 - git_bisect: 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
		)
	
[ff29dcbe6fe49a0b462bddf0691a013c12a53316] Add <6: Yet a line.> into <hello>.
ok 44 - git_pull_noff: 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
		)
	
Cloning into 'submodule_update'...
expecting success: 
     echo "line 1" >>hello &&
     echo "line 2" >>hello &&
     echo "line 3" >>hello &&
     echo "line 4" >>hello &&
     add_and_commit_file hello "4 lines" &&
     HASH1=$(git rev-parse --verify HEAD) &&
     echo "line BUG" >>hello &&
     echo "line 6" >>hello &&
     echo "line 7" >>hello &&
     echo "line 8" >>hello &&
     add_and_commit_file hello "4 more lines with a BUG" &&
     HASH2=$(git rev-parse --verify HEAD) &&
     echo "line 9" >>hello &&
     echo "line 10" >>hello &&
     add_and_commit_file hello "2 more lines" &&
     HASH3=$(git rev-parse --verify HEAD) &&
     echo "line 11" >>hello &&
     add_and_commit_file hello "1 more line" &&
     HASH4=$(git rev-parse --verify HEAD) &&
     sed -e "s/BUG/5/" hello >hello.new &&
     mv hello.new hello &&
     add_and_commit_file hello "BUG fixed" &&
     HASH5=$(git rev-parse --verify HEAD) &&
     echo "line 12" >>hello &&
     echo "line 13" >>hello &&
     add_and_commit_file hello "2 more lines" &&
     HASH6=$(git rev-parse --verify HEAD) &&
     echo "line 14" >>hello &&
     echo "line 15" >>hello &&
     echo "line 16" >>hello &&
     add_and_commit_file hello "again 3 more lines" &&
     HASH7=$(git rev-parse --verify HEAD)

done.
Cloning into 'submodule_update'...
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
done.
The first bad commit could be any of:
ok 26 - bisect skip only one range

expecting success: 
	git bisect start $HASH7 $HASH1 &&
	test "$HASH4" = "$(git rev-parse --verify HEAD)" &&
	git bisect skip $HASH2 $HASH2.. ..$HASH5 &&
	test "$HASH6" = "$(git rev-parse --verify HEAD)" &&
	test_must_fail git bisect bad > my_bisect_log.txt &&
	grep "first bad commit could be any of" my_bisect_log.txt

Branch add_sub1 set up to track remote branch add_sub1 from origin.
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
error: The following untracked working tree files would be overwritten by checkout:
	sub1
Please move or remove them before you can switch branches.
Aborting
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Deleted branch add_sub1 (was 041e421).
Switched to a new branch 'add_sub1'
ok 3 - git_bisect: 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
		)
	
Previous HEAD position was ff29dcb... Add <6: Yet a line.> into <hello>.
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Switched to branch 'other'
Cloning into 'submodule_update'...
ok 1 - set up buggy branch

expecting success: 
     git cat-file commit $HASH2 | grep "author A U Thor" &&
     R=$(git cat-file commit $HASH2 | sed -e "s/A U/O/" | git hash-object -t commit --stdin -w) &&
     git cat-file commit $R | grep "author O Thor" &&
     git update-ref refs/replace/$HASH2 $R &&
     git show HEAD~5 | grep "O Thor" &&
     git show $HASH2 | grep "O Thor"

error: The following untracked working tree files would be overwritten by merge:
	sub1
Please move or remove them before you can merge.
Aborting
fatal: merging of trees ec38489b3f8eda08fda17055ad272abc24bdf929 and a893794caf81ccd3b55c1cac0e91f98dc6a22f7f failed
Merging:
aca6d60 Base
virtual 041e4211db7ed532217ff038b324aebb8d486d4d
found 1 common ancestor:
aca6d60 Base
author A U Thor <author@example.com> 1112912053 -0700
done.
author O Thor <author@example.com> 1112912053 -0700
ok 45 - git_pull_noff: 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
		)
	
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.
Author: O Thor <author@example.com>
Bisecting: 2 revisions left to test after this (roughly 2 steps)
Author: O Thor <author@example.com>
ok 2 - replace the author

expecting success: 
     git cat-file commit $HASH2 | grep "author O Thor" &&
     git --no-replace-objects cat-file commit $HASH2 | grep "author A U Thor" &&
     git show $HASH2 | grep "O Thor" &&
     git --no-replace-objects show $HASH2 | grep "A U Thor"

t6041-bisect-submodule.sh: 159: cd: can't cd to sub1
author O Thor <author@example.com> 1112912053 -0700
Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
author A U Thor <author@example.com> 1112912053 -0700
[32a594a3fdac2d57cf6d02987e30eec68511498c] Add <4: Ciao for now> into <hello>.
Cloning into 'submodule_update'...
Author: O Thor <author@example.com>
Author: A U Thor <author@example.com>
ok 3 - test --no-replace-objects option

expecting success: 
     GIT_NO_REPLACE_OBJECTS=1 git cat-file commit $HASH2 | grep "author A U Thor" &&
     GIT_NO_REPLACE_OBJECTS=1 git show $HASH2 | grep "A U Thor"

author A U Thor <author@example.com> 1112912053 -0700
done.
Author: A U Thor <author@example.com>
ok 4 - test GIT_NO_REPLACE_OBJECTS env variable

expecting success: 
     git mktag <tag.sig >.git/refs/tags/mytag 2>message

Switched to branch 'replace_file_with_sub1'
Your branch is up-to-date with 'origin/replace_file_with_sub1'.
ok 5 - tag replaced commit

expecting success: 
     git fsck master >fsck_master.out &&
     grep "dangling commit $R" fsck_master.out &&
     grep "dangling tag $(cat .git/refs/tags/mytag)" fsck_master.out &&
     test -z "$(git fsck)"

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.
[replace_file_with_sub1 b8f1461] bisect bad
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bar
dangling commit c06ac9b8cd2f38349af40ec00e5d5c761b3bf513
t5572-pull-submodule.sh: 159: cd: can't cd to sub1
dangling tag e25dc7954f0832d962347872884aab2dffb426c5
HEAD is now at b876fd1 Replace sub1 with file
Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
ok 6 - "git fsck" works

expecting success: 
     git repack -a -d &&
     git clone --no-hardlinks . clone_dir &&
     (
	  cd clone_dir &&
	  git show HEAD~5 | grep "A U Thor" &&
	  git show $HASH2 | grep "A U Thor" &&
	  git cat-file commit $R &&
	  git repack -a -d &&
	  test_must_fail git cat-file commit $R &&
	  git fetch ../ "refs/replace/*:refs/replace/*" &&
	  git show HEAD~5 | grep "O Thor" &&
	  git show $HASH2 | grep "O Thor" &&
	  git cat-file commit $R
     )

Deleted branch replace_file_with_sub1 (was 1bf82f3).
Switched to a new branch 'replace_file_with_sub1'
Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
Bisecting: 2 revisions left to test after this (roughly 2 steps)
Merging:
88f15cf Replace sub1 with file
virtual 1bf82f368456432521979c68a5e7601914631728
found 1 common ancestor:
88f15cf Replace sub1 with file
Merge made by the 'recursive' strategy.
[ff29dcbe6fe49a0b462bddf0691a013c12a53316] Add <6: Yet a line.> into <hello>.
Cloning into 'clone_dir'...
 .gitmodules | 4 ++++
 sub1        | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)
 mode change 100644 => 160000 sub1
done.
Author: A U Thor <author@example.com>
Author: A U Thor <author@example.com>
tree 242e3e36d5c0616fbf715682c322254dadb55168
parent 00ad688edb1a79423184992de45a5f0322c8bdf5
author O Thor <author@example.com> 1112912053 -0700
committer C O Mitter <committer@example.com> 1112912053 -0700

hello: 4 more lines with a BUG
fatal: git cat-file c06ac9b8cd2f38349af40ec00e5d5c761b3bf513: bad file
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
The first bad commit could be any of:
ok 27 - bisect skip many ranges

expecting success: 
	git bisect reset &&
	git checkout master^ &&
	HEAD=$(git rev-parse --verify HEAD) &&
	git bisect start &&
	test $HEAD = $(cat .git/BISECT_START) &&
	git bisect reset &&
	test $HEAD = $(git rev-parse --verify HEAD)

Previous HEAD position was ff29dcb... Add <6: Yet a line.> into <hello>.
From ..
 * [new ref]         refs/replace/4217adb325b9db7bfc0c7b223183cc8546638cf0 -> refs/replace/4217adb325b9db7bfc0c7b223183cc8546638cf0
Switched to branch 'other'
Author: O Thor <author@example.com>
Author: O Thor <author@example.com>
Cloning into 'sub1'...
tree 242e3e36d5c0616fbf715682c322254dadb55168
parent 00ad688edb1a79423184992de45a5f0322c8bdf5
author O Thor <author@example.com> 1112912053 -0700
committer C O Mitter <committer@example.com> 1112912053 -0700

hello: 4 more lines with a BUG
ok 7 - repack, clone and fetch work

expecting success: 
     test "$HASH2" = "$(git replace -l)" &&
     test "$HASH2" = "$(git replace)" &&
     aa=${HASH2%??????????????????????????????????????} &&
     test "$HASH2" = "$(git replace --list "$aa*")" &&
     test_must_fail git replace -d $R &&
     test_must_fail git replace --delete &&
     test_must_fail git replace -l -d $HASH2 &&
     git replace -d $HASH2 &&
     git show $HASH2 | grep "A U Thor" &&
     test -z "$(git replace -l)"

Bisecting: 0 revisions left to test after this (roughly 0 steps)
error: replace ref 'c06ac9b8cd2f38349af40ec00e5d5c761b3bf513' not found.
done.
-d needs at least one argument

usage: git replace [-f] <object> <replacement>
   or: git replace [-f] --edit <object>
   or: git replace [-f] --graft <commit> [<parent>...]
   or: git replace -d <object>...
   or: git replace [--format=<format>] [-l [<pattern>]]

    -l, --list            list replace refs
    -d, --delete          delete replace refs
    -e, --edit            edit existing object
    -g, --graft           change a commit's parents
    -f, --force           replace the ref if it exists
    --raw                 do not pretty-print contents for --edit
    --format <format>     use this format

[912b3c6baf1e6e7085f322c908868a3e044a17e6] Revert "Replace sub1 with file"
Note: checking out '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 3de952f... Add <3: Another new day for git> into <hello>.
error: switch `d' : incompatible with --list
usage: git replace [-f] <object> <replacement>
   or: git replace [-f] --edit <object>
   or: git replace [-f] --graft <commit> [<parent>...]
   or: git replace -d <object>...
   or: git replace [--format=<format>] [-l [<pattern>]]

    -l, --list            list replace refs
    -d, --delete          delete replace refs
    -e, --edit            edit existing object
    -g, --graft           change a commit's parents
    -f, --force           replace the ref if it exists
    --raw                 do not pretty-print contents for --edit
    --format <format>     use this format

Deleted replace ref '4217adb325b9db7bfc0c7b223183cc8546638cf0'
Author: A U Thor <author@example.com>
ok 8 - "git replace" listing and deleting

expecting success: 
     git replace $HASH2 $R &&
     git show $HASH2 | grep "O Thor" &&
     test_must_fail git replace $HASH2 $R &&
     git replace -f $HASH2 $R &&
     test_must_fail git replace -f &&
     test "$HASH2" = "$(git replace)"

Author: O Thor <author@example.com>
fatal: replace ref 'refs/replace/4217adb325b9db7bfc0c7b223183cc8546638cf0' already exists
-f only makes sense when writing a replacement

usage: git replace [-f] <object> <replacement>
   or: git replace [-f] --edit <object>
   or: git replace [-f] --graft <commit> [<parent>...]
   or: git replace -d <object>...
   or: git replace [--format=<format>] [-l [<pattern>]]

    -l, --list            list replace refs
    -d, --delete          delete replace refs
    -e, --edit            edit existing object
    -g, --graft           change a commit's parents
    -f, --force           replace the ref if it exists
    --raw                 do not pretty-print contents for --edit
    --format <format>     use this format

ok 9 - "git replace" replacing

expecting success: 
     SHORTHASH2=$(git rev-parse --short=8 $HASH2) &&
     git replace -d $SHORTHASH2 &&
     git replace $SHORTHASH2 $R &&
     git show $HASH2 | grep "O Thor" &&
     test_must_fail git replace $HASH2 $R &&
     git replace -f $HASH2 $R &&
     test_must_fail git replace --force &&
     test "$HASH2" = "$(git replace)"

Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
Deleted replace ref '4217adb325b9db7bfc0c7b223183cc8546638cf0'
Author: O Thor <author@example.com>
fatal: replace ref 'refs/replace/4217adb325b9db7bfc0c7b223183cc8546638cf0' already exists
-f only makes sense when writing a replacement

usage: git replace [-f] <object> <replacement>
   or: git replace [-f] --edit <object>
   or: git replace [-f] --graft <commit> [<parent>...]
   or: git replace -d <object>...
   or: git replace [--format=<format>] [-l [<pattern>]]

    -l, --list            list replace refs
    -d, --delete          delete replace refs
    -e, --edit            edit existing object
    -g, --graft           change a commit's parents
    -f, --force           replace the ref if it exists
    --raw                 do not pretty-print contents for --edit
    --format <format>     use this format

ok 10 - "git replace" resolves sha1

expecting success: 
     git replace -d $HASH2 &&
     git show $HASH2 | grep "A U Thor" &&
     git checkout $HASH1 &&
     git cherry-pick $HASH2 &&
     git show $HASH5 | git apply &&
     git commit --amend -m "hello: 4 more lines WITHOUT the bug" hello &&
     PARA2=$(git rev-parse --verify HEAD) &&
     git cherry-pick $HASH3 &&
     PARA3=$(git rev-parse --verify HEAD) &&
     git cherry-pick $HASH4 &&
     PARA4=$(git rev-parse --verify HEAD) &&
     git cherry-pick $HASH6 &&
     PARA6=$(git rev-parse --verify HEAD) &&
     git replace $HASH6 $PARA6 &&
     git checkout master &&
     cur=$(git rev-parse --verify HEAD) &&
     test "$cur" = "$HASH7" &&
     git log --pretty=oneline | grep $PARA2 &&
     git remote add cloned ./clone_dir

Deleted replace ref '4217adb325b9db7bfc0c7b223183cc8546638cf0'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t6041-bisect-submodule/submodule_update_repo/.) registered for path 'sub1'
Author: A U Thor <author@example.com>
ok 46 - git_pull_noff: replace tracked file with submodule creates empty directory

checking known breakage: 
		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
		)
	
HEAD is now at 3de952f... Add <3: Another new day for git> into <hello>.
Note: checking out '00ad688edb1a79423184992de45a5f0322c8bdf5'.

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 00ad688... hello: 4 lines
[detached HEAD dcda230] hello: 4 more lines with a BUG
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 1 file changed, 4 insertions(+)
ok 28 - bisect starting with a detached HEAD

expecting success: 
	git bisect reset &&
	test_must_fail git bisect start $HASH2 $HASH4 2> rev_list_error &&
	grep "mistook good and bad" rev_list_error &&
	git bisect reset

[detached HEAD af6d994] hello: 4 more lines WITHOUT the bug
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 1 file changed, 4 insertions(+)
Cloning into 'submodule_update'...
Cloning into 'sub1'...
Auto-merging hello
We are not bisecting.
[detached HEAD a3fb2e1] hello: 2 more lines
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 2 insertions(+)
done.
done.
Auto-merging hello
[detached HEAD f486255] hello: 1 more line
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
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.
error: 8ed2e6719f8484ce01fa3ce133fe42d25c2441b8^{commit}: expected commit type, but the object dereferences to tree type
fatal: Needed a single revision
[detached HEAD 911408d] hello: 2 more lines
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:18:13 2005 -0700
 1 file changed, 2 insertions(+)
Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
Deleted branch replace_directory_with_sub1 (was 99dcd27).
Submodule path 'sub1': checked out '7e9f79116e21ad6a3ac18868cba45094b8cda241'
Previous HEAD position was 911408d... hello: 2 more lines
Switched to a new branch 'replace_directory_with_sub1'
Switched to branch 'master'
Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
af6d994c7106b0846fb80f09fa5bcbc460432c6d hello: 4 more lines WITHOUT the bug
ok 11 - create parallel branch without the bug

expecting success: 
     git push cloned $HASH6^:refs/heads/parallel &&
     (
	  cd clone_dir &&
	  git checkout parallel &&
	  git log --pretty=oneline | grep $PARA2
     )

ok 4 - git_bisect: 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
		)
	
Merging:
48ceb4d Replace sub1 with directory
virtual 99dcd2781de945f4997d948bdc9765407ef22ece
found 1 common ancestor:
48ceb4d Replace sub1 with directory
Removing sub1/file3
Removing sub1/file2
Removing sub1/file1
Adding sub1
Merge made by the 'recursive' strategy.
 .gitmodules | 4 ++++
 sub1/file1  | 1 -
 sub1/file2  | 1 -
 sub1/file3  | 1 -
 4 files changed, 4 insertions(+), 3 deletions(-)
 delete mode 100644 sub1/file1
 delete mode 100644 sub1/file2
 delete mode 100644 sub1/file3
To ./clone_dir
 * [new branch]      14ac020163ea60a9d683ce68e36c946f31ecc856^ -> parallel
Maybe you mistook good and bad revs?
Switched to branch 'parallel'
Directory sub1 doesn't exist. 
af6d994c7106b0846fb80f09fa5bcbc460432c6d hello: 4 more lines WITHOUT the bug
ok 12 - push to cloned repo

expecting success: 
     git cat-file commit $PARA3 | grep "author A U Thor" &&
     S=$(git cat-file commit $PARA3 | sed -e "s/A U/O/" | git hash-object -t commit --stdin -w) &&
     git cat-file commit $S | grep "author O Thor" &&
     git replace $PARA3 $S &&
     git show $HASH6~2 | grep "O Thor" &&
     git show $PARA3 | grep "O Thor" &&
     git push cloned $HASH6^:refs/heads/parallel2 &&
     (
	  cd clone_dir &&
	  git checkout parallel2 &&
	  git log --pretty=oneline | grep $PARA3 &&
	  git show $PARA3 | grep "A U Thor"
     )

not ok 47 - git_pull_noff: replace directory with submodule # TODO known breakage

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
		)
	
author A U Thor <author@example.com> 1112912113 -0700
We are not bisecting.
ok 29 - bisect errors out if bad and good are mistaken

expecting success: 
	git bisect reset &&
	git bisect start $HASH7 $HASH1 &&
	git branch bisect &&
	rev_hash4=$(git rev-parse --verify HEAD) &&
	test "$rev_hash4" = "$HASH4" &&
	git branch -D bisect &&
	git bisect good &&
	git branch bisect &&
	rev_hash6=$(git rev-parse --verify HEAD) &&
	test "$rev_hash6" = "$HASH6" &&
	git bisect good > my_bisect_log.txt &&
	grep "$HASH7 is the first bad commit" my_bisect_log.txt &&
	git bisect reset &&
	rev_hash6=$(git rev-parse --verify bisect) &&
	test "$rev_hash6" = "$HASH6" &&
	git branch -D bisect

Cloning into 'submodule_update'...
author O Thor <author@example.com> 1112912113 -0700
Author: O Thor <author@example.com>
done.
Cloning into 'submodule_update'...
We are not bisecting.
Author: O Thor <author@example.com>
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.
done.
To ./clone_dir
 * [new branch]      14ac020163ea60a9d683ce68e36c946f31ecc856^ -> parallel2
error: 8ed2e6719f8484ce01fa3ce133fe42d25c2441b8^{commit}: expected commit type, but the object dereferences to tree type
fatal: Needed a single revision
Switched to branch 'parallel2'
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
a3fb2e1845a1aaf129b7975048973414dc172173 hello: 2 more lines
Author: A U Thor <author@example.com>
ok 13 - push branch with replacement

expecting success: 
     git branch tofetch $HASH6 &&
     (
	  cd clone_dir &&
	  git fetch origin refs/heads/tofetch:refs/heads/parallel3 &&
	  git log --pretty=oneline parallel3 >output.txt &&
	  ! grep $PARA3 output.txt &&
	  git show $PARA3 >para3.txt &&
	  grep "A U Thor" para3.txt &&
	  git fetch origin "refs/replace/*:refs/replace/*" &&
	  git log --pretty=oneline parallel3 >output.txt &&
	  grep $PARA3 output.txt &&
	  git show $PARA3 >para3.txt &&
	  grep "O Thor" para3.txt
     )

Switched to branch 'replace_directory_with_sub1'
Your branch is up-to-date with 'origin/replace_directory_with_sub1'.
From /«PKGBUILDDIR»/t/trash directory.t6050-replace/.
 * [new branch]      tofetch    -> parallel3
 * [new branch]      tofetch    -> origin/tofetch
[replace_directory_with_sub1 da99022] bisect bad
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bar
Bisecting: 2 revisions left to test after this (roughly 2 steps)
Author: A U Thor <author@example.com>
HEAD is now at f9834e9 Replace sub1 with directory
[32a594a3fdac2d57cf6d02987e30eec68511498c] Add <4: Ciao for now> into <hello>.
Deleted branch bisect (was 32a594a).
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
From /«PKGBUILDDIR»/t/trash directory.t6050-replace/.
 * [new ref]         refs/replace/14ac020163ea60a9d683ce68e36c946f31ecc856 -> refs/replace/14ac020163ea60a9d683ce68e36c946f31ecc856
 * [new ref]         refs/replace/a3fb2e1845a1aaf129b7975048973414dc172173 -> refs/replace/a3fb2e1845a1aaf129b7975048973414dc172173
a3fb2e1845a1aaf129b7975048973414dc172173 hello: 2 more lines
Author: O Thor <author@example.com>
ok 14 - fetch branch with replacement

expecting success: 
     git bisect start $HASH7 $HASH1 &&
     test "$PARA3" = "$(git rev-parse --verify HEAD)" &&
     git bisect reset &&
     GIT_NO_REPLACE_OBJECTS=1 git bisect start $HASH7 $HASH1 &&
     test "$HASH4" = "$(git rev-parse --verify HEAD)" &&
     git bisect reset &&
     git --no-replace-objects bisect start $HASH7 $HASH1 &&
     test "$HASH4" = "$(git rev-parse --verify HEAD)" &&
     git bisect reset

Bisecting: 0 revisions left to test after this (roughly 1 step)
Cloning into 'sub1'...
[ff29dcbe6fe49a0b462bddf0691a013c12a53316] Add <6: Yet a line.> into <hello>.
done.
Bisecting: 2 revisions left to test after this (roughly 1 step)
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
[a3fb2e1845a1aaf129b7975048973414dc172173] hello: 2 more lines
3659270ffa1e67547111a107f53191676dff3424 is the first bad commit
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
Deleted branch remove_sub1 (was e68bdee).
Previous HEAD position was ff29dcb... Add <6: Yet a line.> into <hello>.
HEAD is now at 3de952f... Add <3: Another new day for git> into <hello>.
Switched to a new branch 'remove_sub1'
Previous HEAD position was a3fb2e1... hello: 2 more lines
Switched to branch 'master'
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
Bisecting: 0 revisions left to test after this (roughly 0 steps)
Deleted branch bisect (was ff29dcb).
ok 30 - bisect does not create a "bisect" branch

expecting success: 
	git bisect reset &&
	git checkout -b side $HASH4 &&
	add_line_into_file "5(side): first line on a side branch" hello2 &&
	SIDE_HASH5=$(git rev-parse --verify HEAD) &&
	add_line_into_file "6(side): second line on a side branch" hello2 &&
	SIDE_HASH6=$(git rev-parse --verify HEAD) &&
	add_line_into_file "7(side): third line on a side branch" hello2 &&
	SIDE_HASH7=$(git rev-parse --verify HEAD)

[25cca3d5aa6d6dabe316c8af944c5286616e47df] Revert "Replace sub1 with directory"
Merging:
041e421 Add sub1
virtual e68bdeef87414a77bbfbc2db884f1845e55c81b1
found 1 common ancestor:
041e421 Add sub1
Removing sub1
Removing .gitmodules
Merge made by the 'recursive' strategy.
 .gitmodules | 4 ----
 1 file changed, 4 deletions(-)
 delete mode 100644 .gitmodules
We are not bisecting.
Previous HEAD position was 3de952f... Add <3: Another new day for git> into <hello>.
Switched to a new branch 'side'
ok 48 - git_pull_noff: 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 31 - side branch creation

expecting success: 
	git bisect start "$HASH7" "$SIDE_HASH7" > my_bisect_log.txt &&
	grep "merge base must be tested" my_bisect_log.txt &&
	grep $HASH4 my_bisect_log.txt &&
	git bisect good > my_bisect_log.txt &&
	test_must_fail grep "merge base must be tested" my_bisect_log.txt &&
	grep $HASH6 my_bisect_log.txt &&
	git bisect reset

Bisecting: 2 revisions left to test after this (roughly 2 steps)
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t6041-bisect-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'submodule_update'...
[40237c8b8add42b8ca9d277edebf9dd36b4edbd8] hello: 1 more line
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Warning: you are leaving 2 commits behind, not connected to
any of your branches:

  40237c8 hello: 1 more line
  8fc2a8e hello: 2 more lines

If you want to keep them by creating a new branch, this may be a good time
to do so with:

 git branch <new-branch-name> 40237c8

Switched to branch 'master'
Cloning into 'sub1'...
done.
Bisecting: a merge base must be tested
[32a594a3fdac2d57cf6d02987e30eec68511498c] Add <4: Ciao for now> into <hello>.
Submodule path 'sub1': checked out '7e9f79116e21ad6a3ac18868cba45094b8cda241'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
Bisecting: 2 revisions left to test after this (roughly 2 steps)
ok 5 - git_bisect: 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
		)
	
[40237c8b8add42b8ca9d277edebf9dd36b4edbd8] hello: 1 more line
[ff29dcbe6fe49a0b462bddf0691a013c12a53316] Add <6: Yet a line.> into <hello>.
Cloning into 'sub1'...
done.
Previous HEAD position was ff29dcb... Add <6: Yet a line.> into <hello>.
Switched to branch 'side'
Warning: you are leaving 2 commits behind, not connected to
any of your branches:

  40237c8 hello: 1 more line
  8fc2a8e hello: 2 more lines

If you want to keep them by creating a new branch, this may be a good time
to do so with:

 git branch <new-branch-name> 40237c8

Cloning into 'submodule_update'...
Switched to branch 'master'
done.
ok 32 - good merge base when good and bad are siblings

expecting success: 
	git bisect start "$SIDE_HASH7" "$HASH7" > my_bisect_log.txt &&
	grep "merge base must be tested" my_bisect_log.txt &&
	grep $HASH4 my_bisect_log.txt &&
	git bisect skip > my_bisect_log.txt 2>&1 &&
	grep "warning" my_bisect_log.txt &&
	grep $SIDE_HASH6 my_bisect_log.txt &&
	git bisect reset

ok 15 - bisect and replacements

expecting success: 
	git --no-replace-objects rev-list --objects HEAD |
	git --no-replace-objects pack-objects test- &&
	git index-pack test-*.pack

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
e50468a5dbd75b6b0d0450961c97a12d4af9e7c8
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
e50468a5dbd75b6b0d0450961c97a12d4af9e7c8
ok 16 - index-pack and replacements

expecting success: 
	echo replaced >file &&
	git add file &&
	REPLACED=$(git rev-parse :file) &&
	mv file file.replaced &&

	echo original >file &&
	git add file &&
	ORIGINAL=$(git rev-parse :file) &&
	git update-ref refs/replace/$ORIGINAL $REPLACED &&
	mv file file.original &&

	git checkout file &&
	test_cmp file.replaced file

Deleted branch remove_sub1 (was e68bdee).
Switched to a new branch 'remove_sub1'
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
ok 17 - not just commits

expecting success: 
	test_must_fail git replace mytag $HASH1 &&
	test_must_fail git replace HEAD^{tree} HEAD~1 &&
	BLOB=$(git rev-parse :file) &&
	test_must_fail git replace HEAD^ $BLOB

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t6041-bisect-submodule/submodule_update_repo/.) registered for path 'sub1'
Bisecting: a merge base must be tested
fatal: Objects must be of the same type.
'mytag' points to a replaced object of type 'tag'
while '00ad688edb1a79423184992de45a5f0322c8bdf5' points to a replacement object of type 'commit'.
[32a594a3fdac2d57cf6d02987e30eec68511498c] Add <4: Ciao for now> into <hello>.
fatal: Objects must be of the same type.
'HEAD^{tree}' points to a replaced object of type 'tree'
while 'HEAD~1' points to a replacement object of type 'commit'.
fatal: Objects must be of the same type.
'HEAD^' points to a replaced object of type 'commit'
while '4b48deed3a433909bfd6b6ab3d4b91348b6af464' points to a replacement object of type 'blob'.
ok 18 - replaced and replacement objects must be of the same type

expecting success: 
	git replace -f mytag $HASH1 &&
	git replace --force HEAD^{tree} HEAD~1 &&
	git replace -f HEAD^ $BLOB

ok 19 - -f option bypasses the type check

expecting success: 
	git replace | grep $PARA3 &&
	echo $PARA3 | git cat-file --batch

Merging:
041e421 Add sub1
virtual e68bdeef87414a77bbfbc2db884f1845e55c81b1
found 1 common ancestor:
041e421 Add sub1
Removing sub1
Removing .gitmodules
Merge made by the 'recursive' strategy.
a3fb2e1845a1aaf129b7975048973414dc172173
 .gitmodules | 4 ----
 1 file changed, 4 deletions(-)
 delete mode 100644 .gitmodules
a3fb2e1845a1aaf129b7975048973414dc172173 commit 229
tree 2b0c71265a7705e0c171a5530d9ed18d5e1c31a6
parent af6d994c7106b0846fb80f09fa5bcbc460432c6d
author O Thor <author@example.com> 1112912113 -0700
committer C O Mitter <committer@example.com> 1112912353 -0700

hello: 2 more lines

ok 20 - git cat-file --batch works on replace objects

expecting success: 
	test_must_fail git replace --format bogus >/dev/null 2>&1

Cloning into 'sub1'...
ok 21 - test --format bogus

expecting success: 
	git replace --format=short >actual &&
	git replace >expected &&
	test_cmp expected actual

ok 22 - test --format short

expecting success: 
	H1=$(git --no-replace-objects rev-parse HEAD~1) &&
	HT=$(git --no-replace-objects rev-parse HEAD^{tree}) &&
	MYTAG=$(git --no-replace-objects rev-parse mytag) &&
	{
		echo "$H1 -> $BLOB" &&
		echo "$BLOB -> $REPLACED" &&
		echo "$HT -> $H1" &&
		echo "$PARA3 -> $S" &&
		echo "$MYTAG -> $HASH1"
	} | sort >expected &&
	git replace -l --format medium | sort >actual &&
	test_cmp expected actual

done.
warning: the merge base between 5f781ef4cb0a9c22dd8218d08759770f336c6b8b and [3659270ffa1e67547111a107f53191676dff3424] must be skipped.
[11ec2d5fe9fe0e901ce1c6680bb1025a3431ebcf] Add <6(side): second line on a side branch> into <hello2>.
ok 23 - test --format medium

expecting success: 
	{
		echo "$H1 (commit) -> $BLOB (blob)" &&
		echo "$BLOB (blob) -> $REPLACED (blob)" &&
		echo "$HT (tree) -> $H1 (commit)" &&
		echo "$PARA3 (commit) -> $S (commit)" &&
		echo "$MYTAG (tag) -> $HASH1 (commit)"
	} | sort >expected &&
	git replace --format=long | sort >actual &&
	test_cmp expected actual

ok 49 - git_pull_noff: 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
		)
	
Previous HEAD position was 11ec2d5... Add <6(side): second line on a side branch> into <hello2>.
Switched to branch 'side'
ok 24 - test --format long

expecting success: 
	write_script fakeeditor <<-\EOF
		sed -e "s/A U Thor/A fake Thor/" "$1" >"$1.new"
		mv "$1.new" "$1"
	EOF

Submodule path 'sub1': checked out '7e9f79116e21ad6a3ac18868cba45094b8cda241'
ok 25 - setup a fake editor

expecting success: 
	test_must_fail env GIT_EDITOR=./fakeeditor git replace --edit "$PARA3" &&
	GIT_EDITOR=./fakeeditor git replace --force --edit "$PARA3" &&
	git replace -l | grep "$PARA3" &&
	git cat-file commit "$PARA3" | grep "A fake Thor" &&
	git replace -d "$PARA3" &&
	GIT_EDITOR=./fakeeditor git replace --edit "$PARA3" &&
	git replace -l | grep "$PARA3" &&
	git cat-file commit "$PARA3" | grep "A fake Thor"

fatal: replace ref 'refs/replace/a3fb2e1845a1aaf129b7975048973414dc172173' already exists
ok 33 - skipped merge base when good and bad are siblings

expecting success: 
	git bisect start "$HASH7" HEAD > my_bisect_log.txt &&
	grep "merge base must be tested" my_bisect_log.txt &&
	grep $HASH4 my_bisect_log.txt &&
	test_must_fail git bisect bad > my_bisect_log.txt 2>&1 &&
	grep "merge base $HASH4 is bad" my_bisect_log.txt &&
	grep "fixed between $HASH4 and \[$SIDE_HASH7\]" my_bisect_log.txt &&
	git bisect reset

a3fb2e1845a1aaf129b7975048973414dc172173
author A fake Thor <author@example.com> 1112912113 -0700
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
Deleted replace ref 'a3fb2e1845a1aaf129b7975048973414dc172173'
Cloning into 'submodule_update'...
done.
warning: unable to rmdir sub1: Directory not empty
Switched to branch 'remove_sub1'
Your branch is up-to-date with 'origin/remove_sub1'.
a3fb2e1845a1aaf129b7975048973414dc172173
author A fake Thor <author@example.com> 1112912113 -0700
ok 26 - --edit with and without already replaced object

expecting success: 
	git replace -d "$PARA3" &&
	test_must_fail env GIT_EDITOR=true git replace --edit "$PARA3" &&
	test_must_fail env GIT_EDITOR="./fakeeditor;false" git replace --edit "$PARA3" &&
	GIT_EDITOR=./fakeeditor git replace --edit "$PARA3" &&
	git replace -l | grep "$PARA3" &&
	git cat-file commit "$PARA3" | grep "A fake Thor"

Deleted replace ref 'a3fb2e1845a1aaf129b7975048973414dc172173'
[remove_sub1 b33783f] bisect bad
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bar
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
error: new object is the same as the old one: 'a3fb2e1845a1aaf129b7975048973414dc172173'
HEAD is now at 5369cc1 Add sub1
sed: can't read : No such file or directory
mv: cannot move '.new' to '': No such file or directory
error: There was a problem with the editor './fakeeditor;false'.
fatal: editing object file failed
Bisecting: a merge base must be tested
[32a594a3fdac2d57cf6d02987e30eec68511498c] Add <4: Ciao for now> into <hello>.
a3fb2e1845a1aaf129b7975048973414dc172173
author A fake Thor <author@example.com> 1112912113 -0700
ok 27 - --edit and change nothing or command failed

expecting success: 
	test -n "$(git replace)" &&
	git replace -d $(git replace) &&
	test -z "$(git replace)"

Deleted replace ref '14ac020163ea60a9d683ce68e36c946f31ecc856'
Deleted replace ref '4b48deed3a433909bfd6b6ab3d4b91348b6af464'
Deleted replace ref '5c37393794868bc8e708cccd7c9d9aaa7a5e53cb'
Deleted replace ref 'a3fb2e1845a1aaf129b7975048973414dc172173'
Deleted replace ref 'e25dc7954f0832d962347872884aab2dffb426c5'
ok 28 - replace ref cleanup

expecting success: 
	test $(git log --oneline | wc -l) = 7 &&
	git replace --graft $HASH5 &&
	test $(git log --oneline | wc -l) = 3 &&
	commit_has_parents $HASH5 &&
	test_must_fail git replace --graft $HASH5 $HASH4 $HASH3 &&
	git replace --force -g $HASH5 $HASH4 $HASH3 &&
	commit_has_parents $HASH5 $HASH4 $HASH3 &&
	git replace -d $HASH5

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
The merge base 32a594a3fdac2d57cf6d02987e30eec68511498c is bad.
fatal: Needed a single revision
This means the bug has been fixed between 32a594a3fdac2d57cf6d02987e30eec68511498c and [5f781ef4cb0a9c22dd8218d08759770f336c6b8b].
fatal: replace ref 'refs/replace/093e41a79d4a8bfe3c758a96c95e5bf9e35ed89c' already exists
Previous HEAD position was 32a594a... Add <4: Ciao for now> into <hello>.
Switched to branch 'side'
Cloning into 'sub1'...
fatal: Needed a single revision
Deleted replace ref '093e41a79d4a8bfe3c758a96c95e5bf9e35ed89c'
ok 29 - --graft with and without already replaced object

expecting success: 
	echo "line 17" >>hello &&
	echo "line 18" >>hello &&
	git add hello &&
	test_tick &&
	git commit --quiet -S -m "hello: 2 more lines in a signed commit" &&
	HASH8=$(git rev-parse --verify HEAD) &&
	git verify-commit $HASH8

done.
ok 34 - bad merge base when good and bad are siblings

expecting success: 
	git checkout "$SIDE_HASH5" &&
	git merge -m "merge HASH5 and SIDE_HASH5" "$HASH5" &&
	A_HASH=$(git rev-parse --verify HEAD) &&
	git checkout side &&
	git merge -m "merge HASH7 and SIDE_HASH7" "$HASH7" &&
	B_HASH=$(git rev-parse --verify HEAD) &&
	git merge-base --all "$A_HASH" "$B_HASH" > merge_bases.txt &&
	test_line_count = 2 merge_bases.txt &&
	grep "$HASH5" merge_bases.txt &&
	grep "$SIDE_HASH5" merge_bases.txt

Note: checking out '7208484534e368cca8612445f78d2afcf429f37e'.

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 7208484... Create file <hello2> with <5(side): first line on a side branch> inside.
Merging:
7208484 Create file <hello2> with <5(side): first line on a side branch> inside.
virtual 3082e11d3a0f2edca194c8ce1eb802256e38e75e
found 1 common ancestor:
32a594a Add <4: Ciao for now> into <hello>.
Merge made by the 'recursive' strategy.
 hello | 1 +
 1 file changed, 1 insertion(+)
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  b9ff094 merge HASH5 and SIDE_HASH5

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> b9ff094

Switched to branch 'side'
gpg: Signature made Wed Dec 16 11:02:55 2015 UTC using DSA key ID CDDE430D
gpg: checking the trustdb
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: Good signature from "C O Mitter <committer@example.com>"
ok 30 - set up a signed commit

expecting success: 
	git cat-file commit $HASH8 >orig &&
	git replace --graft $HASH8 &&
	git cat-file commit $HASH8 >repl &&
	commit_has_parents $HASH8 &&
	test_must_fail git verify-commit $HASH8 &&
	sed -n -e "/^tree /p" -e "/^author /p" -e "/^committer /p" orig >expected &&
	echo >>expected &&
	sed -e "/^$/q" repl >actual &&
	test_cmp expected actual &&
	git replace -d $HASH8

Merging:
5f781ef Add <7(side): third line on a side branch> into <hello2>.
virtual 3659270ffa1e67547111a107f53191676dff3424
found 1 common ancestor:
32a594a Add <4: Ciao for now> into <hello>.
Merge made by the 'recursive' strategy.
warning: the original commit '71562fa1e5be50504e5b4194dd3ef71a5b4f820e' has a gpg signature.
warning: the signature will be removed in the replacement commit!
 hello | 3 +++
 1 file changed, 3 insertions(+)
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
3082e11d3a0f2edca194c8ce1eb802256e38e75e
7208484534e368cca8612445f78d2afcf429f37e
ok 35 - many merge bases creation

expecting success: 
	git bisect start "$B_HASH" "$A_HASH" > my_bisect_log.txt &&
	grep "merge base must be tested" my_bisect_log.txt &&
	git bisect good > my_bisect_log2.txt &&
	grep "merge base must be tested" my_bisect_log2.txt &&
	{
		{
			grep "$SIDE_HASH5" my_bisect_log.txt &&
			grep "$HASH5" my_bisect_log2.txt
		} || {
			grep "$SIDE_HASH5" my_bisect_log2.txt &&
			grep "$HASH5" my_bisect_log.txt
		}
	} &&
	git bisect reset

fatal: Needed a single revision
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
Deleted branch replace_sub1_with_directory (was 48ceb4d).
Deleted replace ref '71562fa1e5be50504e5b4194dd3ef71a5b4f820e'
ok 31 - --graft with a signed commit

Bisecting: 0 revisions left to test after this (roughly 0 steps)
expecting success: 
	git reset --hard HEAD &&
	git checkout -b test_branch HEAD~2 &&
	echo "line 1 from test branch" >>hello &&
	echo "line 2 from test branch" >>hello &&
	git add hello &&
	test_tick &&
	git commit -m "hello: 2 more lines from a test branch" &&
	HASH9=$(git rev-parse --verify HEAD) &&
	git tag -s -m "tag for testing with a mergetag" test_tag HEAD &&
	git checkout master &&
	git merge -s ours test_tag &&
	HASH10=$(git rev-parse --verify HEAD) &&
	git cat-file commit $HASH10 | grep "^mergetag object"

Switched to a new branch 'replace_sub1_with_directory'
warning: unable to rmdir sub1: Directory not empty
HEAD is now at 71562fa hello: 2 more lines in a signed commit
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
[9106dfb81d8e80d3d7f757ead2eb469b6ff8bdb1] Revert "Add sub1"
Switched to a new branch 'test_branch'
[test_branch b626dba] hello: 2 more lines from a test branch
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+)
error: refusing to lose untracked file at 'sub1/file2'
error: refusing to lose untracked file at 'sub1/file1'
Merging:
041e421 Add sub1
virtual 48ceb4d11475d9d8e6ea470ec7cd34a659f5afca
found 1 common ancestor:
041e421 Add sub1
Adding sub1/file3
Adding sub1/file2
Adding sub1/file1
Removing sub1
Merge made by the 'recursive' strategy.
ok 6 - git_bisect: 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
		)
	
 .gitmodules | 4 ----
 sub1/file1  | 1 +
 sub1/file2  | 1 +
 sub1/file3  | 1 +
 4 files changed, 3 insertions(+), 4 deletions(-)
 create mode 100644 sub1/file1
 create mode 100644 sub1/file2
 create mode 100644 sub1/file3
test_must_fail: command succeeded: git_pull_noff replace_sub1_with_directory
Switched to branch 'master'
not ok 50 - git_pull_noff: 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
		)
	
Bisecting: a merge base must be tested
Merge made by the 'ours' strategy.
Cloning into 'submodule_update'...
mergetag object b626dba35124fd887689d330b4f2e827b8367cae
ok 32 - set up a merge commit with a mergetag

expecting success: 
	test_must_fail git replace --graft $HASH10 $HASH8^1 &&
	git replace --graft $HASH10 $HASH8^1 $HASH9 &&
	git replace -d $HASH10

fatal: original commit '34b917755b797406abda0e6c7e2b66add74926c8' contains mergetag '7973c722ac874a46bef71ecb0aa610ff4e13f918' that is discarded; use --edit instead of --graft
Cloning into 'submodule_update'...
done.
Deleted replace ref '34b917755b797406abda0e6c7e2b66add74926c8'
ok 33 - --graft on a commit with a mergetag

# passed all 33 test(s)
1..33
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Bisecting: a merge base must be tested
[7208484534e368cca8612445f78d2afcf429f37e] Create file <hello2> with <5(side): first line on a side branch> inside.
*** t6060-merge-index.sh ***
[3082e11d3a0f2edca194c8ce1eb802256e38e75e] Add <5: Another new line.> into <hello>.
Previous HEAD position was 3082e11... Add <5: Another new line.> into <hello>.
Switched to branch 'side'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6060-merge-index/.git/
expecting success: 
	for i in 1 2 3 4 5 6 7 8 9 10; do
		echo $i
	done >file &&
	git add file &&
	git commit -m base &&
	git tag base &&
	sed s/2/two/ <file >tmp &&
	mv tmp file &&
	git commit -a -m two &&
	git tag two &&
	git checkout -b other HEAD^ &&
	sed s/10/ten/ <file >tmp &&
	mv tmp file &&
	git commit -a -m ten &&
	git tag ten

[master (root-commit) 987fa90] base
 Author: A U Thor <author@example.com>
 1 file changed, 10 insertions(+)
 create mode 100644 file
ok 36 - good merge bases when good and bad are siblings

expecting success: 
	git bisect start "$HASH7" "$SIDE_HASH7" > my_bisect_log.txt &&
	grep "merge base must be tested" my_bisect_log.txt &&
	grep "$HASH4" my_bisect_log.txt &&
	git bisect good > my_bisect_log2.txt &&
	test -f ".git/BISECT_ANCESTORS_OK" &&
	test "$HASH6" = $(git rev-parse --verify HEAD) &&
	git bisect bad > my_bisect_log3.txt &&
	git bisect good "$A_HASH" > my_bisect_log4.txt &&
	grep "merge base must be tested" my_bisect_log4.txt &&
	test_must_fail test -f ".git/BISECT_ANCESTORS_OK"

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t6041-bisect-submodule/submodule_update_repo/.) registered for path 'sub1'
[master 05a9dd7] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
Switched to a new branch 'other'
[other 116a16d] ten
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'sub1'...
ok 1 - setup diverging branches

expecting success: 
	git read-tree -i -m base ten two &&
	echo file >expect &&
	git diff-files --name-only --diff-filter=U >unmerged &&
	test_cmp expect unmerged

ok 2 - read-tree does not resolve content merge

expecting success: 
	git merge-index git-merge-one-file -a &&
	git diff-files --name-only --diff-filter=U >unmerged &&
	>expect &&
	test_cmp expect unmerged &&
	test_cmp expect-merged file &&
	git cat-file blob :file >file-index &&
	test_cmp expect-merged file-index

Cloning into 'sub1'...
done.
done.
Auto-merging file
Bisecting: a merge base must be tested
[32a594a3fdac2d57cf6d02987e30eec68511498c] Add <4: Ciao for now> into <hello>.
Submodule path 'sub1': checked out '7e9f79116e21ad6a3ac18868cba45094b8cda241'
ok 3 - git merge-index git-merge-one-file resolves

expecting success: 
	git clone --bare . bare.git &&
	(cd bare.git &&
	 GIT_INDEX_FILE=$PWD/merge.index &&
	 export GIT_INDEX_FILE &&
	 git read-tree -i -m base ten two
	)

Cloning into bare repository 'bare.git'...
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
done.
ok 4 - setup bare merge

expecting success: 
	(cd bare.git &&
	 GIT_INDEX_FILE=$PWD/merge.index &&
	 export GIT_INDEX_FILE &&
	 test_must_fail git merge-index git-merge-one-file -a
	)

Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
fatal: /«PKGBUILDDIR»/git-merge-one-file cannot be used without a working tree.
fatal: merge program failed
ok 5 - merge-one-file fails without a work tree

expecting success: 
	(cd bare.git &&
	 mkdir work &&
	 GIT_WORK_TREE=$PWD/work &&
	 export GIT_WORK_TREE &&
	 GIT_INDEX_FILE=$PWD/merge.index &&
	 export GIT_INDEX_FILE &&
	 git merge-index git-merge-one-file -a &&
	 git cat-file blob :file >work/file-index
	) &&
	test_cmp expect-merged bare.git/work/file &&
	test_cmp expect-merged bare.git/work/file-index

Deleted branch replace_sub1_with_directory (was 48ceb4d).
Auto-merging file
warning: unable to rmdir sub1: Directory not empty
Switched to branch 'remove_sub1'
Your branch is up-to-date with 'origin/remove_sub1'.
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.
[remove_sub1 7078a8c] bisect bad
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bar
ok 6 - merge-one-file respects GIT_WORK_TREE

expecting success: 
	mkdir subdir &&
	git clone . subdir/child &&
	(cd subdir &&
	 GIT_DIR=$PWD/child/.git &&
	 export GIT_DIR &&
	 git config core.worktree "$PWD/child" &&
	 git read-tree -i -m base ten two &&
	 git merge-index git-merge-one-file -a &&
	 git cat-file blob :file >file-index
	) &&
	test_cmp expect-merged subdir/child/file &&
	test_cmp expect-merged subdir/file-index

Cloning into 'subdir/child'...
HEAD is now at 5369cc1 Add sub1
done.
error: refusing to lose untracked file at 'sub1/file2'
error: refusing to lose untracked file at 'sub1/file1'
Merging:
041e421 Add sub1
virtual 48ceb4d11475d9d8e6ea470ec7cd34a659f5afca
found 1 common ancestor:
041e421 Add sub1
Adding sub1/file3
Adding sub1/file2
Adding sub1/file1
Removing sub1
Merge made by the 'recursive' strategy.
 .gitmodules | 4 ----
 sub1/file1  | 1 +
 sub1/file2  | 1 +
 sub1/file3  | 1 +
 4 files changed, 3 insertions(+), 4 deletions(-)
 create mode 100644 sub1/file1
 create mode 100644 sub1/file2
 create mode 100644 sub1/file3
test_must_fail: command succeeded: git_pull_noff replace_sub1_with_directory
not ok 51 - git_pull_noff: 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
		)
	
Auto-merging file
Cloning into 'submodule_update'...
ok 7 - merge-one-file respects core.worktree

Bisecting: a merge base must be tested
ok 37 - optimized merge base checks

expecting success: 
	git bisect reset &&
	git checkout -b parallel $HASH1 &&
	mkdir dir1 dir2 &&
	add_line_into_file "1(para): line 1 on parallel branch" dir1/file1 &&
	PARA_HASH1=$(git rev-parse --verify HEAD) &&
	add_line_into_file "2(para): line 2 on parallel branch" dir2/file2 &&
	PARA_HASH2=$(git rev-parse --verify HEAD) &&
	add_line_into_file "3(para): line 3 on parallel branch" dir2/file3 &&
	PARA_HASH3=$(git rev-parse --verify HEAD) &&
	git merge -m "merge HASH4 and PARA_HASH3" "$HASH4" &&
	PARA_HASH4=$(git rev-parse --verify HEAD) &&
	add_line_into_file "5(para): add line on parallel branch" dir1/file1 &&
	PARA_HASH5=$(git rev-parse --verify HEAD) &&
	add_line_into_file "6(para): add line on parallel branch" dir2/file2 &&
	PARA_HASH6=$(git rev-parse --verify HEAD) &&
	git merge -m "merge HASH7 and PARA_HASH6" "$HASH7" &&
	PARA_HASH7=$(git rev-parse --verify HEAD)

# passed all 7 test(s)
1..7
done.
*** t6101-rev-parse-parents.sh ***
Previous HEAD position was 3082e11... Add <5: Another new line.> into <hello>.
Switched to branch 'side'
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6101-rev-parse-parents/.git/
expecting success: 
	test_commit start &&
	test_commit second &&
	git checkout --orphan tmp &&
	test_commit start2 &&
	git checkout master &&
	git merge -m next start2 &&
	test_commit final &&

	test_seq 40 |
	while read i
	do
		git checkout --orphan "b$i" &&
		test_tick &&
		git commit --allow-empty -m "$i" &&
		commit=$(git rev-parse --verify HEAD) &&
		printf "$commit " >>.git/info/grafts
	done

Switched to a new branch 'parallel'
[master (root-commit) bb4ab09] start
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 start.t
[master 79e4276] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 second.t
Switched to a new branch 'tmp'
[tmp (root-commit) 4c3ba1d] start2
 Author: A U Thor <author@example.com>
 3 files changed, 3 insertions(+)
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
Switched to branch 'master'
Merging:
79e4276 second
virtual start2
found 0 common ancestors:
Merge made by the 'recursive' strategy.
 start2.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 start2.t
Merging:
a5a4dc8 Create file <dir2/file3> with <3(para): line 3 on parallel branch> inside.
virtual 32a594a3fdac2d57cf6d02987e30eec68511498c
found 1 common ancestor:
88bcdc1 Create file <hello> with <1: Hello World> inside.
Merge made by the 'recursive' strategy.
 hello | 3 +++
 1 file changed, 3 insertions(+)
[master 28dcd76] final
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 final.t
Cloning into 'sub1'...
Switched to a new branch 'b1'
[b1 (root-commit) f5f3b2c] 1
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Bisecting: 0 revisions left to test after this (roughly 0 steps)
done.
Switched to a new branch 'b2'
warning: unable to rmdir sub1: Directory not empty
Merging:
6d284ea Add <6(para): add line on parallel branch> into <dir2/file2>.
virtual 3659270ffa1e67547111a107f53191676dff3424
found 1 common ancestor:
32a594a Add <4: Ciao for now> into <hello>.
Merge made by the 'recursive' strategy.
[9106dfb81d8e80d3d7f757ead2eb469b6ff8bdb1] Revert "Add sub1"
[b2 (root-commit) 618c8bc] 2
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
 hello | 3 +++
 1 file changed, 3 insertions(+)
ok 38 - "parallel" side branch creation

expecting success: 
	git bisect reset &&
	git bisect start HEAD $HASH1 -- dir1 &&
	para1=$(git rev-parse --verify HEAD) &&
	test "$para1" = "$PARA_HASH1" &&
	git bisect bad > my_bisect_log.txt &&
	grep "$PARA_HASH1 is the first bad commit" my_bisect_log.txt

Switched to a new branch 'b3'
[b3 (root-commit) ba8105e] 3
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Switched to a new branch 'b4'
We are not bisecting.
[b4 (root-commit) 8edc64f] 4
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
Switched to a new branch 'b5'
[b5 (root-commit) e7bafe0] 5
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
ok 7 - git_bisect: 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
		)
	
Switched to a new branch 'b6'
[b6 (root-commit) 2c11482] 6
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
Deleted branch replace_sub1_with_file (was 88f15cf).
Switched to a new branch 'b7'
[b7 (root-commit) b7111a8] 7
Switched to a new branch 'replace_sub1_with_file'
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
Switched to a new branch 'b8'
[b8 (root-commit) edde8dd] 8
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Switched to a new branch 'b9'
Cloning into 'submodule_update'...
[b9 (root-commit) 78609ce] 9
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Bisecting: 0 revisions left to test after this (roughly 0 steps)
done.
Switched to a new branch 'b10'
Merging:
041e421 Add sub1
virtual 88f15cf0afe2d3ceabf91c70179a06fe46326b3b
found 1 common ancestor:
041e421 Add sub1
Merge made by the 'recursive' strategy.
 .gitmodules | 4 ----
 sub1        | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
test_must_fail: command succeeded: git_pull_noff replace_sub1_with_file
[de049b9c4e10f2524a46e151b65aa4f156fd52d6] Create file <dir1/file1> with <1(para): line 1 on parallel branch> inside.
[b10 (root-commit) 1b26416] 10
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
not ok 52 - git_pull_noff: 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
		)
	
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Switched to a new branch 'b11'
[b11 (root-commit) 85f564d] 11
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Switched to a new branch 'b12'
[b12 (root-commit) e798eda] 12
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Switched to a new branch 'b13'
Cloning into 'submodule_update'...
[b13 (root-commit) 9cc2d0a] 13
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
done.
Switched to a new branch 'b14'
de049b9c4e10f2524a46e151b65aa4f156fd52d6 is the first bad commit
ok 39 - restricting bisection on one dir

expecting success: 
	git bisect reset &&
	git bisect start HEAD $HASH1 -- dir1 hello &&
	para4=$(git rev-parse --verify HEAD) &&
	test "$para4" = "$PARA_HASH4" &&
	git bisect bad &&
	hash3=$(git rev-parse --verify HEAD) &&
	test "$hash3" = "$HASH3" &&
	git bisect good &&
	hash4=$(git rev-parse --verify HEAD) &&
	test "$hash4" = "$HASH4" &&
	git bisect good &&
	para1=$(git rev-parse --verify HEAD) &&
	test "$para1" = "$PARA_HASH1" &&
	git bisect good > my_bisect_log.txt &&
	grep "$PARA_HASH4 is the first bad commit" my_bisect_log.txt

[b14 (root-commit) 19a1614] 14
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Switched to a new branch 'b15'
[b15 (root-commit) 9b6308c] 15
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t6041-bisect-submodule/submodule_update_repo/.) registered for path 'sub1'
Switched to a new branch 'b16'
Previous HEAD position was de049b9... Create file <dir1/file1> with <1(para): line 1 on parallel branch> inside.
Switched to branch 'parallel'
[b16 (root-commit) 25d33a4] 16
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Switched to a new branch 'b17'
[b17 (root-commit) 0302283] 17
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Cloning into 'sub1'...
Switched to a new branch 'b18'
[b18 (root-commit) 4e1e05c] 18
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
done.
Switched to a new branch 'b19'
[b19 (root-commit) 3d9cf61] 19
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
Switched to a new branch 'b20'
[b20 (root-commit) 99e88bd] 20
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Switched to a new branch 'b21'
Submodule path 'sub1': checked out '7e9f79116e21ad6a3ac18868cba45094b8cda241'
[b21 (root-commit) 2806eea] 21
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Switched to a new branch 'b22'
Cloning into 'sub1'...
Bisecting: 4 revisions left to test after this (roughly 2 steps)
[b22 (root-commit) a13e487] 22
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
[3f04efc661812c541a2f96ecaae46a79c6ea2464] merge HASH4 and PARA_HASH3
Switched to a new branch 'b23'
done.
[b23 (root-commit) b3430b4] 23
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Switched to a new branch 'b24'
error: The following untracked working tree files would be overwritten by checkout:
	sub1/file1
	sub1/file2
Please move or remove them before you can switch branches.
Aborting
[b24 (root-commit) b41c7be] 24
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Switched to a new branch 'b25'
[b25 (root-commit) b40f716] 25
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Switched to a new branch 'b26'
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
Bisecting: 2 revisions left to test after this (roughly 1 step)
ok 8 - git_bisect: 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
		)
	
[b26 (root-commit) f9b45eb] 26
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
[3de952f2416b6084f557ec417709eac740c6818c] Add <3: Another new day for git> into <hello>.
Switched to a new branch 'b27'
[b27 (root-commit) ecd01c9] 27
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
Switched to a new branch 'b28'
[b28 (root-commit) 3d5358c] 28
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Cloning into 'submodule_update'...
Switched to a new branch 'b29'
[b29 (root-commit) c334e99] 29
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
done.
Deleted branch replace_sub1_with_file (was 88f15cf).
Switched to a new branch 'b30'
Switched to a new branch 'replace_sub1_with_file'
Bisecting: 1 revision left to test after this (roughly 1 step)
[b30 (root-commit) ae87771] 30
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
[32a594a3fdac2d57cf6d02987e30eec68511498c] Add <4: Ciao for now> into <hello>.
Switched to a new branch 'b31'
[b31 (root-commit) 4a37771] 31
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Switched to a new branch 'b32'
[b32 (root-commit) 7be2dd6] 32
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Switched to a new branch 'b33'
Merging:
041e421 Add sub1
virtual 88f15cf0afe2d3ceabf91c70179a06fe46326b3b
found 1 common ancestor:
041e421 Add sub1
Merge made by the 'recursive' strategy.
 .gitmodules | 4 ----
 sub1        | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
test_must_fail: command succeeded: git_pull_noff replace_sub1_with_file
[b33 (root-commit) dcbfd2a] 33
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Bisecting: 0 revisions left to test after this (roughly 0 steps)
not ok 53 - git_pull_noff: 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
		)
	
Switched to a new branch 'b34'
[de049b9c4e10f2524a46e151b65aa4f156fd52d6] Create file <dir1/file1> with <1(para): line 1 on parallel branch> inside.
[b34 (root-commit) 7b802c2] 34
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Switched to a new branch 'b35'
[b35 (root-commit) 507bd75] 35
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t6041-bisect-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'submodule_update'...
Switched to a new branch 'b36'
[b36 (root-commit) 5ded625] 36
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
done.
Switched to a new branch 'b37'
[b37 (root-commit) 8c1e87b] 37
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
3f04efc661812c541a2f96ecaae46a79c6ea2464 is the first bad commit
Switched to a new branch 'b38'
ok 40 - restricting bisection on one dir and a file

expecting success: 
	git bisect start $PARA_HASH7 $HASH1 &&
	para4=$(git rev-parse --verify HEAD) &&
	test "$para4" = "$PARA_HASH4" &&
        git bisect skip &&
	hash7=$(git rev-parse --verify HEAD) &&
	test "$hash7" = "$HASH7" &&
        git bisect skip &&
	para3=$(git rev-parse --verify HEAD) &&
	test "$para3" = "$PARA_HASH3"

Cloning into 'sub1'...
[b38 (root-commit) c52a118] 38
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Switched to a new branch 'b39'
done.
[b39 (root-commit) aeb1d68] 39
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
Switched to a new branch 'b40'
[b40 (root-commit) 44fb50a] 40
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 final.t
 create mode 100644 second.t
 create mode 100644 start.t
 create mode 100644 start2.t
ok 1 - setup

expecting success: 
	git rev-parse start | grep "^[0-9a-f]\{40\}$"

Previous HEAD position was de049b9... Create file <dir1/file1> with <1(para): line 1 on parallel branch> inside.
Switched to branch 'parallel'
bb4ab095e062556a5dc9dbf86833ee9040f06e90
ok 2 - start is valid

expecting success: 
	test_cmp_rev_output tags/start "git rev-parse start^0"

ok 3 - start^0

expecting success: 
	test_must_fail git rev-parse --verify start^1

Submodule path 'sub1': checked out '7e9f79116e21ad6a3ac18868cba45094b8cda241'
fatal: Needed a single revision
ok 4 - start^1 not valid

expecting success: 
	test_cmp_rev_output second^ "git rev-parse second^1"

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 5 - second^1 = second^

expecting success: 
	test_cmp_rev_output start "git rev-parse final^1^1^1"

Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
ok 6 - final^1^1^1

expecting success: 
	test_cmp_rev_output final^^^ "git rev-parse final^1^1^1"

ok 7 - final^1^1^1 = final^^^

expecting success: 
	test_cmp_rev_output start2 "git rev-parse final^1^2"

ok 8 - final^1^2

expecting success: 
	test $(git rev-parse final^1^2) != $(git rev-parse final^1^1)

Bisecting: 5 revisions left to test after this (roughly 3 steps)
Cloning into 'sub1'...
ok 9 - final^1^2 != final^1^1

expecting success: 
	test_must_fail git rev-parse --verify final^1^3

[3f04efc661812c541a2f96ecaae46a79c6ea2464] merge HASH4 and PARA_HASH3
fatal: Needed a single revision
ok 10 - final^1^3 not valid

expecting success: 
	test_must_fail git rev-parse --verify start2^1

done.
fatal: Needed a single revision
ok 11 - --verify start2^1

expecting success: 
	git rev-parse --verify start2^0

error: The following untracked working tree files would be overwritten by checkout:
	sub1/file1
	sub1/file2
4c3ba1d81bd3bb3afbb826285419970794dbc343
Please move or remove them before you can switch branches.
Aborting
ok 12 - --verify start2^0

expecting success: 
	git rev-parse final^1^1 final^1^2 >expect &&
	git rev-parse final^1^@ >actual &&
	test_cmp expect actual

ok 13 - final^1^@ = final^1^1 final^1^2

expecting success: 
	git rev-parse final^1 ^final^1^1 ^final^1^2 >expect &&
	git rev-parse final^1^! >actual &&
	test_cmp expect actual

ok 14 - final^1^! = final^1 ^final^1^1 ^final^1^2

expecting success: 
	test_cmp_rev_output b31 "git rev-parse --verify b1^30"

ok 15 - large graft octopus

expecting success: 
	git repack -a -d

Bisecting: 6 revisions left to test after this (roughly 3 steps)
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
[3659270ffa1e67547111a107f53191676dff3424] Add <7: Should be the last line.> into <hello>.
ok 9 - git_bisect: 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
		)
	
Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
Deleted branch modify_sub1 (was 85dfe6e).
Switched to a new branch 'modify_sub1'
Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
Bisecting: 6 revisions left to test after this (roughly 3 steps)
[a5a4dc83955e310a4f693ab6f6bcea46c8544843] Create file <dir2/file3> with <3(para): line 3 on parallel branch> inside.
Cloning into 'submodule_update'...
ok 41 - skipping away from skipped commit

expecting success: 
	test_must_fail git bisect start $PARA_HASH7 $HASH1 -- foobar 2> error.txt &&
	grep "bad path parameters" error.txt

ok 16 - repack for next test

expecting success: 
	start=$(git rev-parse --verify start) &&
	test_cmp_rev_output start "git rev-parse ${start%?}"

done.
Merging:
041e421 Add sub1
virtual 85dfe6e8a41ab3f8c1a0b533cb1dd3f5c08d66f7
found 1 common ancestor:
041e421 Add sub1
Merge made by the 'recursive' strategy.
ok 17 - short SHA-1 works

# passed all 17 test(s)
1..17
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
*** t6110-rev-list-sparse.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6110-rev-list-sparse/.git/
expecting success: 
	test_commit A &&
	test_commit B &&
	test_commit C &&
	git checkout -b side HEAD^ &&
	test_commit D &&
	test_commit E &&
	git merge master

[master (root-commit) 0ddfaf1] A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 A.t
[master d9df450] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 B.t
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t6041-bisect-submodule/submodule_update_repo/.) registered for path 'sub1'
[master 35a8500] C
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 C.t
Switched to a new branch 'side'
Submodule path 'sub1': checked out 'eedcaeb9ebca3d956845c627772d7a68b8eec63e'
Maybe you started with bad path parameters?
ok 42 - erroring out when using bad path parameters

expecting success: 
	git clone --bare . bare.nocheckout &&
	(
		cd bare.nocheckout &&
		git bisect start --no-checkout &&
		git bisect good $HASH1 &&
		git bisect bad $HASH4 &&
		git bisect run eval \
			"test \$(git rev-list BISECT_HEAD ^$HASH2 --max-count=1 | wc -l) = 0" \
			>../nocheckout.log
	) &&
	grep "$HASH3 is the first bad commit" nocheckout.log

Cloning into bare repository 'bare.nocheckout'...
[side 3e6e33e] D
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 D.t
Cloning into 'sub1'...
[side dc25130] E
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 E.t
ok 54 - git_pull_noff: 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
done.
		)
	
done.
Merging:
dc25130 E
virtual master
found 1 common ancestor:
d9df450 B
Merge made by the 'recursive' strategy.
 C.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 C.t
ok 1 - setup

expecting success: 
	git rev-list --first-parent --boundary HEAD^..

2d82c395bc1ef4846e3c35512cb70c2abc5cdab1
-35a8500a6c116c9ddf35e140fa3277a7fe0b4196
-dc25130fe5e9f5d4a18aa4e0dff022e489b22c75
ok 2 - rev-list --first-parent --boundary

# passed all 2 test(s)
1..2
Cloning into 'submodule_update'...
*** t6111-rev-list-treesame.sh ***
Submodule path 'sub1': checked out '7e9f79116e21ad6a3ac18868cba45094b8cda241'
done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6111-rev-list-treesame/.git/
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
expecting success: 
	test_commit "Initial file" file "Hi there" A &&
	git branch other-branch &&

	test_commit "file=Hello" file "Hello" B &&
	git branch third-branch &&

	git checkout other-branch &&
	test_commit "Added other" other "Hello" C &&

	git checkout master &&
	test_merge D other-branch &&

	git checkout third-branch &&
	test_commit "Third file" third "Nothing" E &&

	git checkout master &&
	test_commit "file=Blah" file "Blah" F &&

	test_tick && git merge --no-commit third-branch &&
	git checkout third-branch file &&
	git commit &&
	note G &&
	git branch fiddler-branch &&

	git checkout -b part2-branch &&
	test_commit "file=Part 2" file "Part 2" H &&

	git checkout fiddler-branch &&
	test_commit "Bad commit" file "Silly" I &&

	test_tick && git revert I && note J &&

	git checkout master &&
	test_tick && git merge --no-ff fiddler-branch &&
	note K &&

	test_commit "file=Part 1" file "Part 1" L &&

	test_tick && test_must_fail git merge part2-branch &&
	test_commit M file "Parts 1+2"

Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
[master (root-commit) bbceb0a] Initial file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
Switched to branch 'replace_sub1_with_file'
Your branch is up-to-date with 'origin/replace_sub1_with_file'.
[master 8d757e8] file=Hello
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[replace_sub1_with_file b927438] bisect bad
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bar
HEAD is now at 5369cc1 Add sub1
Switched to branch 'other-branch'
Bisecting: 0 revisions left to test after this (roughly 1 step)
[other-branch 519d746] Added other
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 other
[3de952f2416b6084f557ec417709eac740c6818c] Add <3: Another new day for git> into <hello>.
Switched to branch 'master'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
Merging:
8d757e8 file=Hello
virtual other-branch
found 1 common ancestor:
bbceb0a Initial file
Merge made by the 'recursive' strategy.
 other | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 other
Switched to branch 'third-branch'
[third-branch 1c8927c] Third file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 third
Cloning into 'sub1'...
Switched to branch 'master'
done.
[master 961a4fd] file=Blah
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Automatic merge went well; stopped before committing as requested
Merging:
961a4fd file=Blah
virtual third-branch
found 1 common ancestor:
8d757e8 file=Hello
Submodule path 'sub1': checked out '7e9f79116e21ad6a3ac18868cba45094b8cda241'
[master 9f6f8b0] Merge branch 'third-branch'
 Author: A U Thor <author@example.com>
Switched to a new branch 'part2-branch'
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
[part2-branch 0977201] file=Part 2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
3de952f2416b6084f557ec417709eac740c6818c is the first bad commit
ok 43 - test bisection on bare repo - --no-checkout specified

expecting success: 
	git clone --bare . bare.defaulted &&
	(
		cd bare.defaulted &&
		git bisect start &&
		git bisect good $HASH1 &&
		git bisect bad $HASH4 &&
		git bisect run eval \
			"test \$(git rev-list BISECT_HEAD ^$HASH2 --max-count=1 | wc -l) = 0" \
			>../defaulted.log
	) &&
	grep "$HASH3 is the first bad commit" defaulted.log

Cloning into bare repository 'bare.defaulted'...
Switched to branch 'fiddler-branch'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
done.
[fiddler-branch 882208b] Bad commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Deleted branch invalid_sub1 (was e730a90).
Switched to a new branch 'invalid_sub1'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
[fiddler-branch cc48266] Revert "Bad commit"
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to branch 'master'
Merging:
9f6f8b0 Merge branch 'third-branch'
virtual fiddler-branch
found 1 common ancestor:
9f6f8b0 Merge branch 'third-branch'
Already up-to-date!
Merge made by the 'recursive' strategy.
Merging:
041e421 Add sub1
virtual e730a90da0e4bd9b39ff6610930a7380f2134a22
found 1 common ancestor:
041e421 Add sub1
Merge made by the 'recursive' strategy.
[master 8e014b3] file=Part 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Merging:
8e014b3 file=Part 1
virtual part2-branch
found 1 common ancestor:
9f6f8b0 Merge branch 'third-branch'
Auto-merging file
CONFLICT (content): Merge conflict in file
Automatic merge failed; fix conflicts and then commit the result.
[master 11de2ca] M
 Author: A U Thor <author@example.com>
ok 1 - setup

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
Bisecting: 0 revisions left to test after this (roughly 0 steps)
ok 2 - log 

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
[b876fd12754d01a743ecab48ff5c5c0d138c46a8] Replace sub1 with file
test_must_fail: command succeeded: git_bisect replace_sub1_with_file
ok 3 - log 

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
not ok 10 - git_bisect: 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 4 - log --topo-order

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
ok 5 - log -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
Bisecting: 0 revisions left to test after this (roughly 1 step)
[3de952f2416b6084f557ec417709eac740c6818c] Add <3: Another new day for git> into <hello>.
ok 6 - log --parents -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
Cloning into 'submodule_update'...
ok 7 - log --full-history -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
done.
ok 8 - log --full-history --parents -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
Switched to a new branch 'add_sub1'
fatal: reference is not a tree: 0123456789012345678901234567890123456789
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Unable to checkout '0123456789012345678901234567890123456789' in submodule path 'sub1'
ok 9 - log --simplify-merges -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
ok 10 - log --first-parent

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
ok 55 - git_pull_noff: 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
		)
	
ok 11 - log --first-parent -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
ok 12 - log F..M

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
ok 13 - log F..M --topo-order

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
Cloning into 'submodule_update'...
ok 14 - log F..M -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
done.
ok 15 - log --parents F..M -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t6041-bisect-submodule/submodule_update_repo/.) registered for path 'sub1'
3de952f2416b6084f557ec417709eac740c6818c is the first bad commit
ok 44 - test bisection on bare repo - --no-checkout defaulted

expecting success: 
	git bisect reset &&
	git checkout -b broken $HASH4 &&
	git tag BROKEN_HASH4 $HASH4 &&
	add_line_into_file "5(broken): first line on a broken branch" hello2 &&
	git tag BROKEN_HASH5 &&
	mkdir missing &&
	:> missing/MISSING &&
	git add missing/MISSING &&
	git commit -m "6(broken): Added file that will be deleted" &&
	git tag BROKEN_HASH6 &&
	add_line_into_file "7(broken): second line on a broken branch" hello2 &&
	git tag BROKEN_HASH7 &&
	add_line_into_file "8(broken): third line on a broken branch" hello2 &&
	git tag BROKEN_HASH8 &&
	git rm missing/MISSING &&
	git commit -m "9(broken): Remove missing file" &&
	git tag BROKEN_HASH9 &&
	rm .git/objects/39/f7e61a724187ab767d2e08442d9b6b9dab587d

Switched to a new branch 'invalid_sub1'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
ok 16 - log F..M --full-history -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
fatal: Needed a single revision
ok 17 - log F..M --full-history --parents -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
We are not bisecting.
Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
Deleted branch valid_sub1 (was 1ca87d6).
Switched to a new branch 'broken'
ok 18 - log F..M --simplify-merges -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
Switched to a new branch 'valid_sub1'
Cloning into 'sub1'...
Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
ok 19 - log F..M --ancestry-path

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
done.
ok 20 - log F..M --ancestry-path -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
[broken 55bdac5] 6(broken): Added file that will be deleted
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 missing/MISSING
ok 21 - log F..M --ancestry-path --parents -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
ok 22 - log F..M --ancestry-path --simplify-merges -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
Merging:
e730a90 Invalid sub1 commit
virtual 1ca87d62f6efdbecc69d78b85ae24b10c4361884
found 1 common ancestor:
e730a90 Invalid sub1 commit
Merge made by the 'recursive' strategy.
ok 23 - log F..M --first-parent

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
Submodule path 'sub1': checked out '7e9f79116e21ad6a3ac18868cba45094b8cda241'
rm 'missing/MISSING'
ok 24 - log F..M --first-parent -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
[broken 508db08] 9(broken): Remove missing file
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 delete mode 100644 missing/MISSING
ok 45 - broken branch creation

ok 25 - log E..M --ancestry-path

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
expecting success: 
	git bisect reset &&
	test_must_fail git bisect start BROKEN_HASH7 BROKEN_HASH4 2>error.txt &&
	test_cmp expected.missing-tree.default error.txt

Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
ok 26 - log E..M --ancestry-path -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
ok 27 - log E..M --ancestry-path --parents -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
We are not bisecting.
ok 28 - log E..M --ancestry-path --simplify-merges -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
ok 29 - log G..M

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t5572-pull-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 30 - log G..M --topo-order

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
Switched to branch 'replace_sub1_with_file'
Your branch is up-to-date with 'origin/replace_sub1_with_file'.
ok 31 - log G..M -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
[replace_sub1_with_file 859f211] bisect bad
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bar
ok 32 - log G..M --parents -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
Cloning into 'sub1'...
HEAD is now at 5369cc1 Add sub1
ok 33 - log G..M --full-history -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
done.
ok 34 - log G..M --full-history --parents -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
Bisecting: 0 revisions left to test after this (roughly 1 step)
ok 35 - log G..M --simplify-merges -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
ok 36 - log G..M --ancestry-path

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
ok 46 - bisect fails if tree is broken on start commit

expecting success: 
	git bisect reset &&
	test_must_fail git bisect start BROKEN_HASH9 BROKEN_HASH4 2>error.txt &&
	git reset --hard broken &&
	git checkout broken &&
	test_cmp expected.missing-tree.default error.txt

ok 37 - log G..M --ancestry-path -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
Submodule path 'sub1': checked out 'aca6d607c65a823c5a3e31c6fbb71430086504f4'
ok 38 - log G..M --ancestry-path --parents -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
We are not bisecting.
ok 39 - log G..M --ancestry-path --simplify-merges -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
ok 40 - log B..F

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
Submodule path 'sub1': checked out '7e9f79116e21ad6a3ac18868cba45094b8cda241'
ok 41 - log B..F -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
ok 56 - git_pull_noff: modified submodule does not update submodule work tree from invalid commit

# still have 11 known breakage(s)
# passed all remaining 45 test(s)
1..56
ok 42 - log B..F --parents -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
ok 43 - log B..F --full-history -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
ok 44 - log B..F --full-history --parents -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
Bisecting: 2 revisions left to test after this (roughly 1 step)
ok 45 - log B..F --simplify-merges -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
*** t6120-describe.sh ***
ok 46 - log B..F --ancestry-path

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
ok 47 - log B..F --ancestry-path -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6120-describe/.git/
HEAD is now at 508db08 9(broken): Remove missing file
ok 48 - log B..F --ancestry-path --parents -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
expecting success: 

	test_tick &&
	echo one >file && git add file && git commit -m initial &&
	one=$(git rev-parse HEAD) &&

	git describe --always HEAD &&

	test_tick &&
	echo two >file && git add file && git commit -m second &&
	two=$(git rev-parse HEAD) &&

	test_tick &&
	echo three >file && git add file && git commit -m third &&

	test_tick &&
	echo A >file && git add file && git commit -m A &&
	test_tick &&
	git tag -a -m A A &&

	test_tick &&
	echo c >file && git add file && git commit -m c &&
	test_tick &&
	git tag c &&

	git reset --hard $two &&
	test_tick &&
	echo B >side && git add side && git commit -m B &&
	test_tick &&
	git tag -a -m B B &&

	test_tick &&
	git merge -m Merged c &&
	merged=$(git rev-parse HEAD) &&

	git reset --hard $two &&
	test_tick &&
	echo D >another && git add another && git commit -m D &&
	test_tick &&
	git tag -a -m D D &&
	test_tick &&
	git tag -a -m R R &&

	test_tick &&
	echo DD >another && git commit -a -m another &&

	test_tick &&
	git tag e &&

	test_tick &&
	echo DDD >another && git commit -a -m "yet another" &&

	test_tick &&
	git merge -m Merged $merged &&

	test_tick &&
	echo X >file && echo X >side && git add file side &&
	git commit -m x


Already on 'broken'
ok 47 - bisect fails if tree is broken on trial commit

expecting success: 
	git bisect reset &&
	git bisect start BROKEN_HASH7 BROKEN_HASH4 --no-checkout &&
	check_same BROKEN_HASH6 BISECT_HEAD &&
	git bisect reset

ok 49 - log B..F --ancestry-path --simplify-merges -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
[master (root-commit) 50b0198] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 50 - log B..F --first-parent

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
50b0198
We are not bisecting.
ok 51 - log B..F --first-parent -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
[master 612fe8f] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 52 - log E F ^B -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
[master c48449d] third
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 53 - log E...F -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
ok 54 - log C..F

[master 4185ee1] A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
Bisecting: 0 revisions left to test after this (roughly 0 steps)
ok 55 - log C..F -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
[master 2ad5867] c
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 56 - log C..F --parents -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
[b876fd12754d01a743ecab48ff5c5c0d138c46a8] Replace sub1 with file
test_must_fail: command succeeded: git_bisect replace_sub1_with_file
HEAD is now at 612fe8f second
ok 57 - log C..F --full-history -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
not ok 11 - git_bisect: 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
		)
	
[master 3acd34f] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 side
ok 58 - log C..F --full-history --parents -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
Bisecting: 0 revisions left to test after this (roughly 1 step)
[55bdac58da30a5a429094bf5466b8095b29ecbf0] 6(broken): Added file that will be deleted
Checking BROKEN_HASH6 is the same as BISECT_HEAD
Merging:
3acd34f B
virtual c
found 1 common ancestor:
612fe8f second
Merge made by the 'recursive' strategy.
ok 59 - log C..F --simplify-merges -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 60 - log C..F --ancestry-path

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
HEAD is now at 612fe8f second
Cloning into 'submodule_update'...
ok 61 - log C..F --ancestry-path -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
[master 84aba8f] D
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 another
done.
ok 62 - log C..F --ancestry-path --parents -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 48 - bisect: --no-checkout - start commit bad

expecting success: 
	git bisect reset &&
	git bisect start broken BROKEN_HASH4 --no-checkout &&
	check_same BROKEN_HASH6 BISECT_HEAD &&
	git bisect reset

[master f459448] another
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 63 - log C..F --ancestry-path --simplify-merges -- file

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
[master a4198f8] yet another
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 64 - log C..F --first-parent

expecting success: 
		git log --format="$FMT" $param |
		unnote >actual &&
		sed -e "$munge_actual" <actual >check &&
		test_cmp expect check
	
We are not bisecting.
Merging:
a4198f8 yet another
virtual 7cac7e2f60e76f6f6a9eaf950c5e927f3115672f
found 1 common ancestor:
612fe8f second
Merge made by the 'recursive' strategy.
 file | 2 +-
 side | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 side
ok 65 - log C..F --first-parent -- file

# passed all 65 test(s)
1..65
[master a3aae96] x
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 2 deletions(-)
ok 1 - setup

expecting success: 
	test $S = 0 &&
	case "$R" in
	$expect)	echo happy ;;
	*)	echo "Oops - $R is not $expect";
		false ;;
	esac
	
happy
ok 2 - describe HEAD

*** t6130-pathspec-noglob.sh ***
expecting success: 
	test $S = 0 &&
	case "$R" in
	$expect)	echo happy ;;
	*)	echo "Oops - $R is not $expect";
		false ;;
	esac
	
happy
ok 3 - describe HEAD^

expecting success: 
	test $S = 0 &&
	case "$R" in
	$expect)	echo happy ;;
	*)	echo "Oops - $R is not $expect";
		false ;;
	esac
	
happy
ok 4 - describe HEAD^^

expecting success: 
	test $S = 0 &&
	case "$R" in
	$expect)	echo happy ;;
	*)	echo "Oops - $R is not $expect";
		false ;;
	esac
	
happy
ok 5 - describe HEAD^^2

expecting success: 
	test $S = 0 &&
	case "$R" in
	$expect)	echo happy ;;
	*)	echo "Oops - $R is not $expect";
		false ;;
	esac
	
happy
ok 6 - describe HEAD^^2^

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6130-pathspec-noglob/.git/
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t6041-bisect-submodule/submodule_update_repo/.) registered for path 'sub1'
expecting success: 
	test $S = 0 &&
	case "$R" in
	$expect)	echo happy ;;
	*)	echo "Oops - $R is not $expect";
		false ;;
	esac
	
expecting success: 
	test_commit unrelated bar &&
	test_commit vanilla foo &&
	# insert file "f*" in the commit, but in a way that avoids
	# the name "f*" in the worktree, because it is not allowed
	# on Windows (the tests below do not depend on the presence
	# of the file in the worktree)
	git update-index --add --cacheinfo 100644 "$(git rev-parse HEAD:foo)" "f*" &&
	test_tick &&
	git commit -m star &&
	test_commit bracket "f[o][o]"

happy
ok 7 - describe HEAD^^^

expecting success: 
	test $S = 0 &&
	case "$R" in
	$expect)	echo happy ;;
	*)	echo "Oops - $R is not $expect";
		false ;;
	esac
	
happy
ok 8 - describe --tags HEAD

expecting success: 
	test $S = 0 &&
	case "$R" in
	$expect)	echo happy ;;
	*)	echo "Oops - $R is not $expect";
		false ;;
	esac
	
happy
ok 9 - describe --tags HEAD^

[master (root-commit) f600089] unrelated
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bar
expecting success: 
	test $S = 0 &&
	case "$R" in
	$expect)	echo happy ;;
	*)	echo "Oops - $R is not $expect";
		false ;;
	esac
	
happy
ok 10 - describe --tags HEAD^^

Bisecting: 2 revisions left to test after this (roughly 1 step)
expecting success: 
	test $S = 0 &&
	case "$R" in
	$expect)	echo happy ;;
	*)	echo "Oops - $R is not $expect";
		false ;;
	esac
	
happy
ok 11 - describe --tags HEAD^^2

[55bdac58da30a5a429094bf5466b8095b29ecbf0] 6(broken): Added file that will be deleted
Checking BROKEN_HASH6 is the same as BISECT_HEAD
[master 065b8fa] vanilla
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
expecting success: 
	test $S = 0 &&
	case "$R" in
	$expect)	echo happy ;;
	*)	echo "Oops - $R is not $expect";
		false ;;
	esac
	
happy
ok 12 - describe --tags HEAD^^2^

Cloning into 'sub1'...
expecting success: 
	test $S = 0 &&
	case "$R" in
	$expect)	echo happy ;;
	*)	echo "Oops - $R is not $expect";
		false ;;
	esac
	
happy
ok 13 - describe --tags HEAD^^^

expecting success: 
	test $S = 0 &&
	case "$R" in
	$expect)	echo happy ;;
	*)	echo "Oops - $R is not $expect";
		false ;;
	esac
	
happy
ok 14 - describe --all HEAD

[master 306e39a] star
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 f*
done.
expecting success: 
	test $S = 0 &&
	case "$R" in
	$expect)	echo happy ;;
	*)	echo "Oops - $R is not $expect";
		false ;;
	esac
	
happy
ok 15 - describe --all HEAD^

expecting success: 
	test $S = 0 &&
	case "$R" in
	$expect)	echo happy ;;
	*)	echo "Oops - $R is not $expect";
		false ;;
	esac
	
happy
ok 16 - describe --all HEAD^^^

[master 48b9afb] bracket
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 f[o][o]
expecting success: 
	test $S = 0 &&
	case "$R" in
	$expect)	echo happy ;;
	*)	echo "Oops - $R is not $expect";
		false ;;
	esac
	
happy
ok 17 - describe --long HEAD^^2^

ok 1 - create commits with glob characters

expecting success: 
	echo vanilla >expect &&
	git log --format=%s -- foo >actual &&
	test_cmp expect actual

expecting success: 
	test $S = 0 &&
	case "$R" in
	$expect)	echo happy ;;
	*)	echo "Oops - $R is not $expect";
		false ;;
	esac
	
happy
ok 18 - describe --long HEAD^^2

ok 2 - vanilla pathspec matches literally

expecting success: 
	cat >expect <<-\EOF &&
	bracket
	star
	vanilla
	EOF
	git log --format=%s -- "f*" >actual &&
	test_cmp expect actual

ok 49 - bisect: --no-checkout - trial commit bad

expecting success: 
	git bisect reset &&
	git bisect start broken BROKEN_HASH4 --no-checkout &&
	check_same BROKEN_HASH6 BISECT_HEAD &&
	git bisect bad BISECT_HEAD &&
	check_same BROKEN_HASH5 BISECT_HEAD &&
	git bisect bad BISECT_HEAD &&
	check_same BROKEN_HASH5 bisect/bad &&
	git bisect reset

expecting success: 
	test $S = 0 &&
	case "$R" in
	$expect)	echo happy ;;
	*)	echo "Oops - $R is not $expect";
		false ;;
	esac
	
happy
ok 19 - describe --tags

ok 3 - star pathspec globs

expecting success: 
	cat >expect <<-\EOF &&
	bracket
	star
	vanilla
	EOF
	git log --format=%s -- ":(glob)f*" >actual &&
	test_cmp expect actual

expecting success: 
	test $S = 0 &&
	case "$R" in
	$expect)	echo happy ;;
	*)	echo "Oops - $R is not $expect";
		false ;;
	esac
	
happy
ok 20 - describe --first-parent --tags

expecting success: 
	echo "A^0" >expect &&
	git checkout A &&
	test_when_finished "git checkout -" &&
	git describe --contains >actual &&
	test_cmp expect actual

ok 4 - star pathspec globs

expecting success: 
	cat >expect <<-\EOF &&
	bracket
	vanilla
	EOF
	git log --format=%s -- "f[o][o]" >actual &&
	test_cmp expect actual

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 4185ee1... A
We are not bisecting.
Submodule path 'sub1': checked out '7e9f79116e21ad6a3ac18868cba45094b8cda241'
ok 5 - bracket pathspec globs and matches literal brackets

expecting success: 
	cat >expect <<-\EOF &&
	bracket
	vanilla
	EOF
	git log --format=%s -- ":(glob)f[o][o]" >actual &&
	test_cmp expect actual

Previous HEAD position was 4185ee1... A
Switched to branch 'master'
ok 6 - bracket pathspec globs and matches literal brackets

expecting success: 
	echo vanilla >expect &&
	git --literal-pathspecs log --format=%s -- foo >actual &&
	test_cmp expect actual

ok 21 - describe --contains defaults to HEAD without commit-ish

expecting success: 
	test $S = 0 &&
	case "$R" in
	$expect)	echo happy ;;
	*)	echo "Oops - $R is not $expect";
		false ;;
	esac
	
ok 7 - no-glob option matches literally (vanilla)

happy
expecting success: 
	echo vanilla >expect &&
	git log --format=%s -- ":(literal)foo" >actual &&
	test_cmp expect actual

ok 22 - describe --all A^0

expecting success: 
	test_cmp err.expect err.actual

ok 23 - no warning was displayed for A

expecting success: 
	mv .git/refs/tags/A .git/refs/tags/Q

Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
ok 24 - rename tag A to Q locally

ok 8 - no-glob option matches literally (vanilla)

expecting success: 
	echo star >expect &&
	git --literal-pathspecs log --format=%s -- "f*" >actual &&
	test_cmp expect actual

warning: tag 'A' is really 'Q' here
expecting success: 
	test $S = 0 &&
	case "$R" in
	$expect)	echo happy ;;
	*)	echo "Oops - $R is not $expect";
		false ;;
	esac
	
ok 9 - no-glob option matches literally (star)

expecting success: 
	echo star >expect &&
	git log --format=%s -- ":(literal)f*" >actual &&
	test_cmp expect actual

happy
ok 25 - describe HEAD

expecting success: 
	test_i18ncmp err.expect err.actual

ok 26 - warning was displayed for Q

expecting success: 
	mv .git/refs/tags/Q .git/refs/tags/A

ok 27 - rename tag Q back to A

expecting success: git pack-refs
ok 10 - no-glob option matches literally (star)

expecting success: 
	echo bracket >expect &&
	git --literal-pathspecs log --format=%s -- "f[o][o]" >actual &&
	test_cmp expect actual

ok 28 - pack tag refs

Switched to branch 'modify_sub1'
Your branch is up-to-date with 'origin/modify_sub1'.
ok 11 - no-glob option matches literally (bracket)

expecting success: 
	echo bracket >expect &&
	git log --format=%s -- ":(literal)f[o][o]" >actual &&
	test_cmp expect actual

expecting success: 
	test $S = 0 &&
	case "$R" in
	$expect)	echo happy ;;
	*)	echo "Oops - $R is not $expect";
		false ;;
	esac
	
happy
ok 29 - describe HEAD

ok 12 - no-glob option matches literally (bracket)

expecting success: 
	: >expect &&
	git --literal-pathspecs log --format=%s -- ":(literal)foo" >actual &&
	test_cmp expect actual

expecting success: 
	test $S = 0 &&
	case "$R" in
	$expect)	echo happy ;;
	*)	echo "Oops - $R is not $expect";
		false ;;
	esac
	
happy
ok 30 - describe --dirty

expecting success: 
	echo >>file

ok 31 - set-up dirty work tree

ok 13 - no-glob option disables :(literal)

expecting success: 
	echo star >expect &&
	GIT_LITERAL_PATHSPECS=1 git log --format=%s -- "f*" >actual &&
	test_cmp expect actual

[modify_sub1 0bf8fe4] bisect bad
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bar
expecting success: 
	test $S = 0 &&
	case "$R" in
	$expect)	echo happy ;;
	*)	echo "Oops - $R is not $expect";
		false ;;
	esac
	
ok 14 - no-glob environment variable works

expecting success: 
	git --literal-pathspecs blame -- foo &&
	git --icase-pathspecs   blame -- foo &&
	git --glob-pathspecs    blame -- foo &&
	git --noglob-pathspecs  blame -- foo

happy
ok 32 - describe --dirty

065b8faf (A U Thor 2005-04-07 15:14:13 -0700 1) vanilla
HEAD is now at 5369cc1 Add sub1
expecting success: 
	test $S = 0 &&
	case "$R" in
	$expect)	echo happy ;;
	*)	echo "Oops - $R is not $expect";
		false ;;
	esac
	
happy
ok 33 - describe --dirty=.mod

expecting success: 
	test_must_fail git describe --dirty HEAD

065b8faf (A U Thor 2005-04-07 15:14:13 -0700 1) vanilla
fatal: --dirty is incompatible with commit-ishes
ok 34 - describe --dirty HEAD

expecting success: 
	git tag -a -m test-annotated test-annotated &&
	echo >>file &&
	test_tick &&
	git commit -a -m "one more" &&
	git tag test1-lightweight &&
	echo >>file &&
	test_tick &&
	git commit -a -m "yet another" &&
	git tag test2-lightweight &&
	echo >>file &&
	test_tick &&
	git commit -a -m "even more"


065b8faf (A U Thor 2005-04-07 15:14:13 -0700 1) vanilla
Bisecting: 2 revisions left to test after this (roughly 1 step)
065b8faf (A U Thor 2005-04-07 15:14:13 -0700 1) vanilla
[55bdac58da30a5a429094bf5466b8095b29ecbf0] 6(broken): Added file that will be deleted
ok 15 - blame takes global pathspec flags

expecting success: 
	mkdir xxx &&
	test_commit xxx xxx/bar

Checking BROKEN_HASH6 is the same as BISECT_HEAD
[master bf36909] one more
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+)
[master 7cd4d15] xxx
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 xxx/bar
ok 16 - setup xxx/bar

expecting success: 
	cat >expect <<-\EOF &&
	xxx
	unrelated
	EOF
	git log --format=%s -- ":(glob)**/bar" >actual &&
	test_cmp expect actual

[master eb002ce] yet another
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 17 - **/ works with :(glob)

expecting success: 
	: >expect &&
	git --noglob-pathspecs log --format=%s -- "**/bar" >actual &&
	test_cmp expect actual

ok 18 - **/ does not work with --noglob-pathspecs

expecting success: 
	cat >expect <<-\EOF &&
	xxx
	unrelated
	EOF
	git --noglob-pathspecs log --format=%s -- ":(glob)**/bar" >actual &&
	test_cmp expect actual

[master ca3eb51] even more
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 35 - set-up matching pattern tests

ok 19 - **/ works with :(glob) and --noglob-pathspecs

expecting success: 
	cat >expect <<-\EOF &&
	xxx
	unrelated
	EOF
	git --glob-pathspecs log --format=%s -- "**/bar" >actual &&
	test_cmp expect actual

expecting success: 
	test $S = 0 &&
	case "$R" in
	$expect)	echo happy ;;
	*)	echo "Oops - $R is not $expect";
		false ;;
	esac
	
happy
ok 36 - describe --match=test-*

ok 20 - **/ works with --glob-pathspecs

expecting success: 
	: >expect &&
	git --glob-pathspecs log --format=%s -- ":(literal)**/bar" >actual &&
	test_cmp expect actual

expecting success: 
	test $S = 0 &&
	case "$R" in
	$expect)	echo happy ;;
	*)	echo "Oops - $R is not $expect";
		false ;;
	esac
	
happy
ok 37 - describe --tags --match=test1-*

ok 21 - **/ does not work with :(literal) and --glob-pathspecs

Bisecting: 0 revisions left to test after this (roughly 0 steps)
expecting success: 
	test $S = 0 &&
	case "$R" in
	$expect)	echo happy ;;
	*)	echo "Oops - $R is not $expect";
		false ;;
	esac
	
happy
ok 38 - describe --tags --match=test2-*

# passed all 21 test(s)
1..21
[fd9df6dc932ed4e1539696448c064bc31b947f3f] Create file <hello2> with <5(broken): first line on a broken branch> inside.
Checking BROKEN_HASH5 is the same as BISECT_HEAD
expecting success: 
	test $S = 0 &&
	case "$R" in
	$expect)	echo happy ;;
	*)	echo "Oops - $R is not $expect";
		false ;;
	esac
	
happy
ok 39 - describe --long --tags --match=test2-* HEAD^

expecting success: 
	echo A >expect &&
	tag_object=$(git rev-parse refs/tags/A) &&
	git name-rev --tags --name-only $tag_object >actual &&
	test_cmp expect actual &&

	echo "A^0" >expect &&
	tagged_commit=$(git rev-parse "refs/tags/A^0") &&
	git name-rev --tags --name-only $tagged_commit >actual &&
	test_cmp expect actual

*** t6131-pathspec-icase.sh ***
ok 40 - name-rev with exact tags

expecting success: 
	echo "A^0" >expect &&
	tag_object=$(git rev-parse refs/tags/A) &&
	git describe --contains $tag_object >actual &&
	test_cmp expect actual &&

	echo "A^0" >expect &&
	tagged_commit=$(git rev-parse "refs/tags/A^0") &&
	git describe --contains $tagged_commit >actual &&
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6131-pathspec-icase/.git/
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
expecting success: 
	test_commit bar bar &&
	test_commit bAr bAr &&
	test_commit BAR BAR &&
	mkdir foo &&
	test_commit foo/bar foo/bar &&
	test_commit foo/bAr foo/bAr &&
	test_commit foo/BAR foo/BAR &&
	mkdir fOo &&
	test_commit fOo/bar fOo/bar &&
	test_commit fOo/bAr fOo/bAr &&
	test_commit fOo/BAR fOo/BAR &&
	mkdir FOO &&
	test_commit FOO/bar FOO/bar &&
	test_commit FOO/bAr FOO/bAr &&
	test_commit FOO/BAR FOO/BAR

ok 41 - describe --contains with the exact tags

# passed all 41 test(s)
1..41
[master (root-commit) b257e7a] bar
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bar
fd9df6dc932ed4e1539696448c064bc31b947f3f is the first bad commit
commit fd9df6dc932ed4e1539696448c064bc31b947f3f
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:28:13 2005 -0700

    Create file <hello2> with <5(broken): first line on a broken branch> inside.

:000000 100644 0000000000000000000000000000000000000000 eea8b5cb3c088378bd97b3d24dc08f935e3a4754 A	hello2
Checking BROKEN_HASH5 is the same as bisect/bad
[master 09d2e74] bAr
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bAr
*** t6132-pathspec-exclude.sh ***
[master ae27bbe] BAR
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 BAR
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6132-pathspec-exclude/.git/
expecting success: 
	for p in file sub/file sub/sub/file sub/file2 sub/sub/sub/file sub2/file; do
		if echo $p | grep /; then
			mkdir -p `dirname $p`
		fi &&
		: >$p &&
		git add $p &&
		git commit -m $p
	done &&
	git log --oneline --format=%s >actual &&
	cat <<EOF >expect &&
sub2/file
sub/sub/sub/file
sub/file2
sub/sub/file
sub/file
file
EOF
	test_cmp expect actual

[master 016d22a] foo/bar
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo/bar
ok 50 - bisect: --no-checkout - target before breakage

expecting success: 
	git bisect reset &&
	git bisect start broken BROKEN_HASH4 --no-checkout &&
	check_same BROKEN_HASH6 BISECT_HEAD &&
	git bisect bad BISECT_HEAD &&
	check_same BROKEN_HASH5 BISECT_HEAD &&
	git bisect good BISECT_HEAD &&
	check_same BROKEN_HASH6 bisect/bad &&
	git bisect reset

[master (root-commit) 4758392] file
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file
sub/file
[master f3c37ed] foo/bAr
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo/bAr
We are not bisecting.
[master b144c5f] sub/file
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 sub/file
sub/sub/file
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[master 98eb41e] foo/BAR
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo/BAR
[49ae89546e57be1b5a23fff1e61d2f6a3a60ffc6] Modify sub1
[master 3276f37] sub/sub/file
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 sub/sub/file
sub/file2
[master edcb5cb] fOo/bar
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 fOo/bar
[master 784d38a] sub/file2
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 sub/file2
sub/sub/sub/file
[master ed5b100] fOo/bAr
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 fOo/bAr
[master cca66eb] sub/sub/sub/file
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 sub/sub/sub/file
sub2/file
[master d451299] sub2/file
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 sub2/file
[master 2f49636] fOo/BAR
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 fOo/BAR
ok 1 - setup

expecting success: 
	test_must_fail git log --oneline --format=%s -- ":(exclude)sub"

Bisecting: 2 revisions left to test after this (roughly 1 step)
fatal: There is nothing to exclude from by :(exclude) patterns.
Perhaps you forgot to add either ':/' or '.' ?
ok 2 - exclude only should error out

expecting success: 
	git log --oneline --format=%s -- . ":(exclude)sub" >actual &&
	cat <<EOF >expect &&
sub2/file
file
EOF
	test_cmp expect actual

[55bdac58da30a5a429094bf5466b8095b29ecbf0] 6(broken): Added file that will be deleted
Checking BROKEN_HASH6 is the same as BISECT_HEAD
[master c65ab92] FOO/bar
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 FOO/bar
ok 3 - t_e_i() exclude sub

expecting success: 
	git log --oneline --format=%s -- . ":(exclude)sub/sub/file" >actual &&
	cat <<EOF >expect &&
sub2/file
sub/sub/sub/file
sub/file2
sub/file
file
EOF
	test_cmp expect actual

ok 4 - t_e_i() exclude sub/sub/file

expecting success: 
	git log --oneline --format=%s -- . ":!sub" >actual &&
	cat <<EOF >expect &&
sub2/file
file
EOF
	test_cmp expect actual

[master cd48380] FOO/bAr
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 FOO/bAr
ok 5 - t_e_i() exclude sub using mnemonic

expecting success: 
	git log --oneline --format=%s -- . ":(exclude,icase)SUB" >actual &&
	cat <<EOF >expect &&
sub2/file
file
EOF
	test_cmp expect actual

ok 6 - t_e_i() exclude :(icase)SUB

expecting success: 
	(
	cd sub &&
	git log --oneline --format=%s -- :/ ":/!sub2" >actual &&
	cat <<EOF >expect &&
sub/sub/sub/file
sub/file2
sub/sub/file
sub/file
file
EOF
	test_cmp expect actual
	)

[master 4e818f3] FOO/BAR
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 FOO/BAR
Submodule path 'sub1': checked out '19c057f4a11810c4873df2518e789eede5e50159'
ok 1 - create commits with glob characters

expecting success: 
	echo bar >expect &&
	git log --format=%s -- "bar" >actual &&
	test_cmp expect actual

ok 7 - t_e_i() exclude sub2 from sub

expecting success: 
	git log --oneline --format=%s -- . ":(exclude)sub/*file" >actual &&
	cat <<EOF >expect &&
sub2/file
sub/file2
file
EOF
	test_cmp expect actual

ok 2 - tree_entry_interesting matches bar

expecting success: 
	cat <<-EOF >expect &&
	BAR
	bAr
	bar
	EOF
	git log --format=%s -- ":(icase)bar" >actual &&
	test_cmp expect actual

ok 8 - t_e_i() exclude sub/*file

expecting success: 
	git log --oneline --format=%s -- . ":(exclude,glob)sub/*/file" >actual &&
	cat <<EOF >expect &&
sub2/file
sub/sub/sub/file
sub/file2
sub/file
file
EOF
	test_cmp expect actual

Bisecting: 0 revisions left to test after this (roughly 0 steps)
ok 3 - tree_entry_interesting matches :(icase)bar

expecting success: 
	cat <<-EOF >expect &&
	fOo/BAR
	fOo/bAr
	fOo/bar
	EOF
	( cd fOo && git log --format=%s -- ":(icase)bar" ) >actual &&
	test_cmp expect actual

ok 9 - t_e_i() exclude :(glob)sub/*/file

expecting success: 
	git ls-files -- . ":(exclude)sub" >actual &&
	cat <<EOF >expect &&
file
sub2/file
EOF
	test_cmp expect actual

[fd9df6dc932ed4e1539696448c064bc31b947f3f] Create file <hello2> with <5(broken): first line on a broken branch> inside.
Checking BROKEN_HASH5 is the same as BISECT_HEAD
ok 12 - git_bisect: 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
		)
	
ok 10 - m_p_d() exclude sub

expecting success: 
	git ls-files -- . ":(exclude)sub/sub/file" >actual &&
	cat <<EOF >expect &&
file
sub/file
sub/file2
sub/sub/sub/file
sub2/file
EOF
	test_cmp expect actual

ok 4 - tree_entry_interesting matches :(icase)bar with prefix

expecting success: 
	cat <<-EOF >expect &&
	FOO/BAR
	FOO/bAr
	FOO/bar
	fOo/BAR
	fOo/bAr
	fOo/bar
	foo/BAR
	foo/bAr
	foo/bar
	EOF
	( cd fOo && git log --format=%s -- ":(icase)../foo/bar" ) >actual &&
	test_cmp expect actual

ok 11 - m_p_d() exclude sub/sub/file

expecting success: 
	git ls-files -- . ":!sub" >actual &&
	cat <<EOF >expect &&
file
sub2/file
EOF
	test_cmp expect actual

ok 5 - tree_entry_interesting matches :(icase)bar with empty prefix

expecting success: 
	cat <<-EOF >expect &&
	BAR
	bAr
	bar
	EOF
	git ls-files ":(icase)bar" >actual &&
	test_cmp expect actual

ok 12 - m_p_d() exclude sub using mnemonic

expecting success: 
	git ls-files -- . ":(exclude,icase)SUB" >actual &&
	cat <<EOF >expect &&
file
sub2/file
EOF
	test_cmp expect actual

ok 13 - m_p_d() exclude :(icase)SUB

expecting success: 
	(
	cd sub &&
	git ls-files -- :/ ":/!sub2" >actual &&
	cat <<EOF >expect &&
../file
file
file2
sub/file
sub/sub/file
EOF
	test_cmp expect actual
	)

ok 6 - match_pathspec matches :(icase)bar

expecting success: 
	cat <<-EOF >expect &&
	fOo/BAR
	fOo/bAr
	fOo/bar
	EOF
	( cd fOo && git ls-files --full-name ":(icase)bar" ) >actual &&
	test_cmp expect actual

ok 7 - match_pathspec matches :(icase)bar with prefix

expecting success: 
	cat <<-EOF >expect &&
	bar
	fOo/BAR
	fOo/bAr
	fOo/bar
	EOF
	( cd fOo && git ls-files --full-name ":(icase)bar" ../bar ) >actual &&
	test_cmp expect actual

ok 14 - m_p_d() exclude sub2 from sub

expecting success: 
	git ls-files -- . ":(exclude)sub/*file" >actual &&
	cat <<EOF >expect &&
file
sub/file2
sub2/file
EOF
	test_cmp expect actual

Cloning into 'submodule_update'...
ok 15 - m_p_d() exclude sub/*file

expecting success: 
	git ls-files -- . ":(exclude,glob)sub/*/file" >actual &&
	cat <<EOF >expect &&
file
sub/file
sub/file2
sub/sub/sub/file
sub2/file
EOF
	test_cmp expect actual

ok 8 - match_pathspec matches :(icase)bar with empty prefix

expecting success: 
	echo FOO/BAR >expect &&
	git diff --name-only HEAD^ HEAD -- ":(icase)foo/bar" >actual &&
	test_cmp expect actual

ok 16 - m_p_d() exclude :(glob)sub/*/file

ok 9 - "git diff" can take magic :(icase) pathspec

# passed all 9 test(s)
1..9
# passed all 16 test(s)
1..16
done.
55bdac58da30a5a429094bf5466b8095b29ecbf0 is the first bad commit
commit 55bdac58da30a5a429094bf5466b8095b29ecbf0
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:28:13 2005 -0700

    6(broken): Added file that will be deleted

:000000 040000 0000000000000000000000000000000000000000 39f7e61a724187ab767d2e08442d9b6b9dab587d A	missing
*** t6200-fmt-merge-msg.sh ***
Checking BROKEN_HASH6 is the same as bisect/bad
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
*** t6300-for-each-ref.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6200-fmt-merge-msg/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6300-for-each-ref/.git/
expecting success: 
	echo one >one &&
	git add one &&
	test_tick &&
	git commit -m "Initial" &&

	git clone . remote &&

	echo uno >one &&
	echo dos >two &&
	git add two &&
	test_tick &&
	git commit -a -m "Second" &&

	git checkout -b left &&

	echo "c1" >one &&
	test_tick &&
	git commit -a -m "Common #1" &&

	echo "c2" >one &&
	test_tick &&
	git commit -a -m "Common #2" &&

	git branch right &&

	echo "l3" >two &&
	test_tick &&
	GIT_COMMITTER_NAME="Another Committer" \
	GIT_AUTHOR_NAME="Another Author" git commit -a -m "Left #3" &&

	echo "l4" >two &&
	test_tick &&
	GIT_COMMITTER_NAME="Another Committer" \
	GIT_AUTHOR_NAME="Another Author" git commit -a -m "Left #4" &&

	echo "l5" >two &&
	test_tick &&
	GIT_COMMITTER_NAME="Another Committer" \
	GIT_AUTHOR_NAME="Another Author" git commit -a -m "Left #5" &&
	git tag tag-l5 &&

	git checkout right &&

	echo "r3" >three &&
	git add three &&
	test_tick &&
	git commit -a -m "Right #3" &&
	git tag tag-r3 &&

	echo "r4" >three &&
	test_tick &&
	git commit -a -m "Right #4" &&

	echo "r5" >three &&
	test_tick &&
	git commit -a -m "Right #5" &&

	git checkout -b long &&
	i=0 &&
	while test $i -lt 30
	do
		test_commit $i one &&
		i=$(($i+1))
	done &&

	git show-branch &&

	apos="'"

[master (root-commit) 883c9d3] Initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one
Cloning into 'remote'...
ok 51 - bisect: --no-checkout - target in breakage

expecting success: 
	git bisect reset &&
	git bisect start broken BROKEN_HASH4 --no-checkout &&
	check_same BROKEN_HASH6 BISECT_HEAD &&
	git bisect good BISECT_HEAD &&
	check_same BROKEN_HASH8 BISECT_HEAD &&
	git bisect good BISECT_HEAD &&
	check_same BROKEN_HASH9 bisect/bad &&
	git bisect reset

done.
We are not bisecting.
[master 2935695] Second
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 two
Switched to a new branch 'left'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t6041-bisect-submodule/submodule_update_repo/.) registered for path 'sub1'
[left b86daf8] Common #1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[left 9f2fd7e] Common #2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[left 5b6ed2c] Left #3
 Author: Another Author <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'sub1'...
[left e382d03] Left #4
 Author: Another Author <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[left 558a9dc] Left #5
 Author: Another Author <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
expecting success: 
	setdate_and_increment &&
	echo "Using $datestamp" > one &&
	git add one &&
	git commit -m "Initial" &&
	setdate_and_increment &&
	git tag -a -m "Tagging at $datestamp" testtag &&
	git update-ref refs/remotes/origin/master master &&
	git remote add origin nowhere &&
	git config branch.master.remote origin &&
	git config branch.master.merge refs/heads/master &&
	git remote add myfork elsewhere &&
	git config remote.pushdefault myfork &&
	git config push.default current

done.
Switched to branch 'right'
[master (root-commit) 67a36f1] Initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one
[right 00c8e89] Right #3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 three
Bisecting: 2 revisions left to test after this (roughly 1 step)
[55bdac58da30a5a429094bf5466b8095b29ecbf0] 6(broken): Added file that will be deleted
Checking BROKEN_HASH6 is the same as BISECT_HEAD
[right ef8635d] Right #4
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[right 2d2f597] Right #5
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'long'
Submodule path 'sub1': checked out '7e9f79116e21ad6a3ac18868cba45094b8cda241'
ok 1 - setup

expecting success: 
		git for-each-ref --format='%(refname)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
[long d6a0cbe] 0
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 2 - basic atom: head refname

expecting success: 
		git for-each-ref --format='%(upstream)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
[long e56a64b] 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 3 - basic atom: head upstream

expecting success: 
		git for-each-ref --format='%(push)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
ok 4 - basic atom: head push

expecting success: 
		git for-each-ref --format='%(objecttype)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
Bisecting: 0 revisions left to test after this (roughly 1 step)
[3df15bfcf4745f4f8ff0007d5ca42e75eba04ff9] Add <8(broken): third line on a broken branch> into <hello2>.
[long 8fc7bcd] 2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Checking BROKEN_HASH8 is the same as BISECT_HEAD
ok 5 - basic atom: head objecttype

expecting success: 
		git for-each-ref --format='%(objectsize)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
Switched to branch 'invalid_sub1'
Your branch is up-to-date with 'origin/invalid_sub1'.
ok 6 - basic atom: head objectsize

expecting success: 
		git for-each-ref --format='%(objectname)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
[invalid_sub1 c95bdaf] bisect bad
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bar
[long b5605fc] 3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 7 - basic atom: head objectname

HEAD is now at 5369cc1 Add sub1
expecting success: 
		git for-each-ref --format='%(tree)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
[long 35000b2] 4
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 8 - basic atom: head tree

expecting success: 
		git for-each-ref --format='%(parent)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
ok 9 - basic atom: head parent

expecting success: 
		git for-each-ref --format='%(numparent)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
[long 3c4f1c6] 5
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
508db08019a8b4b05c3cfe2447ada8a4c78fe3de is the first bad commit
commit 508db08019a8b4b05c3cfe2447ada8a4c78fe3de
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:30:13 2005 -0700

    9(broken): Remove missing file

:040000 000000 39f7e61a724187ab767d2e08442d9b6b9dab587d 0000000000000000000000000000000000000000 D	missing
ok 10 - basic atom: head numparent

expecting success: 
		git for-each-ref --format='%(object)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
Checking BROKEN_HASH9 is the same as bisect/bad
[long bf0bc37] 6
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 11 - basic atom: head object

expecting success: 
		git for-each-ref --format='%(type)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
ok 12 - basic atom: head type

expecting success: 
		git for-each-ref --format='%(*objectname)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
[long e0e9a85] 7
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 13 - basic atom: head *objectname

expecting success: 
		git for-each-ref --format='%(*objecttype)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
ok 14 - basic atom: head *objecttype

expecting success: 
		git for-each-ref --format='%(author)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
[long eb8c9f5] 8
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 15 - basic atom: head author

expecting success: 
		git for-each-ref --format='%(authorname)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
[long 99409c7] 9
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 16 - basic atom: head authorname

expecting success: 
		git for-each-ref --format='%(authoremail)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
ok 52 - bisect: --no-checkout - target after breakage

expecting success: 
	git bisect reset &&
	git checkout broken &&
	git bisect start broken master --no-checkout &&
	git bisect run "$SHELL_PATH" -c '
		GOOD=$(git for-each-ref "--format=%(objectname)" refs/bisect/good-*) &&
		git rev-list --objects BISECT_HEAD --not $GOOD >tmp.$$ &&
		git pack-objects --stdout >/dev/null < tmp.$$
		rc=$?
		rm -f tmp.$$
		test $rc = 0' &&
	check_same BROKEN_HASH6 bisect/bad &&
	git bisect reset

ok 17 - basic atom: head authoremail

expecting success: 
		git for-each-ref --format='%(authordate)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
[long 0ce96e0] 10
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 18 - basic atom: head authordate

expecting success: 
		git for-each-ref --format='%(committer)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
We are not bisecting.
Already on 'broken'
ok 19 - basic atom: head committer

expecting success: 
		git for-each-ref --format='%(committername)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
[long 8377914] 11
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 20 - basic atom: head committername

expecting success: 
		git for-each-ref --format='%(committeremail)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
ok 21 - basic atom: head committeremail

expecting success: 
		git for-each-ref --format='%(committerdate)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
[long 85798ed] 12
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 22 - basic atom: head committerdate

expecting success: 
		git for-each-ref --format='%(tag)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
ok 23 - basic atom: head tag

expecting success: 
		git for-each-ref --format='%(tagger)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
[long f75d7f4] 13
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 24 - basic atom: head tagger

expecting success: 
		git for-each-ref --format='%(taggername)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
ok 25 - basic atom: head taggername

expecting success: 
		git for-each-ref --format='%(taggeremail)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
[long f56cc6e] 14
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 26 - basic atom: head taggeremail

expecting success: 
		git for-each-ref --format='%(taggerdate)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
[long 3dc0dbd] 15
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 27 - basic atom: head taggerdate

expecting success: 
		git for-each-ref --format='%(creator)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
Bisecting: 2 revisions left to test after this (roughly 1 step)
ok 28 - basic atom: head creator

expecting success: 
		git for-each-ref --format='%(creatordate)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
[55bdac58da30a5a429094bf5466b8095b29ecbf0] 6(broken): Added file that will be deleted
[long 56d0ffb] 16
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 29 - basic atom: head creatordate

expecting success: 
		git for-each-ref --format='%(subject)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[5c79e6eace5826bcdf689e414fa791a4dbdc54ec] Invalid sub1 commit
ok 30 - basic atom: head subject

expecting success: 
		git for-each-ref --format='%(contents:subject)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
[long 4c19426] 17
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
running /bin/sh -c 
		GOOD=$(git for-each-ref "--format=%(objectname)" refs/bisect/good-*) &&
		git rev-list --objects BISECT_HEAD --not $GOOD >tmp.$$ &&
		git pack-objects --stdout >/dev/null < tmp.$$
		rc=$?
		rm -f tmp.$$
		test $rc = 0
ok 31 - basic atom: head contents:subject

expecting success: 
		git for-each-ref --format='%(body)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
error: Could not read 39f7e61a724187ab767d2e08442d9b6b9dab587d
fatal: bad tree object 39f7e61a724187ab767d2e08442d9b6b9dab587d
[long 5342a39] 18
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 32 - basic atom: head body

expecting success: 
		git for-each-ref --format='%(contents:body)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
ok 33 - basic atom: head contents:body

expecting success: 
		git for-each-ref --format='%(contents:signature)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
[long 0753e7e] 19
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 34 - basic atom: head contents:signature

expecting success: 
		git for-each-ref --format='%(contents)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[fd9df6dc932ed4e1539696448c064bc31b947f3f] Create file <hello2> with <5(broken): first line on a broken branch> inside.
ok 35 - basic atom: head contents

expecting success: 
		git for-each-ref --format='%(HEAD)' refs/heads/master >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
[long 72baa93] 20
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
running /bin/sh -c 
		GOOD=$(git for-each-ref "--format=%(objectname)" refs/bisect/good-*) &&
		git rev-list --objects BISECT_HEAD --not $GOOD >tmp.$$ &&
		git pack-objects --stdout >/dev/null < tmp.$$
		rc=$?
		rm -f tmp.$$
		test $rc = 0
ok 36 - basic atom: head HEAD

expecting success: 
		git for-each-ref --format='%(refname)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
ok 37 - basic atom: tag refname

[long 494d039] 21
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
expecting success: 
		git for-each-ref --format='%(upstream)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
ok 38 - basic atom: tag upstream

expecting success: 
		git for-each-ref --format='%(push)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
[long 543e615] 22
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 39 - basic atom: tag push

expecting success: 
		git for-each-ref --format='%(objecttype)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
ok 40 - basic atom: tag objecttype

expecting success: 
		git for-each-ref --format='%(objectsize)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
[long 41d12df] 23
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 41 - basic atom: tag objectsize

expecting success: 
		git for-each-ref --format='%(objectname)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
55bdac58da30a5a429094bf5466b8095b29ecbf0 is the first bad commit
commit 55bdac58da30a5a429094bf5466b8095b29ecbf0
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:28:13 2005 -0700

    6(broken): Added file that will be deleted

:000000 040000 0000000000000000000000000000000000000000 39f7e61a724187ab767d2e08442d9b6b9dab587d A	missing
bisect run success
Checking BROKEN_HASH6 is the same as bisect/bad
ok 42 - basic atom: tag objectname

expecting success: 
		git for-each-ref --format='%(tree)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
[long 8b77407] 24
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
fatal: reference is not a tree: 0123456789012345678901234567890123456789
Unable to checkout '0123456789012345678901234567890123456789' in submodule path 'sub1'
ok 43 - basic atom: tag tree

expecting success: 
		git for-each-ref --format='%(parent)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
[long 12fecbe] 25
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 44 - basic atom: tag parent

expecting success: 
		git for-each-ref --format='%(numparent)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
ok 13 - git_bisect: 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
		)
	
ok 45 - basic atom: tag numparent

expecting success: 
		git for-each-ref --format='%(object)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
[long f709339] 26
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 46 - basic atom: tag object

expecting success: 
		git for-each-ref --format='%(type)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
[long c90ce26] 27
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 47 - basic atom: tag type

expecting success: 
		git for-each-ref --format='%(*objectname)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
ok 53 - bisect: demonstrate identification of damage boundary

expecting success: 
	git bisect reset &&
	git bisect start $HASH4 $HASH2 &&
	git bisect good &&
	git bisect log >bisect-log.txt &&
	test_cmp expected.bisect-log bisect-log.txt &&
	git bisect reset

ok 48 - basic atom: tag *objectname

expecting success: 
		git for-each-ref --format='%(*objecttype)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
Cloning into 'submodule_update'...
[long cf03e3f] 28
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 49 - basic atom: tag *objecttype

expecting success: 
		git for-each-ref --format='%(author)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
We are not bisecting.
done.
ok 50 - basic atom: tag author

expecting success: 
		git for-each-ref --format='%(authorname)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
[long f343514] 29
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 51 - basic atom: tag authorname

expecting success: 
		git for-each-ref --format='%(authoremail)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
Switched to a new branch 'invalid_sub1'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
! [left] Left #5
 * [long] 29
  ! [master] Second
   ! [right] Right #5
----
 *   [long] 29
 *   [long^] 28
 *   [long~2] 27
 *   [long~3] 26
 *   [long~4] 25
 *   [long~5] 24
 *   [long~6] 23
 *   [long~7] 22
 *   [long~8] 21
 *   [long~9] 20
 *   [long~10] 19
 *   [long~11] 18
 *   [long~12] 17
 *   [long~13] 16
 *   [long~14] 15
 *   [long~15] 14
 *   [long~16] 13
 *   [long~17] 12
 *   [long~18] 11
 *   [long~19] 10
 *   [long~20] 9
 *   [long~21] 8
 *   [long~22] 7
 *   [long~23] 6
 *   [long~24] 5
 *   [long~25] 4
 *   [long~26] 3
 *   [long~27] 2
 *   [long~28] 1
 *   [long~29] 0
 * + [right] Right #5
 * + [right^] Right #4
 * + [right~2] Right #3
+    [left] Left #5
+    [left^] Left #4
+    [left~2] Left #3
+* + [right~3] Common #2
+* + [right~4] Common #1
+*++ [master] Second
ok 1 - setup

expecting success: 
	echo "Merge branch ${apos}left${apos}" >expected &&

	git checkout master &&
	git fetch . left &&

	git fmt-merge-msg <.git/FETCH_HEAD >actual &&
	test_cmp expected actual

ok 52 - basic atom: tag authoremail

expecting success: 
		git for-each-ref --format='%(authordate)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
Switched to branch 'master'
fatal: Needed a single revision
ok 53 - basic atom: tag authordate

expecting success: 
		git for-each-ref --format='%(committer)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
ok 54 - basic atom: tag committer

expecting success: 
		git for-each-ref --format='%(committername)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
From .
ok 55 - basic atom: tag committername

 * branch            left       -> FETCH_HEAD
expecting success: 
		git for-each-ref --format='%(committeremail)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
Switched to branch 'valid_sub1'
Your branch is up-to-date with 'origin/valid_sub1'.
ok 2 - message for merging local branch

expecting success: 
	echo "Merge branch ${apos}left${apos} of $(pwd)" >expected &&

	git checkout master &&
	git fetch "$(pwd)" left &&

	git fmt-merge-msg <.git/FETCH_HEAD >actual &&
	test_cmp expected actual

ok 56 - basic atom: tag committeremail

expecting success: 
		git for-each-ref --format='%(committerdate)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
Already on 'master'
[valid_sub1 a4beecc] bisect bad
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bar
ok 57 - basic atom: tag committerdate

expecting success: 
		git for-each-ref --format='%(tag)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
Bisecting: 0 revisions left to test after this (roughly 0 steps)
ok 58 - basic atom: tag tag

expecting success: 
		git for-each-ref --format='%(tagger)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
HEAD is now at 5c79e6e Invalid sub1 commit
[3de952f2416b6084f557ec417709eac740c6818c] Add <3: Another new day for git> into <hello>.
ok 59 - basic atom: tag tagger

expecting success: 
		git for-each-ref --format='%(taggername)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
From /«PKGBUILDDIR»/t/trash directory.t6200-fmt-merge-msg
 * branch            left       -> FETCH_HEAD
ok 60 - basic atom: tag taggername

expecting success: 
		git for-each-ref --format='%(taggeremail)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
ok 3 - message for merging external branch

expecting success: 
	cat >expected <<-EOF &&
	Merge branch ${apos}left${apos}

	# By Another Author (3) and A U Thor (2)
	# Via Another Committer
	* left:
	  Left #5
	  Left #4
	  Left #3
	  Common #2
	  Common #1
	EOF

	test_config merge.log true &&
	test_unconfig merge.summary &&

	git checkout master &&
	test_tick &&
	git fetch . left &&

	git fmt-merge-msg <.git/FETCH_HEAD >actual1 &&

	test_unconfig merge.log &&
	test_config merge.summary true &&

	git checkout master &&
	test_tick &&
	git fetch . left &&

	git fmt-merge-msg <.git/FETCH_HEAD >actual2 &&

	test_cmp expected actual1 &&
	test_cmp expected actual2

ok 61 - basic atom: tag taggeremail

expecting success: 
		git for-each-ref --format='%(taggerdate)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
Already on 'master'
ok 62 - basic atom: tag taggerdate

expecting success: 
		git for-each-ref --format='%(creator)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
ok 63 - basic atom: tag creator

expecting success: 
		git for-each-ref --format='%(creatordate)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
ok 64 - basic atom: tag creatordate

expecting success: 
		git for-each-ref --format='%(subject)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
From .
 * branch            left       -> FETCH_HEAD
32a594a3fdac2d57cf6d02987e30eec68511498c is the first bad commit
commit 32a594a3fdac2d57cf6d02987e30eec68511498c
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:16:13 2005 -0700

    Add <4: Ciao for now> into <hello>.

:100644 100644 2601b1193ce6251a6a1a51885a2f660dd931b5d8 af8e44a1153de8c58d0e2cfd9b1da2ac1959e9ff M	hello
ok 65 - basic atom: tag subject

expecting success: 
		git for-each-ref --format='%(contents:subject)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
ok 66 - basic atom: tag contents:subject

expecting success: 
		git for-each-ref --format='%(body)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
Already on 'master'
ok 67 - basic atom: tag body

expecting success: 
		git for-each-ref --format='%(contents:body)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
ok 68 - basic atom: tag contents:body

expecting success: 
		git for-each-ref --format='%(contents:signature)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
ok 69 - basic atom: tag contents:signature

expecting success: 
		git for-each-ref --format='%(contents)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
From .
 * branch            left       -> FETCH_HEAD
ok 70 - basic atom: tag contents

expecting success: 
		git for-each-ref --format='%(HEAD)' refs/tags/testtag >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
Previous HEAD position was 3de952f... Add <3: Another new day for git> into <hello>.
Switched to branch 'broken'
ok 71 - basic atom: tag HEAD

expecting success: 
	test_must_fail git for-each-ref --format="%(INVALID)" refs/heads

ok 4 - [merge] summary/log configuration

expecting success: 
	git checkout master &&
	test_tick &&
	git fetch . left

fatal: unknown field name: INVALID
ok 72 - Check invalid atoms names are errors

expecting success: 
	git for-each-ref --format="%(authordate)" refs/heads &&
	git for-each-ref --format="%(authordate:default) %(authordate)" refs/heads &&
	git for-each-ref --format="%(authordate) %(authordate:default)" refs/heads &&
	git for-each-ref --format="%(authordate:default) %(authordate:default)" refs/heads

Already on 'master'
Mon Jul 3 17:18:44 2006 +0200
Mon Jul 3 17:18:44 2006 +0200 Mon Jul 3 17:18:44 2006 +0200
ok 54 - bisect log: successfull result

expecting success: 
	git bisect reset &&
	git bisect start $HASH4 $HASH2 &&
	test_must_fail git bisect skip &&
	git bisect log >bisect-skip-log.txt &&
	test_cmp expected.bisect-skip-log bisect-skip-log.txt &&
	git bisect reset

Mon Jul 3 17:18:44 2006 +0200 Mon Jul 3 17:18:44 2006 +0200
Mon Jul 3 17:18:44 2006 +0200 Mon Jul 3 17:18:44 2006 +0200
ok 73 - Check format specifiers are ignored in naming date atoms

expecting success: 
	git for-each-ref --format="%(authordate:default)" refs/heads &&
	git for-each-ref --format="%(authordate:relative)" refs/heads &&
	git for-each-ref --format="%(authordate:short)" refs/heads &&
	git for-each-ref --format="%(authordate:local)" refs/heads &&
	git for-each-ref --format="%(authordate:iso8601)" refs/heads &&
	git for-each-ref --format="%(authordate:rfc2822)" refs/heads

Mon Jul 3 17:18:44 2006 +0200
9 years ago
From .
 * branch            left       -> FETCH_HEAD
2006-07-03
ok 5 - setup FETCH_HEAD

expecting success: 
	cat >expected <<-EOF &&
	Merge branch ${apos}left${apos}

	# By Another Author (3) and A U Thor (2)
	# Via Another Committer
	* left: (5 commits)
	  Left #5
	  Left #4
	  Left #3
	  ...
	EOF

	git -c merge.log=3 fmt-merge-msg <.git/FETCH_HEAD >actual &&
	test_cmp expected actual

We are not bisecting.
Mon Jul 3 15:18:44 2006
2006-07-03 17:18:44 +0200
ok 6 - merge.log=3 limits shortlog length

expecting success: 
	cat >expected <<-EOF &&
	Merge branch ${apos}left${apos}

	# By Another Author (3) and A U Thor (2)
	# Via Another Committer
	* left:
	  Left #5
	  Left #4
	  Left #3
	  Common #2
	  Common #1
	EOF

	git -c merge.log=5 fmt-merge-msg <.git/FETCH_HEAD >actual &&
	test_cmp expected actual

Mon, 3 Jul 2006 17:18:44 +0200
ok 74 - Check valid format specifiers for date fields

expecting success: 
	test_must_fail git for-each-ref --format="%(authordate:INVALID)" refs/heads

fatal: unknown date format INVALID
ok 75 - Check invalid format specifiers are errors

ok 7 - merge.log=5 shows all 5 commits

expecting success: 
	cat >expected <<-EOF &&
	Merge branch ${apos}left${apos}

	x By Another Author (3) and A U Thor (2)
	x Via Another Committer
	* left:
	  Left #5
	  Left #4
	  Left #3
	  Common #2
	  Common #1
	EOF

	git -c core.commentchar="x" fmt-merge-msg --log=5 <.git/FETCH_HEAD >actual &&
	test_cmp expected actual

expecting success: 
	(git for-each-ref --shell --format="%(refname) %(committerdate) %(authordate)" refs/heads &&
	git for-each-ref --shell --format="%(refname) %(taggerdate)" refs/tags) >actual &&
	test_cmp expected actual

ok 8 - --log=5 with custom comment character

expecting success: 
	echo "Merge branch ${apos}left${apos}" >expected &&
	git -c merge.log=0 fmt-merge-msg <.git/FETCH_HEAD >actual &&
	test_cmp expected actual

ok 76 - Check unformatted date fields output

expecting success: 
	f=default &&
	(git for-each-ref --shell --format="%(refname) %(committerdate:$f) %(authordate:$f)" refs/heads &&
	git for-each-ref --shell --format="%(refname) %(taggerdate:$f)" refs/tags) >actual &&
	test_cmp expected actual

ok 9 - merge.log=0 disables shortlog

expecting success: 
	cat >expected <<-EOF &&
	Merge branch ${apos}left${apos}

	# By Another Author (3) and A U Thor (2)
	# Via Another Committer
	* left: (5 commits)
	  Left #5
	  Left #4
	  Left #3
	  ...
	EOF

	git fmt-merge-msg --log=3 <.git/FETCH_HEAD >actual &&
	test_cmp expected actual

ok 77 - Check format "default" formatted date fields output

expecting success: 
	f=relative &&
	(git for-each-ref --shell --format="%(refname) %(committerdate:$f) %(authordate:$f)" refs/heads &&
	git for-each-ref --shell --format="%(refname) %(taggerdate:$f)" refs/tags) >actual

ok 10 - --log=3 limits shortlog length

expecting success: 
	cat >expected <<-EOF &&
	Merge branch ${apos}left${apos}

	# By Another Author (3) and A U Thor (2)
	# Via Another Committer
	* left:
	  Left #5
	  Left #4
	  Left #3
	  Common #2
	  Common #1
	EOF

	git fmt-merge-msg --log=5 <.git/FETCH_HEAD >actual &&
	test_cmp expected actual

ok 78 - Check format "relative" date fields output

expecting success: 
	f=short &&
	(git for-each-ref --shell --format="%(refname) %(committerdate:$f) %(authordate:$f)" refs/heads &&
	git for-each-ref --shell --format="%(refname) %(taggerdate:$f)" refs/tags) >actual &&
	test_cmp expected actual

ok 11 - --log=5 shows all 5 commits

expecting success: 
	echo "Merge branch ${apos}left${apos}" >expected &&
	git fmt-merge-msg --no-log <.git/FETCH_HEAD >actual &&
	test_cmp expected actual

Bisecting: 0 revisions left to test after this (roughly 0 steps)
ok 12 - --no-log disables shortlog

expecting success: 
	echo "Merge branch ${apos}left${apos}" >expected &&
	git fmt-merge-msg --no-log <.git/FETCH_HEAD >actual &&
	test_cmp expected actual

ok 79 - Check format "short" date fields output

expecting success: 
	f=local &&
	(git for-each-ref --shell --format="%(refname) %(committerdate:$f) %(authordate:$f)" refs/heads &&
	git for-each-ref --shell --format="%(refname) %(taggerdate:$f)" refs/tags) >actual &&
	test_cmp expected actual

ok 13 - --log=0 disables shortlog

expecting success: 
	echo "Sync with left" >expected &&
	cat >expected.log <<-EOF &&
	Sync with left

	# By Another Author (3) and A U Thor (2)
	# Via Another Committer
	* ${apos}left${apos} of $(pwd):
	  Left #5
	  Left #4
	  Left #3
	  Common #2
	  Common #1
	EOF

	test_unconfig merge.log &&
	test_unconfig merge.summary &&
	git checkout master &&
	git fetch "$(pwd)" left &&
	git fmt-merge-msg -m "Sync with left" <.git/FETCH_HEAD >actual &&
	git fmt-merge-msg --log -m "Sync with left" \
					<.git/FETCH_HEAD >actual.log &&
	test_config merge.log true &&
	git fmt-merge-msg -m "Sync with left" \
					<.git/FETCH_HEAD >actual.log-config &&
	git fmt-merge-msg --no-log -m "Sync with left" \
					<.git/FETCH_HEAD >actual.nolog &&

	test_cmp expected actual &&
	test_cmp expected.log actual.log &&
	test_cmp expected.log actual.log-config &&
	test_cmp expected actual.nolog

[634f7276240c53b10d3c3fb17d5eb24535c2c2e6] Revert "Invalid sub1 commit"
ok 80 - Check format "local" date fields output

expecting success: 
	f=iso8601 &&
	(git for-each-ref --shell --format="%(refname) %(committerdate:$f) %(authordate:$f)" refs/heads &&
	git for-each-ref --shell --format="%(refname) %(taggerdate:$f)" refs/tags) >actual &&
	test_cmp expected actual

Already on 'master'
ok 81 - Check format "iso8601" date fields output

expecting success: 
	f=rfc2822 &&
	(git for-each-ref --shell --format="%(refname) %(committerdate:$f) %(authordate:$f)" refs/heads &&
	git for-each-ref --shell --format="%(refname) %(taggerdate:$f)" refs/tags) >actual &&
	test_cmp expected actual

Bisecting: 0 revisions left to test after this (roughly 0 steps)
ok 82 - Check format "rfc2822" date fields output

expecting success: 
	echo "my date is 2006-07-03" >expected &&
	git for-each-ref \
	  --format="%(authordate:format:my date is %Y-%m-%d)" \
	  refs/heads >actual &&
	test_cmp expected actual

[3de952f2416b6084f557ec417709eac740c6818c] Add <3: Another new day for git> into <hello>.
ok 83 - Check format of strftime date fields

expecting success: 
	echo >expected &&
	git for-each-ref --format="%(authordate:format:)" refs/heads >actual &&
	test_cmp expected actual &&
	long="long format -- $_z40$_z40$_z40$_z40$_z40$_z40$_z40" &&
	echo $long >expected &&
	git for-each-ref --format="%(authordate:format:$long)" refs/heads >actual &&
	test_cmp expected actual

From /«PKGBUILDDIR»/t/trash directory.t6200-fmt-merge-msg
 * branch            left       -> FETCH_HEAD
ok 84 - exercise strftime with odd fields

expecting success: 
	git for-each-ref --format="%(refname)" --sort=refname >actual &&
	test_cmp expected actual

ok 85 - Verify ascending sort

expecting success: 
	git for-each-ref --format="%(refname)" --sort=-refname >actual &&
	test_cmp expected actual

ok 86 - Verify descending sort

expecting success: 
	git for-each-ref --shell --format="%(refname)" >actual &&
	test_cmp expected actual

ok 87 - Quoting style: shell

expecting success: 
	git for-each-ref --perl --format="%(refname)" >actual &&
	test_cmp expected actual

ok 14 - fmt-merge-msg -m

expecting success: 
	cat >expected <<-EOF
	Merge branches ${apos}left${apos} and ${apos}right${apos}

	# By Another Author (3) and A U Thor (2)
	# Via Another Committer
	* left:
	  Left #5
	  Left #4
	  Left #3
	  Common #2
	  Common #1

	* right:
	  Right #5
	  Right #4
	  Right #3
	  Common #2
	  Common #1
	EOF

ok 88 - Quoting style: perl

ok 15 - setup: expected shortlog for two branches
expecting success: 
	git for-each-ref --python --format="%(refname)" >actual &&
	test_cmp expected actual


expecting success: 
	test_config merge.log true &&
	test_unconfig merge.summary &&
	git checkout master &&
	test_tick &&
	git fetch . left right &&
	git fmt-merge-msg <.git/FETCH_HEAD >actual1 &&

	test_unconfig merge.log &&
	test_config merge.summary true &&
	git checkout master &&
	test_tick &&
	git fetch . left right &&
	git fmt-merge-msg <.git/FETCH_HEAD >actual2 &&

	test_config merge.log yes &&
	test_unconfig merge.summary &&
	git checkout master &&
	test_tick &&
	git fetch . left right &&
	git fmt-merge-msg <.git/FETCH_HEAD >actual3 &&

	test_unconfig merge.log &&
	test_config merge.summary yes &&
	git checkout master &&
	test_tick &&
	git fetch . left right &&
	git fmt-merge-msg <.git/FETCH_HEAD >actual4 &&

	test_cmp expected actual1 &&
	test_cmp expected actual2 &&
	test_cmp expected actual3 &&
	test_cmp expected actual4

There are only 'skip'ped commits left to test.
The first bad commit could be any of:
3de952f2416b6084f557ec417709eac740c6818c
32a594a3fdac2d57cf6d02987e30eec68511498c
We cannot bisect more!
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t6041-bisect-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 89 - Quoting style: python

expecting success: 
	git for-each-ref --tcl --format="%(refname)" >actual &&
	test_cmp expected actual

Already on 'master'
ok 90 - Quoting style: tcl

expecting success: 
		git for-each-ref --perl --shell 2>&1 | (read line &&
		case $line in
		"error: more than one quoting style"*) : happy;;
		*) false
		esac)
	
ok 91 - more than one quoting style: --perl --shell

expecting success: 
		git for-each-ref -s --python 2>&1 | (read line &&
		case $line in
		"error: more than one quoting style"*) : happy;;
		*) false
		esac)
	
ok 92 - more than one quoting style: -s --python

expecting success: 
		git for-each-ref --python --tcl 2>&1 | (read line &&
		case $line in
		"error: more than one quoting style"*) : happy;;
		*) false
		esac)
	
ok 93 - more than one quoting style: --python --tcl

expecting success: 
		git for-each-ref --tcl --perl 2>&1 | (read line &&
		case $line in
		"error: more than one quoting style"*) : happy;;
		*) false
		esac)
	
ok 94 - more than one quoting style: --tcl --perl

expecting success: 
	(git for-each-ref --format="%(refname:short)" refs/heads &&
	git for-each-ref --format="%(refname:short)" refs/tags) >actual &&
	test_cmp expected actual

From .
 * branch            left       -> FETCH_HEAD
 * branch            right      -> FETCH_HEAD
Cloning into 'sub1'...
ok 95 - Check short refname format

expecting success: 
	git for-each-ref --format="%(upstream:short)" refs/heads >actual &&
	test_cmp expected actual

ok 96 - Check short upstream format

expecting success: 
	test_commit two

done.
Already on 'master'
Previous HEAD position was 3de952f... Add <3: Another new day for git> into <hello>.
Switched to branch 'broken'
[master 5b9a18b] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two.t
ok 97 - setup for upstream:track[short]

expecting success: 
	git for-each-ref --format="%(upstream:track)" refs/heads >actual &&
	test_cmp expected actual

ok 98 - Check upstream:track format

expecting success: 
	git for-each-ref --format="%(upstream:trackshort)" refs/heads >actual &&
	test_cmp expected actual

ok 55 - bisect log: only skip commits left

expecting success: 
	git checkout parallel &&
	git bisect start HEAD $HASH1 &&
	git bisect good HEAD &&
	git bisect bad HEAD &&
	test "$HASH6" = $(git rev-parse --verify HEAD) &&
	git bisect reset

ok 99 - Check upstream:trackshort format

expecting success: 
	test_must_fail git for-each-ref --format="%(refname:track)" 2>/dev/null &&
	test_must_fail git for-each-ref --format="%(refname:trackshort)" 2>/dev/null

From .
 * branch            left       -> FETCH_HEAD
 * branch            right      -> FETCH_HEAD
Switched to branch 'parallel'
ok 100 - Check that :track[short] cannot be used with other atoms

expecting success: 
	cat >expected <<-\EOF &&


	EOF
	test_when_finished "git config branch.master.merge refs/heads/master" &&
	git config branch.master.merge refs/heads/does-not-exist &&
	git for-each-ref \
		--format="%(upstream:track)$LF%(upstream:trackshort)" \
		refs/heads >actual &&
	test_cmp expected actual

Submodule path 'sub1': checked out '7e9f79116e21ad6a3ac18868cba45094b8cda241'
Already on 'master'
ok 101 - Check that :track[short] works when upstream is invalid

expecting success: 
	echo "[ahead 1]" >expected &&
	git for-each-ref --format="%(push:track)" refs/heads >actual &&
	test_cmp expected actual

ok 102 - %(push) supports tracking specifiers, too

expecting success: 
	git for-each-ref --format="%(objectname:short)" refs/heads >actual &&
	test_cmp expected actual

ok 103 - Check short objectname format

expecting success: 
	test_must_fail git for-each-ref --format="%(refname:INVALID)"

fatal: unknown refname: format INVALID
ok 104 - Check for invalid refname format

From .
 * branch            left       -> FETCH_HEAD
 * branch            right      -> FETCH_HEAD
ok 14 - git_bisect: modified submodule does not update submodule work tree from invalid commit

# still have 2 known breakage(s)
# passed all remaining 12 test(s)
1..14
Already on 'master'
Bisecting: 5 revisions left to test after this (roughly 3 steps)
expecting success: 
	git for-each-ref --format="%(objectname:short) %(color:green)%(refname:short)" >actual &&
	test_cmp expected actual

[3f04efc661812c541a2f96ecaae46a79c6ea2464] merge HASH4 and PARA_HASH3
From .
 * branch            left       -> FETCH_HEAD
 * branch            right      -> FETCH_HEAD
ok 105 - Check %(color:...) 

expecting success: 
	git config --bool core.warnambiguousrefs true &&
	git checkout -b newtag &&
	echo "Using $datestamp" > one &&
	git add one &&
	git commit -m "Branch" &&
	setdate_and_increment &&
	git tag -m "Tagging at $datestamp" master &&
	git for-each-ref --format "%(refname:short)" refs/heads/master refs/tags/master >actual &&
	test_cmp expected actual

*** t6301-for-each-ref-errors.sh ***
Switched to a new branch 'newtag'
[newtag 52ef572] Branch
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 16 - shortlog for two branches

expecting success: 
	test_unconfig merge.log &&
	test_config merge.summary yes &&
	git checkout master &&
	test_tick &&
	git fetch . left right &&
	git fmt-merge-msg -F .git/FETCH_HEAD >actual &&
	test_cmp expected actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6301-for-each-ref-errors/.git/
ok 106 - Check ambiguous head and tag refs (strict)

expecting success: 
	git commit --allow-empty -m "Initial" &&
	git tag testtag &&
	git for-each-ref >full-list &&
	git for-each-ref --format="%(objectname) %(refname)" >brief-list

expecting success: 
	git config --bool core.warnambiguousrefs false &&
	git for-each-ref --format "%(refname:short)" refs/heads/master refs/tags/master >actual &&
	test_cmp expected actual

Already on 'master'
Bisecting: 2 revisions left to test after this (roughly 2 steps)
[master (root-commit) 4c27bcb] Initial
 Author: A U Thor <author@example.com>
ok 107 - Check ambiguous head and tag refs (loose)

expecting success: 
	git checkout master &&
	git tag ambiguous testtag^0 &&
	git branch ambiguous testtag^0 &&
	git for-each-ref --format "%(refname:short)" refs/heads/ambiguous refs/tags/ambiguous >actual &&
	test_cmp expected actual

[3659270ffa1e67547111a107f53191676dff3424] Add <7: Should be the last line.> into <hello>.
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)
ok 1 - setup

expecting success: 
	r=refs/heads/bogus &&
	: >.git/$r &&
	test_when_finished "rm -f .git/$r" &&
	echo "warning: ignoring broken ref $r" >broken-err &&
	git for-each-ref >out 2>err &&
	test_cmp full-list out &&
	test_cmp broken-err err

From .
 * branch            left       -> FETCH_HEAD
 * branch            right      -> FETCH_HEAD
ok 2 - Broken refs are reported correctly

expecting success: 
	r=refs/heads/zeros &&
	echo $ZEROS >.git/$r &&
	test_when_finished "rm -f .git/$r" &&
	echo "warning: ignoring broken ref $r" >zeros-err &&
	git for-each-ref >out 2>err &&
	test_cmp full-list out &&
	test_cmp zeros-err err &&
	git for-each-ref --format="%(objectname) %(refname)" >brief-out 2>brief-err &&
	test_cmp brief-list brief-out &&
	test_cmp zeros-err brief-err

ok 108 - Check ambiguous head and tag refs II (loose)

expecting success: 

	git tag -m "bogo" bogo &&
	bogo=$(git cat-file tag bogo) &&
	bogo=$(printf "%s" "$bogo" | git mktag) &&
	git tag -f bogo "$bogo" &&
	git for-each-ref --format "%(body)" refs/tags/bogo


ok 17 - merge-msg -F

expecting success: 
	test_unconfig merge.log &&
	test_config merge.summary yes &&
	git checkout master &&
	test_tick &&
	git fetch . left right &&
	mkdir sub &&
	cp .git/FETCH_HEAD sub/FETCH_HEAD &&
	(
		cd sub &&
		git fmt-merge-msg -F FETCH_HEAD >../actual
	) &&
	test_cmp expected actual

ok 3 - NULL_SHA1 refs are reported correctly

expecting success: 
	r=refs/heads/missing &&
	echo $MISSING >.git/$r &&
	test_when_finished "rm -f .git/$r" &&
	echo "fatal: missing object $MISSING for $r" >missing-err &&
	test_must_fail git for-each-ref 2>err &&
	test_cmp missing-err err &&
	(
		cat brief-list &&
		echo "$MISSING $r"
	) | sort -k 2 >missing-brief-expected &&
	git for-each-ref --format="%(objectname) %(refname)" >brief-out 2>brief-err &&
	test_cmp missing-brief-expected brief-out &&
	test_must_be_empty brief-err

Updated tag 'bogo' (was e89fff1)

ok 109 - an unusual tag with an incomplete line

expecting success: 
	cat >>msg <<-\EOF &&
		the subject line

		first body line
		second body line
	EOF
	git tag -F msg subject-body

Already on 'master'
ok 110 - create tag with subject and body content

expecting success: 
		git for-each-ref --format='%(subject)' refs/tags/subject-body >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
Bisecting: 0 revisions left to test after this (roughly 1 step)
ok 4 - Missing objects are reported correctly

ok 111 - basic atom: refs/tags/subject-body subject

# passed all 4 test(s)
1..4
expecting success: 
		git for-each-ref --format='%(body)' refs/tags/subject-body >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
[ff29dcbe6fe49a0b462bddf0691a013c12a53316] Add <6: Yet a line.> into <hello>.
ok 112 - basic atom: refs/tags/subject-body body

expecting success: 
		git for-each-ref --format='%(contents)' refs/tags/subject-body >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
*** t6500-gc.sh ***
From .
 * branch            left       -> FETCH_HEAD
 * branch            right      -> FETCH_HEAD
ok 113 - basic atom: refs/tags/subject-body contents

expecting success: 
	cat >msg <<-\EOF &&
		first subject line
		second subject line

		first body line
		second body line
	EOF
	git tag -F msg multiline

ok 114 - create tag with multiline subject

expecting success: 
		git for-each-ref --format='%(subject)' refs/tags/multiline >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
Previous HEAD position was ff29dcb... Add <6: Yet a line.> into <hello>.
ok 18 - merge-msg -F in subdirectory

expecting success: 
	test_unconfig merge.log &&
	test_config merge.summary yes &&

	>empty &&

	(
		cd remote &&
		git checkout -b unrelated &&
		test_tick &&
		git fetch origin &&
		git fmt-merge-msg <.git/FETCH_HEAD >../actual
	) &&

	test_cmp empty actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6500-gc/.git/
Switched to branch 'parallel'
ok 115 - basic atom: refs/tags/multiline subject

expecting success: 
		git for-each-ref --format='%(contents:subject)' refs/tags/multiline >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
expecting success: 
	git gc

ok 116 - basic atom: refs/tags/multiline contents:subject

expecting success: 
		git for-each-ref --format='%(body)' refs/tags/multiline >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
Switched to a new branch 'unrelated'
ok 117 - basic atom: refs/tags/multiline body

expecting success: 
		git for-each-ref --format='%(contents:body)' refs/tags/multiline >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
Nothing new to pack.
ok 56 - "git bisect bad HEAD" behaves as "git bisect bad"

# passed all 56 test(s)
1..56
ok 118 - basic atom: refs/tags/multiline contents:body

expecting success: 
		git for-each-ref --format='%(contents:signature)' refs/tags/multiline >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
ok 1 - gc empty repository

expecting success: 
	git gc &&
	test_path_is_missing .git/gc.pid

ok 119 - basic atom: refs/tags/multiline contents:signature

expecting success: 
		git for-each-ref --format='%(contents)' refs/tags/multiline >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
ok 120 - basic atom: refs/tags/multiline contents

expecting success: 
	git tag -s -m "" signed-empty &&
	git tag -s -m "subject line" signed-short &&
	cat >msg <<-\EOF &&
	subject line

	body contents
	EOF
	git tag -s -F msg signed-long

Nothing new to pack.
ok 2 - gc does not leave behind pid file

expecting success: 
	test_expect_code 129 git gc --nonsense 2>err &&
	test_i18ngrep "[Uu]sage: git gc" err

usage: git gc [<options>]
ok 3 - gc --gobbledegook

expecting success: 
	mkdir broken &&
	(
		cd broken &&
		git init &&
		echo "[gc] pruneexpire = CORRUPT" >>.git/config &&
		test_expect_code 129 git gc -h >usage 2>&1
	) &&
	test_i18ngrep "[Uu]sage" broken/usage

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6500-gc/broken/.git/
*** t6501-freshen-objects.sh ***
usage: git gc [<options>]
ok 4 - gc -h with invalid configuration

expecting success: 
	git init remote &&
	(
		cd remote &&
		test_commit initial &&
		git clone . ../client &&
		git branch -m develop &&
		cd ../client &&
		git fetch --prune &&
		git gc
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6500-gc/remote/.git/
ok 121 - create signed tags

expecting success: 
		git for-each-ref --format='%(subject)' refs/tags/signed-empty >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6501-freshen-objects/.git/
[master (root-commit) 24b24cf] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 initial.t
expecting success: 
		rm -rf .git &&
		git init
	
ok 122 - basic atom: refs/tags/signed-empty subject

Cloning into '../client'...
expecting success: 
		git for-each-ref --format='%(contents:subject)' refs/tags/signed-empty >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6501-freshen-objects/.git/
ok 1 - make repo completely empty (loose)

expecting success: 
		git config core.logallrefupdates false &&
		git reflog expire --expire=all --all
	
done.
From /«PKGBUILDDIR»/t/trash directory.t6200-fmt-merge-msg/.
 * [new branch]      left       -> origin/left
ok 123 - basic atom: refs/tags/signed-empty contents:subject

 * [new branch]      long       -> origin/long
   883c9d3..2935695  master     -> origin/master
 * [new branch]      right      -> origin/right
expecting success: 
		git for-each-ref --format='%(body)' refs/tags/signed-empty >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
 * [new tag]         29         -> 29
 * [new tag]         tag-l5     -> tag-l5
ok 2 - disable reflogs (loose)

expecting success: 
		commit base
	
ok 124 - basic atom: refs/tags/signed-empty body

expecting success: 
		git for-each-ref --format='%(contents:body)' refs/tags/signed-empty >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
[master (root-commit) 8539479] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 base
ok 3 - setup basic history (loose)

expecting success: 
		git checkout -b experiment &&
		commit abandon &&
		maybe_repack &&
		git checkout master &&
		git branch -D experiment
	
 * [new tag]         0          -> 0
 * [new tag]         1          -> 1
From /«PKGBUILDDIR»/t/trash directory.t6500-gc/remote/.
 x [deleted]         (none)     -> origin/master
   (refs/remotes/origin/HEAD has become dangling)
 * [new tag]         10         -> 10
 * [new tag]         11         -> 11
 * [new tag]         12         -> 12
 * [new tag]         13         -> 13
 * [new tag]         14         -> 14
 * [new tag]         15         -> 15
ok 125 - basic atom: refs/tags/signed-empty contents:body

 * [new tag]         16         -> 16
 * [new tag]         17         -> 17
 * [new tag]         18         -> 18
expecting success: 
		git for-each-ref --format='%(contents:signature)' refs/tags/signed-empty >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
 * [new tag]         19         -> 19
 * [new tag]         2          -> 2
Switched to a new branch 'experiment'
 * [new tag]         20         -> 20
 * [new tag]         21         -> 21
 * [new tag]         22         -> 22
 * [new tag]         23         -> 23
 * [new tag]         24         -> 24
 * [new tag]         25         -> 25
 * [new tag]         26         -> 26
 * [new branch]      develop    -> origin/develop
 * [new tag]         27         -> 27
 * [new tag]         28         -> 28
 * [new tag]         3          -> 3
 * [new tag]         4          -> 4
 * [new tag]         5          -> 5
 * [new tag]         6          -> 6
 * [new tag]         7          -> 7
 * [new tag]         8          -> 8
ok 126 - basic atom: refs/tags/signed-empty contents:signature

 * [new tag]         9          -> 9
 * [new tag]         tag-r3     -> tag-r3
expecting success: 
		git for-each-ref --format='%(contents)' refs/tags/signed-empty >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
[experiment 20673e5] abandon
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 abandon
Switched to branch 'master'
ok 127 - basic atom: refs/tags/signed-empty contents

expecting success: 
		git for-each-ref --format='%(subject)' refs/tags/signed-short >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
ok 19 - merge-msg with nothing to merge

expecting success: 
	cat >expected <<-EOF &&
	Merge tag ${apos}tag-r3${apos}

	* tag ${apos}tag-r3${apos}:
	  Right #3
	  Common #2
	  Common #1
	EOF

	test_unconfig merge.log &&
	test_config merge.summary yes &&

	git checkout master &&
	test_tick &&
	git fetch . tag tag-r3 &&

	git fmt-merge-msg <.git/FETCH_HEAD >actual &&
	test_cmp expected actual

Deleted branch experiment (was 20673e5).
ok 4 - create and abandon some objects (loose)

expecting success: 
		find .git/objects -type f |
		xargs test-chmtime -v -86400
	
1450177404	.git/objects/df/967b96a579e45a18b8251732d16804b2e56a55
1450177404	.git/objects/85/52142164d268c95f60dabb74465a2f4ffb51b7
1450177404	.git/objects/85/39479d596dcd9b4feb396d859ee478be4032c1
1450177404	.git/objects/36/8d2d2aead85d6788026df78fb3ea74e48356f1
1450177404	.git/objects/3c/36b27185ad016f68c6d00f13268794aa2bd04f
1450177404	.git/objects/20/673e5a8dbcce9d142c11c023c0ed47eeca7b9b
ok 5 - simulate time passing (loose)

expecting success: 
		tree=$(
			GIT_INDEX_FILE=index.tmp &&
			export GIT_INDEX_FILE &&
			git read-tree HEAD &&
			add unrelated &&
			add abandon &&
			git write-tree
		)
	
ok 128 - basic atom: refs/tags/signed-short subject

expecting success: 
		git for-each-ref --format='%(contents:subject)' refs/tags/signed-short >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
Already on 'master'
ok 129 - basic atom: refs/tags/signed-short contents:subject

expecting success: 
		git for-each-ref --format='%(body)' refs/tags/signed-short >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
ok 6 - start writing new commit with old blob (loose)

expecting success: 
		git gc --prune=12.hours.ago
	
ok 130 - basic atom: refs/tags/signed-short body

expecting success: 
		git for-each-ref --format='%(contents:body)' refs/tags/signed-short >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
ok 131 - basic atom: refs/tags/signed-short contents:body

expecting success: 
		git for-each-ref --format='%(contents:signature)' refs/tags/signed-short >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
warning: symbolic ref is dangling: refs/remotes/origin/HEAD
ok 132 - basic atom: refs/tags/signed-short contents:signature
ok 20 - merge-msg tag


expecting success: 
	cat >expected <<-EOF &&
	Merge tags ${apos}tag-r3${apos} and ${apos}tag-l5${apos}

	* tag ${apos}tag-r3${apos}:
	  Right #3
	  Common #2
	  Common #1

	# By Another Author (3) and A U Thor (2)
	# Via Another Committer
	* tag ${apos}tag-l5${apos}:
	  Left #5
	  Left #4
	  Left #3
	  Common #2
	  Common #1
	EOF

	test_unconfig merge.log &&
	test_config merge.summary yes &&

	git checkout master &&
	test_tick &&
	git fetch . tag tag-r3 tag tag-l5 &&

	git fmt-merge-msg <.git/FETCH_HEAD >actual &&
	test_cmp expected actual

expecting success: 
		git for-each-ref --format='%(contents)' refs/tags/signed-short >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
ok 5 - gc is not aborted due to a stale symref

# passed all 5 test(s)
1..5
ok 133 - basic atom: refs/tags/signed-short contents

expecting success: 
		git for-each-ref --format='%(subject)' refs/tags/signed-long >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
Already on 'master'
ok 134 - basic atom: refs/tags/signed-long subject

expecting success: 
		git for-each-ref --format='%(contents:subject)' refs/tags/signed-long >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
*** t7001-mv.sh ***
ok 135 - basic atom: refs/tags/signed-long contents:subject

ok 7 - simultaneous gc (loose)

expecting success: 
		commit=$(echo foo | git commit-tree -p HEAD $tree) &&
		git update-ref HEAD $commit
	
expecting success: 
		git for-each-ref --format='%(body)' refs/tags/signed-long >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
ok 8 - finish writing out commit (loose)

expecting success: 
		git fsck
	
ok 136 - basic atom: refs/tags/signed-long body

expecting success: 
		git for-each-ref --format='%(contents:body)' refs/tags/signed-long >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7001-mv/.git/
ok 9 - repository passes fsck (loose)

expecting success: 
		git reset --hard HEAD^ &&
		find .git/objects -type f |
		xargs test-chmtime -v -86400
	
expecting success: mkdir path0 path1 &&
     cp "$TEST_DIRECTORY"/../COPYING path0/COPYING &&
     git add path0/COPYING &&
     git commit -m add -a
ok 21 - merge-msg two tags

expecting success: 
	cat >expected <<-EOF &&
	Merge branch ${apos}left${apos}, tag ${apos}tag-r3${apos}

	* tag ${apos}tag-r3${apos}:
	  Right #3
	  Common #2
	  Common #1

	# By Another Author (3) and A U Thor (2)
	# Via Another Committer
	* left:
	  Left #5
	  Left #4
	  Left #3
	  Common #2
	  Common #1
	EOF

	test_unconfig merge.log &&
	test_config merge.summary yes &&

	git checkout master &&
	test_tick &&
	git fetch . tag tag-r3 left &&

	git fmt-merge-msg <.git/FETCH_HEAD >actual &&
	test_cmp expected actual

ok 137 - basic atom: refs/tags/signed-long contents:body

HEAD is now at 8539479 base
expecting success: 
		git for-each-ref --format='%(contents:signature)' refs/tags/signed-long >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
1450177405	.git/objects/pack/pack-131a7edfb61f44e4a4ac201487f423bc79616484.pack
1450177405	.git/objects/pack/pack-131a7edfb61f44e4a4ac201487f423bc79616484.idx
1450177405	.git/objects/info/packs
1450177405	.git/objects/36/8d2d2aead85d6788026df78fb3ea74e48356f1
1450177405	.git/objects/c2/1c9352f7526e9576892a6631e0e8cf1fccd34d
1450177405	.git/objects/e2/13540e0ff117379374ee2ee4e2eeede4ef5377
1450177405	.git/objects/10/09e92bdc439db8c1de1fac30c69273cf740c5d
ok 10 - abandon objects again (loose)

expecting success: 
		tree=$(
			GIT_INDEX_FILE=index.tmp &&
			export GIT_INDEX_FILE &&
			git read-tree HEAD &&
			add abandon &&
			add unrelated &&
			git write-tree
		)
	
ok 138 - basic atom: refs/tags/signed-long contents:signature

Already on 'master'
expecting success: 
		git for-each-ref --format='%(contents)' refs/tags/signed-long >actual &&
		sanitize_pgp <actual >actual.clean &&
		test_cmp expected actual.clean
	
[master (root-commit) 54f5ff8] add
 Author: A U Thor <author@example.com>
 1 file changed, 360 insertions(+)
 create mode 100644 path0/COPYING
ok 1 - prepare reference tree

expecting success: cd path0 && git mv COPYING ../path1/COPYING
ok 139 - basic atom: refs/tags/signed-long contents

ok 2 - moving the file out of subdirectory

expecting success: cd .. && git commit -m move-out -a
ok 11 - start writing new commit with same tree (loose)

expecting success: 
		git gc --prune=12.hours.ago
	
expecting success: 
	git for-each-ref --format="%(objectname) %(taggeremail) %(refname)" --sort=objectname --sort=taggeremail \
		refs/tags/bogo refs/tags/master > actual &&
	test_cmp expected actual

[master db92825] move-out
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename {path0 => path1}/COPYING (100%)
ok 3 - commiting the change

expecting success: git diff-tree -r -M --name-status  HEAD^ HEAD | \
    grep "^R100..*path0/COPYING..*path1/COPYING"
From .
 * branch            left       -> FETCH_HEAD
R100	path0/COPYING	path1/COPYING
ok 4 - checking the commit

expecting success: cd path0 && git mv ../path1/COPYING COPYING
ok 140 - Verify sort with multiple keys

# passed all 140 test(s)
1..140
ok 5 - moving the file back into subdirectory

expecting success: cd .. && git commit -m move-in -a
[master 447d9d3] move-in
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename {path1 => path0}/COPYING (100%)
ok 6 - commiting the change

expecting success: git diff-tree -r -M --name-status  HEAD^ HEAD | \
    grep "^R100..*path1/COPYING..*path0/COPYING"
ok 22 - merge-msg tag and branch

expecting success: 
	{
		cat <<-EOF &&
		Merge branch ${apos}long${apos}

		* long: (35 commits)
		EOF

		i=29 &&
		while test $i -gt 9
		do
			echo "  $i" &&
			i=$(($i-1))
		done &&
		echo "  ..."
	} >expected &&

	test_config merge.summary yes &&

	git checkout master &&
	test_tick &&
	git fetch . long &&

	git fmt-merge-msg <.git/FETCH_HEAD >actual &&
	test_cmp expected actual

*** t7003-filter-branch.sh ***
R100	path1/COPYING	path0/COPYING
ok 7 - checking the commit

expecting success: git mv -k idontexist path0
ok 8 - checking -k on non-existing file

expecting success: touch untracked1 &&
     git mv -k untracked1 path0 &&
     test -f untracked1 &&
     test ! -f path0/untracked1
Already on 'master'
ok 9 - checking -k on untracked file

expecting success: touch untracked2 &&
     git mv -k untracked1 untracked2 path0 &&
     test -f untracked1 &&
     test -f untracked2 &&
     test ! -f path0/untracked1 &&
     test ! -f path0/untracked2
ok 10 - checking -k on multiple untracked files

expecting success: touch path0/untracked1 &&
     test_must_fail git mv -f untracked1 path0 &&
     test ! -f .git/index.lock &&
     test -f untracked1 &&
     test -f path0/untracked1
fatal: not under version control, source=untracked1, destination=path0/untracked1
ok 11 - checking -f on untracked file with existing target

expecting success: test_must_fail git mv path0/COPYING no-such-dir/ &&
     test_must_fail git mv path0/COPYING no-such-dir// &&
     git mv path0/ no-such-dir/ &&
     test_path_is_dir no-such-dir
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7003-filter-branch/.git/
fatal: destination directory does not exist, source=path0/COPYING, destination=no-such-dir/
fatal: destination directory does not exist, source=path0/COPYING, destination=no-such-dir/
ok 12 - simultaneous gc (loose)

expecting success: 
		commit=$(echo foo | git commit-tree -p HEAD $tree) &&
		git update-ref HEAD $commit
	
From .
 * branch            long       -> FETCH_HEAD
ok 12 - moving to absent target with trailing slash

expecting success: git reset --hard
ok 13 - finish writing out commit (loose)

expecting success: 
		rm -rf .git &&
		git init
	
HEAD is now at 447d9d3 move-in
ok 13 - clean up

expecting success: mkdir path1 &&
     git mv path0/ path1/ &&
     test_path_is_dir path1/path0/
ok 23 - merge-msg lots of commits

expecting success: 
	test_config merge.log true &&

	git checkout master^0 &&
	git commit --allow-empty -m "One step ahead" &&
	git tag -a -m "An annotated one" annote HEAD &&

	git checkout master &&
	git fetch . annote &&

	git fmt-merge-msg <.git/FETCH_HEAD >actual &&
	{
		cat <<-\EOF
		Merge tag 'annote'

		An annotated one

		* tag 'annote':
		  One step ahead
		EOF
	} >expected &&
	test_cmp expected actual &&

	test_when_finished "git reset --hard" &&
	annote=$(git rev-parse annote) &&
	git merge --no-commit $annote &&
	{
		cat <<-EOF
		Merge tag '$annote'

		An annotated one

		* tag '$annote':
		  One step ahead
		EOF
	} >expected &&
	test_cmp expected .git/MERGE_MSG

ok 14 - moving to existing untracked target with trailing slash

expecting success: mkdir path2 &&
     >path2/file && git add path2/file &&
     git mv path1/path0/ path2/ &&
     test_path_is_dir path2/path0/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t6501-freshen-objects/.git/
ok 14 - make repo completely empty (repack)

expecting success: 
		git config core.logallrefupdates false &&
		git reflog expire --expire=all --all
	
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 2935695... Second
ok 15 - moving to existing tracked target with trailing slash

expecting success: git reset --hard
[detached HEAD a1b29db] One step ahead
 Author: A U Thor <author@example.com>
ok 15 - disable reflogs (repack)
HEAD is now at 447d9d3 move-in

expecting success: 
		commit base
	
ok 16 - clean up

expecting success: cp "$TEST_DIRECTORY"/../README path0/README &&
     git add path0/README &&
     git commit -m add2 -a
[master (root-commit) aa8ecd7] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 base
Previous HEAD position was a1b29db... One step ahead
ok 16 - setup basic history (repack)

expecting success: 
		git checkout -b experiment &&
		commit abandon &&
Switched to branch 'master'
		maybe_repack &&
		git checkout master &&
		git branch -D experiment
	
[master f548f0d] add2
 Author: A U Thor <author@example.com>
 1 file changed, 56 insertions(+)
 create mode 100644 path0/README
ok 17 - adding another file

expecting success: git mv path0 path2
Switched to a new branch 'experiment'
ok 18 - moving whole subdirectory

expecting success: git commit -m dir-move -a
[experiment ff26f38] abandon
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 abandon
[master 1be33d2] dir-move
 Author: A U Thor <author@example.com>
 2 files changed, 0 insertions(+), 0 deletions(-)
 rename {path0 => path2}/COPYING (100%)
 rename {path0 => path2}/README (100%)
ok 19 - commiting the change

expecting success: git diff-tree -r -M --name-status  HEAD^ HEAD | \
     grep "^R100..*path0/COPYING..*path2/COPYING" &&
     git diff-tree -r -M --name-status  HEAD^ HEAD | \
     grep "^R100..*path0/README..*path2/README"
From .
 * tag               annote     -> FETCH_HEAD
R100	path0/COPYING	path2/COPYING
R100	path0/README	path2/README
ok 20 - checking the commit

expecting success: git mv path2/COPYING path2/COPYING-renamed
ok 21 - succeed when source is a prefix of destination

expecting success: git mv path2 path1
ok 22 - moving whole subdirectory into subdirectory

expecting success: git commit -m dir-move -a
Automatic merge went well; stopped before committing as requested
Merging:
2935695 Second
virtual 8b46c6aacb57c799d0614a94329ab758b2fc5b2e
found 1 common ancestor:
2935695 Second
Already up-to-date!
[master 4fbaedc] dir-move
 Author: A U Thor <author@example.com>
 2 files changed, 0 insertions(+), 0 deletions(-)
 rename path2/COPYING => path1/path2/COPYING-renamed (100%)
 rename {path2 => path1/path2}/README (100%)
expecting success: 
	test_commit A &&
	GIT_COMMITTER_DATE="@0 +0000" GIT_AUTHOR_DATE="@0 +0000" &&
	test_commit --notick B &&
	git checkout -b branch B &&
	test_commit D &&
	mkdir dir &&
	test_commit dir/D &&
	test_commit E &&
	git checkout master &&
	test_commit C &&
	git checkout branch &&
	git merge C &&
	git tag F &&
	test_commit G &&
	test_commit H

ok 23 - commiting the change

expecting success: git diff-tree -r -M --name-status  HEAD^ HEAD | \
     grep "^R100..*path2/COPYING..*path1/path2/COPYING" &&
     git diff-tree -r -M --name-status  HEAD^ HEAD | \
     grep "^R100..*path2/README..*path1/path2/README"
HEAD is now at 2935695 Second
ok 24 - merge-msg with "merging" an annotated tag

R100	path2/COPYING	path1/path2/COPYING-renamed
Switched to branch 'master'
# passed all 24 test(s)
1..24
[master (root-commit) 0ddfaf1] A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 A.t
R100	path2/README	path1/path2/README
ok 24 - checking the commit

expecting success: mkdir path0 && mkdir path0/path2 && test_must_fail git mv path2 path0
Deleted branch experiment (was ff26f38).
ok 17 - create and abandon some objects (repack)

expecting success: 
		find .git/objects -type f |
		xargs test-chmtime -v -86400
	
fatal: bad source, source=path2, destination=path0/path2
ok 25 - do not move directory over existing directory

expecting success: git mv path1/path2/ .
1450177406	.git/objects/pack/pack-a68cd586c7bb427b0f0f1261dc7906f2940ae868.pack
1450177406	.git/objects/pack/pack-a68cd586c7bb427b0f0f1261dc7906f2940ae868.idx
1450177406	.git/objects/info/packs
ok 18 - simulate time passing (repack)

expecting success: 
		tree=$(
			GIT_INDEX_FILE=index.tmp &&
			export GIT_INDEX_FILE &&
			git read-tree HEAD &&
			add unrelated &&
			add abandon &&
			git write-tree
		)
	
ok 26 - move into "."

expecting success: 
	rm -fr .git papers partA &&
	git init &&
	mkdir -p papers/unsorted papers/all-papers partA &&
	echo a > papers/unsorted/Thesis.pdf &&
	echo b > partA/outline.txt &&
	echo c > papers/unsorted/_another &&
	git add papers partA &&
	T1=`git write-tree` &&

	git mv papers/unsorted/Thesis.pdf papers/all-papers/moo-blah.pdf &&

	T=`git write-tree` &&
	git ls-tree -r $T | verbose grep partA/outline.txt

[master e86e545] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 B.t
Switched to a new branch 'branch'
ok 19 - start writing new commit with old blob (repack)

expecting success: 
		git gc --prune=12.hours.ago
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7001-mv/.git/
[branch bd662c1] D
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 D.t
*** t7004-tag.sh ***
[branch 3abb9b5] dir/D
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 dir/D.t
100644 blob 61780798228d17af2d34fce4cfbdf35556832472	partA/outline.txt
ok 27 - Michael Cassar's test case

expecting success: 
	rm -fr .git &&
	git init &&
	mkdir ab &&
	date >ab.c &&
	date >ab/d &&
	git add ab.c ab &&
	git commit -m initial &&
	git mv ab a

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7004-tag/.git/
[branch 48ac83b] E
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 E.t
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7001-mv/.git/
Switched to branch 'master'
[master 0e63577] C
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 C.t
[master (root-commit) f8da3c1] initial
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 ab.c
 create mode 100644 ab/d
ok 28 - Sergey Vlasov's test case

expecting success: (

	rm -fr mine &&
	mkdir mine &&
	cd mine &&
	test_create_repo one &&
	cd one &&
	mkdir sub &&
	>sub/file &&
	git add sub/file &&

	git mv sub "$(pwd)/in" &&
	! test -d sub &&
	test -d in &&
	git ls-files --error-unmatch in/file


)
ok 20 - simultaneous gc (repack)

expecting success: 
		commit=$(echo foo | git commit-tree -p HEAD $tree) &&
		git update-ref HEAD $commit
	
Switched to branch 'branch'
ok 21 - finish writing out commit (repack)

expecting success: 
		git fsck
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7001-mv/mine/one/.git/
Merging:
48ac83b E
virtual C
found 1 common ancestor:
e86e545 B
Merge made by the 'recursive' strategy.
 C.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 C.t
dangling commit ff26f380b0104eb69bd2bf57d64d6e29a12ae5fd
ok 22 - repository passes fsck (repack)

expecting success: 
		git reset --hard HEAD^ &&
		find .git/objects -type f |
		xargs test-chmtime -v -86400
	
HEAD is now at aa8ecd7 base
in/file
ok 29 - absolute pathname

expecting success: (

	rm -fr mine &&
	mkdir mine &&
	cd mine &&
	out=$(pwd) &&
	test_create_repo one &&
	cd one &&
	mkdir sub &&
	>sub/file &&
	git add sub/file &&

	test_must_fail git mv sub "$out/out" &&
	test -d sub &&
	! test -d ../in &&
	git ls-files --error-unmatch sub/file

)
[branch 3c39262] G
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 G.t
1450177406	.git/objects/pack/pack-292a042794a6e7bcd47de1ba76195afa794471f4.pack
1450177406	.git/objects/pack/pack-292a042794a6e7bcd47de1ba76195afa794471f4.idx
1450177407	.git/objects/info/packs
1450177406	.git/objects/c2/1c9352f7526e9576892a6631e0e8cf1fccd34d
1450177406	.git/objects/e2/13540e0ff117379374ee2ee4e2eeede4ef5377
1450177406	.git/objects/36/8d2d2aead85d6788026df78fb3ea74e48356f1
1450177406	.git/objects/3c/36b27185ad016f68c6d00f13268794aa2bd04f
1450177406	.git/objects/ff/26f380b0104eb69bd2bf57d64d6e29a12ae5fd
1450177407	.git/objects/75/8e4b168ed640b5a0d33ff4fcc51be6dec9d867
ok 23 - abandon objects again (repack)

expecting success: 
		tree=$(
			GIT_INDEX_FILE=index.tmp &&
			export GIT_INDEX_FILE &&
			git read-tree HEAD &&
			add abandon &&
			add unrelated &&
			git write-tree
		)
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7001-mv/mine/one/.git/
[branch 110eac9] H
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 H.t
ok 1 - setup

ok 24 - start writing new commit with same tree (repack)

expecting success: 
		git gc --prune=12.hours.ago
	
fatal: /«PKGBUILDDIR»/t/trash directory.t7001-mv/mine/out: '/«PKGBUILDDIR»/t/trash directory.t7001-mv/mine/out' is outside repository
expecting success: 
	git filter-branch branch

sub/file
ok 30 - absolute pathname outside should fail

expecting success: 
	rm -fr .git && git init &&
	mkdir dir other &&
	>dir/a.txt &&
	>dir/b.txt &&
	git add dir/?.txt &&
	git mv dir/a.txt dir/b.txt other &&
	git ls-files >actual &&
	{ echo other/a.txt; echo other/b.txt; } >expect &&
	test_cmp expect actual

expecting success: 
	git tag -l &&
	git tag

ok 1 - listing all tags in an empty tree should succeed

expecting success: 
	test `git tag -l | wc -l` -eq 0 &&
	test `git tag | wc -l` -eq 0

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7001-mv/.git/
ok 2 - listing all tags in an empty tree should output nothing

expecting success: ! (tag_exists mytag)
ok 3 - looking for a tag in an empty tree should fail

expecting success: 
	test_must_fail git tag mynotag &&
	! tag_exists mynotag

fatal: Failed to resolve 'HEAD' as a valid ref.
ok 31 - git mv to move multiple sources into a directory

expecting success: 

	rm -fr .git &&
	git init &&
	echo 1 >dirty &&
	git add dirty &&
	entry="$(git ls-files --stage dirty | cut -f 1)" &&
	git mv dirty dirty2 &&
	[ "$entry" = "$(git ls-files --stage dirty2 | cut -f 1)" ] &&
	echo 2 >dirty2 &&
	git mv dirty2 dirty &&
	[ "$entry" = "$(git ls-files --stage dirty | cut -f 1)" ]


ok 4 - creating a tag in an empty tree should fail

expecting success: 
	test_must_fail git tag mytaghead HEAD &&
	! tag_exists mytaghead

fatal: Failed to resolve 'HEAD' as a valid ref.
ok 5 - creating a tag for HEAD in an empty tree should fail

expecting success: 
	test_must_fail git tag mytagnorev aaaaaaaaaaa &&
	! tag_exists mytagnorev

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7001-mv/.git/
fatal: Failed to resolve 'aaaaaaaaaaa' as a valid ref.
ok 6 - creating a tag for an unknown revision should fail

expecting success: 
	test_tick &&
	echo foo >foo &&
	git add foo &&
	git commit -m Foo &&
	git tag mytag &&
	test_must_fail git reflog exists refs/tags/mytag

[master (root-commit) 86e17e4] Foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo

Rewrite 0ddfaf193ff13d6ab39b7cbd9eed645e3ee2f050 (1/9)ok 25 - simultaneous gc (repack)

expecting success: 
		commit=$(echo foo | git commit-tree -p HEAD $tree) &&
		git update-ref HEAD $commit
	
ok 7 - creating a tag using default HEAD should succeed

expecting success: 
	test_when_finished "git tag -d tag_with_reflog" &&
	git tag --create-reflog tag_with_reflog &&
	git reflog exists refs/tags/tag_with_reflog

ok 32 - git mv should not change sha1 of moved cache entry

expecting success: 

	rm -fr .git &&
	git init &&
	echo 1 >moved &&
	test_ln_s_add moved symlink &&
	git add moved &&
	test_must_fail git mv moved symlink &&
	git mv -f moved symlink &&
	! test -e moved &&
	test -f symlink &&
	test "$(cat symlink)" = 1 &&
	git update-index --refresh &&
	git diff-files --quiet


ok 26 - finish writing out commit (repack)

expecting success: 
	cat >broken-commit <<-\EOF &&
	tree 0000000000000000000000000000000000000001
	parent 0000000000000000000000000000000000000002
	author whatever <whatever@example.com> 1234 -0000
	committer whatever <whatever@example.com> 1234 -0000

	some message
	EOF
	commit=$(git hash-object -t commit -w broken-commit) &&
	git gc 2>stderr &&
	verbose git cat-file -e $commit &&
	test_must_be_empty stderr


Rewrite e86e54590a6764f0c4219b3fe8b5e971cd5a0ed8 (2/9)Deleted tag 'tag_with_reflog' (was 86e17e4)
ok 8 - creating a tag with --create-reflog should create reflog

expecting success: 
	test_must_fail git tag --create-reflog mytag &&
	test_must_fail git reflog exists refs/tags/mytag

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7001-mv/.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

)
fatal: tag 'mytag' already exists
prerequisite SYMLINKS ok
ok 9 - --create-reflog does not create reflog on failure

expecting success: 
	git tag -l &&
	git tag

mytag
mytag
ok 10 - listing all tags if one exists should succeed

expecting success: 
	test `git tag -l` = mytag &&
	test `git tag` = mytag

fatal: destination exists, source=moved, destination=symlink

Rewrite bd662c15882f4e7910b78fc26a3d8fe1ffa802e5 (3/9)ok 11 - listing all tags if one exists should output that tag

expecting success: git tag -l mytag
mytag
ok 12 - listing a tag using a matching pattern should succeed

expecting success: test `git tag -l mytag` = mytag
ok 33 - git mv should overwrite symlink to a file

expecting success: 

	rm -fr .git &&
	git init &&
	echo 1 >moved &&
	test_ln_s_add moved symlink &&
	git add moved &&
	test_must_fail git mv symlink moved &&
	git mv -f symlink moved &&
	! test -e symlink &&
	git update-index --refresh &&
	git diff-files --quiet


ok 13 - listing a tag using a matching pattern should output that tag

expecting success: git tag -l xxx
ok 14 - listing tags using a non-matching pattern should suceed

expecting success: test `git tag -l xxx | wc -l` -eq 0

Rewrite 3abb9b554927997a06e6fafc3c62469a75ef32a3 (4/9)ok 15 - listing tags using a non-matching pattern should output nothing

expecting success: test_must_fail git tag mytag
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7001-mv/.git/
fatal: tag 'mytag' already exists
ok 16 - trying to create a tag with the name of one existing should fail

expecting success: 
	test `git tag -l | wc -l` -eq 1 &&
	test_must_fail git tag "" &&
	test_must_fail git tag .othertag &&
	test_must_fail git tag "other tag" &&
	test_must_fail git tag "othertag^" &&
	test_must_fail git tag "other~tag" &&
	test `git tag -l | wc -l` -eq 1

fatal: '' is not a valid tag name.
fatal: '.othertag' is not a valid tag name.
fatal: destination exists, source=symlink, destination=moved
fatal: 'other tag' is not a valid tag name.
ok 27 - do not complain about existing broken links

fatal: 'othertag^' is not a valid tag name.

Rewrite 48ac83b9774bbddb9c1cd6fe140d5380297aa69c (5/9)# passed all 27 test(s)
1..27
fatal: 'other~tag' is not a valid tag name.
ok 17 - trying to create a tag with a non-valid name should fail

expecting success: 
	git tag myhead HEAD &&
	tag_exists myhead

*** t7005-editor.sh ***
ok 34 - git mv should overwrite file with a symlink

expecting success: 

	test -h moved

ok 35 - check moved symlink

expecting success: 
	git commit -m initial &&
	git reset --hard &&
	git submodule add ./. sub &&
	echo content >file &&
	git add file &&
	git commit -m "added sub and file" &&
	git branch submodule

ok 18 - creating a tag using HEAD directly should succeed

expecting success: 
	tag_exists mytag &&
	git tag --force mytag &&
	tag_exists mytag
[master (root-commit) 11d01c1] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 120000 moved

Rewrite 0e63577b8a9dce52b69167d9c008f6a0e30de818 (6/9)HEAD is now at 11d01c1 initial
ok 19 - --force can create a tag with the name of one existing

expecting success: 
	git tag newtag >expect &&
	git tag --force forcetag >actual &&
	test_cmp expect actual

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

	vi=$(TERM=vt100 git var GIT_EDITOR) &&
	test -n "$vi"


ok 20 - --force is moot with a non-existing tag name

ok 1 - determine default editor

Deleted tag 'newtag' (was 86e17e4)
Deleted tag 'forcetag' (was 86e17e4)
expecting success: 
	! tag_exists unknown-tag &&
	test_must_fail git tag -d unknown-tag

error: tag 'unknown-tag' not found.

Rewrite 013e089e8403f3749848f7aafc6f271fb7179dbc (7/9)ok 21 - trying to delete an unknown tag should fail

expecting success: 
	git tag -l > actual && test_cmp expect actual &&
	git tag -d &&
	git tag -l > actual && test_cmp expect actual

expecting success: 

	msg="Hand-edited" &&
	test_commit "$msg" &&
	echo "$msg" >expect &&
	git show -s --format=%s > actual &&
	test_cmp actual expect


ok 22 - trying to delete tags without params should succeed and do nothing

expecting success: 
	tag_exists mytag &&
	tag_exists myhead &&
	git tag -d mytag myhead &&
	! tag_exists mytag &&
	! tag_exists myhead

[master (root-commit) 2ddcc77] Hand-edited
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 Hand-edited.t

Rewrite 3c39262d23e70569701d337b4d27a1e97512c2d9 (8/9)ok 2 - setup

expecting success: 

	if git commit --amend
	then
		echo "Oops?"
		false
	else
		: happy
	fi

Deleted tag 'mytag' (was 86e17e4)
Deleted tag 'myhead' (was 86e17e4)
Cloning into 'sub'...
error: Terminal is dumb, but EDITOR unset
Please supply the message using either -m or -F option.
ok 23 - deleting two existing tags in one command should succeed

expecting success: 
	! tag_exists mytag &&
	git tag mytag &&
	tag_exists mytag

ok 3 - dumb should error out when falling back on vi

expecting success: 

	EDITOR=./e-EDITOR.sh &&
	VISUAL=./e-VISUAL.sh &&
	export EDITOR VISUAL &&
	git commit --amend &&
	test "$(git show -s --format=%s)" = "Edited by EDITOR"


done.
[master 7eecd8c] Edited by EDITOR
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 Hand-edited.t

Rewrite 110eac945dc1713b27bdf49e74e5805db66971f0 (9/9)ok 24 - creating a tag with the name of another deleted one should succeed

expecting success: 
	tag_exists mytag &&
	! tag_exists myhead &&
	test_must_fail git tag -d mytag anothertag &&
	! tag_exists mytag &&
	! tag_exists myhead

ok 4 - dumb should prefer EDITOR to VISUAL

expecting success: 
		git --exec-path=. commit --amend &&
		git show -s --pretty=oneline |
		sed -e "s/^[0-9a-f]* //" >actual &&
		test_cmp actual expect
	
error: tag 'anothertag' not found.
Deleted tag 'mytag' (was 86e17e4)
[master 5b7078a] Edited by editor
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 Hand-edited.t
ok 25 - trying to delete two tags, existing and not, should fail in the 2nd

expecting success: test_must_fail git tag -d mytag
error: tag 'mytag' not found.
ok 5 - Using editor


ok 26 - trying to delete an already deleted tag should fail

expecting success: 
	git tag v1.0.1 &&
	git tag t211 &&
	git tag aa1 &&
	git tag v0.2.1 &&
	git tag v1.1.3 &&
	git tag cba &&
	git tag a1 &&
	git tag v1.0 &&
	git tag t210 &&
	git tag -l > actual &&
	test_cmp expect actual &&
	git tag > actual &&
	test_cmp expect actual

expecting success: 
		git --exec-path=. commit --amend &&
		git show -s --pretty=oneline |
		sed -e "s/^[0-9a-f]* //" >actual &&
		test_cmp actual expect
	
WARNING: Ref 'refs/heads/branch' is unchanged
[master 7eecd8c] Edited by EDITOR
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 Hand-edited.t
ok 2 - rewrite identically

expecting success: 
	test $H = $(git rev-parse HEAD)

ok 6 - Using EDITOR

ok 3 - result is really identical

expecting success: 
	(git config core.bare true && cd .git &&
	 git filter-branch branch > filter-output 2>&1 &&
	! fgrep fatal filter-output)

expecting success: 
		git --exec-path=. commit --amend &&
		git show -s --pretty=oneline |
		sed -e "s/^[0-9a-f]* //" >actual &&
		test_cmp actual expect
	
[master 2ee1d44] Edited by VISUAL
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 Hand-edited.t
[master 401fbc9] added sub and file
 Author: A U Thor <author@example.com>
 3 files changed, 5 insertions(+)
 create mode 100644 .gitmodules
 create mode 100644 file
 create mode 160000 sub
ok 36 - setup submodule

expecting success: 
	test_must_fail git mv sub file

ok 7 - Using VISUAL

fatal: cannot move directory over file, source=sub, destination=file
ok 37 - git mv cannot move a submodule in a file

expecting success: 
	entry="$(git ls-files --stage sub | cut -f 1)" &&
	git rm .gitmodules &&
	(
		cd sub &&
		rm -f .git &&
		cp -R -P -p ../.git/modules/sub .git &&
		GIT_WORK_TREE=. git config --unset core.worktree
	) &&
	mkdir mod &&
	git mv sub mod/sub &&
	! test -e sub &&
	[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&
	(
		cd mod/sub &&
		git status
	) &&
	git update-index --refresh &&
	git diff-files --quiet

expecting success: 
		git --exec-path=. commit --amend &&
		git show -s --pretty=oneline |
		sed -e "s/^[0-9a-f]* //" >actual &&
		test_cmp actual expect
	
rm '.gitmodules'
ok 27 - listing all tags should print them ordered

[master 1c851bb] Edited by core_editor
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 Hand-edited.t
expecting success: 
	rm *a* &&
	git tag -l "*a*" > current &&
	test_cmp expect current

ok 8 - Using core_editor

ok 28 - listing tags with substring as pattern must print those matching

expecting success: 
	git tag -l "*.1" > actual &&
	test_cmp expect actual

expecting success: 
		git --exec-path=. commit --amend &&
		git show -s --pretty=oneline |
		sed -e "s/^[0-9a-f]* //" >actual &&
		test_cmp actual expect
	
ok 29 - listing tags with a suffix as pattern must print those matching

expecting success: 
	git tag -l "t21*" > actual &&
	test_cmp expect actual

[master 1bdd03b] Edited by GIT_EDITOR
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 Hand-edited.t
ok 30 - listing tags with a prefix as pattern must print those matching

expecting success: 
	git tag -l a1 > actual &&
	test_cmp expect actual

ok 9 - Using GIT_EDITOR

expecting success: 
		git --exec-path=. commit --amend &&
		git show -s --pretty=oneline |
		sed -e "s/^[0-9a-f]* //" >actual &&
		test_cmp actual expect
	
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
ok 31 - listing tags using a name as pattern must print that one matching

expecting success: 
	git tag -l v1.0 > actual &&
	test_cmp expect actual

[master 5b7078a] Edited by editor
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 Hand-edited.t
ok 32 - listing tags using a name as pattern must print that one matching

expecting success: 
	git tag -l "v1.?.?" > actual &&
	test_cmp expect actual

ok 38 - git mv moves a submodule with a .git directory and no .gitmodules

expecting success: 
	rm -rf mod &&
	git reset --hard &&
	git submodule update &&
	entry="$(git ls-files --stage sub | cut -f 1)" &&
	(
		cd sub &&
		rm -f .git &&
		cp -R -P -p ../.git/modules/sub .git &&
		GIT_WORK_TREE=. git config --unset core.worktree
	) &&
	mkdir mod &&
	git mv sub mod/sub &&
	! test -e sub &&
	[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&
	(
		cd mod/sub &&
		git status
	) &&
	echo mod/sub >expected &&
	git config -f .gitmodules submodule.sub.path >actual &&
	test_cmp expected actual &&
	git update-index --refresh &&
	git diff-files --quiet

ok 10 - Using editor (override)

expecting success: 
		git --exec-path=. commit --amend &&
		git show -s --pretty=oneline |
		sed -e "s/^[0-9a-f]* //" >actual &&
		test_cmp actual expect
	
ok 33 - listing tags with ? in the pattern should print those matching

expecting success: 
	git tag -l "v.*" > actual &&
	test_cmp expect actual

ok 34 - listing tags using v.* should print nothing because none have v.

expecting success: 
	git tag -l "v*" > actual &&
	test_cmp expect actual

[master 7eecd8c] Edited by EDITOR
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 Hand-edited.t
HEAD is now at 401fbc9 added sub and file
ok 35 - listing tags using v* should print only those having v

ok 11 - Using EDITOR (override)

expecting success: 
	git tag -l "v1*" "v0*" >actual &&
	test_cmp expect actual

expecting success: 
		git --exec-path=. commit --amend &&
		git show -s --pretty=oneline |
		sed -e "s/^[0-9a-f]* //" >actual &&
		test_cmp actual expect
	
ok 36 - tag -l can accept multiple patterns

expecting success: 
	COLUMNS=40 git tag -l --column=row >actual &&
	cat >expected <<\EOF &&
a1      aa1     cba     t210    t211
v0.2.1  v1.0    v1.0.1  v1.1.3
EOF
	test_cmp expected actual

[master 2ee1d44] Edited by VISUAL
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 Hand-edited.t
ok 12 - Using VISUAL (override)

ok 37 - listing tags in column

expecting success: 
	git config column.tag row &&
	git config column.ui dense &&
	COLUMNS=40 git tag -l >actual &&
	git config --unset column.ui &&
	git config --unset column.tag &&
	cat >expected <<\EOF &&
a1      aa1   cba     t210    t211
v0.2.1  v1.0  v1.0.1  v1.1.3
EOF
	test_cmp expected actual

expecting success: 
		git --exec-path=. commit --amend &&
		git show -s --pretty=oneline |
		sed -e "s/^[0-9a-f]* //" >actual &&
		test_cmp actual expect
	
[master 1c851bb] Edited by core_editor
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 Hand-edited.t
ok 13 - Using core_editor (override)

expecting success: 
		git --exec-path=. commit --amend &&
		git show -s --pretty=oneline |
		sed -e "s/^[0-9a-f]* //" >actual &&
		test_cmp actual expect
	
ok 38 - listing tags in column with column.*

expecting success: 
	test_must_fail git tag --column -n

fatal: --column and -n are incompatible
ok 39 - listing tag with -n --column should fail

expecting success: 
	git config column.ui "row dense" &&
	COLUMNS=40 git tag -l -n >actual &&
	git config --unset column.ui &&
	cat >expected <<\EOF &&
a1              Foo
aa1             Foo
cba             Foo
t210            Foo
t211            Foo
v0.2.1          Foo
v1.0            Foo
v1.0.1          Foo
v1.1.3          Foo
EOF
	test_cmp expected actual

[master 1bdd03b] Edited by GIT_EDITOR
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 Hand-edited.t
ok 14 - Using GIT_EDITOR (override)

expecting success: 

	chmod a+x "e space.sh" &&
	GIT_EDITOR="./e\ space.sh" git commit --amend &&
	test space = "$(git show -s --pretty=format:%s)"


ok 40 - listing tags -n in column with column.ui ignored

expecting success: 
	git tag non-annotated-tag &&
	test $(git cat-file -t non-annotated-tag) = commit &&
	test $(git rev-parse non-annotated-tag) = $(git rev-parse HEAD)

[master 5d9c28a] space
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 Hand-edited.t
ok 15 - editor with a space

expecting success: 

	git config core.editor \"./e\ space.sh\" &&
	git commit --amend &&
	test space = "$(git show -s --pretty=format:%s)"


ok 41 - a non-annotated tag created without parameters should point to HEAD

expecting success: test_must_fail git tag -v unknown-tag
error: tag 'unknown-tag' not found.
ok 42 - trying to verify an unknown tag should fail

expecting success: test_must_fail git tag -v non-annotated-tag
[master 5d9c28a] space
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 Hand-edited.t
ok 16 - core.editor with a space

error: 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b: cannot verify a non-tag object of type commit.
error: could not verify the tag 'non-annotated-tag'
ok 43 - trying to verify a non-annotated and non-signed tag should fail

expecting success: test_must_fail git tag -v unknown-tag1 non-annotated-tag unknown-tag2
# passed all 16 test(s)
1..16
error: tag 'unknown-tag1' not found.
error: 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b: cannot verify a non-tag object of type commit.
error: could not verify the tag 'non-annotated-tag'
error: tag 'unknown-tag2' not found.
ok 44 - trying to verify many non-annotated or unknown tags, should fail

Submodule path 'sub': checked out '11d01c17eb9c056425ddb2e7f9dad430a70539b3'
expecting success: 
	git tag -m "A message" annotated-tag &&
	get_tag_msg annotated-tag >actual &&
	test_cmp expect actual

*** t7006-pager.sh ***
ok 45 - creating an annotated tag with -m message should succeed

expecting success: 
	git tag -F msgfile file-annotated-tag &&
	get_tag_msg file-annotated-tag >actual &&
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7006-pager/.git/
ok 46 - creating an annotated tag with -F messagefile should succeed

expecting success: 
	test_might_fail git config --unset core.pager &&
	less=$(
		unset PAGER GIT_PAGER;
		git var GIT_PAGER
	) &&
	test -n "$less"

expecting success: 
	git tag -F - stdin-annotated-tag <inputmsg &&
	get_tag_msg stdin-annotated-tag >actual &&
	test_cmp expect actual

HEAD detached at 11d01c1
nothing to commit, working directory clean
ok 1 - determine default pager

expecting success: 
	sane_unset GIT_PAGER GIT_PAGER_IN_USE &&
	test_unconfig core.pager &&

	PAGER="cat >paginated.out" &&
	export PAGER &&

	test_commit initial

ok 47 - creating an annotated tag with -F - should succeed

expecting success: 
	! test -f nonexistingfile &&
	! tag_exists notag &&
	test_must_fail git tag -F nonexistingfile notag &&
	! tag_exists notag

fatal: could not open or read 'nonexistingfile': No such file or directory
ok 48 - trying to create a tag with a non-existing -F file should fail

expecting success: 
	echo "message file 1" >msgfile1 &&
	echo "message file 2" >msgfile2 &&
	! tag_exists msgtag &&
	test_must_fail git tag -m "message 1" -F msgfile1 msgtag &&
	! tag_exists msgtag &&
	test_must_fail git tag -F msgfile1 -m "message 1" msgtag &&
	! tag_exists msgtag &&
	test_must_fail git tag -m "message 1" -F msgfile1 \
		-m "message 2" msgtag &&
	! tag_exists msgtag

ok 39 - git mv moves a submodule with a .git directory and .gitmodules

expecting success: 
	rm -rf mod &&
	git reset --hard &&
	git submodule update &&
	entry="$(git ls-files --stage sub | cut -f 1)" &&
	mkdir mod &&
	(
		cd mod &&
		git mv ../sub/ .
	) &&
	! test -e sub &&
	[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&
	(
		cd mod/sub &&
		git status
	) &&
	echo mod/sub >expected &&
	git config -f .gitmodules submodule.sub.path >actual &&
	test_cmp expected actual &&
	git update-index --refresh &&
	git diff-files --quiet

[master (root-commit) 24b24cf] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 initial.t
fatal: only one -F or -m option is allowed.
ok 2 - setup

checking prerequisite: TTY

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	test_have_prereq PERL &&

	# Reading from the pty master seems to get stuck _sometimes_
	# on Mac OS X 10.5.0, using Perl 5.10.0 or 5.8.9.
	#
	# Reproduction recipe: run
	#
	#	i=0
	#	while ./test-terminal.perl echo hi $i
	#	do
	#		: $((i = $i + 1))
	#	done
	#
	# After 2000 iterations or so it hangs.
	# https://rt.cpan.org/Ticket/Display.html?id=65692
	#
	test "$(uname -s)" != Darwin &&

	perl "$TEST_DIRECTORY"/test-terminal.perl \
		sh -c "test -t 1 && test -t 2"

)
fatal: only one -F or -m option is allowed.
fatal: only one -F or -m option is allowed.
ok 4 - rewrite bare repository identically

HEAD is now at 401fbc9 added sub and file
ok 49 - trying to create tags giving both -m or -F options should fail

expecting success: 
	test $H = $(git rev-parse HEAD)

expecting success: 
	git tag -m "" empty-annotated-tag &&
	get_tag_msg empty-annotated-tag >actual &&
	test_cmp expect actual

ok 5 - result is really identical

expecting success: 
	mkdir drepo &&
	( cd drepo &&
	git init &&
	test_commit drepo &&
	git filter-branch -d "$TRASHDIR/dfoo" \
		--index-filter "cp \"$TRASHDIR\"/dfoo/backup-refs \"$TRASHDIR\"" \
	) &&
	grep drepo "$TRASHDIR/backup-refs"

ok 50 - creating a tag with an empty -m message should succeed

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7003-filter-branch/drepo/.git/
expecting success: 
	git tag -F emptyfile emptyfile-annotated-tag &&
	get_tag_msg emptyfile-annotated-tag >actual &&
	test_cmp expect actual

[master (root-commit) 9f96758] drepo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 drepo.t
ok 51 - creating a tag with an empty -F messagefile should succeed

expecting success: 
	git tag -F blanksfile blanks-annotated-tag &&
	get_tag_msg blanks-annotated-tag >actual &&
	test_cmp expect actual

ok 52 - extra blanks in the message for an annotated tag should be removed

expecting success: 
	git tag -m "     " blank-annotated-tag &&
	get_tag_msg blank-annotated-tag >actual &&
	test_cmp expect actual

ok 53 - creating a tag with blank -m message with spaces should succeed

expecting success: 
	git tag -F blankfile blankfile-annotated-tag &&
	get_tag_msg blankfile-annotated-tag >actual &&
	test_cmp expect actual

ok 54 - creating a tag with blank -F messagefile with spaces should succeed

expecting success: 
	git tag -F blanknonlfile blanknonlfile-annotated-tag &&
	get_tag_msg blanknonlfile-annotated-tag >actual &&
	test_cmp expect actual

ok 55 - creating a tag with -F file of spaces and no newline should succeed

expecting success: 
	git tag -F commentsfile comments-annotated-tag &&
	get_tag_msg comments-annotated-tag >actual &&
	test_cmp expect actual

prerequisite TTY ok
expecting success: 
	rm -f paginated.out &&
	test_terminal git log &&
	test -e paginated.out


Rewrite 9f9675864b1443cf5a1e281c740a8ba331951fba (1/1)ok 56 - creating a tag using a -F messagefile with #comments should succeed

expecting success: 
	git tag -m "#comment" comment-annotated-tag &&
	get_tag_msg comment-annotated-tag >actual &&
	test_cmp expect actual

Submodule path 'sub': checked out '11d01c17eb9c056425ddb2e7f9dad430a70539b3'
ok 57 - creating a tag with a #comment in the -m message should succeed

expecting success: 
	git tag -F commentfile commentfile-annotated-tag &&
	get_tag_msg commentfile-annotated-tag >actual &&
	test_cmp expect actual


ok 58 - creating a tag with #comments in the -F messagefile should succeed

WARNING: Ref 'refs/heads/master' is unchanged
HEAD detached at 11d01c1
nothing to commit, working directory clean
expecting success: 
	git tag -F commentnonlfile commentnonlfile-annotated-tag &&
	get_tag_msg commentnonlfile-annotated-tag >actual &&
	test_cmp expect actual

9f9675864b1443cf5a1e281c740a8ba331951fba commit	refs/tags/drepo
ok 6 - correct GIT_DIR while using -d

expecting success: 
	git init drepo-tree &&
	(
		cd drepo-tree &&
		test_commit one &&
		git filter-branch -d "$TRASHDIR/dfoo" \
			--tree-filter "echo changed >one.t" &&
		echo changed >expect &&
		git cat-file blob HEAD:one.t >actual &&
		test_cmp expect actual &&
		test_cmp one.t actual
	)

ok 59 - creating a tag with a file of #comment and no newline should succeed

expecting success: 
	git tag -m "A msg" tag-one-line &&

	echo "tag-one-line" >expect &&
	git tag -l | grep "^tag-one-line" >actual &&
	test_cmp expect actual &&
	git tag -n0 -l | grep "^tag-one-line" >actual &&
	test_cmp expect actual &&
	git tag -n0 -l tag-one-line >actual &&
	test_cmp expect actual &&

	echo "tag-one-line    A msg" >expect &&
	git tag -n1 -l | grep "^tag-one-line" >actual &&
	test_cmp expect actual &&
	git tag -n -l | grep "^tag-one-line" >actual &&
	test_cmp expect actual &&
	git tag -n1 -l tag-one-line >actual &&
	test_cmp expect actual &&
	git tag -n2 -l tag-one-line >actual &&
	test_cmp expect actual &&
	git tag -n999 -l tag-one-line >actual &&
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7003-filter-branch/drepo-tree/.git/
ok 40 - git mv moves a submodule with gitfile

expecting success: 
	rm -rf mod &&
	git reset --hard &&
	git submodule update &&
	git rm .gitmodules &&
	entry="$(git ls-files --stage sub | cut -f 1)" &&
	mkdir mod &&
	git mv sub mod/sub 2>actual.err &&
	! test -s actual.err &&
	! test -e sub &&
	[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&
	(
		cd mod/sub &&
		git status
	) &&
	git update-index --refresh &&
	git diff-files --quiet

HEAD is now at 401fbc9 added sub and file
[master (root-commit) d944c64] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.t
ok 60 - listing the one-line message of a non-signed tag should succeed

expecting success: 
	git tag -m "" tag-zero-lines &&

	echo "tag-zero-lines" >expect &&
	git tag -l | grep "^tag-zero-lines" >actual &&
	test_cmp expect actual &&
	git tag -n0 -l | grep "^tag-zero-lines" >actual &&
	test_cmp expect actual &&
	git tag -n0 -l tag-zero-lines >actual &&
	test_cmp expect actual &&

	echo "tag-zero-lines  " >expect &&
	git tag -n1 -l | grep "^tag-zero-lines" >actual &&
	test_cmp expect actual &&
	git tag -n -l | grep "^tag-zero-lines" >actual &&
	test_cmp expect actual &&
	git tag -n1 -l tag-zero-lines >actual &&
	test_cmp expect actual &&
	git tag -n2 -l tag-zero-lines >actual &&
	test_cmp expect actual &&
	git tag -n999 -l tag-zero-lines >actual &&
	test_cmp expect actual

ok 3 - some commands use a pager

checking known breakage: 
	echo subdir/paginated.out >expected &&
	mkdir -p subdir &&
	rm -f paginated.out subdir/paginated.out &&
	(
		cd subdir &&
		test_terminal git log
	) &&
	{
		ls paginated.out subdir/paginated.out ||
		:
	} >actual &&
	test_cmp expected actual


Rewrite d944c643197c4e8b1e89974e6d9ba85df421b65d (1/1)ok 61 - listing the zero-lines message of a non-signed tag should succeed

expecting success: 
	git tag -F annotagmsg tag-lines &&

	echo "tag-lines" >expect &&
	git tag -l | grep "^tag-lines" >actual &&
	test_cmp expect actual &&
	git tag -n0 -l | grep "^tag-lines" >actual &&
	test_cmp expect actual &&
	git tag -n0 -l tag-lines >actual &&
	test_cmp expect actual &&

	echo "tag-lines       tag line one" >expect &&
	git tag -n1 -l | grep "^tag-lines" >actual &&
	test_cmp expect actual &&
	git tag -n -l | grep "^tag-lines" >actual &&
	test_cmp expect actual &&
	git tag -n1 -l tag-lines >actual &&
	test_cmp expect actual &&

	echo "    tag line two" >>expect &&
	git tag -n2 -l | grep "^ *tag.line" >actual &&
	test_cmp expect actual &&
	git tag -n2 -l tag-lines >actual &&
	test_cmp expect actual &&

	echo "    tag line three" >>expect &&
	git tag -n3 -l | grep "^ *tag.line" >actual &&
	test_cmp expect actual &&
	git tag -n3 -l tag-lines >actual &&
	test_cmp expect actual &&
	git tag -n4 -l | grep "^ *tag.line" >actual &&
	test_cmp expect actual &&
	git tag -n4 -l tag-lines >actual &&
	test_cmp expect actual &&
	git tag -n99 -l | grep "^ *tag.line" >actual &&
	test_cmp expect actual &&
	git tag -n99 -l tag-lines >actual &&
	test_cmp expect actual

Submodule path 'sub': checked out '11d01c17eb9c056425ddb2e7f9dad430a70539b3'
rm '.gitmodules'

Ref 'refs/heads/master' was rewritten
HEAD detached at 11d01c1
nothing to commit, working directory clean
ok 41 - mv does not complain when no .gitmodules file is found

expecting success: 
	rm -rf mod &&
	git reset --hard &&
	git submodule update &&
	git config -f .gitmodules foo.bar true &&
	entry="$(git ls-files --stage sub | cut -f 1)" &&
	mkdir mod &&
	test_must_fail git mv sub mod/sub 2>actual.err &&
	test -s actual.err &&
	test -e sub &&
	git diff-files --quiet -- sub &&
	git add .gitmodules &&
	git mv sub mod/sub 2>actual.err &&
	! test -s actual.err &&
	! test -e sub &&
	[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&
	(
		cd mod/sub &&
		git status
	) &&
	git update-index --refresh &&
	git diff-files --quiet

HEAD is now at 401fbc9 added sub and file
ok 7 - tree-filter works with -d

expecting success: 
	test_must_fail git filter-branch -f --commit-filter "exit 1" HEAD

ok 62 - listing many message lines of a non-signed tag should succeed

expecting success: 
	blob=$(git hash-object -w --stdin <<-\EOF
	Blob paragraph 1.

	Blob paragraph 2.
	EOF
	) &&
	git tag tag-blob $blob &&
	echo "tag-blob        " >expect &&
	git tag -n1 -l tag-blob >actual &&
	test_cmp expect actual

ls: cannot access subdir/paginated.out: No such file or directory
--- expected	2015-12-16 11:03:31.873564871 +0000
+++ actual	2015-12-16 11:03:32.669564871 +0000
@@ -1 +1 @@
-subdir/paginated.out
+paginated.out
not ok 4 - pager runs from subdir # TODO known breakage

expecting success: 
	(
		sane_unset LESS LV &&
		PAGER="env >pager-env.out; wc" &&
		export PAGER &&

		test_terminal git log
	) &&
	grep ^LESS= pager-env.out &&
	grep ^LV= pager-env.out

ok 63 - annotations for blobs are empty

expecting success: 
	tag_exists annotated-tag &&
	test_must_fail git tag -v annotated-tag

error: no signature found
object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag annotated-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

A message
error: could not verify the tag 'annotated-tag'

Rewrite 0ddfaf193ff13d6ab39b7cbd9eed645e3ee2f050 (1/9)ok 64 - trying to verify an annotated non-signed tag should fail

expecting success: 
	tag_exists file-annotated-tag &&
	test_must_fail git tag -v file-annotated-tag

error: no signature found
object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag file-annotated-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

Another message
in a file.
error: could not verify the tag 'file-annotated-tag'
ok 65 - trying to verify a file-annotated non-signed tag should fail

expecting success: 
	tag_exists annotated-tag file-annotated-tag &&
	test_must_fail git tag -v annotated-tag file-annotated-tag

could not write rewritten commit
ok 8 - Fail if commit filter fails

expecting success: 
	git filter-branch -f --tree-filter "mv D.t doh || :" HEAD

error: no signature found
object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag annotated-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

A message
error: could not verify the tag 'annotated-tag'
error: no signature found
object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag file-annotated-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

Another message
in a file.
error: could not verify the tag 'file-annotated-tag'
ok 66 - trying to verify two annotated non-signed tags should fail

expecting success: 
	git tag -s -m "A signed tag message" signed-tag &&
	get_tag_msg signed-tag >actual &&
	test_cmp expect actual

Submodule path 'sub': checked out '11d01c17eb9c056425ddb2e7f9dad430a70539b3'
ok 67 - creating a signed tag with -m message should succeed

expecting success: 

	git tag -u committer@example.com -m "Another message" u-signed-tag &&
	get_tag_msg u-signed-tag >actual &&
	test_cmp expect actual


ok 68 - sign with a given key id

expecting success: 

	test_must_fail git tag -u author@example.com \
		-m "Another message" o-signed-tag


HEAD detached at 11d01c1
nothing to commit, working directory clean
gpg: skipped "author@example.com": secret key not available
gpg: signing failed: secret key not available
error: gpg failed to sign the data
error: unable to sign the tag

Rewrite 0ddfaf193ff13d6ab39b7cbd9eed645e3ee2f050 (1/9)ok 69 - sign with an unknown id (1)

expecting success: 

	test_must_fail git tag -u DEADBEEF -m "Another message" o-signed-tag


ok 42 - mv will error out on a modified .gitmodules file unless staged

expecting success: 
	rm -rf mod &&
	git reset --hard &&
	git submodule update &&
	git config -f .gitmodules --remove-section submodule.sub &&
	git add .gitmodules &&
	entry="$(git ls-files --stage sub | cut -f 1)" &&
	echo "warning: Could not find section in .gitmodules where path=sub" >expect.err &&
	mkdir mod &&
	git mv sub mod/sub 2>actual.err &&
	test_i18ncmp expect.err actual.err &&
	! test -e sub &&
	[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&
	(
		cd mod/sub &&
		git status
	) &&
	git update-index --refresh &&
	git diff-files --quiet

gpg: skipped "DEADBEEF": secret key not available
gpg: signing failed: secret key not available
error: gpg failed to sign the data
error: unable to sign the tag
ok 70 - sign with an unknown id (2)

mv: cannot stat 'D.t': No such file or directory
expecting success: 
	GIT_EDITOR=./fakeeditor git tag -u CDDE430D implied-sign &&
	get_tag_msg implied-sign >actual &&
	test_cmp expect actual

HEAD is now at 401fbc9 added sub and file
      5      15     137

Rewrite e86e54590a6764f0c4219b3fe8b5e971cd5a0ed8 (2/9)ok 71 - -u implies signed tag

LESS=FRX
expecting success: 
	git tag -s -F sigmsgfile file-signed-tag &&
	get_tag_msg file-signed-tag >actual &&
	test_cmp expect actual

LV=-c
ok 5 - LESS and LV envvars are set for pagination

expecting success: 
	rm -f paginated.out &&
	test_terminal git rev-list HEAD &&
	! test -e paginated.out

mv: cannot stat 'D.t': No such file or directory
ok 72 - creating a signed tag with -F messagefile should succeed

expecting success: 
	git tag -s -F - stdin-signed-tag <siginputmsg &&
	get_tag_msg stdin-signed-tag >actual &&
	test_cmp expect actual


Rewrite bd662c15882f4e7910b78fc26a3d8fe1ffa802e5 (3/9)ok 73 - creating a signed tag with -F - should succeed

expecting success: 
	GIT_EDITOR=./fakeeditor git tag -s implied-annotate &&
	get_tag_msg implied-annotate >actual &&
	test_cmp expect actual

Submodule path 'sub': checked out '11d01c17eb9c056425ddb2e7f9dad430a70539b3'

Rewrite 3abb9b554927997a06e6fafc3c62469a75ef32a3 (4/9)ok 74 - -s implies annotated tag

expecting success: 
	! test -f nonexistingfile &&
	! tag_exists nosigtag &&
	test_must_fail git tag -s -F nonexistingfile nosigtag &&
	! tag_exists nosigtag

fatal: could not open or read 'nonexistingfile': No such file or directory
ok 75 - trying to create a signed tag with non-existing -F file should fail

expecting success: git tag -v signed-tag
HEAD detached at 11d01c1
nothing to commit, working directory clean
24b24cf8a829f5b8c30dfc018b0a459a2ccaf380
ok 6 - some commands do not use a pager

expecting success: 
	rm -f paginated.out &&
	git log | cat &&
	! test -e paginated.out

gpg: Signature made Wed Dec 16 11:03:32 2015 UTC using DSA key ID CDDE430D
gpg: checking the trustdb
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: Good signature from "C O Mitter <committer@example.com>"
object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag signed-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

A signed tag message
ok 76 - verifying a signed tag should succeed

expecting success: git tag -v signed-tag file-signed-tag

Rewrite 48ac83b9774bbddb9c1cd6fe140d5380297aa69c (5/9)ok 43 - mv issues a warning when section is not found in .gitmodules

expecting success: 
	rm -rf mod &&
	git reset --hard &&
	git submodule update &&
	mkdir mod &&
	git mv -n sub mod/sub 2>actual.err &&
	test -f sub/.git &&
	git diff-index --exit-code HEAD &&
	git update-index --refresh &&
	git diff-files --quiet -- sub .gitmodules

commit 24b24cf8a829f5b8c30dfc018b0a459a2ccaf380
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:13:13 2005 -0700

    initial
ok 7 - no pager when stdout is a pipe

expecting success: 
	rm -f paginated.out &&
	git log >file &&
	! test -e paginated.out

ok 8 - no pager when stdout is a regular file

expecting success: 
	rm -f paginated.out &&
	test_terminal git --paginate rev-list HEAD &&
	test -e paginated.out

HEAD is now at 401fbc9 added sub and file
gpg: Signature made Wed Dec 16 11:03:32 2015 UTC using DSA key ID CDDE430D
gpg: Good signature from "C O Mitter <committer@example.com>"
object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag signed-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

A signed tag message
gpg: Signature made Wed Dec 16 11:03:33 2015 UTC using DSA key ID CDDE430D
gpg: Good signature from "C O Mitter <committer@example.com>"
object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag file-signed-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

Another signed tag
message in a file.
ok 77 - verifying two signed tags in one command should succeed

expecting success: 
	test_must_fail git tag -v signed-tag annotated-tag &&
	test_must_fail git tag -v file-annotated-tag file-signed-tag &&
	test_must_fail git tag -v annotated-tag \
		file-signed-tag file-annotated-tag &&
	test_must_fail git tag -v signed-tag annotated-tag file-signed-tag

gpg: Signature made Wed Dec 16 11:03:32 2015 UTC using DSA key ID CDDE430D
gpg: Good signature from "C O Mitter <committer@example.com>"

Rewrite 0e63577b8a9dce52b69167d9c008f6a0e30de818 (6/9)object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag signed-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

A signed tag message
error: no signature found
object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag annotated-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

A message
error: could not verify the tag 'annotated-tag'
error: no signature found
object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag file-annotated-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

Another message
in a file.
error: could not verify the tag 'file-annotated-tag'
mv: cannot stat 'D.t': No such file or directory
gpg: Signature made Wed Dec 16 11:03:33 2015 UTC using DSA key ID CDDE430D
gpg: Good signature from "C O Mitter <committer@example.com>"
object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag file-signed-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

Another signed tag
message in a file.
error: no signature found
object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag annotated-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

A message
error: could not verify the tag 'annotated-tag'
gpg: Signature made Wed Dec 16 11:03:33 2015 UTC using DSA key ID CDDE430D
gpg: Good signature from "C O Mitter <committer@example.com>"

Rewrite 013e089e8403f3749848f7aafc6f271fb7179dbc (7/9)object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag file-signed-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

Another signed tag
message in a file.
error: no signature found
object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag file-annotated-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

Another message
in a file.
error: could not verify the tag 'file-annotated-tag'
gpg: Signature made Wed Dec 16 11:03:32 2015 UTC using DSA key ID CDDE430D
gpg: Good signature from "C O Mitter <committer@example.com>"
object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag signed-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

A signed tag message
object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag annotated-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

A message
error: no signature found
error: could not verify the tag 'annotated-tag'
gpg: Signature made Wed Dec 16 11:03:33 2015 UTC using DSA key ID CDDE430D
gpg: Good signature from "C O Mitter <committer@example.com>"
object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag file-signed-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

Another signed tag
message in a file.
ok 78 - verifying many signed and non-signed tags should fail

Submodule path 'sub': checked out '11d01c17eb9c056425ddb2e7f9dad430a70539b3'
expecting success: 
	forged=$(git cat-file tag signed-tag |
		sed -e "s/signed-tag/forged-tag/" |
		git mktag) &&
	git tag forged-tag $forged &&
	test_must_fail git tag -v forged-tag

ok 9 - git --paginate rev-list uses a pager

expecting success: 
	rm -f file paginated.out &&
	git --paginate log | cat &&
	! test -e paginated.out

Checking rename of 'sub' to 'mod/sub'
Renaming sub to mod/sub
commit 24b24cf8a829f5b8c30dfc018b0a459a2ccaf380
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:13:13 2005 -0700

    initial
ok 10 - no pager even with --paginate when stdout is a pipe

expecting success: 
	rm -f paginated.out &&
	test_terminal git --no-pager log &&
	! test -e paginated.out

gpg: Signature made Wed Dec 16 11:03:32 2015 UTC using DSA key ID CDDE430D
gpg: BAD signature from "C O Mitter <committer@example.com>"

Rewrite 3c39262d23e70569701d337b4d27a1e97512c2d9 (8/9)object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag forged-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

A signed tag message
error: could not verify the tag 'forged-tag'
ok 79 - verifying a forged tag should fail

expecting success: 
	git tag -s -m "" empty-signed-tag &&
	get_tag_msg empty-signed-tag >actual &&
	test_cmp expect actual &&
	git tag -v empty-signed-tag

ok 44 - mv --dry-run does not touch the submodule or .gitmodules

expecting success: 
	git mv sub sub2 &&
	git commit -m "moved sub to sub2" &&
	git checkout -q HEAD^ 2>actual &&
	test_i18ngrep "^warning: unable to rmdir sub2:" actual &&
	git status -s sub2 >actual &&
	echo "?? sub2/" >expected &&
	test_cmp expected actual &&
	! test -f sub/.git &&
	test -f sub2/.git &&
	git submodule update &&
	test -f sub/.git &&
	rm -rf sub2 &&
	git diff-index --exit-code HEAD &&
	git update-index --refresh &&
	git diff-files --quiet -- sub .gitmodules &&
	git status -s sub2 >actual &&
	! test -s actual

[master 3a40e7c] moved sub to sub2
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename sub => sub2 (100%)

Rewrite 110eac945dc1713b27bdf49e74e5805db66971f0 (9/9)warning: unable to rmdir sub2: Directory not empty
gpg: Signature made Wed Dec 16 11:03:35 2015 UTC using DSA key ID CDDE430D
gpg: Good signature from "C O Mitter <committer@example.com>"
object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag empty-signed-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

ok 80 - creating a signed tag with an empty -m message should succeed

expecting success: 
	git tag -s -F sigemptyfile emptyfile-signed-tag &&
	get_tag_msg emptyfile-signed-tag >actual &&
	test_cmp expect actual &&
	git tag -v emptyfile-signed-tag


Ref 'refs/heads/branch' was rewritten
gpg: Signature made Wed Dec 16 11:03:35 2015 UTC using DSA key ID CDDE430D
gpg: Good signature from "C O Mitter <committer@example.com>"
object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag emptyfile-signed-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

ok 81 - creating a signed tag with an empty -F messagefile should succeed

commit 24b24cf8a829f5b8c30dfc018b0a459a2ccaf380
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:13:13 2005 -0700

    initial
expecting success: 
	git tag -s -F sigblanksfile blanks-signed-tag &&
	get_tag_msg blanks-signed-tag >actual &&
	test_cmp expect actual &&
	git tag -v blanks-signed-tag

ok 11 - no pager with --no-pager

ok 9 - rewrite, renaming a specific file

expecting success: 
	test D = "$(git show HEAD:doh --)" &&
	! test -f D.t &&
	test -f doh &&
	test D = "$(cat doh)"

expecting success: 
	rm -f paginated.out &&
	test_unconfig pager.grep &&
	test_terminal git grep initial &&
	test -e paginated.out &&

	rm -f paginated.out &&
	test_config pager.grep false &&
	test_terminal git grep initial &&
	! test -e paginated.out

ok 10 - test that the file was renamed

expecting success: 
	git filter-branch -f --tree-filter "mv dir diroh || :" HEAD

gpg: Signature made Wed Dec 16 11:03:35 2015 UTC using DSA key ID CDDE430D
gpg: Good signature from "C O Mitter <committer@example.com>"
object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag blanks-signed-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

Leading blank lines

Repeated blank lines

Trailing spaces

Trailing blank lines
ok 82 - extra blanks in the message for a signed tag should be removed

expecting success: 
	git tag -s -m "     " blank-signed-tag &&
	get_tag_msg blank-signed-tag >actual &&
	test_cmp expect actual &&
	git tag -v blank-signed-tag

Submodule path 'sub': checked out '11d01c17eb9c056425ddb2e7f9dad430a70539b3'
ok 45 - checking out a commit before submodule moved needs manual updates

expecting success: 
	git checkout submodule &&
	mkdir dummy dest &&
	git mv -k dummy sub dest &&
	git status --porcelain >actual &&
	grep "^R  sub -> dest/sub" actual &&
	git reset --hard &&
	git checkout .

gpg: Signature made Wed Dec 16 11:03:35 2015 UTC using DSA key ID CDDE430D
gpg: Good signature from "C O Mitter <committer@example.com>"
object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag blank-signed-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

ok 83 - creating a signed tag with a blank -m message should succeed


Rewrite 0ddfaf193ff13d6ab39b7cbd9eed645e3ee2f050 (1/9)expecting success: 
	git tag -s -F sigblankfile blankfile-signed-tag &&
	get_tag_msg blankfile-signed-tag >actual &&
	test_cmp expect actual &&
	git tag -v blankfile-signed-tag

Switched to branch 'submodule'
mv: cannot stat 'dir': No such file or directory
R  sub -> dest/sub
warning: unable to rmdir dest/sub: Directory not empty
HEAD is now at 401fbc9 added sub and file
ok 46 - mv -k does not accidentally destroy submodules

gpg: Signature made Wed Dec 16 11:03:35 2015 UTC using DSA key ID CDDE430D
gpg: Good signature from "C O Mitter <committer@example.com>"

Rewrite e86e54590a6764f0c4219b3fe8b5e971cd5a0ed8 (2/9)object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag blankfile-signed-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

ok 84 - creating a signed tag with blank -F file with spaces should succeed

# passed all 46 test(s)
1..46
expecting success: 
	git tag -s -F sigblanknonlfile blanknonlfile-signed-tag &&
	get_tag_msg blanknonlfile-signed-tag >actual &&
	test_cmp expect actual &&
	git tag -v signed-tag

mv: cannot stat 'dir': No such file or directory
*** t7007-show.sh ***
gpg: Signature made Wed Dec 16 11:03:32 2015 UTC using DSA key ID CDDE430D
gpg: Good signature from "C O Mitter <committer@example.com>"
object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag signed-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

A signed tag message
ok 85 - creating a signed tag with spaces and no newline should succeed


Rewrite 3d6c5360ccb48d27bbc524f53496821309a1fc79 (3/9)expecting success: 
	git tag -s -F sigcommentsfile comments-signed-tag &&
	get_tag_msg comments-signed-tag >actual &&
	test_cmp expect actual &&
	git tag -v comments-signed-tag

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7007-show/.git/
expecting success: 
	echo hello world >foo &&
	H=$(git hash-object -w foo) &&
	git tag -a foo-tag -m "Tags $H" $H &&
	HH=$(expr "$H" : "\(..\)") &&
	H38=$(expr "$H" : "..\(.*\)") &&
	rm -f .git/objects/$HH/$H38

mv: cannot stat 'dir': No such file or directory
ok 1 - setup

expecting success: 
	test_must_fail git --no-pager show foo-tag

error: sha1 mismatch 3b18e512dba79e4c8300dd08aeb37f8e728b8dad
error: Could not read object 3b18e512dba79e4c8300dd08aeb37f8e728b8dad
tag foo-tag
Tagger: C O Mitter <committer@example.com>
Date:   Wed Dec 16 11:03:36 2015 +0000

Tags 3b18e512dba79e4c8300dd08aeb37f8e728b8dad
ok 2 - showing a tag that point at a missing object

expecting success: 
	test_commit main1 &&
	test_commit main2 &&
	test_commit main3 &&
	git tag -m "annotated tag" annotated &&
	git checkout -b side HEAD^^ &&
	test_commit side2 &&
	test_commit side3 &&
	test_merge merge main3


Rewrite 28e3b83a5f2c2b87fa77b674df1529da9f4a66b4 (4/9)[master (root-commit) 9ca29bf] main1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 main1.t
gpg: Signature made Wed Dec 16 11:03:36 2015 UTC using DSA key ID CDDE430D
gpg: Good signature from "C O Mitter <committer@example.com>"
object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag comments-signed-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

The message.
One line.

Another line.

Last line.
ok 86 - creating a signed tag with a -F file with #comments should succeed

expecting success: 
	git tag -s -m "#comment" comment-signed-tag &&
	get_tag_msg comment-signed-tag >actual &&
	test_cmp expect actual &&
	git tag -v comment-signed-tag

[master 6983cd6] main2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 main2.t
initial.t:initial
[master 75daec8] main3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 main3.t

Rewrite b0e1a7fc77c44f8710a324ce0cdaa5f0e3f41f41 (5/9)ok 12 - configuration can disable pager

expecting success: 
	rm -f paginated.out &&
	test_config pager.config true &&
	test_terminal git config --list &&
	test -e paginated.out

Switched to a new branch 'side'
gpg: Signature made Wed Dec 16 11:03:36 2015 UTC using DSA key ID CDDE430D
gpg: Good signature from "C O Mitter <committer@example.com>"
object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag comment-signed-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

ok 87 - creating a signed tag with #commented -m message should succeed

expecting success: 
	git tag -s -F sigcommentfile commentfile-signed-tag &&
	get_tag_msg commentfile-signed-tag >actual &&
	test_cmp expect actual &&
	git tag -v commentfile-signed-tag

[side 2e812aa] side2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 side2.t
[side 42b83a8] side3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 side3.t
gpg: Signature made Wed Dec 16 11:03:36 2015 UTC using DSA key ID CDDE430D
gpg: Good signature from "C O Mitter <committer@example.com>"

Rewrite 0e63577b8a9dce52b69167d9c008f6a0e30de818 (6/9)object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag commentfile-signed-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

ok 88 - creating a signed tag with #commented -F messagefile should succeed

Merging:
42b83a8 side3
virtual main3
found 1 common ancestor:
9ca29bf main1
Merge made by the 'recursive' strategy.
expecting success: 
	git tag -s -F sigcommentnonlfile commentnonlfile-signed-tag &&
	get_tag_msg commentnonlfile-signed-tag >actual &&
	test_cmp expect actual &&
	git tag -v commentnonlfile-signed-tag

 main2.t | 1 +
 main3.t | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 main2.t
 create mode 100644 main3.t
ok 3 - set up a bit of history

expecting success: 
	cat >expect <<-EOF &&
	commit $(git rev-parse main2)
	commit $(git rev-parse main3)
	EOF
	git show main2 main3 >actual &&
	grep ^commit actual >actual.filtered &&
	test_cmp expect actual.filtered

mv: cannot stat 'dir': No such file or directory
ok 4 - showing two commits

expecting success: 
	cat >expect <<-EOF &&
	commit $(git rev-parse main3)
	commit $(git rev-parse main2)
	EOF
	git show main1..main3 >actual &&
	grep ^commit actual >actual.filtered &&
	test_cmp expect actual.filtered

gpg: Signature made Wed Dec 16 11:03:37 2015 UTC using DSA key ID CDDE430D
gpg: Good signature from "C O Mitter <committer@example.com>"

Rewrite 284d35b48d5c7cf8f258f9d25690e5c3c38bb8c3 (7/9)object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag commentnonlfile-signed-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

ok 89 - creating a signed tag with a #comment and no newline should succeed

expecting success: 
	git tag -s -m "A message line signed" stag-one-line &&

	echo "stag-one-line" >expect &&
	git tag -l | grep "^stag-one-line" >actual &&
	test_cmp expect actual &&
	git tag -n0 -l | grep "^stag-one-line" >actual &&
	test_cmp expect actual &&
	git tag -n0 -l stag-one-line >actual &&
	test_cmp expect actual &&

	echo "stag-one-line   A message line signed" >expect &&
	git tag -n1 -l | grep "^stag-one-line" >actual &&
	test_cmp expect actual &&
	git tag -n -l | grep "^stag-one-line" >actual &&
	test_cmp expect actual &&
	git tag -n1 -l stag-one-line >actual &&
	test_cmp expect actual &&
	git tag -n2 -l stag-one-line >actual &&
	test_cmp expect actual &&
	git tag -n999 -l stag-one-line >actual &&
	test_cmp expect actual

ok 5 - showing a range walks (linear)

expecting success: 
	cat >expect <<-EOF &&
	commit $(git rev-parse main3)
	commit $(git rev-parse main2)
	EOF
	git show ^side3 main3 >actual &&
	grep ^commit actual >actual.filtered &&
	test_cmp expect actual.filtered

ok 6 - showing a range walks (Y shape, ^ first)

expecting success: 
	cat >expect <<-EOF &&
	commit $(git rev-parse main3)
	commit $(git rev-parse main2)
	EOF
	git show main3 ^side3 >actual &&
	grep ^commit actual >actual.filtered &&
	test_cmp expect actual.filtered

ok 13 - git config uses a pager if configured to

expecting success: 
	rm -f paginated.out &&
	mkdir -p subdir &&
	test_config pager.bundle true &&

	git bundle create test.bundle --all &&
	rm -f paginated.out subdir/paginated.out &&
	(
		cd subdir &&
		test_terminal git bundle unbundle ../test.bundle
	) &&
	{
		test -e paginated.out ||
		test -e subdir/paginated.out
	}


Rewrite 8d77ce9a0f051fe4d6b311099cfc061fc8fa238e (8/9)ok 7 - showing a range walks (Y shape, ^ last)

expecting success: 
	cat >expect <<-EOF &&
	commit $(git rev-parse main3)
	commit $(git rev-parse main2)
	EOF
	git show -2 main3 >actual &&
	grep ^commit actual >actual.filtered &&
	test_cmp expect actual.filtered

ok 8 - showing with -N walks

expecting success: 
	cat >expect <<-EOF &&
	tag annotated
	commit $(git rev-parse annotated^{commit})
	EOF
	git show annotated >actual &&
	grep -E "^(commit|tag)" actual >actual.filtered &&
	test_cmp expect actual.filtered

ok 90 - listing the one-line message of a signed tag should succeed

expecting success: 
	git tag -s -m "" stag-zero-lines &&

	echo "stag-zero-lines" >expect &&
	git tag -l | grep "^stag-zero-lines" >actual &&
	test_cmp expect actual &&
	git tag -n0 -l | grep "^stag-zero-lines" >actual &&
	test_cmp expect actual &&
	git tag -n0 -l stag-zero-lines >actual &&
	test_cmp expect actual &&

	echo "stag-zero-lines " >expect &&
	git tag -n1 -l | grep "^stag-zero-lines" >actual &&
	test_cmp expect actual &&
	git tag -n -l | grep "^stag-zero-lines" >actual &&
	test_cmp expect actual &&
	git tag -n1 -l stag-zero-lines >actual &&
	test_cmp expect actual &&
	git tag -n2 -l stag-zero-lines >actual &&
	test_cmp expect actual &&
	git tag -n999 -l stag-zero-lines >actual &&
	test_cmp expect actual

ok 9 - showing annotated tag

expecting success: 
	cat >expect <<-EOF &&
	tag annotated
	commit $(git rev-parse annotated^{commit})
	commit $(git rev-parse side3)
	EOF
	git show annotated side3 >actual &&
	grep -E "^(commit|tag)" actual >actual.filtered &&
	test_cmp expect actual.filtered


Rewrite 3623c2fd76a1257ce6cfb529b64aa3e51d851ffd (9/9)ok 10 - showing annotated tag plus commit

expecting success: 
	cat >expect <<-EOF &&
	commit $(git rev-parse main3)
	commit $(git rev-parse main2)
	EOF
	git show ^side3 annotated >actual &&
	grep -E "^(commit|tag)" actual >actual.filtered &&
	test_cmp expect actual.filtered

ok 11 - showing range

expecting success: 
	cat >expect <<-\EOF &&
	merge
	main3
	EOF
	git show -s --format=%s merge main3 >actual &&
	test_cmp expect actual


ok 12 - -s suppresses diff

Ref 'refs/heads/branch' was rewritten
expecting success: 
	echo main3 >expect &&
	git show --quiet --format=%s main3 >actual &&
	test_cmp expect actual

ok 13 - --quiet suppresses diff

expecting success: 
  test_must_fail git show --graph HEAD

fatal: cannot combine --no-walk with --graph
ok 14 - show --graph is forbidden

ok 91 - listing the zero-lines message of a signed tag should succeed

# passed all 14 test(s)
1..14
expecting success: 
	git tag -s -F sigtagmsg stag-lines &&

	echo "stag-lines" >expect &&
	git tag -l | grep "^stag-lines" >actual &&
	test_cmp expect actual &&
	git tag -n0 -l | grep "^stag-lines" >actual &&
	test_cmp expect actual &&
	git tag -n0 -l stag-lines >actual &&
	test_cmp expect actual &&

	echo "stag-lines      stag line one" >expect &&
	git tag -n1 -l | grep "^stag-lines" >actual &&
	test_cmp expect actual &&
	git tag -n -l | grep "^stag-lines" >actual &&
	test_cmp expect actual &&
	git tag -n1 -l stag-lines >actual &&
	test_cmp expect actual &&

	echo "    stag line two" >>expect &&
	git tag -n2 -l | grep "^ *stag.line" >actual &&
	test_cmp expect actual &&
	git tag -n2 -l stag-lines >actual &&
	test_cmp expect actual &&

	echo "    stag line three" >>expect &&
	git tag -n3 -l | grep "^ *stag.line" >actual &&
	test_cmp expect actual &&
	git tag -n3 -l stag-lines >actual &&
	test_cmp expect actual &&
	git tag -n4 -l | grep "^ *stag.line" >actual &&
	test_cmp expect actual &&
	git tag -n4 -l stag-lines >actual &&
	test_cmp expect actual &&
	git tag -n99 -l | grep "^ *stag.line" >actual &&
	test_cmp expect actual &&
	git tag -n99 -l stag-lines >actual &&
	test_cmp expect actual

ok 11 - rewrite, renaming a specific directory

expecting success: 
	test dir/D = "$(git show HEAD:diroh/D.t --)" &&
	! test -d dir &&
	test -d diroh &&
	! test -d diroh/dir &&
	test -f diroh/D.t &&
	test dir/D = "$(cat diroh/D.t)"

ok 12 - test that the directory was renamed

expecting success: 
	git branch modD oldD &&
	git filter-branch -f --tree-filter "mv B.t boh || :" D..modD

*** t7008-grep-binary.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7008-grep-binary/.git/
expecting success: 
	echo 'binaryQfile' | q_to_nul >a &&
	git add a &&
	git commit -m.

[master (root-commit) 595137c] .
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 a
ok 1 - setup

expecting success: 
	echo Binary file a matches >expect &&
	git grep ina a >actual &&
	test_cmp expect actual

ok 2 - git grep ina a

expecting success: 
	git grep -ah ina a >actual &&
	test_cmp a actual

ok 14 - configuration can enable pager (from subdir)

expecting success: 
	rm -f colorful.log colorless.log &&
	git log --no-color >colorless.log &&
	git log --color >colorful.log &&
	! colorful colorless.log &&
	colorful colorful.log

ok 3 - git grep -ah ina a

expecting success: 
	: >expect &&
	test_must_fail git grep -I ina a >actual &&
	test_cmp expect actual

ok 4 - git grep -I ina a

expecting success: 
	echo a:1 >expect &&
	git grep -c ina a >actual &&
	test_cmp expect actual


Rewrite 3d6c5360ccb48d27bbc524f53496821309a1fc79 (1/2)ok 15 - tests can detect color

expecting success: 
	rm -f colorless.log &&
	test_config color.ui auto &&
	git log >colorless.log &&
	! colorful colorless.log

ok 5 - git grep -c ina a

expecting success: 
	echo a >expect &&
	git grep -l ina a >actual &&
	test_cmp expect actual

ok 6 - git grep -l ina a

expecting success: 
	echo a >expect &&
	git grep -L bar a >actual &&
	test_cmp expect actual

ok 16 - no color when stdout is a regular file

ok 7 - git grep -L bar a

expecting success: 
	: >expect &&
	git grep -q ina a >actual &&
	test_cmp expect actual

expecting success: 
	rm -f paginated.out &&
	test_config color.ui auto &&
	test_terminal env TERM=vt100 git log &&
	colorful paginated.out

ok 8 - git grep -q ina a

expecting success: 
	git grep -F ile a

ok 92 - listing many message lines of a signed tag should succeed

Binary file a matches
ok 9 - git grep -F ile a

expecting success: 
	git grep -Fi iLE a

Binary file a matches
ok 10 - git grep -Fi iLE a

expecting success: 
	git grep ile a


Rewrite ef5df644a239016a9035ed6fe3e7f2b4b4a349bd (2/2)expecting success: 
	git tag -s -m "A message for a tree" tree-signed-tag HEAD^{tree} &&
	get_tag_msg tree-signed-tag >actual &&
	test_cmp expect actual

Binary file a matches
ok 11 - git grep ile a

checking known breakage: 
	git grep .fi a

not ok 12 - git grep .fi a # TODO known breakage

expecting success: 
	printf 'yQf' | q_to_nul >f &&
	git grep -f f -F a

Binary file a matches
ok 13 - git grep -F y<NUL>f a

expecting success: 
	printf 'yQx' | q_to_nul >f &&
	test_must_fail git grep -f f -F a

ok 93 - creating a signed tag pointing to a tree should succeed

ok 14 - git grep -F y<NUL>x a

expecting success: 
	printf 'YQf' | q_to_nul >f &&
	git grep -f f -Fi a

expecting success: 
	git tag -s -m "A message for a blob" blob-signed-tag HEAD:foo &&
	get_tag_msg blob-signed-tag >actual &&
	test_cmp expect actual

Binary file a matches
ok 15 - git grep -Fi Y<NUL>f a

expecting success: 
	printf 'YQx' | q_to_nul >f &&
	test_must_fail git grep -f f -Fi a


Ref 'refs/heads/modD' was rewritten
ok 16 - git grep -Fi Y<NUL>x a
ok 94 - creating a signed tag pointing to a blob should succeed


expecting success: 
	printf 'yQf' | q_to_nul >f &&
	git grep -f f a

expecting success: 
	git tag -s -m "A message for another tag" tag-signed-tag signed-tag &&
	get_tag_msg tag-signed-tag >actual &&
	test_cmp expect actual

Binary file a matches
ok 17 - git grep y<NUL>f a

expecting success: 
	printf 'yQx' | q_to_nul >f &&
	test_must_fail git grep -f f a

ok 18 - git grep y<NUL>x a

expecting success: 
	echo text >t &&
	git add t &&
	echo t:text >expect &&
	git grep text t >actual &&
	test_cmp expect actual &&
	echo "t -diff" >.gitattributes &&
	echo "Binary file t matches" >expect &&
	git grep text t >actual &&
	test_cmp expect actual

ok 13 - rewrite one branch, keeping a side branch

expecting success: 
	test "$(git merge-base modD D)" = "$(git rev-parse B)"

ok 95 - creating a signed tag pointing to another tag should succeed

ok 14 - common ancestor is still common (unchanged)

expecting success: 
	mkdir subdir &&
	touch subdir/new &&
	git add subdir/new &&
	test_tick &&
	git commit -m "subdir" &&
	echo H > A.t &&
	test_tick &&
	git commit -m "not subdir" A.t &&
	echo A > subdir/new &&
	test_tick &&
	git commit -m "again subdir" subdir/new &&
	git rm A.t &&
	test_tick &&
	git commit -m "again not subdir" &&
	git branch sub &&
	git branch sub-earlier HEAD~2 &&
	git filter-branch -f --subdirectory-filter subdir \
		refs/heads/sub refs/heads/sub-earlier

expecting success: 
	echo "rfc1991" >gpghome/gpg.conf &&
	git tag -s -m "RFC1991 signed tag" rfc1991-signed-tag $commit &&
	get_tag_msg rfc1991-signed-tag >actual &&
	test_cmp expect actual

ok 19 - grep respects binary diff attribute

expecting success: 
	git grep --cached text t >actual &&
	test_cmp expect actual

ok 20 - grep --cached respects binary diff attribute

expecting success: 
	git add .gitattributes &&
	rm .gitattributes &&
	git grep --cached text t >actual &&
	test_when_finished "git rm --cached .gitattributes" &&
	test_when_finished "git checkout .gitattributes" &&
	test_cmp expect actual

[branch bb8f80d] subdir
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 subdir/new
ok 96 - creating a signed tag with rfc1991

[branch 5bae69c] not subdir
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
expecting success: 
	echo "rfc1991" >gpghome/gpg.conf &&
	echo "RFC1991 signed tag" >expect &&
	GIT_EDITOR=./fakeeditor git tag -f -s rfc1991-signed-tag $commit &&
	test_cmp expect actual

rm '.gitattributes'
ok 21 - grep --cached respects binary diff attribute (2)

expecting success: 
	git commit -m new &&
	echo "Binary file HEAD:t matches" >expect &&
	git grep text HEAD -- t >actual &&
	test_when_finished "git reset HEAD^" &&
	test_cmp expect actual

ok 17 - color when writing to a pager

expecting success: 
	rm -f paginated.out &&
	test_config color.ui auto &&
	test_config color.pager false &&
	test_terminal env TERM=vt100 git log &&
	! colorful paginated.out

[branch 140072e] again subdir
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master 97f15fb] new
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 t
rm 'A.t'
Updated tag 'rfc1991-signed-tag' (was 4d21afc)
ok 97 - reediting a signed tag body omits signature

[branch ead226b] again not subdir
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 A.t
expecting success: 
	echo "rfc1991" >gpghome/gpg.conf &&
	git tag -v rfc1991-signed-tag

ok 22 - grep revision respects binary diff attribute

expecting success: 
	echo binQary | q_to_nul >b &&
	git add b &&
	echo "Binary file b matches" >expect &&
	git grep bin b >actual &&
	test_cmp expect actual &&
	echo "b diff" >.gitattributes &&
	echo "b:binQary" >expect &&
	git grep bin b | nul_to_q >actual &&
	test_cmp expect actual

gpg: Signature made Wed Dec 16 11:03:39 2015 UTC using DSA key ID CDDE430D
gpg: Good signature from "C O Mitter <committer@example.com>"
object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag rfc1991-signed-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

RFC1991 signed tag
ok 98 - verifying rfc1991 signature

expecting success: 
	echo "rfc1991" >gpghome/gpg.conf &&
	echo "rfc1991-signed-tag RFC1991 signed tag" >expect &&
	git tag -l -n1 rfc1991-signed-tag >actual &&
	test_cmp expect actual &&
	git tag -l -n2 rfc1991-signed-tag >actual &&
	test_cmp expect actual &&
	git tag -l -n999 rfc1991-signed-tag >actual &&
	test_cmp expect actual

ok 23 - grep respects not-binary diff attribute

expecting success: 
	echo a diff=foo >.gitattributes &&
	git config diff.foo.textconv "\"$(pwd)\""/nul_to_q_textconv

ok 99 - list tag with rfc1991 signature

ok 24 - setup textconv filters

expecting success: 
	test_must_fail git grep Qfile

expecting success: 
	git tag -v rfc1991-signed-tag

ok 25 - grep does not honor textconv

expecting success: 
	echo "a:binaryQfile" >expect &&
	git grep --textconv Qfile >actual &&
	test_cmp expect actual

ok 26 - grep --textconv honors textconv

expecting success: 
	test_must_fail git grep --no-textconv Qfile

gpg: Signature made Wed Dec 16 11:03:39 2015 UTC using DSA key ID CDDE430D
gpg: Good signature from "C O Mitter <committer@example.com>"
object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag rfc1991-signed-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

RFC1991 signed tag
ok 100 - verifying rfc1991 signature without --rfc1991

expecting success: 
	echo "rfc1991-signed-tag RFC1991 signed tag" >expect &&
	git tag -l -n1 rfc1991-signed-tag >actual &&
	test_cmp expect actual &&
	git tag -l -n2 rfc1991-signed-tag >actual &&
	test_cmp expect actual &&
	git tag -l -n999 rfc1991-signed-tag >actual &&
	test_cmp expect actual

ok 27 - grep --no-textconv does not honor textconv

expecting success: 
	echo "HEAD:a:binaryQfile" >expect &&
	git grep --textconv Qfile HEAD:a >actual &&
	test_cmp expect actual

ok 28 - grep --textconv blob honors textconv

# still have 1 known breakage(s)
# passed all remaining 27 test(s)
1..28

Rewrite bb8f80d463b54137409c5a381ad07ea6bf4b1867 (1/2)ok 101 - list tag with rfc1991 signature without --rfc1991

expecting success: 
	echo "RFC1991 signed tag" >expect &&
	GIT_EDITOR=./fakeeditor git tag -f -s rfc1991-signed-tag $commit &&
	test_cmp expect actual

*** t7009-filter-branch-null-sha1.sh ***

Rewrite 140072ead29d56d10c1c5c473c117e3aed45a333 (2/2)Updated tag 'rfc1991-signed-tag' (was 0d29427)
ok 102 - reediting a signed tag body omits signature

expecting success: test_must_fail git tag -s -m tail tag-gpg-failure
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7009-filter-branch-null-sha1/.git/
gpg: skipped "BobTheMouse": secret key not available
gpg: signing failed: secret key not available
error: gpg failed to sign the data
error: unable to sign the tag
ok 103 - git tag -s fails if gpg is misconfigured

expecting success: 
	test_commit one &&
	test_commit two &&
	test_commit three

expecting success: test_must_fail git tag -v signed-tag
gpg: keyblock resource `/«PKGBUILDDIR»/t/trash directory.t7004-tag/gpghome/pubring.gpg': file open error
gpg: Signature made Wed Dec 16 11:03:32 2015 UTC using DSA key ID CDDE430D
gpg: Can't check signature: public key not found
object 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b
type commit
tag signed-tag
tagger C O Mitter <committer@example.com> 1112911993 -0700

A signed tag message
error: could not verify the tag 'signed-tag'
ok 104 - verify signed tag fails when public key is not present

expecting success: 
	! (GIT_EDITOR=cat git tag -a initial-comment)


#
# Write a message for tag:
#   initial-comment
# Lines starting with '#' will be ignored.

fatal: no tag message?
ok 105 - git tag -a fails if tag annotation is empty

expecting success: 
	! (GIT_EDITOR=cat git tag -a initial-comment > actual)

Ref 'refs/heads/sub' was rewritten
fatal: no tag message?
ok 106 - message in editor has initial comment

expecting success: 
	# check the first line --- should be empty
	echo >first.expect &&
	sed -e 1q <actual >first.actual &&
	test_i18ncmp first.expect first.actual

ok 107 - message in editor has initial comment: first line

expecting success: 
	# remove commented lines from the remainder -- should be empty
	>rest.expect &&
	sed -e 1d -e "/^#/d" <actual >rest.actual &&
	test_cmp rest.expect rest.actual

ok 108 - message in editor has initial comment: remainder

expecting success: 
	git tag -a -m "An annotation to be reused" reuse &&
	GIT_EDITOR=true git tag -f -a reuse &&
	get_tag_msg reuse >actual &&
	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 18 - colors are suppressed by color.pager

expecting success: 
	rm -f colorful.log &&
	test_config color.ui auto &&
	(
		TERM=vt100 &&
		GIT_PAGER_IN_USE=true &&
		export TERM GIT_PAGER_IN_USE &&
		git log >colorful.log
	) &&
	colorful colorful.log

Ref 'refs/heads/sub-earlier' was rewritten
ok 109 - overwriting an annoted tag should use its previous body

expecting success: 
	mkdir subdir &&
	echo "Tag message in top directory" >msgfile-5 &&
	echo "Tag message in sub directory" >subdir/msgfile-5 &&
	(
		cd subdir &&
		git tag -a -F msgfile-5 tag-from-subdir
	) &&
	git cat-file tag tag-from-subdir | grep "in sub directory"

[master 139b20d] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two.t
Tag message in sub directory
ok 110 - filename for the message is relative to cwd

expecting success: 
	echo "Tag message in sub directory" >subdir/msgfile-6 &&
	(
		cd subdir &&
		git tag -a -F msgfile-6 tag-from-subdir-2
	) &&
	git cat-file tag tag-from-subdir-2 | grep "in sub directory"

ok 19 - color when writing to a file intended for a pager

expecting success: 
	test_config alias.externallog "!git log" &&
	test_config color.ui auto &&
	test_terminal env TERM=vt100 git -p externallog &&
	colorful paginated.out

ok 15 - filter subdirectory only

expecting success: 
	test 2 = $(git rev-list sub | wc -l) &&
	git show sub:new &&
	test_must_fail git show sub:subdir &&
	git show sub-earlier:new &&
	test_must_fail git show sub-earlier:subdir

[master 7c7cd71] three
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 three.t
Tag message in sub directory
ok 111 - filename for the message is relative to cwd

A
ok 1 - setup: base commits

expecting success: 
	{
		git ls-tree HEAD &&
		printf "160000 commit $_z40\\tbroken\\n"
	} >broken-tree &&
	echo "add broken entry" >msg &&

	tree=$(git mktree <broken-tree) &&
	test_tick &&
	commit=$(git commit-tree $tree -p HEAD <msg) &&
	git update-ref HEAD "$commit"

expecting success: 
	echo foo-2.0 >foo &&
	git add foo &&
	git commit -m second &&
	git tag v2.0

fatal: Path 'subdir' exists on disk, but not in 'sub'.
fatal: Path 'subdir' exists on disk, but not in 'sub-earlier'.
ok 16 - subdirectory filter result looks okay

expecting success: 
	git checkout master &&
	mkdir subdir &&
	echo A > subdir/new &&
	git add subdir/new &&
	test_tick &&
	git commit -m "subdir on master" subdir/new &&
	git rm A.t &&
	test_tick &&
	git commit -m "again subdir on master" &&
	git merge branch

[master d3200cb] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 112 - creating second commit and tag

Switched to branch 'master'
expecting success: 
	echo foo-dev >foo &&
	git add foo &&
	git commit -m third

ok 2 - setup: a commit with a bogus null sha1 in the tree

expecting success: 
	test_tick &&
	git commit -a -m "back to normal"

[master 6fc1982] back to normal
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 delete mode 160000 broken
ok 3 - setup: bring HEAD and index in sync

expecting success: 
	test_must_fail git filter-branch \
		--force --prune-empty \
		--index-filter "git rm --cached --ignore-unmatch three.t"

[master c282771] third
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 113 - creating third commit without tag

expecting success: 
	git tag -l --contains 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b v* >actual &&
	test_cmp expected actual

[master 2744380] subdir on master
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 subdir/new
rm 'A.t'
ok 114 - checking that first commit is in all tags (hash)

expecting success: 
	git tag -l --contains v1.0 v* >actual &&
	test_cmp expected actual

[master d349444] again subdir on master
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 A.t
ok 115 - checking that first commit is in all tags (tag)

expecting success: 
	git tag -l --contains HEAD~2 v* >actual &&
	test_cmp expected actual

Merging:
d349444 again subdir on master
virtual branch
found 1 common ancestor:
0e63577 C
Skipped subdir/new (merged same as existing)
Merge made by the 'recursive' strategy.
ok 116 - checking that first commit is in all tags (relative)

expecting success: 
	git tag -l --contains d3200cb2a2a0c653d5ddeedfef2b94eba9226013 v* >actual &&
	test_cmp expected actual

 E.t       | 1 +
 G.t       | 1 +
 H.t       | 1 +
 diroh/D.t | 1 +
 doh       | 1 +
 5 files changed, 5 insertions(+)
 create mode 100644 E.t
 create mode 100644 G.t
 create mode 100644 H.t
 create mode 100644 diroh/D.t
 create mode 100644 doh
ok 17 - more setup

expecting success: 
	git branch directorymoved &&
	git filter-branch -f --index-filter \
		 "git ls-files -s | sed \"s-	-&newsubdir/-\" |
	          GIT_INDEX_FILE=\$GIT_INDEX_FILE.new \
			git update-index --index-info &&
		  mv \"\$GIT_INDEX_FILE.new\" \"\$GIT_INDEX_FILE\"" directorymoved &&
	git diff --exit-code HEAD directorymoved:newsubdir

ok 117 - checking that second commit only has one tag

expecting success: 
	git tag -l --contains c282771867dd40cef6c1f87644fce5e5bc6b13ad v* >actual &&
	test_cmp expected actual

ok 118 - checking that third commit has no tags

expecting success: 
	git branch stable v2.0 &&
        git checkout stable &&
	echo foo-3.0 > foo &&
	git commit foo -m fourth &&
	git tag v3.0

Switched to branch 'stable'

Rewrite d79ce1670bdcb76e6d1da2ae095e890ccb326ae9 (1/5)[stable 820ea75] fourth
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 119 - creating simple branch


Rewrite 139b20d8e6c5b496de61f033f642d0e3dbff528d (2/5)expecting success: 
	git tag -l --contains 820ea75a3bc5b6aafd076dbee5f2daa3dea70df9 v* >actual &&
	test_cmp expected actual

ok 120 - checking that branch head only has one tag

expecting success: 
	git merge --strategy=ours master &&
        git tag v4.0

ok 20 - colors are sent to pager for external commands

expecting success: 
	git config alias.aliasedlog log &&
	git config alias.true "!true"

ok 21 - setup: some aliases

Merge made by the 'ours' strategy.
expecting success: 
		sane_unset PAGER GIT_PAGER &&
		test_unconfig core.pager &&
		rm -f default_pager_used &&
		cat >$less <<-\EOF &&
		#!/bin/sh
		wc >default_pager_used
		EOF
		chmod +x $less &&
		(
			PATH=.:$PATH &&
			export PATH &&
			test_terminal  git log
		) &&
		test -e default_pager_used
	

Rewrite 7c7cd714e262561f73f3079dfca4e8724682ac21 (3/5)ok 121 - merging original branch into this branch

expecting success: 
	git tag -l --contains c282771867dd40cef6c1f87644fce5e5bc6b13ad v* >actual &&
	test_cmp expected actual


Rewrite 0ddfaf193ff13d6ab39b7cbd9eed645e3ee2f050 (1/16)ok 122 - checking that original branch head has one tag now

expecting success: 
	git tag -l --contains 86e17e4ed4cddf9a4f960da789f8378f6ea1ff2b v* >actual &&
	test_cmp expected actual

rm 'three.t'
ok 123 - checking that initial commit is in all tags

expecting success: 
	test_must_fail git tag -a &&
	test_must_fail git tag -l -v &&
	test_must_fail git tag -n 100 &&
	test_must_fail git tag -l -m msg &&
	test_must_fail git tag -l -F some file &&
	test_must_fail git tag -v -s

usage: git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] <tagname> [<head>]
   or: git tag -d <tagname>...
   or: git tag -l [-n[<num>]] [--contains <commit>] [--points-at <object>]
		[<pattern>...]
   or: git tag -v <tagname>...

    -l, --list            list tag names
    -n[<n>]               print <n> lines of each tag message
    -d, --delete          delete tags
    -v, --verify          verify tags

Tag creation options
    -a, --annotate        annotated tag, needs a message
    -m, --message <message>
                          tag message
    -F, --file <file>     read message from file
    -s, --sign            annotated and GPG-signed tag
    --cleanup <mode>      how to strip spaces and #comments from message
    -u, --local-user <key-id>
                          use another key to sign the tag
    -f, --force           replace the tag if exists
    --create-reflog       create a reflog

Tag listing options
    --column[=<style>]    show tag list in columns
    --sort <type>         sort tags
    --contains <commit>   print only tags that contain the commit
    --points-at <object>  print only tags of the object

error: switch `v' : incompatible with --list
usage: git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] <tagname> [<head>]
   or: git tag -d <tagname>...
   or: git tag -l [-n[<num>]] [--contains <commit>] [--points-at <object>]
		[<pattern>...]
   or: git tag -v <tagname>...

    -l, --list            list tag names
    -n[<n>]               print <n> lines of each tag message
    -d, --delete          delete tags
    -v, --verify          verify tags

Tag creation options
    -a, --annotate        annotated tag, needs a message
    -m, --message <message>
                          tag message
    -F, --file <file>     read message from file
    -s, --sign            annotated and GPG-signed tag
    --cleanup <mode>      how to strip spaces and #comments from message
    -u, --local-user <key-id>
                          use another key to sign the tag
    -f, --force           replace the tag if exists
    --create-reflog       create a reflog

Tag listing options
    --column[=<style>]    show tag list in columns
    --sort <type>         sort tags
    --contains <commit>   print only tags that contain the commit
    --points-at <object>  print only tags of the object

fatal: -n option is only allowed with -l.
usage: git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] <tagname> [<head>]
   or: git tag -d <tagname>...
   or: git tag -l [-n[<num>]] [--contains <commit>] [--points-at <object>]
		[<pattern>...]
   or: git tag -v <tagname>...

    -l, --list            list tag names
    -n[<n>]               print <n> lines of each tag message
    -d, --delete          delete tags
    -v, --verify          verify tags

Tag creation options
    -a, --annotate        annotated tag, needs a message
    -m, --message <message>
                          tag message
    -F, --file <file>     read message from file
    -s, --sign            annotated and GPG-signed tag
    --cleanup <mode>      how to strip spaces and #comments from message
    -u, --local-user <key-id>
                          use another key to sign the tag
    -f, --force           replace the tag if exists
    --create-reflog       create a reflog

Tag listing options
    --column[=<style>]    show tag list in columns
    --sort <type>         sort tags
warning: cache entry has null sha1: broken
    --contains <commit>   print only tags that contain the commit
    --points-at <object>  print only tags of the object

usage: git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] <tagname> [<head>]
   or: git tag -d <tagname>...
   or: git tag -l [-n[<num>]] [--contains <commit>] [--points-at <object>]
		[<pattern>...]
   or: git tag -v <tagname>...

    -l, --list            list tag names
    -n[<n>]               print <n> lines of each tag message
    -d, --delete          delete tags
    -v, --verify          verify tags

Tag creation options
    -a, --annotate        annotated tag, needs a message
    -m, --message <message>
                          tag message
    -F, --file <file>     read message from file
    -s, --sign            annotated and GPG-signed tag
    --cleanup <mode>      how to strip spaces and #comments from message
    -u, --local-user <key-id>
                          use another key to sign the tag
    -f, --force           replace the tag if exists
    --create-reflog       create a reflog

Tag listing options
    --column[=<style>]    show tag list in columns
    --sort <type>         sort tags
    --contains <commit>   print only tags that contain the commit
    --points-at <object>  print only tags of the object

error: cache entry has null sha1: broken
fatal: Unable to write new index file

Rewrite e86e54590a6764f0c4219b3fe8b5e971cd5a0ed8 (2/16)
Rewrite e3ed0c3a94f05540151bd8cb9ac647b8777964a6 (4/5)rm 'three.t'
index filter failed: git rm --cached --ignore-unmatch three.t
usage: git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] <tagname> [<head>]
   or: git tag -d <tagname>...
   or: git tag -l [-n[<num>]] [--contains <commit>] [--points-at <object>]
		[<pattern>...]
   or: git tag -v <tagname>...

    -l, --list            list tag names
    -n[<n>]               print <n> lines of each tag message
    -d, --delete          delete tags
    -v, --verify          verify tags

Tag creation options
    -a, --annotate        annotated tag, needs a message
    -m, --message <message>
                          tag message
    -F, --file <file>     read message from file
    -s, --sign            annotated and GPG-signed tag
    --cleanup <mode>      how to strip spaces and #comments from message
    -u, --local-user <key-id>
                          use another key to sign the tag
    -f, --force           replace the tag if exists
    --create-reflog       create a reflog

Tag listing options
    --column[=<style>]    show tag list in columns
    --sort <type>         sort tags
    --contains <commit>   print only tags that contain the commit
    --points-at <object>  print only tags of the object

ok 124 - mixing incompatibles modes and options is forbidden

expecting success: 
	test_must_fail git tag --points-at=v4.0 foo

ok 4 - filter commands are still checked

expecting success: 
	echo three >expect &&
	git filter-branch \
		--force --prune-empty \
		--index-filter "git rm --cached --ignore-unmatch broken" &&
	git log -1 --format=%s >actual &&
	test_cmp expect actual

fatal: --points-at option is only allowed with -l.
ok 125 - --points-at cannot be used in non-list mode

expecting success: 
	echo v4.0 >expect &&
	git tag --points-at v4.0 >actual &&
	test_cmp expect actual


Rewrite 0e63577b8a9dce52b69167d9c008f6a0e30de818 (3/16)ok 126 - --points-at finds lightweight tags

expecting success: 
	git tag -m "v4.0, annotated" annotated-v4.0 v4.0 &&
	echo annotated-v4.0 >expect &&
	git tag -l --points-at v4.0 "annotated*" >actual &&
	test_cmp expect actual

ok 127 - --points-at finds annotated tags of commits

expecting success: 
	git tag -m "describing the v4.0 tag object" \
		annotated-again-v4.0 annotated-v4.0 &&
	cat >expect <<-\EOF &&
	annotated-again-v4.0
	annotated-v4.0
	EOF
	git tag --points-at=annotated-v4.0 >actual &&
	test_cmp expect actual


Rewrite 2744380f4984748b7b4c121c182e9c3330a609c5 (4/16)ok 128 - --points-at finds annotated tags of tags

expecting success: 
	cat >expect <<-\EOF &&
	v2.0
	v3.0
	EOF
	git tag --points-at=v2.0 --points-at=v3.0 >actual &&
	test_cmp expect actual


Rewrite d79ce1670bdcb76e6d1da2ae095e890ccb326ae9 (1/5)ok 129 - multiple --points-at are OR-ed together

expecting success: 
	git tag foo1.3 &&
	git tag foo1.6 &&
	git tag foo1.10 &&
	git tag -l --sort=refname "foo*" >actual &&
	cat >expect <<-\EOF &&
	foo1.10
	foo1.3
	foo1.6
	EOF
	test_cmp expect actual

ok 22 - git log - default pager is used by default


Rewrite d3494446ffa0b10a4a22ad9db09ce4fe83ff7648 (5/16)expecting success: 
		sane_unset GIT_PAGER &&
		test_unconfig core.pager &&
		rm -f PAGER_used &&
		PAGER='wc >PAGER_used' &&
		export PAGER &&
		test_terminal  git log &&
		test -e PAGER_used
	

Rewrite 139b20d8e6c5b496de61f033f642d0e3dbff528d (2/5)ok 130 - lexical sort

expecting success: 
	git tag -l --sort=version:refname "foo*" >actual &&
	cat >expect <<-\EOF &&
	foo1.3
	foo1.6
	foo1.10
	EOF
	test_cmp expect actual

ok 131 - version sort

expecting success: 
	git tag -l --sort=-version:refname "foo*" >actual &&
	cat >expect <<-\EOF &&
	foo1.10
	foo1.6
	foo1.3
	EOF
	test_cmp expect actual


Rewrite 3d6c5360ccb48d27bbc524f53496821309a1fc79 (6/16)ok 132 - reverse version sort

expecting success: 
	git tag -l --sort=-refname "foo*" >actual &&
	cat >expect <<-\EOF &&
	foo1.6
	foo1.3
	foo1.10
	EOF
	test_cmp expect actual


Rewrite 7c7cd714e262561f73f3079dfca4e8724682ac21 (3/5)ok 133 - reverse lexical sort

expecting success: 
	git config tag.sort "v:refname" &&
	git tag -l "foo*" >actual &&
	cat >expect <<-\EOF &&
	foo1.3
	foo1.6
	foo1.10
	EOF
	test_cmp expect actual

ok 134 - configured lexical sort

expecting success: 
	git tag -l --sort=-refname "foo*" >actual &&
	cat >expect <<-\EOF &&
	foo1.6
	foo1.3
	foo1.10
	EOF
	test_cmp expect actual


Rewrite ef5df644a239016a9035ed6fe3e7f2b4b4a349bd (7/16)ok 135 - option override configured sort

expecting success: 
	test_must_fail git tag -l --sort=notvalid "foo*" >actual

error: unsupported sort specification 'notvalid'
usage: git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] <tagname> [<head>]
   or: git tag -d <tagname>...
   or: git tag -l [-n[<num>]] [--contains <commit>] [--points-at <object>]
		[<pattern>...]
   or: git tag -v <tagname>...

    -l, --list            list tag names
    -n[<n>]               print <n> lines of each tag message
    -d, --delete          delete tags
    -v, --verify          verify tags

Tag creation options
    -a, --annotate        annotated tag, needs a message
    -m, --message <message>
                          tag message
    -F, --file <file>     read message from file
    -s, --sign            annotated and GPG-signed tag
    --cleanup <mode>      how to strip spaces and #comments from message
    -u, --local-user <key-id>
                          use another key to sign the tag
    -f, --force           replace the tag if exists
    --create-reflog       create a reflog

Tag listing options
    --column[=<style>]    show tag list in columns
    --sort <type>         sort tags
    --contains <commit>   print only tags that contain the commit
    --points-at <object>  print only tags of the object

ok 136 - invalid sort parameter on command line

expecting success: 
	git config tag.sort "v:notvalid" &&
	git tag -l "foo*" >actual &&
	cat >expect <<-\EOF &&
	foo1.10
	foo1.3
	foo1.6
	EOF
	test_cmp expect actual

warning: cache entry has null sha1: broken
warning: unsupported sort specification 'tag.sort' in variable 'notvalid'

Rewrite e3ed0c3a94f05540151bd8cb9ac647b8777964a6 (4/5)ok 137 - invalid sort parameter in configuratoin

expecting success: 
	git config --unset tag.sort &&
	git config versionsort.prereleaseSuffix -rc &&
	git tag foo1.6-rc1 &&
	git tag foo1.6-rc2 &&
	git tag -l --sort=version:refname "foo*" >actual &&
	cat >expect <<-\EOF &&
	foo1.3
	foo1.6-rc1
	foo1.6-rc2
	foo1.6
	foo1.10
	EOF
	test_cmp expect actual

rm 'broken'

Rewrite d66aa888e8e10ccecac31b04a73b006afcfb6ab2 (8/16)
Rewrite 6fc1982a7cbeec7380180353ef341fd996ac21f7 (5/5)ok 138 - version sort with prerelease reordering

expecting success: 
	git tag -l --sort=-version:refname "foo*" >actual &&
	cat >expect <<-\EOF &&
	foo1.10
	foo1.6
	foo1.6-rc2
	foo1.6-rc1
	foo1.3
	EOF
	test_cmp expect actual

ok 139 - reverse version sort with prerelease reordering

checking prerequisite: ULIMIT_STACK_SIZE

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&run_with_limited_stack true
)

Rewrite 095b78eb9c1f77139224464f38f1e0aff8add3cf (9/16)ok 23 - git log - PAGER overrides default pager

prerequisite ULIMIT_STACK_SIZE ok
expecting success: 
	>expect &&
	i=1 &&
	while test $i -lt 8000
	do
		echo "commit refs/heads/master
committer A U Thor <author@example.com> $((1000000000 + $i * 100)) +0200
data <<EOF
commit #$i
EOF"
		test $i = 1 && echo "from refs/heads/master^0"
		i=$(($i + 1))
	done | git fast-import &&
	git checkout master &&
	git tag far-far-away HEAD^ &&
	run_with_limited_stack git tag --contains HEAD >actual &&
	test_cmp expect actual

expecting success: 
		sane_unset GIT_PAGER &&
		rm -f core.pager_used &&
		PAGER=wc &&
		export PAGER &&
		test_config core.pager 'wc >core.pager_used' &&
		test_terminal  git log &&
		test -e core.pager_used
	

Ref 'refs/heads/master' was rewritten

Rewrite 20d07e95852c2683da5bd70d3badbd5028484552 (10/16)ok 5 - removing the broken entry works

# passed all 5 test(s)
1..5
*** t7010-setup.sh ***

Rewrite 8a3423ee5559c5e0c32440a860f6b09a0e6020fc (11/16)Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7010-setup/.git/
expecting success: 

	mkdir -p a/b/c a/e &&
	D=$(pwd) &&
	>a/b/c/d &&
	>a/e/f


ok 1 - setup

expecting success: 

	git add "$D/a/b/c/d" &&
	git ls-files >current &&
	echo a/b/c/d >expect &&
	test_cmp expect current


ok 2 - git add (absolute)

expecting success: 

	rm -f .git/index &&
	(
		cd a/b &&
		git add "../e/./f"
	) &&
	git ls-files >current &&
	echo a/e/f >expect &&
	test_cmp expect current



Rewrite bb8f80d463b54137409c5a381ad07ea6bf4b1867 (12/16)ok 3 - git add (funny relative)

expecting success: 

	rm -f .git/index &&
	git add a &&
	git rm -f --cached "$D/a/b/c/d" &&
	git ls-files >current &&
	echo a/e/f >expect &&
	test_cmp expect current


rm 'a/b/c/d'
ok 4 - git rm (absolute)

expecting success: 

	rm -f .git/index &&
	git add a &&
	(
		cd a/b &&
		git rm -f --cached "../e/./f"
	) &&
	git ls-files >current &&
	echo a/b/c/d >expect &&
	test_cmp expect current


ok 24 - git log - repository-local core.pager setting overrides PAGER

expecting success: 
		sane_unset GIT_PAGER &&
		rm -f core.pager_used &&
		rm -fr sub &&
		PAGER=wc &&
		stampname=$(pwd)/core.pager_used &&
		export PAGER stampname &&
		test_config core.pager 'wc >"$stampname"' &&
		mkdir sub &&
		(
			cd sub &&
			test_terminal  git log
		) &&
		test -e core.pager_used
	

Rewrite 5bae69c6543c34be1d98816e26501bcda79d1d6b (13/16)rm 'a/e/f'
ok 5 - git rm (funny relative)

expecting success: 

	rm -f .git/index &&
	git add a &&
	git ls-files "$D/a/e/../b" >current &&
	echo a/b/c/d >expect &&
	test_cmp expect current


ok 6 - git ls-files (absolute)

expecting success: 

	rm -f .git/index &&
	git add a &&
	(
		cd a/b &&
		git ls-files "../b/c"
	)  >current &&
	echo c/d >expect &&
	test_cmp expect current


ok 7 - git ls-files (relative #1)

expecting success: 

	rm -f .git/index &&
	git add a &&
	(
		cd a/b &&
		git ls-files --full-name "../e/f"
	)  >current &&
	echo a/e/f >expect &&
	test_cmp expect current



Rewrite 140072ead29d56d10c1c5c473c117e3aed45a333 (14/16)ok 8 - git ls-files (relative #2)

expecting success: 

	rm -f .git/index &&
	git add a &&
	(
		cd a/b &&
		git ls-files "../e/f"
	)  >current &&
	echo ../e/f >expect &&
	test_cmp expect current


ok 9 - git ls-files (relative #3)

expecting success: 
	git commit -m "foo" &&
	echo aa >>a/b/c/d &&
	git commit -m "aa" "$(pwd)/a/b/c/d"


Rewrite ead226bc0b53c5d210f2326ae871b0fea3004df3 (15/16)[master (root-commit) 45f0331] foo
 Author: A U Thor <author@example.com>
 2 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 a/b/c/d
 create mode 100644 a/e/f
[master fc64164] aa
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 10 - commit using absolute path names

expecting success: 
	echo bb >>a/b/c/d &&
	git commit -m "bb" "$(pwd)/a/b/c/d" &&

	git log a/b/c/d >f1.txt &&
	git log "$(pwd)/a/b/c/d" >f2.txt &&
	test_cmp f1.txt f2.txt

[master 854b212] bb
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)

Rewrite 7329f31555df2545350d15ecd0f5eab05e7142e1 (16/16)ok 11 - log using absolute path names

expecting success: 
	git blame a/b/c/d >f1.txt &&
	git blame "$(pwd)/a/b/c/d" >f2.txt &&
	test_cmp f1.txt f2.txt

ok 12 - blame using absolute path names

expecting success: 
	test_create_repo tester


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7010-setup/tester/.git/
ok 13 - setup deeper work tree

expecting success: (
	cd tester &&
	d1="$(cd .. ; pwd)" &&
	test_must_fail git add "$d1"
)
Ref 'refs/heads/directorymoved' was rewritten
fatal: /«PKGBUILDDIR»/t/trash directory.t7010-setup: '/«PKGBUILDDIR»/t/trash directory.t7010-setup' is outside repository
ok 14 - add a directory outside the work tree

expecting success: (
	cd tester &&
	f="$(pwd)x" &&
	echo "$f" &&
	touch "$f" &&
	test_must_fail git add "$f"
)
/«PKGBUILDDIR»/t/trash directory.t7010-setup/testerx
ok 25 - git log - core.pager overrides PAGER from subdirectory

fatal: /«PKGBUILDDIR»/t/trash directory.t7010-setup/testerx: '/«PKGBUILDDIR»/t/trash directory.t7010-setup/testerx' is outside repository
ok 15 - add a file outside the work tree, nasty case 1

expecting success: (
	cd tester &&
	f="$(pwd | sed "s/.$//")x" &&
	echo "$f" &&
	touch "$f" &&
	test_must_fail git add "$f"
)
expecting success: 
		rm -f GIT_PAGER_used &&
		test_config core.pager wc &&
		GIT_PAGER='wc >GIT_PAGER_used' &&
		export GIT_PAGER &&
		test_terminal  git log &&
		test -e GIT_PAGER_used
	
/«PKGBUILDDIR»/t/trash directory.t7010-setup/testex
fatal: /«PKGBUILDDIR»/t/trash directory.t7010-setup/testex: '/«PKGBUILDDIR»/t/trash directory.t7010-setup/testex' is outside repository
ok 16 - add a file outside the work tree, nasty case 2

# passed all 16 test(s)
1..16
ok 18 - use index-filter to move into a subdirectory

expecting success: 
	old=$(git rev-parse HEAD) &&
	test_must_fail git filter-branch -f --msg-filter false HEAD &&
	test $old = $(git rev-parse HEAD) &&
	rm -rf .git-rewrite

*** t7011-skip-worktree-reading.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7011-skip-worktree-reading/.git/
expecting success: 
	test_commit init &&
	mkdir sub &&
	touch ./1 ./2 sub/1 sub/2 &&
	git add 1 2 sub/1 sub/2 &&
	git update-index --skip-worktree 1 sub/1 &&
	git ls-files -t > result &&
	test_cmp expect.skip result

[master (root-commit) 2519212] init
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 init.t

Rewrite 0ddfaf193ff13d6ab39b7cbd9eed645e3ee2f050 (1/16)ok 1 - setup

expecting success: 
	setup_absent &&
	git update-index 1 &&
	test_absent

msg filter failed: false
ok 2 - update-index

expecting success: 
	setup_dirty &&
	git update-index 1 &&
	test_dirty

ok 19 - stops when msg filter fails

expecting success: 
	: > i &&
	git add i &&
	test_tick &&
	GIT_AUTHOR_NAME="B V Uips" git commit -m bvuips &&
	git branch preserved-author &&
	(sane_unset GIT_AUTHOR_NAME &&
	 git filter-branch -f --msg-filter "cat; \
			test \$GIT_COMMIT != $(git rev-parse master) || \
			echo Hallo" \
		preserved-author) &&
	test 1 = $(git rev-list --author="B V Uips" preserved-author | wc -l)

ok 26 - git log - GIT_PAGER overrides core.pager

expecting success: 
		sane_unset PAGER GIT_PAGER &&
		test_unconfig core.pager &&
		rm -f default_pager_used &&
		cat >$less <<-\EOF &&
		#!/bin/sh
		wc >default_pager_used
		EOF
		chmod +x $less &&
		(
			PATH=.:$PATH &&
			export PATH &&
			test_terminal  git -p log
		) &&
		test -e default_pager_used
	
[master 2bfc21d] bvuips
 Author: B V Uips <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 i
ok 3 - update-index

expecting success: 
	setup_absent &&
	git update-index --remove 1 &&
	test -z "$(git ls-files 1)" &&
	test ! -f 1

ok 4 - update-index --remove

expecting success: 
	setup_dirty &&
	git update-index --remove 1 &&
	test -z "$(git ls-files 1)" &&
	echo dirty > expected &&
	test_cmp expected 1

ok 5 - update-index --remove

expecting success: 
	setup_absent &&
	test -z "$(git ls-files -d)"

ok 6 - ls-files --deleted

expecting success: 
	setup_dirty &&
	test -z "$(git ls-files -d)"


Rewrite 0ddfaf193ff13d6ab39b7cbd9eed645e3ee2f050 (1/17)ok 7 - ls-files --deleted

expecting success: 
	setup_absent &&
	test -z "$(git ls-files -m)"


Rewrite e86e54590a6764f0c4219b3fe8b5e971cd5a0ed8 (2/17)ok 8 - ls-files --modified

expecting success: 
	setup_dirty &&
	test -z "$(git ls-files -m)"

ok 9 - ls-files --modified

expecting success: 
	git update-index --no-skip-worktree 1 &&
	echo test > 1 &&
	git update-index 1 &&
	git update-index --skip-worktree 1 &&
	rm 1 &&
	test "$(git grep --no-ext-grep test)" = "1:test"


Rewrite 0e63577b8a9dce52b69167d9c008f6a0e30de818 (3/17)ok 10 - grep with skip-worktree file

expecting success: 
	setup_absent &&
	git diff-index HEAD -- 1 > result &&
	test_cmp expected result


Rewrite 2744380f4984748b7b4c121c182e9c3330a609c5 (4/17)ok 27 - git -p log - default pager is used by default

expecting success: 
		sane_unset GIT_PAGER &&
		test_unconfig core.pager &&
		rm -f PAGER_used &&
		PAGER='wc >PAGER_used' &&
		export PAGER &&
		test_terminal  git -p log &&
		test -e PAGER_used
	
ok 11 - diff-index does not examine skip-worktree absent entries

expecting success: 
	setup_dirty &&
	git diff-index HEAD -- 1 > result &&
	test_cmp expected result


Rewrite d3494446ffa0b10a4a22ad9db09ce4fe83ff7648 (5/17)ok 12 - diff-index does not examine skip-worktree dirty entries

expecting success: 
	setup_absent &&
	test -z "$(git diff-files -- one)"


Rewrite 3d6c5360ccb48d27bbc524f53496821309a1fc79 (6/17)ok 13 - diff-files does not examine skip-worktree absent entries

expecting success: 
	setup_dirty &&
	test -z "$(git diff-files -- one)"


Rewrite ef5df644a239016a9035ed6fe3e7f2b4b4a349bd (7/17)ok 14 - diff-files does not examine skip-worktree dirty entries

expecting success: 
	setup_absent &&
	git rm 1


Rewrite d66aa888e8e10ccecac31b04a73b006afcfb6ab2 (8/17)rm '1'
ok 15 - git-rm succeeds on skip-worktree absent entries

expecting success: 
	git reset &&
	setup_absent &&
	test_must_fail git commit -m null 1


Rewrite 095b78eb9c1f77139224464f38f1e0aff8add3cf (9/17)On branch master
Untracked files:
	2
	expect.full
	expect.skip
	expected
	result
	sub/

nothing added to commit but untracked files present
ok 16 - commit on skip-worktree absent entries

expecting success: 
	git reset &&
	setup_dirty &&
	test_must_fail git commit -m null 1

ok 28 - git -p log - PAGER overrides default pager

expecting success: 
		sane_unset GIT_PAGER &&
		rm -f core.pager_used &&
		PAGER=wc &&
		export PAGER &&
		test_config core.pager 'wc >core.pager_used' &&
		test_terminal  git -p log &&
		test -e core.pager_used
	
On branch master
Untracked files:
	1
	2
	expect.full
	expect.skip
	expected
	result
	sub/

nothing added to commit but untracked files present
ok 17 - commit on skip-worktree dirty entries


Rewrite 20d07e95852c2683da5bd70d3badbd5028484552 (10/17)# passed all 17 test(s)
1..17
*** t7012-skip-worktree-writing.sh ***

Rewrite 8a3423ee5559c5e0c32440a860f6b09a0e6020fc (11/17)Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7012-skip-worktree-writing/.git/
expecting success: 
	test_commit init &&
	echo modified >> init.t &&
	touch added &&
	git add init.t added &&
	git commit -m "modified and added" &&
	git tag top


Rewrite bb8f80d463b54137409c5a381ad07ea6bf4b1867 (12/17)[master (root-commit) 2519212] init
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 init.t

Rewrite 5bae69c6543c34be1d98816e26501bcda79d1d6b (13/17)[master fa1ce8e] modified and added
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
 create mode 100644 added
ok 1 - setup

expecting success: 
	git checkout -f top &&
	git update-index --skip-worktree init.t &&
	rm init.t &&
	git read-tree -m -u HEAD^ &&
	echo init > expected &&
	test_cmp expected init.t

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 fa1ce8e... modified and added

Rewrite 140072ead29d56d10c1c5c473c117e3aed45a333 (14/17)ok 2 - read-tree updates worktree, absent case

expecting success: 
	git checkout -f top &&
	git update-index --skip-worktree init.t &&
	echo dirty >> init.t &&
	test_must_fail git read-tree -m -u HEAD^ &&
	grep -q dirty init.t &&
	test "$(git ls-files -t init.t)" = "S init.t" &&
	git update-index --no-skip-worktree init.t

HEAD is now at fa1ce8e... modified and added
error: Entry 'init.t' not uptodate. Cannot merge.

Rewrite ead226bc0b53c5d210f2326ae871b0fea3004df3 (15/17)ok 3 - read-tree updates worktree, dirty case

expecting success: 
	git checkout -f top &&
	git update-index --skip-worktree added &&
	rm added &&
	git read-tree -m -u HEAD^ &&
	test ! -f added

HEAD is now at fa1ce8e... modified and added
ok 4 - read-tree removes worktree, absent case

expecting success: 
	git checkout -f top &&
	git update-index --skip-worktree added &&
	echo dirty >> added &&
	test_must_fail git read-tree -m -u HEAD^ &&
	grep -q dirty added &&
	test "$(git ls-files -t added)" = "S added" &&
	git update-index --no-skip-worktree added

ok 29 - git -p log - repository-local core.pager setting overrides PAGER


Rewrite 7329f31555df2545350d15ecd0f5eab05e7142e1 (16/17)expecting success: 
		sane_unset GIT_PAGER &&
		rm -f core.pager_used &&
		rm -fr sub &&
		PAGER=wc &&
		stampname=$(pwd)/core.pager_used &&
		export PAGER stampname &&
		test_config core.pager 'wc >"$stampname"' &&
		mkdir sub &&
		(
			cd sub &&
			test_terminal  git -p log
		) &&
		test -e core.pager_used
	
HEAD is now at fa1ce8e... modified and added
error: Entry 'added' not uptodate. Cannot merge.
ok 5 - read-tree removes worktree, dirty case

expecting success: 
	git checkout -f init &&
	mkdir sub &&
	touch ./1 ./2 sub/1 sub/2 &&
	git add 1 2 sub/1 sub/2 &&
	git update-index --skip-worktree 1 sub/1 &&
	git ls-files -t > result &&
	test_cmp expected result

Previous HEAD position was fa1ce8e... modified and added
HEAD is now at 2519212... init

Rewrite 2bfc21d43f33a03177145ce5f42ee28e86b0e4d2 (17/17)ok 6 - index setup

expecting success: 
	setup_absent &&
	git add 1 &&
	test_absent


Ref 'refs/heads/preserved-author' was rewritten
ok 7 - git-add ignores worktree content

expecting success: 
	setup_dirty &&
	git add 1 &&
	test_dirty

ok 20 - author information is preserved

expecting success: 
	echo i > i &&
	test_tick &&
	git commit -m i i &&
	git branch removed-author &&
	git filter-branch -f --commit-filter "\
		if [ \"\$GIT_AUTHOR_NAME\" = \"B V Uips\" ];\
		then\
			skip_commit \"\$@\";
		else\
			git commit-tree \"\$@\";\
		fi" removed-author &&
	cnt1=$(git rev-list master | wc -l) &&
	cnt2=$(git rev-list removed-author | wc -l) &&
	test $cnt1 -eq $(($cnt2 + 1)) &&
	test 0 = $(git rev-list --author="B V Uips" removed-author | wc -l)

ok 8 - git-add ignores worktree content

expecting success: 
	setup_dirty &&
	test_must_fail git rm 1 &&
	test_dirty

[master 68862b3] i
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
error: the following file has changes staged in the index:
    1
(use --cached to keep the file, or -f to force removal)
ok 9 - git-rm fails if worktree is dirty

expecting success: 
	setup_absent &&
	git clean -n > result &&
	test_i18ncmp expected result

ok 30 - git -p log - core.pager overrides PAGER from subdirectory

expecting success: 
		rm -f GIT_PAGER_used &&
		test_config core.pager wc &&
		GIT_PAGER='wc >GIT_PAGER_used' &&
		export GIT_PAGER &&
		test_terminal  git -p log &&
		test -e GIT_PAGER_used
	
ok 10 - git-clean, absent case

expecting success: 
	setup_dirty &&
	git clean -n > result &&
	test_i18ncmp expected result

ok 11 - git-clean, dirty case

# passed all 11 test(s)
1..11

Rewrite 0ddfaf193ff13d6ab39b7cbd9eed645e3ee2f050 (1/18)*** t7030-verify-tag.sh ***

Rewrite e86e54590a6764f0c4219b3fe8b5e971cd5a0ed8 (2/18)Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7030-verify-tag/.git/

Rewrite 0e63577b8a9dce52b69167d9c008f6a0e30de818 (3/18)
Rewrite 2744380f4984748b7b4c121c182e9c3330a609c5 (4/18)ok 31 - git -p log - GIT_PAGER overrides core.pager

expecting success: 
		sane_unset PAGER GIT_PAGER &&
		test_unconfig core.pager &&
		rm -f default_pager_used &&
		cat >$less <<-\EOF &&
		#!/bin/sh
		wc >default_pager_used
		EOF
		chmod +x $less &&
		(
			PATH=.:$PATH &&
			export PATH &&
			test_terminal  git aliasedlog
		) &&
		test -e default_pager_used
	

Rewrite d3494446ffa0b10a4a22ad9db09ce4fe83ff7648 (5/18)
Rewrite 3d6c5360ccb48d27bbc524f53496821309a1fc79 (6/18)expecting success: 
	echo 1 >file && git add file &&
	test_tick && git commit -m initial &&
	git tag -s -m initial initial &&
	git branch side &&

	echo 2 >file && test_tick && git commit -a -m second &&
	git tag -s -m second second &&

	git checkout side &&
	echo 3 >elif && git add elif &&
	test_tick && git commit -m "third on side" &&

	git checkout master &&
	test_tick && git merge -S side &&
	git tag -s -m merge merge &&

	echo 4 >file && test_tick && git commit -a -S -m "fourth unsigned" &&
	git tag -a -m fourth-unsigned fourth-unsigned &&

	test_tick && git commit --amend -S -m "fourth signed" &&
	git tag -s -m fourth fourth-signed &&

	echo 5 >file && test_tick && git commit -a -m "fifth" &&
	git tag fifth-unsigned &&

	git config commit.gpgsign true &&
	echo 6 >file && test_tick && git commit -a -m "sixth" &&
	git tag -a -m sixth sixth-unsigned &&

	test_tick && git rebase -f HEAD^^ && git tag -s -m 6th sixth-signed HEAD^ &&
	git tag -m seventh -s seventh-signed &&

	echo 8 >file && test_tick && git commit -a -m eighth &&
	git tag -uB7227189 -m eighth eighth-signed-alt


Rewrite ef5df644a239016a9035ed6fe3e7f2b4b4a349bd (7/18)[master (root-commit) 777c62c] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file

Rewrite d66aa888e8e10ccecac31b04a73b006afcfb6ab2 (8/18)[master 38545ae] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)

Rewrite 095b78eb9c1f77139224464f38f1e0aff8add3cf (9/18)ok 32 - git aliasedlog - default pager is used by default

expecting success: 
		sane_unset GIT_PAGER &&
		test_unconfig core.pager &&
		rm -f PAGER_used &&
		PAGER='wc >PAGER_used' &&
		export PAGER &&
		test_terminal  git aliasedlog &&
		test -e PAGER_used
	
Switched to branch 'side'
[side 684a8f8] third on side
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 elif
Switched to branch 'master'

Rewrite 20d07e95852c2683da5bd70d3badbd5028484552 (10/18)Merging:
38545ae second
virtual side
found 1 common ancestor:
777c62c initial
Merge made by the 'recursive' strategy.
 elif | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 elif

Rewrite 8a3423ee5559c5e0c32440a860f6b09a0e6020fc (11/18)
Rewrite bb8f80d463b54137409c5a381ad07ea6bf4b1867 (12/18)[master 7b04255] fourth unsigned
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)

Rewrite 5bae69c6543c34be1d98816e26501bcda79d1d6b (13/18)[master 89e5580] fourth signed
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:17:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)

Rewrite 140072ead29d56d10c1c5c473c117e3aed45a333 (14/18)[master beb33ee] fifth
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 33 - git aliasedlog - PAGER overrides default pager

expecting success: 
		sane_unset GIT_PAGER &&
		rm -f core.pager_used &&
		PAGER=wc &&
		export PAGER &&
		test_config core.pager 'wc >core.pager_used' &&
		test_terminal  git aliasedlog &&
		test -e core.pager_used
	

Rewrite ead226bc0b53c5d210f2326ae871b0fea3004df3 (15/18)[master 112dc94] sixth
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)

Rewrite 7329f31555df2545350d15ecd0f5eab05e7142e1 (16/18)
Rewrite 2bfc21d43f33a03177145ce5f42ee28e86b0e4d2 (17/18)
Rewrite 68862b396e34e966159af1904a1560522f345981 (18/18)Current branch master is up to date, rebase forced.
First, rewinding head to replay your work on top of it...

Ref 'refs/heads/removed-author' was rewritten
Applying: fifth
ok 34 - git aliasedlog - repository-local core.pager setting overrides PAGER

expecting success: 
		sane_unset GIT_PAGER &&
		rm -f core.pager_used &&
		rm -fr sub &&
		PAGER=wc &&
		stampname=$(pwd)/core.pager_used &&
		export PAGER stampname &&
		test_config core.pager 'wc >"$stampname"' &&
		mkdir sub &&
		(
			cd sub &&
			test_terminal  git aliasedlog
		) &&
		test -e core.pager_used
	
Applying: sixth
ok 21 - remove a certain author's commits

expecting success: 
	test_must_fail git filter-branch -f master xy-problem &&
	test_must_fail git filter-branch -f HEAD^

fatal: ambiguous argument 'xy-problem': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
[master 12d7bb1] eighth
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Which ref do you want to rewrite?
ok 22 - barf on invalid name

expecting success: 
	git filter-branch -f --commit-filter "\
		parent=\$(git rev-parse \$GIT_COMMIT^) &&
		mapped=\$(map \$parent) &&
		actual=\$(echo \"\$@\" | sed \"s/^.*-p //\") &&
		test \$mapped = \$actual &&
		git commit-tree \"\$@\";" master~2..master &&
	git rev-parse --verify master

ok 1 - create signed tags

ok 35 - git aliasedlog - core.pager overrides PAGER from subdirectory

expecting success: 
	(
		for tag in initial second merge fourth-signed sixth-signed seventh-signed
		do
			git verify-tag $tag 2>actual &&
			grep "Good signature from" actual &&
			! grep "BAD signature from" actual &&
			echo $tag OK || exit 1
		done
	) &&
	(
		for tag in fourth-unsigned fifth-unsigned sixth-unsigned
		do
			test_must_fail git verify-tag $tag 2>actual &&
			! grep "Good signature from" actual &&
			! grep "BAD signature from" actual &&
			echo $tag OK || exit 1
		done
	) &&
	(
		for tag in eighth-signed-alt
		do
			git verify-tag $tag 2>actual &&
			grep "Good signature from" actual &&
			! grep "BAD signature from" actual &&
			grep "not certified" actual &&
			echo $tag OK || exit 1
		done
	)

expecting success: 
		rm -f GIT_PAGER_used &&
		test_config core.pager wc &&
		GIT_PAGER='wc >GIT_PAGER_used' &&
		export GIT_PAGER &&
		test_terminal  git aliasedlog &&
		test -e GIT_PAGER_used
	
gpg: Good signature from "C O Mitter <committer@example.com>"
initial OK
gpg: Good signature from "C O Mitter <committer@example.com>"
second OK
gpg: Good signature from "C O Mitter <committer@example.com>"
merge OK

Rewrite 2bfc21d43f33a03177145ce5f42ee28e86b0e4d2 (1/2)gpg: Good signature from "C O Mitter <committer@example.com>"
fourth-signed OK
gpg: Good signature from "C O Mitter <committer@example.com>"
sixth-signed OK

Rewrite 68862b396e34e966159af1904a1560522f345981 (2/2)gpg: Good signature from "C O Mitter <committer@example.com>"
seventh-signed OK
ok 36 - git aliasedlog - GIT_PAGER overrides core.pager

expecting success: 
		sane_unset PAGER GIT_PAGER &&
		test_unconfig core.pager &&
		rm -f default_pager_used &&
		cat >$less <<-\EOF &&
		#!/bin/sh
		wc >default_pager_used
		EOF
		chmod +x $less &&
		(
			PATH=.:$PATH &&
			export PATH &&
			test_terminal  git -p aliasedlog
		) &&
		test -e default_pager_used
	
fourth-unsigned OK

fifth-unsigned OK
WARNING: Ref 'refs/heads/master' is unchanged
sixth-unsigned OK
gpg: Good signature from "Eris Discordia <discord@example.net>"
68862b396e34e966159af1904a1560522f345981
ok 23 - "map" works in commit filter

expecting success: 

	git checkout -b rerere A &&
	mkdir foo &&
	name="れれれ" &&
	>foo/$name &&
	git add foo &&
	git commit -m "Adding a file" &&
	git filter-branch --tree-filter "rm -fr foo" &&
	test_must_fail git ls-files --error-unmatch "foo/$name" &&
	test $(git rev-parse --verify rerere) != $(git rev-parse --verify A)


gpg: WARNING: This key is not certified with a trusted signature!
eighth-signed-alt OK
ok 2 - verify and show signatures

expecting success: 
	git cat-file tag seventh-signed >raw &&
	sed -e "s/seventh/7th forged/" raw >forged1 &&
	git hash-object -w -t tag forged1 >forged1.tag &&
	test_must_fail git verify-tag $(cat forged1.tag) 2>actual1 &&
	grep "BAD signature from" actual1 &&
	! grep "Good signature from" actual1

Switched to a new branch 'rerere'
[rerere 1d45e88] Adding a file
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 "foo/\343\202\214\343\202\214\343\202\214"
gpg: BAD signature from "C O Mitter <committer@example.com>"
ok 3 - detect fudged signature

expecting success: 
	(
		for tag in initial second merge fourth-signed sixth-signed seventh-signed
		do
			git verify-tag --raw $tag 2>actual &&
			grep "GOODSIG" actual &&
			! grep "BADSIG" actual &&
			echo $tag OK || exit 1
		done
	) &&
	(
		for tag in fourth-unsigned fifth-unsigned sixth-unsigned
		do
			test_must_fail git verify-tag --raw $tag 2>actual &&
			! grep "GOODSIG" actual &&
			! grep "BADSIG" actual &&
			echo $tag OK || exit 1
		done
	) &&
	(
		for tag in eighth-signed-alt
		do
			git verify-tag --raw $tag 2>actual &&
			grep "GOODSIG" actual &&
			! grep "BADSIG" actual &&
			grep "TRUST_UNDEFINED" actual &&
			echo $tag OK || exit 1
		done
	)

[GNUPG:] GOODSIG 13B6F51ECDDE430D C O Mitter <committer@example.com>
initial OK
[GNUPG:] GOODSIG 13B6F51ECDDE430D C O Mitter <committer@example.com>
second OK

Rewrite 0ddfaf193ff13d6ab39b7cbd9eed645e3ee2f050 (1/2)ok 37 - git -p aliasedlog - default pager is used by default

expecting success: 
		sane_unset GIT_PAGER &&
		test_unconfig core.pager &&
		rm -f PAGER_used &&
		PAGER='wc >PAGER_used' &&
		export PAGER &&
		test_terminal  git -p aliasedlog &&
		test -e PAGER_used
	
[GNUPG:] GOODSIG 13B6F51ECDDE430D C O Mitter <committer@example.com>
merge OK
[GNUPG:] GOODSIG 13B6F51ECDDE430D C O Mitter <committer@example.com>
fourth-signed OK
[GNUPG:] GOODSIG 13B6F51ECDDE430D C O Mitter <committer@example.com>

Rewrite 1d45e8854f1dd5452938be2dedb173087134c05c (2/2)sixth-signed OK
[GNUPG:] GOODSIG 13B6F51ECDDE430D C O Mitter <committer@example.com>
seventh-signed OK
fourth-unsigned OK
fifth-unsigned OK
sixth-unsigned OK

[GNUPG:] GOODSIG 61092E85B7227189 Eris Discordia <discord@example.net>
Ref 'refs/heads/rerere' was rewritten
[GNUPG:] TRUST_UNDEFINED
eighth-signed-alt OK
ok 4 - verify signatures with --raw

# passed all 4 test(s)
1..4
error: pathspec 'foo/れれれ' did not match any file(s) known to git.
Did you forget to 'git add'?
*** t7060-wtstatus.sh ***
ok 38 - git -p aliasedlog - PAGER overrides default pager

expecting success: 
		sane_unset GIT_PAGER &&
		rm -f core.pager_used &&
		PAGER=wc &&
		export PAGER &&
		test_config core.pager 'wc >core.pager_used' &&
		test_terminal  git -p aliasedlog &&
		test -e core.pager_used
	
ok 24 - Name needing quotes

expecting success: 
	git reset --hard &&
	git checkout master &&

	mkdir foo &&
	touch foo/bar &&
	git add foo &&
	test_tick &&
	git commit -m "Adding foo" &&

	git rm -r foo &&
	test_tick &&
	git commit -m "Removing foo" &&

	mkdir foo &&
	touch foo/bar &&
	git add foo &&
	test_tick &&
	git commit -m "Re-adding foo" &&

	git filter-branch -f --subdirectory-filter foo &&
	test $(git rev-list master | wc -l) = 3

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:      10000
Total objects:         7999 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:         7999 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              1
Memory total:          2489 KiB
       pools:          2098 KiB
     objects:           390 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =       8000
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =    1177891 /    1177891
---------------------------------------------------------------------

HEAD is now at 643bd56 Adding a file
Switched to branch 'master'
Switched to branch 'master'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7060-wtstatus/.git/
expecting success: 
	git config --global advice.statusuoption false &&
	test_commit A &&
	test_commit B oneside added &&
	git checkout A^0 &&
	test_commit C oneside created

[master 3305444] Adding foo
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 foo/bar
rm 'foo/bar'
[master 19fad5f] Removing foo
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 delete mode 100644 foo/bar
[master (root-commit) 0ddfaf1] A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 A.t
[master 7aafb76] Re-adding foo
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 foo/bar
[master 5747a32] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 oneside
Note: checking out 'A^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 0ddfaf1... A
[detached HEAD f7fe030] C
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 oneside
ok 1 - setup

expecting success: 
	git checkout B^0 &&
	test_must_fail git merge C

Previous HEAD position was f7fe030... C
HEAD is now at 5747a32... B
Merging:
5747a32 B
virtual C
found 1 common ancestor:
0ddfaf1 A
Auto-merging oneside
CONFLICT (add/add): Merge conflict in oneside
Automatic merge failed; fix conflicts and then commit the result.
ok 2 - A/A conflict

expecting success: 
	git diff --cached --name-status >actual &&
	echo "U	oneside" >expect &&
	test_cmp expect actual

ok 3 - Report path with conflict

expecting success: 
	git diff --cached --name-status HEAD^ >actual &&
	echo "U	oneside" >expect &&
	test_cmp expect actual

ok 39 - git -p aliasedlog - repository-local core.pager setting overrides PAGER

checking known breakage: 
		sane_unset GIT_PAGER &&
		rm -f core.pager_used &&
		rm -fr sub &&
		PAGER=wc &&
		stampname=$(pwd)/core.pager_used &&
		export PAGER stampname &&
		test_config core.pager 'wc >"$stampname"' &&
		mkdir sub &&
		(
			cd sub &&
			test_terminal  git -p aliasedlog
		) &&
		test -e core.pager_used
	
ok 4 - Report new path with conflict

expecting success: 
	cat >expect <<EOF &&
On branch side
You have unmerged paths.
  (fix conflicts and run "git commit")

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)

	deleted by us:   foo

no changes added to commit (use "git add" and/or "git commit -a")
EOF
	mkdir mdconflict &&
	(
		cd mdconflict &&
		git init &&
		test_commit initial foo "" &&
		test_commit modify foo foo &&
		git checkout -b side HEAD^ &&
		git rm foo &&
		git commit -m delete &&
		test_must_fail git merge master &&
		test_must_fail git commit --dry-run >../actual &&
		test_i18ncmp ../expect ../actual &&
		git status >../actual &&
		test_i18ncmp ../expect ../actual
	)


Rewrite 3305444c998d38f6e0ae04b8b2dde079396fbd96 (1/3)Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7060-wtstatus/mdconflict/.git/
[master (root-commit) a3c5375] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo

Rewrite 19fad5fb6ee227e558ea3a23a347d3c375fde390 (2/3)[master efd4a38] modify
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 140 - --contains works in a deep repo

Switched to a new branch 'side'
# passed all 140 test(s)
1..140
rm 'foo'

Rewrite 7aafb762e4a3130535b3e68ddc425c6c7c339d3b (3/3)[side 0599bc2] delete
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 foo
Merging:
0599bc2 delete
virtual master
found 1 common ancestor:
a3c5375 initial
CONFLICT (modify/delete): foo deleted in HEAD and modified in master. Version master of foo left in tree.
Automatic merge failed; fix conflicts and then commit the result.

*** t7061-wtstatus-ignore.sh ***
ok 5 - M/D conflict does not segfault

expecting success: 
	git rm -f -r . &&
	cat "$TEST_DIRECTORY/README" >ONE &&
	git add ONE &&
	test_tick &&
	git commit -m "One commit with ONE" &&

	echo Modified >TWO &&
	cat ONE >>TWO &&
	cat ONE >>THREE &&
	git add TWO THREE &&
	sha1=$(git rev-parse :ONE) &&
	git rm --cached ONE &&
	(
		echo "100644 $sha1 1	ONE" &&
		echo "100644 $sha1 2	ONE" &&
		echo "100644 $sha1 3	ONE"
	) | git update-index --index-info &&
	echo Further >>THREE

Ref 'refs/heads/master' was rewritten
oneside: needs merge
rm 'A.t'
rm 'oneside'
rm 'oneside'
[detached HEAD 28342a8] One commit with ONE
 Author: A U Thor <author@example.com>
      5      15     137
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7061-wtstatus-ignore/.git/
ok 25 - Subdirectory filter with disappearing trees

expecting success: 
	git tag -m atag T &&
	git cat-file tag T > expect &&
	git filter-branch -f --tag-name-filter cat &&
	git cat-file tag T > actual &&
	test_cmp expect actual

not ok 40 - git -p aliasedlog - core.pager overrides PAGER from subdirectory # TODO known breakage

expecting success: 
		rm -f GIT_PAGER_used &&
		test_config core.pager wc &&
		GIT_PAGER='wc >GIT_PAGER_used' &&
		export GIT_PAGER &&
		test_terminal  git -p aliasedlog &&
		test -e GIT_PAGER_used
	
expecting success: 
	echo "ignored" >.gitignore &&
	mkdir untracked &&
	: >untracked/ignored &&
	: >untracked/uncommitted &&
	git status --porcelain --ignored >actual &&
	test_cmp expected actual

rm 'ONE'
ok 1 - status untracked directory with --ignored

expecting success: 
	printf "\357\273\277ignored\n" >.gitignore &&
	mkdir -p untracked &&
	: >untracked/ignored &&
	: >untracked/uncommitted &&
	git status --porcelain --ignored >actual &&
	test_cmp expected actual

ok 6 - rename & unmerged setup

expecting success: 
	git status -suno >actual &&
	cat >expect <<-EOF &&
	UU ONE
	AM THREE
	A  TWO
	EOF
	test_cmp expect actual

ok 2 - same with gitignore starting with BOM

expecting success: 
	git status --porcelain --ignored -u >actual &&
	test_cmp expected actual

ok 7 - rename & unmerged status

expecting success: 
	cat >expected <<-EOF &&
	U	ONE
	A	THREE
	A	TWO
	EOF
	git diff-index --cached --name-status HEAD >actual &&
	test_cmp expected actual

ok 3 - status untracked directory with --ignored -u

expecting success: 
	git status --porcelain --ignored untracked/ >actual &&
	test_cmp expected actual

ok 8 - git diff-index --cached shows 2 added + 1 unmerged

expecting success: 
	cat >expected <<-EOF &&
	U	ONE
	A	THREE
	A	TWO
	EOF
	git diff-index --cached -M --name-status HEAD >actual &&
	test_cmp expected actual

ok 4 - status prefixed untracked directory with --ignored

expecting success: 
	git status --porcelain --ignored -u untracked/ >actual &&
	test_cmp expected actual

ok 9 - git diff-index --cached -M shows 2 added + 1 unmerged

expecting success: 
	cat >expected <<-EOF &&
	U	ONE
	C	ONE	THREE
	C	ONE	TWO
	EOF
	git diff-index --cached -C --name-status HEAD |
	sed "s/^C[0-9]*/C/g" >actual &&
	test_cmp expected actual

ok 5 - status prefixed untracked sub-directory with --ignored -u

expecting success: 
	rm -rf untracked &&
	mkdir ignored &&
	: >ignored/uncommitted &&
	git status --porcelain --ignored >actual &&
	test_cmp expected actual

ok 10 - git diff-index --cached -C shows 2 copies + 1 unmerged

expecting success: 
	git reset --hard &&
	git checkout master &&
	test_commit init main.txt init &&
	git checkout -b second_branch &&
	git rm main.txt &&
	git commit -m "main.txt deleted on second_branch" &&
	test_commit second conflict.txt second &&
	git checkout master &&
	test_commit on_second main.txt on_second &&
	test_commit master conflict.txt master &&
	test_must_fail git merge second_branch &&
	cat >expected <<\EOF &&
On branch master
You have unmerged paths.
  (fix conflicts and run "git commit")

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)

	both added:      conflict.txt
	deleted by them: main.txt

no changes added to commit (use "git add" and/or "git commit -a")
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

HEAD is now at 28342a8 One commit with ONE
ok 6 - status ignored directory with --ignore

expecting success: 
	git status --porcelain --ignored -u >actual &&
	test_cmp expected actual

Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  28342a8 One commit with ONE

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> 28342a8

Switched to branch 'master'
ok 7 - status ignored directory with --ignore -u

expecting success: 
	rm -rf ignored &&
	mkdir untracked-ignored &&
	mkdir untracked-ignored/test &&
	git status --porcelain --ignored >actual &&
	test_cmp expected actual

[master e5fc44e] init
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 main.txt
ok 8 - status empty untracked directory with --ignore


Rewrite f78b0905e139f6556b004c5f87cfe750aa8e3286 (1/3)expecting success: 
	git status --porcelain --ignored -u >actual &&
	test_cmp expected actual

ok 9 - status empty untracked directory with --ignore -u

Switched to a new branch 'second_branch'
expecting success: 
	: >untracked-ignored/ignored &&
	: >untracked-ignored/test/ignored &&
	git status --porcelain --ignored >actual &&
	test_cmp expected actual

rm 'main.txt'
ok 10 - status untracked directory with ignored files with --ignore

expecting success: 
	git status --porcelain --ignored -u >actual &&
	test_cmp expected actual

[second_branch 1fd8046] main.txt deleted on second_branch
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 main.txt

Rewrite c9fbe965b33cbcb81865d123297fe4df816d7555 (2/3)ok 11 - status untracked directory with ignored files with --ignore -u

expecting success: 
	rm -rf untracked-ignored &&
	mkdir tracked &&
	: >tracked/committed &&
	git add tracked/committed &&
	git commit -m. &&
	echo "tracked" >.gitignore &&
	git status --porcelain --ignored >actual &&
	test_cmp expected actual

[second_branch e4d0ede] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 conflict.txt
Switched to branch 'master'
[master (root-commit) a8cd782] .
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 tracked/committed

Rewrite fea59ed4667894c7bd682b11f147174ab39c40bd (3/3)ok 41 - git -p aliasedlog - GIT_PAGER overrides core.pager

ok 12 - status ignored tracked directory with --ignore

expecting success: 
		sane_unset PAGER GIT_PAGER &&
		test_unconfig core.pager &&
		rm -f default_pager_used &&
		cat >$less <<-\EOF &&
		#!/bin/sh
		wc >default_pager_used
		EOF
		chmod +x $less &&
		(
			PATH=.:$PATH &&
			export PATH &&
			test_terminal  git -p true
		) &&
		test -e default_pager_used
	
expecting success: 
	git status --porcelain --ignored -u >actual &&
	test_cmp expected actual

[master 9824e6a] on_second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 13 - status ignored tracked directory with --ignore -u

expecting success: 
	echo "committed" >>.gitignore &&
	git status --porcelain --ignored >actual &&
	test_cmp expected actual


ok 14 - status ignored tracked directory and ignored file with --ignore

expecting success: 
	git status --porcelain --ignored -u >actual &&
	test_cmp expected actual

WARNING: Ref 'refs/heads/master' is unchanged
[master b29dd8b] master
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 conflict.txt
ok 15 - status ignored tracked directory and ignored file with --ignore -u

expecting success: 
	echo "tracked" >.gitignore &&
	: >tracked/uncommitted &&
	git status --porcelain --ignored >actual &&
	test_cmp expected actual

T -> T (fea59ed4667894c7bd682b11f147174ab39c40bd -> fea59ed4667894c7bd682b11f147174ab39c40bd)
ok 16 - status ignored tracked directory and uncommitted file with --ignore

Merging:
b29dd8b master
virtual second_branch
found 1 common ancestor:
e5fc44e init
CONFLICT (modify/delete): main.txt deleted in second_branch and modified in HEAD. Version HEAD of main.txt left in tree.
Auto-merging conflict.txt
CONFLICT (add/add): Merge conflict in conflict.txt
Automatic merge failed; fix conflicts and then commit the result.
expecting success: 
	git status --porcelain --ignored -u >actual &&
	test_cmp expected actual

ok 17 - status ignored tracked directory and uncommitted file with --ignore -u

ok 11 - status when conflicts with add and rm advice (deleted by them)

expecting success: 
	git reset --hard &&
	git checkout -b conflict &&
	test_commit one main.txt one &&
	git branch conflict_second &&
	git mv main.txt sub_master.txt &&
	git commit -m "main.txt renamed in sub_master.txt" &&
	git checkout conflict_second &&
	git mv main.txt sub_second.txt &&
	git commit -m "main.txt renamed in sub_second.txt"

expecting success: 
	rm -rf tracked/uncommitted &&
	mkdir tracked/ignored &&
	: >tracked/ignored/uncommitted &&
	git status --porcelain --ignored >actual &&
	test_cmp expected actual

ok 26 - Tag name filtering retains tag message

HEAD is now at b29dd8b master
expecting success: 
	sha1=$(git rev-parse HEAD) &&
	sha1t=$(echo "$faux_gpg_tag" | sed -e s/XXXXXX/$sha1/ | git mktag) &&
	git update-ref "refs/tags/S" "$sha1t" &&
	echo "$faux_gpg_tag" | sed -e s/XXXXXX/$sha1/ | head -n 6 > expect &&
	git filter-branch -f --tag-name-filter cat &&
	git cat-file tag S > actual &&
	test_cmp expect actual

ok 18 - status ignored tracked directory with uncommitted file in untracked subdir with --ignore

expecting success: 
	git status --porcelain --ignored -u >actual &&
	test_cmp expected actual

ok 19 - status ignored tracked directory with uncommitted file in untracked subdir with --ignore -u

Switched to a new branch 'conflict'
expecting success: 
	: >tracked/ignored/committed &&
	git add -f tracked/ignored/committed &&
	git commit -m. &&
	git status --porcelain --ignored >actual &&
	test_cmp expected actual

[conflict 21bce8e] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 1918629] .
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 tracked/ignored/committed
ok 20 - status ignored tracked directory with uncommitted file in tracked subdir with --ignore

expecting success: 
	git status --porcelain --ignored -u >actual &&
	test_cmp expected actual

ok 21 - status ignored tracked directory with uncommitted file in tracked subdir with --ignore -u

# passed all 21 test(s)
1..21
[conflict e06d4c6] main.txt renamed in sub_master.txt
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename main.txt => sub_master.txt (100%)
Switched to branch 'conflict_second'
*** t7062-wtstatus-ignorecase.sh ***
ok 42 - git -p true - default pager is used by default

[conflict_second 6b2443c] main.txt renamed in sub_second.txt
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename main.txt => sub_second.txt (100%)
ok 12 - prepare for conflicts

expecting success: 
	test_must_fail git merge conflict &&
	cat >expected <<\EOF &&
On branch conflict_second
You have unmerged paths.
  (fix conflicts and run "git commit")

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)

	both deleted:    main.txt
	added by them:   sub_master.txt
	added by us:     sub_second.txt

no changes added to commit (use "git add" and/or "git commit -a")
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

expecting success: 
		sane_unset GIT_PAGER &&
		test_unconfig core.pager &&
		rm -f PAGER_used &&
		PAGER='wc >PAGER_used' &&
		export PAGER &&
		test_terminal  git -p true &&
		test -e PAGER_used
	
Merging:
6b2443c main.txt renamed in sub_second.txt
virtual conflict
found 1 common ancestor:
21bce8e one
CONFLICT (rename/rename): Rename "main.txt"->"sub_second.txt" in branch "HEAD" rename "main.txt"->"sub_master.txt" in "conflict"
Automatic merge failed; fix conflicts and then commit the result.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7062-wtstatus-ignorecase/.git/
expecting success: 
	# note: "V/", "V/XQANY/" and "WURZAUP/" produce the same hash code
	# in name-hash.c::hash_name
	mkdir V &&
	mkdir V/XQANY &&
	mkdir WURZAUP &&
	touch V/XQANY/test &&
	git config core.ignorecase true &&
	git add . &&
	# test is successful if git status completes (no endless loop)
	git status

ok 13 - status when conflicts with add and rm advice (both deleted)

expecting success: 
	git reset --hard conflict_second &&
	test_must_fail git merge conflict &&
	git add sub_master.txt &&
	git add sub_second.txt &&
	cat >expected <<\EOF &&
On branch conflict_second
You have unmerged paths.
  (fix conflicts and run "git commit")

Changes to be committed:

	new file:   sub_master.txt

Unmerged paths:
  (use "git rm <file>..." to mark resolution)

	both deleted:    main.txt

Untracked files not listed (use -u option to show untracked files)
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual &&
	git reset --hard &&
	git checkout master


Rewrite f78b0905e139f6556b004c5f87cfe750aa8e3286 (1/3)HEAD is now at 6b2443c main.txt renamed in sub_second.txt
Merging:
6b2443c main.txt renamed in sub_second.txt
virtual conflict
found 1 common ancestor:
21bce8e one
CONFLICT (rename/rename): Rename "main.txt"->"sub_second.txt" in branch "HEAD" rename "main.txt"->"sub_master.txt" in "conflict"
Automatic merge failed; fix conflicts and then commit the result.
On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   V/XQANY/test

ok 1 - status with hash collisions

# passed all 1 test(s)
1..1

Rewrite c9fbe965b33cbcb81865d123297fe4df816d7555 (2/3)*** t7063-status-untracked-cache.sh ***
HEAD is now at 6b2443c main.txt renamed in sub_second.txt
warning: refname 'master' is ambiguous.
Switched to branch 'master'

Rewrite fea59ed4667894c7bd682b11f147174ab39c40bd (3/3)ok 14 - status when conflicts with only rm advice (both deleted)

expecting success: 
	git reset --hard &&
	git checkout master^0 &&
	git status --branch --porcelain >actual &&
	cat >expected <<-EOF &&
	## HEAD (no branch)
	?? .gitconfig
	?? actual
	?? expect
	?? expected
	?? mdconflict/
	EOF
	test_i18ncmp expected actual

HEAD is now at b29dd8b master
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7063-status-untracked-cache/.git/
warning: refname 'master' is ambiguous.
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 b29dd8b... master
checking prerequisite: UNTRACKED_CACHE

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	{ git update-index --untracked-cache; ret=$?; } &&
	test $ret -ne 1

)
Testing .
ok 15 - status --branch with detached HEAD

WARNING: Ref 'refs/heads/master' is unchanged
# passed all 15 test(s)
1..15
S -> S (fea59ed4667894c7bd682b11f147174ab39c40bd -> fea59ed4667894c7bd682b11f147174ab39c40bd)
gpg signature stripped from tag object 5e10caf7d74c3ace8930aa1d5449d4d0ceb2e9e0
ok 43 - git -p true - PAGER overrides default pager

expecting success: 
		sane_unset GIT_PAGER &&
		rm -f core.pager_used &&
		PAGER=wc &&
		export PAGER &&
		test_config core.pager 'wc >core.pager_used' &&
		test_terminal  git -p true &&
		test -e core.pager_used
	
*** t7101-reset-empty-subdirs.sh ***
T -> T (fea59ed4667894c7bd682b11f147174ab39c40bd -> fea59ed4667894c7bd682b11f147174ab39c40bd)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7101-reset-empty-subdirs/.git/
expecting success: mkdir path0 &&
     cp "$TEST_DIRECTORY"/../COPYING path0/COPYING &&
     git add path0/COPYING &&
     git commit -m add -a
ok 27 - Tag name filtering strips gpg signature

expecting success: 
	mkdir gpg &&
	touch gpg/foo &&
	git add gpg &&
	test_tick &&
	git commit -S -m "Adding gpg" &&

	git log -1 --format="%s" > expect &&
	git filter-branch -f --msg-filter "cat" &&
	git log -1 --format="%s" > actual &&
	test_cmp expect actual

[master (root-commit) 353f90e] add
 Author: A U Thor <author@example.com>
 1 file changed, 360 insertions(+)
 create mode 100644 path0/COPYING
ok 1 - creating initial files

expecting success: mkdir path1 &&
     mkdir path1/path2 &&
     cp "$TEST_DIRECTORY"/../COPYING path1/path2/COPYING &&
     cp "$TEST_DIRECTORY"/../COPYING path1/COPYING &&
     cp "$TEST_DIRECTORY"/../COPYING COPYING &&
     cp "$TEST_DIRECTORY"/../COPYING path0/COPYING-TOO &&
     git add path1/path2/COPYING &&
     git add path1/COPYING &&
     git add COPYING &&
     git add path0/COPYING-TOO &&
     git commit -m change -a
[master b2f6d92] Adding gpg
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 gpg/foo
[master 680178f] change
 Author: A U Thor <author@example.com>
 4 files changed, 1440 insertions(+)
 create mode 100644 COPYING
 create mode 100644 path0/COPYING-TOO
 create mode 100644 path1/COPYING
 create mode 100644 path1/path2/COPYING
ok 2 - creating second files

expecting success: git reset --hard HEAD^
HEAD is now at 353f90e add
ok 3 - resetting tree HEAD^

expecting success: test -d path0 &&
     test -f path0/COPYING
ok 4 - checking initial files exist after rewind

expecting success: ! test -f path1/path2/COPYING
ok 5 - checking lack of path1/path2/COPYING

expecting success: ! test -f path1/COPYING
ok 6 - checking lack of path1/COPYING

expecting success: ! test -f COPYING
ok 7 - checking lack of COPYING

expecting success: ! test -f path0/COPYING-TOO
ok 8 - checking checking lack of path1/COPYING-TOO

expecting success: ! test -d path1/path2
ok 9 - checking lack of path1/path2

expecting success: ! test -d path1
ok 10 - checking lack of path1

# passed all 10 test(s)
1..10
*** t7102-reset.sh ***

Rewrite f78b0905e139f6556b004c5f87cfe750aa8e3286 (1/4)ok 44 - git -p true - repository-local core.pager setting overrides PAGER

checking known breakage: 
		sane_unset GIT_PAGER &&
		rm -f core.pager_used &&
		rm -fr sub &&
		PAGER=wc &&
		stampname=$(pwd)/core.pager_used &&
		export PAGER stampname &&
		test_config core.pager 'wc >"$stampname"' &&
		mkdir sub &&
		(
			cd sub &&
			test_terminal  git -p true
		) &&
		test -e core.pager_used
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7102-reset/.git/
expecting success: 
	test_tick &&
	echo "1st file" >first &&
	git add first &&
	git commit -m "create 1st file" &&

	echo "2nd file" >second &&
	git add second &&
	git commit -m "create 2nd file" &&

	echo "2nd line 1st file" >>first &&
	git commit -a -m "modify 1st file" &&

	git rm first &&
	git mv second secondfile &&
	git commit -a -m "remove 1st and rename 2nd" &&

	echo "1st line 2nd file" >secondfile &&
	echo "2nd line 2nd file" >>secondfile &&
	# "git commit -m" would break MinGW, as Windows refuse to pass
	# $test_encoding encoded parameter to git.
	commit_msg $test_encoding | git -c "i18n.commitEncoding=$test_encoding" commit -a -F - &&
	head5=$(git rev-parse --verify HEAD)


Rewrite c9fbe965b33cbcb81865d123297fe4df816d7555 (2/4)[master (root-commit) 811bbdf] create 1st file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 first
[master ba22ccd] create 2nd file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 second
.
Rewrite fea59ed4667894c7bd682b11f147174ab39c40bd (3/4)[master ddaefe0] modify 1st file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
rm 'first'
[master d1a4bc3] remove 1st and rename 2nd
 Author: A U Thor <author@example.com>
 2 files changed, 2 deletions(-)
 delete mode 100644 first
 rename second => secondfile (100%)
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+), 1 deletion(-)
ok 1 - creating initial files and commits

expecting success: 
	hex=$(git log -1 --format="%h") &&
	git reset --hard > .actual &&
	echo HEAD is now at $hex $(commit_msg) > .expected &&
	test_cmp .expected .actual


ok 2 - reset --hard message

expecting success: 
	hex=$(git log -1 --format="%h") &&
	git -c "i18n.logOutputEncoding=$test_encoding" reset --hard > .actual &&
	echo HEAD is now at $hex $(commit_msg $test_encoding) > .expected &&
	test_cmp .expected .actual

Ref 'refs/heads/master' was rewritten
ok 3 - reset --hard message (ISO8859-1 logoutputencoding)

expecting success: 
	test_must_fail git reset aaaaaa &&
	test_must_fail git reset --mixed aaaaaa &&
	test_must_fail git reset --soft aaaaaa &&
	test_must_fail git reset --hard aaaaaa &&
	check_changes $head5

fatal: ambiguous argument 'aaaaaa': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
      0       0       0
fatal: ambiguous argument 'aaaaaa': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
ok 28 - Filtering retains message of gpg signed commit

expecting success: 
	git tag -m tag-with-slash X/1 &&
	git cat-file tag X/1 | sed -e s,X/1,X/2, > expect &&
	git filter-branch -f --tag-name-filter "echo X/2" &&
	git cat-file tag X/2 > actual &&
	test_cmp expect actual

fatal: ambiguous argument 'aaaaaa': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
fatal: ambiguous argument 'aaaaaa': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
not ok 45 - git -p true - core.pager overrides PAGER from subdirectory # TODO known breakage

expecting success: 
		rm -f GIT_PAGER_used &&
		test_config core.pager wc &&
		GIT_PAGER='wc >GIT_PAGER_used' &&
		export GIT_PAGER &&
		test_terminal  git -p true &&
		test -e GIT_PAGER_used
	
ok 4 - giving a non existing revision should fail

expecting success: 
	touch .git/MERGE_HEAD &&
	echo "100644 44c5b5884550c17758737edcced463447b91d42b 1	un" |
		git update-index --index-info &&
	test_must_fail git reset --soft HEAD &&
	rm .git/MERGE_HEAD &&
	git rm --cached -- un

fatal: Cannot do a soft reset in the middle of a merge.
un: needs merge
rm 'un'
ok 5 - reset --soft with unmerged index should fail

expecting success: 
	test_must_fail git reset --soft -- first &&
	test_must_fail git reset --hard -- first &&
	test_must_fail git reset --soft HEAD^ -- first &&
	test_must_fail git reset --hard HEAD^ -- first &&
	check_changes $head5

fatal: Cannot do soft reset with paths.
fatal: Cannot do hard reset with paths.
fatal: Cannot do soft reset with paths.
fatal: Cannot do hard reset with paths.
ok 6 - giving paths with options different than --mixed should fail

expecting success: 
	test_must_fail git reset --other &&
	test_must_fail git reset -o &&
	test_must_fail git reset --mixed --other &&
	test_must_fail git reset --mixed -o &&
	test_must_fail git reset --soft --other &&
	test_must_fail git reset --soft -o &&
	test_must_fail git reset --hard --other &&
	test_must_fail git reset --hard -o &&
	check_changes $head5

error: unknown option `other'
usage: git reset [--mixed | --soft | --hard | --merge | --keep] [-q] [<commit>]
   or: git reset [-q] <tree-ish> [--] <paths>...
   or: git reset --patch [<tree-ish>] [--] [<paths>...]

    -q, --quiet           be quiet, only report errors
    --mixed               reset HEAD and index
    --soft                reset only HEAD
    --hard                reset HEAD, index and working tree
    --merge               reset HEAD, index and working tree
    --keep                reset HEAD but keep local changes
    -p, --patch           select hunks interactively
    -N, --intent-to-add   record only the fact that removed paths will be added later

error: unknown switch `o'
usage: git reset [--mixed | --soft | --hard | --merge | --keep] [-q] [<commit>]
   or: git reset [-q] <tree-ish> [--] <paths>...
   or: git reset --patch [<tree-ish>] [--] [<paths>...]

    -q, --quiet           be quiet, only report errors
    --mixed               reset HEAD and index
    --soft                reset only HEAD
    --hard                reset HEAD, index and working tree
    --merge               reset HEAD, index and working tree
    --keep                reset HEAD but keep local changes
    -p, --patch           select hunks interactively
    -N, --intent-to-add   record only the fact that removed paths will be added later

error: unknown option `other'
usage: git reset [--mixed | --soft | --hard | --merge | --keep] [-q] [<commit>]
   or: git reset [-q] <tree-ish> [--] <paths>...
   or: git reset --patch [<tree-ish>] [--] [<paths>...]

    -q, --quiet           be quiet, only report errors
    --mixed               reset HEAD and index
    --soft                reset only HEAD
    --hard                reset HEAD, index and working tree
    --merge               reset HEAD, index and working tree
    --keep                reset HEAD but keep local changes
    -p, --patch           select hunks interactively
    -N, --intent-to-add   record only the fact that removed paths will be added later

error: unknown switch `o'
usage: git reset [--mixed | --soft | --hard | --merge | --keep] [-q] [<commit>]
   or: git reset [-q] <tree-ish> [--] <paths>...
   or: git reset --patch [<tree-ish>] [--] [<paths>...]

    -q, --quiet           be quiet, only report errors
    --mixed               reset HEAD and index
    --soft                reset only HEAD
    --hard                reset HEAD, index and working tree
    --merge               reset HEAD, index and working tree
    --keep                reset HEAD but keep local changes
    -p, --patch           select hunks interactively
    -N, --intent-to-add   record only the fact that removed paths will be added later

error: unknown option `other'
usage: git reset [--mixed | --soft | --hard | --merge | --keep] [-q] [<commit>]
   or: git reset [-q] <tree-ish> [--] <paths>...
   or: git reset --patch [<tree-ish>] [--] [<paths>...]

    -q, --quiet           be quiet, only report errors
    --mixed               reset HEAD and index
    --soft                reset only HEAD
    --hard                reset HEAD, index and working tree
    --merge               reset HEAD, index and working tree
    --keep                reset HEAD but keep local changes
    -p, --patch           select hunks interactively
    -N, --intent-to-add   record only the fact that removed paths will be added later

error: unknown switch `o'
usage: git reset [--mixed | --soft | --hard | --merge | --keep] [-q] [<commit>]
   or: git reset [-q] <tree-ish> [--] <paths>...
   or: git reset --patch [<tree-ish>] [--] [<paths>...]

    -q, --quiet           be quiet, only report errors
    --mixed               reset HEAD and index
    --soft                reset only HEAD
    --hard                reset HEAD, index and working tree
    --merge               reset HEAD, index and working tree
    --keep                reset HEAD but keep local changes
    -p, --patch           select hunks interactively
    -N, --intent-to-add   record only the fact that removed paths will be added later

error: unknown option `other'
usage: git reset [--mixed | --soft | --hard | --merge | --keep] [-q] [<commit>]
   or: git reset [-q] <tree-ish> [--] <paths>...
   or: git reset --patch [<tree-ish>] [--] [<paths>...]

    -q, --quiet           be quiet, only report errors
    --mixed               reset HEAD and index
    --soft                reset only HEAD
    --hard                reset HEAD, index and working tree
    --merge               reset HEAD, index and working tree
    --keep                reset HEAD but keep local changes
    -p, --patch           select hunks interactively
    -N, --intent-to-add   record only the fact that removed paths will be added later

error: unknown switch `o'
usage: git reset [--mixed | --soft | --hard | --merge | --keep] [-q] [<commit>]
   or: git reset [-q] <tree-ish> [--] <paths>...
   or: git reset --patch [<tree-ish>] [--] [<paths>...]

    -q, --quiet           be quiet, only report errors
    --mixed               reset HEAD and index
    --soft                reset only HEAD
    --hard                reset HEAD, index and working tree
    --merge               reset HEAD, index and working tree
    --keep                reset HEAD but keep local changes
    -p, --patch           select hunks interactively
    -N, --intent-to-add   record only the fact that removed paths will be added later


Rewrite f78b0905e139f6556b004c5f87cfe750aa8e3286 (1/4)
Rewrite c9fbe965b33cbcb81865d123297fe4df816d7555 (2/4)
Rewrite fea59ed4667894c7bd682b11f147174ab39c40bd (3/4)ok 7 - giving unrecognized options should fail

expecting success: 
	git branch branch1 &&
	git branch branch2 &&

	git checkout branch1 &&
	echo "3rd line in branch1" >>secondfile &&
	git commit -a -m "change in branch1" &&

	git checkout branch2 &&
	echo "3rd line in branch2" >>secondfile &&
	git commit -a -m "change in branch2" &&

	test_must_fail git merge branch1 &&
	test_must_fail git reset --soft &&

	printf "1st line 2nd file\n2nd line 2nd file\n3rd line" >secondfile &&
	git commit -a -m "the change in branch2" &&

	git checkout master &&
	git branch -D branch1 branch2 &&
	check_changes $head5

.ok 46 - git -p true - GIT_PAGER overrides core.pager

expecting success: 
		sane_unset PAGER GIT_PAGER &&
		test_unconfig core.pager &&
		rm -f default_pager_used &&
		cat >$less <<-\EOF &&
		#!/bin/sh
		wc >default_pager_used
		EOF
		chmod +x $less &&
		(
			PATH=.:$PATH &&
			export PATH &&
			test_must_fail test_terminal  git -p request-pull
		) &&
		test -e default_pager_used
	
Switched to branch 'branch1'

Rewrite ecd85101fddd95209f80a2603d99c1decb1c32b3 (4/4)[branch1 6b78ea5] change in branch1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Switched to branch 'branch2'
[branch2 f8a209f] change in branch2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)

Merging:
f8a209f change in branch2
virtual branch1
found 1 common ancestor:
Auto-merging secondfile
CONFLICT (content): Merge conflict in secondfile
Automatic merge failed; fix conflicts and then commit the result.
WARNING: Ref 'refs/heads/master' is unchanged
fatal: Cannot do a soft reset in the middle of a merge.
S -> X/2 (fea59ed4667894c7bd682b11f147174ab39c40bd -> fea59ed4667894c7bd682b11f147174ab39c40bd)
[branch2 8e8e261] the change in branch2
 Author: A U Thor <author@example.com>
Switched to branch 'master'
Deleted branch branch1 (was 6b78ea5).
Deleted branch branch2 (was 8e8e261).
T -> X/2 (fea59ed4667894c7bd682b11f147174ab39c40bd -> fea59ed4667894c7bd682b11f147174ab39c40bd)
ok 8 - trying to do reset --soft with pending merge should fail

expecting success: 
	git branch branch3 &&
	git branch branch4 &&

	git checkout branch3 &&
	echo "3rd line in branch3" >>secondfile &&
	git commit -a -m "line in branch3" &&

	git checkout branch4 &&
	echo "3rd line in branch4" >>secondfile &&

	git checkout -m branch3 &&
	test_must_fail git reset --soft &&

	printf "1st line 2nd file\n2nd line 2nd file\n3rd line" >secondfile &&
	git commit -a -m "the line in branch3" &&

	git checkout master &&
	git branch -D branch3 branch4 &&
	check_changes $head5

X/1 -> X/2 (ecd85101fddd95209f80a2603d99c1decb1c32b3 -> ecd85101fddd95209f80a2603d99c1decb1c32b3)
Switched to branch 'branch3'
[branch3 0b5021a] line in branch3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Switched to branch 'branch4'
ok 29 - Tag name filtering allows slashes in tag names

expecting success: 
	git rev-list HEAD > expect &&
	test_commit to_remove &&
	git filter-branch -f --index-filter "git update-index --remove to_remove.t" --prune-empty HEAD &&
	git rev-list HEAD > actual &&
	test_cmp expect actual

Switched to branch 'branch3'
M	secondfile
fatal: Cannot do a soft reset in the middle of a merge.
[master e16d17f] to_remove
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 to_remove.t
[branch3 dbe96ed] the line in branch3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to branch 'master'
ok 47 - git -p request-pull - default pager is used by default

expecting success: 
		sane_unset GIT_PAGER &&
		test_unconfig core.pager &&
		rm -f PAGER_used &&
		PAGER='wc >PAGER_used' &&
		export PAGER &&
		test_must_fail test_terminal  git -p request-pull &&
		test -e PAGER_used
	
Deleted branch branch3 (was dbe96ed).
Deleted branch branch4 (was eed6733).
ok 9 - trying to do reset --soft with pending checkout merge should fail

expecting success: 
	git reset --hard &&
		check_changes $head5 &&
	git reset --hard HEAD &&
		check_changes $head5 &&
	git reset --soft &&
		check_changes $head5 &&
	git reset --soft HEAD &&
		check_changes $head5 &&
	git reset --mixed &&
		check_changes $head5 &&
	git reset --mixed HEAD &&
		check_changes $head5 &&
	git reset &&
		check_changes $head5 &&
	git reset HEAD &&
		check_changes $head5

HEAD is now at eed6733 modify 2nd file (geändert)
HEAD is now at eed6733 modify 2nd file (geändert)
.
Rewrite f78b0905e139f6556b004c5f87cfe750aa8e3286 (1/5)
Rewrite c9fbe965b33cbcb81865d123297fe4df816d7555 (2/5)
Rewrite fea59ed4667894c7bd682b11f147174ab39c40bd (3/5)
Rewrite ecd85101fddd95209f80a2603d99c1decb1c32b3 (4/5)ok 48 - git -p request-pull - PAGER overrides default pager

expecting success: 
		sane_unset GIT_PAGER &&
		rm -f core.pager_used &&
		PAGER=wc &&
		export PAGER &&
		test_config core.pager 'wc >core.pager_used' &&
		test_must_fail test_terminal  git -p request-pull &&
		test -e core.pager_used
	

Rewrite e16d17fb9d7359ed5baab86f0d872cc748f58ab8 (5/5)ok 10 - resetting to HEAD with no changes should succeed and do nothing

expecting success: 
	git reset --soft HEAD^ &&
	check_changes d1a4bc3abce4829628ae2dcb0d60ef3d1a78b1c4 &&
	test "$(git rev-parse ORIG_HEAD)" = \
			$head5


Ref 'refs/heads/master' was rewritten
ok 11 - --soft reset only should show changes in diff --cached

expecting success: 
	echo "3rd line 2nd file" >>secondfile &&
	git commit -a -C ORIG_HEAD &&
	head4=$(git rev-parse --verify HEAD) &&
	check_changes $head4 &&
	test "$(git rev-parse ORIG_HEAD)" = \
			$head5

[master b052eb8] modify 2nd file (geändert)
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 3 insertions(+), 1 deletion(-)
ok 30 - Prune empty commits

expecting success: 
	test_config merge.ff false &&
	git rev-list HEAD >expect &&
	test_commit to_remove_2 &&
	git reset --hard HEAD^ &&
	test_merge non-ff to_remove_2 &&
	git filter-branch -f --index-filter "git update-index --remove to_remove_2.t" --prune-empty HEAD &&
	git rev-list HEAD >actual &&
	test_cmp expect actual

ok 12 - changing files and redo the last commit should succeed

expecting success: 
	git reset --hard HEAD~2 &&
	check_changes ddaefe00f1da16864591c61fdc7adb5d7cd6b74e &&
	test "$(git rev-parse ORIG_HEAD)" = \
			$head4

HEAD is now at ddaefe0 modify 1st file
[master 9e7d2c7] to_remove_2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 to_remove_2.t
HEAD is now at ecd8510 Adding gpg
ok 13 - --hard reset should change the files and undo commits permanently

Merging:
ecd8510 Adding gpg
virtual to_remove_2
found 1 common ancestor:
ecd8510 Adding gpg
Merge made by the 'recursive' strategy.
expecting success: 
	git rm first &&
	git mv second secondfile &&

	echo "1st line 2nd file" >secondfile &&
	echo "2nd line 2nd file" >>secondfile &&
	git add secondfile &&
	check_changes ddaefe00f1da16864591c61fdc7adb5d7cd6b74e

.rm 'first'
 to_remove_2.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 to_remove_2.t
ok 14 - redoing changes adding them without commit them should succeed

ok 49 - git -p request-pull - repository-local core.pager setting overrides PAGER

expecting success: 
	git reset &&
	check_changes ddaefe00f1da16864591c61fdc7adb5d7cd6b74e &&
	test "$(git rev-parse ORIG_HEAD)" = \
			ddaefe00f1da16864591c61fdc7adb5d7cd6b74e

checking known breakage: 
		sane_unset GIT_PAGER &&
		rm -f core.pager_used &&
		rm -fr sub &&
		PAGER=wc &&
		stampname=$(pwd)/core.pager_used &&
		export PAGER stampname &&
		test_config core.pager 'wc >"$stampname"' &&
		mkdir sub &&
		(
			cd sub &&
			test_must_fail test_terminal  git -p request-pull
		) &&
		test -e core.pager_used
	
Unstaged changes after reset:
D	first
D	second
ok 15 - --mixed reset to HEAD should unadd the files

expecting success: 
	git add secondfile &&
	git reset --hard ddaefe00f1da16864591c61fdc7adb5d7cd6b74e &&

	git rm first &&
	git mv second secondfile &&
	git commit -a -m "remove 1st and rename 2nd" &&

	echo "1st line 2nd file" >secondfile &&
	echo "2nd line 2nd file" >>secondfile &&
	# "git commit -m" would break MinGW, as Windows refuse to pass
	# $test_encoding encoded parameter to git.
	commit_msg $test_encoding | git -c "i18n.commitEncoding=$test_encoding" commit -a -F - &&
	check_changes $head5

HEAD is now at ddaefe0 modify 1st file
rm 'first'

Rewrite f78b0905e139f6556b004c5f87cfe750aa8e3286 (1/6)[master d1a4bc3] remove 1st and rename 2nd
 Author: A U Thor <author@example.com>
 2 files changed, 2 deletions(-)
 delete mode 100644 first
 rename second => secondfile (100%)
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+), 1 deletion(-)

Rewrite c9fbe965b33cbcb81865d123297fe4df816d7555 (2/6)ok 16 - redoing the last two commits should succeed

expecting success: 
	git branch branch1 &&
	git branch branch2 &&

	git checkout branch1 &&
	echo "3rd line in branch1" >>secondfile &&
	git commit -a -m "change in branch1" &&

	git checkout branch2 &&
	echo "3rd line in branch2" >>secondfile &&
	git commit -a -m "change in branch2" &&
	head3=$(git rev-parse --verify HEAD) &&

	test_must_fail git pull . branch1 &&
	git reset --hard &&
	check_changes $head3

Switched to branch 'branch1'
[branch1 6b78ea5] change in branch1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Switched to branch 'branch2'

Rewrite fea59ed4667894c7bd682b11f147174ab39c40bd (3/6)[branch2 f8a209f] change in branch2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)

Rewrite ecd85101fddd95209f80a2603d99c1decb1c32b3 (4/6)      4      13     102
From .
 * branch            branch1    -> FETCH_HEAD
not ok 50 - git -p request-pull - core.pager overrides PAGER from subdirectory # TODO known breakage

expecting success: 
		rm -f GIT_PAGER_used &&
		test_config core.pager wc &&
		GIT_PAGER='wc >GIT_PAGER_used' &&
		export GIT_PAGER &&
		test_must_fail test_terminal  git -p request-pull &&
		test -e GIT_PAGER_used
	
Merging:
f8a209f change in branch2
virtual 6b78ea5a18fcfce43fc7d5b8980e339547a633be
found 1 common ancestor:
Auto-merging secondfile
CONFLICT (content): Merge conflict in secondfile
Automatic merge failed; fix conflicts and then commit the result.
HEAD is now at f8a209f change in branch2

Rewrite 9e7d2c740c07770d5699c15c36e97f20f3cd0adf (5/6)ok 17 - --hard reset to HEAD should clear a failed merge

expecting success: 
	git reset --hard HEAD^ &&
	check_changes $head5 &&

	git pull . branch1 &&
	git reset --hard ORIG_HEAD &&
	check_changes $head5 &&

	git checkout master &&
	git branch -D branch1 branch2 &&
	check_changes $head5

.HEAD is now at eed6733 modify 2nd file (geändert)
From .
 * branch            branch1    -> FETCH_HEAD

Rewrite f6ab15566de9304304b0b7356d0a7a57c4b52de3 (6/6)Updating eed6733..6b78ea5
Fast-forward

 secondfile | 1 +
 1 file changed, 1 insertion(+)
Ref 'refs/heads/master' was rewritten
HEAD is now at eed6733 modify 2nd file (geändert)
Switched to branch 'master'
ok 31 - prune empty collapsed merges

expecting success: 
	git checkout master &&
	git reset --hard A &&
	test_commit add-foo foo 1 &&
	git branch moved-foo &&
	test_commit add-bar bar a &&
	git branch invariant &&
	orig_invariant=$(git rev-parse invariant) &&
	git branch moved-bar &&
	test_commit change-foo foo 2 &&
	git filter-branch -f --remap-to-ancestor \
		moved-foo moved-bar A..master \
		-- -- foo &&
	test $(git rev-parse moved-foo) = $(git rev-parse moved-bar) &&
	test $(git rev-parse moved-foo) = $(git rev-parse master^) &&
	test $orig_invariant = $(git rev-parse invariant)

Deleted branch branch1 (was 6b78ea5).
Deleted branch branch2 (was eed6733).
Already on 'master'
HEAD is now at 0ddfaf1 A
ok 18 - --hard reset to ORIG_HEAD should clear a fast-forward merge

expecting success: 
	echo 1 > file1 &&
	echo 2 > file2 &&
	git add file1 file2 &&
	test_tick &&
	git commit -m files &&
	git rm file2 &&
	echo 3 > file3 &&
	echo 4 > file4 &&
	echo 5 > file1 &&
	git add file1 file3 file4 &&
	git reset HEAD -- file1 file2 file3 &&
	test_must_fail git diff --quiet &&
	git diff > output &&
	test_cmp output expect &&
	git diff --cached > output &&
	test_cmp output cached_expect

[master df80ade] add-foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
ok 51 - git -p request-pull - GIT_PAGER overrides core.pager

expecting success: 
		sane_unset PAGER GIT_PAGER &&
		test_unconfig core.pager &&
		rm -f default_pager_used &&
		cat >$less <<-\EOF &&
		#!/bin/sh
		wc >default_pager_used
		EOF
		chmod +x $less &&
		(
			PATH=.:$PATH &&
			export PATH &&
			test_must_fail test_terminal  git -p
		) &&
		test -e default_pager_used
	
[master 14b96fb] files
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 file1
 create mode 100644 file2
rm 'file2'
Unstaged changes after reset:
M	file1
D	file2
[master bff4a0c] add-bar
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bar
ok 19 - test --mixed <paths>

expecting success: 

	mkdir sub &&
	>sub/file1 &&
	>sub/file2 &&
	git update-index --add sub/file1 sub/file2 &&
	T=$(git write-tree) &&
	git reset HEAD sub/file2 &&
	test_must_fail git diff --quiet &&
	U=$(git write-tree) &&
	echo "$T" &&
	echo "$U" &&
	test_must_fail git diff-index --cached --exit-code "$T" &&
	test "$T" != "$U"


Unstaged changes after reset:
M	file1
D	file2
[master e2b171f] change-foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
9571d9b5fb34d9c1274612948c5356f0615744bc
88880074c0c9957f91fd21817fee120b773fc32c
:100644 000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0000000000000000000000000000000000000000 D	sub/file2
ok 20 - test resetting the index at give paths

expecting success: 
	git reset --hard &&
	git reset -- file1 &&
	git diff-files --exit-code &&
	git diff-index --cached --exit-code HEAD

HEAD is now at 14b96fb files
ok 21 - resetting an unmodified path is a no-op

expecting success: 
	echo 123 >> file2 &&
	git reset --mixed HEAD > output &&
	test_i18ncmp expect output

ok 22 - --mixed refreshes the index

expecting success: 
	git rm --cached file2 &&
	F1=$(git rev-parse HEAD:file1) &&
	F2=$(git rev-parse HEAD:file2) &&
	F3=$(git rev-parse HEAD:secondfile) &&
	{
		echo "100644 $F1 1	file2" &&
		echo "100644 $F2 2	file2" &&
		echo "100644 $F3 3	file2"
	} | git update-index --index-info &&
	git ls-files -u &&
	git reset HEAD file2 &&
	test_must_fail git diff --quiet &&
	git diff-index --exit-code --cached HEAD

 OK
rm 'file2'
prerequisite UNTRACKED_CACHE ok
expecting success: 
	git init worktree &&
	cd worktree &&
	mkdir done dtwo dthree &&
	touch one two three done/one dtwo/two dthree/three &&
	git add one two done/one &&
	: >.git/info/exclude &&
	git update-index --untracked-cache

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7063-status-untracked-cache/worktree/.git/
100644 d00491fd7e5bb6fa28c517a0bb32b8b506539d4d 1	file2
100644 0cfbf08886fca9a91cb753ec8734c84fcbe52c9f 2	file2
100644 44c5b5884550c17758737edcced463447b91d42b 3	file2
Testing .ok 52 - git -p - default pager is used by default

Unstaged changes after reset:
M	file2
expecting success: 
		sane_unset GIT_PAGER &&
		test_unconfig core.pager &&
		rm -f PAGER_used &&
		PAGER='wc >PAGER_used' &&
		export PAGER &&
		test_must_fail test_terminal  git -p &&
		test -e PAGER_used
	

Rewrite df80ade938fd0c9aadecc68a97033566a709fb11 (1/2)ok 23 - resetting specific path that is unmerged

expecting success: 

	git reset --hard &&
	>secondfile &&
	git add secondfile &&
	git reset secondfile &&
	test_must_fail git diff --quiet -- secondfile &&
	test -z "$(git diff --cached --name-only)" &&
	test -f secondfile &&
	test_must_be_empty secondfile


HEAD is now at 14b96fb files

Rewrite e2b171f43c3dbc1b9400777d5411f54baa64ee2c (2/2)Unstaged changes after reset:
M	secondfile
ok 24 - disambiguation (1)

expecting success: 

	git reset --hard &&
	>secondfile &&
	git add secondfile &&
	rm -f secondfile &&
	test_must_fail git reset secondfile &&
	test -n "$(git diff --cached --name-only -- secondfile)" &&
	test ! -f secondfile


HEAD is now at 14b96fb files
fatal: ambiguous argument 'secondfile': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
ok 25 - disambiguation (2)

expecting success: 

	git reset --hard &&
	>secondfile &&
	git add secondfile &&
	rm -f secondfile &&
	git reset HEAD secondfile &&
	test_must_fail git diff --quiet &&
	test -z "$(git diff --cached --name-only)" &&
	test ! -f secondfile



HEAD is now at 14b96fb files
WARNING: Ref 'refs/heads/moved-foo' is unchanged
Ref 'refs/heads/moved-bar' was rewritten
Unstaged changes after reset:
D	secondfile
ok 26 - disambiguation (3)

expecting success: 

	git reset --hard &&
	>secondfile &&
	git add secondfile &&
	rm -f secondfile &&
	git reset -- secondfile &&
	test_must_fail git diff --quiet &&
	test -z "$(git diff --cached --name-only)" &&
	test ! -f secondfile

Ref 'refs/heads/master' was rewritten
HEAD is now at 14b96fb files
Unstaged changes after reset:
D	secondfile
ok 27 - disambiguation (4)

expecting success: 
	# for simpler tests, drop last commit containing added files
	git reset --hard HEAD^ &&
	git reset HEAD^^{tree} -- . &&
	git diff --cached HEAD^ --exit-code &&
	git diff HEAD --exit-code

HEAD is now at eed6733 modify 2nd file (geändert)
ok 53 - git -p - PAGER overrides default pager

checking known breakage: 
		sane_unset GIT_PAGER &&
		rm -f core.pager_used &&
		PAGER=wc &&
		export PAGER &&
		test_config core.pager 'wc >core.pager_used' &&
		test_must_fail test_terminal  git -p &&
		! test -e core.pager_used
	
Unstaged changes after reset:
M	secondfile
ok 32 - --remap-to-ancestor with filename filters

expecting success: 
	git checkout master &&
	git reset --hard A &&
	test_commit add-foo2 foo 1 &&
	git branch moved-foo2 &&
	test_commit add-bar2 bar a &&
	git branch invariant2 &&
	orig_invariant=$(git rev-parse invariant2) &&
	git branch moved-bar2 &&
	test_commit change-foo2 foo 2 &&
	git filter-branch -f \
		moved-foo2 moved-bar2 A..master \
		-- -- foo &&
	test $(git rev-parse moved-foo2) = $(git rev-parse moved-bar2) &&
	test $(git rev-parse moved-foo2) = $(git rev-parse master^) &&
	test $orig_invariant = $(git rev-parse invariant2)

Already on 'master'
ok 28 - reset with paths accepts tree

expecting success: 
	echo new-file >new-file &&
	git add new-file &&
	git reset -N HEAD &&

	tree=$(git write-tree) &&
	git ls-tree $tree new-file >actual &&
	>expect &&
	test_cmp expect actual &&

	git diff --name-only >actual &&
	echo new-file >expect &&
	test_cmp expect actual

HEAD is now at 0ddfaf1 A
Unstaged changes after reset:
A	new-file
[master 01c313b] add-foo2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
ok 29 - reset -N keeps removed files as intent-to-add

expecting success: 
	git init mixed_worktree &&
	(
		cd mixed_worktree &&
		test_commit dummy
	) &&
	: >expect &&
	git --git-dir=mixed_worktree/.git --work-tree=mixed_worktree reset >actual &&
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7102-reset/mixed_worktree/.git/
[master da8ba3f] add-bar2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bar
[master (root-commit) b737dfa] dummy
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 dummy.t
ok 30 - reset --mixed sets up work tree

# passed all 30 test(s)
1..30
[master 85f8a93] change-foo2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
.*** t7103-reset-bare.sh ***
not ok 54 - git -p - repository-local core.pager setting is not used # TODO known breakage

expecting success: 
		sane_unset GIT_PAGER &&
		rm -f core.pager_used &&
		rm -fr sub &&
		PAGER=wc &&
		stampname=$(pwd)/core.pager_used &&
		export PAGER stampname &&
		test_config core.pager 'wc >"$stampname"' &&
		mkdir sub &&
		(
			cd sub &&
			test_must_fail test_terminal  git -p
		) &&
		! test -e core.pager_used
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7103-reset-bare/.git/
expecting success: 
	echo one >file &&
	git add file &&
	git commit -m one &&
	echo two >file &&
	git commit -a -m two

[master (root-commit) 2053e71] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
[master 2c6c293] two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - setup non-bare

expecting success: 
	(cd .git &&
	 test_must_fail git reset --hard)

fatal: This operation must be run in a work tree
ok 2 - "hard" reset requires a worktree

expecting success: 
	(cd .git &&
	 test_must_fail git reset --merge)

fatal: This operation must be run in a work tree

Rewrite 01c313b7305a352790e4023531e7c9ba058d186f (1/2)ok 3 - "merge" reset requires a worktree

expecting success: 
	(cd .git &&
	 test_must_fail git reset --keep)

fatal: This operation must be run in a work tree
ok 4 - "keep" reset requires a worktree

expecting success: 
	(cd .git && git reset)

ok 5 - "mixed" reset is ok

expecting success: 
	(cd .git && git reset --soft)

ok 6 - "soft" reset is ok

expecting success: 
	mkdir worktree &&
	GIT_WORK_TREE=$PWD/worktree GIT_DIR=$PWD/.git git reset --hard &&
	test_cmp file worktree/file


Rewrite 85f8a93c56254d9574f03b32137fa90bc653de73 (2/2)HEAD is now at 2c6c293 two
ok 7 - hard reset works with GIT_WORK_TREE

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

Cloning into bare repository 'bare.git'...
done.
ok 8 - setup bare

expecting success: 
	test_must_fail git reset --hard HEAD^

fatal: This operation must be run in a work tree
ok 9 - "hard" reset is not allowed in bare

expecting success: 
	test_must_fail git reset --merge HEAD^

fatal: This operation must be run in a work tree
ok 10 - "merge" reset is not allowed in bare

expecting success: 
	test_must_fail git reset --keep HEAD^


fatal: This operation must be run in a work tree
ok 11 - "keep" reset is not allowed in bare

expecting success: 
	test_must_fail git reset --mixed HEAD^

WARNING: Ref 'refs/heads/moved-foo2' is unchanged
     42     282    2050
fatal: mixed reset is not allowed in a bare repository
ok 12 - "mixed" reset is not allowed in bare

expecting success: 
	git reset --soft HEAD^ &&
	test "`git show --pretty=format:%s | head -n 1`" = "one"

Ref 'refs/heads/moved-bar2' was rewritten
ok 55 - git -p - core.pager is not used from subdirectory

expecting success: 
		rm -f GIT_PAGER_used &&
		test_config core.pager wc &&
		GIT_PAGER='wc >GIT_PAGER_used' &&
		export GIT_PAGER &&
		test_must_fail test_terminal  git -p &&
		test -e GIT_PAGER_used
	
ok 13 - "soft" reset is allowed in bare

# passed all 13 test(s)
1..13
Ref 'refs/heads/master' was rewritten
*** t7104-reset-hard.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7104-reset-hard/.git/
ok 33 - automatic remapping to ancestor with filename filters

expecting success: 
	rm -fr ?* .git &&
	git init &&
	test_commit file &&
	mkdir submod &&
	submodurl="$PWD/submod" &&
	( cd submod &&
	  git init &&
	  test_commit file-in-submod ) &&
	git submodule add "$submodurl" &&
	git commit -m "added submodule" &&
	test_commit add-file &&
	( cd submod && test_commit add-in-submodule ) &&
	git add submod &&
	git commit -m "changed submodule" &&
	git branch original HEAD

expecting success: 

	mkdir before later &&
	>before/1 &&
	>before/2 &&
	>hello &&
	>later/3 &&
	git add before hello later &&
	git commit -m world &&

	H=$(git rev-parse :hello) &&
	git rm --cached hello &&
	echo "100644 $H 2	hello" | git update-index --index-info &&

	rm -f hello &&
	mkdir -p hello &&
	>hello/world &&
	test "$(git ls-files -o)" = hello/world


[master (root-commit) 3df83e0] world
 Author: A U Thor <author@example.com>
 4 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 before/1
 create mode 100644 before/2
 create mode 100644 hello
 create mode 100644 later/3
.rm 'hello'
ok 1 - setup

expecting success: 

	git reset --hard &&
	git ls-files --error-unmatch before/1 before/2 hello later/3 &&
	test -f hello


HEAD is now at 3df83e0 world
before/1
before/2
hello
later/3
ok 2 - reset --hard should restore unmerged ones

expecting success: 

	T=$(git write-tree) &&
	rm -f .git/index &&
	git add before hello later &&
	U=$(git write-tree) &&
	test "$T" = "$U"


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7003-filter-branch/.git/
ok 3 - reset --hard did not corrupt index or cached-tree

# passed all 3 test(s)
1..3
[master (root-commit) d44bdfd] file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file.t
ok 56 - git -p - GIT_PAGER overrides core.pager

checking known breakage: 
		rm -f GIT_PAGER_used &&
		GIT_PAGER='wc >GIT_PAGER_used' &&
		export GIT_PAGER &&
		test_must_fail test_terminal  git -p nonsense &&
		! test -e GIT_PAGER_used
	
*** t7105-reset-patch.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7003-filter-branch/submod/.git/
[master (root-commit) 0a5be9d] file-in-submod
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file-in-submod.t
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7105-reset-patch/.git/
expecting success: 
	mkdir dir &&
	echo parent > dir/foo &&
	echo dummy > bar &&
	git add dir &&
	git commit -m initial &&
	test_tick &&
	test_commit second dir/foo head &&
	set_and_save_state bar bar_work bar_index &&
	save_head

[master (root-commit) 671ac31] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 dir/foo
[master ccae805] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Adding existing repo at 'submod' to the index
ok 1 - setup

expecting success: 
	set_and_save_state dir/foo work work &&
	(echo n; echo n) | git reset -p &&
	verify_saved_state dir/foo &&
	verify_saved_state bar

[master e98c89a] added submodule
 Author: A U Thor <author@example.com>
 2 files changed, 4 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 submod
[master 33eb3f1] add-file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 add-file.t
not ok 57 - no pager for 'git -p nonsense' # TODO known breakage

expecting success: 
		sane_unset PAGER GIT_PAGER &&
		test_unconfig core.pager &&
		rm -f default_pager_used &&
		cat >$less <<-\EOF &&
		#!/bin/sh
		wc >default_pager_used
		EOF
		chmod +x $less &&
		(
			PATH=.:$PATH &&
			export PATH &&
			test_terminal  git shortlog
		) &&
		test -e default_pager_used
	
[master b029786] add-in-submodule
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 add-in-submodule.t
[master 688fa8d] changed submodule
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 34 - setup submodule

expecting success: 
	git filter-branch --tree-filter "test -d submod && {
					 rm -rf submod &&
					 git rm -rf --quiet submod &&
					 mkdir submod &&
					 : > submod/file
					 } || :" HEAD &&
	test $orig_head != `git show-ref --hash --head HEAD`

.
Rewrite d44bdfd48e05bb10967c2a6ab24241846f017d0c (1/4)ok 58 - git shortlog - default pager is used by default

expecting success: 
		sane_unset GIT_PAGER &&
		test_unconfig core.pager &&
		rm -f PAGER_used &&
		PAGER='wc >PAGER_used' &&
		export PAGER &&
		test_terminal  git shortlog &&
		test -e PAGER_used
	

Rewrite e98c89aaa09ea17e7252f3899d1552c6a060a1cc (2/4)diff --git a/bar b/bar
new file mode 100644
index 0000000..7780244
--- /dev/null
+++ b/bar
@@ -0,0 +1 @@
+bar_index
Unstage this hunk [y,n,q,a,d,/,e,?]? 
diff --git a/dir/foo b/dir/foo
index 564b12f..b8f99f5 100644
--- a/dir/foo
+++ b/dir/foo
@@ -1 +1 @@
-head
+work
Unstage this hunk [y,n,q,a,d,/,e,?]? 
ok 2 - saying "n" does nothing

expecting success: 
	(echo n; echo y) | git reset -p >output &&
	verify_state dir/foo work head &&
	verify_saved_state bar &&
	test_i18ngrep "Unstage" output


Rewrite 33eb3f1754a4ab99a61d7b6cac46a4d45c7647dc (3/4)
Rewrite 688fa8de673a006bde985a8f26620a3a845cfb4e (4/4)ok 59 - git shortlog - PAGER overrides default pager

expecting success: 
		sane_unset GIT_PAGER &&
		rm -f core.pager_used &&
		PAGER=wc &&
		export PAGER &&
		test_config core.pager 'wc >core.pager_used' &&
		test_terminal  git shortlog &&
		test -e core.pager_used
	
.
Ref 'refs/heads/master' was rewritten
warning: unable to rmdir submod: Directory not empty
ok 35 - rewrite submodule with another content

expecting success: 
	git reset --hard original &&
	git filter-branch -f --tree-filter \
	    "if git ls-files --error-unmatch -- submod > /dev/null 2>&1
	     then git update-index --cacheinfo 160000 0123456789012345678901234567890123456789 submod
	     fi" HEAD &&
	test $orig_head != `git show-ref --hash --head HEAD`

HEAD is now at 688fa8d changed submodule
ok 60 - git shortlog - repository-local core.pager setting overrides PAGER

expecting success: 
		sane_unset GIT_PAGER &&
		rm -f core.pager_used &&
		rm -fr sub &&
		PAGER=wc &&
		stampname=$(pwd)/core.pager_used &&
		export PAGER stampname &&
		test_config core.pager 'wc >"$stampname"' &&
		mkdir sub &&
		(
			cd sub &&
			test_terminal  git shortlog
		) &&
		test -e core.pager_used
	
Unstage this hunk [y,n,q,a,d,/,e,?]? 
Unstage this hunk [y,n,q,a,d,/,e,?]? 
ok 3 - git reset -p

expecting success: 
	(echo n; echo y) | git reset -p HEAD^ >output &&
	verify_state dir/foo work parent &&
	verify_saved_state bar &&
	test_i18ngrep "Apply" output

.
Rewrite d44bdfd48e05bb10967c2a6ab24241846f017d0c (1/4)
Rewrite e98c89aaa09ea17e7252f3899d1552c6a060a1cc (2/4)
Rewrite 33eb3f1754a4ab99a61d7b6cac46a4d45c7647dc (3/4)ok 61 - git shortlog - core.pager overrides PAGER from subdirectory

expecting success: 
		rm -f GIT_PAGER_used &&
		test_config core.pager wc &&
		GIT_PAGER='wc >GIT_PAGER_used' &&
		export GIT_PAGER &&
		test_terminal  git shortlog &&
		test -e GIT_PAGER_used
	

Rewrite 688fa8de673a006bde985a8f26620a3a845cfb4e (4/4)
Apply deletion to index [y,n,q,a,d,/,?]? 
Apply this hunk to index [y,n,q,a,d,/,e,?]? 
Ref 'refs/heads/master' was rewritten
ok 4 - git reset -p HEAD^

expecting success: 
	set_state dir/foo work work &&
	(echo y; echo n) | git reset -p dir &&
	verify_state dir/foo work head &&
	verify_saved_state bar

ok 36 - replace submodule revision

expecting success: 
	git reset --hard original &&
	commit=$(printf "no newline" | git commit-tree HEAD^{tree}) &&
	git update-ref refs/heads/no-newline $commit &&
	git filter-branch -f refs/heads/no-newline &&
	echo $commit >expect &&
	git rev-parse refs/heads/no-newline >actual &&
	test_cmp expect actual

HEAD is now at 688fa8d changed submodule
ok 62 - git shortlog - GIT_PAGER overrides core.pager

expecting success: 
	git config pager.shortlog false

ok 63 - setup: configure shortlog not to paginate

expecting success: 
		rm -f GIT_PAGER_used &&
		GIT_PAGER='wc >GIT_PAGER_used' &&
		export GIT_PAGER &&
		test_terminal  git shortlog &&
		! test -e GIT_PAGER_used
	

Rewrite e09dd518e31aed50404c6b8e92df04a2e1a90aed (1/1)
WARNING: Ref 'refs/heads/no-newline' is unchanged
 OK
ok 1 - setup

expecting success: 
	test-dump-untracked-cache >../actual &&
	cat >../expect <<EOF &&
info/exclude 0000000000000000000000000000000000000000
core.excludesfile 0000000000000000000000000000000000000000
exclude_per_dir .gitignore
flags 00000006
EOF
	test_cmp ../expect ../actual

ok 2 - untracked cache is empty

ok 37 - filter commit message without trailing newline

expecting success: 
	test_when_finished "git reset --hard original" &&
	ambiguous=$(git rev-list -1 HEAD) &&
	git filter-branch --tree-filter "mv file.t $ambiguous" HEAD^.. &&
	git show HEAD:$ambiguous

expecting success: 
	avoid_racy &&
	: >../trace &&
	GIT_TRACE_UNTRACKED_STATS="$TRASH_DIRECTORY/trace" \
	git status --porcelain >../actual &&
	test_cmp ../status.expect ../actual &&
	cat >../trace.expect <<EOF &&
node creation: 3
gitignore invalidation: 1
directory invalidation: 0
opendir: 4
EOF
	test_cmp ../trace.expect ../trace

ok 64 - no pager for 'git shortlog'

expecting success: 
		sane_unset GIT_PAGER &&
		rm -f core.pager_used &&
		rm -fr sub &&
		PAGER=wc &&
		stampname=$(pwd)/core.pager_used &&
		export PAGER stampname &&
		test_config core.pager 'wc >"$stampname"' &&
		mkdir sub &&
		(
			cd sub &&
			test_terminal  git shortlog
		) &&
		! test -e core.pager_used
	
diff --git a/dir/foo b/dir/foo
index 564b12f..b8f99f5 100644
--- a/dir/foo
+++ b/dir/foo
@@ -1 +1 @@
-head
+work
Unstage this hunk [y,n,q,a,d,/,e,?]? 
ok 5 - git reset -p dir

expecting success: 
	set_state dir/foo work work &&
	(echo y; echo n) | (cd dir && git reset -p -- foo) &&
	verify_state dir/foo work head &&
	verify_saved_state bar


Rewrite 688fa8de673a006bde985a8f26620a3a845cfb4e (1/1)
Ref 'refs/heads/master' was rewritten
A U Thor (1):
      initial

ok 65 - git shortlog - core.pager is not used from subdirectory

expecting success: 
		sane_unset PAGER GIT_PAGER &&
		test_unconfig core.pager &&
		rm -f default_pager_used &&
		cat >$less <<-\EOF &&
		#!/bin/sh
		wc >default_pager_used
		EOF
		chmod +x $less &&
		(
			PATH=.:$PATH &&
			export PATH &&
			test_terminal  git -p shortlog
		) &&
		test -e default_pager_used
	
file
HEAD is now at 688fa8d changed submodule
ok 38 - tree-filter deals with object name vs pathname ambiguity

# passed all 38 test(s)
1..38
*** t7106-reset-unborn-branch.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7106-reset-unborn-branch/.git/
expecting success: 
	echo a >a &&
	echo b >b

ok 1 - setup

expecting success: 
	git add a b &&
	git reset &&

	>expect &&
	git ls-files >actual &&
	test_cmp expect actual

ok 2 - reset

expecting success: 
	rm .git/index &&
	git add a b &&
	test_must_fail git reset HEAD

diff --git a/dir/foo b/dir/foo
index 564b12f..b8f99f5 100644
--- a/dir/foo
+++ b/dir/foo
@@ -1 +1 @@
-head
+work
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Unstage this hunk [y,n,q,a,d,/,e,?]? ok 3 - reset HEAD

expecting success: 
	rm .git/index &&
	git add a b &&
	git reset a &&

	echo b >expect &&
	git ls-files >actual &&
	test_cmp expect actual


ok 3 - status first time (empty cache)

expecting success: 
	test-dump-untracked-cache >../actual &&
	test_cmp ../dump.expect ../actual

ok 4 - reset $file

expecting success: 
	rm .git/index &&
	git add a &&
	echo y >yes &&
	git reset -p <yes >output &&

	>expect &&
	git ls-files >actual &&
	test_cmp expect actual &&
	test_i18ngrep "Unstage" output

ok 4 - untracked cache after first status

expecting success: 
	avoid_racy &&
	: >../trace &&
	GIT_TRACE_UNTRACKED_STATS="$TRASH_DIRECTORY/trace" \
	git status --porcelain >../actual &&
	test_cmp ../status.expect ../actual &&
	cat >../trace.expect <<EOF &&
node creation: 0
gitignore invalidation: 0
directory invalidation: 0
opendir: 0
EOF
	test_cmp ../trace.expect ../trace

ok 6 - git reset -p -- foo (inside dir)

expecting success: 
	(echo y; echo n) | git reset -p HEAD^ -- dir &&
	verify_state dir/foo work parent &&
	verify_saved_state bar

ok 66 - git -p shortlog - default pager is used by default

expecting success: 
		sane_unset GIT_PAGER &&
		rm -f core.pager_used &&
		rm -fr sub &&
		PAGER=wc &&
		stampname=$(pwd)/core.pager_used &&
		export PAGER stampname &&
		test_config core.pager 'wc >"$stampname"' &&
		mkdir sub &&
		(
			cd sub &&
			test_terminal  git -p shortlog
		) &&
		test -e core.pager_used
	
diff --git b/dir/foo a/dir/foo
index 564b12f..9676f5b 100644
--- b/dir/foo
+++ a/dir/foo
@@ -1 +1 @@
-head
+parent
Apply this hunk to index [y,n,q,a,d,/,e,?]? ok 67 - git -p shortlog - core.pager overrides PAGER from subdirectory

expecting success: 
		sane_unset GIT_PAGER &&
		rm -f core.pager_used &&
		rm -fr sub &&
		PAGER=wc &&
		stampname=$(pwd)/core.pager_used &&
		export PAGER stampname &&
		test_config core.pager 'wc >"$stampname"' &&
		mkdir sub &&
		(
			cd sub &&
			test_must_fail test_terminal  git -p apply </dev/null
		) &&
		test -e core.pager_used
	

Unstage this hunk [y,n,q,a,d,/,e,?]? 
ok 5 - reset -p

expecting success: 
	rm .git/index &&
	git add a &&
	git reset --soft &&

	echo a >expect &&
	git ls-files >actual &&
	test_cmp expect actual

ok 7 - git reset -p HEAD^ -- dir

expecting success: 
	verify_saved_head

ok 6 - reset --soft is a no-op

expecting success: 
	rm .git/index &&
	git add a &&
	test_when_finished "echo a >a" &&
	git reset --hard &&

	>expect &&
	git ls-files >actual &&
	test_cmp expect actual &&
	test_path_is_missing a

ok 8 - none of this moved HEAD

# passed all 8 test(s)
1..8
*** t7110-reset-merge.sh ***
ok 7 - reset --hard

# passed all 7 test(s)
1..7
*** t7111-reset-table.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7110-reset-merge/.git/
ok 5 - status second time (fully populated cache)

expecting success: 
	test-dump-untracked-cache >../actual &&
	test_cmp ../dump.expect ../actual

expecting success: 
    for i in 1 2 3; do echo line $i; done >file1 &&
    cat file1 >file2 &&
    git add file1 file2 &&
    test_tick &&
    git commit -m "Initial commit" &&
    git tag initial &&
    echo line 4 >>file1 &&
    cat file1 >file2 &&
    test_tick &&
    git commit -m "add line 4 to file1" file1 &&
    git tag second

ok 6 - untracked cache after second status

expecting success: 
	avoid_racy &&
	: >four &&
	: >../trace &&
	GIT_TRACE_UNTRACKED_STATS="$TRASH_DIRECTORY/trace" \
	git status --porcelain >../actual &&
	cat >../status.expect <<EOF &&
A  done/one
A  one
A  two
?? dthree/
?? dtwo/
?? four
?? three
EOF
	test_cmp ../status.expect ../actual &&
	cat >../trace.expect <<EOF &&
node creation: 0
gitignore invalidation: 0
directory invalidation: 1
opendir: 1
EOF
	test_cmp ../trace.expect ../trace


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7111-reset-table/.git/
expecting success: 
    test_commit E file1 &&
    test_commit D file1 &&
    test_commit C file1

[master (root-commit) 294b13e] Initial commit
 Author: A U Thor <author@example.com>
 2 files changed, 6 insertions(+)
 create mode 100644 file1
 create mode 100644 file2
[master (root-commit) 8464dc0] E
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file1
[master 91b6f65] add line 4 to file1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 1 - setup

expecting success: 
    git reset --merge HEAD^ &&
    ! grep 4 file1 &&
    grep 4 file2 &&
    test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" &&
    test -z "$(git diff --cached)"

[master 2131783] D
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
line 4
ok 2 - reset --merge is ok with changes in file it does not touch

expecting success: 
    git reset --merge second &&
    grep 4 file1 &&
    grep 4 file2 &&
    test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
    test -z "$(git diff --cached)"

[master 4bb0b07] C
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
line 4
line 4
ok 1 - creating initial commits

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
ok 68 - git -p apply </dev/null - core.pager overrides PAGER from subdirectory

expecting success: 
	sane_unset PAGER GIT_PAGER &&
	echo "foo:initial" >expect &&
	>actual &&
	test_unconfig core.pager &&
	test_config pager.log "sed s/^/foo:/ >actual" &&
	test_terminal git log --format=%s -1 &&
	test_cmp expect actual

HEAD is now at 4bb0b07 C
ok 3 - reset --merge is ok when switching back

expecting success: 
    git reset --hard second &&
    cat file1 >file2 &&
    git reset --keep HEAD^ &&
    ! grep 4 file1 &&
    grep 4 file2 &&
    test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" &&
    test -z "$(git diff --cached)"

HEAD is now at 91b6f65 add line 4 to file1
line 4
ok 2 - check: A B C D --soft A B D

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
HEAD is now at 4bb0b07 C
ok 4 - reset --keep is ok with changes in file it does not touch

expecting success: 
    git reset --keep second &&
    grep 4 file1 &&
    grep 4 file2 &&
    test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
    test -z "$(git diff --cached)"

line 4
Unstaged changes after reset:
M	file1
line 4
ok 5 - reset --keep is ok when switching back

expecting success: 
    git reset --hard second &&
    cat file1 >file2 &&
    echo "line 5" >> file1 &&
    git add file1 &&
    git reset --merge HEAD^ &&
    ! grep 4 file1 &&
    ! grep 5 file1 &&
    grep 4 file2 &&
    test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" &&
    test -z "$(git diff --cached)"

ok 3 - check: A B C D --mixed A D D

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
HEAD is now at 91b6f65 add line 4 to file1
HEAD is now at 4bb0b07 C
HEAD is now at 2131783 D
line 4
ok 4 - check: A B C D --hard D D D

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
ok 6 - reset --merge discards changes added to index (1)

expecting success: 
    git reset --hard initial &&
    echo "line 5" >> file2 &&
    git add file2 &&
    git reset --merge second &&
    ! grep 4 file2 &&
    ! grep 5 file1 &&
    grep 4 file1 &&
    test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
    test -z "$(git diff --cached)"

HEAD is now at 4bb0b07 C
HEAD is now at 294b13e Initial commit
error: Entry 'file1' not uptodate. Cannot merge.
fatal: Could not reset index file to revision 'D'.
ok 5 - check: A B C D --merge XXXXX  

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
HEAD is now at 4bb0b07 C
line 4
error: Entry 'file1' would be overwritten by merge. Cannot merge.
fatal: Could not reset index file to revision 'D'.
ok 6 - check: A B C D --keep XXXXX  

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
ok 69 - command-specific pager

expecting success: 
	sane_unset PAGER GIT_PAGER &&
	echo "foo:initial" >expect &&
	>actual &&
	test_config core.pager "exit 1" &&
	test_config pager.log "sed s/^/foo:/ >actual" &&
	test_terminal git log --format=%s -1 &&
	test_cmp expect actual

ok 7 - reset --merge is ok again when switching back (1)

expecting success: 
    git reset --hard second &&
    echo "line 5" >> file1 &&
    git add file1 &&
    test_must_fail git reset --keep HEAD^

HEAD is now at 4bb0b07 C
HEAD is now at 91b6f65 add line 4 to file1
error: Entry 'file1' would be overwritten by merge. Cannot merge.
fatal: Could not reset index file to revision 'HEAD^'.
ok 8 - reset --keep fails with changes in index in files it touches

expecting success: 
    git reset --hard second &&
    echo "line 4" >> file2 &&
    git add file2 &&
    git reset --merge HEAD^ &&
    ! grep 4 file2 &&
    test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" &&
    test -z "$(git diff)" &&
    test -z "$(git diff --cached)"

HEAD is now at 91b6f65 add line 4 to file1
ok 7 - modify in root directory, one dir invalidation

expecting success: 
	test-dump-untracked-cache >../actual &&
	cat >../expect <<EOF &&
info/exclude e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
core.excludesfile 0000000000000000000000000000000000000000
exclude_per_dir .gitignore
flags 00000006
/ 0000000000000000000000000000000000000000 recurse valid
dthree/
dtwo/
four
three
/done/ 0000000000000000000000000000000000000000 recurse valid
/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid
three
/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid
two
EOF
	test_cmp ../expect ../actual

ok 7 - check: A B C C --soft A B C

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
ok 8 - verify untracked cache dump

expecting success: 
	avoid_racy &&
	echo four >.gitignore &&
	: >../trace &&
	GIT_TRACE_UNTRACKED_STATS="$TRASH_DIRECTORY/trace" \
	git status --porcelain >../actual &&
	cat >../status.expect <<EOF &&
A  done/one
A  one
A  two
?? .gitignore
?? dthree/
?? dtwo/
?? three
EOF
	test_cmp ../status.expect ../actual &&
	cat >../trace.expect <<EOF &&
node creation: 0
gitignore invalidation: 1
directory invalidation: 1
opendir: 4
EOF
	test_cmp ../trace.expect ../trace


HEAD is now at 4bb0b07 C
Unstaged changes after reset:
M	file1
ok 9 - reset --merge discards changes added to index (2)

expecting success: 
    git reset --hard initial &&
    git reset --merge second &&
    ! grep 4 file2 &&
    grep 4 file1 &&
    test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
    test -z "$(git diff --cached)"

ok 8 - check: A B C C --mixed A C C

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
HEAD is now at 294b13e Initial commit
HEAD is now at 4bb0b07 C
line 4
HEAD is now at 4bb0b07 C
ok 10 - reset --merge is ok again when switching back (2)

expecting success: 
    git reset --hard second &&
    echo "line 4" >> file2 &&
    git add file2 &&
    git reset --keep HEAD^ &&
    grep 4 file2 &&
    test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" &&
    test -z "$(git diff --cached)"

ok 9 - check: A B C C --hard C C C

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
HEAD is now at 91b6f65 add line 4 to file1
HEAD is now at 4bb0b07 C
line 4
error: Entry 'file1' not uptodate. Cannot merge.
fatal: Could not reset index file to revision 'C'.
ok 10 - check: A B C C --merge XXXXX  

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
HEAD is now at 4bb0b07 C
ok 11 - reset --keep keeps changes it does not touch

expecting success: 
    git reset --keep second &&
    grep 4 file2 &&
    grep 4 file1 &&
    test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
    test -z "$(git diff --cached)"

line 4
ok 70 - command-specific pager overrides core.pager

line 4
expecting success: 
	GIT_PAGER="sed s/^/foo:/ >actual" && export GIT_PAGER &&
	>actual &&
	echo "foo:initial" >expect &&
	test_config pager.log "exit 1" &&
	test_terminal git log --format=%s -1 &&
	test_cmp expect actual

ok 11 - check: A B C C --keep A C C

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
ok 12 - reset --keep keeps changes when switching back

expecting success: 
    git reset --hard second &&
    echo "line 5" >> file1 &&
    test_tick &&
    git commit -m "add line 5" file1 &&
    sed -e "s/line 1/changed line 1/" <file1 >file3 &&
    mv file3 file1 &&
    test_must_fail git reset --merge HEAD^ 2>err.log &&
    grep file1 err.log | grep "not uptodate"

HEAD is now at 4bb0b07 C
HEAD is now at 91b6f65 add line 4 to file1
[master 7799e7c] add line 5
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
error: Entry 'file1' not uptodate. Cannot merge.
ok 13 - reset --merge fails with changes in file it touches

expecting success: 
    git reset --hard second &&
    echo "line 5" >> file1 &&
    test_tick &&
    git commit -m "add line 5" file1 &&
    sed -e "s/line 1/changed line 1/" <file1 >file3 &&
    mv file3 file1 &&
    test_must_fail git reset --keep HEAD^ 2>err.log &&
    grep file1 err.log | grep "not uptodate"

ok 12 - check: B B C D --soft B B D

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
HEAD is now at 91b6f65 add line 4 to file1
HEAD is now at 4bb0b07 C
[master f1894d3] add line 5
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Unstaged changes after reset:
M	file1
error: Entry 'file1' not uptodate. Cannot merge.
ok 14 - reset --keep fails with changes in file it touches

expecting success: 
    git reset --hard second &&
    git branch branch1 &&
    git branch branch2 &&
    git branch branch3 &&
    git checkout branch1 &&
    echo "line 5 in branch1" >> file1 &&
    test_tick &&
    git commit -a -m "change in branch1" &&
    git checkout branch2 &&
    echo "line 5 in branch2" >> file1 &&
    test_tick &&
    git commit -a -m "change in branch2" &&
    git tag third &&
    git checkout branch3 &&
    echo a new file >file3 &&
    rm -f file1 &&
    git add file3 &&
    test_tick &&
    git commit -a -m "change in branch3"

HEAD is now at 91b6f65 add line 4 to file1
ok 13 - check: B B C D --mixed B D D

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
HEAD is now at 4bb0b07 C
HEAD is now at 2131783 D
Switched to branch 'branch1'
ok 14 - check: B B C D --hard D D D

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
[branch1 4afd189] change in branch1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
HEAD is now at 4bb0b07 C
Switched to branch 'branch2'
ok 71 - command-specific pager overridden by environment

expecting success: 
	cat >git-external <<-\EOF &&
	#!/bin/sh
	git "$@"
	EOF
	chmod +x git-external

[branch2 077fd6d] change in branch2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 72 - setup external command

expecting success: 
	sane_unset PAGER GIT_PAGER &&
	echo "foo:initial" >expect &&
	>actual &&
	test_config pager.external "sed s/^/foo:/ >actual" &&
	test_terminal git --exec-path="`pwd`" external log --format=%s -1 &&
	test_cmp expect actual

ok 9 - new .gitignore invalidates recursively

expecting success: 
	test-dump-untracked-cache >../actual &&
	cat >../expect <<EOF &&
info/exclude e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
core.excludesfile 0000000000000000000000000000000000000000
exclude_per_dir .gitignore
flags 00000006
/ e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse valid
.gitignore
dthree/
dtwo/
three
/done/ 0000000000000000000000000000000000000000 recurse valid
/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid
three
/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid
two
EOF
	test_cmp ../expect ../actual

Switched to branch 'branch3'
ok 15 - check: B B C D --merge D D D

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
ok 10 - verify untracked cache dump

expecting success: 
	avoid_racy &&
	echo three >>.git/info/exclude &&
	: >../trace &&
	GIT_TRACE_UNTRACKED_STATS="$TRASH_DIRECTORY/trace" \
	git status --porcelain >../actual &&
	cat >../status.expect <<EOF &&
A  done/one
A  one
A  two
?? .gitignore
?? dtwo/
EOF
	test_cmp ../status.expect ../actual &&
	cat >../trace.expect <<EOF &&
node creation: 0
gitignore invalidation: 1
directory invalidation: 0
opendir: 4
EOF
	test_cmp ../trace.expect ../trace

HEAD is now at 4bb0b07 C
[branch3 05419f2] change in branch3
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 4 deletions(-)
 delete mode 100644 file1
 create mode 100644 file3
ok 15 - setup 3 different branches

expecting success: 
    git checkout third &&
    test_must_fail git merge branch1 &&
    git reset --merge HEAD^ &&
    test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
    test -z "$(git diff --cached)" &&
    test -z "$(git diff)"

error: Entry 'file1' would be overwritten by merge. Cannot merge.
fatal: Could not reset index file to revision 'D'.
Note: checking out 'third'.

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 077fd6d... change in branch2
ok 16 - check: B B C D --keep XXXXX  

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
HEAD is now at 4bb0b07 C
Merging:
077fd6d change in branch2
virtual branch1
found 1 common ancestor:
91b6f65 add line 4 to file1
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Automatic merge failed; fix conflicts and then commit the result.
ok 17 - check: B B C C --soft B B C

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
ok 16 - "reset --merge HEAD^" is ok with pending merge

expecting success: 
    git reset --hard third &&
    test_must_fail git merge branch1 &&
    test_must_fail git reset --keep HEAD^ 2>err.log &&
    test_i18ngrep "middle of a merge" err.log

HEAD is now at 4bb0b07 C
HEAD is now at 077fd6d change in branch2
Merging:
077fd6d change in branch2
virtual branch1
found 1 common ancestor:
91b6f65 add line 4 to file1
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Automatic merge failed; fix conflicts and then commit the result.
Unstaged changes after reset:
M	file1
fatal: Cannot do a keep reset in the middle of a merge.
ok 17 - "reset --keep HEAD^" fails with pending merge

expecting success: 
    git reset --hard third &&
    test_must_fail git merge branch1 &&
    git reset --merge HEAD &&
    test "$(git rev-parse HEAD)" = "$(git rev-parse third)" &&
    test -z "$(git diff --cached)" &&
    test -z "$(git diff)"

HEAD is now at 077fd6d change in branch2
ok 18 - check: B B C C --mixed B C C

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
Merging:
077fd6d change in branch2
virtual branch1
found 1 common ancestor:
91b6f65 add line 4 to file1
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Automatic merge failed; fix conflicts and then commit the result.
HEAD is now at 4bb0b07 C
HEAD is now at 4bb0b07 C
ok 18 - "reset --merge HEAD" is ok with pending merge

expecting success: 
    git reset --hard third &&
    test_must_fail git merge branch1 &&
    test_must_fail git reset --keep HEAD 2>err.log &&
    test_i18ngrep "middle of a merge" err.log

HEAD is now at 077fd6d change in branch2
ok 73 - command-specific pager works for external commands

ok 19 - check: B B C C --hard C C C

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
expecting success: 
	sane_unset PAGER GIT_PAGER &&
	echo "foo:initial" >expect &&
	>actual &&
	test_config pager.log "sed s/^/foo:/ >actual" &&
	test_terminal git --exec-path=. external log --format=%s -1 &&
	test_cmp expect actual

Merging:
077fd6d change in branch2
virtual branch1
found 1 common ancestor:
91b6f65 add line 4 to file1
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Automatic merge failed; fix conflicts and then commit the result.
HEAD is now at 4bb0b07 C
fatal: Cannot do a keep reset in the middle of a merge.
ok 19 - "reset --keep HEAD" fails with pending merge

expecting success: 
    git reset --hard third &&
    rm -f file2 &&
    test_must_fail git merge branch3 &&
    ! test -f file2 &&
    test -f file3 &&
    git diff --exit-code file3 &&
    git diff --exit-code branch3 file3 &&
    git reset --merge HEAD &&
    ! test -f file3 &&
    ! test -f file2 &&
    git diff --exit-code --cached

HEAD is now at 077fd6d change in branch2
ok 20 - check: B B C C --merge C C C

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
Merging:
077fd6d change in branch2
virtual branch3
found 1 common ancestor:
91b6f65 add line 4 to file1
CONFLICT (modify/delete): file1 deleted in branch3 and modified in HEAD. Version HEAD of file1 left in tree.
Automatic merge failed; fix conflicts and then commit the result.
HEAD is now at 4bb0b07 C
ok 20 - --merge is ok with added/deleted merge

expecting success: 
    git reset --hard third &&
    rm -f file2 &&
    test_must_fail git merge branch3 &&
    ! test -f file2 &&
    test -f file3 &&
    git diff --exit-code file3 &&
    git diff --exit-code branch3 file3 &&
    test_must_fail git reset --keep HEAD 2>err.log &&
    test_i18ngrep "middle of a merge" err.log

HEAD is now at 077fd6d change in branch2
ok 21 - check: B B C C --keep B C C

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
Merging:
077fd6d change in branch2
virtual branch3
found 1 common ancestor:
91b6f65 add line 4 to file1
CONFLICT (modify/delete): file1 deleted in branch3 and modified in HEAD. Version HEAD of file1 left in tree.
Automatic merge failed; fix conflicts and then commit the result.
HEAD is now at 4bb0b07 C
fatal: Cannot do a keep reset in the middle of a merge.
ok 21 - --keep fails with added/deleted merge

# passed all 21 test(s)
1..21
ok 22 - check: B C C D --soft B C D

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
HEAD is now at 4bb0b07 C
Unstaged changes after reset:
M	file1
*** t7112-reset-submodule.sh ***
ok 23 - check: B C C D --mixed B D D

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
ok 11 - new info/exclude invalidates everything

expecting success: 
	test-dump-untracked-cache >../actual &&
	cat >../expect <<EOF &&
info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0
core.excludesfile 0000000000000000000000000000000000000000
exclude_per_dir .gitignore
flags 00000006
/ e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse valid
.gitignore
dtwo/
/done/ 0000000000000000000000000000000000000000 recurse valid
/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid
/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid
two
EOF
	test_cmp ../expect ../actual

HEAD is now at 4bb0b07 C
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/.git/
ok 12 - verify untracked cache dump

expecting success: 
	git rm --cached two &&
	test-dump-untracked-cache >../actual &&
	cat >../expect <<EOF &&
info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0
core.excludesfile 0000000000000000000000000000000000000000
exclude_per_dir .gitignore
flags 00000006
/ e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse
/done/ 0000000000000000000000000000000000000000 recurse valid
/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid
/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid
two
EOF
	test_cmp ../expect ../actual

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
		)
	
HEAD is now at 2131783 D
rm 'two'
ok 74 - sub-commands of externals use their own pager

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.git/
expecting success: 
	sane_unset PAGER GIT_PAGER &&
	>expect &&
	>actual &&
	test_config pager.external false &&
	test_config pager.log "sed s/^/log:/ >actual" &&
	test_terminal git --exec-path=. external log --format=%s -1 &&
	test_cmp expect actual

ok 13 - move two from tracked to untracked

expecting success: 
	: >../trace &&
	GIT_TRACE_UNTRACKED_STATS="$TRASH_DIRECTORY/trace" \
	git status --porcelain >../actual &&
	cat >../status.expect <<EOF &&
A  done/one
A  one
?? .gitignore
?? dtwo/
?? two
EOF
	test_cmp ../status.expect ../actual &&
	cat >../trace.expect <<EOF &&
node creation: 0
gitignore invalidation: 0
directory invalidation: 0
opendir: 1
EOF
	test_cmp ../trace.expect ../trace

ok 24 - check: B C C D --hard D D D

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
HEAD is now at 4bb0b07 C
[master (root-commit) 621ccb8] 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
ok 14 - status after the move

expecting success: 
	test-dump-untracked-cache >../actual &&
	cat >../expect <<EOF &&
info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0
core.excludesfile 0000000000000000000000000000000000000000
exclude_per_dir .gitignore
flags 00000006
/ e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse valid
.gitignore
dtwo/
two
/done/ 0000000000000000000000000000000000000000 recurse valid
/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid
/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid
two
EOF
	test_cmp ../expect ../actual

error: Entry 'file1' not uptodate. Cannot merge.
fatal: Could not reset index file to revision 'D'.
ok 25 - check: B C C D --merge XXXXX  

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
ok 15 - verify untracked cache dump

expecting success: 
	git add two &&
	test-dump-untracked-cache >../actual &&
	cat >../expect <<EOF &&
info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0
core.excludesfile 0000000000000000000000000000000000000000
exclude_per_dir .gitignore
flags 00000006
/ e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse
/done/ 0000000000000000000000000000000000000000 recurse valid
/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid
/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid
two
EOF
	test_cmp ../expect ../actual

HEAD is now at 4bb0b07 C
Switched to a new branch 'add_sub1'
error: Entry 'file1' not uptodate. Cannot merge.
fatal: Could not reset index file to revision 'D'.
ok 26 - check: B C C D --keep XXXXX  

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
ok 16 - move two from untracked to tracked

expecting success: 
	: >../trace &&
	GIT_TRACE_UNTRACKED_STATS="$TRASH_DIRECTORY/trace" \
	git status --porcelain >../actual &&
	cat >../status.expect <<EOF &&
A  done/one
A  one
A  two
?? .gitignore
?? dtwo/
EOF
	test_cmp ../status.expect ../actual &&
	cat >../trace.expect <<EOF &&
node creation: 0
gitignore invalidation: 0
directory invalidation: 0
opendir: 1
EOF
	test_cmp ../trace.expect ../trace

HEAD is now at 4bb0b07 C
ok 17 - status after the move

expecting success: 
	test-dump-untracked-cache >../actual &&
	cat >../expect <<EOF &&
info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0
core.excludesfile 0000000000000000000000000000000000000000
exclude_per_dir .gitignore
flags 00000006
/ e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse valid
.gitignore
dtwo/
/done/ 0000000000000000000000000000000000000000 recurse valid
/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid
/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid
two
EOF
	test_cmp ../expect ../actual

ok 18 - verify untracked cache dump

expecting success: 
	echo two >done/.gitignore &&
	echo three >>done/.gitignore &&
	echo two >done/two &&
	git add -f done/two done/.gitignore &&
	git commit -m "first commit"

ok 27 - check: B C C C --soft B C C

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
HEAD is now at 4bb0b07 C
[master (root-commit) 95fa817] first commit
 Author: A U Thor <author@example.com>
 5 files changed, 3 insertions(+)
 create mode 100644 done/.gitignore
 create mode 100644 done/one
 create mode 100644 done/two
 create mode 100644 one
 create mode 100644 two
Unstaged changes after reset:
M	file1
ok 19 - set up for sparse checkout testing

expecting success: 
	: >../trace &&
	GIT_TRACE_UNTRACKED_STATS="$TRASH_DIRECTORY/trace" \
	git status --porcelain >../actual &&
	cat >../status.expect <<EOF &&
?? .gitignore
?? dtwo/
EOF
	test_cmp ../status.expect ../actual &&
	cat >../trace.expect <<EOF &&
node creation: 0
gitignore invalidation: 0
directory invalidation: 0
opendir: 2
EOF
	test_cmp ../trace.expect ../trace

ok 20 - status after commit

expecting success: 
	test-dump-untracked-cache >../actual &&
	cat >../expect <<EOF &&
info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0
core.excludesfile 0000000000000000000000000000000000000000
exclude_per_dir .gitignore
flags 00000006
/ e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse valid
.gitignore
dtwo/
/done/ 0000000000000000000000000000000000000000 recurse valid
/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid
/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid
two
EOF
	test_cmp ../expect ../actual

ok 28 - check: B C C C --mixed B C C

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
ok 21 - untracked cache correct after commit

expecting success: 
	echo "done/[a-z]*" >.git/info/sparse-checkout &&
	test_config core.sparsecheckout true &&
	git checkout master &&
	git update-index --force-untracked-cache &&
	git status --porcelain >/dev/null && # prime the cache
	test_path_is_missing done/.gitignore &&
	test_path_is_file done/one

Cloning into 'sub1'...
HEAD is now at 4bb0b07 C
HEAD is now at 4bb0b07 C
Already on 'master'
done.
initial
ok 29 - check: B C C C --hard C C C

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
ok 22 - set up sparse checkout

expecting success: 
	echo two bis >done/two &&
	echo three >done/three && # three is gitignored
	echo four >done/four && # four is gitignored at a higher level
	echo five >done/five && # five is not gitignored
	echo test >base && #we need to ensure that the root dir is touched
	rm base

ok 23 - create/modify files, some of which are gitignored

expecting success: 
	: >../trace &&
	avoid_racy &&
	GIT_TRACE_UNTRACKED_STATS="$TRASH_DIRECTORY/trace" \
	git status --porcelain >../status.actual &&
	cat >../status.expect <<EOF &&
 M done/two
?? .gitignore
?? done/five
?? dtwo/
EOF
	test_cmp ../status.expect ../status.actual &&
	cat >../trace.expect <<EOF &&
node creation: 0
gitignore invalidation: 1
directory invalidation: 2
opendir: 2
EOF
	test_cmp ../trace.expect ../trace

HEAD is now at 4bb0b07 C
ok 75 - external command pagers override sub-commands

expecting success: 
	write_script git-under_score <<-\EOF &&
	echo ok
	EOF
	git --exec-path=. under_score >actual 2>&1 &&
	echo ok >expect &&
	test_cmp expect actual

ok 76 - command with underscores does not complain

ok 30 - check: B C C C --merge B C C

expecting success: 
	git reset --hard C &&
	if test "$I1" != "$H1"
	then
	    echo "$I1" >file1 &&
	    git add file1
	fi &&
	if test "$W1" != "$I1"
	then
	    echo "$W1" >file1
	fi &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    test "$(cat file1)" = "$W2" &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
# still have 6 known breakage(s)
# passed all remaining 70 test(s)
1..76
HEAD is now at 4bb0b07 C
*** t7201-co.sh ***
ok 31 - check: B C C C --keep B C C

expecting success: 
    git reset --hard C &&
    git branch branch1 &&
    git branch branch2 &&
    git checkout branch1 &&
    test_commit B1 file1 &&
    git checkout branch2 &&
    test_commit B file1

[add_sub1 5d11ca2] Add sub1
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
HEAD is now at 4bb0b07 C
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7201-co/.git/
Switched to a new branch 'remove_sub1'
expecting success: 

	fill x y z > same &&
	fill 1 2 3 4 5 6 7 8 >one &&
	fill a b c d e >two &&
	git add same one two &&
	git commit -m "Initial A one, A two" &&

	git checkout -b renamer &&
	rm -f one &&
	fill 1 3 4 5 6 7 8 >uno &&
	git add uno &&
	fill a b c d e f >two &&
	git commit -a -m "Renamer R one->uno, M two" &&

	git checkout -b side master &&
	fill 1 2 3 4 5 6 7 >one &&
	fill A B C D E >three &&
	rm -f two &&
	git update-index --add --remove one two three &&
	git commit -m "Side M one, D two, A three" &&

	git checkout -b simple master &&
	rm -f one &&
	fill a c e > two &&
	git commit -a -m "Simple D one, M two" &&

	git checkout master

Removing sub1
Removing .gitmodules
Switched to branch 'branch1'
[remove_sub1 8a72081] Revert "Add sub1"
 Author: A U Thor <author@example.com>
 2 files changed, 5 deletions(-)
 delete mode 100644 .gitmodules
 delete mode 160000 sub1
[master (root-commit) 7329388] Initial A one, A two
 Author: A U Thor <author@example.com>
 3 files changed, 16 insertions(+)
 create mode 100644 one
 create mode 100644 same
 create mode 100644 two
Switched to a new branch 'modify_sub1'
[branch1 5456cd2] B1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'renamer'
Switched to branch 'branch2'
[renamer 0420b41] Renamer R one->uno, M two
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename one => uno (87%)
[branch2 aa272d3] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'side'
ok 32 - setting up branches to test with unmerged entries

expecting success: 
	git reset --hard B &&
	test_must_fail git merge branch1 &&
	cat file1 >X_file1 &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    if test "$W2" = "X"
	    then
		test_cmp file1 X_file1
	    else
		test "$(cat file1)" = "$W2"
	    fi &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
HEAD is now at aa272d3 B
[side ab76817] Side M one, D two, A three
 Author: A U Thor <author@example.com>
 3 files changed, 5 insertions(+), 6 deletions(-)
 create mode 100644 three
 delete mode 100644 two
Merging:
aa272d3 B
virtual branch1
found 1 common ancestor:
4bb0b07 C
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Automatic merge failed; fix conflicts and then commit the result.
Switched to a new branch 'simple'
fatal: Cannot do a soft reset in the middle of a merge.
ok 33 - check: X U B C --soft XXXXX  

expecting success: 
	git reset --hard B &&
	test_must_fail git merge branch1 &&
	cat file1 >X_file1 &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    if test "$W2" = "X"
	    then
		test_cmp file1 X_file1
	    else
		test "$(cat file1)" = "$W2"
	    fi &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
HEAD is now at aa272d3 B
[simple 022ff9d] Simple D one, M two
 Author: A U Thor <author@example.com>
 2 files changed, 10 deletions(-)
 delete mode 100644 one
Merging:
aa272d3 B
virtual branch1
found 1 common ancestor:
4bb0b07 C
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Automatic merge failed; fix conflicts and then commit the result.
Switched to branch 'master'
ok 1 - setup

expecting success: 

	git checkout -b delete-me master &&
	rm .git/refs/heads/delete-me &&
	test refs/heads/delete-me = "$(git symbolic-ref HEAD)" &&
	git checkout master &&
	test refs/heads/master = "$(git symbolic-ref HEAD)"

Unstaged changes after reset:
M	file1
Switched to a new branch 'delete-me'
Switched to branch 'master'
ok 34 - check: X U B C --mixed X C C

expecting success: 
	git reset --hard B &&
	test_must_fail git merge branch1 &&
	cat file1 >X_file1 &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    if test "$W2" = "X"
	    then
		test_cmp file1 X_file1
	    else
		test "$(cat file1)" = "$W2"
	    fi &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
From /«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.
   621ccb8..5d11ca2  add_sub1   -> origin/add_sub1
 * [new branch]      modify_sub1 -> origin/modify_sub1
 * [new branch]      remove_sub1 -> origin/remove_sub1
ok 2 - checkout from non-existing branch

expecting success: 

	fill 0 1 2 3 4 5 6 7 8 >one &&
	if git checkout side
	then
		echo Not happy
		false
	else
		echo "happy - failed correctly"
	fi


HEAD is now at aa272d3 B
error: Your local changes to the following files would be overwritten by checkout:
	one
Please, commit your changes or stash them before you can switch branches.
Aborting
happy - failed correctly
ok 3 - checkout with dirty tree without -m

expecting success: 

	git checkout -f master &&
	fill 0 1 2 3 4 5 6 7 8 >same &&
	cp same kept &&
	git checkout side >messages &&
	test_cmp same kept &&
	printf "M\t%s\n" same >messages.expect &&
	test_cmp messages.expect messages

Switched to a new branch 'modifications'
Merging:
aa272d3 B
virtual branch1
found 1 common ancestor:
4bb0b07 C
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Automatic merge failed; fix conflicts and then commit the result.
Already on 'master'
HEAD is now at 4bb0b07 C
Switched to branch 'side'
[modifications 6bb2c77] modified file2 and added file3
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 file3
ok 4 - checkout with unrelated dirty tree without -m

expecting success: 

	git checkout -f master &&
	git clean -f &&

	fill 0 1 2 3 4 5 6 7 8 >one &&
	git checkout -m side > messages &&

	test "$(git symbolic-ref HEAD)" = "refs/heads/side" &&

	printf "M\t%s\n" one >expect.messages &&
	test_cmp expect.messages messages &&

	fill "M	one" "A	three" "D	two" >expect.master &&
	git diff --name-status master >current.master &&
	test_cmp expect.master current.master &&

	fill "M	one" >expect.side &&
	git diff --name-status side >current.side &&
	test_cmp expect.side current.side &&

	: >expect.index &&
	git diff --cached >current.index &&
	test_cmp expect.index current.index

Switched to branch 'master'
ok 35 - check: X U B C --hard C C C

expecting success: 
	git reset --hard B &&
	test_must_fail git merge branch1 &&
	cat file1 >X_file1 &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    if test "$W2" = "X"
	    then
		test_cmp file1 X_file1
	    else
		test "$(cat file1)" = "$W2"
	    fi &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
Removing kept
Removing messages
Removing messages.expect
HEAD is now at aa272d3 B
Switched to branch 'side'
Merging:
aa272d3 B
virtual branch1
found 1 common ancestor:
4bb0b07 C
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Automatic merge failed; fix conflicts and then commit the result.
ok 24 - test sparse status with untracked cache

expecting success: 
	test-dump-untracked-cache >../actual &&
	cat >../expect <<EOF &&
info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0
core.excludesfile 0000000000000000000000000000000000000000
exclude_per_dir .gitignore
flags 00000006
/ e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse valid
.gitignore
dtwo/
/done/ 1946f0437f90c5005533cbe1736a6451ca301714 recurse valid
five
/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid
/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid
two
EOF
	test_cmp ../expect ../actual

To /«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.
 * [new branch]      modifications -> modifications
ok 25 - untracked cache correct after status

expecting success: 
	avoid_racy &&
	: >../trace &&
	GIT_TRACE_UNTRACKED_STATS="$TRASH_DIRECTORY/trace" \
	git status --porcelain >../status.actual &&
	cat >../status.expect <<EOF &&
 M done/two
?? .gitignore
?? done/five
?? dtwo/
EOF
	test_cmp ../status.expect ../status.actual &&
	cat >../trace.expect <<EOF &&
node creation: 0
gitignore invalidation: 0
directory invalidation: 0
opendir: 0
EOF
	test_cmp ../trace.expect ../trace

ok 36 - check: X U B C --merge C C C

expecting success: 
	git reset --hard B &&
	test_must_fail git merge branch1 &&
	cat file1 >X_file1 &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    if test "$W2" = "X"
	    then
		test_cmp file1 X_file1
	    else
		test "$(cat file1)" = "$W2"
	    fi &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
[modify_sub1 8087219] Modify sub1
 Author: A U Thor <author@example.com>
ok 5 - checkout -m with dirty tree

expecting success: 

	git checkout -f master && git clean -f &&

	fill 1 2 3 4 5 7 8 >one &&
	if git checkout renamer
	then
		echo Not happy
		false
	else
		echo "happy - failed correctly"
	fi &&

	git checkout -m renamer &&
	fill 1 3 4 5 7 8 >expect &&
	test_cmp expect uno &&
	! test -f one &&
	git diff --cached >current &&
	! test -s current


Switched to a new branch 'replace_sub1_with_directory'
HEAD is now at aa272d3 B
Switched to branch 'master'
Removing current.index
Removing current.master
Removing current.side
Removing expect.index
Removing expect.master
Removing expect.messages
Removing expect.side
Removing messages
Merging:
aa272d3 B
virtual branch1
found 1 common ancestor:
4bb0b07 C
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Automatic merge failed; fix conflicts and then commit the result.
error: Your local changes to the following files would be overwritten by checkout:
	one
Please, commit your changes or stash them before you can switch branches.
Aborting
happy - failed correctly
fatal: Cannot do a keep reset in the middle of a merge.
ok 37 - check: X U B C --keep XXXXX  

expecting success: 
	git reset --hard B &&
	test_must_fail git merge branch1 &&
	cat file1 >X_file1 &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    if test "$W2" = "X"
	    then
		test_cmp file1 X_file1
	    else
		test "$(cat file1)" = "$W2"
	    fi &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
HEAD is now at aa272d3 B
Switched to branch 'renamer'
M	uno
ok 6 - checkout -m with dirty tree, renamed

expecting success: 

	git checkout -f master && git clean -f &&

	fill 1 T 3 4 5 6 S 8 >one &&
	if git checkout renamer
	then
		echo Not happy
		false
	else
		echo "happy - failed correctly"
	fi &&

	git checkout -m renamer &&

	git diff master:one :3:uno |
	sed -e "1,/^@@/d" -e "/^ /d" -e "s/^-/d/" -e "s/^+/a/" >current &&
	fill d2 aT d7 aS >expect &&
	test_cmp current expect &&
	git diff --cached two >current &&
	! test -s current

Merging:
aa272d3 B
virtual branch1
found 1 common ancestor:
4bb0b07 C
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Automatic merge failed; fix conflicts and then commit the result.
fatal: Cannot do a soft reset in the middle of a merge.
Switched to branch 'master'
ok 38 - check: X U B B --soft XXXXX  

expecting success: 
	git reset --hard B &&
	test_must_fail git merge branch1 &&
	cat file1 >X_file1 &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    if test "$W2" = "X"
	    then
		test_cmp file1 X_file1
	    else
		test "$(cat file1)" = "$W2"
	    fi &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
Removing current
Removing expect
HEAD is now at aa272d3 B
error: Your local changes to the following files would be overwritten by checkout:
	one
Please, commit your changes or stash them before you can switch branches.
Aborting
happy - failed correctly
Merging:
aa272d3 B
virtual branch1
found 1 common ancestor:
4bb0b07 C
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Automatic merge failed; fix conflicts and then commit the result.
Switched to branch 'renamer'
M	uno
Unstaged changes after reset:
M	file1
ok 7 - checkout -m with merge conflict

expecting success: 

	git checkout -f master && git clean -f &&

	fill b d > two &&
	git checkout -m simple &&

	git ls-files >current &&
	fill same two two two >expect &&
	test_cmp current expect &&

	cat <<-EOF >expect &&
	<<<<<<< simple
	a
	c
	e
	=======
	b
	d
	>>>>>>> local
	EOF
	test_cmp two expect

ok 39 - check: X U B B --mixed X B B

expecting success: 
	git reset --hard B &&
	test_must_fail git merge branch1 &&
	cat file1 >X_file1 &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    if test "$W2" = "X"
	    then
		test_cmp file1 X_file1
	    else
		test "$(cat file1)" = "$W2"
	    fi &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
Switched to branch 'master'
Removing current
Removing expect
HEAD is now at aa272d3 B
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
Switched to branch 'simple'
M	two
Previous HEAD position was 621ccb8... Base
Merging:
aa272d3 B
virtual branch1
found 1 common ancestor:
4bb0b07 C
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Automatic merge failed; fix conflicts and then commit the result.
Switched to branch 'modifications'
rm 'sub1'
ok 8 - format of merge conflict from checkout -m

expecting success: 

	git checkout -f master && git reset --hard && git clean -f &&

	fill b d > two &&
	git checkout --merge --conflict=diff3 simple &&

	cat <<-EOF >expect &&
	<<<<<<< simple
	a
	c
	e
	||||||| master
	a
	b
	c
	d
	e
	=======
	b
	d
	>>>>>>> local
	EOF
	test_cmp two expect

HEAD is now at aa272d3 B
Switched to branch 'master'
ok 40 - check: X U B B --hard B B B

expecting success: 
	git reset --hard B &&
	test_must_fail git merge branch1 &&
	cat file1 >X_file1 &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    if test "$W2" = "X"
	    then
		test_cmp file1 X_file1
	    else
		test "$(cat file1)" = "$W2"
	    fi &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
HEAD is now at 7329388 Initial A one, A two
[replace_sub1_with_directory 5626010] 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
Removing current
Removing expect
HEAD is now at aa272d3 B
Switched to a new branch 'replace_directory_with_sub1'
Switched to branch 'simple'
M	two
Merging:
aa272d3 B
virtual branch1
found 1 common ancestor:
4bb0b07 C
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Automatic merge failed; fix conflicts and then commit the result.
ok 9 - checkout --merge --conflict=diff3 <branch>

expecting success: 

	git checkout -f master && git reset --hard && git clean -f &&
	git rm two &&

	test_must_fail git checkout simple 2>errs &&
	test_i18ngrep overwritten errs &&

	git checkout --merge simple 2>errs &&
	test_i18ngrep ! overwritten errs &&
	git ls-files -u &&
	test_must_fail git cat-file -t :0:two &&
	test "$(git cat-file -t :1:two)" = blob &&
	test "$(git cat-file -t :2:two)" = blob &&
	test_must_fail git cat-file -t :3:two

Removing sub1/file3
Removing sub1/file2
Removing sub1/file1
Adding sub1
Switched to branch 'master'
[replace_directory_with_sub1 4ba2fe2] 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
HEAD is now at 7329388 Initial A one, A two
Switched to a new branch 'replace_sub1_with_file'
Removing expect
ok 41 - check: X U B B --merge B B B

expecting success: 
	git reset --hard B &&
	test_must_fail git merge branch1 &&
	cat file1 >X_file1 &&
	if test "$W2" != "XXXXX"
	then
	    git reset --$opt $T &&
	    if test "$W2" = "X"
	    then
		test_cmp file1 X_file1
	    else
		test "$(cat file1)" = "$W2"
	    fi &&
	    git checkout-index -f -- file1 &&
	    test "$(cat file1)" = "$I2" &&
	    git checkout -f HEAD -- file1 &&
	    test "$(cat file1)" = "$H2"
	else
	    test_must_fail git reset --$opt $T
	fi
    
rm 'sub1'
rm 'two'
HEAD is now at aa272d3 B
error: Your local changes to the following files would be overwritten by checkout:
Merging:
aa272d3 B
virtual branch1
found 1 common ancestor:
4bb0b07 C
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Automatic merge failed; fix conflicts and then commit the result.
[replace_sub1_with_file b6a744b] Replace sub1 with file
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
M	two
fatal: Cannot do a keep reset in the middle of a merge.
ok 42 - check: X U B B --keep XXXXX  

Switched to a new branch 'replace_file_with_sub1'
100644 940532533944dd159bfd11136fac2ee35872de38 1	two
100644 bf8d586a0d1628d4b5132c772c2fb2906385b149 2	two
# passed all 42 test(s)
1..42
fatal: Not a valid object name :0:two
[replace_file_with_sub1 0c4f774] Revert "Replace sub1 with file"
 Author: A U Thor <author@example.com>
 2 files changed, 5 insertions(+), 1 deletion(-)
 mode change 100644 => 160000 sub1
fatal: Not a valid object name :3:two
ok 10 - switch to another branch while carrying a deletion

*** t7300-clean.sh ***
expecting success: 

	git config advice.detachedHead false &&
	git checkout -f renamer && git clean -f &&
	git checkout renamer^ 2>messages &&
	test_i18ngrep "HEAD is now at 7329388" messages &&
	test_line_count = 1 messages &&
	H=$(git rev-parse --verify HEAD) &&
	M=$(git show-ref -s --verify refs/heads/master) &&
	test "z$H" = "z$M" &&
	if git symbolic-ref HEAD >/dev/null 2>&1
	then
		echo "OOPS, HEAD is still symbolic???"
		false
	else
		: happy
	fi

Switched to a new branch 'invalid_sub1'
Switched to branch 'renamer'
Removing errs
ok 26 - test sparse status again with untracked cache

expecting success: 
	mkdir done/sub &&
	mkdir done/sub/sub &&
	echo "sub" > done/sub/sub/file

[invalid_sub1 9cc98d3] Invalid sub1 commit
 Author: A U Thor <author@example.com>
ok 27 - set up for test of subdir and sparse checkouts

expecting success: 
	avoid_racy &&
	: >../trace &&
	GIT_TRACE_UNTRACKED_STATS="$TRASH_DIRECTORY/trace" \
	git status --porcelain >../status.actual &&
	cat >../status.expect <<EOF &&
 M done/two
?? .gitignore
?? done/five
?? done/sub/
?? dtwo/
EOF
	test_cmp ../status.expect ../status.actual &&
	cat >../trace.expect <<EOF &&
node creation: 2
gitignore invalidation: 0
directory invalidation: 1
opendir: 3
EOF
	test_cmp ../trace.expect ../trace

HEAD is now at 7329388... Initial A one, A two
Switched to a new branch 'valid_sub1'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7300-clean/.git/
expecting success: 

	mkdir -p src &&
	touch src/part1.c Makefile &&
	echo build >.gitignore &&
	echo \*.o >>.gitignore &&
	git add . &&
	git commit -m setup &&
	touch src/part2.c README &&
	git add .


ok 11 - checkout to detach HEAD (with advice declined)

expecting success: 
	git config advice.detachedHead true &&
	git checkout -f renamer && git clean -f &&
	git checkout renamer^ 2>messages &&
	test_i18ngrep "HEAD is now at 7329388" messages &&
	test_line_count -gt 1 messages &&
	H=$(git rev-parse --verify HEAD) &&
	M=$(git show-ref -s --verify refs/heads/master) &&
	test "z$H" = "z$M" &&
	if git symbolic-ref HEAD >/dev/null 2>&1
	then
		echo "OOPS, HEAD is still symbolic???"
		false
	else
		: happy
	fi

[valid_sub1 a8d019f] Revert "Invalid sub1 commit"
 Author: A U Thor <author@example.com>
Switched to branch 'master'
Previous HEAD position was 7329388... Initial A one, A two
Switched to branch 'renamer'
Removing messages
[master (root-commit) 92c326a] setup
 Author: A U Thor <author@example.com>
 3 files changed, 2 insertions(+)
 create mode 100644 .gitignore
 create mode 100644 Makefile
 create mode 100644 src/part1.c
Cloning into 'submodule_update'...
HEAD is now at 7329388... Initial A one, A two
ok 1 - setup

expecting success: 
	git update-index --skip-worktree .gitignore &&
	rm .gitignore &&
	mkdir -p build docs &&
	touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
	git clean &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test ! -f a.out &&
	test ! -f src/part3.c &&
	test -f docs/manual.txt &&
	test -f obj.o &&
	test -f build/lib.so &&
	git update-index --no-skip-worktree .gitignore &&
	git checkout .gitignore

done.
ok 12 - checkout to detach HEAD

expecting success: 

	git checkout -f master && git clean -f &&
	git checkout renamer^ &&
	H=$(git rev-parse --verify HEAD) &&
	M=$(git show-ref -s --verify refs/heads/master) &&
	test "z$H" = "z$M" &&
	if git symbolic-ref HEAD >/dev/null 2>&1
	then
		echo "OOPS, HEAD is still symbolic???"
		false
	else
		: happy
	fi

Removing a.out
Removing src/part3.c
Switched to branch 'master'
ok 2 - git clean with skip-worktree .gitignore

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
	git clean &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test ! -f a.out &&
	test ! -f src/part3.c &&
	test -f docs/manual.txt &&
	test -f obj.o &&
	test -f build/lib.so


Removing messages
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Note: checking out 'renamer^'.

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 7329388... Initial A one, A two
Removing a.out
Removing src/part3.c
ok 3 - git clean

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
	git clean src/ &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test -f a.out &&
	test ! -f src/part3.c &&
	test -f docs/manual.txt &&
	test -f obj.o &&
	test -f build/lib.so


Removing src/part3.c
ok 4 - git clean src/

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
	git clean src/ src/ &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test -f a.out &&
	test ! -f src/part3.c &&
	test -f docs/manual.txt &&
	test -f obj.o &&
	test -f build/lib.so


ok 13 - checkout to detach HEAD with branchname^

expecting success: 

	git checkout -f master && git clean -f &&
	git checkout ":/Initial" &&
	H=$(git rev-parse --verify HEAD) &&
	M=$(git show-ref -s --verify refs/heads/master) &&
	test "z$H" = "z$M" &&
	if git symbolic-ref HEAD >/dev/null 2>&1
	then
		echo "OOPS, HEAD is still symbolic???"
		false
	else
		: happy
	fi

Branch add_sub1 set up to track remote branch add_sub1 from origin.
Switched to branch 'master'
Removing src/part3.c
ok 5 - git clean src/ src/

expecting success: 

	mkdir -p build docs src/test &&
	touch a.out src/part3.c docs/manual.txt obj.o build/lib.so src/test/1.c &&
	(cd src/ && git clean) &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test -f a.out &&
	test ! -f src/part3.c &&
	test -f src/test/1.c &&
	test -f docs/manual.txt &&
	test -f obj.o &&
	test -f build/lib.so


Removing part3.c
ok 6 - git clean with prefix

Note: checking out ':/Initial'.

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 7329388... Initial A one, A two
expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
	would_clean=$(
		cd docs &&
		git clean -n ../src |
		sed -n -e "s|^Would remove ||p"
	) &&
	verbose test "$would_clean" = ../src/part3.c

ok 7 - git clean with relative prefix

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
	would_clean=$(
		cd docs &&
		git clean -n "$(pwd)/../src" |
		sed -n -e "s|^Would remove ||p"
	) &&
	verbose test "$would_clean" = ../src/part3.c

ok 14 - checkout to detach HEAD with :/message

expecting success: 

	git checkout -f master && git clean -f &&
	git checkout HEAD^0 &&
	H=$(git rev-parse --verify HEAD) &&
	M=$(git show-ref -s --verify refs/heads/master) &&
	test "z$H" = "z$M" &&
	if git symbolic-ref HEAD >/dev/null 2>&1
	then
		echo "OOPS, HEAD is still symbolic???"
		false
	else
		: happy
	fi

Switched to branch 'master'
ok 8 - git clean with absolute path

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
	(
		cd docs &&
		test_must_fail git clean -n ../..
	)

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 7329388... Initial A one, A two
fatal: ../..: '../..' is outside repository
ok 9 - git clean with out of work tree relative path

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
	dd=$(cd .. && pwd) &&
	(
		cd docs &&
		test_must_fail git clean -n $dd
	)

fatal: /«PKGBUILDDIR»/t: '/«PKGBUILDDIR»/t' is outside repository
ok 10 - git clean with out of work tree absolute path

expecting success: 

	mkdir -p build docs src/feature &&
	touch a.out src/part3.c src/feature/file.c docs/manual.txt obj.o build/lib.so &&
	(cd src/ && git clean -d feature/) &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test -f a.out &&
	test -f src/part3.c &&
	test ! -f src/feature/file.c &&
	test -f docs/manual.txt &&
	test -f obj.o &&
	test -f build/lib.so


ok 15 - checkout to detach HEAD with HEAD^0

expecting success: 

	git tag both side &&
	git branch both master &&
	git reset --hard &&
	git checkout master &&

	git checkout both &&
	H=$(git rev-parse --verify HEAD) &&
	M=$(git show-ref -s --verify refs/heads/master) &&
	test "z$H" = "z$M" &&
	name=$(git symbolic-ref HEAD 2>/dev/null) &&
	test "z$name" = zrefs/heads/both


Removing feature/file.c
ok 11 - git clean -d with prefix and path

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: 

	mkdir -p build docs &&
	touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
	ln -s docs/manual.txt src/part4.c &&
	git clean &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test ! -f a.out &&
	test ! -f src/part3.c &&
	test ! -f src/part4.c &&
	test -f docs/manual.txt &&
	test -f obj.o &&
	test -f build/lib.so


HEAD is now at 7329388 Initial A one, A two
Removing a.out
Removing src/part3.c
Removing src/part4.c
ok 12 - git clean symbolic link

expecting success: 

	touch a.clean b.clean other.c &&
	git clean "*.clean" &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test ! -f a.clean &&
	test ! -f b.clean &&
	test -f other.c


Switched to branch 'master'
Removing a.clean
Removing b.clean
ok 13 - git clean with wildcard

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
	git clean -n &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test -f a.out &&
	test -f src/part3.c &&
	test -f docs/manual.txt &&
	test -f obj.o &&
	test -f build/lib.so


warning: refname 'both' is ambiguous.
Switched to branch 'both'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
Would remove a.out
Would remove other.c
Would remove src/part3.c
ok 14 - git clean -n

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
	git clean -d &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test ! -f a.out &&
	test ! -f src/part3.c &&
	test ! -d docs &&
	test -f obj.o &&
	test -f build/lib.so


ok 16 - checkout with ambiguous tag/branch names

expecting success: 

	git reset --hard &&
	git checkout master &&

	git tag frotz side &&
	git branch frotz master &&
	git reset --hard &&
	git checkout master &&

	git checkout tags/frotz &&
	H=$(git rev-parse --verify HEAD) &&
	S=$(git show-ref -s --verify refs/heads/side) &&
	test "z$H" = "z$S" &&
	if name=$(git symbolic-ref HEAD 2>/dev/null)
	then
		echo "Bad -- should have detached"
		false
	else
		: happy
	fi


Removing a.out
Removing docs/
Removing other.c
Removing src/feature/
Removing src/part3.c
Removing src/test/
ok 15 - git clean -d

expecting success: 

	mkdir -p build docs examples &&
	touch a.out src/part3.c docs/manual.txt obj.o build/lib.so examples/1.c &&
	git clean -d src/ examples/ &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test -f a.out &&
	test ! -f src/part3.c &&
	test ! -f examples/1.c &&
	test -f docs/manual.txt &&
	test -f obj.o &&
	test -f build/lib.so


HEAD is now at 7329388 Initial A one, A two
Removing examples/
Removing src/part3.c
ok 16 - git clean -d src/ examples/

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
	git clean -x &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test ! -f a.out &&
	test ! -f src/part3.c &&
	test -f docs/manual.txt &&
	test ! -f obj.o &&
	test -f build/lib.so


Switched to branch 'master'
Removing a.out
Removing obj.o
Removing src/part3.c
ok 17 - git clean -x

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
	git clean -d -x &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test ! -f a.out &&
	test ! -f src/part3.c &&
	test ! -d docs &&
	test ! -f obj.o &&
	test ! -d build


Cloning into 'sub1'...
Removing a.out
Removing build/
Removing docs/
Removing obj.o
Removing src/part3.c
ok 18 - git clean -d -x

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
	git clean -d -x -e src &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test ! -f a.out &&
	test -f src/part3.c &&
	test ! -d docs &&
	test ! -f obj.o &&
	test ! -d build


HEAD is now at 7329388 Initial A one, A two
Already on 'master'
Removing a.out
Removing build/
Removing docs/
Removing obj.o
ok 19 - git clean -d -x with ignored tracked directory

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
	git clean -X &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test -f a.out &&
	test -f src/part3.c &&
	test -f docs/manual.txt &&
	test ! -f obj.o &&
	test -f build/lib.so


Note: checking out 'tags/frotz'.

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 ab76817... Side M one, D two, A three
done.
ok 28 - test sparse status with untracked cache and subdir

expecting success: 
	test-dump-untracked-cache >../actual &&
	cat >../expect <<EOF &&
info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0
core.excludesfile 0000000000000000000000000000000000000000
exclude_per_dir .gitignore
flags 00000006
/ e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse valid
.gitignore
dtwo/
/done/ 1946f0437f90c5005533cbe1736a6451ca301714 recurse valid
five
sub/
/done/sub/ 0000000000000000000000000000000000000000 recurse check_only valid
sub/
/done/sub/sub/ 0000000000000000000000000000000000000000 recurse check_only valid
file
/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid
/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid
two
EOF
	test_cmp ../expect ../actual

Removing obj.o
ok 20 - git clean -X

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
	git clean -d -X &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test -f a.out &&
	test -f src/part3.c &&
	test -f docs/manual.txt &&
	test ! -f obj.o &&
	test ! -d build


ok 29 - verify untracked cache dump (sparse/subdirs)

expecting success: 
	avoid_racy &&
	: >../trace &&
	GIT_TRACE_UNTRACKED_STATS="$TRASH_DIRECTORY/trace" \
	git status --porcelain >../status.actual &&
	test_cmp ../status.expect ../status.actual &&
	cat >../trace.expect <<EOF &&
node creation: 0
gitignore invalidation: 0
directory invalidation: 0
opendir: 0
EOF
	test_cmp ../trace.expect ../trace

ok 17 - checkout with ambiguous tag/branch names

expecting success: 

	git reset --hard &&
	git checkout master &&

	mkdir subs &&
	(
		cd subs &&
		git checkout side
	) &&
	! test -f subs/one &&
	rm -fr subs


Removing build/
Removing obj.o
ok 21 - git clean -d -X

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
	git clean -d -X -e src &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test -f a.out &&
	test ! -f src/part3.c &&
	test -f docs/manual.txt &&
	test ! -f obj.o &&
	test ! -d build


HEAD is now at ab76817 Side M one, D two, A three
Removing build/
Removing obj.o
Removing src/part3.c
ok 22 - git clean -d -X with ignored tracked directory

expecting success: 

	git config --unset clean.requireForce &&
	test_must_fail git clean


Previous HEAD position was ab76817... Side M one, D two, A three
Switched to branch 'master'
fatal: clean.requireForce defaults to true and neither -i, -n, nor -f given; refusing to clean
ok 23 - clean.requireForce defaults to true

expecting success: 

	git config clean.requireForce true &&
	test_must_fail git clean


Switched to branch 'side'
fatal: clean.requireForce set to true and neither -i, -n, nor -f given; refusing to clean
ok 24 - clean.requireForce

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
	git clean -n &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test -f a.out &&
	test -f src/part3.c &&
	test -f docs/manual.txt &&
	test -f obj.o &&
	test -f build/lib.so


ok 18 - switch branches while in subdirectory

expecting success: 

	git reset --hard &&
	git checkout side &&
	mkdir subs &&
	>subs/bero &&
	git add subs/bero &&
	git commit -m "add subs/bero" &&

	git checkout master &&
	mkdir -p subs &&
	(
		cd subs &&
		git checkout side -- bero
	) &&
	test -f subs/bero


Would remove a.out
Would remove src/part3.c
ok 25 - clean.requireForce and -n

expecting success: 

	git clean -f &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test ! -f a.out &&
	test ! -f src/part3.c &&
	test -f docs/manual.txt &&
	test -f obj.o &&
	test -f build/lib.so


Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
HEAD is now at ab76817 Side M one, D two, A three
Removing a.out
Removing src/part3.c
ok 26 - clean.requireForce and -f

expecting success: 

	echo excludes >excludes &&
	echo included >included &&
	git config core.excludesfile excludes &&
	output=$(git clean -n excludes included 2>&1) &&
	expr "$output" : ".*included" >/dev/null &&
	! expr "$output" : ".*excludes" >/dev/null


Already on 'side'
ok 27 - core.excludesfile

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

)
[side bb04aa0] add subs/bero
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 subs/bero
Switched to branch 'master'
rm: cannot remove 'SANETESTD.1/x': Permission denied
prerequisite SANITY ok
expecting success: 

	mkdir foo &&
	touch foo/bar &&
	test_when_finished "chmod 755 foo" &&
	(exec <foo/bar &&
	 chmod 0 foo &&
	 test_must_fail git clean -f -d)

ok 19 - checkout specific path while in subdirectory

expecting success: 
    git config branch.autosetupmerge false &&
    git checkout master &&
    git checkout --track -b track1 &&
    test "$(git config branch.track1.remote)" &&
    test "$(git config branch.track1.merge)"
warning: failed to remove foo/
ok 1 - git reset --keep: added submodule creates empty directory

Removing docs/
Removing included
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
		)
	
Already on 'master'
A	subs/bero
ok 28 - removal failure

expecting success: 
	rm -fr foo bar baz &&
	mkdir -p foo bar baz/boo &&
	(
		cd foo &&
		git init &&
		test_commit nested hello.world
	) &&
	(
		cd bar &&
		>goodbye.people
	) &&
	(
		cd baz/boo &&
		git init &&
		test_commit deeply.nested deeper.world
	) &&
	git clean -f -d &&
	test -f foo/.git/index &&
	test -f foo/hello.world &&
	test -f baz/boo/.git/index &&
	test -f baz/boo/deeper.world &&
	! test -d bar

Switched to a new branch 'track1'
A	subs/bero
Branch track1 set up to track local branch master.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7300-clean/foo/.git/
ok 20 - checkout w/--track sets up tracking

expecting success: 
    test_when_finished git config branch.autosetupmerge false &&
    git config branch.autosetupmerge always &&
    git checkout master &&
    git checkout -b track2 &&
    test "$(git config branch.track2.remote)" &&
    test "$(git config branch.track2.merge)"
[master (root-commit) abd8674] nested
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 hello.world
Switched to branch 'master'
A	subs/bero
Cloning into 'submodule_update'...
Switched to a new branch 'track2'
A	subs/bero
Branch track2 set up to track local branch master.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7300-clean/baz/boo/.git/
ok 21 - checkout w/autosetupmerge=always sets up tracking

expecting success: 
    git checkout master^0 &&
    test_must_fail git symbolic-ref HEAD &&
    test_must_fail git checkout --track -b track &&
    test_must_fail git rev-parse --verify track &&
    test_must_fail git symbolic-ref HEAD &&
    test "z$(git rev-parse master^0)" = "z$(git rev-parse HEAD)"

done.
[master (root-commit) 3f7f1fc] deeply.nested
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 deeper.world
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 7329388... Initial A one, A two
A	subs/bero
fatal: ref HEAD is not a symbolic ref
Removing bar/
Skipping repository baz/boo
Skipping repository foo/
ok 29 - nested git work tree

expecting success: 
	rm -fr almost_git almost_bare_git almost_submodule &&
	mkdir -p almost_git/.git/objects &&
	mkdir -p almost_git/.git/refs &&
	cat >almost_git/.git/HEAD <<-\EOF &&
	garbage
	EOF
	cp -r almost_git/.git/ almost_bare_git &&
	mkdir almost_submodule/ &&
	cat >almost_submodule/.git <<-\EOF &&
	garbage
	EOF
	test_when_finished "rm -rf almost_*" &&
	git clean -f -d &&
	test_path_is_missing almost_git &&
	test_path_is_missing almost_bare_git &&
	test_path_is_missing almost_submodule

fatal: Cannot setup tracking information; starting point 'HEAD' is not a branch.
A	subs/bero
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
fatal: Needed a single revision
fatal: ref HEAD is not a symbolic ref
ok 22 - checkout w/--track from non-branch HEAD fails

expecting success: 
    git checkout master^0 &&
    test_must_fail git symbolic-ref HEAD &&
    test_must_fail git checkout --track -b track frotz &&
    test_must_fail git rev-parse --verify track &&
    test_must_fail git symbolic-ref HEAD &&
    test "z$(git rev-parse master^0)" = "z$(git rev-parse HEAD)"

Removing almost_bare_git/
Removing almost_git/
Removing almost_submodule/
Skipping repository baz/boo
Skipping repository foo/
ok 30 - should clean things that almost look like git but are not

expecting success: 
	rm -fr repo to_clean sub1 sub2 &&
	mkdir repo to_clean &&
	(
		cd repo &&
		git init &&
		test_commit msg hello.world
	) &&
	git submodule add ./repo/.git sub1 &&
	git commit -m "sub1" &&
	git branch before_sub2 &&
	git submodule add ./repo/.git sub2 &&
	git commit -m "sub2" &&
	git checkout before_sub2 &&
	>to_clean/should_clean.this &&
	git clean -f -d &&
	test_path_is_file repo/.git/index &&
	test_path_is_file repo/hello.world &&
	test_path_is_file sub1/.git &&
	test_path_is_file sub1/hello.world &&
	test_path_is_file sub2/.git &&
	test_path_is_file sub2/hello.world &&
	test_path_is_missing to_clean

Branch add_sub1 set up to track remote branch add_sub1 from origin.
HEAD is now at 7329388... Initial A one, A two
A	subs/bero
fatal: ref HEAD is not a symbolic ref
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7300-clean/repo/.git/
warning: refname 'frotz' is ambiguous.
warning: refname 'frotz' is ambiguous.
fatal: Ambiguous object name: 'frotz'.
A	subs/bero
fatal: Needed a single revision
fatal: ref HEAD is not a symbolic ref
[master (root-commit) 1af9d3b] msg
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 hello.world
ok 23 - checkout w/--track from tag fails

expecting success: 
    git checkout master &&
    git config --bool core.prefersymlinkrefs yes &&
    git checkout side &&
    git checkout master &&
    it=$(git symbolic-ref HEAD) &&
    test "z$it" = zrefs/heads/master &&
    here=$(git rev-parse --verify refs/heads/master) &&
    git checkout side^ &&
    test "z$(git rev-parse --verify refs/heads/master)" = "z$here"

Switched to branch 'master'
A	subs/bero
Switched to branch 'side'
Switched to branch 'master'
ok 30 - test sparse status again with untracked cache and subdir

expecting success: 
	git add dtwo/two &&
	git status --porcelain >../status.actual &&
	cat >../status.expect <<EOF &&
 M done/two
A  dtwo/two
?? .gitignore
?? done/five
?? done/sub/
EOF
	test_cmp ../status.expect ../status.actual

Note: checking out 'side^'.

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 ab76817... Side M one, D two, A three
ok 24 - detach a symbolic link HEAD

expecting success: 
    git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" &&
    git update-ref refs/remotes/origin/koala/bear renamer &&

    git checkout --track origin/koala/bear &&
    test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
    test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)" &&

    git checkout master && git branch -D koala/bear &&

    git checkout --track refs/remotes/origin/koala/bear &&
    test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
    test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)" &&

    git checkout master && git branch -D koala/bear &&

    git checkout --track remotes/origin/koala/bear &&
    test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
    test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)"

ok 31 - move entry in subdir from untracked to cached

expecting success: 
	git rm --cached dtwo/two &&
	git status --porcelain >../status.actual &&
	cat >../status.expect <<EOF &&
 M done/two
?? .gitignore
?? done/five
?? done/sub/
?? dtwo/
EOF
	test_cmp ../status.expect ../status.actual

rm 'dtwo/two'
ok 32 - move entry in subdir from cached to untracked

Cloning into 'sub1'...
Previous HEAD position was ab76817... Side M one, D two, A three
Switched to a new branch 'koala/bear'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
Branch koala/bear set up to track remote branch koala/bear from origin.
# passed all 32 test(s)
1..32
done.
*** t7301-clean-interactive.sh ***
Switched to branch 'master'
Deleted branch koala/bear (was 0420b41).
Switched to a new branch 'koala/bear'
Branch koala/bear set up to track remote branch koala/bear from origin.
Cloning into 'sub1'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7301-clean-interactive/.git/
expecting success: 

	mkdir -p src &&
	touch src/part1.c Makefile &&
	echo build >.gitignore &&
	echo \*.o >>.gitignore &&
	git add . &&
	git commit -m setup &&
	touch src/part2.c README &&
	git add .


Switched to branch 'master'
Deleted branch koala/bear (was 0420b41).
done.
Switched to a new branch 'koala/bear'
Branch koala/bear set up to track remote branch koala/bear from origin.
[master (root-commit) 14d6f77] setup
 Author: A U Thor <author@example.com>
 3 files changed, 2 insertions(+)
 create mode 100644 .gitignore
 create mode 100644 Makefile
 create mode 100644 src/part1.c
[master 11bf578] sub1
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 .gitmodules
 create mode 100644 README
 create mode 100644 src/part2.c
 create mode 160000 sub1
ok 1 - setup

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
	docs/manual.txt obj.o build/lib.so &&
	echo c | git clean -i &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test ! -f a.out &&
	test -f docs/manual.txt &&
	test ! -f src/part3.c &&
	test ! -f src/part3.h &&
	test ! -f src/part4.c &&
	test ! -f src/part4.h &&
	test -f obj.o &&
	test -f build/lib.so


ok 25 - checkout with --track fakes a sensible -b <name>

expecting success: 
    test_must_fail git checkout --track renamer
fatal: Missing branch name; try -b
ok 26 - checkout with --track, but without -b, fails with too short tracked name

expecting success: 
	setup_conflicting_index &&
	echo "none of the above" >sample &&
	cat sample >fild &&
	cat sample >file &&
	cat sample >filf &&
	test_must_fail git checkout fild file filf &&
	test_cmp sample fild &&
	test_cmp sample filf &&
	test_cmp sample file

Would remove the following items:
  a.out        src/part3.c  src/part3.h  src/part4.c  src/part4.h
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now> Removing a.out
Removing src/part3.c
Removing src/part3.h
Removing src/part4.c
Removing src/part4.h
ok 2 - git clean -i (c: clean hotkey)

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
	docs/manual.txt obj.o build/lib.so &&
	echo cl | git clean -i &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test ! -f a.out &&
	test -f docs/manual.txt &&
	test ! -f src/part3.c &&
	test ! -f src/part3.h &&
	test ! -f src/part4.c &&
	test ! -f src/part4.h &&
	test -f obj.o &&
	test -f build/lib.so


Would remove the following items:
  a.out        src/part3.c  src/part3.h  src/part4.c  src/part4.h
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now> Removing a.out
Removing src/part3.c
Removing src/part3.h
Removing src/part4.c
Removing src/part4.h
ok 3 - git clean -i (cl: clean prefix)

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
	docs/manual.txt obj.o build/lib.so &&
	echo quit | git clean -i &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test -f a.out &&
	test -f docs/manual.txt &&
	test -f src/part3.c &&
	test -f src/part3.h &&
	test -f src/part4.c &&
	test -f src/part4.h &&
	test -f obj.o &&
	test -f build/lib.so


Would remove the following items:
  a.out        src/part3.c  src/part3.h  src/part4.c  src/part4.h
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now> Bye.
ok 4 - git clean -i (quit)

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
	docs/manual.txt obj.o build/lib.so &&
	echo "\04" | git clean -i &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test -f a.out &&
	test -f docs/manual.txt &&
	test -f src/part3.c &&
	test -f src/part3.h &&
	test -f src/part4.c &&
	test -f src/part4.h &&
	test -f obj.o &&
	test -f build/lib.so


Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
error: path 'file' is unmerged
ok 27 - checkout an unmerged path should fail

expecting success: 
	setup_conflicting_index &&
	echo "none of the above" >sample &&
	echo ourside >expect &&
	cat sample >fild &&
	cat sample >file &&
	cat sample >filf &&
	git checkout -f fild file filf &&
	test_cmp expect fild &&
	test_cmp expect filf &&
	test_cmp sample file

Would remove the following items:
  a.out        src/part3.c  src/part3.h  src/part4.c  src/part4.h
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now> Huh ()?
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now> Bye.
ok 5 - git clean -i (Ctrl+D)

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
	docs/manual.txt obj.o build/lib.so &&
	(echo f; echo "*"; echo; echo c) | \
	git clean -id &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test -f a.out &&
	test -f docs/manual.txt &&
	test -f src/part3.c &&
	test -f src/part3.h &&
	test -f src/part4.c &&
	test -f src/part4.h &&
	test -f obj.o &&
	test -f build/lib.so


Would remove the following items:
  a.out        src/part3.c  src/part4.c
  docs/        src/part3.h  src/part4.h
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now>   a.out        src/part3.c  src/part4.c
  docs/        src/part3.h  src/part4.h
Input ignore patterns>> No more files to clean, exiting.
ok 6 - git clean -id (filter all)

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
	docs/manual.txt obj.o build/lib.so &&
	(echo f; echo "part3.* *.out"; echo; echo c) | \
	git clean -id &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test -f a.out &&
	test ! -f docs/manual.txt &&
	test -f src/part3.c &&
	test -f src/part3.h &&
	test ! -f src/part4.c &&
	test ! -f src/part4.h &&
	test -f obj.o &&
	test -f build/lib.so


Would remove the following items:
  a.out        src/part3.c  src/part4.c
  docs/        src/part3.h  src/part4.h
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now>   a.out        src/part3.c  src/part4.c
  docs/        src/part3.h  src/part4.h
Input ignore patterns>>   docs/        src/part4.c  src/part4.h
Input ignore patterns>> Would remove the following items:
  docs/        src/part4.c  src/part4.h
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now> Removing docs/
Removing src/part4.c
Removing src/part4.h
ok 7 - git clean -id (filter patterns)

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
	docs/manual.txt obj.o build/lib.so &&
	(echo f; echo "* !*.out"; echo; echo c) | \
	git clean -id &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test ! -f a.out &&
	test -f docs/manual.txt &&
	test -f src/part3.c &&
	test -f src/part3.h &&
	test -f src/part4.c &&
	test -f src/part4.h &&
	test -f obj.o &&
	test -f build/lib.so


warning: path 'file' is unmerged
Cloning into 'sub2'...
Would remove the following items:
  a.out        src/part3.c  src/part4.c
  docs/        src/part3.h  src/part4.h
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now>   a.out        src/part3.c  src/part4.c
  docs/        src/part3.h  src/part4.h
Input ignore patterns>>   a.out
Input ignore patterns>> Would remove the following item:
  a.out
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now> Removing a.out
ok 8 - git clean -id (filter patterns 2)

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
	docs/manual.txt obj.o build/lib.so &&
	(echo s; echo "*"; echo; echo c) | \
	git clean -id &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test ! -f a.out &&
	test ! -f docs/manual.txt &&
	test ! -f src/part3.c &&
	test ! -f src/part3.h &&
	test ! -f src/part4.c &&
	test ! -f src/part4.h &&
	test -f obj.o &&
	test -f build/lib.so


ok 28 - checkout with an unmerged path can be ignored

expecting success: 
	setup_conflicting_index &&
	echo "none of the above" >sample &&
	echo ourside >expect &&
	cat sample >fild &&
	cat sample >file &&
	cat sample >filf &&
	git checkout --ours . &&
	test_cmp expect fild &&
	test_cmp expect filf &&
	test_cmp expect file &&
	git checkout --theirs file &&
	test ztheirside = "z$(cat file)"

done.
ok 2 - git reset --keep: 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
		)
	
Would remove the following items:
  a.out        src/part3.c  src/part4.c
  docs/        src/part3.h  src/part4.h
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now>     1: a.out          2: docs/          3: src/part3.c    4: src/part3.h
    5: src/part4.c    6: src/part4.h
Select items to delete>>   * 1: a.out        * 2: docs/        * 3: src/part3.c  * 4: src/part3.h
  * 5: src/part4.c  * 6: src/part4.h
Select items to delete>> Would remove the following items:
  a.out        src/part3.c  src/part4.c
  docs/        src/part3.h  src/part4.h
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now> Removing a.out
Removing docs/
Removing src/part3.c
Removing src/part3.h
Removing src/part4.c
Removing src/part4.h
ok 9 - git clean -id (select - all)

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
	docs/manual.txt obj.o build/lib.so &&
	(echo s; echo; echo c) | \
	git clean -id &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test -f a.out &&
	test -f docs/manual.txt &&
	test -f src/part3.c &&
	test -f src/part3.h &&
	test -f src/part4.c &&
	test -f src/part4.h &&
	test -f obj.o &&
	test -f build/lib.so


Would remove the following items:
  a.out        src/part3.c  src/part4.c
  docs/        src/part3.h  src/part4.h
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now>     1: a.out          2: docs/          3: src/part3.c    4: src/part3.h
    5: src/part4.c    6: src/part4.h
Select items to delete>> No more files to clean, exiting.
ok 10 - git clean -id (select - none)

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
	docs/manual.txt obj.o build/lib.so &&
	(echo s; echo 3; echo; echo c) | \
	git clean -id &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test -f a.out &&
	test -f docs/manual.txt &&
	test ! -f src/part3.c &&
	test -f src/part3.h &&
	test -f src/part4.c &&
	test -f src/part4.h &&
	test -f obj.o &&
	test -f build/lib.so


Would remove the following items:
  a.out        src/part3.c  src/part4.c
  docs/        src/part3.h  src/part4.h
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now>     1: a.out          2: docs/          3: src/part3.c    4: src/part3.h
    5: src/part4.c    6: src/part4.h
Select items to delete>>     1: a.out          2: docs/        * 3: src/part3.c    4: src/part3.h
    5: src/part4.c    6: src/part4.h
Select items to delete>> Would remove the following item:
  src/part3.c
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now> Removing src/part3.c
ok 11 - git clean -id (select - number)

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
	docs/manual.txt obj.o build/lib.so &&
	(echo s; echo 2 3; echo 5; echo; echo c) | \
	git clean -id &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test -f a.out &&
	test ! -f docs/manual.txt &&
	test ! -f src/part3.c &&
	test -f src/part3.h &&
	test ! -f src/part4.c &&
	test -f src/part4.h &&
	test -f obj.o &&
	test -f build/lib.so


Would remove the following items:
  a.out        src/part3.c  src/part4.c
  docs/        src/part3.h  src/part4.h
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now>     1: a.out          2: docs/          3: src/part3.c    4: src/part3.h
    5: src/part4.c    6: src/part4.h
Select items to delete>>     1: a.out        * 2: docs/        * 3: src/part3.c    4: src/part3.h
    5: src/part4.c    6: src/part4.h
Select items to delete>>     1: a.out        * 2: docs/        * 3: src/part3.c    4: src/part3.h
  * 5: src/part4.c    6: src/part4.h
Select items to delete>> Would remove the following items:
  docs/        src/part3.c  src/part4.c
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now> Removing docs/
Removing src/part3.c
Removing src/part4.c
ok 12 - git clean -id (select - number 2)

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
	docs/manual.txt obj.o build/lib.so &&
	(echo s; echo 3,4 5; echo; echo c) | \
	git clean -id &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test -f a.out &&
	test -f docs/manual.txt &&
	test ! -f src/part3.c &&
	test ! -f src/part3.h &&
	test ! -f src/part4.c &&
	test -f src/part4.h &&
	test -f obj.o &&
	test -f build/lib.so


Cloning into 'submodule_update'...
Would remove the following items:
  a.out        src/part3.c  src/part4.c
  docs/        src/part3.h  src/part4.h
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now>     1: a.out          2: docs/          3: src/part3.c    4: src/part3.h
    5: src/part4.c    6: src/part4.h
Select items to delete>>     1: a.out          2: docs/        * 3: src/part3.c  * 4: src/part3.h
  * 5: src/part4.c    6: src/part4.h
Select items to delete>> Would remove the following items:
  src/part3.c  src/part3.h  src/part4.c
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now> Removing src/part3.c
Removing src/part3.h
Removing src/part4.c
ok 13 - git clean -id (select - number 3)

expecting success: 

	mkdir -p build docs &&
	touch a.out foo.txt bar.txt baz.txt &&
	(echo s; echo a.out fo ba bar; echo; echo c) | \
	git clean -id &&
	test -f Makefile &&
	test ! -f a.out &&
	test ! -f foo.txt &&
	test ! -f bar.txt &&
	test -f baz.txt &&
	rm baz.txt


ok 29 - checkout unmerged stage

expecting success: 
	setup_conflicting_index &&
	echo "none of the above" >sample &&
	echo ourside >expect &&
	cat sample >fild &&
	cat sample >file &&
	cat sample >filf &&
	git checkout -m -- fild file filf &&
	(
		echo "<<<<<<< ours"
		echo ourside
		echo "======="
		echo theirside
		echo ">>>>>>> theirs"
	) >merged &&
	test_cmp expect fild &&
	test_cmp expect filf &&
	test_cmp merged file

Would remove the following items:
  a.out        baz.txt      foo.txt
  bar.txt      docs/        src/part4.h
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now>     1: a.out          2: bar.txt        3: baz.txt        4: docs/
    5: foo.txt        6: src/part4.h
Select items to delete>> Huh (ba)?
  * 1: a.out        * 2: bar.txt        3: baz.txt        4: docs/
  * 5: foo.txt        6: src/part4.h
Select items to delete>> Would remove the following items:
  a.out    bar.txt  foo.txt
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now> Removing a.out
Removing bar.txt
Removing foo.txt
ok 14 - git clean -id (select - filenames)

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
	docs/manual.txt obj.o build/lib.so &&
	(echo s; echo 1,3-4; echo 2; echo; echo c) | \
	git clean -id &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test ! -f a.out &&
	test ! -f src/part3.c &&
	test ! -f src/part3.h &&
	test -f src/part4.c &&
	test -f src/part4.h &&
	test ! -f docs/manual.txt &&
	test -f obj.o &&
	test -f build/lib.so


done.
[master eec0cee] sub2
 Author: A U Thor <author@example.com>
 2 files changed, 4 insertions(+)
 create mode 160000 sub2
Would remove the following items:
  a.out        src/part3.c  src/part4.c
  docs/        src/part3.h  src/part4.h
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now>     1: a.out          2: docs/          3: src/part3.c    4: src/part3.h
    5: src/part4.c    6: src/part4.h
Select items to delete>>   * 1: a.out          2: docs/        * 3: src/part3.c  * 4: src/part3.h
    5: src/part4.c    6: src/part4.h
Select items to delete>>   * 1: a.out        * 2: docs/        * 3: src/part3.c  * 4: src/part3.h
    5: src/part4.c    6: src/part4.h
Select items to delete>> Would remove the following items:
  a.out        docs/        src/part3.c  src/part3.h
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now> Removing a.out
Removing docs/
Removing src/part3.c
Removing src/part3.h
ok 15 - git clean -id (select - range)

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
	docs/manual.txt obj.o build/lib.so &&
	(echo s; echo 4- 1; echo; echo c) | \
	git clean -id &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test ! -f a.out &&
	test -f docs/manual.txt &&
	test -f src/part3.c &&
	test ! -f src/part3.h &&
	test ! -f src/part4.c &&
	test ! -f src/part4.h &&
	test -f obj.o &&
	test -f build/lib.so


warning: unable to rmdir sub2: Directory not empty
Switched to a new branch 'no_submodule'
Would remove the following items:
  a.out        src/part3.c  src/part4.c
  docs/        src/part3.h  src/part4.h
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now>     1: a.out          2: docs/          3: src/part3.c    4: src/part3.h
    5: src/part4.c    6: src/part4.h
Select items to delete>>   * 1: a.out          2: docs/          3: src/part3.c  * 4: src/part3.h
  * 5: src/part4.c  * 6: src/part4.h
Select items to delete>> Would remove the following items:
  a.out        src/part3.h  src/part4.c  src/part4.h
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now> Removing a.out
Removing src/part3.h
Removing src/part4.c
Removing src/part4.h
Switched to branch 'before_sub2'
ok 16 - git clean -id (select - range 2)

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
	docs/manual.txt obj.o build/lib.so &&
	(echo s; echo "*"; echo -5- 1 -2; echo; echo c) | \
	git clean -id &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test ! -f a.out &&
	test -f docs/manual.txt &&
	test ! -f src/part3.c &&
	test ! -f src/part3.h &&
	test -f src/part4.c &&
	test -f src/part4.h &&
	test -f obj.o &&
	test -f build/lib.so


Branch no_submodule set up to track remote branch no_submodule from origin.
Skipping repository baz/boo
Skipping repository foo/
Skipping repository repo/
Skipping repository sub2/
Removing to_clean/
ok 31 - should not clean submodules

expecting success: 
	rm -fr to_clean possible_sub1 &&
	mkdir to_clean possible_sub1 &&
	test_when_finished "rm -rf possible_sub*" &&
	echo "gitdir: foo" >possible_sub1/.git &&
	>possible_sub1/hello.world &&
	chmod 0 possible_sub1/.git &&
	>to_clean/should_clean.this &&
	git clean -f -d &&
	test_path_is_file possible_sub1/.git &&
	test_path_is_file possible_sub1/hello.world &&
	test_path_is_missing to_clean

ok 30 - checkout with --merge

expecting success: 
	git config merge.conflictstyle diff3 &&
	setup_conflicting_index &&
	echo "none of the above" >sample &&
	echo ourside >expect &&
	cat sample >fild &&
	cat sample >file &&
	cat sample >filf &&
	git checkout -m -- fild file filf &&
	(
		echo "<<<<<<< ours"
		echo ourside
		echo "||||||| base"
		echo original
		echo "======="
		echo theirside
		echo ">>>>>>> theirs"
	) >merged &&
	test_cmp expect fild &&
	test_cmp expect filf &&
	test_cmp merged file

Would remove the following items:
  a.out        src/part3.c  src/part4.c
  docs/        src/part3.h  src/part4.h
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now>     1: a.out          2: docs/          3: src/part3.c    4: src/part3.h
    5: src/part4.c    6: src/part4.h
Select items to delete>>   * 1: a.out        * 2: docs/        * 3: src/part3.c  * 4: src/part3.h
  * 5: src/part4.c  * 6: src/part4.h
Select items to delete>>   * 1: a.out          2: docs/        * 3: src/part3.c  * 4: src/part3.h
    5: src/part4.c    6: src/part4.h
Select items to delete>> Would remove the following items:
  a.out        src/part3.c  src/part3.h
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now> Removing a.out
Removing src/part3.c
Removing src/part3.h
ok 17 - git clean -id (inverse select)

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
	docs/manual.txt obj.o build/lib.so &&
	(echo a; echo Y; echo y; echo no; echo yes; echo bad; echo) | \
	git clean -id &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test ! -f a.out &&
	test ! -f docs/manual.txt &&
	test -f src/part3.c &&
	test ! -f src/part3.h &&
	test -f src/part4.c &&
	test -f src/part4.h &&
	test -f obj.o &&
	test -f build/lib.so


Skipping repository baz/boo
Skipping repository foo/
Skipping repository possible_sub1/
Skipping repository repo/
Skipping repository sub2/
Removing to_clean/
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 32 - should avoid cleaning possible submodules

expecting success: 
	rm -fr empty_repo to_clean &&
	git init empty_repo &&
	mkdir to_clean &&
	>to_clean/should_clean.this &&
	git clean -f -d &&
	test_path_is_file empty_repo/.git/HEAD &&
	test_path_is_missing to_clean

Would remove the following items:
  a.out        src/part3.c  src/part4.c
  docs/        src/part3.h  src/part4.h
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now> Remove a.out [y/N]? Remove docs/ [y/N]? Remove src/part3.c [y/N]? Remove src/part3.h [y/N]? Remove src/part4.c [y/N]? Remove src/part4.h [y/N]? Removing a.out
Removing docs/
Removing src/part3.h
error: Untracked working tree file 'sub1' would be overwritten by merge.
fatal: Could not reset index file to revision 'add_sub1'.
ok 18 - git clean -id (ask)

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
	docs/manual.txt obj.o build/lib.so &&
	(echo a; echo Y; echo no; echo yes; echo "\04") | \
	git clean -id &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test ! -f a.out &&
	test -f docs/manual.txt &&
	test ! -f src/part3.c &&
	test -f src/part3.h &&
	test -f src/part4.c &&
	test -f src/part4.h &&
	test -f obj.o &&
	test -f build/lib.so


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7300-clean/empty_repo/.git/
Would remove the following items:
  a.out        src/part3.c  src/part4.c
  docs/        src/part3.h  src/part4.h
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now> Remove a.out [y/N]? Remove docs/ [y/N]? Remove src/part3.c [y/N]? Remove src/part3.h [y/N]? Remove src/part4.c [y/N]? 
Removing a.out
Removing src/part3.c
ok 19 - git clean -id (ask - Ctrl+D)

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
	docs/manual.txt obj.o build/lib.so &&
	(cd build/ && \
	 (echo f; echo "docs"; echo "*.h"; echo ; echo c) | \
	 git clean -id ..) &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test ! -f a.out &&
	test -f docs/manual.txt &&
	test ! -f src/part3.c &&
	test -f src/part3.h &&
	test ! -f src/part4.c &&
	test -f src/part4.h &&
	test -f obj.o &&
	test -f build/lib.so


Skipping repository baz/boo
Skipping repository empty_repo/
Skipping repository foo/
Skipping repository repo/
Skipping repository sub2/
Removing to_clean/
ok 33 - nested (empty) git should be kept

expecting success: 
	rm -fr bare1 bare2 subdir &&
	git init --bare bare1 &&
	git clone --local --bare . bare2 &&
	mkdir subdir &&
	cp -r bare2 subdir/bare3 &&
	git clean -f -d &&
	test_path_is_missing bare1 &&
	test_path_is_missing bare2 &&
	test_path_is_missing subdir

ok 3 - git reset --keep: 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
		)
	
Would remove the following items:
  ../a.out        ../src/part3.c  ../src/part4.c
  ../docs/        ../src/part3.h  ../src/part4.h
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now>   ../a.out        ../src/part3.c  ../src/part4.c
  ../docs/        ../src/part3.h  ../src/part4.h
Input ignore patterns>>   ../a.out        ../src/part3.h  ../src/part4.h
  ../src/part3.c  ../src/part4.c
Input ignore patterns>>   ../a.out        ../src/part3.c  ../src/part4.c
Input ignore patterns>> Would remove the following items:
  ../a.out        ../src/part3.c  ../src/part4.c
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now> Removing ../a.out
Removing ../src/part3.c
Removing ../src/part4.c
ok 20 - git clean -id with prefix and path (filter)

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
	docs/manual.txt obj.o build/lib.so &&
	(cd build/ && \
	 (echo s; echo "../docs/"; echo "../src/part3.c"; \
	  echo "../src/part4.c";  echo; echo c) | \
	 git clean -id ..) &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test -f a.out &&
	test ! -f docs/manual.txt &&
	test ! -f src/part3.c &&
	test -f src/part3.h &&
	test ! -f src/part4.c &&
	test -f src/part4.h &&
	test -f obj.o &&
	test -f build/lib.so


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7300-clean/bare1/
Cloning into bare repository 'bare2'...
ok 31 - checkout with --merge, in diff3 -m style

expecting success: 
	git config merge.conflictstyle diff3 &&
	setup_conflicting_index &&
	echo "none of the above" >sample &&
	echo ourside >expect &&
	cat sample >fild &&
	cat sample >file &&
	cat sample >filf &&
	git checkout --conflict=merge -- fild file filf &&
	(
		echo "<<<<<<< ours"
		echo ourside
		echo "======="
		echo theirside
		echo ">>>>>>> theirs"
	) >merged &&
	test_cmp expect fild &&
	test_cmp expect filf &&
	test_cmp merged file

Would remove the following items:
  ../a.out        ../src/part3.c  ../src/part4.c
  ../docs/        ../src/part3.h  ../src/part4.h
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now>     1: ../a.out          2: ../docs/          3: ../src/part3.c
    4: ../src/part3.h    5: ../src/part4.c    6: ../src/part4.h
Select items to delete>>     1: ../a.out        * 2: ../docs/          3: ../src/part3.c
    4: ../src/part3.h    5: ../src/part4.c    6: ../src/part4.h
Select items to delete>>     1: ../a.out        * 2: ../docs/        * 3: ../src/part3.c
    4: ../src/part3.h    5: ../src/part4.c    6: ../src/part4.h
Select items to delete>>     1: ../a.out        * 2: ../docs/        * 3: ../src/part3.c
    4: ../src/part3.h  * 5: ../src/part4.c    6: ../src/part4.h
Select items to delete>> Would remove the following items:
  ../docs/        ../src/part3.c  ../src/part4.c
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now> Removing ../docs/
Removing ../src/part3.c
Removing ../src/part4.c
ok 21 - git clean -id with prefix and path (select by name)

expecting success: 

	mkdir -p build docs &&
	touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
	docs/manual.txt obj.o build/lib.so &&
	(cd build/ && \
	 (echo a; echo Y; echo y; echo no; echo yes; echo bad; echo) | \
	 git clean -id ..) &&
	test -f Makefile &&
	test -f README &&
	test -f src/part1.c &&
	test -f src/part2.c &&
	test ! -f a.out &&
	test ! -f docs/manual.txt &&
	test -f src/part3.c &&
	test ! -f src/part3.h &&
	test -f src/part4.c &&
	test -f src/part4.h &&
	test -f obj.o &&
	test -f build/lib.so


done.
Would remove the following items:
  ../a.out        ../src/part3.c  ../src/part4.c
  ../docs/        ../src/part3.h  ../src/part4.h
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers
    4: ask each             5: quit                 6: help
What now> Remove ../a.out [y/N]? Remove ../docs/ [y/N]? Remove ../src/part3.c [y/N]? Remove ../src/part3.h [y/N]? Remove ../src/part4.c [y/N]? Remove ../src/part4.h [y/N]? Removing ../a.out
Removing ../docs/
Removing ../src/part3.h
ok 22 - git clean -id with prefix and path (ask)

# passed all 22 test(s)
1..22
Cloning into 'submodule_update'...
*** t7400-submodule-basic.sh ***
done.
ok 32 - checkout --conflict=merge, overriding config

expecting success: 
	test_unconfig merge.conflictstyle &&
	setup_conflicting_index &&
	echo "none of the above" >sample &&
	echo ourside >expect &&
	cat sample >fild &&
	cat sample >file &&
	cat sample >filf &&
	git checkout --conflict=diff3 -- fild file filf &&
	(
		echo "<<<<<<< ours"
		echo ourside
		echo "||||||| base"
		echo original
		echo "======="
		echo theirside
		echo ">>>>>>> theirs"
	) >merged &&
	test_cmp expect fild &&
	test_cmp expect filf &&
	test_cmp merged file

Removing bare1/
Removing bare2/
Skipping repository baz/boo
Skipping repository empty_repo/
Skipping repository foo/
Skipping repository repo/
Skipping repository sub2/
Removing subdir/
ok 34 - nested bare repositories should be cleaned

checking known breakage: 
	rm -fr strange_bare &&
	mkdir strange_bare &&
	git init --bare strange_bare/.git &&
	git clean -f -d &&
	test_path_is_missing strange_bare

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.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7300-clean/strange_bare/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/.git/
Skipping repository baz/boo
Skipping repository empty_repo/
Skipping repository foo/
Skipping repository repo/
Skipping repository strange_bare/
Skipping repository sub2/
Path exists:
expecting success: 
	>t &&
	git add t &&
	git commit -m "initial commit" &&
	git branch initial

drwxrwxr-x 1 buildd buildd 8 Dec 16 11:04 strange_bare
strange_bare
not ok 35 - nested (empty) bare repositories should be cleaned even when in .git # TODO known breakage

checking known breakage: 
	rm -fr strange_bare &&
	mkdir strange_bare &&
	git clone --local --bare . strange_bare/.git &&
	git clean -f -d &&
	test_path_is_missing strange_bare

t7112-reset-submodule.sh: 159: cd: can't cd to sub1
Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
Cloning into bare repository 'strange_bare/.git'...
[master (root-commit) 2fa4666] initial commit
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 t
ok 33 - checkout --conflict=diff3

expecting success: 
	git reset --hard master &&
	git symbolic-ref HEAD refs/heads/master &&
	test_must_fail git checkout -b renamer side^ &&
	test $(git symbolic-ref HEAD) = refs/heads/master &&
	git diff --exit-code &&
	git diff --cached --exit-code


ok 1 - setup - initial commit

expecting success: 
	test_when_finished "rm -f .gitmodules" &&
	cat >.gitmodules <<-\EOF &&
	[submodule "s"]
		path
		ignore
	EOF
	test_must_fail git status

done.
error: Missing value for 'submodule.s.path'
fatal: bad config file line 3 in /«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/.gitmodules
HEAD is now at 7329388 Initial A one, A two
ok 2 - configuration parsing

expecting success: 
	mkdir init &&
	(
		cd init &&
		git init &&
		echo a >a &&
		git add a &&
		git commit -m "submodule commit 1" &&
		git tag -a -m "rev-1" rev-1
	)

Skipping repository baz/boo
Skipping repository empty_repo/
Skipping repository foo/
Skipping repository repo/
Skipping repository strange_bare/
Skipping repository sub2/
Path exists:
drwxrwxr-x 1 buildd buildd 8 Dec 16 11:04 strange_bare
fatal: A branch named 'renamer' already exists.
strange_bare
not ok 36 - nested (non-empty) bare repositories should be cleaned even when in .git # TODO known breakage

expecting success: 
	rm -fr repo &&
	mkdir repo &&
	(
		cd repo &&
		git init &&
		mkdir -p bar/baz &&
		test_commit msg bar/baz/hello.world
	) &&
	git clean -f -d repo/bar/baz &&
	test_path_is_file repo/.git/HEAD &&
	test_path_is_dir repo/bar/ &&
	test_path_is_missing repo/bar/baz

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/init/.git/
ok 34 - failing checkout -b should not break working tree

expecting success: 
	git reset --hard master &&
	git checkout master^0 &&
	echo modified >one &&
	test_must_fail git checkout renamer 2>error.log &&
	! grep "^Previous HEAD" error.log

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7300-clean/repo/.git/
[master (root-commit) 0afb3c4] submodule commit 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a
HEAD is now at 7329388 Initial A one, A two
ok 3 - setup - repository in init subdirectory

expecting success: 
	echo a >a &&
	echo z >z &&
	git add a init z &&
	git commit -m "super commit 1"

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 7329388... Initial A one, A two
[master (root-commit) 14dba50] msg
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bar/baz/hello.world
[master f42a4b4] super commit 1
 Author: A U Thor <author@example.com>
 3 files changed, 3 insertions(+)
 create mode 100644 a
 create mode 160000 init
 create mode 100644 z
ok 4 - setup - commit with gitlink

expecting success: 
	mv init .subrepo

ok 35 - switch out of non-branch

expecting success: 
	git reset --hard &&

	git config merge.filfre.driver "./filfre.sh %O %A %B" &&
	git config merge.filfre.name "Feel-free merge driver" &&
	git config merge.filfre.recursive binary &&
	echo "arm merge=filfre" >.gitattributes &&

	git checkout -b left &&
	echo neutral >arm &&
	git add arm .gitattributes &&
	test_tick &&
	git commit -m neutral &&
	git branch right &&

	echo left >arm &&
	test_tick &&
	git commit -a -m left &&
	git checkout right &&

	echo right >arm &&
	test_tick &&
	git commit -a -m right &&

	test_must_fail git merge left &&
	(
		for t in filfre-common left right
		do
			grep $t arm || exit 1
		done
		exit 0
	) &&

	mv arm expect &&
	git checkout -m arm &&
	test_cmp expect arm

ok 5 - setup - hide init subdirectory

expecting success: 
	git init addtest &&
	git init addtest-ignore

Removing repo/bar/baz/
ok 37 - giving path in nested git work tree will remove it

expecting success: 
	rm -fr repo &&
	mkdir repo untracked &&
	(
		cd repo &&
		git init &&
		test_commit msg hello.world
	) &&
	git clean -f -d repo/.git &&
	test_path_is_file repo/.git/HEAD &&
	test_path_is_dir repo/.git/refs &&
	test_path_is_dir repo/.git/objects &&
	test_path_is_dir untracked/

HEAD is now at 7329388 Initial A one, A two
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/addtest/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/addtest-ignore/.git/
ok 6 - setup - repository to add submodules to

expecting success: 
	echo "refs/heads/master" >expect &&
	>empty &&

	(
		cd addtest &&
		git submodule add -q "$submodurl" submod >actual &&
		test_must_be_empty actual &&
		echo "gitdir: ../.git/modules/submod" >expect &&
		test_cmp expect submod/.git &&
		(
			cd submod &&
			git config core.worktree >actual &&
			echo "../../../submod" >expect &&
			test_cmp expect actual &&
			rm -f actual expect
		) &&
		git submodule init
	) &&

	rm -f heads head untracked &&
	inspect addtest/submod ../.. &&
	test_cmp expect heads &&
	test_cmp expect head &&
	test_cmp empty untracked

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7300-clean/repo/.git/
Switched to a new branch 'left'
[master (root-commit) 1af9d3b] msg
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 hello.world
[left b257dc6] neutral
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 .gitattributes
 create mode 100644 arm
ok 38 - giving path to nested .git will not remove it

expecting success: 
	rm -fr repo untracked &&
	mkdir repo untracked &&
	(
		cd repo &&
		git init &&
		test_commit msg hello.world
	) &&
	git clean -f -d repo/.git/ &&
	test_path_is_dir repo/.git &&
	test_dir_is_empty repo/.git &&
	test_path_is_dir untracked/

[left 2459c9d] left
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to branch 'right'
Cloning into 'sub1'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7300-clean/repo/.git/
[right 6b476b9] right
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Merging:
6b476b9 right
virtual left
found 1 common ancestor:
b257dc6 neutral
[master (root-commit) 1af9d3b] msg
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 hello.world
done.
Auto-merging arm
CONFLICT (content): Merge conflict in arm
Automatic merge failed; fix conflicts and then commit the result.
||||||| filfre-common
Removing repo/.git/COMMIT_EDITMSG
Removing repo/.git/HEAD
Removing repo/.git/branches/
Removing repo/.git/config
Removing repo/.git/description
Removing repo/.git/hooks/
Removing repo/.git/index
Removing repo/.git/info/
Removing repo/.git/logs/
Removing repo/.git/objects/
Removing repo/.git/refs/
left
right
ok 39 - giving path to nested .git/ will remove contents

expecting success: 
	rm -fr foo bar baz &&
	mkdir -p foo bar baz/boo &&
	(
		cd foo &&
		git init &&
		test_commit nested hello.world
	) &&
	(
		cd bar &&
		>goodbye.people
	) &&
	(
		cd baz/boo &&
		git init &&
		test_commit deeply.nested deeper.world
	) &&
	git clean -f -f -d &&
	! test -d foo &&
	! test -d bar &&
	! test -d baz

ok 36 - custom merge driver with checkout -m

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7300-clean/foo/.git/
# passed all 36 test(s)
1..36
[master (root-commit) abd8674] nested
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 hello.world
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
*** t7401-submodule-summary.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7300-clean/baz/boo/.git/
[master (root-commit) 3f7f1fc] deeply.nested
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 deeper.world
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7401-submodule-summary/.git/
ok 4 - git reset --keep: 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
		)
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7401-submodule-summary/sm1/.git/
Removing bar/
Removing baz/
Removing empty_repo/
Removing foo/
Removing repo/
Removing strange_bare/
Removing sub2/
Removing untracked/
ok 40 - force removal of nested git work tree

expecting success: 
	rm -fr repo &&
	mkdir repo &&
	(
		cd repo &&
		git init &&
		touch known 1 2 3 &&
		git add known &&
		git clean -f -e 1 -e 2 &&
		test -e 1 &&
		test -e 2 &&
		! (test -e 3) &&
		test -e known
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7300-clean/repo/.git/
Removing 3
ok 41 - git clean -e

expecting success: 
	mkdir foo &&
	chmod a= foo &&
	git clean -dfx foo &&
	! test -d foo

ok 7 - submodule add

expecting success: 
	(
		cd addtest-ignore &&
		cat <<-\EOF >expect &&
		The following path is ignored by one of your .gitignore files:
		submod
		Use -f if you really want to add it.
		EOF
		# Does not use test_commit due to the ignore
		echo "*" > .gitignore &&
		git add --force .gitignore &&
		git commit -m"Ignore everything" &&
		! git submodule add "$submodurl" submod >actual 2>&1 &&
Cloning into 'submodule_update'...
		test_i18ncmp expect actual
	)

Removing foo/
ok 42 - git clean -d with an unreadable empty directory

expecting success: 
	mkdir -p foo &&
	mkdir -p foobar &&
	git clean -df foobar &&
	test_path_is_dir foo &&
	test_path_is_missing foobar

Removing foobar/
ok 43 - git clean -d respects pathspecs (dir is prefix of pathspec)

expecting success: 
	mkdir -p foo &&
	mkdir -p foobar &&
	git clean -df foo &&
	test_path_is_missing foo &&
	test_path_is_dir foobar

expecting success: 
	git add sm1 &&
	git submodule summary >actual &&
	cat >expected <<-EOF &&
* sm1 0000000...a2c4dab (2):
  > Add foo2

EOF
	test_cmp expected actual

done.
[master (root-commit) d9c071b] Ignore everything
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 .gitignore
Removing foo/
ok 44 - git clean -d respects pathspecs (pathspec is prefix of dir)

# still have 2 known breakage(s)
# passed all remaining 42 test(s)
1..44
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.
error: 8ed2e6719f8484ce01fa3ce133fe42d25c2441b8^{commit}: expected commit type, but the object dereferences to tree type
fatal: Needed a single revision
*** t7402-submodule-rebase.sh ***
Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
ok 8 - submodule add to .gitignored path fails

expecting success: 
	(
		cd addtest-ignore &&
		git submodule add --force "$submodurl" submod
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7402-submodule-rebase/.git/
expecting success: 

	echo file > file &&
	git add file &&
	test_tick &&
	git commit -m initial &&
	git clone . submodule &&
	git add submodule &&
	test_tick &&
	git commit -m submodule &&
	echo second line >> file &&
	(cd submodule && git pull) &&
	test_tick &&
	git commit -m file-and-submodule -a &&
	git branch added-submodule


ok 1 - added submodule

expecting success: 
	mkdir sub &&
	(
		cd sub &&
		git submodule summary >../actual
	) &&
	cat >expected <<-EOF &&
* ../sm1 0000000...a2c4dab (2):
  > Add foo2

EOF
	test_cmp expected actual

[master (root-commit) ffefb50] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
Cloning into 'submodule'...
done.
Cloning into 'submod'...
done.
[master 9bd10db] submodule
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 160000 submodule
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
From /«PKGBUILDDIR»/t/trash directory.t7402-submodule-rebase/.
   ffefb50..9bd10db  master     -> origin/master
ok 2 - added submodule (subdirectory)

expecting success: 
	(
		cd sub &&
		git submodule summary . >../actual
	) &&
	>expected &&
	test_cmp expected actual

ok 9 - submodule add to .gitignored path with --force

expecting success: 
	echo "refs/heads/initial" >expect-head &&
	cat <<-\EOF >expect-heads &&
	refs/heads/initial
	refs/heads/master
	EOF
	>empty &&

	(
		cd addtest &&
		git submodule add -b initial "$submodurl" submod-branch &&
		test "initial" = "$(git config -f .gitmodules submodule.submod-branch.branch)" &&
		git submodule init
	) &&

	rm -f heads head untracked &&
	inspect addtest/submod-branch ../.. &&
	test_cmp expect-heads heads &&
	test_cmp expect-head head &&
	test_cmp empty untracked

Updating ffefb50..9bd10db
Fast-forward
 submodule | 1 +
 1 file changed, 1 insertion(+)
 create mode 160000 submodule
[master 041f541] file-and-submodule
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 1 deletion(-)
Cloning into 'sub1'...
ok 1 - setup

expecting success: 

	(cd submodule &&
	 echo 3rd line >> file &&
	 test_tick &&
	 git commit -m fork -a) &&
	echo unrelated >> file2 &&
	git add file2 &&
	test_tick &&
	git commit -m unrelated file2 &&
	echo other line >> file &&
	test_tick &&
	git commit -m update file &&
	CURRENT=$(cd submodule && git rev-parse HEAD) &&
	EXPECTED=$(git rev-parse HEAD~2:submodule) &&
	GIT_TRACE=1 git rebase --onto HEAD~2 HEAD^ &&
	STORED=$(git rev-parse HEAD:submodule) &&
	test $EXPECTED = $STORED &&
	test $CURRENT = $(cd submodule && git rev-parse HEAD)


[master eb5e1a6] fork
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
done.
[master b5e9d7b] unrelated
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file2
ok 3 - added submodule (subdirectory only)

expecting success: 
	(
		cd sub &&
		git submodule summary ../sm1 >../actual
	) &&
	cat >expected <<-EOF &&
* ../sm1 0000000...a2c4dab (2):
  > Add foo2

EOF
	test_cmp expected actual

[master a65f80c] update
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Cloning into 'submod-branch'...
trace: exec: 'git-rebase' '--onto' 'HEAD~2' 'HEAD^'
trace: run_command: 'git-rebase' '--onto' 'HEAD~2' 'HEAD^'
done.
trace: built-in: git 'rev-parse' '--parseopt' '--stuck-long' '--' '--onto' 'HEAD~2' 'HEAD^'
trace: built-in: git 'rev-parse' '--git-dir'
trace: built-in: git 'rev-parse' '--git-path' 'objects'
trace: built-in: git 'rev-parse' '--is-bare-repository'
trace: built-in: git 'rev-parse' '--show-toplevel'
trace: built-in: git 'config' '--bool' 'rebase.stat'
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
trace: built-in: git 'config' '--bool' 'rebase.autostash'
trace: built-in: git 'config' '--bool' 'rebase.autosquash'
trace: built-in: git 'rev-parse' '--verify' 'HEAD^^0'
trace: built-in: git 'rev-parse' '--verify' 'HEAD~2^0'
trace: built-in: git 'symbolic-ref' '-q' 'HEAD'
trace: built-in: git 'rev-parse' '--verify' 'HEAD'
trace: built-in: git 'rev-parse' '--verify' 'HEAD'
trace: built-in: git 'update-index' '-q' '--ignore-submodules' '--refresh'
trace: built-in: git 'diff-files' '--quiet' '--ignore-submodules'
trace: built-in: git 'diff-index' '--cached' '--quiet' '--ignore-submodules' 'HEAD' '--'
trace: built-in: git 'merge-base' '041f541f7d4ce41c4eda25e0e58871f126de234b' 'a65f80c7f0672c121207764dac7ccebf98cf44c8'
ok 4 - added submodule (subdirectory with explicit path)

trace: built-in: git 'rev-parse' '--git-path' 'hooks/pre-rebase'
First, rewinding head to replay your work on top of it...
trace: built-in: git 'checkout' '-q' '041f541f7d4ce41c4eda25e0e58871f126de234b^0'
ok 5 - git reset --keep: 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
		)
	
trace: built-in: git 'update-ref' 'ORIG_HEAD' 'a65f80c7f0672c121207764dac7ccebf98cf44c8'
trace: built-in: git 'format-patch' '-k' '--stdout' '--full-index' '--cherry-pick' '--right-only' '--src-prefix=a/' '--dst-prefix=b/' '--no-renames' '--no-cover-letter' 'b5e9d7b7db63bf27cc3ce457eb90630609309fb6...a65f80c7f0672c121207764dac7ccebf98cf44c8'
trace: built-in: git 'am' '--rebasing' '--resolvemsg=
When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".
'
trace: run_command: 'mailsplit' '-d4' '-o.git/rebase-apply' '-b' '--'
trace: exec: 'git' 'mailsplit' '-d4' '-o.git/rebase-apply' '-b' '--'
trace: built-in: git 'mailsplit' '-d4' '-o.git/rebase-apply' '-b' '--'
expecting success: 
	git submodule summary >actual &&
	cat >expected <<-EOF &&
* sm1 a2c4dab...4c8d358 (1):
  > Add foo3

EOF
	test_cmp expected actual

trace: run_command: 'apply' '--index' '.git/rebase-apply/patch'
Applying: update
trace: built-in: git 'rev-parse' 'HEAD'
Cloning into 'submodule_update'...
trace: built-in: git 'update-ref' '-m' 'rebase finished: refs/heads/master onto 041f541f7d4ce41c4eda25e0e58871f126de234b' 'refs/heads/master' '81a011672801a6d53f73688ebde4d518274102e6' 'a65f80c7f0672c121207764dac7ccebf98cf44c8'
trace: built-in: git 'symbolic-ref' '-m' 'rebase finished: returning to refs/heads/master' 'HEAD' 'refs/heads/master'
trace: built-in: git 'gc' '--auto'
done.
ok 2 - rebase with a dirty submodule

expecting success: 

	test submodule = $(git diff --name-only) &&
	HEAD=$(git rev-parse HEAD) &&
	GIT_EDITOR="\"$(pwd)/fake-editor.sh\"" EDITOR_TEXT="pick $HEAD" \
		git rebase -i HEAD^ &&
	test submodule = $(git diff --name-only)


Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 10 - submodule add --branch

expecting success: 
	echo "refs/heads/master" >expect &&
	>empty &&

	(
		cd addtest &&
		git submodule add "$submodurl" ././dotsubmod/./frotz/./ &&
		git submodule init
	) &&

	rm -f heads head untracked &&
	inspect addtest/dotsubmod/frotz ../../.. &&
	test_cmp expect heads &&
	test_cmp expect head &&
	test_cmp empty untracked

ok 5 - modified submodule(forward)

expecting success: 
	git submodule summary --files >actual &&
	cat >expected <<-EOF &&
* sm1 a2c4dab...4c8d358 (1):
  > Add foo3

EOF
	test_cmp expected actual

Cloning into 'dotsubmod/frotz'...
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
done.
ok 6 - modified submodule(forward), --files

expecting success: 
	git config -f .gitmodules submodule.sm1.path sm1 &&
	git config -f .gitmodules submodule.sm1.ignore all &&
	git config submodule.sm1.ignore all &&
	git config diff.ignoreSubmodules all &&
	git submodule summary >actual &&
	cat >expected <<-EOF &&
* sm1 a2c4dab...4c8d358 (1):
  > Add foo3

EOF
	test_cmp expected actual &&
	git config --unset diff.ignoreSubmodules &&
	git config --remove-section submodule.sm1 &&
	git config -f .gitmodules --remove-section submodule.sm1

Cloning into 'sub1'...
pick 81a011672801a6d53f73688ebde4d518274102e6
done.
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
Successfully rebased and updated refs/heads/master.
Rebasing (1/1)
ok 3 - interactive rebase with a dirty submodule

expecting success: 

	echo yet another line >> file &&
	test_tick &&
	git commit -m next file &&
	echo rewrite > file &&
	test_tick &&
	git commit -m rewrite file &&
	echo dirty > file &&
	test_must_fail git rebase --onto HEAD~2 HEAD^


Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
ok 7 - no ignore=all setting has any effect

warning: unable to rmdir sub1: Directory not empty
[master 260764e] next
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
expecting success: 
	git submodule summary >actual &&
	cat >expected <<-EOF &&
* sm1 4c8d358...db425b6 (2):
  < Add foo3
  < Add foo2

EOF
	test_cmp expected actual

ok 11 - submodule add with ./ in path

expecting success: 
	echo "refs/heads/master" >expect &&
	>empty &&

	(
		cd addtest &&
		git submodule add "$submodurl" dotslashdotsubmod/././frotz/./ &&
		git submodule init
	) &&

	rm -f heads head untracked &&
	inspect addtest/dotslashdotsubmod/frotz ../../.. &&
	test_cmp expect heads &&
	test_cmp expect head &&
	test_cmp empty untracked

[master 63179b5] rewrite
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 4 deletions(-)
ok 6 - git reset --keep: 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
		)
	
Cloning into 'dotslashdotsubmod/frotz'...
Cannot rebase: You have unstaged changes.
Cloning into 'submodule_update'...
done.
Please commit or stash them.
ok 4 - rebase with dirty file and submodule fails

expecting success: 

	echo new > file &&
	CURRENT=$(cd submodule && git rev-parse HEAD) &&
	git stash &&
	test new != $(cat file) &&
	test submodule = $(git diff --name-only) &&
	test $CURRENT = $(cd submodule && git rev-parse HEAD) &&
	git stash apply &&
	test new = $(cat file) &&
	test $CURRENT = $(cd submodule && git rev-parse HEAD)


done.
ok 8 - modified submodule(backward)

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
expecting success: 
	git submodule summary >actual &&
	cat >expected <<-EOF &&
* sm1 4c8d358...41fbea9 (4):
  > Add foo5
  > Add foo4
  < Add foo3
  < Add foo2

EOF
	test_cmp expected actual

Saved working directory and index state WIP on master: 63179b5 rewrite
HEAD is now at 63179b5 rewrite
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 9 - modified submodule(backward and forward)

expecting success: 
	git submodule summary -n 3 >actual &&
	cat >expected <<-EOF &&
* sm1 4c8d358...41fbea9 (4):
  > Add foo5
  > Add foo4
  < Add foo3

EOF
	test_cmp expected actual

Cloning into 'sub1'...
ok 12 - submodule add with /././ in path

expecting success: 
	echo "refs/heads/master" >expect &&
	>empty &&

	(
		cd addtest &&
		git submodule add "$submodurl" slashslashsubmod///frotz// &&
		git submodule init
	) &&

	rm -f heads head untracked &&
	inspect addtest/slashslashsubmod/frotz ../../.. &&
	test_cmp expect heads &&
	test_cmp expect head &&
	test_cmp empty untracked

done.
Merging Version stash was based on with Stashed changes
Merging:
virtual Version stash was based on
virtual Stashed changes
found 1 common ancestor:
virtual 8b045485d7af7da389e60eb467551e426da98c59
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   file
	modified:   submodule (new commits)

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	fake-editor.sh

no changes added to commit (use "git add" and/or "git commit -a")
ok 5 - stash with a dirty submodule

expecting success: 
	git reset --hard &&
	git checkout added-submodule &&
	git add submodule &&
	test_tick &&
	git commit -m third &&
	(
		cd submodule &&
		git commit --allow-empty -m extra
	) &&
	git add submodule &&
	test_tick &&
	git commit -m fourth &&

	test_must_fail git rebase --onto HEAD^^ HEAD^ HEAD^0 &&
	git ls-files -s submodule >actual &&
	(
		cd submodule &&
		echo "160000 $(git rev-parse HEAD^) 1	submodule" &&
		echo "160000 $(git rev-parse HEAD^^) 2	submodule" &&
		echo "160000 $(git rev-parse HEAD) 3	submodule"
	) >expect &&
	test_cmp expect actual

HEAD is now at 63179b5 rewrite
ok 10 - --summary-limit

Switched to branch 'added-submodule'
M	submodule
Cloning into 'slashslashsubmod/frotz'...
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
[added-submodule 3e80a7a] third
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
done.
expecting success: 
	git submodule summary --cached >actual &&
	cat >expected <<-EOF &&
* sm1 41fbea9(submodule)->9da5fb8(blob) (3):
  < Add foo5

EOF
	test_i18ncmp actual expected

[master 7d89a17] extra
 Author: A U Thor <author@example.com>
[added-submodule b58fe73] fourth
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
warning: unable to rmdir sub1: Directory not empty
ok 11 - typechanged submodule(submodule->blob), --cached

expecting success: 
	git submodule summary --files >actual &&
	cat >expected <<-EOF &&
* sm1 9da5fb8(blob)->41fbea9(submodule) (3):
  > Add foo5

EOF
	test_i18ncmp actual expected

First, rewinding head to replay your work on top of it...
Applying: fourth
ok 7 - git reset --keep: 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
		)
	
Using index info to reconstruct a base tree...
M	submodule
Falling back to patching base and 3-way merge...
warning: Failed to merge submodule submodule (commits don't follow merge-base)
Merging 041f541f7d4ce41c4eda25e0e58871f126de234b with fourth
Merging:
041f541 file-and-submodule
virtual fourth
found 1 common ancestor:
virtual 916d85feee86a894adc3398951af35ea093209b9
Auto-merging submodule
CONFLICT (submodule): Merge conflict in submodule
error: Failed to merge in the changes.
Patch failed at 0001 fourth
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

ok 6 - rebasing submodule that should conflict

# passed all 6 test(s)
1..6
ok 12 - typechanged submodule(submodule->blob), --files

Cloning into 'submodule_update'...
expecting success: 
	git submodule summary >actual &&
	cat >expected <<-EOF &&
* sm1 41fbea9(submodule)->9da5fb8(blob):

EOF
	test_i18ncmp actual expected

done.
*** t7403-submodule-sync.sh ***
ok 13 - submodule add with // in path

expecting success: 
	echo "refs/heads/master" >expect &&
	>empty &&

	(
		cd addtest &&
		git submodule add "$submodurl" dotdotsubmod/../realsubmod/frotz/.. &&
		git submodule init
	) &&

	rm -f heads head untracked &&
	inspect addtest/realsubmod ../.. &&
	test_cmp expect heads &&
	test_cmp expect head &&
	test_cmp empty untracked

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7403-submodule-sync/.git/
expecting success: 
	echo file >file &&
	git add file &&
	test_tick &&
	git commit -m upstream &&
	git clone . super &&
	git clone super submodule &&
	(
		cd submodule &&
		git submodule add ../submodule sub-submodule &&
		test_tick &&
		git commit -m "sub-submodule"
	) &&
	(
		cd super &&
		git submodule add ../submodule submodule &&
		test_tick &&
		git commit -m "submodule"
	) &&
	git clone super super-clone &&
	(
		cd super-clone &&
		git submodule update --init --recursive
	) &&
	git clone super empty-clone &&
	(
		cd empty-clone &&
		git submodule init
	) &&
	git clone super top-only-clone &&
	git clone super relative-clone &&
	(
		cd relative-clone &&
		git submodule update --init --recursive
	) &&
	git clone super recursive-clone &&
	(
		cd recursive-clone &&
		git submodule update --init --recursive
	)

[master (root-commit) 0c90624] upstream
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
Cloning into 'super'...
fatal: Not a git repository: 'sm1/.git'
done.
ok 13 - typechanged submodule(submodule->blob)

Cloning into 'submodule'...
Cloning into 'realsubmod'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7401-submodule-summary/sm1/.git/
done.
done.
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
expecting success: 
	git submodule summary >actual &&
	cat >expected <<-EOF &&
* sm1 41fbea9...6858906:
  Warn: sm1 doesn't contain commit 41fbea99b81568012be3e9bcc31431971c1e5bc5

EOF
	test_i18ncmp actual expected

Cloning into 'sub-submodule'...
Cloning into 'sub1'...
done.
done.
ok 14 - nonexistent commit

expecting success: 
	git submodule summary >actual &&
	cat >expected <<-EOF &&
* sm1 9da5fb8(blob)->6858906(submodule) (2):
  > Add foo7

EOF
	test_i18ncmp expected actual

Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
[master 5a446ba] sub-submodule
 Author: A U Thor <author@example.com>
 2 files changed, 4 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 sub-submodule
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
error: Untracked working tree file 'sub1/file1' would be overwritten by merge.
fatal: Could not reset index file to revision 'replace_sub1_with_directory'.
ok 15 - typechanged submodule(blob->submodule)

ok 8 - git reset --keep: 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
		)
	
expecting success: 
	git submodule summary >actual &&
	cat >expected <<-EOF &&
* sm1 6858906...0000000:

EOF
	test_cmp expected actual

Cloning into 'submodule'...
ok 14 - submodule add with /.. in path

expecting success: 
	echo "refs/heads/master" >expect &&
	>empty &&

	(
		cd addtest &&
		git submodule add "$submodurl" dot/dotslashsubmod/./../..////realsubmod2/a/b/c/d/../../../../frotz//.. &&
		git submodule init
	) &&

	rm -f heads head untracked &&
	inspect addtest/realsubmod2 ../.. &&
	test_cmp expect heads &&
	test_cmp expect head &&
	test_cmp empty untracked

done.
Cloning into 'submodule_update'...
fatal: Not a git repository: 'sm1/.git'
done.
ok 16 - deleted submodule

Cloning into 'realsubmod2'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7401-submodule-summary/sm2/.git/
[master 78df3af] submodule
 Author: A U Thor <author@example.com>
 2 files changed, 4 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 submodule
Cloning into 'super-clone'...
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
done.
done.
expecting success: 
	git submodule summary >actual &&
	cat >expected <<-EOF &&
* sm1 6858906...0000000:

* sm2 0000000...fa9eeaf (2):
  > Add foo9

EOF
	test_cmp expected actual

Submodule 'submodule' (/«PKGBUILDDIR»/t/trash directory.t7403-submodule-sync/submodule) registered for path 'submodule'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
fatal: Not a git repository: 'sm1/.git'
ok 17 - multiple submodules

expecting success: 
	git submodule summary sm2 >actual &&
	cat >expected <<-EOF &&
* sm2 0000000...fa9eeaf (2):
  > Add foo9

EOF
	test_cmp expected actual

Cloning into 'submodule'...
Cloning into 'sub1'...
done.
done.
Submodule path 'submodule': checked out '5a446ba52b7cd49fd2fdd854f363e71780faa9a8'
ok 18 - path filter

Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
expecting success: 
	git submodule summary HEAD^ >actual &&
	cat >expected <<-EOF &&
* sm1 6858906...0000000:

* sm2 0000000...fa9eeaf (2):
  > Add foo9

EOF
	test_cmp expected actual

Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
ok 15 - submodule add with ./, /.. and // in path

expecting success: 
	echo "refs/heads/master" >expect &&
	>empty &&

	mkdir addtest/sub &&
	(
		cd addtest/sub &&
		git submodule add "$submodurl" ../realsubmod3 &&
		git submodule init
	) &&

	rm -f heads head untracked &&
	inspect addtest/realsubmod3 ../.. &&
	test_cmp expect heads &&
	test_cmp expect head &&
	test_cmp empty untracked

Submodule 'sub-submodule' (/«PKGBUILDDIR»/t/trash directory.t7403-submodule-sync/submodule) registered for path 'sub-submodule'
error: Untracked working tree file 'sub1/file1' would be overwritten by merge.
fatal: Could not reset index file to revision 'replace_sub1_with_directory'.
fatal: Not a git repository: 'sm1/.git'
Cloning into 'realsubmod3'...
Cloning into 'sub-submodule'...
done.
ok 19 - given commit

expecting success: 
	git submodule summary --for-status HEAD^ >actual &&
	test_i18ncmp actual - <<EOF
* sm1 6858906...0000000:

* sm2 0000000...fa9eeaf (2):
  > Add foo9

EOF

done.
ok 9 - git reset --keep: 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
		)
	
Submodule path 'submodule/sub-submodule': checked out '0c90624ab7f1aaa301d3bb79f60dcfed1ec4897f'
No submodule mapping found in .gitmodules for path 'sm2'
Cloning into 'submodule_update'...
Cloning into 'empty-clone'...
fatal: Not a git repository: 'sm1/.git'
done.
done.
ok 20 - --for-status

expecting success: 
	test_must_fail git submodule summary --files --cached

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
The --cached option cannot be used with the --files option
ok 21 - fail when using --files together with --cached

expecting success: 
	git init xyzzy &&
	cd xyzzy &&
	git submodule summary >output 2>&1 &&
	test_cmp output /dev/null

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7401-submodule-summary/xyzzy/.git/
Submodule 'submodule' (/«PKGBUILDDIR»/t/trash directory.t7403-submodule-sync/submodule) registered for path 'submodule'
Cloning into 'top-only-clone'...
done.
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'relative-clone'...
ok 22 - should not fail in an empty repo

done.
# passed all 22 test(s)
1..22
ok 16 - submodule add in subdirectory

expecting success: 
	(
		cd addtest/sub &&
		test_must_fail git submodule add ../../ submod3 2>../../output.err
	) &&
	test_i18ngrep toplevel output.err

*** t7405-submodule-merge.sh ***
Cloning into 'sub1'...
done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7405-submodule-merge/.git/
expecting success: 

	mkdir sub &&
	(cd sub &&
	 git init &&
	 echo original > file &&
	 git add file &&
	 test_tick &&
	 git commit -m sub-root) &&
	git add sub &&
	test_tick &&
	git commit -m root &&

	git checkout -b a master &&
	(cd sub &&
	 echo A > file &&
	 git add file &&
	 test_tick &&
	 git commit -m sub-a) &&
	git add sub &&
	test_tick &&
	git commit -m a &&

	git checkout -b b master &&
	(cd sub &&
	 echo B > file &&
	 git add file &&
	 test_tick &&
	 git commit -m sub-b) &&
	git add sub &&
	test_tick &&
	git commit -m b &&

	git checkout -b c a &&
	git merge -s ours b &&

	git checkout -b d b &&
	git merge -s ours a

Relative path can only be used from the toplevel of the working tree
ok 17 - submodule add in subdirectory with relative path should fail

expecting success: 
	git config --file=.gitmodules submodule.example.url git://example.com/init.git

ok 18 - setup - add an example entry to .gitmodules

expecting success: 
	test_must_fail git submodule status

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7405-submodule-merge/sub/.git/
Submodule 'submodule' (/«PKGBUILDDIR»/t/trash directory.t7403-submodule-sync/submodule) registered for path 'submodule'
[master (root-commit) 0998b33] sub-root
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
[master (root-commit) 5c9ada4] root
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 160000 sub
Switched to a new branch 'a'
No submodule mapping found in .gitmodules for path 'init'
ok 19 - status should fail for unmapped paths

expecting success: 
	cat <<\EOF >expect &&
[submodule "example"]
	url = git://example.com/init.git
	path = init
EOF

	git config --file=.gitmodules submodule.example.path init &&

	test_cmp expect .gitmodules

Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
[master d98dfef] sub-a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'submodule'...
test_must_fail: command succeeded: git reset --keep replace_sub1_with_file
ok 20 - setup - map path in .gitmodules

expecting success: 
	git submodule status >lines &&
	test_line_count = 1 lines

done.
[a 6102a2a] a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
not ok 10 - git reset --keep: 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
		)
	
Switched to a new branch 'b'
M	sub
[master ce35c37] sub-b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[b 0405d8c] b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'c'
M	sub
Cloning into 'submodule_update'...
ok 21 - status should only print one line

expecting success: 
	rev1=$(cd .subrepo && git rev-parse HEAD) &&
	printf "rev1: %s\n" "$rev1" &&
	test -n "$rev1"

Submodule path 'submodule': checked out '5a446ba52b7cd49fd2fdd854f363e71780faa9a8'
Merge made by the 'ours' strategy.
rev1: 0afb3c48f38b7a6da94516a99749b40ea629ebec
ok 22 - setup - fetch commit name from submodule

expecting success: 
	git submodule status >lines &&
	grep "^-$rev1" lines

done.
Switched to a new branch 'd'
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Merge made by the 'ours' strategy.
ok 1 - setup

expecting success: 
	mkdir merge-search &&
	(cd merge-search &&
	git init &&
	mkdir sub &&
	(cd sub &&
	 git init &&
	 echo "file-a" > file-a &&
	 git add file-a &&
	 git commit -m "sub-a" &&
	 git branch sub-a) &&
	git commit --allow-empty -m init &&
	git branch init &&
	git add sub &&
	git commit -m "a" &&
	git branch a &&

	git checkout -b b &&
	(cd sub &&
	 git checkout -b sub-b &&
	 echo "file-b" > file-b &&
	 git add file-b &&
	 git commit -m "sub-b") &&
	git commit -a -m "b" &&

	git checkout -b c a &&
	(cd sub &&
	 git checkout -b sub-c sub-a &&
	 echo "file-c" > file-c &&
	 git add file-c &&
	 git commit -m "sub-c") &&
	git commit -a -m "c" &&

	git checkout -b d a &&
	(cd sub &&
	 git checkout -b sub-d sub-b &&
	 git merge sub-c) &&
	git commit -a -m "d" &&
	git branch test b &&

	git checkout -b g init &&
	(cd sub &&
	 git checkout -b sub-g sub-c) &&
	git add sub &&
	git commit -a -m "g")

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7405-submodule-merge/merge-search/.git/
Submodule 'sub-submodule' (/«PKGBUILDDIR»/t/trash directory.t7403-submodule-sync/submodule) registered for path 'sub-submodule'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7405-submodule-merge/merge-search/sub/.git/
-0afb3c48f38b7a6da94516a99749b40ea629ebec init
ok 23 - status should initially be "missing"

expecting success: 
	echo git://example.com/init.git >expect &&

	git submodule init &&
	git config submodule.example.url >url &&
	git config submodule.example.url ./.subrepo &&

	test_cmp expect url

[master (root-commit) 9c64145] sub-a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file-a
[master (root-commit) edb5fba] init
 Author: A U Thor <author@example.com>
Cloning into 'sub-submodule'...
done.
[master ea59e10] a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 160000 sub
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
Switched to a new branch 'b'
Submodule 'example' (git://example.com/init.git) registered for path 'init'
Switched to a new branch 'sub-b'
ok 24 - init should register submodule url in .git/config

expecting success: 
	test_failure_with_unknown_submodule init

[sub-b 1e4c5d4] sub-b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file-b
[b 65d3c25] b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'sub1'...
Submodule path 'submodule/sub-submodule': checked out '0c90624ab7f1aaa301d3bb79f60dcfed1ec4897f'
Switched to a new branch 'c'
M	sub
Switched to a new branch 'sub-c'
done.
error: pathspec 'no-such-submodule' did not match any file(s) known to git.
ok 25 - init should fail with unknown submodule

expecting success: 
	test_failure_with_unknown_submodule update

[sub-c 18cac7c] sub-c
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file-c
Cloning into 'recursive-clone'...
[c 00fd913] c
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
done.
Switched to a new branch 'd'
M	sub
Switched to a new branch 'sub-d'
Merging:
1e4c5d4 sub-b
virtual sub-c
found 1 common ancestor:
9c64145 sub-a
Merge made by the 'recursive' strategy.
 file-c | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 file-c
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
error: pathspec 'no-such-submodule' did not match any file(s) known to git.
ok 26 - update should fail with unknown submodule

expecting success: 
	test_failure_with_unknown_submodule status

[d 40eded3] d
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
warning: unable to rmdir sub: Directory not empty
Switched to a new branch 'g'
Switched to a new branch 'sub-g'
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
[g 61ce3a9] g
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 160000 sub
ok 2 - setup for merge search

expecting success: 
	(cd merge-search &&
	 git checkout -b test-forward b &&
	 git merge d &&
	 git ls-tree test-forward sub | cut -f1 | cut -f3 -d" " > actual &&
	 (cd sub &&
	  git rev-parse sub-d > ../expect) &&
	 test_cmp actual expect)

error: pathspec 'no-such-submodule' did not match any file(s) known to git.
ok 27 - status should fail with unknown submodule

expecting success: 
	test_failure_with_unknown_submodule sync

Switched to a new branch 'test-forward'
Submodule 'submodule' (/«PKGBUILDDIR»/t/trash directory.t7403-submodule-sync/submodule) registered for path 'submodule'
M	sub
Merging:
65d3c25 b
virtual d
found 1 common ancestor:
ea59e10 a
Auto-merging sub
Merge made by the 'recursive' strategy.
 sub | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 3 - merge with one side as a fast-forward of the other

expecting success: 
	(cd merge-search &&
	 git checkout -b test-nonforward b &&
	 (cd sub &&
	  git rev-parse sub-d > ../expect) &&
	 test_must_fail git merge c 2> actual  &&
	 grep $(cat expect) actual > /dev/null &&
	 git reset --hard)

test_must_fail: command succeeded: git reset --keep replace_sub1_with_file
Switched to a new branch 'test-nonforward'
M	sub
not ok 11 - git reset --keep: 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
		)
	
error: pathspec 'no-such-submodule' did not match any file(s) known to git.
ok 28 - sync should fail with unknown submodule

expecting success: 
	echo hello >expect &&

	echo "hello" >init &&
	test_must_fail git submodule update &&

	test_cmp expect init

Merging:
65d3c25 b
virtual c
found 1 common ancestor:
ea59e10 a
Auto-merging sub
CONFLICT (submodule): Merge conflict in sub
Automatic merge failed; fix conflicts and then commit the result.
Cloning into 'submodule'...
HEAD is now at 65d3c25 b
ok 4 - merging should conflict for non fast-forward

expecting success: 
	(cd merge-search &&
	git checkout -b test-ambiguous b &&
	(cd sub &&
	 git checkout -b ambiguous sub-b &&
	 git merge sub-c &&
	 git rev-parse sub-d > ../expect1 &&
	 git rev-parse ambiguous > ../expect2) &&
	test_must_fail git merge c 2> actual &&
	grep $(cat expect1) actual > /dev/null &&
	grep $(cat expect2) actual > /dev/null &&
	git reset --hard)

done.
Switched to a new branch 'test-ambiguous'
M	sub
Switched to a new branch 'ambiguous'
Cloning into 'submodule_update'...
Merging:
1e4c5d4 sub-b
virtual sub-c
found 1 common ancestor:
9c64145 sub-a
Merge made by the 'recursive' strategy.
 file-c | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 file-c
done.
Merging:
65d3c25 b
virtual c
found 1 common ancestor:
ea59e10 a
Auto-merging sub
CONFLICT (submodule): Merge conflict in sub
Automatic merge failed; fix conflicts and then commit the result.
Submodule path 'submodule': checked out '5a446ba52b7cd49fd2fdd854f363e71780faa9a8'
fatal: destination path 'init' already exists and is not an empty directory.
Clone of './.subrepo' into submodule path 'init' failed
HEAD is now at 65d3c25 b
ok 5 - merging should fail for ambiguous common parent

ok 29 - update should fail when path is used by a file

expecting success: 
	(cd merge-search &&
	git checkout -b bb a &&
	(cd sub &&
	 git checkout sub-b) &&
	git commit -a -m "bb" &&

	git checkout -b e bb &&
	(cd sub &&
	 git checkout sub-a) &&
	git commit -a -m "e" &&

	git checkout -b f bb &&
	(cd sub &&
	 git checkout sub-d) &&
	git commit -a -m "f" &&

	git checkout -b test-backward e &&
	test_must_fail git merge f)

expecting success: 
	echo hello >expect &&

	rm -fr init &&
	mkdir init &&
	echo "hello" >init/a &&

	test_must_fail git submodule update &&

	test_cmp expect init/a

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Switched to a new branch 'bb'
M	sub
Switched to branch 'sub-b'
[bb 41fd2a8] bb
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Submodule 'sub-submodule' (/«PKGBUILDDIR»/t/trash directory.t7403-submodule-sync/submodule) registered for path 'sub-submodule'
Switched to a new branch 'e'
Switched to branch 'sub-a'
[e 49e8960] e
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'f'
M	sub
Switched to branch 'sub-d'
fatal: destination path 'init' already exists and is not an empty directory.
[f ceec2f6] f
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Clone of './.subrepo' into submodule path 'init' failed
ok 30 - update should fail when path is used by a nonempty directory

expecting success: 
	rm -fr init &&
	rm -f head-sha1 &&
	echo "$rev1" >expect &&

	mkdir init &&
	git submodule update -q >update.out &&
	test_must_be_empty update.out &&

	inspect init &&
	test_cmp expect head-sha1

Cloning into 'sub-submodule'...
Switched to a new branch 'test-backward'
M	sub
warning: Failed to merge submodule sub (commits don't follow merge-base)
Merging:
49e8960 e
virtual f
found 1 common ancestor:
41fd2a8 bb
Auto-merging sub
CONFLICT (submodule): Merge conflict in sub
Automatic merge failed; fix conflicts and then commit the result.
ok 6 - merging should fail for changes that are backwards

expecting success: 
       (cd merge-search &&
       cat >.gitmodules <<EOF &&
[submodule "sub"]
       path = sub
       url = $TRASH_DIRECTORY/sub
EOF
       cat >expect <<EOF &&
U0000000000000000000000000000000000000000 sub
EOF
       git submodule status > actual &&
       test_cmp expect actual &&
	git reset --hard)

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
done.
Cloning into 'sub1'...
Submodule path 'submodule/sub-submodule': checked out '0c90624ab7f1aaa301d3bb79f60dcfed1ec4897f'
done.
HEAD is now at 49e8960 e
ok 7 - git submodule status should display the merge conflict properly with merge base

expecting success: 
       (cd merge-search &&
	git checkout -b test-no-merge-base g &&
	test_must_fail git merge b &&
       cat >.gitmodules <<EOF &&
[submodule "sub"]
       path = sub
       url = $TRASH_DIRECTORY/sub
EOF
       cat >expect <<EOF &&
U0000000000000000000000000000000000000000 sub
EOF
       git submodule status > actual &&
       test_cmp expect actual &&
       git reset --hard)

Switched to a new branch 'test-no-merge-base'
M	sub
ok 1 - setup

expecting success: 
	(
		cd submodule &&
		echo second line >>file &&
		test_tick &&
		git commit -a -m "change submodule"
	)

Merging:
61ce3a9 g
virtual b
found 1 common ancestor:
edb5fba init
Auto-merging sub
CONFLICT (submodule): Merge conflict in sub
Automatic merge failed; fix conflicts and then commit the result.
[master c61fc01] change submodule
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 2 - change submodule

expecting success: 
	(
		cd super &&
		cd submodule &&
		git checkout master &&
		git pull
	) &&
	mv submodule moved-submodule &&
	(
		cd moved-submodule &&
		git config -f .gitmodules submodule.sub-submodule.url ../moved-submodule &&
		test_tick &&
		git commit -a -m moved-sub-submodule
	) &&
	(
		cd super &&
		git config -f .gitmodules submodule.submodule.url ../moved-submodule &&
		test_tick &&
		git commit -a -m moved-submodule
	)

Already on 'master'
Your branch is up-to-date with 'origin/master'.
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
fatal: ref HEAD is not a symbolic ref
From /«PKGBUILDDIR»/t/trash directory.t7403-submodule-sync/submodule
   5a446ba..c61fc01  master     -> origin/master
Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
ok 31 - update should work when path is an empty dir

expecting success: 
	git submodule status >list &&
	grep "^ $rev1" list

Updating 5a446ba..c61fc01
Fast-forward
HEAD is now at 61ce3a9 g
ok 8 - git submodule status should display the merge conflict properly without merge-base

expecting success: 
	git reset --hard HEAD &&
	git checkout -b test2 c &&
	git merge d

 file | 1 +
 1 file changed, 1 insertion(+)
HEAD is now at f35b3af Merge branch 'a' into d
Switched to a new branch 'test2'
M	sub
Merging:
74288c7 Merge branch 'b' into c
virtual d
found 2 common ancestors:
6102a2a a
0405d8c b
  Merging:
  6102a2a a
  0405d8c b
  found 1 common ancestor:
  5c9ada4 root
  Auto-merging sub
Already up-to-date!
Merge made by the 'recursive' strategy.
[master 9f583c0] moved-sub-submodule
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 9 - merging with a modify/modify conflict between merge bases

expecting success: 
	mkdir merge-recursive &&
	(cd merge-recursive &&
	 git init &&
	 mkdir sub &&
	 (cd sub &&
	  git init &&
	  test_commit a &&
	  git checkout -b sub-b master &&
	  test_commit b &&
	  git checkout -b sub-c master &&
	  test_commit c &&
	  git checkout -b sub-bc sub-b &&
	  git merge sub-c &&
	  git checkout -b sub-cb sub-c &&
	  git merge sub-b &&
	  git checkout master) &&
	 git add sub &&
	 git commit -m a &&
	 git checkout -b top-b master &&
	 (cd sub && git checkout sub-b) &&
	 git add sub &&
	 git commit -m b &&
	 git checkout -b top-c master &&
	 (cd sub && git checkout sub-c) &&
	 git add sub &&
	 git commit -m c &&
	 git checkout -b top-bc top-b &&
	 git merge -s ours --no-commit top-c &&
	 (cd sub && git checkout sub-bc) &&
	 git add sub &&
	 git commit -m bc &&
	 git checkout -b top-cb top-c &&
	 git merge -s ours --no-commit top-b &&
	 (cd sub && git checkout sub-cb) &&
	 git add sub &&
	 git commit -m cb)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7405-submodule-merge/merge-recursive/.git/
[master f2e88dd] moved-submodule
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 2 deletions(-)
ok 3 - change submodule url

expecting success: 
	(
		cd super-clone &&
		git pull --no-recurse-submodules &&
		git submodule sync
	) &&
	test -d "$(
		cd super-clone/submodule &&
		git config remote.origin.url
	)" &&
	test ! -d "$(
		cd super-clone/submodule/sub-submodule &&
		git config remote.origin.url
	)" &&
	(
		cd super-clone/submodule &&
		git checkout master &&
		git pull
	) &&
	(
		cd super-clone &&
		test -d "$(git config submodule.submodule.url)"
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7405-submodule-merge/merge-recursive/sub/.git/
 0afb3c48f38b7a6da94516a99749b40ea629ebec init (rev-1)
ok 32 - status should be "up-to-date" after update

expecting success: 
	mkdir -p sub &&
	(
		cd sub &&
		git submodule status >../list
	) &&
	grep "^ $rev1" list &&
	grep "\\.\\./init" list

[master (root-commit) 9d932ab] a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a.t
Switched to a new branch 'sub-b'
From /«PKGBUILDDIR»/t/trash directory.t7403-submodule-sync/super
   78df3af..f2e88dd  master     -> origin/master
[sub-b 8b32189] b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 b.t
Updating 78df3af..f2e88dd
Fast-forward
 .gitmodules | 2 +-
 submodule   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Switched to a new branch 'sub-c'
[sub-c 7d3d4d8] c
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c.t
Submodule path 'sub1': checked out '6bb2c777177005d6a4fc429e4e7f5b28e83e1e0c'
Switched to a new branch 'sub-bc'
 0afb3c48f38b7a6da94516a99749b40ea629ebec ../init (rev-1)
 0afb3c48f38b7a6da94516a99749b40ea629ebec ../init (rev-1)
ok 33 - status "up-to-date" from subdirectory

expecting success: 
	mkdir -p sub &&
	(
		cd sub &&
		git submodule status ../init >../list
	) &&
	grep "^ $rev1" list &&
	grep "\\.\\./init" list

Merging:
8b32189 b
virtual sub-c
found 1 common ancestor:
9d932ab a
Merge made by the 'recursive' strategy.
 c.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 c.t
Switched to a new branch 'sub-cb'
ok 12 - git reset --keep: 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
		)
	
Merging:
7d3d4d8 c
virtual sub-b
found 1 common ancestor:
9d932ab a
Merge made by the 'recursive' strategy.
 b.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 b.t
Switched to branch 'master'
Synchronizing submodule url for 'submodule'
[master (root-commit) a2ff72f] a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 160000 sub
Cloning into 'submodule_update'...
Switched to a new branch 'top-b'
Switched to branch 'sub-b'
 0afb3c48f38b7a6da94516a99749b40ea629ebec ../init (rev-1)
 0afb3c48f38b7a6da94516a99749b40ea629ebec ../init (rev-1)
ok 34 - status "up-to-date" from subdirectory with path

expecting success: 
	(
		cd init &&
		echo b >b &&
		git add b &&
		git commit -m "submodule commit 2"
	) &&

	rev2=$(cd init && git rev-parse HEAD) &&
	test -n "$rev2" &&
	git submodule status >list &&

	grep "^+$rev2" list

done.
[top-b f6b4d5a] b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'top-c'
M	sub
Switched to branch 'master'
[detached HEAD 29946c1] submodule commit 2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 b
Your branch is up-to-date with 'origin/master'.
Switched to branch 'sub-c'
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
[top-c 4d9cfab] c
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'top-bc'
M	sub
From /«PKGBUILDDIR»/t/trash directory.t7403-submodule-sync/moved-submodule
   5a446ba..9f583c0  master     -> origin/master
Automatic merge went well; stopped before committing as requested
Switched to branch 'sub-bc'
Updating 5a446ba..9f583c0
Fast-forward
 .gitmodules | 2 +-
 file        | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
ok 4 - "git submodule sync" should update submodule URLs

expecting success: 
	(
		cd super-clone &&
		(
			cd submodule &&
			git pull --no-recurse-submodules
		) &&
		git submodule sync --recursive
	) &&
	test -d "$(
		cd super-clone/submodule &&
		git config remote.origin.url
	)" &&
	test -d "$(
		cd super-clone/submodule/sub-submodule &&
		git config remote.origin.url
	)" &&
	(
		cd super-clone/submodule/sub-submodule &&
		git checkout master &&
		git pull
	)

[top-bc ff9bd9b] bc
 Author: A U Thor <author@example.com>
Switched to a new branch 'top-cb'
M	sub
+29946c14a4b668bfe27872486abf091b9a4c0a26 init (rev-1-1-g29946c1)
ok 35 - status should be "modified" after submodule commit

expecting success: 
	git submodule --cached status >list &&
	grep "^+$rev1" list

Automatic merge went well; stopped before committing as requested
Switched to branch 'sub-cb'
Already up-to-date.
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
[top-cb a0ac63b] cb
 Author: A U Thor <author@example.com>
ok 10 - setup for recursive merge with submodule

expecting success: 
	(cd merge-recursive &&
	 test_must_fail git merge top-bc &&
	 echo "160000 $(git rev-parse top-cb:sub) 2	sub" > expect2 &&
	 echo "160000 $(git rev-parse top-bc:sub) 3	sub" > expect3 &&
	 git ls-files -u > actual &&
	 grep "$(cat expect2)" actual > /dev/null &&
	 grep "$(cat expect3)" actual > /dev/null)

warning: Failed to merge submodule sub (merge following commits not found)
Merging:
a0ac63b cb
virtual top-bc
found 2 common ancestors:
f6b4d5a b
4d9cfab c
  Merging:
  f6b4d5a b
  4d9cfab c
  found 1 common ancestor:
  a2ff72f a
  Auto-merging sub
  CONFLICT (submodule): Merge conflict in sub
Auto-merging sub
CONFLICT (submodule): Merge conflict in sub
Automatic merge failed; fix conflicts and then commit the result.
+0afb3c48f38b7a6da94516a99749b40ea629ebec init (rev-1)
ok 36 - the --cached sha1 should be rev1

expecting success: 
	git diff >diff &&
	grep "^+Subproject commit $rev2" diff

Cloning into 'sub1'...
ok 11 - recursive merge with submodule

# passed all 11 test(s)
1..11
+Subproject commit 29946c14a4b668bfe27872486abf091b9a4c0a26
ok 37 - git diff should report the SHA1 of the new submodule commit

expecting success: 
	rm -f head-sha1 &&
	echo "$rev1" >expect &&

	git submodule update init &&
	inspect init &&

	test_cmp expect head-sha1

done.
Synchronizing submodule url for 'submodule'
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
*** t7406-submodule-update.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7406-submodule-update/.git/
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
expecting success: 
	echo file > file &&
	git add file &&
	test_tick &&
	git commit -m upstream &&
	git clone . super &&
	git clone super submodule &&
	git clone super rebasing &&
	git clone super merging &&
	git clone super none &&
	(cd super &&
	 git submodule add ../submodule submodule &&
	 test_tick &&
	 git commit -m "submodule" &&
	 git submodule init submodule
	) &&
	(cd submodule &&
	echo "line2" > file &&
	git add file &&
	git commit -m "Commit 2"
	) &&
	(cd super &&
	 (cd submodule &&
	  git pull --rebase origin
	 ) &&
	 git add submodule &&
	 git commit -m "submodule update"
	) &&
	(cd super &&
	 git submodule add ../rebasing rebasing &&
	 test_tick &&
	 git commit -m "rebasing"
	) &&
	(cd super &&
	 git submodule add ../merging merging &&
	 test_tick &&
	 git commit -m "rebasing"
	) &&
	(cd super &&
	 git submodule add ../none none &&
	 test_tick &&
	 git commit -m "none"
	)

Submodule path 'init': checked out '0afb3c48f38b7a6da94516a99749b40ea629ebec'
Synchronizing submodule url for 'submodule/sub-submodule'
fatal: ref HEAD is not a symbolic ref
[master (root-commit) 0c90624] upstream
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
Cloning into 'super'...
done.
ok 38 - update should checkout rev1

expecting success: 
	git submodule status >list &&
	grep "^ $rev1" list

Cloning into 'submodule'...
done.
Previous HEAD position was 0c90624... upstream
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
Cloning into 'rebasing'...
done.
Cloning into 'merging'...
done.
 0afb3c48f38b7a6da94516a99749b40ea629ebec init (rev-1)
ok 39 - status should be "up-to-date" after update

expecting success: 
	git checkout initial &&
	git checkout master

Cloning into 'none'...
From /«PKGBUILDDIR»/t/trash directory.t7403-submodule-sync/moved-submodule
   5a446ba..9f583c0  master     -> origin/master
warning: unable to rmdir init: Directory not empty
Switched to branch 'initial'
done.
Updating 5a446ba..9f583c0
Fast-forward
 .gitmodules | 2 +-
 file        | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
ok 5 - "git submodule sync --recursive" should update all submodule URLs

expecting success: 
	reset_submodule_urls super-clone

Switched to branch 'master'
ok 40 - checkout superproject with subproject already present

expecting success: 
	>empty &&

	git branch second &&
	(
		cd init &&
		echo s >s &&
		git add s &&
		git commit -m "change subproject"
	) &&
	git update-index --add init &&
	git commit -m "change init" &&
	git format-patch -1 --stdout >P.diff &&
	git checkout second &&
	git apply --index P.diff &&

	git diff --cached master >staged &&
	test_cmp empty staged

ok 6 - reset submodule URLs

expecting success: 
	(
		cd super-clone &&
		git pull --no-recurse-submodules &&
		mkdir -p sub &&
		cd sub &&
		git submodule sync >../../output
	) &&
	grep "\\.\\./submodule" output &&
	test -d "$(
		cd super-clone/submodule &&
		git config remote.origin.url
	)" &&
	test ! -d "$(
		cd super-clone/submodule/sub-submodule &&
		git config remote.origin.url
	)" &&
	(
		cd super-clone/submodule &&
		git checkout master &&
		git pull
	) &&
	(
		cd super-clone &&
		test -d "$(git config submodule.submodule.url)"
	)

[detached HEAD 9cdca94] change subproject
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 s
fatal: reference is not a tree: 0123456789012345678901234567890123456789
Unable to checkout '0123456789012345678901234567890123456789' in submodule path 'sub1'
[master 04e0fe1] change init
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Already up-to-date.
Switched to branch 'second'
M	init
warning: unable to rmdir init: Directory not empty
ok 13 - git reset --keep: 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
		)
	
Cloning into 'submodule'...
ok 41 - apply submodule diff

expecting success: 
	mv init init2 &&
	git config -f .gitmodules submodule.example.url "$(pwd)/init2" &&
	git config --remove-section submodule.example &&
	test_must_fail git config submodule.example.url &&

	git submodule update init > update.out &&
	cat update.out &&
	test_i18ngrep "not initialized" update.out &&
	test_must_fail git rev-parse --resolve-git-dir init/.git &&

	git submodule update --init init &&
	git rev-parse --resolve-git-dir init/.git

done.
Cloning into 'submodule_update'...
done.
[master 3ae95bc] submodule
 Author: A U Thor <author@example.com>
 2 files changed, 4 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 submodule
Switched to a new branch 'invalid_sub1'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
Synchronizing submodule url for '../submodule'
Submodule path 'init' not initialized
Maybe you want to use 'update --init'?
Submodule path 'init' not initialized
fatal: not a gitdir 'init/.git'
fatal: Needed a single revision
Already on 'master'
M	sub-submodule
Your branch is up-to-date with 'origin/master'.
Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
Already up-to-date.
ok 7 - "git submodule sync" should update submodule URLs - subdirectory

expecting success: 
	(
		cd super-clone &&
		(
			cd submodule &&
			git pull --no-recurse-submodules
		) &&
		mkdir -p sub &&
		cd sub &&
		git submodule sync --recursive >../../output
	) &&
	grep "\\.\\./submodule/sub-submodule" output &&
	test -d "$(
		cd super-clone/submodule &&
		git config remote.origin.url
	)" &&
	test -d "$(
		cd super-clone/submodule/sub-submodule &&
		git config remote.origin.url
	)" &&
	(
		cd super-clone/submodule/sub-submodule &&
		git checkout master &&
		git pull
	)

[master 4301fd3] Commit 2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Submodule 'example' (/«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/init2) registered for path 'init'
Already up-to-date.
From /«PKGBUILDDIR»/t/trash directory.t7406-submodule-update/submodule
   0c90624..4301fd3  master     -> origin/master
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'sub1'...
Submodule path 'init': checked out '9cdca946443630ae615e1ddfe6174e89fea53615'
/«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/.git/modules/example
ok 42 - update --init

expecting success: 
	mv init init2 &&
	git config -f .gitmodules submodule.example.url "$(pwd)/init2" &&
	git config --remove-section submodule.example &&
	test_must_fail git config submodule.example.url &&

	mkdir -p sub &&
	(
		cd sub &&
		git submodule update ../init >update.out &&
		cat update.out &&
		test_i18ngrep "not initialized" update.out &&
		test_must_fail git rev-parse --resolve-git-dir ../init/.git &&

		git submodule update --init ../init
	) &&
	git rev-parse --resolve-git-dir init/.git

done.
First, rewinding head to replay your work on top of it...
Fast-forwarded master to 4301fd3e4110d3b6212c19aed3094150392545b9.
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
[master fed7cea] submodule update
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Submodule path '../init' not initialized
Maybe you want to use 'update --init'?
Submodule path '../init' not initialized
fatal: not a gitdir '../init/.git'
ok 14 - git reset --keep: 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
		)
	
Submodule 'example' (/«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/init2) registered for path '../init'
Cloning into 'rebasing'...
Synchronizing submodule url for '../submodule/sub-submodule'
done.
Cloning into 'submodule_update'...
Already on 'master'
Your branch is up-to-date with 'origin/master'.
done.
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Already up-to-date.
ok 8 - "git submodule sync --recursive" should update all submodule URLs - subdirectory

expecting success: 
	(
		cd empty-clone &&
		git pull &&
		git submodule sync &&
		test -d "$(git config submodule.submodule.url)"
	)

Branch add_sub1 set up to track remote branch add_sub1 from origin.
Submodule path '../init': checked out '9cdca946443630ae615e1ddfe6174e89fea53615'
/«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/.git/modules/example
[master 5366fa1] rebasing
 Author: A U Thor <author@example.com>
 2 files changed, 4 insertions(+)
 create mode 160000 rebasing
ok 43 - update --init from subdirectory

expecting success: 

	git reset --hard &&
	test_must_fail git add init/a


HEAD is now at f42a4b4 super commit 1
fatal: Pathspec 'init/a' is in submodule 'init'
ok 44 - do not add files from a submodule

expecting success: 

	git reset --hard &&
	git commit -m "commit subproject" init &&
	(cd init &&
	 echo b > a) &&
	git add init/ &&
	git diff --exit-code --cached init &&
	commit=$(cd init &&
	 git commit -m update a >/dev/null &&
	 git rev-parse HEAD) &&
	git add init/ &&
	test_must_fail git diff --exit-code --cached init &&
	test $commit = $(git ls-files --stage |
		sed -n "s/^160000 \([^ ]*\).*/\1/p") &&
	git reset init/ &&
	git diff --exit-code --cached init


From /«PKGBUILDDIR»/t/trash directory.t7403-submodule-sync/super
   78df3af..f2e88dd  master     -> origin/master
HEAD is now at f42a4b4 super commit 1
Updating 78df3af..f2e88dd
Fast-forward
[second 5f47375] commit subproject
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
 .gitmodules | 2 +-
 submodule   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Cloning into 'merging'...
diff --git a/init b/init
index 9cdca94..ba0477b 160000
--- a/init
+++ b/init
@@ -1 +1 @@
-Subproject commit 9cdca946443630ae615e1ddfe6174e89fea53615
+Subproject commit ba0477b3a92611ecd7e3d7526eea3b1f6ebfe802
done.
Unstaged changes after reset:
M	init
ok 45 - gracefully add/reset submodule with a trailing slash

expecting success: 

	test "init" = "$(git ls-files init/)"


Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 46 - ls-files gracefully handles trailing slash

expecting success: 
	rm -rf init &&
	mkdir init &&
	git reset --hard &&
	git checkout initial &&
	test ! -d init &&
	git checkout second

HEAD is now at 5f47375 commit subproject
Switched to branch 'initial'
Synchronizing submodule url for 'submodule'
Switched to branch 'second'
ok 47 - moving to a commit without submodule does not leave empty dir

expecting success: 
	test_must_fail git submodule no-such-subcommand

ok 9 - "git submodule sync" should update known submodule URLs

expecting success: 
	(
		cd top-only-clone &&
		git pull &&
		git submodule sync &&
		test -z "$(git config submodule.submodule.url)" &&
		git submodule sync submodule &&
		test -z "$(git config submodule.submodule.url)"
	)

Cloning into 'sub1'...
[master 7cb8417] rebasing
 Author: A U Thor <author@example.com>
 2 files changed, 4 insertions(+)
 create mode 160000 merging
done.
usage: git submodule [--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [--] <repository> [<path>]
   or: git submodule [--quiet] status [--cached] [--recursive] [--] [<path>...]
   or: git submodule [--quiet] init [--] [<path>...]
   or: git submodule [--quiet] deinit [-f|--force] [--] <path>...
   or: git submodule [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--reference <repository>] [--recursive] [--] [<path>...]
   or: git submodule [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]
   or: git submodule [--quiet] foreach [--recursive] <command>
   or: git submodule [--quiet] sync [--recursive] [--] [<path>...]
ok 48 - submodule <invalid-subcommand> fails

expecting success: 
	mkdir repo &&
	(
		cd repo &&
		git init &&
		echo r >r &&
		git add r &&
		git commit -m "repo commit 1"
	) &&
	git clone --bare repo/ bare.git &&
	(
		cd addtest &&
		git submodule add "$submodurl/repo" &&
		git config -f .gitmodules submodule.repo.path repo &&
		git submodule add "$submodurl/bare.git" &&
		git config -f .gitmodules submodule.bare.path bare
	)

From /«PKGBUILDDIR»/t/trash directory.t7403-submodule-sync/super
   78df3af..f2e88dd  master     -> origin/master
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/repo/.git/
Updating 78df3af..f2e88dd
Fast-forward
 .gitmodules | 2 +-
 submodule   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
[master (root-commit) 69ce787] repo commit 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 r
Cloning into bare repository 'bare.git'...
Cloning into 'none'...
done.
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
done.
ok 15 - git reset --merge: 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
		)
	
Cloning into 'repo'...
done.
[master e1c6586] none
 Author: A U Thor <author@example.com>
 2 files changed, 4 insertions(+)
 create mode 160000 none
ok 1 - setup a submodule tree

expecting success: 
	(cd super/submodule &&
	 git reset --hard HEAD~1
	) &&
	(cd super &&
	 (cd submodule &&
	  compare_head
	 ) &&
	 git submodule update submodule &&
	 cd submodule &&
	 ! compare_head
	)

HEAD is now at 0c90624 upstream
Cloning into 'submodule_update'...
done.
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
ok 10 - "git submodule sync" should not vivify uninteresting submodule

expecting success: 
	(
		cd relative-clone &&
		git remote set-url origin foo &&
		git submodule sync &&
		(
			cd submodule &&
			#actual fails with: "cannot strip off url foo
			test "$(git config remote.origin.url)" = "../submodule"
		)
	)

Branch add_sub1 set up to track remote branch add_sub1 from origin.
Cloning into 'bare'...
Submodule path 'submodule': checked out '4301fd3e4110d3b6212c19aed3094150392545b9'
done.
ok 2 - submodule update detaching the HEAD 

expecting success: 
	(cd super/submodule &&
	 git reset --hard HEAD~1
	) &&
	mkdir super/sub &&
	(cd super/sub &&
	 (cd ../submodule &&
	  compare_head
	 ) &&
	 git submodule update ../submodule &&
	 cd ../submodule &&
	 ! compare_head
	)

HEAD is now at 0c90624 upstream
Synchronizing submodule url for 'submodule'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 49 - add submodules without specifying an explicit path

expecting success: 
	(
		cd addtest &&
		touch file &&
		test_must_fail	git submodule add "$submodurl/repo" file
	)

ok 11 - "git submodule sync" handles origin URL of the form foo

expecting success: 
	(
		cd relative-clone &&
		git remote set-url origin foo/bar &&
		git submodule sync &&
		(
			cd submodule &&
			#actual foo/submodule
			test "$(git config remote.origin.url)" = "../foo/submodule"
		) &&
		(
			cd submodule/sub-submodule &&
			test "$(git config remote.origin.url)" != "../../foo/submodule"
		)
	)

Cloning into 'sub1'...
'file' already exists and is not a valid git repo
ok 50 - add should fail when path is used by a file

expecting success: 
	(
		cd addtest &&
		mkdir empty-dir &&
		test_must_fail git submodule add "$submodurl/repo" empty-dir
	)

done.
Submodule path '../submodule': checked out '4301fd3e4110d3b6212c19aed3094150392545b9'
ok 3 - submodule update from subdirectory

expecting success: 
	(cd submodule &&
	  echo line3 >> file &&
	  git add file &&
	  test_tick &&
	  git commit -m "upstream line3"
	) &&
	(cd super/submodule &&
	  head=$(git rev-parse --verify HEAD) &&
	  echo "Submodule path ${apos}submodule$apos: checked out $apos$head$apos" > ../../expected &&
	  git reset --hard HEAD~1
	) &&
	(cd super &&
	  git submodule update > ../actual 2> ../actual.err
	) &&
	test_i18ncmp expected actual &&
	! test -s actual.err

[master 820877d] upstream line3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
HEAD is now at 0c90624 upstream
Synchronizing submodule url for 'submodule'
'empty-dir' already exists and is not a valid git repo
ok 51 - add should fail when path is used by an existing directory

expecting success: 
	(
		cd addtest &&
		git submodule add ../repo relative &&
		test "$(git config -f .gitmodules submodule.relative.url)" = ../repo &&
		git submodule sync relative &&
		test "$(git config submodule.relative.url)" = "$submodurl/repo"
	)

Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
ok 12 - "git submodule sync" handles origin URL of the form foo/bar

expecting success: 
	(
		cd recursive-clone &&
		git remote set-url origin foo/bar &&
		git submodule sync --recursive &&
		(
			cd submodule &&
			#actual foo/submodule
			test "$(git config remote.origin.url)" = "../foo/submodule"
		) &&
		(
			cd submodule/sub-submodule &&
			test "$(git config remote.origin.url)" = "../../foo/submodule"
		)
	)

ok 16 - git reset --merge: 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
		)
	
Cloning into 'relative'...
done.
Cloning into 'submodule_update'...
Synchronizing submodule url for 'submodule'
done.
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Branch add_sub1 set up to track remote branch add_sub1 from origin.
error: Untracked working tree file 'sub1' would be overwritten by merge.
fatal: Could not reset index file to revision 'add_sub1'.
ok 4 - submodule update does not fetch already present commits

expecting success: 
	(cd super/submodule &&
	 git reset --hard HEAD~1 &&
	 echo "local change" > file
	) &&
	(cd super &&
	 (cd submodule &&
	  compare_head
	 ) &&
	 test_must_fail git submodule update submodule
	)

HEAD is now at 0c90624 upstream
ok 17 - git reset --merge: 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
		)
	
Synchronizing submodule url for 'submodule/sub-submodule'
Cloning into 'submodule_update'...
ok 13 - "git submodule sync --recursive" propagates changes in origin

expecting success: 
	(
		cd relative-clone &&
		git remote set-url origin ./foo &&
		git submodule sync &&
		(
			cd submodule &&
			#actual ./submodule
			test "$(git config remote.origin.url)" = "../submodule"
		)
	)

done.
Synchronizing submodule url for 'relative'
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 52 - use superproject as upstream when path is relative and no url is set there

expecting success: 
	mkdir reltest &&
	(
		cd reltest &&
		git init &&
		mkdir sub &&
		(
			cd sub &&
			git init &&
			test_commit foo
		) &&
		git add sub &&
		git config -f .gitmodules submodule.sub.path sub &&
		git config -f .gitmodules submodule.sub.url ../subrepo &&
		cp .git/config pristine-.git-config &&
		cp .gitmodules pristine-.gitmodules
	)

t7112-reset-submodule.sh: 159: cd: can't cd to sub1
Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/reltest/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/reltest/sub/.git/
error: Your local changes to the following files would be overwritten by checkout:
	file
Please, commit your changes or stash them before you can switch branches.
Aborting
Unable to checkout '4301fd3e4110d3b6212c19aed3094150392545b9' in submodule path 'submodule'
ok 5 - submodule update should fail due to local changes

expecting success: 
	(cd super &&
	 (cd submodule &&
	  compare_head
	 ) &&
	 git submodule update --force submodule &&
	 cd submodule &&
	 ! compare_head
	)

[master (root-commit) ddd63c9] foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo.t
ok 53 - set up for relative path tests

expecting success: 
	(
		cd reltest &&
		cp pristine-.git-config .git/config &&
		cp pristine-.gitmodules .gitmodules &&
		git config remote.origin.url ssh://hostname/repo &&
		git submodule init &&
		test "$(git config submodule.sub.url)" = ssh://hostname/subrepo
	)

Synchronizing submodule url for 'submodule'
ok 14 - "git submodule sync" handles origin URL of the form ./foo

expecting success: 
	(
		cd relative-clone &&
		git remote set-url origin ./foo/bar &&
		git submodule sync &&
		(
			cd submodule &&
			#actual ./foo/submodule
			test "$(git config remote.origin.url)" = "../foo/submodule"
		)
	)

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
Submodule path 'submodule': checked out '4301fd3e4110d3b6212c19aed3094150392545b9'
Submodule 'sub' (ssh://hostname/subrepo) registered for path 'sub'
Cloning into 'sub1'...
ok 6 - submodule update should throw away changes with --force 

expecting success: 
	(cd super &&
	 (cd submodule &&
	  rm -f file
	 ) &&
	 git submodule update --force submodule &&
	 (cd submodule &&
	  test "$(git status -s file)" = ""
	 )
	)

ok 54 - ../subrepo works with URL - ssh://hostname/repo

expecting success: 
	(
		cd reltest &&
		cp pristine-.git-config .git/config &&
		cp pristine-.gitmodules .gitmodules &&
		git config remote.origin.url ssh://hostname:22/repo &&
		git submodule init &&
		test "$(git config submodule.sub.url)" = ssh://hostname:22/subrepo
	)

done.
Synchronizing submodule url for 'submodule'
ok 15 - "git submodule sync" handles origin URL of the form ./foo/bar

expecting success: 
	(
		cd relative-clone &&
		git remote set-url origin ../foo &&
		git submodule sync &&
		(
			cd submodule &&
			#actual ../submodule
			test "$(git config remote.origin.url)" = "../../submodule"
		)
	)

Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
Submodule 'sub' (ssh://hostname:22/subrepo) registered for path 'sub'
ok 55 - ../subrepo works with port-qualified URL - ssh://hostname:22/repo

expecting success: 
	(
		cd reltest &&
		cp pristine-.git-config .git/config &&
		cp pristine-.gitmodules .gitmodules &&
		git config remote.origin.url "//somewhere else/repo" &&
		git submodule init &&
		test "$(git config submodule.sub.url)" = "//somewhere else/subrepo"
	)

Submodule path 'submodule': checked out '4301fd3e4110d3b6212c19aed3094150392545b9'
ok 7 - submodule update --force forcibly checks out submodules

expecting success: 
	(cd submodule &&
	 echo line4 >> file &&
	 git add file &&
	 test_tick &&
	 git commit -m "upstream line4"
	) &&
	(cd super &&
	 git submodule update --remote --force submodule &&
	 cd submodule &&
	 test "$(git log -1 --oneline)" = "$(GIT_DIR=../../submodule/.git git log -1 --oneline)"
	)

ok 18 - git reset --merge: 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
		)
	
[master 6355002] upstream line4
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Synchronizing submodule url for 'submodule'
Cloning into 'submodule_update'...
ok 16 - "git submodule sync" handles origin URL of the form ../foo

expecting success: 
	(
		cd relative-clone &&
		git remote set-url origin ../foo/bar &&
		git submodule sync &&
		(
			cd submodule &&
			#actual ../foo/submodule
			test "$(git config remote.origin.url)" = "../../foo/submodule"
		)
	)

done.
Submodule 'sub' (//somewhere else/subrepo) registered for path 'sub'
ok 56 - ../subrepo path works with local path - //somewhere else/repo

expecting success: 
	(
		cd reltest &&
		cp pristine-.git-config .git/config &&
		cp pristine-.gitmodules .gitmodules &&
		git config remote.origin.url file:///tmp/repo &&
		git submodule init &&
		test "$(git config submodule.sub.url)" = file:///tmp/subrepo
	)

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.
error: 8ed2e6719f8484ce01fa3ce133fe42d25c2441b8^{commit}: expected commit type, but the object dereferences to tree type
fatal: Needed a single revision
Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
From /«PKGBUILDDIR»/t/trash directory.t7406-submodule-update/submodule
   4301fd3..6355002  master     -> origin/master
Synchronizing submodule url for 'submodule'
Submodule 'sub' (file:///tmp/subrepo) registered for path 'sub'
ok 17 - "git submodule sync" handles origin URL of the form ../foo/bar

expecting success: 
	(
		cd relative-clone &&
		git remote set-url origin ../foo/bar &&
		mkdir -p a/b/c &&
		(
			cd a/b/c &&
			git init &&
			>.gitignore &&
			git add .gitignore &&
			test_tick &&
			git commit -m "initial commit"
		) &&
		git submodule add ../bar/a/b/c ./a/b/c &&
		git submodule sync &&
		(
			cd a/b/c &&
			#actual ../foo/bar/a/b/c
			test "$(git config remote.origin.url)" = "../../../../foo/bar/a/b/c"
		)
	)

ok 57 - ../subrepo works with file URL - file:///tmp/repo

expecting success: 
	(
		cd reltest &&
		cp pristine-.git-config .git/config &&
		cp pristine-.gitmodules .gitmodules &&
		git config remote.origin.url helper:://hostname/repo &&
		git submodule init &&
		test "$(git config submodule.sub.url)" = helper:://hostname/subrepo
	)

Submodule path 'submodule': checked out '63550025de24fe5dc1a12e7b0c6d73ec59137ab7'
ok 8 - submodule update --remote should fetch upstream changes

expecting success: 
	(cd submodule &&
	 git checkout -b test-branch &&
	 echo line5 >> file &&
	 git add file &&
	 test_tick &&
	 git commit -m "upstream line5" &&
	 git checkout master
	) &&
	(cd super &&
	 git config submodule.submodule.branch test-branch &&
	 git submodule update --remote --force submodule &&
	 cd submodule &&
	 test "$(git log -1 --oneline)" = "$(GIT_DIR=../../submodule/.git git log -1 --oneline test-branch)"
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7403-submodule-sync/relative-clone/a/b/c/.git/
Switched to a new branch 'test-branch'
[master (root-commit) 1f9e67a] initial commit
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 .gitignore
[test-branch fb214a5] upstream line5
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 3 commits.
  (use "git push" to publish your local commits)
Cloning into 'sub1'...
Submodule 'sub' (helper:://hostname/subrepo) registered for path 'sub'
Adding existing repo at 'a/b/c' to the index
ok 58 - ../subrepo works with helper URL- helper:://hostname/repo

expecting success: 
	(
		cd reltest &&
		cp pristine-.git-config .git/config &&
		git config remote.origin.url user@host:repo &&
		git submodule init &&
		test "$(git config submodule.sub.url)" = user@host:subrepo
	)

done.
From /«PKGBUILDDIR»/t/trash directory.t7406-submodule-update/submodule
 * [new branch]      test-branch -> origin/test-branch
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
Submodule 'sub' (user@host:subrepo) registered for path 'sub'
ok 59 - ../subrepo works with scp-style URL - user@host:repo

expecting success: 
	(
		cd reltest &&
		cp pristine-.git-config .git/config &&
		cp pristine-.gitmodules .gitmodules &&
		git config remote.origin.url user@host:path/to/repo &&
		git submodule init &&
		test "$(git config submodule.sub.url)" = user@host:path/to/subrepo
	)

Synchronizing submodule url for 'a/b/c'
Submodule path 'submodule': checked out 'fb214a54e213b87a93de796f50149daeebdcb7d0'
ok 19 - git reset --merge: 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
		)
	
ok 9 - local config should override .gitmodules branch

expecting success: 
	(cd super/submodule &&
	  git checkout master
	) &&
	(cd super &&
	 (cd submodule &&
	  compare_head
	 ) &&
	 git submodule update --rebase submodule &&
	 cd submodule &&
	 compare_head
	)

Previous HEAD position was fb214a5... upstream line5
Switched to branch 'master'
Your branch is behind 'origin/master' by 3 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)
Synchronizing submodule url for 'submodule'
Cloning into 'submodule_update'...
Submodule 'sub' (user@host:path/to/subrepo) registered for path 'sub'
ok 60 - ../subrepo works with scp-style URL - user@host:path/to/repo

expecting success: 
	(
		cd reltest &&
		cp pristine-.git-config .git/config &&
		cp pristine-.gitmodules .gitmodules &&
		git config remote.origin.url foo &&
		# actual: fails with an error
		git submodule init &&
		test "$(git config submodule.sub.url)" = subrepo
	)

done.
ok 18 - "git submodule sync" handles origin URL of the form ../foo/bar with deeply nested submodule

# passed all 18 test(s)
1..18
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Submodule 'sub' (subrepo) registered for path 'sub'
ok 61 - ../subrepo works with relative local path - foo

expecting success: 
	(
		cd reltest &&
		cp pristine-.git-config .git/config &&
		cp pristine-.gitmodules .gitmodules &&
		git config remote.origin.url foo/bar &&
		git submodule init &&
		test "$(git config submodule.sub.url)" = foo/subrepo
	)

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
First, rewinding head to replay your work on top of it...
*** t7407-submodule-foreach.sh ***
Fast-forwarded master to 4301fd3e4110d3b6212c19aed3094150392545b9.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/.git/
Submodule path 'submodule': rebased into '4301fd3e4110d3b6212c19aed3094150392545b9'
expecting success: 
	echo file > file &&
	git add file &&
	test_tick &&
	git commit -m upstream &&
	git clone . super &&
	git clone super submodule &&
	(
		cd super &&
		git submodule add ../submodule sub1 &&
		git submodule add ../submodule sub2 &&
		git submodule add ../submodule sub3 &&
		git config -f .gitmodules --rename-section \
			submodule.sub1 submodule.foo1 &&
		git config -f .gitmodules --rename-section \
			submodule.sub2 submodule.foo2 &&
		git config -f .gitmodules --rename-section \
			submodule.sub3 submodule.foo3 &&
		git add .gitmodules &&
		test_tick &&
		git commit -m "submodules" &&
		git submodule init sub1 &&
		git submodule init sub2 &&
		git submodule init sub3
	) &&
	(
		cd submodule &&
		echo different > file &&
		git add file &&
		test_tick &&
		git commit -m "different"
	) &&
	(
		cd super &&
		(
			cd sub3 &&
			git pull
		) &&
		git add sub3 &&
		test_tick &&
		git commit -m "update sub3"
	)

Cloning into 'sub1'...
ok 10 - submodule update --rebase staying on master

expecting success: 
	(cd super/submodule &&
	  git reset --hard HEAD~1
	) &&
	(cd super &&
	 (cd submodule &&
	  compare_head
	 ) &&
	 git submodule update --merge submodule &&
	 cd submodule &&
	 compare_head
	)

[master (root-commit) 0c90624] upstream
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
Cloning into 'super'...
HEAD is now at 0c90624 upstream
Submodule 'sub' (foo/subrepo) registered for path 'sub'
done.
ok 62 - ../subrepo works with relative local path - foo/bar

expecting success: 
	(
		cd reltest &&
		cp pristine-.git-config .git/config &&
		cp pristine-.gitmodules .gitmodules &&
		git config remote.origin.url ./foo &&
		git submodule init &&
		test "$(git config submodule.sub.url)" = subrepo
	)

done.
Cloning into 'submodule'...
done.
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
Submodule 'sub' (subrepo) registered for path 'sub'
warning: unable to rmdir sub1: Directory not empty
ok 63 - ../subrepo works with relative local path - ./foo

expecting success: 
	(
		cd reltest &&
		cp pristine-.git-config .git/config &&
		cp pristine-.gitmodules .gitmodules &&
		git config remote.origin.url ./foo/bar &&
		git submodule init &&
		test "$(git config submodule.sub.url)" = foo/subrepo
	)

Updating 0c90624..4301fd3
Fast-forward
Cloning into 'sub1'...
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Submodule path 'submodule': merged in '4301fd3e4110d3b6212c19aed3094150392545b9'
done.
ok 11 - submodule update --merge staying on master

expecting success: 
	(cd super &&
	 git config submodule.submodule.update rebase
	) &&
	(cd super/submodule &&
	  git reset --hard HEAD~1
	) &&
	(cd super &&
	 (cd submodule &&
	  compare_head
	 ) &&
	 git submodule update submodule &&
	 cd submodule &&
	 compare_head
	)

HEAD is now at 0c90624 upstream
ok 20 - git reset --merge: 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
		)
	
Cloning into 'submodule_update'...
Submodule 'sub' (foo/subrepo) registered for path 'sub'
ok 64 - ../subrepo works with relative local path - ./foo/bar

expecting success: 
	(
		cd reltest &&
		cp pristine-.git-config .git/config &&
		cp pristine-.gitmodules .gitmodules &&
		git config remote.origin.url ../foo &&
		git submodule init &&
		test "$(git config submodule.sub.url)" = ../subrepo
	)

done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Cloning into 'sub2'...
done.
Submodule 'sub' (../subrepo) registered for path 'sub'
ok 65 - ../subrepo works with relative local path - ../foo

expecting success: 
	(
		cd reltest &&
		cp pristine-.git-config .git/config &&
		cp pristine-.gitmodules .gitmodules &&
		git config remote.origin.url ../foo/bar &&
		git submodule init &&
		test "$(git config submodule.sub.url)" = ../foo/subrepo
	)

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
First, rewinding head to replay your work on top of it...
Fast-forwarded master to 4301fd3e4110d3b6212c19aed3094150392545b9.
Submodule path 'submodule': rebased into '4301fd3e4110d3b6212c19aed3094150392545b9'
Cloning into 'sub1'...
ok 12 - submodule update - rebase in .git/config

expecting success: 
	(cd super &&
	 git config submodule.submodule.update checkout
	) &&
	(cd super/submodule &&
	  git reset --hard HEAD~1
	) &&
	(cd super &&
	 (cd submodule &&
	  compare_head
	 ) &&
	 git submodule update --rebase submodule &&
	 cd submodule &&
	 compare_head
	)

Cloning into 'sub3'...
done.
Submodule 'sub' (../foo/subrepo) registered for path 'sub'
HEAD is now at 0c90624 upstream
done.
ok 66 - ../subrepo works with relative local path - ../foo/bar

expecting success: 
	(
		cd reltest &&
		cp pristine-.git-config .git/config &&
		cp pristine-.gitmodules .gitmodules &&
		mkdir -p a/b/c &&
		(cd a/b/c; git init) &&
		git config remote.origin.url ../foo/bar.git &&
		git submodule add ../bar/a/b/c ./a/b/c &&
		git submodule init &&
		test "$(git config submodule.a/b/c.url)" = ../foo/bar/a/b/c
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/reltest/a/b/c/.git/
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
[master 33b977a] submodules
 Author: A U Thor <author@example.com>
 4 files changed, 12 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 sub1
 create mode 160000 sub2
 create mode 160000 sub3
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
Adding existing repo at 'a/b/c' to the index
warning: unable to rmdir sub1: Directory not empty
Submodule 'foo1' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/submodule) registered for path 'sub1'
First, rewinding head to replay your work on top of it...
ok 21 - git reset --merge: 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
		)
	
Submodule 'sub' (../foo/subrepo) registered for path 'sub'
Fast-forwarded master to 4301fd3e4110d3b6212c19aed3094150392545b9.
ok 67 - ../bar/a/b/c works with relative local path - ../foo/bar.git

expecting success: 
	(
		cd addtest &&
		git submodule status >expect
	) &&
	mv addtest addtest2 &&
	(
		cd addtest2 &&
		git submodule status >actual &&
		test_cmp expect actual
	)

Submodule path 'submodule': rebased into '4301fd3e4110d3b6212c19aed3094150392545b9'
ok 13 - submodule update - checkout in .git/config but --rebase given

expecting success: 
	(cd super &&
	 git config submodule.submodule.update merge
	) &&
	(cd super/submodule &&
	  git reset --hard HEAD~1
	) &&
	(cd super &&
	 (cd submodule &&
	  compare_head
	 ) &&
	 git submodule update submodule &&
	 cd submodule &&
	 compare_head
	)

Submodule 'foo2' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/submodule) registered for path 'sub2'
HEAD is now at 0c90624 upstream
Cloning into 'submodule_update'...
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Submodule 'foo3' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/submodule) registered for path 'sub3'
[master 509f622] different
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Updating 0c90624..4301fd3
Fast-forward
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Submodule path 'submodule': merged in '4301fd3e4110d3b6212c19aed3094150392545b9'
ok 14 - submodule update - merge in .git/config

expecting success: 
	(cd super &&
	 git config submodule.submodule.update checkout
	) &&
	(cd super/submodule &&
	  git reset --hard HEAD~1
	) &&
	(cd super &&
	 (cd submodule &&
	  compare_head
	 ) &&
	 git submodule update --merge submodule &&
	 cd submodule &&
	 compare_head
	)

From /«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/submodule
   0c90624..509f622  master     -> origin/master
HEAD is now at 0c90624 upstream
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
Updating 0c90624..509f622
Fast-forward
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
[master ed2a820] update sub3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - setup a submodule tree

expecting success: 
	git clone super clone &&
	(
		cd clone &&
		git submodule update --init -- sub1 sub3 &&
		git submodule foreach "echo \$toplevel-\$name-\$path-\$sha1" > ../actual &&
		git config foo.bar zar &&
		git submodule foreach "git config --file \"\$toplevel/.git/config\" foo.bar"
	) &&
	test_i18ncmp expect actual

Cloning into 'clone'...
Cloning into 'sub1'...
done.
done.
Updating 0c90624..4301fd3
Fast-forward
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Submodule path 'submodule': merged in '4301fd3e4110d3b6212c19aed3094150392545b9'
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
ok 15 - submodule update - checkout in .git/config but --merge given

expecting success: 
	(cd super &&
	 git config submodule.submodule.update checkout
	) &&
	(cd super/submodule &&
	  git reset --hard HEAD^
	) &&
	(cd super &&
	 (cd submodule &&
	  compare_head
	 ) &&
	 git submodule update submodule &&
	 cd submodule &&
	 ! compare_head
	)

HEAD is now at 0c90624 upstream
Submodule 'foo1' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/submodule) registered for path 'sub1'
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
error: Untracked working tree file 'sub1/file1' would be overwritten by merge.
fatal: Could not reset index file to revision 'replace_sub1_with_directory'.
Submodule 'foo3' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/submodule) registered for path 'sub3'
ok 22 - git reset --merge: 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
		)
	
Cloning into 'sub1'...
Cloning into 'submodule_update'...
done.
Submodule path 'submodule': checked out '4301fd3e4110d3b6212c19aed3094150392545b9'
ok 16 - submodule update - checkout in .git/config

expecting success: 
	(cd super &&
	 git config submodule.submodule.update "!git checkout"
	) &&
	(cd super/submodule &&
	  git reset --hard HEAD^
	) &&
	(cd super &&
	 (cd submodule &&
	  compare_head
	 ) &&
	 git submodule update submodule &&
	 cd submodule &&
	 ! compare_head
	)

done.
HEAD is now at 0c90624 upstream
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Submodule path 'sub1': checked out '0c90624ab7f1aaa301d3bb79f60dcfed1ec4897f'
Cloning into 'sub3'...
done.
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
Previous HEAD position was 0c90624... upstream
HEAD is now at 4301fd3... Commit 2
Submodule path 'submodule': 'git checkout 4301fd3e4110d3b6212c19aed3094150392545b9'
Submodule path 'sub3': checked out '509f622a4f36a3e472affcf28fa959174f3dd5b5'
ok 17 - submodule update - command in .git/config

expecting success: 
	(cd super &&
	 git config submodule.submodule.update "!false"
	) &&
	(cd super/submodule &&
	  git reset --hard HEAD^
	) &&
	(cd super &&
	 test_must_fail git submodule update submodule
	)

HEAD is now at 0c90624 upstream
Cloning into 'sub1'...
done.
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
Execution of 'false 4301fd3e4110d3b6212c19aed3094150392545b9' failed in submodule path 'submodule'
ok 18 - submodule update - command in .git/config catches failure

expecting success: 
	(cd super &&
	 H=$(git ls-files -s submodule | cut -d" " -f2) &&
	 mkdir submodule1 &&
	 git update-index --add --cacheinfo 160000 $H submodule1 &&
	 git config -f .gitmodules submodule.submodule1.path submodule1 &&
	 git config -f .gitmodules submodule.submodule1.url ../submodule &&
	 git config -f .gitmodules submodule.submodule1.update !false &&
	 git submodule init submodule1 &&
	 echo "none" >expect &&
	 git config submodule.submodule1.update >actual &&
	 test_cmp expect actual
	)

Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
Entering 'sub1'
zar
Entering 'sub3'
error: Untracked working tree file 'sub1/file1' would be overwritten by merge.
fatal: Could not reset index file to revision 'replace_sub1_with_directory'.
zar
ok 2 - test basic "submodule foreach" usage

expecting success: 
	mkdir clone/sub &&
	(
		cd clone/sub &&
		git submodule foreach "echo \$toplevel-\$name-\$sm_path-\$sha1" >../../actual
	) &&
	test_i18ncmp expect actual

Submodule 'submodule1' (/«PKGBUILDDIR»/t/trash directory.t7406-submodule-update/submodule) registered for path 'submodule1'
ok 23 - git reset --merge: 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
		)
	
warning: unknown update mode '!false' suggested for submodule 'submodule1'
ok 19 - submodule init does not copy command into .git/config

expecting success: 
	(cd super &&
	 git config -f .gitmodules submodule.rebasing.update rebase &&
	 git submodule init rebasing &&
	 test "rebase" = "$(git config submodule.rebasing.update)"
	)

ok 3 - test "submodule foreach" from subdirectory

expecting success: 
	git clone submodule nested1 &&
	git clone submodule nested2 &&
	git clone submodule nested3 &&
	(
		cd nested3 &&
		git submodule add ../submodule submodule &&
		test_tick &&
		git commit -m "submodule" &&
		git submodule init submodule
	) &&
	(
		cd nested2 &&
		git submodule add ../nested3 nested3 &&
		test_tick &&
		git commit -m "nested3" &&
		git submodule init nested3
	) &&
	(
		cd nested1 &&
		git submodule add ../nested2 nested2 &&
		test_tick &&
		git commit -m "nested2" &&
		git submodule init nested2
	) &&
	(
		cd super &&
		git submodule add ../nested1 nested1 &&
		test_tick &&
		git commit -m "nested1" &&
		git submodule init nested1
	)

Cloning into 'nested1'...
done.
Cloning into 'nested2'...
Cloning into 'submodule_update'...
done.
Cloning into 'nested3'...
done.
done.
ok 20 - submodule init picks up rebase

expecting success: 
	(cd super &&
	 git config -f .gitmodules submodule.merging.update merge &&
	 git submodule init merging &&
	 test "merge" = "$(git config submodule.merging.update)"
	)

ok 68 - moving the superproject does not break submodules

expecting success: 
	(
		cd addtest2 &&
		(
			cd repo &&
			echo "$submodurl/repo" >expect &&
			git config remote.origin.url >actual &&
			test_cmp expect actual &&
			echo "gitdir: ../.git/modules/repo" >expect &&
			test_cmp expect .git
		) &&
		rm -rf repo &&
		git rm repo &&
		git submodule add -q --name repo_new "$submodurl/bare.git" repo >actual &&
		test_must_be_empty actual &&
		echo "gitdir: ../.git/modules/submod" >expect &&
		test_cmp expect submod/.git &&
		(
			cd repo &&
			echo "$submodurl/bare.git" >expect &&
			git config remote.origin.url >actual &&
			test_cmp expect actual &&
			echo "gitdir: ../.git/modules/repo_new" >expect &&
			test_cmp expect .git
		) &&
		echo "repo" >expect &&
		test_must_fail git config -f .gitmodules submodule.repo.path &&
		git config -f .gitmodules submodule.repo_new.path >actual &&
		test_cmp expect actual&&
		echo "$submodurl/repo" >expect &&
		test_must_fail git config -f .gitmodules submodule.repo.url &&
		echo "$submodurl/bare.git" >expect &&
		git config -f .gitmodules submodule.repo_new.url >actual &&
		test_cmp expect actual &&
		echo "$submodurl/repo" >expect &&
		git config submodule.repo.url >actual &&
		test_cmp expect actual &&
		echo "$submodurl/bare.git" >expect &&
		git config submodule.repo_new.url >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.
rm 'repo'
Cloning into 'submodule'...
ok 21 - submodule init picks up merge

expecting success: 
	(cd super &&
	 rm -rf submodule &&
	 git submodule update submodule &&
	 git status -s submodule >expect &&
	 rm -rf submodule &&
	 git submodule update --merge submodule &&
	 git status -s submodule >actual &&
	 test_cmp expect actual
	)

done.
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
[master 5ec8351] submodule
 Author: A U Thor <author@example.com>
 2 files changed, 4 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 submodule
Cloning into 'sub1'...
done.
ok 69 - submodule add --name allows to replace a submodule with another at the same path

expecting success: 
	(
		cd addtest2 &&
		rm -rf repo &&
		git rm repo &&
		test_must_fail git submodule add -q --name repo_new "$submodurl/repo.git" repo &&
		test ! -d repo &&
		test_must_fail git config -f .gitmodules submodule.repo_new.path &&
		test_must_fail git config -f .gitmodules submodule.repo_new.url &&
		echo "$submodurl/bare.git" >expect &&
		git config submodule.repo_new.url >actual &&
		test_cmp expect actual &&
		git submodule add -f -q --name repo_new "$submodurl/repo.git" repo &&
		test -d repo &&
		echo "repo" >expect &&
		git config -f .gitmodules submodule.repo_new.path >actual &&
		test_cmp expect actual&&
		echo "$submodurl/repo.git" >expect &&
		git config -f .gitmodules submodule.repo_new.url >actual &&
		test_cmp expect actual &&
		echo "$submodurl/repo.git" >expect &&
		git config submodule.repo_new.url >actual &&
		test_cmp expect actual
	)

rm 'repo'
Submodule path 'submodule': checked out '4301fd3e4110d3b6212c19aed3094150392545b9'
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
A git directory for 'repo_new' is found locally with remote(s):
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
  origin	/«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/bare.git
If you want to reuse this local git directory instead of cloning again from
  /«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/repo.git
test_must_fail: command succeeded: git reset --merge replace_sub1_with_file
use the '--force' option. If the local git directory is not the correct repo
or you are unsure what this means choose another name with the '--name' option.
Cloning into 'nested3'...
not ok 24 - git reset --merge: 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
		)
	
done.
Cloning into 'submodule_update'...
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
[master 2e69c85] nested3
 Author: A U Thor <author@example.com>
 2 files changed, 4 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 nested3
Reactivating local git directory for submodule 'repo_new'.
Submodule path 'submodule': checked out '4301fd3e4110d3b6212c19aed3094150392545b9'
ok 22 - submodule update --merge  - ignores --merge  for new submodules

expecting success: 
	(cd super &&
	 rm -rf submodule &&
	 git submodule update submodule &&
	 git status -s submodule >expect &&
	 rm -rf submodule &&
	 git submodule update --rebase submodule &&
	 git status -s submodule >actual &&
	 test_cmp expect actual
	)

ok 70 - submodule add with an existing name fails unless forced

expecting success: 
	git submodule add ./init2 example2 &&
	git commit -m "submodule example2 added"

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'sub1'...
Cloning into 'nested2'...
done.
Cloning into 'example2'...
done.
Submodule path 'submodule': checked out '4301fd3e4110d3b6212c19aed3094150392545b9'
done.
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
[master b23f134] nested2
 Author: A U Thor <author@example.com>
 2 files changed, 4 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 nested2
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
[second 5be6a34] submodule example2 added
 Author: A U Thor <author@example.com>
 2 files changed, 7 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 example2
ok 71 - set up a second submodule

expecting success: 
	git config submodule.example.foo bar &&
	git config submodule.example2.frotz nitfol &&
	git submodule deinit init &&
	test -z "$(git config --get-regexp "submodule\.example\.")" &&
	test -n "$(git config --get-regexp "submodule\.example2\.")" &&
	test -f example2/.git &&
	rmdir init

test_must_fail: command succeeded: git reset --merge replace_sub1_with_file
not ok 25 - git reset --merge: 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
		)
	
Submodule path 'submodule': checked out '4301fd3e4110d3b6212c19aed3094150392545b9'
ok 23 - submodule update --rebase - ignores --rebase for new submodules

expecting success: 
	(cd super &&
	 rm -rf submodule &&
	 git submodule update submodule &&
	 git status -s submodule >expect &&
	 rm -rf submodule &&
	 git config submodule.submodule.update merge &&
	 git submodule update submodule &&
	 git status -s submodule >actual &&
	 git config --unset submodule.submodule.update &&
	 test_cmp expect actual
	)

Cleared directory 'init'
Cloning into 'submodule_update'...
Submodule 'example' (/«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/init2) unregistered for path 'init'
ok 72 - submodule deinit should remove the whole submodule section from .git/config

expecting success: 
	git submodule update --init &&
	git config submodule.example.foo bar &&
	mkdir -p sub &&
	(
		cd sub &&
		git submodule deinit ../init >../output
	) &&
	grep "\\.\\./init" output &&
	test -z "$(git config --get-regexp "submodule\.example\.")" &&
	test -n "$(git config --get-regexp "submodule\.example2\.")" &&
	test -f example2/.git &&
	rmdir init

done.
Cloning into 'nested1'...
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
[master 427ccd0] nested1
 Author: A U Thor <author@example.com>
 2 files changed, 4 insertions(+)
 create mode 160000 nested1
Submodule 'example' (/«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/init2) registered for path 'init'
Submodule path 'submodule': checked out '4301fd3e4110d3b6212c19aed3094150392545b9'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 4 - setup nested submodules

expecting success: 
	git clone super clone2 &&
	(
		cd clone2 &&
		test_must_fail git rev-parse --resolve-git-dir sub1/.git &&
		test_must_fail git rev-parse --resolve-git-dir sub2/.git &&
		test_must_fail git rev-parse --resolve-git-dir sub3/.git &&
		test_must_fail git rev-parse --resolve-git-dir nested1/.git &&
		git submodule update --init &&
		git rev-parse --resolve-git-dir sub1/.git &&
		git rev-parse --resolve-git-dir sub2/.git &&
		git rev-parse --resolve-git-dir sub3/.git &&
		git rev-parse --resolve-git-dir nested1/.git &&
		test_must_fail git rev-parse --resolve-git-dir nested1/nested2/.git &&
		git submodule foreach "git submodule update --init" &&
		git rev-parse --resolve-git-dir nested1/nested2/.git &&
		test_must_fail git rev-parse --resolve-git-dir nested1/nested2/nested3/.git
	)

Cloning into 'clone2'...
done.
Cloning into 'sub1'...
fatal: not a gitdir 'sub1/.git'
done.
fatal: not a gitdir 'sub2/.git'
fatal: not a gitdir 'sub3/.git'
fatal: not a gitdir 'nested1/.git'
Submodule path 'init': checked out '9cdca946443630ae615e1ddfe6174e89fea53615'
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
Submodule path 'submodule': checked out '4301fd3e4110d3b6212c19aed3094150392545b9'
Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
ok 24 - submodule update ignores update=merge config for new submodules

expecting success: 
	(cd super &&
	 rm -rf submodule &&
	 git submodule update submodule &&
	 git status -s submodule >expect &&
	 rm -rf submodule &&
	 git config submodule.submodule.update rebase &&
	 git submodule update submodule &&
	 git status -s submodule >actual &&
	 git config --unset submodule.submodule.update &&
	 test_cmp expect actual
	)

Submodule 'nested1' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/nested1) registered for path 'nested1'
Submodule 'foo1' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/submodule) registered for path 'sub1'
Cleared directory '../init'
Submodule 'example' (/«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/init2) unregistered for path '../init'
Submodule 'foo2' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/submodule) registered for path 'sub2'
ok 73 - submodule deinit from subdirectory

expecting success: 
	git submodule update --init &&
	git config submodule.example.foo bar &&
	git config submodule.example2.frotz nitfol &&
	test_must_fail git submodule deinit &&
	git submodule deinit . >actual &&
	test -z "$(git config --get-regexp "submodule\.example\.")" &&
	test -z "$(git config --get-regexp "submodule\.example2\.")" &&
	test_i18ngrep "Cleared directory .init" actual &&
	test_i18ngrep "Cleared directory .example2" actual &&
	rmdir init example2

Submodule path 'submodule': checked out '4301fd3e4110d3b6212c19aed3094150392545b9'
Submodule 'foo3' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/submodule) registered for path 'sub3'
Submodule path 'sub1': checked out '6bb2c777177005d6a4fc429e4e7f5b28e83e1e0c'
ok 26 - git reset --merge: 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
		)
	
Submodule 'example' (/«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/init2) registered for path 'init'
Cloning into 'nested1'...
done.
Cloning into 'submodule_update'...
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Submodule path 'nested1': checked out 'b23f134787d96fae589a6b76da41f4db112fc8db'
Submodule path 'submodule': checked out '4301fd3e4110d3b6212c19aed3094150392545b9'
Cloning into 'sub1'...
Submodule path 'init': checked out '9cdca946443630ae615e1ddfe6174e89fea53615'
done.
ok 25 - submodule update ignores update=rebase config for new submodules

expecting success: 
	(cd super &&
	 git config -f .gitmodules submodule.none.update none &&
	 git submodule init none &&
	 test "none" = "$(git config submodule.none.update)"
	)

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
Use '.' if you really want to deinitialize all submodules
Submodule path 'sub1': checked out '0c90624ab7f1aaa301d3bb79f60dcfed1ec4897f'
Cloning into 'sub1'...
ok 26 - submodule init picks up update=none

expecting success: 
	(cd super &&
	 git config submodule.submodule.update none &&
	 (cd submodule &&
	  git checkout master &&
	  compare_head
	 ) &&
	 git diff --raw | grep "	submodule" &&
	 git submodule update &&
	 git diff --raw | grep "	submodule" &&
	 (cd submodule &&
	  compare_head
	 ) &&
	 git config --unset submodule.submodule.update &&
	 git submodule update submodule
	)

Cloning into 'sub2'...
done.
Previous HEAD position was 4301fd3... Commit 2
Switched to branch 'master'
Your branch is behind 'origin/master' by 3 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)
done.
:160000 160000 4301fd3... 0000000... M	submodule
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
Submodule path 'sub2': checked out '0c90624ab7f1aaa301d3bb79f60dcfed1ec4897f'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
Cloning into 'sub3'...
done.
Skipping submodule 'none'
Submodule path 'sub3': checked out '509f622a4f36a3e472affcf28fa959174f3dd5b5'
/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/clone2/.git/modules/foo1
/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/clone2/.git/modules/foo2
Skipping submodule 'submodule'
/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/clone2/.git/modules/foo3
Cleared directory 'init'
/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/clone2/.git/modules/nested1
fatal: not a gitdir 'nested1/nested2/.git'
Cleared directory 'example2'
ok 74 - submodule deinit . deinits all initialized submodules

expecting success: 
	git submodule update --init &&
	rm -rf init example2/* example2/.git &&
	git submodule deinit init example2 >actual &&
	test -z "$(git config --get-regexp "submodule\.example\.")" &&
	test -z "$(git config --get-regexp "submodule\.example2\.")" &&
	test_i18ngrep ! "Cleared directory .init" actual &&
	test_i18ngrep "Cleared directory .example2" actual &&
	rmdir init

Skipping submodule 'submodule1'
:160000 160000 4301fd3... 0000000... M	submodule
Entering 'nested1'
Submodule 'example2' (/«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/init2) registered for path 'example2'
fatal: reference is not a tree: 0123456789012345678901234567890123456789
Unable to checkout '0123456789012345678901234567890123456789' in submodule path 'sub1'
Submodule 'example' (/«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/init2) registered for path 'init'
ok 27 - git reset --merge: 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
		)
	
Submodule path 'submodule': checked out '4301fd3e4110d3b6212c19aed3094150392545b9'
ok 27 - submodule update - update=none in .git/config

expecting success: 
	(cd super &&
	 git config submodule.submodule.update none &&
	 (cd submodule &&
	  git checkout master &&
	  compare_head
	 ) &&
	 git diff --raw | grep "	submodule" &&
	 git submodule update --checkout &&
	 test_must_fail git diff --raw \| grep "	submodule" &&
	 (cd submodule &&
	  test_must_fail compare_head
	 ) &&
	 git config --unset submodule.submodule.update
	)

Previous HEAD position was 4301fd3... Commit 2
Submodule 'nested2' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/nested2) registered for path 'nested2'
Switched to branch 'master'
Your branch is behind 'origin/master' by 3 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)
Cloning into 'submodule_update'...
done.
Submodule path 'example2': checked out 'ba0477b3a92611ecd7e3d7526eea3b1f6ebfe802'
:160000 160000 4301fd3... 0000000... M	submodule
Switched to a new branch 'invalid_sub1'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
Cloning into 'nested2'...
fatal: Needed a single revision
Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
done.
Submodule path 'init': checked out '9cdca946443630ae615e1ddfe6174e89fea53615'
Submodule path 'nested2': checked out '2e69c85de92bf5f316f3c67b5e492f287f5a6542'
Entering 'sub1'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
Entering 'sub2'
Submodule path 'submodule': checked out '4301fd3e4110d3b6212c19aed3094150392545b9'
Cleared directory 'example2'
Cloning into 'sub1'...
ok 75 - submodule deinit deinits a submodule when its work tree is missing or empty

expecting success: 
	git submodule update --init &&
	echo X >>init/s &&
	test_must_fail git submodule deinit init &&
	test -n "$(git config --get-regexp "submodule\.example\.")" &&
	test -f example2/.git &&
	git submodule deinit -f init >actual &&
	test -z "$(git config --get-regexp "submodule\.example\.")" &&
	test_i18ngrep "Cleared directory .init" actual &&
	rmdir init

Cloning into 'submodule1'...
done.
Entering 'sub3'
done.
Submodule 'example2' (/«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/init2) registered for path 'example2'
Submodule 'example' (/«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/init2) registered for path 'init'
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
Submodule path 'submodule1': checked out '4301fd3e4110d3b6212c19aed3094150392545b9'
fatal: ambiguous argument '|': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
ok 28 - submodule update - update=none in .git/config but --checkout given

expecting success: 
	(cd super &&
	 git add .gitmodules &&
	 git commit -m ".gitmodules"
	) &&
	git clone super cloned &&
	(cd cloned &&
	 git submodule update --init &&
	 test -e submodule/.git &&
	 test_must_fail test -e none/.git
	)

[master 2a18bde] .gitmodules
 Author: A U Thor <author@example.com>
 2 files changed, 8 insertions(+)
 create mode 160000 submodule1
Cloning into 'cloned'...
/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/clone2/.git/modules/nested1/modules/nested2
ok 28 - git reset --merge: 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 &&
fatal: not a gitdir 'nested1/nested2/nested3/.git'
			test_dir_is_empty sub1 &&
			git submodule update --init --recursive &&
			test_submodule_content sub1 origin/add_sub1
		)
	
ok 5 - use "submodule foreach" to checkout 2nd level submodule

expecting success: 
	(
		cd clone2 &&
		git submodule foreach --recursive "git submodule update --init" &&
		git rev-parse --resolve-git-dir nested1/nested2/nested3/.git &&
		git rev-parse --resolve-git-dir nested1/nested2/nested3/submodule/.git
	)

done.
Submodule path 'example2': checked out 'ba0477b3a92611ecd7e3d7526eea3b1f6ebfe802'
Cloning into 'submodule_update'...
Entering 'nested1'
done.
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Submodule 'merging' (/«PKGBUILDDIR»/t/trash directory.t7406-submodule-update/merging) registered for path 'merging'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Submodule path 'init': checked out '9cdca946443630ae615e1ddfe6174e89fea53615'
HEAD is now at 5d11ca2 Add sub1
Submodule 'none' (/«PKGBUILDDIR»/t/trash directory.t7406-submodule-update/none) registered for path 'none'
Entering 'nested1/nested2'
Submodule 'rebasing' (/«PKGBUILDDIR»/t/trash directory.t7406-submodule-update/rebasing) registered for path 'rebasing'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
Submodule 'submodule' (/«PKGBUILDDIR»/t/trash directory.t7406-submodule-update/submodule) registered for path 'submodule'
Submodule 'submodule1' (/«PKGBUILDDIR»/t/trash directory.t7406-submodule-update/submodule) registered for path 'submodule1'
Submodule 'nested3' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/nested3) registered for path 'nested3'
Cloning into 'sub1'...
warning: unknown update mode '!false' suggested for submodule 'submodule1'
done.
error: the following file has local modifications:
    init
(use --cached to keep the file, or -f to force removal)
Submodule work tree 'init' contains local modifications; use '-f' to discard them
Cloning into 'nested3'...
Cloning into 'merging'...
done.
done.
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
Cleared directory 'init'
ok 76 - submodule deinit fails when the submodule contains modifications unless forced

expecting success: 
	git submodule update --init &&
	echo X >>init/untracked &&
	test_must_fail git submodule deinit init &&
	test -n "$(git config --get-regexp "submodule\.example\.")" &&
	test -f example2/.git &&
	git submodule deinit -f init >actual &&
	test -z "$(git config --get-regexp "submodule\.example\.")" &&
	test_i18ngrep "Cleared directory .init" actual &&
	rmdir init

Submodule path 'merging': checked out '0c90624ab7f1aaa301d3bb79f60dcfed1ec4897f'
Submodule path 'nested3': checked out '5ec83512b76a0b8170b899f8e643913c3e9b72d9'
ok 29 - git reset --hard: 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
		)
	
Entering 'nested1/nested2/nested3'
Skipping submodule 'none'
Cloning into 'submodule_update'...
Cloning into 'rebasing'...
Submodule 'example' (/«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/init2) registered for path 'init'
done.
done.
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Submodule path 'rebasing': checked out '0c90624ab7f1aaa301d3bb79f60dcfed1ec4897f'
HEAD is now at 5d11ca2 Add sub1
Submodule 'submodule' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/submodule) registered for path 'submodule'
Cloning into 'submodule'...
done.
Submodule path 'init': checked out '9cdca946443630ae615e1ddfe6174e89fea53615'
Cloning into 'submodule'...
done.
Submodule path 'submodule': checked out '4301fd3e4110d3b6212c19aed3094150392545b9'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
Skipping submodule 'submodule1'
ok 29 - submodule update --init skips submodule with update=none

expecting success: 
	(cd super &&
	 git reset --hard HEAD &&
	 git submodule add ../submodule submodule2 &&
	 git submodule init &&
	 git commit -am "new_submodule" &&
	 (cd submodule2 &&
	  git rev-parse --verify HEAD >../expect
	 ) &&
	 (cd submodule &&
	  test_commit "update_submodule" file
	 ) &&
	 (cd submodule2 &&
	  test_commit "update_submodule2" file
	 ) &&
	 git add submodule &&
	 git add submodule2 &&
	 git commit -m "two_new_submodule_commits" &&
	 (cd submodule &&
	  echo "" > file
	 ) &&
	 git checkout HEAD^ &&
	 test_must_fail git submodule update &&
	 (cd submodule2 &&
	  git rev-parse --verify HEAD >../actual
	 ) &&
	 test_cmp expect actual
	)

HEAD is now at 2a18bde .gitmodules
Submodule path 'submodule': checked out '509f622a4f36a3e472affcf28fa959174f3dd5b5'
Entering 'nested1/nested2/nested3/submodule'
Cloning into 'sub1'...
done.
Cloning into 'submodule2'...
error: the following file has local modifications:
    init
(use --cached to keep the file, or -f to force removal)
Submodule work tree 'init' contains local modifications; use '-f' to discard them
done.
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
Entering 'sub1'
ok 30 - git reset --hard: 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 &&
			$command add_sub1 &&
			test_superproject_content origin/add_sub1 &&
			test_dir_is_empty sub1
		)
	
Cleared directory 'init'
ok 77 - submodule deinit fails when the submodule contains untracked files unless forced

expecting success: 
	git submodule update --init &&
	(
		cd init &&
		git checkout HEAD^
	) &&
	test_must_fail git submodule deinit init &&
	test -n "$(git config --get-regexp "submodule\.example\.")" &&
	test -f example2/.git &&
	git submodule deinit -f init >actual &&
	test -z "$(git config --get-regexp "submodule\.example\.")" &&
	test_i18ngrep "Cleared directory .init" actual &&
	rmdir init

Cloning into 'submodule_update'...
Entering 'sub2'
done.
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Branch add_sub1 set up to track remote branch add_sub1 from origin.
HEAD is now at 5d11ca2 Add sub1
Submodule 'example' (/«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/init2) registered for path 'init'
Entering 'sub3'
ok 31 - git reset --hard: 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
		)
	
Cloning into 'submodule_update'...
[master f097068] new_submodule
 Author: A U Thor <author@example.com>
 2 files changed, 4 insertions(+)
 create mode 160000 submodule2
done.
Switched to a new branch 'replace_sub1_with_file'
[detached HEAD 83199b0] update_submodule
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/clone2/.git/modules/nested1/modules/nested2/modules/nested3
/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/clone2/.git/modules/nested1/modules/nested2/modules/nested3/modules/submodule
ok 6 - use "foreach --recursive" to checkout all submodules

expecting success: 
	(
		cd clone2 &&
		git submodule foreach --recursive "true" > ../actual
	) &&
	test_i18ncmp expect actual

t7112-reset-submodule.sh: 159: cd: can't cd to sub1
Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
[master 5eea228] update_submodule2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 3 deletions(-)
HEAD is now at 0c4f774 Revert "Replace sub1 with file"
Submodule path 'init': checked out '9cdca946443630ae615e1ddfe6174e89fea53615'
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  9cdca94 change subproject

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> 9cdca94

HEAD is now at 0afb3c4... submodule commit 1
[master 6abe3b6] two_new_submodule_commits
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 2 deletions(-)
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 f097068... new_submodule
M	submodule
M	submodule2
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
error: the following file has local modifications:
    init
(use --cached to keep the file, or -f to force removal)
Submodule work tree 'init' contains local modifications; use '-f' to discard them
Cloning into 'sub1'...
Skipping submodule 'none'
done.
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
Cleared directory 'init'
ok 78 - submodule deinit fails when the submodule HEAD does not match unless forced

expecting success: 
	git submodule update --init &&
	git submodule deinit init >actual &&
	test_i18ngrep "Submodule .example. (.*) unregistered for path .init" actual &&
	test_i18ngrep "Cleared directory .init" actual &&
	git submodule deinit init >actual &&
	test_i18ngrep ! "Submodule .example. (.*) unregistered for path .init" actual &&
	test_i18ngrep "Cleared directory .init" actual &&
	git submodule deinit . >actual &&
	test_i18ngrep ! "Submodule .example. (.*) unregistered for path .init" actual &&
	test_i18ngrep "Submodule .example2. (.*) unregistered for path .example2" actual &&
	test_i18ngrep "Cleared directory .init" actual &&
	git submodule deinit . >actual &&
	test_i18ngrep ! "Submodule .example. (.*) unregistered for path .init" actual &&
	test_i18ngrep ! "Submodule .example2. (.*) unregistered for path .example2" actual &&
	test_i18ngrep "Cleared directory .init" actual &&
	rmdir init example2

ok 7 - test messages from "foreach --recursive"

expecting success: 
	(
		cd clone2 &&
		git submodule foreach -q --recursive "echo \$name-\$path" > ../actual
	) &&
	test_cmp expect actual

error: Your local changes to the following files would be overwritten by checkout:
	file
Please, commit your changes or stash them before you can switch branches.
Aborting
Skipping submodule 'submodule1'
ok 32 - git reset --hard: 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
		)
	
Submodule 'example' (/«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/init2) registered for path 'init'
Unable to checkout '4301fd3e4110d3b6212c19aed3094150392545b9' in submodule path 'submodule'
Submodule path 'submodule2': checked out '63550025de24fe5dc1a12e7b0c6d73ec59137ab7'
Cloning into 'submodule_update'...
ok 30 - submodule update continues after checkout error

expecting success: 
	(cd super &&
	 git reset --hard HEAD &&
	 git checkout master &&
	 git submodule update &&
	 (cd submodule &&
	  git submodule add ../submodule subsubmodule &&
	  git submodule init &&
	  git commit -m "new_subsubmodule"
	 ) &&
	 git add submodule &&
	 git commit -m "update_submodule" &&
	 (cd submodule &&
	  (cd subsubmodule &&
	   test_commit "update_subsubmodule" file
	  ) &&
	  git add subsubmodule &&
	  test_commit "update_submodule_again" file &&
	  (cd subsubmodule &&
	   test_commit "update_subsubmodule_again" file
	  ) &&
	  test_commit "update_submodule_again_again" file
	 ) &&
	 (cd submodule2 &&
	  git rev-parse --verify HEAD >../expect &&
	  test_commit "update_submodule2_again" file
	 ) &&
	 git add submodule &&
	 git add submodule2 &&
	 git commit -m "new_commits" &&
	 git checkout HEAD^ &&
	 (cd submodule &&
	  git checkout HEAD^ &&
	  (cd subsubmodule &&
	   echo "" > file
	  )
	 ) &&
	 test_must_fail git submodule update --recursive &&
	 (cd submodule2 &&
	  git rev-parse --verify HEAD >../actual
	 ) &&
	 test_cmp expect actual
	)

HEAD is now at f097068 new_submodule
done.
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.
Previous HEAD position was f097068... new_submodule
Switched to branch 'master'
M	submodule
M	submodule2
Your branch is ahead of 'origin/master' by 8 commits.
  (use "git push" to publish your local commits)
error: 8ed2e6719f8484ce01fa3ce133fe42d25c2441b8^{commit}: expected commit type, but the object dereferences to tree type
fatal: Needed a single revision
Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
HEAD is now at 4ba2fe2 Revert "Replace sub1 with directory"
Submodule path 'init': checked out '9cdca946443630ae615e1ddfe6174e89fea53615'
ok 8 - test "foreach --quiet --recursive"

expecting success: 
	git clone super clone3 &&
	(
		cd clone3 &&
		test_must_fail git rev-parse --resolve-git-dir sub1/.git &&
		test_must_fail git rev-parse --resolve-git-dir sub2/.git &&
		test_must_fail git rev-parse --resolve-git-dir sub3/.git &&
		test_must_fail git rev-parse --resolve-git-dir nested1/.git &&
		git submodule update --init --recursive &&
		git rev-parse --resolve-git-dir sub1/.git &&
		git rev-parse --resolve-git-dir sub2/.git &&
		git rev-parse --resolve-git-dir sub3/.git &&
		git rev-parse --resolve-git-dir nested1/.git &&
		git rev-parse --resolve-git-dir nested1/nested2/.git &&
		git rev-parse --resolve-git-dir nested1/nested2/nested3/.git &&
		git rev-parse --resolve-git-dir nested1/nested2/nested3/submodule/.git
	)

Skipping submodule 'none'
Cloning into 'clone3'...
done.
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
fatal: not a gitdir 'sub1/.git'
fatal: not a gitdir 'sub2/.git'
fatal: not a gitdir 'sub3/.git'
fatal: not a gitdir 'nested1/.git'
Cloning into 'sub1'...
Skipping submodule 'submodule1'
done.
Submodule 'example' (/«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/init2) unregistered for path 'init'
Cleared directory 'init'
Submodule 'nested1' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/nested1) registered for path 'nested1'
Submodule path 'submodule2': checked out '5eea2280dfd25c6fa1d65bea054215e215b29ff5'
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
Submodule 'foo1' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/submodule) registered for path 'sub1'
ok 33 - git reset --hard: 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
		)
	
Cleared directory 'init'
Submodule 'foo2' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/submodule) registered for path 'sub2'
Cloning into 'subsubmodule'...
done.
Cloning into 'submodule_update'...
Submodule 'foo3' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/submodule) registered for path 'sub3'
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Cloning into 'nested1'...
done.
[detached HEAD b086af9] new_subsubmodule
 Author: A U Thor <author@example.com>
 2 files changed, 4 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 subsubmodule
Submodule 'example2' (/«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/init2) unregistered for path 'example2'
Submodule path 'nested1': checked out 'b23f134787d96fae589a6b76da41f4db112fc8db'
Cleared directory 'init'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
[master d205d12] update_submodule
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 55e4edf] update_subsubmodule
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 3 deletions(-)
Submodule 'nested2' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/nested2) registered for path 'nested2'
Cloning into 'sub1'...
[detached HEAD a8233e7] update_submodule_again
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 2 deletions(-)
done.
[master 6a7dc08] update_subsubmodule_again
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'nested2'...
Cleared directory 'init'
[detached HEAD e158d13] update_submodule_again_again
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 79 - submodule deinit is silent when used on an uninitialized submodule

expecting success: 
	git submodule update --init &&
	(
		cd init &&
		rm .git &&
		cp -R ../.git/modules/example .git &&
		GIT_WORK_TREE=. git config --unset core.worktree
	) &&
	test_must_fail git submodule deinit init &&
	test_must_fail git submodule deinit -f init &&
	test -d init/.git &&
	test -n "$(git config --get-regexp "submodule\.example\.")"

done.
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
[detached HEAD 7f9b1b5] update_submodule2_again
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
warning: unable to rmdir sub1: Directory not empty
HEAD is now at 8a72081 Revert "Add sub1"
Submodule path 'nested1/nested2': checked out '2e69c85de92bf5f316f3c67b5e492f287f5a6542'
[master 640e591] new_commits
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 2 deletions(-)
Submodule 'example2' (/«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/init2) registered for path 'example2'
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 d205d12... update_submodule
M	submodule
M	submodule2
ok 34 - git reset --hard: 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
		)
	
Previous HEAD position was e158d13... update_submodule_again_again
HEAD is now at a8233e7... update_submodule_again
M	subsubmodule
Submodule 'example' (/«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/init2) registered for path 'init'
Submodule 'nested3' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/nested3) registered for path 'nested3'
Cloning into 'submodule_update'...
done.
Cloning into 'nested3'...
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
done.
Submodule path 'example2': checked out 'ba0477b3a92611ecd7e3d7526eea3b1f6ebfe802'
Skipping submodule 'none'
Submodule path 'nested1/nested2/nested3': checked out '5ec83512b76a0b8170b899f8e643913c3e9b72d9'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
Submodule path 'init': checked out '9cdca946443630ae615e1ddfe6174e89fea53615'
Submodule 'submodule' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/submodule) registered for path 'submodule'
Submodule path 'submodule': checked out 'b086af9ed448e03899fa61b80fd2abf238a70003'
Cloning into 'sub1'...
Cloning into 'submodule'...
done.
Submodule work tree 'init' contains a .git directory
done.
(use 'rm -rf' if you really want to remove it including all of its history)
error: Your local changes to the following files would be overwritten by checkout:
	file
Please, commit your changes or stash them before you can switch branches.
Aborting
Unable to checkout '63550025de24fe5dc1a12e7b0c6d73ec59137ab7' in submodule path 'submodule/subsubmodule'
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
Skipping submodule 'submodule1'
Submodule work tree 'init' contains a .git directory
Submodule path 'nested1/nested2/nested3/submodule': checked out '509f622a4f36a3e472affcf28fa959174f3dd5b5'
(use 'rm -rf' if you really want to remove it including all of its history)
ok 80 - submodule deinit fails when submodule has a .git directory even when forced

expecting success: 
	svname=$(printf "\303\245 \303\244\303\266") &&
	mkdir "$svname" &&
	(
		cd "$svname" &&
		git init &&
		>sub &&
		git add sub &&
		git commit -m "init sub"
	) &&
	git submodule add ./"$svname" &&
	git submodule >&2 &&
	test -n "$(git submodule | grep "$svname")"

Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/å äö/.git/
[master (root-commit) ac8413a] init sub
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 sub
Submodule path 'submodule2': checked out '5eea2280dfd25c6fa1d65bea054215e215b29ff5'
Cloning into 'sub1'...
warning: unable to rmdir sub1: Directory not empty
HEAD is now at 8a72081 Revert "Add sub1"
Failed to recurse into submodule path 'submodule'
done.
ok 31 - submodule update continues after recursive checkout error

expecting success: 
	(cd super &&
	 git checkout master &&
	 git reset --hard HEAD &&
	 (cd submodule &&
	  (cd subsubmodule &&
	   git reset --hard HEAD
	  )
	 ) &&
	 git submodule update --recursive &&
	 (cd submodule &&
	  test_commit "update_submodule_2" file
	 ) &&
	 (cd submodule2 &&
	  test_commit "update_submodule2_2" file
	 ) &&
	 git add submodule &&
	 git add submodule2 &&
	 git commit -m "two_new_submodule_commits" &&
	 (cd submodule &&
	  git checkout master &&
	  test_commit "conflict" file &&
	  echo "conflict" > file
	 ) &&
	 git checkout HEAD^ &&
	 (cd submodule2 &&
	  git rev-parse --verify HEAD >../expect
	 ) &&
	 git config submodule.submodule.update merge &&
	 test_must_fail git submodule update &&
	 (cd submodule2 &&
	  git rev-parse --verify HEAD >../actual
	 ) &&
	 test_cmp expect actual
	)

Adding existing repo at 'å äö' to the index
Previous HEAD position was d205d12... update_submodule
Switched to branch 'master'
M	submodule
M	submodule2
Your branch is ahead of 'origin/master' by 10 commits.
  (use "git push" to publish your local commits)
HEAD is now at 640e591 new_commits
Submodule path 'sub1': checked out '0c90624ab7f1aaa301d3bb79f60dcfed1ec4897f'
ok 35 - git reset --hard: 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
		)
	
HEAD is now at 6a7dc08 update_subsubmodule_again
Cloning into 'submodule_update'...
 ba0477b3a92611ecd7e3d7526eea3b1f6ebfe802 example2 (rev-1-2-gba0477b)
Cloning into 'sub2'...
done.
done.
 9cdca946443630ae615e1ddfe6174e89fea53615 init (rev-1-1-g9cdca94)
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
 ac8413ab54d5b842a4ac9b1bb82796fa240f9dc7 å äö (heads/master)
Submodule path 'sub2': checked out '0c90624ab7f1aaa301d3bb79f60dcfed1ec4897f'
Skipping submodule 'none'
Cloning into 'sub3'...
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
done.
Submodule path 'submodule': checked out 'e158d134d5ea0a652b5dab9ef19f14310988624e'
Cloning into 'sub1'...
ok 81 - submodule with UTF-8 name

expecting success: 
	mkdir super &&
	pwd=$(pwd) &&
	(
		cd super &&
		git init &&
		git submodule add --depth=1 file://"$pwd"/example2 submodule &&
		(
			cd submodule &&
			test 1 = $(git log --oneline | wc -l)
		)
	)

Submodule path 'sub3': checked out '509f622a4f36a3e472affcf28fa959174f3dd5b5'
done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7400-submodule-basic/super/.git/
/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/clone3/.git/modules/foo1
/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/clone3/.git/modules/foo2
/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/clone3/.git/modules/foo3
/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/clone3/.git/modules/nested1
/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/clone3/.git/modules/nested1/modules/nested2
Submodule path 'submodule/subsubmodule': checked out '55e4edfe7b455b73e3bf00bae12ae32eebc09b5e'
/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/clone3/.git/modules/nested1/modules/nested2/modules/nested3
/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/clone3/.git/modules/nested1/modules/nested2/modules/nested3/modules/submodule
ok 9 - use "update --recursive" to checkout all submodules

Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
Cloning into 'submodule'...
Skipping submodule 'submodule1'
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
warning: unable to rmdir sub1: Directory not empty
expecting success: 
	(
		cd clone3 &&
		git submodule status --recursive > ../actual
	) &&
	test_cmp expect actual

HEAD is now at 5626010 Replace sub1 with directory
test_must_fail: command succeeded: git reset --hard replace_sub1_with_directory
not ok 36 - git reset --hard: 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
		)
	
Submodule path 'submodule2': checked out '7f9b1b5072a357fe7152a0acb484d2a335b33b65'
Cloning into 'submodule_update'...
[detached HEAD ff8f46c] update_submodule_2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
done.
ok 82 - submodule add clone shallow submodule

[detached HEAD 57a1516] update_submodule2_2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
# passed all 82 test(s)
1..82
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
[master 61717e1] two_new_submodule_commits
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 2 deletions(-)
warning: unable to rmdir subsubmodule: Directory not empty
Previous HEAD position was ff8f46c... update_submodule_2
Switched to branch 'master'
Your branch is behind 'origin/master' by 3 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)
[master 08cc343] conflict
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
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 640e591... new_commits
M	submodule
M	submodule2
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'sub1'...
done.
*** t7408-submodule-reference.sh ***
Skipping submodule 'none'
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7408-submodule-reference/.git/
expecting success: test_create_repo A && cd A &&
echo first > file1 &&
git add file1 &&
git commit -m A-initial
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7408-submodule-reference/A/.git/
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
[master (root-commit) 3509402] A-initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file1
ok 1 - preparing first repository

expecting success: git clone A B && cd B &&
echo second > file2 &&
git add file2 &&
git commit -m B-addition &&
git repack -a -d &&
git prune
Cloning into 'B'...
done.
Merging:
08cc343 conflict
virtual e158d134d5ea0a652b5dab9ef19f14310988624e
found 1 common ancestor:
0c90624 upstream
Auto-merging file
CONFLICT (content): Merge conflict in file
[master 03a25bb] B-addition
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file2
warning: unable to rmdir sub1: Directory not empty
Automatic merge failed; fix conflicts and then commit the result.
Unable to merge 'e158d134d5ea0a652b5dab9ef19f14310988624e' in submodule path 'submodule'
HEAD is now at 5626010 Replace sub1 with directory
test_must_fail: command succeeded: git reset --hard replace_sub1_with_directory
ok 32 - submodule update exit immediately in case of merge conflict

expecting success: 
	(cd super &&
	 git checkout master &&
	 git reset --hard HEAD &&
	 (cd submodule &&
	  git reset --hard HEAD &&
	  git submodule update --recursive
	 ) &&
	 (cd submodule &&
	  test_commit "update_submodule_3" file
	 ) &&
	 (cd submodule2 &&
	  test_commit "update_submodule2_3" file
	 ) &&
	 git add submodule &&
	 git add submodule2 &&
	 git commit -m "two_new_submodule_commits" &&
	 (cd submodule &&
	  git checkout master &&
	  test_commit "conflict2" file &&
	  echo "conflict" > file
	 ) &&
	 git checkout HEAD^ &&
	 (cd submodule2 &&
	  git rev-parse --verify HEAD >../expect
	 ) &&
	 git config submodule.submodule.update rebase &&
	 test_must_fail git submodule update &&
	 (cd submodule2 &&
	  git rev-parse --verify HEAD >../actual
	 ) &&
	 test_cmp expect actual
	)

ok 10 - test "status --recursive"

not ok 37 - git reset --hard: 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
		)
	
expecting success: 
	(
		cd clone3 &&
		(
			cd nested1/nested2 &&
			test_commit file2
		) &&
		git submodule status --cached --recursive -- nested1 > ../actual
	) &&
	test_cmp expect actual

[detached HEAD 25d56d1] file2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file2.t
Previous HEAD position was 640e591... new_commits
Switched to branch 'master'
M	submodule
Your branch is ahead of 'origin/master' by 11 commits.
  (use "git push" to publish your local commits)
HEAD is now at 61717e1 two_new_submodule_commits
warning: unable to rmdir subsubmodule: Directory not empty
HEAD is now at 08cc343 conflict
ok 2 - preparing second repository

expecting success: test_create_repo super && cd super &&
echo file > file &&
git add file &&
git commit -m B-super-initial
Cloning into 'submodule_update'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7408-submodule-reference/super/.git/
[master (root-commit) af032fe] B-super-initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
done.
ok 3 - preparing superproject

expecting success: cd super && git submodule add --reference ../B "file://$base_dir/A" sub &&
git commit -m B-super-added
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
[master 85c1732] update_submodule_3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'sub'...
[detached HEAD 0a8d0eb] update_submodule2_3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 14ad624] two_new_submodule_commits
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 2 deletions(-)
Already on 'master'
Your branch and 'origin/master' have diverged,
and have 2 and 3 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
[master 10845e8] conflict2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 1049ed6] B-super-added
 Author: A U Thor <author@example.com>
 2 files changed, 4 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 sub
ok 4 - submodule add --reference

expecting success: test_line_count = 1 super/.git/modules/sub/objects/info/alternates
ok 5 - after add: existence of info/alternates

expecting success: cd super/sub &&
echo "0 objects, 0 kilobytes" > expected &&
git count-objects > current &&
diff expected current
ok 6 - that reference gets used with add

expecting success: git clone super super-clone
Cloning into 'super-clone'...
Cloning into 'sub1'...
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 61717e1... two_new_submodule_commits
M	submodule
M	submodule2
done.
ok 7 - cloning superproject

expecting success: cd super-clone && git submodule update --init --reference ../B
done.
ok 11 - ensure "status --cached --recursive" preserves the --cached flag

expecting success: 
	git clone --recursive super clone4 &&
	(
		cd clone4 &&
		git rev-parse --resolve-git-dir .git &&
		git rev-parse --resolve-git-dir sub1/.git &&
		git rev-parse --resolve-git-dir sub2/.git &&
		git rev-parse --resolve-git-dir sub3/.git &&
		git rev-parse --resolve-git-dir nested1/.git &&
		git rev-parse --resolve-git-dir nested1/nested2/.git &&
		git rev-parse --resolve-git-dir nested1/nested2/nested3/.git &&
		git rev-parse --resolve-git-dir nested1/nested2/nested3/submodule/.git
	)

Cloning into 'clone4'...
done.
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
Submodule 'sub' (file:///«PKGBUILDDIR»/t/trash directory.t7408-submodule-reference/A) registered for path 'sub'
Skipping submodule 'none'
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
HEAD is now at b6a744b Replace sub1 with file
test_must_fail: command succeeded: git reset --hard replace_sub1_with_file
Cloning into 'sub'...
not ok 38 - git reset --hard: 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
		)
	
Submodule 'nested1' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/nested1) registered for path 'nested1'
Submodule 'foo1' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/submodule) registered for path 'sub1'
Cloning into 'submodule_update'...
done.
Submodule path 'sub': checked out '3509402b1f5e661c071e540dde822c6f6f7c4198'
Submodule 'foo2' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/submodule) registered for path 'sub2'
ok 8 - update with reference

expecting success: test_line_count = 1 super-clone/.git/modules/sub/objects/info/alternates
ok 9 - after update: existence of info/alternates

expecting success: cd super-clone/sub &&
echo "0 objects, 0 kilobytes" > expected &&
git count-objects > current &&
diff expected current
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 10 - that reference gets used with update

# passed all 10 test(s)
1..10
Submodule 'foo3' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/submodule) registered for path 'sub3'
Cannot rebase: You have unstaged changes.
Please commit or stash them.
Unable to rebase 'ff8f46c652fe66036803f1ba78e2d2cdb971984f' in submodule path 'submodule'
*** t7409-submodule-detached-worktree.sh ***
ok 33 - submodule update exit immediately after recursive rebase error

expecting success: 
	(cd super &&
	 git submodule add ../submodule s1 &&
	 test_must_fail git submodule add ../merging s1
	)

Cloning into 'nested1'...
expecting success: 
	git init --bare remote &&
	test_create_repo bundle1 &&
	(
		cd bundle1 &&
		test_commit "shoot" &&
		git rev-parse --verify HEAD >../expect
	) &&
	mkdir home &&
	(
		cd home &&
		GIT_WORK_TREE="$(pwd)" &&
		GIT_DIR="$(pwd)/.dotfiles" &&
		export GIT_WORK_TREE GIT_DIR &&
		git clone --bare ../remote .dotfiles &&
		git submodule add ../bundle1 .vim/bundle/sogood &&
		test_commit "sogood" &&
		(
			unset GIT_WORK_TREE GIT_DIR &&
			cd .vim/bundle/sogood &&
			git rev-parse --verify HEAD >actual &&
			test_cmp ../../../../expect actual
		) &&
		git push origin master
	) &&
	mkdir home2 &&
	(
		cd home2 &&
		git clone --bare ../remote .dotfiles &&
		GIT_WORK_TREE="$(pwd)" &&
		GIT_DIR="$(pwd)/.dotfiles" &&
		export GIT_WORK_TREE GIT_DIR &&
		git checkout master &&
		git submodule update --init &&
		(
			unset GIT_WORK_TREE GIT_DIR &&
			cd .vim/bundle/sogood &&
			git rev-parse --verify HEAD >actual &&
			test_cmp ../../../../expect actual
		)
	)

done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7409-submodule-detached-worktree/remote/
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7409-submodule-detached-worktree/bundle1/.git/
[master (root-commit) d074fcf] shoot
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 shoot.t
Cloning into 's1'...
Cloning into bare repository '.dotfiles'...
Cloning into 'sub1'...
done.
Submodule path 'nested1': checked out 'b23f134787d96fae589a6b76da41f4db112fc8db'
warning: You appear to have cloned an empty repository.
done.
done.
Submodule 'nested2' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/nested2) registered for path 'nested2'
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
Cloning into '.vim/bundle/sogood'...
done.
Cloning into 'nested2'...
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
done.
's1' already exists in the index
ok 34 - add different submodules to the same path

expecting success: 
	(cd super &&
	 mkdir deeper &&
	 git submodule add ../submodule deeper/submodule &&
	 (cd deeper/submodule &&
	  git log > ../../expected
	 ) &&
	 (cd .git/modules/deeper/submodule &&
	  git log > ../../../../actual
	 ) &&
	 test_cmp actual expected
	)

HEAD is now at b6a744b Replace sub1 with file
test_must_fail: command succeeded: git reset --hard replace_sub1_with_file
not ok 39 - git reset --hard: 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
		)
	
[master (root-commit) 2f89248] sogood
 Author: A U Thor <author@example.com>
 3 files changed, 5 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 .vim/bundle/sogood
 create mode 100644 sogood.t
Submodule path 'nested1/nested2': checked out '2e69c85de92bf5f316f3c67b5e492f287f5a6542'
Cloning into 'deeper/submodule'...
Cloning into 'submodule_update'...
done.
To /«PKGBUILDDIR»/t/trash directory.t7409-submodule-detached-worktree/home/../remote
 * [new branch]      master -> master
Cloning into bare repository '.dotfiles'...
done.
Submodule 'nested3' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/nested3) registered for path 'nested3'
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Already on 'master'
ok 35 - submodule add places git-dir in superprojects git-dir

expecting success: 
	(cd super &&
	 git commit -m "added submodule"
	) &&
	git clone super super2 &&
	(cd super2 &&
	 git submodule init deeper/submodule &&
	 git submodule update &&
	 (cd deeper/submodule &&
	  git log > ../../expected
	 ) &&
	 (cd .git/modules/deeper/submodule &&
	  git log > ../../../../actual
	 ) &&
	 test_cmp actual expected
	)

Cloning into 'nested3'...
[detached HEAD fc57fbc] added submodule
 Author: A U Thor <author@example.com>
 3 files changed, 8 insertions(+)
 create mode 160000 deeper/submodule
 create mode 160000 s1
Cloning into 'super2'...
done.
done.
Note: checking out 'fc57fbc08f24e669c30e43698778c3bffd2acfec'.

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>

Submodule '.vim/bundle/sogood' (/«PKGBUILDDIR»/t/trash directory.t7409-submodule-detached-worktree/home2/../bundle1) registered for path '.vim/bundle/sogood'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
Submodule path 'nested1/nested2/nested3': checked out '5ec83512b76a0b8170b899f8e643913c3e9b72d9'
Cloning into '.vim/bundle/sogood'...
done.
Cloning into 'sub1'...
Submodule 'deeper/submodule' (/«PKGBUILDDIR»/t/trash directory.t7406-submodule-update/submodule) registered for path 'deeper/submodule'
done.
Submodule 'submodule' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/submodule) registered for path 'submodule'
Submodule path '.vim/bundle/sogood': checked out 'd074fcf17f7c15e9e139fe2d6e7ca796a5e616e7'
ok 1 - submodule on detached working tree

expecting success: 
	mkdir home3 &&
	(
		cd home3 &&
		GIT_DIR="$(pwd)/.dotfiles" &&
		export GIT_DIR &&
		git clone --bare ../remote "$GIT_DIR" &&
		git config core.bare false &&
		git config core.worktree .. &&
		git checkout master &&
		git submodule add ../bundle1 .vim/bundle/dupe &&
		test_commit "dupe" &&
		git push origin master
	) &&
	(
		cd home &&
		GIT_DIR="$(pwd)/.dotfiles" &&
		export GIT_DIR &&
		git config core.bare false &&
		git config core.worktree .. &&
		git pull &&
		git submodule update --init &&
		test -f .vim/bundle/dupe/shoot.t
	)

Cloning into 'submodule'...
Cloning into bare repository '/«PKGBUILDDIR»/t/trash directory.t7409-submodule-detached-worktree/home3/.dotfiles'...
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
done.
done.
Cloning into 'deeper/submodule'...
Already on 'master'
done.
Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
HEAD is now at 8087219 Modify sub1
Submodule path 'nested1/nested2/nested3/submodule': checked out '509f622a4f36a3e472affcf28fa959174f3dd5b5'
Submodule path 'deeper/submodule': checked out '63550025de24fe5dc1a12e7b0c6d73ec59137ab7'
Cloning into '.vim/bundle/dupe'...
done.
Cloning into 'sub1'...
done.
Submodule path 'sub1': checked out '6bb2c777177005d6a4fc429e4e7f5b28e83e1e0c'
[master e996493] dupe
 Author: A U Thor <author@example.com>
 3 files changed, 5 insertions(+)
 create mode 160000 .vim/bundle/dupe
 create mode 100644 dupe.t
Submodule path 'sub1': checked out '0c90624ab7f1aaa301d3bb79f60dcfed1ec4897f'
ok 40 - git reset --hard: 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
		)
	
To /«PKGBUILDDIR»/t/trash directory.t7409-submodule-detached-worktree/home3/../remote
   2f89248..e996493  master -> master
Cloning into 'sub2'...
Cloning into 'submodule_update'...
ok 36 - submodule update places git-dir in superprojects git-dir

expecting success: 
	(cd super2 &&
	 (cd deeper/submodule &&
	  git submodule add ../submodule subsubmodule &&
	  (cd subsubmodule &&
	   git log > ../../../expected
	  ) &&
	  git commit -m "added subsubmodule" &&
	  git push origin :
	 ) &&
	 (cd .git/modules/deeper/submodule/modules/subsubmodule &&
	  git log > ../../../../../actual
	 ) &&
	 git add deeper/submodule &&
	 git commit -m "update submodule" &&
	 git push origin : &&
	 test_cmp actual expected
	)

done.
done.
From /«PKGBUILDDIR»/t/trash directory.t7409-submodule-detached-worktree/home/../remote
 * branch            HEAD       -> FETCH_HEAD
Updating 2f89248..e996493
Fast-forward
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
 .gitmodules      | 3 +++
 .vim/bundle/dupe | 1 +
 dupe.t           | 1 +
 3 files changed, 5 insertions(+)
 create mode 160000 .vim/bundle/dupe
 create mode 100644 dupe.t
Submodule path 'sub2': checked out '0c90624ab7f1aaa301d3bb79f60dcfed1ec4897f'
Cloning into 'subsubmodule'...
done.
Cloning into 'sub3'...
Submodule '.vim/bundle/dupe' (/«PKGBUILDDIR»/t/trash directory.t7409-submodule-detached-worktree/home/../bundle1) registered for path '.vim/bundle/dupe'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
done.
[detached HEAD 672e1ef] added subsubmodule
 Author: A U Thor <author@example.com>
 2 files changed, 4 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 subsubmodule
Everything up-to-date
Cloning into 'sub1'...
Cloning into '.vim/bundle/dupe'...
Submodule path 'sub3': checked out '509f622a4f36a3e472affcf28fa959174f3dd5b5'
done.
[detached HEAD 0533749] update submodule
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
done.
.git
Everything up-to-date
ok 37 - submodule add places git-dir in superprojects git-dir recursive

expecting success: 
	mkdir super_update_r &&
	(cd super_update_r &&
	 git init --bare
	) &&
	mkdir subsuper_update_r &&
	(cd subsuper_update_r &&
	 git init --bare
	) &&
	mkdir subsubsuper_update_r &&
	(cd subsubsuper_update_r &&
	 git init --bare
	) &&
	git clone subsubsuper_update_r subsubsuper_update_r2 &&
	(cd subsubsuper_update_r2 &&
	 test_commit "update_subsubsuper" file &&
	 git push origin master
	) &&
	git clone subsuper_update_r subsuper_update_r2 &&
	(cd subsuper_update_r2 &&
	 test_commit "update_subsuper" file &&
	 git submodule add ../subsubsuper_update_r subsubmodule &&
	 git commit -am "subsubmodule" &&
	 git push origin master
	) &&
	git clone super_update_r super_update_r2 &&
	(cd super_update_r2 &&
	 test_commit "update_super" file &&
	 git submodule add ../subsuper_update_r submodule &&
	 git commit -am "submodule" &&
	 git push origin master
	) &&
	rm -rf super_update_r2 &&
	git clone super_update_r super_update_r2 &&
	(cd super_update_r2 &&
	 git submodule update --init --recursive >actual &&
	 test_i18ngrep "Submodule path .submodule/subsubmodule.: checked out" actual &&
	 (cd submodule/subsubmodule &&
	  git log > ../../expected
	 ) &&
	 (cd .git/modules/submodule/modules/subsubmodule
	  git log > ../../../../../actual
	 )
	 test_cmp actual expected
	)

/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/clone4/.git/modules/foo1
/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/clone4/.git/modules/foo2
/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/clone4/.git/modules/foo3
/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/clone4/.git/modules/nested1
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7406-submodule-update/super_update_r/
/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/clone4/.git/modules/nested1/modules/nested2
/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/clone4/.git/modules/nested1/modules/nested2/modules/nested3
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7406-submodule-update/subsuper_update_r/
/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/clone4/.git/modules/nested1/modules/nested2/modules/nested3/modules/submodule
ok 12 - use "git clone --recursive" to checkout all submodules

expecting success: 
	git clone super "common objects" &&
	git clone super clone5 &&
	(
		cd clone5 &&
		test_must_fail git rev-parse --resolve-git-dir d nested1/.git &&
		git submodule update --init --recursive --reference="$(dirname "$PWD")/common objects" &&
		git rev-parse --resolve-git-dir nested1/.git &&
		git rev-parse --resolve-git-dir nested1/nested2/.git &&
		git rev-parse --resolve-git-dir nested1/nested2/nested3/.git &&
		test -f .git/modules/nested1/objects/info/alternates &&
		test -f .git/modules/nested1/modules/nested2/objects/info/alternates &&
		test -f .git/modules/nested1/modules/nested2/modules/nested3/objects/info/alternates
	)

Cloning into 'common objects'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7406-submodule-update/subsubsuper_update_r/
Cloning into 'subsubsuper_update_r2'...
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
Submodule path '.vim/bundle/dupe': checked out 'd074fcf17f7c15e9e139fe2d6e7ca796a5e616e7'
done.
warning: You appear to have cloned an empty repository.
Cloning into 'clone5'...
done.
done.
[master (root-commit) e13bbd9] update_subsubsuper
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 2 - submodule on detached working pointed by core.worktree

Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
# passed all 2 test(s)
1..2
HEAD is now at 9cc98d3 Invalid sub1 commit
fatal: not a gitdir 'd'
To /«PKGBUILDDIR»/t/trash directory.t7406-submodule-update/subsubsuper_update_r
 * [new branch]      master -> master
Cloning into 'subsuper_update_r2'...
warning: You appear to have cloned an empty repository.
done.
[master (root-commit) 7cab57e] update_subsuper
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
*** t7410-submodule-checkout-to.sh ***
Submodule 'nested1' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/nested1) registered for path 'nested1'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7410-submodule-checkout-to/.git/
expecting success: mkdir -p origin/sub && ( cd origin/sub && git init &&
	echo file1 >file1 &&
	git add file1 &&
	git commit -m file1 ) &&
    mkdir -p origin/main && ( cd origin/main && git init &&
	git submodule add ../sub &&
	git commit -m "add sub" ) &&
    ( cd origin/sub &&
	echo file1updated >file1 &&
	git add file1 &&
	git commit -m "file1 updated" ) &&
    ( cd origin/main/sub && git pull ) &&
    ( cd origin/main &&
	git add sub &&
	git commit -m "sub updated" )
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7410-submodule-checkout-to/origin/sub/.git/
Submodule 'foo1' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/submodule) registered for path 'sub1'
[master (root-commit) 7d286df] file1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file1
Cloning into 'subsubmodule'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7410-submodule-checkout-to/origin/main/.git/
done.
Submodule 'foo2' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/submodule) registered for path 'sub2'
fatal: reference is not a tree: 0123456789012345678901234567890123456789
Unable to checkout '0123456789012345678901234567890123456789' in submodule path 'sub1'
ok 41 - git reset --hard: 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
		)
	
Submodule 'foo3' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/submodule) registered for path 'sub3'
Cloning into 'sub'...
[master 796fb1a] subsubmodule
 Author: A U Thor <author@example.com>
 2 files changed, 4 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 subsubmodule
done.
Cloning into 'nested1'...
Cloning into 'submodule_update'...
done.
To /«PKGBUILDDIR»/t/trash directory.t7406-submodule-update/subsuper_update_r
 * [new branch]      master -> master
Cloning into 'super_update_r2'...
done.
warning: You appear to have cloned an empty repository.
done.
Switched to a new branch 'invalid_sub1'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
[master (root-commit) 489f12d] update_super
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
[master (root-commit) 8fbe334] add sub
 Author: A U Thor <author@example.com>
 2 files changed, 4 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 sub
fatal: Needed a single revision
[master e649865] file1 updated
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
Submodule path 'nested1': checked out 'b23f134787d96fae589a6b76da41f4db112fc8db'
HEAD is now at a8d019f Revert "Invalid sub1 commit"
From /«PKGBUILDDIR»/t/trash directory.t7410-submodule-checkout-to/origin/sub
   7d286df..e649865  master     -> origin/master
Updating 7d286df..e649865
Fast-forward
Cloning into 'submodule'...
Submodule 'nested2' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/nested2) registered for path 'nested2'
 file1 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
done.
[master 49ab738] sub updated
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - setup: make origin

expecting success: mkdir clone && ( cd clone &&
	git clone --recursive "$base_path/origin/main")
Cloning into 'main'...
done.
Cloning into 'nested2'...
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7112-reset-submodule/submodule_update_repo/.) registered for path 'sub1'
done.
[master 8dc9f2e] submodule
 Author: A U Thor <author@example.com>
 2 files changed, 4 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 submodule
Cloning into 'sub1'...
To /«PKGBUILDDIR»/t/trash directory.t7406-submodule-update/super_update_r
 * [new branch]      master -> master
Submodule path 'nested1/nested2': checked out '2e69c85de92bf5f316f3c67b5e492f287f5a6542'
done.
Submodule 'sub' (/«PKGBUILDDIR»/t/trash directory.t7410-submodule-checkout-to/origin/sub) registered for path 'sub'
Cloning into 'super_update_r2'...
done.
Submodule 'nested3' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/nested3) registered for path 'nested3'
Cloning into 'sub'...
Submodule path 'sub1': checked out '621ccb8a0648a4edc0b5176c59b08a13e8fa9460'
done.
Cloning into 'nested3'...
ok 42 - git reset --hard: modified submodule does not update submodule work tree from invalid commit

# still have 8 known breakage(s)
# passed all remaining 34 test(s)
1..42
Submodule path 'sub': checked out 'e6498659d5b15d66cc3a10c9e6ac274749020c3b'
done.
ok 2 - setup: clone

expecting success: mkdir default_checkout &&
    (cd clone/main &&
	git worktree add "$base_path/default_checkout/main" "$rev1_hash_main")
Cloning into 'submodule'...
Preparing /«PKGBUILDDIR»/t/trash directory.t7410-submodule-checkout-to/default_checkout/main (identifier main)
done.
HEAD is now at 8fbe334 add sub
ok 3 - checkout main

checking known breakage: (cd default_checkout/main && git diff --submodule master"^!" | grep "file1 updated")
*** t7411-submodule-config.sh ***
Submodule path 'nested1/nested2/nested3': checked out '5ec83512b76a0b8170b899f8e643913c3e9b72d9'
not ok 4 - can see submodule diffs just after checkout # TODO known breakage

expecting success: mkdir fully_cloned_submodule &&
    (cd clone/main &&
	git worktree add "$base_path/fully_cloned_submodule/main" "$rev1_hash_main") &&
    (cd fully_cloned_submodule/main && git submodule update)
Preparing /«PKGBUILDDIR»/t/trash directory.t7410-submodule-checkout-to/fully_cloned_submodule/main (identifier main1)
expecting success: 
	mkdir submodule &&
	(cd submodule &&
		git init &&
		echo a >a &&
		git add . &&
		git commit -ma
	) &&
	mkdir super &&
	(cd super &&
		git init &&
		git submodule add ../submodule &&
		git submodule add ../submodule a &&
		git commit -m "add as submodule and as a" &&
		git mv a b &&
		git commit -m "move a to b"
	)

HEAD is now at 8fbe334 add sub
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7411-submodule-config/submodule/.git/
Submodule 'submodule' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/submodule) registered for path 'submodule'
[master (root-commit) 25344de] a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7411-submodule-config/super/.git/
Cloning into 'submodule'...
done.
Cloning into 'sub'...
done.
Cloning into 'submodule'...
Cloning into 'subsubmodule'...
done.
done.
Submodule path 'nested1/nested2/nested3/submodule': checked out '509f622a4f36a3e472affcf28fa959174f3dd5b5'
Submodule path 'sub': checked out '7d286df97cef95232f2d162cd7dbc97db91b6c98'
ok 5 - checkout main and initialize independed clones

expecting success: (cd fully_cloned_submodule/main && git diff --submodule master"^!" | grep "file1 updated")
  > file1 updated
ok 6 - can see submodule diffs after independed cloning

expecting success: mkdir linked_submodule &&
    (cd clone/main &&
	git worktree add "$base_path/linked_submodule/main" "$rev1_hash_main") &&
    (cd clone/main/sub &&
	git worktree add "$base_path/linked_submodule/main/sub" "$rev1_hash_sub")
Preparing /«PKGBUILDDIR»/t/trash directory.t7410-submodule-checkout-to/linked_submodule/main (identifier main2)
Cloning into 'sub1'...
HEAD is now at 8fbe334 add sub
done.
Submodule path 'submodule/subsubmodule': checked out 'e13bbd9c3df4762b3c846e1fb977b29be7746269'
Preparing /«PKGBUILDDIR»/t/trash directory.t7410-submodule-checkout-to/linked_submodule/main/sub (identifier sub)
ok 38 - submodule update places git-dir in superprojects git-dir recursive

expecting success: 
	(cd super &&
	 git reset --hard master &&
	 rm -rf deeper/ &&
	 git submodule add --force ../submodule deeper/submodule
	)

HEAD is now at 7d286df file1
ok 7 - checkout sub manually

expecting success: (cd linked_submodule/main && git diff --submodule master"^!" | grep "file1 updated")
warning: unable to rmdir deeper/submodule: Directory not empty
warning: unable to rmdir s1: Directory not empty
HEAD is now at 14ad624 two_new_submodule_commits
  > file1 updated
ok 8 - can see submodule diffs after manual checkout of linked submodule

# still have 1 known breakage(s)
# passed all remaining 7 test(s)
1..8
Cloning into 'a'...
Submodule path 'sub1': checked out '0c90624ab7f1aaa301d3bb79f60dcfed1ec4897f'
done.
Reactivating local git directory for submodule 'deeper/submodule'.
*** t7500-commit.sh ***
Cloning into 'sub2'...
[master (root-commit) 1e1e171] add as submodule and as a
 Author: A U Thor <author@example.com>
 3 files changed, 8 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 a
 create mode 160000 submodule
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7500-commit/.git/
done.
expecting success: 
	echo content > foo &&
	git add foo &&
	git commit -m "initial commit"

ok 39 - submodule add properly re-creates deeper level submodules

expecting success: 
	(cd super &&
	 H=$(git rev-parse --short HEAD) &&
	 git commit -am "pre move" &&
	 H2=$(git rev-parse --short HEAD) &&
	 git status | sed "s/$H/XXX/" >expect &&
	 H=$(cd submodule2; git rev-parse HEAD) &&
	 git rm --cached submodule2 &&
	 rm -rf submodule2 &&
	 mkdir -p "moved/sub module" &&
	 git update-index --add --cacheinfo 160000 $H "moved/sub module" &&
	 git config -f .gitmodules submodule.submodule2.path "moved/sub module"
	 git commit -am "post move" &&
	 git submodule update &&
	 git status | sed "s/$H2/XXX/" >actual &&
	 test_cmp expect actual
	)

[master d9c6ca2] move a to b
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename a => b (100%)
ok 1 - submodule config cache setup

expecting success: 
	(cd super &&
		test-submodule-config \
			HEAD^ a \
			HEAD b \
			HEAD^ submodule \
			HEAD submodule \
				>actual &&
		test_cmp expect actual
	)

[master (root-commit) 4ceffa3] initial commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
ok 1 - a basic commit in an empty tree should succeed

expecting success: 
	echo changes >> foo &&
	git add foo &&
	(
		GIT_EDITOR="echo hello >\"\$1\"" &&
		export GIT_EDITOR &&
		test_must_fail git commit --template "$PWD"/notexist
	)

ok 2 - test parsing and lookup of submodule config by path

expecting success: 
	(cd super &&
		test-submodule-config --name \
			HEAD^ a \
			HEAD a \
			HEAD^ submodule \
			HEAD submodule \
				>actual &&
		test_cmp expect actual
	)

fatal: could not read '/«PKGBUILDDIR»/t/trash directory.t7500-commit/notexist': No such file or directory
ok 2 - nonexistent template file should return error

expecting success: 
	test_config commit.template "$PWD"/notexist &&
	(
		GIT_EDITOR="echo hello >\"\$1\"" &&
		export GIT_EDITOR &&
		test_must_fail git commit
	)

ok 3 - test parsing and lookup of submodule config by name

expecting success: 
	(cd super &&
		cp .gitmodules .gitmodules.bak &&
		echo "	value = \"" >>.gitmodules &&
		git add .gitmodules &&
		mv .gitmodules.bak .gitmodules &&
		git commit -m "add error" &&
		test-submodule-config \
			HEAD b \
			HEAD submodule \
				>actual &&
		test_cmp expect_error actual
	)

fatal: could not read '/«PKGBUILDDIR»/t/trash directory.t7500-commit/notexist': No such file or directory
ok 3 - nonexistent template file in config should return error

expecting success: 
	echo "template line" > "$TEMPLATE" &&
	test_must_fail git commit --template "$TEMPLATE"

Submodule path 'sub2': checked out '0c90624ab7f1aaa301d3bb79f60dcfed1ec4897f'
Aborting commit; you did not edit the message.
ok 4 - unedited template should not commit

expecting success: 
	echo "# comment in template" >> "$TEMPLATE" &&
	test_must_fail git commit --template "$TEMPLATE"

[detached HEAD 25008d1] pre move
 Author: A U Thor <author@example.com>
 3 files changed, 5 insertions(+), 1 deletion(-)
 create mode 160000 deeper/submodule
[master 1209e5f] add error
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
error: bad config file line 7 in 
Aborting commit; you did not edit the message.
ok 5 - unedited template with comments should not commit

expecting success: 
	(
		test_set_editor "$TEST_DIRECTORY"/t7500/add-signed-off &&
		test_must_fail git commit --template "$TEMPLATE"
	)

ok 4 - error in one submodule config lets continue

expecting success: 
	(cd super &&
		old_a=$(git config submodule.a.url) &&
		old_submodule=$(git config submodule.submodule.url) &&
		git config submodule.a.url git@somewhere.else.net:a.git &&
		git config submodule.submodule.url git@somewhere.else.net:submodule.git &&
		test-submodule-config --url \
			"" b \
			"" submodule \
				>actual &&
		test_cmp expect_url actual &&
		git config submodule.a.path c &&
		test-submodule-config \
			"" c \
			"" submodule \
				>actual &&
		test_cmp expect_local_path actual &&
		git config submodule.a.url $old_a &&
		git config submodule.submodule.url $old_submodule &&
		git config --unset submodule.a.path c
	)

Aborting commit; you did not edit the message.
ok 6 - a Signed-off-by line by itself should not commit

expecting success: 
	(
		test_set_editor "$TEST_DIRECTORY"/t7500/add-comments &&
		test_must_fail git commit --template "$TEMPLATE"
	)

Aborting commit; you did not edit the message.
ok 7 - adding comments to a template should not commit

expecting success: 
	(
		test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
		git commit --template "$TEMPLATE"
	) &&
	commit_msg_is "template linecommit message"

[master 674e84b] template line
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Cloning into 'sub3'...
ok 8 - adding real content to a template should commit

expecting success: 
	echo "short template" > "$TEMPLATE" &&
	echo "new content" >> foo &&
	git add foo &&
	(
		test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
		git commit -t "$TEMPLATE"
	) &&
	commit_msg_is "short templatecommit message"

done.
ok 5 - reading of local configuration

expecting success: 
	(cd super &&
		git config submodule.submodule.fetchrecursesubmodules blabla &&
		test_must_fail test-submodule-config \
			"" b \
			"" submodule \
				>actual.out 2>actual.err &&
		touch expect_fetchrecurse_die.out &&
		test_cmp expect_fetchrecurse_die.out actual.out  &&
		test_cmp expect_fetchrecurse_die.err actual.err  &&
		git config --unset submodule.submodule.fetchrecursesubmodules
	)

[master b008462] short template
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 9 - -t option should be short for --template

expecting success: 
	echo "new template" > "$TEMPLATE" &&
	test_config commit.template "$TEMPLATE" &&
	echo "more content" >> foo &&
	git add foo &&
	(
		test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
		git commit
	) &&
	commit_msg_is "new templatecommit message"

ok 6 - local error in fetchrecursesubmodule dies early

expecting success: 
	(cd super &&
		git config -f .gitmodules \
			submodule.submodule.fetchrecursesubmodules blabla &&
		git add .gitmodules &&
		git config --unset -f .gitmodules \
			submodule.submodule.fetchrecursesubmodules &&
		git commit -m "add error in fetchrecursesubmodules" &&
		test-submodule-config \
			HEAD b \
			HEAD submodule \
				>actual &&
		test_cmp expect_error actual  &&
		git reset --hard HEAD^
	)

[master a514d04] new template
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master 564e011] add error in fetchrecursesubmodules
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Submodule path 'sub3': checked out '509f622a4f36a3e472affcf28fa959174f3dd5b5'
rm 'submodule2'
ok 10 - config-specified template should commit

expecting success: 
	echo "still more content" >> foo &&
	git add foo &&
	GIT_EDITOR="$TEST_DIRECTORY"/t7500/add-content git commit --template "$TEMPLATE" \
		-m "command line msg" &&
	commit_msg_is "command line msg"

HEAD is now at 1209e5f add error
ok 7 - error in history in fetchrecursesubmodule lets continue

# passed all 7 test(s)
1..7
[master bc07f80] command line msg
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/clone5/.git/modules/nested1
ok 11 - explicit commit message should override template

expecting success: 
	echo "content galore" >> foo &&
	git add foo &&
	echo "standard input msg" |
	(
		test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
		git commit --template "$TEMPLATE" --file -
	) &&
	commit_msg_is "standard input msg"

/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/clone5/.git/modules/nested1/modules/nested2
/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/clone5/.git/modules/nested1/modules/nested2/modules/nested3
ok 13 - test "update --recursive" with a flag with spaces

expecting success: 
	git clone super clone6 &&
	(
		cd clone6 &&
		test_must_fail git rev-parse --resolve-git-dir sub1/.git &&
		test_must_fail git rev-parse --resolve-git-dir sub2/.git &&
		test_must_fail git rev-parse --resolve-git-dir sub3/.git &&
		test_must_fail git rev-parse --resolve-git-dir nested1/.git &&
		git submodule update --init --recursive -- nested1 &&
		test_must_fail git rev-parse --resolve-git-dir sub1/.git &&
		test_must_fail git rev-parse --resolve-git-dir sub2/.git &&
		test_must_fail git rev-parse --resolve-git-dir sub3/.git &&
		git rev-parse --resolve-git-dir nested1/.git &&
		git rev-parse --resolve-git-dir nested1/nested2/.git &&
		git rev-parse --resolve-git-dir nested1/nested2/nested3/.git &&
		git rev-parse --resolve-git-dir nested1/nested2/nested3/submodule/.git
	)

Cloning into 'clone6'...
[master 4e5bcb5] standard input msg
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
*** t7501-commit.sh ***
ok 12 - commit message from file should override template

done.
expecting success: 
	echo "content galore" >>foo &&
	git add foo &&
	GIT_EDITOR="$TEST_DIRECTORY"/t7500/add-whitespaced-content git commit \
		--template "$TEMPLATE" &&
	commit_msg_is "commit message"

[detached HEAD a5e8310] post move
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename submodule2 => moved/sub module (100%)
fatal: not a gitdir 'sub1/.git'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7501-commit/.git/
fatal: not a gitdir 'sub2/.git'
expecting success: 
	echo bongo bongo >file &&
	git add file &&
	git status >actual &&
	test_i18ngrep "Initial commit" actual

fatal: not a gitdir 'sub3/.git'
[master 7668595] commit message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
fatal: not a gitdir 'nested1/.git'
ok 13 - commit message from template with whitespace issue

expecting success: 

	cp .git/index saved-index &&
	(
		echo some new content >file &&
	        GIT_INDEX_FILE=.git/another_index &&
		export GIT_INDEX_FILE &&
		git add file &&
		git commit -m "commit using another index" &&
		git diff-index --exit-code HEAD &&
		git diff-files --exit-code
	) &&
	cmp .git/index saved-index >/dev/null


Initial commit
ok 1 - initial status

expecting success: 
	test_must_fail git commit --amend

fatal: You have nothing to amend.
ok 2 - fail initial amend

expecting success: 
	git commit -m initial

[master 627d141] commit using another index
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 7 deletions(-)
 create mode 100644 file
 delete mode 100644 foo
[master (root-commit) 402702b] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 3 - setup: initial commit

expecting success: 
	git checkout HEAD file && echo >>file && git add file &&
	test_must_fail git commit -m foo -m bar -F file

ok 14 - using alternate GIT_INDEX_FILE (1)

expecting success: 

	cp .git/index saved-index &&
	(
		rm -f .git/no-such-index &&
		GIT_INDEX_FILE=.git/no-such-index &&
		export GIT_INDEX_FILE &&
		git commit -m "commit using nonexistent index" &&
		test -z "$(git ls-files)" &&
		test -z "$(git ls-tree HEAD)"

	) &&
	cmp .git/index saved-index >/dev/null

[master e0b79c8] commit using nonexistent index
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 file
fatal: Option -m cannot be combined with -c/-C/-F/--fixup.
ok 4 - -m and -F do not mix

expecting success: 
	git checkout HEAD file && echo >>file && git add file &&
	test_must_fail git commit -C HEAD -m illegal

ok 15 - using alternate GIT_INDEX_FILE (2)

expecting success: 
	echo "yet another content *narf*" >> foo &&
	echo "zort" | git commit -s -F - foo &&
	git cat-file commit HEAD | sed "1,/^\$/d" > output &&
	test_cmp expect output

[master 4277203] zort
 Author: A U Thor <author@example.com>
 1 file changed, 8 insertions(+)
 create mode 100644 foo
fatal: Option -m cannot be combined with -c/-C/-F/--fixup.
ok 5 - -m and -C do not mix

expecting success: 
	echo King of the bongo >file &&
	test_must_fail git commit -m foo -a file

ok 16 - --signoff

expecting success: 
	mkdir subdir &&
	echo "Log in top directory" >log &&
	echo "Log in sub directory" >subdir/log &&
	(
		cd subdir &&
		git commit --allow-empty -F log
	) &&
	commit_msg_is "Log in sub directory"

Submodule 'nested1' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/nested1) registered for path 'nested1'
fatal: Paths with -a does not make sense.
ok 6 - paths and -a do not mix

expecting success: 
	echo bong-o-bong >file &&
	# 2: update, 1:st path, that is all, 7: quit
	( echo 2; echo 1; echo; echo 7 ) |
	git commit -m foo --interactive file &&
	git reset --hard HEAD^

[master 606aa49] Log in sub directory
 Author: A U Thor <author@example.com>
ok 17 - commit message from file (1)

expecting success: 
	rm -f log &&
	echo "Log in sub directory" >subdir/log &&
	(
		cd subdir &&
		git commit --allow-empty -F log
	) &&
	commit_msg_is "Log in sub directory"

[master 1d371fb] Log in sub directory
 Author: A U Thor <author@example.com>
ok 18 - commit message from file (2)

expecting success: 
	(
		cd subdir &&
		echo "Log with foo word" | git commit --allow-empty -F -
	) &&
	commit_msg_is "Log with foo word"

Cloning into 'nested1'...
[master 8bea4ba] Log with foo word
 Author: A U Thor <author@example.com>
ok 19 - commit message from stdin

expecting success: 
	(
		cd subdir &&
		echo "-F log" > f.log &&
		echo "-t template" > t.template &&
		git commit --allow-empty -F f.log -t t.template
	) &&
	commit_msg_is "-F log"

done.
[master 763bf77] -F log
 Author: A U Thor <author@example.com>
ok 20 - commit -F overrides -t

expecting success: 
	echo "more content" >>foo &&
	git add foo &&
	>empty &&
	git commit --allow-empty-message <empty &&
	commit_msg_is "" &&
	git tag empty-message-commit

Submodule path 'moved/sub module': checked out '0a8d0eb02c9ff9715abf0cf42b3fcfd7f927958a'
[master 94502f9] 
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 21 - Commit without message is allowed with --allow-empty-message

expecting success: 
	echo "more content" >>foo &&
	git add foo &&
	>empty &&
	test_must_fail git commit <empty

Skipping submodule 'none'
Submodule path 'nested1': checked out 'b23f134787d96fae589a6b76da41f4db112fc8db'
Aborting commit due to empty commit message.
ok 22 - Commit without message is no-no without --allow-empty-message

expecting success: 
	echo "even more content" >>foo &&
	git add foo &&
	git commit --allow-empty-message -m"hello there" &&
	commit_msg_is "hello there"

[master e8be3bf] hello there
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+)
ok 23 - Commit a message with --allow-empty-message

expecting success: 
	echo more >>foo &&
	git add foo &&
	test_must_fail git commit -C empty-message-commit &&
	git commit -C empty-message-commit --allow-empty-message &&
	commit_msg_is ""

Aborting commit due to empty commit message.
Submodule 'nested2' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/nested2) registered for path 'nested2'
[master ee2ca70] 
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 11:05:43 2015 +0000
 1 file changed, 1 insertion(+)
ok 24 - commit -C empty respects --allow-empty-message

expecting success: 
	commit_for_rebase_autosquash_setup &&
	git commit --fixup HEAD~1 &&
	commit_msg_is "fixup! target message subject line"

Skipping submodule 'submodule1'
           staged     unstaged path
  1:        +1/-0        +1/-2 file

*** 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> [master 1db6165] target message subject line
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Cloning into 'nested2'...
           staged     unstaged path
  1:        +1/-0        +1/-2 [f]ile
Update>>            staged     unstaged path
* 1:        +1/-0        +1/-2 [f]ile
Update>> [master 0dfdad0] intermediate commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
updated one path

*** 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 54cbdc6] foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
done.
HEAD is now at 402702b initial
ok 7 - can use paths with --interactive

expecting success: 
	test_must_fail git commit --allow-empty -C bogus

ok 40 - submodule update properly revives a moved submodule

[master b221f3d] fixup! target message subject line
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
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

)
fatal: could not lookup commit bogus
ok 8 - using invalid commit with -C

expecting success: 
	git reset --hard &&
	test_must_fail git commit -m initial

ok 25 - commit --fixup provides correct one-line commit message

expecting success: 
	commit_for_rebase_autosquash_setup &&
	echo "log message from file" >msgfile &&
	git commit --squash HEAD~1 -F msgfile  &&
	commit_msg_is "squash! target message subject linelog message from file"

prerequisite SYMLINKS ok
expecting success: 
	mkdir -p linked/dir &&
	ln -s linked/dir linkto &&
	(cd linkto &&
	 git clone "$TRASH_DIRECTORY"/super_update_r2 super &&
	 (cd super &&
	  git submodule update --init --recursive
	 )
	)

HEAD is now at 402702b initial
Cloning into 'super'...
On branch master
Untracked files:
	actual

nothing added to commit but untracked files present
ok 9 - nothing to commit

expecting success: 
	test_must_fail git commit -m initial --dry-run

[master c2cb4a9] target message subject line
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)

	actual

nothing added to commit but untracked files present (use "git add" to track)
ok 10 - --dry-run fails with nothing to commit

expecting success: 
	test_must_fail git commit -m initial --short

done.
?? actual
ok 11 - --short fails with nothing to commit

expecting success: 
	test_must_fail git commit -m initial --porcelain

[master a69c300] intermediate commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
?? actual
ok 12 - --porcelain fails with nothing to commit

expecting success: 
	test_must_fail git commit -m initial --long

Submodule path 'nested1/nested2': checked out '2e69c85de92bf5f316f3c67b5e492f287f5a6542'
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)

	actual

nothing added to commit but untracked files present (use "git add" to track)
ok 13 - --long fails with nothing to commit

expecting success: 
	echo bongo bongo bongo >file &&
	git commit -m next -a

[master 6e310db] squash! target message subject line
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master b49f306] next
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 14 - setup: non-initial commit

expecting success: 
	echo bongo bongo bongo >>file &&
	git commit -m next -a --dry-run

ok 26 - commit --squash works with -F

expecting success: 
	commit_for_rebase_autosquash_setup &&
	git commit --squash HEAD~1 -m "foo bar\nbaz" &&
	commit_msg_is "squash! target message subject linefoo bar\nbaz"

On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	modified:   file

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	actual

ok 15 - --dry-run with stuff to commit returns ok

checking known breakage: 
	echo bongo bongo bongo >>file &&
	git commit -m next -a --short

M  file
?? actual
not ok 16 - --short with stuff to commit returns ok # TODO known breakage

checking known breakage: 
	echo bongo bongo bongo >>file &&
	git commit -m next -a --porcelain

M  file
?? actual
not ok 17 - --porcelain with stuff to commit returns ok # TODO known breakage

expecting success: 
	echo bongo bongo bongo >>file &&
	git commit -m next -a --long

[master 7ab5def] target message subject line
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	modified:   file

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	actual

ok 18 - --long with stuff to commit returns ok

expecting success: 
	echo more bongo: bongo bongo bongo bongo >file &&
	test_must_fail git commit -F gah -a

Submodule 'nested3' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/nested3) registered for path 'nested3'
[master ddec392] intermediate commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
fatal: could not read log file 'gah': No such file or directory
Submodule 'submodule' (/«PKGBUILDDIR»/t/trash directory.t7406-submodule-update/subsuper_update_r) registered for path 'submodule'
ok 19 - commit message from non-existing file

expecting success: 
	# Empty except stray tabs and spaces on a few lines.
	sed -e "s/@//g" >msg <<-\EOF &&
		@		@
		@@
		@  @
		@Signed-off-by: hula@
	EOF
	test_must_fail git commit -F msg -a

Aborting commit due to empty commit message.
[master 6fe0d51] squash! target message subject line
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 20 - empty commit message

expecting success: 
	git checkout HEAD file && echo >>file && git add file &&
	git commit -t file -F file

ok 27 - commit --squash works with -m

expecting success: 
	commit_for_rebase_autosquash_setup &&
	git commit --squash HEAD~1 -C HEAD &&
	commit_msg_is "squash! target message subject lineintermediate commit"

[master 09e25c4] bongo bongo bongo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 21 - template "emptyness" check does not kick in with -F

expecting success: 
	git checkout HEAD file && echo >>file && git add file &&
	test_must_fail git commit -t file 2>err &&
	test_i18ngrep "did not edit" err

[master b6e7f3e] target message subject line
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Cloning into 'nested3'...
Cloning into 'submodule'...
[master e900474] intermediate commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Aborting commit; you did not edit the message.
done.
ok 22 - template "emptyness" check

expecting success: 
	git checkout HEAD file && echo >>file && git add file &&
	echo this is the commit message, coming from a file >msg &&
	git commit -F msg -a

done.
[master 80a62a2] squash! target message subject line
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 11:05:44 2015 +0000
 1 file changed, 1 insertion(+)
ok 28 - commit --squash works with -C

expecting success: 
	commit_for_rebase_autosquash_setup &&
	test_set_editor "$TEST_DIRECTORY"/t7500/edit-content &&
	git commit --squash HEAD~1 -c HEAD &&
	commit_msg_is "squash! target message subject lineedited commit"

[master 1c71493] this is the commit message, coming from a file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 23 - setup: commit message from file

expecting success: 
	cat >editor <<-\EOF &&
	#!/bin/sh
	sed -e "s/a file/an amend commit/g" < "$1" > "$1-"
	mv "$1-" "$1"
	EOF
	chmod 755 editor &&
	EDITOR=./editor git commit --amend

[master a1353fc] target message subject line
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master 68c258b] this is the commit message, coming from an amend commit
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+)
ok 24 - amend commit

expecting success: 
	cp file file.expect &&
	echo changed >file &&
	git add file &&
	git commit --no-edit --amend --only &&
	git cat-file blob HEAD:file >file.actual &&
	test_cmp file.expect file.actual &&
	git diff --exit-code

[master 45578e7] intermediate commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Submodule path 'nested1/nested2/nested3': checked out '5ec83512b76a0b8170b899f8e643913c3e9b72d9'
[master 68c258b] this is the commit message, coming from an amend commit
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+)
Submodule path 'submodule': checked out '796fb1a6484f5f6c560d10b7517c12bee8a9388a'
ok 25 - amend --only ignores staged contents

expecting success: 
	cat >editor <<-\EOF &&
	#!/bin/sh
	sed -e "s/unamended/amended/g" <"$1" >"$1-"
	mv "$1-" "$1"
	EOF
	chmod 755 editor

[master 2af8bf7] squash! target message subject line
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 11:05:45 2015 +0000
 1 file changed, 1 insertion(+)
ok 26 - set up editor

expecting success: 
	echo unamended >expect &&
	git commit --allow-empty -m "unamended" &&
	echo needs more bongo >file &&
	git add file &&
	EDITOR=./editor git commit --no-edit --amend &&
	git diff --exit-code HEAD -- file &&
	git diff-tree -s --format=%s HEAD >msg &&
	test_cmp expect msg

[master 7221845] unamended
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 3 deletions(-)
ok 29 - commit --squash works with -c

expecting success: 
	commit_for_rebase_autosquash_setup &&
	git commit --squash HEAD -C HEAD &&
	commit_msg_is "squash! intermediate commit"

[master 4954c5b] unamended
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+), 3 deletions(-)
Submodule 'submodule' (/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/submodule) registered for path 'submodule'
[master c19f85c] target message subject line
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Submodule 'subsubmodule' (/«PKGBUILDDIR»/t/trash directory.t7406-submodule-update/subsubsuper_update_r) registered for path 'subsubmodule'
ok 27 - amend without launching editor

expecting success: 
	echo amended >expect &&
	git commit --allow-empty -m "unamended" &&
	echo bongo again >file &&
	git add file &&
	EDITOR=./editor git commit --edit --amend &&
	git diff-tree -s --format=%s HEAD >msg &&
	test_cmp expect msg

[master 23f87dd] intermediate commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master be9e363] unamended
 Author: A U Thor <author@example.com>
[master f747aab] squash! intermediate commit
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 11:05:45 2015 +0000
 1 file changed, 1 insertion(+)
ok 30 - commit --squash works with -C for same commit

expecting success: 
	commit_for_rebase_autosquash_setup &&
	test_set_editor "$TEST_DIRECTORY"/t7500/edit-content &&
	git commit --squash HEAD -c HEAD &&
	commit_msg_is "squash! edited commit"

[master 5a25981] amended
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'submodule'...
Cloning into 'subsubmodule'...
ok 28 - --amend --edit

expecting success: 
	cat >replace <<-\EOF &&
	#!/bin/sh
	echo "amended" >"$1"
	EOF
	chmod 755 replace &&
	git commit --allow-empty --allow-empty-message -m "" &&
	echo more bongo >file &&
	git add file &&
	EDITOR=./replace git commit --edit --amend &&
	git diff-tree -s --format=%s HEAD >msg &&
	./replace expect &&
	test_cmp expect msg

done.
[master a63c97e] target message subject line
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
done.
[master 81e7551] 
 Author: A U Thor <author@example.com>
[master 21bc106] intermediate commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master c7325bc] amended
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 29 - --amend --edit of empty message

expecting success: 
	echo amended >expect &&
	git commit --allow-empty -m buffer &&
	echo bongo bongo >file &&
	git add file &&
	EDITOR=./editor git commit -m unamended --edit &&
	git diff-tree -s  --format=%s HEAD >msg &&
	test_cmp expect msg

[master 1d01395] squash! edited commit
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 11:05:45 2015 +0000
 1 file changed, 1 insertion(+)
[master 3432be1] buffer
 Author: A U Thor <author@example.com>
ok 31 - commit --squash works with -c for same commit

expecting success: 
	commit_for_rebase_autosquash_setup &&
	test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
	git commit --squash HEAD~1 &&
	commit_msg_is "squash! target message subject linecommit message"

Submodule path 'submodule/subsubmodule': checked out 'e13bbd9c3df4762b3c846e1fb977b29be7746269'
Submodule path 'nested1/nested2/nested3/submodule': checked out '509f622a4f36a3e472affcf28fa959174f3dd5b5'
[master 149ed15] amended
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master ae253e2] target message subject line
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 30 - -m --edit

expecting success: 
	echo enough with the bongos >file &&
	test_must_fail git commit -F msg -m amending .

fatal: Option -m cannot be combined with -c/-C/-F/--fixup.
ok 31 - -m and -F do not mix

expecting success: 
	git commit -C HEAD^ .

ok 41 - submodule update can handle symbolic links in pwd

expecting success: 
	git clone cloned super3 &&
	pwd=$(pwd) &&
	(cd super3 &&
	 sed -e "s#url = ../#url = file://$pwd/#" <.gitmodules >.gitmodules.tmp &&
	 mv -f .gitmodules.tmp .gitmodules &&
	 git submodule update --init --depth=3
	 (cd submodule &&
	  test 1 = $(git log --oneline | wc -l)
	 )
)

[master b630ad0] intermediate commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
fatal: not a gitdir 'sub1/.git'
Cloning into 'super3'...
fatal: not a gitdir 'sub2/.git'
[master 73fdf3f] buffer
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 32 - using message from other commit

expecting success: 
	cat >editor <<-\EOF &&
	#!/bin/sh
	sed -e "s/amend/older/g"  < "$1" > "$1-"
	mv "$1-" "$1"
	EOF
	chmod 755 editor &&
	echo hula hula >file &&
	EDITOR=./editor git commit -c HEAD^ -a

fatal: not a gitdir 'sub3/.git'
/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/clone6/.git/modules/nested1
done.
[master 5cef8b0] squash! target message subject line
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/clone6/.git/modules/nested1/modules/nested2
/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/clone6/.git/modules/nested1/modules/nested2/modules/nested3
ok 32 - commit --squash works with editor

[master 9b8e260] oldered
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
expecting success: 
	echo changes >>foo &&
	echo "message" >log &&
	git add foo &&
	test_must_fail git commit --fixup HEAD~1 --squash HEAD~2 &&
	test_must_fail git commit --fixup HEAD~1 -C HEAD~2 &&
	test_must_fail git commit --fixup HEAD~1 -c HEAD~2 &&
	test_must_fail git commit --fixup HEAD~1 -m "cmdline message" &&
	test_must_fail git commit --fixup HEAD~1 -F log

/«PKGBUILDDIR»/t/trash directory.t7407-submodule-foreach/clone6/.git/modules/nested1/modules/nested2/modules/nested3/modules/submodule
ok 14 - use "update --recursive nested1" to checkout all submodules rooted in nested1

expecting success: 
	(
		cd super &&
		git submodule foreach echo success >../expected &&
		yes | git submodule foreach "read y && test \"x\$y\" = xy && echo success" >../actual
	) &&
	test_cmp expected actual

ok 33 - editing message from other commit

expecting success: 
	echo silly new contents >file &&
	echo commit message from stdin |
	git commit -F - -a

[master c15d6c5] commit message from stdin
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 34 - message from stdin

expecting success: 
	echo gak >file &&
	git commit -m author \
		--author "Rubber Duck <rduck@convoy.org>" -a >output 2>&1 &&
	grep Rubber.Duck output

fatal: Options --squash and --fixup cannot be used together
fatal: Only one of -c/-C/-F/--fixup can be used.
fatal: Only one of -c/-C/-F/--fixup can be used.
 Author: Rubber Duck <rduck@convoy.org>
ok 35 - overriding author from command line

expecting success: 
	echo 7 |
	git commit --interactive |
	grep "What now"

fatal: Option -m cannot be combined with -c/-C/-F/--fixup.
fatal: Only one of -c/-C/-F/--fixup can be used.
ok 33 - invalid message options when using --fixup

# passed all 33 test(s)
1..33
Submodule 'merging' (file:///«PKGBUILDDIR»/t/trash directory.t7406-submodule-update/merging) registered for path 'merging'
*** t7502-commit.sh ***
Submodule 'none' (file:///«PKGBUILDDIR»/t/trash directory.t7406-submodule-update/none) registered for path 'none'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7502-commit/.git/
expecting success: 

	echo new >file1 &&
	git add file1 &&
	check_summary_oneline "root-commit" "initial" &&

	echo change >>file1 &&
	git add file1

Submodule 'rebasing' (file:///«PKGBUILDDIR»/t/trash directory.t7406-submodule-update/rebasing) registered for path 'rebasing'
ok 1 - output summary format

expecting success: 
	check_summary_oneline "" "a change"

Submodule 'submodule' (file:///«PKGBUILDDIR»/t/trash directory.t7406-submodule-update/submodule) registered for path 'submodule'
ok 2 - output summary format: root-commit

expecting success: 

	check_summary_oneline "" "empty" "--allow-empty"

ok 3 - output summary format for commit with an empty diff

expecting success: 

	git checkout -b recursive-base &&
	test_commit base file1 &&

	git checkout -b recursive-a recursive-base &&
	test_commit commit-a file1 &&

	git checkout -b recursive-b recursive-base &&
	test_commit commit-b file1 &&

	# conflict
	git checkout recursive-a &&
	test_must_fail git merge recursive-b &&
	# resolve the conflict
	echo commit-a > file1 &&
	git add file1 &&
	check_summary_oneline "" "Merge"

Submodule 'submodule1' (file:///«PKGBUILDDIR»/t/trash directory.t7406-submodule-update/submodule) registered for path 'submodule1'
Switched to a new branch 'recursive-base'
warning: unknown update mode '!false' suggested for submodule 'submodule1'
What now> Bye.
[recursive-base e6f945f] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 2 deletions(-)
ok 36 - interactive add

expecting success: 
	echo zoo >file &&
	test_must_fail git diff --exit-code >diff1 &&
	(echo u ; echo "*" ; echo q) |
	(
		EDITOR=: &&
		export EDITOR &&
		test_must_fail git commit --interactive
	) &&
	git diff >diff2 &&
	compare_diff_patch diff1 diff2

Switched to a new branch 'recursive-a'
ok 15 - command passed to foreach retains notion of stdin

expecting success: 
	(
		cd clone2 &&
		git submodule foreach --recursive echo success >../expected &&
		yes | git submodule foreach --recursive "read y && test \"x\$y\" = xy && echo success" >../actual
	) &&
	test_cmp expected actual

[recursive-a 9300328] commit-a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'merging'...
Switched to a new branch 'recursive-b'
[recursive-b 2f9e083] commit-b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to branch 'recursive-a'
Merging:
9300328 commit-a
virtual recursive-b
found 1 common ancestor:
e6f945f base
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Automatic merge failed; fix conflicts and then commit the result.
ok 4 - output summary format for merges

expecting success: 

	output_tests_cleanup &&

	echo doing partial >"commit is" &&
	mkdir not &&
	echo very much encouraged but we should >not/forbid &&
	git add "commit is" not &&
	echo update added "commit is" file >"commit is" &&
	echo also update another >not/forbid &&
	test_tick &&
	git commit -a -m "initial with -a" &&

	git cat-file blob HEAD:"commit is" >current.1 &&
	git cat-file blob HEAD:not/forbid >current.2 &&

	cmp current.1 "commit is" &&
	cmp current.2 not/forbid


Switched to branch 'master'
rm 'file1'
Submodule path 'merging': checked out '0c90624ab7f1aaa301d3bb79f60dcfed1ec4897f'
[master 34ca441] cleanup
 Author: A U Thor <author@example.com>
 1 file changed, 2 deletions(-)
 delete mode 100644 file1
[master 8a2203d] initial with -a
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 commit is
 create mode 100644 not/forbid
Skipping submodule 'none'
ok 5 - the basics

expecting success: 

	echo another >"commit is" &&
	echo another >not/forbid &&
	test_tick &&
	git commit -m "partial commit to handle a file" "commit is" &&

	changed=$(git diff-tree --name-only HEAD^ HEAD) &&
	test "$changed" = "commit is"


[master 3302250] partial commit to handle a file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 6 - partial

expecting success: 

	test_tick &&
	git commit -m "partial commit to subdirectory" not &&

	changed=$(git diff-tree -r --name-only HEAD^ HEAD) &&
	test "$changed" = "not/forbid"


           staged     unstaged path
  1:    unchanged        +1/-1 file

*** 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
Cloning into 'rebasing'...
What now>            staged     unstaged path
  1:    unchanged        +1/-1 [f]ile
Update>> [master 742b3a6] partial commit to subdirectory
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
updated one path

*** 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.
ok 7 - partial modification in a subdirectory

expecting success: 

	git rm not/forbid &&
	git commit -m "partial commit to remove not/forbid" not &&

	changed=$(git diff-tree -r --name-only HEAD^ HEAD) &&
	test "$changed" = "not/forbid" &&
	remain=$(git ls-tree -r --name-only HEAD) &&
	test "$remain" = "commit is"


Aborting commit due to empty commit message.
rm 'not/forbid'
ok 37 - commit --interactive doesn't change index if editor aborts

expecting success: 
	cat >editor <<-\EOF &&
	#!/bin/sh
	sed -e s/good/bad/g <"$1" >"$1-"
	mv "$1-" "$1"
	EOF
	chmod 755 editor &&

	echo A good commit message. >msg &&
	echo moo >file &&

	EDITOR=./editor git commit -a -F msg &&
	git show -s --pretty=format:%s >subject &&
	grep -q good subject &&

	echo quack >file &&
	echo Another good message. |
	EDITOR=./editor git commit -a -F - &&
	git show -s --pretty=format:%s >subject &&
	grep -q good subject

[master 09fd303] partial commit to remove not/forbid
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 not/forbid
ok 8 - partial removal

expecting success: 

	>positive &&
	git add positive &&
	git commit -s -m "thank you" &&
	actual=$(git cat-file commit HEAD | sed -ne "s/Signed-off-by: //p") &&
	expected=$(git var GIT_COMMITTER_IDENT | sed -e "s/>.*/>/") &&
	test "z$actual" = "z$expected"


[master 0d1da3a] A good commit message.
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master cc1232b] thank you
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 positive
[master 121f24d] Another good message.
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 38 - editor not invoked if -F is given

expecting success: 

	git rm --cached file &&
	mv file elif &&
	git add elif &&
	git commit -m "Partial: add elif" elif &&
	git diff-tree --name-status HEAD^ HEAD >current &&
	echo "A	elif" >expected &&
	test_cmp expected current


ok 9 - sign off

expecting success: 

	>negative &&
	git add negative &&
	git commit -m "one" -m "two" -m "three" &&
	actual=$(git cat-file commit HEAD | sed -e "1,/^\$/d") &&
	expected=$(echo one; echo; echo two; echo; echo three) &&
	test "z$actual" = "z$expected"


rm 'file'
[master 19f335d] one
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 negative
[master e66cc0d] Partial: add elif
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 elif
ok 10 - multiple -m

expecting success: 

	echo minus >negative &&
	git add negative &&
	git status -v | sed -ne "/^diff --git /p" >actual &&
	echo "diff --git a/negative b/negative" >expect &&
	test_cmp expect actual


ok 11 - verbose

expecting success: 

	test_config color.diff always &&
	git status -v >actual &&
	grep "\[1mdiff --git" actual

ok 39 - partial commit that involves removal (1)

expecting success: 

	git commit -m "Partial: remove file" file &&
	git diff-tree --name-status HEAD^ HEAD >current &&
	echo "D	file" >expected &&
	test_cmp expected current


[master 9226c00] Partial: remove file
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 file
Submodule path 'rebasing': checked out '0c90624ab7f1aaa301d3bb79f60dcfed1ec4897f'
diff --git a/negative b/negative
ok 40 - partial commit that involves removal (2)

expecting success: 

	git rm --cached elif &&
	echo elif >elif &&
	git commit -m "Partial: modify elif" elif &&
	git diff-tree --name-status HEAD^ HEAD >current &&
	echo "M	elif" >expected &&
	test_cmp expected current


ok 12 - verbose respects diff config

expecting success: 
	printf "%s" "$mesg_with_comment_and_newlines" >expect

ok 13 - prepare file with comment line and trailing newlines

expecting success: 

	echo >>negative &&
	git commit --cleanup=verbatim --no-status -t expect -a &&
	git cat-file -p HEAD |sed -e "1,/^\$/d" >actual &&
	test_cmp expect actual


rm 'elif'
[master a8a362f] # text
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+)
[master f0e0084] Partial: modify elif
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'submodule'...
ok 14 - cleanup commit messages (verbatim option,-t)

expecting success: 

	echo >>negative &&
	git commit --cleanup=verbatim -F expect -a &&
	git cat-file -p HEAD |sed -e "1,/^\$/d">actual &&
	test_cmp expect actual


ok 41 - partial commit that involves removal (3)

expecting success: 

	oldtick=$GIT_AUTHOR_DATE &&
	test_tick &&
	git reset --hard &&
	git cat-file -p HEAD |
	sed -e "s/author.*/author $author $oldtick/" \
		-e "s/^\(committer.*> \).*$/\1$GIT_COMMITTER_DATE/" > \
		expected &&
	git commit --amend --author="$author" &&
	git cat-file -p HEAD > current &&
	test_cmp expected current


[master 1a798b1] # text
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
HEAD is now at f0e0084 Partial: modify elif
ok 15 - cleanup commit messages (verbatim option,-F)

expecting success: 

	echo >>negative &&
	git commit --cleanup=verbatim -m "$mesg_with_comment_and_newlines" -a &&
	git cat-file -p HEAD |sed -e "1,/^\$/d">actual &&
	test_cmp expect actual


[master f750bb2] Partial: modify elif
 Author: The Real Author <someguy@his.email.org>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 980cf90] # text
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 42 - amend commit to fix author

expecting success: 

	test_tick &&
	newtick=$GIT_AUTHOR_DATE &&
	git reset --hard &&
	git cat-file -p HEAD |
	sed -e "s/author.*/author $author $newtick/" \
		-e "s/^\(committer.*> \).*$/\1$GIT_COMMITTER_DATE/" > \
		expected &&
	git commit --amend --date="$newtick" &&
	git cat-file -p HEAD > current &&
	test_cmp expected current


ok 16 - cleanup commit messages (verbatim option,-m)

expecting success: 

	echo >>negative &&
	{ echo;echo "# text";echo; } >text &&
	echo "# text" >expect &&
	git commit --cleanup=whitespace -F text -a &&
	git cat-file -p HEAD |sed -e "1,/^\$/d">actual &&
	test_cmp expect actual


HEAD is now at f750bb2 Partial: modify elif
[master 94a43e3] # text
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 17 - cleanup commit messages (whitespace option,-F)

expecting success: 

	echo >>negative &&
	cat >text <<EOF &&

# to be kept

  # ------------------------ >8 ------------------------
# to be kept, too
# ------------------------ >8 ------------------------
to be removed
# ------------------------ >8 ------------------------
to be removed, too
EOF

	cat >expect <<EOF &&
# to be kept

  # ------------------------ >8 ------------------------
# to be kept, too
EOF
	git commit --cleanup=scissors -e -F text -a &&
	git cat-file -p HEAD |sed -e "1,/^\$/d">actual &&
	test_cmp expect actual

[master e001f38] Partial: modify elif
 Author: The Real Author <someguy@his.email.org>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 716e3cc] # to be kept
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 43 - amend commit to fix date

expecting success: 
	git commit --amend --date=2010-01-02T03:04:05 >output &&
	grep "Date: *Sat Jan 2 03:04:05 2010" output

ok 18 - cleanup commit messages (scissors option,-F,-e)

expecting success: 

	echo >>negative &&
	cat >text <<EOF &&
# ------------------------ >8 ------------------------
to be removed
EOF
	git commit --cleanup=scissors -e -F text -a --allow-empty-message &&
	git cat-file -p HEAD |sed -e "1,/^\$/d">actual &&
	test_must_be_empty actual

[master e7b5e59] 
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 Date: Sat Jan 2 03:04:05 2010 +0000
ok 44 - commit mentions forced date in output

ok 19 - cleanup commit messages (scissors option,-F,-e, scissors on first line)

expecting success: 
	test_must_fail git commit --amend --date=seventeen

expecting success: 

	echo >>negative &&
	{ echo;echo "# text";echo sample;echo; } >text &&
	echo sample >expect &&
	git commit --cleanup=strip -F text -a &&
	git cat-file -p HEAD |sed -e "1,/^\$/d">actual &&
	test_cmp expect actual


fatal: invalid date format: seventeen
ok 45 - commit complains about completely bogus dates

expecting success: 
	git commit --amend \
		--date="midnight the 12th of october, anno domini 1979" &&
	echo "Fri Oct 12 00:00:00 1979 +0000" >expect &&
	git log -1 --format=%ad >actual &&
	test_cmp expect actual

[master c5e08a2] sample
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 20 - cleanup commit messages (strip option,-F)

expecting success: 

	echo >>negative &&
	{ echo;echo sample;echo; } >text &&
	git commit -e -F text -a &&
	head -n 4 .git/COMMIT_EDITMSG >actual

[master f5df4a5] Partial: modify elif
 Author: The Real Author <someguy@his.email.org>
 Date: Fri Oct 12 00:00:00 1979 +0000
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 46 - commit --date allows approxidate

expecting success: 

	echo 1 >positive &&
	git add positive &&
	git commit -s -m "thank you" &&
	git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
	(
		echo thank you
		echo
		git var GIT_COMMITTER_IDENT |
		sed -e "s/>.*/>/" -e "s/^/Signed-off-by: /"
	) >expected &&
	test_cmp expected actual


[master 68ab696] sample
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 21 - cleanup commit messages (strip option,-F,-e)

expecting success: 
	test_i18ncmp expect actual

ok 22 - cleanup commit messages (strip option,-F,-e): output

expecting success: 
	test_must_fail git commit --cleanup=non-existent

Submodule path 'submodule': checked out '4301fd3e4110d3b6212c19aed3094150392545b9'
[master b1242bf] thank you
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 positive
fatal: Invalid cleanup mode non-existent
ok 23 - cleanup commit message (fail on invalid cleanup mode option)

expecting success: 
	test_must_fail git -c commit.cleanup=non-existent commit

fatal: Invalid cleanup mode non-existent
ok 24 - cleanup commit message (fail on invalid cleanup mode configuration)

expecting success: 
	echo content >>file &&
	git add file &&
	(
	  test_set_editor "$TEST_DIRECTORY"/t7500/add-content-and-comment &&
	  git commit --no-status
	) &&
	commit_msg_is "commit message"

ok 47 - sign off (1)

expecting success: 

	echo 2 >positive &&
	git add positive &&
	existing="Signed-off-by: Watch This <watchthis@example.com>" &&
	git commit -s -m "thank you

$existing" &&
	git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
	(
		echo thank you
		echo
		echo $existing
		git var GIT_COMMITTER_IDENT |
		sed -e "s/>.*/>/" -e "s/^/Signed-off-by: /"
	) >expected &&
	test_cmp expected actual


Skipping submodule 'submodule1'
ok 42 - submodule update clone shallow submodule

[master d6a2899] commit message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
expecting success: 
	(cd super2 &&
	 (cd deeper/submodule/subsubmodule &&
	  git checkout HEAD^
	 ) &&
	 git submodule update --recursive deeper/submodule >actual &&
	 test_i18ngrep "Submodule path .deeper/submodule/subsubmodule.: checked out" actual
	)

[master 7fd90bd] thank you
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 25 - cleanup commit message (no config and no option uses default)

expecting success: 
	echo content >>file &&
	git add file &&
	(
	  test_set_editor "$TEST_DIRECTORY"/t7500/add-content-and-comment &&
	  git commit --cleanup=whitespace --no-status
	) &&
	commit_msg_is "commit message # comment"

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 820877d... upstream line3
ok 48 - sign off (2)

expecting success: 

	echo 3 >positive &&
	git add positive &&
	alt="Alt-RFC-822-Header: Value" &&
	git commit -s -m "welcome

$alt" &&
	git cat-file commit HEAD | sed -e "1,/^\$/d" > actual &&
	(
		echo welcome
		echo
		echo $alt
		git var GIT_COMMITTER_IDENT |
		sed -e "s/>.*/>/" -e "s/^/Signed-off-by: /"
	) >expected &&
	test_cmp expected actual

[master 677ffe8] commit message # comment
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 16 - command passed to foreach --recursive retains notion of stdin

expecting success: 
	(
		cd super &&
		git submodule foreach "echo \\\"quoted\\\"" > ../expected &&
		git submodule foreach echo \"quoted\" > ../actual
	) &&
	test_cmp expected actual

[master 1ddd74c] welcome
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 26 - cleanup commit message (option overrides default)

expecting success: 
	echo content >>file &&
	git add file &&
	(
	  test_set_editor "$TEST_DIRECTORY"/t7500/add-content-and-comment &&
	  git -c commit.cleanup=whitespace commit --no-status
	) &&
	commit_msg_is "commit message # comment"

ok 49 - signoff gap

expecting success: 

	echo 4 >positive &&
	git add positive &&
	alt="fixed: 34" &&
	git commit -s -m "welcome

We have now
$alt" &&
	git cat-file commit HEAD | sed -e "1,/^\$/d" > actual &&
	(
		echo welcome
		echo
		echo We have now
		echo $alt
		echo
		git var GIT_COMMITTER_IDENT |
		sed -e "s/>.*/>/" -e "s/^/Signed-off-by: /"
	) >expected &&
	test_cmp expected actual

[master 7403f47] commit message # comment
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master e3f6199] welcome
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 27 - cleanup commit message (config overrides default)

expecting success: 
	echo content >>file &&
	git add file &&
	(
	  test_set_editor "$TEST_DIRECTORY"/t7500/add-content-and-comment &&
	  git -c commit.cleanup=whitespace commit --cleanup=default
	) &&
	commit_msg_is "commit message"

ok 50 - signoff gap 2

expecting success: 

	>negative &&
	git add negative &&
	git commit -m "one" -m "two" -m "three" &&
	git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
	(
		echo one
		echo
		echo two
		echo
		echo three
	) >expected &&
	test_cmp expected actual


[master 7dda181] commit message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master 1c0c3dc] one
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 negative
ok 28 - cleanup commit message (option overrides config)

expecting success: 
	echo content >>file &&
	git add file &&
	git commit -m "message #comment " &&
	commit_msg_is "message #comment"

ok 51 - multiple -m

expecting success: 

	oldtick=$GIT_AUTHOR_DATE &&
	test_tick &&
	git reset --hard &&
	git cat-file -p HEAD |
	sed -e "s/author.*/author $author $oldtick/" \
		-e "s/^\(committer.*> \).*$/\1$GIT_COMMITTER_DATE/" > \
		expected &&
	git commit --amend --author="$author" &&
	git cat-file -p HEAD > current &&
	test_cmp expected current


HEAD is now at 1c0c3dc one
[master 1a59102] message #comment
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 29 - cleanup commit message (default, -m)

expecting success: 
	echo content >>file &&
	git add file &&
	git commit --cleanup=whitespace --no-status -m "message #comment " &&
	commit_msg_is "message #comment"

[master a99e76b] one
 Author: The Real Author <someguy@his.email.org>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 negative
ok 52 - amend commit to fix author

expecting success: 
	echo tacocat > elif &&
	echo tehlulz > chz &&
	git add chz &&
	git commit elif -m "tacocat is a palindrome" &&
	git show --stat | grep elif &&
	git diff --cached | grep chz

[master a3a10c1] message #comment
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 30 - cleanup commit message (whitespace option, -m)

expecting success: 
	echo content >>file &&
	git add file &&
	git -c commit.cleanup=whitespace commit --no-status -m "message #comment " &&
	commit_msg_is "message #comment"

[master ca13b04] tacocat is a palindrome
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
 elif | 2 +-
[master 5e53dc8] message #comment
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
diff --git a/chz b/chz
+++ b/chz
ok 53 - git commit <file> with dirty index

expecting success: 

	git reset --hard &&
	test_must_fail git commit -m empty


ok 31 - cleanup commit message (whitespace config, -m)

expecting success: 
	echo >>negative &&
	git commit -e -m "sample" -a &&
	test_i18ngrep \
	  "^# Author: *A U Thor <author@example.com>\$" \
	  .git/COMMIT_EDITMSG

HEAD is now at ca13b04 tacocat is a palindrome
On branch master
Untracked files:
	actual
	current
	diff1
	diff2
	editor
	err
	expect
	expected
	file.actual
	file.expect
	msg
	output
	replace
	subject

nothing added to commit but untracked files present
ok 54 - same tree (single parent)

expecting success: 

	git commit --allow-empty -m "forced empty" &&
	git cat-file commit HEAD | grep forced


[master 412b92d] sample
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Submodule path 'deeper/submodule/subsubmodule': checked out '63550025de24fe5dc1a12e7b0c6d73ec59137ab7'
# Author:    A U Thor <author@example.com>
ok 43 - submodule update --recursive drops module name before recursing
ok 32 - message shows author when it is not equal to committer


expecting success: 
	git commit --allow-empty -e -m foo --date="2010-01-02T03:04:05" &&
	test_i18ngrep \
	  "^# Date: *Sat Jan 2 03:04:05 2010 +0000" \
	  .git/COMMIT_EDITMSG

[master 8480cda] forced empty
 Author: A U Thor <author@example.com>
# passed all 43 test(s)
1..43
forced empty
[master ok 55 - same tree (single parent) --allow-empty

e7428d3] foo
 Author: A U Thor <author@example.com>
 Date: Sat Jan 2 03:04:05 2010 +0000
expecting success: 

	git checkout -b side HEAD^ &&
	echo zero >zero &&
	git add zero &&
	git commit -m "add zero" &&
	git checkout master &&

	git merge -s ours side -m "empty ok" &&
	git diff HEAD^ HEAD >actual &&
	: >expected &&
	test_cmp expected actual &&

	git commit --amend -m "empty really ok" &&
	git diff HEAD^ HEAD >actual &&
	: >expected &&
	test_cmp expected actual


# Date:      Sat Jan 2 03:04:05 2010 +0000
ok 33 - message shows date when it is explicitly set

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

)
Switched to a new branch 'side'
Debian build daemon <buildd@testbuildd.raspbian.org> 1112912533 -0700
prerequisite AUTOIDENT ok
expecting success: 

	echo >>negative &&
	(
		sane_unset GIT_COMMITTER_EMAIL &&
		sane_unset GIT_COMMITTER_NAME &&
		git commit -e -m "sample" -a
	) &&
	# the ident is calculated from the system, so we cannot
	# check the actual value, only that it is there
	test_i18ngrep "^# Committer: " .git/COMMIT_EDITMSG

[side 63d4c21] add zero
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 zero
[master 0f7410d] sample
 Author: A U Thor <author@example.com>
 Committer: Debian build daemon <buildd@testbuildd.raspbian.org>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly. Run the
following command and follow the instructions in your editor to edit
your configuration file:

    git config --global --edit

After doing this, you may fix the identity used for this commit with:

    git commit --amend --reset-author

 1 file changed, 1 insertion(+)
# Committer: Debian build daemon <buildd@testbuildd.raspbian.org>
ok 34 - message shows committer when it is automatic

Switched to branch 'master'
skipping test: do not fire editor when committer is bogus 
	>.git/result &&
	>expect &&

	echo >>negative &&
	(
		sane_unset GIT_COMMITTER_EMAIL &&
		sane_unset GIT_COMMITTER_NAME &&
		GIT_EDITOR="\"$(pwd)/.git/FAKE_EDITOR\"" &&
		export GIT_EDITOR &&
		test_must_fail git commit -e -m sample -a
	) &&
	test_cmp expect .git/result

ok 35 # skip do not fire editor when committer is bogus (missing !AUTOIDENT)

expecting success: 
	echo tick >file &&
	git add file &&
	echo "editor not started" >.git/result &&
	(GIT_EDITOR="\"$(pwd)/.git/FAKE_EDITOR\"" git commit -m tick) &&
	test "$(cat .git/result)" = "editor not started"

Merge made by the 'ours' strategy.
[master f46c443] tick
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 7 deletions(-)
ok 36 - do not fire editor if -m <msg> was given

expecting success: 
	echo tock >file &&
	git add file &&
	echo "editor not started" >.git/result &&
	(GIT_EDITOR="\"$(pwd)/.git/FAKE_EDITOR\"" \
	 git commit -m "" --allow-empty-message) &&
	test "$(cat .git/result)" = "editor not started"

[master 5d3ea12] empty really ok
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
ok 56 - same tree (merge and amend merge)

expecting success: 

	git reset --hard &&
	test_tick &&
	git commit --allow-empty -m "old commit" &&
	old=$(git rev-parse --verify HEAD) &&
	test_tick &&
	git commit --allow-empty -m "new commit" &&
	new=$(git rev-parse --verify HEAD) &&
	test_tick &&
	git commit --allow-empty --amend -C "$old" &&
	git show --pretty="format:%ad %s" "$old" >expected &&
	git show --pretty="format:%ad %s" HEAD >actual &&
	test_cmp expected actual


[master 49a6520] 
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
HEAD is now at 5d3ea12 empty really ok
ok 37 - do not fire editor if -m "" was given

expecting success: 

	git clean -f &&
	echo f >g &&
	git add g &&
	git commit -m "add g" &&
	git branch second &&
	echo master >g &&
	echo g >h &&
	git add g h &&
	git commit -m "modify g and add h" &&
	git checkout second &&
	echo second >g &&
	git add g &&
	git commit -m second &&
	# Must fail due to conflict
	test_must_fail git cherry-pick -n master &&
	echo "editor not started" >.git/result &&
	(
		GIT_EDITOR="\"$(pwd)/.git/FAKE_EDITOR\"" &&
		export GIT_EDITOR &&
		test_must_fail git commit
	) &&
	test "$(cat .git/result)" = "editor not started"

[master c7a9c12] old commit
 Author: A U Thor <author@example.com>
Removing act
Removing actual
Removing commit_msg_is.actual
Removing commit_msg_is.expect
Removing current.1
Removing current.2
Removing exp
Removing expect
Removing text
ok 17 - multi-argument command passed to foreach is not shell-evaluated twice

# passed all 17 test(s)
1..17
[master e83599f] new commit
 Author: A U Thor <author@example.com>
[master b87b684] add g
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 g
[master e918633] old commit
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:17:13 2005 -0700
[master 4afbee0] modify g and add h
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 h
ok 57 - amend using the message from another commit

expecting success: 

	git reset --hard &&
	test_tick &&
	git commit --allow-empty -m "old commit" &&
	old=$(git rev-parse --verify HEAD) &&
	git tag -a -m "tag on old" tagged-old HEAD &&
	test_tick &&
	git commit --allow-empty -m "new commit" &&
	new=$(git rev-parse --verify HEAD) &&
	test_tick &&
	git commit --allow-empty --amend -C tagged-old &&
	git show --pretty="format:%ad %s" "$old" >expected &&
	git show --pretty="format:%ad %s" HEAD >actual &&
	test_cmp expected actual


Switched to branch 'second'
HEAD is now at e918633 old commit
[master 542463f] old commit
 Author: A U Thor <author@example.com>
[second 84224c9] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
error: could not apply 4afbee0... modify g and add h
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
Auto-merging g
CONFLICT (content): Merge conflict in g
error: commit is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
U	g
ok 38 - do not fire editor in the presence of conflicts

[master 58731ec] new commit
 Author: A U Thor <author@example.com>
expecting success: 
	echo >>negative &&
	! "$SHELL_PATH" -c '
	  echo kill -TERM $$ >> .git/FAKE_EDITOR
	  GIT_EDITOR=.git/FAKE_EDITOR
	  export GIT_EDITOR
	  exec git commit -a' &&
	test ! -f .git/index.lock

Terminated
[master 4e62188] old commit
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:20:13 2005 -0700
ok 39 - a SIGTERM should break locks

expecting success: 

	git rev-parse second master >expect &&
	test_must_fail git merge second master &&
	git checkout master g &&
	EDITOR=: git commit -a &&
	git cat-file commit HEAD | sed -n -e "s/^parent //p" -e "/^$/q" >actual &&
	test_cmp expect actual


ok 58 - amend using the message from a commit named with tag

expecting success: 

	git config notes.rewrite.amend true &&
	git config notes.rewriteRef "refs/notes/*" &&
	test_commit foo &&
	git notes add -m"a note" &&
	test_tick &&
	git commit --amend -m"new foo" &&
	test "$(git notes show)" = "a note"


Merging:
virtual second
virtual master
found 1 common ancestor:
b87b684 add g
Auto-merging g
CONFLICT (content): Merge conflict in g
Automatic merge failed; fix conflicts and then commit the result.
[master 6e0cbb9] foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo.t
[second f168659] Merge branch 'master' into second
 Author: A U Thor <author@example.com>
ok 40 - Hand committing of a redundant merge removes dups

expecting success: 

	git reset --hard &&
	git commit -s -m "hello: kitty" --allow-empty &&
	git cat-file commit HEAD | sed -e "1,/^$/d" >actual &&
	test_line_count = 3 actual


HEAD is now at f168659 Merge branch 'master' into second
[second a395a20] hello: kitty
 Author: A U Thor <author@example.com>
ok 41 - A single-liner subject with a token plus colon is not a footer

expecting success: 
	git commit -s --allow-empty --allow-empty-message &&
	cat <<-EOF >expect &&


	Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>

	EOF
	sed -e "/^#/d" -e "s/^:.*//" .git/COMMIT_EDITMSG >actual &&
	test_cmp expect actual

[master 7412b39] new foo
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:23:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 foo.t
ok 59 - amend can copy notes

expecting success: 
	git reset --hard &&
	for i in 1 2 3 4 5
	do
		echo $i
	done >./- &&
	git add ./- &&
	test_tick &&
	git commit -m "add dash" >output </dev/null &&
	test_i18ngrep " changed, 5 insertions" output

[second 9e2a6f4] Signed-off-by: C O Mitter <committer@example.com>
 Author: A U Thor <author@example.com>
ok 42 - commit -s places sob on third line after two empty lines

HEAD is now at 7412b39 new foo
expecting success: 
		try_commit "" &&
		test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
	
HEAD is now at 9e2a6f4 Signed-off-by: C O Mitter <committer@example.com>
 1 file changed, 5 insertions(+)
ok 60 - commit a file whose name is a dash

expecting success: 
	# This test relies on having something in the index, as it
	# would not otherwise actually prove much.  So check this.
	test -n "$(git ls-files)" &&
	git checkout --orphan orphan &&
	echo foo >newfile &&
	git add newfile &&
	git commit --only newfile -m"--only on unborn branch" &&
	echo newfile >expected &&
	git ls-tree -r --name-only HEAD >actual &&
	test_cmp expected actual

[second a3b8b8c] message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
# Changes to be committed:
Switched to a new branch 'orphan'
ok 43 - commit

expecting success: 
		try_commit "" &&
		test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
	
HEAD is now at a3b8b8c message
[orphan (root-commit) 80ebc6a] --only on unborn branch
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 newfile
ok 61 - --only works on to-be-born branch

[second cc76b0a] message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
# still have 2 known breakage(s)
# passed all remaining 59 test(s)
1..61
# Changes to be committed:
ok 44 - commit

expecting success: 
		try_commit --status &&
		test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
	
HEAD is now at cc76b0a message
[second 7569aeb] message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
# Changes to be committed:
ok 45 - commit --status

expecting success: 
		try_commit --no-status &&
		test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
	
*** t7503-pre-commit-hook.sh ***
HEAD is now at 7569aeb message
*** t7504-commit-msg-hook.sh ***
[second c6e0ee2] message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7503-pre-commit-hook/.git/
ok 46 - commit --no-status

expecting success: 
		test_config commit.status yes &&
		try_commit "" &&
		test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
	
expecting success: 

	echo "foo" > file &&
	git add file &&
	git commit -m "first"


HEAD is now at c6e0ee2 message
[master (root-commit) 8efc301] first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 1 - with no hook

expecting success: 

	echo "bar" > file &&
	git add file &&
	git commit --no-verify -m "bar"


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7504-commit-msg-hook/.git/
expecting success: 

	echo "foo" > file &&
	git add file &&
	git commit -m "first"


[second 227feda] message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
# Changes to be committed:
[master f1d737f] bar
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 2 - --no-verify with no hook

ok 47 - commit with commit.status = yes

expecting success: 
		test_config commit.status no &&
		try_commit "" &&
		test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
	
expecting success: 

	echo "more" >> file &&
	git add file &&
	git commit -m "more"


[master (root-commit) 8efc301] first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 1 - with no hook

expecting success: 

	echo "more foo" >> file &&
	git add file &&
	echo "more foo" > FAKE_MSG &&
	GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit


HEAD is now at 227feda message
[master 3ab0c5e] more
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 3 - with succeeding hook

expecting success: 

	echo "even more" >> file &&
	git add file &&
	git commit --no-verify -m "even more"


[second f38f048] message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master 44f4a78] more foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 2 - with no hook (editor)

expecting success: 

	echo "bar" > file &&
	git add file &&
	git commit --no-verify -m "bar"


[master 50ab5c4] even more
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 4 - --no-verify with succeeding hook

ok 48 - commit with commit.status = no

expecting success: 
		test_config commit.status yes &&
		try_commit --status &&
		test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
	
expecting success: 

	echo "another" >> file &&
	git add file &&
	test_must_fail git commit -m "another"


[master f22c7db] bar
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 2 deletions(-)
ok 3 - --no-verify with no hook

expecting success: 

	echo "more bar" > file &&
	git add file &&
	echo "more bar" > FAKE_MSG &&
	GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit --no-verify


HEAD is now at f38f048 message
ok 5 - with failing hook

expecting success: 

	echo "stuff" >> file &&
	git add file &&
	git commit --no-verify -m "stuff"


[second 0edc788] message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master bd44119] more bar
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 4 - --no-verify with no hook (editor)

# Changes to be committed:
[master 280f94b] stuff
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+)
ok 6 - --no-verify with failing hook

expecting success: 

	echo "content" >> file &&
	git add file &&
	git commit -m "content"


ok 49 - commit --status with commit.status = yes

expecting success: 
		test_config commit.status yes &&
		try_commit --no-status &&
		test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
	
expecting success: 

	echo "more" >> file &&
	git add file &&
	git commit -m "more"


HEAD is now at 0edc788 message
[master fa090f1] content
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 7 - with non-executable hook

expecting success: 

	echo "more content" >> file &&
	git add file &&
	git commit --no-verify -m "more content"


[master c386217] more
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 5 - with succeeding hook

expecting success: 

	echo "more more" >> file &&
	git add file &&
	echo "more more" > FAKE_MSG &&
	GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit


[second c424ccc] message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
*** t7505-prepare-commit-msg-hook.sh ***
[master ee8aaa8] more content
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 8 - --no-verify with non-executable hook

expecting success: 

	echo "more content" >> file &&
	git add file &&
	mkdir success &&
	(
		cd success &&
		git commit -m "hook requires GIT_PREFIX = success/"
	) &&
	rmdir success

ok 50 - commit --no-status with commit.status = yes

expecting success: 
		test_config commit.status no &&
		try_commit --status &&
		test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
	
[master 6c04d00] more more
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 6 - with succeeding hook (editor)

expecting success: 

	echo "even more" >> file &&
	git add file &&
	git commit --no-verify -m "even more"


HEAD is now at c424ccc message
[master e735a63] even more
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 7 - --no-verify with succeeding hook

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7505-prepare-commit-msg-hook/.git/
expecting success: 

	echo "even more more" >> file &&
	git add file &&
	echo "even more more" > FAKE_MSG &&
	GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit --no-verify


[master a7b1ffd] hook requires GIT_PREFIX = success/
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 9 - with hook requiring GIT_PREFIX

expecting success: 

	echo "more content" >> file &&
	git add file &&
	mkdir fail &&
	(
		cd fail &&
		test_must_fail git commit -m "hook must fail"
	) &&
	rmdir fail &&
	git checkout -- file

expecting success: 

	echo "foo" > file &&
	git add file &&
	git commit -m "first"


[second 8ac8c58] message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
# Changes to be committed:
ok 51 - commit --status with commit.status = no

expecting success: 
		test_config commit.status no &&
		try_commit --no-status &&
		test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
	
[master (root-commit) d594051] first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
[master 2e36385] even more more
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 1 - with no hook

ok 8 - --no-verify with succeeding hook (editor)

expecting success: 

	echo "another" >> file &&
	git add file &&
	test_must_fail git commit -m "another"


HEAD is now at 8ac8c58 message
ok 10 - with failing hook requiring GIT_PREFIX

expecting success: 
	write_script "$HOOK" <<-\EOF &&
	test "$GIT_AUTHOR_NAME" = "New Author" &&
	test "$GIT_AUTHOR_EMAIL" = "newauthor@example.com"
	EOF
	test_must_fail git commit --allow-empty -m "by a.u.thor" &&
	(
		GIT_AUTHOR_NAME="New Author" &&
		GIT_AUTHOR_EMAIL="newauthor@example.com" &&
		export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL &&
		git commit --allow-empty -m "by new.author via env" &&
		git show -s
	) &&
	git commit --author="New Author <newauthor@example.com>" \
		--allow-empty -m "by new.author via command line" &&
	git show -s

ok 9 - with failing hook

expecting success: 

	echo "more another" >> file &&
	git add file &&
	echo "more another" > FAKE_MSG &&
	! (GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit)


expecting success: 

	echo "more" >> file &&
	git add file &&
	git commit -m "more" &&
	test "`git log -1 --pretty=format:%s`" = "message (no editor)"


[second b3f9a0a] message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master 27d941c] by new.author via env
 Author: New Author <newauthor@example.com>
 1 file changed, 1 insertion(+)
ok 52 - commit --no-status with commit.status = no

expecting success: 
		try_commit "" &&
		test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
	
commit 27d941cea22b792078ee73cdb12d37b6ab7566c7
Author: New Author <newauthor@example.com>
Date:   Wed Dec 16 11:05:53 2015 +0000

    by new.author via env
ok 10 - with failing hook (editor)

expecting success: 

	echo "stuff" >> file &&
	git add file &&
	git commit --no-verify -m "stuff"


HEAD is now at b3f9a0a message
[master be46668] message (no editor)
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master 7bbcb76] by new.author via command line
 Author: New Author <newauthor@example.com>
ok 2 - with hook (-m)

expecting success: 

	echo "more" >> file &&
	git add file &&
	GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit -e -m "more more" &&
	test "`git log -1 --pretty=format:%s`" = message


commit 7bbcb768fdbf4ca9fbac1baa7a6be3b5a4d682d4
Author: New Author <newauthor@example.com>
Date:   Wed Dec 16 11:05:53 2015 +0000

    by new.author via command line
ok 11 - check the author in hook

[master 10a8385] stuff
 Author: A U Thor <author@example.com>
 1 file changed, 3 insertions(+)
# passed all 11 test(s)
1..11
ok 11 - --no-verify with failing hook

expecting success: 

	echo "more stuff" >> file &&
	git add file &&
	echo "more stuff" > FAKE_MSG &&
	GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit --no-verify


[second 49b964a] message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
## Custom template
# Changes to be committed:
ok 53 - commit

expecting success: 
		try_commit "" &&
		test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
	
HEAD is now at 49b964a message
[master 52b65f8] message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master 7c8adf3] more stuff
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
*** t7506-status-submodule.sh ***
ok 12 - --no-verify with failing hook (editor)

expecting success: 

	echo "content" >> file &&
	git add file &&
	git commit -m "content"


ok 3 - with hook (-m editor)

expecting success: 

	echo "more" >> file &&
	git add file &&
	git commit -t "$(git rev-parse --git-dir)/template" &&
	test "`git log -1 --pretty=format:%s`" = template


[second dc052fb] message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
## Custom template
# Changes to be committed:
ok 54 - commit

expecting success: 
		try_commit --status &&
		test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
	
[master 7f5ddb7] content
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 13 - with non-executable hook

HEAD is now at dc052fb message
expecting success: 

	echo "content again" >> file &&
	git add file &&
	echo "content again" > FAKE_MSG &&
	GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit -m "content again"


[master 86fbf04] template
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7506-status-submodule/.git/
[master fecb42b] content again
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[second 5c41a78] message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
expecting success: 
	test_create_repo_with_commit sub &&
	echo output > .gitignore &&
	git add sub .gitignore &&
	git commit -m "Add submodule sub"

ok 14 - with non-executable hook (editor)

ok 4 - with hook (-t)

expecting success: 

	echo "more" >> file &&
	git add file &&
	(echo more | git commit -F -) &&
	test "`git log -1 --pretty=format:%s`" = "message (no editor)"


## Custom template
expecting success: 

	echo "more content" >> file &&
	git add file &&
	git commit --no-verify -m "more content"


# Changes to be committed:
ok 55 - commit --status

expecting success: 
		try_commit --no-status &&
		test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
	
HEAD is now at 5c41a78 message
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7506-status-submodule/sub/.git/
[master 8cea351] more content
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 15 - --no-verify with non-executable hook

expecting success: 

	echo "even more content" >> file &&
	git add file &&
	echo "even more content" > FAKE_MSG &&
	GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit --no-verify


[master 3475d3d] message (no editor)
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[second 6d47158] message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 5 - with hook (-F)

expecting success: 

	echo "more" >> file &&
	git add file &&
	(echo more more | GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit -e -F -) &&
	test "`git log -1 --pretty=format:%s`" = message


[master (root-commit) d85a415]  Add bar
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 bar
## Custom template
ok 56 - commit --no-status

expecting success: 
		test_config commit.status yes &&
		try_commit "" &&
		test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
	
[master d034877] even more content
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 16 - --no-verify with non-executable hook (editor)

[master 7689786]  Add foo
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 foo
HEAD is now at 6d47158 message
expecting success: 

	echo "additional" >> file &&
	git add file &&
	git commit -m "additional" &&
	commit_msg_is "new message"


[master (root-commit) 188a668] Add submodule sub
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 .gitignore
 create mode 160000 sub
ok 1 - setup

expecting success: 
	git status >output &&
	test_i18ngrep "nothing to commit" output

[master d6a3499] message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[second c2c5a79] message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master 1114b59] new message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
## Custom template
ok 6 - with hook (-F editor)

expecting success: 

	head=`git rev-parse HEAD` &&
	echo "more" >> file &&
	git add file &&
	git commit -C $head &&
	test "`git log -1 --pretty=format:%s`" = "$head (no editor)"


# Changes to be committed:
ok 17 - hook edits commit message

expecting success: 

	echo "additional content" >> file &&
	git add file &&
	echo "additional content" > FAKE_MSG &&
	GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit &&
	commit_msg_is "new message"


nothing to commit, working directory clean
ok 2 - status clean

expecting success: 
	test_must_fail git commit --dry-run -a >output &&
	test_i18ngrep "nothing to commit" output

ok 57 - commit with commit.status = yes

expecting success: 
		test_config commit.status no &&
		try_commit "" &&
		test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
	
HEAD is now at c2c5a79 message
nothing to commit, working directory clean
ok 3 - commit --dry-run -a clean

expecting success: 
	(cd sub && git reset --hard) &&
	echo "changed" >sub/foo &&
	git status >output &&
	test_i18ngrep "modified:   sub (modified content)" output

[master 291b9b9] d6a3499102eab9f5d923a970e6d75999135aeedc (no editor)
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 11:05:54 2015 +0000
 1 file changed, 1 insertion(+)
HEAD is now at 7689786  Add foo
[master db9bca2] new message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[second 7847ecc] message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 7 - with hook (-C)

expecting success: 

	echo "more more" >> file &&
	git add file &&
	GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit &&
	test "`git log -1 --pretty=format:%s`" = default


## Custom template
ok 18 - hook edits commit message (editor)

expecting success: 

	echo "plus" >> file &&
	git add file &&
	git commit --no-verify -m "plus" &&
	commit_msg_is "plus"


ok 58 - commit with commit.status = no

expecting success: 
		test_config commit.status yes &&
		try_commit --status &&
		test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
	
	modified:   sub (modified content)
ok 4 - status with modified file in submodule

expecting success: 
	(cd sub && git reset --hard) &&
	echo "changed" >sub/foo &&
	git status --porcelain >output &&
	diff output - <<-\EOF
	 M sub
	EOF

HEAD is now at 7689786  Add foo
[master a499bab] plus
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
HEAD is now at 7847ecc message
ok 19 - hook doesn't edit commit message

expecting success: 

	echo "more plus" >> file &&
	git add file &&
	echo "more plus" > FAKE_MSG &&
	GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit --no-verify &&
	commit_msg_is "more plus"


[master fa2772a] default
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 8 - with hook (editor)

expecting success: 

	head=`git rev-parse HEAD` &&
	echo "more" >> file &&
	git add file &&
	GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit --amend &&
	test "`git log -1 --pretty=format:%s`" = "$head"


ok 5 - status with modified file in submodule (porcelain)

expecting success: 
	(cd sub && git reset --hard && echo >foo && git add foo) &&
	git status >output &&
	test_i18ngrep "modified:   sub (modified content)" output

[second 2a43a92] message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
## Custom template
# Changes to be committed:
HEAD is now at 7689786  Add foo
ok 59 - commit --status with commit.status = yes

expecting success: 
		test_config commit.status yes &&
		try_commit --no-status &&
		test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
	
[master cc3d039] more plus
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 20 - hook doesn't edit commit message (editor)

# passed all 20 test(s)
1..20
HEAD is now at 2a43a92 message
	modified:   sub (modified content)
ok 6 - status with added file in submodule

expecting success: 
	(cd sub && git reset --hard && echo >foo && git add foo) &&
	git status --porcelain >output &&
	diff output - <<-\EOF
	 M sub
	EOF

[master af8b5a8] fa2772a39e6ac180fac617a17b2d41915a8989b3
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 11:05:54 2015 +0000
 1 file changed, 2 insertions(+)
HEAD is now at 7689786  Add foo
[second d7ff4d1] message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 9 - with hook (--amend)

expecting success: 

	head=`git rev-parse HEAD` &&
	echo "more" >> file &&
	git add file &&
	GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit -c $head &&
	test "`git log -1 --pretty=format:%s`" = "$head"


## Custom template
ok 60 - commit --no-status with commit.status = yes

expecting success: 
		test_config commit.status no &&
		try_commit --status &&
		test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
	
*** t7507-commit-verbose.sh ***
ok 7 - status with added file in submodule (porcelain)

expecting success: 
	(cd sub && git reset --hard) &&
	echo "content" >sub/new-file &&
	git status >output &&
	test_i18ngrep "modified:   sub (untracked content)" output

HEAD is now at d7ff4d1 message
HEAD is now at 7689786  Add foo
[master 8880ef4] af8b5a898d80e446866a968f4f90487433eb7190
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 11:05:54 2015 +0000
 1 file changed, 1 insertion(+)
[second 00f5977] message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
	modified:   sub (untracked content)
ok 8 - status with untracked file in submodule

expecting success: 
	git status -uno >output &&
	test_i18ngrep "^nothing to commit" output

ok 10 - with hook (-c)

expecting success: 

	test_when_finished "git checkout -f master" &&
	git checkout -B other HEAD@{1} &&
	echo "more" >>file &&
	git add file &&
	git commit -m other &&
	git checkout - &&
	git merge --no-ff other &&
	test "`git log -1 --pretty=format:%s`" = "merge (no editor)"

## Custom template
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7507-commit-verbose/.git/
# Changes to be committed:
Switched to a new branch 'other'
ok 61 - commit --status with commit.status = no

expecting success: 
		test_config commit.status no &&
		try_commit --no-status &&
		test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
	
expecting success: 
	echo content >file &&
	git add file &&
	git commit -F message

nothing to commit (use -u to show untracked files)
ok 9 - status -uno with untracked file in submodule

expecting success: 
	git status --porcelain >output &&
	diff output - <<-\EOF
	 M sub
	EOF

HEAD is now at 00f5977 message
[master (root-commit) ba07f82] subject
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 1 - setup

expecting success: 
	git commit --amend -v

[other 8192bcd] message (no editor)
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 10 - status with untracked file in submodule (porcelain)

expecting success: 
	(cd sub && git reset --hard && echo >foo && git add foo) &&
	echo "content" >sub/new-file &&
	git status >output &&
	test_i18ngrep "modified:   sub (modified content, untracked content)" output

Switched to branch 'master'
[second 0dff67f] message
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
## Custom template
HEAD is now at 7689786  Add foo
diff --git a/file b/file
[master ba07f82] subject
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 11:05:55 2015 +0000
 1 file changed, 1 insertion(+)
 create mode 100644 file
Merging:
8880ef4 af8b5a898d80e446866a968f4f90487433eb7190
virtual other
found 1 common ancestor:
af8b5a8 fa2772a39e6ac180fac617a17b2d41915a8989b3
ok 2 - initial commit shows verbose diff

expecting success: 
	echo content modified >file &&
	git add file &&
	git commit -F message

ok 62 - commit --no-status with commit.status = no

expecting success: 
	test_config core.commentchar ";" &&
	try_commit --status &&
	test_i18ngrep "^; Changes to be committed:" .git/COMMIT_EDITMSG

Merge made by the 'recursive' strategy.
HEAD is now at 0dff67f message
[master 8be5e57] subject
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 3 - second commit

expecting success: 
	git commit --amend -v &&
	check_message message

	modified:   sub (modified content, untracked content)
ok 11 - status with added and untracked file in submodule

expecting success: 
	(cd sub && git reset --hard && echo >foo && git add foo) &&
	echo "content" >sub/new-file &&
	git status --porcelain >output &&
	diff output - <<-\EOF
	 M sub
	EOF

Already on 'master'
ok 11 - with hook (merge)

expecting success: 

	test_when_finished "git checkout -f master" &&
	git checkout -B other HEAD@{1} &&
	echo "more" >>file &&
	git add file &&
	git commit -m other &&
	git checkout - &&
	env GIT_EDITOR="\"\$FAKE_EDITOR\"" git merge --no-ff -e other &&
	test "`git log -1 --pretty=format:%s`" = "merge"

HEAD is now at 7689786  Add foo
diff --git a/file b/file
[second 4b7a259] message ## Custom template
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master 8be5e57] subject
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 11:05:55 2015 +0000
 1 file changed, 1 insertion(+), 1 deletion(-)
## Custom template
Switched to and reset branch 'other'
; Changes to be committed:
ok 4 - verbose diff is stripped out

expecting success: 
	git config diff.mnemonicprefix true &&
	git commit --amend -v &&
	check_message message

ok 63 - commit --status with custom comment character

expecting success: 
	test_commit "#foo" foo &&
	GIT_EDITOR=.git/FAKE_EDITOR git -c core.commentChar=auto commit --amend &&
	test_i18ngrep "^; Changes to be committed:" .git/COMMIT_EDITMSG

ok 12 - status with added and untracked file in submodule (porcelain)

expecting success: 
	(cd sub && git reset --hard) &&
	rm sub/new-file &&
	(cd sub && echo "next change" >foo && git commit -m "next change" foo) &&
	echo "changed" >sub/foo &&
	git status >output &&
	test_i18ngrep "modified:   sub (new commits, modified content)" output

diff --git c/file i/file
[second 62d6989] #foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
HEAD is now at 7689786  Add foo
[master 8be5e57] subject
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 11:05:55 2015 +0000
 1 file changed, 1 insertion(+), 1 deletion(-)
[other 7ec88de] message (no editor)
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 5 - verbose diff is stripped out (mnemonicprefix)

Switched to branch 'master'
expecting success: 
	git commit --amend -F diff &&
	check_message diff

[master 58575d5] next change
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master 0bf013c] This is an example commit message that contains a diff.
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 11:05:55 2015 +0000
 1 file changed, 1 insertion(+), 1 deletion(-)
[second 0b6163d] message #foo
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:23:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 foo
; Changes to be committed:
Merging:
9bafd2f merge (no editor)
virtual other
found 1 common ancestor:
9bafd2f merge (no editor)
ok 64 - switch core.commentchar

expecting success: 
	cat >text <<\EOF &&
# 1
; 2
@ 3
! 4
$ 5
% 6
^ 7
& 8
| 9
: 10
EOF
	git commit --amend -F text &&
	(
		test_set_editor .git/FAKE_EDITOR &&
		test_must_fail git -c core.commentChar=auto commit --amend
	)

ok 6 - diff in message is retained without -v

expecting success: 
	git commit --amend -F diff -v &&
	check_message diff

	modified:   sub (new commits, modified content)
ok 13 - status with modified file in modified submodule

expecting success: 
	(cd sub && git reset --hard) &&
	echo "changed" >sub/foo &&
	git status --porcelain >output &&
	diff output - <<-\EOF
	 M sub
	EOF

Merge made by the 'recursive' strategy.
[master 0bf013c] This is an example commit message that contains a diff.
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 11:05:55 2015 +0000
 1 file changed, 1 insertion(+), 1 deletion(-)
HEAD is now at 58575d5 next change
[second 158cea3] # 1 ; 2 @ 3 ! 4 $ 5 % 6 ^ 7 & 8 | 9 : 10
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:23:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 foo
 file | 1 +
 1 file changed, 1 insertion(+)
fatal: unable to select a comment character that is not used
in the current commit message
ok 7 - diff in message is retained with -v

expecting success: 
	git config diff.submodule log &&
	git submodule add ./. sub &&
	git commit -m "sub added" &&
	(
		cd sub &&
		echo "more" >>file &&
		git commit -a -m "submodule commit"
	) &&
	(
		GIT_EDITOR=cat &&
		export GIT_EDITOR &&
		test_must_fail git commit -a -v 2>err
	) &&
	test_i18ngrep "Aborting commit due to empty commit message." err

ok 65 - switch core.commentchar but out of options

# passed all 65 test(s)
1..65
Already on 'master'
ok 14 - status with modified file in modified submodule (porcelain)
ok 12 - with hook and editor (merge)


expecting success: 
	(cd sub && git reset --hard && echo >foo && git add foo) &&
	git status >output &&
	test_i18ngrep "modified:   sub (new commits, modified content)" output

expecting success: 

	test_when_finished "git checkout -f master" &&
	head=`git rev-parse HEAD` &&
	echo "more" >> file &&
	git add file &&
	test_must_fail env GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit -c $head


HEAD is now at 58575d5 next change
	modified:   sub (new commits, modified content)
ok 15 - status with added file in modified submodule

expecting success: 
	(cd sub && git reset --hard && echo >foo && git add foo) &&
	git status --porcelain >output &&
	diff output - <<-\EOF
	 M sub
	EOF

Already on 'master'
ok 13 - with failing hook

expecting success: 

	test_when_finished "git checkout -f master" &&
	head=`git rev-parse HEAD` &&
	echo "more" >> file &&
	git add file &&
	test_must_fail env GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit --no-verify -c $head


HEAD is now at 58575d5 next change
*** t7508-status.sh ***
ok 16 - status with added file in modified submodule (porcelain)

expecting success: 
	(cd sub && git reset --hard) &&
	echo "content" >sub/new-file &&
	git status >output &&
	test_i18ngrep "modified:   sub (new commits, untracked content)" output

Cloning into 'sub'...
Already on 'master'
ok 14 - with failing hook (--no-verify)

expecting success: 

	test_when_finished "git checkout -f master" &&
	git checkout -B other HEAD@{1} &&
	echo "more" >> file &&
	git add file &&
	rm -f "$HOOK" &&
	git commit -m other &&
	write_script "$HOOK" <<-EOF &&
	exit 1
	EOF
	git checkout - &&
	test_must_fail git merge --no-ff other


HEAD is now at 58575d5 next change
Switched to and reset branch 'other'
done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7508-status/.git/
	modified:   sub (new commits, untracked content)
ok 17 - status with untracked file in modified submodule

expecting success: 
	git status --porcelain >output &&
	diff output - <<-\EOF
	 M sub
	EOF

expecting success: 
	git config --global advice.statusuoption false &&
	mkdir broken &&
	test_when_finished "rm -fr broken" &&
	(
		cd broken &&
		git init &&
		echo "[status] showuntrackedfiles = CORRUPT" >>.git/config &&
		test_expect_code 129 git status -h >usage 2>&1
	) &&
	test_i18ngrep "[Uu]sage" broken/usage

[other b9611c6] other
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 18 - status with untracked file in modified submodule (porcelain)

expecting success: 
	(cd sub && git reset --hard && echo >foo && git add foo) &&
	echo "content" >sub/new-file &&
	git status >output &&
	test_i18ngrep "modified:   sub (new commits, modified content, untracked content)" output

Switched to branch 'master'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7508-status/broken/.git/
HEAD is now at 58575d5 next change
Merging:
61492ed merge
virtual other
found 1 common ancestor:
61492ed merge
usage: git status [<options>] [--] <pathspec>...
Not committing merge; use 'git commit' to complete the merge.
ok 1 - status -h in broken repository

expecting success: 
	mkdir broken &&
	test_when_finished "rm -fr broken" &&
	(
		cd broken &&
		git init &&
		echo "[status] showuntrackedfiles = CORRUPT" >>.git/config &&
		test_expect_code 129 git commit -h >usage 2>&1
	) &&
	test_i18ngrep "[Uu]sage" broken/usage

Already on 'master'
ok 15 - with failing hook (merge)

# passed all 15 test(s)
1..15
	modified:   sub (new commits, modified content, untracked content)
ok 19 - status with added and untracked file in modified submodule

expecting success: 
	(cd sub && git reset --hard && echo >foo && git add foo) &&
	echo "content" >sub/new-file &&
	git status --porcelain >output &&
	diff output - <<-\EOF
	 M sub
	EOF

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7508-status/broken/.git/
HEAD is now at 58575d5 next change
[master b4f01de] sub added
 Author: A U Thor <author@example.com>
 2 files changed, 4 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 sub
usage: git commit [<options>] [--] <pathspec>...
ok 2 - commit -h in broken repository

expecting success: 
	: >tracked &&
	: >modified &&
	mkdir dir1 &&
	: >dir1/tracked &&
	: >dir1/modified &&
	mkdir dir2 &&
	: >dir1/tracked &&
	: >dir1/modified &&
	git add . &&

	git status >output &&

	test_tick &&
	git commit -m initial &&
	: >untracked &&
	: >dir1/untracked &&
	: >dir2/untracked &&
	echo 1 >dir1/modified &&
	echo 2 >dir2/modified &&
	echo 3 >dir2/added &&
	git add dir2/added

*** t7509-commit.sh ***
[master 8d82823] submodule commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 20 - status with added and untracked file in modified submodule (porcelain)

expecting success: 
	(cd sub &&
	 rm -f new-file
	 REAL="$(pwd)/../.real" &&
	 mv .git "$REAL"
	 echo "gitdir: $REAL" >.git) &&
	 echo .real >>.gitignore &&
	 git commit -m "added .real to .gitignore" .gitignore


# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# Author:    A U Thor <author@example.com>
#
# On branch master
# Changes to be committed:
#	modified:   sub
#
# Untracked files:
#	actual
#	check-for-diff
#	diff
#	err
#	message
#
# ------------------------ >8 ------------------------
# Do not touch the line above.
# Everything below will be removed.
Submodule sub 0bf013c..8d82823:
  > submodule commit
[master 7edd54c] added .real to .gitignore
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 21 - setup .git file for sub

expecting success: 
	(cd sub && git reset --hard && echo >foo && git add foo) &&
	git status >output &&
	test_i18ngrep "modified:   sub (new commits, modified content)" output

Aborting commit due to empty commit message.
ok 8 - submodule log is stripped out too with -v

expecting success: 
	(
		GIT_EDITOR=cat &&
		export GIT_EDITOR &&
		test_must_fail git -c core.commentchar=";" commit -a -v 2>err
	) &&
	test_i18ngrep "Aborting commit due to empty commit message." err

[master (root-commit) 6f4196e] initial
 Author: A U Thor <author@example.com>
 5 files changed, 2 insertions(+)
 create mode 100644 .gitconfig
 create mode 100644 dir1/modified
 create mode 100644 dir1/tracked
 create mode 100644 modified
 create mode 100644 tracked
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7509-commit/.git/
ok 3 - setup

expecting success: 
	test_i18ngrep "use \"git rm --cached <file>\.\.\.\" to unstage" output

HEAD is now at 58575d5 next change
  (use "git rm --cached <file>..." to unstage)
ok 4 - status (1)

expecting success: 
	echo "Initial" >foo &&
	git add foo &&
	test_tick &&
	git commit -m "Initial Commit" --author Frigate\ \<flying@over.world\> &&
	git tag Initial &&
	echo "Test 1" >>foo &&
	test_tick &&
	git commit -a -C Initial &&
	author_header Initial >expect &&
	author_header HEAD >actual &&
	test_cmp expect actual &&

	message_body Initial >expect &&
	message_body HEAD >actual &&
	test_cmp expect actual

expecting success: 
	cat >expect <<\EOF &&
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#	new file:   dir2/added
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#	modified:   dir1/modified
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#	dir1/untracked dir2/untracked
#	dir2/modified  untracked
#
EOF
	COLUMNS=50 git -c status.displayCommentPrefix=true status --column="column dense" >output &&
	test_i18ncmp expect output


; Please enter the commit message for your changes. Lines starting
; with ';' will be ignored, and an empty message aborts the commit.
;
; Author:    A U Thor <author@example.com>
;
; On branch master
; Changes to be committed:
;	modified:   sub
;
; Untracked files:
;	actual
;	check-for-diff
;	diff
;	err
;	message
;
; ------------------------ >8 ------------------------
; Do not touch the line above.
; Everything below will be removed.
Submodule sub 0bf013c..8d82823:
  > submodule commit
Aborting commit due to empty commit message.
ok 9 - verbose diff is stripped out with set core.commentChar

ok 5 - status --column

expecting success: 
	strip_comments expect &&
	COLUMNS=49 git -c status.displayCommentPrefix=false status --column="column dense" >output &&
	test_i18ncmp expect output

[master (root-commit) 6c1fd11] Initial Commit
 Author: Frigate <flying@over.world>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
# passed all 9 test(s)
1..9
	modified:   sub (new commits, modified content)
ok 22 - status with added file in modified submodule with .git file

expecting success: 
	rm -rf sub/* sub/.git

ok 23 - rm submodule contents

expecting success: 
	git status >output &&
	test_i18ngrep "nothing to commit" output

ok 6 - status --column status.displayCommentPrefix=false

[master 19b40bf] Initial Commit
 Author: Frigate <flying@over.world>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+)
expecting success: 
	git -c status.displayCommentPrefix=true status >output &&
	test_i18ncmp expect output

nothing to commit, working directory clean
ok 24 - status clean (empty submodule dir)

expecting success: 
	test_must_fail git commit --dry-run -a >output &&
	test_i18ngrep "nothing to commit" output

*** t7510-signed-commit.sh ***
nothing to commit, working directory clean
ok 25 - status -a clean (empty submodule dir)

ok 7 - status with status.displayCommentPrefix=true

expecting success: 
	strip_comments expect &&
	git -c status.displayCommentPrefix=false status >output &&
	test_i18ncmp expect output

expecting success: 
	git clone . super &&
	test_create_repo_with_commit sub1 &&
	test_tick &&
	test_create_repo_with_commit sub2 &&
	(
		cd super &&
		prev=$(git rev-parse HEAD) &&
		git checkout -b add_sub1 &&
		git submodule add ../sub1 &&
		git commit -m "add sub1" &&
		git checkout -b add_sub2 $prev &&
		git submodule add ../sub2 &&
		git commit -m "add sub2" &&
		git checkout -b merge_conflict_gitmodules &&
		test_must_fail git merge add_sub1 &&
		git status -s >../status_actual 2>&1
	) &&
	test_cmp status_actual status_expect

Cloning into 'super'...
ok 1 - -C option copies authorship and message

expecting success: 
	echo "Test 2" >>foo &&
	test_tick &&
	git commit -a -C Initial --reset-author &&
	echo "author $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> $GIT_AUTHOR_DATE" >expect &&
	author_header HEAD >actual &&
	test_cmp expect actual &&

	message_body Initial >expect &&
	message_body HEAD >actual &&
	test_cmp expect actual

ok 8 - status with status.displayCommentPrefix=false

expecting success: 
	(cat expect && git diff --cached) >expect-with-v &&
	git status -v >output &&
	test_i18ncmp expect-with-v output

done.
[master 0381fd2] Initial Commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7510-signed-commit/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7506-status-submodule/sub1/.git/
ok 9 - status -v

expecting success: 
	(cat expect &&
	 echo "Changes to be committed:" &&
	 git -c diff.mnemonicprefix=true diff --cached &&
	 echo "--------------------------------------------------" &&
	 echo "Changes not staged for commit:" &&
	 git -c diff.mnemonicprefix=true diff) >expect-with-v &&
	git status -v -v >output &&
	test_i18ncmp expect-with-v output

ok 2 - -C option copies only the message with --reset-author

expecting success: 
	echo "Test 3" >>foo &&
	test_tick &&
	EDITOR=: VISUAL=: git commit -a -c Initial &&
	author_header Initial >expect &&
	author_header HEAD >actual &&
	test_cmp expect actual

[master (root-commit) 64fdee8]  Add bar
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 bar
[master fef56eb] Initial Commit
 Author: Frigate <flying@over.world>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+)
ok 10 - status -v -v

expecting success: 
	cat >.git/editor <<-\EOF &&
	#! /bin/sh
	cp "$1" output
EOF
	chmod 755 .git/editor

ok 11 - setup fake editor

expecting success: 
	commit_template_commented

[master 2ad6ed6]  Add foo
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 foo
ok 3 - -c option copies authorship and message

expecting success: 
	echo "Test 4" >>foo &&
	test_tick &&
	EDITOR=: VISUAL=: git commit -a -c Initial --reset-author &&
	echo "author $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> $GIT_AUTHOR_DATE" >expect &&
	author_header HEAD >actual &&
	test_cmp expect actual &&

	message_body Initial >expect &&
	message_body HEAD >actual &&
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7506-status-submodule/sub2/.git/
Aborting commit due to empty commit message.
[master d241f1c] Initial Commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 12 - commit ignores status.displayCommentPrefix=false in COMMIT_EDITMSG

expecting success: 
	test_config advice.statusHints false &&
	git status >output &&
	test_i18ncmp expect output


[master (root-commit) f4dd8ee]  Add bar
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 bar
ok 4 - -c option copies only the message with --reset-author

expecting success: 
	git checkout Initial &&
	echo "Test 5" >>foo &&
	test_tick &&
	git commit -a --amend -m "amend test" &&
	author_header Initial >expect &&
	author_header HEAD >actual &&
	test_cmp expect actual &&

	echo "amend test" >expect &&
	message_body HEAD >actual &&
	test_cmp expect actual

[master 0c53b86]  Add foo
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 foo
Note: checking out 'Initial'.

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 6c1fd11... Initial Commit
ok 13 - status (advice.statusHints false)

expecting success: 

	git status -s >output &&
	test_cmp expect output


Switched to a new branch 'add_sub1'
[detached HEAD 7318ebc] amend test
 Author: Frigate <flying@over.world>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 2 insertions(+)
 create mode 100644 foo
ok 14 - status -s

expecting success: 
	{
		echo ".gitignore" &&
		echo "expect*" &&
		echo "output" &&
		echo "untracked"
	} >.gitignore &&

	cat >expect <<-\EOF &&
	 M dir1/modified
	A  dir2/added
	?? dir2/modified
	EOF
	git status -s >output &&
	test_cmp expect output &&

	cat >expect <<-\EOF &&
	 M dir1/modified
	A  dir2/added
	?? dir2/modified
	!! .gitignore
	!! dir1/untracked
	!! dir2/untracked
	!! expect
	!! expect-with-v
	!! output
	!! untracked
	EOF
	git status -s --ignored >output &&
	test_cmp expect output &&

	cat >expect <<\EOF &&
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	new file:   dir2/added

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   dir1/modified

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	dir2/modified

Ignored files:
  (use "git add -f <file>..." to include in what will be committed)

	.gitignore
	dir1/untracked
	dir2/untracked
	expect
	expect-with-v
	output
	untracked

EOF
	git status --ignored >output &&
	test_i18ncmp expect output

ok 5 - --amend option copies authorship

expecting success: 
	git cat-file commit Initial >tmp &&
	sed "s/author [^<]* </author  </" tmp >empty-author &&
	sha=$(git hash-object -t commit -w empty-author) &&
	test_when_finished "remove_object $sha" &&
	git checkout $sha &&
	test_when_finished "git checkout Initial" &&
	echo "Empty author test" >>foo &&
	test_tick &&
	test_must_fail git commit -a -m "empty author" --amend 2>err &&
	grep "empty ident" err

ok 15 - status with gitignore

expecting success: 
	{
		echo ".gitignore" &&
		echo "expect*" &&
		echo "dir2/modified" &&
		echo "output" &&
		echo "untracked"
	} >.gitignore &&

	cat >expect <<-\EOF &&
	 M dir1/modified
	A  dir2/added
	EOF
	git status -s >output &&
	test_cmp expect output &&

	cat >expect <<-\EOF &&
	 M dir1/modified
	A  dir2/added
	!! .gitignore
	!! dir1/untracked
	!! dir2/modified
	!! dir2/untracked
	!! expect
	!! expect-with-v
	!! output
	!! untracked
	EOF
	git status -s --ignored >output &&
	test_cmp expect output &&

	cat >expect <<\EOF &&
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	new file:   dir2/added

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   dir1/modified

Ignored files:
  (use "git add -f <file>..." to include in what will be committed)

	.gitignore
	dir1/untracked
	dir2/modified
	dir2/untracked
	expect
	expect-with-v
	output
	untracked

EOF
	git status --ignored >output &&
	test_i18ncmp expect output

Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  7318ebc amend test

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> 7318ebc

HEAD is now at 488af46... Initial Commit
fatal: empty ident name (for <flying@over.world>) not allowed
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  488af46 Initial Commit

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> 488af46

expecting success: 
	test_when_finished "test_unconfig commit.gpgsign" &&

	echo 1 >file && git add file &&
	test_tick && git commit -S -m initial &&
	git tag initial &&
	git branch side &&

	echo 2 >file && test_tick && git commit -a -S -m second &&
	git tag second &&

	git checkout side &&
	echo 3 >elif && git add elif &&
	test_tick && git commit -m "third on side" &&

	git checkout master &&
	test_tick && git merge -S side &&
	git tag merge &&

	echo 4 >file && test_tick && git commit -a -m "fourth unsigned" &&
	git tag fourth-unsigned &&

	test_tick && git commit --amend -S -m "fourth signed" &&
	git tag fourth-signed &&

	git config commit.gpgsign true &&
	echo 5 >file && test_tick && git commit -a -m "fifth signed" &&
	git tag fifth-signed &&

	git config commit.gpgsign false &&
	echo 6 >file && test_tick && git commit -a -m "sixth" &&
	git tag sixth-unsigned &&

	git config commit.gpgsign true &&
	echo 7 >file && test_tick && git commit -a -m "seventh" --no-gpg-sign &&
	git tag seventh-unsigned &&

	test_tick && git rebase -f HEAD^^ && git tag sixth-signed HEAD^ &&
	git tag seventh-signed &&

	echo 8 >file && test_tick && git commit -a -m eighth -SB7227189 &&
	git tag eighth-signed-alt

HEAD is now at 6c1fd11... Initial Commit
M	foo
ok 6 - --amend option with empty author

expecting success: 
	git cat-file commit Initial >tmp &&
	sed "s/author [^<]* </author </" tmp >malformed &&
	sha=$(git hash-object -t commit -w malformed) &&
	test_when_finished "remove_object $sha" &&
	git checkout $sha &&
	test_when_finished "git checkout Initial" &&
	echo "Missing author test" >>foo &&
	test_tick &&
	test_must_fail git commit -a -m "malformed author" --amend 2>err &&
	grep "empty ident" err

ok 16 - status with gitignore (nothing untracked)

expecting success: 

	git status -s -b >output &&
	test_cmp expect output


Cloning into 'sub1'...
ok 17 - status -s -b

expecting success: 
	tr "\\n" Q <expect >expect.q &&
	mv expect.q expect &&
	git status -s -z -b >output &&
	nul_to_q <output >output.q &&
	mv output.q output &&
	test_cmp expect output

Previous HEAD position was 6c1fd11... Initial Commit
HEAD is now at 1dcf28c... Initial Commit
M	foo
done.
[master (root-commit) 67095e7] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
fatal: empty ident name (for <flying@over.world>) not allowed
ok 18 - status -s -z -b

expecting success: 
	mkdir dir3 &&
	: >dir3/untracked1 &&
	: >dir3/untracked2

ok 19 - setup dir3

expecting success: 
	cat >expect <<EOF &&
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	new file:   dir2/added

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   dir1/modified

Untracked files not listed (use -u option to show untracked files)
EOF
	git status -uno >output &&
	test_i18ncmp expect output

Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  1dcf28c Initial Commit

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> 1dcf28c

HEAD is now at 6c1fd11... Initial Commit
M	foo
ok 7 - --amend option with missing author

expecting success: 
	git checkout Initial &&
	echo "Test 6" >>foo &&
	test_tick &&
	git commit -a --reset-author -m "Changed again" --amend &&
	echo "author $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> $GIT_AUTHOR_DATE" >expect &&
	author_header HEAD >actual &&
	test_cmp expect actual &&

	echo "Changed again" >expect &&
	message_body HEAD >actual &&
	test_cmp expect actual

ok 20 - status -uno

expecting success: 
	test_config status.showuntrackedfiles no &&
	git status >output &&
	test_i18ncmp expect output

HEAD is now at 6c1fd11... Initial Commit
M	foo
[master 9178e08] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[detached HEAD 16b5be6] Changed again
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+)
 create mode 100644 foo
ok 21 - status (status.showUntrackedFiles no)

expecting success: 
	cat >expect <<EOF &&
On branch master
Changes to be committed:
	new file:   dir2/added

Changes not staged for commit:
	modified:   dir1/modified

Untracked files not listed
EOF
	test_config advice.statusHints false &&
	git status -uno >output &&
	test_i18ncmp expect output

Switched to branch 'side'
ok 8 - --reset-author makes the commit ours even with --amend option

expecting success: 
	git checkout Initial &&
	echo "Test 7" >>foo &&
	test_tick &&
	test_must_fail git commit -a --reset-author --author="Xyzzy <frotz@nitfol.xz>"

[add_sub1 bf22bd9] add sub1
 Author: A U Thor <author@example.com>
 2 files changed, 4 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 sub1
ok 22 - status -uno (advice.statusHints false)

Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  16b5be6 Changed again

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> 16b5be6

HEAD is now at 6c1fd11... Initial Commit
expecting success: 
	git status -s -uno >output &&
	test_cmp expect output

warning: unable to rmdir sub1: Directory not empty
[side 8154fd0] third on side
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 elif
Switched to a new branch 'add_sub2'
fatal: Using both --reset-author and --author does not make sense
ok 9 - --reset-author and --author are mutually exclusive

expecting success: 
	git checkout Initial &&
	echo "Test 7" >>foo &&
	test_tick &&
	test_must_fail git commit -a --reset-author -m done

ok 23 - status -s -uno

expecting success: 
	git config status.showuntrackedfiles no &&
	git status -s >output &&
	test_cmp expect output

Switched to branch 'master'
HEAD is now at 6c1fd11... Initial Commit
M	foo
fatal: --reset-author can be used only with -C, -c or --amend.
ok 10 - --reset-author should be rejected without -c/-C/--amend

expecting success: 
	echo "cherry-pick 1a" >>foo &&
	test_tick &&
	git commit -am "cherry-pick 1" --author="Cherry <cherry@pick.er>" &&
	git tag cherry-pick-head &&
	git rev-parse cherry-pick-head >.git/CHERRY_PICK_HEAD &&
	echo "This is a MERGE_MSG" >.git/MERGE_MSG &&
	echo "cherry-pick 1b" >>foo &&
	test_tick &&
	git commit -a &&
	author_header cherry-pick-head >expect &&
	author_header HEAD >actual &&
	test_cmp expect actual &&

	echo "This is a MERGE_MSG" >expect &&
	message_body HEAD >actual &&
	test_cmp expect actual

Merging:
9178e08 second
virtual side
found 1 common ancestor:
67095e7 initial
ok 24 - status -s (status.showUntrackedFiles no)

expecting success: 
	cat >expect <<EOF &&
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	new file:   dir2/added

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   dir1/modified

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	dir1/untracked
	dir2/modified
	dir2/untracked
	dir3/
	untracked

EOF
	git status -unormal >output &&
	test_i18ncmp expect output

[detached HEAD 7db2008] cherry-pick 1
 Author: Cherry <cherry@pick.er>
 1 file changed, 3 insertions(+)
ok 25 - status -unormal

expecting success: 
	test_config status.showuntrackedfiles normal &&
	git status >output &&
	test_i18ncmp expect output

Merge made by the 'recursive' strategy.
 elif | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 elif
[detached HEAD b9f2fd6] This is a MERGE_MSG
 Author: Cherry <cherry@pick.er>
 Date: Thu Apr 7 15:24:13 2005 -0700
 1 file changed, 1 insertion(+)
[master bffa0f7] fourth unsigned
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 26 - status (status.showUntrackedFiles normal)

expecting success: 
	git status -s -unormal >output &&
	test_cmp expect output

ok 11 - commit respects CHERRY_PICK_HEAD and MERGE_MSG

expecting success: 
	git rev-parse cherry-pick-head >.git/CHERRY_PICK_HEAD &&
	echo "cherry-pick 2" >>foo &&
	test_tick &&
	git commit -am "cherry-pick 2" --reset-author &&
	echo "author $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> $GIT_AUTHOR_DATE" >expect &&
	author_header HEAD >actual &&
	test_cmp expect actual

ok 27 - status -s -unormal

expecting success: 
	git config status.showuntrackedfiles normal &&
	git status -s >output &&
	test_cmp expect output

Cloning into 'sub2'...
ok 28 - status -s (status.showUntrackedFiles normal)

expecting success: 
	cat >expect <<EOF &&
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	new file:   dir2/added

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   dir1/modified

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	dir1/untracked
	dir2/modified
	dir2/untracked
	dir3/untracked1
	dir3/untracked2
	untracked

EOF
	git status -uall >output &&
	test_i18ncmp expect output

[detached HEAD 9a09dbe] cherry-pick 2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master c5b3e3c] fourth signed
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:17:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
done.
ok 29 - status -uall

expecting success: 
	test_config status.showuntrackedfiles all &&
	git status >output &&
	test_i18ncmp expect output

ok 12 - --reset-author with CHERRY_PICK_HEAD

# passed all 12 test(s)
1..12
ok 30 - status (status.showUntrackedFiles all)

expecting success: 
	rm -rf dir3

ok 31 - teardown dir3

expecting success: 
	test_unconfig status.showuntrackedfiles &&
	git status -s -uall >output &&
	test_cmp expect output

*** t7511-status-index.sh ***
[master c6a9263] fifth signed
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 32 - status -s -uall

expecting success: 
	test_config status.showuntrackedfiles all &&
	git status -s >output &&
	rm -rf dir3 &&
	test_cmp expect output

[master 0558043] sixth
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7511-status-index/.git/
ok 33 - status -s (status.showUntrackedFiles all)

expecting success: 
	cat >expect <<\EOF &&
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	new file:   ../dir2/added

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   modified

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	untracked
	../dir2/modified
	../dir2/untracked
	../untracked

EOF
	(cd dir1 && git status) >output &&
	test_i18ncmp expect output

[add_sub2 d3bbc2a] add sub2
 Author: A U Thor <author@example.com>
 2 files changed, 4 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 sub2
ok 34 - status with relative paths

expecting success: 
		git add * &&
		git status
	
[master 835bad4] seventh
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
expecting success: 

	(cd dir1 && git status -s) >output &&
	test_cmp expect output


ok 35 - status -s with relative paths

Switched to a new branch 'merge_conflict_gitmodules'
expecting success: 

	(cd dir1 && git status --porcelain) >output &&
	test_cmp expect output


On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   0
	new file:   1
	new file:   2
	new file:   3
	new file:   4
	new file:   5
	new file:   6
	new file:   7
	new file:   8
	new file:   9
	new file:   a
	new file:   b
	new file:   c
	new file:   d
	new file:   e
	new file:   f
	new file:   g
	new file:   h
	new file:   i
	new file:   j
	new file:   k
	new file:   l
	new file:   m
	new file:   n
	new file:   o
	new file:   p
	new file:   q
	new file:   r
	new file:   s
	new file:   t
	new file:   u
	new file:   v
	new file:   w
	new file:   x
	new file:   y
	new file:   z

ok 1 - status, filename length 1

ok 36 - status --porcelain ignores relative paths setting

expecting success: 

	git config status.color.untracked blue &&
	git config status.color.branch green


Merging:
d3bbc2a add sub2
virtual add_sub1
found 1 common ancestor:
7edd54c added .real to .gitignore
Auto-merging .gitmodules
CONFLICT (add/add): Merge conflict in .gitmodules
expecting success: 
		git add p* &&
		git status
	
ok 37 - setup unique colors

expecting success: 
	cat >expect <<\EOF &&
On branch <GREEN>master<RESET>
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	<GREEN>new file:   dir2/added<RESET>

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	<RED>modified:   dir1/modified<RESET>

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	<BLUE>dir1/untracked<RESET>
	<BLUE>dir2/modified<RESET>
	<BLUE>dir2/untracked<RESET>
	<BLUE>untracked<RESET>

EOF
	test_config color.ui always &&
	git status | test_decode_color >output &&
	test_i18ncmp expect output

Automatic merge failed; fix conflicts and then commit the result.
On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   p0
	new file:   p1
	new file:   p2
	new file:   p3
	new file:   p4
	new file:   p5
	new file:   p6
	new file:   p7
	new file:   p8
	new file:   p9
	new file:   pa
	new file:   pb
	new file:   pc
	new file:   pd
	new file:   pe
	new file:   pf
	new file:   pg
	new file:   ph
	new file:   pi
	new file:   pj
	new file:   pk
	new file:   pl
	new file:   pm
	new file:   pn
	new file:   po
	new file:   pp
	new file:   pq
	new file:   pr
	new file:   ps
	new file:   pt
	new file:   pu
	new file:   pv
	new file:   pw
	new file:   px
	new file:   py
	new file:   pz

ok 2 - status, filename length 2

expecting success: 
		git add px* &&
		git status
	
ok 26 - status with merge conflict in .gitmodules

ok 38 - status with color.ui

expecting success: 
	test_config color.status always &&
	git status | test_decode_color >output &&
	test_i18ncmp expect output

On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   px0
	new file:   px1
	new file:   px2
	new file:   px3
	new file:   px4
	new file:   px5
	new file:   px6
	new file:   px7
	new file:   px8
	new file:   px9
	new file:   pxa
	new file:   pxb
	new file:   pxc
	new file:   pxd
	new file:   pxe
	new file:   pxf
	new file:   pxg
	new file:   pxh
	new file:   pxi
	new file:   pxj
	new file:   pxk
	new file:   pxl
	new file:   pxm
	new file:   pxn
	new file:   pxo
	new file:   pxp
	new file:   pxq
	new file:   pxr
	new file:   pxs
	new file:   pxt
	new file:   pxu
	new file:   pxv
	new file:   pxw
	new file:   pxx
	new file:   pxy
	new file:   pxz

ok 3 - status, filename length 3

expecting success: 
	(
		cd super &&
		git diff >../diff_actual 2>&1
	) &&
	test_cmp diff_actual diff_expect

expecting success: 
		git add pre* &&
		git status
	
ok 39 - status with color.status

expecting success: 

	git config color.ui always &&
	git status -s | test_decode_color >output &&
	test_cmp expect output


On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   pre0
	new file:   pre1
	new file:   pre2
	new file:   pre3
	new file:   pre4
	new file:   pre5
	new file:   pre6
	new file:   pre7
	new file:   pre8
	new file:   pre9
	new file:   prea
	new file:   preb
	new file:   prec
	new file:   pred
	new file:   pree
	new file:   pref
	new file:   preg
	new file:   preh
	new file:   prei
	new file:   prej
	new file:   prek
	new file:   prel
	new file:   prem
	new file:   pren
	new file:   preo
	new file:   prep
	new file:   preq
	new file:   prer
	new file:   pres
	new file:   pret
	new file:   preu
	new file:   prev
	new file:   prew
	new file:   prex
	new file:   prey
	new file:   prez

ok 4 - status, filename length 4

ok 40 - status -s with color.ui

expecting success: 

	git config --unset color.ui &&
	git config color.status always &&
	git status -s | test_decode_color >output &&
	test_cmp expect output


ok 27 - diff with merge conflict in .gitmodules

expecting success: 
	(
		cd super &&
		git diff --submodule >../diff_submodule_actual 2>&1
	) &&
	test_cmp diff_submodule_actual diff_submodule_expect

expecting success: 
		git add pref* &&
		git status
	
Current branch master is up to date, rebase forced.
First, rewinding head to replay your work on top of it...
On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   pref0
	new file:   pref1
	new file:   pref2
	new file:   pref3
	new file:   pref4
	new file:   pref5
	new file:   pref6
	new file:   pref7
	new file:   pref8
	new file:   pref9
	new file:   prefa
	new file:   prefb
	new file:   prefc
	new file:   prefd
	new file:   prefe
	new file:   preff
	new file:   prefg
	new file:   prefh
	new file:   prefi
	new file:   prefj
	new file:   prefk
	new file:   prefl
	new file:   prefm
	new file:   prefn
	new file:   prefo
	new file:   prefp
	new file:   prefq
	new file:   prefr
	new file:   prefs
	new file:   preft
	new file:   prefu
	new file:   prefv
	new file:   prefw
	new file:   prefx
	new file:   prefy
	new file:   prefz

ok 5 - status, filename length 5

ok 41 - status -s with color.status

expecting success: 

	git status -s -b | test_decode_color >output &&
	test_cmp expect output


ok 28 - diff --submodule with merge conflict in .gitmodules

expecting success: 
		git add prefi* &&
		git status
	
# passed all 28 test(s)
1..28
ok 42 - status -s -b with color.status

expecting success: 

	git config --unset color.status &&
	git config color.ui always &&
	git status --porcelain | test_decode_color >output &&
	test_cmp expect output


On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   prefi0
	new file:   prefi1
	new file:   prefi2
	new file:   prefi3
	new file:   prefi4
	new file:   prefi5
	new file:   prefi6
	new file:   prefi7
	new file:   prefi8
	new file:   prefi9
	new file:   prefia
	new file:   prefib
	new file:   prefic
	new file:   prefid
	new file:   prefie
	new file:   prefif
	new file:   prefig
	new file:   prefih
	new file:   prefii
	new file:   prefij
	new file:   prefik
	new file:   prefil
	new file:   prefim
	new file:   prefin
	new file:   prefio
	new file:   prefip
	new file:   prefiq
	new file:   prefir
	new file:   prefis
	new file:   prefit
	new file:   prefiu
	new file:   prefiv
	new file:   prefiw
	new file:   prefix
	new file:   prefiy
	new file:   prefiz

ok 6 - status, filename length 6

Applying: sixth
expecting success: 
		git add prefix* &&
		git status
	
ok 43 - status --porcelain ignores color.ui

expecting success: 

	git config --unset color.ui &&
	git config color.status always &&
	git status --porcelain | test_decode_color >output &&
	test_cmp expect output


On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   prefix0
	new file:   prefix1
	new file:   prefix2
	new file:   prefix3
	new file:   prefix4
	new file:   prefix5
	new file:   prefix6
	new file:   prefix7
	new file:   prefix8
	new file:   prefix9
	new file:   prefixa
	new file:   prefixb
	new file:   prefixc
	new file:   prefixd
	new file:   prefixe
	new file:   prefixf
	new file:   prefixg
	new file:   prefixh
	new file:   prefixi
	new file:   prefixj
	new file:   prefixk
	new file:   prefixl
	new file:   prefixm
	new file:   prefixn
	new file:   prefixo
	new file:   prefixp
	new file:   prefixq
	new file:   prefixr
	new file:   prefixs
	new file:   prefixt
	new file:   prefixu
	new file:   prefixv
	new file:   prefixw
	new file:   prefixx
	new file:   prefixy
	new file:   prefixz

ok 7 - status, filename length 7

Applying: seventh
ok 44 - status --porcelain ignores color.status

expecting success: 
		git add prefix-* &&
		git status
	
expecting success: 

	git status --porcelain -b >output &&
	{
		echo "## master" &&
		cat expect
	} >tmp &&
	mv tmp expect &&
	test_cmp expect output


On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   prefix-0
	new file:   prefix-1
	new file:   prefix-2
	new file:   prefix-3
	new file:   prefix-4
	new file:   prefix-5
	new file:   prefix-6
	new file:   prefix-7
	new file:   prefix-8
	new file:   prefix-9
	new file:   prefix-a
	new file:   prefix-b
	new file:   prefix-c
	new file:   prefix-d
	new file:   prefix-e
	new file:   prefix-f
	new file:   prefix-g
	new file:   prefix-h
	new file:   prefix-i
	new file:   prefix-j
	new file:   prefix-k
	new file:   prefix-l
	new file:   prefix-m
	new file:   prefix-n
	new file:   prefix-o
	new file:   prefix-p
	new file:   prefix-q
	new file:   prefix-r
	new file:   prefix-s
	new file:   prefix-t
	new file:   prefix-u
	new file:   prefix-v
	new file:   prefix-w
	new file:   prefix-x
	new file:   prefix-y
	new file:   prefix-z

ok 8 - status, filename length 8

*** t7512-status-help.sh ***
ok 45 - status --porcelain respects -b

expecting success: 
	cat >expect <<\EOF &&
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	new file:   dir2/added

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   dir1/modified

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	dir1/untracked
	dir2/modified
	dir2/untracked
	untracked

EOF
	test_config status.relativePaths false &&
	(cd dir1 && git status) >output &&
	test_i18ncmp expect output


expecting success: 
		git add prefix-p* &&
		git status
	
On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   prefix-p0
	new file:   prefix-p1
	new file:   prefix-p2
	new file:   prefix-p3
	new file:   prefix-p4
	new file:   prefix-p5
	new file:   prefix-p6
	new file:   prefix-p7
	new file:   prefix-p8
	new file:   prefix-p9
	new file:   prefix-pa
	new file:   prefix-pb
	new file:   prefix-pc
	new file:   prefix-pd
	new file:   prefix-pe
	new file:   prefix-pf
	new file:   prefix-pg
	new file:   prefix-ph
	new file:   prefix-pi
	new file:   prefix-pj
	new file:   prefix-pk
	new file:   prefix-pl
	new file:   prefix-pm
	new file:   prefix-pn
	new file:   prefix-po
	new file:   prefix-pp
	new file:   prefix-pq
	new file:   prefix-pr
	new file:   prefix-ps
	new file:   prefix-pt
	new file:   prefix-pu
	new file:   prefix-pv
	new file:   prefix-pw
	new file:   prefix-px
	new file:   prefix-py
	new file:   prefix-pz

ok 9 - status, filename length 9

ok 46 - status without relative paths

expecting success: 

	test_config status.relativePaths false &&
	(cd dir1 && git status -s) >output &&
	test_cmp expect output


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7512-status-help/.git/
expecting success: 
		git add prefix-pr* &&
		git status
	
expecting success: 
	git config --global advice.statusuoption false &&
	test_commit init main.txt init &&
	git branch conflicts &&
	test_commit on_master main.txt on_master &&
	git checkout conflicts &&
	test_commit on_conflicts main.txt on_conflicts

On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   prefix-pr0
	new file:   prefix-pr1
	new file:   prefix-pr2
	new file:   prefix-pr3
	new file:   prefix-pr4
	new file:   prefix-pr5
	new file:   prefix-pr6
	new file:   prefix-pr7
	new file:   prefix-pr8
	new file:   prefix-pr9
	new file:   prefix-pra
	new file:   prefix-prb
	new file:   prefix-prc
	new file:   prefix-prd
	new file:   prefix-pre
	new file:   prefix-prf
	new file:   prefix-prg
	new file:   prefix-prh
	new file:   prefix-pri
	new file:   prefix-prj
	new file:   prefix-prk
	new file:   prefix-prl
	new file:   prefix-prm
	new file:   prefix-prn
	new file:   prefix-pro
	new file:   prefix-prp
	new file:   prefix-prq
	new file:   prefix-prr
	new file:   prefix-prs
	new file:   prefix-prt
	new file:   prefix-pru
	new file:   prefix-prv
	new file:   prefix-prw
	new file:   prefix-prx
	new file:   prefix-pry
	new file:   prefix-prz

ok 10 - status, filename length 10

ok 47 - status -s without relative paths

expecting success: 
	cat >expect <<EOF &&
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	modified:   dir1/modified

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	dir1/untracked
	dir2/
	untracked

EOF
	git commit --dry-run dir1/modified >output &&
	test_i18ncmp expect output

expecting success: 
		git add prefix-pre* &&
		git status
	
[master (root-commit) 56c882b] init
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 main.txt
ok 48 - dry-run of partial commit excluding new file in index

expecting success: 
	touch dir2/added &&
	git status &&
	git diff-files >output &&
	test_cmp expect output

On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   prefix-pre0
	new file:   prefix-pre1
	new file:   prefix-pre2
	new file:   prefix-pre3
	new file:   prefix-pre4
	new file:   prefix-pre5
	new file:   prefix-pre6
	new file:   prefix-pre7
	new file:   prefix-pre8
	new file:   prefix-pre9
	new file:   prefix-prea
	new file:   prefix-preb
	new file:   prefix-prec
	new file:   prefix-pred
	new file:   prefix-pree
	new file:   prefix-pref
	new file:   prefix-preg
	new file:   prefix-preh
	new file:   prefix-prei
	new file:   prefix-prej
	new file:   prefix-prek
	new file:   prefix-prel
	new file:   prefix-prem
	new file:   prefix-pren
	new file:   prefix-preo
	new file:   prefix-prep
	new file:   prefix-preq
	new file:   prefix-prer
	new file:   prefix-pres
	new file:   prefix-pret
	new file:   prefix-preu
	new file:   prefix-prev
	new file:   prefix-prew
	new file:   prefix-prex
	new file:   prefix-prey
	new file:   prefix-prez

ok 11 - status, filename length 11

On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	new file:   dir2/added

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   dir1/modified

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	dir1/untracked
	dir2/modified
	dir2/untracked
	untracked

expecting success: 
		git add prefix-pref* &&
		git status
	
ok 49 - status refreshes the index

expecting success: 
	test_create_repo sm && (
		cd sm &&
		>foo &&
		git add foo &&
		git commit -m "Add foo"
	) &&
	git add sm

[master 88a81b6] on_master
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   prefix-pref0
	new file:   prefix-pref1
	new file:   prefix-pref2
	new file:   prefix-pref3
	new file:   prefix-pref4
	new file:   prefix-pref5
	new file:   prefix-pref6
	new file:   prefix-pref7
	new file:   prefix-pref8
	new file:   prefix-pref9
	new file:   prefix-prefa
	new file:   prefix-prefb
	new file:   prefix-prefc
	new file:   prefix-prefd
	new file:   prefix-prefe
	new file:   prefix-preff
	new file:   prefix-prefg
	new file:   prefix-prefh
	new file:   prefix-prefi
	new file:   prefix-prefj
	new file:   prefix-prefk
	new file:   prefix-prefl
	new file:   prefix-prefm
	new file:   prefix-prefn
	new file:   prefix-prefo
	new file:   prefix-prefp
	new file:   prefix-prefq
	new file:   prefix-prefr
	new file:   prefix-prefs
	new file:   prefix-preft
	new file:   prefix-prefu
	new file:   prefix-prefv
	new file:   prefix-prefw
	new file:   prefix-prefx
	new file:   prefix-prefy
	new file:   prefix-prefz

ok 12 - status, filename length 12

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7508-status/sm/.git/
expecting success: 
		git add prefix-prefi* &&
		git status
	
Switched to branch 'conflicts'
[master d280694] eighth
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master (root-commit) 4c2ba33] Add foo
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 foo
On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   prefix-prefi0
	new file:   prefix-prefi1
	new file:   prefix-prefi2
	new file:   prefix-prefi3
	new file:   prefix-prefi4
	new file:   prefix-prefi5
	new file:   prefix-prefi6
	new file:   prefix-prefi7
	new file:   prefix-prefi8
	new file:   prefix-prefi9
	new file:   prefix-prefia
	new file:   prefix-prefib
	new file:   prefix-prefic
	new file:   prefix-prefid
	new file:   prefix-prefie
	new file:   prefix-prefif
	new file:   prefix-prefig
	new file:   prefix-prefih
	new file:   prefix-prefii
	new file:   prefix-prefij
	new file:   prefix-prefik
	new file:   prefix-prefil
	new file:   prefix-prefim
	new file:   prefix-prefin
	new file:   prefix-prefio
	new file:   prefix-prefip
	new file:   prefix-prefiq
	new file:   prefix-prefir
	new file:   prefix-prefis
	new file:   prefix-prefit
	new file:   prefix-prefiu
	new file:   prefix-prefiv
	new file:   prefix-prefiw
	new file:   prefix-prefix
	new file:   prefix-prefiy
	new file:   prefix-prefiz

ok 13 - status, filename length 13

[conflicts 8f933df] on_conflicts
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - create signed commits

expecting success: 
	(
		for commit in initial second merge fourth-signed fifth-signed sixth-signed seventh-signed
		do
			git verify-commit $commit &&
			git show --pretty=short --show-signature $commit >actual &&
			grep "Good signature from" actual &&
			! grep "BAD signature from" actual &&
			echo $commit OK || exit 1
		done
	) &&
	(
		for commit in merge^2 fourth-unsigned sixth-unsigned seventh-unsigned
		do
			test_must_fail git verify-commit $commit &&
			git show --pretty=short --show-signature $commit >actual &&
			! grep "Good signature from" actual &&
			! grep "BAD signature from" actual &&
			echo $commit OK || exit 1
		done
	) &&
	(
		for commit in eighth-signed-alt
		do
			git show --pretty=short --show-signature $commit >actual &&
			grep "Good signature from" actual &&
			! grep "BAD signature from" actual &&
			grep "not certified" actual &&
			echo $commit OK || exit 1
		done
	)

ok 50 - setup status submodule summary

expecting success: 
	cat >expect <<EOF &&
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	new file:   dir2/added
	new file:   sm

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   dir1/modified

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	dir1/untracked
	dir2/modified
	dir2/untracked
	untracked

EOF
	git status >output &&
	test_i18ncmp expect output

expecting success: 
		git add prefix-prefix* &&
		git status
	
ok 1 - prepare for conflicts

expecting success: 
	test_must_fail git merge master &&
	cat >expected <<\EOF &&
On branch conflicts
You have unmerged paths.
  (fix conflicts and run "git commit")

Unmerged paths:
  (use "git add <file>..." to mark resolution)

	both modified:   main.txt

no changes added to commit (use "git add" and/or "git commit -a")
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   prefix-prefix0
	new file:   prefix-prefix1
	new file:   prefix-prefix2
	new file:   prefix-prefix3
	new file:   prefix-prefix4
	new file:   prefix-prefix5
	new file:   prefix-prefix6
	new file:   prefix-prefix7
	new file:   prefix-prefix8
	new file:   prefix-prefix9
	new file:   prefix-prefixa
	new file:   prefix-prefixb
	new file:   prefix-prefixc
	new file:   prefix-prefixd
	new file:   prefix-prefixe
	new file:   prefix-prefixf
	new file:   prefix-prefixg
	new file:   prefix-prefixh
	new file:   prefix-prefixi
	new file:   prefix-prefixj
	new file:   prefix-prefixk
	new file:   prefix-prefixl
	new file:   prefix-prefixm
	new file:   prefix-prefixn
	new file:   prefix-prefixo
	new file:   prefix-prefixp
	new file:   prefix-prefixq
	new file:   prefix-prefixr
	new file:   prefix-prefixs
	new file:   prefix-prefixt
	new file:   prefix-prefixu
	new file:   prefix-prefixv
	new file:   prefix-prefixw
	new file:   prefix-prefixx
	new file:   prefix-prefixy
	new file:   prefix-prefixz

ok 14 - status, filename length 14

gpg: Signature made Wed Dec 16 11:05:57 2015 UTC using DSA key ID CDDE430D
gpg: checking the trustdb
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: Good signature from "C O Mitter <committer@example.com>"
Merging:
8f933df on_conflicts
virtual master
found 1 common ancestor:
56c882b init
Auto-merging main.txt
CONFLICT (content): Merge conflict in main.txt
Automatic merge failed; fix conflicts and then commit the result.
ok 51 - status submodule summary is disabled by default

expecting success: 
	git status --untracked-files=all >output &&
	test_i18ncmp expect output

expecting success: 
		git add prefix-prefix-* &&
		git status
	
ok 2 - status when conflicts unresolved

expecting success: 
	git reset --hard conflicts &&
	test_must_fail git merge master &&
	echo one >main.txt &&
	git add main.txt &&
	cat >expected <<\EOF &&
On branch conflicts
All conflicts fixed but you are still merging.
  (use "git commit" to conclude merge)

Changes to be committed:

	modified:   main.txt

Untracked files not listed (use -u option to show untracked files)
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   prefix-prefix-0
	new file:   prefix-prefix-1
	new file:   prefix-prefix-2
	new file:   prefix-prefix-3
	new file:   prefix-prefix-4
	new file:   prefix-prefix-5
	new file:   prefix-prefix-6
	new file:   prefix-prefix-7
	new file:   prefix-prefix-8
	new file:   prefix-prefix-9
	new file:   prefix-prefix-a
	new file:   prefix-prefix-b
	new file:   prefix-prefix-c
	new file:   prefix-prefix-d
	new file:   prefix-prefix-e
	new file:   prefix-prefix-f
	new file:   prefix-prefix-g
	new file:   prefix-prefix-h
	new file:   prefix-prefix-i
	new file:   prefix-prefix-j
	new file:   prefix-prefix-k
	new file:   prefix-prefix-l
	new file:   prefix-prefix-m
	new file:   prefix-prefix-n
	new file:   prefix-prefix-o
	new file:   prefix-prefix-p
	new file:   prefix-prefix-q
	new file:   prefix-prefix-r
	new file:   prefix-prefix-s
	new file:   prefix-prefix-t
	new file:   prefix-prefix-u
	new file:   prefix-prefix-v
	new file:   prefix-prefix-w
	new file:   prefix-prefix-x
	new file:   prefix-prefix-y
	new file:   prefix-prefix-z

ok 15 - status, filename length 15

ok 52 - status --untracked-files=all does not show submodule

gpg: Good signature from "C O Mitter <committer@example.com>"
expecting success: 
	git status -s >output &&
	test_cmp expect output

expecting success: 
		git add prefix-prefix-p* &&
		git status
	
initial OK
HEAD is now at 8f933df on_conflicts
Merging:
8f933df on_conflicts
virtual master
found 1 common ancestor:
56c882b init
Auto-merging main.txt
CONFLICT (content): Merge conflict in main.txt
Automatic merge failed; fix conflicts and then commit the result.
On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   prefix-prefix-p0
	new file:   prefix-prefix-p1
	new file:   prefix-prefix-p2
	new file:   prefix-prefix-p3
	new file:   prefix-prefix-p4
	new file:   prefix-prefix-p5
	new file:   prefix-prefix-p6
	new file:   prefix-prefix-p7
	new file:   prefix-prefix-p8
	new file:   prefix-prefix-p9
	new file:   prefix-prefix-pa
	new file:   prefix-prefix-pb
	new file:   prefix-prefix-pc
	new file:   prefix-prefix-pd
	new file:   prefix-prefix-pe
	new file:   prefix-prefix-pf
	new file:   prefix-prefix-pg
	new file:   prefix-prefix-ph
	new file:   prefix-prefix-pi
	new file:   prefix-prefix-pj
	new file:   prefix-prefix-pk
	new file:   prefix-prefix-pl
	new file:   prefix-prefix-pm
	new file:   prefix-prefix-pn
	new file:   prefix-prefix-po
	new file:   prefix-prefix-pp
	new file:   prefix-prefix-pq
	new file:   prefix-prefix-pr
	new file:   prefix-prefix-ps
	new file:   prefix-prefix-pt
	new file:   prefix-prefix-pu
	new file:   prefix-prefix-pv
	new file:   prefix-prefix-pw
	new file:   prefix-prefix-px
	new file:   prefix-prefix-py
	new file:   prefix-prefix-pz

ok 16 - status, filename length 16

gpg: Signature made Wed Dec 16 11:05:57 2015 UTC using DSA key ID CDDE430D
gpg: Good signature from "C O Mitter <committer@example.com>"
ok 53 - status -s submodule summary is disabled by default

expecting success: 
	git status -s --untracked-files=all >output &&
	test_cmp expect output

expecting success: 
		git add prefix-prefix-pr* &&
		git status
	
On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   prefix-prefix-pr0
	new file:   prefix-prefix-pr1
	new file:   prefix-prefix-pr2
	new file:   prefix-prefix-pr3
	new file:   prefix-prefix-pr4
	new file:   prefix-prefix-pr5
	new file:   prefix-prefix-pr6
	new file:   prefix-prefix-pr7
	new file:   prefix-prefix-pr8
	new file:   prefix-prefix-pr9
	new file:   prefix-prefix-pra
	new file:   prefix-prefix-prb
	new file:   prefix-prefix-prc
	new file:   prefix-prefix-prd
	new file:   prefix-prefix-pre
	new file:   prefix-prefix-prf
	new file:   prefix-prefix-prg
	new file:   prefix-prefix-prh
	new file:   prefix-prefix-pri
	new file:   prefix-prefix-prj
	new file:   prefix-prefix-prk
	new file:   prefix-prefix-prl
	new file:   prefix-prefix-prm
	new file:   prefix-prefix-prn
	new file:   prefix-prefix-pro
	new file:   prefix-prefix-prp
	new file:   prefix-prefix-prq
	new file:   prefix-prefix-prr
	new file:   prefix-prefix-prs
	new file:   prefix-prefix-prt
	new file:   prefix-prefix-pru
	new file:   prefix-prefix-prv
	new file:   prefix-prefix-prw
	new file:   prefix-prefix-prx
	new file:   prefix-prefix-pry
	new file:   prefix-prefix-prz

ok 54 - status -s --untracked-files=all does not show submodule

ok 17 - status, filename length 17

ok 3 - status when conflicts resolved before commit

expecting success: 
	git reset --hard master &&
	git checkout -b rebase_conflicts &&
	test_commit one_rebase main.txt one &&
	test_commit two_rebase main.txt two &&
	test_commit three_rebase main.txt three

gpg: Good signature from "C O Mitter <committer@example.com>"
expecting success: 
	cat >expect <<EOF &&
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	new file:   dir2/added
	new file:   sm

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   dir1/modified

Submodule changes to be committed:

* sm 0000000...$head (1):
  > Add foo

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	dir1/untracked
	dir2/modified
	dir2/untracked
	untracked

EOF
	git config status.submodulesummary 10 &&
	git status >output &&
	test_i18ncmp expect output

expecting success: 
		git add prefix-prefix-pre* &&
		git status
	
HEAD is now at 88a81b6 on_master
second OK
Switched to a new branch 'rebase_conflicts'
On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   prefix-prefix-pre0
	new file:   prefix-prefix-pre1
	new file:   prefix-prefix-pre2
	new file:   prefix-prefix-pre3
	new file:   prefix-prefix-pre4
	new file:   prefix-prefix-pre5
	new file:   prefix-prefix-pre6
	new file:   prefix-prefix-pre7
	new file:   prefix-prefix-pre8
	new file:   prefix-prefix-pre9
	new file:   prefix-prefix-prea
	new file:   prefix-prefix-preb
	new file:   prefix-prefix-prec
	new file:   prefix-prefix-pred
	new file:   prefix-prefix-pree
	new file:   prefix-prefix-pref
	new file:   prefix-prefix-preg
	new file:   prefix-prefix-preh
	new file:   prefix-prefix-prei
	new file:   prefix-prefix-prej
	new file:   prefix-prefix-prek
	new file:   prefix-prefix-prel
	new file:   prefix-prefix-prem
	new file:   prefix-prefix-pren
	new file:   prefix-prefix-preo
	new file:   prefix-prefix-prep
	new file:   prefix-prefix-preq
	new file:   prefix-prefix-prer
	new file:   prefix-prefix-pres
	new file:   prefix-prefix-pret
	new file:   prefix-prefix-preu
	new file:   prefix-prefix-prev
	new file:   prefix-prefix-prew
	new file:   prefix-prefix-prex
	new file:   prefix-prefix-prey
	new file:   prefix-prefix-prez

ok 18 - status, filename length 18

gpg: Signature made Wed Dec 16 11:05:58 2015 UTC using DSA key ID CDDE430D
gpg: Good signature from "C O Mitter <committer@example.com>"
expecting success: 
		git add prefix-prefix-pref* &&
		git status
	
[rebase_conflicts 000106f] one_rebase
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   prefix-prefix-pref0
	new file:   prefix-prefix-pref1
	new file:   prefix-prefix-pref2
	new file:   prefix-prefix-pref3
	new file:   prefix-prefix-pref4
	new file:   prefix-prefix-pref5
	new file:   prefix-prefix-pref6
	new file:   prefix-prefix-pref7
	new file:   prefix-prefix-pref8
	new file:   prefix-prefix-pref9
	new file:   prefix-prefix-prefa
	new file:   prefix-prefix-prefb
	new file:   prefix-prefix-prefc
	new file:   prefix-prefix-prefd
	new file:   prefix-prefix-prefe
	new file:   prefix-prefix-preff
	new file:   prefix-prefix-prefg
	new file:   prefix-prefix-prefh
	new file:   prefix-prefix-prefi
	new file:   prefix-prefix-prefj
	new file:   prefix-prefix-prefk
	new file:   prefix-prefix-prefl
	new file:   prefix-prefix-prefm
	new file:   prefix-prefix-prefn
	new file:   prefix-prefix-prefo
	new file:   prefix-prefix-prefp
	new file:   prefix-prefix-prefq
	new file:   prefix-prefix-prefr
	new file:   prefix-prefix-prefs
	new file:   prefix-prefix-preft
	new file:   prefix-prefix-prefu
	new file:   prefix-prefix-prefv
	new file:   prefix-prefix-prefw
	new file:   prefix-prefix-prefx
	new file:   prefix-prefix-prefy
	new file:   prefix-prefix-prefz

ok 19 - status, filename length 19

gpg: Good signature from "C O Mitter <committer@example.com>"
merge OK
expecting success: 
		git add prefix-prefix-prefi* &&
		git status
	
gpg: Signature made Wed Dec 16 11:05:58 2015 UTC using DSA key ID CDDE430D
gpg: Good signature from "C O Mitter <committer@example.com>"
On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   prefix-prefix-prefi0
	new file:   prefix-prefix-prefi1
	new file:   prefix-prefix-prefi2
	new file:   prefix-prefix-prefi3
	new file:   prefix-prefix-prefi4
	new file:   prefix-prefix-prefi5
	new file:   prefix-prefix-prefi6
	new file:   prefix-prefix-prefi7
	new file:   prefix-prefix-prefi8
	new file:   prefix-prefix-prefi9
	new file:   prefix-prefix-prefia
	new file:   prefix-prefix-prefib
	new file:   prefix-prefix-prefic
	new file:   prefix-prefix-prefid
	new file:   prefix-prefix-prefie
	new file:   prefix-prefix-prefif
	new file:   prefix-prefix-prefig
	new file:   prefix-prefix-prefih
	new file:   prefix-prefix-prefii
	new file:   prefix-prefix-prefij
	new file:   prefix-prefix-prefik
	new file:   prefix-prefix-prefil
	new file:   prefix-prefix-prefim
	new file:   prefix-prefix-prefin
	new file:   prefix-prefix-prefio
	new file:   prefix-prefix-prefip
	new file:   prefix-prefix-prefiq
	new file:   prefix-prefix-prefir
	new file:   prefix-prefix-prefis
	new file:   prefix-prefix-prefit
	new file:   prefix-prefix-prefiu
	new file:   prefix-prefix-prefiv
	new file:   prefix-prefix-prefiw
	new file:   prefix-prefix-prefix
	new file:   prefix-prefix-prefiy
	new file:   prefix-prefix-prefiz

ok 20 - status, filename length 20

[rebase_conflicts f5f3be0] two_rebase
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
expecting success: 
		git add prefix-prefix-prefix* &&
		git status
	
gpg: Good signature from "C O Mitter <committer@example.com>"
[rebase_conflicts 227802d] three_rebase
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
fourth-signed OK
On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   prefix-prefix-prefix0
	new file:   prefix-prefix-prefix1
	new file:   prefix-prefix-prefix2
	new file:   prefix-prefix-prefix3
	new file:   prefix-prefix-prefix4
	new file:   prefix-prefix-prefix5
	new file:   prefix-prefix-prefix6
	new file:   prefix-prefix-prefix7
	new file:   prefix-prefix-prefix8
	new file:   prefix-prefix-prefix9
	new file:   prefix-prefix-prefixa
	new file:   prefix-prefix-prefixb
	new file:   prefix-prefix-prefixc
	new file:   prefix-prefix-prefixd
	new file:   prefix-prefix-prefixe
	new file:   prefix-prefix-prefixf
	new file:   prefix-prefix-prefixg
	new file:   prefix-prefix-prefixh
	new file:   prefix-prefix-prefixi
	new file:   prefix-prefix-prefixj
	new file:   prefix-prefix-prefixk
	new file:   prefix-prefix-prefixl
	new file:   prefix-prefix-prefixm
	new file:   prefix-prefix-prefixn
	new file:   prefix-prefix-prefixo
	new file:   prefix-prefix-prefixp
	new file:   prefix-prefix-prefixq
	new file:   prefix-prefix-prefixr
	new file:   prefix-prefix-prefixs
	new file:   prefix-prefix-prefixt
	new file:   prefix-prefix-prefixu
	new file:   prefix-prefix-prefixv
	new file:   prefix-prefix-prefixw
	new file:   prefix-prefix-prefixx
	new file:   prefix-prefix-prefixy
	new file:   prefix-prefix-prefixz

ok 21 - status, filename length 21

ok 4 - prepare for rebase conflicts

expecting success: 
	test_when_finished "git rebase --abort" &&
	ONTO=$(git rev-parse --short HEAD^^) &&
	test_must_fail git rebase HEAD^ --onto HEAD^^ &&
	cat >expected <<EOF &&
rebase in progress; onto $ONTO
You are currently rebasing branch 'rebase_conflicts' on '$ONTO'.
  (fix conflicts and then run "git rebase --continue")
  (use "git rebase --skip" to skip this patch)
  (use "git rebase --abort" to check out the original branch)

Unmerged paths:
  (use "git reset HEAD <file>..." to unstage)
  (use "git add <file>..." to mark resolution)

	both modified:   main.txt

no changes added to commit (use "git add" and/or "git commit -a")
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

No submodule mapping found in .gitmodules for path 'sm'
expecting success: 
		git add prefix-prefix-prefix-* &&
		git status
	
gpg: Signature made Wed Dec 16 11:05:58 2015 UTC using DSA key ID CDDE430D
gpg: Good signature from "C O Mitter <committer@example.com>"
On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   prefix-prefix-prefix-0
	new file:   prefix-prefix-prefix-1
	new file:   prefix-prefix-prefix-2
	new file:   prefix-prefix-prefix-3
	new file:   prefix-prefix-prefix-4
	new file:   prefix-prefix-prefix-5
	new file:   prefix-prefix-prefix-6
	new file:   prefix-prefix-prefix-7
	new file:   prefix-prefix-prefix-8
	new file:   prefix-prefix-prefix-9
	new file:   prefix-prefix-prefix-a
	new file:   prefix-prefix-prefix-b
	new file:   prefix-prefix-prefix-c
	new file:   prefix-prefix-prefix-d
	new file:   prefix-prefix-prefix-e
	new file:   prefix-prefix-prefix-f
	new file:   prefix-prefix-prefix-g
	new file:   prefix-prefix-prefix-h
	new file:   prefix-prefix-prefix-i
	new file:   prefix-prefix-prefix-j
	new file:   prefix-prefix-prefix-k
	new file:   prefix-prefix-prefix-l
	new file:   prefix-prefix-prefix-m
	new file:   prefix-prefix-prefix-n
	new file:   prefix-prefix-prefix-o
	new file:   prefix-prefix-prefix-p
	new file:   prefix-prefix-prefix-q
	new file:   prefix-prefix-prefix-r
	new file:   prefix-prefix-prefix-s
	new file:   prefix-prefix-prefix-t
	new file:   prefix-prefix-prefix-u
	new file:   prefix-prefix-prefix-v
	new file:   prefix-prefix-prefix-w
	new file:   prefix-prefix-prefix-x
	new file:   prefix-prefix-prefix-y
	new file:   prefix-prefix-prefix-z

ok 22 - status, filename length 22

expecting success: 
		git add prefix-prefix-prefix-p* &&
		git status
	
gpg: Good signature from "C O Mitter <committer@example.com>"
fifth-signed OK
On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   prefix-prefix-prefix-p0
	new file:   prefix-prefix-prefix-p1
	new file:   prefix-prefix-prefix-p2
	new file:   prefix-prefix-prefix-p3
	new file:   prefix-prefix-prefix-p4
	new file:   prefix-prefix-prefix-p5
	new file:   prefix-prefix-prefix-p6
	new file:   prefix-prefix-prefix-p7
	new file:   prefix-prefix-prefix-p8
	new file:   prefix-prefix-prefix-p9
	new file:   prefix-prefix-prefix-pa
	new file:   prefix-prefix-prefix-pb
	new file:   prefix-prefix-prefix-pc
	new file:   prefix-prefix-prefix-pd
	new file:   prefix-prefix-prefix-pe
	new file:   prefix-prefix-prefix-pf
	new file:   prefix-prefix-prefix-pg
	new file:   prefix-prefix-prefix-ph
	new file:   prefix-prefix-prefix-pi
	new file:   prefix-prefix-prefix-pj
	new file:   prefix-prefix-prefix-pk
	new file:   prefix-prefix-prefix-pl
	new file:   prefix-prefix-prefix-pm
	new file:   prefix-prefix-prefix-pn
	new file:   prefix-prefix-prefix-po
	new file:   prefix-prefix-prefix-pp
	new file:   prefix-prefix-prefix-pq
	new file:   prefix-prefix-prefix-pr
	new file:   prefix-prefix-prefix-ps
	new file:   prefix-prefix-prefix-pt
	new file:   prefix-prefix-prefix-pu
	new file:   prefix-prefix-prefix-pv
	new file:   prefix-prefix-prefix-pw
	new file:   prefix-prefix-prefix-px
	new file:   prefix-prefix-prefix-py
	new file:   prefix-prefix-prefix-pz

ok 23 - status, filename length 23

expecting success: 
		git add prefix-prefix-prefix-pr* &&
		git status
	
gpg: Signature made Wed Dec 16 11:05:59 2015 UTC using DSA key ID CDDE430D
gpg: Good signature from "C O Mitter <committer@example.com>"
On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   prefix-prefix-prefix-pr0
	new file:   prefix-prefix-prefix-pr1
	new file:   prefix-prefix-prefix-pr2
	new file:   prefix-prefix-prefix-pr3
	new file:   prefix-prefix-prefix-pr4
	new file:   prefix-prefix-prefix-pr5
	new file:   prefix-prefix-prefix-pr6
	new file:   prefix-prefix-prefix-pr7
	new file:   prefix-prefix-prefix-pr8
	new file:   prefix-prefix-prefix-pr9
	new file:   prefix-prefix-prefix-pra
	new file:   prefix-prefix-prefix-prb
	new file:   prefix-prefix-prefix-prc
	new file:   prefix-prefix-prefix-prd
	new file:   prefix-prefix-prefix-pre
	new file:   prefix-prefix-prefix-prf
	new file:   prefix-prefix-prefix-prg
	new file:   prefix-prefix-prefix-prh
	new file:   prefix-prefix-prefix-pri
	new file:   prefix-prefix-prefix-prj
	new file:   prefix-prefix-prefix-prk
	new file:   prefix-prefix-prefix-prl
	new file:   prefix-prefix-prefix-prm
	new file:   prefix-prefix-prefix-prn
	new file:   prefix-prefix-prefix-pro
	new file:   prefix-prefix-prefix-prp
	new file:   prefix-prefix-prefix-prq
	new file:   prefix-prefix-prefix-prr
	new file:   prefix-prefix-prefix-prs
	new file:   prefix-prefix-prefix-prt
	new file:   prefix-prefix-prefix-pru
	new file:   prefix-prefix-prefix-prv
	new file:   prefix-prefix-prefix-prw
	new file:   prefix-prefix-prefix-prx
	new file:   prefix-prefix-prefix-pry
	new file:   prefix-prefix-prefix-prz

ok 24 - status, filename length 24

gpg: Good signature from "C O Mitter <committer@example.com>"
sixth-signed OK
# passed all 24 test(s)
1..24
*** t7513-interpret-trailers.sh ***
gpg: Signature made Wed Dec 16 11:05:59 2015 UTC using DSA key ID CDDE430D
gpg: Good signature from "C O Mitter <committer@example.com>"
First, rewinding head to replay your work on top of it...
ok 55 - status submodule summary

expecting success: 
	strip_comments expect &&
	git -c status.displayCommentPrefix=false status >output &&
	test_i18ncmp expect output

gpg: Good signature from "C O Mitter <committer@example.com>"
seventh-signed OK
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7513-interpret-trailers/.git/
expecting success: 
	: >empty &&
	cat >basic_message <<-\EOF &&
		subject

		body
	EOF
	cat >complex_message_body <<-\EOF &&
		my subject

		my body which is long
		and contains some special
		chars like : = ? !

	EOF
	sed -e "s/ Z\$/ /" >complex_message_trailers <<-\EOF &&
		Fixes: Z
		Acked-by: Z
		Reviewed-by: Z
		Signed-off-by: Z
	EOF
	cat >basic_patch <<-\EOF
		---
		 foo.txt | 2 +-
		 1 file changed, 1 insertion(+), 1 deletion(-)

		diff --git a/foo.txt b/foo.txt
		index 0353767..1d91aa1 100644
		--- a/foo.txt
		+++ b/foo.txt
		@@ -1,3 +1,3 @@

		-bar
		+baz

		--
		1.9.rc0.11.ga562ddc

	EOF

Applying: three_rebase
ok 1 - setup

expecting success: 
	sed -e "s/ Z\$/ /" >expected <<-\EOF &&

		ack: Peff
		Reviewed-by: Z
		Acked-by: Johan
	EOF
	git interpret-trailers --trailer "ack = Peff" --trailer "Reviewed-by" \
		--trailer "Acked-by: Johan" empty >actual &&
	test_cmp expected actual

merge^2 OK
Using index info to reconstruct a base tree...
M	main.txt
ok 2 - without config

expecting success: 
	sed -e "s/ Z\$/ /" >expected <<-\EOF &&

		Acked-by: Johan
		Reviewed-by: Z
		ack: Peff
	EOF
	git interpret-trailers --trailer "Acked-by: Johan" --trailer "Reviewed-by" \
		--trailer "ack = Peff" empty >actual &&
	test_cmp expected actual

Falling back to patching base and 3-way merge...
fourth-unsigned OK
Merging 000106f582466cd889472e29a05f277e464bb3e8 with three_rebase
Merging:
000106f one_rebase
virtual three_rebase
found 1 common ancestor:
virtual 022b39ca39aa226018ccf5f8138fd73f11c73790
Auto-merging main.txt
CONFLICT (content): Merge conflict in main.txt
error: Failed to merge in the changes.
ok 3 - without config in another order

Patch failed at 0001 three_rebase
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

expecting success: 
	cat >expected <<-\EOF &&

		ack: Peff
		Acked-by: Johan
	EOF
	git interpret-trailers --trim-empty --trailer ack=Peff \
		--trailer "Reviewed-by" --trailer "Acked-by: Johan" \
		--trailer "sob:" empty >actual &&
	test_cmp expected actual

ok 4 - --trim-empty without config

expecting success: 
	cat >expected <<-\EOF &&

		Acked-by: Johan
		Reviewed-by: Peff
	EOF
	{ echo; echo "Acked-by: Johan"; } |
	git -c "trailer.Acked-by.ifexists=addifdifferent" interpret-trailers \
		--trailer "Reviewed-by: Peff" --trailer "Acked-by: Johan" >actual &&
	test_cmp expected actual

sixth-unsigned OK
ok 5 - with config option on the command line

expecting success: 
	cat >expected <<-\EOF &&
		area: change

		Reviewed-by: Peff
		Acked-by: Johan
	EOF
	echo "area: change" |
	git interpret-trailers --trailer "Reviewed-by: Peff" \
		--trailer "Acked-by: Johan" >actual &&
	test_cmp expected actual

seventh-unsigned OK
ok 6 - with only a title in the message

expecting success: 
	cat >expected <<-\EOF &&
		place of
		code: change

		Reviewed-by: Peff
		Acked-by: Johan
	EOF
	printf "%s\n" "place of" "code: change" |
	git interpret-trailers --trailer "Reviewed-by: Peff" \
		--trailer "Acked-by: Johan" >actual &&
	test_cmp expected actual

No submodule mapping found in .gitmodules for path 'sm'
ok 7 - with multiline title in the message

expecting success: 
	git config trailer.ack.key "Acked-by: " &&
	cat >expected <<-\EOF &&

		Acked-by: Peff
	EOF
	git interpret-trailers --trim-empty --trailer "ack = Peff" empty >actual &&
	test_cmp expected actual &&
	git interpret-trailers --trim-empty --trailer "Acked-by = Peff" empty >actual &&
	test_cmp expected actual &&
	git interpret-trailers --trim-empty --trailer "Acked-by :Peff" empty >actual &&
	test_cmp expected actual

gpg: Good signature from "Eris Discordia <discord@example.net>"
gpg: WARNING: This key is not certified with a trusted signature!
eighth-signed-alt OK
ok 2 - verify and show signatures

expecting success: 
	git verify-commit eighth-signed-alt 2>actual &&
	grep "Good signature from" actual &&
	! grep "BAD signature from" actual &&
	grep "not certified" actual

gpg: Good signature from "Eris Discordia <discord@example.net>"
gpg: WARNING: This key is not certified with a trusted signature!
ok 3 - verify-commit exits success on untrusted signature

ok 8 - with config setup

expecting success: 
	git config trailer.separators ":=" &&
	git config trailer.ack.key "Acked-by= " &&
	cat >expected <<-\EOF &&

		Acked-by= Peff
	EOF
	git interpret-trailers --trim-empty --trailer "ack = Peff" empty >actual &&
	test_cmp expected actual &&
	git interpret-trailers --trim-empty --trailer "Acked-by= Peff" empty >actual &&
	test_cmp expected actual &&
	git interpret-trailers --trim-empty --trailer "Acked-by : Peff" empty >actual &&
	test_cmp expected actual

expecting success: 
	(
		for commit in initial second merge fourth-signed fifth-signed sixth-signed seventh-signed
		do
			git verify-commit --raw $commit 2>actual &&
			grep "GOODSIG" actual &&
			! grep "BADSIG" actual &&
			echo $commit OK || exit 1
		done
	) &&
	(
		for commit in merge^2 fourth-unsigned sixth-unsigned seventh-unsigned
		do
			test_must_fail git verify-commit --raw $commit 2>actual &&
			! grep "GOODSIG" actual &&
			! grep "BADSIG" actual &&
			echo $commit OK || exit 1
		done
	) &&
	(
		for commit in eighth-signed-alt
		do
			git verify-commit --raw $commit 2>actual &&
			grep "GOODSIG" actual &&
			! grep "BADSIG" actual &&
			grep "TRUST_UNDEFINED" actual &&
			echo $commit OK || exit 1
		done
	)

ok 5 - status when rebase in progress before resolving conflicts

expecting success: 
	git reset --hard rebase_conflicts &&
	test_when_finished "git rebase --abort" &&
	ONTO=$(git rev-parse --short HEAD^^) &&
	test_must_fail git rebase HEAD^ --onto HEAD^^ &&
	echo three >main.txt &&
	git add main.txt &&
	cat >expected <<EOF &&
rebase in progress; onto $ONTO
You are currently rebasing branch 'rebase_conflicts' on '$ONTO'.
  (all conflicts fixed: run "git rebase --continue")

Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	modified:   main.txt

Untracked files not listed (use -u option to show untracked files)
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

[GNUPG:] GOODSIG 13B6F51ECDDE430D C O Mitter <committer@example.com>
HEAD is now at 227802d three_rebase
initial OK
ok 9 - with config setup and ":=" as separators

expecting success: 
	git config trailer.separators "%" &&
	cat >expected <<-\EOF &&

		bug% 42
		count% 10
		bug% 422
	EOF
	git interpret-trailers --trim-empty --trailer "bug = 42" \
		--trailer count%10 --trailer "test: stuff" \
		--trailer "bug % 422" empty >actual &&
	test_cmp expected actual

ok 10 - with config setup and "%" as separators

expecting success: 
	cat >special_message <<-\EOF &&
		Special Message

		bug% 42
		count% 10
		bug% 422
	EOF
	cat >expected <<-\EOF &&
		Special Message

		bug% 42
		count% 10
		bug% 422
		count% 100
	EOF
	git interpret-trailers --trailer count%100 \
		special_message >actual &&
	test_cmp expected actual

[GNUPG:] GOODSIG 13B6F51ECDDE430D C O Mitter <committer@example.com>
second OK
ok 11 - with "%" as separators and a message with trailers

expecting success: 
	git config trailer.separators ":=#" &&
	git config trailer.bug.key "Bug #" &&
	cat >expected <<-\EOF &&

		Bug #42
	EOF
	git interpret-trailers --trim-empty --trailer "bug = 42" empty >actual &&
	test_cmp expected actual

ok 56 - status submodule summary with status.displayCommentPrefix=false

expecting success: 
	commit_template_commented

[GNUPG:] GOODSIG 13B6F51ECDDE430D C O Mitter <committer@example.com>
merge OK
ok 12 - with config setup and ":=#" as separators

expecting success: 
	cat basic_message >expected &&
	echo >>expected &&
	git interpret-trailers <basic_message >actual &&
	test_cmp expected actual

ok 13 - with commit basic message

expecting success: 
	cat basic_message >input &&
	cat basic_patch >>input &&
	cat basic_message >expected &&
	echo >>expected &&
	cat basic_patch >>expected &&
	git interpret-trailers <input >actual &&
	test_cmp expected actual

[GNUPG:] GOODSIG 13B6F51ECDDE430D C O Mitter <committer@example.com>
fourth-signed OK
ok 14 - with basic patch

expecting success: 
	cat complex_message_body complex_message_trailers >complex_message &&
	cat complex_message_body >expected &&
	sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
		Fixes: Z
		Acked-by= Z
		Reviewed-by: Z
		Signed-off-by: Z
	EOF
	git interpret-trailers complex_message >actual &&
	test_cmp expected actual

ok 15 - with commit complex message as argument

expecting success: 
	cat basic_message >>expected &&
	echo >>expected &&
	cat basic_patch >>expected &&
	git interpret-trailers complex_message input >actual &&
	test_cmp expected actual

[GNUPG:] GOODSIG 13B6F51ECDDE430D C O Mitter <committer@example.com>
First, rewinding head to replay your work on top of it...
fifth-signed OK
warning: more than one trailer.ack.key
warning: more than one trailer.bug.key
ok 16 - with 2 files arguments

expecting success: 
	cat basic_message >message_with_comments &&
	sed -e "s/ Z\$/ /" >>message_with_comments <<-\EOF &&
		# comment

		# other comment
		Cc: Z
		# yet another comment
		Reviewed-by: Johan
		Reviewed-by: Z
		# last comment

	EOF
	cat basic_patch >>message_with_comments &&
	cat basic_message >expected &&
	cat >>expected <<-\EOF &&
		# comment

		Reviewed-by: Johan
		Cc: Peff
		# last comment

	EOF
	cat basic_patch >>expected &&
	git interpret-trailers --trim-empty --trailer "Cc: Peff" message_with_comments >actual &&
	test_cmp expected actual

[GNUPG:] GOODSIG 13B6F51ECDDE430D C O Mitter <committer@example.com>
sixth-signed OK
No submodule mapping found in .gitmodules for path 'sm'
ok 17 - with message that has comments

expecting success: 
	cat basic_message >message_with_comments &&
	sed -e "s/ Z\$/ /" >>message_with_comments <<-\EOF &&
		# comment

		# other comment
		Cc: Z
		# yet another comment
		Reviewed-by: Johan
		Reviewed-by: Z
		# last comment

		Conflicts:

	EOF
	cat basic_message >expected &&
	cat >>expected <<-\EOF &&
		# comment

		Reviewed-by: Johan
		Cc: Peff
		# last comment

		Conflicts:

	EOF
	git interpret-trailers --trim-empty --trailer "Cc: Peff" message_with_comments >actual &&
	test_cmp expected actual

Applying: three_rebase
[GNUPG:] GOODSIG 13B6F51ECDDE430D C O Mitter <committer@example.com>
seventh-signed OK
Using index info to reconstruct a base tree...
M	main.txt
ok 18 - with message that has an old style conflict block

expecting success: 
	cat complex_message_body >expected &&
	sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
		Fixes: Z
		Acked-by= Z
		Reviewed-by: Z
		Signed-off-by: Z
		Acked-by= Peff
		Bug #42
	EOF
	git interpret-trailers --trailer "ack: Peff" \
		--trailer "bug: 42" <complex_message >actual &&
	test_cmp expected actual

Falling back to patching base and 3-way merge...
merge^2 OK
Merging 000106f582466cd889472e29a05f277e464bb3e8 with three_rebase
Merging:
000106f one_rebase
virtual three_rebase
found 1 common ancestor:
virtual 022b39ca39aa226018ccf5f8138fd73f11c73790
Auto-merging main.txt
CONFLICT (content): Merge conflict in main.txt
error: Failed to merge in the changes.
Patch failed at 0001 three_rebase
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

ok 19 - with commit complex message and trailer args

expecting success: 
	cat complex_message >complex_patch &&
	cat basic_patch >>complex_patch &&
	cat complex_message_body >expected &&
	cat >>expected <<-\EOF &&
		Acked-by= Peff
		Bug #42
	EOF
	cat basic_patch >>expected &&
	git interpret-trailers --trim-empty --trailer "ack: Peff" \
		--trailer "bug: 42" <complex_patch >actual &&
	test_cmp expected actual

fourth-unsigned OK
sixth-unsigned OK
ok 20 - with complex patch, args and --trim-empty

expecting success: 
	git config trailer.bug.where "before" &&
	cat complex_message_body >expected &&
	sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
		Bug #42
		Fixes: Z
		Acked-by= Z
		Reviewed-by: Z
		Signed-off-by: Z
		Acked-by= Peff
	EOF
	git interpret-trailers --trailer "ack: Peff" \
		--trailer "bug: 42" complex_message >actual &&
	test_cmp expected actual

seventh-unsigned OK
ok 21 - using "where = before"

expecting success: 
	git config trailer.ack.where "after" &&
	cat complex_message_body >expected &&
	sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
		Bug #42
		Fixes: Z
		Acked-by= Z
		Acked-by= Peff
		Reviewed-by: Z
		Signed-off-by: Z
	EOF
	git interpret-trailers --trailer "ack: Peff" \
		--trailer "bug: 42" complex_message >actual &&
	test_cmp expected actual

[GNUPG:] GOODSIG 61092E85B7227189 Eris Discordia <discord@example.net>
[GNUPG:] TRUST_UNDEFINED
eighth-signed-alt OK
ok 4 - verify signatures with --raw

expecting success: 
	git show -s initial >commit &&
	git show -s --show-signature initial >show &&
	git verify-commit -v initial >verify.1 2>verify.2 &&
	git cat-file commit initial >cat &&
	grep -v -e "gpg: " -e "Warning: " show >show.commit &&
	grep -e "gpg: " -e "Warning: " show >show.gpg &&
	grep -v "^ " cat | grep -v "^gpgsig " >cat.commit &&
	test_cmp show.commit commit &&
	test_cmp show.gpg verify.2 &&
	test_cmp cat.commit verify.1

ok 22 - using "where = after"

expecting success: 
	git config trailer.review.key "Reviewed-by" &&
	git config trailer.review.where "end" &&
	cat complex_message_body >expected &&
	sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
		Fixes: Z
		Acked-by= Z
		Acked-by= Peff
		Reviewed-by: Z
		Signed-off-by: Z
		Reviewed-by: Junio
		Reviewed-by: Johannes
	EOF
	git interpret-trailers --trailer "ack: Peff" \
		--trailer "Reviewed-by: Junio" --trailer "Reviewed-by: Johannes" \
		complex_message >actual &&
	test_cmp expected actual

Aborting commit due to empty commit message.
ok 57 - commit with submodule summary ignores status.displayCommentPrefix

expecting success: 
	git status -s >output &&
	test_cmp expect output

ok 23 - using "where = end"

expecting success: 
	git config trailer.review.key "Reviewed-by" &&
	git config trailer.review.where "start" &&
	cat complex_message_body >expected &&
	sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
		Reviewed-by: Johannes
		Reviewed-by: Junio
		Fixes: Z
		Acked-by= Z
		Acked-by= Peff
		Reviewed-by: Z
		Signed-off-by: Z
	EOF
	git interpret-trailers --trailer "ack: Peff" \
		--trailer "Reviewed-by: Junio" --trailer "Reviewed-by: Johannes" \
		complex_message >actual &&
	test_cmp expected actual

ok 58 - status -s submodule summary

expecting success: 
	cat >expect <<EOF &&
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   dir1/modified

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	dir1/untracked
	dir2/modified
	dir2/untracked
	untracked

no changes added to commit (use "git add" and/or "git commit -a")
EOF
	git commit -m "commit submodule" &&
	git config status.submodulesummary 10 &&
	test_must_fail git commit --dry-run >output &&
	test_i18ncmp expect output &&
	git status >output &&
	test_i18ncmp expect output

ok 6 - status when rebase in progress before rebase --continue

expecting success: 
	git reset --hard master &&
	git checkout -b rebase_i_conflicts &&
	test_commit one_unmerge main.txt one_unmerge &&
	git branch rebase_i_conflicts_second &&
	test_commit one_master main.txt one_master &&
	git checkout rebase_i_conflicts_second &&
	test_commit one_second main.txt one_second

HEAD is now at 88a81b6 on_master
ok 24 - using "where = start"

expecting success: 
	git config trailer.review.key "Reviewed-by:" &&
	git config trailer.review.where "before" &&
	cat complex_message_body >expected &&
	sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
		Bug #42
		Fixes: Z
		Acked-by= Z
		Acked-by= Peff
		Reviewed-by:Johan
		Reviewed-by:
		Signed-off-by: Z
	EOF
	git interpret-trailers --trailer "ack: Peff" --trailer "bug: 42" \
		--trailer "review: Johan" <complex_message >actual &&
	test_cmp expected actual

[master bb15d44] commit submodule
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 dir2/added
 create mode 160000 sm
ok 5 - show signed commit with signature
Switched to a new branch 'rebase_i_conflicts'

expecting success: 
	git cat-file commit seventh-signed >raw &&

	sed -e "s/seventh/7th forged/" raw >forged1 &&
	git hash-object -w -t commit forged1 >forged1.commit &&
	! git verify-commit $(cat forged1.commit) &&
	git show --pretty=short --show-signature $(cat forged1.commit) >actual1 &&
	grep "BAD signature from" actual1 &&
	! grep "Good signature from" actual1

[rebase_i_conflicts 2481394] one_unmerge
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 25 - using "where = before" for a token in the middle of the message

expecting success: 
	cat complex_message_body >expected &&
	cat >>expected <<-\EOF &&
		Bug #46
		Bug #42
		Acked-by= Peff
		Reviewed-by:Johan
	EOF
	git interpret-trailers --trim-empty --trailer "ack: Peff" \
		--trailer "bug: 42" --trailer "review: Johan" \
		--trailer "Bug: 46" <complex_message >actual &&
	test_cmp expected actual

ok 26 - using "where = before" and --trim-empty

expecting success: 
	cat complex_message_body >expected &&
	sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
		Bug #42
		Fixes: Z
		Acked-by= Z
		Acked-by= Peff
		Acked-by= Junio
		Acked-by= Peff
		Reviewed-by:
		Signed-off-by: Z
	EOF
	git interpret-trailers --trailer "ack: Peff" --trailer "review:" \
		--trailer "ack: Junio" --trailer "bug: 42" --trailer "ack: Peff" \
		--trailer "ack: Peff" <complex_message >actual &&
	test_cmp expected actual

gpg: Signature made Wed Dec 16 11:05:59 2015 UTC using DSA key ID CDDE430D
gpg: BAD signature from "C O Mitter <committer@example.com>"
ok 27 - the default is "ifExists = addIfDifferentNeighbor"

expecting success: 
	git config trailer.ifexists "addIfDifferent" &&
	cat complex_message_body >expected &&
	sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
		Bug #42
		Fixes: Z
		Acked-by= Z
		Acked-by= Peff
		Acked-by= Junio
		Reviewed-by:
		Signed-off-by: Z
	EOF
	git interpret-trailers --trailer "ack: Peff" --trailer "review:" \
		--trailer "ack: Junio" --trailer "bug: 42" --trailer "ack: Peff" \
		--trailer "ack: Peff" <complex_message >actual &&
	test_cmp expected actual

[rebase_i_conflicts e0164e4] one_master
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to branch 'rebase_i_conflicts_second'
ok 28 - default "ifExists" is now "addIfDifferent"

expecting success: 
	git config trailer.ack.ifExists "addIfDifferent" &&
	git config trailer.ack.where "end" &&
	cat complex_message_body >expected &&
	sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
		Bug #42
		Fixes: Z
		Acked-by= Z
		Reviewed-by:
		Signed-off-by: Z
		Acked-by= Peff
	EOF
	git interpret-trailers --trailer "ack: Peff" --trailer "review:" \
		--trailer "bug: 42" --trailer "ack: Peff" \
		<complex_message >actual &&
	test_cmp expected actual

gpg: BAD signature from "C O Mitter <committer@example.com>"
ok 6 - detect fudged signature

expecting success: 
	git cat-file commit seventh-signed >raw &&
	cat raw >forged2 &&
	echo Qwik | tr "Q" "\000" >>forged2 &&
	git hash-object -w -t commit forged2 >forged2.commit &&
	! git verify-commit $(cat forged2.commit) &&
	git show --pretty=short --show-signature $(cat forged2.commit) >actual2 &&
	grep "BAD signature from" actual2 &&
	! grep "Good signature from" actual2

[rebase_i_conflicts_second b88a46f] one_second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 29 - using "ifExists = addIfDifferent" with "where = end"

expecting success: 
	git config trailer.ack.ifExists "addIfDifferent" &&
	git config trailer.ack.where "before" &&
	cat complex_message_body >expected &&
	sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
		Bug #42
		Fixes: Z
		Acked-by= Peff
		Acked-by= Z
		Reviewed-by:
		Signed-off-by: Z
	EOF
	git interpret-trailers --trailer "ack: Peff" --trailer "review:" \
		--trailer "bug: 42" --trailer "ack: Peff" \
		<complex_message >actual &&
	test_cmp expected actual

ok 7 - prepare for rebase_i_conflicts

expecting success: 
	test_when_finished "git rebase --abort" &&
	ONTO=$(git rev-parse --short rebase_i_conflicts) &&
	LAST_COMMIT=$(git rev-parse --short rebase_i_conflicts_second) &&
	test_must_fail git rebase -i rebase_i_conflicts &&
	cat >expected <<EOF &&
interactive rebase in progress; onto $ONTO
Last command done (1 command done):
   pick $LAST_COMMIT one_second
No commands remaining.
You are currently rebasing branch 'rebase_i_conflicts_second' on '$ONTO'.
  (fix conflicts and then run "git rebase --continue")
  (use "git rebase --skip" to skip this patch)
  (use "git rebase --abort" to check out the original branch)

Unmerged paths:
  (use "git reset HEAD <file>..." to unstage)
  (use "git add <file>..." to mark resolution)

	both modified:   main.txt

no changes added to commit (use "git add" and/or "git commit -a")
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

gpg: Signature made Wed Dec 16 11:05:59 2015 UTC using DSA key ID CDDE430D
gpg: BAD signature from "C O Mitter <committer@example.com>"
ok 30 - using "ifExists = addIfDifferent" with "where = before"

expecting success: 
	git config trailer.ack.ifExists "addIfDifferentNeighbor" &&
	git config trailer.ack.where "end" &&
	cat complex_message_body >expected &&
	sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
		Bug #42
		Fixes: Z
		Acked-by= Z
		Reviewed-by:
		Signed-off-by: Z
		Acked-by= Peff
		Acked-by= Junio
		Tested-by: Jakub
		Acked-by= Junio
		Acked-by= Peff
	EOF
	git interpret-trailers --trailer "ack: Peff" --trailer "review:" \
		--trailer "ack: Junio" --trailer "bug: 42" \
		--trailer "Tested-by: Jakub" --trailer "ack: Junio" \
		--trailer "ack: Junio" --trailer "ack: Peff" <complex_message >actual &&
	test_cmp expected actual

ok 31 - using "ifExists = addIfDifferentNeighbor" with "where = end"

expecting success: 
	git config trailer.ack.ifExists "addIfDifferentNeighbor" &&
	git config trailer.ack.where "after" &&
	cat complex_message_body >expected &&
	sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
		Bug #42
		Fixes: Z
		Acked-by= Z
		Acked-by= Peff
		Acked-by= Junio
		Acked-by= Peff
		Reviewed-by:
		Signed-off-by: Z
		Tested-by: Jakub
	EOF
	git interpret-trailers --trailer "ack: Peff" --trailer "review:" \
		--trailer "ack: Junio" --trailer "bug: 42" \
		--trailer "Tested-by: Jakub" --trailer "ack: Junio" \
		--trailer "ack: Junio" --trailer "ack: Peff" <complex_message >actual &&
	test_cmp expected actual

gpg: BAD signature from "C O Mitter <committer@example.com>"
ok 7 - detect fudged signature with NUL

expecting success: 
	git checkout fourth-signed^0 &&
	git commit --amend -S --no-edit &&
	git verify-commit HEAD &&
	git show -s --show-signature HEAD >actual &&
	grep "Good signature from" actual &&
	! grep "BAD signature from" actual

Note: checking out 'fourth-signed^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 c5b3e3c... fourth signed
ok 32 - using "ifExists = addIfDifferentNeighbor"  with "where = after"

expecting success: 
	git config trailer.ack.ifExists "addIfDifferentNeighbor" &&
	cat complex_message_body >expected &&
	cat >>expected <<-\EOF &&
		Bug #42
		Acked-by= Peff
		Acked-by= Junio
		Acked-by= Peff
	EOF
	git interpret-trailers --trim-empty --trailer "ack: Peff" \
		--trailer "Acked-by= Peff" --trailer "review:" \
		--trailer "ack: Junio" --trailer "bug: 42" \
		--trailer "ack: Peff" <complex_message >actual &&
	test_cmp expected actual

ok 33 - using "ifExists = addIfDifferentNeighbor" and --trim-empty

expecting success: 
	git config trailer.ack.ifExists "add" &&
	git config trailer.ack.where "end" &&
	cat complex_message_body >expected &&
	sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
		Bug #42
		Fixes: Z
		Acked-by= Z
		Reviewed-by:
		Signed-off-by: Z
		Acked-by= Peff
		Acked-by= Peff
		Tested-by: Jakub
		Acked-by= Junio
		Tested-by: Johannes
		Acked-by= Peff
	EOF
	git interpret-trailers --trailer "ack: Peff" \
		--trailer "Acked-by= Peff" --trailer "review:" \
		--trailer "Tested-by: Jakub" --trailer "ack: Junio" \
		--trailer "bug: 42" --trailer "Tested-by: Johannes" \
		--trailer "ack: Peff" <complex_message >actual &&
	test_cmp expected actual

[detached HEAD bb22a09] fourth signed
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:17:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
gpg: Signature made Wed Dec 16 11:06:03 2015 UTC using DSA key ID CDDE430D
gpg: Good signature from "C O Mitter <committer@example.com>"
ok 34 - using "ifExists = add" with "where = end"

expecting success: 
	git config trailer.ack.ifExists "add" &&
	git config trailer.ack.where "after" &&
	cat complex_message_body >expected &&
	sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
		Bug #42
		Fixes: Z
		Acked-by= Z
		Acked-by= Peff
		Acked-by= Peff
		Acked-by= Junio
		Acked-by= Peff
		Reviewed-by:
		Signed-off-by: Z
	EOF
	git interpret-trailers --trailer "ack: Peff" \
		--trailer "Acked-by= Peff" --trailer "review:" \
		--trailer "ack: Junio" --trailer "bug: 42" \
		--trailer "ack: Peff" <complex_message >actual &&
	test_cmp expected actual

gpg: Good signature from "C O Mitter <committer@example.com>"
ok 8 - amending already signed commit

ok 35 - using "ifExists = add" with "where = after"

expecting success: 
	git config trailer.fix.key "Fixes: " &&
	git config trailer.fix.ifExists "replace" &&
	cat complex_message_body >expected &&
	sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
		Bug #42
		Acked-by= Z
		Acked-by= Junio
		Acked-by= Peff
		Reviewed-by:
		Signed-off-by: Z
		Fixes: 22
	EOF
	git interpret-trailers --trailer "review:" \
		--trailer "fix=53" --trailer "ack: Junio" --trailer "fix=22" \
		--trailer "bug: 42" --trailer "ack: Peff" \
		<complex_message >actual &&
	test_cmp expected actual

expecting success: 
	cat >expect <<-\EOF &&
	G
	13B6F51ECDDE430D
	C O Mitter <committer@example.com>
	EOF
	git log -1 --format="%G?%n%GK%n%GS" sixth-signed >actual &&
	test_cmp expect actual

ok 36 - using "ifExists = replace"

expecting success: 
	git config trailer.fix.where "after" &&
	cat complex_message_body >expected &&
	sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
		Bug #42
		Fixes: 22
		Acked-by= Z
		Acked-by= Junio
		Acked-by= Peff
		Reviewed-by:
		Signed-off-by: Z
	EOF
	git interpret-trailers --trailer "review:" \
		--trailer "fix=53" --trailer "ack: Junio" --trailer "fix=22" \
		--trailer "bug: 42" --trailer "ack: Peff" \
		<complex_message >actual &&
	test_cmp expected actual

ok 9 - show good signature with custom format

expecting success: 
	cat >expect <<-\EOF &&
	B
	13B6F51ECDDE430D
	C O Mitter <committer@example.com>
	EOF
	git log -1 --format="%G?%n%GK%n%GS" $(cat forged1.commit) >actual &&
	test_cmp expect actual

ok 37 - using "ifExists = replace" with "where = after"

expecting success: 
	git config trailer.fix.ifExists "doNothing" &&
	cat complex_message_body >expected &&
	sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
		Bug #42
		Fixes: Z
		Acked-by= Z
		Acked-by= Junio
		Acked-by= Peff
		Reviewed-by:
		Signed-off-by: Z
	EOF
	git interpret-trailers --trailer "review:" --trailer "fix=53" \
		--trailer "ack: Junio" --trailer "fix=22" \
		--trailer "bug: 42" --trailer "ack: Peff" \
		<complex_message >actual &&
	test_cmp expected actual

ok 59 - status submodule summary (clean submodule): commit

expecting success: 
	git status -s >output &&
	test_cmp expect output

ok 10 - show bad signature with custom format

ok 38 - using "ifExists = doNothing"
expecting success: 
	cat >expect <<-\EOF &&
	U
	61092E85B7227189
	Eris Discordia <discord@example.net>
	EOF
	git log -1 --format="%G?%n%GK%n%GS" eighth-signed-alt >actual &&
	test_cmp expect actual


expecting success: 
	git config trailer.cc.key "Cc: " &&
	git config trailer.cc.where "before" &&
	cat complex_message_body >expected &&
	sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
		Bug #42
		Cc: Linus
		Fixes: Z
		Acked-by= Z
		Acked-by= Junio
		Acked-by= Peff
		Reviewed-by:
		Signed-off-by: Z
	EOF
	git interpret-trailers --trailer "review:" --trailer "fix=53" \
		--trailer "cc=Linus" --trailer "ack: Junio" \
		--trailer "fix=22" --trailer "bug: 42" --trailer "ack: Peff" \
		<complex_message >actual &&
	test_cmp expected actual

ok 60 - status -s submodule summary (clean submodule)

expecting success: 
	git status --porcelain |
	perl -pe "s/\012/\000/g" >expect &&
	git status -z >output &&
	test_cmp expect output

ok 11 - show unknown signature with custom format

expecting success: 
	cat >expect <<-\EOF &&
	N


	EOF
	git log -1 --format="%G?%n%GK%n%GS" seventh-unsigned >actual &&
	test_cmp expect actual

ok 39 - the default is "ifMissing = add"

expecting success: 
	git config trailer.ifmissing "doNothing" &&
	cat complex_message_body >expected &&
	sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
		Fixes: Z
		Acked-by= Z
		Acked-by= Junio
		Acked-by= Peff
		Reviewed-by:
		Signed-off-by: Z
	EOF
	git interpret-trailers --trailer "review:" --trailer "fix=53" \
		--trailer "cc=Linus" --trailer "ack: Junio" \
		--trailer "fix=22" --trailer "bug: 42" --trailer "ack: Peff" \
		<complex_message >actual &&
	test_cmp expected actual &&
	git config trailer.ifmissing "add"

ok 12 - show lack of signature with custom format

# passed all 12 test(s)
1..12
ok 61 - status -z implies porcelain

expecting success: 
	cat >expect <<EOF &&
On branch master
Changes to be committed:
  (use "git reset HEAD^1 <file>..." to unstage)

	new file:   dir2/added
	new file:   sm

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   dir1/modified

Submodule changes to be committed:

* sm 0000000...$head (1):
  > Add foo

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	dir1/untracked
	dir2/modified
	dir2/untracked
	untracked

EOF
	git config status.submodulesummary 10 &&
	git commit --dry-run --amend >output &&
	test_i18ncmp expect output

ok 40 - when default "ifMissing" is "doNothing"

expecting success: 
	git config trailer.cc.key "Cc: " &&
	git config trailer.cc.where "end" &&
	git config trailer.cc.ifMissing "add" &&
	cat complex_message_body >expected &&
	sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
		Bug #42
		Fixes: Z
		Acked-by= Z
		Acked-by= Junio
		Acked-by= Peff
		Reviewed-by:
		Signed-off-by: Z
		Cc: Linus
	EOF
	git interpret-trailers --trailer "review:" --trailer "fix=53" \
		--trailer "ack: Junio" --trailer "fix=22" \
		--trailer "bug: 42" --trailer "cc=Linus" --trailer "ack: Peff" \
		<complex_message >actual &&
	test_cmp expected actual

*** t7514-commit-patch.sh ***
ok 41 - using "ifMissing = add" with "where = end"

expecting success: 
	git config trailer.cc.key "Cc: " &&
	git config trailer.cc.where "before" &&
	git config trailer.cc.ifMissing "add" &&
	cat complex_message_body >expected &&
	sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
		Cc: Linus
		Bug #42
		Fixes: Z
		Acked-by= Z
		Acked-by= Junio
		Acked-by= Peff
		Reviewed-by:
		Signed-off-by: Z
	EOF
	git interpret-trailers --trailer "review:" --trailer "fix=53" \
		--trailer "ack: Junio" --trailer "fix=22" \
		--trailer "bug: 42" --trailer "cc=Linus" --trailer "ack: Peff" \
		<complex_message >actual &&
	test_cmp expected actual

Rebasing (1/1)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7514-commit-patch/.git/
expecting success: 
	echo line1 >file &&
	git add file &&
	git commit -m commit1

ok 42 - using "ifMissing = add" with "where = before"

expecting success: 
	git config trailer.cc.ifMissing "doNothing" &&
	cat complex_message_body >expected &&
	sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
		Bug #42
		Fixes: Z
		Acked-by= Z
		Acked-by= Junio
		Acked-by= Peff
		Reviewed-by:
		Signed-off-by: Z
	EOF
	git interpret-trailers --trailer "review:" --trailer "fix=53" \
		--trailer "cc=Linus" --trailer "ack: Junio" \
		--trailer "fix=22" --trailer "bug: 42" --trailer "ack: Peff" \
		<complex_message >actual &&
	test_cmp expected actual

error: could not apply b88a46f... one_second

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Auto-merging main.txt
CONFLICT (content): Merge conflict in main.txt
[master (root-commit) 5235a6d] commit1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 1 - setup (initial)

expecting success: 
	test_when_finished "rm -f editor_was_started" &&
	rm -f editor_was_started &&
	echo more >>file &&
	echo e | env GIT_EDITOR=": >editor_was_started" git commit -p -m commit2 file &&
	test -r editor_was_started

ok 43 - using "ifMissing = doNothing"

expecting success: 
	git config trailer.where "after" &&
	git config --unset trailer.ack.where &&
	cat complex_message_body >expected &&
	sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
		Bug #42
		Fixes: Z
		Acked-by= Z
		Acked-by= Peff
		Acked-by= Peff
		Acked-by= Junio
		Acked-by= Peff
		Reviewed-by:
		Signed-off-by: Z
		Tested-by: Jakub
		Tested-by: Johannes
	EOF
	git interpret-trailers --trailer "ack: Peff" \
		--trailer "Acked-by= Peff" --trailer "review:" \
		--trailer "Tested-by: Jakub" --trailer "ack: Junio" \
		--trailer "bug: 42" --trailer "Tested-by: Johannes" \
		--trailer "ack: Peff" <complex_message >actual &&
	test_cmp expected actual

No submodule mapping found in .gitmodules for path 'sm'
Could not apply b88a46fc6dd2c836d96d7d7a7adea27c8beb3d80... one_second
ok 44 - default "where" is now "after"

expecting success: 
	git config trailer.sign.key "Signed-off-by: " &&
	git config trailer.sign.where "after" &&
	git config trailer.sign.ifExists "addIfDifferentNeighbor" &&
	git config trailer.sign.command "echo \"A U Thor <author@example.com>\"" &&
	cat complex_message_body >expected &&
	sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
		Fixes: Z
		Acked-by= Z
		Reviewed-by:
		Signed-off-by: Z
		Signed-off-by: A U Thor <author@example.com>
	EOF
	git interpret-trailers --trailer "review:" --trailer "fix=22" \
		<complex_message >actual &&
	test_cmp expected actual

ok 45 - with simple command

expecting success: 
	git config trailer.sign.ifExists "addIfDifferent" &&
	git config trailer.sign.command "echo \"\$GIT_COMMITTER_NAME <\$GIT_COMMITTER_EMAIL>\"" &&
	cat complex_message_body >expected &&
	sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
		Fixes: Z
		Acked-by= Z
		Reviewed-by:
		Signed-off-by: Z
		Signed-off-by: C O Mitter <committer@example.com>
	EOF
	git interpret-trailers --trailer "review:" --trailer "fix=22" \
		<complex_message >actual &&
	test_cmp expected actual

ok 46 - with command using commiter information

expecting success: 
	git config trailer.sign.key "Signed-off-by: " &&
	git config trailer.sign.where "after" &&
	git config trailer.sign.ifExists "addIfDifferentNeighbor" &&
	git config trailer.sign.command "echo \"\$GIT_AUTHOR_NAME <\$GIT_AUTHOR_EMAIL>\"" &&
	cat complex_message_body >expected &&
	sed -e "s/ Z\$/ /" >>expected <<-\EOF &&
		Fixes: Z
		Acked-by= Z
		Reviewed-by:
		Signed-off-by: Z
		Signed-off-by: A U Thor <author@example.com>
	EOF
	git interpret-trailers --trailer "review:" --trailer "fix=22" \
		<complex_message >actual &&
	test_cmp expected actual

ok 8 - status during rebase -i when conflicts unresolved

expecting success: 
	git reset --hard rebase_i_conflicts_second &&
	test_when_finished "git rebase --abort" &&
	ONTO=$(git rev-parse --short rebase_i_conflicts) &&
	LAST_COMMIT=$(git rev-parse --short rebase_i_conflicts_second) &&
	test_must_fail git rebase -i rebase_i_conflicts &&
	git add main.txt &&
	cat >expected <<EOF &&
interactive rebase in progress; onto $ONTO
Last command done (1 command done):
   pick $LAST_COMMIT one_second
No commands remaining.
You are currently rebasing branch 'rebase_i_conflicts_second' on '$ONTO'.
  (all conflicts fixed: run "git rebase --continue")

Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	modified:   main.txt

Untracked files not listed (use -u option to show untracked files)
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

HEAD is now at b88a46f one_second
ok 62 - commit --dry-run submodule summary (--amend)

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 47 - with command using author information

expecting success: 
	echo "Content of the first commit." > a.txt &&
	git add a.txt &&
	git commit -m "Add file a.txt"

rm: cannot remove 'SANETESTD.1/x': Permission denied
prerequisite SANITY ok
expecting success: 
	(
		chmod a-w .git &&
		# make dir1/tracked stat-dirty
		>dir1/tracked1 && mv -f dir1/tracked1 dir1/tracked &&
		git status -s >output &&
		! grep dir1/tracked output &&
		# make sure "status" succeeded without writing index out
		git diff-files | grep dir1/tracked
	)
	status=$?
	chmod 775 .git
	(exit $status)

[master (root-commit) e788bd7] Add file a.txt
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a.txt
ok 48 - setup a commit

expecting success: 
	git config trailer.fix.ifExists "replace" &&
	git config trailer.fix.command "git log -1 --oneline --format=\"%h (%s)\" --abbrev-commit --abbrev=14 \$ARG" &&
	FIXED=$(git log -1 --oneline --format="%h (%s)" --abbrev-commit --abbrev=14 HEAD) &&
	cat complex_message_body >expected &&
	sed -e "s/ Z\$/ /" >>expected <<-EOF &&
		Fixes: $FIXED
		Acked-by= Z
		Reviewed-by:
		Signed-off-by: Z
		Signed-off-by: A U Thor <author@example.com>
	EOF
	git interpret-trailers --trailer "review:" --trailer "fix=HEAD" \
		<complex_message >actual &&
	test_cmp expected actual

:100644 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0000000000000000000000000000000000000000 M	dir1/tracked
ok 63 - status succeeds in a read-only repository

ok 49 - with command using $ARG

expecting success: 
	git config trailer.fix.ifExists "replace" &&
	git config trailer.fix.command "false \$ARG" &&
	cat complex_message_body >expected &&
	sed -e "s/ Z\$/ /" >>expected <<-EOF &&
		Fixes: Z
		Acked-by= Z
		Reviewed-by:
		Signed-off-by: Z
		Signed-off-by: A U Thor <author@example.com>
	EOF
	git interpret-trailers --trailer "review:" --trailer "fix=HEAD" \
		<complex_message >actual &&
	test_cmp expected actual

expecting success: 
	cat > expect << EOF &&
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	modified:   sm

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   dir1/modified

Submodule changes to be committed:

* sm $head...$new_head (1):
  > Add bar

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	.gitmodules
	dir1/untracked
	dir2/modified
	dir2/untracked
	untracked

EOF
	echo modified  sm/untracked &&
	git status --ignore-submodules=untracked >output &&
	test_i18ncmp expect output

error: running trailer command 'false ' failed
modified sm/untracked
error: running trailer command 'false HEAD' failed
ok 50 - with failing command using $ARG

expecting success: 
	git config --unset trailer.fix.command &&
	cat >expected <<-EOF &&

		Signed-off-by: A U Thor <author@example.com>
	EOF
	git interpret-trailers --trailer ":" --trailer ":test" >actual <<-EOF &&
	EOF
	test_cmp expected actual

diff --git a/file b/file
index a29bdeb..3049d20 100644
--- a/file
+++ b/file
@@ -1 +1,2 @@
 line1
+more
error: empty trailer token in trailer ':'
error: empty trailer token in trailer ':test'
Stage this hunk [y,n,q,a,d,/,e,?]? ok 51 - with empty tokens

expecting success: 
	git config --unset trailer.sign.key &&
	cat >expected <<-EOF &&

		sign: A U Thor <author@example.com>
	EOF
	git interpret-trailers >actual <<-EOF &&
	EOF
	test_cmp expected actual


[master 3ea37f3] commit2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 52 - with command but no key

expecting success: 
	git config --unset trailer.review.key &&
	cat >expected <<-EOF &&

		review: Junio
		sign: A U Thor <author@example.com>
	EOF
	git interpret-trailers --trailer "review:Junio" >actual <<-EOF &&
	EOF
	test_cmp expected actual

ok 2 - edit hunk "commit -p -m message"

expecting success: 
	test_when_finished "rm -f editor_was_started" &&
	rm -f editor_was_started &&
	echo more >>file &&
	echo e | env GIT_EDITOR=": >editor_was_started" git commit -p -m commit3 file &&
	test -r editor_was_started

ok 53 - with no command and no key

# passed all 53 test(s)
1..53
*** t7515-status-symlinks.sh ***
No submodule mapping found in .gitmodules for path 'sm'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7515-status-symlinks/.git/
expecting success: 
	echo .gitignore >.gitignore &&
	echo actual >>.gitignore &&
	echo expect >>.gitignore &&
	mkdir dir &&
	echo x >dir/file1 &&
	echo y >dir/file2 &&
	git add dir &&
	git commit -m initial &&
	git tag initial

[master (root-commit) 229c7d7] initial
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 dir/file1
 create mode 100644 dir/file2
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

)
prerequisite SYMLINKS ok
expecting success: 
	test_when_finished "rm symlink" &&
	ln -s dir symlink &&
	echo "?? symlink" >expect &&
	git status --porcelain >actual &&
	test_cmp expect actual

ok 2 - symlink to a directory

Rebasing (1/1)
expecting success: 
	test_when_finished "rm -rf copy && git reset --hard initial" &&
	mkdir copy &&
	cp dir/file1 copy/file1 &&
	echo "changed in copy" >copy/file2 &&
	git add copy &&
	git commit -m second &&
	rm -rf copy &&
	ln -s dir copy &&
	echo " D copy/file1" >expect &&
	echo " D copy/file2" >>expect &&
	echo "?? copy" >>expect &&
	git status --porcelain >actual &&
	test_cmp expect actual

[master 5364ec6] second
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 copy/file1
 create mode 100644 copy/file2
ok 64 - --ignore-submodules=untracked suppresses submodules with untracked content

expecting success: 
	test_config diff.ignoreSubmodules dirty &&
	git status >output &&
	test_i18ncmp expect output &&
	git config --add -f .gitmodules submodule.subname.ignore untracked &&
	git config --add -f .gitmodules submodule.subname.path sm &&
	git status >output &&
	test_i18ncmp expect output &&
	git config -f .gitmodules  --remove-section submodule.subname

error: could not apply b88a46f... one_second

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Auto-merging main.txt
CONFLICT (content): Merge conflict in main.txt
HEAD is now at 229c7d7 initial
ok 3 - symlink replacing a directory

# passed all 3 test(s)
1..3
Could not apply b88a46fc6dd2c836d96d7d7a7adea27c8beb3d80... one_second
*** t7516-commit-races.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7516-commit-races/.git/
No submodule mapping found in .gitmodules for path 'sm'
expecting success: 
	write_script hare-editor <<-\EOF &&
	git commit --allow-empty -m hare
	EOF
	test_must_fail env EDITOR=./hare-editor git commit --allow-empty -m tortoise -e &&
	git show -s --pretty=format:%s >subject &&
	grep hare subject &&
	test -z "$(git show -s --pretty=format:%P)"

diff --git a/file b/file
index 3049d20..c1dcbdb 100644
--- a/file
+++ b/file
@@ -1,2 +1,3 @@
 line1
 more
+more
Stage this hunk [y,n,q,a,d,/,e,?]? [master (root-commit) cbeadaf] hare
 Author: A U Thor <author@example.com>
fatal: cannot lock ref 'HEAD': ref refs/heads/master is at cbeadaf6c6fe5724d8e6d5b60c86fb478fff569b but expected 0000000000000000000000000000000000000000
hare
ok 9 - status during rebase -i after resolving conflicts

expecting success: 
	git reset --hard master &&
	git checkout -b rebase_i_edit &&
	test_commit one_rebase_i main.txt one &&
	test_commit two_rebase_i main.txt two &&
	COMMIT2=$(git rev-parse --short rebase_i_edit) &&
	test_commit three_rebase_i main.txt three &&
	COMMIT3=$(git rev-parse --short rebase_i_edit) &&
	FAKE_LINES="1 edit 2" &&
	export FAKE_LINES &&
	test_when_finished "git rebase --abort" &&
	ONTO=$(git rev-parse --short HEAD~2) &&
	git rebase -i HEAD~2 &&
	cat >expected <<EOF &&
interactive rebase in progress; onto $ONTO
Last commands done (2 commands done):
   pick $COMMIT2 two_rebase_i
   edit $COMMIT3 three_rebase_i
No commands remaining.
You are currently editing a commit while rebasing branch 'rebase_i_edit' on '$ONTO'.
  (use "git commit --amend" to amend the current commit)
  (use "git rebase --continue" once you are satisfied with your changes)

nothing to commit (use -u to show untracked files)
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual


ok 1 - race to create orphan commit

expecting success: 
	write_script airplane-editor <<-\EOF &&
	git commit --allow-empty -m airplane
	EOF
	git checkout --orphan branch &&
	git commit --allow-empty -m base &&
	git rev-parse HEAD >base &&
	test_must_fail env EDITOR=./airplane-editor git commit --allow-empty -m ship -e &&
	git show -s --pretty=format:%s >subject &&
	grep airplane subject &&
	git rev-parse HEAD^ >parent &&
	test_cmp base parent

[master 7299c7f] commit3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
HEAD is now at 88a81b6 on_master
ok 3 - edit hunk "commit --dry-run -p -m message"

Switched to a new branch 'branch'
# passed all 3 test(s)
1..3
Switched to a new branch 'rebase_i_edit'
[branch (root-commit) 14c9c21] base
 Author: A U Thor <author@example.com>
[rebase_i_edit f90e540] one_rebase_i
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
*** t7600-merge.sh ***
[branch 529f492] airplane
 Author: A U Thor <author@example.com>
fatal: cannot lock ref 'HEAD': ref refs/heads/branch is at 529f4920c0a224d8c5a7120cc48d7ac38fe161cd but expected 14c9c21259a86615292d33cca4ca2ea18f334466
airplane
[rebase_i_edit 33e516f] two_rebase_i
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 2 - race to create non-orphan commit

# passed all 2 test(s)
1..2
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7600-merge/.git/
*** t7601-merge-pull-config.sh ***
[rebase_i_edit c346c87] three_rebase_i
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7601-merge-pull-config/.git/
expecting success: 
	echo c0 >c0.c &&
	git add c0.c &&
	git commit -m c0 &&
	git tag c0 &&
	echo c1 >c1.c &&
	git add c1.c &&
	git commit -m c1 &&
	git tag c1 &&
	git reset --hard c0 &&
	echo c2 >c2.c &&
	git add c2.c &&
	git commit -m c2 &&
	git tag c2 &&
	git reset --hard c0 &&
	echo c3 >c3.c &&
	git add c3.c &&
	git commit -m c3 &&
	git tag c3

[master (root-commit) e036f0a] c0
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c0.c
[master 5f26010] c1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c1.c
HEAD is now at e036f0a c0
[master f58dce6] c2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c2.c
expecting success: 
	git add file &&
	test_tick &&
	git commit -m "commit 0" &&
	git tag c0 &&
	c0=$(git rev-parse HEAD) &&
	cp file.1 file &&
	git add file &&
	test_tick &&
	git commit -m "commit 1" &&
	git tag c1 &&
	c1=$(git rev-parse HEAD) &&
	git reset --hard "$c0" &&
	cp file.5 file &&
	git add file &&
	test_tick &&
	git commit -m "commit 2" &&
	git tag c2 &&
	c2=$(git rev-parse HEAD) &&
	git reset --hard "$c0" &&
	cp file.9 file &&
	git add file &&
	test_tick &&
	git commit -m "commit 3" &&
	git tag c3 &&
	c3=$(git rev-parse HEAD) &&
	git reset --hard "$c0" &&
	create_merge_msgs

HEAD is now at e036f0a c0
[master (root-commit) 88012a2] commit 0
 Author: A U Thor <author@example.com>
 1 file changed, 9 insertions(+)
 create mode 100644 file
[master 5e7b6a1] c3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c3.c
ok 1 - setup

expecting success: 
	git reset --hard c1 &&
	test -f c0.c &&
	test -f c1.c &&
	test ! -f c2.c &&
	test ! -f c3.c &&
	git merge c2 &&
	test -f c1.c &&
	test -f c2.c

HEAD is now at 5f26010 c1
[master c4c4222] commit 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Merging:
5f26010 c1
virtual c2
found 1 common ancestor:
e036f0a c0
Merge made by the 'recursive' strategy.
 c2.c | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 c2.c
ok 2 - merge c1 with c2

expecting success: 
	git reset --hard c0 &&
	test_config pull.ff true &&
	git pull . c1 &&
	test "$(git rev-parse HEAD)" = "$(git rev-parse c1)"

HEAD is now at 88012a2 commit 0
HEAD is now at e036f0a c0
ok 65 - .gitmodules ignore=untracked suppresses submodules with untracked content

expecting success: 
	git config --add -f .gitmodules submodule.subname.ignore none &&
	git config --add -f .gitmodules submodule.subname.path sm &&
	git config --add submodule.subname.ignore untracked &&
	git config --add submodule.subname.path sm &&
	git status >output &&
	test_i18ncmp expect output &&
	git config --remove-section submodule.subname &&
	git config --remove-section -f .gitmodules submodule.subname

[master ac59201] commit 2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
From .
 * tag               c1         -> FETCH_HEAD
HEAD is now at 88012a2 commit 0
rebase -i script before editing:
Updating e036f0a..5f26010
Fast-forward
pick 33e516f two_rebase_i
pick c346c87 three_rebase_i

 c1.c | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 c1.c
rebase -i script after editing:
pick 33e516f two_rebase_i
edit c346c87 three_rebase_i
[master 7504643] commit 3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 3 - fast-forward pull succeeds with "true" in pull.ff

expecting success: 
	git reset --hard c0 &&
	test_config merge.ff false &&
	test_config pull.ff true &&
	git pull . c1 &&
	test "$(git rev-parse HEAD)" = "$(git rev-parse c1)"

HEAD is now at e036f0a c0
HEAD is now at 88012a2 commit 0
ok 1 - setup

expecting success: 
	test_must_fail git merge -$ c1 &&
	test_must_fail git merge --no-such c1 &&
	test_must_fail git merge -s foobar c1 &&
	test_must_fail git merge -s=foobar c1 &&
	test_must_fail git merge -m &&
	test_must_fail git merge

error: unknown switch `$'
usage: git merge [<options>] [<commit>...]
   or: git merge [<options>] <msg> HEAD <commit>
   or: git merge --abort

    -n                    do not show a diffstat at the end of the merge
    --stat                show a diffstat at the end of the merge
    --summary             (synonym to --stat)
    --log[=<n>]           add (at most <n>) entries from shortlog to merge commit message
    --squash              create a single commit instead of doing a merge
    --commit              perform a commit if the merge succeeds (default)
    -e, --edit            edit message before committing
    --ff                  allow fast-forward (default)
    --ff-only             abort if fast-forward is not possible
    --rerere-autoupdate   update the index with reused conflict resolution if possible
    --verify-signatures   Verify that the named commit has a valid GPG signature
    -s, --strategy <strategy>
                          merge strategy to use
    -X, --strategy-option <option=value>
                          option for selected merge strategy
    -m, --message <message>
                          merge commit message (for a non-fast-forward merge)
    -v, --verbose         be more verbose
    -q, --quiet           be more quiet
    --abort               abort the current in-progress merge
    --progress            force progress reporting
    -S, --gpg-sign[=<key-id>]
                          GPG sign commit
    --overwrite-ignore    update ignored files (default)

error: unknown option `no-such'
usage: git merge [<options>] [<commit>...]
   or: git merge [<options>] <msg> HEAD <commit>
   or: git merge --abort

    -n                    do not show a diffstat at the end of the merge
    --stat                show a diffstat at the end of the merge
    --summary             (synonym to --stat)
    --log[=<n>]           add (at most <n>) entries from shortlog to merge commit message
    --squash              create a single commit instead of doing a merge
    --commit              perform a commit if the merge succeeds (default)
    -e, --edit            edit message before committing
    --ff                  allow fast-forward (default)
    --ff-only             abort if fast-forward is not possible
    --rerere-autoupdate   update the index with reused conflict resolution if possible
    --verify-signatures   Verify that the named commit has a valid GPG signature
    -s, --strategy <strategy>
                          merge strategy to use
    -X, --strategy-option <option=value>
                          option for selected merge strategy
    -m, --message <message>
                          merge commit message (for a non-fast-forward merge)
    -v, --verbose         be more verbose
    -q, --quiet           be more quiet
    --abort               abort the current in-progress merge
    --progress            force progress reporting
    -S, --gpg-sign[=<key-id>]
                          GPG sign commit
    --overwrite-ignore    update ignored files (default)

From .
 * tag               c1         -> FETCH_HEAD
Could not find merge strategy 'foobar'.
Available strategies are: octopus ours recursive resolve subtree.
Updating e036f0a..5f26010
Fast-forward
Rebasing (2/2)
 c1.c | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 c1.c
Could not find merge strategy '=foobar'.
Available strategies are: octopus ours recursive resolve subtree.
error: switch `m' requires a value
usage: git merge [<options>] [<commit>...]
   or: git merge [<options>] <msg> HEAD <commit>
   or: git merge --abort

    -n                    do not show a diffstat at the end of the merge
    --stat                show a diffstat at the end of the merge
    --summary             (synonym to --stat)
    --log[=<n>]           add (at most <n>) entries from shortlog to merge commit message
    --squash              create a single commit instead of doing a merge
    --commit              perform a commit if the merge succeeds (default)
    -e, --edit            edit message before committing
    --ff                  allow fast-forward (default)
    --ff-only             abort if fast-forward is not possible
    --rerere-autoupdate   update the index with reused conflict resolution if possible
    --verify-signatures   Verify that the named commit has a valid GPG signature
    -s, --strategy <strategy>
                          merge strategy to use
    -X, --strategy-option <option=value>
                          option for selected merge strategy
    -m, --message <message>
                          merge commit message (for a non-fast-forward merge)
    -v, --verbose         be more verbose
    -q, --quiet           be more quiet
    --abort               abort the current in-progress merge
    --progress            force progress reporting
    -S, --gpg-sign[=<key-id>]
                          GPG sign commit
    --overwrite-ignore    update ignored files (default)

fatal: No remote for the current branch.
ok 2 - test option parsing

expecting success: 
	mkdir broken &&
	(
		cd broken &&
		git init &&
		>.git/index &&
		test_expect_code 129 git merge -h 2>usage
	) &&
	test_i18ngrep "[Uu]sage: git merge" broken/usage

ok 4 - pull.ff=true overrides merge.ff=false

expecting success: 
	git reset --hard c0 &&
	test_config pull.ff false &&
	git pull . c1 &&
	test "$(git rev-parse HEAD^1)" = "$(git rev-parse c0)" &&
	test "$(git rev-parse HEAD^2)" = "$(git rev-parse c1)"

Stopped at c346c87b664c095707086b279a790c9749c8b121... three_rebase_i
HEAD is now at e036f0a c0
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7600-merge/broken/.git/
usage: git merge [<options>] [<commit>...]
ok 3 - merge -h with invalid index

expecting success: 
	test_must_fail git merge -s index c1

Could not find merge strategy 'index'.
Available strategies are: octopus ours recursive resolve subtree.
ok 4 - reject non-strategy with a git-merge-foo name

expecting success: 
	echo "OBJID HEAD@{0}: merge c1: Fast-forward" >reflog.expected &&

	git reset --hard c0 &&
	git merge c1 &&
	verify_merge file result.1 &&
	verify_head "$c1" &&

	git reflog -1 >reflog.actual &&
	sed "s/$_x05[0-9a-f]*/OBJID/g" reflog.actual >reflog.fuzzy &&
	test_cmp reflog.expected reflog.fuzzy

You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

HEAD is now at 88012a2 commit 0
From .
 * tag               c1         -> FETCH_HEAD
Updating 88012a2..c4c4222
Fast-forward
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Merging:
e036f0a c0
virtual 5f26010e0ff6d792201aaa4e624db9f4497221c0
found 1 common ancestor:
e036f0a c0
Merge made by the 'recursive' strategy.
 c1.c | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 c1.c
ok 66 - .git/config ignore=untracked suppresses submodules with untracked content

expecting success: 
	git status --ignore-submodules=dirty >output &&
	test_i18ncmp expect output

ok 5 - merge c0 with c1

expecting success: 
	git reset --hard c0 &&
	git merge --ff-only c1 &&
	git merge --ff-only HEAD c0 c1 &&
	verify_merge file result.1 &&
	verify_head "$c1"

ok 5 - fast-forward pull creates merge with "false" in pull.ff

expecting success: 
	git reset --hard c1 &&
	test_config pull.ff only &&
	test_must_fail git pull . c3

HEAD is now at 88012a2 commit 0
HEAD is now at 5f26010 c1
Updating 88012a2..c4c4222
Fast-forward
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Already up-to-date.
ok 10 - status when rebasing -i in edit mode

expecting success: 
	git reset --hard master &&
	git checkout -b split_commit &&
	test_commit one_split main.txt one &&
	test_commit two_split main.txt two &&
	COMMIT2=$(git rev-parse --short split_commit) &&
	test_commit three_split main.txt three &&
	COMMIT3=$(git rev-parse --short split_commit) &&
	test_commit four_split main.txt four &&
	COMMIT4=$(git rev-parse --short split_commit) &&
	FAKE_LINES="1 edit 2 3" &&
	export FAKE_LINES &&
	test_when_finished "git rebase --abort" &&
	ONTO=$(git rev-parse --short HEAD~3) &&
	git rebase -i HEAD~3 &&
	git reset HEAD^ &&
	cat >expected <<EOF &&
interactive rebase in progress; onto $ONTO
Last commands done (2 commands done):
   pick $COMMIT2 two_split
   edit $COMMIT3 three_split
Next command to do (1 remaining command):
   pick $COMMIT4 four_split
  (use "git rebase --edit-todo" to view and edit)
You are currently splitting a commit while rebasing branch 'split_commit' on '$ONTO'.
  (Once your working directory is clean, run "git rebase --continue")

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   main.txt

no changes added to commit (use "git add" and/or "git commit -a")
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

From .
 * tag               c3         -> FETCH_HEAD
HEAD is now at 88a81b6 on_master
ok 6 - merge c0 with c1 with --ff-only

expecting success: 
	git checkout -f master &&
	test_might_fail git branch -D kid &&

	echo "OBJID HEAD@{0}: initial pull" >reflog.expected &&

	git checkout --orphan kid &&
	test_when_finished "git checkout -f master" &&
	git rm -fr . &&
	test_tick &&
	git merge --ff-only c1 &&
	verify_merge file result.1 &&
	verify_head "$c1" &&

	git reflog -1 >reflog.actual &&
	sed "s/$_x05[0-9a-f][0-9a-f]/OBJID/g" reflog.actual >reflog.fuzzy &&
	test_cmp reflog.expected reflog.fuzzy

Switched to a new branch 'split_commit'
fatal: Not possible to fast-forward, aborting.
Already on 'master'
ok 6 - pull prevents non-fast-forward with "only" in pull.ff

expecting success: 
	git reset --hard c1 &&
	git config pull.twohead ours &&
	git merge c2 &&
	test -f c1.c &&
	! test -f c2.c

error: branch 'kid' not found.
[split_commit 19b175e] one_split
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'kid'
HEAD is now at 5f26010 c1
rm 'file'
No submodule mapping found in .gitmodules for path 'sm'
[split_commit e1786e7] two_split
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Merge made by the 'ours' strategy.
ok 7 - merge c1 with c2 (ours in pull.twohead)

expecting success: 
	git reset --hard c1 &&
	git config pull.octopus "recursive" &&
	test_must_fail git merge c2 c3 &&
	test "$(git rev-parse c1)" = "$(git rev-parse HEAD)"

HEAD is now at 5f26010 c1
error: Not handling anything other than two heads merge.
Merge with strategy recursive failed.
[split_commit e6af1e5] three_split
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to branch 'master'
ok 7 - merge from unborn branch

expecting success: 
	git reset --hard c1 &&
	test_tick &&
	git merge c2 &&
	verify_merge file result.1-5 msg.1-5 &&
	verify_parents $c1 $c2

ok 8 - merge c1 with c2 and c3 (recursive in pull.octopus)

expecting success: 
	git reset --hard c1 &&
	git config pull.octopus "recursive octopus" &&
	git merge c2 c3 &&
	test "$(git rev-parse c1)" != "$(git rev-parse HEAD)" &&
	test "$(git rev-parse c1)" = "$(git rev-parse HEAD^1)" &&
	test "$(git rev-parse c2)" = "$(git rev-parse HEAD^2)" &&
	test "$(git rev-parse c3)" = "$(git rev-parse HEAD^3)" &&
	git diff --exit-code &&
	test -f c0.c &&
	test -f c1.c &&
	test -f c2.c &&
	test -f c3.c

HEAD is now at c4c4222 commit 1
HEAD is now at 5f26010 c1
[split_commit 9e436b8] four_split
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Merging:
c4c4222 commit 1
virtual c2
found 1 common ancestor:
88012a2 commit 0
Auto-merging file
Merge made by the 'recursive' strategy.
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 67 - --ignore-submodules=dirty suppresses submodules with untracked content

expecting success: 
	test_config diff.ignoreSubmodules dirty &&
	git status >output &&
	! test -s actual &&
	git config --add -f .gitmodules submodule.subname.ignore dirty &&
	git config --add -f .gitmodules submodule.subname.path sm &&
	git status >output &&
	test_i18ncmp expect output &&
	git config -f .gitmodules  --remove-section submodule.subname

fatal: Needed a single revision
ok 8 - merge c1 with c2

expecting success: 
	git reset --hard c1 &&
	test_tick &&
	git merge c2 c3 &&
	verify_merge file result.1-5-9 msg.1-5-9 &&
	verify_parents $c1 $c2 $c3

HEAD is now at c4c4222 commit 1
error: Not handling anything other than two heads merge.
Trying merge strategy recursive...
Rewinding the tree to pristine...
Trying merge strategy octopus...
Trying simple merge with c2
Trying simple merge with c2
Trying simple merge with c3
Simple merge did not work, trying automatic merge.
Merge made by the 'octopus' strategy.
 c2.c | 1 +
 c3.c | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 c2.c
 create mode 100644 c3.c
No submodule mapping found in .gitmodules for path 'sm'
Auto-merging file
ok 9 - merge c1 with c2 and c3 (recursive and octopus in pull.octopus)

expecting success: 
	git reset --hard c0 &&
	echo A >conflict.c &&
	git add conflict.c &&
	echo contents >foo.c &&
	git add foo.c &&
	git commit -m c4 &&
	git tag c4 &&
	echo B >conflict.c &&
	git add conflict.c &&
	git mv foo.c bar.c &&
	git commit -m c5 &&
	git tag c5 &&
	git reset --hard c4 &&
	echo C >conflict.c &&
	git add conflict.c &&
	echo secondline >> foo.c &&
	git add foo.c &&
	git commit -m c6 &&
	git tag c6

Trying simple merge with c3
HEAD is now at e036f0a c0
Simple merge did not work, trying automatic merge.
[master 0e69efd] c4
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 conflict.c
 create mode 100644 foo.c
Auto-merging file
[master 6ebdcef] c5
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename foo.c => bar.c (100%)
Merge made by the 'octopus' strategy.
 file | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
rebase -i script before editing:
pick e1786e7 two_split
pick e6af1e5 three_split
pick 9e436b8 four_split

HEAD is now at 0e69efd c4
rebase -i script after editing:
pick e1786e7 two_split
edit e6af1e5 three_split
pick 9e436b8 four_split
[master 174e6cb] c6
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 1 deletion(-)
ok 10 - setup conflicted merge

expecting success: 
	git config --unset-all pull.twohead &&
	git reset --hard c5 &&
	test_must_fail git merge -s resolve c6 &&
	resolve_count=$(conflict_count) &&
	git reset --hard c5 &&
	test_must_fail git merge -s recursive c6 &&
	recursive_count=$(conflict_count) &&
	git reset --hard c5 &&
	test_must_fail git merge -s recursive -s resolve c6 &&
	auto_count=$(conflict_count) &&
	test $auto_count = $recursive_count &&
	test $auto_count != $resolve_count

fatal: Needed a single revision
ok 9 - merge c1 with c2 and c3

expecting success: 
	git reset --hard c1 &&
	test_tick &&
	test_must_fail git merge --ff-only c2 &&
	test_must_fail git merge --ff-only c3 &&
	test_must_fail git merge --ff-only c2 c3 &&
	git reset --hard c0 &&
	git merge c3 &&
	verify_head $c3

HEAD is now at 6ebdcef c5
HEAD is now at c4c4222 commit 1
error: Merge requires file-level merging
Trying really trivial in-index merge...
Nope.
fatal: Not possible to fast-forward, aborting.
fatal: Not possible to fast-forward, aborting.
Trying simple merge.
Simple merge failed, trying Automatic merge.
fatal: Not possible to fast-forward, aborting.
HEAD is now at 88012a2 commit 0
Rebasing (2/3)
Updating 88012a2..7504643
Fast-forward
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 10 - merges with --ff-only

expecting success: 
	git reset --hard c1 &&
	test_tick &&
	test_config merge.ff "only" &&
	test_must_fail git merge c2 &&
	test_must_fail git merge c3 &&
	test_must_fail git merge c2 c3 &&
	git reset --hard c0 &&
	git merge c3 &&
	verify_head $c3

Auto-merging conflict.c
Stopped at e6af1e5fceda66dfdf5b79247f571ce5de3346eb... three_split
HEAD is now at c4c4222 commit 1
ERROR: content conflict in conflict.c
fatal: Not possible to fast-forward, aborting.
fatal: Not possible to fast-forward, aborting.
You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

fatal: Not possible to fast-forward, aborting.
ERROR: foo.c: Not handling case 12f00e90b6ef79117ce6e650416b8cf517099b78 ->  -> f09d25f6fef310fe4501c2b3ad8106df35603251
fatal: merge program failed
Automatic merge failed; fix conflicts and then commit the result.
Unstaged changes after reset:
M	main.txt
HEAD is now at 88012a2 commit 0
Updating 88012a2..7504643
Fast-forward
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
HEAD is now at 6ebdcef c5
Merging:
6ebdcef c5
virtual c6
found 1 common ancestor:
0e69efd c4
Auto-merging conflict.c
CONFLICT (content): Merge conflict in conflict.c
Auto-merging bar.c
Automatic merge failed; fix conflicts and then commit the result.
ok 11 - merges with merge.ff=only

expecting success: 
	git reset --hard c0 &&
	git merge --no-commit c1 &&
	verify_merge file result.1 &&
	verify_head $c1

ok 68 - .gitmodules ignore=dirty suppresses submodules with untracked content

expecting success: 
	git config --add -f .gitmodules submodule.subname.ignore none &&
	git config --add -f .gitmodules submodule.subname.path sm &&
	git config --add submodule.subname.ignore dirty &&
	git config --add submodule.subname.path sm &&
	git status >output &&
	test_i18ncmp expect output &&
	git config --remove-section submodule.subname &&
	git config -f .gitmodules  --remove-section submodule.subname

HEAD is now at 88012a2 commit 0
HEAD is now at 6ebdcef c5
Updating 88012a2..c4c4222
Fast-forward
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 12 - merge c0 with c1 (no-commit)

expecting success: 
	git reset --hard c1 &&
	git merge --no-commit c2 &&
	verify_merge file result.1-5 &&
	verify_head $c1 &&
	verify_mergeheads $c2

HEAD is now at c4c4222 commit 1
ok 11 - status when splitting a commit

expecting success: 
	git reset --hard master &&
	git checkout -b amend_last &&
	test_commit one_amend main.txt one &&
	test_commit two_amend main.txt two &&
	test_commit three_amend main.txt three &&
	COMMIT3=$(git rev-parse --short amend_last) &&
	test_commit four_amend main.txt four &&
	COMMIT4=$(git rev-parse --short amend_last) &&
	FAKE_LINES="1 2 edit 3" &&
	export FAKE_LINES &&
	test_when_finished "git rebase --abort" &&
	ONTO=$(git rev-parse --short HEAD~3) &&
	git rebase -i HEAD~3 &&
	git commit --amend -m "foo" &&
	cat >expected <<EOF &&
interactive rebase in progress; onto $ONTO
Last commands done (3 commands done):
   pick $COMMIT3 three_amend
   edit $COMMIT4 four_amend
  (see more in file .git/rebase-merge/done)
No commands remaining.
You are currently editing a commit while rebasing branch 'amend_last' on '$ONTO'.
  (use "git commit --amend" to amend the current commit)
  (use "git rebase --continue" once you are satisfied with your changes)

nothing to commit (use -u to show untracked files)
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

Automatic merge went well; stopped before committing as requested
Merging:
c4c4222 commit 1
virtual c2
found 1 common ancestor:
88012a2 commit 0
Auto-merging file
HEAD is now at 88a81b6 on_master
Switched to a new branch 'amend_last'
Trying merge strategy recursive...
Merging:
6ebdcef c5
virtual c6
found 1 common ancestor:
0e69efd c4
Auto-merging conflict.c
CONFLICT (content): Merge conflict in conflict.c
Auto-merging bar.c
Rewinding the tree to pristine...
Trying merge strategy resolve...
conflict.c: needs merge
ok 13 - merge c1 with c2 (no-commit)

expecting success: 
	git reset --hard c1 &&
	git merge --no-commit c2 c3 &&
	verify_merge file result.1-5-9 &&
	verify_head $c1 &&
	verify_mergeheads $c2 $c3

conflict.c: needs merge
fatal: You need to resolve your current index first
error: Your local changes to the following files would be overwritten by merge:
	bar.c
	conflict.c
Please, commit your changes or stash them before you can merge.
Aborting
fatal: merging of trees eaa00eb2702a4053ab5e619a30f92c9b2f5d0c76 and 1e3baadfd043060816576a47c415ca9293c1fec7 failed
Rewinding the tree to pristine...
Using the recursive to prepare resolving by hand.
conflict.c: needs merge
Merging:
6ebdcef c5
virtual c6
found 1 common ancestor:
0e69efd c4
[amend_last dd030b9] one_amend
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
HEAD is now at c4c4222 commit 1
ok 11 - merge picks up the best result

expecting success: 
	git config pull.twohead "recursive resolve" &&
	git reset --hard c5 &&
	test_must_fail git merge -s resolve c6 &&
	resolve_count=$(conflict_count) &&
	git reset --hard c5 &&
	test_must_fail git merge -s recursive c6 &&
	recursive_count=$(conflict_count) &&
	git reset --hard c5 &&
	test_must_fail git merge c6 &&
	auto_count=$(conflict_count) &&
	test $auto_count = $recursive_count &&
	test $auto_count != $resolve_count

[amend_last fe43c06] two_amend
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Trying simple merge with c2
HEAD is now at 6ebdcef c5
Simple merge did not work, trying automatic merge.
error: Merge requires file-level merging
Trying really trivial in-index merge...
Nope.
[amend_last e19aac0] three_amend
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Trying simple merge.
Simple merge failed, trying Automatic merge.
[amend_last 10a40f2] four_amend
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Auto-merging file
Auto-merging conflict.c
Trying simple merge with c3
ERROR: content conflict in conflict.c
Simple merge did not work, trying automatic merge.
ok 69 - .git/config ignore=dirty suppresses submodules with untracked content

expecting success: 
	echo modified >sm/foo &&
	git status --ignore-submodules=dirty >output &&
	test_i18ncmp expect output

ERROR: foo.c: Not handling case 12f00e90b6ef79117ce6e650416b8cf517099b78 ->  -> f09d25f6fef310fe4501c2b3ad8106df35603251
fatal: merge program failed
Automatic merge failed; fix conflicts and then commit the result.
Auto-merging file
HEAD is now at 6ebdcef c5
Merging:
6ebdcef c5
virtual c6
found 1 common ancestor:
0e69efd c4
Auto-merging conflict.c
CONFLICT (content): Merge conflict in conflict.c
Auto-merging bar.c
Automatic merge failed; fix conflicts and then commit the result.
Automatic merge went well; stopped before committing as requested
HEAD is now at 6ebdcef c5
ok 14 - merge c1 with c2 and c3 (no-commit)

expecting success: 
	git reset --hard c0 &&
	git merge --squash c1 &&
	verify_merge file result.1 &&
	verify_head $c0 &&
	verify_no_mergehead &&
	test_cmp squash.1 .git/SQUASH_MSG

HEAD is now at 88012a2 commit 0
No submodule mapping found in .gitmodules for path 'sm'
Updating 88012a2..c4c4222
Fast-forward
Squash commit -- not updating HEAD
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 15 - merge c0 with c1 (squash)

expecting success: 
	git reset --hard c0 &&
	git merge --squash --ff-only c1 &&
	verify_merge file result.1 &&
	verify_head $c0 &&
	verify_no_mergehead &&
	test_cmp squash.1 .git/SQUASH_MSG

HEAD is now at 88012a2 commit 0
Updating 88012a2..c4c4222
Fast-forward
Squash commit -- not updating HEAD
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Trying merge strategy recursive...
Merging:
6ebdcef c5
virtual c6
found 1 common ancestor:
0e69efd c4
Auto-merging conflict.c
CONFLICT (content): Merge conflict in conflict.c
Auto-merging bar.c
Rewinding the tree to pristine...
Trying merge strategy resolve...
conflict.c: needs merge
conflict.c: needs merge
fatal: You need to resolve your current index first
error: Your local changes to the following files would be overwritten by merge:
	bar.c
	conflict.c
Please, commit your changes or stash them before you can merge.
Aborting
fatal: merging of trees eaa00eb2702a4053ab5e619a30f92c9b2f5d0c76 and 1e3baadfd043060816576a47c415ca9293c1fec7 failed
Rewinding the tree to pristine...
Using the recursive to prepare resolving by hand.
conflict.c: needs merge
Merging:
6ebdcef c5
virtual c6
found 1 common ancestor:
0e69efd c4
ok 70 - --ignore-submodules=dirty suppresses submodules with modified content

expecting success: 
	git config --add -f .gitmodules submodule.subname.ignore dirty &&
	git config --add -f .gitmodules submodule.subname.path sm &&
	git status >output &&
	test_i18ncmp expect output &&
	git config -f .gitmodules  --remove-section submodule.subname

ok 16 - merge c0 with c1 (squash, ff-only)

expecting success: 
	git reset --hard c1 &&
	git merge --squash c2 &&
	verify_merge file result.1-5 &&
	verify_head $c1 &&
	verify_no_mergehead &&
	test_cmp squash.1-5 .git/SQUASH_MSG

ok 12 - merge picks up the best result (from config)

expecting success: 
	git config pull.twohead "foobar" &&
	git reset --hard c5 &&
	test_must_fail git merge c6

HEAD is now at c4c4222 commit 1
HEAD is now at 6ebdcef c5
Automatic merge went well; stopped before committing as requested
Merging:
c4c4222 commit 1
virtual c2
found 1 common ancestor:
88012a2 commit 0
Auto-merging file
Squash commit -- not updating HEAD
rebase -i script before editing:
pick fe43c06 two_amend
pick e19aac0 three_amend
pick 10a40f2 four_amend

Could not find merge strategy 'foobar'.
Available strategies are: octopus ours recursive resolve subtree.
ok 13 - merge errors out on invalid strategy

expecting success: 
	git config --unset-all pull.twohead &&
	git reset --hard c5 &&
	test_must_fail git merge -s "resolve recursive" c6

rebase -i script after editing:
pick fe43c06 two_amend
pick e19aac0 three_amend
edit 10a40f2 four_amend
ok 17 - merge c1 with c2 (squash)

expecting success: 
	git reset --hard c1 &&
	test_must_fail git merge --squash --ff-only c2

HEAD is now at 6ebdcef c5
HEAD is now at c4c4222 commit 1
Could not find merge strategy 'resolve recursive'.
Available strategies are: octopus ours recursive resolve subtree.
ok 14 - merge errors out on invalid strategy

fatal: Not possible to fast-forward, aborting.
ok 18 - unsuccessful merge of c1 with c2 (squash, ff-only)

expecting success: 
	git reset --hard c1 &&
	git merge --squash c2 c3 &&
	verify_merge file result.1-5-9 &&
	verify_head $c1 &&
	verify_no_mergehead &&
	test_cmp squash.1-5-9 .git/SQUASH_MSG

# passed all 14 test(s)
1..14
HEAD is now at c4c4222 commit 1
*** t7602-merge-octopus-many.sh ***
Trying simple merge with c2
Simple merge did not work, trying automatic merge.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7602-merge-octopus-many/.git/
Rebasing (3/3)
expecting success: 
	echo c0 > c0.c &&
	git add c0.c &&
	git commit -m c0 &&
	git tag c0 &&
	i=1 &&
	while test $i -le 30
	do
		git reset --hard c0 &&
		echo c$i > c$i.c &&
		git add c$i.c &&
		git commit -m c$i &&
		git tag c$i &&
		i=`expr $i + 1` || return 1
	done

Auto-merging file
[master (root-commit) 44e48f6] c0
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c0.c
Stopped at 10a40f21dcec09ca8229d61396b7a2576f85ff5d... four_amend
HEAD is now at 44e48f6 c0
Trying simple merge with c3
Simple merge did not work, trying automatic merge.
[master 4250d4e] c1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c1.c
You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

[detached HEAD b59f380] foo
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:32:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
HEAD is now at 44e48f6 c0
ok 71 - .gitmodules ignore=dirty suppresses submodules with modified content

expecting success: 
	git config --add -f .gitmodules submodule.subname.ignore none &&
	git config --add -f .gitmodules submodule.subname.path sm &&
	git config --add submodule.subname.ignore dirty &&
	git config --add submodule.subname.path sm &&
	git status >output &&
	test_i18ncmp expect output &&
	git config --remove-section submodule.subname &&
	git config -f .gitmodules  --remove-section submodule.subname

Auto-merging file
[master 78200b0] c2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c2.c
HEAD is now at 44e48f6 c0
Automatic merge went well; stopped before committing as requested
Squash commit -- not updating HEAD
[master 23f6d27] c3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c3.c
ok 19 - merge c1 with c2 and c3 (squash)

expecting success: 
	git reset --hard c1 &&
	test_config branch.master.mergeoptions "--no-commit" &&
	git merge c2 &&
	verify_merge file result.1-5 &&
	verify_head $c1 &&
	verify_mergeheads $c2

HEAD is now at 44e48f6 c0
HEAD is now at c4c4222 commit 1
ok 12 - status after editing the last commit with --amend during a rebase -i

expecting success: 
	git reset --hard master &&
	git checkout -b several_edits &&
	test_commit one_edits main.txt one &&
	test_commit two_edits main.txt two &&
	test_commit three_edits main.txt three &&
	test_commit four_edits main.txt four

[master a4b743d] c4
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c4.c
Automatic merge went well; stopped before committing as requested
Merging:
c4c4222 commit 1
virtual c2
found 1 common ancestor:
88012a2 commit 0
Auto-merging file
HEAD is now at 88a81b6 on_master
Switched to a new branch 'several_edits'
HEAD is now at 44e48f6 c0
[several_edits eb16a7e] one_edits
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 20 - merge c1 with c2 (no-commit in config)

expecting success: 
	git reset --hard c1 &&
	git merge --log c2 &&
	git show -s --pretty=tformat:%s%n%b >expect &&

	test_config branch.master.mergeoptions "--log" &&
	git reset --hard c1 &&
	git merge c2 &&
	git show -s --pretty=tformat:%s%n%b >actual &&

	test_cmp expect actual

[master 76c84eb] c5
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c5.c
HEAD is now at c4c4222 commit 1
HEAD is now at 44e48f6 c0
[several_edits 9e0744e] two_edits
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Merging:
c4c4222 commit 1
virtual c2
found 1 common ancestor:
88012a2 commit 0
Auto-merging file
Merge made by the 'recursive' strategy.
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
[master a869ee2] c6
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c6.c
[several_edits 8dcd0d2] three_edits
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
HEAD is now at 44e48f6 c0
HEAD is now at c4c4222 commit 1
Merging:
c4c4222 commit 1
virtual c2
found 1 common ancestor:
88012a2 commit 0
Auto-merging file
Merge made by the 'recursive' strategy.
[master 3602b1c] c7
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c7.c
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
[several_edits 001318e] four_edits
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 13 - prepare for several edits

expecting success: 
	FAKE_LINES="edit 1 edit 2 3" &&
	export FAKE_LINES &&
	test_when_finished "git rebase --abort" &&
	COMMIT2=$(git rev-parse --short several_edits^^) &&
	COMMIT3=$(git rev-parse --short several_edits^) &&
	COMMIT4=$(git rev-parse --short several_edits) &&
	ONTO=$(git rev-parse --short HEAD~3) &&
	git rebase -i HEAD~3 &&
	git rebase --continue &&
	cat >expected <<EOF &&
interactive rebase in progress; onto $ONTO
Last commands done (2 commands done):
   edit $COMMIT2 two_edits
   edit $COMMIT3 three_edits
Next command to do (1 remaining command):
   pick $COMMIT4 four_edits
  (use "git rebase --edit-todo" to view and edit)
You are currently editing a commit while rebasing branch 'several_edits' on '$ONTO'.
  (use "git commit --amend" to amend the current commit)
  (use "git rebase --continue" once you are satisfied with your changes)

nothing to commit (use -u to show untracked files)
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

HEAD is now at 44e48f6 c0
ok 21 - merge c1 with c2 (log in config)

expecting success: 
	git reset --hard c1 &&
	git merge c2 &&
	git show -s --pretty=tformat:%s%n%b >expect &&

	test_config branch.master.mergeoptions "--no-log" &&
	test_config merge.log "true" &&
	git reset --hard c1 &&
	git merge c2 &&
	git show -s --pretty=tformat:%s%n%b >actual &&

	test_cmp expect actual

HEAD is now at c4c4222 commit 1
[master aa4b16f] c8
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c8.c
ok 72 - .git/config ignore=dirty suppresses submodules with modified content

expecting success: 
	cat > expect << EOF &&
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	modified:   sm

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)
  (commit or discard the untracked or modified content in submodules)

	modified:   dir1/modified
	modified:   sm (modified content)

Submodule changes to be committed:

* sm $head...$new_head (1):
  > Add bar

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	.gitmodules
	dir1/untracked
	dir2/modified
	dir2/untracked
	untracked

EOF
	git status --ignore-submodules=untracked > output &&
	test_i18ncmp expect output

Merging:
c4c4222 commit 1
virtual c2
found 1 common ancestor:
88012a2 commit 0
Auto-merging file
Merge made by the 'recursive' strategy.
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
HEAD is now at 44e48f6 c0
[master d43c908] c9
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c9.c
HEAD is now at c4c4222 commit 1
Merging:
c4c4222 commit 1
virtual c2
found 1 common ancestor:
88012a2 commit 0
Auto-merging file
Merge made by the 'recursive' strategy.
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
HEAD is now at 44e48f6 c0
ok 22 - merge c1 with c2 (log in config gets overridden)

expecting success: 
	git reset --hard c1 &&
	test_config branch.master.mergeoptions "--squash" &&
	git merge c2 &&
	verify_merge file result.1-5 &&
	verify_head $c1 &&
	verify_no_mergehead &&
	test_cmp squash.1-5 .git/SQUASH_MSG

[master 55c1500] c10
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c10.c
HEAD is now at c4c4222 commit 1
HEAD is now at 44e48f6 c0
Automatic merge went well; stopped before committing as requested
Merging:
c4c4222 commit 1
virtual c2
found 1 common ancestor:
88012a2 commit 0
Auto-merging file
Squash commit -- not updating HEAD
No submodule mapping found in .gitmodules for path 'sm'
[master f1ed963] c11
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c11.c
HEAD is now at 44e48f6 c0
ok 23 - merge c1 with c2 (squash in config)

expecting success: 
	git reset --hard c1 &&
	test_config branch.master.mergeoptions "-n" &&
	test_tick &&
	git merge --summary c2 >diffstat.txt &&
	verify_merge file result.1-5 msg.1-5 &&
	verify_parents $c1 $c2 &&
	if ! grep "^ file |  *2 +-$" diffstat.txt
	then
		echo "[OOPS] diffstat was not generated with --summary"
		false
	fi

HEAD is now at c4c4222 commit 1
[master 47c7a8c] c12
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c12.c
HEAD is now at 44e48f6 c0
[master 78c9ebc] c13
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c13.c
HEAD is now at 44e48f6 c0
fatal: Needed a single revision
 file | 2 +-
ok 73 - --ignore-submodules=untracked doesn't suppress submodules with modified content

expecting success: 
	git config --add -f .gitmodules submodule.subname.ignore untracked &&
	git config --add -f .gitmodules submodule.subname.path sm &&
	git status >output &&
	test_i18ncmp expect output &&
	git config -f .gitmodules  --remove-section submodule.subname

ok 24 - override config option -n with --summary

expecting success: 
	git reset --hard c1 &&
	test_config branch.master.mergeoptions "-n" &&
	test_tick &&
	git merge --stat c2 >diffstat.txt &&
	verify_merge file result.1-5 msg.1-5 &&
	verify_parents $c1 $c2 &&
	if ! grep "^ file |  *2 +-$" diffstat.txt
	then
		echo "[OOPS] diffstat was not generated with --stat"
		false
	fi

[master 792a8b5] c14
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c14.c
HEAD is now at c4c4222 commit 1
rebase -i script before editing:
HEAD is now at 44e48f6 c0
pick 9e0744e two_edits
pick 8dcd0d2 three_edits
pick 001318e four_edits

rebase -i script after editing:
edit 9e0744e two_edits
edit 8dcd0d2 three_edits
pick 001318e four_edits
[master 5916536] c15
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c15.c
HEAD is now at 44e48f6 c0
[master 1d02c3d] c16
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c16.c
fatal: Needed a single revision
 file | 2 +-
ok 25 - override config option -n with --stat

expecting success: 
	git reset --hard c1 &&
	test_config branch.master.mergeoptions "--stat" &&
	test_tick &&
	git merge -n c2 >diffstat.txt &&
	verify_merge file result.1-5 msg.1-5 &&
	verify_parents $c1 $c2 &&
	if grep "^ file |  *2 +-$" diffstat.txt
	then
		echo "[OOPS] diffstat was generated"
		false
	fi

HEAD is now at 44e48f6 c0
HEAD is now at c4c4222 commit 1
[master ad2c1ab] c17
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c17.c
Rebasing (1/3)
HEAD is now at 44e48f6 c0
[master b8ab6b7] c18
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c18.c
Stopped at 9e0744e83c8330e8b23efbca5e7bd9c9ae77f3e7... two_edits
HEAD is now at 44e48f6 c0
fatal: Needed a single revision
ok 26 - override config option --stat

expecting success: 
	git reset --hard c1 &&
	test_config branch.master.mergeoptions "--no-commit" &&
	test_tick &&
	git merge --commit c2 &&
	verify_merge file result.1-5 msg.1-5 &&
	verify_parents $c1 $c2

[master ae9ca2a] c19
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c19.c
You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

HEAD is now at c4c4222 commit 1
HEAD is now at 44e48f6 c0
Merging:
c4c4222 commit 1
virtual c2
found 1 common ancestor:
88012a2 commit 0
Auto-merging file
Merge made by the 'recursive' strategy.
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 47d4dfd] c20
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c20.c
ok 74 - .gitmodules ignore=untracked doesn't suppress submodules with modified content

expecting success: 
	git config --add -f .gitmodules submodule.subname.ignore none &&
	git config --add -f .gitmodules submodule.subname.path sm &&
	git config --add submodule.subname.ignore untracked &&
	git config --add submodule.subname.path sm &&
	git status >output &&
	test_i18ncmp expect output &&
	git config --remove-section submodule.subname &&
	git config -f .gitmodules  --remove-section submodule.subname

HEAD is now at 44e48f6 c0
[master 4f335ec] c21
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c21.c
fatal: Needed a single revision
ok 27 - merge c1 with c2 (override --no-commit)

expecting success: 
	git reset --hard c1 &&
	test_config branch.master.mergeoptions "--squash" &&
	test_tick &&
	git merge --no-squash c2 &&
	verify_merge file result.1-5 msg.1-5 &&
	verify_parents $c1 $c2

HEAD is now at 44e48f6 c0
HEAD is now at c4c4222 commit 1
[master 559e01b] c22
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c22.c
Merging:
c4c4222 commit 1
virtual c2
found 1 common ancestor:
88012a2 commit 0
Auto-merging file
Merge made by the 'recursive' strategy.
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
HEAD is now at 44e48f6 c0
Rebasing (2/3)
[master 739dd26] c23
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c23.c
fatal: Needed a single revision
HEAD is now at 44e48f6 c0
Stopped at 8dcd0d2be09beb748d164d4703c05fdfeb5a7c32... three_edits
ok 28 - merge c1 with c2 (override --squash)

expecting success: 
	git reset --hard c0 &&
	test_tick &&
	git merge --no-ff c1 &&
	verify_merge file result.1 &&
	verify_parents $c0 $c1

HEAD is now at 88012a2 commit 0
[master c5aecc2] c24
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c24.c
Merging:
88012a2 commit 0
virtual c1
found 1 common ancestor:
88012a2 commit 0
Merge made by the 'recursive' strategy.
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

HEAD is now at 44e48f6 c0
[master 34770eb] c25
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c25.c
fatal: Needed a single revision
ok 29 - merge c0 with c1 (no-ff)

expecting success: 
	git reset --hard c0 &&
	test_config merge.ff "false" &&
	test_tick &&
	git merge c1 &&
	verify_merge file result.1 &&
	verify_parents $c0 $c1

HEAD is now at 44e48f6 c0
HEAD is now at 88012a2 commit 0
[master fbf6ef1] c26
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c26.c
Merging:
88012a2 commit 0
virtual c1
found 1 common ancestor:
88012a2 commit 0
Merge made by the 'recursive' strategy.
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
HEAD is now at 44e48f6 c0
ok 75 - .git/config ignore=untracked doesn't suppress submodules with modified content

ok 14 - status: (continue first edit) second edit

expecting success: 
	git reset --hard several_edits &&
	FAKE_LINES="edit 1 edit 2 3" &&
	export FAKE_LINES &&
	test_when_finished "git rebase --abort" &&
	COMMIT2=$(git rev-parse --short several_edits^^) &&
	COMMIT3=$(git rev-parse --short several_edits^) &&
	COMMIT4=$(git rev-parse --short several_edits) &&
	ONTO=$(git rev-parse --short HEAD~3) &&
	git rebase -i HEAD~3 &&
	git rebase --continue &&
	git reset HEAD^ &&
	cat >expected <<EOF &&
interactive rebase in progress; onto $ONTO
Last commands done (2 commands done):
   edit $COMMIT2 two_edits
   edit $COMMIT3 three_edits
Next command to do (1 remaining command):
   pick $COMMIT4 four_edits
  (use "git rebase --edit-todo" to view and edit)
You are currently splitting a commit while rebasing branch 'several_edits' on '$ONTO'.
  (Once your working directory is clean, run "git rebase --continue")

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   main.txt

no changes added to commit (use "git add" and/or "git commit -a")
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

[master 93f2dd0] c27
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c27.c
expecting success: 
	cat > expect << EOF &&
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	modified:   sm

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   dir1/modified
	modified:   sm (new commits)

Submodule changes to be committed:

* sm $head...$new_head (1):
  > Add bar

Submodules changed but not updated:

* sm $new_head...$head2 (1):
  > 2nd commit

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	.gitmodules
	dir1/untracked
	dir2/modified
	dir2/untracked
	untracked

EOF
	git status --ignore-submodules=untracked > output &&
	test_i18ncmp expect output

HEAD is now at 001318e four_edits
fatal: Needed a single revision
HEAD is now at 44e48f6 c0
ok 30 - merge c0 with c1 (merge.ff=false)

expecting success: 
	git reset --hard c0 &&
	test_config branch.master.mergeoptions "--ff" &&
	test_config merge.ff "false" &&
	test_tick &&
	git merge c1 &&
	verify_merge file result.1 &&
	verify_parents "$c0"

HEAD is now at 88012a2 commit 0
[master e5eaa53] c28
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c28.c
HEAD is now at 44e48f6 c0
Updating 88012a2..c4c4222
Fast-forward
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
[master 79522d0] c29
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c29.c
fatal: Needed a single revision
HEAD is now at 44e48f6 c0
No submodule mapping found in .gitmodules for path 'sm'
ok 31 - combine branch.master.mergeoptions with merge.ff

expecting success: 
	git reset --hard c0 &&
	test_config merge.ff "something-new" &&
	test_tick &&
	git merge c1 2>message &&
	verify_head "$c1" &&
	test_cmp empty message

[master 40c903b] c30
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c30.c
HEAD is now at 88012a2 commit 0
ok 1 - setup

expecting success: 
	git reset --hard c1 &&
	i=2 &&
	refs="" &&
	while test $i -le 30
	do
		refs="$refs c$i"
		i=`expr $i + 1`
	done &&
	git merge $refs &&
	test "$(git rev-parse c1)" != "$(git rev-parse HEAD)" &&
	i=1 &&
	while test $i -le 30
	do
		test "$(git rev-parse c$i)" = "$(git rev-parse HEAD^$i)" &&
		i=`expr $i + 1` || return 1
	done &&
	git diff --exit-code &&
	i=1 &&
	while test $i -le 30
	do
		test -f c$i.c &&
		i=`expr $i + 1` || return 1
	done

HEAD is now at 4250d4e c1
Updating 88012a2..c4c4222
Fast-forward
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 32 - tolerate unknown values for merge.ff

expecting success: 
	git reset --hard c0 &&
	test_must_fail git merge --squash --no-ff c1 &&
	test_must_fail git merge --no-ff --squash c1

HEAD is now at 88012a2 commit 0
fatal: You cannot combine --squash with --no-ff.
fatal: You cannot combine --squash with --no-ff.
ok 33 - combining --squash and --no-ff is refused

expecting success: 
	git merge --no-ff --ff-only c1 &&
	test_must_fail git merge --no-ff --ff-only c2

Updating 88012a2..c4c4222
Fast-forward
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fatal: Not possible to fast-forward, aborting.
ok 34 - option --ff-only overwrites --no-ff

expecting success: 
	git reset --hard c0 &&
	test_config merge.ff only &&
	git merge --no-ff c1

HEAD is now at 88012a2 commit 0
Merging:
88012a2 commit 0
virtual c1
found 1 common ancestor:
88012a2 commit 0
Merge made by the 'recursive' strategy.
No submodule mapping found in .gitmodules for path 'sm'
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Trying simple merge with c2
ok 35 - option --no-ff overrides merge.ff=only config

expecting success: 
	git reset --hard c0 &&
	test_config branch.master.mergeoptions "--no-ff" &&
	git merge --ff c1 &&
	verify_merge file result.1 &&
	verify_head $c1

HEAD is now at 88012a2 commit 0
Trying simple merge with c3
Updating 88012a2..c4c4222
Fast-forward
Trying simple merge with c4
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 76 - --ignore-submodules=untracked doesn't suppress submodule summary

expecting success: 
	git config --add -f .gitmodules submodule.subname.ignore untracked &&
	git config --add -f .gitmodules submodule.subname.path sm &&
	git status >output &&
	test_i18ncmp expect output &&
	git config -f .gitmodules  --remove-section submodule.subname

rebase -i script before editing:
pick 9e0744e two_edits
pick 8dcd0d2 three_edits
pick 001318e four_edits

Trying simple merge with c5
rebase -i script after editing:
edit 9e0744e two_edits
edit 8dcd0d2 three_edits
pick 001318e four_edits
ok 36 - merge c0 with c1 (ff overrides no-ff)

expecting success: 
	git reset --hard c0 &&
	git merge --no-log c2 &&
	git show -s --pretty=format:%b HEAD >msg.act &&
	test_cmp msg.nologff msg.act &&

	git reset --hard c0 &&
	test_config branch.master.mergeoptions "--no-ff" &&
	git merge --no-log c2 &&
	git show -s --pretty=format:%b HEAD >msg.act &&
	test_cmp msg.nolognoff msg.act &&

	git merge --log c3 &&
	git show -s --pretty=format:%b HEAD >msg.act &&
	test_cmp msg.log msg.act &&

	git reset --hard HEAD^ &&
	test_config merge.log "yes" &&
	git merge c3 &&
	git show -s --pretty=format:%b HEAD >msg.act &&
	test_cmp msg.log msg.act

Trying simple merge with c6
HEAD is now at 88012a2 commit 0
Updating 88012a2..ac59201
Fast-forward
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Trying simple merge with c7
HEAD is now at 88012a2 commit 0
Trying simple merge with c8
Merging:
88012a2 commit 0
virtual c2
found 1 common ancestor:
88012a2 commit 0
Merge made by the 'recursive' strategy.
Trying simple merge with c9
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Rebasing (1/3)
Trying simple merge with c10
Merging:
312a7ea Merge tag 'c2'
virtual c3
found 1 common ancestor:
88012a2 commit 0
Auto-merging file
Merge made by the 'recursive' strategy.
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Trying simple merge with c11
Stopped at 9e0744e83c8330e8b23efbca5e7bd9c9ae77f3e7... two_edits
HEAD is now at 312a7ea Merge tag 'c2'
Trying simple merge with c12
You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

Merging:
312a7ea Merge tag 'c2'
virtual c3
found 1 common ancestor:
88012a2 commit 0
Auto-merging file
Merge made by the 'recursive' strategy.
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Trying simple merge with c13
ok 37 - merge log message

expecting success: 
       git reset --hard c1 &&
       test_tick &&
       git merge c0 c2 c0 c1 &&
       verify_merge file result.1-5 &&
       verify_parents $c1 $c2

Trying simple merge with c14
HEAD is now at c4c4222 commit 1
Merging:
virtual c1
virtual c2
found 1 common ancestor:
virtual c0
Auto-merging file
Merge made by the 'recursive' strategy.
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Trying simple merge with c15
Trying simple merge with c16
fatal: Needed a single revision
ok 38 - merge c1 with c0, c2, c0, and c1

expecting success: 
       git reset --hard c1 &&
       test_tick &&
       git merge c0 c2 c0 c1 &&
       verify_merge file result.1-5 &&
       verify_parents $c1 $c2

Trying simple merge with c17
HEAD is now at c4c4222 commit 1
Merging:
virtual c1
virtual c2
found 1 common ancestor:
virtual c0
Auto-merging file
Merge made by the 'recursive' strategy.
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Trying simple merge with c18
ok 77 - .gitmodules ignore=untracked doesn't suppress submodule summary

expecting success: 
	git config --add -f .gitmodules submodule.subname.ignore none &&
	git config --add -f .gitmodules submodule.subname.path sm &&
	git config --add submodule.subname.ignore untracked &&
	git config --add submodule.subname.path sm &&
	git status >output &&
	test_i18ncmp expect output &&
	git config --remove-section submodule.subname &&
	git config -f .gitmodules  --remove-section submodule.subname

Trying simple merge with c19
fatal: Needed a single revision
Rebasing (2/3)
ok 39 - merge c1 with c0, c2, c0, and c1

expecting success: 
       git reset --hard c1 &&
       test_tick &&
       git merge c1 c2 &&
       verify_merge file result.1-5 &&
       verify_parents $c1 $c2

Trying simple merge with c20
HEAD is now at c4c4222 commit 1
Stopped at 8dcd0d2be09beb748d164d4703c05fdfeb5a7c32... three_edits
Merging:
virtual c1
virtual c2
found 1 common ancestor:
88012a2 commit 0
Auto-merging file
Merge made by the 'recursive' strategy.
Trying simple merge with c21
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

Trying simple merge with c22
Unstaged changes after reset:
M	main.txt
fatal: Needed a single revision
ok 40 - merge c1 with c1 and c2

expecting success: 
       git reset --hard c0 &&
       mv file file1 &&
       cat file1 >file &&
       rm -f file1 &&
       git merge c2

HEAD is now at 88012a2 commit 0
Trying simple merge with c23
Updating 88012a2..ac59201
Fast-forward
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 41 - merge fast-forward in a dirty tree

expecting success: 
	git reset --hard c0 &&
	git merge --no-ff -s resolve c1 >out &&
	test_i18ngrep "Wonderful." out &&
	verify_parents $c0 $c1

Trying simple merge with c24
HEAD is now at 88012a2 commit 0
Trying simple merge with c25
Wonderful.
Trying simple merge with c26
fatal: Needed a single revision
ok 42 - in-index merge

expecting success: 
	git reset --hard c1 &&
	cp file file.n && mv -f file.n file &&
	git merge c3

ok 15 - status: (continue first edit) second edit and split

expecting success: 
	git reset --hard several_edits &&
	FAKE_LINES="edit 1 edit 2 3" &&
	export FAKE_LINES &&
	test_when_finished "git rebase --abort" &&
	COMMIT2=$(git rev-parse --short several_edits^^) &&
	COMMIT3=$(git rev-parse --short several_edits^) &&
	COMMIT4=$(git rev-parse --short several_edits) &&
	ONTO=$(git rev-parse --short HEAD~3) &&
	git rebase -i HEAD~3 &&
	git rebase --continue &&
	git commit --amend -m "foo" &&
	cat >expected <<EOF &&
interactive rebase in progress; onto $ONTO
Last commands done (2 commands done):
   edit $COMMIT2 two_edits
   edit $COMMIT3 three_edits
Next command to do (1 remaining command):
   pick $COMMIT4 four_edits
  (use "git rebase --edit-todo" to view and edit)
You are currently editing a commit while rebasing branch 'several_edits' on '$ONTO'.
  (use "git commit --amend" to amend the current commit)
  (use "git rebase --continue" once you are satisfied with your changes)

nothing to commit (use -u to show untracked files)
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

HEAD is now at c4c4222 commit 1
HEAD is now at 001318e four_edits
Trying simple merge with c27
Merging:
c4c4222 commit 1
virtual c3
found 1 common ancestor:
88012a2 commit 0
Auto-merging file
Merge made by the 'recursive' strategy.
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 43 - refresh the index before merging

expecting success: 
	git reset --hard c3 &&
	echo c4 >c4.c &&
	git add c4.c &&
	git commit -m c4 &&
	git tag c4 &&
	echo c5 >c5.c &&
	git add c5.c &&
	git commit -m c5 &&
	git tag c5 &&
	git reset --hard c3 &&
	echo c6 >c6.c &&
	git add c6.c &&
	git commit -m c6 &&
	git tag c6 &&
	git branch -f c5-branch c5 &&
	git merge c5-branch~1 &&
	git show -s --pretty=tformat:%s HEAD >actual.branch &&
	git reset --keep HEAD^ &&
	git merge c5~1 &&
	git show -s --pretty=tformat:%s HEAD >actual.tag &&
	test_cmp expected.branch actual.branch &&
	test_cmp expected.tag actual.tag

Trying simple merge with c28
HEAD is now at 7504643 commit 3
[master 5d3e6c7] c4
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c4.c
Trying simple merge with c29
Trying simple merge with c30
[master bfb196a] c5
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c5.c
ok 78 - .git/config ignore=untracked doesn't suppress submodule summary

expecting success: 
	git status --ignore-submodules=dirty > output &&
	test_i18ncmp expect output

Merge made by the 'octopus' strategy.
HEAD is now at 7504643 commit 3
 c10.c | 1 +
 c11.c | 1 +
 c12.c | 1 +
 c13.c | 1 +
 c14.c | 1 +
 c15.c | 1 +
 c16.c | 1 +
 c17.c | 1 +
 c18.c | 1 +
 c19.c | 1 +
 c2.c  | 1 +
 c20.c | 1 +
 c21.c | 1 +
 c22.c | 1 +
 c23.c | 1 +
 c24.c | 1 +
 c25.c | 1 +
 c26.c | 1 +
 c27.c | 1 +
 c28.c | 1 +
 c29.c | 1 +
 c3.c  | 1 +
 c30.c | 1 +
 c4.c  | 1 +
 c5.c  | 1 +
 c6.c  | 1 +
 c7.c  | 1 +
 c8.c  | 1 +
 c9.c  | 1 +
 29 files changed, 29 insertions(+)
 create mode 100644 c10.c
 create mode 100644 c11.c
 create mode 100644 c12.c
 create mode 100644 c13.c
 create mode 100644 c14.c
 create mode 100644 c15.c
 create mode 100644 c16.c
 create mode 100644 c17.c
 create mode 100644 c18.c
 create mode 100644 c19.c
 create mode 100644 c2.c
 create mode 100644 c20.c
 create mode 100644 c21.c
 create mode 100644 c22.c
 create mode 100644 c23.c
 create mode 100644 c24.c
 create mode 100644 c25.c
 create mode 100644 c26.c
 create mode 100644 c27.c
 create mode 100644 c28.c
 create mode 100644 c29.c
 create mode 100644 c3.c
 create mode 100644 c30.c
 create mode 100644 c4.c
 create mode 100644 c5.c
 create mode 100644 c6.c
 create mode 100644 c7.c
 create mode 100644 c8.c
 create mode 100644 c9.c
[master f5763a5] c6
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c6.c
Merging:
f5763a5 c6
virtual c5-branch~1
found 1 common ancestor:
7504643 commit 3
Merge made by the 'recursive' strategy.
 c4.c | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 c4.c
Merging:
f5763a5 c6
virtual c5~1
found 1 common ancestor:
7504643 commit 3
Merge made by the 'recursive' strategy.
No submodule mapping found in .gitmodules for path 'sm'
 c4.c | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 c4.c
ok 44 - merge early part of c2

expecting success: 
	git reset --hard c0 &&
	git merge --no-ff --no-commit c1 &&
	EDITOR=: git commit &&
	verify_parents $c0 $c1

HEAD is now at 88012a2 commit 0
Automatic merge went well; stopped before committing as requested
Merging:
88012a2 commit 0
virtual c1
found 1 common ancestor:
88012a2 commit 0
[master da2f946] Merge tag 'c1'
 Author: A U Thor <author@example.com>
fatal: Needed a single revision
ok 45 - merge --no-ff --no-commit && commit

expecting success: 
	EDITOR=: git commit --amend &&
	verify_parents $c0 $c1

rebase -i script before editing:
pick 9e0744e two_edits
pick 8dcd0d2 three_edits
pick 001318e four_edits

[master da2f946] Merge tag 'c1'
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:33:13 2005 -0700
rebase -i script after editing:
edit 9e0744e two_edits
edit 8dcd0d2 three_edits
pick 001318e four_edits
fatal: Needed a single revision
ok 46 - amending no-ff merge commit

expecting success: 
	git reset --hard c0 &&
	EDITOR=./editor git merge --no-ff --edit c1 &&
	verify_parents $c0 $c1 &&
	git cat-file commit HEAD >raw &&
	grep "work done on the side branch" raw &&
	sed "1,/^$/d" >actual raw &&
	test_cmp actual expected

No submodule mapping found in .gitmodules for path 'sm'
HEAD is now at 88012a2 commit 0
Merging:
88012a2 commit 0
virtual c1
found 1 common ancestor:
88012a2 commit 0
Merge made by the 'recursive' strategy.
 file | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fatal: Needed a single revision
ok 79 - --ignore-submodules=dirty doesn't suppress submodule summary

expecting success: 
	git config --add -f .gitmodules submodule.subname.ignore dirty &&
	git config --add -f .gitmodules submodule.subname.path sm &&
	git status >output &&
	test_i18ncmp expect output &&
	git config -f .gitmodules  --remove-section submodule.subname

Rebasing (1/3)
Merge work done on the side branch c1
ok 47 - merge --no-ff --edit

expecting success: 
	git reset --hard c0 &&
	git commit --allow-empty -m "A newer commit" &&
	git tag -s -m "A newer commit" signed &&
	git reset --hard c0 &&

	git merge --ff-only signed &&
	git rev-parse signed^0 >expect &&
	git rev-parse HEAD >actual &&
	test_cmp actual expect

HEAD is now at 88012a2 commit 0
Stopped at 9e0744e83c8330e8b23efbca5e7bd9c9ae77f3e7... two_edits
[master 06e5522] A newer commit
 Author: A U Thor <author@example.com>
You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

HEAD is now at 88012a2 commit 0
Updating 88012a2..06e5522
Fast-forward
ok 48 - merge --ff-only tag

expecting success: 
	git reset --hard c0 &&
	git commit --allow-empty -m "A newer commit" &&
	git tag -f -s -m "A newer commit" signed &&
	git reset --hard c0 &&

	EDITOR=false git merge --no-edit signed &&
	git rev-parse signed^0 >expect &&
	git rev-parse HEAD^2 >actual &&
	test_cmp actual expect

HEAD is now at 88012a2 commit 0
[master 06e5522] A newer commit
 Author: A U Thor <author@example.com>
Updated tag 'signed' (was 5d8fab0)
HEAD is now at 88012a2 commit 0
Rebasing (2/3)
Merging:
88012a2 commit 0
virtual signed
found 1 common ancestor:
88012a2 commit 0
Already up-to-date!
Merge made by the 'recursive' strategy.
Stopped at 8dcd0d2be09beb748d164d4703c05fdfeb5a7c32... three_edits
ok 49 - merge --no-edit tag should skip editor

expecting success: 
	# 256 near-identical stanzas...
	for i in $(test_seq 1 256); do
		for j in 1 2 3 4 5; do
			echo $i-$j
		done
	done >file &&
	git add file &&
	git commit -m base &&

	# one side changes the first line of each to "master"
	sed s/-1/-master/ <file >tmp &&
	mv tmp file &&
	git commit -am master &&

	# and the other to "side"; merging the two will
	# yield 256 separate conflicts
	git checkout -b side HEAD^ &&
	sed s/-1/-side/ <file >tmp &&
	mv tmp file &&
	git commit -am side

ok 2 - merge c1 with c2, c3, c4, ... c29

expecting success: 
	git reset --hard c1 &&
	git merge c2 c3 c4 >actual &&
	test_i18ncmp expected actual

You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

HEAD is now at 4250d4e c1
[detached HEAD 3bdce16] foo
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:35:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 80 - .gitmodules ignore=dirty doesn't suppress submodule summary

expecting success: 
	git config --add -f .gitmodules submodule.subname.ignore none &&
	git config --add -f .gitmodules submodule.subname.path sm &&
	git config --add submodule.subname.ignore dirty &&
	git config --add submodule.subname.path sm &&
	git status >output &&
	test_i18ncmp expect output &&
	git config --remove-section submodule.subname &&
	git config -f .gitmodules  --remove-section submodule.subname

[master 6ba3b7d] base
 Author: A U Thor <author@example.com>
 1 file changed, 1280 insertions(+), 9 deletions(-)
 rewrite file (100%)
[master 1b7353d] master
 Author: A U Thor <author@example.com>
 1 file changed, 256 insertions(+), 256 deletions(-)
Switched to a new branch 'side'
ok 3 - merge output uses pretty names

expecting success: 
	GIT_MERGE_VERBOSITY=0 git merge c4 c5 >actual &&
	test_i18ncmp expected actual

[side e17c3e3] side
 Author: A U Thor <author@example.com>
 1 file changed, 256 insertions(+), 256 deletions(-)
ok 50 - set up mod-256 conflict scenario

expecting success: 
	git reset --hard &&
	test_must_fail git merge -s recursive master

ok 16 - status: (continue first edit) second edit and amend

expecting success: 
	git reset --hard several_edits &&
	FAKE_LINES="edit 1 edit 2 3" &&
	export FAKE_LINES &&
	test_when_finished "git rebase --abort" &&
	COMMIT2=$(git rev-parse --short several_edits^^) &&
	COMMIT3=$(git rev-parse --short several_edits^) &&
	COMMIT4=$(git rev-parse --short several_edits) &&
	ONTO=$(git rev-parse --short HEAD~3) &&
	git rebase -i HEAD~3 &&
	git commit --amend -m "a" &&
	git rebase --continue &&
	cat >expected <<EOF &&
interactive rebase in progress; onto $ONTO
Last commands done (2 commands done):
   edit $COMMIT2 two_edits
   edit $COMMIT3 three_edits
Next command to do (1 remaining command):
   pick $COMMIT4 four_edits
  (use "git rebase --edit-todo" to view and edit)
You are currently editing a commit while rebasing branch 'several_edits' on '$ONTO'.
  (use "git commit --amend" to amend the current commit)
  (use "git rebase --continue" once you are satisfied with your changes)

nothing to commit (use -u to show untracked files)
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

ok 4 - merge reduces irrelevant remote heads

HEAD is now at e17c3e3 side
expecting success: 
	git reset --hard c0 &&
	git merge c1 c2 >actual &&
	test_i18ncmp expected actual

HEAD is now at 001318e four_edits
HEAD is now at 44e48f6 c0
Merging:
e17c3e3 side
virtual master
found 1 common ancestor:
6ba3b7d base
Auto-merging file
CONFLICT (content): Merge conflict in file
Automatic merge failed; fix conflicts and then commit the result.
ok 51 - merge detects mod-256 conflicts (recursive)

expecting success: 
	git reset --hard &&
	test_must_fail git merge -s resolve master

HEAD is now at e17c3e3 side
error: Merge requires file-level merging
Trying really trivial in-index merge...
Nope.
Trying simple merge.
Simple merge failed, trying Automatic merge.
ok 5 - merge fast-forward output uses pretty names

# passed all 5 test(s)
1..5
Auto-merging file
ERROR: content conflict in file
fatal: merge program failed
Automatic merge failed; fix conflicts and then commit the result.
ok 52 - merge detects mod-256 conflicts (resolve)

# passed all 52 test(s)
1..52
*** t7603-merge-reduce-heads.sh ***
*** t7604-merge-custom-message.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7603-merge-reduce-heads/.git/
ok 81 - .git/config ignore=dirty doesn't suppress submodule summary

expecting success: 
	test_config core.commentchar ";" &&
	git -c status.displayCommentPrefix=true status >output &&
	test_i18ncmp expect output

expecting success: 
	echo c0 > c0.c &&
	git add c0.c &&
	git commit -m c0 &&
	git tag c0 &&
	echo c1 > c1.c &&
	git add c1.c &&
	git commit -m c1 &&
	git tag c1 &&
	git reset --hard c0 &&
	echo c2 > c2.c &&
	git add c2.c &&
	git commit -m c2 &&
	git tag c2 &&
	git reset --hard c0 &&
	echo c3 > c3.c &&
	git add c3.c &&
	git commit -m c3 &&
	git tag c3 &&
	git reset --hard c0 &&
	echo c4 > c4.c &&
	git add c4.c &&
	git commit -m c4 &&
	git tag c4 &&
	echo c5 > c5.c &&
	git add c5.c &&
	git commit -m c5 &&
	git tag c5

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7604-merge-custom-message/.git/
[master (root-commit) d60ee0f] c0
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c0.c
expecting success: 
	echo c0 > c0.c &&
	git add c0.c &&
	git commit -m c0 &&
	git tag c0 &&
	echo c1 > c1.c &&
	git add c1.c &&
	git commit -m c1 &&
	git tag c1 &&
	git reset --hard c0 &&
	echo c2 > c2.c &&
	git add c2.c &&
	git commit -m c2 &&
	git tag c2 &&
	create_merge_msgs

[master (root-commit) d60ee0f] c0
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c0.c
[master b9d74ca] c1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c1.c
HEAD is now at d60ee0f c0
[master b9d74ca] c1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c1.c
[master 006c83d] c2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c2.c
HEAD is now at d60ee0f c0
HEAD is now at d60ee0f c0
rebase -i script before editing:
pick 9e0744e two_edits
pick 8dcd0d2 three_edits
pick 001318e four_edits

No submodule mapping found in .gitmodules for path 'sm'
[master 006c83d] c2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c2.c
rebase -i script after editing:
edit 9e0744e two_edits
edit 8dcd0d2 three_edits
pick 001318e four_edits
ok 1 - setup

expecting success: 
	git reset --hard c1 &&
	git merge -m "$(cat exp.subject)" c2 &&
	git cat-file commit HEAD | sed -e "1,/^$/d" >actual &&
	test_cmp exp.subject actual

[master b6cfe8f] c3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c3.c
HEAD is now at b9d74ca c1
HEAD is now at d60ee0f c0
Merging:
b9d74ca c1
virtual c2
found 1 common ancestor:
d60ee0f c0
Merge made by the 'recursive' strategy.
 c2.c | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 c2.c
ok 2 - merge c2 with a custom message

expecting success: 
	git reset --hard c1 &&
	git merge --log -m "$(cat exp.subject)" c2 &&
	git cat-file commit HEAD | sed -e "1,/^$/d" >actual &&
	test_cmp exp.log actual

[master feccded] c4
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c4.c
HEAD is now at b9d74ca c1
[master 3681f42] c5
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c5.c
Merging:
b9d74ca c1
virtual c2
found 1 common ancestor:
d60ee0f c0
Merge made by the 'recursive' strategy.
ok 1 - setup

expecting success: 
	git reset --hard c1 &&
	git merge c2 c3 c4 c5 &&
	test "$(git rev-parse c1)" != "$(git rev-parse HEAD)" &&
	test "$(git rev-parse c1)" = "$(git rev-parse HEAD^1)" &&
	test "$(git rev-parse c2)" = "$(git rev-parse HEAD^2)" &&
	test "$(git rev-parse c3)" = "$(git rev-parse HEAD^3)" &&
	test "$(git rev-parse c5)" = "$(git rev-parse HEAD^4)" &&
	git diff --exit-code &&
	test -f c0.c &&
	test -f c1.c &&
	test -f c2.c &&
	test -f c3.c &&
	test -f c4.c &&
	test -f c5.c &&
	git show --format=%s -s >actual &&
	! grep c1 actual &&
	grep c2 actual &&
	grep c3 actual &&
	! grep c4 actual &&
	grep c5 actual

 c2.c | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 c2.c
HEAD is now at b9d74ca c1
ok 3 - merge --log appends to custom message

Rebasing (1/3)
# passed all 3 test(s)
1..3
*** t7605-merge-resolve.sh ***
Trying simple merge with c2
No submodule mapping found in .gitmodules for path 'sm'
Stopped at 9e0744e83c8330e8b23efbca5e7bd9c9ae77f3e7... two_edits
Trying simple merge with c3
You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7605-merge-resolve/.git/
Trying simple merge with c5
expecting success: 
	echo c0 > c0.c &&
	git add c0.c &&
	git commit -m c0 &&
	git tag c0 &&
	echo c1 > c1.c &&
	git add c1.c &&
	git commit -m c1 &&
	git tag c1 &&
	git reset --hard c0 &&
	echo c2 > c2.c &&
	git add c2.c &&
	git commit -m c2 &&
	git tag c2 &&
	git reset --hard c0 &&
	echo c3 > c2.c &&
	git add c2.c &&
	git commit -m c3 &&
	git tag c3

[detached HEAD ff795c9] a
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:34:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
Merge made by the 'octopus' strategy.
 c2.c | 1 +
 c3.c | 1 +
 c4.c | 1 +
 c5.c | 1 +
 4 files changed, 4 insertions(+)
 create mode 100644 c2.c
 create mode 100644 c3.c
 create mode 100644 c4.c
 create mode 100644 c5.c
[master (root-commit) 6ecbe9f] c0
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c0.c
ok 82 - status (core.commentchar with submodule summary)

expecting success: 
	test_config core.commentchar ";;" &&
	test_must_fail git -c status.displayCommentPrefix=true status

error: core.commentChar should only be one character
fatal: bad config variable 'core.commentchar' in file '.git/config' at line 6
ok 83 - status (core.commentchar with two chars with submodule summary)

expecting success: 
	cat > expect << EOF &&
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   dir1/modified

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	.gitmodules
	dir1/untracked
	dir2/modified
	dir2/untracked
	untracked

no changes added to commit (use "git add" and/or "git commit -a")
EOF
	git status --ignore-submodules=all > output &&
	test_i18ncmp expect output

[master 2b2b64c] c1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c1.c
ok 84 - --ignore-submodules=all suppresses submodule summary

expecting success: 
	cat > expect << EOF &&
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	modified:   sm

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   dir1/modified

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	.gitmodules
	dir1/untracked
	dir2/modified
	dir2/untracked
	untracked

EOF
	git config --add -f .gitmodules submodule.subname.ignore all &&
	git config --add -f .gitmodules submodule.subname.path sm &&
	git status > output &&
	test_cmp expect output &&
	git config -f .gitmodules  --remove-section submodule.subname

HEAD is now at 6ecbe9f c0
[master f19a3df] c2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c2.c
Merge tags 'c2', 'c3' and 'c5'
Merge tags 'c2', 'c3' and 'c5'
Merge tags 'c2', 'c3' and 'c5'
ok 2 - merge c1 with c2, c3, c4, c5

expecting success: 
	git reset --hard c1 &&
	git pull . c2 c3 c4 c5 &&
	test "$(git rev-parse c1)" != "$(git rev-parse HEAD)" &&
	test "$(git rev-parse c1)" = "$(git rev-parse HEAD^1)" &&
	test "$(git rev-parse c2)" = "$(git rev-parse HEAD^2)" &&
	test "$(git rev-parse c3)" = "$(git rev-parse HEAD^3)" &&
	test "$(git rev-parse c5)" = "$(git rev-parse HEAD^4)" &&
	git diff --exit-code &&
	test -f c0.c &&
	test -f c1.c &&
	test -f c2.c &&
	test -f c3.c &&
	test -f c4.c &&
	test -f c5.c &&
	git show --format=%s -s >actual &&
	! grep c1 actual &&
	grep c2 actual &&
	grep c3 actual &&
	! grep c4 actual &&
	grep c5 actual

HEAD is now at 6ecbe9f c0
HEAD is now at b9d74ca c1
[master cf42883] c3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c2.c
ok 1 - setup

expecting success: 
	git reset --hard c1 &&
	git merge -s resolve c2 &&
	test "$(git rev-parse c1)" != "$(git rev-parse HEAD)" &&
	test "$(git rev-parse c1)" = "$(git rev-parse HEAD^1)" &&
	test "$(git rev-parse c2)" = "$(git rev-parse HEAD^2)" &&
	git diff --exit-code &&
	test -f c0.c &&
	test -f c1.c &&
	test -f c2.c &&
	test 3 = $(git ls-tree -r HEAD | wc -l) &&
	test 3 = $(git ls-files | wc -l)

Rebasing (2/3)
HEAD is now at 2b2b64c c1
From .
 * tag               c2         -> FETCH_HEAD
 * tag               c3         -> FETCH_HEAD
 * tag               c4         -> FETCH_HEAD
 * tag               c5         -> FETCH_HEAD
Trying really trivial in-index merge...
Wonderful.
In-index merge
 c2.c | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 c2.c
Trying simple merge with 006c83ddc7580149f1454d9db1806ca1acbf8378
Stopped at 8dcd0d2be09beb748d164d4703c05fdfeb5a7c32... three_edits
Trying simple merge with b6cfe8f9f45db6984b7566fa463a44ad8881b67e
Trying simple merge with 3681f42dfc08f26eeac2f50633c8e633a77655a5
ok 2 - merge c1 to c2

expecting success: 
	git reset --hard c2 &&
	test_must_fail git merge -s resolve c3

You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

Merge made by the 'octopus' strategy.
HEAD is now at f19a3df c2
 c2.c | 1 +
 c3.c | 1 +
 c4.c | 1 +
 c5.c | 1 +
 4 files changed, 4 insertions(+)
 create mode 100644 c2.c
 create mode 100644 c3.c
 create mode 100644 c4.c
 create mode 100644 c5.c
error: Merge requires file-level merging
Trying really trivial in-index merge...
Nope.
ok 85 - .gitmodules ignore=all suppresses unstaged submodule summary

expecting success: 
	git config --add -f .gitmodules submodule.subname.ignore none &&
	git config --add -f .gitmodules submodule.subname.path sm &&
	git config --add submodule.subname.ignore all &&
	git config --add submodule.subname.path sm &&
	git status > output &&
	test_cmp expect output &&
	git config --remove-section submodule.subname &&
	git config -f .gitmodules  --remove-section submodule.subname

Trying simple merge.
Simple merge failed, trying Automatic merge.
Added c2.c in both, but differently.
Merge tags 'c2', 'c3' and 'c5'
Merge tags 'c2', 'c3' and 'c5'
Merge tags 'c2', 'c3' and 'c5'
ok 3 - pull c2, c3, c4, c5 into c1

ok 17 - status: (amend first edit) second edit

expecting success: 
	for i in A B C D E
	do
		echo $i > $i.c &&
		git add $i.c &&
		git commit -m $i &&
		git tag $i
	done &&
	git reset --hard A &&
	for i in F G H I
	do
		echo $i > $i.c &&
		git add $i.c &&
		git commit -m $i &&
		git tag $i
	done

expecting success: 
	git reset --hard several_edits &&
	FAKE_LINES="edit 1 edit 2 3" &&
	export FAKE_LINES &&
	test_when_finished "git rebase --abort" &&
	ONTO=$(git rev-parse --short HEAD~3) &&
	COMMIT2=$(git rev-parse --short several_edits^^) &&
	COMMIT3=$(git rev-parse --short several_edits^) &&
	COMMIT4=$(git rev-parse --short several_edits) &&
	git rebase -i HEAD~3 &&
	git commit --amend -m "b" &&
	git rebase --continue &&
	git reset HEAD^ &&
	cat >expected <<EOF &&
interactive rebase in progress; onto $ONTO
Last commands done (2 commands done):
   edit $COMMIT2 two_edits
   edit $COMMIT3 three_edits
Next command to do (1 remaining command):
   pick $COMMIT4 four_edits
  (use "git rebase --edit-todo" to view and edit)
You are currently splitting a commit while rebasing branch 'several_edits' on '$ONTO'.
  (Once your working directory is clean, run "git rebase --continue")

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   main.txt

no changes added to commit (use "git add" and/or "git commit -a")
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

ERROR: content conflict in c2.c
fatal: merge program failed
Automatic merge failed; fix conflicts and then commit the result.
ok 3 - merge c2 to c3 (fails)

HEAD is now at 001318e four_edits
# passed all 3 test(s)
1..3
[master 39cd303] A
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 A.c
*** t7606-merge-custom.sh ***
[master aac3931] B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 B.c
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7606-merge-custom/.git/
[master 63d88cd] C
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 C.c
expecting success: 
	cat >git-merge-theirs <<-EOF &&
	#!$SHELL_PATH
	eval git read-tree --reset -u \\\$\$#
	EOF

	chmod +x git-merge-theirs &&
	PATH=.:$PATH &&
	export PATH

ok 1 - set up custom strategy

expecting success: 
	test_commit c0 c0.c &&
	test_commit c1 c1.c &&
	git reset --keep c0 &&
	echo c1c1 >c1.c &&
	git add c1.c &&
	test_commit c2 c2.c &&
	git reset --keep c0 &&
	test_commit c3 c3.c

[master 137d0fc] D
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 D.c
[master (root-commit) 934056f] c0
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c0.c
[master 7439378] E
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 E.c
[master 7b51d7c] c1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c1.c
HEAD is now at 39cd303 A
ok 86 - .git/config ignore=all suppresses unstaged submodule summary

expecting success: 
	git config status.showUntrackedFiles no &&
	git status -s >expected_short &&
	git status --no-short >expected_noshort

[master cb341af] F
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 F.c
[master f06910a] c2
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 c1.c
 create mode 100644 c2.c
[master 1632b7b] G
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 G.c
[master 2c6db10] H
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 H.c
[master 934e277] c3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c3.c
ok 2 - setup

expecting success: 
	git reset --hard c1 &&

	git rev-parse c1 >head.old &&
	git rev-parse c2 >second-parent.expected &&
	git rev-parse c2^{tree} >tree.expected &&
	git merge -s theirs c2 &&

	git rev-parse HEAD >head.new &&
	git rev-parse HEAD^1 >first-parent &&
	git rev-parse HEAD^2 >second-parent &&
	git rev-parse HEAD^{tree} >tree &&
	git update-index --refresh &&
	git diff --exit-code &&
	git diff --exit-code c2 HEAD &&
	git diff --exit-code c2 &&

	! test_cmp head.old head.new &&
	test_cmp head.old first-parent &&
	test_cmp second-parent.expected second-parent &&
	test_cmp tree.expected tree &&
	test -f c0.c &&
	grep c1c1 c1.c &&
	test -f c2.c

HEAD is now at 7b51d7c c1
[master 672f674] I
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 I.c
ok 4 - setup

expecting success: 
	git reset --hard A &&
	git merge E I

No submodule mapping found in .gitmodules for path 'sm'
HEAD is now at 39cd303 A
Merge made by the 'theirs' strategy.
rebase -i script before editing:
pick 9e0744e two_edits
pick 8dcd0d2 three_edits
pick 001318e four_edits

 c1.c | 2 +-
 c2.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 c2.c
rebase -i script after editing:
edit 9e0744e two_edits
edit 8dcd0d2 three_edits
pick 001318e four_edits
Fast-forwarding to: E
Trying simple merge with I
Merge made by the 'octopus' strategy.
 B.c | 1 +
 C.c | 1 +
 D.c | 1 +
 E.c | 1 +
 F.c | 1 +
 G.c | 1 +
 H.c | 1 +
 I.c | 1 +
 8 files changed, 8 insertions(+)
 create mode 100644 B.c
 create mode 100644 C.c
 create mode 100644 D.c
 create mode 100644 E.c
 create mode 100644 F.c
 create mode 100644 G.c
 create mode 100644 H.c
 create mode 100644 I.c
ok 5 - merge E and I

expecting success: 
	test $(git rev-parse HEAD^1) = $(git rev-parse E) &&
	test $(git rev-parse HEAD^2) = $(git rev-parse I)

--- head.old	2015-12-16 11:06:27.353564892 +0000
+++ head.new	2015-12-16 11:06:27.545564892 +0000
@@ -1 +1 @@
-7b51d7cdbd54b8c470d864639e1136d88ce718ef
+5127482d58f03334905cdbe3564c8d092aa56dbe
c1c1
ok 3 - merge c2 with a custom strategy

expecting success: 
	git reset --hard c1 &&

	git rev-parse c1 >head.old &&
	git rev-parse c3 >second-parent.expected &&
	git rev-parse c3^{tree} >tree.expected &&
	git merge -s theirs c3 &&

	git rev-parse HEAD >head.new &&
	git rev-parse HEAD^1 >first-parent &&
	git rev-parse HEAD^2 >second-parent &&
	git rev-parse HEAD^{tree} >tree &&
	git update-index --refresh &&
	git diff --exit-code &&
	git diff --exit-code c3 HEAD &&
	git diff --exit-code c3 &&

	! test_cmp head.old head.new &&
	test_cmp head.old first-parent &&
	test_cmp second-parent.expected second-parent &&
	test_cmp tree.expected tree &&
	test -f c0.c &&
	! test -e c1.c &&
	test -f c3.c

ok 6 - verify merge result

expecting success: 
	git reset --hard E &&
	echo foo > file.c &&
	git add file.c &&
	git commit -m E2 &&
	git tag E2 &&
	git reset --hard I &&
	echo bar >file.c &&
	git add file.c &&
	git commit -m I2 &&
	git tag I2

HEAD is now at 7b51d7c c1
HEAD is now at 7439378 E
Rebasing (1/3)
[master cc12bcc] E2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file.c
No submodule mapping found in .gitmodules for path 'sm'
Merge made by the 'theirs' strategy.
HEAD is now at 672f674 I
 c1.c | 1 -
 c3.c | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)
 delete mode 100644 c1.c
 create mode 100644 c3.c
Stopped at 9e0744e83c8330e8b23efbca5e7bd9c9ae77f3e7... two_edits
[master da1ca18] I2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file.c
ok 7 - add conflicts

expecting success: 
	git reset --hard A &&
	test_must_fail git merge E2 I2 &&
	echo baz > file.c &&
	git add file.c &&
	git commit -m "resolve conflict"

You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

HEAD is now at 39cd303 A
ok 87 - setup of test environment

expecting success: 
	git -c status.short=true status >actual &&
	test_cmp expected_short actual

[detached HEAD 9b72fdb] b
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:34:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 88 - "status.short=true" same as "-s"

expecting success: 
	git -c status.short=true status --no-short >actual &&
	test_cmp expected_noshort actual

--- head.old	2015-12-16 11:06:27.837564892 +0000
+++ head.new	2015-12-16 11:06:28.033564892 +0000
@@ -1 +1 @@
-7b51d7cdbd54b8c470d864639e1136d88ce718ef
+f5f2abda42595469639ae786a37808202e35dcf0
ok 4 - trivial merge with custom strategy

Fast-forwarding to: E2
# passed all 4 test(s)
1..4
Trying simple merge with I2
*** t7607-merge-overwrite.sh ***
Simple merge did not work, trying automatic merge.
Added file.c in both, but differently.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7607-merge-overwrite/.git/
expecting success: 
	test_commit c0 c0.c &&
	test_commit c1 c1.c &&
	test_commit c1a c1.c "c1 a" &&
	git reset --hard c0 &&
	test_commit c2 c2.c &&
	git reset --hard c0 &&
	mkdir sub &&
	echo "sub/f" > sub/f &&
	mkdir sub2 &&
	echo "sub2/f" > sub2/f &&
	git add sub/f sub2/f &&
	git commit -m sub &&
	git tag sub &&
	echo "VERY IMPORTANT CHANGES" > important

No submodule mapping found in .gitmodules for path 'sm'
ERROR: content conflict in file.c
fatal: merge program failed
[master (root-commit) 934056f] c0
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c0.c
Automatic merge failed; fix conflicts and then commit the result.
[master aa7344d] resolve conflict
 Author: A U Thor <author@example.com>
ok 8 - merge E2 and I2, causing a conflict and resolve it

expecting success: 
	test $(git rev-parse HEAD^1) = $(git rev-parse E2) &&
	test $(git rev-parse HEAD^2) = $(git rev-parse I2)

[master 7b51d7c] c1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c1.c
Rebasing (2/3)
ok 9 - verify merge result

expecting success: 
	git reset --hard c0 &&
	git merge c4 c5

[master 4e7fedb] c1a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
HEAD is now at d60ee0f c0
HEAD is now at 934056f c0
Updating d60ee0f..3681f42
Fast-forward
Stopped at 8dcd0d2be09beb748d164d4703c05fdfeb5a7c32... three_edits
 c4.c | 1 +
 c5.c | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 c4.c
 create mode 100644 c5.c
ok 10 - fast-forward to redundant refs

expecting success: 
	test $(git rev-parse HEAD) = $(git rev-parse c5)

[master 48f99e1] c2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c2.c
ok 11 - verify merge result

expecting success: 
	git reset --hard c5 &&
	git merge c0 c4

HEAD is now at 934056f c0
HEAD is now at 3681f42 c5
You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

Already up-to-date.
ok 12 - merge up-to-date redundant refs

expecting success: 
	test $(git rev-parse HEAD) = $(git rev-parse c5)

Unstaged changes after reset:
M	main.txt
No submodule mapping found in .gitmodules for path 'sm'
ok 13 - verify merge result

[master 55608b7] sub
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 sub/f
 create mode 100644 sub2/f
# passed all 13 test(s)
1..13
ok 1 - setup

expecting success: 
	git reset --hard c1 &&
	cp important c2.c &&
	test_must_fail git merge c2 &&
	test_path_is_missing .git/MERGE_HEAD &&
	test_cmp important c2.c

HEAD is now at 7b51d7c c1
error: The following untracked working tree files would be overwritten by merge:
	c2.c
Please move or remove them before you can merge.
Aborting
fatal: merging of trees 93035bc44e71dc037ede30e10867527070f66364 and 223e2079392406e13c1b247476ccf8c658dbaaaf failed
Merging:
7b51d7c c1
virtual c2
found 1 common ancestor:
934056f c0
ok 2 - will not overwrite untracked file

expecting success: 
	git reset --hard c1 &&
	cp important c2.c &&
	git add c2.c &&
	git commit -m important &&
	git checkout c2

*** t7608-merge-messages.sh ***
HEAD is now at 7b51d7c c1
ok 89 - "status.short=true" weaker than "--no-short"

expecting success: 
	git -c status.short=false status >actual &&
	test_cmp expected_noshort actual

[master b7e8e56] important
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 c2.c
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7608-merge-messages/.git/
expecting success: 
	test_commit master-1 &&
	git checkout -b local-branch &&
	test_commit branch-1 &&
	git checkout master &&
	test_commit master-2 &&
	git merge local-branch &&
	check_oneline "Merge branch Qlocal-branchQ"

Note: checking out 'c2'.

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 48f99e1... c2
ok 3 - will overwrite tracked file

expecting success: 
	git reset --hard c1 &&
	cp important c2.c &&
	git add c2.c &&
	test_must_fail git merge c2 &&
	test_path_is_missing .git/MERGE_HEAD &&
	test_cmp important c2.c

ok 18 - status: (amend first edit) second edit and split

expecting success: 
	git reset --hard several_edits &&
	FAKE_LINES="edit 1 edit 2 3" &&
	export FAKE_LINES &&
	test_when_finished "git rebase --abort" &&
	COMMIT2=$(git rev-parse --short several_edits^^) &&
	COMMIT3=$(git rev-parse --short several_edits^) &&
	COMMIT4=$(git rev-parse --short several_edits) &&
	ONTO=$(git rev-parse --short HEAD~3) &&
	git rebase -i HEAD~3 &&
	git commit --amend -m "c" &&
	git rebase --continue &&
	git commit --amend -m "d" &&
	cat >expected <<EOF &&
interactive rebase in progress; onto $ONTO
Last commands done (2 commands done):
   edit $COMMIT2 two_edits
   edit $COMMIT3 three_edits
Next command to do (1 remaining command):
   pick $COMMIT4 four_edits
  (use "git rebase --edit-todo" to view and edit)
You are currently editing a commit while rebasing branch 'several_edits' on '$ONTO'.
  (use "git commit --amend" to amend the current commit)
  (use "git rebase --continue" once you are satisfied with your changes)

nothing to commit (use -u to show untracked files)
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

HEAD is now at 7b51d7c c1
HEAD is now at 001318e four_edits
[master (root-commit) 7b5416a] master-1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 master-1.t
error: Your local changes to the following files would be overwritten by merge:
	c2.c
Please, commit your changes or stash them before you can merge.
Aborting
fatal: merging of trees 93035bc44e71dc037ede30e10867527070f66364 and 223e2079392406e13c1b247476ccf8c658dbaaaf failed
Merging:
7b51d7c c1
virtual c2
found 1 common ancestor:
934056f c0
ok 4 - will not overwrite new file

expecting success: 
	git reset --hard c1 &&
	cp important c2.c &&
	git add c2.c &&
	rm c2.c &&
	test_must_fail git merge c2 &&
	test_path_is_missing .git/MERGE_HEAD &&
	git checkout c2.c &&
	test_cmp important c2.c

Switched to a new branch 'local-branch'
HEAD is now at 7b51d7c c1
[local-branch f064301] branch-1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 branch-1.t
error: Your local changes to the following files would be overwritten by merge:
	c2.c
Please, commit your changes or stash them before you can merge.
Aborting
fatal: merging of trees 93035bc44e71dc037ede30e10867527070f66364 and 223e2079392406e13c1b247476ccf8c658dbaaaf failed
Merging:
7b51d7c c1
virtual c2
found 1 common ancestor:
934056f c0
No submodule mapping found in .gitmodules for path 'sm'
ok 5 - will not overwrite staged changes

expecting success: 
	git reset --hard c1 &&
	git rm c1.c &&
	git commit -m "rm c1.c" &&
	cp important c1.c &&
	test_must_fail git merge c1a &&
	test_cmp important c1.c

Switched to branch 'master'
HEAD is now at 7b51d7c c1
rm 'c1.c'
[master 04af5f8] master-2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 master-2.t
[detached HEAD 86e44d1] rm c1.c
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 c1.c
error: refusing to lose untracked file at 'c1.c'
Merging:
86e44d1 rm c1.c
virtual c1a
found 1 common ancestor:
7b51d7c c1
CONFLICT (modify/delete): c1.c deleted in HEAD and modified in c1a. Version c1a of c1.c left in tree.
Automatic merge failed; fix conflicts and then commit the result.
ok 6 - will not overwrite removed file

expecting success: 
	git reset --hard c1 &&
	git rm c1.c &&
	git commit -m "rm c1.c" &&
	cp important c1.c &&
	git add c1.c &&
	test_must_fail git merge c1a &&
	test_path_is_missing .git/MERGE_HEAD &&
	test_cmp important c1.c

Merging:
04af5f8 master-2
virtual local-branch
found 1 common ancestor:
7b5416a master-1
Merge made by the 'recursive' strategy.
 branch-1.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 branch-1.t
HEAD is now at 7b51d7c c1
rm 'c1.c'
ok 1 - merge local branch

expecting success: 
	git checkout -b octopus-a master &&
	test_commit octopus-1 &&
	git checkout -b octopus-b master &&
	test_commit octopus-2 &&
	git checkout master &&
	git merge octopus-a octopus-b &&
	check_oneline "Merge branches Qoctopus-aQ and Qoctopus-bQ"

[detached HEAD 86e44d1] rm c1.c
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 c1.c
Switched to a new branch 'octopus-a'
error: Your local changes to the following files would be overwritten by merge:
	c1.c
Please, commit your changes or stash them before you can merge.
Aborting
fatal: merging of trees f3c82d8080720758f10d1b1ab0884ef20525f69a and 011cdd48bc81dc19a0a375e84691d2970b2fa0d7 failed
Merging:
86e44d1 rm c1.c
virtual c1a
found 1 common ancestor:
7b51d7c c1
ok 7 - will not overwrite re-added file

expecting success: 
	git reset --hard c1 &&
	git rm c1.c &&
	git commit -m "rm c1.c" &&
	cp important c1.c &&
	git add c1.c &&
	rm c1.c &&
	test_must_fail git merge c1a &&
	test_path_is_missing .git/MERGE_HEAD &&
	git checkout c1.c &&
	test_cmp important c1.c

[octopus-a 7226ae8] octopus-1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 octopus-1.t
HEAD is now at 7b51d7c c1
rm 'c1.c'
Switched to a new branch 'octopus-b'
[detached HEAD 86e44d1] rm c1.c
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 c1.c
No submodule mapping found in .gitmodules for path 'sm'
[octopus-b 9679e1e] octopus-2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 octopus-2.t
error: Your local changes to the following files would be overwritten by merge:
	c1.c
Please, commit your changes or stash them before you can merge.
Aborting
fatal: merging of trees f3c82d8080720758f10d1b1ab0884ef20525f69a and 011cdd48bc81dc19a0a375e84691d2970b2fa0d7 failed
Merging:
86e44d1 rm c1.c
virtual c1a
found 1 common ancestor:
7b51d7c c1
Switched to branch 'master'
ok 8 - will not overwrite removed file with staged changes

checking known breakage: 
	git reset --hard c1 &&
	git mv c1.c other.c &&
	git commit -m rename &&
	cp important other.c &&
	git merge c1a &&
	test_cmp important other.c

HEAD is now at 7b51d7c c1
Fast-forwarding to: octopus-a
[detached HEAD 891a741] rename
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename c1.c => other.c (100%)
ok 90 - "status.short=false" same as "--no-short"

expecting success: 
	git -c status.short=false status -s >actual &&
	test_cmp expected_short actual

Trying simple merge with octopus-b
Merging:
891a741 rename
virtual c1a
found 1 common ancestor:
7b51d7c c1
Auto-merging other.c
Merge made by the 'recursive' strategy.
 other.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--- important	2015-12-16 11:06:29.161564892 +0000
+++ other.c	2015-12-16 11:06:30.433564892 +0000
@@ -1 +1 @@
-VERY IMPORTANT CHANGES
+c1 a
ok 91 - "status.short=false" weaker than "-s"

expecting success: 
	git status -sb >expected_branch &&
	git -c status.branch=true status -s >actual &&
	test_cmp expected_branch actual

not ok 9 - will not overwrite unstaged changes in renamed file # TODO known breakage

expecting success: 
	git reset --hard c0 &&
	rm -rf sub &&
	mkdir -p sub/f &&
	cp important sub/f/important &&
	test_must_fail git merge sub &&
	test_path_is_missing .git/MERGE_HEAD &&
	test_cmp important sub/f/important

Merge made by the 'octopus' strategy.
HEAD is now at 934056f c0
 octopus-1.t | 1 +
 octopus-2.t | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 octopus-1.t
 create mode 100644 octopus-2.t
rebase -i script before editing:
pick 9e0744e two_edits
pick 8dcd0d2 three_edits
pick 001318e four_edits

ok 2 - merge octopus branches

expecting success: 
	git checkout -b tag-branch master &&
	test_commit tag-1 &&
	git checkout master &&
	test_commit master-3 &&
	git merge tag-1 &&
	check_oneline "Merge tag Qtag-1Q"

error: Updating the following directories would lose untracked files in it:
	sub/f

Aborting
Updating 934056f..55608b7
ok 10 - will not overwrite untracked subtree

rebase -i script after editing:
expecting success: 
	git reset --hard c0 &&
	rm -rf sub &&
	cp important sub &&
	cp important sub2 &&
	test_must_fail git merge sub 2>out &&
	test_cmp out expect &&
	test_path_is_missing .git/MERGE_HEAD &&
	test_cmp important sub &&
	test_cmp important sub2 &&
	rm -f sub sub2

edit 9e0744e two_edits
edit 8dcd0d2 three_edits
pick 001318e four_edits
Switched to a new branch 'tag-branch'
ok 92 - "status.branch=true" same as "-b"

expecting success: 
	git status -s --no-branch  >expected_nobranch &&
	git -c status.branch=true status -s >actual &&
	test_must_fail test_cmp expected_nobranch actual

HEAD is now at 934056f c0
[tag-branch 727cec4] tag-1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 tag-1.t
Updating 934056f..55608b7
Switched to branch 'master'
ok 11 - will not overwrite untracked file in leading path

--- expected_nobranch	2015-12-16 11:06:30.681564892 +0000
+++ actual	2015-12-16 11:06:30.733564892 +0000
@@ -1,2 +1,3 @@
+## master
  M dir1/modified
 MM sm
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 93 - "status.branch=true" different from "--no-branch"

expecting success: 
	git -c status.branch=true status -s --no-branch >actual &&
	test_cmp expected_nobranch actual

prerequisite SYMLINKS ok
expecting success: 
	git reset --hard c0 &&
	rm -rf sub &&
	mkdir sub2 &&
	ln -s sub2 sub &&
	test_must_fail git merge sub &&
	test_path_is_missing .git/MERGE_HEAD

HEAD is now at 934056f c0
[master 1834f00] master-3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 master-3.t
ok 94 - "status.branch=true" weaker than "--no-branch"

expecting success: 
       git -c status.branch=true status --porcelain >actual &&
       test_cmp expected_nobranch actual

error: The following untracked working tree files would be overwritten by merge:
	sub
Please move or remove them before you can merge.
Aborting
Updating 934056f..55608b7
ok 12 - will not overwrite untracked symlink in leading path

expecting success: 
	git reset --hard c0 &&
	rm -rf sub &&
	test_ln_s_add sub2 sub &&
	git commit -m ln &&
	git checkout sub

Merging:
1834f00 master-3
virtual tag-1
found 1 common ancestor:
b5672c0 Merge branches 'octopus-a' and 'octopus-b'
Merge made by the 'recursive' strategy.
ok 95 - "status.branch=true" weaker than "--porcelain"

expecting success: 
	git -c status.branch=false status -s >actual &&
	test_cmp expected_nobranch actual

 tag-1.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 tag-1.t
Rebasing (1/3)
HEAD is now at 934056f c0
ok 3 - merge tag

expecting success: 
	git checkout -b ambiguous master &&
	test_commit ambiguous &&
	git checkout master &&
	test_commit master-4 &&
	git merge ambiguous &&
	check_oneline "Merge tag QambiguousQ"

ok 96 - "status.branch=false" same as "--no-branch"

expecting success: 
	git -c status.branch=false status -sb >actual &&
	test_cmp expected_branch actual

Switched to a new branch 'ambiguous'
[detached HEAD 6d387d8] ln
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 120000 sub
Stopped at 9e0744e83c8330e8b23efbca5e7bd9c9ae77f3e7... two_edits
ok 97 - "status.branch=false" weaker than "-b"

expecting success: 
	git config --unset status.showUntrackedFiles

Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  6d387d8 ln

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> 6d387d8

HEAD is now at 55608b7... sub
ok 13 - will not be confused by symlink in leading path

expecting success: 
	git reset --hard c0 &&
	git rm -fr . &&
	git checkout --orphan new &&
	cp important c0.c &&
	test_must_fail git merge c0 2>out &&
	test_i18ncmp out expect

[ambiguous 05dd8f8] ambiguous
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 ambiguous.t
ok 98 - Restore default test environment

expecting success: 
	git config --add -f .gitmodules submodule.subname.ignore all &&
	git config --add -f .gitmodules submodule.subname.path sm &&
	git config --add submodule.subname.ignore all &&
	git status -s --ignore-submodules=dirty >output &&
	test_i18ngrep "^M. sm" output &&
	GIT_EDITOR="echo hello >>\"\$1\"" &&
	export GIT_EDITOR &&
	git commit -uno &&
	git status -s --ignore-submodules=dirty >output &&
	test_i18ngrep ! "^M. sm" output

HEAD is now at 934056f c0
Switched to branch 'master'
rm 'c0.c'
You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

Switched to a new branch 'new'
D	c0.c
[detached HEAD d2d1466] c
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:34:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
MM sm
[master 4dad856] master-4
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 master-4.t
ok 14 - will not overwrite untracked file on unborn branch

expecting success: 
	test_when_finished "rm c0.c" &&
	test_path_is_missing .git/MERGE_HEAD &&
	test_cmp important c0.c

ok 15 - will not overwrite untracked file on unborn branch .git/MERGE_HEAD sanity etc.

expecting success: 
	test_must_fail git rev-parse --verify HEAD

warning: refname 'ambiguous' is ambiguous.
warning: refname 'ambiguous' is ambiguous.
fatal: Needed a single revision
ok 16 - failed merge leaves unborn branch in the womb

expecting success: 
	git symbolic-ref HEAD refs/heads/unborn &&
	rm -f .git/index &&
	echo foo > tracked-file &&
	git add tracked-file &&
	echo bar > untracked-file

Merging:
4dad856 master-4
virtual ambiguous
found 1 common ancestor:
cac54ed Merge tag 'tag-1'
Merge made by the 'recursive' strategy.
 ambiguous.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 ambiguous.t
ok 4 - ambiguous tag

expecting success: 
	git checkout -b remote master &&
	test_commit remote-1 &&
	git update-ref refs/remotes/origin/master remote &&
	git checkout master &&
	test_commit master-5 &&
	git merge origin/master &&
	check_oneline "Merge remote-tracking branch Qorigin/masterQ"

ok 17 - set up unborn branch and content

expecting success: 
	git merge master &&
	grep foo tracked-file &&
	git show :tracked-file >expect &&
	grep foo expect &&
	grep bar untracked-file

Switched to a new branch 'remote'
foo
foo
bar
ok 18 - will not clobber WT/index when merging into unborn

[remote bc66e06] remote-1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 remote-1.t
# still have 1 known breakage(s)
# passed all remaining 17 test(s)
1..18
Switched to branch 'master'
*** t7609-merge-co-error-msgs.sh ***
[master ecb72d0] master-5
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 master-5.t
Merging:
ecb72d0 master-5
virtual origin/master
found 1 common ancestor:
39902d7 Merge tag 'ambiguous'
Merge made by the 'recursive' strategy.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7609-merge-co-error-msgs/.git/
 remote-1.t | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 remote-1.t
Rebasing (2/3)
expecting success: 
	echo one >one &&
	git add one &&
	git commit -a -m First &&

	git checkout -b branch &&
	echo two >two &&
	echo three >three &&
	echo four >four &&
	echo five >five &&
	git add two three four five &&
	git commit -m Second &&

	git checkout master &&
	echo other >two &&
	echo other >three &&
	echo other >four &&
	echo other >five

ok 5 - remote-tracking branch

# passed all 5 test(s)
1..5
[master bb1ef07] hello /«PKGBUILDDIR»/t/trash directory.t7508-status/.git/COMMIT_EDITMSG
 Author: A U Thor <author@example.com>
[master (root-commit) c4cd1ed] First
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one
Switched to a new branch 'branch'
ok 99 - git commit will commit a staged but ignored submodule

expecting success: 
	git reset HEAD^ &&
	git add sm &&
	cat >expect << EOF &&
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	modified:   sm

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   dir1/modified

Untracked files not listed (use -u option to show untracked files)
EOF
	git commit -uno --dry-run >output &&
	test_i18ncmp expect output &&
	git status -s --ignore-submodules=dirty >output &&
	test_i18ngrep "^M. sm" output

Stopped at 8dcd0d2be09beb748d164d4703c05fdfeb5a7c32... three_edits
Unstaged changes after reset:
M	dir1/modified
M	sm
*** t7610-mergetool.sh ***
[branch e4ea904] Second
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 five
 create mode 100644 four
 create mode 100644 three
 create mode 100644 two
Switched to branch 'master'
ok 1 - setup

You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

expecting success: 
	test_must_fail git merge branch 2>out &&
	test_cmp out expect &&
	git commit --allow-empty -m empty &&
	(
		GIT_MERGE_VERBOSITY=0 &&
		export GIT_MERGE_VERBOSITY &&
		test_must_fail git merge branch 2>out2
	) &&
	test_cmp out2 expect &&
	git reset --hard HEAD^

Updating c4cd1ed..e4ea904
[detached HEAD 017475b] d
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:35:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
[master Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7610-mergetool/.git/
ece74e2] empty
 Author: A U Thor <author@example.com>
expecting success: 
	test_config rerere.enabled true &&
	echo master >file1 &&
	echo master spaced >"spaced name" &&
	echo master file11 >file11 &&
	echo master file12 >file12 &&
	echo master file13 >file13 &&
	echo master file14 >file14 &&
	mkdir subdir &&
	echo master sub >subdir/file3 &&
	test_create_repo submod &&
	(
		cd submod &&
		: >foo &&
		git add foo &&
		git commit -m "Add foo"
	) &&
	git submodule add git://example.com/submod submod &&
	git add file1 "spaced name" file1[1-4] subdir/file3 .gitmodules submod &&
	git commit -m "add initial versions" &&

	git checkout -b branch1 master &&
	git submodule update -N &&
	echo branch1 change >file1 &&
	echo branch1 newfile >file2 &&
	echo branch1 spaced >"spaced name" &&
	echo branch1 both added >both &&
	echo branch1 change file11 >file11 &&
	echo branch1 change file13 >file13 &&
	echo branch1 sub >subdir/file3 &&
	(
		cd submod &&
		echo branch1 submodule >bar &&
		git add bar &&
		git commit -m "Add bar on branch1" &&
		git checkout -b submod-branch1
	) &&
	git add file1 "spaced name" file11 file13 file2 subdir/file3 submod &&
	git add both &&
	git rm file12 &&
	git commit -m "branch1 changes" &&

	git checkout -b stash1 master &&
	echo stash1 change file11 >file11 &&
	git add file11 &&
	git commit -m "stash1 changes" &&

	git checkout -b stash2 master &&
	echo stash2 change file11 >file11 &&
	git add file11 &&
	git commit -m "stash2 changes" &&

	git checkout master &&
	git submodule update -N &&
	echo master updated >file1 &&
	echo master new >file2 &&
	echo master updated spaced >"spaced name" &&
	echo master both added >both &&
	echo master updated file12 >file12 &&
	echo master updated file14 >file14 &&
	echo master new sub >subdir/file3 &&
	(
		cd submod &&
		echo master submodule >bar &&
		git add bar &&
		git commit -m "Add bar on master" &&
		git checkout -b submod-master
	) &&
	git add file1 "spaced name" file12 file14 file2 subdir/file3 submod &&
	git add both &&
	git rm file11 &&
	git commit -m "master updates" &&

	git config merge.tool mytool &&
	git config mergetool.mytool.cmd "cat \"\$REMOTE\" >\"\$MERGED\"" &&
	git config mergetool.mytool.trustExitCode true &&
	git config mergetool.mybase.cmd "cat \"\$BASE\" >\"\$MERGED\"" &&
	git config mergetool.mybase.trustExitCode true

HEAD is now at c4cd1ed First
ok 2 - untracked files overwritten by merge (fast and non-fast forward)

expecting success: 
	git add two &&
	git add three &&
	git add four &&
	test_must_fail git merge branch 2>out &&
	test_cmp out expect

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7610-mergetool/submod/.git/
Updating c4cd1ed..e4ea904
ok 3 - untracked files or local changes ovewritten by merge

[master (root-commit) afb6687] Add foo
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 foo
expecting success: 
	git add five &&
	mkdir rep &&
	echo one >rep/one &&
	echo two >rep/two &&
	git add rep/one rep/two &&
	git commit -m Fourth &&
	git checkout master &&
	echo uno >rep/one &&
	echo dos >rep/two &&
	test_must_fail git checkout branch 2>out &&
	test_cmp out expect

[master 3bd5349] Fourth
 Author: A U Thor <author@example.com>
 6 files changed, 6 insertions(+)
 create mode 100644 five
 create mode 100644 four
 create mode 100644 rep/one
 create mode 100644 rep/two
 create mode 100644 three
 create mode 100644 two
ok 19 - status: (amend first edit) second edit and amend

expecting success: 
	git reset --hard several_edits &&
	FAKE_LINES="edit 1 edit 2 3" &&
	export FAKE_LINES &&
	test_when_finished "git rebase --abort" &&
	COMMIT2=$(git rev-parse --short several_edits^^) &&
	COMMIT3=$(git rev-parse --short several_edits^) &&
	COMMIT4=$(git rev-parse --short several_edits) &&
	ONTO=$(git rev-parse --short HEAD~3) &&
	git rebase -i HEAD~3 &&
	git reset HEAD^ &&
	git add main.txt &&
	git commit -m "e" &&
	git rebase --continue &&
	cat >expected <<EOF &&
interactive rebase in progress; onto $ONTO
Last commands done (2 commands done):
   edit $COMMIT2 two_edits
   edit $COMMIT3 three_edits
Next command to do (1 remaining command):
   pick $COMMIT4 four_edits
  (use "git rebase --edit-todo" to view and edit)
You are currently editing a commit while rebasing branch 'several_edits' on '$ONTO'.
  (use "git commit --amend" to amend the current commit)
  (use "git rebase --continue" once you are satisfied with your changes)

nothing to commit (use -u to show untracked files)
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

HEAD is now at 001318e four_edits
Already on 'master'
ok 4 - cannot switch branches because of local changes

expecting success: 
	git add rep/one rep/two &&
	test_must_fail git checkout branch 2>out &&
	test_cmp out expect

Adding existing repo at 'submod' to the index
M  sm
ok 100 - git commit --dry-run will show a staged but ignored submodule

expecting success: 
	git commit -uno -m message &&
	git status -s --ignore-submodules=dirty >output &&
	 test_i18ngrep ! "^M. sm" output &&
	git config --remove-section submodule.subname &&
	git config -f .gitmodules  --remove-section submodule.subname

ok 5 - not uptodate file porcelain checkout error

expecting success: 
	git init uptodate &&
	cd uptodate &&
	mkdir rep &&
	mkdir rep2 &&
	touch rep/foo &&
	touch rep2/foo &&
	git add rep/foo rep2/foo &&
	git commit -m init &&
	git checkout -b branch &&
	git rm rep -r &&
	git rm rep2 -r &&
	>rep &&
	>rep2 &&
	git add rep rep2&&
	git commit -m "added test as a file" &&
	git checkout master &&
	>rep/untracked-file &&
	>rep2/untracked-file &&
	test_must_fail git checkout branch 2>out &&
	test_cmp out ../expect

[master 36d0558] message
 Author: A U Thor <author@example.com>
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7609-merge-co-error-msgs/uptodate/.git/
ok 101 - git commit -m will commit a staged but ignored submodule

# passed all 101 test(s)
1..101
[master (root-commit) b5416df] init
 Author: A U Thor <author@example.com>
 2 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 rep/foo
 create mode 100644 rep2/foo
[master (root-commit) c0d6d4d] add initial versions
 Author: A U Thor <author@example.com>
 9 files changed, 11 insertions(+)
 create mode 100644 .gitmodules
 create mode 100644 file1
 create mode 100644 file11
 create mode 100644 file12
 create mode 100644 file13
 create mode 100644 file14
 create mode 100644 spaced name
 create mode 100644 subdir/file3
 create mode 160000 submod
Switched to a new branch 'branch'
rm 'rep/foo'
Switched to a new branch 'branch1'
rm 'rep2/foo'
*** t7611-merge-abort.sh ***
[branch a887065] added test as a file
 Author: A U Thor <author@example.com>
 2 files changed, 0 insertions(+), 0 deletions(-)
 rename rep2/foo => rep (100%)
 rename rep/foo => rep2 (100%)
Switched to branch 'master'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7611-merge-abort/.git/
ok 6 - not_uptodate_dir porcelain checkout error

# passed all 6 test(s)
1..6
expecting success: 
	# Create the above repo
	echo foo > foo &&
	echo bar > bar &&
	echo baz > baz &&
	git add foo bar baz &&
	git commit -m initial &&
	echo bazz > baz &&
	git commit -a -m "second" &&
	git checkout -b conflict_branch HEAD^ &&
	echo barf > bar &&
	echo bazf > baz &&
	git commit -a -m "conflict" &&
	git checkout -b clean_branch HEAD^ &&
	echo bart > bar &&
	git commit -a -m "clean" &&
	git checkout master

[master (root-commit) c5a14d9] initial
 Author: A U Thor <author@example.com>
 3 files changed, 3 insertions(+)
 create mode 100644 bar
 create mode 100644 baz
 create mode 100644 foo
*** t7612-merge-verify-signatures.sh ***
[master 20bb527] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'conflict_branch'
[conflict_branch a93d448] conflict
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 2 deletions(-)
[master f1e7973] Add bar on branch1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bar
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7612-merge-verify-signatures/.git/
Switched to a new branch 'clean_branch'
Switched to a new branch 'submod-branch1'
[clean_branch 6280fa2] clean
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to branch 'master'
ok 1 - setup

rm 'file12'
expecting success: 
	test_must_fail git merge --abort 2>output &&
	test_i18ngrep MERGE_HEAD output

fatal: There is no merge to abort (MERGE_HEAD missing).
ok 2 - fails without MERGE_HEAD (unstarted merge)

expecting success: 
	test ! -f .git/MERGE_HEAD &&
	test "$pre_merge_head" = "$(git rev-parse HEAD)"

[branch1 fb5c1b3] branch1 changes
 Author: A U Thor <author@example.com>
 9 files changed, 8 insertions(+), 7 deletions(-)
 create mode 100644 both
 delete mode 100644 file12
 create mode 100644 file2
ok 3 - fails without MERGE_HEAD (unstarted merge): .git/MERGE_HEAD sanity

expecting success: 
	git merge clean_branch &&
	test ! -f .git/MERGE_HEAD &&
	# Merge successfully completed
	post_merge_head="$(git rev-parse HEAD)" &&
	test_must_fail git merge --abort 2>output &&
	test_i18ngrep MERGE_HEAD output

Switched to a new branch 'stash1'
Merging:
20bb527 second
virtual clean_branch
found 1 common ancestor:
c5a14d9 initial
Merge made by the 'recursive' strategy.
M	submod
rebase -i script before editing:
 bar | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
pick 9e0744e two_edits
pick 8dcd0d2 three_edits
pick 001318e four_edits

rebase -i script after editing:
edit 9e0744e two_edits
edit 8dcd0d2 three_edits
pick 001318e four_edits
[stash1 b87aaec] stash1 changes
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
fatal: There is no merge to abort (MERGE_HEAD missing).
ok 4 - fails without MERGE_HEAD (completed merge)

expecting success: 
	test ! -f .git/MERGE_HEAD &&
	test "$post_merge_head" = "$(git rev-parse HEAD)"

ok 5 - fails without MERGE_HEAD (completed merge): .git/MERGE_HEAD sanity

expecting success: 
	git reset --hard "$pre_merge_head"

Switched to a new branch 'stash2'
M	submod
HEAD is now at 20bb527 second
ok 6 - Forget previous merge

expecting success: 
	# Redo merge, but stop before creating merge commit
	git merge --no-commit clean_branch &&
	test -f .git/MERGE_HEAD &&
	# Abort non-conflicting merge
	git merge --abort &&
	test ! -f .git/MERGE_HEAD &&
	test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
	test -z "$(git diff)" &&
	test -z "$(git diff --staged)"

[stash2 77540cc] stash2 changes
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Automatic merge went well; stopped before committing as requested
Merging:
20bb527 second
virtual clean_branch
found 1 common ancestor:
c5a14d9 initial
Switched to branch 'master'
M	submod
ok 7 - Abort after --no-commit

expecting success: 
	# Create conflicting merge
	test_must_fail git merge conflict_branch &&
	test -f .git/MERGE_HEAD &&
	# Abort conflicting merge
	git merge --abort &&
	test ! -f .git/MERGE_HEAD &&
	test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
	test -z "$(git diff)" &&
	test -z "$(git diff --staged)"

Merging:
20bb527 second
virtual conflict_branch
found 1 common ancestor:
c5a14d9 initial
Auto-merging baz
CONFLICT (content): Merge conflict in baz
Automatic merge failed; fix conflicts and then commit the result.
Rebasing (1/3)
expecting success: 
	echo 1 >file && git add file &&
	test_tick && git commit -m initial &&
	git tag initial &&

	git checkout -b side-signed &&
	echo 3 >elif && git add elif &&
	test_tick && git commit -S -m "signed on side" &&
	git checkout initial &&

	git checkout -b side-unsigned &&
	echo 3 >foo && git add foo &&
	test_tick && git commit -m "unsigned on side" &&
	git checkout initial &&

	git checkout -b side-bad &&
	echo 3 >bar && git add bar &&
	test_tick && git commit -S -m "bad on side" &&
	git cat-file commit side-bad >raw &&
	sed -e "s/bad/forged bad/" raw >forged &&
	git hash-object -w -t commit forged >forged.commit &&
	git checkout initial &&

	git checkout -b side-untrusted &&
	echo 3 >baz && git add baz &&
	test_tick && git commit -SB7227189 -m "untrusted on side" &&

	git checkout master

ok 8 - Abort after conflicts

expecting success: 
	echo xyzzy >> foo &&
	git add foo &&
	git diff --staged > expect &&
	test_must_fail git merge clean_branch &&
	test ! -f .git/MERGE_HEAD &&
	test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
	test -z "$(git diff)" &&
	git diff --staged > actual &&
	test_cmp expect actual

Stopped at 9e0744e83c8330e8b23efbca5e7bd9c9ae77f3e7... two_edits
[master (root-commit) 777c62c] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
error: Your local changes to the following files would be overwritten by merge:
	foo
Please, commit your changes or stash them before you can merge.
Aborting
fatal: merging of trees a2e7c2ef82c7194d05cb708830c1e88ce6875f1c and e9abbaa324044e9422619abeda250312320710b3 failed
Merging:
20bb527 second
virtual clean_branch
found 1 common ancestor:
c5a14d9 initial
Switched to a new branch 'side-signed'
You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

ok 9 - Clean merge with dirty index fails

expecting success: 
	test_must_fail git merge conflict_branch &&
	test ! -f .git/MERGE_HEAD &&
	test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
	test -z "$(git diff)" &&
	git diff --staged > actual &&
	test_cmp expect actual

Submodule path 'submod': checked out 'afb668784f9ce325022c99ef8e6bc83cd04278f1'
Unstaged changes after reset:
M	main.txt
error: Your local changes to the following files would be overwritten by merge:
	foo
Please, commit your changes or stash them before you can merge.
Aborting
fatal: merging of trees a2e7c2ef82c7194d05cb708830c1e88ce6875f1c and abea744efbdcab1aeae53d0990d2140bdeb15bd4 failed
Merging:
20bb527 second
virtual conflict_branch
found 1 common ancestor:
c5a14d9 initial
[detached HEAD 9fa4b49] e
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[side-signed c6f75e6] signed on side
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 elif
ok 10 - Conflicting merge with dirty index fails

expecting success: 
	git reset "$pre_merge_head" &&
	git diff > actual &&
	test_cmp expect actual

[detached HEAD 5b592f7] Add bar on master
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bar
Note: checking out 'initial'.

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 777c62c... initial
Switched to a new branch 'submod-master'
Unstaged changes after reset:
M	foo
Switched to a new branch 'side-unsigned'
ok 11 - Reset index (but preserve worktree changes)

expecting success: 
	git merge --no-commit clean_branch &&
	test -f .git/MERGE_HEAD &&
	# Abort merge
	git merge --abort &&
	test ! -f .git/MERGE_HEAD &&
	test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
	test -z "$(git diff --staged)" &&
	git diff > actual &&
	test_cmp expect actual

Automatic merge went well; stopped before committing as requested
Merging:
20bb527 second
virtual clean_branch
found 1 common ancestor:
c5a14d9 initial
[side-unsigned 477db0d] unsigned on side
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
rm 'file11'
Note: checking out 'initial'.

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 777c62c... initial
Switched to a new branch 'side-bad'
[master 48ba24d] master updates
 Author: A U Thor <author@example.com>
 9 files changed, 8 insertions(+), 7 deletions(-)
 create mode 100644 both
 delete mode 100644 file11
 create mode 100644 file2
ok 12 - Abort clean merge with non-conflicting dirty worktree

expecting success: 
	test_must_fail git merge conflict_branch &&
	test -f .git/MERGE_HEAD &&
	# Abort merge
	git merge --abort &&
	test ! -f .git/MERGE_HEAD &&
	test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
	test -z "$(git diff --staged)" &&
	git diff > actual &&
	test_cmp expect actual

Merging:
20bb527 second
virtual conflict_branch
found 1 common ancestor:
c5a14d9 initial
Auto-merging baz
CONFLICT (content): Merge conflict in baz
Automatic merge failed; fix conflicts and then commit the result.
[side-bad 211f90f] bad on side
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bar
ok 1 - setup

expecting success: 
	git checkout -b test1 branch1 &&
	git submodule update -N &&
	test_must_fail git merge master >/dev/null 2>&1 &&
	( yes "" | git mergetool both >/dev/null 2>&1 ) &&
	( yes "" | git mergetool file1 file1 ) &&
	( yes "" | git mergetool file2 "spaced name" >/dev/null 2>&1 ) &&
	( yes "" | git mergetool subdir/file3 >/dev/null 2>&1 ) &&
	( yes "d" | git mergetool file11 >/dev/null 2>&1 ) &&
	( yes "d" | git mergetool file12 >/dev/null 2>&1 ) &&
	( yes "l" | git mergetool submod >/dev/null 2>&1 ) &&
	test "$(cat file1)" = "master updated" &&
	test "$(cat file2)" = "master new" &&
	test "$(cat subdir/file3)" = "master new sub" &&
	test "$(cat submod/bar)" = "branch1 submodule" &&
	git commit -m "branch1 resolved with mergetool"

ok 13 - Abort conflicting merge with non-conflicting dirty worktree

expecting success: 
	git reset --hard "$pre_merge_head"

Switched to a new branch 'test1'
M	submod
Note: checking out 'initial'.

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 777c62c... initial
HEAD is now at 20bb527 second
ok 14 - Reset worktree changes

expecting success: 
	echo xyzzy >> bar &&
	git diff > expect &&
	test_must_fail git merge --no-commit clean_branch &&
	test ! -f .git/MERGE_HEAD &&
	test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
	test -z "$(git diff --staged)" &&
	git diff > actual &&
	test_cmp expect actual

Switched to a new branch 'side-untrusted'
error: Your local changes to the following files would be overwritten by merge:
	bar
Please, commit your changes or stash them before you can merge.
Aborting
fatal: merging of trees a2e7c2ef82c7194d05cb708830c1e88ce6875f1c and e9abbaa324044e9422619abeda250312320710b3 failed
Merging:
20bb527 second
virtual clean_branch
found 1 common ancestor:
c5a14d9 initial
Rebasing (2/3)
ok 15 - Fail clean merge with conflicting dirty worktree

expecting success: 
	test_must_fail git merge conflict_branch &&
	test ! -f .git/MERGE_HEAD &&
	test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
	test -z "$(git diff --staged)" &&
	git diff > actual &&
	test_cmp expect actual

error: Your local changes to the following files would be overwritten by merge:
	bar
Please, commit your changes or stash them before you can merge.
Aborting
fatal: merging of trees a2e7c2ef82c7194d05cb708830c1e88ce6875f1c and abea744efbdcab1aeae53d0990d2140bdeb15bd4 failed
Merging:
20bb527 second
virtual conflict_branch
found 1 common ancestor:
c5a14d9 initial
Stopped at 8dcd0d2be09beb748d164d4703c05fdfeb5a7c32... three_edits
ok 16 - Fail conflicting merge with conflicting dirty worktree

expecting success: 
	git reset --hard "$pre_merge_head"

HEAD is now at 20bb527 second
ok 17 - Reset worktree changes

expecting success: 
	echo bart > bar &&
	git diff > expect &&
	test_must_fail git merge --no-commit clean_branch &&
	test ! -f .git/MERGE_HEAD &&
	test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
	test -z "$(git diff --staged)" &&
	git diff > actual &&
	test_cmp expect actual

[side-untrusted dd86f13] untrusted on side
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 baz
error: Your local changes to the following files would be overwritten by merge:
	bar
Please, commit your changes or stash them before you can merge.
Aborting
fatal: merging of trees a2e7c2ef82c7194d05cb708830c1e88ce6875f1c and e9abbaa324044e9422619abeda250312320710b3 failed
Submodule path 'submod': checked out 'f1e79731463601167179811363c6dab0cdc96e35'
Merging:
20bb527 second
virtual clean_branch
found 1 common ancestor:
c5a14d9 initial
You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

Switched to branch 'master'
ok 1 - create signed commits

expecting success: 
	test_must_fail git merge --ff-only --verify-signatures side-unsigned 2>mergeerror &&
	test_i18ngrep "does not have a GPG signature" mergeerror

ok 18 - Fail clean merge with matching dirty worktree

expecting success: 
	git add bar &&
	git diff --staged > expect &&
	git merge --no-commit clean_branch &&
	test -f .git/MERGE_HEAD &&
	### When aborting the merge, git will discard all staged changes,
	### including those that were staged pre-merge. In other words,
	### --abort will LOSE any staged changes (the staged changes that
	### are lost must match the merge result, or the merge would not
	### have been allowed to start). Change expectations accordingly:
	rm expect &&
	touch expect &&
	# Abort merge
	git merge --abort &&
	test ! -f .git/MERGE_HEAD &&
	test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
	git diff --staged > actual &&
	test_cmp expect actual &&
	test -z "$(git diff)"

fatal: Commit 477db0d does not have a GPG signature.
ok 2 - merge unsigned commit with verification

expecting success: 
	test_must_fail git merge --ff-only --verify-signatures $(cat forged.commit) 2>mergeerror &&
	test_i18ngrep "has a bad GPG signature" mergeerror

Automatic merge went well; stopped before committing as requested
Merging:
20bb527 second
virtual clean_branch
found 1 common ancestor:
c5a14d9 initial
fatal: Commit 3ccf28f has a bad GPG signature allegedly by C O Mitter <committer@example.com>.
ok 3 - merge commit with bad signature with verification

expecting success: 
	test_must_fail git merge --ff-only --verify-signatures side-untrusted 2>mergeerror &&
	test_i18ngrep "has an untrusted GPG signature" mergeerror

fatal: Commit dd86f13 has an untrusted GPG signature, allegedly by Eris Discordia <discord@example.net>.
ok 4 - merge commit with untrusted signature with verification

expecting success: 
	git merge --verbose --ff-only --verify-signatures side-signed >mergeoutput &&
	test_i18ngrep "has a good GPG signature" mergeoutput

ok 19 - Abort clean merge with matching dirty index

expecting success: 
	git reset --hard "$pre_merge_head"

HEAD is now at 20bb527 second
ok 20 - Reset worktree changes

expecting success: 
	echo barf > bar &&
	git diff > expect &&
	test_must_fail git merge conflict_branch &&
	test ! -f .git/MERGE_HEAD &&
	test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
	test -z "$(git diff --staged)" &&
	git diff > actual &&
	test_cmp expect actual

Commit c6f75e6 has a good GPG signature by C O Mitter <committer@example.com>
ok 5 - merge signed commit with verification

error: Your local changes to the following files would be overwritten by merge:
	bar
Please, commit your changes or stash them before you can merge.
Aborting
fatal: merging of trees a2e7c2ef82c7194d05cb708830c1e88ce6875f1c and abea744efbdcab1aeae53d0990d2140bdeb15bd4 failed
Merging:
20bb527 second
virtual conflict_branch
found 1 common ancestor:
c5a14d9 initial
expecting success: 
	git merge $(cat forged.commit)

Merging:
c6f75e6 signed on side
virtual 3ccf28fbd155136202554fbc09d41bab2f38fb53
found 1 common ancestor:
777c62c initial
Merge made by the 'recursive' strategy.
 bar | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 bar
ok 6 - merge commit with bad signature without verification

ok 20 - status: (split first edit) second edit

expecting success: 
	git reset --hard several_edits &&
	FAKE_LINES="edit 1 edit 2 3" &&
	export FAKE_LINES &&
	test_when_finished "git rebase --abort" &&
	COMMIT2=$(git rev-parse --short several_edits^^) &&
	COMMIT3=$(git rev-parse --short several_edits^) &&
	COMMIT4=$(git rev-parse --short several_edits) &&
	ONTO=$(git rev-parse --short HEAD~3) &&
	git rebase -i HEAD~3 &&
	git reset HEAD^ &&
	git add main.txt &&
	git commit --amend -m "f" &&
	git rebase --continue &&
	git reset HEAD^ &&
	cat >expected <<EOF &&
interactive rebase in progress; onto $ONTO
Last commands done (2 commands done):
   edit $COMMIT2 two_edits
   edit $COMMIT3 three_edits
Next command to do (1 remaining command):
   pick $COMMIT4 four_edits
  (use "git rebase --edit-todo" to view and edit)
You are currently splitting a commit while rebasing branch 'several_edits' on '$ONTO'.
  (Once your working directory is clean, run "git rebase --continue")

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   main.txt

no changes added to commit (use "git add" and/or "git commit -a")
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

ok 21 - Fail conflicting merge with matching dirty worktree

expecting success: 
	git add bar &&
	git diff --staged > expect &&
	test_must_fail git merge conflict_branch &&
	test -f .git/MERGE_HEAD &&
	### When aborting the merge, git will discard all staged changes,
	### including those that were staged pre-merge. In other words,
	### --abort will LOSE any staged changes (the staged changes that
	### are lost must match the merge result, or the merge would not
	### have been allowed to start). Change expectations accordingly:
	rm expect &&
	touch expect &&
	# Abort merge
	git merge --abort &&
	test ! -f .git/MERGE_HEAD &&
	test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
	git diff --staged > actual &&
	test_cmp expect actual &&
	test -z "$(git diff)"

# passed all 6 test(s)
1..6
HEAD is now at 001318e four_edits
Merging:
20bb527 second
virtual conflict_branch
found 1 common ancestor:
c5a14d9 initial
Auto-merging baz
CONFLICT (content): Merge conflict in baz
Automatic merge failed; fix conflicts and then commit the result.
*** t7613-merge-submodule.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/.git/
ok 22 - Abort conflicting merge with matching dirty index

expecting success: 
	git reset --hard "$pre_merge_head"

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
		)
	
HEAD is now at 20bb527 second
ok 23 - Reset worktree changes

expecting success: 
	# Pre-merge worktree changes
	echo xyzzy > foo &&
	echo barf > bar &&
	git add bar &&
	git diff > expect &&
	git diff --staged > expect-staged &&
	# Perform merge
	test_must_fail git merge conflict_branch &&
	test -f .git/MERGE_HEAD &&
	# Post-merge worktree changes
	echo yzxxz > foo &&
	echo blech > baz &&
	### When aborting the merge, git will discard staged changes (bar)
	### and unmerged changes (baz). Other changes that are neither
	### staged nor marked as unmerged (foo), will be preserved. For
	### these changed, git cannot tell pre-merge changes apart from
	### post-merge changes, so the post-merge changes will be
	### preserved. Change expectations accordingly:
	git diff -- foo > expect &&
	rm expect-staged &&
	touch expect-staged &&
	# Abort merge
	git merge --abort &&
	test ! -f .git/MERGE_HEAD &&
	test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
	git diff > actual &&
	test_cmp expect actual &&
	git diff --staged > actual-staged &&
	test_cmp expect-staged actual-staged

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.git/
[master (root-commit) 2347eb4] 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
Merging:
20bb527 second
virtual conflict_branch
found 1 common ancestor:
c5a14d9 initial
Auto-merging baz
CONFLICT (content): Merge conflict in baz
Automatic merge failed; fix conflicts and then commit the result.
Switched to a new branch 'add_sub1'
Merging:
file1

ok 24 - Abort merge with pre- and post-merge worktree changes

expecting success: 
	git reset --hard "$pre_merge_head"

HEAD is now at 20bb527 second
ok 25 - Reset worktree changes

expecting success: 
	# Pre-merge worktree changes
	echo xyzzy > foo &&
	echo barf > bar &&
	git add bar &&
	git diff > expect &&
	git diff --staged > expect-staged &&
	# Perform merge
	test_must_fail git merge conflict_branch &&
	test -f .git/MERGE_HEAD &&
	# Post-merge worktree changes
	echo yzxxz > foo &&
	echo blech > baz &&
	git add foo bar &&
	### When aborting the merge, git will discard all staged changes
	### (foo, bar and baz), and no changes will be preserved. Whether
	### the changes were staged pre- or post-merge does not matter
	### (except for not preventing starting the merge).
	### Change expectations accordingly:
	rm expect expect-staged &&
	touch expect &&
	touch expect-staged &&
	# Abort merge
	git merge --abort &&
	test ! -f .git/MERGE_HEAD &&
	test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
	git diff > actual &&
	test_cmp expect actual &&
	git diff --staged > actual-staged &&
	test_cmp expect-staged actual-staged

Merging:
20bb527 second
virtual conflict_branch
found 1 common ancestor:
c5a14d9 initial
Auto-merging baz
CONFLICT (content): Merge conflict in baz
Automatic merge failed; fix conflicts and then commit the result.
Cloning into 'sub1'...
Normal merge conflict for 'file1':
  {local}: modified file
  {remote}: modified file
done.
ok 26 - Abort merge with pre- and post-merge index changes

# passed all 26 test(s)
1..26
*** t7700-repack.sh ***
rebase -i script before editing:
pick 9e0744e two_edits
pick 8dcd0d2 three_edits
pick 001318e four_edits

rebase -i script after editing:
edit 9e0744e two_edits
edit 8dcd0d2 three_edits
pick 001318e four_edits
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7700-repack/.git/
expecting success: 
	echo content1 > file1 &&
	echo content2 > file2 &&
	git add . &&
	test_tick &&
	git commit -m initial_commit &&
	# Create two packs
	# The first pack will contain all of the objects except one
	git rev-list --objects --all | grep -v file2 |
		git pack-objects pack > /dev/null &&
	# The second pack will contain the excluded object
	packsha1=$(git rev-list --objects --all | grep file2 |
		git pack-objects pack) &&
	>pack-$packsha1.keep &&
	objsha1=$(git verify-pack -v pack-$packsha1.idx | head -n 1 |
		sed -e "s/^\([0-9a-f]\{40\}\).*/\1/") &&
	mv pack-* .git/objects/pack/ &&
	git repack -A -d -l &&
	git prune-packed &&
	for p in .git/objects/pack/*.idx; do
		idx=$(basename $p)
		test "pack-$packsha1.idx" = "$idx" && continue
		if git verify-pack -v $p | egrep "^$objsha1"; then
			found_duplicate_object=1
			echo "DUPLICATE OBJECT FOUND"
			break
		fi
	done &&
	test -z "$found_duplicate_object"

[master (root-commit) 3677360] initial_commit
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 file1
 create mode 100644 file2
[add_sub1 7141cca] 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'
Removing sub1
Removing .gitmodules
[remove_sub1 af434d3] 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'
Stopped at 9e0744e83c8330e8b23efbca5e7bd9c9ae77f3e7... two_edits
You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

Rebasing (1/3)
Unstaged changes after reset:
M	main.txt
[detached HEAD eefe3c3] f
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:33:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
From /«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.
   2347eb4..7141cca  add_sub1   -> origin/add_sub1
 * [new branch]      modify_sub1 -> origin/modify_sub1
 * [new branch]      remove_sub1 -> origin/remove_sub1
ok 1 - objects in packs marked .keep are not repacked

expecting success: 
	# build on $objsha1, $packsha1, and .keep state from previous
	git repack -Adbl &&
	test_when_finished "found_duplicate_object=" &&
	for p in .git/objects/pack/*.idx; do
		idx=$(basename $p)
		test "pack-$packsha1.idx" = "$idx" && continue
		if git verify-pack -v $p | egrep "^$objsha1"; then
			found_duplicate_object=1
			echo "DUPLICATE OBJECT FOUND"
			break
		fi
	done &&
	test "$found_duplicate_object" = 1

Switched to a new branch 'modifications'
[modifications 16f35db] modified file2 and added file3
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 file3
To /«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.
 * [new branch]      modifications -> modifications
Rebasing (2/3)
[modify_sub1 ec55a65] Modify sub1
 Author: A U Thor <author@example.com>
637f0347d31dad180d6fc7f6720c187b05a8754c blob   9 18 162
DUPLICATE OBJECT FOUND
ok 2 - writing bitmaps via command-line can duplicate .keep objects

expecting success: 
	# build on $objsha1, $packsha1, and .keep state from previous
	git -c repack.writebitmaps=true repack -Adl &&
	test_when_finished "found_duplicate_object=" &&
	for p in .git/objects/pack/*.idx; do
		idx=$(basename $p)
		test "pack-$packsha1.idx" = "$idx" && continue
		if git verify-pack -v $p | egrep "^$objsha1"; then
			found_duplicate_object=1
			echo "DUPLICATE OBJECT FOUND"
			break
		fi
	done &&
	test "$found_duplicate_object" = 1

Switched to a new branch 'replace_sub1_with_directory'
Stopped at 8dcd0d2be09beb748d164d4703c05fdfeb5a7c32... three_edits
You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

Unstaged changes after reset:
M	main.txt
637f0347d31dad180d6fc7f6720c187b05a8754c blob   9 18 162
DUPLICATE OBJECT FOUND
ok 3 - writing bitmaps via config can duplicate .keep objects

expecting success: 
	mkdir alt_objects &&
	echo `pwd`/alt_objects > .git/objects/info/alternates &&
	echo content3 > file3 &&
	objsha1=$(GIT_OBJECT_DIRECTORY=alt_objects git hash-object -w file3) &&
	git add file3 &&
	test_tick &&
	git commit -m commit_file3 &&
	git repack -a -d -l &&
	git prune-packed &&
	for p in .git/objects/pack/*.idx; do
		if git verify-pack -v $p | egrep "^$objsha1"; then
			found_duplicate_object=1
			echo "DUPLICATE OBJECT FOUND"
			break
		fi
	done &&
	test -z "$found_duplicate_object"

[master 6f105e6] commit_file3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file3
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
Previous HEAD position was 2347eb4... Base
Switched to branch 'modifications'
rm 'sub1'
ok 21 - status: (split first edit) second edit and split

expecting success: 
	git reset --hard several_edits &&
	FAKE_LINES="edit 1 edit 2 3" &&
	export FAKE_LINES &&
	test_when_finished "git rebase --abort" &&
	COMMIT2=$(git rev-parse --short several_edits^^) &&
	COMMIT3=$(git rev-parse --short several_edits^) &&
	COMMIT4=$(git rev-parse --short several_edits) &&
	ONTO=$(git rev-parse --short HEAD~3) &&
	git rebase -i HEAD~3 &&
	git reset HEAD^ &&
	git add main.txt &&
	git commit --amend -m "g" &&
	git rebase --continue &&
	git commit --amend -m "h" &&
	cat >expected <<EOF &&
interactive rebase in progress; onto $ONTO
Last commands done (2 commands done):
   edit $COMMIT2 two_edits
   edit $COMMIT3 three_edits
Next command to do (1 remaining command):
   pick $COMMIT4 four_edits
  (use "git rebase --edit-todo" to view and edit)
You are currently editing a commit while rebasing branch 'several_edits' on '$ONTO'.
  (use "git commit --amend" to amend the current commit)
  (use "git rebase --continue" once you are satisfied with your changes)

nothing to commit (use -u to show untracked files)
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

HEAD is now at 001318e four_edits
[replace_sub1_with_directory 0abcf00] 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
ok 4 - loose objects in alternate ODB are not repacked

expecting success: 
	mkdir alt_objects/pack &&
	mv .git/objects/pack/* alt_objects/pack &&
	git repack -a &&
	myidx=$(ls -1 .git/objects/pack/*.idx) &&
	test -f "$myidx" &&
	for p in alt_objects/pack/*.idx; do
		git verify-pack -v $p | sed -n -e "/^[0-9a-f]\{40\}/p"
	done | while read sha1 rest; do
		if ! ( git verify-pack -v $myidx | grep "^$sha1" ); then
			echo "Missing object in local pack: $sha1"
			return 1
		fi
	done

Switched to a new branch 'replace_directory_with_sub1'
Removing sub1/file3
Removing sub1/file2
Removing sub1/file1
Adding sub1
[replace_directory_with_sub1 ea26008] 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
Switched to a new branch 'replace_sub1_with_file'
rm 'sub1'
[replace_sub1_with_file 3d0ed3b] Replace sub1 with file
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
Switched to a new branch 'replace_file_with_sub1'
[replace_file_with_sub1 aa60ee5] Revert "Replace sub1 with file"
 Author: A U Thor <author@example.com>
 2 files changed, 5 insertions(+), 1 deletion(-)
 mode change 100644 => 160000 sub1
Switched to a new branch 'invalid_sub1'
6f105e6234717c52e9b117b08840926910a68314 commit 224 158 12
[invalid_sub1 2e1f05b] Invalid sub1 commit
 Author: A U Thor <author@example.com>
3677360288c631b6b2e1f0e1f081b1e518605e9f commit 178 132 170
Switched to a new branch 'valid_sub1'
ac3e272b72bbf89def8657766b855d0656630ed4 blob   9 18 302
[valid_sub1 fca299d] Revert "Invalid sub1 commit"
 Author: A U Thor <author@example.com>
97b3ce03d6823ba5c356b4c628dce30bedb81fe0 tree   99 95 356
Switched to branch 'master'
5676a2d9f02138eabe54b0c560a89a5fb2264ec4 tree   4 14 451 1 97b3ce03d6823ba5c356b4c628dce30bedb81fe0
Cloning into 'submodule_update'...
637f0347d31dad180d6fc7f6720c187b05a8754c blob   9 18 320
ok 5 - packed obs in alt ODB are repacked even when local repo is packless

expecting success: 
	rm -f .git/objects/pack/* &&
	echo new_content >> file1 &&
	git add file1 &&
	test_tick &&
	git commit -m more_content &&
	git repack &&
	git repack -a -d &&
	myidx=$(ls -1 .git/objects/pack/*.idx) &&
	test -f "$myidx" &&
	for p in alt_objects/pack/*.idx; do
		git verify-pack -v $p | sed -n -e "/^[0-9a-f]\{40\}/p"
	done | while read sha1 rest; do
		if ! ( git verify-pack -v $myidx | grep "^$sha1" ); then
			echo "Missing object in local pack: $sha1"
			return 1
		fi
	done

done.
[master 7934c82] more_content
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Updating 2347eb4..7141cca
Fast-forward
 .gitmodules | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
rebase -i script before editing:
pick 9e0744e two_edits
pick 8dcd0d2 three_edits
pick 001318e four_edits

rebase -i script after editing:
Recorded resolution for 'both'.
Recorded resolution for 'file1'.
edit 9e0744e two_edits
edit 8dcd0d2 three_edits
pick 001318e four_edits
Recorded resolution for 'file2'.
Recorded resolution for 'spaced name'.
Recorded resolution for 'subdir/file3'.
[test1 4d9a24b] branch1 resolved with mergetool
 Author: A U Thor <author@example.com>
ok 2 - custom mergetool

expecting success: 
	test_config core.autocrlf true &&
	git checkout -b test2 branch1 &&
	test_must_fail git merge master >/dev/null 2>&1 &&
	( yes "" | git mergetool file1 >/dev/null 2>&1 ) &&
	( yes "" | git mergetool file2 >/dev/null 2>&1 ) &&
	( yes "" | git mergetool "spaced name" >/dev/null 2>&1 ) &&
	( yes "" | git mergetool both >/dev/null 2>&1 ) &&
	( yes "" | git mergetool subdir/file3 >/dev/null 2>&1 ) &&
	( yes "d" | git mergetool file11 >/dev/null 2>&1 ) &&
	( yes "d" | git mergetool file12 >/dev/null 2>&1 ) &&
	( yes "r" | git mergetool submod >/dev/null 2>&1 ) &&
	test "$(printf x | cat file1 -)" = "$(printf "master updated\r\nx")" &&
	test "$(printf x | cat file2 -)" = "$(printf "master new\r\nx")" &&
	test "$(printf x | cat subdir/file3 -)" = "$(printf "master new sub\r\nx")" &&
	git submodule update -N &&
	test "$(cat submod/bar)" = "master submodule" &&
	git commit -m "branch1 resolved with mergetool - autocrlf" &&
	test_config core.autocrlf false &&
	git reset --hard

Switched to a new branch 'test2'
6f105e6234717c52e9b117b08840926910a68314 commit 224 158 172
3677360288c631b6b2e1f0e1f081b1e518605e9f commit 178 132 330
ac3e272b72bbf89def8657766b855d0656630ed4 blob   9 18 715
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
97b3ce03d6823ba5c356b4c628dce30bedb81fe0 tree   99 95 620
5676a2d9f02138eabe54b0c560a89a5fb2264ec4 tree   4 14 733 1 97b3ce03d6823ba5c356b4c628dce30bedb81fe0
Rebasing (1/3)
637f0347d31dad180d6fc7f6720c187b05a8754c blob   9 18 488
ok 6 - packed obs in alt ODB are repacked when local repo has packs

expecting success: 
	# swap the .keep so the commit object is in the pack with .keep
	for p in alt_objects/pack/*.pack
	do
		base_name=$(basename $p .pack) &&
		if test -f alt_objects/pack/$base_name.keep
		then
			rm alt_objects/pack/$base_name.keep
		else
			touch alt_objects/pack/$base_name.keep
		fi
	done &&
	git repack -a -d &&
	myidx=$(ls -1 .git/objects/pack/*.idx) &&
	test -f "$myidx" &&
	for p in alt_objects/pack/*.idx; do
		git verify-pack -v $p | sed -n -e "/^[0-9a-f]\{40\}/p"
	done | while read sha1 rest; do
		if ! ( git verify-pack -v $myidx | grep "^$sha1" ); then
			echo "Missing object in local pack: $sha1"
			return 1
		fi
	done

Stopped at 9e0744e83c8330e8b23efbca5e7bd9c9ae77f3e7... two_edits
Cloning into 'sub1'...
You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

done.
Unstaged changes after reset:
M	main.txt
[detached HEAD b480d38] g
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:33:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
6f105e6234717c52e9b117b08840926910a68314 commit 224 158 172
3677360288c631b6b2e1f0e1f081b1e518605e9f commit 178 132 330
ac3e272b72bbf89def8657766b855d0656630ed4 blob   9 18 715
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
97b3ce03d6823ba5c356b4c628dce30bedb81fe0 tree   99 95 620
5676a2d9f02138eabe54b0c560a89a5fb2264ec4 tree   4 14 733 1 97b3ce03d6823ba5c356b4c628dce30bedb81fe0
637f0347d31dad180d6fc7f6720c187b05a8754c blob   9 18 488
ok 7 - packed obs in alternate ODB kept pack are repacked

expecting success: 
	rm -f alt_objects/pack/*.keep &&
	mv .git/objects/pack/* alt_objects/pack/ &&
	csha1=$(git rev-parse HEAD^{commit}) &&
	git reset --hard HEAD^ &&
	test_tick &&
	git reflog expire --expire=$test_tick --expire-unreachable=$test_tick --all &&
	# The pack-objects call on the next line is equivalent to
	# git repack -A -d without the call to prune-packed
	git pack-objects --honor-pack-keep --non-empty --all --reflog \
	    --unpack-unreachable </dev/null pack &&
	rm -f .git/objects/pack/* &&
	mv pack-* .git/objects/pack/ &&
	test 0 = $(git verify-pack -v -- .git/objects/pack/*.idx |
		egrep "^$csha1 " | sort | uniq | wc -l) &&
	echo > .git/objects/info/alternates &&
	test_must_fail git show $csha1

ok 1 - git merge: 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
		)
	
HEAD is now at 6f105e6 commit_file3
Cloning into 'submodule_update'...
Rebasing (2/3)
85f93d7925f6a606964869128f786c6de753b60c
done.
fatal: bad object 7934c8297cda0727689031949f840002f9b651ef
ok 8 - packed unreachable obs in alternate ODB are not loosened

expecting success: 
	echo `pwd`/alt_objects > .git/objects/info/alternates &&
	echo "$csha1" | git pack-objects --non-empty --all --reflog pack &&
	rm -f .git/objects/pack/* &&
	mv pack-* .git/objects/pack/ &&
	# The pack-objects call on the next line is equivalent to
	# git repack -A -d without the call to prune-packed
	git pack-objects --honor-pack-keep --non-empty --all --reflog \
	    --unpack-unreachable </dev/null pack &&
	rm -f .git/objects/pack/* &&
	mv pack-* .git/objects/pack/ &&
	test 0 = $(git verify-pack -v -- .git/objects/pack/*.idx |
		egrep "^$csha1 " | sort | uniq | wc -l) &&
	echo > .git/objects/info/alternates &&
	test_must_fail git show $csha1

Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Stopped at 8dcd0d2be09beb748d164d4703c05fdfeb5a7c32... three_edits
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Updating 2347eb4..7141cca
Fast-forward
 .gitmodules | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

[detached HEAD 29f1f82] h
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:35:13 2005 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
8487d25eb1b4a03fc88368df42f5e4942fddaa8d
85f93d7925f6a606964869128f786c6de753b60c
fatal: bad object 7934c8297cda0727689031949f840002f9b651ef
ok 9 - local packed unreachable obs that exist in alternate ODB are not loosened

expecting success: 
	test_tick &&
	git commit --allow-empty -m "commit 4" &&
	H0=$(git rev-parse HEAD) &&
	H1=$(git rev-parse HEAD^) &&
	H2=$(git rev-parse HEAD^^) &&
	echo "$H0 $H2" > .git/info/grafts &&
	git reflog expire --expire=$test_tick --expire-unreachable=$test_tick --all &&
	git repack -a -d &&
	git cat-file -t $H1
	
ok 22 - status: (split first edit) second edit and amend

expecting success: 
	git reset --hard master &&
	git checkout -b am_session &&
	test_commit one_am one.txt "one" &&
	test_commit two_am two.txt "two" &&
	test_commit three_am three.txt "three"

[master 818d068] commit 4
 Author: A U Thor <author@example.com>
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
HEAD is now at 88a81b6 on_master
Switched to a new branch 'am_session'
[am_session ee8f61a] one_am
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 one.txt
[am_session a3cfe42] two_am
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 two.txt
Cloning into 'sub1'...
done.
[am_session 70a2e7d] three_am
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 three.txt
ok 23 - prepare am_session

expecting success: 
	git checkout -b am_already_exists &&
	test_when_finished "rm Maildir/* && git am --abort" &&
	git format-patch -1 -oMaildir &&
	test_must_fail git am Maildir/*.patch &&
	cat >expected <<\EOF &&
On branch am_already_exists
You are in the middle of an am session.
  (fix conflicts and then run "git am --continue")
  (use "git am --skip" to skip this patch)
  (use "git am --abort" to restore the original branch)

nothing to commit (use -u to show untracked files)
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

commit
ok 10 - objects made unreachable by grafts only are kept

Switched to a new branch 'am_already_exists'
# passed all 10 test(s)
1..10
Maildir/0001-three_am.patch
Applying: three_am
*** t7701-repack-unpack-unreachable.sh ***
error: three.txt: already exists in index
Patch failed at 0001 three_am
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
ok 24 - status in an am session: file already exists

expecting success: 
	git reset --hard am_session &&
	git checkout -b am_not_exists &&
	git rm three.txt &&
	git commit -m "delete three.txt" &&
	test_when_finished "rm Maildir/* && git am --abort" &&
	git format-patch -1 -oMaildir &&
	test_must_fail git am Maildir/*.patch &&
	cat >expected <<\EOF &&
On branch am_not_exists
You are in the middle of an am session.
  (fix conflicts and then run "git am --continue")
  (use "git am --skip" to skip this patch)
  (use "git am --abort" to restore the original branch)

nothing to commit (use -u to show untracked files)
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7701-repack-unpack-unreachable/.git/
HEAD is now at 70a2e7d three_am
expecting success: 
	echo content > file1 &&
	git add . &&
	test_tick &&
	git commit -m initial_commit &&
	# create a transient branch with unique content
	git checkout -b transient_branch &&
	echo more content >> file1 &&
	# record the objects created in the database for file, commit, tree
	fsha1=$(git hash-object file1) &&
	test_tick &&
	git commit -a -m more_content &&
	csha1=$(git rev-parse HEAD^{commit}) &&
	tsha1=$(git rev-parse HEAD^{tree}) &&
	git checkout master &&
	echo even more content >> file1 &&
	test_tick &&
	git commit -a -m even_more_content &&
	# delete the transient branch
	git branch -D transient_branch &&
	# pack the repo
	git repack -A -d -l &&
	# verify objects are packed in repository
	test 3 = $(git verify-pack -v -- .git/objects/pack/*.idx |
		   egrep "^($fsha1|$csha1|$tsha1) " |
		   sort | uniq | wc -l) &&
	git show $fsha1 &&
	git show $csha1 &&
	git show $tsha1 &&
	# now expire the reflog, while keeping reachable ones but expiring
	# unreachables immediately
	test_tick &&
	sometimeago=$(( $test_tick - 10000 )) &&
	git reflog expire --expire=$sometimeago --expire-unreachable=$test_tick --all &&
	# and repack
	git repack -A -d -l &&
	# verify objects are retained unpacked
	test 0 = $(git verify-pack -v -- .git/objects/pack/*.idx |
		   egrep "^($fsha1|$csha1|$tsha1) " |
		   sort | uniq | wc -l) &&
	git show $fsha1 &&
	git show $csha1 &&
	git show $tsha1

Switched to a new branch 'am_not_exists'
rm 'three.txt'
[am_not_exists e3aff3f] delete three.txt
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 three.txt
[master (root-commit) 5236a77] initial_commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file1
Maildir/0001-delete-three.txt.patch
Switched to a new branch 'transient_branch'
Applying: delete three.txt
ok 2 - git merge: 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
		)
	
error: three.txt: does not exist in index
Patch failed at 0001 delete three.txt
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
[transient_branch 24d3dd6] more_content
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Switched to branch 'master'
ok 25 - status in an am session: file does not exist

expecting success: 
	git reset --hard am_session &&
	git checkout -b am_empty &&
	test_when_finished "rm Maildir/* && git am --abort" &&
	git format-patch -3 -oMaildir &&
	git rm one.txt two.txt three.txt &&
	git commit -m "delete all am_empty" &&
	echo error >Maildir/0002-two_am.patch &&
	test_must_fail git am Maildir/*.patch &&
	cat >expected <<\EOF &&
On branch am_empty
You are in the middle of an am session.
The current patch is empty.
  (use "git am --skip" to skip this patch)
  (use "git am --abort" to restore the original branch)

nothing to commit (use -u to show untracked files)
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

[master 934cb86] even_more_content
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
HEAD is now at 70a2e7d three_am
Deleted branch transient_branch (was 24d3dd6).
Cloning into 'submodule_update'...
Switched to a new branch 'am_empty'
Maildir/0001-one_am.patch
Maildir/0002-two_am.patch
Maildir/0003-three_am.patch
done.
rm 'one.txt'
rm 'three.txt'
rm 'two.txt'
[am_empty aa8028c] delete all am_empty
 Author: A U Thor <author@example.com>
 3 files changed, 3 deletions(-)
 delete mode 100644 one.txt
 delete mode 100644 three.txt
 delete mode 100644 two.txt
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Applying: one_am
Patch is empty. Was it split wrong?
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Branch add_sub1 set up to track remote branch add_sub1 from origin.
error: The following untracked working tree files would be overwritten by merge:
	sub1
Please move or remove them before you can merge.
Aborting
Updating 2347eb4..7141cca
ok 26 - status in an am session: empty patch

expecting success: 
	git reset --hard master &&
	git checkout -b bisect &&
	test_commit one_bisect main.txt one &&
	test_commit two_bisect main.txt two &&
	test_commit three_bisect main.txt three &&
	test_when_finished "git bisect reset" &&
	git bisect start &&
	git bisect bad &&
	git bisect good one_bisect &&
	TGT=$(git rev-parse --short two_bisect) &&
	cat >expected <<EOF &&
HEAD detached at $TGT
You are currently bisecting, started from branch 'bisect'.
  (use "git bisect reset" to get back to the original branch)

nothing to commit (use -u to show untracked files)
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

ok 3 - git merge: 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
		)
	
content
more content
HEAD is now at 88a81b6 on_master
commit 24d3dd69fb58e8ee7cf49dd5cf55ba09486cf335
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:14:13 2005 -0700

    more_content

diff --git a/file1 b/file1
index d95f3ad..86436d0 100644
--- a/file1
+++ b/file1
@@ -1 +1,2 @@
 content
+more content
tree 23dcdce1632612f22c2c58e14a653890ee9cb0aa

file1
Switched to a new branch 'bisect'
Cloning into 'submodule_update'...
[bisect ce51c44] one_bisect
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
done.
[bisect b1063d2] two_bisect
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
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.
[bisect 08507a3] three_bisect
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
t7613-merge-submodule.sh: 159: cd: can't cd to sub1
Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
Updating 3d0ed3b..aa60ee5
Fast-forward
content
more content
 .gitmodules | 4 ++++
 sub1        | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)
 mode change 100644 => 160000 sub1
commit 24d3dd69fb58e8ee7cf49dd5cf55ba09486cf335
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:14:13 2005 -0700

    more_content

diff --git a/file1 b/file1
index d95f3ad..86436d0 100644
--- a/file1
+++ b/file1
@@ -1 +1,2 @@
 content
+more content
tree 23dcdce1632612f22c2c58e14a653890ee9cb0aa

file1
ok 1 - -A with -d option leaves unreachable objects unpacked

expecting success: 
	fsha1path=$(echo "$fsha1" | sed -e "s|\(..\)|\1/|") &&
	fsha1path=".git/objects/$fsha1path" &&
	csha1path=$(echo "$csha1" | sed -e "s|\(..\)|\1/|") &&
	csha1path=".git/objects/$csha1path" &&
	tsha1path=$(echo "$tsha1" | sed -e "s|\(..\)|\1/|") &&
	tsha1path=".git/objects/$tsha1path" &&
	git branch transient_branch $csha1 &&
	git repack -a -d -l &&
	test ! -f "$fsha1path" &&
	test ! -f "$csha1path" &&
	test ! -f "$tsha1path" &&
	test 1 = $(ls -1 .git/objects/pack/pack-*.pack | wc -l) &&
	packfile=$(ls .git/objects/pack/pack-*.pack) &&
	git branch -D transient_branch &&
	test_tick &&
	git repack -A -l &&
	test ! -f "$fsha1path" &&
	test ! -f "$csha1path" &&
	test ! -f "$tsha1path" &&
	git show $fsha1 &&
	git show $csha1 &&
	git show $tsha1

Deleted branch transient_branch (was 24d3dd6).
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
content
more content
commit 24d3dd69fb58e8ee7cf49dd5cf55ba09486cf335
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:14:13 2005 -0700

    more_content

diff --git a/file1 b/file1
index d95f3ad..86436d0 100644
--- a/file1
+++ b/file1
@@ -1 +1,2 @@
 content
+more content
tree 23dcdce1632612f22c2c58e14a653890ee9cb0aa

file1
ok 2 - -A without -d option leaves unreachable objects packed

expecting success: 
	tmppack=".git/objects/pack/tmp_pack" &&
	ln "$packfile" "$tmppack" &&
	git repack -A -l -d &&
	test-chmtime -v +0 "$tmppack" "$fsha1path" "$csha1path" "$tsha1path" \
		> mtimes &&
	compare_mtimes < mtimes

Cloning into 'sub1'...
Bisecting: 0 revisions left to test after this (roughly 0 steps)
done.
[b1063d2ed3a5cdbe76f3e35ac1d51ba19492d873] two_bisect
ok 3 - unpacked objects receive timestamp of pack file

expecting success: 
	obj1=$(echo one | git hash-object -w --stdin) &&
	obj2=$(echo two | git hash-object -w --stdin) &&
	pack1=$(echo $obj1 | git pack-objects .git/objects/pack/pack) &&
	pack2=$(echo $obj2 | git pack-objects .git/objects/pack/pack) &&
	git prune-packed &&
	git cat-file -p $obj1 &&
	git cat-file -p $obj2 &&
	test-chmtime =-86400 .git/objects/pack/pack-$pack2.pack &&
	git repack -A -d --unpack-unreachable=1.hour.ago &&
	git cat-file -p $obj1 &&
	test_must_fail git cat-file -p $obj2

Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
Previous HEAD position was b1063d2... two_bisect
Switched to branch 'bisect'
ok 27 - status when bisecting

expecting success: 
	git reset --hard master &&
	git checkout -b statushints_disabled &&
	test_when_finished "git config --local advice.statushints true" &&
	git config --local advice.statushints false &&
	test_commit one_statushints main.txt one &&
	test_commit two_statushints main.txt two &&
	test_commit three_statushints main.txt three &&
	test_when_finished "git rebase --abort" &&
	ONTO=$(git rev-parse --short HEAD^^) &&
	test_must_fail git rebase HEAD^ --onto HEAD^^ &&
	cat >expected <<EOF &&
rebase in progress; onto $ONTO
You are currently rebasing branch 'statushints_disabled' on '$ONTO'.

Unmerged paths:
	both modified:   main.txt

no changes added to commit
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

HEAD is now at 88a81b6 on_master
Switched to a new branch 'statushints_disabled'
ok 4 - git merge: 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
		)
	
one
two
[statushints_disabled 1d51a61] one_statushints
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Submodule path 'submod': checked out '5b592f796c80b49a0e8916069c72cb3527ae3597'
[statushints_disabled b391cf9] two_statushints
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Cloning into 'submodule_update'...
Recorded resolution for 'both'.
Recorded resolution for 'file1'.
Recorded resolution for 'file2'.
Recorded resolution for 'spaced name'.
Recorded resolution for 'subdir/file3'.
[test2 fc4f376] branch1 resolved with mergetool - autocrlf
 Author: A U Thor <author@example.com>
[statushints_disabled 085a49e] three_statushints
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
HEAD is now at fc4f376 branch1 resolved with mergetool - autocrlf
done.
ok 3 - mergetool crlf

expecting success: 
	git checkout -b test3 branch1 &&
	git submodule update -N &&
	(
		cd subdir &&
		test_must_fail git merge master >/dev/null 2>&1 &&
		( yes "" | git mergetool file3 >/dev/null 2>&1 ) &&
		test "$(cat file3)" = "master new sub"
	)

one
fatal: Not a valid object name f719efd430d52bcfc8566a43b2eb655688d38871
ok 4 - do not bother loosening old objects

expecting success: 
	echo my-unique-content >file &&
	git add file &&
	git commit -m "make it reachable" &&
	git gc &&
	git reset HEAD^ &&
	git reflog expire --expire=now --all &&
	git add file &&
	test-chmtime =-86400 .git/objects/pack/* &&
	git gc --prune=1.hour.ago &&
	git cat-file blob :file

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.
Switched to a new branch 'test3'
M	submod
[master 73784a1] make it reachable
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
error: 8ed2e6719f8484ce01fa3ce133fe42d25c2441b8^{commit}: expected commit type, but the object dereferences to tree type
fatal: Needed a single revision
Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
Updating 0abcf00..ea26008
Fast-forward
 .gitmodules | 4 ++++
 sub1/file1  | 1 -
 sub1/file2  | 1 -
 sub1/file3  | 1 -
 4 files changed, 4 insertions(+), 3 deletions(-)
 delete mode 100644 sub1/file1
 delete mode 100644 sub1/file2
 delete mode 100644 sub1/file3
First, rewinding head to replay your work on top of it...
Submodule path 'submod': checked out 'f1e79731463601167179811363c6dab0cdc96e35'
Applying: three_statushints
Using index info to reconstruct a base tree...
M	main.txt
Falling back to patching base and 3-way merge...
Merging 1d51a61d07671b18820720aa57e7b7001ed23c9e with three_statushints
Merging:
1d51a61 one_statushints
virtual three_statushints
found 1 common ancestor:
virtual 022b39ca39aa226018ccf5f8138fd73f11c73790
Auto-merging main.txt
CONFLICT (content): Merge conflict in main.txt
error: Failed to merge in the changes.
Patch failed at 0001 three_statushints
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'sub1'...
ok 28 - status when rebase conflicts with statushints disabled

expecting success: 
	git reset --hard master &&
	git checkout -b cherry_branch &&
	test_commit one_cherry main.txt one &&
	test_commit two_cherries main.txt two &&
	git checkout -b cherry_branch_second &&
	test_commit second_cherry main.txt second &&
	git checkout cherry_branch &&
	test_commit three_cherries main.txt three

my-unique-content
ok 5 - keep packed objects found only in index

HEAD is now at 88a81b6 on_master
done.
# passed all 5 test(s)
1..5
Switched to a new branch 'cherry_branch'
*** t7702-repack-cyclic-alternate.sh ***
[cherry_branch 4f22d72] one_cherry
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[cherry_branch c9c98f1] two_cherries
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'cherry_branch_second'
ok 4 - mergetool in subdir

expecting success: 
	(
		cd subdir &&
		( yes "" | git mergetool ../file1 >/dev/null 2>&1 ) &&
		( yes "" | git mergetool ../file2 ../spaced\ name >/dev/null 2>&1 ) &&
		( yes "" | git mergetool ../both >/dev/null 2>&1 ) &&
		( yes "d" | git mergetool ../file11 >/dev/null 2>&1 ) &&
		( yes "d" | git mergetool ../file12 >/dev/null 2>&1 ) &&
		( yes "l" | git mergetool ../submod >/dev/null 2>&1 ) &&
		test "$(cat ../file1)" = "master updated" &&
		test "$(cat ../file2)" = "master new" &&
		test "$(cat ../submod/bar)" = "branch1 submodule" &&
		git commit -m "branch1 resolved with mergetool - subdir"
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7702-repack-cyclic-alternate/.git/
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
[cherry_branch_second 7a516ff] second_cherry
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
expecting success: 
	GIT_OBJECT_DIRECTORY=.git//../.git/objects &&
	export GIT_OBJECT_DIRECTORY &&
	touch a &&
	git add a &&
	git commit -m 1 &&
	git repack -adl &&
	echo "$(pwd)"/.git/objects/../objects >.git/objects/info/alternates

Switched to branch 'cherry_branch'
[cherry_branch dece170] three_cherries
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[master (root-commit) 5a9332d] 1
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 a
ok 29 - prepare for cherry-pick conflicts

expecting success: 
	test_when_finished "git cherry-pick --abort" &&
	test_must_fail git cherry-pick cherry_branch_second &&
	TO_CHERRY_PICK=$(git rev-parse --short CHERRY_PICK_HEAD) &&
	cat >expected <<EOF &&
On branch cherry_branch
You are currently cherry-picking commit $TO_CHERRY_PICK.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)

	both modified:   main.txt

no changes added to commit (use "git add" and/or "git commit -a")
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

error: could not apply 7a516ff... second_cherry
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging main.txt
CONFLICT (content): Merge conflict in main.txt
ok 5 - git merge: 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
		)
	
ok 30 - status when cherry-picking before resolving conflicts

expecting success: 
	git reset --hard cherry_branch &&
	test_when_finished "git cherry-pick --abort" &&
	test_must_fail git cherry-pick cherry_branch_second &&
	TO_CHERRY_PICK=$(git rev-parse --short CHERRY_PICK_HEAD) &&
	echo end >main.txt &&
	git add main.txt &&
	cat >expected <<EOF &&
On branch cherry_branch
You are currently cherry-picking commit $TO_CHERRY_PICK.
  (all conflicts fixed: run "git cherry-pick --continue")
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:

	modified:   main.txt

Untracked files not listed (use -u option to show untracked files)
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

ok 1 - setup

expecting success: 
	git repack -adl &&
	git fsck

HEAD is now at dece170 three_cherries
error: could not apply 7a516ff... second_cherry
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging main.txt
CONFLICT (content): Merge conflict in main.txt
Cloning into 'submodule_update'...
done.
ok 31 - status when cherry-picking after resolving conflicts

expecting success: 
	test_commit atag tagging &&
	git checkout atag &&
	cat >expected <<\EOF &&
HEAD detached at atag
nothing to commit (use -u to show untracked files)
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual &&

	git reset --hard HEAD^ &&
	cat >expected <<\EOF &&
HEAD detached from atag
nothing to commit (use -u to show untracked files)
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

ok 2 - re-packing repository with itsself as alternate

# passed all 2 test(s)
1..2
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
[cherry_branch 7c0e44d] atag
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 tagging
*** t7800-difftool.sh ***
Note: checking out 'atag'.

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 7c0e44d... atag
HEAD is now at dece170 three_cherries
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7800-difftool/.git/
ok 32 - status showing detached at and from a tag

expecting success: 
	git checkout master &&
	echo before >to-revert.txt &&
	test_commit before to-revert.txt &&
	echo old >to-revert.txt &&
	test_commit old to-revert.txt &&
	echo new >to-revert.txt &&
	test_commit new to-revert.txt &&
	TO_REVERT=$(git rev-parse --short HEAD^) &&
	test_must_fail git revert $TO_REVERT &&
	cat >expected <<EOF &&
On branch master
You are currently reverting commit $TO_REVERT.
  (fix conflicts and run "git revert --continue")
  (use "git revert --abort" to cancel the revert operation)

Unmerged paths:
  (use "git reset HEAD <file>..." to unstage)
  (use "git add <file>..." to mark resolution)

	both modified:   to-revert.txt

no changes added to commit (use "git add" and/or "git commit -a")
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

expecting success: 
	echo master >file &&
	git add file &&
	git commit -m "added file" &&

	git checkout -b branch master &&
	echo branch >file &&
	git commit -a -m "branch changed file" &&
	git checkout master

Previous HEAD position was dece170... three_cherries
Switched to branch 'master'
[master (root-commit) afa4e6f] added file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
[master 9bdd889] before
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 to-revert.txt
Switched to a new branch 'branch'
[master 0caa53c] old
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[branch a9b4e12] branch changed file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to branch 'master'
ok 1 - setup

expecting success: 
	difftool_test_setup &&
	test_config difftool.test-tool.cmd "cat \"\$REMOTE\"" &&
	echo master >expect &&
	git difftool --no-prompt branch >actual &&
	test_cmp expect actual &&

	test_config difftool.test-tool.cmd "cat \"\$LOCAL\"" &&
	echo branch >expect &&
	git difftool --no-prompt branch >actual &&
	test_cmp expect actual

[master af625b4] new
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
error: could not revert 0caa53c... old
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging to-revert.txt
CONFLICT (content): Merge conflict in to-revert.txt
ok 33 - status while reverting commit (conflicts)

expecting success: 
	echo reverted >to-revert.txt &&
	git add to-revert.txt &&
	cat >expected <<EOF &&
On branch master
You are currently reverting commit $TO_REVERT.
  (all conflicts fixed: run "git revert --continue")
  (use "git revert --abort" to cancel the revert operation)

Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	modified:   to-revert.txt

Untracked files not listed (use -u option to show untracked files)
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

ok 34 - status while reverting commit (conflicts resolved)

expecting success: 
	git revert --continue &&
	cat >expected <<\EOF &&
On branch master
nothing to commit (use -u to show untracked files)
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

Cloning into 'sub1'...
[master 6a029c7] Revert "old"
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 35 - status after reverting commit

expecting success: 
	git reset --hard master &&
	git checkout -b several_commits &&
	test_commit one_commit main.txt one &&
	test_commit two_commit main.txt two &&
	test_commit three_commit main.txt three &&
	test_commit four_commit main.txt four

done.
HEAD is now at 6a029c7 Revert "old"
Switched to a new branch 'several_commits'
[several_commits ad8fc94] one_commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[several_commits d6d14d5] two_commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
[several_commits 5c7f1ad] three_commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[several_commits 3ecd625] four_commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
ok 36 - prepare for different number of commits rebased

expecting success: 
	FAKE_LINES="exec_exit_15" &&
	export FAKE_LINES &&
	test_when_finished "git rebase --abort" &&
	ONTO=$(git rev-parse --short HEAD~3) &&
	test_must_fail git rebase -i HEAD~3 &&
	cat >expected <<EOF &&
interactive rebase in progress; onto $ONTO
Last command done (1 command done):
   exec exit 15
No commands remaining.
You are currently editing a commit while rebasing branch 'several_commits' on '$ONTO'.
  (use "git commit --amend" to amend the current commit)
  (use "git rebase --continue" once you are satisfied with your changes)

nothing to commit (use -u to show untracked files)
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

warning: unable to rmdir sub1: Directory not empty
Updating 7141cca..af434d3
Fast-forward
 .gitmodules | 4 ----
 1 file changed, 4 deletions(-)
 delete mode 100644 .gitmodules
ok 6 - git merge: 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
		)
	
Cloning into 'submodule_update'...
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
rebase -i script before editing:
pick d6d14d5 two_commit
pick 5c7f1ad three_commit
pick 3ecd625 four_commit

rebase -i script after editing:
exec exit 15
Cloning into 'sub1'...
Rebasing (1/1)
Executing: exit 15
done.
Execution failed: exit 15
You can fix the problem, and then run

	git rebase --continue

Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
ok 37 - status: one command done nothing remaining

expecting success: 
	FAKE_LINES="1 > exec_exit_15  2 3" &&
	export FAKE_LINES &&
	test_when_finished "git rebase --abort" &&
	ONTO=$(git rev-parse --short HEAD~3) &&
	COMMIT4=$(git rev-parse --short HEAD) &&
	COMMIT3=$(git rev-parse --short HEAD^) &&
	COMMIT2=$(git rev-parse --short HEAD^^) &&
	test_must_fail git rebase -i HEAD~3 &&
	cat >expected <<EOF &&
interactive rebase in progress; onto $ONTO
Last commands done (2 commands done):
   pick $COMMIT2 two_commit
   exec exit 15
Next commands to do (2 remaining commands):
   pick $COMMIT3 three_commit
   pick $COMMIT4 four_commit
  (use "git rebase --edit-todo" to view and edit)
You are currently editing a commit while rebasing branch 'several_commits' on '$ONTO'.
  (use "git commit --amend" to amend the current commit)
  (use "git rebase --continue" once you are satisfied with your changes)

nothing to commit (use -u to show untracked files)
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

warning: unable to rmdir sub1: Directory not empty
Updating 7141cca..af434d3
Fast-forward
 .gitmodules | 4 ----
 1 file changed, 4 deletions(-)
 delete mode 100644 .gitmodules
ok 2 - custom commands

expecting success: 
	test_config difftool.vimdiff.cmd "cat \"\$REMOTE\"" &&
	echo master >expect &&
	git difftool --tool vimdiff --no-prompt branch >actual &&
	test_cmp expect actual

ok 7 - git merge: 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
		)
	
[test3 64f8fd4] branch1 resolved with mergetool - subdir
 Author: A U Thor <author@example.com>
ok 5 - mergetool on file in parent dir

expecting success: 
	git checkout -b test4 branch1 &&
	git submodule update -N &&
	test_must_fail git merge master &&
	test -n "$(git ls-files -u)" &&
	( yes "d" | git mergetool file11 >/dev/null 2>&1 ) &&
	( yes "d" | git mergetool file12 >/dev/null 2>&1 ) &&
	( yes "l" | git mergetool submod >/dev/null 2>&1 ) &&
	output="$(git mergetool --no-prompt)" &&
	test "$output" = "No files need merging" &&
	git reset --hard

Switched to a new branch 'test4'
Cloning into 'submodule_update'...
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
rebase -i script before editing:
pick d6d14d5 two_commit
pick 5c7f1ad three_commit
pick 3ecd625 four_commit

rebase -i script after editing:
pick d6d14d5 two_commit

exec exit 15
pick 5c7f1ad three_commit
pick 3ecd625 four_commit
warning: Failed to merge submodule submod (merge following commits not found)
Merging:
fb5c1b3 branch1 changes
virtual master
found 1 common ancestor:
c0d6d4d add initial versions
Auto-merging submod
CONFLICT (submodule): Merge conflict in submod
Auto-merging subdir/file3
CONFLICT (content): Merge conflict in subdir/file3
Auto-merging spaced name
CONFLICT (content): Merge conflict in spaced name
Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
CONFLICT (modify/delete): file12 deleted in HEAD and modified in master. Version master of file12 left in tree.
CONFLICT (modify/delete): file11 deleted in master and modified in HEAD. Version HEAD of file11 left in tree.
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Auto-merging both
CONFLICT (add/add): Merge conflict in both
Resolved 'both' using previous resolution.
Resolved 'file1' using previous resolution.
Resolved 'file2' using previous resolution.
Resolved 'spaced name' using previous resolution.
Resolved 'subdir/file3' using previous resolution.
Automatic merge failed; fix conflicts and then commit the result.
Rebasing (3/5)
Executing: exit 15
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
Execution failed: exit 15
You can fix the problem, and then run

	git rebase --continue

Cloning into 'sub1'...
done.
ok 3 - custom tool commands override built-ins

expecting success: 
	: >expect &&
	test_must_fail \
		git difftool --no-prompt --tool=bad-tool branch >actual &&
	test_cmp expect actual

ok 38 - status: two commands done with some white lines in done file

expecting success: 
	FAKE_LINES="1 2 exec_exit_15 3 > 4" &&
	export FAKE_LINES &&
	test_when_finished "git rebase --abort" &&
	ONTO=$(git rev-parse --short HEAD~4) &&
	COMMIT4=$(git rev-parse --short HEAD) &&
	COMMIT3=$(git rev-parse --short HEAD^) &&
	COMMIT2=$(git rev-parse --short HEAD^^) &&
	test_must_fail git rebase -i HEAD~4 &&
	cat >expected <<EOF &&
interactive rebase in progress; onto $ONTO
Last commands done (3 commands done):
   pick $COMMIT2 two_commit
   exec exit 15
  (see more in file .git/rebase-merge/done)
Next commands to do (2 remaining commands):
   pick $COMMIT3 three_commit
   pick $COMMIT4 four_commit
  (use "git rebase --edit-todo" to view and edit)
You are currently editing a commit while rebasing branch 'several_commits' on '$ONTO'.
  (use "git commit --amend" to amend the current commit)
  (use "git rebase --continue" once you are satisfied with your changes)

nothing to commit (use -u to show untracked files)
EOF
	git status --untracked-files=no >actual &&
	test_i18ncmp expected actual

Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
error: The following untracked working tree files would be overwritten by merge:
	sub1/file1
	sub1/file2
Please move or remove them before you can merge.
Aborting
Updating 7141cca..0abcf00
ok 8 - git merge: 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
		)
	
Cloning into 'submodule_update'...
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Unknown merge tool bad-tool
fatal: external diff died, stopping at file
ok 4 - difftool ignores bad --tool values

expecting success: 
	difftool_test_setup &&
	>for-diff &&
	git add for-diff &&
	echo changes>for-diff &&
	git add for-diff &&
	: >expect &&
	git difftool --cached --no-prompt -- for-diff >actual &&
	test_cmp expect actual &&
	git reset -- for-diff &&
	rm for-diff

rebase -i script before editing:
pick ad8fc94 one_commit
pick d6d14d5 two_commit
pick 5c7f1ad three_commit
pick 3ecd625 four_commit

HEAD is now at fb5c1b3 branch1 changes
ok 6 - mergetool skips autoresolved

expecting success: 
	(
		cd subdir &&
		test_config rerere.enabled false &&
		test_must_fail git merge master &&
		( yes "r" | git mergetool ../submod ) &&
		( yes "d" "d" | git mergetool --no-prompt ) &&
		test "$(cat ../file1)" = "master updated" &&
		test "$(cat ../file2)" = "master new" &&
		test "$(cat file3)" = "master new sub" &&
		( cd .. && git submodule update -N ) &&
		test "$(cat ../submod/bar)" = "master submodule" &&
		git commit -m "branch2 resolved by mergetool from subdir"
	)

rebase -i script after editing:
pick ad8fc94 one_commit
pick d6d14d5 two_commit
exec exit 15
pick 5c7f1ad three_commit

pick 3ecd625 four_commit
warning: Failed to merge submodule submod (merge following commits not found)
Merging:
fb5c1b3 branch1 changes
virtual master
found 1 common ancestor:
c0d6d4d add initial versions
Auto-merging submod
CONFLICT (submodule): Merge conflict in submod
Auto-merging subdir/file3
CONFLICT (content): Merge conflict in subdir/file3
Auto-merging spaced name
CONFLICT (content): Merge conflict in spaced name
Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
CONFLICT (modify/delete): file12 deleted in HEAD and modified in master. Version master of file12 left in tree.
CONFLICT (modify/delete): file11 deleted in master and modified in HEAD. Version HEAD of file11 left in tree.
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Auto-merging both
CONFLICT (add/add): Merge conflict in both
Automatic merge failed; fix conflicts and then commit the result.
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
Merging:
../submod

Cloning into 'sub1'...
Rebasing (3/6)
Executing: exit 15
Execution failed: exit 15
You can fix the problem, and then run

	git rebase --continue

done.
Submodule merge conflict for '../submod':
  {local}: submodule commit f1e79731463601167179811363c6dab0cdc96e35
  {remote}: submodule commit 5b592f796c80b49a0e8916069c72cb3527ae3597
Use (l)ocal or (r)emote, or (a)bort? Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
Merging:
both
file1
file11
file12
file2
spaced name
subdir/file3

ok 39 - status: two remaining commands with some white lines in todo file

# passed all 39 test(s)
1..39
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
error: The following untracked working tree files would be overwritten by merge:
	sub1/file1
	sub1/file2
Please move or remove them before you can merge.
Aborting
Updating 7141cca..0abcf00
*** t7810-grep.sh ***
Normal merge conflict for 'both':
  {local}: created file
  {remote}: created file

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7810-grep/.git/
expecting success: 
	{
		echo foo mmap bar
		echo foo_mmap bar
		echo foo_mmap bar mmap
		echo foo mmap bar_mmap
		echo foo_mmap bar mmap baz
	} >file &&
	{
		echo Hello world
		echo HeLLo world
		echo Hello_world
		echo HeLLo_world
	} >hello_world &&
	{
		echo "a+b*c"
		echo "a+bc"
		echo "abc"
	} >ab &&
	echo vvv >v &&
	echo ww w >w &&
	echo x x xx x >x &&
	echo y yy >y &&
	echo zzz > z &&
	mkdir t &&
	echo test >t/t &&
	echo vvv >t/v &&
	mkdir t/a &&
	echo vvv >t/a/v &&
	{
		echo "line without leading space1"
		echo " line with leading space1"
		echo " line with leading space2"
		echo " line with leading space3"
		echo "line without leading space2"
	} >space &&
	git add . &&
	test_tick &&
	git commit -m initial

ok 9 - git merge: 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
		)
	
[master (root-commit) cfd9fd5] initial
 Author: A U Thor <author@example.com>
 13 files changed, 32 insertions(+)
 create mode 100644 ab
 create mode 100644 file
 create mode 100644 hello.c
 create mode 100644 hello_world
 create mode 100644 space
 create mode 100644 t/a/v
 create mode 100644 t/t
 create mode 100644 t/v
 create mode 100644 v
 create mode 100644 w
 create mode 100644 x
 create mode 100644 y
 create mode 100644 z
ok 5 - difftool forwards arguments to diff

ok 1 - setup

expecting success: 
	test_must_fail git grep "("

expecting success: 
	test_config difftool.error.cmd false &&
	git difftool -y -t error branch

fatal: unmatched parenthesis
ok 2 - grep should not segfault with a bad input

expecting success: 
		{
			echo ${HC}file:1:foo mmap bar
			echo ${HC}file:3:foo_mmap bar mmap
			echo ${HC}file:4:foo mmap bar_mmap
			echo ${HC}file:5:foo_mmap bar mmap baz
		} >expected &&
		git -c grep.linenumber=false grep -n -w -e mmap $H >actual &&
		test_cmp expected actual
	
ok 3 - grep -w HEAD

expecting success: 
		{
			echo ${HC}file:1:foo mmap bar
			echo ${HC}file:3:foo_mmap bar mmap
			echo ${HC}file:4:foo mmap bar_mmap
			echo ${HC}file:5:foo_mmap bar mmap baz
		} >expected &&
		git -c grep.linenumber=true grep -w -e mmap $H >actual &&
		test_cmp expected actual
	
ok 4 - grep -w HEAD

expecting success: 
		{
			echo ${HC}file:foo mmap bar
			echo ${HC}file:foo_mmap bar mmap
			echo ${HC}file:foo mmap bar_mmap
			echo ${HC}file:foo_mmap bar mmap baz
		} >expected &&
		git -c grep.linenumber=true grep --no-line-number -w -e mmap $H >actual &&
		test_cmp expected actual
	
Normal merge conflict for 'file1':
  {local}: modified file
  {remote}: modified file
ok 5 - grep -w HEAD

expecting success: 
		: >expected &&
		test_must_fail git grep -n -w -e "^w" $H >actual &&
		test_cmp expected actual
	
ok 6 - grep -w HEAD (w)

expecting success: 
		{
			echo ${HC}x:1:x x xx x
		} >expected &&
		git grep -n -w -e "x xx* x" $H >actual &&
		test_cmp expected actual
	
Cloning into 'submodule_update'...
ok 7 - grep -w HEAD (x)

expecting success: 
		{
			echo ${HC}y:1:y yy
		} >expected &&
		git grep -n -w -e "^y" $H >actual &&
		test_cmp expected actual
	

ok 8 - grep -w HEAD (y-1)

expecting success: 
		: >expected &&
		if git grep -n -w -e "^y y" $H >actual
		then
			echo should not have matched
			cat actual
			false
		else
			test_cmp expected actual
		fi
	
done.
ok 9 - grep -w HEAD (y-2)

expecting success: 
		: >expected &&
		if git grep -n -w -e "^z" $H >actual
		then
			echo should not have matched
			cat actual
			false
		else
			test_cmp expected actual
		fi
	
ok 10 - grep -w HEAD (z)

expecting success: 
		echo "${HC}t/t:1:test" >expected &&
		git grep -n -e test $H >actual &&
		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 11 - grep HEAD (t-1)

expecting success: 
		echo "${HC}t:1:test" >expected &&
		(
			cd t &&
			git grep -n -e test $H
		) >actual &&
		test_cmp expected actual
	
ok 12 - grep HEAD (t-2)

expecting success: 
		echo "${HC}t/t:1:test" >expected &&
		(
			cd t &&
			git grep --full-name -n -e test $H
		) >actual &&
		test_cmp expected actual
	
ok 13 - grep HEAD (t-3)

expecting success: 
		! git grep -c test $H | grep /dev/null
        
Deleted merge conflict for 'file11':
  {local}: modified file
  {remote}: deleted
Use (m)odified or (d)eleted file, or (a)bort? ok 14 - grep -c HEAD (no /dev/null)

expecting success: 
		{
			echo ${HC}t/a/v:1:vvv
			echo ${HC}t/v:1:vvv
			echo ${HC}v:1:vvv
		} >expected &&
		git grep --max-depth -1 -n -e vvv $H >actual &&
		test_cmp expected actual
	

ok 15 - grep --max-depth -1 HEAD

expecting success: 
		{
			echo ${HC}v:1:vvv
		} >expected &&
		git grep --max-depth 0 -n -e vvv $H >actual &&
		test_cmp expected actual
	
ok 16 - grep --max-depth 0 HEAD

expecting success: 
		{
			echo ${HC}t/a/v:1:vvv
			echo ${HC}t/v:1:vvv
			echo ${HC}v:1:vvv
		} >expected &&
		git grep --max-depth 0 -n -e vvv $H -- "*" >actual &&
		test_cmp expected actual
	
ok 17 - grep --max-depth 0 -- '*' HEAD

expecting success: 
		{
			echo ${HC}t/v:1:vvv
			echo ${HC}v:1:vvv
		} >expected &&
		git grep --max-depth 1 -n -e vvv $H >actual &&
		test_cmp expected actual
	
ok 18 - grep --max-depth 1 HEAD

expecting success: 
		{
			echo ${HC}t/v:1:vvv
		} >expected &&
		git grep --max-depth 0 -n -e vvv $H -- t >actual &&
		test_cmp expected actual
	
ok 19 - grep --max-depth 0 -- t HEAD

expecting success: 
		{
			echo ${HC}t/v:1:vvv
			echo ${HC}v:1:vvv
		} >expected &&
		git grep --max-depth 0 -n -e vvv $H -- . t >actual &&
		test_cmp expected actual
	
ok 20 - grep --max-depth 0 -- . t HEAD

expecting success: 
		{
			echo ${HC}t/v:1:vvv
			echo ${HC}v:1:vvv
		} >expected &&
		git grep --max-depth 0 -n -e vvv $H -- t . >actual &&
		test_cmp expected actual
	
Deleted merge conflict for 'file12':
  {local}: deleted
  {remote}: modified file
Use (m)odified or (d)eleted file, or (a)bort? 
ok 21 - grep --max-depth 0 -- t . HEAD

expecting success: 
		echo "${HC}ab:a+bc" >expected &&
		git -c grep.extendedRegexp=false grep "a+b*c" $H ab >actual &&
		test_cmp expected actual
	
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 22 - grep HEAD with grep.extendedRegexp=false

expecting success: 
		echo "${HC}ab:abc" >expected &&
		git -c grep.extendedRegexp=true grep "a+b*c" $H ab >actual &&
		test_cmp expected actual
	
ok 23 - grep HEAD with grep.extendedRegexp=true

expecting success: 
		echo "${HC}ab:a+bc" >expected &&
		git -c grep.patterntype=basic grep "a+b*c" $H ab >actual &&
		test_cmp expected actual
	
ok 24 - grep HEAD with grep.patterntype=basic

expecting success: 
		echo "${HC}ab:abc" >expected &&
		git -c grep.patterntype=extended grep "a+b*c" $H ab >actual &&
		test_cmp expected actual
	
ok 25 - grep HEAD with grep.patterntype=extended

expecting success: 
		echo "${HC}ab:a+b*c" >expected &&
		git -c grep.patterntype=fixed grep "a+b*c" $H ab >actual &&
		test_cmp expected actual
	
ok 26 - grep HEAD with grep.patterntype=fixed

expecting success: 
		echo "${HC}ab:a+b*c" >expected &&
		git -c grep.patterntype=perl grep "a\x{2b}b\x{2a}c" $H ab >actual &&
		test_cmp expected actual
	
Cloning into 'sub1'...
ok 27 - grep HEAD with grep.patterntype=perl

expecting success: 
		echo "${HC}ab:abc" >expected &&
		git \
			-c grep.patternType=default \
			-c grep.extendedRegexp=true \
			grep "a+b*c" $H ab >actual &&
		test_cmp expected actual
	
Normal merge conflict for 'file2':
  {local}: created file
  {remote}: created file
ok 28 - grep HEAD with grep.patternType=default and grep.extendedRegexp=true

expecting success: 
		echo "${HC}ab:abc" >expected &&
		git \
			-c grep.extendedRegexp=true \
			-c grep.patternType=default \
			grep "a+b*c" $H ab >actual &&
		test_cmp expected actual
	
ok 29 - grep HEAD with grep.extendedRegexp=true and grep.patternType=default

expecting success: 
		echo "${HC}ab:abc" >expected &&
		git \
			-c grep.patternType=extended \
done.
			-c grep.extendedRegexp=false \
			grep "a+b*c" $H ab >actual &&
		test_cmp expected actual
	
ok 30 - grep HEAD with grep.patternType=extended and grep.extendedRegexp=false

expecting success: 
		echo "${HC}ab:a+bc" >expected &&
		git \
			-c grep.patternType=basic \
			-c grep.extendedRegexp=true \
			grep "a+b*c" $H ab >actual &&
		test_cmp expected actual
	

ok 31 - grep HEAD with grep.patternType=basic and grep.extendedRegexp=true

expecting success: 
		echo "${HC}ab:abc" >expected &&
		git \
			-c grep.extendedRegexp=false \
			-c grep.patternType=extended \
			grep "a+b*c" $H ab >actual &&
		test_cmp expected actual
	
ok 32 - grep HEAD with grep.extendedRegexp=false and grep.patternType=extended

expecting success: 
		echo "${HC}ab:a+bc" >expected &&
		git \
			-c grep.extendedRegexp=true \
			-c grep.patternType=basic \
			grep "a+b*c" $H ab >actual &&
		test_cmp expected actual
	
ok 33 - grep HEAD with grep.extendedRegexp=true and grep.patternType=basic

expecting success: 
		echo ${HC}ab:3 >expected &&
		git grep --count -e b $H -- ab >actual &&
		test_cmp expected actual
	
ok 34 - grep --count HEAD

expecting success: 
		echo 3 >expected &&
		git grep --count -h -e b $H -- ab >actual &&
		test_cmp expected actual
	
ok 35 - grep --count -h HEAD

expecting success: 
		{
			echo ${HC}file:1:foo mmap bar
			echo ${HC}file:3:foo_mmap bar mmap
			echo ${HC}file:4:foo mmap bar_mmap
			echo ${HC}file:5:foo_mmap bar mmap baz
		} >expected &&
		git -c grep.linenumber=false grep -n -w -e mmap $H >actual &&
		test_cmp expected actual
	
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
ok 36 - grep -w in working tree

expecting success: 
		{
			echo ${HC}file:1:foo mmap bar
			echo ${HC}file:3:foo_mmap bar mmap
			echo ${HC}file:4:foo mmap bar_mmap
			echo ${HC}file:5:foo_mmap bar mmap baz
		} >expected &&
		git -c grep.linenumber=true grep -w -e mmap $H >actual &&
		test_cmp expected actual
	
ok 37 - grep -w in working tree

expecting success: 
		{
			echo ${HC}file:foo mmap bar
			echo ${HC}file:foo_mmap bar mmap
			echo ${HC}file:foo mmap bar_mmap
			echo ${HC}file:foo_mmap bar mmap baz
		} >expected &&
		git -c grep.linenumber=true grep --no-line-number -w -e mmap $H >actual &&
		test_cmp expected actual
	
Normal merge conflict for 'spaced name':
  {local}: modified file
  {remote}: modified file
ok 38 - grep -w in working tree

expecting success: 
		: >expected &&
		test_must_fail git grep -n -w -e "^w" $H >actual &&
		test_cmp expected actual
	
ok 39 - grep -w in working tree (w)

expecting success: 
		{
			echo ${HC}x:1:x x xx x
		} >expected &&
		git grep -n -w -e "x xx* x" $H >actual &&
		test_cmp expected actual
	
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
ok 40 - grep -w in working tree (x)

expecting success: 
		{
			echo ${HC}y:1:y yy
		} >expected &&
		git grep -n -w -e "^y" $H >actual &&
		test_cmp expected actual
	
Updating 7141cca..3d0ed3b
Fast-forward
ok 41 - grep -w in working tree (y-1)


expecting success: 
		: >expected &&
		if git grep -n -w -e "^y y" $H >actual
		then
			echo should not have matched
			cat actual
			false
		else
			test_cmp expected actual
		fi
	
 .gitmodules | 4 ----
 sub1        | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
test_must_fail: command succeeded: git merge replace_sub1_with_file
ok 42 - grep -w in working tree (y-2)

expecting success: 
		: >expected &&
		if git grep -n -w -e "^z" $H >actual
		then
			echo should not have matched
			cat actual
			false
		else
			test_cmp expected actual
		fi
	
not ok 10 - git merge: 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 6 - difftool ignores exit code

expecting success: 
	test_config difftool.error.cmd false &&
	test_must_fail git difftool -y --trust-exit-code -t error branch

ok 43 - grep -w in working tree (z)

expecting success: 
		echo "${HC}t/t:1:test" >expected &&
		git grep -n -e test $H >actual &&
		test_cmp expected actual
	
ok 44 - grep in working tree (t-1)

expecting success: 
		echo "${HC}t:1:test" >expected &&
		(
			cd t &&
			git grep -n -e test $H
		) >actual &&
		test_cmp expected actual
	
ok 45 - grep in working tree (t-2)

expecting success: 
		echo "${HC}t/t:1:test" >expected &&
		(
			cd t &&
			git grep --full-name -n -e test $H
		) >actual &&
		test_cmp expected actual
	
ok 46 - grep in working tree (t-3)

expecting success: 
		! git grep -c test $H | grep /dev/null
        
Cloning into 'submodule_update'...
ok 47 - grep -c in working tree (no /dev/null)

expecting success: 
		{
			echo ${HC}t/a/v:1:vvv
			echo ${HC}t/v:1:vvv
			echo ${HC}v:1:vvv
		} >expected &&
		git grep --max-depth -1 -n -e vvv $H >actual &&
		test_cmp expected actual
	
ok 48 - grep --max-depth -1 in working tree

expecting success: 
		{
			echo ${HC}v:1:vvv
		} >expected &&
		git grep --max-depth 0 -n -e vvv $H >actual &&
		test_cmp expected actual
	
Normal merge conflict for 'subdir/file3':
  {local}: modified file
  {remote}: modified file
done.
ok 49 - grep --max-depth 0 in working tree

expecting success: 
		{
			echo ${HC}t/a/v:1:vvv
			echo ${HC}t/v:1:vvv
			echo ${HC}v:1:vvv
		} >expected &&
		git grep --max-depth 0 -n -e vvv $H -- "*" >actual &&
		test_cmp expected actual
	
ok 50 - grep --max-depth 0 -- '*' in working tree

expecting success: 
		{
			echo ${HC}t/v:1:vvv
			echo ${HC}v:1:vvv
		} >expected &&
		git grep --max-depth 1 -n -e vvv $H >actual &&
		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 51 - grep --max-depth 1 in working tree

expecting success: 
		{
			echo ${HC}t/v:1:vvv
		} >expected &&
		git grep --max-depth 0 -n -e vvv $H -- t >actual &&
		test_cmp expected actual
	
ok 52 - grep --max-depth 0 -- t in working tree

expecting success: 
		{
			echo ${HC}t/v:1:vvv
			echo ${HC}v:1:vvv
		} >expected &&
		git grep --max-depth 0 -n -e vvv $H -- . t >actual &&
		test_cmp expected actual
	
ok 53 - grep --max-depth 0 -- . t in working tree

expecting success: 
		{
			echo ${HC}t/v:1:vvv
			echo ${HC}v:1:vvv
		} >expected &&
		git grep --max-depth 0 -n -e vvv $H -- t . >actual &&
		test_cmp expected actual
	
ok 54 - grep --max-depth 0 -- t . in working tree

expecting success: 
		echo "${HC}ab:a+bc" >expected &&
		git -c grep.extendedRegexp=false grep "a+b*c" $H ab >actual &&
		test_cmp expected actual
	
ok 55 - grep in working tree with grep.extendedRegexp=false

expecting success: 
		echo "${HC}ab:abc" >expected &&
		git -c grep.extendedRegexp=true grep "a+b*c" $H ab >actual &&
		test_cmp expected actual
	
ok 56 - grep in working tree with grep.extendedRegexp=true

expecting success: 
		echo "${HC}ab:a+bc" >expected &&
		git -c grep.patterntype=basic grep "a+b*c" $H ab >actual &&
		test_cmp expected actual
	
ok 57 - grep in working tree with grep.patterntype=basic

expecting success: 
		echo "${HC}ab:abc" >expected &&
		git -c grep.patterntype=extended grep "a+b*c" $H ab >actual &&
		test_cmp expected actual
	
ok 58 - grep in working tree with grep.patterntype=extended

expecting success: 
		echo "${HC}ab:a+b*c" >expected &&
		git -c grep.patterntype=fixed grep "a+b*c" $H ab >actual &&
		test_cmp expected actual
	
ok 59 - grep in working tree with grep.patterntype=fixed

expecting success: 
		echo "${HC}ab:a+b*c" >expected &&
		git -c grep.patterntype=perl grep "a\x{2b}b\x{2a}c" $H ab >actual &&
		test_cmp expected actual
	
ok 60 - grep in working tree with grep.patterntype=perl

expecting success: 
		echo "${HC}ab:abc" >expected &&
		git \
			-c grep.patternType=default \
			-c grep.extendedRegexp=true \
			grep "a+b*c" $H ab >actual &&
		test_cmp expected actual
	
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 61 - grep in working tree with grep.patternType=default and grep.extendedRegexp=true

expecting success: 
		echo "${HC}ab:abc" >expected &&
		git \
			-c grep.extendedRegexp=true \
			-c grep.patternType=default \
			grep "a+b*c" $H ab >actual &&
		test_cmp expected actual
	
Submodule path 'submod': checked out '5b592f796c80b49a0e8916069c72cb3527ae3597'
ok 62 - grep in working tree with grep.extendedRegexp=true and grep.patternType=default

expecting success: 
		echo "${HC}ab:abc" >expected &&
		git \
			-c grep.patternType=extended \
			-c grep.extendedRegexp=false \
			grep "a+b*c" $H ab >actual &&
		test_cmp expected actual
	
[test4 eb0ab2b] branch2 resolved by mergetool from subdir
 Author: A U Thor <author@example.com>
ok 7 - mergetool merges all from subdir

expecting success: 
	test_config rerere.enabled true &&
	rm -rf .git/rr-cache &&
	git checkout -b test5 branch1 &&
	git submodule update -N &&
	test_must_fail git merge master >/dev/null 2>&1 &&
	( yes "l" | git mergetool --no-prompt submod >/dev/null 2>&1 ) &&
	( yes "d" "d" | git mergetool --no-prompt >/dev/null 2>&1 ) &&
	git submodule update -N &&
	output="$(yes "n" | git mergetool --no-prompt)" &&
	test "$output" = "No files need merging" &&
	git reset --hard

ok 63 - grep in working tree with grep.patternType=extended and grep.extendedRegexp=false

expecting success: 
		echo "${HC}ab:a+bc" >expected &&
		git \
			-c grep.patternType=basic \
			-c grep.extendedRegexp=true \
			grep "a+b*c" $H ab >actual &&
		test_cmp expected actual
	
ok 64 - grep in working tree with grep.patternType=basic and grep.extendedRegexp=true

expecting success: 
		echo "${HC}ab:abc" >expected &&
		git \
			-c grep.extendedRegexp=false \
			-c grep.patternType=extended \
			grep "a+b*c" $H ab >actual &&
		test_cmp expected actual
	
ok 65 - grep in working tree with grep.extendedRegexp=false and grep.patternType=extended

expecting success: 
		echo "${HC}ab:a+bc" >expected &&
		git \
			-c grep.extendedRegexp=true \
			-c grep.patternType=basic \
			grep "a+b*c" $H ab >actual &&
		test_cmp expected actual
	
Switched to a new branch 'test5'
M	submod
ok 66 - grep in working tree with grep.extendedRegexp=true and grep.patternType=basic

expecting success: 
		echo ${HC}ab:3 >expected &&
		git grep --count -e b $H -- ab >actual &&
		test_cmp expected actual
	
Cloning into 'sub1'...
ok 67 - grep --count in working tree

expecting success: 
		echo 3 >expected &&
		git grep --count -h -e b $H -- ab >actual &&
		test_cmp expected actual
	
ok 68 - grep --count -h in working tree

expecting success: 
	git grep -l -C1 foo >actual &&
	test_cmp expected actual

done.
ok 69 - grep -l -C

expecting success: 
	git grep -c -C1 foo >actual &&
	test_cmp expected actual

ok 70 - grep -l -C

expecting success: 
	git ls-files >expected &&
	git grep -L -C1 nonexistent_string >actual &&
	test_cmp expected actual

ok 71 - grep -L -C

expecting success: 
	git grep -e "foo mmap" --and -e bar_mmap >actual &&
	test_cmp expected actual

ok 72 - grep -e A --and -e B

expecting success: 
	git grep \( -e foo_ --or -e baz \) \
		--and -e " mmap" >actual &&
	test_cmp expected actual

fatal: external diff died, stopping at file
ok 7 - difftool forwards exit code with --trust-exit-code

ok 73 - grep ( -e A --or -e B ) --and -e B

Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
expecting success: 
	test_config difftool.vimdiff.path false &&
	test_must_fail git difftool -y --trust-exit-code -t vimdiff branch

expecting success: 
	git grep -e "foo mmap" --and --not -e bar_mmap >actual &&
	test_cmp expected actual

Submodule path 'submod': checked out 'f1e79731463601167179811363c6dab0cdc96e35'
ok 74 - grep -e A --and --not -e B

expecting success: 
	GREP_OPTIONS=-v git grep " mmap bar\$" >actual &&
	test_cmp expected actual

ok 75 - grep should ignore GREP_OPTIONS

expecting success: 
	test_must_fail git grep -f patterns

fatal: cannot open 'patterns': No such file or directory
ok 76 - grep -f, non-existent file

expecting success: 
	git grep -f pattern >actual &&
	test_cmp expected actual

Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
ok 77 - grep -f, one pattern

expecting success: 
	git grep -f patterns >actual &&
	test_cmp expected actual

ok 78 - grep -f, multiple patterns

expecting success: 
	git grep "$(cat patterns)" >actual &&
	test_cmp expected actual

ok 79 - grep, multiple patterns

expecting success: 
	git grep -f patterns >actual &&
	test_cmp expected actual

Updating 7141cca..3d0ed3b
Fast-forward
 .gitmodules | 4 ----
 sub1        | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
test_must_fail: command succeeded: git merge replace_sub1_with_file
ok 80 - grep -f, ignore empty lines

expecting success: 
	git grep -f - <patterns >actual &&
	test_cmp expected actual

not ok 11 - git merge: 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 81 - grep -f, ignore empty lines, read patterns from stdin

expecting success: 
	>empty &&
	git grep -q mmap >actual &&
	test_cmp empty actual &&
	test_must_fail git grep -q qfwfq >actual &&
	test_cmp empty actual

ok 82 - grep -q, silently report matches

expecting success: 
	git grep -C1 "^[yz]" >actual &&
	test_cmp expected actual

ok 83 - grep -C1 hunk mark between files

expecting success: 
	echo a >>file &&
	test_tick &&
	GIT_AUTHOR_NAME="With * Asterisk" \
	GIT_AUTHOR_EMAIL="xyzzy@frotz.com" \
	git commit -a -m "second" &&

	echo a >>file &&
	test_tick &&
	git commit -a -m "third" &&

	echo a >>file &&
	test_tick &&
	GIT_AUTHOR_NAME="Night Fall" \
	GIT_AUTHOR_EMAIL="nitfol@frobozz.com" \
	git commit -a -m "fourth"

Cloning into 'submodule_update'...
[master b39ecf0] second
 Author: With * Asterisk <xyzzy@frotz.com>
 1 file changed, 1 insertion(+)
[master 8f9afb5] third
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
done.
[master 2d5652e] fourth
 Author: Night Fall <nitfol@frobozz.com>
 1 file changed, 1 insertion(+)
ok 84 - log grep setup

expecting success: 
	git log --author=author --pretty=tformat:%s >actual &&
	{
		echo third && echo initial
	} >expect &&
	test_cmp expect actual

ok 85 - log grep (1)

expecting success: 
	git log --author=" * " -F --pretty=tformat:%s >actual &&
	{
		echo second
	} >expect &&
	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 86 - log grep (2)

expecting success: 
	git log --author="^A U" --pretty=tformat:%s >actual &&
	{
		echo third && echo initial
	} >expect &&
	test_cmp expect actual

ok 87 - log grep (3)

expecting success: 
	git log --author="frotz\.com>$" --pretty=tformat:%s >actual &&
	{
		echo second
	} >expect &&
	test_cmp expect actual

ok 88 - log grep (4)

expecting success: 
	git log --author=Thor -F --pretty=tformat:%s >actual &&
	{
		echo third && echo initial
	} >expect &&
	test_cmp expect actual

ok 89 - log grep (5)

expecting success: 
	git log --author=-0700  --pretty=tformat:%s >actual &&
	>expect &&
	test_cmp expect actual

ok 90 - log grep (6)

expecting success: 
	git log -g --grep-reflog="commit: third" --pretty=tformat:%s >actual &&
	echo third >expect &&
	test_cmp expect actual

ok 91 - log grep (7)

expecting success: 
	git log -g --grep-reflog="commit: third" --grep-reflog="commit: second" --pretty=tformat:%s >actual &&
	{
		echo third && echo second
	} >expect &&
	test_cmp expect actual

ok 92 - log grep (8)

expecting success: 
	git log -g --grep-reflog="commit: third" --author="Thor" --pretty=tformat:%s >actual &&
	echo third >expect &&
	test_cmp expect actual

ok 93 - log grep (9)

expecting success: 
	git log -g --grep-reflog="commit: third" --author="non-existant" --pretty=tformat:%s >actual &&
	: >expect &&
	test_cmp expect actual

ok 94 - log grep (9)

expecting success: 
	test_must_fail git log --grep-reflog="commit: third"

fatal: cannot use --grep-reflog without --walk-reflogs
ok 95 - log --grep-reflog can only be used under -g

expecting success: 
	git log --grep=i --grep=r --format=%s >actual &&
	{
		echo fourth && echo third && echo initial
	} >expect &&
	test_cmp expect actual

fatal: external diff died, stopping at file
ok 96 - log with multiple --grep uses union

expecting success: 
	git log --all-match --grep=i --grep=r --format=%s >actual &&
	{
		echo third
	} >expect &&
	test_cmp expect actual

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 8 - difftool forwards exit code with --trust-exit-code for built-ins

expecting success: 
	test_config difftool.error.cmd false &&
	test_config difftool.trustExitCode true &&
	test_must_fail git difftool -y -t error branch

ok 97 - log --all-match with multiple --grep uses intersection

expecting success: 
	git log --author="Thor" --author="Aster" --format=%s >actual &&
	{
	    echo third && echo second && echo initial
	} >expect &&
	test_cmp expect actual

ok 98 - log with multiple --author uses union

expecting success: 
	git log --all-match --author="Thor" --author="Aster" --format=%s >actual &&
	{
	    echo third && echo second && echo initial
	} >expect &&
	test_cmp expect actual

ok 99 - log --all-match with multiple --author still uses union

expecting success: 
	# grep matches only third and fourth
	# author matches only initial and third
	git log --author="A U Thor" --grep=r --format=%s >actual &&
	{
		echo third
	} >expect &&
	test_cmp expect actual

ok 100 - log --grep --author uses intersection

expecting success: 
	# grep matches initial and second but not third
	# author matches only initial and third
	git log --author="A U Thor" --grep=s --grep=l --format=%s >actual &&
	{
		echo initial
	} >expect &&
	test_cmp expect actual

ok 101 - log --grep --grep --author takes union of greps and intersects with author

expecting success: 
	# grep matches only initial and third
	# author matches all but second
	git log --all-match --author="Thor" --author="Night" --grep=i --format=%s >actual &&
	{
	    echo third && echo initial
	} >expect &&
	test_cmp expect actual

ok 102 - log ---all-match -grep --author --author still takes union of authors and intersects with grep

expecting success: 
	# grep matches only initial and third
	# author matches all but second
	git log --author="Thor" --author="Night" --grep=i --format=%s >actual &&
	{
	    echo third && echo initial
	} >expect &&
	test_cmp expect actual

Cloning into 'sub1'...
ok 103 - log --grep --author --author takes union of authors and intersects with grep

expecting success: 
	# grep matches only third
	# author matches only initial and third
	git log --all-match --author="A U Thor" --grep=i --grep=r --format=%s >actual &&
	{
		echo third
	} >expect &&
	test_cmp expect actual

ok 104 - log --all-match --grep --grep --author takes intersection

expecting success: 
	: >expect &&
	git log --author="$GIT_AUTHOR_DATE" >actual &&
	test_cmp expect actual

done.
ok 105 - log --author does not search in timestamp

expecting success: 
	: >expect &&
	git log --committer="$GIT_COMMITTER_DATE" >actual &&
	test_cmp expect actual

ok 106 - log --committer does not search in timestamp

expecting success: 
	git update-index --assume-unchanged t/t &&
	rm t/t &&
	test "$(git grep test)" = "t/t:test" &&
	git update-index --no-assume-unchanged t/t &&
	git checkout t/t

ok 107 - grep with CE_VALID file

expecting success: 
	git config diff.custom.funcname "^#" &&
	echo "hello.c diff=custom" >.gitattributes &&
	git grep -p return >actual &&
	test_cmp expected actual

ok 108 - grep -p with userdiff

expecting success: 
	rm -f .gitattributes &&
	git grep -p return >actual &&
	test_cmp expected actual

Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
ok 109 - grep -p

expecting success: 
	git grep -p -B5 return >actual &&
	test_cmp expected actual

ok 110 - grep -p -B5

expecting success: 
	git grep -W return >actual &&
	test_cmp expected actual

Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
ok 111 - grep -W

expecting success: 
	test_when_finished "rm -f .gitattributes" &&
	git config diff.custom.xfuncname "(printf.*|})$" &&
	echo "hello.c diff=custom" >.gitattributes &&
	git grep -W return >actual &&
	test_cmp expected actual

Updating 7141cca..ec55a65
Fast-forward
ok 112 - grep -W with userdiff

expecting success: 
	mkdir -p s &&
	(
		cd s && git grep "x x x" ..
	)

../x:x x xx x
ok 113 - grep from a subdirectory to search wider area (1)

expecting success: 
	mkdir -p s &&
	(
		cd s || exit 1
		( git grep xxyyzz .. >out ; echo $? >status )
		! test -s out &&
		test 1 = $(cat status)
	)

ok 114 - grep from a subdirectory to search wider area (2)

expecting success: 
	git grep -Fi "CHAR *" >actual &&
	test_cmp expected actual

ok 115 - grep -Fi

expecting success: 
	rm -fr non &&
	mkdir -p non/git/sub &&
	echo hello >non/git/file1 &&
	echo world >non/git/sub/file2 &&
	{
		echo file1:hello &&
		echo sub/file2:world
	} >non/expect.full &&
	echo file2:world >non/expect.sub &&
	(
		GIT_CEILING_DIRECTORIES="$(pwd)/non/git" &&
		export GIT_CEILING_DIRECTORIES &&
		cd non/git &&
		test_must_fail git grep o &&
		git grep --no-index o >../actual.full &&
		test_cmp ../expect.full ../actual.full
		cd sub &&
		test_must_fail git grep o &&
		git grep --no-index o >../../actual.sub &&
		test_cmp ../../expect.sub ../../actual.sub
	) &&

	echo ".*o*" >non/git/.gitignore &&
	(
		GIT_CEILING_DIRECTORIES="$(pwd)/non/git" &&
		export GIT_CEILING_DIRECTORIES &&
		cd non/git &&
		test_must_fail git grep o &&
		git grep --no-index --exclude-standard o >../actual.full &&
		test_cmp ../expect.full ../actual.full &&

		{
			echo ".gitignore:.*o*"
			cat ../expect.full
		} >../expect.with.ignored &&
		git grep --no-index --no-exclude o >../actual.full &&
		test_cmp ../expect.with.ignored ../actual.full
	)

fatal: Not a git repository (or any of the parent directories): .git
ok 116 - outside of git repository

expecting success: 
	rm -fr is &&
	mkdir -p is/git/sub &&
	echo hello >is/git/file1 &&
	echo world >is/git/sub/file2 &&
	echo ".*o*" >is/git/.gitignore &&
	{
		echo file1:hello &&
		echo sub/file2:world
	} >is/expect.unignored &&
	{
		echo ".gitignore:.*o*" &&
		cat is/expect.unignored
	} >is/expect.full &&
	: >is/expect.empty &&
	echo file2:world >is/expect.sub &&
	(
		cd is/git &&
		git init &&
		test_must_fail git grep o >../actual.full &&
		test_cmp ../expect.empty ../actual.full &&

		git grep --untracked o >../actual.unignored &&
		test_cmp ../expect.unignored ../actual.unignored &&

		git grep --no-index o >../actual.full &&
		test_cmp ../expect.full ../actual.full &&

		git grep --no-index --exclude-standard o >../actual.unignored &&
		test_cmp ../expect.unignored ../actual.unignored &&

		cd sub &&
		test_must_fail git grep o >../../actual.sub &&
		test_cmp ../../expect.empty ../../actual.sub &&

		git grep --no-index o >../../actual.sub &&
		test_cmp ../../expect.sub ../../actual.sub &&

		git grep --untracked o >../../actual.sub &&
		test_cmp ../../expect.sub ../../actual.sub
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7810-grep/is/git/.git/
Submodule path 'sub1': checked out '16f35dbe1b011ba099b95d9716033ba6d1f02026'
fatal: external diff died, stopping at file
ok 9 - difftool honors difftool.trustExitCode = true

expecting success: 
	test_config difftool.error.cmd false &&
	test_config difftool.trustExitCode false &&
	git difftool -y -t error branch

ok 12 - git merge: 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
		)
	
ok 117 - inside git repository but with --no-index

expecting success: 
cat >double-dash <<EOF &&
--
->
other
EOF
git add double-dash

ok 118 - setup double-dash tests

expecting success: 
	git grep -- "->" >actual &&
	test_cmp expected actual

ok 119 - grep -- pattern

expecting success: 
	git grep -- "->" -- double-dash >actual &&
	test_cmp expected actual

ok 120 - grep -- pattern -- pathspec

expecting success: 
	git grep -e "->" -- double-dash >actual &&
	test_cmp expected actual

ok 121 - grep -e pattern -- path

expecting success: 
	git grep -e -- -- double-dash >actual &&
	test_cmp expected actual

Cloning into 'submodule_update'...
ok 122 - grep -e -- -- path

expecting success: 
	git grep --perl-regexp "\p{Ps}.*?\p{Pe}" hello.c >actual &&
	test_cmp expected actual

done.
ok 123 - grep --perl-regexp pattern

expecting success: 
	git grep -P "\p{Ps}.*?\p{Pe}" hello.c >actual &&
	test_cmp expected actual

ok 124 - grep -P pattern

expecting success: 
	>empty &&
	test_must_fail git -c grep.extendedregexp=true \
		grep "\p{Ps}.*?\p{Pe}" hello.c >actual &&
	test_cmp empty actual

fatal: command line, '\p{Ps}.*?\p{Pe}': Invalid content of \{\}
ok 125 - grep pattern with grep.extendedRegexp=true
Switched to a new branch 'add_sub1'

Branch add_sub1 set up to track remote branch add_sub1 from origin.
expecting success: 
	git -c grep.extendedregexp=true \
		grep -P "\p{Ps}.*?\p{Pe}" hello.c >actual &&
	test_cmp expected actual

ok 126 - grep -P pattern with grep.extendedRegexp=true

expecting success: 
	{
		echo "ab:a+b*c"
		echo "ab:a+bc"
	} >expected &&
	git grep -P -v "abc" ab >actual &&
	test_cmp expected actual

ok 127 - grep -P -v pattern

expecting success: 
	cat >expected <<-EOF &&
	hello.c:	printf("Hello world.\n");
	EOF
	git grep -P -i "PRINTF\([^\d]+\)" hello.c >actual &&
	test_cmp expected actual

ok 128 - grep -P -i pattern

expecting success: 
	{
		echo "hello_world:Hello world"
		echo "hello_world:HeLLo world"
	} >expected &&
	git grep -P -w "He((?i)ll)o" hello_world >actual &&
	test_cmp expected actual

ok 129 - grep -P -w pattern

expecting success: 
	test_must_fail git grep -G "a["

fatal: command line, 'a[': Invalid regular expression
ok 130 - grep -G invalidpattern properly dies 

expecting success: 
	test_must_fail git -c grep.patterntype=basic grep "a["

fatal: command line, 'a[': Invalid regular expression
ok 131 - grep invalidpattern properly dies with grep.patternType=basic

expecting success: 
	test_must_fail git grep -E "a["

fatal: command line, 'a[': Invalid regular expression
ok 132 - grep -E invalidpattern properly dies 

expecting success: 
	test_must_fail git -c grep.patterntype=extended grep "a["

fatal: command line, 'a[': Invalid regular expression
ok 133 - grep invalidpattern properly dies with grep.patternType=extended

expecting success: 
	test_must_fail git grep -P "a["

fatal: command line, 'a[': missing terminating ] for character class
ok 134 - grep -P invalidpattern properly dies 

expecting success: 
	test_must_fail git -c grep.patterntype=perl grep "a["

fatal: command line, 'a[': missing terminating ] for character class
ok 135 - grep invalidpattern properly dies with grep.patternType=perl

expecting success: 
	echo "ab:a+b*c" >expected &&
	git grep -G -E -F "a+b*c" ab >actual &&
	test_cmp expected actual

ok 136 - grep -G -E -F pattern

expecting success: 
	echo "ab:a+b*c" >expected &&
	git \
		-c grep.patterntype=basic \
		-c grep.patterntype=extended \
		-c grep.patterntype=fixed \
		grep "a+b*c" ab >actual &&
	test_cmp expected actual

ok 137 - grep pattern with grep.patternType=basic, =extended, =fixed

expecting success: 
	echo "ab:a+bc" >expected &&
	git grep -E -F -G "a+b*c" ab >actual &&
	test_cmp expected actual

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 138 - grep -E -F -G pattern

expecting success: 
	echo "ab:a+bc" >expected &&
	git \
		-c grep.patterntype=extended \
		-c grep.patterntype=fixed \
		-c grep.patterntype=basic \
		grep "a+b*c" ab >actual &&
	test_cmp expected actual

ok 139 - grep pattern with grep.patternType=extended, =fixed, =basic

expecting success: 
	echo "ab:abc" >expected &&
	git grep -F -G -E "a+b*c" ab >actual &&
	test_cmp expected actual

ok 140 - grep -F -G -E pattern

expecting success: 
	echo "ab:abc" >expected &&
	git \
		-c grep.patterntype=fixed \
		-c grep.patterntype=basic \
		-c grep.patterntype=extended \
		grep "a+b*c" ab >actual &&
	test_cmp expected actual

ok 141 - grep pattern with grep.patternType=fixed, =basic, =extended

expecting success: 
	>empty &&
	test_must_fail git grep -G -F -P -E "a\x{2b}b\x{2a}c" ab >actual &&
	test_cmp empty actual

fatal: command line, 'a\x{2b}b\x{2a}c': Invalid content of \{\}
ok 142 - grep -G -F -P -E pattern

expecting success: 
	>empty &&
	test_must_fail git \
		-c grep.patterntype=fixed \
		-c grep.patterntype=basic \
		-c grep.patterntype=perl \
		-c grep.patterntype=extended \
		grep "a\x{2b}b\x{2a}c" ab >actual &&
	test_cmp empty actual

Cloning into 'sub1'...
fatal: command line, 'a\x{2b}b\x{2a}c': Invalid content of \{\}
ok 143 - grep pattern with grep.patternType=fixed, =basic, =perl, =extended

expecting success: 
	echo "ab:a+b*c" >expected &&
	git grep -G -F -E -P "a\x{2b}b\x{2a}c" ab >actual &&
	test_cmp expected actual

done.
ok 144 - grep -G -F -E -P pattern

expecting success: 
	echo "ab:a+b*c" >expected &&
	git \
		-c grep.patterntype=fixed \
		-c grep.patterntype=basic \
		-c grep.patterntype=extended \
		-c grep.patterntype=perl \
		grep "a\x{2b}b\x{2a}c" ab >actual &&
	test_cmp expected actual

ok 145 - grep pattern with grep.patternType=fixed, =basic, =extended, =perl

expecting success: 
	echo "ab:a+b*c" >expected &&
	git \
		-c grep.patterntype=fixed \
		grep -P "a\x{2b}b\x{2a}c" ab >actual &&
	test_cmp expected actual

ok 146 - grep -P pattern with grep.patternType=fixed

expecting success: 
	echo "ab:a+b*c" >expected &&
	git \
		-c grep.patterntype=basic \
		grep -F "*c" ab >actual &&
	test_cmp expected actual

ok 147 - grep -F pattern with grep.patternType=basic

expecting success: 
	{
		echo "ab:a+b*c"
		echo "ab:a+bc"
	} >expected &&
	git \
		-c grep.patterntype=fixed \
		grep -G "a+b" ab >actual &&
	test_cmp expected actual

ok 148 - grep -G pattern with grep.patternType=fixed

expecting success: 
	{
		echo "ab:a+b*c"
		echo "ab:a+bc"
		echo "ab:abc"
	} >expected &&
	git \
		-c grep.patterntype=fixed \
		grep -E "a+" ab >actual &&
	test_cmp expected actual

HEAD is now at fb5c1b3 branch1 changes
ok 149 - grep -E pattern with grep.patternType=fixed

expecting success: 
	test_config color.grep.context		normal &&
	test_config color.grep.filename		normal &&
	test_config color.grep.function		normal &&
	test_config color.grep.linenumber	normal &&
	test_config color.grep.match		normal &&
	test_config color.grep.selected		normal &&
	test_config color.grep.separator	red &&

	git grep --color=always -A1 -e char -e lo_w hello.c hello_world |
	test_decode_color >actual &&
	test_cmp expected actual

ok 8 - mergetool skips resolved paths when rerere is active

expecting success: 
	test_config rerere.enabled true &&
	git checkout stash1 &&
	echo "Conflicting stash content" >file11 &&
	git stash &&

	git checkout --detach stash2 &&
	test_must_fail git stash apply &&

	test -n "$(git ls-files -u)" &&
	conflicts="$(git rerere remaining)" &&
	test "$conflicts" = "file11" &&
	output="$(git mergetool --no-prompt)" &&
	test "$output" != "No files need merging" &&

	git commit -am "save the stash resolution" &&

	git reset --hard stash2 &&
	test_must_fail git stash apply &&

	test -n "$(git ls-files -u)" &&
	conflicts="$(git rerere remaining)" &&
	test -z "$conflicts" &&
	output="$(git mergetool --no-prompt)" &&
	test "$output" = "No files need merging"

Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
Switched to branch 'stash1'
M	submod
ok 10 - difftool honors difftool.trustExitCode = false

expecting success: 
	test_config difftool.error.cmd false &&
	test_config difftool.trustExitCode true &&
	git difftool -y --no-trust-exit-code -t error branch

Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
Updating 7141cca..2e1f05b
Fast-forward
ok 150 - grep --color, separator

expecting success: 
	git grep --break -e char -e lo_w hello.c hello_world >actual &&
	test_cmp expected actual

ok 151 - grep --break

expecting success: 
	git grep --break -A1 -e char -e lo_w hello.c hello_world >actual &&
	test_cmp expected actual

ok 152 - grep --break with context

expecting success: 
	git grep --heading -e char -e lo_w hello.c hello_world >actual &&
	test_cmp expected actual

ok 153 - grep --heading

expecting success: 
	test_config color.grep.context		normal &&
	test_config color.grep.filename		"bold green" &&
	test_config color.grep.function		normal &&
	test_config color.grep.linenumber	normal &&
	test_config color.grep.match		"black yellow" &&
	test_config color.grep.selected		normal &&
	test_config color.grep.separator	normal &&

	git grep --break --heading -n --color \
		-e char -e lo_w hello.c hello_world |
	test_decode_color >actual &&
	test_cmp expected actual

Saved working directory and index state WIP on stash1: b87aaec stash1 changes
HEAD is now at b87aaec stash1 changes
Note: checking out 'stash2'.

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 77540cc... stash2 changes
M	submod
ok 154 - mimic ack-grep --group

expecting success: 
	git grep -E "^ " space >actual &&
	test_cmp expected actual

fatal: reference is not a tree: 0123456789012345678901234567890123456789
Unable to checkout '0123456789012345678901234567890123456789' in submodule path 'sub1'
ok 155 - grep -E "^ "

expecting success: 
	git grep -P "^ " space >actual &&
	test_cmp expected actual

ok 156 - grep -P "^ "

expecting success: 
	test_config color.grep.context		normal &&
	test_config color.grep.filename		normal &&
	test_config color.grep.function		normal &&
	test_config color.grep.linenumber	normal &&
	test_config color.grep.matchContext	normal &&
	test_config color.grep.matchSelected	red &&
	test_config color.grep.selected		normal &&
	test_config color.grep.separator	normal &&

	git grep --color=always -C2 -e "with " -e space2  space |
	test_decode_color >actual &&
	test_cmp expected actual

Merging Updated upstream with Stashed changes
Merging:
virtual Updated upstream
virtual Stashed changes
found 1 common ancestor:
virtual 506f505174572dc68bade51b4931618e9acd766a
Auto-merging file11
CONFLICT (content): Merge conflict in file11
Recorded preimage for 'file11'
ok 13 - git merge: 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
		)
	
Cloning into 'submodule_update'...
done.
ok 157 - grep --color -e A -e B with context

expecting success: 
	test_config color.grep.context		normal &&
	test_config color.grep.filename		normal &&
	test_config color.grep.function		normal &&
	test_config color.grep.linenumber	normal &&
	test_config color.grep.matchContext	normal &&
	test_config color.grep.matchSelected	red &&
	test_config color.grep.selected		normal &&
	test_config color.grep.separator	normal &&

	git grep --color=always -C2 -e "with " --and -e space2  space |
	test_decode_color >actual &&
	test_cmp expected actual

Switched to a new branch 'invalid_sub1'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
fatal: Needed a single revision
Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
ok 11 - difftool ignores exit code with --no-trust-exit-code

expecting success: 
	test_when_finished "rm -f for-diff .git/fail-right-file" &&
	test_when_finished "git reset -- for-diff" &&
	write_script .git/fail-right-file <<-\EOF &&
	echo "$2"
	exit 1
	EOF
	>for-diff &&
	git add for-diff &&
	echo file >expect &&
	test_must_fail git difftool -y --trust-exit-code \
		--extcmd .git/fail-right-file branch >actual &&
	test_cmp expect actual

Updating 2e1f05b..fca299d
Fast-forward
Recorded resolution for 'file11'.
[detached HEAD c30212e] save the stash resolution
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 2 deletions(-)
HEAD is now at 77540cc stash2 changes
ok 158 - grep --color -e A --and -e B with context

expecting success: 
	test_config color.grep.context		normal &&
	test_config color.grep.filename		normal &&
	test_config color.grep.function		normal &&
	test_config color.grep.linenumber	normal &&
	test_config color.grep.matchContext	normal &&
	test_config color.grep.matchSelected	red &&
	test_config color.grep.selected		normal &&
	test_config color.grep.separator	normal &&

	git grep --color=always -C2 -e "with " --and --not -e space2  space |
	test_decode_color >actual &&
	test_cmp expected actual

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
Merging Updated upstream with Stashed changes
Merging:
virtual Updated upstream
virtual Stashed changes
found 1 common ancestor:
virtual 506f505174572dc68bade51b4931618e9acd766a
Auto-merging file11
CONFLICT (content): Merge conflict in file11
Resolved 'file11' using previous resolution.
ok 159 - grep --color -e A --and --not -e B with context

expecting success: 
	test_config color.grep.context		normal &&
	test_config color.grep.filename		normal &&
	test_config color.grep.function		normal &&
	test_config color.grep.linenumber	normal &&
	test_config color.grep.matchContext	normal &&
	test_config color.grep.matchSelected	red &&
	test_config color.grep.selected		normal &&
	test_config color.grep.separator	normal &&

	git grep --color=always -p -C3 -e int --and -e Hello --no-index hello.c |
	test_decode_color >actual &&
	test_cmp expected actual

Cloning into 'sub1'...
done.
ok 9 - conflicted stash sets up rerere

expecting success: 
	git reset --hard &&
	test_config rerere.enabled false &&
	git checkout -b test12 branch1 &&
	git submodule update -N &&
	test_must_fail git merge master &&

	( yes "" | git mergetool subdir ) &&

	test "$(cat subdir/file3)" = "master new sub" &&
	git reset --hard

HEAD is now at 77540cc stash2 changes
Previous HEAD position was 77540cc... stash2 changes
Switched to a new branch 'test12'
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
ok 160 - grep --color -e A --and -e B -p with context

# passed all 160 test(s)
1..160
*** t7811-grep-open.sh ***
ok 14 - git merge: 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
		)
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7811-grep-open/.git/
warning: Failed to merge submodule submod (merge following commits not found)
expecting success: 
	test_might_fail git config --unset core.pager &&
	less=$(
		unset PAGER GIT_PAGER;
		git var GIT_PAGER
	) &&
	test -n "$less"

Merging:
fb5c1b3 branch1 changes
virtual master
found 1 common ancestor:
c0d6d4d add initial versions
Auto-merging submod
CONFLICT (submodule): Merge conflict in submod
Auto-merging subdir/file3
CONFLICT (content): Merge conflict in subdir/file3
Auto-merging spaced name
CONFLICT (content): Merge conflict in spaced name
Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
CONFLICT (modify/delete): file12 deleted in HEAD and modified in master. Version master of file12 left in tree.
CONFLICT (modify/delete): file11 deleted in master and modified in HEAD. Version HEAD of file11 left in tree.
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Auto-merging both
CONFLICT (add/add): Merge conflict in both
Automatic merge failed; fix conflicts and then commit the result.
ok 1 - determine default pager

expecting success: 
	test_commit initial grep.h "
enum grep_pat_token {
	GREP_PATTERN,
	GREP_PATTERN_HEAD,
	GREP_PATTERN_BODY,
	GREP_AND,
	GREP_OPEN_PAREN,
	GREP_CLOSE_PAREN,
	GREP_NOT,
	GREP_OR,
};" &&

	test_commit add-user revision.c "
	}
	if (seen_dashdash)
		read_pathspec_from_stdin(revs, &sb, prune);
	strbuf_release(&sb);
}

static void add_grep(struct rev_info *revs, const char *ptn, enum grep_pat_token what)
{
	append_grep_pattern(&revs->grep_filter, ptn, \"command line\", 0, what);
" &&

	mkdir subdir &&
	test_commit subdir subdir/grep.c "enum grep_pat_token" &&

	test_commit uninteresting unrelated "hello, world" &&

	echo GREP_PATTERN >untracked

Cloning into 'submodule_update'...
fatal: external diff died, stopping at file
[master (root-commit) 6a780d2] initial
 Author: A U Thor <author@example.com>
 1 file changed, 11 insertions(+)
 create mode 100644 grep.h
ok 12 - difftool stops on error with --trust-exit-code

done.
expecting success: 
	difftool_test_setup &&
	test_config merge.tool bogus-tool &&
	test_config diff.tool bogus-tool &&
	test_config diff.guitool test-tool &&

	echo branch >expect &&
	git difftool --no-prompt --gui branch >actual &&
	test_cmp expect actual

Merging:
subdir/file3

[master 7eeae3c] add-user
 Author: A U Thor <author@example.com>
 1 file changed, 11 insertions(+)
 create mode 100644 revision.c
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Branch add_sub1 set up to track remote branch add_sub1 from origin.
[master 22c3f1e] subdir
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 subdir/grep.c
Updating 2347eb4..7141cca
Fast-forward
 .gitmodules | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
[master cd972f3] uninteresting
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 unrelated
ok 2 - setup

expecting success: 
	cat >$less <<-\EOF &&
	#!/bin/sh
	printf "%s\n" "$@" >pager-args
	EOF
	chmod +x $less &&
	cat >expect.less <<-\EOF &&
	+/*GREP_PATTERN
	grep.h
	EOF
	echo grep.h >expect.notless &&
	>empty &&

	PATH=.:$PATH git grep -O GREP_PATTERN >out &&
	{
		test_cmp expect.less pager-args ||
		test_cmp expect.notless pager-args
	} &&
	test_cmp empty out

Normal merge conflict for 'subdir/file3':
  {local}: modified file
  {remote}: modified file
--- expect.less	2015-12-16 11:07:07.629564897 +0000
+++ pager-args	2015-12-16 11:07:07.657564897 +0000
@@ -1,2 +1 @@
-+/*GREP_PATTERN
 grep.h
ok 3 - git grep -O

expecting success: 
	test_must_fail git grep --cached -O GREP_PATTERN >out 2>msg &&
	test_i18ngrep open-files-in-pager msg

fatal: --open-files-in-pager only works on the worktree
ok 4 - git grep -O --cached

expecting success: 
	rm -f expect.less pager-args out &&
	cat >expect <<-\EOF &&
	grep.h
	untracked
	EOF
	>empty &&

	(
		GIT_PAGER='printf "%s\n" >pager-args' &&
		export GIT_PAGER &&
		git grep --no-index -O GREP_PATTERN >out
	) &&
	test_cmp expect pager-args &&
	test_cmp empty out

HEAD is now at fb5c1b3 branch1 changes
ok 10 - mergetool takes partial path

expecting success: 
	git checkout -b test6 branch1 &&
	git submodule update -N &&
	mv submod submod-movedaside &&
	git rm --cached submod &&
	git commit -m "Submodule deleted from branch" &&
	git checkout -b test6.a test6 &&
	test_must_fail git merge master &&
	test -n "$(git ls-files -u)" &&
	( yes "" | git mergetool file1 file2 spaced\ name subdir/file3 >/dev/null 2>&1 ) &&
	( yes "" | git mergetool both >/dev/null 2>&1 ) &&
	( yes "d" | git mergetool file11 file12 >/dev/null 2>&1 ) &&
	( yes "r" | git mergetool submod ) &&
	rmdir submod && mv submod-movedaside submod &&
	test "$(cat submod/bar)" = "branch1 submodule" &&
	git submodule update -N &&
	test "$(cat submod/bar)" = "master submodule" &&
	output="$(git mergetool --no-prompt)" &&
	test "$output" = "No files need merging" &&
	git commit -m "Merge resolved by keeping module" &&

	mv submod submod-movedaside &&
	git checkout -b test6.b test6 &&
	git submodule update -N &&
	test_must_fail git merge master &&
	test -n "$(git ls-files -u)" &&
	( yes "" | git mergetool file1 file2 spaced\ name subdir/file3 >/dev/null 2>&1 ) &&
	( yes "" | git mergetool both >/dev/null 2>&1 ) &&
	( yes "d" | git mergetool file11 file12 >/dev/null 2>&1 ) &&
	( yes "l" | git mergetool submod ) &&
	test ! -e submod &&
	output="$(git mergetool --no-prompt)" &&
	test "$output" = "No files need merging" &&
	git commit -m "Merge resolved by deleting module" &&

	mv submod-movedaside submod &&
	git checkout -b test6.c master &&
	git submodule update -N &&
	test_must_fail git merge test6 &&
	test -n "$(git ls-files -u)" &&
	( yes "" | git mergetool file1 file2 spaced\ name subdir/file3 >/dev/null 2>&1 ) &&
	( yes "" | git mergetool both >/dev/null 2>&1 ) &&
	( yes "d" | git mergetool file11 file12 >/dev/null 2>&1 ) &&
	( yes "r" | git mergetool submod ) &&
	test ! -e submod &&
	test -d submod.orig &&
	git submodule update -N &&
	output="$(git mergetool --no-prompt)" &&
	test "$output" = "No files need merging" &&
	git commit -m "Merge resolved by deleting module" &&
	mv submod.orig submod &&

	git checkout -b test6.d master &&
	git submodule update -N &&
	test_must_fail git merge test6 &&
	test -n "$(git ls-files -u)" &&
	( yes "" | git mergetool file1 file2 spaced\ name subdir/file3 >/dev/null 2>&1 ) &&
	( yes "" | git mergetool both >/dev/null 2>&1 ) &&
	( yes "d" | git mergetool file11 file12 >/dev/null 2>&1 ) &&
	( yes "l" | git mergetool submod ) &&
	test "$(cat submod/bar)" = "master submodule" &&
	git submodule update -N &&
	test "$(cat submod/bar)" = "master submodule" &&
	output="$(git mergetool --no-prompt)" &&
	test "$output" = "No files need merging" &&
	git commit -m "Merge resolved by keeping module" &&
	git reset --hard HEAD

ok 5 - git grep -O --no-index

expecting success: 
	cat >less <<-\EOF &&
	#!/bin/sh
	printf "%s\n" "$@" >actual
	EOF
	chmod +x less

ok 6 - setup: fake "less"

expecting success: 
	cat >expect <<-\EOF &&
	+/*GREP_PATTERN
	grep.h
	EOF
	>empty &&

	GIT_PAGER=./less git grep -O GREP_PATTERN >out &&
	test_cmp expect actual &&
	test_cmp empty out &&

	git grep -O./less GREP_PATTERN >out2 &&
	test_cmp expect actual &&
	test_cmp empty out2

Switched to a new branch 'test6'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 7 - git grep -O jumps to line in less

expecting success: 
	rm -f actual &&
	cat >expect <<-\EOF &&
	+/*enum grep_pat_token
	grep.h
	revision.c
	subdir/grep.c
	unrelated
	EOF
	>empty &&

	echo "enum grep_pat_token" >unrelated &&
	test_when_finished "git checkout HEAD unrelated" &&
	GIT_PAGER=./less git grep -F -O "enum grep_pat_token" >out &&
	test_cmp expect actual &&
	test_cmp empty out

ok 8 - modified file

expecting success: 
	rm -f actual &&
	echo grep.h >expect &&
	test_config color.grep always &&
	test_config color.grep.filename yellow &&
	test_config color.grep.separator green &&
	git grep -O'printf "%s\n" >actual' GREP_AND &&
	test_cmp expect actual

Cloning into 'sub1'...
rm 'submod'
done.
ok 9 - copes with color settings

expecting success: 
	rm -f actual &&
	echo grep.c >expect &&
	>empty &&

	(
		cd subdir &&
		export GIT_PAGER &&
		GIT_PAGER='printf "%s\n" >../args' &&
		git grep -O "enum grep_pat_token" >../out &&
		git grep -O"pwd >../dir; :" "enum grep_pat_token" >../out2
	) &&
	case $(cat dir) in
	*subdir)
		: good
		;;
	*)
		false
		;;
	esac &&
	test_cmp expect args &&
	test_cmp empty out &&
	test_cmp empty out2

[test6 3023623] Submodule deleted from branch
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 160000 submod
Switched to a new branch 'test6.a'
ok 10 - run from subdir

# passed all 10 test(s)
1..10
Merging:
3023623 Submodule deleted from branch
virtual master
found 1 common ancestor:
c0d6d4d add initial versions
CONFLICT (modify/delete): submod deleted in HEAD and modified in master. Version master of submod left in tree.
Auto-merging subdir/file3
CONFLICT (content): Merge conflict in subdir/file3
Auto-merging spaced name
CONFLICT (content): Merge conflict in spaced name
Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
CONFLICT (modify/delete): file12 deleted in HEAD and modified in master. Version master of file12 left in tree.
CONFLICT (modify/delete): file11 deleted in master and modified in HEAD. Version HEAD of file11 left in tree.
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Auto-merging both
CONFLICT (add/add): Merge conflict in both
Automatic merge failed; fix conflicts and then commit the result.
*** t8001-annotate.sh ***
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t8001-annotate/.git/
expecting success: 
	echo "1A quick brown fox jumps over the" >file &&
	echo "lazy dog" >>file &&
	git add file &&
	GIT_AUTHOR_NAME="A" GIT_AUTHOR_EMAIL="A@test.git" \
	git commit -a -m "Initial."

[master (root-commit) 5a109a3] Initial.
 Author: A <A@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
ok 1 - setup A lines

expecting success: 
	check_count A 2

git annotate  file 
Author A (expected 2, attributed 2) good
ok 2 - blame 1 author

expecting success: 
	echo "2A quick brown fox jumps over the" >>file &&
	echo "lazy dog" >>file &&
	GIT_AUTHOR_NAME="B" GIT_AUTHOR_EMAIL="B@test.git" \
	git commit -a -m "Second."

ok 15 - git merge --ff: 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
		)
	
[master f5a7179] Second.
 Author: B <B@test.git>
 1 file changed, 2 insertions(+)
ok 3 - setup B lines

expecting success: 
	check_count A 2 B 2

git annotate  file 
Author A (expected 2, attributed 2) good
Author B (expected 2, attributed 2) good
ok 4 - blame 2 authors

expecting success: 
	git checkout -b branch1 master &&
	echo "3A slow green fox jumps into the" >>file &&
	echo "well." >>file &&
	GIT_AUTHOR_NAME="B1" GIT_AUTHOR_EMAIL="B1@test.git" \
	git commit -a -m "Branch1-1"

Switched to a new branch 'branch1'
[branch1 b4a364e] Branch1-1
 Author: B1 <B1@test.git>
 1 file changed, 2 insertions(+)
ok 5 - setup B1 lines (branch1)

expecting success: 
	check_count A 2 B 2 B1 2

git annotate  file 
Cloning into 'submodule_update'...
ok 13 - difftool honors --gui

expecting success: 
	difftool_test_setup &&
	: >expect &&
	git difftool --no-prompt --gui --no-gui >actual &&
	test_cmp expect actual &&

	test_config merge.tool bogus-tool &&
Author A (expected 2, attributed 2) good
	test_config diff.tool bogus-tool &&
Author B (expected 2, attributed 2) good
Author B1 (expected 2, attributed 2) good
	test_config diff.guitool test-tool &&
	echo branch >expect &&
	git difftool --no-prompt --no-gui --gui branch >actual &&
	test_cmp expect actual

ok 6 - blame 2 authors + 1 branch1 author

expecting success: 
	git checkout -b branch2 master &&
	sed -e "s/2A quick brown/4A quick brown lazy dog/" <file >file.new &&
	mv file.new file &&
	GIT_AUTHOR_NAME="B2" GIT_AUTHOR_EMAIL="B2@test.git" \
	git commit -a -m "Branch2-1"

done.
Switched to a new branch 'branch2'
[branch2 788c742] Branch2-1
 Author: B2 <B2@test.git>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 7 - setup B2 lines (branch2)

expecting success: 
	check_count A 2 B 1 B2 1

git annotate  file 
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Author A (expected 2, attributed 2) good
Author B (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
ok 8 - blame 2 authors + 1 branch2 author

expecting success: 
	git merge branch1

Merging:
788c742 Branch2-1
virtual branch1
found 1 common ancestor:
f5a7179 Second.
Auto-merging file
Merge made by the 'recursive' strategy.
 file | 2 ++
 1 file changed, 2 insertions(+)
ok 9 - merge branch1 & branch2

expecting success: 
	check_count A 2 B 1 B1 2 B2 1

git annotate  file 
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Author B1 (expected 2, attributed 2) good
Author A (expected 2, attributed 2) good
Author B (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
ok 10 - blame 2 authors + 2 merged-in authors

expecting success: 
	check_count --first-parent A 2 B 1 "A U Thor" 2 B2 1

git annotate  --first-parent file 
Updating 2347eb4..7141cca
Fast-forward
 .gitmodules | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
Author A U Thor (expected 2, attributed 2) good
Author A (expected 2, attributed 2) good
Author B (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
ok 11 - blame --first-parent blames merge for branch1

expecting success: 
	check_count -h master A 2 B 2

git annotate  file master
Author A (expected 2, attributed 2) good
Author B (expected 2, attributed 2) good
ok 12 - blame ancestor

expecting success: 
	check_count -h master^ A 2

git annotate  file master^
Author A (expected 2, attributed 2) good
ok 13 - blame great-ancestor

expecting success: 
	echo "evil merge." >>file &&
	git commit -a --amend

[branch2 3d226c4] Merge branch 'branch1' into branch2
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 11:07:09 2015 +0000
ok 14 - setup evil merge

expecting success: 
	check_count A 2 B 1 B1 2 B2 1 "A U Thor" 1

git annotate  file 
Author B (expected 1, attributed 1) good
Author A U Thor (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
Author A (expected 2, attributed 2) good
Author B1 (expected 2, attributed 2) good
ok 15 - blame evil merge

expecting success: 
	test_when_finished "git checkout branch2" &&
	test_when_finished "rm -f .git/info/grafts" &&
	graft= &&
	for i in 0 1 2
	do
		for j in 0 1 2 3 4 5 6 7 8 9
		do
			git checkout --orphan "$i$j" &&
			printf "%s\n" "$i" "$j" >file &&
			test_tick &&
			GIT_AUTHOR_NAME=$i$j GIT_AUTHOR_EMAIL=$i$j@test.git \
			git commit -a -m "$i$j" &&
			commit=$(git rev-parse --verify HEAD) &&
			graft="$graft$commit "
		done
	done &&
	printf "%s " $graft >.git/info/grafts &&
	check_count -h 00 01 1 10 1

Switched to a new branch '00'
[00 (root-commit) e2c6177] 00
 Author: 00 <00@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '01'
[01 (root-commit) 0dbe04b] 01
 Author: 01 <01@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
Switched to a new branch '02'
[02 (root-commit) 97fbca6] 02
 Author: 02 <02@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '03'
[03 (root-commit) 5cdbcd8] 03
 Author: 03 <03@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Cloning into 'sub1'...
Switched to a new branch '04'
[04 (root-commit) 5a154cf] 04
 Author: 04 <04@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '05'
done.
[05 (root-commit) a84e1de] 05
 Author: 05 <05@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '06'
[06 (root-commit) d4bea54] 06
 Author: 06 <06@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '07'
[07 (root-commit) 24ba6e8] 07
 Author: 07 <07@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
Switched to a new branch '08'
[08 (root-commit) fe90088] 08
 Author: 08 <08@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '09'
[09 (root-commit) 773a2fb] 09
 Author: 09 <09@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '10'
[10 (root-commit) 80536e5] 10
 Author: 10 <10@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
ok 16 - git merge --ff: 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
		)
	
Switched to a new branch '11'
[11 (root-commit) 33c07c1] 11
 Author: 11 <11@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '12'
[12 (root-commit) ae7094b] 12
 Author: 12 <12@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Cloning into 'submodule_update'...
Switched to a new branch '13'
done.
[13 (root-commit) 19e767d] 13
 Author: 13 <13@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '14'
[14 (root-commit) f7159ac] 14
 Author: 14 <14@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Switched to a new branch '15'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
[15 (root-commit) d95fecf] 15
 Author: 15 <15@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
error: The following untracked working tree files would be overwritten by merge:
	sub1
Please move or remove them before you can merge.
Aborting
Updating 2347eb4..7141cca
Switched to a new branch '16'
ok 17 - git merge --ff: 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
		)
	
[16 (root-commit) d8bfdb9] 16
 Author: 16 <16@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '17'
[17 (root-commit) aa3f31e] 17
 Author: 17 <17@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Cloning into 'submodule_update'...
Switched to a new branch '18'
[18 (root-commit) d76cb1d] 18
 Author: 18 <18@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
done.
Switched to a new branch '19'
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.
[19 (root-commit) 95e03c5] 19
 Author: 19 <19@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
ok 14 - difftool --gui last setting wins

expecting success: 
	difftool_test_setup &&
	echo branch >expect &&
	git difftool --no-prompt --gui branch >actual &&
	test_cmp expect actual

t7613-merge-submodule.sh: 159: cd: can't cd to sub1
Switched to a new branch '20'
Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
[20 (root-commit) d40a964] 20
 Author: 20 <20@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Updating 3d0ed3b..aa60ee5
Fast-forward
Switched to a new branch '21'
 .gitmodules | 4 ++++
 sub1        | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)
 mode change 100644 => 160000 sub1
[21 (root-commit) 6c3def2] 21
 Author: 21 <21@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '22'
[22 (root-commit) 78d2294] 22
 Author: 22 <22@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '23'
[23 (root-commit) 76a64d0] 23
 Author: 23 <23@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Merging:
submod

Switched to a new branch '24'
[24 (root-commit) 59f234a] 24
 Author: 24 <24@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Submodule merge conflict for 'submod':
Switched to a new branch '25'
  {local}: deleted
  {remote}: submodule commit 5b592f796c80b49a0e8916069c72cb3527ae3597
Use (l)ocal or (r)emote, or (a)bort? Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
[25 (root-commit) 26ac47a] 25
 Author: 25 <25@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '26'
[26 (root-commit) db7e855] 26
 Author: 26 <26@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '27'
[27 (root-commit) 279f565] 27
 Author: 27 <27@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Cloning into 'sub1'...
Switched to a new branch '28'
[28 (root-commit) f691d9c] 28
 Author: 28 <28@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
done.
Switched to a new branch '29'
[29 (root-commit) c72134e] 29
 Author: 29 <29@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
git annotate  file 00
Author 10 (expected 1, attributed 1) good
Author 01 (expected 1, attributed 1) good
Submodule path 'submod': checked out '5b592f796c80b49a0e8916069c72cb3527ae3597'
Switched to branch 'branch2'
ok 16 - blame huge graft

expecting success: 
	echo "incomplete" | tr -d "\\012" >>file &&
	GIT_AUTHOR_NAME="C" GIT_AUTHOR_EMAIL="C@test.git" \
	git commit -a -m "Incomplete"

[branch2 df2a32c] Incomplete
 Author: C <C@test.git>
 1 file changed, 1 insertion(+)
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
ok 17 - setup incomplete line

expecting success: 
	check_count A 2 B 1 B1 2 B2 1 "A U Thor" 1 C 1

git annotate  file 
Author B (expected 1, attributed 1) good
Author A U Thor (expected 1, attributed 1) good
Author B1 (expected 2, attributed 2) good
Author B2 (expected 1, attributed 1) good
Author C (expected 1, attributed 1) good
Author A (expected 2, attributed 2) good
ok 18 - blame incomplete line

expecting success: 
	mv file file.orig &&
	{
		cat file.orig &&
		echo
	} | sed -e "s/^3A/99/" -e "/^1A/d" -e "/^incomplete/d" >file &&
	echo "incomplete" | tr -d "\\012" >>file &&
	GIT_AUTHOR_NAME="D" GIT_AUTHOR_EMAIL="D@test.git" \
	git commit -a -m "edit"

Recorded resolution for 'both'.
Recorded resolution for 'file1'.
Recorded resolution for 'file2'.
Recorded resolution for 'spaced name'.
Recorded resolution for 'subdir/file3'.
[branch2 697e974] edit
 Author: D <D@test.git>
 1 file changed, 1 insertion(+), 2 deletions(-)
ok 19 - setup edits

expecting success: 
	check_count A 1 B 1 B1 1 B2 1 "A U Thor" 1 C 1 D 1

[test6.a b35b764] Merge resolved by keeping module
 Author: A U Thor <author@example.com>
git annotate  file 
Switched to a new branch 'test6.b'
Author C (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
Author A U Thor (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
ok 20 - blame edits

expecting success: 
	echo "No robots allowed" >file.new &&
	cat file >>file.new &&
	mv file.new file &&
	GIT_AUTHOR_NAME="E" GIT_AUTHOR_EMAIL="E at test dot git" \
	git commit -a -m "norobots"

ok 18 - git merge --ff: 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
		)
	
[branch2 c2d6d83] norobots
 Author: E <E at test dot git>
 1 file changed, 1 insertion(+)
ok 21 - setup obfuscated email

expecting success: 
	check_count A 1 B 1 B1 1 B2 1 "A U Thor" 1 C 1 D 1 E 1

git annotate  file 
Author C (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
Author A U Thor (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
Author E (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
ok 22 - blame obfuscated email

expecting success: 
	check_count -L1 A 1 B 1 B1 1 B2 1 "A U Thor" 1 C 1 D 1 E 1

git annotate  -L1 file 
Cloning into 'submodule_update'...
Author B1 (expected 1, attributed 1) good
Author C (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
Author A U Thor (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
Author E (expected 1, attributed 1) good
ok 23 - blame -L 1 (all)

expecting success: 
	check_count -L, A 1 B 1 B1 1 B2 1 "A U Thor" 1 C 1 D 1 E 1

ok 15 - difftool --gui works without configured diff.guitool

git annotate  -L, file 
expecting success: 
	difftool_test_setup &&
	git config --unset diff.tool &&
	echo branch >expect &&
	GIT_DIFF_TOOL=test-tool git difftool --no-prompt branch >actual &&
	test_cmp expect actual

Resolved 'both' using previous resolution.
Resolved 'file1' using previous resolution.
Resolved 'file2' using previous resolution.
Resolved 'spaced name' using previous resolution.
Resolved 'subdir/file3' using previous resolution.
Merging:
3023623 Submodule deleted from branch
virtual master
found 1 common ancestor:
c0d6d4d add initial versions
CONFLICT (modify/delete): submod deleted in HEAD and modified in master. Version master of submod left in tree.
Auto-merging subdir/file3
CONFLICT (content): Merge conflict in subdir/file3
Auto-merging spaced name
CONFLICT (content): Merge conflict in spaced name
Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
CONFLICT (modify/delete): file12 deleted in HEAD and modified in master. Version master of file12 left in tree.
CONFLICT (modify/delete): file11 deleted in master and modified in HEAD. Version HEAD of file11 left in tree.
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Auto-merging both
CONFLICT (add/add): Merge conflict in both
Automatic merge failed; fix conflicts and then commit the result.
done.
Author A (expected 1, attributed 1) good
Author C (expected 1, attributed 1) good
Author A U Thor (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
Author E (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
ok 24 - blame -L , (all)

expecting success: 
	check_count -L5 B1 1 C 1 D 1 "A U Thor" 1

git annotate  -L5 file 
Author A U Thor (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
Author C (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
ok 25 - blame -L X (X to end)

expecting success: 
	check_count -L5, B1 1 C 1 D 1 "A U Thor" 1

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.
git annotate  -L5, file 
error: 8ed2e6719f8484ce01fa3ce133fe42d25c2441b8^{commit}: expected commit type, but the object dereferences to tree type
fatal: Needed a single revision
Author A U Thor (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
Author C (expected 1, attributed 1) good
ok 26 - blame -L X, (X to end)

expecting success: 
	check_count -L,3 A 1 B2 1 E 1

git annotate  -L,3 file 
Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
Author B2 (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
Author E (expected 1, attributed 1) good
ok 27 - blame -L ,Y (up to Y)

expecting success: 
	check_count -L3,3 B2 1

Updating 0abcf00..ea26008
Fast-forward
git annotate  -L3,3 file 
 .gitmodules | 4 ++++
 sub1/file1  | 1 -
 sub1/file2  | 1 -
 sub1/file3  | 1 -
 4 files changed, 4 insertions(+), 3 deletions(-)
 delete mode 100644 sub1/file1
 delete mode 100644 sub1/file2
 delete mode 100644 sub1/file3
Author B2 (expected 1, attributed 1) good
ok 28 - blame -L X,X

expecting success: 
	check_count -L3,6 B 1 B1 1 B2 1 D 1

git annotate  -L3,6 file 
Author B2 (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
ok 29 - blame -L X,Y

expecting success: 
	check_count -L6,3 B 1 B1 1 B2 1 D 1

git annotate  -L6,3 file 
Author B1 (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
ok 30 - blame -L Y,X (undocumented)

expecting success: 
	test_must_fail $PROG -L-1 file

fatal: -L invalid line number: -1
ok 31 - blame -L -X

expecting success: 
	test_must_fail $PROG -L0 file

fatal: -L invalid line number: 0
ok 32 - blame -L 0

expecting success: 
	test_must_fail $PROG -L,0 file

fatal: -L invalid line number: 0
ok 33 - blame -L ,0

expecting success: 
	test_must_fail $PROG -L,+0 file

fatal: -L invalid empty range
ok 34 - blame -L ,+0

expecting success: 
	test_must_fail $PROG -L1,+0 file

fatal: -L invalid empty range
ok 35 - blame -L X,+0

expecting success: 
	check_count -L3,+1 B2 1

git annotate  -L3,+1 file 
Author B2 (expected 1, attributed 1) good
ok 36 - blame -L X,+1

expecting success: 
	check_count -L3,+4 B 1 B1 1 B2 1 D 1

git annotate  -L3,+4 file 
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
Author B2 (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
ok 37 - blame -L X,+N

expecting success: 
	test_must_fail $PROG -L,-0 file

fatal: -L invalid empty range
ok 38 - blame -L ,-0

expecting success: 
	test_must_fail $PROG -L1,-0 file

fatal: -L invalid empty range
ok 39 - blame -L X,-0

expecting success: 
	check_count -L3,-1 B2 1

git annotate  -L3,-1 file 
Author B2 (expected 1, attributed 1) good
ok 40 - blame -L X,-1

expecting success: 
	check_count -L6,-4 B 1 B1 1 B2 1 D 1

git annotate  -L6,-4 file 
Author B1 (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
Cloning into 'sub1'...
ok 41 - blame -L X,-N

expecting success: 
	check_count -L/evil/ C 1 "A U Thor" 1

git annotate  -L/evil/ file 
Author C (expected 1, attributed 1) good
Author A U Thor (expected 1, attributed 1) good
ok 42 - blame -L /RE/ (RE to end)

expecting success: 
	check_count -L/robot/,/green/ A 1 B 1 B2 1 D 1 E 1

git annotate  -L/robot/,/green/ file 
done.
Author D (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
Author E (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
ok 43 - blame -L /RE/,/RE2/

expecting success: 
	check_count -L5,/evil/ B1 1 D 1 "A U Thor" 1

git annotate  -L5,/evil/ file 
Author A U Thor (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
ok 44 - blame -L X,/RE/

expecting success: 
	check_count -L/99/,7 B1 1 D 1 "A U Thor" 1

git annotate  -L/99/,7 file 
Author A U Thor (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
ok 45 - blame -L /RE/,Y

expecting success: 
	check_count -L/99/,+3 B1 1 D 1 "A U Thor" 1

git annotate  -L/99/,+3 file 
Author B1 (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
Author A U Thor (expected 1, attributed 1) good
ok 46 - blame -L /RE/,+N

expecting success: 
	check_count -L/99/,-3 B 1 B2 1 D 1

git annotate  -L/99/,-3 file 
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
ok 16 - GIT_DIFF_TOOL variable

expecting success: 
	difftool_test_setup &&
	test_config diff.tool bogus-tool &&
	test_config merge.tool bogus-tool &&

	echo branch >expect &&
	GIT_DIFF_TOOL=test-tool git difftool --no-prompt branch >actual &&
	test_cmp expect actual &&

	test_config diff.tool bogus-tool &&
	test_config merge.tool bogus-tool &&
	GIT_DIFF_TOOL=bogus-tool \
		git difftool --no-prompt --tool=test-tool branch >actual &&
	test_cmp expect actual

Author B2 (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
ok 47 - blame -L /RE/,-N

expecting success: 
	n=$(expr $(wc -l <file) + 1) &&
	check_count -L$n C 1

git annotate  -L8 file 
Author C (expected 1, attributed 1) good
ok 48 - blame -L X (X == nlines)

expecting success: 
	n=$(expr $(wc -l <file) + 2) &&
	test_must_fail $PROG -L$n file

fatal: file file has only 8 lines
ok 49 - blame -L X (X == nlines + 1)

expecting success: 
	test_must_fail $PROG -L12345 file

fatal: file file has only 8 lines
ok 50 - blame -L X (X > nlines)

expecting success: 
	n=$(expr $(wc -l <file) + 1) &&
	check_count -L,$n A 1 B 1 B1 1 B2 1 "A U Thor" 1 C 1 D 1 E 1

git annotate  -L,8 file 
ok 19 - git merge --ff: 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
		)
	
Author B2 (expected 1, attributed 1) good
Author A U Thor (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
Author E (expected 1, attributed 1) good
Author C (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
ok 51 - blame -L ,Y (Y == nlines)

expecting success: 
	n=$(expr $(wc -l <file) + 2) &&
	test_must_fail $PROG -L,$n file

fatal: file file has only 8 lines
ok 52 - blame -L ,Y (Y == nlines + 1)

expecting success: 
	test_must_fail $PROG -L,12345 file

fatal: file file has only 8 lines
ok 53 - blame -L ,Y (Y > nlines)

expecting success: 
	check_count -L2,3 -L6,7 A 1 B1 1 B2 1 "A U Thor" 1

git annotate  -L2,3 -L6,7 file 
Author B1 (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
Author A U Thor (expected 1, attributed 1) good
ok 54 - blame -L multiple (disjoint)

expecting success: 
	check_count -L6,7 -L2,3 A 1 B1 1 B2 1 "A U Thor" 1

git annotate  -L6,7 -L2,3 file 
Cloning into 'submodule_update'...
Author B2 (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
Author A U Thor (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
ok 55 - blame -L multiple (disjoint: unordered)

expecting success: 
	check_count -L2,3 -L4,5 A 1 B 1 B2 1 D 1

done.
git annotate  -L2,3 -L4,5 file 
Author B (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
ok 56 - blame -L multiple (adjacent)

expecting success: 
	check_count -L4,5 -L2,3 A 1 B 1 B2 1 D 1

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
git annotate  -L4,5 -L2,3 file 
Author D (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
ok 57 - blame -L multiple (adjacent: unordered)

expecting success: 
	check_count -L2,4 -L3,5 A 1 B 1 B2 1 D 1

git annotate  -L2,4 -L3,5 file 
Author A (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
ok 58 - blame -L multiple (overlapping)

expecting success: 
	check_count -L3,5 -L2,4 A 1 B 1 B2 1 D 1

git annotate  -L3,5 -L2,4 file 
Author D (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
ok 59 - blame -L multiple (overlapping: unordered)

expecting success: 
	check_count -L2,8 -L3,5 A 1 B 1 B1 1 B2 1 C 1 D 1 "A U Thor" 1

git annotate  -L2,8 -L3,5 file 
Author B2 (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
Author A U Thor (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
Author C (expected 1, attributed 1) good
ok 60 - blame -L multiple (superset/subset)

expecting success: 
	check_count -L3,5 -L2,8 A 1 B 1 B1 1 B2 1 C 1 D 1 "A U Thor" 1

git annotate  -L3,5 -L2,8 file 
Author B2 (expected 1, attributed 1) good
Author C (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
Author A U Thor (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
ok 61 - blame -L multiple (superset/subset: unordered)

expecting success: 
	check_count -L3,3 -L/fox/ B1 1 B2 1 C 1 D 1 "A U Thor" 1

git annotate  -L3,3 -L/fox/ file 
Author C (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
Author A U Thor (expected 1, attributed 1) good
ok 62 - blame -L /RE/ (relative)

expecting success: 
	check_count -L/dog/ A 1 B 1 B1 1 B2 1 C 1 D 1 "A U Thor" 1

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
git annotate  -L/dog/ file 
Author B2 (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
Author C (expected 1, attributed 1) good
Author A U Thor (expected 1, attributed 1) good
ok 63 - blame -L /RE/ (relative: no preceding range)

expecting success: 
	check_count -L1,1 -L/dog/,+1 A 1 E 1

git annotate  -L1,1 -L/dog/,+1 file 
Author A (expected 1, attributed 1) good
Author E (expected 1, attributed 1) good
ok 64 - blame -L /RE/ (relative: adjacent)

expecting success: 
	test_must_fail $PROG -L4,4 -L/dog/ file

fatal: -L parameter 'dog' starting at line 5: No match
ok 65 - blame -L /RE/ (relative: not found)

expecting success: 
	test_must_fail $PROG -L, -L/$/ file

fatal: file file has only 8 lines
ok 66 - blame -L /RE/ (relative: end-of-file)

expecting success: 
	check_count -L3,3 -L^/dog/,+2 A 1 B2 1

git annotate  -L3,3 -L^/dog/,+2 file 
Cloning into 'sub1'...
Author A (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
ok 67 - blame -L ^/RE/ (absolute)

expecting success: 
	check_count -L^/dog/,+2 A 1 B2 1

git annotate  -L^/dog/,+2 file 
done.
Author B2 (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
ok 68 - blame -L ^/RE/ (absolute: no preceding range)

expecting success: 
	test_must_fail $PROG -L4,4 -L^/tambourine/ file

fatal: -L parameter 'tambourine' starting at line 1: No match
ok 69 - blame -L ^/RE/ (absolute: not found)

expecting success: 
	n=$(expr $(wc -l <file) + 1) &&
	check_count -L$n -L^/$/,+2 A 1 C 1 E 1

git annotate  -L8 -L^/$/,+2 file 
Author C (expected 1, attributed 1) good
Author E (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
ok 70 - blame -L ^/RE/ (absolute: end-of-file)

expecting success: 
	tr Q "\\t" >hello.c <<-\EOF &&
	int main(int argc, const char *argv[])
	{
	Qputs("hello");
	}
	EOF
	git add hello.c &&
	GIT_AUTHOR_NAME="F" GIT_AUTHOR_EMAIL="F@test.git" \
	git commit -m "hello" &&

	mv hello.c hello.orig &&
	sed -e "/}/ {x; s/$/Qputs(\"goodbye\");/; G;}" <hello.orig |
	tr Q "\\t" >hello.c &&
	GIT_AUTHOR_NAME="G" GIT_AUTHOR_EMAIL="G@test.git" \
	git commit -a -m "goodbye" &&

	mv hello.c hello.orig &&
	echo "#include <stdio.h>" >hello.c &&
	cat hello.orig >>hello.c &&
	tr Q "\\t" >>hello.c <<-\EOF &&
	void mail()
	{
	Qputs("mail");
	}
	EOF
	GIT_AUTHOR_NAME="H" GIT_AUTHOR_EMAIL="H@test.git" \
	git commit -a -m "mail"

[branch2 4f9a289] hello
 Author: F <F@test.git>
 1 file changed, 4 insertions(+)
 create mode 100644 hello.c
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
[branch2 0c4c0f6] goodbye
 Author: G <G@test.git>
 1 file changed, 1 insertion(+)
[branch2 cd28884] mail
 Author: H <H@test.git>
 1 file changed, 5 insertions(+)
ok 71 - setup -L :regex

expecting success: 
	check_count -f hello.c -L:main F 4 G 1

git annotate  -L:main hello.c 
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
warning: unable to rmdir sub1: Directory not empty
Updating 7141cca..af434d3
Fast-forward
Author F (expected 4, attributed 4) good
Author G (expected 1, attributed 1) good
ok 72 - blame -L :literal

expecting success: 
	check_count -f hello.c "-L:m[a-z][a-z]l" H 4

git annotate  -L:m[a-z][a-z]l hello.c 
 .gitmodules | 4 ----
 1 file changed, 4 deletions(-)
 delete mode 100644 .gitmodules
Author H (expected 4, attributed 4) good
ok 73 - blame -L :regex

expecting success: 
	test_must_fail $PROG -L:nomatch hello.c

fatal: -L parameter 'nomatch' starting at line 1: no match
ok 74 - blame -L :nomatch

expecting success: 
	check_count -f hello.c -L3,3 -L:ma.. F 1 H 4

git annotate  -L3,3 -L:ma.. hello.c 
Author F (expected 1, attributed 1) good
Author H (expected 4, attributed 4) good
ok 75 - blame -L :RE (relative)

expecting success: 
	check_count -f hello.c -L:ma.. F 4 G 1

git annotate  -L:ma.. hello.c 
Author G (expected 1, attributed 1) good
Author F (expected 4, attributed 4) good
ok 76 - blame -L :RE (relative: no preceding range)

expecting success: 
	test_must_fail $PROG -L3,3 -L:tambourine hello.c

ok 20 - git merge --ff: 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
		)
	
fatal: -L parameter 'tambourine' starting at line 4: no match
ok 77 - blame -L :RE (relative: not found)

expecting success: 
	test_must_fail $PROG -L, -L:main hello.c

Merging:
submod

fatal: -L parameter 'main' starting at line 11: no match
ok 78 - blame -L :RE (relative: end-of-file)

expecting success: 
	check_count -f hello.c -L3,3 -L^:ma.. F 4 G 1

git annotate  -L3,3 -L^:ma.. hello.c 
Submodule merge conflict for 'submod':
Author G (expected 1, attributed 1) good
Author F (expected 4, attributed 4) good
ok 79 - blame -L ^:RE (absolute)

expecting success: 
	check_count -f hello.c -L^:ma.. F 4 G 1

git annotate  -L^:ma.. hello.c 
  {local}: deleted
  {remote}: submodule commit 5b592f796c80b49a0e8916069c72cb3527ae3597
Cloning into 'submodule_update'...
Author G (expected 1, attributed 1) good
Author F (expected 4, attributed 4) good
Use (l)ocal or (r)emote, or (a)bort? ok 80 - blame -L ^:RE (absolute: no preceding range)

expecting success: 
	test_must_fail $PROG -L4,4 -L^:tambourine hello.c

fatal: -L parameter 'tambourine' starting at line 1: no match
ok 81 - blame -L ^:RE (absolute: not found)

expecting success: 
	n=$(printf "%d" $(wc -l <hello.c)) &&
	check_count -f hello.c -L$n -L^:ma.. F 4 G 1 H 1

git annotate  -L10 -L^:ma.. hello.c 
done.
Author F (expected 4, attributed 4) good
Author H (expected 1, attributed 1) good
Author G (expected 1, attributed 1) good
ok 82 - blame -L ^:RE (absolute: end-of-file)

expecting success: 
	(
	GIT_AUTHOR_NAME=I &&
	export GIT_AUTHOR_NAME &&
	GIT_AUTHOR_EMAIL=I@test.git &&
	export GIT_AUTHOR_EMAIL &&
	>incremental &&
	git add incremental &&
	git commit -m "step 0" &&
	printf "partial" >>incremental &&
	git commit -a -m "step 0.5" &&
	echo >>incremental &&
	git commit -a -m "step 1"
	)

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
[branch2 51f5f75] step 0
 Author: I <I@test.git>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 incremental
[branch2 4a88317] step 0.5
 Author: I <I@test.git>
 1 file changed, 1 insertion(+)
[branch2 3784a72] step 1
 Author: I <I@test.git>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 83 - setup incremental

expecting success: 
	check_count -h HEAD^^ -f incremental

git annotate  incremental HEAD^^
ok 84 - blame empty

expecting success: 
	test_must_fail $PROG -L0 incremental HEAD^^

[test6.b 3e1f924] Merge resolved by deleting module
 Author: A U Thor <author@example.com>
fatal: -L invalid line number: 0
ok 85 - blame -L 0 empty

expecting success: 
	test_must_fail $PROG -L1 incremental HEAD^^

fatal: file incremental has only 0 lines
ok 86 - blame -L 1 empty

expecting success: 
	test_must_fail $PROG -L2 incremental HEAD^^

Switched to a new branch 'test6.c'
fatal: file incremental has only 0 lines
ok 87 - blame -L 2 empty

expecting success: 
	check_count -h HEAD^ -f incremental I 1

git annotate  incremental HEAD^
Author I (expected 1, attributed 1) good
ok 88 - blame half

expecting success: 
	test_must_fail $PROG -L0 incremental HEAD^

fatal: -L invalid line number: 0
ok 89 - blame -L 0 half

expecting success: 
	check_count -h HEAD^ -f incremental -L1 I 1

git annotate  -L1 incremental HEAD^
Author I (expected 1, attributed 1) good
ok 90 - blame -L 1 half

expecting success: 
	test_must_fail $PROG -L2 incremental HEAD^

fatal: file incremental has only 1 lines
ok 91 - blame -L 2 half

expecting success: 
	test_must_fail $PROG -L3 incremental HEAD^

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 17 - GIT_DIFF_TOOL overrides

expecting success: 
	difftool_test_setup &&
	echo branch >expect &&
	GIT_DIFFTOOL_NO_PROMPT=true git difftool branch >actual &&
	test_cmp expect actual

fatal: file incremental has only 1 lines
ok 92 - blame -L 3 half

expecting success: 
	check_count -f incremental I 1

git annotate  incremental 
Author I (expected 1, attributed 1) good
ok 93 - blame full

expecting success: 
	test_must_fail $PROG -L0 incremental

fatal: -L invalid line number: 0
ok 94 - blame -L 0 full

expecting success: 
	check_count -f incremental -L1 I 1

git annotate  -L1 incremental 
Author I (expected 1, attributed 1) good
ok 95 - blame -L 1 full

expecting success: 
	test_must_fail $PROG -L2 incremental

fatal: file incremental has only 1 lines
ok 96 - blame -L 2 full

expecting success: 
	test_must_fail $PROG -L3 incremental

Merging:
48ba24d master updates
virtual test6
found 1 common ancestor:
c0d6d4d add initial versions
CONFLICT (modify/delete): submod deleted in test6 and modified in HEAD. Version HEAD of submod left in tree at submod~HEAD.
Auto-merging subdir/file3
CONFLICT (content): Merge conflict in subdir/file3
Auto-merging spaced name
CONFLICT (content): Merge conflict in spaced name
Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
CONFLICT (modify/delete): file12 deleted in test6 and modified in HEAD. Version HEAD of file12 left in tree.
CONFLICT (modify/delete): file11 deleted in HEAD and modified in test6. Version test6 of file11 left in tree.
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Auto-merging both
CONFLICT (add/add): Merge conflict in both
Cloning into 'sub1'...
fatal: file incremental has only 1 lines
ok 97 - blame -L 3 full

expecting success: 
	test_must_fail $PROG -L file

Resolved 'both' using previous resolution.
Resolved 'file1' using previous resolution.
Resolved 'file2' using previous resolution.
Resolved 'spaced name' using previous resolution.
Resolved 'subdir/file3' using previous resolution.
Automatic merge failed; fix conflicts and then commit the result.
usage: git blame [<options>] [<rev-opts>] [<rev>] [--] <file>
    <rev-opts> are documented in git-rev-list(1)

    --incremental         Show blame entries as we find them, incrementally
    -b                    Show blank SHA-1 for boundary commits (Default: off)
    --root                Do not treat root commits as boundaries (Default: off)
    --show-stats          Show work cost statistics
    --score-debug         Show output score for blame entries
    -f, --show-name       Show original filename (Default: auto)
    -n, --show-number     Show original linenumber (Default: off)
    -p, --porcelain       Show in a format designed for machine consumption
    --line-porcelain      Show porcelain format with per-line commit information
    -c                    Use the same output mode as git-annotate (Default: off)
    -t                    Show raw timestamp (Default: off)
    -l                    Show long commit SHA1 (Default: off)
    -s                    Suppress author name and timestamp (Default: off)
    -e, --show-email      Show author email instead of name (Default: off)
    -w                    Ignore whitespace differences
    --minimal             Spend extra cycles to find better match
    -S <file>             Use revisions from <file> instead of calling git-rev-list
    --contents <file>     Use <file>'s contents as the final image
    -C[<score>]           Find line copies within and across files
    -M[<score>]           Find line movements within and across files
    -L <n,m>              Process only line range n,m, counting from 1
    --abbrev[=<n>]        use <n> digits to display SHA-1s


ok 98 - blame -L

expecting success: 
	test_must_fail $PROG -L1,+ file

usage: git blame [<options>] [<rev-opts>] [<rev>] [--] <file>
ok 99 - blame -L X,+

expecting success: 
	test_must_fail $PROG -L1,- file

usage: git blame [<options>] [<rev-opts>] [<rev>] [--] <file>
ok 100 - blame -L X,-

expecting success: 
	test_must_fail $PROG -LX file

done.
usage: git blame [<options>] [<rev-opts>] [<rev>] [--] <file>
ok 101 - blame -L X (non-numeric X)

expecting success: 
	test_must_fail $PROG -L1,Y file

usage: git blame [<options>] [<rev-opts>] [<rev>] [--] <file>
ok 102 - blame -L X,Y (non-numeric Y)

expecting success: 
	test_must_fail $PROG -L1,+N file

usage: git blame [<options>] [<rev-opts>] [<rev>] [--] <file>
ok 103 - blame -L X,+N (non-numeric N)

expecting success: 
	test_must_fail $PROG -L1,-N file

usage: git blame [<options>] [<rev-opts>] [<rev>] [--] <file>
ok 104 - blame -L X,-N (non-numeric N)

expecting success: 
	test_must_fail $PROG -L1,^/99/ file

usage: git blame [<options>] [<rev-opts>] [<rev>] [--] <file>
ok 105 - blame -L ,^/RE/

expecting success: 
	git annotate file master >actual &&
	awk "{ print \$3; }" <actual >authors &&
	test 2 = $(grep A <authors | wc -l) &&
	test 2 = $(grep B <authors | wc -l)

ok 106 - annotate old revision

# passed all 106 test(s)
1..106
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
*** t8002-blame.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t8002-blame/.git/
warning: unable to rmdir sub1: Directory not empty
Updating 7141cca..af434d3
Fast-forward
expecting success: 
	echo "1A quick brown fox jumps over the" >file &&
	echo "lazy dog" >>file &&
	git add file &&
	GIT_AUTHOR_NAME="A" GIT_AUTHOR_EMAIL="A@test.git" \
	git commit -a -m "Initial."

 .gitmodules | 4 ----
 1 file changed, 4 deletions(-)
 delete mode 100644 .gitmodules
[master (root-commit) eed2b97] Initial.
 Author: A <A@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
ok 1 - setup A lines

expecting success: 
	check_count A 2

git blame -c  file 
Author A (expected 2, attributed 2) good
ok 2 - blame 1 author

expecting success: 
	echo "2A quick brown fox jumps over the" >>file &&
	echo "lazy dog" >>file &&
	GIT_AUTHOR_NAME="B" GIT_AUTHOR_EMAIL="B@test.git" \
	git commit -a -m "Second."

[master 79ac486] Second.
 Author: B <B@test.git>
 1 file changed, 2 insertions(+)
ok 3 - setup B lines

expecting success: 
	check_count A 2 B 2

git blame -c  file 
Author B (expected 2, attributed 2) good
Author A (expected 2, attributed 2) good
ok 4 - blame 2 authors

expecting success: 
	git checkout -b branch1 master &&
	echo "3A slow green fox jumps into the" >>file &&
	echo "well." >>file &&
	GIT_AUTHOR_NAME="B1" GIT_AUTHOR_EMAIL="B1@test.git" \
	git commit -a -m "Branch1-1"

Switched to a new branch 'branch1'
[branch1 83da4d1] Branch1-1
 Author: B1 <B1@test.git>
 1 file changed, 2 insertions(+)
ok 5 - setup B1 lines (branch1)

expecting success: 
	check_count A 2 B 2 B1 2

git blame -c  file 
ok 21 - git merge --ff: 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
		)
	
Author B (expected 2, attributed 2) good
Author A (expected 2, attributed 2) good
Author B1 (expected 2, attributed 2) good
ok 6 - blame 2 authors + 1 branch1 author

expecting success: 
	git checkout -b branch2 master &&
	sed -e "s/2A quick brown/4A quick brown lazy dog/" <file >file.new &&
	mv file.new file &&
	GIT_AUTHOR_NAME="B2" GIT_AUTHOR_EMAIL="B2@test.git" \
	git commit -a -m "Branch2-1"

Switched to a new branch 'branch2'
[branch2 e11417b] Branch2-1
 Author: B2 <B2@test.git>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 7 - setup B2 lines (branch2)

expecting success: 
	check_count A 2 B 1 B2 1

git blame -c  file 
ok 18 - GIT_DIFFTOOL_NO_PROMPT variable

expecting success: 
	difftool_test_setup &&
	test_config difftool.prompt false &&
	echo >input &&
	GIT_DIFFTOOL_PROMPT=true git difftool branch <input >output &&
	prompt=$(tail -1 <output) &&
	prompt_given "$prompt"

Author A (expected 2, attributed 2) good
Author B (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
ok 8 - blame 2 authors + 1 branch2 author

expecting success: 
	git merge branch1

Cloning into 'submodule_update'...
Merging:
e11417b Branch2-1
virtual branch1
found 1 common ancestor:
79ac486 Second.
Auto-merging file
Merge made by the 'recursive' strategy.
 file | 2 ++
 1 file changed, 2 insertions(+)
ok 9 - merge branch1 & branch2

expecting success: 
	check_count A 2 B 1 B1 2 B2 1

done.
git blame -c  file 
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Author A (expected 2, attributed 2) good
Author B (expected 1, attributed 1) good
Author B1 (expected 2, attributed 2) good
Author B2 (expected 1, attributed 1) good
ok 10 - blame 2 authors + 2 merged-in authors

expecting success: 
	check_count --first-parent A 2 B 1 "A U Thor" 2 B2 1

git blame -c  --first-parent file 
Author A (expected 2, attributed 2) good
Author B2 (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
Author A U Thor (expected 2, attributed 2) good
ok 11 - blame --first-parent blames merge for branch1

expecting success: 
	check_count -h master A 2 B 2

git blame -c  file master
Author A (expected 2, attributed 2) good
Author B (expected 2, attributed 2) good
ok 12 - blame ancestor

expecting success: 
	check_count -h master^ A 2

git blame -c  file master^
Author A (expected 2, attributed 2) good
ok 13 - blame great-ancestor

expecting success: 
	echo "evil merge." >>file &&
	git commit -a --amend

[branch2 c2ee234] Merge branch 'branch1' into branch2
 Author: A U Thor <author@example.com>
 Date: Wed Dec 16 11:07:20 2015 +0000
ok 14 - setup evil merge

expecting success: 
	check_count A 2 B 1 B1 2 B2 1 "A U Thor" 1

git blame -c  file 
Author B1 (expected 2, attributed 2) good
Author B (expected 1, attributed 1) good
Author A (expected 2, attributed 2) good
Author A U Thor (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
ok 15 - blame evil merge

expecting success: 
	test_when_finished "git checkout branch2" &&
	test_when_finished "rm -f .git/info/grafts" &&
	graft= &&
	for i in 0 1 2
	do
		for j in 0 1 2 3 4 5 6 7 8 9
		do
			git checkout --orphan "$i$j" &&
			printf "%s\n" "$i" "$j" >file &&
			test_tick &&
			GIT_AUTHOR_NAME=$i$j GIT_AUTHOR_EMAIL=$i$j@test.git \
			git commit -a -m "$i$j" &&
			commit=$(git rev-parse --verify HEAD) &&
			graft="$graft$commit "
		done
	done &&
	printf "%s " $graft >.git/info/grafts &&
	check_count -h 00 01 1 10 1

Switched to a new branch '00'
[00 (root-commit) e2c6177] 00
 Author: 00 <00@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '01'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
[01 (root-commit) 0dbe04b] 01
 Author: 01 <01@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '02'
[02 (root-commit) 97fbca6] 02
 Author: 02 <02@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '03'
[03 (root-commit) 5cdbcd8] 03
 Author: 03 <03@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Cloning into 'sub1'...
Switched to a new branch '04'
[04 (root-commit) 5a154cf] 04
 Author: 04 <04@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '05'
done.
[05 (root-commit) a84e1de] 05
 Author: 05 <05@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '06'
[06 (root-commit) d4bea54] 06
 Author: 06 <06@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '07'
[07 (root-commit) 24ba6e8] 07
 Author: 07 <07@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '08'
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
[08 (root-commit) fe90088] 08
 Author: 08 <08@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '09'
[09 (root-commit) 773a2fb] 09
 Author: 09 <09@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
error: The following untracked working tree files would be overwritten by merge:
Switched to a new branch '10'
	sub1/file1
	sub1/file2
Please move or remove them before you can merge.
Aborting
Updating 7141cca..0abcf00
[10 (root-commit) 80536e5] 10
 Author: 10 <10@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '11'
[11 (root-commit) 33c07c1] 11
 Author: 11 <11@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
ok 19 - GIT_DIFFTOOL_PROMPT variable

Switched to a new branch '12'
ok 22 - git merge --ff: 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
		)
	
expecting success: 
	difftool_test_setup &&
	test_config difftool.prompt false &&
	echo branch >expect &&
	git difftool branch >actual &&
	test_cmp expect actual

[12 (root-commit) ae7094b] 12
 Author: 12 <12@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '13'
[13 (root-commit) 19e767d] 13
 Author: 13 <13@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '14'
Cloning into 'submodule_update'...
[14 (root-commit) f7159ac] 14
 Author: 14 <14@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
done.
Switched to a new branch '15'
Switched to a new branch 'add_sub1'
[15 (root-commit) d95fecf] 15
 Author: 15 <15@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Switched to a new branch '16'
[16 (root-commit) d8bfdb9] 16
 Author: 16 <16@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '17'
[17 (root-commit) aa3f31e] 17
 Author: 17 <17@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '18'
[18 (root-commit) d76cb1d] 18
 Author: 18 <18@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '19'
[19 (root-commit) 95e03c5] 19
 Author: 19 <19@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '20'
[20 (root-commit) d40a964] 20
 Author: 20 <20@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
Switched to a new branch '21'
[21 (root-commit) 6c3def2] 21
 Author: 21 <21@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '22'
[22 (root-commit) 78d2294] 22
 Author: 22 <22@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Cloning into 'sub1'...
Switched to a new branch '23'
[23 (root-commit) 76a64d0] 23
 Author: 23 <23@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Merging:
submod

done.
Switched to a new branch '24'
[24 (root-commit) 59f234a] 24
 Author: 24 <24@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Submodule merge conflict for 'submod':
  {local}: submodule commit 5b592f796c80b49a0e8916069c72cb3527ae3597
  {remote}: deleted
Switched to a new branch '25'
Use (l)ocal or (r)emote, or (a)bort? [25 (root-commit) 26ac47a] 25
 Author: 25 <25@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '26'
[26 (root-commit) db7e855] 26
 Author: 26 <26@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '27'
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
[27 (root-commit) 279f565] 27
 Author: 27 <27@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
Switched to a new branch '28'
[28 (root-commit) f691d9c] 28
 Author: 28 <28@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
ok 20 - difftool.prompt config variable is false

expecting success: 
	difftool_test_setup &&
	test_might_fail git config --unset difftool.prompt &&
	test_config mergetool.prompt false &&
	echo branch >expect &&
	git difftool branch >actual &&
	test_cmp expect actual

Switched to a new branch '29'
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
[29 (root-commit) c72134e] 29
 Author: 29 <29@test.git>
 1 file changed, 2 insertions(+)
 create mode 100644 file
git blame -c  file 00
Author 10 (expected 1, attributed 1) good
Author 01 (expected 1, attributed 1) good
Switched to branch 'branch2'
ok 16 - blame huge graft

expecting success: 
	echo "incomplete" | tr -d "\\012" >>file &&
	GIT_AUTHOR_NAME="C" GIT_AUTHOR_EMAIL="C@test.git" \
	git commit -a -m "Incomplete"

error: The following untracked working tree files would be overwritten by merge:
	sub1/file1
	sub1/file2
Please move or remove them before you can merge.
Aborting
Updating 7141cca..0abcf00
[test6.c 3cdce36] Merge resolved by deleting module
 Author: A U Thor <author@example.com>
[branch2 0e53bef] Incomplete
 Author: C <C@test.git>
 1 file changed, 1 insertion(+)
ok 17 - setup incomplete line

expecting success: 
	check_count A 2 B 1 B1 2 B2 1 "A U Thor" 1 C 1

git blame -c  file 
Author C (expected 1, attributed 1) good
Author B1 (expected 2, attributed 2) good
Author B2 (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
Author A (expected 2, attributed 2) good
Author A U Thor (expected 1, attributed 1) good
ok 18 - blame incomplete line

expecting success: 
	mv file file.orig &&
	{
		cat file.orig &&
		echo
	} | sed -e "s/^3A/99/" -e "/^1A/d" -e "/^incomplete/d" >file &&
	echo "incomplete" | tr -d "\\012" >>file &&
	GIT_AUTHOR_NAME="D" GIT_AUTHOR_EMAIL="D@test.git" \
	git commit -a -m "edit"

Switched to a new branch 'test6.d'
[branch2 2847af6] edit
 Author: D <D@test.git>
 1 file changed, 1 insertion(+), 2 deletions(-)
ok 19 - setup edits

expecting success: 
	check_count A 1 B 1 B1 1 B2 1 "A U Thor" 1 C 1 D 1

git blame -c  file 
Author B2 (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
Author A U Thor (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
Author C (expected 1, attributed 1) good
ok 20 - blame edits

expecting success: 
	echo "No robots allowed" >file.new &&
	cat file >>file.new &&
	mv file.new file &&
	GIT_AUTHOR_NAME="E" GIT_AUTHOR_EMAIL="E at test dot git" \
	git commit -a -m "norobots"

ok 23 - git merge --ff: 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
		)
	
[branch2 7e7a143] norobots
 Author: E <E at test dot git>
 1 file changed, 1 insertion(+)
ok 21 - setup obfuscated email

expecting success: 
	check_count A 1 B 1 B1 1 B2 1 "A U Thor" 1 C 1 D 1 E 1

git blame -c  file 
Author A U Thor (expected 1, attributed 1) good
Author E (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
Author C (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
ok 22 - blame obfuscated email

expecting success: 
	check_count -L1 A 1 B 1 B1 1 B2 1 "A U Thor" 1 C 1 D 1 E 1

git blame -c  -L1 file 
Author E (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
Author A U Thor (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
Author C (expected 1, attributed 1) good
ok 23 - blame -L 1 (all)

expecting success: 
	check_count -L, A 1 B 1 B1 1 B2 1 "A U Thor" 1 C 1 D 1 E 1

git blame -c  -L, file 
Author B2 (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
Author E (expected 1, attributed 1) good
Author A U Thor (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
Author C (expected 1, attributed 1) good
ok 24 - blame -L , (all)

expecting success: 
	check_count -L5 B1 1 C 1 D 1 "A U Thor" 1

git blame -c  -L5 file 
Merging:
48ba24d master updates
virtual test6
found 1 common ancestor:
c0d6d4d add initial versions
CONFLICT (modify/delete): submod deleted in test6 and modified in HEAD. Version HEAD of submod left in tree at submod~HEAD.
Auto-merging subdir/file3
CONFLICT (content): Merge conflict in subdir/file3
Auto-merging spaced name
CONFLICT (content): Merge conflict in spaced name
Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
CONFLICT (modify/delete): file12 deleted in test6 and modified in HEAD. Version HEAD of file12 left in tree.
CONFLICT (modify/delete): file11 deleted in HEAD and modified in test6. Version test6 of file11 left in tree.
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Auto-merging both
CONFLICT (add/add): Merge conflict in both
Cloning into 'submodule_update'...
Resolved 'both' using previous resolution.
Resolved 'file1' using previous resolution.
Resolved 'file2' using previous resolution.
Resolved 'spaced name' using previous resolution.
Resolved 'subdir/file3' using previous resolution.
Automatic merge failed; fix conflicts and then commit the result.
Author C (expected 1, attributed 1) good
Author A U Thor (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
ok 25 - blame -L X (X to end)

expecting success: 
	check_count -L5, B1 1 C 1 D 1 "A U Thor" 1

git blame -c  -L5, file 
done.
Author C (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
Author A U Thor (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
ok 26 - blame -L X, (X to end)

expecting success: 
	check_count -L,3 A 1 B2 1 E 1

git blame -c  -L,3 file 
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Author B2 (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
Author E (expected 1, attributed 1) good
ok 27 - blame -L ,Y (up to Y)

expecting success: 
	check_count -L3,3 B2 1

git blame -c  -L3,3 file 
Author B2 (expected 1, attributed 1) good
ok 28 - blame -L X,X

expecting success: 
	check_count -L3,6 B 1 B1 1 B2 1 D 1

git blame -c  -L3,6 file 
Author B (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
ok 29 - blame -L X,Y

expecting success: 
	check_count -L6,3 B 1 B1 1 B2 1 D 1

git blame -c  -L6,3 file 
Author B1 (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
ok 30 - blame -L Y,X (undocumented)

expecting success: 
	test_must_fail $PROG -L-1 file

fatal: -L invalid line number: -1
ok 31 - blame -L -X

expecting success: 
	test_must_fail $PROG -L0 file

fatal: -L invalid line number: 0
ok 32 - blame -L 0

expecting success: 
	test_must_fail $PROG -L,0 file

fatal: -L invalid line number: 0
ok 33 - blame -L ,0

expecting success: 
	test_must_fail $PROG -L,+0 file

fatal: -L invalid empty range
ok 34 - blame -L ,+0

expecting success: 
	test_must_fail $PROG -L1,+0 file

fatal: -L invalid empty range
ok 35 - blame -L X,+0

expecting success: 
	check_count -L3,+1 B2 1

git blame -c  -L3,+1 file 
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
Author B2 (expected 1, attributed 1) good
ok 36 - blame -L X,+1

expecting success: 
	check_count -L3,+4 B 1 B1 1 B2 1 D 1

git blame -c  -L3,+4 file 
Author D (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
ok 37 - blame -L X,+N

expecting success: 
	test_must_fail $PROG -L,-0 file

fatal: -L invalid empty range
ok 38 - blame -L ,-0

expecting success: 
	test_must_fail $PROG -L1,-0 file

fatal: -L invalid empty range
ok 39 - blame -L X,-0

expecting success: 
	check_count -L3,-1 B2 1

git blame -c  -L3,-1 file 
Cloning into 'sub1'...
Author B2 (expected 1, attributed 1) good
ok 40 - blame -L X,-1

expecting success: 
	check_count -L6,-4 B 1 B1 1 B2 1 D 1

done.
git blame -c  -L6,-4 file 
Author D (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
ok 41 - blame -L X,-N

expecting success: 
	check_count -L/evil/ C 1 "A U Thor" 1

git blame -c  -L/evil/ file 
ok 21 - difftool merge.prompt = false

Author A U Thor (expected 1, attributed 1) good
Author C (expected 1, attributed 1) good
ok 42 - blame -L /RE/ (RE to end)

expecting success: 
	check_count -L/robot/,/green/ A 1 B 1 B2 1 D 1 E 1

expecting success: 
	difftool_test_setup &&
	test_config difftool.prompt true &&
	echo branch >expect &&
	git difftool -y branch >actual &&
	test_cmp expect actual

git blame -c  -L/robot/,/green/ file 
Author B (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
Author E (expected 1, attributed 1) good
ok 43 - blame -L /RE/,/RE2/

expecting success: 
	check_count -L5,/evil/ B1 1 D 1 "A U Thor" 1

git blame -c  -L5,/evil/ file 
Author A U Thor (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
ok 44 - blame -L X,/RE/

expecting success: 
	check_count -L/99/,7 B1 1 D 1 "A U Thor" 1

git blame -c  -L/99/,7 file 
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
Author A U Thor (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
ok 45 - blame -L /RE/,Y

expecting success: 
	check_count -L/99/,+3 B1 1 D 1 "A U Thor" 1

git blame -c  -L/99/,+3 file 
Author B1 (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
Author A U Thor (expected 1, attributed 1) good
ok 46 - blame -L /RE/,+N

expecting success: 
	check_count -L/99/,-3 B 1 B2 1 D 1

git blame -c  -L/99/,-3 file 
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
Author B2 (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
ok 47 - blame -L /RE/,-N

expecting success: 
	n=$(expr $(wc -l <file) + 1) &&
	check_count -L$n C 1

Updating 7141cca..3d0ed3b
Fast-forward
git blame -c  -L8 file 
 .gitmodules | 4 ----
 sub1        | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
test_must_fail: command succeeded: git merge --ff replace_sub1_with_file
Author C (expected 1, attributed 1) good
ok 48 - blame -L X (X == nlines)

expecting success: 
	n=$(expr $(wc -l <file) + 2) &&
	test_must_fail $PROG -L$n file

fatal: file file has only 8 lines
not ok 24 - git merge --ff: 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 49 - blame -L X (X == nlines + 1)

expecting success: 
	test_must_fail $PROG -L12345 file

fatal: file file has only 8 lines
ok 50 - blame -L X (X > nlines)

expecting success: 
	n=$(expr $(wc -l <file) + 1) &&
	check_count -L,$n A 1 B 1 B1 1 B2 1 "A U Thor" 1 C 1 D 1 E 1

git blame -c  -L,8 file 
Author A U Thor (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
Author C (expected 1, attributed 1) good
Author E (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
ok 51 - blame -L ,Y (Y == nlines)

expecting success: 
	n=$(expr $(wc -l <file) + 2) &&
	test_must_fail $PROG -L,$n file

Cloning into 'submodule_update'...
fatal: file file has only 8 lines
ok 52 - blame -L ,Y (Y == nlines + 1)

expecting success: 
	test_must_fail $PROG -L,12345 file

fatal: file file has only 8 lines
ok 53 - blame -L ,Y (Y > nlines)

expecting success: 
	check_count -L2,3 -L6,7 A 1 B1 1 B2 1 "A U Thor" 1

git blame -c  -L2,3 -L6,7 file 
done.
Author B1 (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
Author A U Thor (expected 1, attributed 1) good
ok 54 - blame -L multiple (disjoint)

expecting success: 
	check_count -L6,7 -L2,3 A 1 B1 1 B2 1 "A U Thor" 1

git blame -c  -L6,7 -L2,3 file 
Author A (expected 1, attributed 1) good
Author A U Thor (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
ok 55 - blame -L multiple (disjoint: unordered)

expecting success: 
	check_count -L2,3 -L4,5 A 1 B 1 B2 1 D 1

git blame -c  -L2,3 -L4,5 file 
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Author B (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
ok 56 - blame -L multiple (adjacent)

expecting success: 
	check_count -L4,5 -L2,3 A 1 B 1 B2 1 D 1

git blame -c  -L4,5 -L2,3 file 
Author A (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
ok 57 - blame -L multiple (adjacent: unordered)

expecting success: 
	check_count -L2,4 -L3,5 A 1 B 1 B2 1 D 1

git blame -c  -L2,4 -L3,5 file 
Author D (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
ok 58 - blame -L multiple (overlapping)

expecting success: 
	check_count -L3,5 -L2,4 A 1 B 1 B2 1 D 1

git blame -c  -L3,5 -L2,4 file 
Author A (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
ok 59 - blame -L multiple (overlapping: unordered)

expecting success: 
	check_count -L2,8 -L3,5 A 1 B 1 B1 1 B2 1 C 1 D 1 "A U Thor" 1

git blame -c  -L2,8 -L3,5 file 
Author C (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
Author A U Thor (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
ok 60 - blame -L multiple (superset/subset)

expecting success: 
	check_count -L3,5 -L2,8 A 1 B 1 B1 1 B2 1 C 1 D 1 "A U Thor" 1

git blame -c  -L3,5 -L2,8 file 
Author A (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
Author C (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
Author A U Thor (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
ok 61 - blame -L multiple (superset/subset: unordered)

expecting success: 
	check_count -L3,3 -L/fox/ B1 1 B2 1 C 1 D 1 "A U Thor" 1

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
git blame -c  -L3,3 -L/fox/ file 
Author A U Thor (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
Author C (expected 1, attributed 1) good
ok 62 - blame -L /RE/ (relative)

expecting success: 
	check_count -L/dog/ A 1 B 1 B1 1 B2 1 C 1 D 1 "A U Thor" 1

git blame -c  -L/dog/ file 
Author A U Thor (expected 1, attributed 1) good
Author B (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
Author C (expected 1, attributed 1) good
Author B1 (expected 1, attributed 1) good
Author D (expected 1, attributed 1) good
ok 63 - blame -L /RE/ (relative: no preceding range)

expecting success: 
	check_count -L1,1 -L/dog/,+1 A 1 E 1

git blame -c  -L1,1 -L/dog/,+1 file 
ok 22 - difftool.prompt can overridden with -y

Cloning into 'sub1'...
expecting success: 
	difftool_test_setup &&
	test_config difftool.prompt false &&
	echo >input &&
	git difftool --prompt branch <input >output &&
	prompt=$(tail -1 <output) &&
	prompt_given "$prompt"

Author E (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
ok 64 - blame -L /RE/ (relative: adjacent)

expecting success: 
	test_must_fail $PROG -L4,4 -L/dog/ file

fatal: -L parameter 'dog' starting at line 5: No match
ok 65 - blame -L /RE/ (relative: not found)

expecting success: 
	test_must_fail $PROG -L, -L/$/ file

done.
fatal: file file has only 8 lines
ok 66 - blame -L /RE/ (relative: end-of-file)

expecting success: 
	check_count -L3,3 -L^/dog/,+2 A 1 B2 1

git blame -c  -L3,3 -L^/dog/,+2 file 
Author A (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
ok 67 - blame -L ^/RE/ (absolute)

expecting success: 
	check_count -L^/dog/,+2 A 1 B2 1

git blame -c  -L^/dog/,+2 file 
Author A (expected 1, attributed 1) good
Author B2 (expected 1, attributed 1) good
ok 68 - blame -L ^/RE/ (absolute: no preceding range)

expecting success: 
	test_must_fail $PROG -L4,4 -L^/tambourine/ file

fatal: -L parameter 'tambourine' starting at line 1: No match
ok 69 - blame -L ^/RE/ (absolute: not found)

expecting success: 
	n=$(expr $(wc -l <file) + 1) &&
	check_count -L$n -L^/$/,+2 A 1 C 1 E 1

git blame -c  -L8 -L^/$/,+2 file 
Author C (expected 1, attributed 1) good
Author E (expected 1, attributed 1) good
Author A (expected 1, attributed 1) good
ok 70 - blame -L ^/RE/ (absolute: end-of-file)

expecting success: 
	tr Q "\\t" >hello.c <<-\EOF &&
	int main(int argc, const char *argv[])
	{
	Qputs("hello");
	}
	EOF
	git add hello.c &&
	GIT_AUTHOR_NAME="F" GIT_AUTHOR_EMAIL="F@test.git" \
	git commit -m "hello" &&

	mv hello.c hello.orig &&
	sed -e "/}/ {x; s/$/Qputs(\"goodbye\");/; G;}" <hello.orig |
	tr Q "\\t" >hello.c &&
	GIT_AUTHOR_NAME="G" GIT_AUTHOR_EMAIL="G@test.git" \
	git commit -a -m "goodbye" &&

	mv hello.c hello.orig &&
	echo "#include <stdio.h>" >hello.c &&
	cat hello.orig >>hello.c &&
	tr Q "\\t" >>hello.c <<-\EOF &&
	void mail()
	{
	Qputs("mail");
	}
	EOF
	GIT_AUTHOR_NAME="H" GIT_AUTHOR_EMAIL="H@test.git" \
	git commit -a -m "mail"

Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
[branch2 bed4f90] hello
 Author: F <F@test.git>
 1 file changed, 4 insertions(+)
 create mode 100644 hello.c
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
[branch2 8eddaa3] goodbye
 Author: G <G@test.git>
 1 file changed, 1 insertion(+)
[branch2 e691c6f] mail
 Author: H <H@test.git>
 1 file changed, 5 insertions(+)
ok 71 - setup -L :regex

expecting success: 
	check_count -f hello.c -L:main F 4 G 1

git blame -c  -L:main hello.c 
Author F (expected 4, attributed 4) good
Author G (expected 1, attributed 1) good
ok 72 - blame -L :literal

expecting success: 
	check_count -f hello.c "-L:m[a-z][a-z]l" H 4

git blame -c  -L:m[a-z][a-z]l hello.c 
Author H (expected 4, attributed 4) good
ok 73 - blame -L :regex

expecting success: 
	test_must_fail $PROG -L:nomatch hello.c

fatal: -L parameter 'nomatch' starting at line 1: no match
ok 74 - blame -L :nomatch

expecting success: 
	check_count -f hello.c -L3,3 -L:ma.. F 1 H 4

git blame -c  -L3,3 -L:ma.. hello.c 
Updating 7141cca..3d0ed3b
Fast-forward
 .gitmodules | 4 ----
 sub1        | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
test_must_fail: command succeeded: git merge --ff replace_sub1_with_file
Author H (expected 4, attributed 4) good
Author F (expected 1, attributed 1) good
ok 75 - blame -L :RE (relative)

expecting success: 
	check_count -f hello.c -L:ma.. F 4 G 1

git blame -c  -L:ma.. hello.c 
Author G (expected 1, attributed 1) good
Author F (expected 4, attributed 4) good
ok 76 - blame -L :RE (relative: no preceding range)

expecting success: 
	test_must_fail $PROG -L3,3 -L:tambourine hello.c

not ok 25 - git merge --ff: 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
		)
	
fatal: -L parameter 'tambourine' starting at line 4: no match
ok 77 - blame -L :RE (relative: not found)

expecting success: 
	test_must_fail $PROG -L, -L:main hello.c

fatal: -L parameter 'main' starting at line 11: no match
ok 78 - blame -L :RE (relative: end-of-file)

expecting success: 
	check_count -f hello.c -L3,3 -L^:ma.. F 4 G 1

git blame -c  -L3,3 -L^:ma.. hello.c 
Author F (expected 4, attributed 4) good
Author G (expected 1, attributed 1) good
ok 79 - blame -L ^:RE (absolute)

expecting success: 
	check_count -f hello.c -L^:ma.. F 4 G 1

git blame -c  -L^:ma.. hello.c 
Author F (expected 4, attributed 4) good
Author G (expected 1, attributed 1) good
ok 80 - blame -L ^:RE (absolute: no preceding range)

expecting success: 
	test_must_fail $PROG -L4,4 -L^:tambourine hello.c

Cloning into 'submodule_update'...
fatal: -L parameter 'tambourine' starting at line 1: no match
ok 81 - blame -L ^:RE (absolute: not found)

expecting success: 
	n=$(printf "%d" $(wc -l <hello.c)) &&
	check_count -f hello.c -L$n -L^:ma.. F 4 G 1 H 1

git blame -c  -L10 -L^:ma.. hello.c 
done.
Author H (expected 1, attributed 1) good
Author G (expected 1, attributed 1) good
Author F (expected 4, attributed 4) good
ok 82 - blame -L ^:RE (absolute: end-of-file)

expecting success: 
	(
	GIT_AUTHOR_NAME=I &&
	export GIT_AUTHOR_NAME &&
	GIT_AUTHOR_EMAIL=I@test.git &&
	export GIT_AUTHOR_EMAIL &&
	>incremental &&
	git add incremental &&
	git commit -m "step 0" &&
	printf "partial" >>incremental &&
	git commit -a -m "step 0.5" &&
	echo >>incremental &&
	git commit -a -m "step 1"
	)

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
[branch2 283d4ce] step 0
 Author: I <I@test.git>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 incremental
Merging:
submod

[branch2 88ca202] step 0.5
 Author: I <I@test.git>
 1 file changed, 1 insertion(+)
[branch2 a667a79] step 1
 Author: I <I@test.git>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 83 - setup incremental

expecting success: 
	check_count -h HEAD^^ -f incremental

git blame -c  incremental HEAD^^
Submodule merge conflict for 'submod':
ok 84 - blame empty

expecting success: 
	test_must_fail $PROG -L0 incremental HEAD^^

  {local}: submodule commit 5b592f796c80b49a0e8916069c72cb3527ae3597
  {remote}: deleted
fatal: -L invalid line number: 0
Use (l)ocal or (r)emote, or (a)bort? ok 85 - blame -L 0 empty

expecting success: 
	test_must_fail $PROG -L1 incremental HEAD^^

fatal: file incremental has only 0 lines
ok 86 - blame -L 1 empty

expecting success: 
	test_must_fail $PROG -L2 incremental HEAD^^

fatal: file incremental has only 0 lines
ok 87 - blame -L 2 empty

expecting success: 
	check_count -h HEAD^ -f incremental I 1

git blame -c  incremental HEAD^
Author I (expected 1, attributed 1) good
ok 23 - difftool.prompt can overridden with --prompt

ok 88 - blame half

expecting success: 
	test_must_fail $PROG -L0 incremental HEAD^

expecting success: 
	difftool_test_setup &&
	echo branch >expect &&
	git difftool --prompt --no-prompt branch >actual &&
	test_cmp expect actual &&
	echo >input &&
	git difftool --no-prompt --prompt branch <input >output &&
	prompt=$(tail -1 <output) &&
	prompt_given "$prompt"

fatal: -L invalid line number: 0
ok 89 - blame -L 0 half

expecting success: 
	check_count -h HEAD^ -f incremental -L1 I 1

git blame -c  -L1 incremental HEAD^
Author I (expected 1, attributed 1) good
ok 90 - blame -L 1 half

expecting success: 
	test_must_fail $PROG -L2 incremental HEAD^

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
fatal: file incremental has only 1 lines
ok 91 - blame -L 2 half

expecting success: 
	test_must_fail $PROG -L3 incremental HEAD^

fatal: file incremental has only 1 lines
ok 92 - blame -L 3 half

expecting success: 
	check_count -f incremental I 1

git blame -c  incremental 
Author I (expected 1, attributed 1) good
ok 93 - blame full

expecting success: 
	test_must_fail $PROG -L0 incremental

fatal: -L invalid line number: 0
ok 94 - blame -L 0 full

expecting success: 
	check_count -f incremental -L1 I 1

git blame -c  -L1 incremental 
Author I (expected 1, attributed 1) good
ok 95 - blame -L 1 full

expecting success: 
	test_must_fail $PROG -L2 incremental

fatal: file incremental has only 1 lines
ok 96 - blame -L 2 full

expecting success: 
	test_must_fail $PROG -L3 incremental

Cloning into 'sub1'...
fatal: file incremental has only 1 lines
ok 97 - blame -L 3 full

expecting success: 
	test_must_fail $PROG -L file

usage: git blame [<options>] [<rev-opts>] [<rev>] [--] <file>
    <rev-opts> are documented in git-rev-list(1)

    --incremental         Show blame entries as we find them, incrementally
    -b                    Show blank SHA-1 for boundary commits (Default: off)
    --root                Do not treat root commits as boundaries (Default: off)
    --show-stats          Show work cost statistics
    --score-debug         Show output score for blame entries
    -f, --show-name       Show original filename (Default: auto)
    -n, --show-number     Show original linenumber (Default: off)
    -p, --porcelain       Show in a format designed for machine consumption
    --line-porcelain      Show porcelain format with per-line commit information
    -c                    Use the same output mode as git-annotate (Default: off)
    -t                    Show raw timestamp (Default: off)
    -l                    Show long commit SHA1 (Default: off)
    -s                    Suppress author name and timestamp (Default: off)
    -e, --show-email      Show author email instead of name (Default: off)
    -w                    Ignore whitespace differences
    --minimal             Spend extra cycles to find better match
    -S <file>             Use revisions from <file> instead of calling git-rev-list
    --contents <file>     Use <file>'s contents as the final image
    -C[<score>]           Find line copies within and across files
    -M[<score>]           Find line movements within and across files
    -L <n,m>              Process only line range n,m, counting from 1
    --abbrev[=<n>]        use <n> digits to display SHA-1s


ok 98 - blame -L

expecting success: 
	test_must_fail $PROG -L1,+ file

usage: git blame [<options>] [<rev-opts>] [<rev>] [--] <file>
ok 99 - blame -L X,+

expecting success: 
	test_must_fail $PROG -L1,- file

done.
usage: git blame [<options>] [<rev-opts>] [<rev>] [--] <file>
ok 100 - blame -L X,-

expecting success: 
	test_must_fail $PROG -LX file

usage: git blame [<options>] [<rev-opts>] [<rev>] [--] <file>
ok 101 - blame -L X (non-numeric X)

expecting success: 
	test_must_fail $PROG -L1,Y file

usage: git blame [<options>] [<rev-opts>] [<rev>] [--] <file>
ok 102 - blame -L X,Y (non-numeric Y)

expecting success: 
	test_must_fail $PROG -L1,+N file

usage: git blame [<options>] [<rev-opts>] [<rev>] [--] <file>
ok 103 - blame -L X,+N (non-numeric N)

expecting success: 
	test_must_fail $PROG -L1,-N file

usage: git blame [<options>] [<rev-opts>] [<rev>] [--] <file>
ok 104 - blame -L X,-N (non-numeric N)

expecting success: 
	test_must_fail $PROG -L1,^/99/ file

usage: git blame [<options>] [<rev-opts>] [<rev>] [--] <file>
ok 105 - blame -L ,^/RE/

expecting success: 
	check_count \
		"<A@test.git>" 1 \
		"<B@test.git>" 1 \
		"<B1@test.git>" 1 \
		"<B2@test.git>" 1 \
		"<author@example.com>" 1 \
		"<C@test.git>" 1 \
		"<D@test.git>" 1 \
		"<E at test dot git>" 1

git blame -c -e  file 
[test6.d 74369a4] Merge resolved by keeping module
 Author: A U Thor <author@example.com>
HEAD is now at 74369a4 Merge resolved by keeping module
ok 11 - deleted vs modified submodule

expecting success: 
	git checkout -b test7 branch1 &&
	git submodule update -N &&
	mv submod submod-movedaside &&
	git rm --cached submod &&
	echo not a submodule >submod &&
	git add submod &&
	git commit -m "Submodule path becomes file" &&
	git checkout -b test7.a branch1 &&
	test_must_fail git merge master &&
	test -n "$(git ls-files -u)" &&
	( yes "" | git mergetool file1 file2 spaced\ name subdir/file3 >/dev/null 2>&1 ) &&
	( yes "" | git mergetool both >/dev/null 2>&1 ) &&
	( yes "d" | git mergetool file11 file12 >/dev/null 2>&1 ) &&
	( yes "r" | git mergetool submod ) &&
	rmdir submod && mv submod-movedaside submod &&
	test "$(cat submod/bar)" = "branch1 submodule" &&
	git submodule update -N &&
	test "$(cat submod/bar)" = "master submodule" &&
	output="$(git mergetool --no-prompt)" &&
	test "$output" = "No files need merging" &&
	git commit -m "Merge resolved by keeping module" &&

	mv submod submod-movedaside &&
	git checkout -b test7.b test7 &&
	test_must_fail git merge master &&
	test -n "$(git ls-files -u)" &&
	( yes "" | git mergetool file1 file2 spaced\ name subdir/file3 >/dev/null 2>&1 ) &&
	( yes "" | git mergetool both >/dev/null 2>&1 ) &&
	( yes "d" | git mergetool file11 file12 >/dev/null 2>&1 ) &&
	( yes "l" | git mergetool submod ) &&
	git submodule update -N &&
	test "$(cat submod)" = "not a submodule" &&
	output="$(git mergetool --no-prompt)" &&
	test "$output" = "No files need merging" &&
	git commit -m "Merge resolved by keeping file" &&

	git checkout -b test7.c master &&
	rmdir submod && mv submod-movedaside submod &&
	test ! -e submod.orig &&
	git submodule update -N &&
	test_must_fail git merge test7 &&
	test -n "$(git ls-files -u)" &&
	( yes "" | git mergetool file1 file2 spaced\ name subdir/file3 >/dev/null 2>&1 ) &&
	( yes "" | git mergetool both >/dev/null 2>&1 ) &&
	( yes "d" | git mergetool file11 file12 >/dev/null 2>&1 ) &&
	( yes "r" | git mergetool submod ) &&
	test -d submod.orig &&
	git submodule update -N &&
	test "$(cat submod)" = "not a submodule" &&
	output="$(git mergetool --no-prompt)" &&
	test "$output" = "No files need merging" &&
	git commit -m "Merge resolved by keeping file" &&

	git checkout -b test7.d master &&
	rmdir submod && mv submod.orig submod &&
	git submodule update -N &&
	test_must_fail git merge test7 &&
	test -n "$(git ls-files -u)" &&
	( yes "" | git mergetool file1 file2 spaced\ name subdir/file3 >/dev/null 2>&1 ) &&
	( yes "" | git mergetool both>/dev/null 2>&1 ) &&
	( yes "d" | git mergetool file11 file12 >/dev/null 2>&1 ) &&
	( yes "l" | git mergetool submod ) &&
	test "$(cat submod/bar)" = "master submodule" &&
	git submodule update -N &&
	test "$(cat submod/bar)" = "master submodule" &&
	output="$(git mergetool --no-prompt)" &&
	test "$output" = "No files need merging" &&
	git commit -m "Merge resolved by keeping module"

Author <C@test.git> (expected 1, attributed 1) good
Author <D@test.git> (expected 1, attributed 1) good
Author <E at test dot git> (expected 1, attributed 1) good
Author <B1@test.git> (expected 1, attributed 1) good
Author <A@test.git> (expected 1, attributed 1) good
Author <B2@test.git> (expected 1, attributed 1) good
Author <B@test.git> (expected 1, attributed 1) good
Author <author@example.com> (expected 1, attributed 1) good
ok 106 - blame --show-email

expecting success: 
	echo "bin: test number 1" >one &&
	git add one &&
	GIT_AUTHOR_NAME=name1 \
	GIT_AUTHOR_EMAIL=email1@test.git \
	git commit -m First --date="2010-01-01 01:00:00" &&
	cat >expected_n <<-\EOF &&
	(name1 2010-01-01 01:00:00 +0000 1) bin: test number 1
	EOF
	cat >expected_e <<-\EOF
	(<email1@test.git> 2010-01-01 01:00:00 +0000 1) bin: test number 1
	EOF

Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
Switched to a new branch 'test7'
M	submod
[branch2 792f13d] First
 Author: name1 <email1@test.git>
 Date: Fri Jan 1 01:00:00 2010 +0000
 1 file changed, 1 insertion(+)
 create mode 100644 one
ok 107 - setup showEmail tests

expecting success: 
	git blame one >blame &&
	find_blame <blame >result &&
	test_cmp expected_n result

ok 108 - blame with no options and no config

expecting success: 
	git blame --show-email one >blame1 &&
	find_blame <blame1 >result &&
	test_cmp expected_e result &&
	git blame -e one >blame2 &&
	find_blame <blame2 >result &&
	test_cmp expected_e result &&
	git blame --no-show-email one >blame3 &&
	find_blame <blame3 >result &&
	test_cmp expected_n result

Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
Updating 7141cca..ec55a65
Fast-forward
ok 109 - blame with showemail options

expecting success: 
	git config blame.showEmail false &&
	git blame one >blame1 &&
	find_blame <blame1 >result &&
	test_cmp expected_n result &&
	git blame --show-email one >blame2 &&
	find_blame <blame2 >result &&
	test_cmp expected_e result &&
	git blame -e one >blame3 &&
	find_blame <blame3 >result &&
	test_cmp expected_e result &&
	git blame --no-show-email one >blame4 &&
	find_blame <blame4 >result &&
	test_cmp expected_n result

Submodule path 'submod': checked out 'f1e79731463601167179811363c6dab0cdc96e35'
ok 110 - blame with showEmail config false

expecting success: 
	git config blame.showEmail true &&
	git blame one >blame1 &&
	find_blame <blame1 >result &&
	test_cmp expected_e result &&
	git blame --no-show-email one >blame2 &&
	find_blame <blame2 >result &&
	test_cmp expected_n result

rm 'submod'
[test7 297d652] Submodule path becomes file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
 mode change 160000 => 100644 submod
ok 111 - blame with showEmail config true

Switched to a new branch 'test7.a'
# passed all 111 test(s)
1..111
warning: Failed to merge submodule submod (not checked out)
Resolved 'both' using previous resolution.
Resolved 'file1' using previous resolution.
Resolved 'file2' using previous resolution.
Resolved 'spaced name' using previous resolution.
Resolved 'subdir/file3' using previous resolution.
Merging:
fb5c1b3 branch1 changes
virtual master
found 1 common ancestor:
c0d6d4d add initial versions
Auto-merging submod
CONFLICT (submodule): Merge conflict in submod
Auto-merging subdir/file3
CONFLICT (content): Merge conflict in subdir/file3
Auto-merging spaced name
CONFLICT (content): Merge conflict in spaced name
Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
CONFLICT (modify/delete): file12 deleted in HEAD and modified in master. Version master of file12 left in tree.
CONFLICT (modify/delete): file11 deleted in master and modified in HEAD. Version HEAD of file11 left in tree.
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Auto-merging both
CONFLICT (add/add): Merge conflict in both
Automatic merge failed; fix conflicts and then commit the result.
Submodule path 'sub1': checked out '16f35dbe1b011ba099b95d9716033ba6d1f02026'
*** t8003-blame-corner-cases.sh ***
ok 26 - git merge --ff: 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
		)
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t8003-blame-corner-cases/.git/
expecting success: 

	echo A A A A A >one &&
	echo B B B B B >two &&
	echo C C C C C >tres &&
	echo ABC >mouse &&
	for i in 1 2 3 4 5 6 7 8 9
	do
		echo $i
	done >nine_lines &&
	for i in 1 2 3 4 5 6 7 8 9 a
	do
		echo $i
	done >ten_lines &&
	git add one two tres mouse nine_lines ten_lines &&
	test_tick &&
	GIT_AUTHOR_NAME=Initial git commit -m Initial &&

	cat one >uno &&
	mv two dos &&
	cat one >>tres &&
	echo DEF >>mouse &&
	git add uno dos tres mouse &&
	test_tick &&
	GIT_AUTHOR_NAME=Second git commit -a -m Second &&

	echo GHIJK >>mouse &&
	git add mouse &&
	test_tick &&
	GIT_AUTHOR_NAME=Third git commit -m Third &&

	cat mouse >cow &&
	git add cow &&
	test_tick &&
	GIT_AUTHOR_NAME=Fourth git commit -m Fourth &&

	{
		echo ABC
		echo DEF
		echo XXXX
		echo GHIJK
	} >cow &&
	git add cow &&
	test_tick &&
	GIT_AUTHOR_NAME=Fifth git commit -m Fifth

[master (root-commit) a7d6c31] Initial
 Author: Initial <author@example.com>
 6 files changed, 23 insertions(+)
 create mode 100644 mouse
 create mode 100644 nine_lines
 create mode 100644 one
 create mode 100644 ten_lines
 create mode 100644 tres
 create mode 100644 two
Cloning into 'submodule_update'...
[master 480ef79] Second
 Author: Second <author@example.com>
 4 files changed, 3 insertions(+)
 rename two => dos (100%)
 create mode 100644 uno
done.
[master 74385ca] Third
 Author: Third <author@example.com>
 1 file changed, 1 insertion(+)
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
[master 5b22ca3] Fourth
 Author: Fourth <author@example.com>
 1 file changed, 3 insertions(+)
 create mode 100644 cow
[master 018e313] Fifth
 Author: Fifth <author@example.com>
 1 file changed, 1 insertion(+)
ok 1 - setup

expecting success: 

	git blame uno | grep Second


480ef79e (Second 2005-04-07 15:14:13 -0700 1) A A A A A
ok 2 - straight copy without -C

expecting success: 

	git blame dos | grep Initial


^a7d6c31 two (Initial 2005-04-07 15:13:13 -0700 1) B B B B B
ok 3 - straight move without -C

expecting success: 

	git blame -C1 uno | grep Second


480ef79e (Second 2005-04-07 15:14:13 -0700 1) A A A A A
ok 4 - straight copy with -C

expecting success: 

	git blame -C1 dos | grep Initial


^a7d6c31 two (Initial 2005-04-07 15:13:13 -0700 1) B B B B B
ok 5 - straight move with -C

expecting success: 

	git blame -C -C1 uno | grep Initial


^a7d6c31 one (Initial 2005-04-07 15:13:13 -0700 1) A A A A A
ok 6 - straight copy with -C -C

expecting success: 

	git blame -C -C1 dos | grep Initial


^a7d6c31 two (Initial 2005-04-07 15:13:13 -0700 1) B B B B B
ok 7 - straight move with -C -C

expecting success: 

	git blame -L2 tres | grep Second


480ef79e (Second 2005-04-07 15:14:13 -0700 2) A A A A A
ok 8 - append without -C

expecting success: 

	git blame -L2 -C1 tres | grep Second


Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
480ef79e (Second 2005-04-07 15:14:13 -0700 2) A A A A A
ok 9 - append with -C

expecting success: 

	git blame -L2 -C -C1 tres | grep Second


480ef79e (Second 2005-04-07 15:14:13 -0700 2) A A A A A
ok 10 - append with -C -C

expecting success: 

	git blame -L2 -C -C -C1 tres | grep Initial


^a7d6c31 one (Initial 2005-04-07 15:13:13 -0700 2) A A A A A
ok 11 - append with -C -C -C

expecting success: 

	git blame -f -C -C1 HEAD^ -- cow | sed -e "$pick_fc" >current &&
	{
		echo mouse-Initial
		echo mouse-Second
		echo mouse-Third
	} >expected &&
	test_cmp expected current


ok 12 - blame wholesale copy

expecting success: 

	git blame -f -C -C1 HEAD -- cow | sed -e "$pick_fc" >current &&
	{
		echo mouse-Initial
		echo mouse-Second
		echo cow-Fifth
		echo mouse-Third
	} >expected &&
	test_cmp expected current


Cloning into 'sub1'...
ok 13 - blame wholesale copy and more

expecting success: 
	mkdir path &&
	echo A A A A A >path/file &&
	echo B B B B B >path/elif &&
	git add path &&
	test_tick &&
	git commit -m "path was a directory" &&
	rm -fr path &&
	echo A A A A A >path &&
	git add path &&
	test_tick &&
	git commit -m "path is a regular file" &&
	git blame HEAD^.. -- path

done.
[master 0aef879] path was a directory
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 path/elif
 create mode 100644 path/file
ok 24 - difftool last flag wins

expecting success: 
	test_config merge.tool test-tool &&
	test_config mergetool.test-tool.cmd "cat \$LOCAL" &&
	echo branch >expect &&
	git difftool --no-prompt branch >actual &&
	test_cmp expect actual &&

	# set merge.tool to something bogus, diff.tool to test-tool
	test_config merge.tool bogus-tool &&
	test_config diff.tool test-tool &&
	git difftool --no-prompt branch >actual &&
	test_cmp expect actual

[master 846e53e] path is a regular file
 Author: A U Thor <author@example.com>
 2 files changed, 1 deletion(-)
 rename path/file => path (100%)
 delete mode 100644 path/elif
^0aef879 path/file (A U Thor 2005-04-07 15:18:13 -0700 1) A A A A A
ok 14 - blame path that used to be a directory

expecting success: 
  TREE=`git rev-parse HEAD:` &&
  cat >badcommit <<EOF &&
tree $TREE
author <noname> 1234567890 +0000
committer David Reiss <dreiss@facebook.com> 1234567890 +0000

some message
EOF
  COMMIT=`git hash-object -t commit -w badcommit` &&
  git --no-pager blame $COMMIT -- uno >/dev/null

ok 15 - blame to a commit with no author name

expecting success: 
	test_must_fail git blame -L5 tres 2>errors &&
	grep "has only 2 lines" errors

fatal: file tres has only 2 lines
ok 16 - blame -L with invalid start

expecting success: 
	test_must_fail git blame -L1,5 tres 2>errors &&
	grep "has only 2 lines" errors

Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
fatal: file tres has only 2 lines
ok 17 - blame -L with invalid end

expecting success: 
	git blame -L1,1 tres >out &&
	cat out &&
	test $(wc -l < out) -eq 1

^a7d6c31 (Initial 2005-04-07 15:13:13 -0700 1) C C C C C
ok 18 - blame parses <end> part of -L

expecting success: 
	git blame nine_lines >actual &&
	test $(grep -c "  " actual) = 0

ok 19 - indent of line numbers, nine lines

expecting success: 
	git blame ten_lines >actual &&
	test $(grep -c "  " actual) = 9

Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
ok 20 - indent of line numbers, ten lines

expecting success: 
	git config core.autocrlf false &&
	printf "testcase\n" >crlffile &&
	git add crlffile &&
	git commit -m testcase &&
	printf "testcase\r\n" >crlffile

Updating 7141cca..2e1f05b
Fast-forward
[master 281288b] testcase
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 crlffile
ok 21 - setup file with CRLF newlines

expecting success: 
	git config core.autocrlf true &&
	git blame crlffile >actual &&
	grep "A U Thor" actual

281288b4 (A U Thor 2005-04-07 15:19:13 -0700 1) testcase
ok 22 - blame file with CRLF core.autocrlf true

expecting success: 
	git config core.autocrlf false &&
	echo "crlffile text" >.gitattributes &&
	git blame crlffile >actual &&
	grep "A U Thor" actual

281288b4 (A U Thor 2005-04-07 15:19:13 -0700 1) testcase
ok 23 - blame file with CRLF attributes text

# passed all 23 test(s)
1..23
*** t8004-blame-with-conflicts.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t8004-blame-with-conflicts/.git/
expecting success: 
	# Create the old file
	echo "Old line" > file1 &&
	git add file1 &&
	git commit --author "Old Line <ol@localhost>" -m file1.a &&

	# Branch
	git checkout -b foo &&

	# Do an ugly move and change
	git rm file1 &&
	echo "New line ..."  > file2 &&
	echo "... and more" >> file2 &&
	git add file2 &&
	git commit --author "U Gly <ug@localhost>" -m ugly &&

	# Back to master and change something
	git checkout master &&
	echo "

bla" >> file1 &&
	git commit --author "Old Line <ol@localhost>" -a -m file1.b &&

	# Back to foo and merge master
	git checkout foo &&
	if git merge master; then
		echo needed conflict here
		exit 1
	else
		echo merge failed - resolving automatically
	fi &&
	echo "New line ...
... and more

bla
Even more" > file2 &&
	git rm file1 &&
	git commit --author "M Result <mr@localhost>" -a -m merged &&

	# Back to master and change file1 again
	git checkout master &&
	sed s/bla/foo/ <file1 >X &&
	rm file1 &&
	mv X file1 &&
	git commit --author "No Bla <nb@localhost>" -a -m replace &&

	# Try to merge into foo again
	git checkout foo &&
	if git merge master; then
		echo needed conflict here
		exit 1
	else
		echo merge failed - test is setup
	fi

[master (root-commit) 0af56c2] file1.a
 Author: Old Line <ol@localhost>
 1 file changed, 1 insertion(+)
 create mode 100644 file1
Switched to a new branch 'foo'
rm 'file1'
[foo 30d3e39] ugly
 Author: U Gly <ug@localhost>
 2 files changed, 2 insertions(+), 1 deletion(-)
 delete mode 100644 file1
 create mode 100644 file2
Switched to branch 'master'
[master a17abf2] file1.b
 Author: Old Line <ol@localhost>
 1 file changed, 3 insertions(+)
fatal: reference is not a tree: 0123456789012345678901234567890123456789
Unable to checkout '0123456789012345678901234567890123456789' in submodule path 'sub1'
Switched to branch 'foo'
Merging:
30d3e39 ugly
virtual master
found 1 common ancestor:
0af56c2 file1.a
CONFLICT (modify/delete): file1 deleted in HEAD and modified in master. Version master of file1 left in tree.
Automatic merge failed; fix conflicts and then commit the result.
merge failed - resolving automatically
file1: needs merge
rm 'file1'
ok 27 - git merge --ff: 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
		)
	
[foo 0ac2dd0] merged
 Author: M Result <mr@localhost>
Switched to branch 'master'
[master 723a908] replace
 Author: No Bla <nb@localhost>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to branch 'foo'
Cloning into 'submodule_update'...
Merging:
0ac2dd0 merged
virtual master
found 1 common ancestor:
a17abf2 file1.b
CONFLICT (modify/delete): file1 deleted in HEAD and modified in master. Version master of file1 left in tree.
Automatic merge failed; fix conflicts and then commit the result.
merge failed - test is setup
ok 1 - setup first case

expecting success: 
	git blame file2

30d3e39c (U Gly    2015-12-16 11:07:33 +0000 1) New line ...
30d3e39c (U Gly    2015-12-16 11:07:33 +0000 2) ... and more
0ac2dd07 (M Result 2015-12-16 11:07:33 +0000 3) 
0ac2dd07 (M Result 2015-12-16 11:07:33 +0000 4) bla
0ac2dd07 (M Result 2015-12-16 11:07:33 +0000 5) Even more
ok 2 - blame runs on unconflicted file while other file has conflicts

expecting success: 
	git blame file1

done.
^0af56c2 (Old Line 2015-12-16 11:07:33 +0000 1) Old line
a17abf29 (Old Line 2015-12-16 11:07:33 +0000 2) 
a17abf29 (Old Line 2015-12-16 11:07:33 +0000 3) 
723a9084 (No Bla   2015-12-16 11:07:33 +0000 4) foo
ok 3 - blame does not crash with conflicted file in stages 1,3

# passed all 3 test(s)
1..3
Switched to a new branch 'invalid_sub1'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
*** t8005-blame-i18n.sh ***
fatal: Needed a single revision
Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t8005-blame-i18n/.git/
Updating 2e1f05b..fca299d
Fast-forward
expecting success: 
	# Create the file
	echo "UTF-8 LINE" > file &&
	git add file &&
	git commit --author "$UTF8_NAME <utf8@localhost>" -m "$UTF8_MSG" &&

	echo "EUC-JAPAN LINE" >> file &&
	git add file &&
	git config i18n.commitencoding eucJP &&
	git commit --author "$EUC_JAPAN_NAME <euc-japan@localhost>" -m "$EUC_JAPAN_MSG" &&

	echo "SJIS LINE" >> file &&
	git add file &&
	git config i18n.commitencoding SJIS &&
	git commit --author "$SJIS_NAME <sjis@localhost>" -m "$SJIS_MSG"

[master (root-commit) b214916] ブレームのテストです。
 Author: 山田 太郎 <utf8@localhost>
 1 file changed, 1 insertion(+)
 create mode 100644 file
[master 69cc0ee] ブレームのテストです。
 1 file changed, 1 insertion(+)
[master 4b8dd3f] ブレームのテストです。
 1 file changed, 1 insertion(+)
ok 1 - setup the repository

expecting success: 
	git blame --incremental file | \
		egrep "^(author|summary) " > actual &&
	test_cmp actual expected

ok 2 - blame respects i18n.commitencoding

expecting success: 
	git config i18n.logoutputencoding eucJP &&
	git blame --incremental file | \
		egrep "^(author|summary) " > actual &&
	test_cmp actual expected

ok 3 - blame respects i18n.logoutputencoding

expecting success: 
	git blame --incremental --encoding=UTF-8 file | \
		egrep "^(author|summary) " > actual &&
	test_cmp actual expected

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 4 - blame respects --encoding=UTF-8

expecting success: 
	git blame --incremental --encoding=none file | \
		egrep "^(author|summary) " > actual &&
	test_cmp actual expected

ok 5 - blame respects --encoding=none

Merging:
submod

# passed all 5 test(s)
1..5
*** t8006-blame-textconv.sh ***
Submodule merge conflict for 'submod':
  {local}: submodule commit f1e79731463601167179811363c6dab0cdc96e35
  {remote}: submodule commit 5b592f796c80b49a0e8916069c72cb3527ae3597
Cloning into 'sub1'...
Use (l)ocal or (r)emote, or (a)bort? Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t8006-blame-textconv/.git/
done.
expecting success: 
	echo "bin: test number 0" >zero.bin &&
	echo "bin: test 1" >one.bin &&
	echo "bin: test number 2" >two.bin &&
	test_ln_s_add one.bin symlink.bin &&
	git add . &&
	GIT_AUTHOR_NAME=Number1 git commit -a -m First --date="2010-01-01 18:00:00" &&
	echo "bin: test 1 version 2" >one.bin &&
	echo "bin: test number 2 version 2" >>two.bin &&
	rm -f symlink.bin &&
	test_ln_s_add two.bin symlink.bin &&
	GIT_AUTHOR_NAME=Number2 git commit -a -m Second --date="2010-01-01 20:00:00"

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
[master (root-commit) 517c65b] First
 Author: Number1 <author@example.com>
 Date: Fri Jan 1 18:00:00 2010 +0000
 5 files changed, 7 insertions(+)
 create mode 100755 helper
 create mode 100644 one.bin
 create mode 120000 symlink.bin
 create mode 100644 two.bin
 create mode 100644 zero.bin
[master 66ebdf6] Second
 Author: Number2 <author@example.com>
 Date: Fri Jan 1 20:00:00 2010 +0000
 3 files changed, 3 insertions(+), 2 deletions(-)
ok 1 - setup 

expecting success: 
	git blame one.bin >blame &&
	find_blame Number2 <blame >result &&
	test_cmp expected result

Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
ok 2 - no filter specified

expecting success: 
	echo "*.bin diff=test" >.gitattributes &&
	echo "zero.bin eol=crlf" >>.gitattributes &&
	git config diff.test.textconv ./helper &&
	git config diff.test.cachetextconv false

ok 25 - difftool + mergetool config variables

expecting success: 
	test_config difftool.tkdiff.path echo &&
	git difftool --tool=tkdiff --no-prompt branch >output &&
	lines=$(grep file output | wc -l) &&
	test "$lines" -eq 1

ok 3 - setup textconv filters

expecting success: 
	git blame --no-textconv one.bin >blame &&
	find_blame <blame> result &&
	test_cmp expected result

Submodule path 'submod': checked out '5b592f796c80b49a0e8916069c72cb3527ae3597'
ok 4 - blame with --no-textconv

expecting success: 
	git blame one.bin >blame &&
	find_blame  <blame >result &&
	test_cmp expected result

ok 28 - git merge --ff: 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 5 - basic blame on last commit

expecting success: 
	git blame --textconv two.bin >blame &&
	find_blame <blame >result &&
	test_cmp expected result

[test7.a 90e7519] Merge resolved by keeping module
 Author: A U Thor <author@example.com>
Cloning into 'submodule_update'...
Switched to a new branch 'test7.b'
Resolved 'both' using previous resolution.
Resolved 'file1' using previous resolution.
Resolved 'file2' using previous resolution.
Resolved 'spaced name' using previous resolution.
Resolved 'subdir/file3' using previous resolution.
done.
Merging:
297d652 Submodule path becomes file
virtual master
found 1 common ancestor:
c0d6d4d add initial versions
Auto-merging submod
CONFLICT (content): Merge conflict in submod
Auto-merging subdir/file3
CONFLICT (content): Merge conflict in subdir/file3
Auto-merging spaced name
CONFLICT (content): Merge conflict in spaced name
Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
CONFLICT (modify/delete): file12 deleted in HEAD and modified in master. Version master of file12 left in tree.
CONFLICT (modify/delete): file11 deleted in master and modified in HEAD. Version HEAD of file11 left in tree.
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Auto-merging both
CONFLICT (add/add): Merge conflict in both
Automatic merge failed; fix conflicts and then commit the result.
ok 6 - blame --textconv going through revisions

expecting success: 
	test_when_finished "git checkout zero.bin" &&
	printf "bin: updated number 0\015" >zero.bin &&
	git blame --textconv zero.bin >blame &&
	expect="(Not Committed Yet ....-..-.. ..:..:.. +0000 1)" &&
	expect="$expect converted: updated number 0" &&
	expr "$(find_blame <blame)" : "^$expect"

Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Branch add_sub1 set up to track remote branch add_sub1 from origin.
75
Updating 2347eb4..7141cca
Fast-forward
ok 7 - blame --textconv with local changes

expecting success: 
	git config diff.test.cachetextconv true

 .gitmodules | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
ok 8 - setup +cachetextconv

expecting success: 
	git blame --textconv two.bin >blame &&
	find_blame <blame >result &&
	test_cmp expected result &&
	git blame --textconv one.bin >blame &&
	find_blame  <blame >result &&
	test_cmp expected_one result

ok 9 - blame --textconv works with textconvcache

expecting success: 
	git config diff.test.cachetextconv false

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 10 - setup -cachetextconv

expecting success: 
	echo "bin: test number 2 version 3" >>two.bin &&
	GIT_AUTHOR_NAME=Number3 git commit -a -m Third --date="2010-01-01 22:00:00"

[master d5b3fc9] Third
 Author: Number3 <author@example.com>
 Date: Fri Jan 1 22:00:00 2010 +0000
 1 file changed, 1 insertion(+)
ok 11 - make a new commit

expecting success: 
	git blame HEAD^ two.bin >blame &&
	find_blame <blame >result &&
	test_cmp expected result

Cloning into 'sub1'...
ok 12 - blame from previous revision

expecting success: 
	git blame --no-textconv symlink.bin >blame &&
	find_blame <blame >result &&
	test_cmp expected result

ok 26 - difftool.<tool>.path

expecting success: 
	echo branch >expect &&
	echo master >>expect &&
	git difftool --no-prompt --extcmd=cat branch >actual &&
	test_cmp expect actual

done.
ok 13 - blame with --no-textconv (on symlink)

expecting success: 
	git blame --textconv symlink.bin >blame &&
	find_blame <blame >result &&
	test_cmp expected result

ok 14 - blame --textconv (on symlink)

expecting success: 
	cat >three.bin <<\EOF &&
bin: test number 2
bin: test number 2 version 2
bin: test number 2 version 3
bin: test number 3
EOF
	git add three.bin &&
	GIT_AUTHOR_NAME=Number4 git commit -a -m Fourth --date="2010-01-01 23:00:00"

[master 1180fbc] Fourth
 Author: Number4 <author@example.com>
 Date: Fri Jan 1 23:00:00 2010 +0000
 1 file changed, 4 insertions(+)
 create mode 100644 three.bin
ok 15 - make another new commit

expecting success: 
	git blame -C -C three.bin >blame &&
	find_blame <blame >result &&
	cat >expected <<\EOF &&
(Number1 2010-01-01 18:00:00 +0000 1) converted: test number 2
(Number2 2010-01-01 20:00:00 +0000 2) converted: test number 2 version 2
(Number3 2010-01-01 22:00:00 +0000 3) converted: test number 2 version 3
(Number4 2010-01-01 23:00:00 +0000 4) converted: test number 3
EOF
	test_cmp expected result

Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
ok 16 - blame on last commit (-C -C, symlink)

# passed all 16 test(s)
1..16
ok 29 - git merge --ff-only: 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
		)
	
*** t8007-cat-file-textconv.sh ***
Cloning into 'submodule_update'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t8007-cat-file-textconv/.git/
expecting success: 
	echo "bin: test" >one.bin &&
	test_ln_s_add one.bin symlink.bin &&
	git add . &&
	GIT_AUTHOR_NAME=Number1 git commit -a -m First --date="2010-01-01 18:00:00" &&
	echo "bin: test version 2" >one.bin &&
	GIT_AUTHOR_NAME=Number2 git commit -a -m Second --date="2010-01-01 20:00:00"

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
done.
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
[master (root-commit) df69a3c] First
 Author: Number1 <author@example.com>
 Date: Fri Jan 1 18:00:00 2010 +0000
 3 files changed, 5 insertions(+)
 create mode 100755 helper
 create mode 100644 one.bin
 create mode 120000 symlink.bin
[master f4067c2] Second
 Author: Number2 <author@example.com>
 Date: Fri Jan 1 20:00:00 2010 +0000
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - setup 

expecting success: 
	git cat-file --textconv :one.bin >result &&
	test_cmp expected result

Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 2 - no filter specified

expecting success: 
	echo "*.bin diff=test" >.gitattributes &&
	git config diff.test.textconv ./helper &&
	git config diff.test.cachetextconv false

Updating 2347eb4..7141cca
Fast-forward
 .gitmodules | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
ok 3 - setup textconv filters

expecting success: 
	git cat-file blob :one.bin >result &&
	test_cmp expected result

ok 4 - cat-file without --textconv

expecting success: 
	git cat-file -p HEAD^:one.bin >result &&
	test_cmp expected result

ok 5 - cat-file without --textconv on previous commit

expecting success: 
	git cat-file --textconv :one.bin >result &&
	test_cmp expected result

ok 6 - cat-file --textconv on last commit

expecting success: 
	git cat-file --textconv HEAD^:one.bin >result &&
	test_cmp expected result

ok 27 - difftool --extcmd=cat

expecting success: 
	echo branch >expect &&
	echo master >>expect &&
	git difftool --no-prompt --extcmd=cat branch >actual &&
	test_cmp expect actual

ok 7 - cat-file --textconv on previous commit

expecting success: 
	printf "%s" "one.bin" >expected &&
	git cat-file blob :symlink.bin >result &&
	test_cmp expected result

ok 8 - cat-file without --textconv (symlink)

expecting success: 
	git cat-file --textconv :symlink.bin >result &&
	test_cmp expected result

ok 9 - cat-file --textconv on index (symlink)

expecting success: 
	git cat-file --textconv HEAD:symlink.bin >result &&
	test_cmp expected result

ok 10 - cat-file --textconv on HEAD (symlink)

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
# passed all 10 test(s)
1..10
*** t8008-blame-formats.sh ***
Cloning into 'sub1'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t8008-blame-formats/.git/
expecting success: 
	echo a >file &&
	git add file &&
	test_tick &&
	git commit -m one &&
	echo b >>file &&
	echo c >>file &&
	echo d >>file &&
	test_tick &&
	git commit -a -m two

done.
[master (root-commit) baf5e0b] one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
[master 8825379] two
 Author: A U Thor <author@example.com>
 1 file changed, 3 insertions(+)
ok 1 - setup

expecting success: 
	git blame file >actual &&
	test_cmp expect actual

ok 2 - normal blame output

expecting success: 
	git blame --porcelain file >actual &&
	test_cmp expect actual

ok 3 - blame --porcelain output

expecting success: 
	git blame --line-porcelain file >actual &&
	test_cmp expect actual

ok 4 - blame --line-porcelain output

Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
# passed all 4 test(s)
1..4
*** t9000-addresses.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9000-addresses/.git/
ok 30 - git merge --ff-only: 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
		)
	
Cloning into 'submodule_update'...
ok 28 - difftool --extcmd cat

expecting success: 
	echo branch >expect &&
	echo master >>expect &&
	git difftool --no-prompt -x cat branch >actual &&
	test_cmp expect actual

done.
1..0 # SKIP Perl Mail::Address unavailable, skipping test
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
*** t9001-send-email.sh ***
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Merging:
submod

error: The following untracked working tree files would be overwritten by merge:
	sub1
Please move or remove them before you can merge.
Aborting
Updating 2347eb4..7141cca
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9001-send-email/.git/
expecting success: 
	echo "1A quick brown fox jumps over the" >file &&
	echo "lazy dog" >>file &&
	git add file &&
	GIT_AUTHOR_NAME="A" git commit -a -m "Initial."

Submodule merge conflict for 'submod':
ok 31 - git merge --ff-only: 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
		)
	
[master (root-commit) be9a936] Initial.
 Author: A <author@example.com>
 1 file changed, 2 insertions(+)
 create mode 100644 file
  {local}: modified file
  {remote}: submodule commit 5b592f796c80b49a0e8916069c72cb3527ae3597
Use (l)ocal or (r)emote, or (a)bort? ok 1 - prepare reference tree

expecting success: 
	write_script fake.sendmail <<-\EOF &&
	shift
	output=1
	while test -f commandline$output
	do
		output=$(($output+1))
	done
	for a
	do
		echo "!$a!"
	done >commandline$output
	cat >"msgtxt$output"
	EOF
	git add fake.sendmail &&
	GIT_AUTHOR_NAME="A" git commit -a -m "Second."

Cloning into 'submodule_update'...
done.
[master 53cc672] Second.
 Author: A <author@example.com>
 1 file changed, 12 insertions(+)
 create mode 100755 fake.sendmail
ok 2 - Setup helper tool

expecting success: 
	patches=`git format-patch -s --cc="One <one@example.com>" --cc=two@example.com -n HEAD^1`

ok 3 - Extract patches

expecting success: 
	test_no_confirm --suppress-cc=sob &&
	check_no_confirm

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.
t7613-merge-submodule.sh: 159: cd: can't cd to sub1
Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
Updating 3d0ed3b..aa60ee5
Fast-forward
 .gitmodules | 4 ++++
 sub1        | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)
 mode change 100644 => 160000 sub1
[test7.b 36201c1] Merge resolved by keeping file
 Author: A U Thor <author@example.com>
Switched to a new branch 'test7.c'
ok 29 - difftool -x cat

expecting success: 
	echo file >expect &&
	git difftool --no-prompt \
		--extcmd sh\ -c\ \"echo\ \$1\" branch >actual &&
	test_cmp expect actual

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
error: failed to create path 'submod': perhaps a D/F conflict?
Cloning into 'sub1'...
Merging:
48ba24d master updates
virtual test7
found 1 common ancestor:
c0d6d4d add initial versions
Auto-merging submod
CONFLICT (content): Merge conflict in submod
Auto-merging subdir/file3
CONFLICT (content): Merge conflict in subdir/file3
Auto-merging spaced name
CONFLICT (content): Merge conflict in spaced name
Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
CONFLICT (modify/delete): file12 deleted in test7 and modified in HEAD. Version HEAD of file12 left in tree.
CONFLICT (modify/delete): file11 deleted in HEAD and modified in test7. Version test7 of file11 left in tree.
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Auto-merging both
CONFLICT (add/add): Merge conflict in both
Resolved 'both' using previous resolution.
Resolved 'file1' using previous resolution.
Resolved 'file2' using previous resolution.
Resolved 'spaced name' using previous resolution.
Resolved 'subdir/file3' using previous resolution.
Automatic merge failed; fix conflicts and then commit the result.
done.
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
ok 32 - git merge --ff-only: 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
		)
	
Cloning into 'submodule_update'...
ok 30 - difftool --extcmd echo arg1

expecting success: 
	echo master >expect &&
	git difftool --no-prompt \
		--extcmd sh\ -c\ \"cat\ \$1\" branch >actual &&
	test_cmp expect actual

done.
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.
error: 8ed2e6719f8484ce01fa3ce133fe42d25c2441b8^{commit}: expected commit type, but the object dereferences to tree type
fatal: Needed a single revision
Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
Updating 0abcf00..ea26008
Fast-forward
 .gitmodules | 4 ++++
 sub1/file1  | 1 -
 sub1/file2  | 1 -
 sub1/file3  | 1 -
 4 files changed, 4 insertions(+), 3 deletions(-)
 delete mode 100644 sub1/file1
 delete mode 100644 sub1/file2
 delete mode 100644 sub1/file3
ok 4 - No confirm with --suppress-cc

expecting success: 
	test_no_confirm --confirm=never &&
	check_no_confirm

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'sub1'...
done.
ok 31 - difftool --extcmd cat arg1

expecting success: 
	echo branch >expect &&
	git difftool --no-prompt \
		--extcmd sh\ -c\ \"cat\ \$2\" branch >actual &&
	test_cmp expect actual

Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
ok 33 - git merge --ff-only: 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
		)
	
Cloning into 'submodule_update'...
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 32 - difftool --extcmd cat arg2

expecting success: 
	echo m2 >file2 &&
	git add file2 &&
	git commit -m "added file2" &&

	git checkout branch &&
	echo br2 >file2 &&
	git add file2 &&
	git commit -a -m "branch changed file2" &&
	git checkout master

[master 0189fec] added file2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file2
Switched to branch 'branch'
[branch 35582b9] branch changed file2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file2
Switched to branch 'master'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 33 - setup with 2 files different

ok 5 - No confirm with --confirm=never

expecting success: 
	(echo n && echo) >input &&
	git difftool -x cat branch <input >output &&
	grep m2 output &&
	grep br2 output &&
	! grep master output &&
	! grep branch output

expecting success: 
	git config sendemail.confirm never &&
	test_no_confirm --compose --subject=foo &&
	check_no_confirm

Cloning into 'sub1'...
Merging:
submod

done.
Submodule merge conflict for 'submod':
  {local}: submodule commit 5b592f796c80b49a0e8916069c72cb3527ae3597
  {remote}: modified file
Use (l)ocal or (r)emote, or (a)bort? Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
warning: unable to rmdir sub1: Directory not empty
Updating 7141cca..af434d3
Fast-forward
 .gitmodules | 4 ----
 1 file changed, 4 deletions(-)
 delete mode 100644 .gitmodules
[test7.c 895ee8e] Merge resolved by keeping file
 Author: A U Thor <author@example.com>
ok 34 - git merge --ff-only: 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
		)
	
Switched to a new branch 'test7.d'
Cloning into 'submodule_update'...
m2
Launch 'cat' [Y/n]: br2
ok 34 - say no to the first file

expecting success: 
	(echo && echo n) >input &&
	git difftool -x cat branch <input >output &&
	grep master output &&
	grep branch output &&
	! grep m2 output &&
	! grep br2 output

done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
error: failed to create path 'submod': perhaps a D/F conflict?
Merging:
48ba24d master updates
virtual test7
found 1 common ancestor:
c0d6d4d add initial versions
Auto-merging submod
CONFLICT (content): Merge conflict in submod
Auto-merging subdir/file3
CONFLICT (content): Merge conflict in subdir/file3
Auto-merging spaced name
CONFLICT (content): Merge conflict in spaced name
Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
CONFLICT (modify/delete): file12 deleted in test7 and modified in HEAD. Version HEAD of file12 left in tree.
CONFLICT (modify/delete): file11 deleted in HEAD and modified in test7. Version test7 of file11 left in tree.
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Auto-merging both
CONFLICT (add/add): Merge conflict in both
Resolved 'both' using previous resolution.
Resolved 'file1' using previous resolution.
Resolved 'file2' using previous resolution.
Resolved 'spaced name' using previous resolution.
Resolved 'subdir/file3' using previous resolution.
Automatic merge failed; fix conflicts and then commit the result.
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'sub1'...
done.
ok 6 - No confirm with sendemail.confirm=never

expecting success: 
	git send-email --suppress-cc=sob --from="Example <nobody@example.com>" --to=nobody@example.com --smtp-server="$(pwd)/fake.sendmail" $patches 2>errors

Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
master
Launch 'cat' [Y/n]: branch
ok 35 - say no to the second file

expecting success: 
	git difftool -x cat branch </dev/null >output &&
	! grep master output &&
	! grep branch output &&
	! grep m2 output &&
	! grep br2 output

Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
warning: unable to rmdir sub1: Directory not empty
Updating 7141cca..af434d3
Fast-forward
 .gitmodules | 4 ----
 1 file changed, 4 deletions(-)
 delete mode 100644 .gitmodules
ok 35 - git merge --ff-only: 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
		)
	
Cloning into 'submodule_update'...
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 36 - ending prompt input with EOF

expecting success: 
	git difftool --tool-help >output &&
	grep tool output

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'sub1'...
done.
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
error: The following untracked working tree files would be overwritten by merge:
	sub1/file1
	sub1/file2
Please move or remove them before you can merge.
Aborting
Updating 7141cca..0abcf00
0001-Second.patch
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com author@example.com one@example.com two@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com
Subject: [PATCH 1/1] Second.
Date: Wed, 16 Dec 2015 11:07:50 +0000
Message-Id: <1450264070-15249-1-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4

Result: OK
ok 7 - Send patches

expecting success: 
	cat >expected <<-\EOF
	!nobody@example.com!
	!author@example.com!
	!one@example.com!
	!two@example.com!
	EOF

ok 8 - setup expect

expecting success: 
	test_cmp expected commandline1

ok 9 - Verify commandline

expecting success: 
	clean_fake_sendmail &&
	git send-email --envelope-sender="Patch Contributor <patch@example.com>" --suppress-cc=sob --from="Example <nobody@example.com>" --to=nobody@example.com --smtp-server="$(pwd)/fake.sendmail" $patches 2>errors

ok 36 - git merge --ff-only: 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
		)
	
Cloning into 'submodule_update'...
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Merging:
submod

Submodule merge conflict for 'submod':
  {local}: submodule commit 5b592f796c80b49a0e8916069c72cb3527ae3597
  {remote}: modified file
Use (l)ocal or (r)emote, or (a)bort? Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'sub1'...
done.
[test7.d 3137fd9] Merge resolved by keeping module
 Author: A U Thor <author@example.com>
ok 12 - file vs modified submodule

expecting success: 
	git checkout -b test10 branch1 &&
	git submodule update -N &&
	(
		cd subdir &&
		test_create_repo subdir_module &&
		(
		cd subdir_module &&
		: >file15 &&
		git add file15 &&
		git commit -m "add initial versions"
		)
	) &&
	git submodule add git://example.com/subsubmodule subdir/subdir_module &&
	git add subdir/subdir_module &&
	git commit -m "add submodule in subdirectory" &&

	git checkout -b test10.a test10 &&
	git submodule update -N &&
	(
	cd subdir/subdir_module &&
		git checkout -b super10.a &&
		echo test10.a >file15 &&
		git add file15 &&
		git commit -m "on branch 10.a"
	) &&
	git add subdir/subdir_module &&
	git commit -m "change submodule in subdirectory on test10.a" &&

	git checkout -b test10.b test10 &&
	git submodule update -N &&
	(
		cd subdir/subdir_module &&
		git checkout -b super10.b &&
		echo test10.b >file15 &&
		git add file15 &&
		git commit -m "on branch 10.b"
	) &&
	git add subdir/subdir_module &&
	git commit -m "change submodule in subdirectory on test10.b" &&

	test_must_fail git merge test10.a >/dev/null 2>&1 &&
	(
		cd subdir &&
		( yes "l" | git mergetool subdir_module )
	) &&
	test "$(cat subdir/subdir_module/file15)" = "test10.b" &&
	git submodule update -N &&
	test "$(cat subdir/subdir_module/file15)" = "test10.b" &&
	git reset --hard &&
	git submodule update -N &&

	test_must_fail git merge test10.a >/dev/null 2>&1 &&
	( yes "r" | git mergetool subdir/subdir_module ) &&
	test "$(cat subdir/subdir_module/file15)" = "test10.b" &&
	git submodule update -N &&
	test "$(cat subdir/subdir_module/file15)" = "test10.a" &&
	git commit -m "branch1 resolved with mergetool" &&
	rm -rf subdir/subdir_module

Switched to a new branch 'test10'
M	submod
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
error: The following untracked working tree files would be overwritten by merge:
	sub1/file1
	sub1/file2
Please move or remove them before you can merge.
Aborting
Updating 7141cca..0abcf00
Submodule path 'submod': checked out 'f1e79731463601167179811363c6dab0cdc96e35'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7610-mergetool/subdir/subdir_module/.git/
[master (root-commit) fa992dd] add initial versions
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file15
ok 37 - git merge --ff-only: 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
		)
	
0001-Second.patch
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -f patch@example.com -i nobody@example.com author@example.com one@example.com two@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com
Subject: [PATCH 1/1] Second.
Date: Wed, 16 Dec 2015 11:07:52 +0000
Message-Id: <1450264072-15739-1-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4

Result: OK
ok 10 - Send patches with --envelope-sender

expecting success: 
	cat >expected <<-\EOF
	!patch@example.com!
	!-i!
	!nobody@example.com!
	!author@example.com!
	!one@example.com!
	!two@example.com!
	EOF

No suitable tool for 'git difftool --tool=<tool>' found.
The following tools are valid, but not currently available:
Some of the tools listed above only work in a windowed
ok 11 - setup expect

ok 37 - difftool --tool-help

expecting success: 
	test_cmp expected commandline1

expecting success: 
	git checkout master &&
	mkdir sub &&
	echo master >sub/sub &&
	git add sub/sub &&
	git commit -m "added sub/sub" &&
	echo test >>file &&
	echo test >>sub/sub &&
	git add file sub/sub &&
	git commit -m "modified both"

ok 12 - Verify commandline

Adding existing repo at 'subdir/subdir_module' to the index
expecting success: 
	clean_fake_sendmail &&
	git send-email --envelope-sender=auto --suppress-cc=sob --from="Example <nobody@example.com>" --to=nobody@example.com --smtp-server="$(pwd)/fake.sendmail" $patches 2>errors

Cloning into 'submodule_update'...
Already on 'master'
done.
[master 3f07e2f] added sub/sub
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 sub/sub
Switched to a new branch 'add_sub1'
[master 20f39ad] modified both
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 38 - setup change in subdirectory

[test10 b8bb086] add submodule in subdirectory
 Author: A U Thor <author@example.com>
 2 files changed, 4 insertions(+)
 create mode 160000 subdir/subdir_module
expecting success: 
		symlinks=--no-symlinks &&
		
	git difftool -d $symlinks --extcmd ls branch >output &&
	grep sub output &&
	grep file output

	
Switched to a new branch 'test10.a'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
Switched to a new branch 'super10.a'
[super10.a 7c2eba3] on branch 10.a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Cloning into 'sub1'...
[test10.a 1b579c3] change submodule in subdirectory on test10.a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
done.
Switched to a new branch 'test10.b'
M	subdir/subdir_module
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
Submodule path 'subdir/subdir_module': checked out 'fa992dda28c3e5b0af60bed75cd20df58f74a1df'
Updating 7141cca..3d0ed3b
Fast-forward
 .gitmodules | 4 ----
 sub1        | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
test_must_fail: command succeeded: git merge --ff-only replace_sub1_with_file
not ok 38 - git merge --ff-only: 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
		)
	
Switched to a new branch 'super10.b'
[super10.b 5464465] on branch 10.b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Cloning into 'submodule_update'...
[test10.b 7feee51] change submodule in subdirectory on test10.b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
sub
file
file2
file
file2
ok 39 - difftool -d --no-symlinks

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: 
		symlinks=--symlinks &&
		
	git difftool -d $symlinks --extcmd ls branch >output &&
	grep sub output &&
	grep file output

	
Merging:
subdir_module

0001-Second.patch
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -f nobody@example.com -i nobody@example.com author@example.com one@example.com two@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com
Subject: [PATCH 1/1] Second.
Date: Wed, 16 Dec 2015 11:07:54 +0000
Message-Id: <1450264074-16423-1-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4

Result: OK
Submodule merge conflict for 'subdir_module':
ok 13 - Send patches with --envelope-sender=auto

expecting success: 
	cat >expected <<-\EOF
	!nobody@example.com!
	!-i!
	!nobody@example.com!
	!author@example.com!
	!one@example.com!
	!two@example.com!
	EOF

ok 14 - setup expect

expecting success: 
	test_cmp expected commandline1

  {local}: submodule commit 546446549eb75904998343aa3d6b0337fdf92bb2
  {remote}: submodule commit 7c2eba3234d7fe558d8baf9f0497209eb4db30fc
Use (l)ocal or (r)emote, or (a)bort? ok 15 - Verify commandline

expecting success: 
cat >expected-show-all-headers <<\EOF
0001-Second.patch
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
Dry-OK. Log says:
Server: relay.example.com
MAIL FROM:<from@example.com>
RCPT TO:<to@example.com>
RCPT TO:<cc@example.com>
RCPT TO:<author@example.com>
RCPT TO:<one@example.com>
RCPT TO:<two@example.com>
RCPT TO:<bcc@example.com>
From: Example <from@example.com>
To: to@example.com
Cc: cc@example.com,
	A <author@example.com>,
	One <one@example.com>,
	two@example.com
Subject: [PATCH 1/1] Second.
Date: DATE-STRING
Message-Id: MESSAGE-ID-STRING
X-Mailer: X-MAILER-STRING
In-Reply-To: <unique-message-id@example.com>
References: <unique-message-id@example.com>

Result: OK
EOF

ok 16 - setup expect

expecting success: 
	test_suppress_self_unquoted 'A U Thor' 'author@example.com' 		'self_name_suppressed'

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
[master 8bfd7d6] unquoted-self_name_suppressed
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 unquoted-self_name_suppressed.t
[master c1dbf1d] test suppress-cc.self unquoted-self_name_suppressed with name A U Thor email author@example.com
 Author: A U Thor <author@example.com>
 Date: Thu Apr 7 15:13:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 unquoted-self_name_suppressed.t
Cloning into 'sub1'...
done.
HEAD is now at 7feee51 change submodule in subdirectory on test10.b
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
Updating 7141cca..3d0ed3b
Fast-forward
 .gitmodules | 4 ----
 sub1        | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)
test_must_fail: command succeeded: git merge --ff-only replace_sub1_with_file
 mode change 160000 => 100644 sub1
not ok 39 - git merge --ff-only: 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
		)
	
sub
file
file2
file
file2
ok 40 - difftool -d --symlinks

expecting success: 
		symlinks=--no-symlinks &&
		
	git difftool --dir-diff $symlinks --extcmd ls branch >output &&
	grep sub output &&
	grep file output

	
Cloning into 'submodule_update'...
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Merging:
subdir/subdir_module

Submodule merge conflict for 'subdir/subdir_module':
  {local}: submodule commit 546446549eb75904998343aa3d6b0337fdf92bb2
  {remote}: submodule commit 7c2eba3234d7fe558d8baf9f0497209eb4db30fc
Use (l)ocal or (r)emote, or (a)bort? Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'sub1'...
suppress-self-unquoted-self_name_suppressed.patch
Submodule path 'subdir/subdir_module': checked out '7c2eba3234d7fe558d8baf9f0497209eb4db30fc'
done.
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com
From: A U Thor <author@example.com>
To: nobody@example.com
Subject: [PATCH] test suppress-cc.self unquoted-self_name_suppressed with name A U Thor email author@example.com
Date: Wed, 16 Dec 2015 11:07:57 +0000
Message-Id: <1450264077-16940-1-git-send-email-author@example.com>
X-Mailer: git-send-email 2.6.4

Result: OK
HEAD is now at 53cc672 Second.
ok 17 - self name is suppressed

expecting success: 
	test_suppress_self_quoted 'A U. Thor' 'author@example.com' 		'self_name_dot_suppressed'

[test10.b 7f17bb7] branch1 resolved with mergetool
 Author: A U Thor <author@example.com>
ok 13 - submodule in subdirectory

expecting success: 
	git checkout -b test11 branch1 &&
	mv submod submod-movedaside &&
	git rm --cached submod &&
	mkdir submod &&
	echo not a submodule >submod/file16 &&
	git add submod/file16 &&
	git commit -m "Submodule path becomes directory" &&

	test_must_fail git merge master &&
	test -n "$(git ls-files -u)" &&
	( yes "l" | git mergetool submod ) &&
	test "$(cat submod/file16)" = "not a submodule" &&
	rm -rf submod.orig &&

	git reset --hard >/dev/null 2>&1 &&
	test_must_fail git merge master &&
	test -n "$(git ls-files -u)" &&
	test ! -e submod.orig &&
	( yes "r" | git mergetool submod ) &&
	test -d submod.orig &&
	test "$(cat submod.orig/file16)" = "not a submodule" &&
	rm -r submod.orig &&
	mv submod-movedaside/.git submod &&
	( cd submod && git clean -f && git reset --hard ) &&
	git submodule update -N &&
	test "$(cat submod/bar)" = "master submodule" &&
	git reset --hard >/dev/null 2>&1 && rm -rf submod-movedaside &&

	git checkout -b test11.c master &&
	git submodule update -N &&
	test_must_fail git merge test11 &&
	test -n "$(git ls-files -u)" &&
	( yes "l" | git mergetool submod ) &&
	git submodule update -N &&
	test "$(cat submod/bar)" = "master submodule" &&

	git reset --hard >/dev/null 2>&1 &&
	git submodule update -N &&
	test_must_fail git merge test11 &&
	test -n "$(git ls-files -u)" &&
	test ! -e submod.orig &&
	( yes "r" | git mergetool submod ) &&
	test "$(cat submod/file16)" = "not a submodule" &&

	git reset --hard master >/dev/null 2>&1 &&
	( cd submod && git clean -f && git reset --hard ) &&
	git submodule update -N

[master 7217f9f] quoted-self_name_dot_suppressed
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 quoted-self_name_dot_suppressed.t
Switched to a new branch 'test11'
[master 2a9b279] test suppress-cc.self quoted-self_name_dot_suppressed with name A U. Thor email author@example.com
 Author: A U. Thor <author@example.com>
 Date: Thu Apr 7 15:14:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 quoted-self_name_dot_suppressed.t
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
rm 'submod'
sub
file
file2
file
file2
ok 41 - difftool --dir-diff --no-symlinks

expecting success: 
		symlinks=--symlinks &&
		
	git difftool --dir-diff $symlinks --extcmd ls branch >output &&
	grep sub output &&
	grep file output

	
[test11 f795396] Submodule path becomes directory
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 1 deletion(-)
 delete mode 160000 submod
 create mode 100644 submod/file16
Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
Resolved 'both' using previous resolution.
Resolved 'file1' using previous resolution.
Resolved 'file2' using previous resolution.
Resolved 'spaced name' using previous resolution.
Resolved 'subdir/file3' using previous resolution.
Merging:
f795396 Submodule path becomes directory
virtual master
found 1 common ancestor:
c0d6d4d add initial versions
Adding submod/file16
CONFLICT (modify/delete): submod deleted in HEAD and modified in master. Version master of submod left in tree at submod~master.
Auto-merging subdir/file3
CONFLICT (content): Merge conflict in subdir/file3
Auto-merging spaced name
CONFLICT (content): Merge conflict in spaced name
Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
CONFLICT (modify/delete): file12 deleted in HEAD and modified in master. Version master of file12 left in tree.
CONFLICT (modify/delete): file11 deleted in master and modified in HEAD. Version HEAD of file11 left in tree.
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Auto-merging both
CONFLICT (add/add): Merge conflict in both
Automatic merge failed; fix conflicts and then commit the result.
Updating 7141cca..ec55a65
Fast-forward
Merging:
submod

Submodule merge conflict for 'submod':
  {local}: deleted
  {remote}: submodule commit 5b592f796c80b49a0e8916069c72cb3527ae3597
Resolved 'both' using previous resolution.
Resolved 'file1' using previous resolution.
Resolved 'file2' using previous resolution.
Resolved 'spaced name' using previous resolution.
Resolved 'subdir/file3' using previous resolution.
Use (l)ocal or (r)emote, or (a)bort? Merging:
f795396 Submodule path becomes directory
virtual master
found 1 common ancestor:
c0d6d4d add initial versions
Adding submod/file16
CONFLICT (modify/delete): submod deleted in HEAD and modified in master. Version master of submod left in tree at submod~master.
Auto-merging subdir/file3
CONFLICT (content): Merge conflict in subdir/file3
Auto-merging spaced name
CONFLICT (content): Merge conflict in spaced name
Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
CONFLICT (modify/delete): file12 deleted in HEAD and modified in master. Version master of file12 left in tree.
CONFLICT (modify/delete): file11 deleted in master and modified in HEAD. Version HEAD of file11 left in tree.
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Auto-merging both
CONFLICT (add/add): Merge conflict in both
Automatic merge failed; fix conflicts and then commit the result.
Submodule path 'sub1': checked out '16f35dbe1b011ba099b95d9716033ba6d1f02026'
ok 40 - git merge --ff-only: 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
		)
	
Merging:
submod

Submodule merge conflict for 'submod':
  {local}: deleted
  {remote}: submodule commit 5b592f796c80b49a0e8916069c72cb3527ae3597
Cloning into 'submodule_update'...
Use (l)ocal or (r)emote, or (a)bort? sub
done.
file
file2
file
file2
ok 42 - difftool --dir-diff --symlinks

expecting success: 
		symlinks=--no-symlinks &&
		
	git difftool --dir-diff $symlinks --prompt --extcmd ls branch >output &&
	grep sub output &&
	grep file output

	
HEAD is now at f1e7973 Add bar on branch1
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Submodule path 'submod': checked out '5b592f796c80b49a0e8916069c72cb3527ae3597'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
Switched to a new branch 'test11.c'
suppress-self-quoted-self_name_dot_suppressed.patch
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com
From: "A U. Thor" <author@example.com>
To: nobody@example.com
Subject: [PATCH] test suppress-cc.self quoted-self_name_dot_suppressed with name A U. Thor email author@example.com
Date: Wed, 16 Dec 2015 11:07:59 +0000
Message-Id: <1450264079-17435-1-git-send-email-author@example.com>
X-Mailer: git-send-email 2.6.4

Result: OK
Cloning into 'sub1'...
HEAD is now at 53cc672 Second.
ok 18 - self name with dot is suppressed

expecting success: 
	test_suppress_self_quoted 'Füñný Nâmé' 'odd_?=mail@example.com' 		'non_ascii_self_suppressed'

done.
[master 742718a] quoted-non_ascii_self_suppressed
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 quoted-non_ascii_self_suppressed.t
[master 9287b94] test suppress-cc.self quoted-non_ascii_self_suppressed with name Füñný Nâmé email odd_?=mail@example.com
 Author: Füñný Nâmé <odd_?=mail@example.com>
 Date: Thu Apr 7 15:15:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 quoted-non_ascii_self_suppressed.t
Merging:
48ba24d master updates
virtual test11
found 1 common ancestor:
c0d6d4d add initial versions
Adding submod/file16
CONFLICT (modify/delete): submod deleted in test11 and modified in HEAD. Version HEAD of submod left in tree at submod~HEAD.
Auto-merging subdir/file3
CONFLICT (content): Merge conflict in subdir/file3
Auto-merging spaced name
CONFLICT (content): Merge conflict in spaced name
Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
CONFLICT (modify/delete): file12 deleted in test11 and modified in HEAD. Version HEAD of file12 left in tree.
CONFLICT (modify/delete): file11 deleted in HEAD and modified in test11. Version test11 of file11 left in tree.
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Auto-merging both
CONFLICT (add/add): Merge conflict in both
Resolved 'both' using previous resolution.
Resolved 'file1' using previous resolution.
Resolved 'file2' using previous resolution.
Resolved 'spaced name' using previous resolution.
Resolved 'subdir/file3' using previous resolution.
Automatic merge failed; fix conflicts and then commit the result.
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
Updating 7141cca..2e1f05b
Fast-forward
Merging:
submod

Submodule merge conflict for 'submod':
  {local}: submodule commit 5b592f796c80b49a0e8916069c72cb3527ae3597
  {remote}: deleted
Use (l)ocal or (r)emote, or (a)bort? sub
file
file2
file
file2
ok 43 - difftool --dir-diff ignores --prompt --no-symlinks

expecting success: 
		symlinks=--symlinks &&
		
	git difftool --dir-diff $symlinks --prompt --extcmd ls branch >output &&
	grep sub output &&
	grep file output

	
fatal: reference is not a tree: 0123456789012345678901234567890123456789
Unable to checkout '0123456789012345678901234567890123456789' in submodule path 'sub1'
ok 41 - git merge --ff-only: 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
		)
	
error: refusing to lose untracked file at 'submod/file16'
Merging:
48ba24d master updates
virtual test11
found 1 common ancestor:
c0d6d4d add initial versions
Adding submod/file16
CONFLICT (modify/delete): submod deleted in test11 and modified in HEAD. Version HEAD of submod left in tree at submod~HEAD.
Auto-merging subdir/file3
CONFLICT (content): Merge conflict in subdir/file3
Auto-merging spaced name
CONFLICT (content): Merge conflict in spaced name
Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
CONFLICT (modify/delete): file12 deleted in test11 and modified in HEAD. Version HEAD of file12 left in tree.
CONFLICT (modify/delete): file11 deleted in HEAD and modified in test11. Version test11 of file11 left in tree.
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Auto-merging both
CONFLICT (add/add): Merge conflict in both
Resolved 'both' using previous resolution.
Resolved 'file1' using previous resolution.
Resolved 'file2' using previous resolution.
Resolved 'spaced name' using previous resolution.
Resolved 'subdir/file3' using previous resolution.
Automatic merge failed; fix conflicts and then commit the result.
Cloning into 'submodule_update'...
done.
Switched to a new branch 'invalid_sub1'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
fatal: Needed a single revision
Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
Merging:
submod

Updating 2e1f05b..fca299d
Fast-forward
Submodule merge conflict for 'submod':
  {local}: submodule commit 5b592f796c80b49a0e8916069c72cb3527ae3597
  {remote}: deleted
Use (l)ocal or (r)emote, or (a)bort? sub
file
file2
file
file2
ok 44 - difftool --dir-diff ignores --prompt --symlinks

expecting success: 
		symlinks=--no-symlinks &&
		
	(
		cd sub &&
		git difftool --dir-diff $symlinks --extcmd ls branch >output &&
		grep sub output &&
		grep file output
	)

	
suppress-self-quoted-non_ascii_self_suppressed.patch
HEAD is now at 5b592f7 Add bar on master
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com
From: =?UTF-8?q?F=C3=BC=C3=B1n=C3=BD=20N=C3=A2m=C3=A9?= <odd_?=mail@example.com>
To: nobody@example.com
Subject: [PATCH] =?UTF-8?q?test=20suppress-cc.self=20quoted-non=5Fascii=5F?= =?UTF-8?q?self=5Fsuppressed=20with=20name=20F=C3=BC=C3=B1n=C3=BD=20N?= =?UTF-8?q?=C3=A2m=C3=A9=20email=20odd=5F=3F=3Dmail@example.com?=
Date: Wed, 16 Dec 2015 11:08:02 +0000
Message-Id: <1450264082-17914-1-git-send-email-odd_?=mail@example.com>
X-Mailer: git-send-email 2.6.4
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Result: OK
HEAD is now at 53cc672 Second.
ok 19 - non-ascii self name is suppressed

expecting success: 
	test_suppress_self_quoted 'Ƒüñníęř €. Nâṁé' 'odd_?=mail@example.com' 		'long_non_ascii_self_suppressed'

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
[master 3c5bf00] quoted-long_non_ascii_self_suppressed
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 quoted-long_non_ascii_self_suppressed.t
[master c14ab53] test suppress-cc.self quoted-long_non_ascii_self_suppressed with name Ƒüñníęř €. Nâṁé email odd_?=mail@example.com
 Author: Ƒüñníęř €. Nâṁé <odd_?=mail@example.com>
 Date: Thu Apr 7 15:16:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 quoted-long_non_ascii_self_suppressed.t
Cloning into 'sub1'...
ok 14 - directory vs modified submodule

expecting success: 
	git checkout -b test13 branch1 &&
	test_must_fail git merge master &&
	git mergetool --no-prompt --tool mybase -- both &&
	>expected &&
	test_cmp both expected &&
	git reset --hard master >/dev/null 2>&1

Switched to a new branch 'test13'
M	submod
done.
warning: Failed to merge submodule submod (merge following commits not found)
Resolved 'both' using previous resolution.
Resolved 'file1' using previous resolution.
Resolved 'file2' using previous resolution.
Resolved 'spaced name' using previous resolution.
Resolved 'subdir/file3' using previous resolution.
Merging:
fb5c1b3 branch1 changes
virtual master
found 1 common ancestor:
c0d6d4d add initial versions
Auto-merging submod
CONFLICT (submodule): Merge conflict in submod
Auto-merging subdir/file3
CONFLICT (content): Merge conflict in subdir/file3
Auto-merging spaced name
CONFLICT (content): Merge conflict in spaced name
Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
CONFLICT (modify/delete): file12 deleted in HEAD and modified in master. Version master of file12 left in tree.
CONFLICT (modify/delete): file11 deleted in master and modified in HEAD. Version HEAD of file11 left in tree.
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Auto-merging both
CONFLICT (add/add): Merge conflict in both
Automatic merge failed; fix conflicts and then commit the result.
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
Merging:
both

Normal merge conflict for 'both':
  {local}: created file
  {remote}: created file
ok 42 - git merge --ff-only: 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
		)
	
sub
file
file2
file
file2
ok 45 - difftool --dir-diff from subdirectory --no-symlinks

expecting success: 
		symlinks=--symlinks &&
		
	(
		cd sub &&
		git difftool --dir-diff $symlinks --extcmd ls branch >output &&
		grep sub output &&
		grep file output
	)

	
ok 15 - file with no base

expecting success: 
	git checkout -b test14 branch1 &&
	test_config mergetool.defaults.cmd "cat \"\$REMOTE\" >\"\$MERGED\"" &&
	test_config mergetool.defaults.trustExitCode true &&
	test_must_fail git merge master &&
	git mergetool --no-prompt --tool defaults -- both &&
	echo master both added >expected &&
	test_cmp both expected &&
	git reset --hard master >/dev/null 2>&1

Cloning into 'submodule_update'...
Switched to a new branch 'test14'
M	submod
done.
warning: Failed to merge submodule submod (merge following commits not found)
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Resolved 'both' using previous resolution.
Resolved 'file1' using previous resolution.
Resolved 'file2' using previous resolution.
Resolved 'spaced name' using previous resolution.
Resolved 'subdir/file3' using previous resolution.
Merging:
fb5c1b3 branch1 changes
virtual master
found 1 common ancestor:
c0d6d4d add initial versions
Auto-merging submod
CONFLICT (submodule): Merge conflict in submod
Auto-merging subdir/file3
CONFLICT (content): Merge conflict in subdir/file3
Auto-merging spaced name
CONFLICT (content): Merge conflict in spaced name
Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
CONFLICT (modify/delete): file12 deleted in HEAD and modified in master. Version master of file12 left in tree.
CONFLICT (modify/delete): file11 deleted in master and modified in HEAD. Version HEAD of file11 left in tree.
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Auto-merging both
CONFLICT (add/add): Merge conflict in both
Automatic merge failed; fix conflicts and then commit the result.
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Merging:
2347eb4 Base
virtual add_sub1
found 1 common ancestor:
2347eb4 Base
Merge made by the 'recursive' strategy.
 .gitmodules | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
Merging:
both

Normal merge conflict for 'both':
  {local}: created file
  {remote}: created file
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 16 - custom commands override built-ins

expecting success: 
	git checkout -b test15 branch1 &&
	test_config mergetool.writeToTemp false &&
	test_config mergetool.myecho.cmd "echo \"\$LOCAL\"" &&
	test_config mergetool.myecho.trustExitCode true &&
	test_must_fail git merge master &&
	git mergetool --no-prompt --tool myecho -- both >actual &&
	grep ^\./both_LOCAL_ actual >/dev/null &&
	git reset --hard master >/dev/null 2>&1

Switched to a new branch 'test15'
M	submod
Cloning into 'sub1'...
warning: Failed to merge submodule submod (merge following commits not found)
Resolved 'both' using previous resolution.
Resolved 'file1' using previous resolution.
Resolved 'file2' using previous resolution.
Resolved 'spaced name' using previous resolution.
Resolved 'subdir/file3' using previous resolution.
Merging:
fb5c1b3 branch1 changes
virtual master
found 1 common ancestor:
c0d6d4d add initial versions
Auto-merging submod
CONFLICT (submodule): Merge conflict in submod
Auto-merging subdir/file3
CONFLICT (content): Merge conflict in subdir/file3
Auto-merging spaced name
CONFLICT (content): Merge conflict in spaced name
Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
CONFLICT (modify/delete): file12 deleted in HEAD and modified in master. Version master of file12 left in tree.
CONFLICT (modify/delete): file11 deleted in master and modified in HEAD. Version HEAD of file11 left in tree.
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Auto-merging both
CONFLICT (add/add): Merge conflict in both
Automatic merge failed; fix conflicts and then commit the result.
done.
suppress-self-quoted-long_non_ascii_self_suppressed.patch
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com
From: =?UTF-8?q?=C6=91=C3=BC=C3=B1n=C3=AD=C4=99=C5=99=20=E2=82=AC=2E=20N=C3=A2=E1=B9=81=C3=A9?= <odd_?=mail@example.com>
To: nobody@example.com
Subject: [PATCH] =?UTF-8?q?test=20suppress-cc.self=20quoted-long=5Fnon=5Fa?= =?UTF-8?q?scii=5Fself=5Fsuppressed=20with=20name=20=C6=91=C3=BC=C3=B1n?= =?UTF-8?q?=C3=AD=C4=99=C5=99=20=E2=82=AC.=20N=C3=A2=E1=B9=81=C3=A9=20emai?= =?UTF-8?q?l=20odd=5F=3F=3Dmail@example.com?=
Date: Wed, 16 Dec 2015 11:08:05 +0000
Message-Id: <1450264085-18427-1-git-send-email-odd_?=mail@example.com>
X-Mailer: git-send-email 2.6.4
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Result: OK
HEAD is now at 53cc672 Second.
ok 20 - long non-ascii self name is suppressed

expecting success: 
	test_suppress_self_unquoted '"A U. Thor"' 'author@example.com' 		'self_name_sanitized_suppressed'

sub
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
file
file2
file
file2
ok 46 - difftool --dir-diff from subdirectory --symlinks

[master 5471acc] unquoted-self_name_sanitized_suppressed
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 unquoted-self_name_sanitized_suppressed.t
expecting success: 
		symlinks=--no-symlinks &&
		
	test_when_finished git reset --hard &&
	rm file2 &&
	git difftool --dir-diff $symlinks --extcmd ls branch master >output &&
	grep file2 output

	
[master cd09f7e] test suppress-cc.self unquoted-self_name_sanitized_suppressed with name "A U. Thor" email author@example.com
 Author: A U. Thor <author@example.com>
 Date: Thu Apr 7 15:17:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 unquoted-self_name_sanitized_suppressed.t
ok 43 - git merge --no-ff: 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 17 - filenames seen by tools start with ./

expecting success: 
	git checkout -b test16 branch1 &&
	test_config mergetool.writeToTemp true &&
	test_config mergetool.myecho.cmd "echo \"\$LOCAL\"" &&
	test_config mergetool.myecho.trustExitCode true &&
	test_must_fail git merge master &&
	git mergetool --no-prompt --tool myecho -- both >actual &&
	test_must_fail grep ^\./both_LOCAL_ actual >/dev/null &&
	grep /both_LOCAL_ actual >/dev/null &&
	git reset --hard master >/dev/null 2>&1

Cloning into 'submodule_update'...
Switched to a new branch 'test16'
M	submod
done.
warning: Failed to merge submodule submod (merge following commits not found)
Switched to a new branch 'no_submodule'
Branch no_submodule set up to track remote branch no_submodule from origin.
Resolved 'both' using previous resolution.
Resolved 'file1' using previous resolution.
Resolved 'file2' using previous resolution.
Resolved 'spaced name' using previous resolution.
Resolved 'subdir/file3' using previous resolution.
Merging:
fb5c1b3 branch1 changes
virtual master
found 1 common ancestor:
c0d6d4d add initial versions
Auto-merging submod
CONFLICT (submodule): Merge conflict in submod
Auto-merging subdir/file3
CONFLICT (content): Merge conflict in subdir/file3
Auto-merging spaced name
CONFLICT (content): Merge conflict in spaced name
Auto-merging file2
CONFLICT (add/add): Merge conflict in file2
CONFLICT (modify/delete): file12 deleted in HEAD and modified in master. Version master of file12 left in tree.
CONFLICT (modify/delete): file11 deleted in master and modified in HEAD. Version HEAD of file11 left in tree.
Auto-merging file1
CONFLICT (content): Merge conflict in file1
Auto-merging both
CONFLICT (add/add): Merge conflict in both
Automatic merge failed; fix conflicts and then commit the result.
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Merging:
2347eb4 Base
virtual add_sub1
found 1 common ancestor:
2347eb4 Base
Merge made by the 'recursive' strategy.
 .gitmodules | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 .gitmodules
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 18 - temporary filenames are used with mergetool.writeToTemp

# passed all 18 test(s)
1..18
Cloning into 'sub1'...
done.
file2
file2
HEAD is now at 20f39ad modified both
ok 47 - difftool --dir-diff when worktree file is missing --no-symlinks

expecting success: 
		symlinks=--symlinks &&
		
	test_when_finished git reset --hard &&
	rm file2 &&
	git difftool --dir-diff $symlinks --extcmd ls branch master >output &&
	grep file2 output

	
*** t9002-column.sh ***
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9002-column/.git/
expecting success: 
	cat >lista <<\EOF
one
two
three
four
five
six
seven
eight
nine
ten
eleven
EOF

ok 1 - setup

expecting success: 
	git column --indent=Z --mode=never <lista >actual &&
	test_cmp lista actual

ok 2 - never

expecting success: 
	cat >expected <<\EOF &&
Zone
Ztwo
Zthree
Zfour
Zfive
Zsix
Zseven
Zeight
Znine
Zten
Zeleven
EOF
	git column --indent=Z --mode=plain <lista >actual &&
	test_cmp expected actual

ok 3 - always

expecting success: 
	cat >expected <<\EOF &&
one    two    three  four   five   six    seven  eight  nine   ten    eleven
EOF
	COLUMNS=80 git column --mode=column <lista >actual &&
	test_cmp expected actual

ok 4 - 80 columns

expecting success: 
	COLUMNS=1 git column --mode=column <lista >actual &&
	test_cmp expected actual

ok 5 - COLUMNS = 1

expecting success: 
	git column --mode=column --width=1 <lista >actual &&
	test_cmp expected actual

ok 6 - width = 1

expecting success: 
	cat >expected <<\EOF &&
one    seven
two    eight
three  nine
four   ten
five   eleven
six
EOF
	git column --mode=column <lista >actual &&
	test_cmp expected actual

ok 7 - 20 columns

expecting success: 
	cat >expected <<\EOF &&
one    seven
two    eight
three  nine
four   ten
five   eleven
six
EOF
	git column --mode=column,nodense < lista > actual &&
	test_cmp expected actual

ok 44 - git merge --no-ff: 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
		)
	
ok 8 - 20 columns, nodense

expecting success: 
	cat >expected <<\EOF &&
one   five  nine
two   six   ten
three seven eleven
four  eight
EOF
	git column --mode=column,dense < lista > actual &&
	test_cmp expected actual

ok 9 - 20 columns, dense

expecting success: 
	cat >expected <<\EOF &&
one     seven
two     eight
three   nine
four    ten
five    eleven
six
EOF
	git column --mode=column --padding 2 <lista >actual &&
	test_cmp expected actual

ok 10 - 20 columns, padding 2

expecting success: 
	cat >expected <<\EOF &&
  one    seven
  two    eight
  three  nine
  four   ten
  five   eleven
  six
EOF
	git column --mode=column --indent="  " <lista >actual &&
	test_cmp expected actual

ok 11 - 20 columns, indented

expecting success: 
	cat >expected <<\EOF &&
one    two
three  four
five   six
seven  eight
nine   ten
eleven
EOF
	git column --mode=row <lista >actual &&
	test_cmp expected actual

ok 12 - 20 columns, row first

expecting success: 
	cat >expected <<\EOF &&
one    two
three  four
five   six
seven  eight
nine   ten
eleven
EOF
	git column --mode=row,nodense <lista >actual &&
	test_cmp expected actual

ok 13 - 20 columns, row first, nodense

expecting success: 
	cat >expected <<\EOF &&
one   two    three
four  five   six
seven eight  nine
ten   eleven
EOF
	git column --mode=row,dense <lista >actual &&
	test_cmp expected actual

ok 14 - 20 columns, row first, dense

suppress-self-unquoted-self_name_sanitized_suppressed.patch
# passed all 14 test(s)
1..14
Cloning into 'submodule_update'...
*** t9010-svn-fe.sh ***
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com
From: "A U. Thor" <author@example.com>
To: nobody@example.com
Subject: [PATCH] test suppress-cc.self unquoted-self_name_sanitized_suppressed with name "A U. Thor" email author@example.com
Date: Wed, 16 Dec 2015 11:08:07 +0000
Message-Id: <1450264087-18931-1-git-send-email-author@example.com>
X-Mailer: git-send-email 2.6.4

Result: OK
done.
Switched to a new branch 'no_submodule'
HEAD is now at 53cc672 Second.
Branch no_submodule set up to track remote branch no_submodule from origin.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9010-svn-fe/.git/
ok 21 - sanitized self name is suppressed

expecting success: 
	git send-email \
		--dry-run \
		--suppress-cc=sob \
		--from="Example <from@example.com>" \
		--to=to@example.com \
		--cc=cc@example.com \
		--bcc=bcc@example.com \
		--in-reply-to="<unique-message-id@example.com>" \
		--smtp-server relay.example.com \
		$patches |
	sed	-e "s/^\(Date:\).*/\1 DATE-STRING/" \
		-e "s/^\(Message-Id:\).*/\1 MESSAGE-ID-STRING/" \
		-e "s/^\(X-Mailer:\).*/\1 X-MAILER-STRING/" \
		>actual-show-all-headers &&
	test_cmp expected-show-all-headers actual-show-all-headers

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

)
prerequisite PIPE ok
expecting success: 
	reinit_git &&
	echo "SVN-fs-dump-format-version: 2" >input &&
	try_dump input

Branch add_sub1 set up to track remote branch add_sub1 from origin.
error: The following untracked working tree files would be overwritten by merge:
	sub1
Please move or remove them before you can merge.
Aborting
fatal: merging of trees ec38489b3f8eda08fda17055ad272abc24bdf929 and 0b69b71484b60d71ef72f2a041be2266e119a257 failed
Merging:
2347eb4 Base
virtual add_sub1
found 1 common ancestor:
2347eb4 Base
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9010-svn-fe/.git/
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         0 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          0
pack_report: pack_mmap_calls          =          0
pack_report: pack_open_windows        =          0 /          0
pack_report: pack_mapped              =          0 /          0
---------------------------------------------------------------------

ok 1 - empty dump

expecting success: 
	reinit_git &&
	echo "SVN-fs-dump-format-version: 4" >v4.dump &&
	try_dump v4.dump must_fail

ok 45 - git merge --no-ff: 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
		)
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9010-svn-fe/.git/
fatal: expected svn dump format version <= 3, found 4
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         0 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          0
pack_report: pack_mmap_calls          =          0
pack_report: pack_open_windows        =          0 /          0
pack_report: pack_mapped              =          0 /          0
---------------------------------------------------------------------

ok 2 - v4 dumps not supported

file2
file2
checking known breakage: 
	reinit_git &&
	printf "rev <nobody, nobody@local>: %s\n" "" "" >expect &&
	cat >emptyrev.dump <<-\EOF &&
	SVN-fs-dump-format-version: 3

	Revision-number: 1
	Prop-content-length: 0
	Content-length: 0

	Revision-number: 2
	Prop-content-length: 0
	Content-length: 0

	EOF
	try_dump emptyrev.dump &&
	git log -p --format="rev <%an, %ae>: %s" HEAD >actual &&
	test_cmp expect actual

Cloning into 'submodule_update'...
HEAD is now at 20f39ad modified both
ok 48 - difftool --dir-diff when worktree file is missing --symlinks

expecting success: 
	cat >expect <<-EOF &&
	file
	$(pwd)/file
	file2
	$(pwd)/file2
	sub/sub
	$(pwd)/sub/sub
	EOF
	git difftool --dir-diff --symlink \
		--extcmd "./.git/CHECK_SYMLINKS" branch HEAD &&
	test_cmp actual expect

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9010-svn-fe/.git/
done.
fatal: invalid property line: Revision-number: 2
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         0 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          0
pack_report: pack_mmap_calls          =          0
pack_report: pack_open_windows        =          0 /          0
pack_report: pack_mapped              =          0 /          0
---------------------------------------------------------------------

not ok 3 - empty revision # TODO known breakage

expecting success: 
	reinit_git &&
	printf "rev <nobody, nobody@local>: %s\n" "" "" >expect &&
	cat >emptyprop.dump <<-\EOF &&
	SVN-fs-dump-format-version: 3

	Revision-number: 1
	Prop-content-length: 10
	Content-length: 10

	PROPS-END

	Revision-number: 2
	Prop-content-length: 10
	Content-length: 10

	PROPS-END
	EOF
	try_dump emptyprop.dump &&
	git log -p --format="rev <%an, %ae>: %s" HEAD >actual &&
	test_cmp expect actual

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.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9010-svn-fe/.git/
t7613-merge-submodule.sh: 159: cd: can't cd to sub1
progress Imported commit 1.
Branch replace_file_with_sub1 set up to track remote branch replace_file_with_sub1 from origin.
progress Imported commit 2.
Merging:
3d0ed3b Replace sub1 with file
virtual replace_file_with_sub1
found 1 common ancestor:
3d0ed3b Replace sub1 with file
Merge made by the 'recursive' strategy.
 .gitmodules | 4 ++++
 sub1        | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)
 mode change 100644 => 160000 sub1
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            9 (         0 duplicates                  )
      blobs  :            2 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            3 (         0 duplicates          1 deltas of          2 attempts)
      commits:            4 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           2 (         2 loads     )
      marks:           1024 (         2 unique    )
      atoms:              2
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          4
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        756 /        756
---------------------------------------------------------------------

ok 4 - empty properties

expecting success: 
	reinit_git &&
	echo "<author@example.com, author@example.com@local>" >expect.author &&
	cat >message <<-\EOF &&
	A concise summary of the change

	A detailed description of the change, why it is needed, what
	was broken and why applying this is the best course of action.

	* file.c
	    Details pertaining to an individual file.
	EOF
	{
		properties \
			svn:author author@example.com \
			svn:log "$(cat message)" &&
		echo PROPS-END
	} >props &&
	{
		echo "SVN-fs-dump-format-version: 3" &&
		echo &&
		echo "Revision-number: 1" &&
		echo Prop-content-length: $(wc -c <props) &&
		echo Content-length: $(wc -c <props) &&
		echo &&
		cat props
	} >log.dump &&
	try_dump log.dump &&
	git log -p --format="%B" HEAD >actual.log &&
	git log --format="<%an, %ae>" >actual.author &&
	test_cmp message actual.log &&
	test_cmp expect.author actual.author

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9010-svn-fe/.git/
progress Imported commit 1.
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            5 (         0 duplicates                  )
      blobs  :            1 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            2 (         0 duplicates          0 deltas of          1 attempts)
      commits:            2 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           2 (         2 loads     )
      marks:           1024 (         1 unique    )
      atoms:              1
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          4
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        494 /        494
---------------------------------------------------------------------

ok 5 - author name and commit message

Cloning into 'sub1'...
expecting success: 
	reinit_git &&
	echo author >expect &&
	cat >extraprop.dump <<-\EOF &&
	SVN-fs-dump-format-version: 3

	Revision-number: 1
	Prop-content-length: 56
	Content-length: 56

	K 8
	nonsense
	V 1
	y
	K 10
	svn:author
	V 6
	author
	PROPS-END
	EOF
	try_dump extraprop.dump &&
	git log -p --format=%an HEAD >actual &&
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9010-svn-fe/.git/
done.
progress Imported commit 1.
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            5 (         0 duplicates                  )
      blobs  :            1 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            2 (         0 duplicates          0 deltas of          1 attempts)
      commits:            2 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           2 (         2 loads     )
      marks:           1024 (         1 unique    )
      atoms:              1
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          4
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        357 /        357
---------------------------------------------------------------------

Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
ok 6 - unsupported properties are ignored

checking known breakage: 
	echo author@example.com >expect.author &&
	echo 1999-01-01 >expect.date &&
	echo file >expect.files &&
	reinit_git &&
	{
		properties \
			svn:author author@example.com \
			svn:date "1999-01-01T00:01:002.000000Z" \
			svn:log "add empty file" &&
		echo PROPS-END
	} >props &&
	{
		cat <<-EOF &&
		SVN-fs-dump-format-version: 3

		Revision-number: 1
		EOF
		echo Prop-content-length: $(wc -c <props) &&
		echo Content-length: $(wc -c <props) &&
		echo &&
		cat props &&
		cat <<-\EOF

		Node-path: empty-file
		Node-kind: file
		Node-action: add
		Content-length: 0

		EOF
	} >emptyfile.dump &&
	try_dump emptyfile.dump &&
	git log --format=%an HEAD >actual.author &&
	git log --date=short --format=%ad HEAD >actual.date &&
	git ls-tree -r --name-only HEAD >actual.files &&
	test_cmp expect.author actual.author &&
	test_cmp expect.date actual.date &&
	test_cmp expect.files actual.files &&
	git checkout HEAD empty-file &&
	test_cmp empty file

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9010-svn-fe/.git/
fatal: invalid dump: adds node without text
ok 49 - difftool --dir-diff --symlink without unstaged changes

expecting success: 
		symlinks=--no-symlinks &&
		
	test_when_finished git reset --hard &&
	echo "orig content" >file &&
	git difftool -d $symlinks --extcmd "$(pwd)/modify-right-file" branch &&
	echo "new content" >expect &&
	test_cmp expect file

	
ok 46 - git merge --no-ff: replace tracked file with submodule creates empty directory

checking known breakage: 
		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
		)
	
ok 22 - Show all headers

expecting success: 
	clean_fake_sendmail &&
	(echo "to@example.com"
	 echo ""
	) | GIT_SEND_EMAIL_NOTTY=1 git send-email \
		--smtp-server="$(pwd)/fake.sendmail" \
		$patches \
		2>errors &&
		grep "^From: A U Thor <author@example.com>\$" msgtxt1 &&
		grep "^To: to@example.com\$" msgtxt1

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            2 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            1 (         0 duplicates          0 deltas of          0 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         1 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          2
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        162 /        162
---------------------------------------------------------------------

not ok 7 - timestamp and empty file # TODO known breakage

expecting success: 
	reinit_git &&
	printf "%s\n" directory/file1 directory/file2 >expect.files &&
	echo hi >hi &&
	echo hello >hello &&
	{
		properties \
			svn:author author@example.com \
			svn:date "1999-02-01T00:01:002.000000Z" \
			svn:log "add directory with some files in it" &&
		echo PROPS-END
	} >props &&
	{
		cat <<-EOF &&
		SVN-fs-dump-format-version: 3

		Revision-number: 1
		EOF
		echo Prop-content-length: $(wc -c <props) &&
		echo Content-length: $(wc -c <props) &&
		echo &&
		cat props &&
		cat <<-\EOF &&

		Node-path: directory
		Node-kind: dir
		Node-action: add
		Prop-content-length: 10
		Content-length: 10

		PROPS-END

		Node-path: directory/file1
		Node-kind: file
		Node-action: add
		EOF
		text_no_props hello &&
		cat <<-\EOF &&
		Node-path: directory/file2
		Node-kind: file
		Node-action: add
		EOF
		text_no_props hi
	} >directory.dump &&
	try_dump directory.dump &&

	git ls-tree -r --name-only HEAD >actual.files &&
	git checkout HEAD directory &&
	test_cmp expect.files actual.files &&
	test_cmp hello directory/file1 &&
	test_cmp hi directory/file2

Cloning into 'submodule_update'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9010-svn-fe/.git/
done.
progress Imported commit 1.
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.
error: 8ed2e6719f8484ce01fa3ce133fe42d25c2441b8^{commit}: expected commit type, but the object dereferences to tree type
fatal: Needed a single revision
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            8 (         0 duplicates                  )
      blobs  :            3 (         0 duplicates          0 deltas of          1 attempts)
      trees  :            3 (         0 duplicates          0 deltas of          3 attempts)
      commits:            2 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           2 (         2 loads     )
      marks:           1024 (         1 unique    )
      atoms:              4
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          4
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        595 /        595
---------------------------------------------------------------------

Branch replace_directory_with_sub1 set up to track remote branch replace_directory_with_sub1 from origin.
ok 8 - directory with files

Merging:
0abcf00 Replace sub1 with directory
virtual replace_directory_with_sub1
found 1 common ancestor:
0abcf00 Replace sub1 with directory
Removing sub1/file3
Removing sub1/file2
Removing sub1/file1
Adding sub1
Merge made by the 'recursive' strategy.
expecting success: 
	reinit_git &&
	sort <<-\EOF >expect.branch-files &&
	trunk/file1
	trunk/file2
	"branches/UpdateFOPto094\\/file1"
	"branches/UpdateFOPto094\\/file2"
	EOF

	echo hi >hi &&
	echo hello >hello &&
	{
		properties \
			svn:author author@example.com \
			svn:date "1999-02-02T00:01:02.000000Z" \
			svn:log "add directory with some files in it" &&
		echo PROPS-END
	} >props.setup &&
	{
		properties \
			svn:author brancher@example.com \
			svn:date "2007-12-06T21:38:34.000000Z" \
			svn:log "Updating fop to .94 and adjust fo-stylesheets" &&
		echo PROPS-END
	} >props.branch &&
	{
		cat <<-EOF &&
		SVN-fs-dump-format-version: 3

		Revision-number: 1
		EOF
		echo Prop-content-length: $(wc -c <props.setup) &&
		echo Content-length: $(wc -c <props.setup) &&
		echo &&
		cat props.setup &&
		cat <<-\EOF &&

		Node-path: trunk
		Node-kind: dir
		Node-action: add
		Prop-content-length: 10
		Content-length: 10

		PROPS-END

		Node-path: branches
		Node-kind: dir
		Node-action: add
		Prop-content-length: 10
		Content-length: 10

		PROPS-END

		Node-path: trunk/file1
		Node-kind: file
		Node-action: add
		EOF
		text_no_props hello &&
		cat <<-\EOF &&
		Node-path: trunk/file2
		Node-kind: file
		Node-action: add
		EOF
		text_no_props hi &&
		cat <<-\EOF &&

		Revision-number: 2
		EOF
		echo Prop-content-length: $(wc -c <props.branch) &&
		echo Content-length: $(wc -c <props.branch) &&
		echo &&
		cat props.branch &&
		cat <<-\EOF

		Node-path: branches/UpdateFOPto094\
		Node-kind: dir
		Node-action: add
		Node-copyfrom-rev: 1
		Node-copyfrom-path: trunk

		Node-kind: dir
		Node-action: add
		Prop-content-length: 34
		Content-length: 34

		K 13
		svn:mergeinfo
		V 0

		PROPS-END
		EOF
	} >branch.dump &&
	try_dump branch.dump &&

	git ls-tree -r --name-only HEAD |
	sort >actual.branch-files &&
	test_cmp expect.branch-files actual.branch-files

 .gitmodules | 4 ++++
 sub1/file1  | 1 -
 sub1/file2  | 1 -
 sub1/file3  | 1 -
 4 files changed, 4 insertions(+), 3 deletions(-)
 delete mode 100644 sub1/file1
 delete mode 100644 sub1/file2
 delete mode 100644 sub1/file3
Directory sub1 doesn't exist. 
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9010-svn-fe/.git/
not ok 47 - git merge --no-ff: replace directory with submodule # TODO known breakage

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
		)
	
Cloning into 'submodule_update'...
progress Imported commit 1.
progress Imported commit 2.
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:           14 (         0 duplicates                  )
      blobs  :            4 (         0 duplicates          1 deltas of          2 attempts)
      trees  :            6 (         0 duplicates          1 deltas of          6 attempts)
      commits:            4 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           2 (         2 loads     )
      marks:           1024 (         2 unique    )
      atoms:              7
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          6
pack_report: pack_mmap_calls          =          2
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =       1246 /       1246
---------------------------------------------------------------------

ok 9 - branch name with backslash

expecting success: 
	reinit_git &&
	cat >inaction.dump <<-\EOF &&
	SVN-fs-dump-format-version: 3

	Revision-number: 1
	Prop-content-length: 10
	Content-length: 10

	PROPS-END

	Node-path: directory
	Node-kind: dir
	Prop-content-length: 10
	Content-length: 10

	PROPS-END
	EOF
	try_dump inaction.dump must_fail

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9010-svn-fe/.git/
fatal: invalid dump: Node-path block lacks Node-action
git-fast-import statistics:
HEAD is now at 20f39ad modified both
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            2 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            1 (         0 duplicates          0 deltas of          0 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         1 unique    )
      atoms:              0
ok 50 - difftool --dir-diff syncs worktree with unstaged change --no-symlinks

Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          2
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        138 /        138
---------------------------------------------------------------------

ok 10 - node without action

expecting success: 
		symlinks=--symlinks &&
		
	test_when_finished git reset --hard &&
	echo "orig content" >file &&
	git difftool -d $symlinks --extcmd "$(pwd)/modify-right-file" branch &&
	echo "new content" >expect &&
	test_cmp expect file

	
expecting success: 
	reinit_git &&
	cat >textless.dump <<-\EOF &&
	SVN-fs-dump-format-version: 3

	Revision-number: 1
	Prop-content-length: 10
	Content-length: 10

	PROPS-END

	Node-path: textless
	Node-kind: file
	Node-action: add
	Prop-content-length: 10
	Content-length: 10

	PROPS-END
	EOF
	try_dump textless.dump must_fail

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9010-svn-fe/.git/
fatal: invalid dump: adds node without text
Cloning into 'sub1'...
done.
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            2 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            1 (         0 duplicates          0 deltas of          0 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         1 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          2
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        138 /        138
---------------------------------------------------------------------

ok 11 - action: add node without text

checking known breakage: 
	reinit_git &&
	cat >expect <<-\EOF &&
	OBJID
	:120000 100644 OBJID OBJID T	greeting
	OBJID
	:100644 120000 OBJID OBJID T	greeting
	OBJID
	:000000 100644 OBJID OBJID A	greeting
	EOF
	echo "link hello" >expect.blob &&
	echo hello >hello &&
	cat >filemode.dump <<-\EOF &&
	SVN-fs-dump-format-version: 3

	Revision-number: 1
	Prop-content-length: 10
	Content-length: 10

	PROPS-END

	Node-path: greeting
	Node-kind: file
	Node-action: add
	Prop-content-length: 10
	Text-content-length: 11
	Content-length: 21

	PROPS-END
	link hello

	Revision-number: 2
	Prop-content-length: 10
	Content-length: 10

	PROPS-END

	Node-path: greeting
	Node-kind: file
	Node-action: change
	Prop-content-length: 33
	Content-length: 33

	K 11
	svn:special
	V 1
	*
	PROPS-END

	Revision-number: 3
	Prop-content-length: 10
	Content-length: 10

	PROPS-END

	Node-path: greeting
	Node-kind: file
	Node-action: change
	Prop-content-length: 10
	Content-length: 10

	PROPS-END
	EOF
	try_dump filemode.dump &&
	{
		git rev-list HEAD |
		git diff-tree --root --stdin |
		sed "s/$_x40/OBJID/g"
	} >actual &&
	git show HEAD:greeting >actual.blob &&
	git show HEAD^:greeting >actual.target &&
	test_cmp expect actual &&
	test_cmp expect.blob actual.blob &&
	test_cmp hello actual.target

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9010-svn-fe/.git/
progress Imported commit 1.
progress Imported commit 2.
progress Imported commit 3.
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
0001-Second.patch
Who should the emails be sent to (if any)? Message-ID to be used as In-Reply-To for the first email (if any)? (mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i to@example.com author@example.com one@example.com two@example.com committer@example.com
From: A U Thor <author@example.com>
To: to@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com,
	C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: Wed, 16 Dec 2015 11:08:11 +0000
Message-Id: <1450264091-19708-1-git-send-email-author@example.com>
X-Mailer: git-send-email 2.6.4

Result: OK
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:           15 (         1 duplicates                  )
      blobs  :            4 (         0 duplicates          2 deltas of          3 attempts)
      trees  :            5 (         1 duplicates          2 deltas of          5 attempts)
      commits:            6 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           2 (         2 loads     )
      marks:           1024 (         3 unique    )
      atoms:              4
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          4
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =       1309 /       1309
---------------------------------------------------------------------

Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
From: A U Thor <author@example.com>
To: to@example.com
ok 23 - Prompting works

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

)
Merging:
7141cca Add sub1
virtual remove_sub1
found 1 common ancestor:
7141cca Add sub1
Removing sub1
Removing .gitmodules
Merge made by the 'recursive' strategy.
 .gitmodules | 4 ----
 1 file changed, 4 deletions(-)
 delete mode 100644 .gitmodules
Debian build daemon <buildd@testbuildd.raspbian.org> 1112912233 -0700
--- hello	2015-12-16 11:08:11.757564904 +0000
+++ actual.target	2015-12-16 11:08:12.077564904 +0000
@@ -1 +1 @@
-hello
+link hello
not ok 12 - change file mode but keep old content # TODO known breakage

prerequisite AUTOIDENT ok
expecting success: 
	clean_fake_sendmail &&
	(sane_unset GIT_AUTHOR_NAME &&
	sane_unset GIT_AUTHOR_EMAIL &&
	sane_unset GIT_COMMITTER_NAME &&
	sane_unset GIT_COMMITTER_EMAIL &&
	GIT_SEND_EMAIL_NOTTY=1 git send-email \
		--smtp-server="$(pwd)/fake.sendmail" \
		--to=to@example.com \
		$patches </dev/null 2>errors
	)

expecting success: 
	reinit_git &&
	echo "commit message" >expect.message &&
	{
		properties \
			unimportant "something with a NUL (Q)" \
			svn:log "commit message"&&
		echo PROPS-END
	} |
	q_to_nul >props &&
	{
		cat <<-\EOF &&
		SVN-fs-dump-format-version: 3

		Revision-number: 1
		EOF
		echo Prop-content-length: $(wc -c <props) &&
		echo Content-length: $(wc -c <props) &&
		echo &&
		cat props
	} >nulprop.dump &&
	try_dump nulprop.dump &&
	git diff-tree --always -s --format=%s HEAD >actual.message &&
	test_cmp expect.message actual.message

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9010-svn-fe/.git/
ok 48 - git merge --no-ff: 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
		)
	
progress Imported commit 1.
Cloning into 'submodule_update'...
done.
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            5 (         0 duplicates                  )
      blobs  :            1 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            2 (         0 duplicates          0 deltas of          1 attempts)
      commits:            2 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           2 (         2 loads     )
      marks:           1024 (         1 unique    )
      atoms:              1
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          4
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        371 /        371
---------------------------------------------------------------------

ok 13 - NUL in property value

expecting success: 
	# Caveat: svnadmin 1.6.16 (r1073529) truncates at \0 in the
	# svn:specialQnotreally example.
	reinit_git &&
	cat >expect <<-\EOF &&
	OBJID
	:100644 100644 OBJID OBJID M	greeting
	OBJID
	:000000 100644 OBJID OBJID A	greeting
	EOF
	printf "\n%s\n" "something with an ASCII NUL (Q)" >expect.message &&
	printf "%s\n" "helQo" >expect.hello1 &&
	printf "%s\n" "link hello" >expect.hello2 &&
	{
		properties svn:log "something with an ASCII NUL (Q)" &&
		echo PROPS-END
	} |
	q_to_nul >props &&
	{
		q_to_nul <<-\EOF &&
		SVN-fs-dump-format-version: 3

		Revision-number: 1
		Prop-content-length: 10
		Content-length: 10

		PROPS-END

		Node-path: greeting
		Node-kind: file
		Node-action: add
		Prop-content-length: 10
		Text-content-length: 6
		Content-length: 16

		PROPS-END
		helQo

		Revision-number: 2
		EOF
		echo Prop-content-length: $(wc -c <props) &&
		echo Content-length: $(wc -c <props) &&
		echo &&
		cat props &&
		q_to_nul <<-\EOF

		Node-path: greeting
		Node-kind: file
		Node-action: change
		Prop-content-length: 43
		Text-content-length: 11
		Content-length: 54

		K 21
		svn:specialQnotreally
		V 1
		*
		PROPS-END
		link hello
		EOF
	} >8bitclean.dump &&
	try_dump 8bitclean.dump &&
	{
		git rev-list HEAD |
		git diff-tree --root --stdin |
		sed "s/$_x40/OBJID/g"
	} >actual &&
	{
		git cat-file commit HEAD | nul_to_q &&
		echo
	} |
	sed -ne "/^\$/,\$ p" >actual.message &&
	git cat-file blob HEAD^:greeting | nul_to_q >actual.hello1 &&
	git cat-file blob HEAD:greeting | nul_to_q >actual.hello2 &&
	test_cmp expect actual &&
	test_cmp expect.message actual.message &&
	test_cmp expect.hello1 actual.hello1 &&
	test_cmp expect.hello2 actual.hello2

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9010-svn-fe/.git/
progress Imported commit 1.
HEAD is now at 20f39ad modified both
progress Imported commit 2.
ok 51 - difftool --dir-diff syncs worktree with unstaged change --symlinks

expecting success: 
		symlinks=--no-symlinks &&
		
	test_when_finished git reset --hard &&
	git difftool -d $symlinks --extcmd "$(pwd)/modify-right-file" branch &&
	echo "new content" >expect &&
	test_cmp expect file

	
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:           12 (         0 duplicates                  )
      blobs  :            4 (         0 duplicates          0 deltas of          2 attempts)
      trees  :            4 (         0 duplicates          1 deltas of          4 attempts)
      commits:            4 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           2 (         2 loads     )
      marks:           1024 (         2 unique    )
      atoms:              3
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          4
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        991 /        991
---------------------------------------------------------------------

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
ok 14 - NUL in log message, file content, and property name

expecting success: 
	reinit_git &&
	cat >expect <<-\EOF &&
	OBJID
	:120000 100644 OBJID OBJID T	greeting
	OBJID
	:100644 120000 OBJID OBJID T	greeting
	OBJID
	:000000 100644 OBJID OBJID A	greeting
	EOF
	echo "link hello" >expect.blob &&
	echo hello >hello &&
	cat >filemode2.dump <<-\EOF &&
	SVN-fs-dump-format-version: 3

	Revision-number: 1
	Prop-content-length: 10
	Content-length: 10

	PROPS-END

	Node-path: greeting
	Node-kind: file
	Node-action: add
	Prop-content-length: 10
	Text-content-length: 11
	Content-length: 21

	PROPS-END
	link hello

	Revision-number: 2
	Prop-content-length: 10
	Content-length: 10

	PROPS-END

	Node-path: greeting
	Node-kind: file
	Node-action: change
	Prop-content-length: 33
	Text-content-length: 11
	Content-length: 44

	K 11
	svn:special
	V 1
	*
	PROPS-END
	link hello

	Revision-number: 3
	Prop-content-length: 10
	Content-length: 10

	PROPS-END

	Node-path: greeting
	Node-kind: file
	Node-action: change
	Prop-content-length: 10
	Text-content-length: 11
	Content-length: 21

	PROPS-END
	link hello
	EOF
	try_dump filemode2.dump &&
	{
		git rev-list HEAD |
		git diff-tree --root --stdin |
		sed "s/$_x40/OBJID/g"
	} >actual &&
	git show HEAD:greeting >actual.blob &&
	git show HEAD^:greeting >actual.target &&
	test_cmp expect actual &&
	test_cmp expect.blob actual.blob &&
	test_cmp hello actual.target

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9010-svn-fe/.git/
Cloning into 'sub1'...
progress Imported commit 1.
progress Imported commit 2.
progress Imported commit 3.
done.
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:           16 (         2 duplicates                  )
      blobs  :            5 (         1 duplicates          1 deltas of          3 attempts)
      trees  :            5 (         1 duplicates          2 deltas of          5 attempts)
      commits:            6 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           2 (         2 loads     )
      marks:           1024 (         3 unique    )
      atoms:              4
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          4
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =       1359 /       1359
---------------------------------------------------------------------

Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
ok 15 - change file mode and reiterate content

expecting success: 
	reinit_git &&
	{
		# (old) h + (inline) ello + (old) \n
		printf "SVNQ%b%b%s" "Q\003\006\005\004" "\001Q\0204\001\002" "ello" |
		q_to_nul
	} >delta &&
	{
		properties \
			svn:author author@example.com \
			svn:date "1999-01-05T00:01:002.000000Z" \
			svn:log "add greeting" &&
		echo PROPS-END
	} >props &&
	{
		properties \
			svn:author author@example.com \
			svn:date "1999-01-06T00:01:002.000000Z" \
			svn:log "change it" &&
		echo PROPS-END
	} >props2 &&
	{
		echo SVN-fs-dump-format-version: 3 &&
		echo &&
		echo Revision-number: 1 &&
		echo Prop-content-length: $(wc -c <props) &&
		echo Content-length: $(wc -c <props) &&
		echo &&
		cat props &&
		cat <<-\EOF &&

		Node-path: hello
		Node-kind: file
		Node-action: add
		Prop-content-length: 10
		Text-content-length: 3
		Content-length: 13

		PROPS-END
		hi

		EOF
		echo Revision-number: 2 &&
		echo Prop-content-length: $(wc -c <props2) &&
		echo Content-length: $(wc -c <props2) &&
		echo &&
		cat props2 &&
		cat <<-\EOF &&

		Node-path: hello
		Node-kind: file
		Node-action: change
		Text-delta: true
		Prop-content-length: 10
		EOF
		echo Text-content-length: $(wc -c <delta) &&
		echo Content-length: $((10 + $(wc -c <delta))) &&
		echo &&
		echo PROPS-END &&
		cat delta
	} >delta.dump &&
	try_dump delta.dump

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9010-svn-fe/.git/
Branch remove_sub1 set up to track remote branch remove_sub1 from origin.
progress Imported commit 1.
progress Imported commit 2.
Merging:
7141cca Add sub1
virtual remove_sub1
found 1 common ancestor:
7141cca Add sub1
Removing sub1
Removing .gitmodules
Merge made by the 'recursive' strategy.
 .gitmodules | 4 ----
 1 file changed, 4 deletions(-)
 delete mode 100644 .gitmodules
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:           12 (         0 duplicates                  )
      blobs  :            4 (         0 duplicates          0 deltas of          2 attempts)
      trees  :            4 (         0 duplicates          1 deltas of          4 attempts)
      commits:            4 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           2 (         2 loads     )
      marks:           1024 (         2 unique    )
      atoms:              3
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          5
pack_report: pack_mmap_calls          =          2
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        995 /        995
---------------------------------------------------------------------

ok 16 - deltas supported

expecting success: 
	reinit_git &&
	cat >expect <<-\EOF &&
	OBJID
	:100755 100644 OBJID OBJID M	script.sh
	EOF
	{
		properties \
			svn:author author@example.com \
			svn:date "1999-03-06T00:01:002.000000Z" \
			svn:log "make an executable, or chmod -x it" &&
		echo PROPS-END
	} >revprops &&
	{
		echo SVN-fs-dump-format-version: 3 &&
		echo &&
		echo Revision-number: 1 &&
		echo Prop-content-length: $(wc -c <revprops) &&
		echo Content-length: $(wc -c <revprops) &&
		echo &&
		cat revprops &&
		echo &&
		cat <<-\EOF &&
		Node-path: script.sh
		Node-kind: file
		Node-action: add
		Text-content-length: 0
		Prop-content-length: 39
		Content-length: 39

		K 14
		svn:executable
		V 4
		true
		PROPS-END

		EOF
		echo Revision-number: 2 &&
		echo Prop-content-length: $(wc -c <revprops) &&
		echo Content-length: $(wc -c <revprops) &&
		echo &&
		cat revprops &&
		echo &&
		cat <<-\EOF
		Node-path: script.sh
		Node-kind: file
		Node-action: change
		Prop-delta: true
		Prop-content-length: 30
		Content-length: 30

		D 14
		svn:executable
		PROPS-END
		EOF
	} >propdelta.dump &&
	try_dump propdelta.dump &&
	{
		git rev-list HEAD |
		git diff-tree --stdin |
		sed "s/$_x40/OBJID/g"
	} >actual &&
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9010-svn-fe/.git/
0001-Second.patch
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'
progress Imported commit 1.
progress Imported commit 2.
ok 49 - git merge --no-ff: 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. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i to@example.com author@example.com one@example.com two@example.com committer@example.com
From: Debian build daemon <buildd@testbuildd.raspbian.org>
To: to@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com,
	C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: Wed, 16 Dec 2015 11:08:14 +0000
Message-Id: <1450264094-20028-1-git-send-email-buildd@testbuildd.raspbian.org>
X-Mailer: git-send-email 2.6.4

Result: OK
ok 24 - implicit ident is allowed

skipping test: broken implicit ident aborts send-email 
	clean_fake_sendmail &&
	(sane_unset GIT_AUTHOR_NAME &&
	sane_unset GIT_AUTHOR_EMAIL &&
	sane_unset GIT_COMMITTER_NAME &&
	sane_unset GIT_COMMITTER_EMAIL &&
	GIT_SEND_EMAIL_NOTTY=1 && export GIT_SEND_EMAIL_NOTTY &&
	test_must_fail git send-email \
		--smtp-server="$(pwd)/fake.sendmail" \
		--to=to@example.com \
		$patches </dev/null 2>errors &&
	test_i18ngrep "tell me who you are" errors
	)

ok 25 # skip broken implicit ident aborts send-email (missing !AUTOIDENT of PERL,!AUTOIDENT)

expecting success: 
	write_script tocmd-sed <<-\EOF &&
	sed -n -e "s/^tocmd--//p" "$1"
	EOF
	write_script cccmd-sed <<-\EOF
	sed -n -e "s/^cccmd--//p" "$1"
	EOF

HEAD is now at 20f39ad modified both
ok 52 - difftool --dir-diff syncs worktree without unstaged change --no-symlinks

expecting success: 
		symlinks=--symlinks &&
		
	test_when_finished git reset --hard &&
	git difftool -d $symlinks --extcmd "$(pwd)/modify-right-file" branch &&
	echo "new content" >expect &&
	test_cmp expect file

	
ok 26 - setup tocmd and cccmd scripts

expecting success: 
	clean_fake_sendmail &&
	cp $patches tocmd.patch &&
	echo tocmd--tocmd@example.com >>tocmd.patch &&
	git send-email \
		--from="Example <nobody@example.com>" \
		--to-cmd=./tocmd-sed \
		--smtp-server="$(pwd)/fake.sendmail" \
		tocmd.patch \
		&&
	grep "^To: tocmd@example.com" msgtxt1

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:           11 (         0 duplicates                  )
      blobs  :            3 (         0 duplicates          1 deltas of          2 attempts)
      trees  :            4 (         0 duplicates          1 deltas of          4 attempts)
      commits:            4 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           2 (         2 loads     )
      marks:           1024 (         2 unique    )
      atoms:              3
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          4
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        991 /        991
---------------------------------------------------------------------

ok 17 - property deltas supported

expecting success: 
	reinit_git &&
	cat <<-\EOF >expect &&
	OBJID
	OBJID
	:000000 100644 OBJID OBJID A	greeting
	EOF
	sed -e "s/X$//" <<-\EOF >changeroot.dump &&
	SVN-fs-dump-format-version: 3

	Revision-number: 1
	Prop-content-length: 10
	Content-length: 10

	PROPS-END

	Node-path: greeting
	Node-kind: file
	Node-action: add
	Text-content-length: 0
	Prop-content-length: 10
	Content-length: 10

	PROPS-END

	Revision-number: 2
	Prop-content-length: 10
	Content-length: 10

	PROPS-END

	Node-path: X
	Node-kind: dir
	Node-action: change
	Prop-delta: true
	Prop-content-length: 43
	Content-length: 43

	K 10
	svn:ignore
	V 11
	build-area

	PROPS-END
	EOF
	try_dump changeroot.dump &&
	{
		git rev-list HEAD |
		git diff-tree --root --always --stdin |
		sed "s/$_x40/OBJID/g"
	} >actual &&
	test_cmp expect actual

Cloning into 'submodule_update'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9010-svn-fe/.git/
done.
progress Imported commit 1.
progress Imported commit 2.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:           10 (         0 duplicates                  )
      blobs  :            3 (         0 duplicates          0 deltas of          2 attempts)
      trees  :            3 (         0 duplicates          1 deltas of          3 attempts)
      commits:            4 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           2 (         2 loads     )
      marks:           1024 (         2 unique    )
      atoms:              3
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          4
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        882 /        882
---------------------------------------------------------------------

ok 18 - properties on /

expecting success: 
	reinit_git &&
	cat >expect <<-\EOF &&
	OBJID
	:120000 100644 OBJID OBJID T	test-file
	OBJID
	:100755 120000 OBJID OBJID T	test-file
	OBJID
	:000000 100755 OBJID OBJID A	test-file
	EOF
	cat >deleteprop.dump <<-\EOF &&
	SVN-fs-dump-format-version: 3

	Revision-number: 1
	Prop-content-length: 10
	Content-length: 10

	PROPS-END

	Node-path: test-file
	Node-kind: file
	Node-action: add
	Prop-delta: true
	Prop-content-length: 35
	Text-content-length: 17
	Content-length: 52

	K 14
	svn:executable
	V 0

	PROPS-END
	link testing 123

	Revision-number: 2
	Prop-content-length: 10
	Content-length: 10

	PROPS-END

	Node-path: test-file
	Node-kind: file
	Node-action: change
	Prop-delta: true
	Prop-content-length: 53
	Text-content-length: 17
	Content-length: 70

	K 11
	svn:special
	V 1
	*
	D 14
	svn:executable
	PROPS-END
	link testing 231

	Revision-number: 3
	Prop-content-length: 10
	Content-length: 10

	PROPS-END

	Node-path: test-file
	Node-kind: file
	Node-action: change
	Prop-delta: true
	Prop-content-length: 27
	Text-content-length: 17
	Content-length: 44

	D 11
	svn:special
	PROPS-END
	link testing 321
	EOF
	try_dump deleteprop.dump &&
	{
		git rev-list HEAD |
		git diff-tree --root --stdin |
		sed "s/$_x40/OBJID/g"
	} >actual &&
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9010-svn-fe/.git/
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
progress Imported commit 1.
progress Imported commit 2.
progress Imported commit 3.
Cloning into 'sub1'...
done.
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:           18 (         0 duplicates                  )
      blobs  :            6 (         0 duplicates          0 deltas of          3 attempts)
      trees  :            6 (         0 duplicates          2 deltas of          6 attempts)
      commits:            6 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           2 (         2 loads     )
      marks:           1024 (         3 unique    )
      atoms:              4
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          4
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =       1483 /       1483
---------------------------------------------------------------------

ok 19 - deltas for typechange

expecting success: 
	reinit_git &&
	cat >expect <<-\EOF &&
	OBJID
	:120000 100644 OBJID OBJID T	postimage
	OBJID
	:100644 120000 OBJID OBJID T	postimage
	OBJID
	:000000 100644 OBJID OBJID A	postimage
	EOF
	echo "first preimage" >expect.1 &&
	printf target >expect.2 &&
	printf lnk >expect.3 &&
	{
		printf "SVNQ%b%b%b" "QQ\017\001\017" "\0217" "first preimage\n" |
		q_to_nul
	} >delta.1 &&
	{
		properties svn:special "*" &&
		echo PROPS-END
	} >symlink.props &&
	{
		printf "SVNQ%b%b%b" "Q\002\013\004\012" "\0201\001\001\0211" "lnk target" |
		q_to_nul
	} >delta.2 &&
	{
		printf "SVNQ%b%b" "Q\004\003\004Q" "\001Q\002\002" |
		q_to_nul
	} >delta.3 &&
	{
		cat <<-\EOF &&
		SVN-fs-dump-format-version: 3

		Revision-number: 1
		Prop-content-length: 10
		Content-length: 10

		PROPS-END

		Node-path: postimage
		Node-kind: file
		Node-action: add
		Text-delta: true
		Prop-content-length: 10
		EOF
		echo Text-content-length: $(wc -c <delta.1) &&
		echo Content-length: $((10 + $(wc -c <delta.1))) &&
		echo &&
		echo PROPS-END &&
		cat delta.1 &&
		cat <<-\EOF &&

		Revision-number: 2
		Prop-content-length: 10
		Content-length: 10

		PROPS-END

		Node-path: postimage
		Node-kind: file
		Node-action: change
		Text-delta: true
		EOF
		echo Prop-content-length: $(wc -c <symlink.props) &&
		echo Text-content-length: $(wc -c <delta.2) &&
		echo Content-length: $(($(wc -c <symlink.props) + $(wc -c <delta.2))) &&
		echo &&
		cat symlink.props &&
		cat delta.2 &&
		cat <<-\EOF &&

		Revision-number: 3
		Prop-content-length: 10
		Content-length: 10

		PROPS-END

		Node-path: postimage
		Node-kind: file
		Node-action: change
		Text-delta: true
		Prop-content-length: 10
		EOF
		echo Text-content-length: $(wc -c <delta.3) &&
		echo Content-length: $((10 + $(wc -c <delta.3))) &&
		echo &&
		echo PROPS-END &&
		cat delta.3 &&
		echo
	} >deltapartial.dump &&
	try_dump deltapartial.dump &&
	{
		git rev-list HEAD |
		git diff-tree --root --stdin |
		sed "s/$_x40/OBJID/g"
	} >actual &&
	test_cmp expect actual &&
	git show HEAD:postimage >actual.3 &&
	git show HEAD^:postimage >actual.2 &&
	git show HEAD^^:postimage >actual.1 &&
	test_cmp expect.1 actual.1 &&
	test_cmp expect.2 actual.2 &&
	test_cmp expect.3 actual.3

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9010-svn-fe/.git/
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
HEAD is now at 20f39ad modified both
ok 53 - difftool --dir-diff syncs worktree without unstaged change --symlinks

Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
progress Imported commit 1.
expecting success: 
	echo "orig content" >file &&
	git difftool --dir-diff --no-symlinks --extcmd "$(pwd)/modify-file" branch &&
	echo "new content" >expect &&
	test_cmp expect file

progress Imported commit 2.
progress Imported commit 3.
error: refusing to lose untracked file at 'sub1/file2'
error: refusing to lose untracked file at 'sub1/file1'
Merging:
7141cca Add sub1
virtual replace_sub1_with_directory
found 1 common ancestor:
7141cca Add sub1
Adding sub1/file3
Adding sub1/file2
Adding sub1/file1
Removing sub1
Merge made by the 'recursive' strategy.
 .gitmodules | 4 ----
 sub1/file1  | 1 +
 sub1/file2  | 1 +
 sub1/file3  | 1 +
 4 files changed, 3 insertions(+), 4 deletions(-)
 create mode 100644 sub1/file1
 create mode 100644 sub1/file2
 create mode 100644 sub1/file3
test_must_fail: command succeeded: git merge --no-ff replace_sub1_with_directory
not ok 50 - git merge --no-ff: 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
		)
	
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:           18 (         0 duplicates                  )
      blobs  :            6 (         0 duplicates          0 deltas of          3 attempts)
      trees  :            6 (         0 duplicates          2 deltas of          6 attempts)
      commits:            6 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           2 (         2 loads     )
      marks:           1024 (         3 unique    )
      atoms:              4
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          6
pack_report: pack_mmap_calls          =          3
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =       1456 /       1456
---------------------------------------------------------------------

ok 20 - deltas need not consume the whole preimage

expecting success: 
	reinit_git &&
	{
		# COPY 1
		printf "SVNQ%b%b" "Q\001\001\002Q" "\001Q" |
		q_to_nul
	} >greedy.delta &&
	{
		cat <<-\EOF &&
		SVN-fs-dump-format-version: 3

		Revision-number: 1
		Prop-content-length: 10
		Content-length: 10

		PROPS-END

		Node-path: bootstrap
		Node-kind: file
		Node-action: add
		Text-delta: true
		Prop-content-length: 10
		EOF
		echo Text-content-length: $(wc -c <greedy.delta) &&
		echo Content-length: $((10 + $(wc -c <greedy.delta))) &&
		echo &&
		echo PROPS-END &&
		cat greedy.delta &&
		echo
	} >greedydelta.dump &&
	try_dump greedydelta.dump must_fail might_fail

Cloning into 'submodule_update'...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9010-svn-fe/.git/
done.
error: delta preimage ends early
fatal: cannot apply delta
fast-import: dumping crash report to .git/fast_import_crash_20697
ok 21 - no hang for delta trying to read past end of preimage

expecting success: 
	svnconf=$PWD/svnconf &&
	mkdir -p "$svnconf" &&

	if
		svnadmin -h >/dev/null 2>&1 &&
		svnadmin create simple-svn &&
		svnadmin load simple-svn <"$TEST_DIRECTORY/t9135/svn.dump" &&
		svn export --config-dir "$svnconf" "file://$PWD/simple-svn" simple-svnco
	then
		test_set_prereq SVNREPO
	fi

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
tocmd.patch
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'
(to-cmd) Adding to: tocmd@example.com from: './tocmd-sed'
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i tocmd@example.com author@example.com one@example.com two@example.com committer@example.com
From: Example <nobody@example.com>
To: tocmd@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com,
	C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: Wed, 16 Dec 2015 11:08:16 +0000
Message-Id: <1450264096-20404-1-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4

Result: OK
To: tocmd@example.com
ok 27 - tocmd works

expecting success: 
	clean_fake_sendmail &&
	cp $patches cccmd.patch &&
	echo "cccmd--  cccmd@example.com" >>cccmd.patch &&
	git send-email \
		--from="Example <nobody@example.com>" \
		--to=nobody@example.com \
		--cc-cmd=./cccmd-sed \
		--smtp-server="$(pwd)/fake.sendmail" \
		cccmd.patch \
		&&
	grep "^	cccmd@example.com" msgtxt1

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'sub1'...
done.
ok 54 - difftool --no-symlinks does not overwrite working tree file 

expecting success: 
	(
		TMPDIR=$TRASH_DIRECTORY &&
		export TMPDIR &&
		echo "orig content" >file &&
		test_must_fail git difftool --dir-diff --no-symlinks --extcmd "$(pwd)/modify-both-files" branch &&
		echo "wt content" >expect &&
		test_cmp expect file &&
		echo "tmp content" >expect &&
		test_cmp expect "$(cat tmpdir)/file"
	)

Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
Branch replace_sub1_with_directory set up to track remote branch replace_sub1_with_directory from origin.
<<< Started new transaction, based on original revision 1
     * editing path : branches ... done.
     * editing path : trunk ... done.
error: refusing to lose untracked file at 'sub1/file2'
error: refusing to lose untracked file at 'sub1/file1'
Merging:
7141cca Add sub1
virtual replace_sub1_with_directory
found 1 common ancestor:
7141cca Add sub1
Adding sub1/file3
Adding sub1/file2
Adding sub1/file1
Removing sub1
Merge made by the 'recursive' strategy.
 .gitmodules | 4 ----
 sub1/file1  | 1 +
 sub1/file2  | 1 +
 sub1/file3  | 1 +
 4 files changed, 3 insertions(+), 4 deletions(-)
 create mode 100644 sub1/file1
 create mode 100644 sub1/file2
 create mode 100644 sub1/file3
test_must_fail: command succeeded: git merge --no-ff replace_sub1_with_directory
not ok 51 - git merge --no-ff: 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
		)
	
Cloning into 'submodule_update'...
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.

------- Committed revision 1 >>>

<<< Started new transaction, based on original revision 2
     * editing path : branches/branch-b ...COPIED... done.
cccmd.patch
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
(cc-cmd) Adding cc: cccmd@example.com from: './cccmd-sed'
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com author@example.com one@example.com two@example.com committer@example.com cccmd@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com,
	C O Mitter <committer@example.com>,
	cccmd@example.com
Subject: [PATCH 1/1] Second.
Date: Wed, 16 Dec 2015 11:08:18 +0000
Message-Id: <1450264098-20736-1-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4

Result: OK
	cccmd@example.com
ok 28 - cccmd works

expecting success: 
	z8=zzzzzzzz &&
	z64=$z8$z8$z8$z8$z8$z8$z8$z8 &&
	z512=$z64$z64$z64$z64$z64$z64$z64$z64 &&
	clean_fake_sendmail &&
	cp $patches longline.patch &&
	echo $z512$z512 >>longline.patch &&
	test_must_fail git send-email \
		--from="Example <nobody@example.com>" \
		--to=nobody@example.com \
		--smtp-server="$(pwd)/fake.sendmail" \
		$patches longline.patch \
		2>errors &&
	grep longline.patch errors

warning: Both files modified: '/«PKGBUILDDIR»/t/trash directory.t7800-difftool/file' and '/«PKGBUILDDIR»/t/trash directory.t7800-difftool/git-difftool.icQ25/right/file'.
warning: Working tree file has been left.
warning:
warning: Temporary files exist in '/«PKGBUILDDIR»/t/trash directory.t7800-difftool/git-difftool.icQ25'.
warning: You may want to cleanup or recover these.
ok 55 - difftool --no-symlinks detects conflict 

expecting success: 
	git submodule add ./. submod/ule &&
	(
		cd submod/ule &&
		test_config diff.tool checktrees &&
		test_config difftool.checktrees.cmd '
			test -d "$LOCAL" && test -d "$REMOTE" && echo good
		' &&
		echo good >expect &&
		git difftool --tool=checktrees --dir-diff HEAD~ >actual &&
		test_cmp expect actual
	)

Cloning into 'sub1'...
done.

------- Committed revision 2 >>>

Cloning into 'submod/ule'...
done.
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
<<< Started new transaction, based on original revision 3
     * editing path : branches/branch-b/b1 ... done.
Merging:
7141cca Add sub1
virtual replace_sub1_with_file
found 1 common ancestor:
7141cca Add sub1
Merge made by the 'recursive' strategy.
 .gitmodules | 4 ----
 sub1        | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
test_must_fail: command succeeded: git merge --no-ff replace_sub1_with_file
not ok 52 - git merge --no-ff: 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
		)
	
Cloning into 'submodule_update'...
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.

------- Committed revision 3 >>>

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
<<< Started new transaction, based on original revision 4
     * editing path : branches/branch-c ...COPIED... done.
Cloning into 'sub1'...
done.
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'

------- Committed revision 4 >>>

fatal: longline.patch: 35: patch contains a line longer than 998 characters
ok 29 - reject long lines

expecting success: 
	! test -e commandline1

ok 30 - no patch was sent

expecting success: 
	clean_fake_sendmail &&
	git send-email \
		--from="Example <nobody@example.com>" \
		--to=nobody@example.com \
		--smtp-server="$(pwd)/fake.sendmail" \
		$patches &&
	sed "1,/^\$/d" <msgtxt1 >msgbody1 &&
	grep "From: A <author@example.com>" msgbody1

Branch replace_sub1_with_file set up to track remote branch replace_sub1_with_file from origin.
<<< Started new transaction, based on original revision 5
     * editing path : branches/branch-c ... done.
ok 56 - difftool properly honors gitlink and core.worktree

expecting success: 
	git init dirlinks &&
	(
		cd dirlinks &&
		git config diff.tool checktrees &&
		git config difftool.checktrees.cmd "echo good" &&
		mkdir foo &&
		: >foo/bar &&
		git add foo/bar &&
		test_commit symlink-one &&
		ln -s foo link &&
		git add link &&
		test_commit symlink-two &&
		echo good >expect &&
		git difftool --tool=checktrees --dir-diff HEAD~ >actual &&
		test_cmp expect actual
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t7800-difftool/dirlinks/.git/
Merging:
7141cca Add sub1
virtual replace_sub1_with_file
found 1 common ancestor:
7141cca Add sub1
Merge made by the 'recursive' strategy.
 .gitmodules | 4 ----
 sub1        | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)
 mode change 160000 => 100644 sub1
test_must_fail: command succeeded: git merge --no-ff replace_sub1_with_file
not ok 53 - git merge --no-ff: 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
		)
	
[master (root-commit) f38528f] symlink-one
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
 create mode 100644 foo/bar
 create mode 100644 symlink-one.t
[master 669ece0] symlink-two
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 120000 link
 create mode 100644 symlink-two.t
Cloning into 'submodule_update'...
done.
Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.

------- Committed revision 5 >>>

<<< Started new transaction, based on original revision 6
     * editing path : branches/branch-c ...COPIED... done.
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'sub1'...
done.
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'

------- Committed revision 6 >>>

A    simple-svnco
Branch modify_sub1 set up to track remote branch modify_sub1 from origin.
A    simple-svnco/branches
A    simple-svnco/branches/branch-b
A    simple-svnco/branches/branch-b/b1
A    simple-svnco/branches/branch-c
A    simple-svnco/branches/branch-c/b1
A    simple-svnco/trunk
Exported revision 6.
ok 22 - set up svn repo

expecting success: 
	mkdir -p simple-git &&
	(
		cd simple-git &&
		reinit_git &&
		try_dump "$TEST_DIRECTORY/t9135/svn.dump"
	) &&
	(
		cd simple-svnco &&
		git init &&
		git add . &&
		git fetch ../simple-git master &&
		git diff --exit-code FETCH_HEAD
	)

Merging:
7141cca Add sub1
virtual modify_sub1
found 1 common ancestor:
7141cca Add sub1
Merge made by the 'recursive' strategy.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9010-svn-fe/simple-git/.git/
progress Imported commit 1.
progress Imported commit 2.
progress Imported commit 3.
progress Imported commit 4.
progress Imported commit 5.
progress Imported commit 6.
ok 57 - difftool --dir-diff symlinked directories

# passed all 57 test(s)
1..57
0001-Second.patch
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com author@example.com one@example.com two@example.com committer@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com,
	C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: Wed, 16 Dec 2015 11:08:22 +0000
Message-Id: <1450264102-21330-1-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4

Result: OK
From: A <author@example.com>
ok 31 - Author From: in message body

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:           31 (         0 duplicates                  )
      blobs  :            7 (         0 duplicates          2 deltas of          6 attempts)
      trees  :           12 (         0 duplicates          6 deltas of         11 attempts)
      commits:           12 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           2 (         2 loads     )
      marks:           1024 (         6 unique    )
      atoms:             10
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =         11
pack_report: pack_mmap_calls          =          4
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =       3155 /       3155
---------------------------------------------------------------------

expecting success: 
	clean_fake_sendmail &&
	git send-email \
		--from="A <author@example.com>" \
		--to=nobody@example.com \
		--smtp-server="$(pwd)/fake.sendmail" \
		$patches &&
	sed "1,/^\$/d" <msgtxt1 >msgbody1 &&
	! grep "From: A <author@example.com>" msgbody1

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9010-svn-fe/simple-svnco/.git/
*** t9011-svn-da.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9011-svn-da/.git/
expecting success: 
	test_must_fail test-svn-fe -d preimage empty 0

error: invalid delta: unexpected end of file
ok 1 - reject empty delta

expecting success: 
	printf "SVNQ" | q_to_nul >clear.delta &&
	test-svn-fe -d preimage clear.delta 4 >actual &&
	test_cmp empty actual

From ../simple-git
 * branch            master     -> FETCH_HEAD
ok 2 - delta can empty file

expecting success: 
	printf "SVN\002" >bad.filetype &&
	test_must_fail test-svn-fe -d preimage bad.filetype 4

ok 23 - t9135/svn.dump

# still have 3 known breakage(s)
error: invalid delta: unrecognized file type
# passed all remaining 20 test(s)
1..23
ok 3 - reject svndiff2

expecting success: 
	printf "SVNQ%s" "QQQQQ" | q_to_nul >clear.onewindow &&
	test-svn-fe -d preimage clear.onewindow 9 >actual &&
	test_cmp empty actual

Submodule path 'sub1': checked out '16f35dbe1b011ba099b95d9716033ba6d1f02026'
ok 4 - one-window empty delta

expecting success: 
	printf "SVNQ%s" "QQQQQ" | q_to_nul >clear.onewindow &&
	printf "SVNQ%s" "QQ" | q_to_nul >clear.partialwindow &&
	test_must_fail test-svn-fe -d preimage clear.onewindow 6 &&
	test_must_fail test-svn-fe -d preimage clear.partialwindow 6

error: invalid delta: unexpected end of file
error: invalid delta: unexpected end of file
ok 5 - reject incomplete window header

expecting success: 
	printf "SVNQ%s" "QQQQQ" | q_to_nul >clear.onewindow &&
	printf "SVNQ%s" "QQ" | q_to_nul >clear.partialwindow &&
	test_must_fail test-svn-fe -d preimage clear.onewindow 14 &&
	test_must_fail test-svn-fe -d preimage clear.partialwindow 9

ok 54 - git merge --no-ff: 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
		)
	
*** t9020-remote-svn.sh ***
error: invalid delta: unexpected end of file
error: invalid delta: unexpected end of file
ok 6 - reject declared delta longer than actual delta

expecting success: 
	printf "SVNQ%s%s" "QQQQQ" "QQQQQ" | q_to_nul >clear.twowindow &&
	test-svn-fe -d preimage clear.twowindow 14 >actual &&
	test_must_fail test-svn-fe -d preimage clear.twowindow 13 &&
	test_cmp empty actual

error: invalid delta: unexpected end of file
ok 7 - two-window empty delta

expecting success: 
	printf "SVNQ%s" \
		"RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRQQQQQ" |
		tr R "\200" |
		q_to_nul >clear.noisy &&
	len=$(wc -c <clear.noisy) &&
	test-svn-fe -d preimage clear.noisy $len &&
	test_cmp empty actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9020-remote-svn/.git/
Cloning into 'submodule_update'...
ok 8 - noisy zeroes

expecting success: 
	printf "SVNRQ" | tr R "\200" | q_to_nul >clear.badmagic &&
	test_must_fail test-svn-fe -d preimage clear.badmagic 5

expecting success: 
	init_git &&
	git fetch svnsim &&
	test_cmp .git/refs/svn/svnsim/master .git/refs/remotes/svnsim/master  &&
	cp .git/refs/remotes/svnsim/master master.good

error: invalid delta: unrecognized file type
ok 9 - reject variable-length int in magic

expecting success: 
	printf "SVNQ%s%s" "QQQQQ" "QQQQRRQ" |
		tr R "\200" |
		q_to_nul >clear.fullint &&
	printf "SVNQ%s%s" "QQQQQ" "QQQQRR" |
		tr RT "\201" |
		q_to_nul >clear.partialint &&
	test_must_fail test-svn-fe -d preimage clear.fullint 15 &&
	test-svn-fe -d preimage clear.fullint 16 &&
	test_must_fail test-svn-fe -d preimage clear.partialint 15

done.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9020-remote-svn/.git/
error: invalid delta: unexpected end of file
error: invalid delta: unexpected end of file
ok 10 - reject truncated integer

expecting success: 
	printf "SVNQ%b" "Q\003QQQ" | q_to_nul >clear.readpreimage &&
	test-svn-fe -d preimage clear.readpreimage 9 >actual &&
	test_cmp empty actual

Switched to a new branch 'add_sub1'
Branch add_sub1 set up to track remote branch add_sub1 from origin.
ok 11 - nonempty (but unused) preimage view

expecting success: 
	printf "SVNQ%b%b" "Q\003QQQ" "Q\002QQQ" |
		q_to_nul >clear.backtrack &&
	test_must_fail test-svn-fe -d preimage clear.backtrack 14

error: invalid delta: window slides left
ok 12 - preimage view: right endpoint cannot backtrack

expecting success: 
	printf "SVNQ%b%b" "Q\003QQQ" "\001\002QQQ" |
		q_to_nul >clear.preshrink &&
	printf "SVNQ%b%b" "Q\003QQQ" "\001\001QQQ" |
		q_to_nul >clear.shrinkbacktrack &&
	test-svn-fe -d preimage clear.preshrink 14 >actual &&
	test_must_fail test-svn-fe -d preimage clear.shrinkbacktrack 14 &&
	test_cmp empty actual

error: invalid delta: window slides left
ok 13 - preimage view: left endpoint can advance

expecting success: 
	printf "SVNQ%b%b" "\001\001QQQ" "\0200Q\003QQQ" |
		q_to_nul >clear.noisybacktrack &&
	printf "SVNQ%b%b" "\001\001QQQ" "\0200\001\002QQQ" |
		q_to_nul >clear.noisyadvance &&
	test_must_fail test-svn-fe -d preimage clear.noisybacktrack 15 &&
	test-svn-fe -d preimage clear.noisyadvance 15 &&
	test_cmp empty actual

progress Imported commit 1.
progress Imported commit 2.
progress Imported commit 3.
progress Imported commit 4.
error: invalid delta: window slides left
progress Imported commit 5.
progress Imported commit 6.
ok 14 - preimage view: offsets compared by value

expecting success: 
	printf "SVNQ%b" "\010QQQQ" | q_to_nul >clear.lateemptyread &&
	printf "SVNQ%b" "\010\001QQQ" | q_to_nul >clear.latenonemptyread &&
	printf "SVNQ%b" "\001\010QQQ" | q_to_nul >clear.longread &&
	test_must_fail test-svn-fe -d preimage clear.lateemptyread 9 &&
	test_must_fail test-svn-fe -d preimage clear.latenonemptyread 9 &&
	test_must_fail test-svn-fe -d preimage clear.longread 9

error: delta preimage ends early
error: delta preimage ends early
error: delta preimage ends early
ok 15 - preimage view: reject truncated preimage

expecting success: 
	printf "SVNQ%b%s%b%s" "QQQQ\003" "bar" "QQQQ\001" "x" |
		q_to_nul >inline.clear &&
	test_must_fail test-svn-fe -d preimage inline.clear 18 >actual

Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
error: invalid delta: does not copy all inline data
ok 16 - forbid unconsumed inline data

expecting success: 
	printf "SVNQ%b%s" "QQQQ\003" "b" | q_to_nul >inline.trunc &&
	test_must_fail test-svn-fe -d preimage inline.trunc 10

From testsvn::sim:///«PKGBUILDDIR»/t/t9154/svn.dump
 * [new branch]      master     -> svnsim/master
error: invalid delta: unexpected end of file
ok 17 - reject truncated inline data

expecting success: 
	printf "SVNQ%b%b%s" "QQ\001\001\003" "\0201" "b" | q_to_nul >insn.trunc &&
	test_must_fail test-svn-fe -d preimage insn.trunc 11

ok 1 - simple fetch

expecting success: 
	git fetch svnsim &&
	test_cmp master.good .git/refs/remotes/svnsim/master

error: invalid delta: unexpected end of file
ok 18 - reject truncated inline data (after instruction section)

expecting success: 
	echo hi >expect &&
	printf "SVNQ%b%b%b" "QQ\003\001\003" "\0203" "hi\n" | q_to_nul >copydat &&
	test-svn-fe -d preimage copydat 13 >actual &&
	test_cmp expect actual

ok 19 - copyfrom_data

expecting success: 
	echo hi >expect &&
	printf "SVNQ%b%b%b%b%b" "QQ\003\002\003" "\0201\0202" "hi\n" \
		"QQQ\002Q" "\0200Q" | q_to_nul >copy.multi &&
	len=$(wc -c <copy.multi) &&
	test-svn-fe -d preimage copy.multi $len >actual &&
	test_cmp expect actual

Cloning into 'sub1'...
ok 20 - multiple copyfrom_data

expecting success: 
	printf "SVNQ%b%b%b" "QQ\003\002\003" "\0203\0200" "hi\n" |
		q_to_nul >copy.partial &&
	len=$(wc -c <copy.partial) &&
	test_must_fail test-svn-fe -d preimage copy.partial $len

error: invalid delta: unexpected end of instructions section
ok 21 - incomplete multiple insn

expecting success: 
	printf "SVNQ%b%b%s%b%s" "QQ\002\002\001" "\0201\0201" "X" \
			"QQQQ\002" "YZ" |
		q_to_nul >copy.incomplete &&
	len=$(wc -c <copy.incomplete) &&
	test_must_fail test-svn-fe -d preimage copy.incomplete $len

done.
warning: svnrdump, returned 1
error: invalid delta: copies unavailable inline data
ok 22 - catch attempt to copy missing data

expecting success: 
	printf foofoo >expect &&
	printf "SVNQ%b%b%s" "QQ\006\004\003" "\0203\0100\003Q" "foo" |
		q_to_nul >copytarget.repeat &&
	len=$(wc -c <copytarget.repeat) &&
	test-svn-fe -d preimage copytarget.repeat $len >actual &&
	test_cmp expect actual

ok 2 - repeated fetch, nothing shall change

expecting success: 
	git fetch svnfile

ok 23 - copyfrom target to repeat data

expecting success: 
	printf foooof >expect &&
	printf "SVNQ%b%b%s" \
		"QQ\006\007\003" "\0203\0101\002\0101\001\0101Q" "foo" |
		q_to_nul >copytarget.reverse &&
	len=$(wc -c <copytarget.reverse) &&
	test-svn-fe -d preimage copytarget.reverse $len >actual &&
	test_cmp expect actual

ok 24 - copyfrom target out of order

expecting success: 
	printf "SVNQ%b%b%s" "QQ\004\004\003" "\0202\0101\002\0201" "XYZ" |
		q_to_nul >copytarget.infuture &&
	len=$(wc -c <copytarget.infuture) &&
	test_must_fail test-svn-fe -d preimage copytarget.infuture $len

error: invalid delta: copies from the future
ok 25 - catch copyfrom future

expecting success: 
	printf XYXYXYXYXYXZ >expect &&
	printf "SVNQ%b%b%s" "QQ\014\004\003" "\0202\0111Q\0201" "XYZ" |
		q_to_nul >copytarget.sustain &&
	len=$(wc -c <copytarget.sustain) &&
	test-svn-fe -d preimage copytarget.sustain $len >actual &&
	test_cmp expect actual

progress Imported commit 1.
progress Imported commit 2.
progress Imported commit 3.
progress Imported commit 4.
progress Imported commit 5.
progress Imported commit 6.
ok 26 - copy to sustain

expecting success: 
	printf "SVNQ%b%b%s" "QQ\003\003\001" "\0201\0177Q" X |
		q_to_nul >copytarget.overflow &&
	len=$(wc -c <copytarget.overflow) &&
	test_must_fail test-svn-fe -d preimage copytarget.overflow $len

Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
error: invalid delta: incorrect postimage length
ok 27 - catch copy that overflows

expecting success: 
	printf foo >expect &&
	printf "SVNQ%b%b" "Q\003\003\002Q" "\003Q" | q_to_nul >copysource.all &&
	test-svn-fe -d preimage copysource.all 11 >actual &&
	test_cmp expect actual

ok 28 - copyfrom source

expecting success: 
	printf oof >expect &&
	printf "SVNQ%b%b" "Q\003\003\006Q" "\001\002\001\001\001Q" |
		q_to_nul >copysource.rev &&
	test-svn-fe -d preimage copysource.rev 15 >actual &&
	test_cmp expect actual

ok 29 - copy backwards

expecting success: 
	printf fo >expect &&
	printf "SVNQ%b%b%b%b" "Q\003\001\002Q" "\001Q" \
		"\002\001\001\002Q" "\001Q" |
		q_to_nul >copysource.two &&
	test-svn-fe -d preimage copysource.two 18 >actual &&
	test_cmp expect actual

Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
From testsvn::file:///«PKGBUILDDIR»/t/t9154/svn.dump
 * [new branch]      master     -> svnfile/master
ok 3 - fetch from a file:// url gives the same result

ok 30 - offsets are relative to window

expecting success: 
	printf aaaaccccdddddddd >expect &&
	printf aaaabbbbcccc >source &&
	printf "SVNQ%b%b%s" "Q\014\020\007\001" \
		"\004Q\004\010\0201\0107\010" d |
		q_to_nul >delta.example &&
	len=$(wc -c <delta.example) &&
	test-svn-fe -d source delta.example $len >actual &&
	test_cmp expect actual

checking known breakage: 
	test_cmp .git/refs/remotes/svnfile/master .git/refs/remotes/svnsim/master

--- .git/refs/remotes/svnfile/master	2015-12-16 11:08:24.257564906 +0000
+++ .git/refs/remotes/svnsim/master	2015-12-16 11:08:23.525564906 +0000
@@ -1 +1 @@
-5eae62c2f3487c5ea270e341430ada7561fb3f90
+9a341ed7b7df44e2bf2186fb8e4324fa67dbf56c
Merging:
7141cca Add sub1
virtual invalid_sub1
found 1 common ancestor:
7141cca Add sub1
Merge made by the 'recursive' strategy.
not ok 4 - the sha1 differ because the git-svn-id line in the commit msg contains the url # TODO known breakage

expecting success: 
	# filter out any other marks, that can not be regenerated. Only up to 3 digit revisions are allowed here
	grep ":[0-9]\{1,3\} " $MARKSPATH/svnsim.marks > $MARKSPATH/svnsim.marks.old &&
	rm $MARKSPATH/svnsim.marks &&
	git fetch svnsim &&
	test_cmp $MARKSPATH/svnsim.marks.old $MARKSPATH/svnsim.marks

ok 31 - example from notes/svndiff

# passed all 31 test(s)
1..31
*** t9100-git-svn-basic.sh ***
0001-Second.patch
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com author@example.com one@example.com two@example.com committer@example.com
From: A <author@example.com>
To: nobody@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com,
	C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: Wed, 16 Dec 2015 11:08:24 +0000
Message-Id: <1450264104-21621-1-git-send-email-author@example.com>
X-Mailer: git-send-email 2.6.4

Result: OK
ok 32 - Author From: not in message body

expecting success: 
	git send-email \
		--from="Example <nobody@example.com>" \
		--to=nobody@example.com \
		--smtp-server="$(pwd)/fake.sendmail" \
		--no-validate \
		$patches longline.patch \
		2>errors

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9100-git-svn-basic/.git/
warning: svnrdump, returned 1
ok 5 - mark-file regeneration

expecting success: 
	SVNRMAX=3 &&
	export SVNRMAX &&
	init_git &&
	git fetch svnsim &&
	test_cmp .git/refs/svn/svnsim/master .git/refs/remotes/svnsim/master  &&
	unset SVNRMAX &&
	git fetch svnsim &&
	test_cmp master.good .git/refs/remotes/svnsim/master

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9020-remote-svn/.git/
progress Imported commit 1.
progress Imported commit 2.
fatal: reference is not a tree: 0123456789012345678901234567890123456789
Unable to checkout '0123456789012345678901234567890123456789' in submodule path 'sub1'
ok 55 - git merge --no-ff: 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
		)
	
From testsvn::sim:///«PKGBUILDDIR»/t/t9154/svn.dump
 * [new branch]      master     -> svnsim/master
Cloning into 'submodule_update'...
done.
progress Imported commit 3.
Switched to a new branch 'invalid_sub1'
Branch invalid_sub1 set up to track remote branch invalid_sub1 from origin.
progress Imported commit 4.
progress Imported commit 5.
progress Imported commit 6.
fatal: Needed a single revision
Branch valid_sub1 set up to track remote branch valid_sub1 from origin.
Merging:
2e1f05b Invalid sub1 commit
virtual valid_sub1
found 1 common ancestor:
2e1f05b Invalid sub1 commit
Merge made by the 'recursive' strategy.
From testsvn::sim:///«PKGBUILDDIR»/t/t9154/svn.dump
   af40fb0..9a341ed  master     -> svnsim/master
ok 6 - incremental imports must lead to the same head

# still have 1 known breakage(s)
# passed all remaining 5 test(s)
1..6
*** t9101-git-svn-props.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9101-git-svn-props/.git/
Submodule 'sub1' (/«PKGBUILDDIR»/t/trash directory.t7613-merge-submodule/submodule_update_repo/.) registered for path 'sub1'
Cloning into 'sub1'...
done.
0001-Second.patch
longline.patch
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com author@example.com one@example.com two@example.com committer@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com,
	C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: Wed, 16 Dec 2015 11:08:25 +0000
Message-Id: <1450264106-22191-1-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4

Result: OK
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com author@example.com one@example.com two@example.com committer@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com,
	C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: Wed, 16 Dec 2015 11:08:26 +0000
Message-Id: <1450264106-22191-2-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4
In-Reply-To: <1450264106-22191-1-git-send-email-nobody@example.com>
References: <1450264106-22191-1-git-send-email-nobody@example.com>

Result: OK
ok 33 - allow long lines with --no-validate

expecting success: 
	clean_fake_sendmail &&
	git send-email \
		--from="Example <nobody@example.com>" \
		--to=nobody@example.com \
		--in-reply-to=" " \
		--smtp-server="$(pwd)/fake.sendmail" \
		$patches \
		2>errors &&
	! grep "^In-Reply-To: < *>" msgtxt1

define NO_SVN_TESTS to skip git svn tests
# UTF-8 locale not set, some tests skipped ()
expecting success: 
	mkdir import &&
	(
		cd import &&
		echo foo >foo &&
		ln -s foo foo.link
		mkdir -p dir/a/b/c/d/e &&
		echo "deep dir" >dir/a/b/c/d/e/file &&
		mkdir bar &&
		echo "zzz" >bar/zzz &&
		echo "#!/bin/sh" >exec.sh &&
		chmod +x exec.sh &&
		svn_cmd import -m "import for git svn" . "$svnrepo" >/dev/null
	) &&
	rm -rf import &&
	git svn init "$svnrepo"
Submodule path 'sub1': checked out '2347eb41f9999e497dc0cd1624a4423397243b74'
ok 56 - git merge --no-ff: modified submodule does not update submodule work tree from invalid commit

# still have 11 known breakage(s)
# passed all remaining 45 test(s)
1..56
*** t9102-git-svn-deep-rmdir.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9102-git-svn-deep-rmdir/.git/
0001-Second.patch
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com author@example.com one@example.com two@example.com committer@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com,
	C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: Wed, 16 Dec 2015 11:08:27 +0000
Message-Id: <1450264107-22470-1-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4

Result: OK
ok 34 - Invalid In-Reply-To

expecting success: 
	clean_fake_sendmail &&
	(echo "From Example <from@example.com>"
	 echo "To Example <to@example.com>"
	 echo ""
	) | GIT_SEND_EMAIL_NOTTY=1 git send-email \
		--smtp-server="$(pwd)/fake.sendmail" \
		$patches 2>errors &&
	! grep "^In-Reply-To: < *>" msgtxt1

expecting success: 
	mkdir import &&
	(
		cd import &&
		mkdir -p deeply/nested/directory/number/1 &&
		mkdir -p deeply/nested/directory/number/2 &&
		echo foo >deeply/nested/directory/number/1/file &&
		echo foo >deeply/nested/directory/number/2/another &&
		svn_cmd import -m "import for git svn" . "$svnrepo"
	)
	
Adding         deeply
Adding         deeply/nested
Adding         deeply/nested/directory
Adding         deeply/nested/directory/number
Adding         deeply/nested/directory/number/1
Adding         deeply/nested/directory/number/1/file
Adding         deeply/nested/directory/number/2
0001-Second.patch
Adding         deeply/nested/directory/number/2/another
Who should the emails be sent to (if any)? Committing transaction...
Message-ID to be used as In-Reply-To for the first email (if any)? (mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i from@example.com author@example.com one@example.com two@example.com committer@example.com
From: A U Thor <author@example.com>
To: From Example <from@example.com>
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com,
	C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: Wed, 16 Dec 2015 11:08:29 +0000
Message-Id: <1450264109-22593-1-git-send-email-author@example.com>
X-Mailer: git-send-email 2.6.4
In-Reply-To: <To Example <to@example.com>
References: <To Example <to@example.com>

Result: OK
ok 35 - Valid In-Reply-To when prompting

expecting success: 
	clean_fake_sendmail &&
	echo "<unique-message-id@example.com>" >expect &&
	git send-email \
		--from="Example <nobody@example.com>" \
		--to=nobody@example.com \
		--no-chain-reply-to \
		--in-reply-to="$(cat expect)" \
		--smtp-server="$(pwd)/fake.sendmail" \
		$patches $patches $patches \
		2>errors &&
	# The first message is a reply to --in-reply-to
	sed -n -e "s/^In-Reply-To: *\(.*\)/\1/p" msgtxt1 >actual &&
	test_cmp expect actual &&
	# Second and subsequent messages are replies to the first one
	sed -n -e "s/^Message-Id: *\(.*\)/\1/p" msgtxt1 >expect &&
	sed -n -e "s/^In-Reply-To: *\(.*\)/\1/p" msgtxt2 >actual &&
	test_cmp expect actual &&
	sed -n -e "s/^In-Reply-To: *\(.*\)/\1/p" msgtxt3 >actual &&
	test_cmp expect actual

expecting success: svn co "$svnrepo" test_wc
A    test_wc/cr
A    test_wc/crlf
A    test_wc/empty
A    test_wc/empty_cr
A    test_wc/empty_crlf
A    test_wc/empty_lf
A    test_wc/kw.c
A    test_wc/lf
A    test_wc/ne_cr
A    test_wc/ne_crlf
A    test_wc/ne_lf
Checked out revision 1.
ok 1 - checkout working copy from svn

expecting success: 
	(
		cd test_wc &&
		echo Greetings >> kw.c &&
		poke kw.c &&
		svn_cmd commit -m "Not yet an Id" &&
		echo Hello world >> kw.c &&
		poke kw.c &&
		svn_cmd commit -m "Modified file, but still not yet an Id" &&
		svn_cmd propset svn:keywords Id kw.c &&
		poke kw.c &&
		svn_cmd commit -m "Propset Id"
	)

Committed revision 1.
ok 1 - initialize repo

expecting success: 
	git svn init "$svnrepo" &&
	git svn fetch &&
	git checkout -f -b test-rmdir ${remotes_git_svn}
	
Sending        kw.c
Transmitting file data .done
Committing transaction...
ok 1 - initialize git svn

expecting success: git svn fetch
0001-Second.patch
0001-Second.patch
0001-Second.patch
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com author@example.com one@example.com two@example.com committer@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com,
	C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: Wed, 16 Dec 2015 11:08:29 +0000
Message-Id: <1450264111-22658-1-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4
In-Reply-To: <unique-message-id@example.com>
References: <unique-message-id@example.com>

Result: OK
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com author@example.com one@example.com two@example.com committer@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com,
	C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: Wed, 16 Dec 2015 11:08:30 +0000
Message-Id: <1450264111-22658-2-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4
In-Reply-To: <1450264111-22658-1-git-send-email-nobody@example.com>
References: <unique-message-id@example.com>
 <1450264111-22658-1-git-send-email-nobody@example.com>

Result: OK
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com author@example.com one@example.com two@example.com committer@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com,
	C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: Wed, 16 Dec 2015 11:08:31 +0000
Message-Id: <1450264111-22658-3-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4
In-Reply-To: <1450264111-22658-1-git-send-email-nobody@example.com>
References: <unique-message-id@example.com>
 <1450264111-22658-1-git-send-email-nobody@example.com>

Result: OK
ok 36 - In-Reply-To without --chain-reply-to

expecting success: 
	clean_fake_sendmail &&
	echo "<unique-message-id@example.com>" >expect &&
	git send-email \
		--from="Example <nobody@example.com>" \
		--to=nobody@example.com \
		--chain-reply-to \
		--in-reply-to="$(cat expect)" \
		--smtp-server="$(pwd)/fake.sendmail" \
		$patches $patches $patches \
		2>errors &&
	sed -n -e "s/^In-Reply-To: *\(.*\)/\1/p" msgtxt1 >actual &&
	test_cmp expect actual &&
	sed -n -e "s/^Message-Id: *\(.*\)/\1/p" msgtxt1 >expect &&
	sed -n -e "s/^In-Reply-To: *\(.*\)/\1/p" msgtxt2 >actual &&
	test_cmp expect actual &&
	sed -n -e "s/^Message-Id: *\(.*\)/\1/p" msgtxt2 >expect &&
	sed -n -e "s/^In-Reply-To: *\(.*\)/\1/p" msgtxt3 >actual &&
	test_cmp expect actual

Committed revision 2.
Sending        kw.c
Transmitting file data .done
Committing transaction...
Committed revision 3.
property 'svn:keywords' set on 'kw.c'
0001-Second.patch
0001-Second.patch
0001-Second.patch
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com author@example.com one@example.com two@example.com committer@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com,
	C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: Wed, 16 Dec 2015 11:08:30 +0000
Message-Id: <1450264112-22757-1-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4
In-Reply-To: <unique-message-id@example.com>
References: <unique-message-id@example.com>

Result: OK
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com author@example.com one@example.com two@example.com committer@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com,
	C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: Wed, 16 Dec 2015 11:08:31 +0000
Message-Id: <1450264112-22757-2-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4
In-Reply-To: <1450264112-22757-1-git-send-email-nobody@example.com>
References: <unique-message-id@example.com>
 <1450264112-22757-1-git-send-email-nobody@example.com>

Result: OK
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com author@example.com one@example.com two@example.com committer@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com,
	C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: Wed, 16 Dec 2015 11:08:32 +0000
Message-Id: <1450264112-22757-3-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4
In-Reply-To: <1450264112-22757-2-git-send-email-nobody@example.com>
References: <unique-message-id@example.com>
 <1450264112-22757-1-git-send-email-nobody@example.com>
 <1450264112-22757-2-git-send-email-nobody@example.com>

Result: OK
ok 37 - In-Reply-To with --chain-reply-to

expecting success: 
	write_script fake-editor <<-\EOF
	echo fake edit >>"$1"
	EOF

ok 38 - setup fake editor

expecting success: 
	clean_fake_sendmail &&
	git send-email \
	--compose --subject foo \
	--from="Example <nobody@example.com>" \
	--to=nobody@example.com \
	--smtp-server="$(pwd)/fake.sendmail" \
	$patches \
	2>errors

Sending        kw.c
Committing transaction...
Committed revision 4.
ok 2 - setup some commits to svn

expecting success: git svn init "$svnrepo"
	A	bar/zzz
	A	dir/a/b/c/d/e/file
	A	exec.sh
	A	foo
	A	foo.link
r1 = 84595e414a8a7a8c1ed30314d1d48662a9e3d249 (refs/remotes/git-svn)
0001-Second.patch
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Subject: foo
Date: Wed, 16 Dec 2015 11:08:34 +0000
Message-Id: <1450264115-22833-1-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4

Result: OK
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com author@example.com one@example.com two@example.com committer@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com,
	C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: Wed, 16 Dec 2015 11:08:35 +0000
Message-Id: <1450264115-22833-2-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4
In-Reply-To: <1450264115-22833-1-git-send-email-nobody@example.com>
References: <1450264115-22833-1-git-send-email-nobody@example.com>

Result: OK
ok 39 - --compose works

expecting success: 
	grep "^fake edit" msgtxt1

fake edit
ok 40 - first message is compose text

expecting success: 
	grep "Subject:.*Second" msgtxt2

Subject: [PATCH 1/1] Second.
ok 41 - second message is patch

expecting success: 
cat >expected-suppress-sob <<\EOF
0001-Second.patch
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
Dry-OK. Log says:
Server: relay.example.com
MAIL FROM:<from@example.com>
RCPT TO:<to@example.com>
RCPT TO:<cc@example.com>
RCPT TO:<author@example.com>
RCPT TO:<one@example.com>
RCPT TO:<two@example.com>
From: Example <from@example.com>
To: to@example.com
Cc: cc@example.com,
	A <author@example.com>,
	One <one@example.com>,
	two@example.com
Subject: [PATCH 1/1] Second.
Date: DATE-STRING
Message-Id: MESSAGE-ID-STRING
X-Mailer: X-MAILER-STRING

Result: OK
EOF

ok 42 - setup expect

expecting success: 
	git config sendemail.cc cc@example.com &&
	test_suppression sob

Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9100-git-svn-basic/svnrepo r1
ok 2 - import an SVN revision into git

expecting success: svn co "$svnrepo" "$SVN_TREE"
A    .git/svn/refs/remotes/git-svn/svn-tree/bar
A    .git/svn/refs/remotes/git-svn/svn-tree/bar/zzz
A    .git/svn/refs/remotes/git-svn/svn-tree/dir
A    .git/svn/refs/remotes/git-svn/svn-tree/dir/a
A    .git/svn/refs/remotes/git-svn/svn-tree/dir/a/b
A    .git/svn/refs/remotes/git-svn/svn-tree/dir/a/b/c
A    .git/svn/refs/remotes/git-svn/svn-tree/dir/a/b/c/d
A    .git/svn/refs/remotes/git-svn/svn-tree/dir/a/b/c/d/e
A    .git/svn/refs/remotes/git-svn/svn-tree/dir/a/b/c/d/e/file
A    .git/svn/refs/remotes/git-svn/svn-tree/exec.sh
A    .git/svn/refs/remotes/git-svn/svn-tree/foo
A    .git/svn/refs/remotes/git-svn/svn-tree/foo.link
Checked out revision 1.
ok 3 - checkout from svn

expecting success: 
	git checkout -f -b mybranch ${remotes_git_svn} &&
	mv dir/a/b/c/d/e/file dir/file &&
	cp dir/file file &&
	git update-index --add --remove dir/a/b/c/d/e/file dir/file file &&
	git commit -m "$name" &&
	git svn set-tree --find-copies-harder --rmdir \
		${remotes_git_svn}..mybranch &&
	svn_cmd up "$SVN_TREE" &&
	test -d "$SVN_TREE"/dir && test ! -d "$SVN_TREE"/dir/a
Switched to a new branch 'mybranch'
[mybranch 4b28c2a] try a deep --rmdir with a commit
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
 rename dir/{a/b/c/d/e => }/file (100%)
 create mode 100644 file
ok 43 - sendemail.cc set

expecting success: 
cat >expected-suppress-sob <<\EOF
0001-Second.patch
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
Dry-OK. Log says:
Server: relay.example.com
MAIL FROM:<from@example.com>
RCPT TO:<to@example.com>
RCPT TO:<author@example.com>
RCPT TO:<one@example.com>
RCPT TO:<two@example.com>
From: Example <from@example.com>
To: to@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com
Subject: [PATCH 1/1] Second.
Date: DATE-STRING
Message-Id: MESSAGE-ID-STRING
X-Mailer: X-MAILER-STRING

Result: OK
EOF

ok 44 - setup expect

expecting success: 
	git config --unset sendemail.cc &&
	test_suppression sob

ok 3 - initialize git svn

expecting success: git svn fetch
	A	deeply/nested/directory/number/1/file
	A	deeply/nested/directory/number/2/another
r1 = b312304b9a262fb6d3f04da7fdaa5306b5ae2d38 (refs/remotes/git-svn)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9102-git-svn-deep-rmdir/svnrepo r1
Switched to a new branch 'test-rmdir'
ok 2 - mirror via git svn

expecting success: 
	git rm -f deeply/nested/directory/number/2/another &&
	git commit -a -m "remove another" &&
	git svn set-tree --rmdir HEAD &&
	svn_cmd ls -R "$svnrepo" | grep ^deeply/nested/directory/number/1
	
rm 'deeply/nested/directory/number/2/another'
[test-rmdir 4c0e114] remove another
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 deeply/nested/directory/number/2/another
ok 45 - sendemail.cc unset

expecting success: 
cat >expected-suppress-cccmd <<\EOF
0001-Second.patch
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'
Dry-OK. Log says:
Server: relay.example.com
MAIL FROM:<from@example.com>
RCPT TO:<to@example.com>
RCPT TO:<author@example.com>
RCPT TO:<one@example.com>
RCPT TO:<two@example.com>
RCPT TO:<committer@example.com>
From: Example <from@example.com>
To: to@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com,
	C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: DATE-STRING
Message-Id: MESSAGE-ID-STRING
X-Mailer: X-MAILER-STRING

Result: OK
EOF

ok 46 - setup expect

expecting success: 
	write_script cccmd <<-\EOF &&
	echo cc-cmd@example.com
	EOF
	git config sendemail.cccmd ./cccmd &&
	test_suppression cccmd

	C	dir/a/b/c/d/e/file => dir/file
	R	dir/a/b/c/d/e/file => file
ok 47 - sendemail.cccmd

	D+	dir/a/b/c/d/e/
	D+	dir/a/b/c/d/
expecting success: 
cat >expected-suppress-all <<\EOF
0001-Second.patch
Dry-OK. Log says:
Server: relay.example.com
MAIL FROM:<from@example.com>
RCPT TO:<to@example.com>
From: Example <from@example.com>
To: to@example.com
Subject: [PATCH 1/1] Second.
Date: DATE-STRING
Message-Id: MESSAGE-ID-STRING
X-Mailer: X-MAILER-STRING

Result: OK
EOF

	D+	dir/a/b/c/
	D+	dir/a/b/
ok 48 - setup expect

	D+	dir/a/
expecting success: 
	test_suppression all

	A	cr
	A	crlf
	A	empty
	A	empty_cr
	A	empty_crlf
	A	empty_lf
	A	kw.c
	A	lf
	A	ne_cr
	A	ne_crlf
	A	ne_lf
r1 = d34f1d18b5bebde42465a18ada107ee1fcce61e6 (refs/remotes/git-svn)
	D	dir/a/b/c/d/e/file
	D	dir/a/
	A	dir/file
	A	file
W: -empty_dir: dir/a
	M	kw.c
r2 = 6d1861f9f572de6d4bed69262dfa267aa690fd18 (refs/remotes/git-svn)
r2 = 267f5e42d0da1a59538060fcabd8baa82910abdd (refs/remotes/git-svn)
Done committing 1 revisions to SVN
Updating '.git/svn/refs/remotes/git-svn/svn-tree':
	M	kw.c
D    .git/svn/refs/remotes/git-svn/svn-tree/dir/a
A    .git/svn/refs/remotes/git-svn/svn-tree/dir/file
ok 49 - --suppress-cc=all

expecting success: 
cat >expected-suppress-body <<\EOF
0001-Second.patch
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
(cc-cmd) Adding cc: cc-cmd@example.com from: './cccmd'
Dry-OK. Log says:
Server: relay.example.com
MAIL FROM:<from@example.com>
RCPT TO:<to@example.com>
RCPT TO:<author@example.com>
RCPT TO:<one@example.com>
RCPT TO:<two@example.com>
RCPT TO:<cc-cmd@example.com>
From: Example <from@example.com>
To: to@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com,
	cc-cmd@example.com
Subject: [PATCH 1/1] Second.
Date: DATE-STRING
Message-Id: MESSAGE-ID-STRING
X-Mailer: X-MAILER-STRING

Result: OK
EOF

A    .git/svn/refs/remotes/git-svn/svn-tree/file
ok 50 - setup expect

Updated to revision 2.
expecting success: 
	test_suppression body

ok 4 - try a deep --rmdir with a commit

expecting success: 
	mkdir dir/new_file &&
	mv dir/file dir/new_file/file &&
	mv dir/new_file dir/file &&
	git update-index --remove dir/file &&
	git update-index --add dir/file/file &&
	git commit -m 'detect node change from file to directory #1' &&
	test_must_fail git svn set-tree --find-copies-harder --rmdir 		remotes/git-svn..mybranch

r3 = 58b70a9421d212423ea6a6621cf70f2186e1f7d6 (refs/remotes/git-svn)
[mybranch 2f06149] detect node change from file to directory #1
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename dir/{ => file}/file (100%)
	M	kw.c
r4 = a737ed0d1e3d186921f9ded4a932c88818314bd3 (refs/remotes/git-svn)
	D	deeply/nested/directory/number/2/another
	D+	deeply/nested/directory/number/2/
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9101-git-svn-props/svnrepo r4
ok 4 - fetch revisions from svn

expecting success: git checkout -b mybranch ${remotes_git_svn} &&
	echo Hi again >> kw.c &&
	git commit -a -m "test keywords ignoring" &&
	git svn set-tree ${remotes_git_svn}..mybranch &&
	git pull . ${remotes_git_svn}
Switched to a new branch 'mybranch'
[mybranch c3859f9] test keywords ignoring
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 51 - --suppress-cc=body

expecting success: 
cat >expected-suppress-body-cccmd <<\EOF
0001-Second.patch
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
Dry-OK. Log says:
Server: relay.example.com
MAIL FROM:<from@example.com>
RCPT TO:<to@example.com>
RCPT TO:<author@example.com>
RCPT TO:<one@example.com>
RCPT TO:<two@example.com>
From: Example <from@example.com>
To: to@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com
Subject: [PATCH 1/1] Second.
Date: DATE-STRING
Message-Id: MESSAGE-ID-STRING
X-Mailer: X-MAILER-STRING

Result: OK
EOF

ok 52 - setup expect

expecting success: 
	test_suppression body cccmd

	D	deeply/nested/directory/number/2/another
	D	deeply/nested/directory/number/2/
W: -empty_dir: deeply/nested/directory/number/2
r2 = c3466123c8078cc76f2c2d95830e83ee445be866 (refs/remotes/git-svn)
Done committing 1 revisions to SVN
deeply/nested/directory/number/1/
deeply/nested/directory/number/1/file
ok 3 - Try a commit on rmdir

# passed all 3 test(s)
1..3
*** t9103-git-svn-tracked-directory-removed.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9103-git-svn-tracked-directory-removed/.git/
ok 53 - --suppress-cc=body --suppress-cc=cccmd

expecting success: 
cat >expected-suppress-sob <<\EOF
0001-Second.patch
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
Dry-OK. Log says:
Server: relay.example.com
MAIL FROM:<from@example.com>
RCPT TO:<to@example.com>
RCPT TO:<author@example.com>
RCPT TO:<one@example.com>
RCPT TO:<two@example.com>
From: Example <from@example.com>
To: to@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com
Subject: [PATCH 1/1] Second.
Date: DATE-STRING
Message-Id: MESSAGE-ID-STRING
X-Mailer: X-MAILER-STRING

Result: OK
EOF

ok 54 - setup expect

expecting success: 
	test_might_fail git config --unset sendemail.cccmd &&
	test_suppression sob

expecting success: 
	mkdir import &&
	mkdir import/trunk &&
	echo hello >> import/trunk/README &&
	svn_cmd import -m initial import "$svnrepo" &&
	rm -rf import &&
	svn_cmd co "$svnrepo"/trunk trunk &&
	echo bye bye >> trunk/README &&
	svn_cmd rm -m "gone" "$svnrepo"/trunk &&
	rm -rf trunk &&
	mkdir trunk &&
	echo "new" > trunk/FOLLOWME &&
	svn_cmd import -m "new trunk" trunk "$svnrepo"/trunk

dir/file already exists in repository at r2 and it is not a directory (file/1)
ok 5 - detect node change from file to directory #1

expecting success: 
	rm -rf dir "$GIT_DIR"/index &&
	git checkout -f -b mybranch2 ${remotes_git_svn} &&
	mv bar/zzz zzz &&
	rm -rf bar &&
	mv zzz bar &&
	git update-index --remove -- bar/zzz &&
	git update-index --add -- bar &&
	git commit -m "$name" &&
	test_must_fail git svn set-tree --find-copies-harder --rmdir \
		${remotes_git_svn}..mybranch2

Switched to a new branch 'mybranch2'
[mybranch2 ef46411] detect node change from directory to file #1
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename bar/zzz => bar (100%)
	M	kw.c
Adding         import/trunk
Adding         import/trunk/README
Committing transaction...
ok 55 - --suppress-cc=sob

expecting success: 
cat >expected-suppress-bodycc <<\EOF
0001-Second.patch
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'
Dry-OK. Log says:
Server: relay.example.com
MAIL FROM:<from@example.com>
RCPT TO:<to@example.com>
RCPT TO:<author@example.com>
RCPT TO:<one@example.com>
RCPT TO:<two@example.com>
RCPT TO:<committer@example.com>
From: Example <from@example.com>
To: to@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com,
	C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: DATE-STRING
Message-Id: MESSAGE-ID-STRING
X-Mailer: X-MAILER-STRING

Result: OK
EOF

ok 56 - setup expect

expecting success: 
	test_suppression bodycc

Committed revision 1.
A    trunk/README
Checked out revision 1.
	M	kw.c
r5 = 3fe8cc17907233291e1a781048a86b1360fb0a29 (refs/remotes/git-svn)
Committing transaction...
Done committing 1 revisions to SVN
From .
 * remote-tracking branch git-svn    -> FETCH_HEAD
Updating c3859f9..3fe8cc1
Fast-forward
ok 5 - test svn:keywords ignoring

expecting success: test '/* $Id$ */' = '/* $Id$ */'
ok 57 - --suppress-cc=bodycc

ok 6 - raw $Id$ found in kw.c

expecting success: 
	(
		cd test_wc &&
		svn_cmd propset svn:eol-style CR empty &&
		svn_cmd propset svn:eol-style CR crlf &&
		svn_cmd propset svn:eol-style CR ne_crlf &&
		svn_cmd commit -m "propset CR on crlf files"
	 )

expecting success: 
cat >expected-suppress-cc <<\EOF
0001-Second.patch
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'
Dry-OK. Log says:
Server: relay.example.com
MAIL FROM:<from@example.com>
RCPT TO:<to@example.com>
RCPT TO:<author@example.com>
RCPT TO:<committer@example.com>
From: Example <from@example.com>
To: to@example.com
Cc: A <author@example.com>,
	C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: DATE-STRING
Message-Id: MESSAGE-ID-STRING
X-Mailer: X-MAILER-STRING

Result: OK
EOF

ok 58 - setup expect

expecting success: 
	test_suppression cc

property 'svn:eol-style' set on 'empty'
property 'svn:eol-style' set on 'crlf'
property 'svn:eol-style' set on 'ne_crlf'
Committed revision 2.
Sending        crlf
Sending        empty
Sending        ne_crlf
Transmitting file data ..done
Committing transaction...
Adding         trunk/FOLLOWME
Committing transaction...
ok 59 - --suppress-cc=cc

expecting success: 
	test_confirm --confirm=always --suppress-cc=all

Transaction is out of date: Directory '/bar' is out of date at /«PKGBUILDDIR»/perl/blib/lib/Git/SVN.pm line 1981.

ok 6 - detect node change from directory to file #1

expecting success: 
	rm -f "$GIT_DIR"/index &&
	git checkout -f -b mybranch3 ${remotes_git_svn} &&
	rm bar/zzz &&
	git update-index --remove bar/zzz &&
	mkdir bar/zzz &&
	echo yyy > bar/zzz/yyy &&
	git update-index --add bar/zzz/yyy &&
	git commit -m "$name" &&
	git svn set-tree --find-copies-harder --rmdir \
		${remotes_git_svn}..mybranch3 &&
	svn_cmd up "$SVN_TREE" &&
	test -d "$SVN_TREE"/bar/zzz &&
	test -e "$SVN_TREE"/bar/zzz/yyy

Switched to a new branch 'mybranch3'
[mybranch3 34366af] detect node change from file to directory #2
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 1 deletion(-)
 delete mode 100644 bar/zzz
 create mode 100644 bar/zzz/yyy
Committed revision 3.
ok 1 - make history for tracking

expecting success: 
	git svn clone -s "$svnrepo" x &&
	test -f x/FOLLOWME &&
	test ! -f x/README

Committed revision 6.
ok 7 - propset CR on crlf files

expecting success: git svn fetch &&
	 git pull . ${remotes_git_svn} &&
	 svn_cmd co "$svnrepo" new_wc
Send this email? ([y]es|[n]o|[q]uit|[a]ll): OK. Log says:
ok 60 - --confirm=always

expecting success: 
	test_confirm --confirm=auto

Send this email? ([y]es|[n]o|[q]uit|[a]ll): OK. Log says:
ok 61 - --confirm=auto

expecting success: 
	test_confirm --confirm=cc

	D	bar/zzz
	A	bar/zzz/yyy
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9103-git-svn-tracked-directory-removed/x/.git/
	M	crlf
	M	empty
	M	ne_crlf
r6 = 6519f08c4e6bd73ae92c40b7a638841dc7cabd9b (refs/remotes/git-svn)
Send this email? ([y]es|[n]o|[q]uit|[a]ll): OK. Log says:
ok 62 - --confirm=cc

expecting success: 
	test_confirm --confirm=compose --compose

From .
 * remote-tracking branch git-svn    -> FETCH_HEAD
Updating 3fe8cc1..6519f08
Fast-forward
 crlf    | 3 +--
 ne_crlf | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
A    new_wc/cr
A    new_wc/crlf
A    new_wc/empty
A    new_wc/empty_cr
A    new_wc/empty_crlf
A    new_wc/empty_lf
A    new_wc/kw.c
A    new_wc/lf
A    new_wc/ne_cr
A    new_wc/ne_crlf
A    new_wc/ne_lf
	A	README
Checked out revision 6.
ok 8 - fetch and pull latest from svn and checkout a new wc

expecting success: cmp crlf new_wc/crlf
	D	bar/zzz
ok 9 - Comparing crlf

expecting success: cmp ne_crlf new_wc/ne_crlf
ok 10 - Comparing ne_crlf

expecting success: cmp lf new_wc/lf
ok 11 - Comparing lf

expecting success: cmp ne_lf new_wc/ne_lf
ok 12 - Comparing ne_lf

expecting success: cmp cr new_wc/cr
ok 13 - Comparing cr

expecting success: cmp ne_cr new_wc/ne_cr
ok 14 - Comparing ne_cr

expecting success: cmp empty_cr new_wc/empty_cr
	A	bar/zzz/yyy
ok 15 - Comparing empty_cr

expecting success: cmp empty_lf new_wc/empty_lf
ok 16 - Comparing empty_lf

expecting success: cmp empty new_wc/empty
ok 17 - Comparing empty

expecting success: cmp empty_crlf new_wc/empty_crlf
ok 18 - Comparing empty_crlf

expecting success: svn_cmd propset svn:eol-style CRLF cr &&
	 svn_cmd propset svn:eol-style CRLF ne_cr &&
	 svn_cmd propset svn:keywords Id cr &&
	 svn_cmd propset svn:keywords Id ne_cr &&
	 svn_cmd commit -m "propset CRLF on cr files"
r1 = 69e41f416be8b3852db91d659795857a3f3b87b8 (refs/remotes/origin/trunk)
r3 = a9326218fb12378c4a9a9586b42bec3fd747e3d6 (refs/remotes/git-svn)
property 'svn:eol-style' set on 'cr'
Done committing 1 revisions to SVN
property 'svn:eol-style' set on 'ne_cr'
property 'svn:keywords' set on 'cr'
Updating '.git/svn/refs/remotes/git-svn/svn-tree':
	D	README
	A	FOLLOWME
D    .git/svn/refs/remotes/git-svn/svn-tree/bar/zzz
A    .git/svn/refs/remotes/git-svn/svn-tree/bar/zzz
property 'svn:keywords' set on 'ne_cr'
A    .git/svn/refs/remotes/git-svn/svn-tree/bar/zzz/yyy
Updated to revision 3.
ok 7 - detect node change from file to directory #2

expecting success: 
	rm -f "$GIT_DIR"/index &&
	git checkout -f -b mybranch4 ${remotes_git_svn} &&
	rm -rf dir &&
	git update-index --remove -- dir/file &&
	touch dir &&
	echo asdf > dir &&
	git update-index --add -- dir &&
	git commit -m "$name" &&
	test_must_fail git svn set-tree --find-copies-harder --rmdir \
		${remotes_git_svn}..mybranch4

r3 = 8b26ce8ca1ac43410967efdfd6c5889c657b8c83 (refs/remotes/origin/trunk)
Switched to a new branch 'mybranch4'
[mybranch4 399f273] detect node change from directory to file #2
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 1 deletion(-)
 create mode 100644 dir
 delete mode 100644 dir/file
Sending        cr
Sending        ne_cr
Transmitting file data ..done
Committing transaction...
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9103-git-svn-tracked-directory-removed/svnrepo/trunk r3
ok 2 - clone repo with git

expecting success: 
	cd x &&
		test -n "$(git svn find-rev r1)" &&
		git reset --hard $(git svn find-rev r1) &&
		test -f README &&
		test ! -f FOLLOWME &&
		test x$(git svn find-rev r2) = x

Send this email? ([y]es|[n]o|[q]uit|[a]ll): OK. Log says:
ok 63 - --confirm=compose

expecting success: 
	test_when_finished git config sendemail.confirm never &&
	git config --unset sendemail.confirm &&
	test_confirm

Committed revision 7.
ok 19 - Set CRLF on cr files

expecting success: git svn fetch && git pull . ${remotes_git_svn}
Send this email? ([y]es|[n]o|[q]uit|[a]ll): OK. Log says:
ok 64 - confirm by default (due to cc)

expecting success: 
	test_when_finished git config sendemail.confirm never &&
	git config --unset sendemail.confirm &&
	test_confirm --suppress-cc=all --compose

Send this email? ([y]es|[n]o|[q]uit|[a]ll): OK. Log says:
ok 65 - confirm by default (due to --compose)

expecting success: 
	test_when_finished git config sendemail.confirm never &&
	git config --unset sendemail.confirm &&
	rm -fr outdir &&
	git format-patch -2 -o outdir &&
	GIT_SEND_EMAIL_NOTTY=1 \
		git send-email \
			--from="Example <nobody@example.com>" \
			--to=nobody@example.com \
			--smtp-server="$(pwd)/fake.sendmail" \
			outdir/*.patch </dev/null

outdir/0001-Initial.patch
outdir/0002-Second.patch
	D	dir/file
Item already exists in filesystem: File already exists: filesystem '882a1681-0de5-4242-8c5d-4087585fc5b8', transaction '3-5', path '/dir' at /«PKGBUILDDIR»/perl/blib/lib/Git/SVN.pm line 1981.

ok 8 - detect node change from directory to file #2

expecting success: 
	rm -f "$GIT_DIR"/index &&
	git checkout -f -b mybranch5 ${remotes_git_svn} &&
	chmod -x exec.sh &&
	git update-index exec.sh &&
	git commit -m "$name" &&
	git svn set-tree --find-copies-harder --rmdir \
		${remotes_git_svn}..mybranch5 &&
	svn_cmd up "$SVN_TREE" &&
	test ! -x "$SVN_TREE"/exec.sh
Switched to a new branch 'mybranch5'
[mybranch5 979af96] remove executable bit from a file
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 mode change 100755 => 100644 exec.sh
	M	cr
	M	ne_cr
r7 = 13b1685e66fcdb88a4bac292453179c3ec8ca2f1 (refs/remotes/git-svn)
From .
 * remote-tracking branch git-svn    -> FETCH_HEAD
Updating 6519f08..13b1685
Fast-forward
 cr    | 4 +++-
 ne_cr | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
ok 20 - fetch and pull latest from svn

expecting success: test 'f39bd49beefa1dff130e47c7a24777dfc3657ba2' = 'f39bd49beefa1dff130e47c7a24777dfc3657ba2'
ok 21 - CRLF + $Id$

expecting success: test '41c5e77993f143876592cd19b5e9a6f6d2e4ff8a' = '41c5e77993f143876592cd19b5e9a6f6d2e4ff8a'
ok 22 - CRLF + $Id$ (no newline)

expecting success: 
	(
		cd test_wc &&
		mkdir -p deeply/nested/directory &&
		touch deeply/nested/directory/.keep &&
		svn_cmd add deeply &&
		svn_cmd up &&
		svn_cmd propset -R svn:ignore '
no-such-file*
' .
		svn_cmd commit -m 'propset svn:ignore'
	) &&
	git svn show-ignore > show-ignore.got &&
	cmp show-ignore.expect show-ignore.got

outdir/0001-Initial.patch
outdir/0002-Second.patch
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'

From: Example <nobody@example.com>
To: nobody@example.com
Cc: A <author@example.com>
Subject: [PATCH 1/2] Initial.
Date: Wed, 16 Dec 2015 11:09:03 +0000
Message-Id: <1450264144-24901-1-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4

    The Cc list above has been expanded by additional
    addresses found in the patch commit message. By default
    send-email prompts before sending whenever this occurs.
    This behavior is controlled by the sendemail.confirm
    configuration setting.

    For additional information, run 'git send-email --help'.
    To retain the current behavior, but squelch this message,
    run 'git config --global sendemail.confirm auto'.

Send this email? ([y]es|[n]o|[q]uit|[a]ll): 
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com author@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Cc: A <author@example.com>
Subject: [PATCH 1/2] Initial.
Date: Wed, 16 Dec 2015 11:09:03 +0000
Message-Id: <1450264144-24901-1-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4

Result: OK
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'

From: Example <nobody@example.com>
To: nobody@example.com
Cc: A <author@example.com>
Subject: [PATCH 2/2] Second.
Date: Wed, 16 Dec 2015 11:09:04 +0000
Message-Id: <1450264144-24901-2-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4
In-Reply-To: <1450264144-24901-1-git-send-email-nobody@example.com>
References: <1450264144-24901-1-git-send-email-nobody@example.com>

Send this email? ([y]es|[n]o|[q]uit|[a]ll): 
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com author@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Cc: A <author@example.com>
Subject: [PATCH 2/2] Second.
Date: Wed, 16 Dec 2015 11:09:04 +0000
Message-Id: <1450264144-24901-2-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4
In-Reply-To: <1450264144-24901-1-git-send-email-nobody@example.com>
References: <1450264144-24901-1-git-send-email-nobody@example.com>

Result: OK
A         deeply
ok 66 - confirm detects EOF (inform assumes y)

A         deeply/nested
expecting success: 
	test_when_finished git config sendemail.confirm never &&
	git config sendemail.confirm auto &&
	GIT_SEND_EMAIL_NOTTY=1 &&
	export GIT_SEND_EMAIL_NOTTY &&
		test_must_fail git send-email \
			--from="Example <nobody@example.com>" \
			--to=nobody@example.com \
			--smtp-server="$(pwd)/fake.sendmail" \
			$patches </dev/null

A         deeply/nested/directory
A         deeply/nested/directory/.keep
Updating '.':
U    kw.c
Updated to revision 7.
property 'svn:ignore' set on '.'
property 'svn:ignore' set on 'deeply'
property 'svn:ignore' set on 'deeply/nested'
property 'svn:ignore' set on 'deeply/nested/directory'
Sending        .
HEAD is now at 69e41f4 initial
Adding         deeply
Adding         deeply/nested
Adding         deeply/nested/directory
Adding         deeply/nested/directory/.keep
Transmitting file data .done
Committing transaction...
0001-Second.patch
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'

From: Example <nobody@example.com>
To: nobody@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com,
	C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Send this email reply required at /«PKGBUILDDIR»/git-send-email line 1288.
Date: Wed, 16 Dec 2015 11:09:06 +0000
Message-Id: <1450264146-25052-1-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4

Send this email? ([y]es|[n]o|[q]uit|[a]ll): 
Committed revision 8.
ok 67 - confirm detects EOF (auto causes failure)

expecting success: 
	test_when_finished git config sendemail.confirm never &&
	git config sendemail.confirm auto &&
	GIT_SEND_EMAIL_NOTTY=1 &&
	export GIT_SEND_EMAIL_NOTTY &&
		yes "bogus" | test_must_fail git send-email \
			--from="Example <nobody@example.com>" \
			--to=nobody@example.com \
			--smtp-server="$(pwd)/fake.sendmail" \
			$patches

	M	exec.sh
0001-Second.patch
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'

From: Example <nobody@example.com>
To: nobody@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com,
	C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: Wed, 16 Dec 2015 11:09:07 +0000
Message-Id: <1450264147-25172-1-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4

Send this email reply required at /«PKGBUILDDIR»/git-send-email line 1288, <STDIN> line 10.
Send this email? ([y]es|[n]o|[q]uit|[a]ll): Send this email? ([y]es|[n]o|[q]uit|[a]ll): Send this email? ([y]es|[n]o|[q]uit|[a]ll): Send this email? ([y]es|[n]o|[q]uit|[a]ll): Send this email? ([y]es|[n]o|[q]uit|[a]ll): Send this email? ([y]es|[n]o|[q]uit|[a]ll): Send this email? ([y]es|[n]o|[q]uit|[a]ll): Send this email? ([y]es|[n]o|[q]uit|[a]ll): Send this email? ([y]es|[n]o|[q]uit|[a]ll): Send this email? ([y]es|[n]o|[q]uit|[a]ll): ok 68 - confirm does not loop forever

expecting success: 
	clean_fake_sendmail &&
	rm -fr outdir &&
	git format-patch -1 -o outdir --cc="àéìöú <utf8@example.com>" &&
	git send-email \
	--from="Example <nobody@example.com>" \
	--to=nobody@example.com \
	--smtp-server="$(pwd)/fake.sendmail" \
	outdir/*.patch &&
	grep "^	" msgtxt1 |
	grep "=?UTF-8?q?=C3=A0=C3=A9=C3=AC=C3=B6=C3=BA?= <utf8@example.com>"

outdir/0001-Second.patch
	M	exec.sh
ok 3 - make sure r2 still has old file

# passed all 3 test(s)
1..3
r4 = 603924ffc86931e935dd01c468fa7f3ee1a57223 (refs/remotes/git-svn)
Done committing 1 revisions to SVN
*** t9104-git-svn-follow-parent.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9104-git-svn-follow-parent/.git/
Updating '.git/svn/refs/remotes/git-svn/svn-tree':
 U   .git/svn/refs/remotes/git-svn/svn-tree/exec.sh
Updated to revision 4.
ok 9 - remove executable bit from a file

expecting success: 
	chmod +x exec.sh &&
	git update-index exec.sh &&
	git commit -m "$name" &&
	git svn set-tree --find-copies-harder --rmdir \
		${remotes_git_svn}..mybranch5 &&
	svn_cmd up "$SVN_TREE" &&
	test -x "$SVN_TREE"/exec.sh
[mybranch5 ab4968f] add executable bit back file
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 exec.sh
ok 23 - test show-ignore

expecting success: 
	git svn fetch && git pull . remotes/git-svn &&
	git svn create-ignore &&
	cmp ./.gitignore create-ignore.expect &&
	cmp ./deeply/.gitignore create-ignore.expect &&
	cmp ./deeply/nested/.gitignore create-ignore.expect &&
	cmp ./deeply/nested/directory/.gitignore create-ignore.expect &&
	git ls-files -s | grep gitignore | cmp - create-ignore-index.expect
	
outdir/0001-Second.patch
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: àéìöú <utf8@example.com> from line 'Cc: àéìöú <utf8@example.com>'
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com author@example.com utf8@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Cc: A <author@example.com>,
	=?UTF-8?q?=C3=A0=C3=A9=C3=AC=C3=B6=C3=BA?= <utf8@example.com>
Subject: [PATCH] Second.
Date: Wed, 16 Dec 2015 11:09:09 +0000
Message-Id: <1450264149-25248-1-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4

Result: OK
	=?UTF-8?q?=C3=A0=C3=A9=C3=AC=C3=B6=C3=BA?= <utf8@example.com>
ok 69 - utf8 Cc is rfc2047 encoded

expecting success: 
	clean_fake_sendmail &&
	write_script fake-editor-utf8 <<-\EOF &&
	echo "utf8 body: àéìöú" >>"$1"
	EOF
	GIT_EDITOR="\"$(pwd)/fake-editor-utf8\"" \
	git send-email \
		--compose --subject foo \
		--from="Example <nobody@example.com>" \
		--to=nobody@example.com \
		--smtp-server="$(pwd)/fake.sendmail" \
		$patches &&
	grep "^utf8 body" msgtxt1 &&
	grep "^Content-Type: text/plain; charset=UTF-8" msgtxt1

expecting success: 
	mkdir import &&
	(
		cd import &&
		mkdir -p trunk &&
		echo hello >trunk/readme &&
		svn_cmd import -m "initial" . "$svnrepo"
	) &&
	svn_cmd co "$svnrepo" wc &&
	(
		cd wc &&
		echo world >>trunk/readme &&
		poke trunk/readme &&
		svn_cmd commit -m "another commit" &&
		svn_cmd up &&
		svn_cmd mv trunk thunk &&
		echo goodbye >>thunk/readme &&
		poke thunk/readme &&
		svn_cmd commit -m "bye now"
	)
	
Adding         trunk
Adding         trunk/readme
Committing transaction...
0001-Second.patch
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Subject: foo
Date: Wed, 16 Dec 2015 11:09:10 +0000
Message-Id: <1450264151-25403-1-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Result: OK
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com author@example.com one@example.com two@example.com committer@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com,
	C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: Wed, 16 Dec 2015 11:09:11 +0000
Message-Id: <1450264151-25403-2-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4
In-Reply-To: <1450264151-25403-1-git-send-email-nobody@example.com>
References: <1450264151-25403-1-git-send-email-nobody@example.com>

Result: OK
utf8 body: àéìöú
Content-Type: text/plain; charset=UTF-8
ok 70 - --compose adds MIME for utf8 body

expecting success: 
	clean_fake_sendmail &&
	write_script fake-editor-utf8-mime <<-\EOF &&
	cat >"$1" <<-\EOM
	MIME-Version: 1.0
	Content-Type: text/plain; charset=iso-8859-1
	Content-Transfer-Encoding: 8bit
	Subject: foo

	utf8 body: àéìöú
	EOM
	EOF
	GIT_EDITOR="\"$(pwd)/fake-editor-utf8-mime\"" \
	git send-email \
		--compose --subject foo \
		--from="Example <nobody@example.com>" \
		--to=nobody@example.com \
		--smtp-server="$(pwd)/fake.sendmail" \
		$patches &&
	grep "^utf8 body" msgtxt1 &&
	grep "^Content-Type: text/plain; charset=iso-8859-1" msgtxt1 &&
	! grep "^Content-Type: text/plain; charset=UTF-8" msgtxt1

Committed revision 1.
A    wc/trunk
A    wc/trunk/readme
Checked out revision 1.
Sending        trunk/readme
Transmitting file data .done
Committing transaction...
Committed revision 2.
Updating '.':
	M	exec.sh
At revision 2.
	A	deeply/nested/directory/.keep
0001-Second.patch
A         thunk
D         trunk
D         trunk/readme
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Subject: foo
Date: Wed, 16 Dec 2015 11:09:12 +0000
Message-Id: <1450264153-25467-1-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Result: OK
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com author@example.com one@example.com two@example.com committer@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com,
	C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: Wed, 16 Dec 2015 11:09:13 +0000
Message-Id: <1450264153-25467-2-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4
In-Reply-To: <1450264153-25467-1-git-send-email-nobody@example.com>
References: <1450264153-25467-1-git-send-email-nobody@example.com>

Result: OK
utf8 body: àéìöú
Content-Type: text/plain; charset=iso-8859-1
ok 71 - --compose respects user mime type

expecting success: 
	clean_fake_sendmail &&
	GIT_EDITOR="\"$(pwd)/fake-editor\"" \
	git send-email \
		--compose --subject utf8-sübjëct \
		--from="Example <nobody@example.com>" \
		--to=nobody@example.com \
		--smtp-server="$(pwd)/fake.sendmail" \
		$patches &&
	grep "^fake edit" msgtxt1 &&
	grep "^Subject: =?UTF-8?q?utf8-s=C3=BCbj=C3=ABct?=" msgtxt1

r8 = 22d4d6faacbd55be30e509991f95690f1a689844 (refs/remotes/git-svn)
From .
 * remote-tracking branch git-svn    -> FETCH_HEAD
Updating 13b1685..22d4d6f
Fast-forward
 deeply/nested/directory/.keep | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 deeply/nested/directory/.keep
Adding         thunk
Sending        thunk/readme
Deleting       trunk
Transmitting file data .done
Committing transaction...
	M	exec.sh
r5 = 474a68f5bb6554006156da3b665cf99fd3110075 (refs/remotes/git-svn)
Done committing 1 revisions to SVN
Updating '.git/svn/refs/remotes/git-svn/svn-tree':
 U   .git/svn/refs/remotes/git-svn/svn-tree/exec.sh
Committed revision 3.
Updated to revision 5.
ok 1 - initialize repo

expecting success: 
	git svn init --minimize-url -i thunk "$svnrepo"/thunk &&
	git svn fetch -i thunk &&
	test "`git rev-parse --verify refs/remotes/thunk@2`" \
           = "`git rev-parse --verify refs/remotes/thunk~1`" &&
        test "`git cat-file blob refs/remotes/thunk:readme |\
                 sed -n -e "3p"`" = goodbye &&
	test -z "`git config --get svn-remote.svn.fetch \
	         "^trunk:refs/remotes/thunk@2$"`"
	
ok 10 - add executable bit back file

expecting success: 
	rm exec.sh &&
	ln -s file exec.sh &&
	git update-index exec.sh &&
	git commit -m "$name" &&
	git svn set-tree --find-copies-harder --rmdir \
		${remotes_git_svn}..mybranch5 &&
	svn_cmd up "$SVN_TREE" &&
	test -h "$SVN_TREE"/exec.sh
[mybranch5 27bb5c6] executable file becomes a symlink to file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
 rewrite exec.sh (100%)
 mode change 100755 => 120000
0001-Second.patch
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Subject: =?UTF-8?q?utf8-s=C3=BCbj=C3=ABct?=
Date: Wed, 16 Dec 2015 11:09:14 +0000
Message-Id: <1450264155-25659-1-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Result: OK
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com author@example.com one@example.com two@example.com committer@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com,
	C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: Wed, 16 Dec 2015 11:09:15 +0000
Message-Id: <1450264155-25659-2-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4
In-Reply-To: <1450264155-25659-1-git-send-email-nobody@example.com>
References: <1450264155-25659-1-git-send-email-nobody@example.com>

Result: OK
fake edit
Subject: =?UTF-8?q?utf8-s=C3=BCbj=C3=ABct?=
ok 72 - --compose adds MIME for utf8 subject

expecting success: 
	clean_fake_sendmail &&
	test_commit weird_author &&
	test_when_finished "git reset --hard HEAD^" &&
	git commit --amend --author "Füñný Nâmé <odd_?=mail@example.com>" &&
	git format-patch --stdout -1 >funny_name.patch &&
	git send-email --from="Example <nobody@example.com>" \
		--to=nobody@example.com \
		--smtp-server="$(pwd)/fake.sendmail" \
		funny_name.patch &&
	grep "^From: Füñný Nâmé <odd_?=mail@example.com>" msgtxt1

[master be76f76] weird_author
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 weird_author.t
[master 3275a1e] weird_author
 Author: Füñný Nâmé <odd_?=mail@example.com>
 Date: Thu Apr 7 15:18:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 weird_author.t
funny_name.patch
(mbox) Adding cc: =?UTF-8?q?F=C3=BC=C3=B1n=C3=BD=20N=C3=A2m=C3=A9?= <odd_?=mail@example.com> from line 'From: =?UTF-8?q?F=C3=BC=C3=B1n=C3=BD=20N=C3=A2m=C3=A9?= <odd_?=mail@example.com>'
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com odd_?=mail@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Cc: =?UTF-8?q?F=C3=BC=C3=B1n=C3=BD=20N=C3=A2m=C3=A9?= <odd_?=mail@example.com>
Subject: [PATCH] weird_author
Date: Wed, 16 Dec 2015 11:09:17 +0000
Message-Id: <1450264157-25769-1-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Result: OK
From: Füñný Nâmé <odd_?=mail@example.com>
HEAD is now at 53cc672 Second.
ok 73 - utf8 author is correctly passed on

expecting success: 
	clean_fake_sendmail &&
	test_commit weird_sender &&
	test_when_finished "git reset --hard HEAD^" &&
	git commit --amend --author "Füñný Nâmé <odd_?=mail@example.com>" &&
	git format-patch --stdout -1 >funny_name.patch &&
	git send-email --from="Füñný Nâmé <odd_?=mail@example.com>" \
		--to=nobody@example.com \
		--smtp-server="$(pwd)/fake.sendmail" \
		funny_name.patch &&
	grep "^From: " msgtxt1 >msgfrom &&
	test_line_count = 1 msgfrom

ok 24 - test create-ignore

expecting success: 
	git svn propget svn:ignore . | cmp - prop.expect &&
	cd deeply &&
	git svn propget svn:ignore . | cmp - ../prop.expect &&
	git svn propget svn:entry:committed-rev nested/directory/.keep 	  | cmp - ../prop2.expect &&
	git svn propget svn:ignore .. | cmp - ../prop.expect &&
	git svn propget svn:ignore nested/ | cmp - ../prop.expect &&
	git svn propget svn:ignore ./nested | cmp - ../prop.expect &&
	git svn propget svn:ignore .././deeply/nested | cmp - ../prop.expect
	
[master 0fcb405] weird_sender
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 weird_sender.t
[master 429c4f6] weird_sender
 Author: Füñný Nâmé <odd_?=mail@example.com>
 Date: Thu Apr 7 15:19:13 2005 -0700
 1 file changed, 1 insertion(+)
 create mode 100644 weird_sender.t
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/thunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo
funny_name.patch
(mbox) Adding cc: =?UTF-8?q?F=C3=BC=C3=B1n=C3=BD=20N=C3=A2m=C3=A9?= <odd_?=mail@example.com> from line 'From: =?UTF-8?q?F=C3=BC=C3=B1n=C3=BD=20N=C3=A2m=C3=A9?= <odd_?=mail@example.com>'
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com odd_?=mail@example.com
From: =?UTF-8?q?F=C3=BC=C3=B1n=C3=BD=20N=C3=A2m=C3=A9?= <odd_?=mail@example.com>
To: nobody@example.com
Cc: =?UTF-8?q?F=C3=BC=C3=B1n=C3=BD=20N=C3=A2m=C3=A9?= <odd_?=mail@example.com>
Subject: [PATCH] weird_sender
Date: Wed, 16 Dec 2015 11:09:19 +0000
Message-Id: <1450264159-25872-1-git-send-email-odd_?=mail@example.com>
X-Mailer: git-send-email 2.6.4

Result: OK
HEAD is now at 53cc672 Second.
ok 74 - utf8 sender is not duplicated

expecting success: 
	clean_fake_sendmail &&
	git config sendemail.composeencoding iso-8859-1 &&
	write_script fake-editor-utf8 <<-\EOF &&
	echo "utf8 body: àéìöú" >>"$1"
	EOF
	GIT_EDITOR="\"$(pwd)/fake-editor-utf8\"" \
	git send-email \
		--compose --subject foo \
		--from="Example <nobody@example.com>" \
		--to=nobody@example.com \
		--smtp-server="$(pwd)/fake.sendmail" \
		$patches &&
	grep "^utf8 body" msgtxt1 &&
	grep "^Content-Type: text/plain; charset=iso-8859-1" msgtxt1

	D	exec.sh
	A	exec.sh
	D	exec.sh
	A	exec.sh
W: -empty_dir: exec.sh
0001-Second.patch
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Subject: foo
Date: Wed, 16 Dec 2015 11:09:20 +0000
Message-Id: <1450264161-26011-1-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Result: OK
r6 = ddb0a602d54a56de2e06d6d4ce09989c89cd4356 (refs/remotes/git-svn)
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com author@example.com one@example.com two@example.com committer@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com,
	C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: Wed, 16 Dec 2015 11:09:21 +0000
Message-Id: <1450264161-26011-2-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4
In-Reply-To: <1450264161-26011-1-git-send-email-nobody@example.com>
References: <1450264161-26011-1-git-send-email-nobody@example.com>

Result: OK
Done committing 1 revisions to SVN
utf8 body: àéìöú
Content-Type: text/plain; charset=iso-8859-1
ok 75 - sendemail.composeencoding works

expecting success: 
	clean_fake_sendmail &&
	write_script fake-editor-utf8 <<-\EOF &&
	echo "utf8 body: àéìöú" >>"$1"
	EOF
	GIT_EDITOR="\"$(pwd)/fake-editor-utf8\"" \
	git send-email \
		--compose-encoding iso-8859-1 \
		--compose --subject foo \
		--from="Example <nobody@example.com>" \
		--to=nobody@example.com \
		--smtp-server="$(pwd)/fake.sendmail" \
		$patches &&
	grep "^utf8 body" msgtxt1 &&
	grep "^Content-Type: text/plain; charset=iso-8859-1" msgtxt1

Updating '.git/svn/refs/remotes/git-svn/svn-tree':
D    .git/svn/refs/remotes/git-svn/svn-tree/exec.sh
A    .git/svn/refs/remotes/git-svn/svn-tree/exec.sh
Updated to revision 6.
ok 11 - executable file becomes a symlink to file

expecting success: 
	chmod +x file &&
	ln -s file exec-2.sh &&
	git update-index --add file exec-2.sh &&
	git commit -m "$name" &&
	git svn set-tree --find-copies-harder --rmdir \
		${remotes_git_svn}..mybranch5 &&
	svn_cmd up "$SVN_TREE" &&
	test -x "$SVN_TREE"/file &&
	test -h "$SVN_TREE"/exec-2.sh
[mybranch5 d9c0aef] new symlink is added to a file that was also just made executable
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
 create mode 120000 exec-2.sh
 mode change 100644 => 100755 file
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/thunk, 2
Initializing parent: refs/remotes/thunk@2
	A	readme
r1 = 153c1cceaf8f25d031674d065696e2b990d90606 (refs/remotes/thunk@2)
0001-Second.patch
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Subject: foo
Date: Wed, 16 Dec 2015 11:09:22 +0000
Message-Id: <1450264163-26139-1-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Result: OK
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com author@example.com one@example.com two@example.com committer@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com,
	C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: Wed, 16 Dec 2015 11:09:23 +0000
Message-Id: <1450264163-26139-2-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4
In-Reply-To: <1450264163-26139-1-git-send-email-nobody@example.com>
References: <1450264163-26139-1-git-send-email-nobody@example.com>

Result: OK
utf8 body: àéìöú
Content-Type: text/plain; charset=iso-8859-1
ok 76 - --compose-encoding works

expecting success: 
	clean_fake_sendmail &&
	git config sendemail.composeencoding iso-8859-1 &&
	write_script fake-editor-utf8 <<-\EOF &&
	echo "utf8 body: àéìöú" >>"$1"
	EOF
	GIT_EDITOR="\"$(pwd)/fake-editor-utf8\"" \
	git send-email \
		--compose-encoding iso-8859-2 \
		--compose --subject foo \
		--from="Example <nobody@example.com>" \
		--to=nobody@example.com \
		--smtp-server="$(pwd)/fake.sendmail" \
		$patches &&
	grep "^utf8 body" msgtxt1 &&
	grep "^Content-Type: text/plain; charset=iso-8859-2" msgtxt1

	M	readme
r2 = e372bb1cc419aad418dd05071ef3483e16dc8eb5 (refs/remotes/thunk@2)
Found branch parent: (refs/remotes/thunk) e372bb1cc419aad418dd05071ef3483e16dc8eb5
Following parent with do_switch
	M	readme
Successfully followed parent
r3 = 98536fa3cdac66ca210f9f34d953d4179a2f0799 (refs/remotes/thunk)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/thunk r3
ok 2 - init and fetch a moved directory

expecting success: 
        git config svn-remote.svn.url "$svnrepo" &&
        git config --add svn-remote.svn.fetch \
          trunk:refs/remotes/svn/trunk &&
        git config --add svn-remote.svn.fetch \
          thunk:refs/remotes/svn/thunk &&
        git svn fetch -i svn/thunk &&
	test "`git rev-parse --verify refs/remotes/svn/trunk`" \
           = "`git rev-parse --verify refs/remotes/svn/thunk~1`" &&
        test "`git cat-file blob refs/remotes/svn/thunk:readme |\
                 sed -n -e "3p"`" = goodbye
        
0001-Second.patch
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Subject: foo
Date: Wed, 16 Dec 2015 11:09:24 +0000
Message-Id: <1450264165-26289-1-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-2
Content-Transfer-Encoding: 8bit

Result: OK
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com author@example.com one@example.com two@example.com committer@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com,
	C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: Wed, 16 Dec 2015 11:09:25 +0000
Message-Id: <1450264165-26289-2-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4
In-Reply-To: <1450264165-26289-1-git-send-email-nobody@example.com>
References: <1450264165-26289-1-git-send-email-nobody@example.com>

Result: OK
utf8 body: àéìöú
Content-Type: text/plain; charset=iso-8859-2
ok 77 - --compose-encoding overrides sendemail.composeencoding

expecting success: 
	clean_fake_sendmail &&
	GIT_EDITOR="\"$(pwd)/fake-editor\"" \
	git send-email \
		--compose-encoding iso-8859-2 \
		--compose --subject utf8-sübjëct \
		--from="Example <nobody@example.com>" \
		--to=nobody@example.com \
		--smtp-server="$(pwd)/fake.sendmail" \
		$patches &&
	grep "^fake edit" msgtxt1 &&
	grep "^Subject: =?iso-8859-2?q?utf8-s=C3=BCbj=C3=ABct?=" msgtxt1

	C	exec.sh => exec-2.sh
	M	file
0001-Second.patch
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Subject: =?iso-8859-2?q?utf8-s=C3=BCbj=C3=ABct?=
Date: Wed, 16 Dec 2015 11:09:25 +0000
Message-Id: <1450264166-26436-1-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-2
Content-Transfer-Encoding: 8bit

Result: OK
(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'
(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'
(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'
OK. Log says:
Sendmail: /«PKGBUILDDIR»/t/trash directory.t9001-send-email/fake.sendmail -i nobody@example.com author@example.com one@example.com two@example.com committer@example.com
From: Example <nobody@example.com>
To: nobody@example.com
Cc: A <author@example.com>,
	One <one@example.com>,
	two@example.com,
	C O Mitter <committer@example.com>
Subject: [PATCH 1/1] Second.
Date: Wed, 16 Dec 2015 11:09:26 +0000
Message-Id: <1450264166-26436-2-git-send-email-nobody@example.com>
X-Mailer: git-send-email 2.6.4
In-Reply-To: <1450264166-26436-1-git-send-email-nobody@example.com>
References: <1450264166-26436-1-git-send-email-nobody@example.com>

Result: OK
fake edit
Subject: =?iso-8859-2?q?utf8-s=C3=BCbj=C3=ABct?=
ok 78 - --compose-encoding adds correct MIME for subject

expecting success: 
	echo master >master &&
	git add master &&
	git commit -m"add master" &&
	test_must_fail git send-email --dry-run master 2>errors &&
	grep disambiguate errors

[master 15ae028] add master
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 master
	A	exec-2.sh
	M	file
r7 = 734e7df9ee0a9a429f40625fb5e92bb4c824f9d7 (refs/remotes/git-svn)
Done committing 1 revisions to SVN
Updating '.git/svn/refs/remotes/git-svn/svn-tree':
A    .git/svn/refs/remotes/git-svn/svn-tree/exec-2.sh
 U   .git/svn/refs/remotes/git-svn/svn-tree/file
Updated to revision 7.
ok 12 - new symlink is added to a file that was also just made executable

expecting success: 
	echo git help >help &&
	rm exec-2.sh &&
	cp help exec-2.sh &&
	git update-index exec-2.sh &&
	git commit -m "$name" &&
	git svn set-tree --find-copies-harder --rmdir \
		${remotes_git_svn}..mybranch5 &&
	svn_cmd up "$SVN_TREE" &&
	test -f "$SVN_TREE"/exec-2.sh &&
	test ! -h "$SVN_TREE"/exec-2.sh &&
	test_cmp help "$SVN_TREE"/exec-2.sh
[mybranch5 e69c552] modify a symlink to become a file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
 rewrite exec-2.sh (100%)
 mode change 120000 => 100644
	A	readme
to produce patches for.  Please disambiguate by...
ok 79 - detects ambiguous reference/file conflict

expecting success: 
	rm -fr outdir &&
	git format-patch -2 -o outdir &&
	git send-email \
		--dry-run \
		--from="Example <nobody@example.com>" \
		--to=nobody@example.com \
		outdir/000?-*.patch 2>errors >out &&
	grep "^Subject: " out >subjects &&
	test "z$(sed -n -e 1p subjects)" = "zSubject: [PATCH 1/2] Second." &&
	test "z$(sed -n -e 2p subjects)" = "zSubject: [PATCH 2/2] add master"

outdir/0001-Second.patch
outdir/0002-add-master.patch
r1 = 153c1cceaf8f25d031674d065696e2b990d90606 (refs/remotes/svn/trunk)
	M	readme
r2 = e372bb1cc419aad418dd05071ef3483e16dc8eb5 (refs/remotes/svn/trunk)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/thunk, 2
Found branch parent: (refs/remotes/svn/thunk) e372bb1cc419aad418dd05071ef3483e16dc8eb5
Following parent with do_switch
	M	readme
Successfully followed parent
r3 = 98536fa3cdac66ca210f9f34d953d4179a2f0799 (refs/remotes/svn/thunk)
ok 3 - init and fetch from one svn-remote

expecting success: 
        (svn_cmd cp -m "resurrecting trunk as junk" \
               "$svnrepo"/trunk@2 "$svnrepo"/junk ||
         svn cp -m "resurrecting trunk as junk" \
               -r2 "$svnrepo"/trunk "$svnrepo"/junk) &&
        git config --add svn-remote.svn.fetch \
          junk:refs/remotes/svn/junk &&
        git svn fetch -i svn/thunk &&
        git svn fetch -i svn/junk &&
        test -z "`git diff svn/junk svn/trunk`" &&
        test "`git merge-base svn/junk svn/trunk`" \
           = "`git rev-parse svn/trunk`"
        
ok 80 - feed two files

expecting success: 
	git send-email \
		--dry-run \
		--from="Example <nobody@example.com>" \
		--to=nobody@example.com \
		--in-reply-to="<in-reply-id@example.com>" \
		--no-thread \
		$patches |
	grep "In-Reply-To: <in-reply-id@example.com>"

Committing transaction...
Committed revision 4.
In-Reply-To: <in-reply-id@example.com>
ok 81 - in-reply-to but no threading

expecting success: 
	git send-email \
		--dry-run \
		--from="Example <nobody@example.com>" \
		--to=nobody@example.com \
		--no-thread \
		$patches $patches >stdout &&
	! grep "In-Reply-To: " stdout

	D	exec-2.sh
	A	exec-2.sh
	D	exec-2.sh
	A	exec-2.sh
W: -empty_dir: exec-2.sh
r8 = 435995e64454d88adff5bc4ecad55e80e6d66905 (refs/remotes/git-svn)
Done committing 1 revisions to SVN
Updating '.git/svn/refs/remotes/git-svn/svn-tree':
D    .git/svn/refs/remotes/git-svn/svn-tree/exec-2.sh
A    .git/svn/refs/remotes/git-svn/svn-tree/exec-2.sh
Updated to revision 8.
ok 82 - no in-reply-to and no threading

ok 13 - modify a symlink to become a file

expecting success: 
	git send-email \
		--dry-run \
		--from="Example <nobody@example.com>" \
		--to=nobody@example.com \
		--thread \
		--no-chain-reply-to \
		$patches $patches >stdout &&
	grep "In-Reply-To: " stdout

skipping test: commit with UTF-8 message: locale:  
	echo '# hello' >> exec-2.sh &&
	git update-index exec-2.sh &&
	git commit -m 'éï∏' &&
	git svn set-tree HEAD
ok 14 # skip commit with UTF-8 message: locale:  (missing UTF8)

expecting success: git svn init "$svnrepo" && git svn fetch &&
     git rev-list --pretty=raw ${remotes_git_svn} | grep ^tree | uniq > a &&
     git rev-list --pretty=raw remotes/alt | grep ^tree | uniq > b &&
     test_cmp a b
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/junk, 2
Found branch parent: (refs/remotes/svn/junk) e372bb1cc419aad418dd05071ef3483e16dc8eb5
Following parent with do_switch
Successfully followed parent
r4 = e2c630504ad877b1ade1fed97470868ff82fe028 (refs/remotes/svn/junk)
In-Reply-To: <1450264176-27068-1-git-send-email-nobody@example.com>
ok 83 - threading but no chain-reply-to

expecting success: 
	git config --replace-all sendemail.to "Somebody <somebody@ex.com>" &&
	git send-email \
		--dry-run \
		--from="Example <nobody@example.com>" \
		$patches $patches >stdout &&
	grep "To: Somebody <somebody@ex.com>" stdout

Using existing [svn-remote "svn"]
To: Somebody <somebody@ex.com>
To: Somebody <somebody@ex.com>
ok 84 - sendemail.to works

expecting success: 
	git send-email \
		--dry-run \
		--from="Example <nobody@example.com>" \
		--no-to \
		--to=nobody@example.com \
		$patches $patches >stdout &&
	grep "To: nobody@example.com" stdout &&
	! grep "To: Somebody <somebody@ex.com>" stdout

To: nobody@example.com
To: nobody@example.com
ok 85 - --no-to overrides sendemail.to

expecting success: 
	git config --replace-all sendemail.cc "Somebody <somebody@ex.com>" &&
	git send-email \
		--dry-run \
		--from="Example <nobody@example.com>" \
		--to=nobody@example.com \
		$patches $patches >stdout &&
	grep "Cc: Somebody <somebody@ex.com>" stdout

ok 4 - follow deleted parent

expecting success: 
        mkdir -p import/trunk/thunk/bump/thud &&
        echo hi > import/trunk/thunk/bump/thud/file &&
        svn import -m "import a larger parent" import "$svnrepo"/larger-parent &&
        svn cp -m "hi" "$svnrepo"/larger-parent "$svnrepo"/another-larger &&
        git svn init --minimize-url -i larger \
	  "$svnrepo"/larger-parent/trunk/thunk/bump/thud &&
        git svn fetch -i larger &&
	git svn init --minimize-url -i larger-parent \
	  "$svnrepo"/another-larger/trunk/thunk/bump/thud &&
	git svn fetch -i larger-parent &&
        git rev-parse --verify refs/remotes/larger &&
        git rev-parse --verify \
	   refs/remotes/larger-parent &&
        test "`git merge-base \
		 refs/remotes/larger-parent \
                 refs/remotes/larger`" = \
             "`git rev-parse refs/remotes/larger`"
        
Adding         import/trunk
Adding         import/trunk/readme
Adding         import/trunk/thunk
Adding         import/trunk/thunk/bump
Adding         import/trunk/thunk/bump/thud
Adding         import/trunk/thunk/bump/thud/file
Committing transaction...
ok 25 - test propget

expecting success: 
	git svn proplist . | cmp - prop.expect &&
	git svn proplist nested/directory/.keep | cmp - prop2.expect
	
	A	bar/zzz
	A	dir/a/b/c/d/e/file
	A	exec.sh
	A	foo
	A	foo.link
r1 = 84595e414a8a7a8c1ed30314d1d48662a9e3d249 (refs/remotes/alt)
Committed revision 5.
	D	dir/a/b/c/d/e/file
	D	dir/a/
	A	dir/file
	A	file
W: -empty_dir: dir/a
Cc: Somebody <somebody@ex.com>,
Cc: Somebody <somebody@ex.com>,
ok 86 - sendemail.cc works

expecting success: 
	git send-email \
		--dry-run \
		--from="Example <nobody@example.com>" \
		--no-cc \
		--cc=bodies@example.com \
		--to=nobody@example.com \
		$patches $patches >stdout &&
	grep "Cc: bodies@example.com" stdout &&
	! grep "Cc: Somebody <somebody@ex.com>" stdout

Committing transaction...
r2 = da91e2afc6e62f4eff7138fea2fa33ce2c3dff00 (refs/remotes/alt)
	D	bar/zzz
	A	bar/zzz/yyy
r3 = fc3c0824a7f4b5bcc3fe3b18e4299698f7052105 (refs/remotes/alt)
	M	exec.sh
Committed revision 6.
r4 = b54ca6087c9a54394adc1aefbbcc3d0360c8ca16 (refs/remotes/alt)
	M	exec.sh
r5 = d1ce8fd646ade443028b75f1fb31973fe2376b61 (refs/remotes/alt)
	D	exec.sh
	A	exec.sh
W: -empty_dir: exec.sh
r6 = 698fbae0b0ab1797b22d35ebcdc1e6db24d0c0a9 (refs/remotes/alt)
	A	exec-2.sh
Cc: bodies@example.com,
Cc: bodies@example.com,
ok 87 - --no-cc overrides sendemail.cc

expecting success: 
	git config --replace-all sendemail.bcc "Other <other@ex.com>" &&
	git send-email \
		--dry-run \
		--from="Example <nobody@example.com>" \
		--to=nobody@example.com \
		--smtp-server relay.example.com \
		$patches $patches >stdout &&
	grep "RCPT TO:<other@ex.com>" stdout

	M	file
r7 = a85a0b58107b6706ace40105e16d9f5498add240 (refs/remotes/alt)
	D	exec-2.sh
	A	exec-2.sh
W: -empty_dir: exec-2.sh
r8 = 1a7662ec0f489e155ee831b75c83c625dd6d9566 (refs/remotes/alt)
ok 15 - test fetch functionality (svn => git) with alternate GIT_SVN_ID

expecting success: test_cmp a expected
ok 16 - check imported tree checksums expected tree checksums

expecting success: 
        git config --add svn-remote.svn.fetch                               bar:refs/remotes/git-svn &&
	test_must_fail git svn migrate

RCPT TO:<other@ex.com>
RCPT TO:<other@ex.com>
ok 88 - sendemail.bcc works

expecting success: 
	git send-email \
		--dry-run \
		--from="Example <nobody@example.com>" \
		--no-bcc \
		--bcc=bodies@example.com \
		--to=nobody@example.com \
		--smtp-server relay.example.com \
		$patches $patches >stdout &&
	grep "RCPT TO:<bodies@example.com>" stdout &&
	! grep "RCPT TO:<other@ex.com>" stdout

Using existing [svn-remote "svn"]
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/larger-parent/trunk/thunk/bump/thud => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo
Remote ref refs/remote/git-svn is tracked by
  "svn-remote.svn.fetch=bar:refs/remotes/git-svn"
and
  "svn-remote.svn.fetch=:refs/remotes/git-svn"
Please resolve this ambiguity in your git configuration file before continuing

RCPT TO:<bodies@example.com>
RCPT TO:<bodies@example.com>
ok 89 - --no-bcc overrides sendemail.bcc

expecting success: 
	patch=`git format-patch -1 --to="bodies@example.com"` &&
	test_when_finished "rm $patch" &&
	git send-email \
		--dry-run \
		--from="Example <nobody@example.com>" \
		--smtp-server relay.example.com \
		$patch >stdout &&
	grep "RCPT TO:<bodies@example.com>" stdout

ok 17 - exit if remote refs are ambigious

expecting success: 
        svnadmin create "${PWD}/svnrepo2" &&
        svn mkdir -m "mkdir bar" "${svnrepo}2/bar" &&
        git config --unset svn-remote.svn.fetch \
                                "^bar:refs/${remotes_git_svn}$" &&
	test_must_fail git svn init "${svnrepo}2/bar"
        
ok 26 - test proplist

# passed all 26 test(s)
1..26
*** t9105-git-svn-commit-diff.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9105-git-svn-commit-diff/.git/
Committing transaction...
Committed revision 1.
RCPT TO:<bodies@example.com>
ok 90 - patches To headers are used by default

expecting success: 
	patch=`git format-patch -1 --to="bodies@example.com"` &&
	test_when_finished "rm $patch" &&
	git send-email \
		--dry-run \
		--from="Example <nobody@example.com>" \
		--to=nobody@example.com \
		--smtp-server relay.example.com \
		$patch >stdout &&
	grep "RCPT TO:<bodies@example.com>" stdout &&
	grep "RCPT TO:<nobody@example.com>" stdout

expecting success: 
	mkdir import &&
	(
		cd import &&
		echo hello >readme &&
		svn_cmd import -m "initial" . "$svnrepo"
	) &&
	echo hello > readme &&
	git update-index --add readme &&
	git commit -a -m "initial" &&
	echo world >> readme &&
	git commit -a -m "another"
	
Adding         readme
Committing transaction...
Committed revision 1.
[master (root-commit) c26a2db] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 readme
[master e75e336] another
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 1 - initialize repo

expecting success: 
	test -n "$prev" && test -n "$head" &&
	git svn commit-diff -r1 "$prev" "$head" "$svnrepo" &&
	svn_cmd co "$svnrepo" wc &&
	cmp readme wc/readme
	
	A	file
RCPT TO:<bodies@example.com>
RCPT TO:<nobody@example.com>
ok 91 - patches To headers are appended to

expecting success: 
	patch1=`git format-patch -1 --to="bodies@example.com"` &&
	patch2=`git format-patch -1 --to="other@example.com" HEAD~` &&
	test_when_finished "rm $patch1 && rm $patch2" &&
	git send-email \
		--dry-run \
		--from="Example <nobody@example.com>" \
		--to="nobody@example.com" \
		--smtp-server relay.example.com \
		$patch1 $patch2 >stdout &&
	test $(grep -c "RCPT TO:<bodies@example.com>" stdout) = 1 &&
	test $(grep -c "RCPT TO:<nobody@example.com>" stdout) = 2 &&
	test $(grep -c "RCPT TO:<other@example.com>" stdout) = 1

r5 = ff1a76a00d1497c7e8ff5ab415c34792b387f53e (refs/remotes/larger)
svn-remote.svn.url already set: file:///«PKGBUILDDIR»/t/trash%20directory.t9100-git-svn-basic/svnrepo
wanted to set to: file:///«PKGBUILDDIR»/t/trash%20directory.t9100-git-svn-basic/svnrepo2/bar

ok 18 - exit if init-ing a would clobber a URL

expecting success: 
        git svn init --minimize-url -i bar "$svnrepo/bar" &&
        git config --get svn-remote.svn.fetch \
                              "^bar:refs/remotes/bar$" &&
        git config --get svn-remote.svn.fetch \
                              "^:refs/${remotes_git_svn}$"
        
ok 92 - To headers from files reset each patch

expecting success: 
cat >email-using-8bit <<\EOF
From fe6ecc66ece37198fe5db91fa2fc41d9f4fe5cc4 Mon Sep 17 00:00:00 2001
Message-Id: <bogus-message-id@example.com>
From: author@example.com
Date: Sat, 12 Jun 2010 15:53:58 +0200
Subject: subject goes here

Dieser deutsche Text enthält einen Umlaut!
EOF

ok 93 - setup expect

expecting success: 
	echo "Subject: subject goes here" >expected

ok 94 - setup expect

expecting success: 
	clean_fake_sendmail &&
	echo bogus |
	git send-email --from=author@example.com --to=nobody@example.com \
			--smtp-server="$(pwd)/fake.sendmail" \
			--8bit-encoding=UTF-8 \
			email-using-8bit >stdout &&
	grep "Subject" msgtxt1 >actual &&
	test_cmp expected actual

Using existing [svn-remote "svn"]
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/another-larger/trunk/thunk/bump/thud => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo
ok 95 - ASCII subject is not RFC2047 quoted

expecting success: 
	cat >content-type-decl <<-\EOF
	MIME-Version: 1.0
	Content-Type: text/plain; charset=UTF-8
	Content-Transfer-Encoding: 8bit
	EOF

ok 96 - setup expect

expecting success: 
	clean_fake_sendmail &&
	echo |
	git send-email --from=author@example.com --to=nobody@example.com \
			--smtp-server="$(pwd)/fake.sendmail" \
			email-using-8bit >stdout &&
	grep "do not declare a Content-Transfer-Encoding" stdout &&
	grep email-using-8bit stdout &&
	grep "Which 8bit encoding" stdout &&
	egrep "Content|MIME" msgtxt1 >actual &&
	test_cmp actual content-type-decl

	M	readme
Using existing [svn-remote "svn"]
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9100-git-svn-basic/svnrepo/bar => file:///«PKGBUILDDIR»/t/trash%20directory.t9100-git-svn-basic/svnrepo
bar:refs/remotes/bar
:refs/remotes/git-svn
ok 19 - init allows us to connect to another directory in the same repo

expecting success: 
	git svn fetch -i bar &&
	git checkout -b my-bar refs/remotes/bar &&
	echo 1 > foo &&
	git add foo &&
	git commit -m "change 1" &&
	echo 2 > foo &&
	git add foo &&
	git commit -m "change 2" &&
	old_head=$(git rev-parse HEAD) &&
	git svn dcommit -i bar HEAD^ &&
	test $old_head = $(git rev-parse HEAD) &&
	test refs/heads/my-bar = $(git symbolic-ref HEAD) &&
	git log refs/remotes/bar | grep "change 1" &&
	! git log refs/remotes/bar | grep "change 2" &&
	git checkout master &&
	git branch -D my-bar
	
Committed r2
A    wc/readme
Checked out revision 2.
ok 2 - test the commit-diff command

expecting success: 
	svn_cmd import -m "sub-directory" import "$svnrepo"/subdir &&
	git svn init --minimize-url "$svnrepo"/subdir &&
	git svn fetch &&
	git svn commit-diff -r3 "$prev" "$head" &&
	svn_cmd cat "$svnrepo"/subdir/readme > readme.2 &&
	cmp readme readme.2
	
The following files are 8bit, but do not declare a Content-Transfer-Encoding.
email-using-8bit
    email-using-8bit
Which 8bit encoding should I declare [UTF-8]? (mbox) Adding cc: author@example.com from line 'From: author@example.com'
ok 97 - asks about and fixes 8bit encodings

expecting success: 
	clean_fake_sendmail &&
	git config sendemail.assume8bitEncoding UTF-8 &&
	echo bogus |
	git send-email --from=author@example.com --to=nobody@example.com \
			--smtp-server="$(pwd)/fake.sendmail" \
			email-using-8bit >stdout &&
	egrep "Content|MIME" msgtxt1 >actual &&
	test_cmp actual content-type-decl

Adding         import/readme
Committing transaction...
Committed revision 3.
ok 98 - sendemail.8bitEncoding works

expecting success: 
	clean_fake_sendmail &&
	git config sendemail.assume8bitEncoding "bogus too" &&
	echo bogus |
	git send-email --from=author@example.com --to=nobody@example.com \
			--smtp-server="$(pwd)/fake.sendmail" \
			--8bit-encoding=UTF-8 \
			email-using-8bit >stdout &&
	egrep "Content|MIME" msgtxt1 >actual &&
	test_cmp actual content-type-decl

branch_from: /larger-parent => /larger-parent/trunk/thunk/bump/thud
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/larger-parent/trunk/thunk/bump/thud => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/another-larger/trunk/thunk/bump/thud, 5
Found branch parent: (refs/remotes/larger-parent) ff1a76a00d1497c7e8ff5ab415c34792b387f53e
Following parent with do_switch
Successfully followed parent
	A	zzz
r6 = 04a11a09a8d2552edf5ddaac1d4466ad82b0e135 (refs/remotes/larger-parent)
r1 = c2ab2e01d3d5bb28cf776f9e8315f55c4a9e6c90 (refs/remotes/bar)
ff1a76a00d1497c7e8ff5ab415c34792b387f53e
04a11a09a8d2552edf5ddaac1d4466ad82b0e135
ok 5 - follow larger parent

expecting success: 
	svn mkdir -m "follow higher-level parent" "$svnrepo"/blob &&
	svn co "$svnrepo"/blob blob &&
	(
		cd blob &&
		echo hi > hi &&
		svn add hi &&
		svn commit -m "hihi"
	) &&
	svn mkdir -m "new glob at top level" "$svnrepo"/glob &&
	svn mv -m "move blob down a level" "$svnrepo"/blob "$svnrepo"/glob/blob &&
	git svn init --minimize-url -i blob "$svnrepo"/glob/blob &&
        git svn fetch -i blob
        
	D	zzz
	A	zzz/yyy
r3 = 700f42261a3fb6ec67736c3c38cc6c5477f83947 (refs/remotes/bar)
ok 99 - --8bit-encoding overrides sendemail.8bitEncoding

expecting success: 
	cat >email-using-8bit <<-\EOF
	From fe6ecc66ece37198fe5db91fa2fc41d9f4fe5cc4 Mon Sep 17 00:00:00 2001
	Message-Id: <bogus-message-id@example.com>
	From: author@example.com
	Date: Sat, 12 Jun 2010 15:53:58 +0200
	Subject: Dieser Betreff enthält auch einen Umlaut!

	Nothing to see here.
	EOF

ok 100 - setup expect

expecting success: 
	cat >expected <<-\EOF
	Subject: =?UTF-8?q?Dieser=20Betreff=20enth=C3=A4lt=20auch=20einen=20Umlaut!?=
	EOF

ok 101 - setup expect

expecting success: 
	clean_fake_sendmail &&
	echo bogus |
	git send-email --from=author@example.com --to=nobody@example.com \
			--smtp-server="$(pwd)/fake.sendmail" \
			--8bit-encoding=UTF-8 \
			email-using-8bit >stdout &&
	grep "Subject" msgtxt1 >actual &&
	test_cmp expected actual

Switched to a new branch 'my-bar'
Committing transaction...
[my-bar b3d177e] change 1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
[my-bar 0e4fd1c] change 2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9105-git-svn-commit-diff/svnrepo/subdir => file:///«PKGBUILDDIR»/t/trash%20directory.t9105-git-svn-commit-diff/svnrepo
Committed revision 7.
Checked out revision 7.
A         hi
Adding         hi
Transmitting file data .done
Committing transaction...
ok 102 - --8bit-encoding also treats subject

expecting success: 
	cat >email-using-8bit <<-\EOF
	From fe6ecc66ece37198fe5db91fa2fc41d9f4fe5cc4 Mon Sep 17 00:00:00 2001
	Message-Id: <bogus-message-id@example.com>
	From: A U Thor <author@example.com>
	Date: Sat, 12 Jun 2010 15:53:58 +0200
	Content-Type: text/plain; charset=UTF-8
	Subject: Nothing to see here.

	Dieser Betreff enthält auch einen Umlaut!
	EOF

ok 103 - setup expect

expecting success: 
	clean_fake_sendmail &&
	git config sendemail.transferEncoding 7bit &&
	test_must_fail git send-email \
		--transfer-encoding=7bit \
		--smtp-server="$(pwd)/fake.sendmail" \
		email-using-8bit \
		2>errors >out &&
	grep "cannot send message as 7bit" errors &&
	test -z "$(ls msgtxt*)"

Committed revision 8.
Committing transaction...
Committed revision 9.
cannot send message as 7bit at /«PKGBUILDDIR»/git-send-email line 1668.
ls: cannot access msgtxt*: No such file or directory
ok 104 - sendemail.transferencoding=7bit fails on 8bit data

expecting success: 
	clean_fake_sendmail &&
	git config sendemail.transferEncoding 8bit &&
	test_must_fail git send-email \
		--transfer-encoding=7bit \
		--smtp-server="$(pwd)/fake.sendmail" \
		email-using-8bit \
		2>errors >out &&
	grep "cannot send message as 7bit" errors &&
	test -z "$(ls msgtxt*)"

Committing transaction...
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9100-git-svn-basic/svnrepo/bar ...
	A	readme
Committed revision 10.
r3 = 4f8d7441d261f1dff86129de3d1f04a144f58031 (refs/remotes/git-svn)
	A	foo
cannot send message as 7bit at /«PKGBUILDDIR»/git-send-email line 1668.
ls: cannot access msgtxt*: No such file or directory
ok 105 - --transfer-encoding overrides sendemail.transferEncoding

expecting success: 
	clean_fake_sendmail &&
	git send-email \
		--transfer-encoding=8bit \
		--smtp-server="$(pwd)/fake.sendmail" \
		email-using-8bit \
		2>errors >out &&
	sed 1,/^$/d msgtxt1 >actual &&
	sed 1,/^$/d email-using-8bit >expected &&
	test_cmp expected actual

Committed r9
	A	foo
r9 = 0f902b62f365beab2119e5fcb0449e20a363584f (refs/remotes/bar)
No changes between b3d177e6ad1ea2c51c4f4dc1699f84d19d9ff2a3 and refs/remotes/bar
Resetting to the latest refs/remotes/bar
dcommitted on a detached HEAD because you gave a revision argument.
The rewritten commit is: 0f902b62f365beab2119e5fcb0449e20a363584f
    change 1
Switched to branch 'master'
Deleted branch my-bar (was 0e4fd1c).
ok 20 - dcommit $rev does not clobber current branch

expecting success: 
	git svn fetch -i bar &&
	git checkout -b my-bar refs/remotes/bar &&
	echo abc > d &&
	git update-index --add d &&
	git commit -m '/bar/d should be in the log' &&
	git svn dcommit -i bar &&
	test -z "`git diff refs/heads/my-bar refs/remotes/bar`" &&
	mkdir newdir &&
	echo new > newdir/dir &&
	git update-index --add newdir/dir &&
	git commit -m 'add a new directory' &&
	git svn dcommit -i bar &&
	test -z "`git diff refs/heads/my-bar refs/remotes/bar`" &&
	echo foo >> newdir/dir &&
	git update-index newdir/dir &&
	git commit -m 'modify a file in new directory' &&
	git svn dcommit -i bar &&
	test -z "`git diff refs/heads/my-bar refs/remotes/bar`"
	
ok 106 - sendemail.transferencoding=8bit

expecting success: 
	cat >expected <<-\EOF
	Dieser Betreff enth=C3=A4lt auch einen Umlaut!
	EOF

ok 107 - setup expect

expecting success: 
	clean_fake_sendmail &&
	git send-email \
		--transfer-encoding=quoted-printable \
		--smtp-server="$(pwd)/fake.sendmail" \
		email-using-8bit \
		2>errors >out &&
	sed 1,/^$/d msgtxt1 >actual &&
	test_cmp expected actual

Using existing [svn-remote "svn"]
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/glob/blob => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo
	M	readme
Committed r4
ok 3 - commit-diff to a sub-directory (with git svn config)

# passed all 3 test(s)
1..3
*** t9106-git-svn-commit-diff-clobber.sh ***
ok 108 - 8-bit and sendemail.transferencoding=quoted-printable

expecting success: 
	cat >expected <<-\EOF
	RGllc2VyIEJldHJlZmYgZW50aMOkbHQgYXVjaCBlaW5lbiBVbWxhdXQhCg==
	EOF

ok 109 - setup expect

expecting success: 
	clean_fake_sendmail &&
	git send-email \
		--transfer-encoding=base64 \
		--smtp-server="$(pwd)/fake.sendmail" \
		email-using-8bit \
		2>errors >out &&
	sed 1,/^$/d msgtxt1 >actual &&
	test_cmp expected actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9106-git-svn-commit-diff-clobber/.git/
expecting success: 
	mkdir import &&
	(
		cd import &&
		echo initial >file &&
		svn_cmd import -m "initial" . "$svnrepo"
	) &&
	echo initial > file &&
	git update-index --add file &&
	git commit -a -m "initial"
	
	A	bar/foo
r9 = c64d3ef4686afa11e35bd979646d015eb2cc6ad9 (refs/remotes/alt)
Switched to a new branch 'my-bar'
[my-bar 003a67c] /bar/d should be in the log
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 d
ok 110 - 8-bit and sendemail.transferencoding=base64

expecting success: 
	cat >email-using-qp <<-\EOF
	From fe6ecc66ece37198fe5db91fa2fc41d9f4fe5cc4 Mon Sep 17 00:00:00 2001
	Message-Id: <bogus-message-id@example.com>
	From: A U Thor <author@example.com>
	Date: Sat, 12 Jun 2010 15:53:58 +0200
	MIME-Version: 1.0
	Content-Transfer-Encoding: quoted-printable
	Content-Type: text/plain; charset=UTF-8
	Subject: Nothing to see here.

	Dieser Betreff enth=C3=A4lt auch einen Umlaut!
	EOF

ok 111 - setup expect

expecting success: 
	clean_fake_sendmail &&
	git send-email \
		--transfer-encoding=base64 \
		--smtp-server="$(pwd)/fake.sendmail" \
		email-using-qp \
		2>errors >out &&
	sed 1,/^$/d msgtxt1 >actual &&
	test_cmp expected actual

Adding         file
Committing transaction...
Committed revision 1.
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/blob => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/glob/blob, 9
[master (root-commit) 91e9397] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 1 - initialize repo

expecting success: 
	svn_cmd co "$svnrepo" t.svn &&
	(
		cd t.svn &&
		echo second line from svn >>file &&
		poke file &&
		svn_cmd commit -m "second line from svn"
	) &&
	rm -rf t.svn
	
Initializing parent: refs/remotes/blob@9
A    t.svn/file
Checked out revision 1.
Sending        file
Transmitting file data .done
Committing transaction...
r7 = 6d2140eaf4ec41022f6eedede8f7ed18fd2111ba (refs/remotes/blob@9)
ok 112 - convert from quoted-printable to base64

expecting success: 
tr -d '\015' | tr '%' '\015' >email-using-crlf <<EOF
From fe6ecc66ece37198fe5db91fa2fc41d9f4fe5cc4 Mon Sep 17 00:00:00 2001
Message-Id: <bogus-message-id@example.com>
From: A U Thor <author@example.com>
Date: Sat, 12 Jun 2010 15:53:58 +0200
Content-Type: text/plain; charset=UTF-8
Subject: Nothing to see here.

Look, I have a CRLF and an = sign!%
EOF

ok 113 - setup expect

expecting success: 
	cat >expected <<-\EOF
	Look, I have a CRLF and an =3D sign!=0D
	EOF

ok 114 - setup expect

expecting success: 
	clean_fake_sendmail &&
	git send-email \
		--transfer-encoding=quoted-printable \
		--smtp-server="$(pwd)/fake.sendmail" \
		email-using-crlf \
		2>errors >out &&
	sed 1,/^$/d msgtxt1 >actual &&
	test_cmp expected actual

	A	hi
r8 = b5f8a895fee39577dbb9e86f121effec9cb73258 (refs/remotes/blob@9)
Found branch parent: (refs/remotes/blob) b5f8a895fee39577dbb9e86f121effec9cb73258
Committed revision 2.
Following parent with do_switch
ok 2 - commit change from svn side

expecting success: 
	echo second line from git >> file &&
	git commit -a -m "second line from git" &&
	test_must_fail git svn commit-diff -r1 HEAD~1 HEAD "$svnrepo"

[master fb1086d] second line from git
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Successfully followed parent
r10 = 8c3360b8da0bf8d04a85dd26c4c8530bbb63a1ab (refs/remotes/blob)
ok 6 - follow higher-level parent

expecting success: 
	svn_cmd mv -m "bye!" "$svnrepo"/glob/blob/hi "$svnrepo"/glob/blob/bye &&
	svn_cmd rm -m "remove glob" "$svnrepo"/glob &&
	git svn init --minimize-url -i glob "$svnrepo"/glob &&
	git svn fetch -i glob &&
	test "`git cat-file blob refs/remotes/glob:blob/bye`" = hi &&
	test "`git ls-tree refs/remotes/glob | wc -l `" -eq 1
	
Committing transaction...
ok 115 - CRLF and sendemail.transferencoding=quoted-printable

expecting success: 
	cat >expected <<-\EOF
	TG9vaywgSSBoYXZlIGEgQ1JMRiBhbmQgYW4gPSBzaWduIQ0K
	EOF

ok 116 - setup expect

expecting success: 
	clean_fake_sendmail &&
	git send-email \
		--transfer-encoding=base64 \
		--smtp-server="$(pwd)/fake.sendmail" \
		email-using-crlf \
		2>errors >out &&
	sed 1,/^$/d msgtxt1 >actual &&
	test_cmp expected actual

Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9100-git-svn-basic/svnrepo/bar ...
Committed revision 11.
	A	d
Committing transaction...
ok 117 - CRLF and sendemail.transferencoding=base64

expecting success: 
	clean_fake_sendmail &&
	rm -fr outdir &&
	git format-patch --cover-letter -2 -o outdir &&
	test_must_fail git send-email \
		--from="Example <nobody@example.com>" \
		--to=nobody@example.com \
		--smtp-server="$(pwd)/fake.sendmail" \
		outdir/0002-*.patch \
		outdir/0000-*.patch \
		outdir/0001-*.patch \
		2>errors >out &&
	grep "SUBJECT HERE" errors &&
	test -z "$(ls msgtxt*)"

outdir/0000-cover-letter.patch
outdir/0001-Second.patch
outdir/0002-add-master.patch
Transaction is out of date: File '/file' is out of date at /«PKGBUILDDIR»/git-svn line 1530.

ok 3 - commit conflicting change from git

expecting success: 
	git reset --hard HEAD~1 &&
	echo second line from svn >> file &&
	git commit -a -m "second line from svn" &&
	echo third line from git >> file &&
	git commit -a -m "third line from git" &&
	git svn commit-diff -r2 HEAD~1 HEAD "$svnrepo"
	
HEAD is now at 91e9397 initial
Committed r10
[master 297f38d] second line from svn
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Committed revision 12.
[master 5259aab] third line from git
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
	A	d
r10 = 11dc06c919dd88aadb7456fdc06f0e6224c8f02d (refs/remotes/bar)
No changes between 003a67c907126293508490e8164bd8f62b918aa6 and refs/remotes/bar
Resetting to the latest refs/remotes/bar
[my-bar 7915ca0] add a new directory
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 newdir/dir
has the template subject '*** SUBJECT HERE ***'. Pass --force if you really want to send.
ls: cannot access msgtxt*: No such file or directory
ok 118 - refusing to send cover letter template

expecting success: 
	clean_fake_sendmail &&
	rm -fr outdir &&
	git format-patch --cover-letter -2 -o outdir &&
	git send-email \
		--force \
		--from="Example <nobody@example.com>" \
		--to=nobody@example.com \
		--smtp-server="$(pwd)/fake.sendmail" \
		outdir/0002-*.patch \
		outdir/0000-*.patch \
		outdir/0001-*.patch \
		2>errors >out &&
	! grep "SUBJECT HERE" errors &&
	test -n "$(ls msgtxt*)"

outdir/0000-cover-letter.patch
outdir/0001-Second.patch
outdir/0002-add-master.patch
ok 119 - --force sends cover letter template anyway

expecting success: 
	test_cover_addresses "To" --to-cover

outdir/0000-cover-letter.patch
outdir/0001-Second.patch
outdir/0002-add-master.patch
Using existing [svn-remote "svn"]
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/glob => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo
	M	file
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9100-git-svn-basic/svnrepo/bar ...
Committed r3
ok 4 - commit complementing change from git

expecting success: 
	git svn init "$svnrepo" &&
	git svn fetch &&
	git reset --hard refs/${remotes_git_svn} &&
	svn_cmd co "$svnrepo" t.svn &&
	(
		cd t.svn &&
		echo fourth line from svn >>file &&
		poke file &&
		svn_cmd commit -m "fourth line from svn"
	) &&
	rm -rf t.svn &&
	echo "fourth line from git" >> file &&
	git commit -a -m "fourth line from git" &&
	test_must_fail git svn dcommit
	
ok 120 - to-cover adds To to all mail

expecting success: 
	test_cover_addresses "Cc" --cc-cover

outdir/0000-cover-letter.patch
outdir/0001-Second.patch
outdir/0002-add-master.patch
	A	newdir/dir
Committed r11
	A	newdir/dir
ok 121 - cc-cover adds Cc to all mail

expecting success: 
	test_config sendemail.tocover true &&
	test_cover_addresses "To"

r11 = 0119e6488174a4a4330164e3dafe0397b47dcd93 (refs/remotes/bar)
outdir/0000-cover-letter.patch
outdir/0001-Second.patch
outdir/0002-add-master.patch
No changes between 7915ca032f765e11d3e1992b6824e1db67c8609b and refs/remotes/bar
Resetting to the latest refs/remotes/bar
[my-bar 7bd44f8] modify a file in new directory
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
r9 = 2affd62e818ed57c5d8ccadcdf07669970cff387 (refs/remotes/glob)
ok 122 - tocover adds To to all mail

expecting success: 
	test_config sendemail.cccover true &&
	test_cover_addresses "Cc"

	A	blob/hi
outdir/0000-cover-letter.patch
outdir/0001-Second.patch
outdir/0002-add-master.patch
r10 = c5200f36c55c607f0d9854801646ea8fbbe70585 (refs/remotes/glob)
	D	hi
	A	bye
W: -empty_dir: glob/blob/hi
r11 = 602f50384a8e9b1f62afefd4a83ecbf477ddf21a (refs/remotes/blob)
	D	blob/hi
	A	blob/bye
W: -empty_dir: glob/blob/hi
r11 = 88ef88a2dec13a03734dccff294fb520dd435d57 (refs/remotes/glob)
ok 7 - follow deleted directory

expecting success: 
	mkdir -p import/trunk/subversion/bindings/swig/perl/t &&
	for i in a b c ; do \
	  echo $i > import/trunk/subversion/bindings/swig/perl/$i.pm &&
	  echo _$i > import/trunk/subversion/bindings/swig/perl/t/$i.t; \
	done &&
	  echo "bad delete test" > \
	   import/trunk/subversion/bindings/swig/perl/t/larger-parent &&
	  echo "bad delete test 2" > \
	   import/trunk/subversion/bindings/swig/perl/another-larger &&
	(
		cd import &&
		svn import -m "r9270 test" . "$svnrepo"/r9270
	) &&
	svn_cmd co "$svnrepo"/r9270/trunk/subversion/bindings/swig/perl r9270 &&
	(
		cd r9270 &&
		svn mkdir native &&
		svn mv t native/t &&
		for i in a b c
		do
			svn mv $i.pm native/$i.pm
		done &&
		echo z >>native/t/c.t &&
		poke native/t/c.t &&
		svn commit -m "reorg test"
	) &&
	git svn init --minimize-url -i r9270-t \
	  "$svnrepo"/r9270/trunk/subversion/bindings/swig/perl/native/t &&
	git svn fetch -i r9270-t &&
	test `git rev-list r9270-t | wc -l` -eq 2 &&
	test "`git ls-tree --name-only r9270-t~1`" = \
	     "`git ls-tree --name-only r9270-t`"
	
Adding         trunk
Adding         trunk/readme
Adding         trunk/subversion
Adding         trunk/subversion/bindings
Adding         trunk/subversion/bindings/swig
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9100-git-svn-basic/svnrepo/bar ...
Adding         trunk/subversion/bindings/swig/perl
Adding         trunk/subversion/bindings/swig/perl/a.pm
Adding         trunk/subversion/bindings/swig/perl/another-larger
Adding         trunk/subversion/bindings/swig/perl/b.pm
Adding         trunk/subversion/bindings/swig/perl/c.pm
Adding         trunk/subversion/bindings/swig/perl/t
Adding         trunk/subversion/bindings/swig/perl/t/a.t
Adding         trunk/subversion/bindings/swig/perl/t/b.t
Adding         trunk/subversion/bindings/swig/perl/t/c.t
Adding         trunk/subversion/bindings/swig/perl/t/larger-parent
Adding         trunk/thunk
Adding         trunk/thunk/bump
Adding         trunk/thunk/bump/thud
Adding         trunk/thunk/bump/thud/file
Committing transaction...
ok 123 - cccover adds Cc to all mail

expecting success: 
	clean_fake_sendmail &&
	echo "alias sbd  somebody@example.org" >.mailrc &&
	git config --replace-all sendemail.aliasesfile "$(pwd)/.mailrc" &&
	git config sendemail.aliasfiletype mailrc &&
	git send-email \
		--from="Example <nobody@example.com>" \
		--to=sbd \
		--smtp-server="$(pwd)/fake.sendmail" \
		outdir/0001-*.patch \
		2>errors >out &&
	grep "^!somebody@example\.org!$" commandline1

Committed revision 13.
	M	newdir/dir
A    r9270/t
A    r9270/t/a.t
A    r9270/t/b.t
A    r9270/t/c.t
A    r9270/t/larger-parent
A    r9270/a.pm
A    r9270/another-larger
A    r9270/b.pm
A    r9270/c.pm
Checked out revision 13.
A         native
	A	file
A         native/t
D         t
D         t/a.t
D         t/b.t
D         t/c.t
D         t/larger-parent
r1 = fc5e75baba2186b76b1e539af926b9038e3c4b46 (refs/remotes/git-svn)
A         native/a.pm
D         a.pm
Committed r12
A         native/b.pm
D         b.pm
	M	file
A         native/c.pm
D         c.pm
r2 = 6d61221071a6351b59f407ff195b432c72b677c7 (refs/remotes/git-svn)
!somebody@example.org!
ok 124 - sendemail.aliasfiletype=mailrc

expecting success: 
	clean_fake_sendmail &&
	echo "alias sbd  someone@example.org" >"$HOME/.mailrc" &&
	git config --replace-all sendemail.aliasesfile "~/.mailrc" &&
	git config sendemail.aliasfiletype mailrc &&
	git send-email \
		--from="Example <nobody@example.com>" \
		--to=sbd \
		--smtp-server="$(pwd)/fake.sendmail" \
		outdir/0001-*.patch \
		2>errors >out &&
	grep "^!someone@example\.org!$" commandline1

	M	file
	M	newdir/dir
r3 = e9a605a0b6536da17836acc77cef425fe0fd50da (refs/remotes/git-svn)
r12 = 86ea23093cee28e0bc5633ed9df4abcc7bc87e5c (refs/remotes/bar)
No changes between 7bd44f83d8ee8a2ad8e926e5b1c291c0235c09eb and refs/remotes/bar
Resetting to the latest refs/remotes/bar
Deleting       a.pm
HEAD is now at e9a605a third line from git
Deleting       b.pm
Deleting       c.pm
Adding         native
Adding         native/a.pm
Adding         native/b.pm
Adding         native/c.pm
Adding         native/t
Sending        native/t/c.t
Deleting       t
Transmitting file data .done
Committing transaction...
ok 21 - able to dcommit to a subdirectory

expecting success: 
	test_commit "commit-new-file-foo2" foo2 &&
	test-chmtime =-60 foo &&
	git svn dcommit

[my-bar 4f36d99] commit-new-file-foo2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo2
A    t.svn/file
Checked out revision 3.
Sending        file
Transmitting file data .done
Committing transaction...
Committed revision 14.
!someone@example.org!
ok 125 - sendemail.aliasfile=~/.mailrc

expecting success: 
		clean_fake_sendmail && rm -fr outdir &&
		git format-patch -1 -o outdir &&
		git config --replace-all sendemail.aliasesfile \
			"$(pwd)/.tmp-email-aliases" &&
		git config sendemail.aliasfiletype sendmail &&
		git send-email \
			--from="Example <nobody@example.com>" \
			--to=alice --to=bcgrp \
			--smtp-server="$(pwd)/fake.sendmail" \
			outdir/0001-*.patch \
			2>errors >out &&
		for i in $expect
		do
			grep "^!$i!$" commandline1 || return 1
		done
	
outdir/0001-add-master.patch
Committed revision 4.
[master 87a14ae] fourth line from git
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
!awol@example.com!
!bob@example.com!
!chloe@example.com!
!o@example.com!
ok 126 - sendemail.aliasfiletype=sendmail

expecting success: 
		clean_fake_sendmail && rm -fr outdir &&
		git format-patch -1 -o outdir &&
		git config --replace-all sendemail.aliasesfile \
			"$(pwd)/.tmp-email-aliases" &&
		git config sendemail.aliasfiletype sendmail &&
		git send-email \
			--from="Example <nobody@example.com>" \
			--to=alice --to=bcgrp \
			--smtp-server="$(pwd)/fake.sendmail" \
			outdir/0001-*.patch \
			2>errors >out &&
		for i in $expect
		do
			grep "^!$i!$" commandline1 || return 1
		done
	
outdir/0001-add-master.patch
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9100-git-svn-basic/svnrepo/bar ...
Using existing [svn-remote "svn"]
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/r9270/trunk/subversion/bindings/swig/perl/native/t => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo
	A	foo2
!alice1!
!bob1!
!bob2!
!chuck1!
!chuck2!
!darla1!
!darla2!
!darla3!
!elton1!
Committed r13
!elton2!
!elton3!
!fred1!
!fred2!
!greg1!
ok 127 - sendmail aliases line folding

expecting success: 
		clean_fake_sendmail && rm -fr outdir &&
		git format-patch -1 -o outdir &&
		git config --replace-all sendemail.aliasesfile \
			"$(pwd)/.tmp-email-aliases" &&
		git config sendemail.aliasfiletype sendmail &&
		git send-email \
			--from="Example <nobody@example.com>" \
			--to=alice --to=bcgrp \
			--smtp-server="$(pwd)/fake.sendmail" \
			outdir/0001-*.patch \
			2>errors >out &&
		for i in $expect
		do
			grep "^!$i!$" commandline1 || return 1
		done
	
outdir/0001-add-master.patch
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9106-git-svn-commit-diff-clobber/svnrepo ...
	A	foo2
r13 = 9485d6b7898a812c01d1de71c36414c1ba27a159 (refs/remotes/bar)
No changes between 4f36d99d4329b1e1eb231feb73e7b68c03b0e721 and refs/remotes/bar
Resetting to the latest refs/remotes/bar
ok 22 - dcommit should not fail with a touched file

expecting success: 
	test-chmtime =-60 foo &&
	git svn rebase


ERROR from SVN:
Transaction is out of date: File '/file' is out of date
W: 87a14ae8ec6cc8e58974ce73bcfb2f80c0a55c25 and refs/remotes/git-svn differ, using rebase:
:100644 100644 faa34c792e6a485955b65cc9f20e8ab0dd63e45c d270188940c824ce4f1e8aa864ca5d2f8c75f939 M	file
Current branch master is up to date.
ERROR: Not all changes have been committed into SVN, however the committed
ones (if any) seem to be successfully integrated into the working tree.
Please see the above messages for details.

ok 5 - dcommit fails to commit because of conflict

expecting success: 
	git reset --hard refs/remotes/git-svn &&
	echo 'index merge' > file2 &&
	git update-index --add file2 &&
	git commit -a -m 'index merge' &&
	echo 'more changes' >> file2 &&
	git update-index file2 &&
	git commit -a -m 'more changes' &&
	git svn dcommit
	
HEAD is now at e9a605a third line from git
[master fc997b3] index merge
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file2
[master 334ed22] more changes
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
!alice1!
!bob1!
ok 128 - sendmail aliases tolerate bogus line folding

expecting success: 
		clean_fake_sendmail && rm -fr outdir &&
		git format-patch -1 -o outdir &&
		git config --replace-all sendemail.aliasesfile \
			"$(pwd)/.tmp-email-aliases" &&
		git config sendemail.aliasfiletype sendmail &&
		git send-email \
			--from="Example <nobody@example.com>" \
			--to=alice --to=bcgrp \
			--smtp-server="$(pwd)/fake.sendmail" \
			outdir/0001-*.patch \
			2>errors >out &&
		for i in $expect
		do
			grep "^!$i!$" commandline1 || return 1
		done
	
outdir/0001-add-master.patch
!alice!
!bcgrp!
ok 129 - sendmail aliases empty

expecting success: 
	clean_fake_sendmail &&
	echo "alias sbd  someone@example.org" >.mailrc &&
	test_config sendemail.aliasesfile ".mailrc" &&
	test_config sendemail.aliasfiletype mailrc &&
	git format-patch --stdout -1 --to=sbd >aliased.patch &&
	git send-email \
		--from="Example <nobody@example.com>" \
		--smtp-server="$(pwd)/fake.sendmail" \
		aliased.patch \
		2>errors >out &&
	grep "^!someone@example\.org!$" commandline1

Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/r9270/trunk/subversion/bindings/swig/perl/t => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/r9270/trunk/subversion/bindings/swig/perl/native/t, 13
Initializing parent: refs/remotes/r9270-t@13
	A	a.t
	A	b.t
	A	c.t
	A	larger-parent
Current branch my-bar is up to date.
ok 23 - rebase should not fail with a touched file

expecting success: 
	echo cba > d &&
	git update-index d &&
	git commit -m 'update /bar/d' &&
	git svn set-tree -i bar HEAD &&
	test -z "`git diff refs/heads/my-bar refs/remotes/bar`"
	
[my-bar 697b5b2] update /bar/d
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
r13 = 322825e6b56bfb9ffdc0789ea3e58bb4522564fc (refs/remotes/r9270-t@13)
Found branch parent: (refs/remotes/r9270-t) 322825e6b56bfb9ffdc0789ea3e58bb4522564fc
Following parent with do_switch
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9106-git-svn-commit-diff-clobber/svnrepo ...
	M	c.t
Successfully followed parent
r14 = 32f0bd381d809d3e3e74927a5fc08375a45e10ef (refs/remotes/r9270-t)
!someone@example.org!
ok 130 - alias support in To header

expecting success: 
	clean_fake_sendmail &&
	echo "alias sbd  someone@example.org" >.mailrc &&
	test_config sendemail.aliasesfile ".mailrc" &&
	test_config sendemail.aliasfiletype mailrc &&
	git format-patch --stdout -1 --cc=sbd >aliased.patch &&
	git send-email \
		--from="Example <nobody@example.com>" \
		--smtp-server="$(pwd)/fake.sendmail" \
		aliased.patch \
		2>errors >out &&
	grep "^!someone@example\.org!$" commandline1

	A	file2
ok 8 - follow-parent avoids deleting relevant info

expecting success: 
	svn_cmd cp -m "wheee!" "$svnrepo"/r9270/trunk "$svnrepo"/r9270/drunk &&
	git svn init --minimize-url -i r9270-d \
	  "$svnrepo"/r9270/drunk/subversion/bindings/swig/perl/native/t &&
	git svn fetch -i r9270-d &&
	test `git rev-list r9270-d | wc -l` -eq 3 &&
	test "`git ls-tree --name-only r9270-t`" = \
	     "`git ls-tree --name-only r9270-d`" &&
	test "`git rev-parse r9270-t`" = \
	     "`git rev-parse r9270-d~1`"
	
Committing transaction...
Committed r5
Committed revision 15.
	M	file
!someone@example.org!
ok 131 - alias support in Cc header

expecting success: 
	clean_fake_sendmail &&
	echo "alias sbd  someone@example.org" >.mailrc &&
	test_config sendemail.aliasesfile ".mailrc" &&
	test_config sendemail.aliasfiletype mailrc &&
	git format-patch --stdout -1 >tocmd.patch &&
	echo tocmd--sbd >>tocmd.patch &&
	git send-email \
		--from="Example <nobody@example.com>" \
		--to-cmd=./tocmd-sed \
		--smtp-server="$(pwd)/fake.sendmail" \
		tocmd.patch \
		2>errors >out &&
	grep "^!someone@example\.org!$" commandline1

r4 = 8e0ca6fa9919fee73fb105a9f873ca63e590d315 (refs/remotes/git-svn)
	A	file2
r5 = 6ffd94c9668d7ad89151e8cd4b82f2b1f6b8e293 (refs/remotes/git-svn)
W: fc997b3c35a9bcd0111f4fb94dbf88729e1ae9f6 and refs/remotes/git-svn differ, using rebase:
:100644 100644 d270188940c824ce4f1e8aa864ca5d2f8c75f939 b349877e032add143a5dc286d30e523181dea4ef M	file
First, rewinding head to replay your work on top of it...
Applying: more changes
	M	d
!someone@example.org!
ok 132 - tocmd works with aliases

expecting success: 
	clean_fake_sendmail &&
	echo "alias sbd  someone@example.org" >.mailrc &&
	test_config sendemail.aliasesfile ".mailrc" &&
	test_config sendemail.aliasfiletype mailrc &&
	git format-patch --stdout -1 >cccmd.patch &&
	echo cccmd--sbd >>cccmd.patch &&
	git send-email \
		--from="Example <nobody@example.com>" \
		--cc-cmd=./cccmd-sed \
		--smtp-server="$(pwd)/fake.sendmail" \
		cccmd.patch \
		2>errors >out &&
	grep "^!someone@example\.org!$" commandline1

	M	file2
Using existing [svn-remote "svn"]
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/r9270/drunk/subversion/bindings/swig/perl/native/t => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo
	M	d
Committed r6
r14 = b482987207767a22ff40ccfc7bfc55bcfbb67abf (refs/remotes/bar)
Done committing 1 revisions to SVN
ok 24 - able to set-tree to a subdirectory

expecting success: 
	mkdir bare-repo &&
	( cd bare-repo &&
	git init --bare &&
	GIT_DIR=. git svn init "$svnrepo" &&
	git svn fetch ) &&
	rm -rf bare-repo
	
	M	file2
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9100-git-svn-basic/bare-repo/
r6 = 4f4a1d53ddec1f261dce1fd627878dbf42142f1f (refs/remotes/git-svn)
No changes between a79a5e9d2ebc07f50dccdd24bc153925182b4bc0 and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
ok 6 - dcommit does the svn equivalent of an index merge

expecting success: 
	svn_cmd co "$svnrepo" t.svn &&
	(
		cd t.svn &&
		echo third line from svn >>file &&
		poke file &&
		svn_cmd commit -m "third line from svn"
	) &&
	rm -rf t.svn
	
A    t.svn/file
!someone@example.org!
A    t.svn/file2
Checked out revision 6.
ok 133 - cccmd works with aliases

expecting success: 
	do_xmailer_test 1 "--xmailer" &&
	do_xmailer_test 0 "--no-xmailer"

0001-add-master.patch
Sending        file
Transmitting file data .done
Committing transaction...
Committed revision 7.
ok 7 - commit another change from svn side

expecting success: 
	git reset --hard refs/remotes/git-svn &&
	echo new file >> new-file &&
	git update-index --add new-file &&
	git commit -a -m 'new file' &&
	echo clobber > file &&
	git commit -a -m 'clobber' &&
	test_must_fail git svn dcommit
	
HEAD is now at 4f4a1d5 more changes
[master d69048e] new file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 new-file
[master 4ae805e] clobber
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 4 deletions(-)
0001-add-master.patch
ok 134 - --[no-]xmailer without any configuration

expecting success: 
	test_config sendemail.xmailer true &&
	do_xmailer_test 1 "" &&
	do_xmailer_test 0 "--no-xmailer" &&
	do_xmailer_test 1 "--xmailer"

0001-add-master.patch
branch_from: /r9270/trunk => /r9270/trunk/subversion/bindings/swig/perl/native/t
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/r9270/trunk/subversion/bindings/swig/perl/native/t => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/r9270/drunk/subversion/bindings/swig/perl/native/t, 14
Found branch parent: (refs/remotes/r9270-d) 32f0bd381d809d3e3e74927a5fc08375a45e10ef
Following parent with do_switch
Successfully followed parent
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9106-git-svn-commit-diff-clobber/svnrepo ...
0001-add-master.patch
r15 = 8963a5b26e480acb7aeb50c878722148c0523d3b (refs/remotes/r9270-d)
	A	new-file
ok 9 - track initial change if it was only made to parent

expecting success: 
	(
		cd wc &&
		svn_cmd up &&
		svn_cmd mkdir stunk &&
		echo "trunk stunk" > stunk/readme &&
		svn_cmd add stunk/readme &&
		svn_cmd ci -m "trunk stunk" &&
		echo "stunk like junk" >> stunk/readme &&
		svn_cmd ci -m "really stunk" &&
		echo "stink stank stunk" >> stunk/readme &&
		svn_cmd ci -m "even the grinch agrees"
	) &&
	svn_cmd copy -m "stunk flunked" "$svnrepo"/stunk "$svnrepo"/flunk &&
	{ svn cp -m "early stunk flunked too" \
		"$svnrepo"/stunk@17 "$svnrepo"/flunked ||
	svn_cmd cp -m "early stunk flunked too" \
		-r17 "$svnrepo"/stunk "$svnrepo"/flunked; } &&
	git svn init --minimize-url -i stunk "$svnrepo"/stunk &&
	git svn fetch -i stunk &&
	git update-ref refs/remotes/flunk@18 refs/remotes/stunk~2 &&
	git update-ref -d refs/remotes/stunk &&
	git config --unset svn-remote.svn.fetch stunk &&
	mkdir -p "$GIT_DIR"/svn/refs/remotes/flunk@18 &&
	rev_map=$(cd "$GIT_DIR"/svn/refs/remotes/stunk && ls .rev_map*) &&
	dd if="$GIT_DIR"/svn/refs/remotes/stunk/$rev_map \
	   of="$GIT_DIR"/svn/refs/remotes/flunk@18/$rev_map bs=24 count=1 &&
	rm -rf "$GIT_DIR"/svn/refs/remotes/stunk &&
	git svn init --minimize-url -i flunk "$svnrepo"/flunk &&
	git svn fetch -i flunk &&
	git svn init --minimize-url -i stunk "$svnrepo"/stunk &&
	git svn fetch -i stunk &&
	git svn init --minimize-url -i flunked "$svnrepo"/flunked &&
	git svn fetch -i flunked &&
	test "`git rev-parse --verify refs/remotes/flunk@18`" \
	   = "`git rev-parse --verify refs/remotes/stunk`" &&
	test "`git rev-parse --verify refs/remotes/flunk~1`" \
	   = "`git rev-parse --verify refs/remotes/stunk`" &&
	test "`git rev-parse --verify refs/remotes/flunked~1`" \
	   = "`git rev-parse --verify refs/remotes/stunk~1`"
	
Updating '.':
A    another-larger
A    another-larger/trunk
A    another-larger/trunk/thunk
A    another-larger/trunk/thunk/bump
A    another-larger/trunk/thunk/bump/thud
A    another-larger/trunk/thunk/bump/thud/file
A    another-larger/trunk/readme
A    junk
A    junk/readme
A    larger-parent
A    larger-parent/trunk
A    larger-parent/trunk/thunk
A    larger-parent/trunk/thunk/bump
A    larger-parent/trunk/thunk/bump/thud
A    larger-parent/trunk/thunk/bump/thud/file
A    larger-parent/trunk/readme
A    r9270
A    r9270/drunk
A    r9270/drunk/subversion
A    r9270/drunk/subversion/bindings
A    r9270/drunk/subversion/bindings/swig
A    r9270/drunk/subversion/bindings/swig/perl
A    r9270/drunk/subversion/bindings/swig/perl/native
A    r9270/drunk/subversion/bindings/swig/perl/native/t
A    r9270/drunk/subversion/bindings/swig/perl/native/t/a.t
A    r9270/drunk/subversion/bindings/swig/perl/native/t/b.t
A    r9270/drunk/subversion/bindings/swig/perl/native/t/c.t
A    r9270/drunk/subversion/bindings/swig/perl/native/t/larger-parent
A    r9270/drunk/subversion/bindings/swig/perl/native/a.pm
A    r9270/drunk/subversion/bindings/swig/perl/native/b.pm
A    r9270/drunk/subversion/bindings/swig/perl/native/c.pm
A    r9270/drunk/subversion/bindings/swig/perl/another-larger
A    r9270/drunk/thunk
A    r9270/drunk/thunk/bump
A    r9270/drunk/thunk/bump/thud
A    r9270/drunk/thunk/bump/thud/file
A    r9270/drunk/readme
A    r9270/trunk
A    r9270/trunk/subversion
A    r9270/trunk/subversion/bindings
A    r9270/trunk/subversion/bindings/swig
A    r9270/trunk/subversion/bindings/swig/perl
A    r9270/trunk/subversion/bindings/swig/perl/native
A    r9270/trunk/subversion/bindings/swig/perl/native/t
A    r9270/trunk/subversion/bindings/swig/perl/native/t/a.t
A    r9270/trunk/subversion/bindings/swig/perl/native/t/b.t
A    r9270/trunk/subversion/bindings/swig/perl/native/t/c.t
A    r9270/trunk/subversion/bindings/swig/perl/native/t/larger-parent
A    r9270/trunk/subversion/bindings/swig/perl/native/a.pm
A    r9270/trunk/subversion/bindings/swig/perl/native/b.pm
A    r9270/trunk/subversion/bindings/swig/perl/native/c.pm
A    r9270/trunk/subversion/bindings/swig/perl/another-larger
A    r9270/trunk/thunk
A    r9270/trunk/thunk/bump
A    r9270/trunk/thunk/bump/thud
A    r9270/trunk/thunk/bump/thud/file
Committed r8
A    r9270/trunk/readme
Updated to revision 15.
A         stunk
A         stunk/readme
	M	file
	A	bar/zzz
	A	dir/a/b/c/d/e/file
	A	exec.sh
	A	foo
	A	foo.link
0001-add-master.patch
r7 = c79df5135001f048293483fc0f7cd982e214dc31 (refs/remotes/git-svn)
r1 = 84595e414a8a7a8c1ed30314d1d48662a9e3d249 (refs/remotes/alt)
	A	new-file
Adding         stunk
Adding         stunk/readme
Transmitting file data .done
Committing transaction...
r8 = a7d9604c91335a64818c9cd5b5bcdf9075d9a03f (refs/remotes/git-svn)
W: d69048efd1299b987ec1706e45143b86c155e107 and refs/remotes/git-svn differ, using rebase:
:100644 100644 b349877e032add143a5dc286d30e523181dea4ef fad4bec9888fc6883cc5a8447f365d44b8e4ebba M	file
	D	dir/a/b/c/d/e/file
	D	dir/a/
	A	dir/file
	A	file
W: -empty_dir: dir/a
r2 = da91e2afc6e62f4eff7138fea2fa33ce2c3dff00 (refs/remotes/alt)
First, rewinding head to replay your work on top of it...
Applying: clobber
	D	bar/zzz
	A	bar/zzz/yyy
Committed revision 16.
Using index info to reconstruct a base tree...
M	file
Falling back to patching base and 3-way merge...
Merging a7d9604c91335a64818c9cd5b5bcdf9075d9a03f with clobber
Merging:
a7d9604 new file
virtual clobber
found 1 common ancestor:
virtual 76ac259f7ab5e2e4bb7a2fecf07396a2695c68c9
Auto-merging file
CONFLICT (content): Merge conflict in file
error: Failed to merge in the changes.
Patch failed at 0001 clobber
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

rebase refs/remotes/git-svn: command returned error: 128

ok 8 - multiple dcommit from git svn will not clobber svn

expecting success: 
	test -d .git/rebase-apply

ok 9 - check that rebase really failed

expecting success: 
	echo clobber and I really mean it > file &&
	git update-index file &&
	git rebase --continue &&
	git svn dcommit
	
r3 = fc3c0824a7f4b5bcc3fe3b18e4299698f7052105 (refs/remotes/alt)
	M	exec.sh
Applying: clobber
r4 = b54ca6087c9a54394adc1aefbbcc3d0360c8ca16 (refs/remotes/alt)
Sending        stunk/readme
Transmitting file data .done
Committing transaction...
	M	exec.sh
r5 = d1ce8fd646ade443028b75f1fb31973fe2376b61 (refs/remotes/alt)
Committed revision 17.
	D	exec.sh
	A	exec.sh
W: -empty_dir: exec.sh
ok 135 - --[no-]xmailer with sendemail.xmailer=true

expecting success: 
	test_config sendemail.xmailer false &&
	do_xmailer_test 0 "" &&
	do_xmailer_test 0 "--no-xmailer" &&
	do_xmailer_test 1 "--xmailer"

0001-add-master.patch
r6 = 698fbae0b0ab1797b22d35ebcdc1e6db24d0c0a9 (refs/remotes/alt)
	A	exec-2.sh
	M	file
r7 = a85a0b58107b6706ace40105e16d9f5498add240 (refs/remotes/alt)
Sending        stunk/readme
Transmitting file data .done
Committing transaction...
	D	exec-2.sh
	A	exec-2.sh
W: -empty_dir: exec-2.sh
r8 = 1a7662ec0f489e155ee831b75c83c625dd6d9566 (refs/remotes/alt)
	A	bar/foo
Committed revision 18.
r9 = c64d3ef4686afa11e35bd979646d015eb2cc6ad9 (refs/remotes/alt)
	A	bar/d
Committing transaction...
r10 = 10dada74b755d48048a4d6879197f73e1d2a716d (refs/remotes/alt)
	A	bar/newdir/dir
0001-add-master.patch
r11 = b865f5d3627691b4ccb79205fa8572e261ef5081 (refs/remotes/alt)
Committed revision 19.
	M	bar/newdir/dir
r12 = 40147b523c113e0edd58a660d0826dfed87ab17a (refs/remotes/alt)
	A	bar/foo2
Committing transaction...
r13 = 1e70ca6eafa0043ac48bf5070dbe92e7917a0639 (refs/remotes/alt)
	M	bar/d
r14 = 526fe0e369bb483918d155cb812c9f5b53a3e5ad (refs/remotes/alt)
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9106-git-svn-commit-diff-clobber/svnrepo ...
Committed revision 20.
ok 25 - git-svn works in a bare repository

expecting success: 
	mkdir worktree gitdir &&
	( cd worktree &&
	git svn init "$svnrepo" &&
	git init --separate-git-dir ../gitdir &&
	git svn fetch ) &&
	rm -rf worktree gitdir
	
0001-add-master.patch
	M	file
Committed r9
	M	file
r9 = 3f797f668a7b770a8fd79f160b45227af4449c55 (refs/remotes/git-svn)
No changes between 402ff364f072919e9b3d9522e8f68f8e13e9861f and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
ok 10 - resolve, continue the rebase and dcommit

# passed all 10 test(s)
1..10
ok 136 - --[no-]xmailer with sendemail.xmailer=false

expecting success: 
	git send-email \
	--dry-run \
	--from="Example <from@example.com>" \
	--to="To 1 <to1@example.com>" \
	--to="to2@example.com" \
	--to="to3@example.com" \
	--cc="Cc 1 <cc1@example.com>" \
	--cc="Cc2 <cc2@example.com>" \
	--bcc="bcc1@example.com" \
	--bcc="bcc2@example.com" \
	0001-add-master.patch | replace_variable_fields \
	>expected-list

*** t9107-git-svn-migrate.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9107-git-svn-migrate/.git/
Using existing [svn-remote "svn"]
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/stunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9100-git-svn-basic/worktree/.git/
Reinitialized existing Git repository in /«PKGBUILDDIR»/t/trash directory.t9100-git-svn-basic/gitdir/
expecting success: 
	cp "$GIT_DIR"/config "$GIT_DIR"/config-old-git-svn &&
	mkdir import &&
	(
		cd import &&
		for i in trunk branches/a branches/b tags/0.1 tags/0.2 tags/0.3
		do
			mkdir -p $i &&
			echo hello >>$i/README ||
			exit 1
		done &&
		svn_cmd import -m test . "$svnrepo"
	) &&
	git svn init "$svnrepo" &&
	git svn fetch &&
	rm -rf "$GIT_DIR"/svn &&
	git update-ref refs/heads/git-svn-HEAD refs/${remotes_git_svn} &&
	git update-ref refs/heads/svn-HEAD refs/${remotes_git_svn} &&
	git update-ref -d refs/${remotes_git_svn} refs/${remotes_git_svn}
	
ok 137 - setup expected-list

expecting success: 
	git send-email \
	--dry-run \
	--from="Example <from@example.com>" \
	--to="To 1 <to1@example.com>, to2@example.com" \
	--to="to3@example.com" \
	--cc="Cc 1 <cc1@example.com>, Cc2 <cc2@example.com>" \
	--bcc="bcc1@example.com, bcc2@example.com" \
	0001-add-master.patch | replace_variable_fields \
	>actual-list &&
	test_cmp expected-list actual-list

Adding         branches
Adding         branches/a
Adding         branches/a/README
Adding         branches/b
Adding         branches/b/README
Adding         tags
Adding         tags/0.1
Adding         tags/0.1/README
Adding         tags/0.2
Adding         tags/0.2/README
Adding         tags/0.3
Adding         tags/0.3/README
Adding         trunk
Adding         trunk/README
Committing transaction...
Committed revision 1.
ok 138 - use email list in --cc --to and --bcc

expecting success: 
	echo "alias to2 to2@example.com" >.mutt &&
	echo "alias cc1 Cc 1 <cc1@example.com>" >>.mutt &&
	test_config sendemail.aliasesfile ".mutt" &&
	test_config sendemail.aliasfiletype mutt &&
	git send-email \
	--dry-run \
	--from="Example <from@example.com>" \
	--to="To 1 <to1@example.com>, to2, to3@example.com" \
	--cc="cc1, Cc2 <cc2@example.com>" \
	--bcc="bcc1@example.com, bcc2@example.com" \
	0001-add-master.patch | replace_variable_fields \
	>actual-list &&
	test_cmp expected-list actual-list

	A	bar/zzz
	A	dir/a/b/c/d/e/file
	A	exec.sh
	A	foo
	A	foo.link
r1 = 84595e414a8a7a8c1ed30314d1d48662a9e3d249 (refs/remotes/alt)
ok 139 - aliases work with email list

	D	dir/a/b/c/d/e/file
	D	dir/a/
expecting success: 
	echo "alias to2 to2@example.com" >.mutt &&
	echo "alias cc1 Cc 1 <cc1@example.com>" >>.mutt &&
	test_config sendemail.aliasesfile ".mutt" &&
	test_config sendemail.aliasfiletype mutt &&
	TO1=$(echo "QTo 1 <to1@example.com>" | q_to_tab) &&
	TO2=$(echo "QZto2" | qz_to_tab_space) &&
	CC1=$(echo "cc1" | append_cr) &&
	BCC1=$(echo "Q bcc1@example.com Q" | q_to_nul) &&
	git send-email \
	--dry-run \
	--from="	Example <from@example.com>" \
	--to="$TO1" \
	--to="$TO2" \
	--to="  to3@example.com   " \
	--cc="$CC1" \
	--cc="Cc2 <cc2@example.com>" \
	--bcc="$BCC1" \
	--bcc="bcc2@example.com" \
	0001-add-master.patch | replace_variable_fields \
	>actual-list &&
	test_cmp expected-list actual-list

	A	dir/file
	A	file
W: -empty_dir: dir/a
r2 = da91e2afc6e62f4eff7138fea2fa33ce2c3dff00 (refs/remotes/alt)
	D	bar/zzz
	A	bar/zzz/yyy
r3 = fc3c0824a7f4b5bcc3fe3b18e4299698f7052105 (refs/remotes/alt)
	M	exec.sh
	A	readme
r4 = b54ca6087c9a54394adc1aefbbcc3d0360c8ca16 (refs/remotes/alt)
r16 = a1d7e90631bb6f232b351c782befaf2bfdf262f4 (refs/remotes/stunk)
	M	exec.sh
r5 = d1ce8fd646ade443028b75f1fb31973fe2376b61 (refs/remotes/alt)
	M	readme
r17 = 6b9823cdde0b54372e1515e9f4aa19c95cb2050a (refs/remotes/stunk)
	D	exec.sh
	A	exec.sh
W: -empty_dir: exec.sh
r6 = 698fbae0b0ab1797b22d35ebcdc1e6db24d0c0a9 (refs/remotes/alt)
	M	readme
	A	exec-2.sh
	M	file
r18 = 68022ce1a2dc36ba724a42d2794203c629932da1 (refs/remotes/stunk)
r7 = a85a0b58107b6706ace40105e16d9f5498add240 (refs/remotes/alt)
ok 140 - leading and trailing whitespaces are removed

# passed all 140 test(s)
1..140
*** t9108-git-svn-glob.sh ***
	D	exec-2.sh
	A	exec-2.sh
W: -empty_dir: exec-2.sh
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9108-git-svn-glob/.git/
r8 = 1a7662ec0f489e155ee831b75c83c625dd6d9566 (refs/remotes/alt)
1+0 records in
1+0 records out
24 bytes (24 B) copied, 0.00133433 s, 18.0 kB/s
	A	bar/foo
r9 = c64d3ef4686afa11e35bd979646d015eb2cc6ad9 (refs/remotes/alt)
	A	bar/d
r10 = 10dada74b755d48048a4d6879197f73e1d2a716d (refs/remotes/alt)
	A	bar/newdir/dir
r11 = b865f5d3627691b4ccb79205fa8572e261ef5081 (refs/remotes/alt)
	M	bar/newdir/dir
r12 = 40147b523c113e0edd58a660d0826dfed87ab17a (refs/remotes/alt)
expecting success: 
	mkdir -p trunk/src/a trunk/src/b trunk/doc &&
	echo "hello world" > trunk/src/a/readme &&
	echo "goodbye world" > trunk/src/b/readme &&
	svn_cmd import -m "initial" trunk "$svnrepo"/trunk &&
	svn_cmd co "$svnrepo" tmp &&
	(
		cd tmp &&
		mkdir branches tags &&
		svn_cmd add branches tags &&
		svn_cmd cp trunk branches/start &&
		svn_cmd commit -m "start a new branch" &&
		svn_cmd up &&
		echo "hi" >> branches/start/src/b/readme &&
		poke branches/start/src/b/readme &&
		echo "hey" >> branches/start/src/a/readme &&
		poke branches/start/src/a/readme &&
		svn_cmd commit -m "hi" &&
		svn_cmd up &&
		svn_cmd cp branches/start tags/end &&
		echo "bye" >> tags/end/src/b/readme &&
		poke tags/end/src/b/readme &&
		echo "aye" >> tags/end/src/a/readme &&
		poke tags/end/src/a/readme &&
		svn_cmd commit -m "the end" &&
		echo "byebye" >> tags/end/src/b/readme &&
		poke tags/end/src/b/readme &&
		svn_cmd commit -m "nothing to see here"
	) &&
	git config --add svn-remote.svn.url "$svnrepo" &&
	git config --add svn-remote.svn.fetch \
	                 "trunk/src/a:refs/remotes/trunk" &&
	git config --add svn-remote.svn.branches \
	                 "branches/*/src/a:refs/remotes/branches/*" &&
	git config --add svn-remote.svn.tags\
	                 "tags/*/src/a:refs/remotes/tags/*" &&
	git svn multi-fetch &&
	git log --pretty=oneline refs/remotes/tags/end | \
	    sed -e "s/^.\{41\}//" > output.end &&
	test_cmp expect.end output.end &&
	test "`git rev-parse refs/remotes/tags/end~1`" = \
		"`git rev-parse refs/remotes/branches/start`" &&
	test "`git rev-parse refs/remotes/branches/start~2`" = \
		"`git rev-parse refs/remotes/trunk`" &&
	test_must_fail git rev-parse refs/remotes/tags/end@3
	
	A	bar/foo2
r13 = 1e70ca6eafa0043ac48bf5070dbe92e7917a0639 (refs/remotes/alt)
Adding         trunk/doc
Adding         trunk/src
Adding         trunk/src/a
Adding         trunk/src/a/readme
	M	bar/d
Adding         trunk/src/b
Adding         trunk/src/b/readme
Committing transaction...
r14 = 526fe0e369bb483918d155cb812c9f5b53a3e5ad (refs/remotes/alt)
ok 26 - git-svn works in in a repository with a gitdir: link

# passed all 26 test(s)
1..26
	A	branches/a/README
	A	branches/b/README
	A	tags/0.1/README
	A	tags/0.2/README
	A	tags/0.3/README
	A	trunk/README
Committed revision 1.
*** t9109-git-svn-multi-glob.sh ***
r1 = 7648c8e7c568d64aeb194f186a7e4ed3e8fdc2f7 (refs/remotes/git-svn)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9109-git-svn-multi-glob/.git/
A    tmp/trunk
A    tmp/trunk/doc
A    tmp/trunk/src
A    tmp/trunk/src/a
A    tmp/trunk/src/a/readme
A    tmp/trunk/src/b
A    tmp/trunk/src/b/readme
Checked out revision 1.
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9107-git-svn-migrate/svnrepo r1
A         branches
A         tags
Using existing [svn-remote "svn"]
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/flunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo
ok 1 - setup old-looking metadata

A         branches/start
expecting success: test -n '7648c8e7c568d64aeb194f186a7e4ed3e8fdc2f7'
ok 2 - git-svn-HEAD is a real HEAD

expecting success: 
	mkdir -p "$GIT_DIR"/git-svn/info "$GIT_DIR"/svn/info &&
	echo "$svnrepo" > "$GIT_DIR"/git-svn/info/url &&
	echo "$svnrepo" > "$GIT_DIR"/svn/info/url &&
	git svn migrate &&
	! test -d "$GIT_DIR"/git-svn &&
	git rev-parse --verify refs/${remotes_git_svn}^0 &&
	git rev-parse --verify refs/remotes/svn^0 &&
	test "$(git config --get svn-remote.svn.url)" = "$svnrepo_escaped" &&
	test `git config --get svn-remote.svn.fetch` = \
             ":refs/${remotes_git_svn}"
	
Adding         branches
Adding         branches/start
Adding         tags
Committing transaction...
expecting success: 
	mkdir -p trunk/src/a trunk/src/b trunk/doc &&
	echo "hello world" > trunk/src/a/readme &&
	echo "goodbye world" > trunk/src/b/readme &&
	svn_cmd import -m "initial" trunk "$svnrepo"/trunk &&
	svn_cmd co "$svnrepo" tmp &&
	(
		cd tmp &&
		mkdir branches branches/v1 tags &&
		svn_cmd add branches tags &&
		svn_cmd cp trunk branches/v1/start &&
		svn_cmd commit -m "start a new branch" &&
		svn_cmd up &&
		echo "hi" >> branches/v1/start/src/b/readme &&
		poke branches/v1/start/src/b/readme &&
		echo "hey" >> branches/v1/start/src/a/readme &&
		poke branches/v1/start/src/a/readme &&
		svn_cmd commit -m "hi" &&
		svn_cmd up &&
		svn_cmd cp branches/v1/start tags/end &&
		echo "bye" >> tags/end/src/b/readme &&
		poke tags/end/src/b/readme &&
		echo "aye" >> tags/end/src/a/readme &&
		poke tags/end/src/a/readme &&
		svn_cmd commit -m "the end" &&
		echo "byebye" >> tags/end/src/b/readme &&
		poke tags/end/src/b/readme &&
		svn_cmd commit -m "nothing to see here"
	) &&
	git config --add svn-remote.svn.url "$svnrepo" &&
	git config --add svn-remote.svn.fetch \
	                 "trunk/src/a:refs/remotes/trunk" &&
	git config --add svn-remote.svn.branches \
	                 "branches/*/*/src/a:refs/remotes/branches/*/*" &&
	git config --add svn-remote.svn.tags\
	                 "tags/*/src/a:refs/remotes/tags/*" &&
	git svn multi-fetch &&
	git log --pretty=oneline refs/remotes/tags/end | \
	    sed -e "s/^.\{41\}//" > output.end &&
	test_cmp expect.end output.end &&
	test "`git rev-parse refs/remotes/tags/end~1`" = \
		"`git rev-parse refs/remotes/branches/v1/start`" &&
	test "`git rev-parse refs/remotes/branches/v1/start~2`" = \
		"`git rev-parse refs/remotes/trunk`" &&
	test_must_fail git rev-parse refs/remotes/tags/end@3
	
Committed revision 2.
Updating '.':
At revision 2.
Adding         trunk/doc
Adding         trunk/src
Adding         trunk/src/a
Adding         trunk/src/a/readme
Adding         trunk/src/b
Adding         trunk/src/b/readme
Committing transaction...
Sending        branches/start/src/a/readme
Sending        branches/start/src/b/readme
Transmitting file data ..done
Committing transaction...
Migrating from v0 layout...
Renaming ref: refs/heads/git-svn-HEAD => refs/remotes/git-svn
Renaming ref: refs/heads/svn-HEAD => refs/remotes/svn
Done migrating from v0 layout...
Migrating from a git-svn v1 layout...
Data from a previous version of git-svn exists, but
	.git/svn
	(required for this version (2.6.4) of git-svn) does not exist.
 - .git/git-svn => .git/svn/git-svn
 - .git/svn/info => .git/svn/svn/info
Done migrating from a git-svn v1 layout
7648c8e7c568d64aeb194f186a7e4ed3e8fdc2f7
7648c8e7c568d64aeb194f186a7e4ed3e8fdc2f7
ok 3 - initialize old-style (v0) git svn layout

expecting success: 
	git svn init "$svnrepo" -T trunk -t tags -b branches &&
	git config --get-all svn-remote.svn.fetch > fetch.out &&
	grep "^trunk:refs/remotes/origin/trunk$" fetch.out &&
	test -n "`git config --get svn-remote.svn.branches \
	            "^branches/\*:refs/remotes/origin/\*$"`" &&
	test -n "`git config --get svn-remote.svn.tags \
	            "^tags/\*:refs/remotes/origin/tags/\*$"`" &&
	git config --unset svn-remote.svn.branches \
	                        "^branches/\*:refs/remotes/origin/\*$" &&
	git config --unset svn-remote.svn.tags \
	                        "^tags/\*:refs/remotes/origin/tags/\*$" &&
	git config --add svn-remote.svn.fetch "branches/a:refs/remotes/origin/a" &&
	git config --add svn-remote.svn.fetch "branches/b:refs/remotes/origin/b" &&
	for i in tags/0.1 tags/0.2 tags/0.3; do
		git config --add svn-remote.svn.fetch \
		                 $i:refs/remotes/origin/$i || exit 1; done &&
	git config --get-all svn-remote.svn.fetch > fetch.out &&
	grep "^trunk:refs/remotes/origin/trunk$" fetch.out &&
	grep "^branches/a:refs/remotes/origin/a$" fetch.out &&
	grep "^branches/b:refs/remotes/origin/b$" fetch.out &&
	grep "^tags/0\.1:refs/remotes/origin/tags/0\.1$" fetch.out &&
	grep "^tags/0\.2:refs/remotes/origin/tags/0\.2$" fetch.out &&
	grep "^tags/0\.3:refs/remotes/origin/tags/0\.3$" fetch.out &&
	grep "^:refs/${remotes_git_svn}" fetch.out
	
Committed revision 1.
A    tmp/trunk
A    tmp/trunk/doc
A    tmp/trunk/src
A    tmp/trunk/src/a
A    tmp/trunk/src/a/readme
Committed revision 3.
A    tmp/trunk/src/b
A    tmp/trunk/src/b/readme
Checked out revision 1.
Updating '.':
A         branches
A         branches/v1
A         tags
At revision 3.
A         branches/v1/start
A         tags/end
Adding         branches
Adding         branches/v1
Adding         branches/v1/start
Adding         tags
Committing transaction...
Adding         tags/end
Sending        tags/end/src/a/readme
Sending        tags/end/src/b/readme
Transmitting file data ..done
Committing transaction...
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/stunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/flunk, 18
Committed revision 2.
Updating '.':
Committed revision 4.
At revision 2.
Initializing parent: refs/remotes/flunk@18
	M	readme
Using existing [svn-remote "svn"]
r17 = 6b9823cdde0b54372e1515e9f4aa19c95cb2050a (refs/remotes/flunk@18)
Sending        branches/v1/start/src/a/readme
Sending        branches/v1/start/src/b/readme
Transmitting file data ..Sending        tags/end/src/b/readme
Transmitting file data .done
Committing transaction...
done
Committing transaction...
	M	readme
r18 = 68022ce1a2dc36ba724a42d2794203c629932da1 (refs/remotes/flunk@18)
trunk:refs/remotes/origin/trunk
Found branch parent: (refs/remotes/flunk) 68022ce1a2dc36ba724a42d2794203c629932da1
Following parent with do_switch
trunk:refs/remotes/origin/trunk
branches/a:refs/remotes/origin/a
branches/b:refs/remotes/origin/b
tags/0.1:refs/remotes/origin/tags/0.1
tags/0.2:refs/remotes/origin/tags/0.2
tags/0.3:refs/remotes/origin/tags/0.3
:refs/remotes/git-svn
Successfully followed parent
ok 4 - initialize a multi-repository repo

expecting success: 
	git svn multi-fetch &&
	for i in trunk a b tags/0.1 tags/0.2 tags/0.3; do
		git rev-parse --verify refs/remotes/origin/$i^0 >> refs.out || exit 1;
	    done &&
	test -z "`sort < refs.out | uniq -d`" &&
	for i in trunk a b tags/0.1 tags/0.2 tags/0.3; do
	  for j in trunk a b tags/0.1 tags/0.2 tags/0.3; do
		if test $j != $i; then continue; fi
	    test -z "`git diff refs/remotes/origin/$i 	                         refs/remotes/origin/$j`" ||exit 1; done; done
	
r19 = dd0361dba3758b07edb4ab3a62040482802ee315 (refs/remotes/flunk)
Committed revision 3.
Committed revision 5.
Updating '.':
At revision 3.
A         tags/end
Adding         tags/end
Sending        tags/end/src/a/readme
Sending        tags/end/src/b/readme
Transmitting file data ..done
Committing transaction...
Committed revision 4.
Sending        tags/end/src/b/readme
Transmitting file data .done
Committing transaction...
Rebuilding .git/svn/git-svn/.rev_map.b7ead112-5643-4770-8379-3668b894bc83 ...
r1 = 7648c8e7c568d64aeb194f186a7e4ed3e8fdc2f7
Done rebuilding .git/svn/git-svn/.rev_map.b7ead112-5643-4770-8379-3668b894bc83
Using existing [svn-remote "svn"]
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/stunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo
Migrating from a git-svn v1 layout...
Data from a previous version of git-svn exists, but
	.git/svn
	(required for this version (2.6.4) of git-svn) does not exist.
Done migrating from a git-svn v1 layout
Committed revision 5.
	A	readme
	A	README
r1 = 92ae8345d919f33caa2a3b7f4da20ca9d0b920e5 (refs/remotes/trunk)
r1 = 45f84b828fb4133d5f138bbfbdd2ec94c650c700 (refs/remotes/origin/b)
	A	README
branch_from: /trunk => /trunk/src/a
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9108-git-svn-glob/svnrepo/trunk/src/a => file:///«PKGBUILDDIR»/t/trash%20directory.t9108-git-svn-glob/svnrepo/branches/start/src/a, 1
Found branch parent: (refs/remotes/branches/start) 92ae8345d919f33caa2a3b7f4da20ca9d0b920e5
r1 = c8f411bfafa224905d9baccf7c85bcb742811032 (refs/remotes/origin/tags/0.1)
Following parent with do_switch
Successfully followed parent
	A	README
r2 = 438952e5e89fc57a33544b5f8e224c8601156dcd (refs/remotes/branches/start)
r1 = 2f3c33e20d9d1ab77f96be8ae249db4dc7e1fa29 (refs/remotes/origin/trunk)
	A	README
	M	readme
r3 = 5ae6fb47f26eeadc43245f88aa4935330fa9122f (refs/remotes/branches/start)
r1 = 1aed99119a365703d6bd6757aaa266b0a7eb00f0 (refs/remotes/origin/a)
branch_from: /branches/start => /branches/start/src/a
	A	README
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9108-git-svn-glob/svnrepo/branches/start/src/a => file:///«PKGBUILDDIR»/t/trash%20directory.t9108-git-svn-glob/svnrepo/tags/end/src/a, 3
Found branch parent: (refs/remotes/tags/end) 5ae6fb47f26eeadc43245f88aa4935330fa9122f
r1 = 57cc464e9cc130e6b50c77dcac57b505833e1247 (refs/remotes/origin/tags/0.3)
Migrating from a git-svn v1 layout...
Data from a previous version of git-svn exists, but
	.git/svn
	(required for this version (2.6.4) of git-svn) does not exist.
Done migrating from a git-svn v1 layout
Following parent with do_switch
	A	README
	M	readme
Successfully followed parent
r1 = 364e9094781858891388a3f7d9f16f81bb53736c (refs/remotes/origin/tags/0.2)
r4 = 2895281b6ef263529e5049b8a3439d33c609eb82 (refs/remotes/tags/end)
	A	readme
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9108-git-svn-glob/svnrepo/trunk/src/a r1
r1 = a76115a838a11efbc0c82519baa4d2a6d8df6efb (refs/remotes/trunk)
ok 5 - multi-fetch works on partial urls + paths

expecting success: 
	git config --unset-all svn-remote.svn.fetch &&
	git config --unset-all svn-remote.svn.url &&
	rm -rf "$GIT_DIR"/svn &&
	for i in `cat fetch.out`; do
		path=`expr $i : "\([^:]*\):.*$"`
		ref=`expr $i : "[^:]*:\(refs/remotes/.*\)$"`
		if test -z "$ref"; then continue; fi
		if test -n "$path"; then path="/$path"; fi
		( mkdir -p "$GIT_DIR"/svn/$ref/info/ &&
		echo "$svnrepo"$path > "$GIT_DIR"/svn/$ref/info/url ) || exit 1;
	done &&
	git svn migrate --minimize &&
	test -z "`git config -l | grep "^svn-remote\.git-svn\."`" &&
	git config --get-all svn-remote.svn.fetch > fetch.out &&
	grep "^trunk:refs/remotes/origin/trunk$" fetch.out &&
	grep "^branches/a:refs/remotes/origin/a$" fetch.out &&
	grep "^branches/b:refs/remotes/origin/b$" fetch.out &&
	grep "^tags/0\.1:refs/remotes/origin/tags/0\.1$" fetch.out &&
	grep "^tags/0\.2:refs/remotes/origin/tags/0\.2$" fetch.out &&
	grep "^tags/0\.3:refs/remotes/origin/tags/0\.3$" fetch.out &&
	grep "^:refs/${remotes_git_svn}" fetch.out
	
fatal: ambiguous argument 'refs/remotes/tags/end@3': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
refs/remotes/tags/end@3
ok 1 - test refspec globbing

expecting success: 
	git config --add svn-remote.two.url "$svnrepo" &&
	git config --add svn-remote.two.fetch trunk:refs/remotes/two/trunk &&
	git config --add svn-remote.two.branches \
	                 "branches/*:refs/remotes/two/branches/*" &&
	git config --add svn-remote.two.tags \
	                 "tags/*:refs/remotes/two/tags/*" &&
	(
		cd tmp &&
		echo "try try" >> tags/end/src/b/readme &&
		poke tags/end/src/b/readme &&
		svn_cmd commit -m "try to try"
	) &&
	git svn fetch two &&
	test `git rev-list refs/remotes/two/tags/end | wc -l` -eq 6 &&
	test `git rev-list refs/remotes/two/branches/start | wc -l` -eq 3 &&
	test `git rev-parse refs/remotes/two/branches/start~2` = \
	     `git rev-parse refs/remotes/two/trunk` &&
	test `git rev-parse refs/remotes/two/tags/end~3` = \
	     `git rev-parse refs/remotes/two/branches/start` &&
	git log --pretty=oneline refs/remotes/two/tags/end | \
	    sed -e "s/^.\{41\}//" > output.two &&
	test_cmp expect.two output.two
	
branch_from: /trunk => /trunk/src/a
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9109-git-svn-multi-glob/svnrepo/trunk/src/a => file:///«PKGBUILDDIR»/t/trash%20directory.t9109-git-svn-multi-glob/svnrepo/branches/v1/start/src/a, 1
Found branch parent: (refs/remotes/branches/v1/start) a76115a838a11efbc0c82519baa4d2a6d8df6efb
Following parent with do_switch
Sending        tags/end/src/b/readme
Successfully followed parent
Transmitting file data .done
Committing transaction...
r2 = 39769c5ddb34ccccbf1a20613a61e40f165d54c4 (refs/remotes/branches/v1/start)
	M	readme
Committed revision 6.
r3 = 3658fe65e3e8ee8adc9ee4d56773565d8ed7f59b (refs/remotes/branches/v1/start)
branch_from: /branches/v1/start => /branches/v1/start/src/a
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9109-git-svn-multi-glob/svnrepo/branches/v1/start/src/a => file:///«PKGBUILDDIR»/t/trash%20directory.t9109-git-svn-multi-glob/svnrepo/tags/end/src/a, 3
	A	readme
Found branch parent: (refs/remotes/tags/end) 3658fe65e3e8ee8adc9ee4d56773565d8ed7f59b
Following parent with do_switch
r16 = a1d7e90631bb6f232b351c782befaf2bfdf262f4 (refs/remotes/stunk)
	M	readme
Successfully followed parent
	M	readme
r4r17 = 14a89449202a7bd456e086183ed35440fcbda20e (refs/remotes/tags/end)
 = 6b9823cdde0b54372e1515e9f4aa19c95cb2050a (refs/remotes/stunk)
	M	readme
r18 = 68022ce1a2dc36ba724a42d2794203c629932da1 (refs/remotes/stunk)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9109-git-svn-multi-glob/svnrepo/trunk/src/a r1
fatal: ambiguous argument 'refs/remotes/tags/end@3': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
refs/remotes/tags/end@3
ok 1 - test refspec globbing

expecting success: 
	git config --add svn-remote.two.url "$svnrepo" &&
	git config --add svn-remote.two.fetch trunk:refs/remotes/two/trunk &&
	git config --add svn-remote.two.branches \
	                 "branches/*/*:refs/remotes/two/branches/*/*" &&
	git config --add svn-remote.two.tags \
	                 "tags/*:refs/remotes/two/tags/*" &&
	(
		cd tmp &&
		echo "try try" >> tags/end/src/b/readme &&
		poke tags/end/src/b/readme &&
		svn_cmd commit -m "try to try"
	) &&
	git svn fetch two &&
	test `git rev-list refs/remotes/two/tags/end | wc -l` -eq 6 &&
	test `git rev-list refs/remotes/two/branches/v1/start | wc -l` -eq 3 &&
	test `git rev-parse refs/remotes/two/branches/v1/start~2` = \
	     `git rev-parse refs/remotes/two/trunk` &&
	test `git rev-parse refs/remotes/two/tags/end~3` = \
	     `git rev-parse refs/remotes/two/branches/v1/start` &&
	git log --pretty=oneline refs/remotes/two/tags/end | \
	    sed -e "s/^.\{41\}//" > output.two &&
	test_cmp expect.two output.two
	
Using existing [svn-remote "svn"]
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9107-git-svn-migrate/svnrepo/branches/a => file:///«PKGBUILDDIR»/t/trash%20directory.t9107-git-svn-migrate/svnrepo
Using existing [svn-remote "svn"]
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9107-git-svn-migrate/svnrepo/branches/b => file:///«PKGBUILDDIR»/t/trash%20directory.t9107-git-svn-migrate/svnrepo
Using existing [svn-remote "svn"]
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9107-git-svn-migrate/svnrepo/tags/0.1 => file:///«PKGBUILDDIR»/t/trash%20directory.t9107-git-svn-migrate/svnrepo
Using existing [svn-remote "svn"]
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9107-git-svn-migrate/svnrepo/tags/0.2 => file:///«PKGBUILDDIR»/t/trash%20directory.t9107-git-svn-migrate/svnrepo
Using existing [svn-remote "svn"]
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9107-git-svn-migrate/svnrepo/tags/0.3 => file:///«PKGBUILDDIR»/t/trash%20directory.t9107-git-svn-migrate/svnrepo
Sending        tags/end/src/b/readme
Transmitting file data .done
Committing transaction...
Using existing [svn-remote "svn"]
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9107-git-svn-migrate/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9107-git-svn-migrate/svnrepo
trunk:refs/remotes/origin/trunk
branches/a:refs/remotes/origin/a
branches/b:refs/remotes/origin/b
tags/0.1:refs/remotes/origin/tags/0.1
tags/0.2:refs/remotes/origin/tags/0.2
tags/0.3:refs/remotes/origin/tags/0.3
:refs/remotes/git-svn
ok 6 - migrate --minimize on old inited layout

expecting success: 
	git svn fetch -i trunk &&
	test -z "$(ls "$GIT_DIR"/svn/refs/remotes/origin/trunk/.rev_db.* 2>/dev/null)" &&
	expect="$(ls "$GIT_DIR"/svn/refs/remotes/origin/trunk/.rev_map.*)" &&
	test -n "$expect" &&
	rev_db="$(echo $expect | sed -e "s,_map,_db,")" &&
	convert_to_rev_db "$expect" "$rev_db" &&
	rm -f "$expect" &&
	test -f "$rev_db" &&
	git svn fetch -i trunk &&
	test -z "$(ls "$GIT_DIR"/svn/refs/remotes/origin/trunk/.rev_db.* 2>/dev/null)" &&
	test ! -e "$GIT_DIR"/svn/refs/remotes/origin/trunk/.rev_db &&
	test -f "$expect"
	
Committed revision 6.
	A	src/a/readme
	A	src/b/readme
W: +empty_dir: trunk/doc
r1 = 8d0f45ea34893322f13660fff55e418f5305ca8d (refs/remotes/two/trunk)
Using existing [svn-remote "svn"]
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/flunked => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9108-git-svn-glob/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9108-git-svn-glob/svnrepo/branches/start, 1
Found branch parent: (refs/remotes/two/branches/start) 8d0f45ea34893322f13660fff55e418f5305ca8d
Following parent with do_switch
Successfully followed parent
r2 = 95b90ea37c959ec19df77d65ff14379283dff98d (refs/remotes/two/branches/start)
	M	src/a/readme
	M	src/b/readme
r3 = e879af74268d311d196feb02ee3da47d7268ca40 (refs/remotes/two/branches/start)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9108-git-svn-glob/svnrepo/branches/start => file:///«PKGBUILDDIR»/t/trash%20directory.t9108-git-svn-glob/svnrepo/tags/end, 3
Found branch parent: (refs/remotes/two/tags/end) e879af74268d311d196feb02ee3da47d7268ca40
Following parent with do_switch
Rebuilding .git/svn/refs/remotes/git-svn/.rev_map.b7ead112-5643-4770-8379-3668b894bc83 ...
r1 = 7648c8e7c568d64aeb194f186a7e4ed3e8fdc2f7
Done rebuilding .git/svn/refs/remotes/git-svn/.rev_map.b7ead112-5643-4770-8379-3668b894bc83
	M	src/a/readme
	M	src/b/readme
Successfully followed parent
Rebuilding .git/svn/refs/remotes/origin/a/.rev_map.b7ead112-5643-4770-8379-3668b894bc83 ...
r1 = 1aed99119a365703d6bd6757aaa266b0a7eb00f0
Done rebuilding .git/svn/refs/remotes/origin/a/.rev_map.b7ead112-5643-4770-8379-3668b894bc83
r4 = d8ec44dad34c1599658f367a721af91d75e4d428 (refs/remotes/two/tags/end)
Rebuilding .git/svn/refs/remotes/origin/b/.rev_map.b7ead112-5643-4770-8379-3668b894bc83 ...
	A	src/a/readme
r1 = 45f84b828fb4133d5f138bbfbdd2ec94c650c700
Done rebuilding .git/svn/refs/remotes/origin/b/.rev_map.b7ead112-5643-4770-8379-3668b894bc83
	A	src/b/readme
W: +empty_dir: trunk/doc
Rebuilding .git/svn/refs/remotes/origin/tags/0.1/.rev_map.b7ead112-5643-4770-8379-3668b894bc83 ...
r1 = c8f411bfafa224905d9baccf7c85bcb742811032
Done rebuilding .git/svn/refs/remotes/origin/tags/0.1/.rev_map.b7ead112-5643-4770-8379-3668b894bc83
	M	src/b/readme
r1 = 1c7e8c0d7372a2e5c0b6a5aabca7bc88b3d836bf (refs/remotes/two/trunk)
Rebuilding .git/svn/refs/remotes/origin/tags/0.2/.rev_map.b7ead112-5643-4770-8379-3668b894bc83 ...
r5 = bd99bc1c8cdd147824325f46c6885a6e8068628d (refs/remotes/two/tags/end)
r1 = 364e9094781858891388a3f7d9f16f81bb53736c
Done rebuilding .git/svn/refs/remotes/origin/tags/0.2/.rev_map.b7ead112-5643-4770-8379-3668b894bc83
Rebuilding .git/svn/refs/remotes/origin/tags/0.3/.rev_map.b7ead112-5643-4770-8379-3668b894bc83 ...
r1 = 57cc464e9cc130e6b50c77dcac57b505833e1247
Done rebuilding .git/svn/refs/remotes/origin/tags/0.3/.rev_map.b7ead112-5643-4770-8379-3668b894bc83
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9109-git-svn-multi-glob/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9109-git-svn-multi-glob/svnrepo/branches/v1/start, 1
	M	src/b/readme
Rebuilding .git/svn/refs/remotes/origin/trunk/.rev_map.b7ead112-5643-4770-8379-3668b894bc83 ...
r6 = 92405217cb87ee0537dfed5126dc6385bcf65551 (refs/remotes/two/tags/end)
r1 = 2f3c33e20d9d1ab77f96be8ae249db4dc7e1fa29
Done rebuilding .git/svn/refs/remotes/origin/trunk/.rev_map.b7ead112-5643-4770-8379-3668b894bc83
Found branch parent: (refs/remotes/two/branches/v1/start) 1c7e8c0d7372a2e5c0b6a5aabca7bc88b3d836bf
Following parent with do_switch
Successfully followed parent
ok 2 - test left-hand-side only globbing

expecting success: 
	git config --add svn-remote.three.url "$svnrepo" &&
	git config --add svn-remote.three.fetch \
	                 trunk:refs/remotes/three/trunk &&
	git config --add svn-remote.three.branches \
	                 "branches/*/t/*:refs/remotes/three/branches/*" &&
	git config --add svn-remote.three.tags \
	                 "tags/*/*:refs/remotes/three/tags/*" &&
	(
		cd tmp &&
		echo "try try" >> tags/end/src/b/readme &&
		poke tags/end/src/b/readme &&
		svn_cmd commit -m "try to try"
	) &&
	test_must_fail git svn fetch three 2> stderr.three &&
	test_cmp expect.three stderr.three
	
r2 = 62ebdfd58c025ccbbfea0291b4317a457d158d99 (refs/remotes/two/branches/v1/start)
	M	src/a/readme
	M	src/b/readme
Sending        tags/end/src/b/readme
Transmitting file data .r3 = fb25e1149c7affd669f738ff91072a0aa1d64de2 (refs/remotes/two/branches/v1/start)
done
Committing transaction...
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9109-git-svn-multi-glob/svnrepo/branches/v1/start => file:///«PKGBUILDDIR»/t/trash%20directory.t9109-git-svn-multi-glob/svnrepo/tags/end, 3
Committed revision 7.
Found branch parent: (refs/remotes/two/tags/end) fb25e1149c7affd669f738ff91072a0aa1d64de2
Following parent with do_switch
	M	src/a/readme
	M	src/b/readme
Successfully followed parent
r4 = 3c2c6382c382e0d958a512655e161576b674e6de (refs/remotes/two/tags/end)
	M	src/b/readme
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/stunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/flunked, 17
r5 = 7520e7983a314b268483120830dd10bd10974a79 (refs/remotes/two/tags/end)
Found branch parent: (refs/remotes/flunked) 6b9823cdde0b54372e1515e9f4aa19c95cb2050a
Following parent with do_switch
	M	src/b/readme
Successfully followed parent
r6 = 73c43bc56a0ddefc4fccc98c7cc153114f6b56fc (refs/remotes/two/tags/end)
r20 = 276920a0c2d56d828a84a6d4c6056eea424a6802 (refs/remotes/flunked)
ok 2 - test left-hand-side only globbing

expecting success: 
	(
		cd tmp &&
		mkdir branches/v2 &&
		svn_cmd add branches/v2 &&
		svn_cmd cp trunk branches/v2/start &&
		svn_cmd commit -m "Another versioned branch" &&
		svn_cmd up &&
		echo "hello" >> branches/v2/start/src/b/readme &&
		poke branches/v2/start/src/b/readme &&
		echo "howdy" >> branches/v2/start/src/a/readme &&
		poke branches/v2/start/src/a/readme &&
		svn_cmd commit -m "Changed 2 in v2/start" &&
		svn_cmd up &&
		svn_cmd cp branches/v2/start tags/next &&
		echo "bye" >> tags/next/src/b/readme &&
		poke tags/next/src/b/readme &&
		echo "aye" >> tags/next/src/a/readme &&
		poke tags/next/src/a/readme &&
		svn_cmd commit -m "adding more" &&
		echo "byebye" >> tags/next/src/b/readme &&
		poke tags/next/src/b/readme &&
		svn_cmd commit -m "adios"
	) &&
	git config --add svn-remote.four.url "$svnrepo" &&
	git config --add svn-remote.four.fetch trunk:refs/remotes/four/trunk &&
	git config --add svn-remote.four.branches \
	                 "branches/*/*:refs/remotes/four/branches/*/*" &&
	git config --add svn-remote.four.tags \
	                 "tags/*:refs/remotes/four/tags/*" &&
	git svn fetch four &&
	test `git rev-list refs/remotes/four/tags/next | wc -l` -eq 5 &&
	test `git rev-list refs/remotes/four/branches/v2/start | wc -l` -eq 3 &&
	test `git rev-parse refs/remotes/four/branches/v2/start~2` = \
	     `git rev-parse refs/remotes/four/trunk` &&
	test `git rev-parse refs/remotes/four/tags/next~2` = \
	     `git rev-parse refs/remotes/four/branches/v2/start` &&
	git log --pretty=oneline refs/remotes/four/tags/next | \
	    sed -e "s/^.\{41\}//" > output.four &&
	test_cmp expect.four output.four
	
ok 10 - follow-parent is atomic

expecting success: 
	svn_cmd cp -m "resurrect /glob" "$svnrepo"/r9270 "$svnrepo"/glob &&
	git svn multi-fetch &&
	test `git cat-file commit refs/remotes/glob | \
	       grep "^parent " | wc -l` -eq 2
	
A         branches/v2
A         branches/v2/start
Committing transaction...
Adding         branches/v2
Rebuilding .git/svn/refs/remotes/origin/trunk/.rev_map.b7ead112-5643-4770-8379-3668b894bc83 ...
Adding         branches/v2/start
Committing transaction...
r1 = 2f3c33e20d9d1ab77f96be8ae249db4dc7e1fa29
Done rebuilding .git/svn/refs/remotes/origin/trunk/.rev_map.b7ead112-5643-4770-8379-3668b894bc83
ok 7 - .rev_db auto-converted to .rev_map.UUID

# passed all 7 test(s)
1..7
ok 3 - test disallow multi-globs

# passed all 3 test(s)
1..3
*** t9110-git-svn-use-svm-props.sh ***
*** t9111-git-svn-use-svnsync-props.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9110-git-svn-use-svm-props/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9111-git-svn-use-svnsync-props/.git/
Committed revision 21.
Committed revision 7.
Updating '.':
At revision 7.
Sending        branches/v2/start/src/a/readme
Sending        branches/v2/start/src/b/readme
Transmitting file data ..done
Committing transaction...
expecting success: 
	svnadmin load -q "$rawsvnrepo" < "$TEST_DIRECTORY"/t9111/svnsync.dump &&
	git svn init --minimize-url -R arr -i bar "$svnrepo"/bar &&
	git svn init --minimize-url -R argh -i dir "$svnrepo"/dir &&
	git svn init --minimize-url -R argh -i e "$svnrepo"/dir/a/b/c/d/e &&
	git config svn.useSvnsyncProps true &&
	git svn fetch --all
	
expecting success: 
	svnadmin load -q "$rawsvnrepo" < "$TEST_DIRECTORY"/t9110/svm.dump &&
	git svn init --minimize-url -R arr -i bar "$svnrepo"/mirror/arr &&
	git svn init --minimize-url -R argh -i dir "$svnrepo"/mirror/argh &&
	git svn init --minimize-url -R argh -i e \
	  "$svnrepo"/mirror/argh/a/b/c/d/e &&
	git config svn.useSvmProps true &&
	git svn fetch --all
	
Committed revision 8.
Updating '.':
At revision 8.
A         tags/next
Adding         tags/next
Sending        tags/next/src/a/readme
Sending        tags/next/src/b/readme
Transmitting file data ..done
Committing transaction...
Committed revision 9.
Sending        tags/next/src/b/readme
Transmitting file data .done
Committing transaction...
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/r9270 => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/glob, 20
Initializing parent: refs/remotes/glob@20
	A	trunk/subversion/bindings/swig/perl/t/a.t
	A	trunk/subversion/bindings/swig/perl/t/b.t
	A	trunk/subversion/bindings/swig/perl/t/c.t
	A	trunk/subversion/bindings/swig/perl/t/larger-parent
	A	trunk/subversion/bindings/swig/perl/a.pm
	A	trunk/subversion/bindings/swig/perl/another-larger
	A	trunk/subversion/bindings/swig/perl/b.pm
	A	trunk/subversion/bindings/swig/perl/c.pm
	A	trunk/thunk/bump/thud/file
	A	trunk/readme
r13 = 489078f2657e242994647b0eb7d28c3fe7be4c7a (refs/remotes/glob@20)
	D	trunk/subversion/bindings/swig/perl/t/a.t
	D	trunk/subversion/bindings/swig/perl/t/b.t
	D	trunk/subversion/bindings/swig/perl/t/c.t
	D	trunk/subversion/bindings/swig/perl/t/larger-parent
	D	trunk/subversion/bindings/swig/perl/t/
	D	trunk/subversion/bindings/swig/perl/a.pm
Committed revision 10.
	D	trunk/subversion/bindings/swig/perl/b.pm
	D	trunk/subversion/bindings/swig/perl/c.pm
	A	trunk/subversion/bindings/swig/perl/native/t/a.t
	A	trunk/subversion/bindings/swig/perl/native/t/b.t
	A	trunk/subversion/bindings/swig/perl/native/t/c.t
	A	trunk/subversion/bindings/swig/perl/native/t/larger-parent
	A	trunk/subversion/bindings/swig/perl/native/a.pm
	A	trunk/subversion/bindings/swig/perl/native/b.pm
	A	trunk/subversion/bindings/swig/perl/native/c.pm
W: -empty_dir: r9270/trunk/subversion/bindings/swig/perl/a.pm
W: -empty_dir: r9270/trunk/subversion/bindings/swig/perl/b.pm
W: -empty_dir: r9270/trunk/subversion/bindings/swig/perl/c.pm
W: -empty_dir: r9270/trunk/subversion/bindings/swig/perl/t
r14 = 983326b54a6438d94cc4c48472fabdbe9ca05e0b (refs/remotes/glob@20)
	A	drunk/subversion/bindings/swig/perl/native/t/a.t
	A	drunk/subversion/bindings/swig/perl/native/t/b.t
	A	drunk/subversion/bindings/swig/perl/native/t/c.t
	A	drunk/subversion/bindings/swig/perl/native/t/larger-parent
	A	drunk/subversion/bindings/swig/perl/native/a.pm
	A	drunk/subversion/bindings/swig/perl/native/b.pm
	A	drunk/subversion/bindings/swig/perl/native/c.pm
	A	drunk/subversion/bindings/swig/perl/another-larger
	A	drunk/thunk/bump/thud/file
	A	drunk/readme
r15 = e0af54fa3877033bdba251664eb8de19d694a2a5 (refs/remotes/glob@20)
Found branch parent: (refs/remotes/glob) e0af54fa3877033bdba251664eb8de19d694a2a5
Index mismatch: 3cd9c37c278d8b60927f43385900d57622921efe != b80e441d0bfb8031c1110b908fb333507c1b9180
rereading e0af54fa3877033bdba251664eb8de19d694a2a5
Following parent with do_switch
Successfully followed parent
r21 = 48a073d9a025e43a7aae2d7d28bb3793b575519e (refs/remotes/glob)
ok 11 - track multi-parent paths

expecting success: 
	git svn multi-fetch
	
	A	src/a/readme
	A	src/b/readme
W: +empty_dir: trunk/doc
r1 = 1c7e8c0d7372a2e5c0b6a5aabca7bc88b3d836bf (refs/remotes/four/trunk)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9109-git-svn-multi-glob/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9109-git-svn-multi-glob/svnrepo/branches/v1/start, 1
Found branch parent: (refs/remotes/four/branches/v1/start) 1c7e8c0d7372a2e5c0b6a5aabca7bc88b3d836bf
Following parent with do_switch
Successfully followed parent
r2 = 62ebdfd58c025ccbbfea0291b4317a457d158d99 (refs/remotes/four/branches/v1/start)
	M	src/a/readme
	M	src/b/readme
r3 = fb25e1149c7affd669f738ff91072a0aa1d64de2 (refs/remotes/four/branches/v1/start)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9109-git-svn-multi-glob/svnrepo/branches/v1/start => file:///«PKGBUILDDIR»/t/trash%20directory.t9109-git-svn-multi-glob/svnrepo/tags/end, 3
Found branch parent: (refs/remotes/four/tags/end) fb25e1149c7affd669f738ff91072a0aa1d64de2
Following parent with do_switch
ok 12 - multi-fetch continues to work

expecting success: 
	rm -r "$GIT_DIR/svn" "$GIT_DIR/refs/remotes" "$GIT_DIR/logs" &&
	mkdir "$GIT_DIR/svn" &&
	git svn multi-fetch
	
	M	src/a/readme
	M	src/b/readme
Successfully followed parent
r4 = 3c2c6382c382e0d958a512655e161576b674e6de (refs/remotes/four/tags/end)
	M	src/b/readme
r5 = 7520e7983a314b268483120830dd10bd10974a79 (refs/remotes/four/tags/end)
	M	src/b/readme
r6 = 73c43bc56a0ddefc4fccc98c7cc153114f6b56fc (refs/remotes/four/tags/end)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9109-git-svn-multi-glob/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9109-git-svn-multi-glob/svnrepo/branches/v2/start, 3
Found branch parent: (refs/remotes/four/branches/v2/start) 1c7e8c0d7372a2e5c0b6a5aabca7bc88b3d836bf
Following parent with do_switch
Successfully followed parent
r7 = b3c7467762f68204df376d5fe4a99ff08688f98c (refs/remotes/four/branches/v2/start)
	M	src/a/readme
	M	src/b/readme
r8 = 74277d352aeb710f5948304bf563de19373bfd96 (refs/remotes/four/branches/v2/start)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9109-git-svn-multi-glob/svnrepo/branches/v2/start => file:///«PKGBUILDDIR»/t/trash%20directory.t9109-git-svn-multi-glob/svnrepo/tags/next, 8
Found branch parent: (refs/remotes/four/tags/next) 74277d352aeb710f5948304bf563de19373bfd96
Following parent with do_switch
	M	src/a/readme
	M	src/b/readme
Successfully followed parent
r9 = 5f87b08f021e586461487324f77a32cb9b14f4dd (refs/remotes/four/tags/next)
	M	src/b/readme
r10 = bf525a33ff61f948d18c70a6fa617e26dcbbd2b3 (refs/remotes/four/tags/next)
ok 3 - test another branch

expecting success: 
	git config --add svn-remote.three.url "$svnrepo" &&
	git config --add svn-remote.three.fetch \
	                 trunk:refs/remotes/three/trunk &&
	git config --add svn-remote.three.branches \
	                 "branches/*/t/*:refs/remotes/three/branches/*/*" &&
	git config --add svn-remote.three.tags \
	                 "tags/*:refs/remotes/three/tags/*" &&
	(
		cd tmp &&
		echo "try try" >> tags/end/src/b/readme &&
		poke tags/end/src/b/readme &&
		svn_cmd commit -m "try to try"
	) &&
	test_must_fail git svn fetch three 2> stderr.three &&
	test_cmp expect.three stderr.three
	
Sending        tags/end/src/b/readme
Transmitting file data .done
Committing transaction...
	A	readme
r1 = 153c1cceaf8f25d031674d065696e2b990d90606 (refs/remotes/svn/trunk)
Committed revision 11.
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9110-git-svn-use-svm-props/svnrepo/mirror/arr => file:///«PKGBUILDDIR»/t/trash%20directory.t9110-git-svn-use-svm-props/svnrepo
	M	readme
r2 = e372bb1cc419aad418dd05071ef3483e16dc8eb5 (refs/remotes/svn/trunk)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/thunk, 2
Found branch parent: (refs/remotes/svn/thunk) e372bb1cc419aad418dd05071ef3483e16dc8eb5
Following parent with do_switch
	M	readme
Successfully followed parent
r3 = 98536fa3cdac66ca210f9f34d953d4179a2f0799 (refs/remotes/svn/thunk)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/junk, 2
Found branch parent: (refs/remotes/svn/junk) e372bb1cc419aad418dd05071ef3483e16dc8eb5
Following parent with do_switch
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9111-git-svn-use-svnsync-props/svnrepo/bar => file:///«PKGBUILDDIR»/t/trash%20directory.t9111-git-svn-use-svnsync-props/svnrepo
Successfully followed parent
r4 = e2c630504ad877b1ade1fed97470868ff82fe028 (refs/remotes/svn/junk)
	A	file
r5 = ff1a76a00d1497c7e8ff5ab415c34792b387f53e (refs/remotes/larger)
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9110-git-svn-use-svm-props/svnrepo/mirror/argh => file:///«PKGBUILDDIR»/t/trash%20directory.t9110-git-svn-use-svm-props/svnrepo
branch_from: /larger-parent => /larger-parent/trunk/thunk/bump/thud
ok 4 - test disallow multiple globs

Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/larger-parent/trunk/thunk/bump/thud => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/another-larger/trunk/thunk/bump/thud, 5
# passed all 4 test(s)
1..4
Found branch parent: (refs/remotes/larger-parent) ff1a76a00d1497c7e8ff5ab415c34792b387f53e
Following parent with do_switch
*** t9112-git-svn-md5less-file.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9112-git-svn-md5less-file/.git/
Successfully followed parent
r6 = 04a11a09a8d2552edf5ddaac1d4466ad82b0e135 (refs/remotes/larger-parent)
r9 = 2affd62e818ed57c5d8ccadcdf07669970cff387 (refs/remotes/glob)
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9111-git-svn-use-svnsync-props/svnrepo/dir => file:///«PKGBUILDDIR»/t/trash%20directory.t9111-git-svn-use-svnsync-props/svnrepo
expecting success: svnadmin load "$rawsvnrepo" < dumpfile.svn
	A	blob/hi
r10 = c5200f36c55c607f0d9854801646ea8fbbe70585 (refs/remotes/glob)
<<< Started new transaction, based on original revision 1
     * editing path : md5less-file ... done.
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/blob => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/glob/blob, 9
Initializing parent: refs/remotes/blob@9

------- Committed revision 1 >>>

ok 1 - load svn dumpfile

expecting success: git svn init "$svnrepo"
r7 = 6d2140eaf4ec41022f6eedede8f7ed18fd2111ba (refs/remotes/blob@9)
	A	hi
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9110-git-svn-use-svm-props/svnrepo/mirror/argh/a/b/c/d/e => file:///«PKGBUILDDIR»/t/trash%20directory.t9110-git-svn-use-svm-props/svnrepo
r8 = b5f8a895fee39577dbb9e86f121effec9cb73258 (refs/remotes/blob@9)
Found branch parent: (refs/remotes/blob) b5f8a895fee39577dbb9e86f121effec9cb73258
Following parent with do_switch
Successfully followed parent
r10 = 8c3360b8da0bf8d04a85dd26c4c8530bbb63a1ab (refs/remotes/blob)
	D	blob/hi
	A	blob/bye
W: -empty_dir: glob/blob/hi
r11 = 88ef88a2dec13a03734dccff294fb520dd435d57 (refs/remotes/glob)
	D	hi
	A	bye
W: -empty_dir: glob/blob/hi
r11 = 602f50384a8e9b1f62afefd4a83ecbf477ddf21a (refs/remotes/blob)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/r9270/trunk/subversion/bindings/swig/perl/t => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/r9270/trunk/subversion/bindings/swig/perl/native/t, 13
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9111-git-svn-use-svnsync-props/svnrepo/dir/a/b/c/d/e => file:///«PKGBUILDDIR»/t/trash%20directory.t9111-git-svn-use-svnsync-props/svnrepo
Initializing parent: refs/remotes/r9270-t@13
ok 2 - initialize git svn

expecting success: git svn fetch
	A	a.t
	A	b.t
	A	c.t
	A	larger-parent
r13 = 322825e6b56bfb9ffdc0789ea3e58bb4522564fc (refs/remotes/r9270-t@13)
Found branch parent: (refs/remotes/r9270-t) 322825e6b56bfb9ffdc0789ea3e58bb4522564fc
Following parent with do_switch
	M	c.t
Successfully followed parent
r14 = 32f0bd381d809d3e3e74927a5fc08375a45e10ef (refs/remotes/r9270-t)
branch_from: /r9270/trunk => /r9270/trunk/subversion/bindings/swig/perl/native/t
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/r9270/trunk/subversion/bindings/swig/perl/native/t => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/r9270/drunk/subversion/bindings/swig/perl/native/t, 14
Found branch parent: (refs/remotes/r9270-d) 32f0bd381d809d3e3e74927a5fc08375a45e10ef
Following parent with do_switch
Successfully followed parent
r15 = 8963a5b26e480acb7aeb50c878722148c0523d3b (refs/remotes/r9270-d)
	A	a/b/c/d/e/file
	A	readme
r9 (@1) = 79a1181387506bdda9e0f310c40ddb3f4eed7179 (refs/remotes/dir)
r16 = a1d7e90631bb6f232b351c782befaf2bfdf262f4 (refs/remotes/stunk)
	A	file
	M	readme
r9 (@1)r17 = 6b9823cdde0b54372e1515e9f4aa19c95cb2050a (refs/remotes/stunk)
 = 6aadfc98d31cbed4e89c9d601491ad7b5c46d857 (refs/remotes/e)
	D	a/b/c/d/e/file
	D	a/
	A	file
	M	readme
W: -empty_dir: mirror/argh/a
r18 = 68022ce1a2dc36ba724a42d2794203c629932da1 (refs/remotes/stunk)
r10 (@2) = c165f07c4c5694be18c9c28331ca7efd46d78417 (refs/remotes/dir)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/stunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/flunk, 18
	A	file
Found branch parent: (refs/remotes/flunk) 68022ce1a2dc36ba724a42d2794203c629932da1
	A	md5less-file
Following parent with do_switch
Successfully followed parent
r1 = 6aadfc98d31cbed4e89c9d601491ad7b5c46d857 (refs/remotes/e)
r1 = 9a6151a670330ba26117b2d1944f856a7ff4fcd5 (refs/remotes/git-svn)
r19 = dd0361dba3758b07edb4ab3a62040482802ee315 (refs/remotes/flunk)
	A	a/b/c/d/e/file
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9112-git-svn-md5less-file/svnrepo r1
	A	zzz
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/stunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/flunked, 17
ok 3 - fetch revisions from svn

# passed all 3 test(s)
1..3
r1 = 79a1181387506bdda9e0f310c40ddb3f4eed7179 (refs/remotes/dir)
*** t9113-git-svn-dcommit-new-file.sh ***
Found branch parent: (refs/remotes/flunked) 6b9823cdde0b54372e1515e9f4aa19c95cb2050a
r2 (@1) = 44a982ce17928f9542c6f3fce48affc197150e1e (refs/remotes/bar)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9113-git-svn-dcommit-new-file/.git/
Following parent with do_switch
	D	a/b/c/d/e/file
	D	a/
	A	file
W: -empty_dir: dir/a
Successfully followed parent
	M	zzz
r2 = c165f07c4c5694be18c9c28331ca7efd46d78417 (refs/remotes/dir)
r20 = 276920a0c2d56d828a84a6d4c6056eea424a6802 (refs/remotes/flunked)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/r9270 => file:///«PKGBUILDDIR»/t/trash%20directory.t9104-git-svn-follow-parent/svnrepo/glob, 20
r3 (@6) = 2ebd1f75bc1fdd83dcbcdf6194f8b9a16e4fdeb0 (refs/remotes/bar)
	A	zzz
Initializing parent: refs/remotes/glob@20
	A	d
r4 (@9) = 07c2950915eb3ada192043ac2e5efcf9d9e07de3 (refs/remotes/bar)
r1 = 44a982ce17928f9542c6f3fce48affc197150e1e (refs/remotes/bar)
	A	trunk/subversion/bindings/swig/perl/t/a.t
	A	trunk/subversion/bindings/swig/perl/t/b.t
	A	trunk/subversion/bindings/swig/perl/t/c.t
	A	trunk/subversion/bindings/swig/perl/t/larger-parent
	A	trunk/subversion/bindings/swig/perl/a.pm
	A	trunk/subversion/bindings/swig/perl/another-larger
	A	trunk/subversion/bindings/swig/perl/b.pm
	A	trunk/subversion/bindings/swig/perl/c.pm
	A	trunk/thunk/bump/thud/file
	A	trunk/readme
	A	newdir/dir
	M	zzz
r13 = 489078f2657e242994647b0eb7d28c3fe7be4c7a (refs/remotes/glob@20)
r6 = 2ebd1f75bc1fdd83dcbcdf6194f8b9a16e4fdeb0 (refs/remotes/bar)
r5 (@10) = 7b59bc03f91e595ef213c16f436644c05d922782 (refs/remotes/bar)
	A	d
	D	trunk/subversion/bindings/swig/perl/t/a.t
	D	trunk/subversion/bindings/swig/perl/t/b.t
	D	trunk/subversion/bindings/swig/perl/t/c.t
	D	trunk/subversion/bindings/swig/perl/t/larger-parent
	D	trunk/subversion/bindings/swig/perl/t/
	D	trunk/subversion/bindings/swig/perl/a.pm
r9 = 07c2950915eb3ada192043ac2e5efcf9d9e07de3 (refs/remotes/bar)
	D	trunk/subversion/bindings/swig/perl/b.pm
1..0 # SKIP skipping svnserve test. (set $SVNSERVE_PORT to enable)
	D	trunk/subversion/bindings/swig/perl/c.pm
	M	newdir/dir
	A	trunk/subversion/bindings/swig/perl/native/t/a.t
	A	trunk/subversion/bindings/swig/perl/native/t/b.t
	A	trunk/subversion/bindings/swig/perl/native/t/c.t
	A	trunk/subversion/bindings/swig/perl/native/t/larger-parent
	A	trunk/subversion/bindings/swig/perl/native/a.pm
	A	trunk/subversion/bindings/swig/perl/native/b.pm
	A	trunk/subversion/bindings/swig/perl/native/c.pm
W: -empty_dir: r9270/trunk/subversion/bindings/swig/perl/a.pm
W: -empty_dir: r9270/trunk/subversion/bindings/swig/perl/b.pm
W: -empty_dir: r9270/trunk/subversion/bindings/swig/perl/c.pm
W: -empty_dir: r9270/trunk/subversion/bindings/swig/perl/t
*** t9114-git-svn-dcommit-merge.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9114-git-svn-dcommit-merge/.git/
r14 = 983326b54a6438d94cc4c48472fabdbe9ca05e0b (refs/remotes/glob@20)
r6 (@11)	A	newdir/dir
 = 8775e0be15e9c3fd282c6f4e71a82766ab3e9231 (refs/remotes/bar)
r10 = 7b59bc03f91e595ef213c16f436644c05d922782 (refs/remotes/bar)
	A	drunk/subversion/bindings/swig/perl/native/t/a.t
	A	drunk/subversion/bindings/swig/perl/native/t/b.t
	A	drunk/subversion/bindings/swig/perl/native/t/c.t
	A	drunk/subversion/bindings/swig/perl/native/t/larger-parent
	A	drunk/subversion/bindings/swig/perl/native/a.pm
	A	drunk/subversion/bindings/swig/perl/native/b.pm
	A	drunk/subversion/bindings/swig/perl/native/c.pm
	A	drunk/subversion/bindings/swig/perl/another-larger
	A	drunk/thunk/bump/thud/file
	A	drunk/readme
	M	d
	M	newdir/dir
r15 = e0af54fa3877033bdba251664eb8de19d694a2a5 (refs/remotes/glob@20)
Found branch parent: (refs/remotes/glob) e0af54fa3877033bdba251664eb8de19d694a2a5
r11 = 8775e0be15e9c3fd282c6f4e71a82766ab3e9231 (refs/remotes/bar)
Index mismatch: 3cd9c37c278d8b60927f43385900d57622921efe != b80e441d0bfb8031c1110b908fb333507c1b9180
rereading e0af54fa3877033bdba251664eb8de19d694a2a5
r7 (@12) = ab9ada04d293d792e2e941a664911858fe0167af (refs/remotes/bar)
Following parent with do_switch
Successfully followed parent
	M	d
r21 = 48a073d9a025e43a7aae2d7d28bb3793b575519e (refs/remotes/glob)
r12 = ab9ada04d293d792e2e941a664911858fe0167af (refs/remotes/bar)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9110-git-svn-use-svm-props/svnrepo/mirror/arr r7
ok 1 - load svm repo

expecting success: 
	git cat-file commit refs/remotes/bar | 	   grep '^git-svn-id: http://mayonaise/svnrepo/bar@12 161ce429-a9dd-4828-af4a-52023f968c89$' &&
	git cat-file commit refs/remotes/bar~1 | 	   grep '^git-svn-id: http://mayonaise/svnrepo/bar@11 161ce429-a9dd-4828-af4a-52023f968c89$' &&
	git cat-file commit refs/remotes/bar~2 | 	   grep '^git-svn-id: http://mayonaise/svnrepo/bar@10 161ce429-a9dd-4828-af4a-52023f968c89$' &&
	git cat-file commit refs/remotes/bar~3 | 	   grep '^git-svn-id: http://mayonaise/svnrepo/bar@9 161ce429-a9dd-4828-af4a-52023f968c89$' &&
	git cat-file commit refs/remotes/bar~4 | 	   grep '^git-svn-id: http://mayonaise/svnrepo/bar@6 161ce429-a9dd-4828-af4a-52023f968c89$' &&
	git cat-file commit refs/remotes/bar~5 | 	   grep '^git-svn-id: http://mayonaise/svnrepo/bar@1 161ce429-a9dd-4828-af4a-52023f968c89$'
	
ok 13 - multi-fetch works off a 'clean' repository

git-svn-id: http://mayonaise/svnrepo/bar@12 161ce429-a9dd-4828-af4a-52023f968c89
# passed all 13 test(s)
1..13
git-svn-id: http://mayonaise/svnrepo/bar@11 161ce429-a9dd-4828-af4a-52023f968c89
git-svn-id: http://mayonaise/svnrepo/bar@10 161ce429-a9dd-4828-af4a-52023f968c89
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9111-git-svn-use-svnsync-props/svnrepo/bar r12
git-svn-id: http://mayonaise/svnrepo/bar@9 161ce429-a9dd-4828-af4a-52023f968c89
git-svn-id: http://mayonaise/svnrepo/bar@6 161ce429-a9dd-4828-af4a-52023f968c89
git-svn-id: http://mayonaise/svnrepo/bar@1 161ce429-a9dd-4828-af4a-52023f968c89
ok 2 - verify metadata for /bar

expecting success: 
	git cat-file commit refs/remotes/e | 	   grep '^git-svn-id: http://mayonaise/svnrepo/dir/a/b/c/d/e@1 161ce429-a9dd-4828-af4a-52023f968c89$'
	
git-svn-id: http://mayonaise/svnrepo/dir/a/b/c/d/e@1 161ce429-a9dd-4828-af4a-52023f968c89
ok 3 - verify metadata for /dir/a/b/c/d/e

expecting success: 
	git cat-file commit refs/remotes/dir | 	   grep '^git-svn-id: http://mayonaise/svnrepo/dir@2 161ce429-a9dd-4828-af4a-52023f968c89$' &&
	git cat-file commit refs/remotes/dir~1 | 	   grep '^git-svn-id: http://mayonaise/svnrepo/dir@1 161ce429-a9dd-4828-af4a-52023f968c89$'
	
ok 1 - load svnsync repo

expecting success: 
	git cat-file commit refs/remotes/bar | 	   grep '^git-svn-id: http://mayonaise/svnrepo/bar@12 161ce429-a9dd-4828-af4a-52023f968c89$' &&
	git cat-file commit refs/remotes/bar~1 | 	   grep '^git-svn-id: http://mayonaise/svnrepo/bar@11 161ce429-a9dd-4828-af4a-52023f968c89$' &&
	git cat-file commit refs/remotes/bar~2 | 	   grep '^git-svn-id: http://mayonaise/svnrepo/bar@10 161ce429-a9dd-4828-af4a-52023f968c89$' &&
	git cat-file commit refs/remotes/bar~3 | 	   grep '^git-svn-id: http://mayonaise/svnrepo/bar@9 161ce429-a9dd-4828-af4a-52023f968c89$' &&
	git cat-file commit refs/remotes/bar~4 | 	   grep '^git-svn-id: http://mayonaise/svnrepo/bar@6 161ce429-a9dd-4828-af4a-52023f968c89$' &&
	git cat-file commit refs/remotes/bar~5 | 	   grep '^git-svn-id: http://mayonaise/svnrepo/bar@1 161ce429-a9dd-4828-af4a-52023f968c89$'
	
git-svn-id: http://mayonaise/svnrepo/bar@12 161ce429-a9dd-4828-af4a-52023f968c89
git-svn-id: http://mayonaise/svnrepo/dir@2 161ce429-a9dd-4828-af4a-52023f968c89
git-svn-id: http://mayonaise/svnrepo/bar@11 161ce429-a9dd-4828-af4a-52023f968c89
git-svn-id: http://mayonaise/svnrepo/dir@1 161ce429-a9dd-4828-af4a-52023f968c89
ok 4 - verify metadata for /dir

git-svn-id: http://mayonaise/svnrepo/bar@10 161ce429-a9dd-4828-af4a-52023f968c89
expecting success: 
        git svn find-rev r12 |
	    grep ab9ada04d293d792e2e941a664911858fe0167af
        
git-svn-id: http://mayonaise/svnrepo/bar@9 161ce429-a9dd-4828-af4a-52023f968c89
git-svn-id: http://mayonaise/svnrepo/bar@6 161ce429-a9dd-4828-af4a-52023f968c89
git-svn-id: http://mayonaise/svnrepo/bar@1 161ce429-a9dd-4828-af4a-52023f968c89
ok 2 - verify metadata for /bar

expecting success: 
	git cat-file commit refs/remotes/e | 	   grep '^git-svn-id: http://mayonaise/svnrepo/dir/a/b/c/d/e@1 161ce429-a9dd-4828-af4a-52023f968c89$'
	
git-svn-id: http://mayonaise/svnrepo/dir/a/b/c/d/e@1 161ce429-a9dd-4828-af4a-52023f968c89
ok 3 - verify metadata for /dir/a/b/c/d/e

expecting success: 
	git cat-file commit refs/remotes/dir | 	   grep '^git-svn-id: http://mayonaise/svnrepo/dir@2 161ce429-a9dd-4828-af4a-52023f968c89$' &&
	git cat-file commit refs/remotes/dir~1 | 	   grep '^git-svn-id: http://mayonaise/svnrepo/dir@1 161ce429-a9dd-4828-af4a-52023f968c89$'
	
git-svn-id: http://mayonaise/svnrepo/dir@2 161ce429-a9dd-4828-af4a-52023f968c89
git-svn-id: http://mayonaise/svnrepo/dir@1 161ce429-a9dd-4828-af4a-52023f968c89
ok 4 - verify metadata for /dir

# passed all 4 test(s)
1..4
*** t9115-git-svn-dcommit-funky-renames.sh ***
*** t9116-git-svn-log.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9115-git-svn-dcommit-funky-renames/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9116-git-svn-log/.git/
expecting success: 
	svn_cmd co "$svnrepo" mysvnwork &&
	mkdir -p mysvnwork/trunk &&
	(
		cd mysvnwork &&
		big_text_block >>trunk/README &&
		svn_cmd add trunk &&
		svn_cmd ci -m "first commit" trunk
	)
	
Checked out revision 0.
A         trunk
A         trunk/README
Adding         trunk
Adding         trunk/README
Transmitting file data .done
Committing transaction...
expecting success: 
	svnadmin load -q "$rawsvnrepo" < "$TEST_DIRECTORY"/t9115/funky-names.dump &&
	start_httpd gtk+
	
expecting success: 
	mkdir import &&
	(
		cd import &&
		for i in trunk branches/a branches/b tags/0.1 tags/0.2 tags/0.3
		do
			mkdir -p $i &&
			echo hello >>$i/README ||
			exit 1
		done &&
		svn_cmd import -m test . "$svnrepo"
	) &&
	git svn init "$svnrepo" -T trunk -b branches -t tags &&
	git svn fetch &&
	git reset --hard origin/trunk &&
	echo bye >> README &&
	git commit -a -m bye &&
	git svn dcommit &&
	git reset --hard origin/a &&
	echo why >> FEEDME &&
	git update-index --add FEEDME &&
	git commit -m feedme &&
	git svn dcommit &&
	git reset --hard origin/trunk &&
	echo aye >> README &&
	git commit -a -m aye &&
	git svn dcommit &&
	git reset --hard origin/b &&
	echo spy >> README &&
	git commit -a -m spy &&
	echo try >> README &&
	git commit -a -m try &&
	git svn dcommit
	
Committed revision 1.
ok 1 - setup svn repository

expecting success: 
	git svn init "$svnrepo" -t tags -T trunk -b branches &&
	git svn fetch &&
	git checkout -b svn remotes/origin/trunk &&
	git checkout -b merge &&
	echo new file > new_file &&
	git add new_file &&
	git commit -a -m "New file" &&
	echo hello >> README &&
	git commit -a -m "hello" &&
	echo add some stuff >> new_file &&
	git commit -a -m "add some stuff" &&
	git checkout svn &&
	mv -f README tmp &&
	echo friend > README &&
	cat tmp >> README &&
	git commit -a -m "friend" &&
	git merge merge
	
Adding         branches
Adding         branches/a
Adding         branches/a/README
Adding         branches/b
Adding         branches/b/README
Adding         tags
Adding         tags/0.1
Adding         tags/0.1/README
Adding         tags/0.2
Adding         tags/0.2/README
Adding         tags/0.3
Adding         tags/0.3/README
Adding         trunk
Adding         trunk/README
Committing transaction...
ab9ada04d293d792e2e941a664911858fe0167af
ok 5 - find commit based on SVN revision number

expecting success: 
	git svn rebase
	
SVN_HTTPD_PORT is not defined!
ok 1 - load repository with strange names

expecting success: 
	git svn init "$svnrepo" &&
	git svn fetch &&
	git reset --hard git-svn
	
Committed revision 1.
Current branch master is up to date.
ok 6 - empty rebase

# passed all 6 test(s)
1..6
*** t9117-git-svn-init-clone.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9117-git-svn-init-clone/.git/
expecting success: 
	mkdir project project/trunk project/branches project/tags &&
	echo foo > project/trunk/foo &&
	svn_cmd import -m "$test_description" project "$svnrepo"/project &&
	rm -rf project
	
Adding         project/branches
Adding         project/tags
Adding         project/trunk
Adding         project/trunk/foo
Committing transaction...
	A	README
r1 = aa51005342885cddc02b5efe1f21b7664b27aa63 (refs/remotes/origin/trunk)
Committed revision 1.
ok 1 - setup svnrepo

expecting success: 
	test ! -d trunk &&
	git svn clone "$svnrepo"/project/trunk &&
	test -d trunk/.git/svn &&
	test -e trunk/foo &&
	rm -rf trunk
	
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9114-git-svn-dcommit-merge/svnrepo/trunk r1
Switched to a new branch 'svn'
Switched to a new branch 'merge'
[merge 1680861] New file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 new_file
	A	 leading space file
[merge 78c6cb1] hello
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
	A	#{cool_name}
	A	file name with spaces
W: +empty_dir:  leading space
W: +empty_dir: #{bad_directory_name}
W: +empty_dir: dir name with spaces
W: +empty_dir: regular_dir_name
[merge 05ee17a] add some stuff
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Switched to branch 'svn'
[svn 97d749d] friend
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Merging:
97d749d friend
virtual merge
found 1 common ancestor:
aa51005 first commit
Auto-merging README
Merge made by the 'recursive' strategy.
 README   | 1 +
 new_file | 2 ++
 2 files changed, 3 insertions(+)
 create mode 100644 new_file
ok 2 - setup git mirror and merge

expecting success: 
	test x`git rev-parse --verify refs/heads/svn^2` = 	     x`git rev-parse --verify refs/heads/merge` &&
	git cat-file commit refs/heads/svn^ | grep '^friend$'
	
friend
ok 3 - verify pre-merge ancestry

expecting success: 
	git svn dcommit
	
r1 = 84e8e683693e5949db813012d42e016736ac9ef4 (refs/remotes/git-svn)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9115-git-svn-dcommit-funky-renames/svnrepo r1
creating empty directory:  leading space
creating empty directory: #{bad_directory_name}
creating empty directory: dir name with spaces
creating empty directory: regular_dir_name
HEAD is now at 84e8e68 what will those wacky people think of next?
ok 2 - init and fetch repository

expecting success: 
	mkdir -p "#{bad_directory_name}" &&
	echo hi > "#{bad_directory_name}/ foo" &&
	git update-index --add "#{bad_directory_name}/ foo" &&
	git commit -m "new file in ugly parent" &&
	git svn dcommit
	
[master d5c2979] new file in ugly parent
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 #{bad_directory_name}/ foo
	A	README
r1 = 2807f583b58db434e20578aba45132f33877bd45 (refs/remotes/origin/trunk)
	A	README
r1 = d4ab799e71ae57443f9a95bef8a9e373e593c9d4 (refs/remotes/origin/tags/0.2)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9117-git-svn-init-clone/tmp/trunk/.git/
	A	README
r1 = 3334d8c816061a4bd3955e8bfa08aebf707e57a8 (refs/remotes/origin/tags/0.3)
	A	README
	A	foo
r1 = ba6d69818d535c2de85dca8e65a6067d62bc90f9 (refs/remotes/origin/a)
r1 = 28c678b0c32956a4e077ae19e3bfb3bbdb899c9d (refs/remotes/git-svn)
	A	README
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9117-git-svn-init-clone/svnrepo/project/trunk r1
r1 = 975b4e3e0e3da144ea498a36571d3fc467522fe6 (refs/remotes/origin/b)
ok 2 - basic clone

expecting success: 
	test ! -d target &&
	git svn clone "$svnrepo"/project/trunk target &&
	test -d target/.git/svn &&
	test -e target/foo &&
	rm -rf target
	
	A	README
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9115-git-svn-dcommit-funky-renames/svnrepo ...
r1 = efd9b55ca3963ce8233c7249a0441756c4463903 (refs/remotes/origin/tags/0.1)
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9114-git-svn-dcommit-merge/svnrepo/trunk ...
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9116-git-svn-log/svnrepo/trunk r1
HEAD is now at 2807f58 test
[master 274a2e5] bye
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
	A	#{bad_directory_name}/ foo
	M	README
Committed r2
Committed r2
	A	#{bad_directory_name}/ foo
r2 = a6394d46d0a90d0486921405eea6fe66f3d6b08b (refs/remotes/git-svn)
No changes between d5c2979633a06597148ab799a6156c2fade79825 and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
	M	README
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9117-git-svn-init-clone/tmp/target/.git/
ok 3 - create file in existing ugly and empty dir

expecting success: 
	git mv "#{bad_directory_name}/ foo" "file name with feces" &&
	git commit -m "rename ugly file" &&
	git svn dcommit
	
[master bb0e8ca] rename ugly file
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename #{bad_directory_name}/ foo => file name with feces (100%)
r2 = 2fd1a13f8dcb08e685a1797bef822cb9f562fc21 (refs/remotes/origin/trunk)
	A	foo
	A	new_file
	M	README
r1 = 28c678b0c32956a4e077ae19e3bfb3bbdb899c9d (refs/remotes/git-svn)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9117-git-svn-init-clone/svnrepo/project/trunk r1
ok 3 - clone to target directory

expecting success: 
	test ! -d project &&
	git svn clone -s "$svnrepo"/project &&
	test -d project/.git/svn &&
	test -e project/foo &&
	rm -rf project
	
Committed r3
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9116-git-svn-log/svnrepo/trunk ...
	M	README
	A	new_file
r3 = 7a69e4def6a25d9d8c870edbd4ca0b8f9cea8d42 (refs/remotes/origin/trunk)
No changes between 7c583fc0659240a0030a3c025518953b75aa5832 and refs/remotes/origin/trunk
Resetting to the latest refs/remotes/origin/trunk
ok 4 - git svn dcommit merges

expecting success: 
	test x`git rev-parse --verify refs/heads/svn` = 	     x`git rev-parse --verify refs/remotes/origin/trunk ` &&
	test x`git rev-parse --verify refs/heads/svn^2` = 	     x`git rev-parse --verify refs/heads/merge` &&
	git cat-file commit refs/heads/svn^ | grep '^friend$'
	
friend
ok 5 - verify post-merge ancestry

expecting success: 
	git rev-list --pretty=raw -1 refs/heads/svn | 	  grep "    Merge branch 'merge' into svn"
	
    Merge branch 'merge' into svn
ok 6 - verify merge commit message

# passed all 6 test(s)
1..6
	M	README
*** t9118-git-svn-funky-branch-names.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9118-git-svn-funky-branch-names/.git/
Committed r2
	M	README
r2 = 2e3b7a39a556ef1cb75266a8b0312736623f38d9 (refs/remotes/origin/trunk)
No changes between 274a2e52b49d2347fd401c6fd78c6fd799b6d022 and refs/remotes/origin/trunk
Resetting to the latest refs/remotes/origin/trunk
HEAD is now at ba6d698 test
expecting success: 
	mkdir project project/trunk project/branches project/tags &&
	echo foo > project/trunk/foo &&
	svn_cmd import -m "$test_description" project "$svnrepo/pr ject" &&
	rm -rf project &&
	svn_cmd cp -m "fun" "$svnrepo/pr ject/trunk" \
	                "$svnrepo/pr ject/branches/fun plugin" &&
	svn_cmd cp -m "more fun!" "$svnrepo/pr ject/branches/fun plugin" \
	                      "$svnrepo/pr ject/branches/more fun plugin!" &&
	svn_cmd cp -m "scary" "$svnrepo/pr ject/branches/fun plugin" \
	              "$svnrepo/pr ject/branches/$scary_uri" &&
	svn_cmd cp -m "leading dot" "$svnrepo/pr ject/trunk" \
			"$svnrepo/pr ject/branches/.leading_dot" &&
	svn_cmd cp -m "trailing dot" "$svnrepo/pr ject/trunk" \
			"$svnrepo/pr ject/branches/trailing_dot." &&
	svn_cmd cp -m "trailing .lock" "$svnrepo/pr ject/trunk" \
			"$svnrepo/pr ject/branches/trailing_dotlock.lock" &&
	svn_cmd cp -m "reflog" "$svnrepo/pr ject/trunk" \
			"$svnrepo/pr ject/branches/not-a@{0}reflog@" &&
	start_httpd
	
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9115-git-svn-dcommit-funky-renames/svnrepo ...
[master 231e3ef] feedme
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 FEEDME
Adding         project/branches
Adding         project/tags
Adding         project/trunk
Adding         project/trunk/foo
Committing transaction...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9117-git-svn-init-clone/tmp/project/.git/
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9117-git-svn-init-clone/svnrepo/project => file:///«PKGBUILDDIR»/t/trash%20directory.t9117-git-svn-init-clone/svnrepo
	R	#{bad_directory_name}/ foo => file name with feces
Committed revision 1.
	A	foo
r1 = 28c678b0c32956a4e077ae19e3bfb3bbdb899c9d (refs/remotes/origin/trunk)
Committed r3
Committing transaction...
	D	#{bad_directory_name}/ foo
	A	file name with feces
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9117-git-svn-init-clone/svnrepo/project/trunk r1
W: -empty_dir: #{bad_directory_name}/ foo
Committed revision 2.
ok 4 - clone with --stdlayout

expecting success: 
	test ! -d target &&
	git svn clone -s "$svnrepo"/project target &&
	test -d target/.git/svn &&
	test -e target/foo &&
	rm -rf target
	
r3 = 6efe358d0489dafff39603288c729530aa5ec214 (refs/remotes/git-svn)
No changes between bb0e8ca123800a994e304a3b3943e5c48beac595 and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
ok 4 - rename ugly file

expecting success: 
	echo :x > pretty &&
	git update-index --add pretty &&
	git commit -m "pretty :x" &&
	git svn dcommit &&
	mkdir -p regular_dir_name &&
	git mv pretty regular_dir_name/pretty &&
	git commit -m "moved pretty file" &&
	git svn dcommit
	
[master 5d7263b] pretty :x
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 pretty
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9116-git-svn-log/svnrepo/branches/a ...
Committing transaction...
Committed revision 3.
	A	FEEDME
Committing transaction...
Committed r3
Committed revision 4.
	A	FEEDME
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9117-git-svn-init-clone/tmp/target/.git/
r3 = 12025d0d2bb4df95ade4f844ed00d25dd4dfcc3d (refs/remotes/origin/a)
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9117-git-svn-init-clone/svnrepo/project => file:///«PKGBUILDDIR»/t/trash%20directory.t9117-git-svn-init-clone/svnrepo
No changes between 231e3ef52f0323ec00a4e131fe13c8d61a401ac5 and refs/remotes/origin/a
Resetting to the latest refs/remotes/origin/a
Committing transaction...
HEAD is now at 2e3b7a3 bye
[master dc0b1d0] aye
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9115-git-svn-dcommit-funky-renames/svnrepo ...
Committed revision 5.
	A	foo
r1 = 28c678b0c32956a4e077ae19e3bfb3bbdb899c9d (refs/remotes/origin/trunk)
Committing transaction...
	A	pretty
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9117-git-svn-init-clone/svnrepo/project/trunk r1
ok 5 - clone to target directory with --stdlayout

expecting success: 
	test ! -d trunk &&
	git svn init "$svnrepo"/project/trunk trunk 2>warning &&
	test_must_fail grep -q prefix warning &&
	rm -rf trunk &&
	rm -f warning
	
Committed revision 6.
Committed r4
Committing transaction...
	A	pretty
r4 = 4d46a856ea9c4a60e41b0e2fb89ba5a911f30962 (refs/remotes/git-svn)
No changes between 5d7263bca25e9cc32c9174d7da4c48779c5c8717 and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
Committed revision 7.
[master 1565e5b] moved pretty file
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename pretty => regular_dir_name/pretty (100%)
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9116-git-svn-log/svnrepo/trunk ...
Committing transaction...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9117-git-svn-init-clone/tmp/trunk/.git/
ok 6 - init without -s/-T/-b/-t does not warn

expecting success: 
	test ! -d trunk &&
	git svn clone "$svnrepo"/project/trunk 2>warning &&
	test_must_fail grep -q prefix warning &&
	rm -rf trunk &&
	rm -f warning
	
	M	README
Committed revision 8.
SVN_HTTPD_PORT is not defined!
ok 1 - setup svnrepo

expecting success: 
	git svn clone -s "$svnrepo/pr ject" project &&
	(
		cd project &&
		git rev-parse "refs/remotes/origin/fun%20plugin" &&
		git rev-parse "refs/remotes/origin/more%20fun%20plugin!" &&
		git rev-parse "refs/remotes/origin/$scary_ref" &&
		git rev-parse "refs/remotes/origin/%2Eleading_dot" &&
		git rev-parse "refs/remotes/origin/trailing_dot%2E" &&
		git rev-parse "refs/remotes/origin/trailing_dotlock%2Elock" &&
		git rev-parse "refs/remotes/origin/$non_reflog"
	)
	
Committed r4
	M	README
r4 = 60db0b07fe32b624df36c4e73e10d35db555b501 (refs/remotes/origin/trunk)
No changes between dc0b1d0d9f2652ee2242f04312ae06e30261ca4a and refs/remotes/origin/trunk
Resetting to the latest refs/remotes/origin/trunk
HEAD is now at 975b4e3 test
[master 4671842] spy
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master c2c1006] try
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9115-git-svn-dcommit-funky-renames/svnrepo ...
	R	pretty => regular_dir_name/pretty
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9117-git-svn-init-clone/tmp/trunk/.git/
Committed r5
	A	foo
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9118-git-svn-funky-branch-names/project/.git/
	D	pretty
	A	regular_dir_name/pretty
W: -empty_dir: pretty
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9118-git-svn-funky-branch-names/svnrepo/pr%20ject => file:///«PKGBUILDDIR»/t/trash%20directory.t9118-git-svn-funky-branch-names/svnrepo
r1 = 28c678b0c32956a4e077ae19e3bfb3bbdb899c9d (refs/remotes/git-svn)
r5 = d999fef32e651c48ffcedc174bff3bb0edaf0fb7 (refs/remotes/git-svn)
No changes between 1565e5b8a16999d7c35211e290414f5eaf7cf41b and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
ok 5 - rename pretty file

expecting success: 
	git mv regular_dir_name/pretty "#{bad_directory_name}/ booboo" &&
	git commit -m booboo &&
	git svn dcommit
	
[master 18e59dc] booboo
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename regular_dir_name/pretty => #{bad_directory_name}/ booboo (100%)
ok 7 - clone without -s/-T/-b/-t does not warn

expecting success: 
	test ! -d project &&
	git svn init -s "$svnrepo"/project project 2>warning &&
	test_must_fail grep -q prefix warning &&
	test_svn_configured_prefix "origin/" &&
	rm -rf project &&
	rm -f warning
	
	A	foo
r1 = 30b317524641cdf0a9003cc121fe4ffc94fbd709 (refs/remotes/origin/trunk)
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9116-git-svn-log/svnrepo/branches/b ...
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9118-git-svn-funky-branch-names/svnrepo/pr%20ject/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9118-git-svn-funky-branch-names/svnrepo/pr%20ject/branches/fun%20plugin, 1
Found branch parent: (refs/remotes/origin/fun plugin) 30b317524641cdf0a9003cc121fe4ffc94fbd709
Following parent with do_switch
Successfully followed parent
r2 = 4b555dd7acc39936cdcaebe3b68b605d7afbd4f9 (refs/remotes/origin/fun plugin)
	M	README
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9118-git-svn-funky-branch-names/svnrepo/pr%20ject/branches/fun%20plugin => file:///«PKGBUILDDIR»/t/trash%20directory.t9118-git-svn-funky-branch-names/svnrepo/pr%20ject/branches/more%20fun%20plugin!, 2
Found branch parent: (refs/remotes/origin/more fun plugin!) 4b555dd7acc39936cdcaebe3b68b605d7afbd4f9
Following parent with do_switch
Committed r5
Successfully followed parent
r3 = 0ddc75095b46a062a201712721c99b2a7b5a5ce6 (refs/remotes/origin/more fun plugin!)
	M	README
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9117-git-svn-init-clone/tmp/project/.git/
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9118-git-svn-funky-branch-names/svnrepo/pr%20ject/branches/fun%20plugin => file:///«PKGBUILDDIR»/t/trash%20directory.t9118-git-svn-funky-branch-names/svnrepo/pr%20ject/branches/Abo-Uebernahme%20(Bug%20%23994), 3
r5 = b9676161b8a89bdb83c0303ce6d96ff4f9e5496c (refs/remotes/origin/b)
Found branch parent: (refs/remotes/origin/Abo-Uebernahme (Bug #994)) 4b555dd7acc39936cdcaebe3b68b605d7afbd4f9
Following parent with do_switch
Successfully followed parent
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9115-git-svn-dcommit-funky-renames/svnrepo ...
ok 8 - init with -s/-T/-b/-t assumes --prefix=origin/

expecting success: 
	test ! -d project &&
	git svn clone -s "$svnrepo"/project 2>warning &&
	test_must_fail grep -q prefix warning &&
	test_svn_configured_prefix "origin/" &&
	rm -rf project &&
	rm -f warning
	
	M	README
r4 = b01497111c7798acfd056cee26f94b8d3e33a654 (refs/remotes/origin/Abo-Uebernahme (Bug #994))
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9118-git-svn-funky-branch-names/svnrepo/pr%20ject/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9118-git-svn-funky-branch-names/svnrepo/pr%20ject/branches/.leading_dot, 4
Found branch parent: (refs/remotes/origin/.leading_dot) 30b317524641cdf0a9003cc121fe4ffc94fbd709
Following parent with do_switch
Committed r6
Successfully followed parent
	R	regular_dir_name/pretty => #{bad_directory_name}/ booboo
	M	README
r5 = 74968698ef82d7c40dabb2eff0e57105966ef042 (refs/remotes/origin/.leading_dot)
r6 = 3e225fd60bc6404f03e7885e0bccda4224170776 (refs/remotes/origin/b)
No changes between c2c1006af30d3ef137b83947e96327a1fd9ad3b3 and refs/remotes/origin/b
Resetting to the latest refs/remotes/origin/b
ok 1 - setup repository and import

expecting success: 
	git reset --hard origin/a &&
	git svn log -r2 origin/trunk | grep ^r2 &&
	git svn log -r4 origin/trunk | grep ^r4 &&
	git svn log -r3 | grep ^r3
	
HEAD is now at 12025d0 feedme
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9118-git-svn-funky-branch-names/svnrepo/pr%20ject/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9118-git-svn-funky-branch-names/svnrepo/pr%20ject/branches/trailing_dot., 5
Committed r6
Found branch parent: (refs/remotes/origin/trailing_dot.) 30b317524641cdf0a9003cc121fe4ffc94fbd709
Following parent with do_switch
	A	#{bad_directory_name}/ booboo
	D	regular_dir_name/pretty
W: -empty_dir: regular_dir_name/pretty
Successfully followed parent
r6 = bc40964b8d48a766b76031978fe9e73a138878d7 (refs/remotes/git-svn)
r6 = 71a6395b1dc84327c8a7e4d0f9b876edf4e94013 (refs/remotes/origin/trailing_dot.)
No changes between 18e59dc11e221370a745de5c02afc19849749852 and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
ok 6 - rename pretty file into ugly one

expecting success: 
	echo .. > +_+ &&
	git update-index --add +_+ &&
	git commit -m plus &&
	mkdir gtk+ &&
	git mv +_+ gtk+/_+_ &&
	git commit -m plus_dir &&
	git svn dcommit
	
[master e3d4417] plus
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 +_+
[master 68f5c62] plus_dir
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename +_+ => gtk+/_+_ (100%)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9118-git-svn-funky-branch-names/svnrepo/pr%20ject/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9118-git-svn-funky-branch-names/svnrepo/pr%20ject/branches/trailing_dotlock.lock, 6
Found branch parent: (refs/remotes/origin/trailing_dotlock.lock) 30b317524641cdf0a9003cc121fe4ffc94fbd709
Following parent with do_switch
Successfully followed parent
r7 = e52d6a2a1c6316e29ee1b019b16221e6120d5475 (refs/remotes/origin/trailing_dotlock.lock)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9117-git-svn-init-clone/tmp/project/.git/
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9118-git-svn-funky-branch-names/svnrepo/pr%20ject/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9118-git-svn-funky-branch-names/svnrepo/pr%20ject/branches/not-a@%7B0%7Dreflog, 7
Found branch parent: (refs/remotes/origin/not-a@{0}reflog) 30b317524641cdf0a9003cc121fe4ffc94fbd709
Following parent with do_switch
Successfully followed parent
r8 = cac53f5c872827142bc21a71bc64dcf0e3d2401e (refs/remotes/origin/not-a@{0}reflog)
	A	foo
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9118-git-svn-funky-branch-names/svnrepo/pr%20ject/trunk r1
r1 = 28c678b0c32956a4e077ae19e3bfb3bbdb899c9d (refs/remotes/origin/trunk)
4b555dd7acc39936cdcaebe3b68b605d7afbd4f9
0ddc75095b46a062a201712721c99b2a7b5a5ce6
b01497111c7798acfd056cee26f94b8d3e33a654
74968698ef82d7c40dabb2eff0e57105966ef042
71a6395b1dc84327c8a7e4d0f9b876edf4e94013
e52d6a2a1c6316e29ee1b019b16221e6120d5475
cac53f5c872827142bc21a71bc64dcf0e3d2401e
ok 2 - test clone with funky branch names

expecting success: 
	(
		cd project &&
		git reset --hard 'refs/remotes/origin/more%20fun%20plugin!' &&
		echo hello >> foo &&
		git commit -m 'hello' -- foo &&
		git svn dcommit
	)
	
HEAD is now at 0ddc750 more fun!
[master 7936015] hello
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
r2 | buildd | 2015-12-16 11:12:47 +0000 (Wed, 16 Dec 2015) | 2 lines
ok 9 - clone with -s/-T/-b/-t assumes --prefix=origin/

expecting success: 
	test ! -d project &&
	git svn init -s "$svnrepo"/project project --prefix "" 2>warning &&
	test_must_fail grep -q prefix warning &&
	test_svn_configured_prefix "" &&
	rm -rf project &&
	rm -f warning
	
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9115-git-svn-dcommit-funky-renames/svnrepo ...
	A	+_+
Committed r7
	A	+_+
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9117-git-svn-init-clone/tmp/project/.git/
r7 = accad8b0990443755e1ba98fcca04295746f808c (refs/remotes/git-svn)
r4 | buildd | 2015-12-16 11:13:00 +0000 (Wed, 16 Dec 2015) | 2 lines
ok 10 - init with -s/-T/-b/-t and --prefix "" still works

expecting success: 
	test ! -d project &&
	git svn clone -s "$svnrepo"/project --prefix "" 2>warning &&
	test_must_fail grep -q prefix warning &&
	test_svn_configured_prefix "" &&
	rm -rf project &&
	rm -f warning
	
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9118-git-svn-funky-branch-names/svnrepo/pr%20ject/branches/more%20fun%20plugin! ...
	R	+_+ => gtk+/_+_
Committed r8
	M	foo
	D	+_+
	A	gtk+/_+_
W: -empty_dir: +_+
r8 = 0d0b4768e2ba918151ed1e461918c3b22f314c37 (refs/remotes/git-svn)
No changes between 68f5c62452cef0b0d3c615811bd529fd036e1ea5 and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
ok 7 - add a file with plus signs

expecting success: 
	git svn clone "$svnrepo" test-rebase &&
	(
		cd test-rebase &&
		echo test-rebase >test-rebase &&
		git add test-rebase &&
		git commit -m test-rebase
	)
	
Committed r9
	M	foo
r9 = 22333b877ca56939a8529d51c1890694d4d1698d (refs/remotes/origin/more fun plugin!)
No changes between 7936015c450742e810488d88e8705ef59bc70121 and refs/remotes/origin/more%20fun%20plugin!
Resetting to the latest refs/remotes/origin/more%20fun%20plugin!
ok 3 - test dcommit to funky branch

expecting success: 
	(
		cd project &&
		git reset --hard "refs/remotes/origin/$scary_ref" &&
		echo urls are scary >> foo &&
		git commit -m "eep" -- foo &&
		git svn dcommit
	)
	
HEAD is now at b014971 scary
[master 8c2db75] eep
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
r3 | buildd | 2015-12-16 11:12:53 +0000 (Wed, 16 Dec 2015) | 2 lines
ok 2 - run log

expecting success: 
	git reset --hard origin/trunk &&
	git svn log -r3 origin/a | grep ^r3
	
HEAD is now at 60db0b0 aye
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9117-git-svn-init-clone/tmp/project/.git/
	A	foo
r1 = 28c678b0c32956a4e077ae19e3bfb3bbdb899c9d (refs/remotes/trunk)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9115-git-svn-dcommit-funky-renames/test-rebase/.git/
ok 11 - clone with -s/-T/-b/-t and --prefix "" still works

# passed all 11 test(s)
1..11
*** t9119-git-svn-info.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9119-git-svn-info/.git/
	A	 leading space file
	A	#{cool_name}
	A	file name with spaces
W: +empty_dir:  leading space
W: +empty_dir: #{bad_directory_name}
W: +empty_dir: dir name with spaces
W: +empty_dir: regular_dir_name
r1 = 84e8e683693e5949db813012d42e016736ac9ef4 (refs/remotes/git-svn)
	A	#{bad_directory_name}/ foo
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9118-git-svn-funky-branch-names/svnrepo/pr%20ject/branches/Abo-Uebernahme%20(Bug%20%23994) ...
r2 = a6394d46d0a90d0486921405eea6fe66f3d6b08b (refs/remotes/git-svn)
r3 | buildd | 2015-12-16 11:12:53 +0000 (Wed, 16 Dec 2015) | 2 lines
ok 3 - run log against a from trunk

expecting success: 
	git reset --hard origin/trunk &&
	git svn log -r 1:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2-r4 -
	
HEAD is now at 60db0b0 aye
	D	#{bad_directory_name}/ foo
	A	file name with feces
W: -empty_dir: #{bad_directory_name}/ foo
r3 = 6efe358d0489dafff39603288c729530aa5ec214 (refs/remotes/git-svn)
	A	pretty
r4 = 4d46a856ea9c4a60e41b0e2fb89ba5a911f30962 (refs/remotes/git-svn)
	M	foo
	D	pretty
	A	regular_dir_name/pretty
W: -empty_dir: pretty
r5 = d999fef32e651c48ffcedc174bff3bb0edaf0fb7 (refs/remotes/git-svn)
	A	#{bad_directory_name}/ booboo
	D	regular_dir_name/pretty
W: -empty_dir: regular_dir_name/pretty
1..0 # SKIP skipping svn-info test (SVN version: 1.9.2 not supported)
r6 = bc40964b8d48a766b76031978fe9e73a138878d7 (refs/remotes/git-svn)
*** t9120-git-svn-clone-with-percent-escapes.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9120-git-svn-clone-with-percent-escapes/.git/
	A	+_+
Committed r10
r7 = accad8b0990443755e1ba98fcca04295746f808c (refs/remotes/git-svn)
	D	+_+
	A	gtk+/_+_
W: -empty_dir: +_+
	M	foo
r8 = 0d0b4768e2ba918151ed1e461918c3b22f314c37 (refs/remotes/git-svn)
r10 = c0a64786c8e899b43f74aff1d38c17cdfccc22b4 (refs/remotes/origin/Abo-Uebernahme (Bug #994))
No changes between 8c2db750b942835cee7dc12ed86193d9b752f598 and refs/remotes/origin/Abo-Uebernahme%20(Bug%20#994)
Resetting to the latest refs/remotes/origin/Abo-Uebernahme%20(Bug%20#994)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9115-git-svn-dcommit-funky-renames/svnrepo r8
creating empty directory:  leading space
creating empty directory: dir name with spaces
creating empty directory: regular_dir_name
ok 4 - test dcommit to scary branch

expecting success: 
	(
		cd project &&
		git reset --hard "refs/remotes/origin/trailing_dotlock%2Elock" &&
		echo who names branches like this anyway? >> foo &&
		git commit -m "bar" -- foo &&
		git svn dcommit
	)
	
HEAD is now at e52d6a2 trailing .lock
[master a8e5b31] test-rebase
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 test-rebase
ok 8 - clone the repository to test rebase

expecting success: 
		echo test-rebase-main > test-rebase-main &&
		git add test-rebase-main &&
		git commit -m test-rebase-main &&
		git svn dcommit
	
[master 16d863d] bar
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master 4792e6e] test-rebase-main
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 test-rebase-main
expecting success: 
	mkdir project project/trunk project/branches project/tags &&
	echo foo > project/trunk/foo &&
	svn_cmd import -m "$test_description" project "$svnrepo/pr ject" &&
	svn_cmd cp -m "branch" "$svnrepo/pr ject/trunk" \
	  "$svnrepo/pr ject/branches/b" &&
	svn_cmd cp -m "tag" "$svnrepo/pr ject/trunk" \
	  "$svnrepo/pr ject/tags/v1" &&
	rm -rf project &&
	start_httpd

ok 4 - test ascending revision range

expecting success: 
	git reset --hard origin/trunk &&
	git svn log --show-commit -r 1:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2-r4 -
	
HEAD is now at 60db0b0 aye
Adding         project/branches
Adding         project/tags
Adding         project/trunk
Adding         project/trunk/foo
Committing transaction...
Committed revision 1.
Committing transaction...
Committed revision 2.
Committing transaction...
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9118-git-svn-funky-branch-names/svnrepo/pr%20ject/branches/trailing_dotlock.lock ...
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9115-git-svn-dcommit-funky-renames/svnrepo ...
Committed revision 3.
SVN_HTTPD_PORT is not defined!
ok 1 - setup svnrepo

expecting success: 
	git svn clone "$svnrepo/pr%20ject" clone &&
	(
		cd clone &&
		git rev-parse refs/${remotes_git_svn}
	)

ok 5 - test ascending revision range with --show-commit

expecting success: 
	git svn find-rev r1 >expected-range-r1-r2-r4-sha1 &&
	git svn find-rev r2 >>expected-range-r1-r2-r4-sha1 &&
	git svn find-rev r4 >>expected-range-r1-r2-r4-sha1 &&
	git reset --hard origin/trunk &&
	git svn log --show-commit -r 1:4 | grep '^r[0-9]' | cut -d'|' -f2 >out &&
	git rev-parse $(cat out) >actual &&
	test_cmp expected-range-r1-r2-r4-sha1 actual
	
	M	foo
	A	test-rebase-main
Committed r9
Committed r11
	A	test-rebase-main
	M	foo
r9 = a0e59a4cb8ec500548ab1c311ac2a733d1b64ddd (refs/remotes/git-svn)
No changes between 4792e6eafa6a8288430dac17dc6ae22003a2ff40 and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
r11 = c943f7e0929036a267f3330705385e37aaf4f917 (refs/remotes/origin/trailing_dotlock.lock)
No changes between 16d863d6f91f35d81aa95f7bc7c2af6c9aa7bbd0 and refs/remotes/origin/trailing_dotlock%2Elock
Resetting to the latest refs/remotes/origin/trailing_dotlock%2Elock
ok 9 - make a commit to test rebase

expecting success: 
	cd test-rebase &&
		git svn rebase &&
		test -e test-rebase-main &&
		test -e test-rebase
	
ok 5 - test dcommit to trailing_dotlock branch

# passed all 5 test(s)
1..5
*** t9121-git-svn-fetch-renamed-dir.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9121-git-svn-fetch-renamed-dir/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9120-git-svn-clone-with-percent-escapes/clone/.git/
	A	trunk/foo
W: +empty_dir: branches
W: +empty_dir: tags
r1 = ac28883ddc1f10bc45dafd67d8736f757702d822 (refs/remotes/git-svn)
expecting success: 
	svnadmin load -q "$rawsvnrepo" < "$TEST_DIRECTORY"/t9121/renamed-dir.dump
	
	A	branches/b/foo
r2 = ddda387cfcba81c077998d49e13797c9ec807d6b (refs/remotes/git-svn)
	A	tags/v1/foo
r3 = f00ec374a5a2f9f0eff964577fae4e3e48f893b3 (refs/remotes/git-svn)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9120-git-svn-clone-with-percent-escapes/svnrepo/pr%20ject r3
f00ec374a5a2f9f0eff964577fae4e3e48f893b3
ok 2 - test clone with percent escapes

expecting success: 
	svn_cmd checkout "$svnrepo/pr%20ject" svn.percent &&
	svn_cmd checkout "$svnrepo/pr%20ject/trunk" svn.percent.trunk

A    svn.percent/branches
A    svn.percent/branches/b
A    svn.percent/branches/b/foo
A    svn.percent/tags
A    svn.percent/tags/v1
A    svn.percent/tags/v1/foo
A    svn.percent/trunk
A    svn.percent/trunk/foo
Checked out revision 3.
A    svn.percent.trunk/foo
Checked out revision 3.
ok 3 - svn checkout with percent escapes

expecting success: 
	svn_cmd checkout "$svnrepo/pr ject" svn.space &&
	svn_cmd checkout "$svnrepo/pr ject/trunk" svn.space.trunk

A    svn.space/branches
A    svn.space/branches/b
A    svn.space/branches/b/foo
A    svn.space/tags
A    svn.space/tags/v1
A    svn.space/tags/v1/foo
A    svn.space/trunk
A    svn.space/trunk/foo
Checked out revision 3.
A    svn.space.trunk/foo
Checked out revision 3.
ok 4 - svn checkout with space

expecting success: 
	git svn clone --minimize-url "$svnrepo/pr%20ject/trunk" minimize &&
	(
		cd minimize &&
		git rev-parse refs/${remotes_git_svn}
	)

ok 1 - load repository with renamed directory

expecting success: 
	git svn init "$svnrepo/newname" &&
	git svn fetch
	
	A	test-rebase-main
r9 = a0e59a4cb8ec500548ab1c311ac2a733d1b64ddd (refs/remotes/git-svn)
First, rewinding head to replay your work on top of it...
Applying: test-rebase
ok 10 - git svn rebase works inside a fresh-cloned repository

# passed all 10 test(s)
1..10
*** t9122-git-svn-author.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9122-git-svn-author/.git/
expecting success: 
	svn_cmd checkout "$svnrepo" work.svn &&
	(
		cd work.svn &&
		echo >file
		svn_cmd add file
		svn_cmd commit -m "first commit" file
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9120-git-svn-clone-with-percent-escapes/minimize/.git/
Checked out revision 0.
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9120-git-svn-clone-with-percent-escapes/svnrepo/pr%20ject/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9120-git-svn-clone-with-percent-escapes/svnrepo
A         file
HEAD is now at 60db0b0 aye
	A	foo
Adding         file
Transmitting file data .done
Committing transaction...
r1 = 7aff694536457870ce5650278e49e8b299e99b47 (refs/remotes/git-svn)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9120-git-svn-clone-with-percent-escapes/svnrepo/pr%20ject/trunk r1
7aff694536457870ce5650278e49e8b299e99b47
ok 5 - test clone trunk with percent escapes and minimize-url

expecting success: 
	git svn clone "$svnrepo/pr%20ject/trunk" trunk &&
	(
		cd trunk &&
		git rev-parse refs/${remotes_git_svn}
	)

Committed revision 1.
ok 1 - setup svn repository

expecting success: 
	mkdir work.git &&
	(
		cd work.git &&
		git svn init "$svnrepo"
		git svn fetch &&

		echo modification >file &&
		test_tick &&
		git commit -a -m second &&

		test_tick &&
		git svn dcommit &&

		echo "further modification" >file &&
		test_tick &&
		git commit -a -m third &&

		test_tick &&
		git svn --add-author-from dcommit &&

		echo "yet further modification" >file &&
		test_tick &&
		git commit -a -m fourth &&

		test_tick &&
		git svn --add-author-from --use-log-author dcommit &&

		git log &&

		git show -s HEAD^^ >../actual.2 &&
		git show -s HEAD^  >../actual.3 &&
		git show -s HEAD   >../actual.4

	) &&

	# Make sure that --add-author-from without --use-log-author
	# did not affect the authorship information
	myself=$(grep "^Author: " actual.2) &&
	unaffected=$(grep "^Author: " actual.3) &&
	test "z$myself" = "z$unaffected" &&

	# Make sure lack of --add-author-from did not add cruft
	! grep "^    From: A U Thor " actual.2 &&

	# Make sure --add-author-from added cruft
	grep "^    From: A U Thor " actual.3 &&
	grep "^    From: A U Thor " actual.4 &&

	# Make sure --add-author-from with --use-log-author affected
	# the authorship information
	grep "^Author: A U Thor " actual.4 &&

	# Make sure there are no commit messages with excess blank lines
	test $(grep "^ " actual.2 | wc -l) = 3 &&
	test $(grep "^ " actual.3 | wc -l) = 5 &&
	test $(grep "^ " actual.4 | wc -l) = 5 &&

	# Make sure there are no svn commit messages with excess blank lines
	(
		cd work.svn &&
		svn_cmd up &&
		
		test $(svn_cmd log -r2:2 | wc -l) = 5 &&
		test $(svn_cmd log -r4:4 | wc -l) = 7
	)

ok 6 - test ascending revision range with --show-commit (sha1)

expecting success: 
	git reset --hard origin/trunk &&
	git svn log -r 4:1 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4-r2-r1 -
	
HEAD is now at 60db0b0 aye
	A	a.txt
r2 = 99bee5b1f87a80313450e7ffbd26c3c428ca4eab (refs/remotes/git-svn)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9121-git-svn-fetch-renamed-dir/svnrepo/newname r2
ok 2 - init and fetch repository

# passed all 2 test(s)
1..2
*** t9123-git-svn-rebuild-with-rewriteroot.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9123-git-svn-rebuild-with-rewriteroot/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9120-git-svn-clone-with-percent-escapes/trunk/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9122-git-svn-author/work.git/.git/
	A	foo
r1 = 7aff694536457870ce5650278e49e8b299e99b47 (refs/remotes/git-svn)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9120-git-svn-clone-with-percent-escapes/svnrepo/pr%20ject/trunk r1
7aff694536457870ce5650278e49e8b299e99b47
ok 6 - test clone trunk with percent escapes

expecting success: 
	git svn clone --stdlayout "$svnrepo/pr%20ject" percent &&
	(
		cd percent &&
		git rev-parse refs/remotes/origin/trunk^0 &&
		git rev-parse refs/remotes/origin/b^0 &&
		git rev-parse refs/remotes/origin/tags/v1^0
	)

ok 7 - test descending revision range

expecting success: 
	git reset --hard origin/trunk &&
	git svn log -r 1:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2 -
	
HEAD is now at 60db0b0 aye
expecting success: 
	git svn init --rewrite-root=http://invalid.invalid/ "$svnrepo" &&
	git svn fetch &&
	git checkout -b mybranch ${remotes_git_svn}
	
	A	file
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9120-git-svn-clone-with-percent-escapes/percent/.git/
r1 = 422206e8c39045cd53b1722af126ddd2870f2149 (refs/remotes/git-svn)
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9120-git-svn-clone-with-percent-escapes/svnrepo/pr%20ject => file:///«PKGBUILDDIR»/t/trash%20directory.t9120-git-svn-clone-with-percent-escapes/svnrepo
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9122-git-svn-author/svnrepo r1
[master d80d923] second
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
	A	foo
ok 8 - test ascending revision range with unreachable revision

expecting success: 
	git reset --hard origin/trunk &&
	git svn log -r 3:1 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r2-r1 -
	
HEAD is now at 60db0b0 aye
r1 = 7aff694536457870ce5650278e49e8b299e99b47 (refs/remotes/origin/trunk)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9120-git-svn-clone-with-percent-escapes/svnrepo/pr%20ject/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9120-git-svn-clone-with-percent-escapes/svnrepo/pr%20ject/branches/b, 1
Found branch parent: (refs/remotes/origin/b) 7aff694536457870ce5650278e49e8b299e99b47
Following parent with do_switch
Successfully followed parent
r2 = ba6d5cdd3dbbef9e0c5267986fa75202b53cf96b (refs/remotes/origin/b)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9120-git-svn-clone-with-percent-escapes/svnrepo/pr%20ject/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9120-git-svn-clone-with-percent-escapes/svnrepo/pr%20ject/tags/v1, 2
Found branch parent: (refs/remotes/origin/tags/v1) 7aff694536457870ce5650278e49e8b299e99b47
Following parent with do_switch
Successfully followed parent
r3 = 4c8574323798e44769bddbaac43625397f6a7996 (refs/remotes/origin/tags/v1)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9120-git-svn-clone-with-percent-escapes/svnrepo/pr%20ject/trunk r1
7aff694536457870ce5650278e49e8b299e99b47
ba6d5cdd3dbbef9e0c5267986fa75202b53cf96b
4c8574323798e44769bddbaac43625397f6a7996
ok 7 - test clone --stdlayout with percent escapes

expecting success: 
	git svn clone -s "$svnrepo/pr ject" --prefix origin/ space &&
	(
		cd space &&
		git rev-parse refs/remotes/origin/trunk^0 &&
		git rev-parse refs/remotes/origin/b^0 &&
		git rev-parse refs/remotes/origin/tags/v1^0
	)

Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9122-git-svn-author/svnrepo ...
ok 9 - test descending revision range with unreachable revision

expecting success: 
	git reset --hard origin/trunk &&
	git svn log -r 2:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r2 -
	
HEAD is now at 60db0b0 aye
	M	file
Committed r2
	M	file
	A	foo
r2 = 850cdd576c51829e4cd3b656e2b1a89c1351c084 (refs/remotes/git-svn)
No changes between d80d9233a8fd94555050582e2cb9ca75066fd9d6 and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
r1 = 8e7c5c3a42d7d51341045a055aa341e8f169274a (refs/remotes/git-svn)
[master a88d6c7] third
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9123-git-svn-rebuild-with-rewriteroot/svnrepo r1
Switched to a new branch 'mybranch'
ok 1 - init, fetch and checkout repository

expecting success: 
	rm "$GIT_SVN_DIR"/.rev_map.*
	
ok 2 - remove rev_map

expecting success: 
	git svn rebase >/dev/null
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9120-git-svn-clone-with-percent-escapes/space/.git/
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9120-git-svn-clone-with-percent-escapes/svnrepo/pr%20ject => file:///«PKGBUILDDIR»/t/trash%20directory.t9120-git-svn-clone-with-percent-escapes/svnrepo
ok 10 - test ascending revision range with unreachable upper boundary revision and 1 commit

expecting success: 
	git reset --hard origin/trunk &&
	git svn log -r 3:2 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r2 -
	
HEAD is now at 60db0b0 aye
	A	foo
r1 = 7aff694536457870ce5650278e49e8b299e99b47 (refs/remotes/origin/trunk)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9120-git-svn-clone-with-percent-escapes/svnrepo/pr%20ject/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9120-git-svn-clone-with-percent-escapes/svnrepo/pr%20ject/branches/b, 1
Found branch parent: (refs/remotes/origin/b) 7aff694536457870ce5650278e49e8b299e99b47
Following parent with do_switch
Successfully followed parent
r2 = ba6d5cdd3dbbef9e0c5267986fa75202b53cf96b (refs/remotes/origin/b)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9120-git-svn-clone-with-percent-escapes/svnrepo/pr%20ject/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9120-git-svn-clone-with-percent-escapes/svnrepo/pr%20ject/tags/v1, 2
Found branch parent: (refs/remotes/origin/tags/v1) 7aff694536457870ce5650278e49e8b299e99b47
Following parent with do_switch
Successfully followed parent
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9122-git-svn-author/svnrepo ...
r3 = 4c8574323798e44769bddbaac43625397f6a7996 (refs/remotes/origin/tags/v1)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9120-git-svn-clone-with-percent-escapes/svnrepo/pr%20ject/trunk r1
7aff694536457870ce5650278e49e8b299e99b47
ok 3 - rebuild rev_map

ba6d5cdd3dbbef9e0c5267986fa75202b53cf96b
# passed all 3 test(s)
1..3
4c8574323798e44769bddbaac43625397f6a7996
ok 8 - test clone -s with unescaped space

# passed all 8 test(s)
1..8
*** t9124-git-svn-dcommit-auto-props.sh ***
	M	file
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9124-git-svn-dcommit-auto-props/.git/
*** t9125-git-svn-multi-glob-branch-names.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9125-git-svn-multi-glob-branch-names/.git/
ok 11 - test descending revision range with unreachable upper boundary revision and 1 commit

expecting success: 
	git reset --hard origin/trunk &&
	git svn log -r 3:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -
	
HEAD is now at 60db0b0 aye
Committed r3
	M	file
r3 = 39567015744382d401d480e711b05d5e7ae82744 (refs/remotes/git-svn)
No changes between a88d6c780b7a3306912385ba57e236b03bc75f99 and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
[master d803fe9] fourth
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
expecting success: 
	mkdir import &&
	(
		cd import &&
		echo foo >foo &&
		svn_cmd import -m "import for git svn" . "$svnrepo"
	) &&
	rm -rf import &&
	git svn init "$svnrepo" &&
	git svn fetch

expecting success: 
	mkdir project project/trunk project/branches \
			project/branches/v14.1 project/tags &&
	echo foo > project/trunk/foo &&
	svn_cmd import -m "$test_description" project "$svnrepo/project" &&
	rm -rf project &&
	svn_cmd cp -m "fun" "$svnrepo/project/trunk" \
	                "$svnrepo/project/branches/v14.1/beta" &&
	svn_cmd cp -m "more fun!" "$svnrepo/project/branches/v14.1/beta" \
	                      "$svnrepo/project/branches/v14.1/gold"
	
Adding         foo
Committing transaction...
Adding         project/branches
Adding         project/branches/v14.1
Adding         project/tags
Adding         project/trunk
Adding         project/trunk/foo
Committing transaction...
ok 12 - test ascending revision range with unreachable lower boundary revision and 1 commit

expecting success: 
	git reset --hard origin/trunk &&
	git svn log -r 4:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -
	
HEAD is now at 60db0b0 aye
Committed revision 1.
Committed revision 1.
Committing transaction...
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9122-git-svn-author/svnrepo ...
Committed revision 2.
Committing transaction...
	M	file
ok 13 - test descending revision range with unreachable lower boundary revision and 1 commit

expecting success: 
	git reset --hard origin/trunk &&
	git svn log -r 5:6 | test_cmp expected-separator -
	
HEAD is now at 60db0b0 aye
Committed revision 3.
ok 1 - setup svnrepo

expecting success: 
	git svn clone -T trunk -b branches/*/* -t tags \
	              "$svnrepo/project" project &&
	(cd project &&
		git rev-parse "refs/remotes/origin/v14.1/beta" &&
		git rev-parse "refs/remotes/origin/v14.1/gold"
	)
	
Committed r4
	M	file
r4 = 8f09d0f1f0041d49093eccfce6c6bf78bf8f4bdb (refs/remotes/git-svn)
No changes between d803fe9516bb41b239c5574c9e3e32bd47bb1738 and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
commit 8f09d0f1f0041d49093eccfce6c6bf78bf8f4bdb
Author: A U Thor <author@example.com>
Date:   Wed Dec 16 11:14:09 2015 +0000

    fourth
    
    From: A U Thor <author@example.com>
    
    git-svn-id: file:///«PKGBUILDDIR»/t/trash%20directory.t9122-git-svn-author/svnrepo@4 d5dd5f9a-761b-4b29-9692-ab4e6cfdbf8e

commit 39567015744382d401d480e711b05d5e7ae82744
Author: buildd <buildd@d5dd5f9a-761b-4b29-9692-ab4e6cfdbf8e>
Date:   Wed Dec 16 11:14:03 2015 +0000

    third
    
    From: A U Thor <author@example.com>
    
    git-svn-id: file:///«PKGBUILDDIR»/t/trash%20directory.t9122-git-svn-author/svnrepo@3 d5dd5f9a-761b-4b29-9692-ab4e6cfdbf8e

commit 850cdd576c51829e4cd3b656e2b1a89c1351c084
Author: buildd <buildd@d5dd5f9a-761b-4b29-9692-ab4e6cfdbf8e>
Date:   Wed Dec 16 11:13:56 2015 +0000

    second
    
    git-svn-id: file:///«PKGBUILDDIR»/t/trash%20directory.t9122-git-svn-author/svnrepo@2 d5dd5f9a-761b-4b29-9692-ab4e6cfdbf8e

commit 422206e8c39045cd53b1722af126ddd2870f2149
Author: buildd <buildd@d5dd5f9a-761b-4b29-9692-ab4e6cfdbf8e>
Date:   Wed Dec 16 11:13:42 2015 +0000

    first commit
    
    git-svn-id: file:///«PKGBUILDDIR»/t/trash%20directory.t9122-git-svn-author/svnrepo@1 d5dd5f9a-761b-4b29-9692-ab4e6cfdbf8e
    From: A U Thor <author@example.com>
    From: A U Thor <author@example.com>
Author: A U Thor <author@example.com>
Updating '.':
U    file
Updated to revision 4.
ok 2 - interact with it via git svn

# passed all 2 test(s)
1..2
*** t9126-git-svn-follow-deleted-readded-directory.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9126-git-svn-follow-deleted-readded-directory/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9125-git-svn-multi-glob-branch-names/project/.git/
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9125-git-svn-multi-glob-branch-names/svnrepo/project => file:///«PKGBUILDDIR»/t/trash%20directory.t9125-git-svn-multi-glob-branch-names/svnrepo
ok 14 - test ascending revision range with unreachable boundary revisions and no commits

expecting success: 
	git reset --hard origin/trunk &&
	git svn log -r 6:5 | test_cmp expected-separator -
	
	A	foo
HEAD is now at 60db0b0 aye
1..0 # SKIP skipping svnserve test. (set $SVNSERVE_PORT to enable)
*** t9127-git-svn-partial-rebuild.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9127-git-svn-partial-rebuild/.git/
r1 = 46bc808c88814633157296e8b52baed03f3d0630 (refs/remotes/git-svn)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9124-git-svn-dcommit-auto-props/svnrepo r1
ok 1 - initialize git svn

expecting success: 
	mkdir user &&
	generate_auto_props yes >user/config

ok 2 - enable auto-props config

expecting success: 
	echo "#!$SHELL_PATH" >exec1.sh &&
	chmod +x exec1.sh &&
	echo "hello" >hello.txt &&
	echo bar >bar &&
	git add exec1.sh hello.txt bar &&
	git commit -m "files for enabled auto-props" &&
	git svn dcommit --config-dir=user

	A	foo
[master 505048a] files for enabled auto-props
 Author: A U Thor <author@example.com>
 3 files changed, 3 insertions(+)
 create mode 100644 bar
 create mode 100755 exec1.sh
 create mode 100644 hello.txt
r1 = 03151cf43e74ca424ba226b4b684e36d1714e288 (refs/remotes/origin/trunk)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9125-git-svn-multi-glob-branch-names/svnrepo/project/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9125-git-svn-multi-glob-branch-names/svnrepo/project/branches/v14.1/beta, 1
Found branch parent: (refs/remotes/origin/v14.1/beta) 03151cf43e74ca424ba226b4b684e36d1714e288
Following parent with do_switch
Successfully followed parent
expecting success: 
	mkdir import &&
	(
		(cd import &&
		mkdir trunk branches tags &&
		(cd trunk &&
		echo foo > foo
		) &&
		svn_cmd import -m "import for git-svn" . "$svnrepo" >/dev/null &&
		svn_cmd copy "$svnrepo"/trunk "$svnrepo"/branches/a \
			-m "created branch a"
		) &&
		rm -rf import &&
		svn_cmd co "$svnrepo"/trunk trunk &&
		(cd trunk &&
		echo bar >> foo &&
		svn_cmd ci -m "updated trunk"
		) &&
		svn_cmd co "$svnrepo"/branches/a a &&
		(cd a &&
		echo baz >> a &&
		svn_cmd add a &&
		svn_cmd ci -m "updated a"
		) &&
		git svn init --stdlayout "$svnrepo"
	)

r2 = 212686ac9c35ea4ee1ab9c10867c5f3406b70eef (refs/remotes/origin/v14.1/beta)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9125-git-svn-multi-glob-branch-names/svnrepo/project/branches/v14.1/beta => file:///«PKGBUILDDIR»/t/trash%20directory.t9125-git-svn-multi-glob-branch-names/svnrepo/project/branches/v14.1/gold, 2
Found branch parent: (refs/remotes/origin/v14.1/gold) 212686ac9c35ea4ee1ab9c10867c5f3406b70eef
Following parent with do_switch
Successfully followed parent
r3 = 3c3eecd23e981e64831563b39a708d93a9787ea2 (refs/remotes/origin/v14.1/gold)
ok 15 - test descending revision range with unreachable boundary revisions and no commits

expecting success: 
	git reset --hard origin/trunk &&
	git svn log -r 3:5 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -
	
HEAD is now at 60db0b0 aye
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9125-git-svn-multi-glob-branch-names/svnrepo/project/trunk r1
Committing transaction...
212686ac9c35ea4ee1ab9c10867c5f3406b70eef
3c3eecd23e981e64831563b39a708d93a9787ea2
ok 2 - test clone with multi-glob in branch names

expecting success: 
	(cd project &&
	git reset --hard 'refs/remotes/origin/v14.1/gold' &&
	echo hello >> foo &&
	git commit -m 'hello' -- foo &&
	git svn dcommit
	)
	
HEAD is now at 3c3eecd more fun!
[master 05ff94a] hello
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Committed revision 2.
A    trunk/foo
Checked out revision 2.
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9124-git-svn-dcommit-auto-props/svnrepo ...
Sending        foo
Transmitting file data .done
Committing transaction...
	A	bar
	A	exec1.sh
	A	hello.txt
Committed revision 3.
A    a/foo
Checked out revision 3.
A         a
Committed r2
ok 16 - test ascending revision range with unreachable boundary revisions and 1 commit

expecting success: 
	git reset --hard origin/trunk &&
	git svn log -r 5:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -
	
HEAD is now at 60db0b0 aye
Adding         a
Transmitting file data .done
Committing transaction...
	A	bar
	A	exec1.sh
	A	hello.txt
r2 = c3900e78092f1430f2a320a6c55d8f7c36e40660 (refs/remotes/git-svn)
No changes between 505048ae82fa3dfb50d7e187286fe72141cb24ad and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9125-git-svn-multi-glob-branch-names/svnrepo/project/branches/v14.1/gold ...
Committed revision 4.
ok 3 - add files matching auto-props

expecting success: 
	generate_auto_props no >user/config

ok 4 - disable auto-props config

expecting success: 
	echo "#$SHELL_PATH" >exec2.sh &&
	chmod +x exec2.sh &&
	echo "world" >world.txt &&
	echo zot >zot &&
	git add exec2.sh world.txt zot &&
	git commit -m "files for disabled auto-props" &&
	git svn dcommit --config-dir=user

[master 8d90ab5] files for disabled auto-props
 Author: A U Thor <author@example.com>
 3 files changed, 3 insertions(+)
 create mode 100755 exec2.sh
 create mode 100644 world.txt
 create mode 100644 zot
	M	foo
Committed r4
	M	foo
r4 = 1a397808de70bbb06fca31f66f9519cca4467d59 (refs/remotes/origin/v14.1/gold)
No changes between 05ff94af29ac20bd654635d578dd8d27f2d53464 and refs/remotes/origin/v14.1/gold
Resetting to the latest refs/remotes/origin/v14.1/gold
ok 17 - test descending revision range with unreachable boundary revisions and 1 commit

# passed all 17 test(s)
1..17
ok 3 - test dcommit to multi-globbed branch

# passed all 3 test(s)
1..3
*** t9128-git-svn-cmd-branch.sh ***
*** t9129-git-svn-i18n-commitencoding.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9128-git-svn-cmd-branch/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9129-git-svn-i18n-commitencoding/.git/
ok 1 - initialize svnrepo

expecting success: 
	git svn fetch -r1:2

Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9124-git-svn-dcommit-auto-props/svnrepo ...
	A	exec2.sh
	A	world.txt
	A	zot
expecting success: 
		mkdir $H &&
		svn_cmd import -m "$H test" $H "$svnrepo"/$H &&
		git svn clone "$svnrepo"/$H $H
	
expecting success: 
	mkdir import &&
	(
		(cd import &&
		mkdir trunk branches tags &&
		(cd trunk &&
		echo foo > foo
		) &&
		svn_cmd import -m "import for git-svn" . "$svnrepo" >/dev/null
		) &&
		rm -rf import &&
		svn_cmd co "$svnrepo"/trunk trunk &&
		(cd trunk &&
		echo bar >> foo &&
		svn_cmd ci -m "updated trunk"
		) &&
		rm -rf trunk
	)

Committing transaction...
Committed r3
	A	exec2.sh
	A	world.txt
	A	zot
r3 = 525e6c87b483346bbfd051c7d92b7726b0c3fa63 (refs/remotes/git-svn)
No changes between 8d90ab59c41c8f36b6065725992c9e961d577069 and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
ok 5 - add files matching disabled auto-props

expecting success: 
(
	mkdir work &&
	cd work &&
	svn_cmd co "$svnrepo" &&
	cd svnrepo &&

	# Check properties from first commit.
	test "x$(svn_cmd propget svn:executable exec1.sh)" = "x*" &&
	test "x$(svn_cmd propget svn:mime-type exec1.sh)" = \
	     "xapplication/x-shellscript" &&
	test "x$(svn_cmd propget svn:mime-type hello.txt)" = "xtext/plain" &&
	test "x$(svn_cmd propget svn:eol-style hello.txt)" = "xnative" &&
	test "x$(svn_cmd propget svn:mime-type bar)" = "x" &&

	# Check properties from second commit.
	test "x$(svn_cmd propget svn:executable exec2.sh)" = "x*" &&
	test "x$(svn_cmd propget svn:mime-type exec2.sh)" = "x" &&
	test "x$(svn_cmd propget svn:mime-type world.txt)" = "x" &&
	test "x$(svn_cmd propget svn:eol-style world.txt)" = "x" &&
	test "x$(svn_cmd propget svn:mime-type zot)" = "x"
)

A    svnrepo/bar
A    svnrepo/exec1.sh
A    svnrepo/exec2.sh
A    svnrepo/foo
A    svnrepo/hello.txt
A    svnrepo/world.txt
A    svnrepo/zot
Checked out revision 3.
Committed revision 1.
A    trunk/foo
Checked out revision 1.
svn: warning: W200017: Property 'svn:mime-type' not found on 'bar'
svn: E200000: A problem occurred; see other errors for details
svn: warning: W200017: Property 'svn:mime-type' not found on 'exec2.sh'
svn: E200000: A problem occurred; see other errors for details
	A	foo
svn: warning: W200017: Property 'svn:mime-type' not found on 'world.txt'
svn: E200000: A problem occurred; see other errors for details
Sending        foo
Transmitting file data .done
Committing transaction...
svn: warning: W200017: Property 'svn:eol-style' not found on 'world.txt'
svn: E200000: A problem occurred; see other errors for details
svn: warning: W200017: Property 'svn:mime-type' not found on 'zot'
svn: E200000: A problem occurred; see other errors for details
r1 = 4ef7d681ab7cacc6042ac848f65f8bbf48284eb5 (refs/remotes/origin/trunk)
ok 6 - check resulting svn repository

expecting success: 
	test -d user &&
	generate_auto_props yes > user/config &&
	git mv foo foo.sh &&
	git commit -m "foo => foo.sh" &&
	git svn dcommit --config-dir=user &&
	(
		cd work/svnrepo &&
		svn_cmd up &&
		test ! -e foo &&
		test -e foo.sh &&
		test "x$(svn_cmd propget svn:mime-type foo.sh)" = \
		     "xapplication/x-shellscript" &&
		test "x$(svn_cmd propget svn:eol-style foo.sh)" = "xLF"
	)

[master d6395d9] foo => foo.sh
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename foo => foo.sh (100%)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9127-git-svn-partial-rebuild/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9127-git-svn-partial-rebuild/svnrepo/branches/a, 1
Committed revision 2.
ok 1 - initialize svnrepo

expecting success: 
	git svn init --stdlayout "$svnrepo" &&
	git svn fetch &&
	git checkout remotes/origin/trunk

Found branch parent: (refs/remotes/origin/a) 4ef7d681ab7cacc6042ac848f65f8bbf48284eb5
Following parent with do_switch
Successfully followed parent
r2 = 933033fbdb8b2f9668a7e8352ff94f52a2bc7881 (refs/remotes/origin/a)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9127-git-svn-partial-rebuild/svnrepo/trunk r1
ok 2 - import an early SVN revision into git

expecting success: 
	mkdir mirror &&
	(
		(cd mirror &&
		git init &&
		git svn init --stdlayout "$svnrepo" &&
		git svn fetch
		)
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9127-git-svn-partial-rebuild/mirror/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9129-git-svn-i18n-commitencoding/ISO8859-1/.git/
r1 = 4d3a9eaf821a03a38f538eb355a29b168d528d23 (refs/remotes/git-svn)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9129-git-svn-i18n-commitencoding/svnrepo/ISO8859-1 r1
ok 1 - ISO8859-1 setup

expecting success: 
		mkdir $H &&
		svn_cmd import -m "$H test" $H "$svnrepo"/$H &&
		git svn clone "$svnrepo"/$H $H
	
Committing transaction...
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9124-git-svn-dcommit-auto-props/svnrepo ...
Committed revision 2.
	R	foo => foo.sh
Committed r4
	D	foo
	A	foo.sh
W: -empty_dir: foo
r4 = ed9c820182f9634bdf5fc069052f918ac3c963d4 (refs/remotes/git-svn)
No changes between d6395d9e7464177fa9cab57eaf15a433b3aff29f and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
Updating '.':
D    foo
A    foo.sh
Updated to revision 4.
ok 7 - check renamed file

# passed all 7 test(s)
1..7
*** t9130-git-svn-authors-file.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9130-git-svn-authors-file/.git/
	A	foo
r1 = 1ad1e976569ddd5bd60b62e99663feec22641081 (refs/remotes/origin/trunk)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9129-git-svn-i18n-commitencoding/eucJP/.git/
	M	foo
r2 = dfb256165db4ebce9725ea4eaf330a952deab74a (refs/remotes/origin/trunk)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/trunk r2
r2 = f26acef9d7801eb123cb65285aceb9efb7ea37a6 (refs/remotes/git-svn)
expecting success: 
	for i in aa bb cc dd
	do
		svn_cmd mkdir -m $i --username $i "$svnrepo"/$i
	done
	
Note: checking out 'remotes/origin/trunk'.

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 dfb2561... updated trunk
ok 2 - import into git

expecting success: 
	git svn branch a &&
	base=$(git rev-parse HEAD:) &&
	test $base = $(git rev-parse remotes/origin/a:) &&
	git svn branch -m "created branch b blah" b &&
	test $base = $(git rev-parse remotes/origin/b:) &&
	test_must_fail git branch -m "no branchname" &&
	git svn branch -n c &&
	test_must_fail git rev-parse remotes/origin/c &&
	test_must_fail git svn branch a &&
	git svn branch -t tag1 &&
	test $base = $(git rev-parse remotes/origin/tags/tag1:) &&
	git svn branch --tag tag2 &&
	test $base = $(git rev-parse remotes/origin/tags/tag2:) &&
	git svn tag tag3 &&
	test $base = $(git rev-parse remotes/origin/tags/tag3:) &&
	git svn tag -m "created tag4 foo" tag4 &&
	test $base = $(git rev-parse remotes/origin/tags/tag4:) &&
	test_must_fail git svn tag -m "no tagname" &&
	git svn tag -n tag5 &&
	test_must_fail git rev-parse remotes/origin/tags/tag5 &&
	test_must_fail git svn tag tag1

	A	foo
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9129-git-svn-i18n-commitencoding/svnrepo/eucJP r2
ok 2 - eucJP setup

expecting success: 
		mkdir $H &&
		svn_cmd import -m "$H test" $H "$svnrepo"/$H &&
		git svn clone "$svnrepo"/$H $H
	
Committing transaction...
r1 = 4ef7d681ab7cacc6042ac848f65f8bbf48284eb5 (refs/remotes/origin/trunk)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9127-git-svn-partial-rebuild/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9127-git-svn-partial-rebuild/svnrepo/branches/a, 1
Committing transaction...
Found branch parent: (refs/remotes/origin/a) 4ef7d681ab7cacc6042ac848f65f8bbf48284eb5
Following parent with do_switch
Committed revision 1.
Successfully followed parent
r2 = 933033fbdb8b2f9668a7e8352ff94f52a2bc7881 (refs/remotes/origin/a)
	M	foo
Committed revision 3.
r3 = 6874972113f13d6849c972dd5792f1b9f6dd3648 (refs/remotes/origin/trunk)
Committing transaction...
	A	a
r4 = ac5218bce9c6c93a7a1367399fc849c6e1529241 (refs/remotes/origin/a)
Committed revision 2.
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9127-git-svn-partial-rebuild/svnrepo/trunk r3
Committing transaction...
ok 3 - make full git mirror of SVN

expecting success: 
	git config --add remote.origin.url "file://$PWD/mirror/.git" &&
	git config --add remote.origin.fetch refs/remotes/*:refs/remotes/* &&
	git fetch origin &&
	git svn fetch

From file:///«PKGBUILDDIR»/t/trash directory.t9127-git-svn-partial-rebuild/mirror/
   933033f..ac5218b  origin/a   -> origin/a
   4ef7d68..6874972  origin/trunk -> origin/trunk
Committed revision 3.
Copying file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/trunk at r2 to file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/branches/a...
Committing transaction...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9129-git-svn-i18n-commitencoding/ISO-2022-JP/.git/
Committed revision 4.
ok 1 - setup svnrepo

expecting success: 
	test_must_fail git svn clone --authors-file=svn-authors "$svnrepo" x
	
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/branches/a, 2
Found branch parent: (refs/remotes/origin/a) dfb256165db4ebce9725ea4eaf330a952deab74a
r3 = 9886c7ae14ae83e2bdff0c50f92429d4067c8f4d (refs/remotes/git-svn)
Following parent with do_switch
Successfully followed parent
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9129-git-svn-i18n-commitencoding/svnrepo/ISO-2022-JP r3
ok 3 - ISO-2022-JP setup

expecting success: 
	(
		cd $H &&
		git config i18n.commitencoding $H &&
		git checkout -b t refs/remotes/git-svn &&
		echo $H >F &&
		git add F &&
		git commit -a -F "$TEST_DIRECTORY"/t3900/$H.txt &&
		E=$(git cat-file commit HEAD | sed -ne "s/^encoding //p") &&
		test "z$E" = "z$H"
		compare_git_head_with "$TEST_DIRECTORY"/t3900/$H.txt
	)
	
Switched to a new branch 't'
r3 = 6f04c4a74ff8806c362e5c2b218ec36ada130abc (refs/remotes/origin/a)
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 F
ok 4 - ISO8859-1 commit on git side

expecting success: 
	(
		cd $H &&
		git config i18n.commitencoding $H &&
		git checkout -b t refs/remotes/git-svn &&
		echo $H >F &&
		git add F &&
		git commit -a -F "$TEST_DIRECTORY"/t3900/$H.txt &&
		E=$(git cat-file commit HEAD | sed -ne "s/^encoding //p") &&
		test "z$E" = "z$H"
		compare_git_head_with "$TEST_DIRECTORY"/t3900/$H.txt
	)
	
Partial-rebuilding .git/svn/refs/remotes/origin/trunk/.rev_map.144cbb15-3788-492f-a5dc-3e12f0cb55b6 ...
Currently at 1 = 4ef7d681ab7cacc6042ac848f65f8bbf48284eb5
r3 = 6874972113f13d6849c972dd5792f1b9f6dd3648
Done rebuilding .git/svn/refs/remotes/origin/trunk/.rev_map.144cbb15-3788-492f-a5dc-3e12f0cb55b6
Switched to a new branch 't'
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 F
ok 5 - eucJP commit on git side

expecting success: 
	(
		cd $H &&
		git config i18n.commitencoding $H &&
		git checkout -b t refs/remotes/git-svn &&
		echo $H >F &&
		git add F &&
		git commit -a -F "$TEST_DIRECTORY"/t3900/$H.txt &&
		E=$(git cat-file commit HEAD | sed -ne "s/^encoding //p") &&
		test "z$E" = "z$H"
		compare_git_head_with "$TEST_DIRECTORY"/t3900/$H.txt
	)
	
Switched to a new branch 't'
Partial-rebuilding .git/svn/refs/remotes/origin/a/.rev_map.144cbb15-3788-492f-a5dc-3e12f0cb55b6 ...
Currently at 2 = 933033fbdb8b2f9668a7e8352ff94f52a2bc7881
[t 99e03ee] $B$O$l$R$[$U(B
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 F
r4 = ac5218bce9c6c93a7a1367399fc849c6e1529241
Done rebuilding .git/svn/refs/remotes/origin/a/.rev_map.144cbb15-3788-492f-a5dc-3e12f0cb55b6
ok 6 - ISO-2022-JP commit on git side

expecting success: 
	(
		cd $H &&
		git svn dcommit &&
		git cat-file commit HEAD | grep git-svn-id: &&
		E=$(git cat-file commit HEAD | sed -ne "s/^encoding //p") &&
		test "z$E" = "z$H" &&
		compare_git_head_with "$TEST_DIRECTORY"/t3900/$H.txt
	)
	
ok 4 - fetch from git mirror and partial-rebuild

# passed all 4 test(s)
1..4
*** t9131-git-svn-empty-symlink.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9131-git-svn-empty-symlink/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9130-git-svn-authors-file/x/.git/
expecting success: 
	svnadmin load "$rawsvnrepo" <<EOF
SVN-fs-dump-format-version: 2

UUID: 60780f9a-7df5-43b4-83ab-60e2c0673ef7

Revision-number: 0
Prop-content-length: 56
Content-length: 56

K 8
svn:date
V 27
2008-11-26T07:17:27.590577Z
PROPS-END

Revision-number: 1
Prop-content-length: 111
Content-length: 111

K 7
svn:log
V 4
test
K 10
svn:author
V 12
normalperson
K 8
svn:date
V 27
2008-11-26T07:18:03.511836Z
PROPS-END

Node-path: bar
Node-kind: file
Node-action: add
Prop-content-length: 33
Text-content-length: 0
Text-content-md5: d41d8cd98f00b204e9800998ecf8427e
Content-length: 33

K 11
svn:special
V 1
*
PROPS-END

Revision-number: 2
Prop-content-length: 121
Content-length: 121

K 7
svn:log
V 13
bar => doink

K 10
svn:author
V 12
normalperson
K 8
svn:date
V 27
2008-11-27T03:55:31.601672Z
PROPS-END

Node-path: bar
Node-kind: file
Node-action: change
Text-content-length: 10
Text-content-md5: 92ca4fe7a9721f877f765c252dcd66c9
Content-length: 10

link doink

EOF

<<< Started new transaction, based on original revision 1
W: +empty_dir: aa
     * editing path : bar ... done.
r1 = 336113faf72dddda10463b52e04a7d9961994316 (refs/remotes/git-svn)

------- Committed revision 1 >>>

Copying file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/trunk at r2 to file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/branches/b...
W: +empty_dir: bb
r2 = e5519467a877e086d7a6f66d9026d9443e24a998 (refs/remotes/git-svn)
<<< Started new transaction, based on original revision 2
     * editing path : bar ... done.
W: +empty_dir: cc
Author: cc not defined in svn-authors file

ok 2 - start import with incomplete authors file

expecting success: 
	(
		cd x
		test "`git rev-list refs/remotes/git-svn | wc -l`" -eq 2 &&
		git rev-list -1 --pretty=raw refs/remotes/git-svn | \
		  grep "^author BBBBBBB BBBBBBB <bb@example\.com> " &&
		git rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \
		  grep "^author AAAAAAA AAAAAAA <aa@example\.com> "
	)
	
author BBBBBBB BBBBBBB <bb@example.com> 1450264478 +0000
author AAAAAAA AAAAAAA <aa@example.com> 1450264477 +0000
ok 3 - imported 2 revisions successfully

expecting success: 
	(
		cd x
		git svn fetch --authors-file=../svn-authors &&
		test "`git rev-list refs/remotes/git-svn | wc -l`" -eq 4 &&
		git rev-list -1 --pretty=raw refs/remotes/git-svn | \
		  grep "^author DDDDDDD DDDDDDD <dd@example\.com> " &&
		git rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \
		  grep "^author CCCCCCC CCCCCCC <cc@example\.com> "
	)
	
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9129-git-svn-i18n-commitencoding/svnrepo/ISO8859-1 ...

------- Committed revision 2 >>>

ok 1 - load svn dumpfile

expecting success: git svn clone -r1 "$svnrepo" x
	A	F
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/branches/b, 2
Found branch parent: (refs/remotes/origin/b) dfb256165db4ebce9725ea4eaf330a952deab74a
Following parent with do_switch
Committed r4
Successfully followed parent
r4 = 81a508e104030af7ba26d26dd30bd6ebf78d551c (refs/remotes/origin/b)
	A	F
r4 = 694e3fce801142188d9db820d261c997db7b02c0 (refs/remotes/git-svn)
fatal: 'no branchname' is not a valid branch name.
No changes between 31b0ffaa8237a08bb8c1cc0c3cbd66eec3fc476a and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
git-svn-id: file:///«PKGBUILDDIR»/t/trash%20directory.t9129-git-svn-i18n-commitencoding/svnrepo/ISO8859-1@4 965f4afb-c337-459f-a77a-2ab21cefb79b
ok 7 - ISO8859-1 dcommit to svn

expecting success: 
	(
		cd $H &&
		git svn dcommit &&
		git cat-file commit HEAD | grep git-svn-id: &&
		E=$(git cat-file commit HEAD | sed -ne "s/^encoding //p") &&
		test "z$E" = "z$H" &&
		compare_git_head_with "$TEST_DIRECTORY"/t3900/$H.txt
	)
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9131-git-svn-empty-symlink/x/.git/
W: +empty_dir: cc
r3 = 328e1366e75b42a6686c1eca5c77e7b6879ab8a6 (refs/remotes/git-svn)
W: +empty_dir: dd
r4 = 01b88c6bd0f079cd05c9f1fa1bafd34de2a74997 (refs/remotes/git-svn)
bar has mode 120000 but it points to nothing
converting to an empty file with mode 100644
	A	bar
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9130-git-svn-authors-file/svnrepo r4
creating empty directory: aa
creating empty directory: bb
creating empty directory: cc
creating empty directory: dd
author DDDDDDD DDDDDDD <dd@example.com> 1450264481 +0000
author CCCCCCC CCCCCCC <cc@example.com> 1450264479 +0000
ok 4 - continues to import once authors have been added

expecting success: 
	svn_cmd mkdir -m globs --username aa \
	  "$svnrepo"/aa/trunk "$svnrepo"/aa/branches "$svnrepo"/aa/tags &&
	git svn clone --authors-file=svn-authors -s "$svnrepo"/aa aa-work &&
	for i in bb ee cc
	do
		branch="aa/branches/$i"
		svn_cmd mkdir -m "$branch" --username $i "$svnrepo/$branch"
	done
	
r1 = 7de8f4013a9621c29fdc1078f1d55dc923bd7be2 (refs/remotes/git-svn)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9131-git-svn-empty-symlink/svnrepo r1
Committing transaction...
ok 2 - clone using git svn

expecting success: (cd x && git config svn.brokenSymlinkWorkaround true)
ok 3 - enable broken symlink workaround

expecting success: test -f x/bar && ! test -s x/bar
ok 4 - "bar" is an empty file

expecting success: (cd x && git svn rebase)
Copying file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/trunk at r2 to file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/branches/c...
Committed revision 5.
fatal: ambiguous argument 'remotes/origin/c': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
remotes/origin/c
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9129-git-svn-i18n-commitencoding/svnrepo/eucJP ...
	A	F
Committed r5
	A	F
r5 = 287d6a536f0d16e2ba2fee6ee725ff07dacbc8b8 (refs/remotes/git-svn)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9130-git-svn-authors-file/aa-work/.git/
No changes between d426f6ef1e8e42440d8edd68f58ddacf6f95fdb6 and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9130-git-svn-authors-file/svnrepo/aa => file:///«PKGBUILDDIR»/t/trash%20directory.t9130-git-svn-authors-file/svnrepo
git-svn-id: file:///«PKGBUILDDIR»/t/trash%20directory.t9129-git-svn-i18n-commitencoding/svnrepo/eucJP@5 965f4afb-c337-459f-a77a-2ab21cefb79b
ok 8 - eucJP dcommit to svn

expecting success: 
	(
		cd $H &&
		git svn dcommit &&
		git cat-file commit HEAD | grep git-svn-id: &&
		E=$(git cat-file commit HEAD | sed -ne "s/^encoding //p") &&
		test "z$E" = "z$H" &&
		compare_git_head_with "$TEST_DIRECTORY"/t3900/$H.txt
	)
	
Scanning for empty symlinks, this may take a while if you have many empty files
You may disable this with `git config svn.brokenSymlinkWorkaround false'.
This may be done in a different terminal without restarting git svn
branch a already exists

	M	bar
r2 = f5d31dc75bd18a26e5b7d0f956b8ac1ec1c3fe7d (refs/remotes/git-svn)
First, rewinding head to replay your work on top of it...
Fast-forwarded master to refs/remotes/git-svn.
ok 5 - get "bar" => symlink fix from svn

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: test -h x/bar
ok 6 - "bar" becomes a symlink

expecting success: git svn clone -r1 "$svnrepo" y
r5 = 4e2c96e0d9b855a444a20098ea8e33d3a194f248 (refs/remotes/origin/trunk)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9130-git-svn-authors-file/svnrepo/aa/trunk r5
Committing transaction...
Committed revision 6.
Committing transaction...
Copying file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/trunk at r2 to file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/tags/tag1...
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9129-git-svn-i18n-commitencoding/svnrepo/ISO-2022-JP ...
Committed revision 7.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9131-git-svn-empty-symlink/y/.git/
	A	F
Committing transaction...
bar has mode 120000 but it points to nothing
converting to an empty file with mode 100644
	A	bar
r1 = 7de8f4013a9621c29fdc1078f1d55dc923bd7be2 (refs/remotes/git-svn)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9131-git-svn-empty-symlink/svnrepo r1
ok 7 - clone using git svn

expecting success: (cd y && git config svn.brokenSymlinkWorkaround false)
ok 8 - disable broken symlink workaround

expecting success: test -f y/bar && ! test -s y/bar
ok 9 - "bar" is an empty file

expecting success: (cd y && git svn rebase)
Committed r6
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/tags/tag1, 2
Committed revision 8.
ok 5 - authors-file against globs

expecting success: 
	( cd aa-work && test_must_fail git svn fetch --authors-file=../svn-authors )
	
Found branch parent: (refs/remotes/origin/tags/tag1) dfb256165db4ebce9725ea4eaf330a952deab74a
	A	F
Following parent with do_switch
r6 = 7e425e3039980d55c3ca7192f8c38983f066a60a (refs/remotes/git-svn)
Successfully followed parent
No changes between 99e03ee01ab2feffc2cad9ec30156638d7053024 and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
git-svn-id: file:///«PKGBUILDDIR»/t/trash%20directory.t9129-git-svn-i18n-commitencoding/svnrepo/ISO-2022-JP@6 965f4afb-c337-459f-a77a-2ab21cefb79b
ok 9 - ISO-2022-JP dcommit to svn

expecting success: 
	(
		cd ISO8859-1 &&
		compare_svn_head_with "$TEST_DIRECTORY"/t3900/1-UTF-8.txt
	)

r5 = d8af24ed5f1e232ccefe223b3308da00dad4d0c9 (refs/remotes/origin/tags/tag1)
	M	bar
r2 = 4b41f3f3afad4472006ad04b885337eb5eb3da55 (refs/remotes/git-svn)
ok 10 - ISO-8859-1 should match UTF-8 in svn

expecting success: 
		(
			cd $H &&
			compare_svn_head_with "$TEST_DIRECTORY"/t3900/2-UTF-8.txt
		)
	
First, rewinding head to replay your work on top of it...
r6 = d1cda089801098f8c32c2164dc464e1ed14d30ce (refs/remotes/origin/bb)
Fast-forwarded master to refs/remotes/git-svn.
Copying file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/trunk at r2 to file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/tags/tag2...
ok 10 - get "bar" => symlink fix from svn

expecting success: ! test -L y/bar
ok 11 - "bar" does not become a symlink

expecting success: git svn clone -r1 "$svnrepo" z
Author: ee not defined in ../svn-authors file

ok 6 - fetch fails on ee

expecting success: 
	(
		cd aa-work &&
		test 6 -eq "`tmp_config_get svn-remote.svn.branches-maxRev`" &&
		test 6 -eq "`tmp_config_get svn-remote.svn.tags-maxRev`"
	)
	
ok 7 - failure happened without negative side effects

expecting success: 
	(
		cd aa-work &&
		git svn fetch --authors-file=../svn-authors &&
		test 8 -eq "`tmp_config_get svn-remote.svn.branches-maxRev`" &&
		test 8 -eq "`tmp_config_get svn-remote.svn.tags-maxRev`"
	)
	
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/tags/tag2, 2
Found branch parent: (refs/remotes/origin/tags/tag2) dfb256165db4ebce9725ea4eaf330a952deab74a
Following parent with do_switch
Successfully followed parent
r6 = e88b5a94bd31bafbd4598ab939ac57cee2a2545d (refs/remotes/origin/tags/tag2)
ok 11 - eucJP should match UTF-8 in svn

expecting success: 
		(
			cd $H &&
			compare_svn_head_with "$TEST_DIRECTORY"/t3900/2-UTF-8.txt
		)
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9131-git-svn-empty-symlink/z/.git/
bar has mode 120000 but it points to nothing
converting to an empty file with mode 100644
	A	bar
r1 = 7de8f4013a9621c29fdc1078f1d55dc923bd7be2 (refs/remotes/git-svn)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9131-git-svn-empty-symlink/svnrepo r1
r7 = ccb5515061b4dc51da231c080f3fea7e237e43ac (refs/remotes/origin/ee)
ok 12 - clone using git svn

expecting success: test -f z/bar && ! test -s z/bar
ok 13 - "bar" is an empty file

expecting success: (cd z && git svn rebase)
r8 = 445b24a1683e58e1433cf120729945ab709ca57a (refs/remotes/origin/cc)
ok 8 - fetch continues after authors-file is fixed

expecting success: 
	(
		rm -r "$GIT_DIR" &&
		test x = x"$(git config svn.authorsfile)" &&
		test_config="$HOME"/.gitconfig &&
		sane_unset GIT_DIR &&
		git config --global \
		  svn.authorsfile "$HOME"/svn-authors &&
		test x"$HOME"/svn-authors = x"$(git config svn.authorsfile)" &&
		git svn clone "$svnrepo" gitconfig.clone &&
		cd gitconfig.clone &&
		nr_ex=$(git log | grep "^Author:.*example.com" | wc -l) &&
		nr_rev=$(git rev-list HEAD | wc -l) &&
		test $nr_rev -eq $nr_ex
	)

Copying file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/trunk at r2 to file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/tags/tag3...
ok 12 - ISO-2022-JP should match UTF-8 in svn

# passed all 12 test(s)
1..12
*** t9132-git-svn-broken-symlink.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9132-git-svn-broken-symlink/.git/
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/tags/tag3, 2
Found branch parent: (refs/remotes/origin/tags/tag3) dfb256165db4ebce9725ea4eaf330a952deab74a
Following parent with do_switch
Successfully followed parent
r7 = ffc2c63915e32cf3e8b033e891758d74606e8268 (refs/remotes/origin/tags/tag3)
	M	bar
expecting success: 
	svnadmin load "$rawsvnrepo" <<EOF
SVN-fs-dump-format-version: 2

UUID: 60780f9a-7df5-43b4-83ab-60e2c0673ef7

Revision-number: 0
Prop-content-length: 56
Content-length: 56

K 8
svn:date
V 27
2008-11-26T07:17:27.590577Z
PROPS-END

Revision-number: 1
Prop-content-length: 111
Content-length: 111

K 7
svn:log
V 4
test
K 10
svn:author
V 12
normalperson
K 8
svn:date
V 27
2008-11-26T07:18:03.511836Z
PROPS-END

Node-path: bar
Node-kind: file
Node-action: add
Prop-content-length: 33
Text-content-length: 4
Text-content-md5: 912ec803b2ce49e4a541068d495ab570
Content-length: 37

K 11
svn:special
V 1
*
PROPS-END
asdf

Revision-number: 2
Prop-content-length: 121
Content-length: 121

K 7
svn:log
V 13
bar => doink

K 10
svn:author
V 12
normalperson
K 8
svn:date
V 27
2008-11-27T03:55:31.601672Z
PROPS-END

Node-path: bar
Node-kind: file
Node-action: change
Text-content-length: 10
Text-content-md5: 92ca4fe7a9721f877f765c252dcd66c9
Content-length: 10

link doink

EOF

r2 = 4b41f3f3afad4472006ad04b885337eb5eb3da55 (refs/remotes/git-svn)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9130-git-svn-authors-file/gitconfig.clone/.git/
<<< Started new transaction, based on original revision 1
     * editing path : bar ... done.
First, rewinding head to replay your work on top of it...
Fast-forwarded master to refs/remotes/git-svn.
ok 14 - get "bar" => symlink fix from svn

expecting success: ! test -L z/bar
ok 15 - "bar" does not become a symlink

# passed all 15 test(s)
1..15
*** t9133-git-svn-nested-git-repo.sh ***

------- Committed revision 1 >>>

W: +empty_dir: aa
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9133-git-svn-nested-git-repo/.git/
<<< Started new transaction, based on original revision 2
     * editing path : bar ... done.
r1 = 336113faf72dddda10463b52e04a7d9961994316 (refs/remotes/git-svn)
W: +empty_dir: bb
r2 = e5519467a877e086d7a6f66d9026d9443e24a998 (refs/remotes/git-svn)

------- Committed revision 2 >>>

ok 1 - load svn dumpfile

expecting success: git svn clone -r1 "$svnrepo" x
W: +empty_dir: cc
r3 = 328e1366e75b42a6686c1eca5c77e7b6879ab8a6 (refs/remotes/git-svn)
W: +empty_dir: dd
r4 = 01b88c6bd0f079cd05c9f1fa1bafd34de2a74997 (refs/remotes/git-svn)
W: +empty_dir: aa/branches
W: +empty_dir: aa/tags
W: +empty_dir: aa/trunk
r5 = 7ec15aa701964b1867e94b88c2565e5e6276f684 (refs/remotes/git-svn)
expecting success: 
	svn_cmd co "$svnrepo" s &&
	(
		cd s &&
		git init &&
		test -f .git/HEAD &&
		> .git/a &&
		echo a > a &&
		svn_cmd add .git a &&
		svn_cmd commit -m "create a nested git repo" &&
		svn_cmd up &&
		echo hi >> .git/a &&
		svn_cmd commit -m "modify .git/a" &&
		svn_cmd up
	)

Checked out revision 0.
W: +empty_dir: aa/branches/bb
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9133-git-svn-nested-git-repo/s/.git/
r6 = 306b83c2f45b7023d6f5247d256960a1a3c4a35d (refs/remotes/git-svn)
A         .git
A         .git/HEAD
A         .git/hooks
A         .git/hooks/post-update.sample
A         .git/hooks/pre-rebase.sample
A         .git/hooks/prepare-commit-msg.sample
A         .git/hooks/applypatch-msg.sample
A         .git/hooks/pre-applypatch.sample
A         .git/hooks/commit-msg.sample
A         .git/hooks/pre-commit.sample
A         .git/hooks/update.sample
A         .git/hooks/pre-push.sample
A         .git/description
A         .git/branches
A         .git/config
A         .git/objects
A         .git/objects/info
A         .git/objects/pack
A         .git/info
A         .git/info/exclude
A         .git/refs
A         .git/refs/heads
A         .git/refs/tags
A         .git/a
A         a
W: +empty_dir: aa/branches/ee
Copying file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/trunk at r2 to file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/tags/tag4...
r7 = 9964d9dc4041ac658bb5674f04e488444fbdce30 (refs/remotes/git-svn)
W: +empty_dir: aa/branches/cc
r8 = f21c9b3a7a73a31cc03e966ac2796c802251fac0 (refs/remotes/git-svn)
Adding         .git
Adding         .git/HEAD
Adding         .git/a
Adding         .git/branches
Adding         .git/config
Adding         .git/description
Adding         .git/hooks
Adding         .git/hooks/applypatch-msg.sample
Adding         .git/hooks/commit-msg.sample
Adding         .git/hooks/post-update.sample
Adding         .git/hooks/pre-applypatch.sample
Adding         .git/hooks/pre-commit.sample
Adding         .git/hooks/pre-push.sample
Adding         .git/hooks/pre-rebase.sample
Adding         .git/hooks/prepare-commit-msg.sample
Adding         .git/hooks/update.sample
Adding         .git/info
Adding         .git/info/exclude
Adding         .git/objects
Adding         .git/objects/info
Adding         .git/objects/pack
Adding         .git/refs
Adding         .git/refs/heads
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9130-git-svn-authors-file/svnrepo r8
Adding         .git/refs/tags
Adding         a
Transmitting file data ..creating empty directory: aa
creating empty directory: aa/branches
creating empty directory: aa/branches/bb
creating empty directory: aa/branches/cc
creating empty directory: aa/branches/ee
creating empty directory: aa/tags
creating empty directory: aa/trunk
creating empty directory: bb
creating empty directory: cc
creating empty directory: dd
.............done
Committing transaction...
ok 9 - fresh clone with svn.authors-file in config

# passed all 9 test(s)
1..9
*** t9134-git-svn-ignore-paths.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9134-git-svn-ignore-paths/.git/
Committed revision 1.
Updating '.':
At revision 1.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9132-git-svn-broken-symlink/x/.git/
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/tags/tag4, 2
Found branch parent: (refs/remotes/origin/tags/tag4) dfb256165db4ebce9725ea4eaf330a952deab74a
Following parent with do_switch
Sending        .git/a
Transmitting file data .done
Committing transaction...
Successfully followed parent
r8 = 179add6b029d687314857d190c43a2cf2f3ff002 (refs/remotes/origin/tags/tag4)
expecting success: 
	svn_cmd co "$svnrepo" s &&
	(
		cd s &&
		mkdir qqq www &&
		echo test_qqq > qqq/test_qqq.txt &&
		echo test_www > www/test_www.txt &&
		svn_cmd add qqq &&
		svn_cmd add www &&
		svn_cmd commit -m "create some files" &&
		svn_cmd up &&
		echo hi >> www/test_www.txt &&
		svn_cmd commit -m "modify www/test_www.txt" &&
		svn_cmd up
	)

bar has mode 120000 but is not a link
	A	bar
Checked out revision 0.
Committed revision 2.
r1 = 488f932a3e7e78c094338a45989f1b926eeb1ded (refs/remotes/git-svn)
A         qqq
A         qqq/test_qqq.txt
Updating '.':
At revision 2.
A         www
A         www/test_www.txt
ok 1 - setup repo with a git repo inside it

expecting success: 
	git svn clone "$svnrepo" g &&
	echo a > expect &&
	test_cmp expect g/a

Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9132-git-svn-broken-symlink/svnrepo r1
ok 2 - clone using git svn

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: 
	test -L x/bar &&
	(cd x && test xasdf = x"`git cat-file blob HEAD:bar`")

ok 3 - "bar" is a symlink that points to "asdf"

expecting success: 
	(cd x && git svn rebase)

Adding         qqq
Adding         qqq/test_qqq.txt
Adding         www
Adding         www/test_www.txt
Transmitting file data ..done
Committing transaction...
Committed revision 1.
Updating '.':
At revision 1.
Sending        www/test_www.txt
Transmitting file data .done
Committing transaction...
Committed revision 2.
tag name required

Updating '.':
At revision 2.
ok 1 - setup test repository

expecting success: 
	git svn clone --ignore-paths="^www" "$svnrepo" g &&
	echo test_qqq > expect &&
	for i in g/*/*.txt; do cat $i >> expect2; done &&
	test_cmp expect expect2

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9133-git-svn-nested-git-repo/g/.git/
	A	a
Checksum mismatch: bar 5e40c0877058c504203932e5136051cf3cd3519b
expected: 912ec803b2ce49e4a541068d495ab570
     got: 3f9dfa058a15dc34057c51ec4d35393c
Retrying... (possibly a bad symlink from SVN)
	M	bar
r1 = 000df449c368448614f70e8b3c8da931f088de08 (refs/remotes/git-svn)
r2 = f22126922cfbb5523501089827b15cc8ecdb530a (refs/remotes/git-svn)
r2 = 8d268390b0e5f8c5bde50e05857b71dda382e30e (refs/remotes/git-svn)
First, rewinding head to replay your work on top of it...
Fast-forwarded master to refs/remotes/git-svn.
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9133-git-svn-nested-git-repo/svnrepo r2
ok 2 - clone an SVN repo containing a git repo
ok 4 - get "bar" => symlink fix from svn


expecting success: 
	(
		cd s &&
		echo b >> a &&
		svn_cmd commit -m "SVN-side change outside of .git" &&
		svn_cmd up &&
		svn_cmd log -v | fgrep "SVN-side change outside of .git"
	)

expecting success: 
	test -L x/bar &&
	(cd x && test xdoink = x"`git cat-file blob HEAD:bar`")

ok 5 - "bar" remains a proper symlink

# passed all 5 test(s)
1..5
*** t9135-git-svn-moved-branch-empty-file.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9135-git-svn-moved-branch-empty-file/.git/
Sending        a
Transmitting file data .done
Committing transaction...
Committed revision 3.
Copying file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/trunk at r2 to file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/tags/tag5...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9134-git-svn-ignore-paths/g/.git/
Updating '.':
At revision 3.
SVN-side change outside of .git
ok 3 - SVN-side change outside of .git

expecting success: 
	(
		cd g &&
		git svn rebase &&
		echo a > expect &&
		echo b >> expect &&
		test_cmp a expect &&
		rm expect
	)

expecting success: 
	svnadmin load "$rawsvnrepo" < "${TEST_DIRECTORY}/t9135/svn.dump"
	
fatal: ambiguous argument 'remotes/origin/tags/tag5': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
remotes/origin/tags/tag5
	A	qqq/test_qqq.txt
<<< Started new transaction, based on original revision 1
     * editing path : branches ... done.
     * editing path : trunk ... done.
r1 = 265db7b1f9e468a350a578a79a9e20767a9b961d (refs/remotes/git-svn)
r2 = e95caf0b2aef983985280ef685c7ca6b89dd4945 (refs/remotes/git-svn)

------- Committed revision 1 >>>

Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9134-git-svn-ignore-paths/svnrepo r2
ok 2 - clone an SVN repository with ignored www directory

expecting success: 
	git svn init "$svnrepo" c &&
	( cd c && git svn fetch --ignore-paths="^www" ) &&
	rm expect2 &&
	echo test_qqq > expect &&
	for i in c/*/*.txt; do cat $i >> expect2; done &&
	test_cmp expect expect2

<<< Started new transaction, based on original revision 2
     * editing path : branches/branch-b ...COPIED... done.

------- Committed revision 2 >>>

<<< Started new transaction, based on original revision 3
     * editing path : branches/branch-b/b1 ... done.

------- Committed revision 3 >>>

<<< Started new transaction, based on original revision 4
     * editing path : branches/branch-c ...COPIED... done.
branch tag1 already exists

ok 3 - git svn branch tests

expecting success: 
	(svn_cmd co "$svnrepo" svn &&
	cd svn &&
	mkdir mirror &&
	svn_cmd add mirror &&
	svn_cmd copy trunk mirror/ &&
	svn_cmd copy tags mirror/ &&
	svn_cmd copy branches mirror/ &&
	svn_cmd ci -m "made mirror" ) &&
	rm -rf svn &&
	git svn init -s -R mirror --prefix=mirror/ "$svnrepo"/mirror &&
	git svn fetch -R mirror &&
	git checkout mirror/trunk &&
	base=$(git rev-parse HEAD:) &&
	git svn branch -m "branch in mirror" d &&
	test $base = $(git rev-parse remotes/mirror/d:) &&
	test_must_fail git rev-parse remotes/d


------- Committed revision 4 >>>

A    svn/branches
A    svn/branches/a
A    svn/branches/a/foo
A    svn/branches/b
A    svn/branches/b/foo
A    svn/tags
A    svn/tags/tag1
A    svn/tags/tag1/foo
A    svn/tags/tag2
A    svn/tags/tag2/foo
A    svn/tags/tag3
A    svn/tags/tag3/foo
A    svn/tags/tag4
A    svn/tags/tag4/foo
A    svn/trunk
A    svn/trunk/foo
Checked out revision 8.
<<< Started new transaction, based on original revision 5
     * editing path : branches/branch-c ... done.
A         mirror
	M	a
A         mirror/trunk
r3 = 9b508a7813345e2ff14549adbfc13fe8170affdc (refs/remotes/git-svn)

------- Committed revision 5 >>>

A         mirror/tags
<<< Started new transaction, based on original revision 6
     * editing path : branches/branch-c ...COPIED... done.
A         mirror/branches
First, rewinding head to replay your work on top of it...
Fast-forwarded master to refs/remotes/git-svn.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9134-git-svn-ignore-paths/c/.git/
ok 4 - update git svn-cloned repo

expecting success: 
	(
		cd s &&
		git add a &&
		git commit -m "add a inside an SVN repo" &&
		git log &&
		svn_cmd add --force .git &&
		svn_cmd commit -m "SVN-side change inside of .git" &&
		svn_cmd up &&
		svn_cmd log -v | fgrep "SVN-side change inside of .git"
	)

[master (root-commit) 2254dcd] add a inside an SVN repo
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+)
 create mode 100644 a
commit 2254dcd97bf0fc51887fe4588997adcf05e3c9bd
Author: A U Thor <author@example.com>
Date:   Wed Dec 16 11:15:34 2015 +0000

    add a inside an SVN repo
A         .git/refs/heads/master
A         .git/COMMIT_EDITMSG
A         .git/logs
A         .git/logs/refs
A         .git/logs/refs/heads
A         .git/logs/refs/heads/master
A         .git/logs/HEAD
A  (bin)  .git/index
A         .git/objects/a3
A  (bin)  .git/objects/a3/8e8ab7e857af7a7ac6f49fa3d3821f26fedca8
A         .git/objects/22
A         .git/objects/22/54dcd97bf0fc51887fe4588997adcf05e3c9bd
A         .git/objects/42
A  (bin)  .git/objects/42/2c2b7ab3b3c668038da977e4e93a5fc623169c
Adding         mirror
Adding         mirror/branches

------- Committed revision 6 >>>

Adding         mirror/tags
ok 1 - load svn dumpfile

expecting success: git svn clone -s "$svnrepo" x
Adding         mirror/trunk
Committing transaction...
Adding         .git/COMMIT_EDITMSG
Adding  (bin)  .git/index
Adding         .git/logs
Adding         .git/logs/HEAD
Adding         .git/logs/refs
Adding         .git/logs/refs/heads
Adding         .git/logs/refs/heads/master
Adding         .git/objects/22
Adding         .git/objects/22/54dcd97bf0fc51887fe4588997adcf05e3c9bd
Adding         .git/objects/42
Adding  (bin)  .git/objects/42/2c2b7ab3b3c668038da977e4e93a5fc623169c
Adding         .git/objects/a3
Adding  (bin)  .git/objects/a3/8e8ab7e857af7a7ac6f49fa3d3821f26fedca8
Adding         .git/refs/heads/master
Transmitting file data ........done
Committing transaction...
Committed revision 9.
Committed revision 4.
Updating '.':
At revision 4.
SVN-side change inside of .git
ok 5 - SVN-side change inside of .git

expecting success: 
	(
		cd g &&
		git svn rebase &&
		echo a > expect &&
		echo b >> expect &&
		test_cmp a expect &&
		rm expect
	)

	A	qqq/test_qqq.txt
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9135-git-svn-moved-branch-empty-file/x/.git/
r1 = 265db7b1f9e468a350a578a79a9e20767a9b961d (refs/remotes/git-svn)
r2 = e95caf0b2aef983985280ef685c7ca6b89dd4945 (refs/remotes/git-svn)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9134-git-svn-ignore-paths/svnrepo r2
ok 3 - init+fetch an SVN repository with ignored www directory

expecting success: 
	(
	    cd g &&
	    git config --get svn-remote.svn.ignore-paths | fgrep "www"
	)

^www
ok 4 - verify ignore-paths config saved by clone

expecting success: 
	(
		cd s &&
		echo b >> qqq/test_qqq.txt &&
		svn_cmd commit -m "SVN-side change outside of www" &&
		svn_cmd up &&
		svn_cmd log -v | fgrep "SVN-side change outside of www"
	)

Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/mirror => file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo
r1 = dba16ef32328bdabbc71a5cb73ac5cf3278e124a (refs/remotes/origin/trunk)
Sending        qqq/test_qqq.txt
Transmitting file data .done
Committing transaction...
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9135-git-svn-moved-branch-empty-file/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9135-git-svn-moved-branch-empty-file/svnrepo/branches/branch-b, 1
Found branch parent: (refs/remotes/origin/branch-b) dba16ef32328bdabbc71a5cb73ac5cf3278e124a
Following parent with do_switch
Committed revision 3.
Successfully followed parent
Updating '.':
At revision 3.
r2 = 773686b4e70d43d34d96792f5fa9f74db22efa37 (refs/remotes/origin/branch-b)
SVN-side change outside of www
ok 5 - SVN-side change outside of www

expecting success: 
	(
		cd g &&
		git svn rebase &&
		printf "test_qqq\nb\n" > expect &&
		for i in */*.txt; do cat $i >> expect2; done &&
		test_cmp expect2 expect &&
		rm expect expect2
	)

	A	b1
r3 = 1d281e8413673dcf467e15290e81171c54e47918 (refs/remotes/origin/branch-b)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9135-git-svn-moved-branch-empty-file/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9135-git-svn-moved-branch-empty-file/svnrepo/branches/branch-c, 3
Found branch parent: (refs/remotes/origin/branch-c) dba16ef32328bdabbc71a5cb73ac5cf3278e124a
Following parent with do_switch
Successfully followed parent
r4 = 4baf9db6b0061c2576dbc07a05024da3df5104f8 (refs/remotes/git-svn)
r4 = 0d95aa92190783c699244912354cb83c363582c3 (refs/remotes/origin/branch-c)
First, rewinding head to replay your work on top of it...
Fast-forwarded master to refs/remotes/git-svn.
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9135-git-svn-moved-branch-empty-file/svnrepo/branches/branch-b => file:///«PKGBUILDDIR»/t/trash%20directory.t9135-git-svn-moved-branch-empty-file/svnrepo/branches/branch-c, 5
ok 6 - update git svn-cloned repo

expecting success: 
	(
		cd s &&
		echo c >> a &&
		git add a &&
		git commit -m "add a inside an SVN repo" &&
		svn_cmd commit -m "SVN-side change in and out of .git" &&
		svn_cmd up &&
		svn_cmd log -v | fgrep "SVN-side change in and out of .git"
	)

[master 36ef161] add a inside an SVN repo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Found branch parent: (refs/remotes/origin/branch-c) 1d281e8413673dcf467e15290e81171c54e47918
Index mismatch: 934e48f4addc4882a9b7b99615348569d531c873 != 4b825dc642cb6eb9a060e54bf8d69288fbee4904
rereading 1d281e8413673dcf467e15290e81171c54e47918
Following parent with do_switch
Successfully followed parent
r6 = dfa1d518585f4a8551e581d63f64c65beeabf2b3 (refs/remotes/origin/branch-c)
Sending        .git/index
Sending        .git/logs/HEAD
Sending        .git/logs/refs/heads/master
Sending        .git/refs/heads/master
Sending        a
Transmitting file data .....done
Committing transaction...
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9135-git-svn-moved-branch-empty-file/svnrepo/trunk r1
ok 2 - clone using git svn

expecting success: 
	(
		cd x &&
		git reset --hard origin/branch-c &&
		test -f b1 &&
		! test -s b1
	)
	
HEAD is now at dfa1d51 branch-c off of branch-b
ok 3 - test that b1 exists and is empty

# passed all 3 test(s)
1..3
*** t9136-git-svn-recreated-branch-empty-file.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9136-git-svn-recreated-branch-empty-file/.git/
Committed revision 5.
Updating '.':
branch_from: /branches => /branches/b
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/branches/b => file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/mirror/branches/b, 8
At revision 5.
SVN-side change in and out of .git
ok 7 - SVN-side change in and out of .git

expecting success: 
	(
		cd g &&
		git svn rebase &&
		echo a > expect &&
		echo b >> expect &&
		echo c >> expect &&
		test_cmp a expect &&
		rm expect
	)

Found branch parent: (refs/remotes/mirror/b) 81a508e104030af7ba26d26dd30bd6ebf78d551c
Following parent with do_switch
Successfully followed parent
r9 = 011e92e4079521fd82a8ae1dba76efa75b10f189 (refs/remotes/mirror/b)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/mirror/trunk, 8
	M	qqq/test_qqq.txt
r3 = bff2c7e8e241bff3d51f770d40e10b064b593eb8 (refs/remotes/git-svn)
expecting success: 
	svnadmin load "$rawsvnrepo" < "${TEST_DIRECTORY}/t9136/svn.dump"
	
Found branch parent: (refs/remotes/mirror/trunk) dfb256165db4ebce9725ea4eaf330a952deab74a
Following parent with do_switch
First, rewinding head to replay your work on top of it...
Successfully followed parent
Fast-forwarded master to refs/remotes/git-svn.
<<< Started new transaction, based on original revision 1
     * editing path : branches ... done.
     * editing path : tags ... done.
     * editing path : trunk ... done.
ok 6 - update git svn-cloned repo (config ignore)

expecting success: 
	(
		cd c &&
		git svn rebase --ignore-paths="^www" &&
		printf "test_qqq\nb\n" > expect &&
		for i in */*.txt; do cat $i >> expect2; done &&
		test_cmp expect2 expect &&
		rm expect expect2
	)

     * editing path : trunk/file ... done.
r9 = 374fa09f1490c7f559477a2ac8369da3f5b64212 (refs/remotes/mirror/trunk)
branch_from: /tags => /tags/tag1
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/tags/tag1 => file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/mirror/tags/tag1, 8

------- Committed revision 1 >>>

Found branch parent: (refs/remotes/mirror/tags/tag1) d8af24ed5f1e232ccefe223b3308da00dad4d0c9
<<< Started new transaction, based on original revision 2
     * editing path : tags/1.0 ...COPIED... done.
Following parent with do_switch
Successfully followed parent
r9 = 9ed7d21e023d8174ba6b8a2beb8cbc5717e15942 (refs/remotes/mirror/tags/tag1)
branch_from: /branches => /branches/a

------- Committed revision 2 >>>

Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/branches/a => file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/mirror/branches/a, 8
<<< Started new transaction, based on original revision 3
     * editing path : tags/1.0.1 ...COPIED... done.
Found branch parent: (refs/remotes/mirror/a) 6f04c4a74ff8806c362e5c2b218ec36ada130abc
Following parent with do_switch

------- Committed revision 3 >>>

Successfully followed parent
<<< Started new transaction, based on original revision 4
     * editing path : tags/1.0.1 ... done.
r9 = f794ecb1fc626529a0068157749ae368521264dc (refs/remotes/mirror/a)
branch_from: /tags => /tags/tag2
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/tags/tag2 => file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/mirror/tags/tag2, 8

------- Committed revision 4 >>>

	M	a
<<< Started new transaction, based on original revision 5
Found branch parent: (refs/remotes/mirror/tags/tag2) e88b5a94bd31bafbd4598ab939ac57cee2a2545d
     * editing path : branches/1.0 ...COPIED... done.
r5 = 057bc8471faf0229f47bd94286ee9d5350f88974 (refs/remotes/git-svn)
Following parent with do_switch
Successfully followed parent

------- Committed revision 5 >>>

First, rewinding head to replay your work on top of it...
r9 = 80674cdc294e0e7fc6760cf193cc48e39ce64001 (refs/remotes/mirror/tags/tag2)
Fast-forwarded master to refs/remotes/git-svn.
branch_from: /tags => /tags/tag4
<<< Started new transaction, based on original revision 6
     * editing path : tags/1.0.1 ...COPIED... done.
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/tags/tag4 => file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/mirror/tags/tag4, 8
ok 8 - update git svn-cloned repo again

# passed all 8 test(s)
1..8
*** t9137-git-svn-dcommit-clobber-series.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9137-git-svn-dcommit-clobber-series/.git/
Found branch parent: (refs/remotes/mirror/tags/tag4) 179add6b029d687314857d190c43a2cf2f3ff002
Following parent with do_switch

------- Committed revision 6 >>>

ok 1 - load svn dumpfile

expecting success: git svn clone -s "$svnrepo" x
Successfully followed parent
r9 = 98f61964258be52eecb6c0339f37fe8187a0b17d (refs/remotes/mirror/tags/tag4)
	M	qqq/test_qqq.txt
branch_from: /tags => /tags/tag3
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/tags/tag3 => file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/mirror/tags/tag3, 8
r3 = bff2c7e8e241bff3d51f770d40e10b064b593eb8 (refs/remotes/git-svn)
Found branch parent: (refs/remotes/mirror/tags/tag3) ffc2c63915e32cf3e8b033e891758d74606e8268
First, rewinding head to replay your work on top of it...
Following parent with do_switch
Fast-forwarded master to refs/remotes/git-svn.
Successfully followed parent
ok 7 - update git svn-cloned repo (option ignore)

expecting success: 
	(
		cd s &&
		echo zaq >> www/test_www.txt
		svn_cmd commit -m "SVN-side change inside of www/test_www.txt" &&
		svn_cmd up &&
		svn_cmd log -v | fgrep "SVN-side change inside of www/test_www.txt"
	)

r9 = 8ac5e78fc1904f240bdd6c90ee07b9972579f887 (refs/remotes/mirror/tags/tag3)
expecting success: 
	mkdir import &&
	(cd import &&
	awk "BEGIN { for (i = 1; i < 64; i++) { print i } }" > file
	svn_cmd import -m "initial" . "$svnrepo"
	) &&
	git svn init "$svnrepo" &&
	git svn fetch &&
	test -e file
	
Previous HEAD position was dfb2561... updated trunk
HEAD is now at 374fa09... made mirror
Sending        www/test_www.txt
Transmitting file data .done
Committing transaction...
Adding         file
Committing transaction...
Committed revision 4.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9136-git-svn-recreated-branch-empty-file/x/.git/
Updating '.':
At revision 4.
Committed revision 1.
SVN-side change inside of www/test_www.txt
ok 8 - SVN-side change inside of ignored www

expecting success: 
	(
		cd g &&
		git svn rebase &&
		printf "test_qqq\nb\n" > expect &&
		for i in */*.txt; do cat $i >> expect2; done &&
		test_cmp expect2 expect &&
		rm expect expect2
	)

	A	file
Copying file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/mirror/trunk at r9 to file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/mirror/branches/d...
r1 = 01efea176152bee3d20d5dfc693319a408ddf79b (refs/remotes/origin/trunk)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9136-git-svn-recreated-branch-empty-file/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9136-git-svn-recreated-branch-empty-file/svnrepo/tags/1.0, 1
Found branch parent: (refs/remotes/origin/tags/1.0) 01efea176152bee3d20d5dfc693319a408ddf79b
Following parent with do_switch
Successfully followed parent
r2 = a104eccddde4605170deb0a754f3523a22206040 (refs/remotes/origin/tags/1.0)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9136-git-svn-recreated-branch-empty-file/svnrepo/tags/1.0 => file:///«PKGBUILDDIR»/t/trash%20directory.t9136-git-svn-recreated-branch-empty-file/svnrepo/tags/1.0.1, 2
Found branch parent: (refs/remotes/origin/tags/1.0.1) a104eccddde4605170deb0a754f3523a22206040
Following parent with do_switch
Successfully followed parent
r3 = 30ece9ea09d653101f6bc9ce346c01acd0ffb5ee (refs/remotes/origin/tags/1.0.1)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9136-git-svn-recreated-branch-empty-file/svnrepo/tags/1.0 => file:///«PKGBUILDDIR»/t/trash%20directory.t9136-git-svn-recreated-branch-empty-file/svnrepo/branches/1.0, 4
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/mirror/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9128-git-svn-cmd-branch/svnrepo/mirror/branches/d, 9
Found branch parent: (refs/remotes/origin/1.0) a104eccddde4605170deb0a754f3523a22206040
Found branch parent: (refs/remotes/mirror/d) 374fa09f1490c7f559477a2ac8369da3f5b64212
Following parent with do_switch
Following parent with do_switch
Successfully followed parent
Successfully followed parent
r5 = ab5f9de20a71e54b3710c2ca5189140cf0c699d3 (refs/remotes/origin/1.0)
r4 = 4558cbd172d9abfb47a409f97a683ec9e6b7ca09 (refs/remotes/git-svn)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9136-git-svn-recreated-branch-empty-file/svnrepo/branches/1.0 => file:///«PKGBUILDDIR»/t/trash%20directory.t9136-git-svn-recreated-branch-empty-file/svnrepo/tags/1.0.1, 5
r10 = 36c7d8737d64ef10af5410c0bc7899bb208ed38e (refs/remotes/mirror/d)
Found branch parent: (refs/remotes/origin/tags/1.0.1) ab5f9de20a71e54b3710c2ca5189140cf0c699d3
Following parent with do_switch
First, rewinding head to replay your work on top of it...
fatal: ambiguous argument 'remotes/d': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
Fast-forwarded master to refs/remotes/git-svn.
'git <command> [<revision>...] -- [<file>...]'
remotes/d
ok 4 - branch uses correct svn-remote

# passed all 4 test(s)
1..4
Successfully followed parent
ok 9 - update git svn-cloned repo (config ignore)

expecting success: 
	(
		cd c &&
		git svn rebase --ignore-paths="^www" &&
		printf "test_qqq\nb\n" > expect &&
		for i in */*.txt; do cat $i >> expect2; done &&
		test_cmp expect2 expect &&
		rm expect expect2
	)

r6 = 563cd388a39d3971248a9fc398f3b69993a93c45 (refs/remotes/origin/tags/1.0.1)
*** t9138-git-svn-authors-prog.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9138-git-svn-authors-prog/.git/
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9136-git-svn-recreated-branch-empty-file/svnrepo/trunk r1
ok 2 - clone using git svn

# passed all 2 test(s)
1..2
*** t9139-git-svn-non-utf8-commitencoding.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9139-git-svn-non-utf8-commitencoding/.git/
expecting success: 
	cat >svn-authors <<-\EOF
	ff = FFFFFFF FFFFFFF <fFf@other.example.com>
	EOF

ok 1 - svn-authors setup

expecting success: 
	for i in aa bb cc-sub dd-sub ee-foo ff
	do
		svn mkdir -m $i --username $i "$svnrepo"/$i
	done

	A	file
r1 = dc15a8b35d282de12e9a79463c8a862b21fc9d46 (refs/remotes/git-svn)
Committing transaction...
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9137-git-svn-dcommit-clobber-series/svnrepo r1
expecting success: 
		mkdir $H &&
		svn_cmd import -m "$H test" $H "$svnrepo"/$H &&
		git svn clone "$svnrepo"/$H $H
	
ok 1 - initialize repo

expecting success: 
	test x"`sed -n -e 58p < file`" = x58 &&
	test x"`sed -n -e 61p < file`" = x61 &&
	svn_cmd co "$svnrepo" tmp &&
	(cd tmp &&
		perl -i.bak -p -e "s/^58$/5588/" file &&
		perl -i.bak -p -e "s/^61$/6611/" file &&
		poke file &&
		test x"`sed -n -e 58p < file`" = x5588 &&
		test x"`sed -n -e 61p < file`" = x6611 &&
		svn_cmd commit -m "58 => 5588, 61 => 6611"
	)
	
A    tmp/file
Checked out revision 1.
Committing transaction...
Committed revision 1.
Sending        file
Transmitting file data .done
Committing transaction...
Committing transaction...
r4 = 4558cbd172d9abfb47a409f97a683ec9e6b7ca09 (refs/remotes/git-svn)
Committed revision 1.
Committed revision 2.
First, rewinding head to replay your work on top of it...
ok 2 - (supposedly) non-conflicting change from SVN

expecting success: 
	echo hi > life &&
	git update-index --add life &&
	git commit -m hi-life &&
	echo bye >> life &&
	git commit -m bye-life life
	
Fast-forwarded master to refs/remotes/git-svn.
[master 2846c33] hi-life
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 life
[master 4899bcf] bye-life
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 3 - some unrelated changes to git

expecting success: 
	test x"`sed -n -e 4p < file`" = x4 &&
	test x"`sed -n -e 7p < file`" = x7 &&
	perl -i.bak -p -e 's/^4$/4444/' file &&
	perl -i.bak -p -e 's/^7$/7777/' file &&
	test x"`sed -n -e 4p < file`" = x4444 &&
	test x"`sed -n -e 7p < file`" = x7777 &&
	git commit -m '4 => 4444, 7 => 7777' file &&
	git svn dcommit &&
	svn_cmd up tmp &&
	cd tmp &&
		test x"`sed -n -e 4p < file`" = x4444 &&
		test x"`sed -n -e 7p < file`" = x7777 &&
		test x"`sed -n -e 58p < file`" = x5588 &&
		test x"`sed -n -e 61p < file`" = x6611
	
ok 10 - update git svn-cloned repo (option ignore)

expecting success: 
	(
		cd s &&
		echo cvf >> www/test_www.txt
		echo ygg >> qqq/test_qqq.txt
		svn_cmd commit -m "SVN-side change in and out of ignored www" &&
		svn_cmd up &&
		svn_cmd log -v | fgrep "SVN-side change in and out of ignored www"
	)

[master 3af4711] 4 => 4444, 7 => 7777
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+), 2 deletions(-)
Committed revision 2.
Sending        qqq/test_qqq.txt
Sending        www/test_www.txt
Transmitting file data ..done
Committing transaction...
Committing transaction...
Committed revision 5.
Updating '.':
Committed revision 3.
At revision 5.
SVN-side change in and out of ignored www
ok 11 - SVN-side change in and out of ignored www

expecting success: 
	(
		cd g &&
		git svn rebase &&
		printf "test_qqq\nb\nygg\n" > expect &&
		for i in */*.txt; do cat $i >> expect2; done &&
		test_cmp expect2 expect &&
		rm expect expect2
	)

Committing transaction...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9139-git-svn-non-utf8-commitencoding/ISO8859-1/.git/
Committed revision 4.
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9137-git-svn-dcommit-clobber-series/svnrepo ...
Committing transaction...
r1 = f1dd9b850ffa2cfe3d2ec638e17219fc495381ab (refs/remotes/git-svn)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9139-git-svn-non-utf8-commitencoding/svnrepo/ISO8859-1 r1
ok 1 - ISO8859-1 setup

expecting success: 
		mkdir $H &&
		svn_cmd import -m "$H test" $H "$svnrepo"/$H &&
		git svn clone "$svnrepo"/$H $H
	
Committed revision 5.
	A	life
Committing transaction...
Committing transaction...
Committed r3
Committed revision 2.
	M	file
Committed revision 6.
ok 2 - setup svnrepo

expecting success: 
	git svn clone --authors-prog=./svn-authors-prog \
	    --authors-file=svn-authors "$svnrepo" x

r2 = 2eae550c012503a178945c12d7330024c0c44b71 (refs/remotes/git-svn)
	M	qqq/test_qqq.txt
	A	life
r3 = e484d0823c6811628b838ea155a2a92cf08e6457 (refs/remotes/git-svn)
r5 = 35fc94101801e82e119247b15531ccf7bd6febb4 (refs/remotes/git-svn)
W: 2846c339645c7b37e76ec35c065ca3dadff4c56b and refs/remotes/git-svn differ, using rebase:
:100644 100644 55200b3d5d7c0e515eaccaf8465a295017e88249 15dcf092297e5fcea41cadcc3eb0a689aaa3e65e M	file
First, rewinding head to replay your work on top of it...
First, rewinding head to replay your work on top of it...
Fast-forwarded master to refs/remotes/git-svn.
Applying: bye-life
Applying: 4 => 4444, 7 => 7777
ok 12 - update git svn-cloned repo again (config ignore)

expecting success: 
	(
		cd c &&
		git svn rebase --ignore-paths="^www" &&
		printf "test_qqq\nb\nygg\n" > expect &&
		for i in */*.txt; do cat $i >> expect2; done &&
		test_cmp expect2 expect &&
		rm expect expect2
	)

	M	life
Committed r4
	M	life
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9139-git-svn-non-utf8-commitencoding/eucJP/.git/
r4 = 9bdbf68011a66f28cf7a9114485b1aa27ce59119 (refs/remotes/git-svn)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9138-git-svn-authors-prog/x/.git/
	M	file
r2 = be6f190bf429290f39bdcb5f831da2d8278044af (refs/remotes/git-svn)
W: +empty_dir: aa
Committed r5
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9139-git-svn-non-utf8-commitencoding/svnrepo/eucJP r2
ok 2 - eucJP setup

expecting success: 
	(
		cd $H &&
		git config i18n.commitencoding $H &&
		git checkout -b t refs/remotes/git-svn &&
		echo $H >F &&
		git add F &&
		git commit -a -F "$TEST_DIRECTORY"/t3900/$H.txt &&
		E=$(git cat-file commit HEAD | sed -ne "s/^encoding //p") &&
		test "z$E" = "z$H"
	)
	
r1 = 32a655f397a212f553131e47d2de5de7998cd473 (refs/remotes/git-svn)
Switched to a new branch 't'
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 F
ok 3 - ISO8859-1 commit on git side

expecting success: 
	(
		cd $H &&
		git config i18n.commitencoding $H &&
		git checkout -b t refs/remotes/git-svn &&
		echo $H >F &&
		git add F &&
		git commit -a -F "$TEST_DIRECTORY"/t3900/$H.txt &&
		E=$(git cat-file commit HEAD | sed -ne "s/^encoding //p") &&
		test "z$E" = "z$H"
	)
	
	M	file
Switched to a new branch 't'
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 F
W: +empty_dir: bb
ok 4 - eucJP commit on git side

expecting success: 
	(
		cd $H &&
		git config --unset i18n.commitencoding &&
		test_must_fail git svn dcommit
	)
	
r5 = 8c2d2d1786b61b7137ca5135b41c219b26ce51ef (refs/remotes/git-svn)
No changes between 67027606eaa3b10e37e11decf4ab1414d59f1c44 and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
r2 = 2ed914059e95dac5a36f38d819a79a609337a2ff (refs/remotes/git-svn)
W: +empty_dir: cc-sub
Updating 'tmp':
U    tmp/file
A    tmp/life
Updated to revision 5.
ok 4 - change file but in unrelated area

expecting success: 
	echo foo >>file &&
	git add file &&
	test_must_fail git svn dcommit

r3 = 34e79d2ec18157604d810d33fef6de51647b8d62 (refs/remotes/git-svn)
	M	qqq/test_qqq.txt
W: +empty_dir: dd-sub
r5 = 35fc94101801e82e119247b15531ccf7bd6febb4 (refs/remotes/git-svn)
r4 = 89e2215387333dc486835d33cdb7e7e55aa10fc6 (refs/remotes/git-svn)
W: +empty_dir: ee-foo
First, rewinding head to replay your work on top of it...
r5 = 964863e59e7653d7d88f9ce80c8b74555b803132 (refs/remotes/git-svn)
Fast-forwarded master to refs/remotes/git-svn.
W: +empty_dir: ff
ok 13 - update git svn-cloned repo again (option ignore)

# passed all 13 test(s)
1..13
r6 = 0a5a956fd3b227888f6ad29f3f3d12d91e60f21b (refs/remotes/git-svn)
*** t9140-git-svn-reset.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9140-git-svn-reset/.git/
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9138-git-svn-authors-prog/svnrepo r6
creating empty directory: aa
creating empty directory: bb
creating empty directory: cc-sub
creating empty directory: dd-sub
creating empty directory: ee-foo
creating empty directory: ff
ok 3 - import authors with prog and file

expecting success: 
	(
		cd x
		test "`git rev-list refs/remotes/git-svn | wc -l`" -eq 6
	)

ok 4 - imported 6 revisions successfully

expecting success: 
	(
		cd x
		git rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \
		  grep "^author ee-foo <ee-foo@example\.com> " &&
		git rev-list -1 --pretty=raw refs/remotes/git-svn~2 | \
		  grep "^author dd <dd@sub\.example\.com> " &&
		git rev-list -1 --pretty=raw refs/remotes/git-svn~3 | \
		  grep "^author cc <cc@sub\.example\.com> " &&
		git rev-list -1 --pretty=raw refs/remotes/git-svn~4 | \
		  grep "^author bb <bb@example\.com> " &&
		git rev-list -1 --pretty=raw refs/remotes/git-svn~5 | \
		  grep "^author aa <aa@example\.com> "
	)

author ee-foo <ee-foo@example.com> 1450264567 +0000
author dd <dd@sub.example.com> 1450264566 +0000
author cc <cc@sub.example.com> 1450264565 +0000
author bb <bb@example.com> 1450264563 +0000
author aa <aa@example.com> 1450264562 +0000
ok 5 - authors-prog ran correctly

expecting success: 
	(
		cd x
		git rev-list -1 --pretty=raw refs/remotes/git-svn | \
		  grep "^author FFFFFFF FFFFFFF <fFf@other\.example\.com> "
	)

author FFFFFFF FFFFFFF <fFf@other.example.com> 1450264568 +0000
ok 6 - authors-file overrode authors-prog

expecting success: 
	svn mkdir -m bad --username "xyz; touch evil" "$svnrepo"/bad &&
	(
		cd x &&
		git svn --authors-prog=../svn-authors-prog fetch &&
		git rev-list -1 --pretty=raw refs/remotes/git-svn |
		grep "^author xyz; touch evil <xyz; touch evil@example\.com> " &&
		! test -f evil
	)

Committing transaction...
expecting success: 
	svn_cmd co "$svnrepo" s &&
	(
		cd s &&
		mkdir vis &&
		echo always visible > vis/vis.txt &&
		svn_cmd add vis &&
		svn_cmd commit -m "create visible files" &&
		mkdir hid &&
		echo initially hidden > hid/hid.txt &&
		svn_cmd add hid &&
		svn_cmd commit -m "create initially hidden files" &&
		svn_cmd up &&
		echo mod >> vis/vis.txt &&
		svn_cmd commit -m "modify vis" &&
		svn_cmd up
	)

Committed revision 7.
Checked out revision 0.
A         vis
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9139-git-svn-non-utf8-commitencoding/svnrepo/ISO8859-1 ...
A         vis/vis.txt
Cannot dcommit with a dirty index.  Commit your changes first, or stash them with `git stash'.
 at /«PKGBUILDDIR»/git-svn line 846.

ok 5 - attempt to dcommit with a dirty index

# passed all 5 test(s)
1..5
Could not decode as UTF-8:

Perhaps you need to set i18n.commitencoding

*** t9141-git-svn-multiple-branches.sh ***
ok 5 - ISO8859-1 dcommit to svn

expecting success: 
	(
		cd $H &&
		git config --unset i18n.commitencoding &&
		test_must_fail git svn dcommit
	)
	
Adding         vis
Adding         vis/vis.txt
Transmitting file data .done
Committing transaction...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9141-git-svn-multiple-branches/.git/
Committed revision 1.
A         hid
A         hid/hid.txt
Adding         hid
Adding         hid/hid.txt
Transmitting file data .done
Committing transaction...
expecting success: 
	mkdir	project \
		project/trunk \
		project/b_one \
		project/b_two \
		project/tags_A \
		project/tags_B &&
	echo 1 > project/trunk/a.file &&
	svn_cmd import -m "$test_description" project "$svnrepo/project" &&
	rm -rf project &&
	svn_cmd cp -m "Branch 1" "$svnrepo/project/trunk" \
				 "$svnrepo/project/b_one/first" &&
	svn_cmd cp -m "Tag 1" "$svnrepo/project/trunk" \
			      "$svnrepo/project/tags_A/1.0" &&
	svn_cmd co "$svnrepo/project" svn_project &&
	( cd svn_project &&
		echo 2 > trunk/a.file &&
		svn_cmd ci -m "Change 1" trunk/a.file &&
		svn_cmd cp -m "Branch 2" "$svnrepo/project/trunk" \
					 "$svnrepo/project/b_one/second" &&
		svn_cmd cp -m "Tag 2" "$svnrepo/project/trunk" \
				      "$svnrepo/project/tags_A/2.0" &&
		echo 3 > trunk/a.file &&
		svn_cmd ci -m "Change 2" trunk/a.file &&
		svn_cmd cp -m "Branch 3" "$svnrepo/project/trunk" \
					 "$svnrepo/project/b_two/1" &&
		svn_cmd cp -m "Tag 3" "$svnrepo/project/trunk" \
				      "$svnrepo/project/tags_A/3.0" &&
		echo 4 > trunk/a.file &&
		svn_cmd ci -m "Change 3" trunk/a.file &&
		svn_cmd cp -m "Branch 4" "$svnrepo/project/trunk" \
					 "$svnrepo/project/b_two/2" &&
		svn_cmd cp -m "Tag 4" "$svnrepo/project/trunk" \
				      "$svnrepo/project/tags_A/4.0" &&
		svn_cmd up &&
		echo 5 > b_one/first/a.file &&
		svn_cmd ci -m "Change 4" b_one/first/a.file &&
		svn_cmd cp -m "Tag 5" "$svnrepo/project/b_one/first" \
				      "$svnrepo/project/tags_B/v5" &&
		echo 6 > b_one/second/a.file &&
		svn_cmd ci -m "Change 5" b_one/second/a.file &&
		svn_cmd cp -m "Tag 6" "$svnrepo/project/b_one/second" \
				      "$svnrepo/project/tags_B/v6" &&
		echo 7 > b_two/1/a.file &&
		svn_cmd ci -m "Change 6" b_two/1/a.file &&
		svn_cmd cp -m "Tag 7" "$svnrepo/project/b_two/1" \
				      "$svnrepo/project/tags_B/v7" &&
		echo 8 > b_two/2/a.file &&
		svn_cmd ci -m "Change 7" b_two/2/a.file &&
		svn_cmd cp -m "Tag 8" "$svnrepo/project/b_two/2" \
				      "$svnrepo/project/tags_B/v8"
	)

Adding         project/b_one
Adding         project/b_two
Adding         project/tags_A
Adding         project/tags_B
Adding         project/trunk
Adding         project/trunk/a.file
Committing transaction...
Committed revision 2.
Updating '.':
At revision 2.
W: +empty_dir: bad
r7 = 0d5b8c335dc42e58da174c042c1c7a203d704139 (refs/remotes/git-svn)
author xyz; touch evil <xyz; touch evil@example.com> 1450264577 +0000
ok 7 - authors-prog handled special characters in username

# passed all 7 test(s)
1..7
*** t9142-git-svn-shallow-clone.sh ***
Committed revision 1.
Sending        vis/vis.txt
Transmitting file data .Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9139-git-svn-non-utf8-commitencoding/svnrepo/eucJP ...
done
Committing transaction...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9142-git-svn-shallow-clone/.git/
Could not decode as UTF-8:

Perhaps you need to set i18n.commitencoding

ok 6 - eucJP dcommit to svn

# passed all 6 test(s)
1..6
*** t9143-git-svn-gc.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9143-git-svn-gc/.git/
Committing transaction...
Committed revision 3.
Updating '.':
At revision 3.
ok 1 - setup test repository

expecting success: 
	git svn init "$svnrepo" g &&
	( cd g && git svn fetch --ignore-paths="^hid" )

Committed revision 2.
expecting success: 
	svn_cmd mkdir -m "create standard layout" \
	  "$svnrepo"/trunk "$svnrepo"/branches "$svnrepo"/tags &&
	svn_cmd cp -m "branch off trunk" \
	  "$svnrepo"/trunk "$svnrepo"/branches/a &&
	svn_cmd co "$svnrepo"/branches/a &&
	(
		cd a &&
		> foo &&
		svn_cmd add foo &&
		svn_cmd commit -m "add foo"
	) &&
	start_httpd

expecting success: 
	mkdir import &&
	mkdir tmp &&
	echo "Sample text for Subversion repository." > import/test.txt &&
	svn_cmd import -m "import for git svn" import "$svnrepo" > /dev/null
	
Committing transaction...
Committing transaction...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9140-git-svn-reset/g/.git/
Committed revision 3.
A    svn_project/b_one
A    svn_project/b_one/first
A    svn_project/b_one/first/a.file
A    svn_project/b_two
A    svn_project/tags_A
A    svn_project/tags_A/1.0
A    svn_project/tags_A/1.0/a.file
A    svn_project/tags_B
A    svn_project/trunk
A    svn_project/trunk/a.file
Checked out revision 3.
Committed revision 1.
ok 1 - setup directories and test repo

expecting success: svn_cmd co "$svnrepo" test_wc
A    test_wc/test.txt
Checked out revision 1.
ok 2 - checkout working copy from svn

expecting success: 
	(
		cd test_wc &&
		svn_cmd propset foo bar test.txt &&
		svn_cmd commit -m "property set"
	)
Sending        trunk/a.file
Transmitting file data .done
Committing transaction...
property 'foo' set on 'test.txt'
Committing transaction...
Sending        test.txt
Committing transaction...
	A	vis/vis.txt
Committed revision 2.
Committed revision 4.
Checked out revision 2.
r1 = aa9050099363a9f83e5027eaabe8d240ade0596d (refs/remotes/git-svn)
A         foo
Committed revision 2.
ok 3 - set some properties to create an unhandled.log file

expecting success: git svn init "$svnrepo"
r2 = bac4f20fa8ca3ce2947adfe84c4dc8ba20a2b75f (refs/remotes/git-svn)
Committing transaction...
	M	vis/vis.txt
r3 = 4384f189c313fddc5b6e70268186eb7f66f2fa8a (refs/remotes/git-svn)
Adding         foo
Transmitting file data .done
Committing transaction...
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9140-git-svn-reset/svnrepo r3
ok 2 - clone SVN repository with hidden directory

expecting success: 
	( cd s &&
	  echo mod hidden >> hid/hid.txt &&
	  svn_cmd commit -m "modify hid" &&
	  svn_cmd up
	)

Committed revision 5.
Sending        hid/hid.txt
Transmitting file data .done
Committing transaction...
Committed revision 3.
SVN_HTTPD_PORT is not defined!
ok 1 - setup test repository

expecting success: 
	git svn clone -r HEAD "$svnrepo/trunk" g &&
	( cd g && git rev-parse --symbolic --verify HEAD )

Committing transaction...
ok 4 - Setup repo

expecting success: git svn fetch
Committed revision 4.
Updating '.':
At revision 4.
ok 3 - modify hidden file in SVN repo

expecting success: 
	( cd g &&
	  git svn find-rev refs/remotes/git-svn > ../expect &&
	  test_must_fail git svn fetch 2> ../errors &&
	  git svn find-rev refs/remotes/git-svn > ../expect2 ) &&
	fgrep "not found in commit" errors &&
	test_cmp expect expect2

Committed revision 6.
Sending        trunk/a.file
Transmitting file data .done
Committing transaction...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9142-git-svn-shallow-clone/g/.git/
Committed revision 7.
Committing transaction...
r1 = 07971d87e91cc019924ad1fc6bb79ed6300e1282 (refs/remotes/git-svn)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9142-git-svn-shallow-clone/svnrepo/trunk r1
HEAD
ok 2 - clone trunk with "-r HEAD"

# passed all 2 test(s)
1..2
*** t9144-git-svn-old-rev_map.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9144-git-svn-old-rev_map/.git/
	A	test.txt
r1 = bc4d5ca4ca5a7b6e12763a3f29ccd357e560e364 (refs/remotes/git-svn)
Committed revision 8.
	M	test.txt
r2 = 00f74a738b9936dc3635ab3c241457f7dbf1d968 (refs/remotes/git-svn)
Committing transaction...
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9143-git-svn-gc/svnrepo r2
ok 5 - Fetch repo

expecting success: 
	 cp .git/svn/refs/remotes/git-svn/unhandled.log tmp
	
ok 6 - make backup copy of unhandled.log

expecting success: > .git/svn/refs/remotes/git-svn/index
ok 7 - create leftover index

expecting success: git svn gc
expecting success: 
	mkdir i &&
	(cd i && > a) &&
	svn_cmd import -m- i "$svnrepo" &&
	git svn init "$svnrepo" &&
	git svn fetch &&
	test -d .git/svn/refs/remotes/git-svn/ &&
	! test -e .git/svn/git-svn/ &&
	mv .git/svn/refs/remotes/git-svn .git/svn/ &&
	rm -r .git/svn/refs

Committed revision 9.
Adding         i/a
Committing transaction...
Sending        trunk/a.file
Transmitting file data .done
Committing transaction...
Committed revision 1.
Committed revision 10.
ok 8 - git svn gc runs

expecting success: ! test -f .git/svn/refs/remotes/git-svn/index
ok 9 - git svn index removed

expecting success: 
		 gunzip .git/svn/refs/remotes/git-svn/unhandled.log.gz
		
ok 10 - git svn gc produces a valid gzip file

expecting success: 
	 test_cmp .git/svn/refs/remotes/git-svn/unhandled.log tmp/unhandled.log
	
ok 11 - git svn gc does not change unhandled.log files

# passed all 11 test(s)
1..11
*** t9145-git-svn-master-branch.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9145-git-svn-master-branch/.git/
Committing transaction...
hid/hid.txt was not found in commit 4384f189c313fddc5b6e70268186eb7f66f2fa8a (r3)
ok 4 - fetch fails on modified hidden file

expecting success: 
	( cd g &&
	  git svn reset -r1 &&
	  git svn find-rev refs/remotes/git-svn > ../expect2 ) &&
	echo 1 >expect &&
	test_cmp expect expect2

Committed revision 11.
expecting success: 
	mkdir i &&
	> i/a &&
	svn_cmd import -m trunk i "$svnrepo/trunk" &&
	svn_cmd import -m b/a i "$svnrepo/branches/a" &&
	svn_cmd import -m b/b i "$svnrepo/branches/b"

Committing transaction...
Adding         i/a
Committing transaction...
Committed revision 12.
Updating '.':
A    b_one/second
A    b_one/second/a.file
A    b_two/1
A    b_two/1/a.file
A    b_two/2
A    b_two/2/a.file
A    tags_A/2.0
A    tags_A/2.0/a.file
A    tags_A/3.0
r1 = aa9050099363a9f83e5027eaabe8d240ade0596d (refs/remotes/git-svn)
A    tags_A/3.0/a.file
A    tags_A/4.0
A    tags_A/4.0/a.file
Updated to revision 12.
Committed revision 1.
Sending        b_one/first/a.file
Transmitting file data .done
Committing transaction...
Adding         i/a
Committing transaction...
	A	a
r1 = e914f1f0ed142675b8493d9c0fce53afbfeb9fa8 (refs/remotes/git-svn)
ok 5 - reset unwinds back to r1

expecting success: 
	( cd g &&
	  git svn fetch &&
	  git svn rebase &&
	  fgrep "mod hidden" hid/hid.txt
	)

Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9144-git-svn-old-rev_map/svnrepo r1
ok 1 - setup test repository with old layout

expecting success: 
	svn_cmd import -m- i "$svnrepo/b" &&
	git svn rebase &&
	echo a >> b/a &&
	git add b/a &&
	git commit -m- -a &&
	git svn dcommit &&
	! test -d .git/svn/refs/ &&
	test -e .git/svn/git-svn/

Committed revision 13.
Committed revision 2.
Adding         i/a
Committing transaction...
Committing transaction...
Adding         i/a
Committing transaction...
Committed revision 2.
Index mismatch: a4b5c203f79112e92d530cb82366ca4d706fa4a8 != 6b5a1244749c8cdb5442eefd0abc3689d666322d
rereading aa9050099363a9f83e5027eaabe8d240ade0596d
Committed revision 14.
Committed revision 3.
ok 1 - setup test repository

expecting success: 
	git svn clone -s "$svnrepo" g &&
	(
		cd g &&
		test x`git rev-parse --verify refs/remotes/origin/trunk^0` = \
		     x`git rev-parse --verify refs/heads/master^0`
	)

	A	hid/hid.txt
r2 = 82207f9775024a0b9cfd853cbfe2fe4cfe20f2de (refs/remotes/git-svn)
Sending        b_one/second/a.file
Transmitting file data .done
Committing transaction...
	M	vis/vis.txt
r3 = 5cf4cd00584c18de538c189e4a0f0056863c1633 (refs/remotes/git-svn)
	M	hid/hid.txt
r4 = adc8e045f617b8a4b6e19df6da31f2750f9ea366 (refs/remotes/git-svn)
Committed revision 15.
Committing transaction...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9145-git-svn-master-branch/g/.git/
	A	b/a
Committed revision 16.
r2 = 636ab4fed29f62460c01df42eb194a9c4f0f4f0e (refs/remotes/git-svn)
Sending        b_two/1/a.file
Transmitting file data .done
Committing transaction...
First, rewinding head to replay your work on top of it...
Fast-forwarded master to refs/remotes/git-svn.
[master af565f9] -
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
	A	a
r1 = 80bd59bfcd54c142a2ae40b2657dcaa053d1d1f2 (refs/remotes/origin/trunk)
Committed revision 17.
	A	a
r2 = 588d13449f4834c86c2b9970d69825594c7e34c7 (refs/remotes/origin/a)
Committing transaction...
	A	a
First, rewinding head to replay your work on top of it...
r3 = 6edcbe4bcbe95ef2f520b92f931a80c2414b8b55 (refs/remotes/origin/b)
mod hidden
ok 6 - refetch succeeds not ignoring any files

# passed all 6 test(s)
1..6
*** t9146-git-svn-empty-dirs.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9146-git-svn-empty-dirs/.git/
Committed revision 18.
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9145-git-svn-master-branch/svnrepo/trunk r1
ok 2 - git svn clone --stdlayout sets up trunk as master

# passed all 2 test(s)
1..2
*** t9147-git-svn-include-paths.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9147-git-svn-include-paths/.git/
Sending        b_two/2/a.file
Transmitting file data .done
Committing transaction...
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9144-git-svn-old-rev_map/svnrepo ...
Committed revision 19.
expecting success: 
	for i in a b c d d/e d/e/f "weird file name"
	do
		svn_cmd mkdir -m "mkdir $i" "$svnrepo"/"$i"
	done

expecting success: 
	svn_cmd co "$svnrepo" s &&
	(
		cd s &&
		mkdir qqq www xxx &&
		echo test_qqq > qqq/test_qqq.txt &&
		echo test_www > www/test_www.txt &&
		echo test_xxx > xxx/test_xxx.txt &&
		svn_cmd add qqq &&
		svn_cmd add www &&
		svn_cmd add xxx &&
		svn_cmd commit -m "create some files" &&
		svn_cmd up &&
		echo hi >> www/test_www.txt &&
		svn_cmd commit -m "modify www/test_www.txt" &&
		svn_cmd up
	)

	M	b/a
Checked out revision 0.
Committing transaction...
A         qqq
A         qqq/test_qqq.txt
A         www
A         www/test_www.txt
A         xxx
A         xxx/test_xxx.txt
Committing transaction...
Committed r3
Committed revision 20.
ok 1 - setup svnrepo

expecting success: 
	git svn clone -T trunk \
		      -b b_one/* --branches b_two/* \
		      -t tags_A/* --tags tags_B \
		      "$svnrepo/project" git_project &&
	( cd git_project &&
		git rev-parse refs/remotes/origin/first &&
		git rev-parse refs/remotes/origin/second &&
		git rev-parse refs/remotes/origin/1 &&
		git rev-parse refs/remotes/origin/2 &&
		git rev-parse refs/remotes/origin/tags/1.0 &&
		git rev-parse refs/remotes/origin/tags/2.0 &&
		git rev-parse refs/remotes/origin/tags/3.0 &&
		git rev-parse refs/remotes/origin/tags/4.0 &&
		git rev-parse refs/remotes/origin/tags/v5 &&
		git rev-parse refs/remotes/origin/tags/v6 &&
		git rev-parse refs/remotes/origin/tags/v7 &&
		git rev-parse refs/remotes/origin/tags/v8
	)

Adding         qqq
Adding         qqq/test_qqq.txt
Adding         www
Adding         www/test_www.txt
Adding         xxx
Adding         xxx/test_xxx.txt
Transmitting file data ...	M	b/a
done
Committing transaction...
r3 = d0dcb769f71b2f017cfe4b345a69610783abdcf8 (refs/remotes/git-svn)
Committed revision 1.
No changes between af565f9b9c60921e59a590c490d73a3ff2a4a272 and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
ok 2 - old layout continues to work

# passed all 2 test(s)
1..2
*** t9148-git-svn-propset.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9148-git-svn-propset/.git/
Committing transaction...
Committed revision 1.
Updating '.':
At revision 1.
Committed revision 2.
Sending        www/test_www.txt
Transmitting file data .done
Committing transaction...
Committing transaction...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9141-git-svn-multiple-branches/git_project/.git/
Using higher level of URL: file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project => file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo
Committed revision 2.
Updating '.':
At revision 2.
ok 1 - setup test repository

expecting success: 
	git svn clone --include-paths="qqq" "$svnrepo" g &&
	echo test_qqq > expect &&
	for i in g/*/*.txt; do cat $i >> expect2; done &&
	test_cmp expect expect2

Committed revision 3.
expecting success: 
	git svn init "$svnrepo"
	
	A	a.file
Committing transaction...
r1 = 681d06d5b210de034f9f2df804c0196d7d49afcc (refs/remotes/origin/trunk)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/b_one/first, 1
Found branch parent: (refs/remotes/origin/first) 681d06d5b210de034f9f2df804c0196d7d49afcc
Committed revision 4.
Following parent with do_switch
Successfully followed parent
Committing transaction...
r2 = 71b7c689dd42092f15d447838c83055bf03dbb96 (refs/remotes/origin/first)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/tags_A/1.0, 2
Found branch parent: (refs/remotes/origin/tags/1.0) 681d06d5b210de034f9f2df804c0196d7d49afcc
Committed revision 5.
Following parent with do_switch
Successfully followed parent
r3 = dbb6e60660b1dc26f96e4ea5dda9c412c62dbc73 (refs/remotes/origin/tags/1.0)
Committing transaction...
	M	a.file
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9147-git-svn-include-paths/g/.git/
r4 = ae810a7b8277c815f7c832003b125e948919f3ff (refs/remotes/origin/trunk)
Committed revision 6.
ok 1 - initialize git svn

expecting success: 
	git svn fetch
	
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/b_one/second, 4
Committing transaction...
Found branch parent: (refs/remotes/origin/second) ae810a7b8277c815f7c832003b125e948919f3ff
	A	qqq/test_qqq.txt
Following parent with do_switch
Successfully followed parent
r1 = d31dfc05c1d7f55783d5c173502ac0fc553a42dd (refs/remotes/git-svn)
Committed revision 7.
ok 1 - initialize repo

expecting success: git svn clone "$svnrepo" cloned
r5 = 4ca565d71598a46c6253a11aa8b7c36a18d774bd (refs/remotes/origin/second)
r2 = 22c7e540779f6659b5038eadb29dd00cfe49a150 (refs/remotes/git-svn)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/tags_A/2.0, 5
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9147-git-svn-include-paths/svnrepo r2
ok 2 - clone an SVN repository with filter to include qqq directory

expecting success: 
	git svn init "$svnrepo" c &&
	( cd c && git svn fetch --include-paths="qqq" ) &&
	rm expect2 &&
	echo test_qqq > expect &&
	for i in c/*/*.txt; do cat $i >> expect2; done &&
	test_cmp expect expect2

Found branch parent: (refs/remotes/origin/tags/2.0) ae810a7b8277c815f7c832003b125e948919f3ff
Following parent with do_switch
Successfully followed parent
r6 = 6457ca0b07fc5e9e4be7310ed938ad22bb25f2ea (refs/remotes/origin/tags/2.0)
	M	a.file
r7 = 8428abf5fefb5bb893fd9820ffe36eafb0227c28 (refs/remotes/origin/trunk)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/b_two/1, 7
Found branch parent: (refs/remotes/origin/1) 8428abf5fefb5bb893fd9820ffe36eafb0227c28
Following parent with do_switch
Successfully followed parent
r8 = f0a2501038fe44ea756b0dbfc4beb960dcda1eff (refs/remotes/origin/1)
	A	subdir/subdir2/foo_subdir2
	A	subdir/foo_subdir
	A	foo
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/tags_A/3.0, 8
r1 = 22e61b72e0b901fe3eb4447bb84889a1dcc9bc48 (refs/remotes/git-svn)
Found branch parent: (refs/remotes/origin/tags/3.0) 8428abf5fefb5bb893fd9820ffe36eafb0227c28
Following parent with do_switch
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9148-git-svn-propset/svnrepo r1
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9147-git-svn-include-paths/c/.git/
ok 2 - fetch revisions from svn

expecting success: 
	set_props "." "foo" "svn:keywords" "FreeBSD=%H" &&
	git svn dcommit &&
	svn_cmd co "$svnrepo" svn_project &&
	confirm_props "." "foo" "svn:keywords" "FreeBSD=%H" &&
	rm -rf svn_project
	
Successfully followed parent
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9146-git-svn-empty-dirs/cloned/.git/
r9 = 3ac3c64b9bd7d49ea03519ee0642eb02753851f0 (refs/remotes/origin/tags/3.0)
	M	a.file
r10 = 4993f5f39929967293062a4e1be4111bd5d0af1f (refs/remotes/origin/trunk)
W: +empty_dir: a
r1 = 03e2038c8de87412a92a391d3426b67ab7dd92b5 (refs/remotes/git-svn)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/b_two/2, 10
W: +empty_dir: b
Found branch parent: (refs/remotes/origin/2) 4993f5f39929967293062a4e1be4111bd5d0af1f
Following parent with do_switch
r2 = e9039aad9258f4af3a6e84a9d40ad4e587cf5e9b (refs/remotes/git-svn)
Successfully followed parent
W: +empty_dir: c
r3 = 50a8e50c2999ee238f47cb2fe4c09e9c3f6fbda8 (refs/remotes/git-svn)
r11 = 33feed176d5a01e7c52413889fa2a98ae5a3e197 (refs/remotes/origin/2)
W: +empty_dir: d
r4 = 01a64551cee67b212fc553941bc96bb180db09e3 (refs/remotes/git-svn)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/tags_A/4.0, 11
W: +empty_dir: d/e
Found branch parent: (refs/remotes/origin/tags/4.0) 4993f5f39929967293062a4e1be4111bd5d0af1f
r5 = ba478ec6b575003ccac43048766cc172c7cb04f4 (refs/remotes/git-svn)
Following parent with do_switch
Successfully followed parent
W: +empty_dir: d/e/f
r6 = e8b3e7cab2ec7cf3db7d383d097190367f0d171d (refs/remotes/git-svn)
r12 = f021cf77b35d9e3211bd9ad9a13da98c5b0c4e8d (refs/remotes/origin/tags/4.0)
[master 3191570] testing propset
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
W: +empty_dir: weird file name
r7 = db5a04befeb8f2d32c10a7a1243a2599a8478755 (refs/remotes/git-svn)
	M	a.file
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9146-git-svn-empty-dirs/svnrepo r7
creating empty directory: a
creating empty directory: b
creating empty directory: c
creating empty directory: d
creating empty directory: d/e
creating empty directory: d/e/f
creating empty directory: weird file name
r13 = 77d4032149791178c76f9ba61ede240ff9c41fdb (refs/remotes/origin/first)
ok 2 - clone

expecting success: 
	(
		cd cloned &&
		for i in a b c d d/e d/e/f "weird file name"
		do
			if ! test -d "$i"
			then
				echo >&2 "$i does not exist"
				exit 1
			fi
		done
	)

ok 3 - empty directories exist

expecting success: 
	(
		git svn init "$svnrepo" cloned-no-mkdirs &&
		cd cloned-no-mkdirs &&
		git config svn-remote.svn.automkdirs false &&
		git svn fetch &&
		for i in a b c d d/e d/e/f "weird file name"
		do
			if test -d "$i"
			then
				echo >&2 "$i exists"
				exit 1
			fi
		done
	)

Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/b_one/first => file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/tags_B/v5, 13
	A	qqq/test_qqq.txt
Found branch parent: (refs/remotes/origin/tags/v5) 77d4032149791178c76f9ba61ede240ff9c41fdb
Following parent with do_switch
r1 = d31dfc05c1d7f55783d5c173502ac0fc553a42dd (refs/remotes/git-svn)
Successfully followed parent
r14 = 1fbf88e33554b1e42facf1787aa64d6b548d55e0 (refs/remotes/origin/tags/v5)
r2 = 22c7e540779f6659b5038eadb29dd00cfe49a150 (refs/remotes/git-svn)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9147-git-svn-include-paths/svnrepo r2
	M	a.file
ok 3 - init+fetch an SVN repository with included qqq directory

expecting success: 
	(
	    cd g &&
	    git config --get svn-remote.svn.include-paths | fgrep "qqq"
	)

qqq
ok 4 - verify include-paths config saved by clone

expecting success: 
	(
		cd s &&
		echo b >> qqq/test_qqq.txt &&
		svn_cmd commit -m "SVN-side change outside of www" &&
		svn_cmd up &&
		svn_cmd log -v | fgrep "SVN-side change outside of www"
	)

r15 = c2a5777cc79577eb5b12d5076ce1f0d1b5dd2566 (refs/remotes/origin/second)
Sending        qqq/test_qqq.txt
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/b_one/second => file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/tags_B/v6, 15
Transmitting file data .done
Committing transaction...
Found branch parent: (refs/remotes/origin/tags/v6) c2a5777cc79577eb5b12d5076ce1f0d1b5dd2566
Following parent with do_switch
Successfully followed parent
Committed revision 3.
r16 = d6e4f62cceb8d719ecfa7c3c3cbafe8ee0dc188c (refs/remotes/origin/tags/v6)
Updating '.':
At revision 3.
SVN-side change outside of www
ok 5 - SVN-side change outside of www

expecting success: 
	(
		cd g &&
		git svn rebase &&
		printf "test_qqq\nb\n" > expect &&
		for i in */*.txt; do cat $i >> expect2; done &&
		test_cmp expect2 expect &&
		rm expect expect2
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9146-git-svn-empty-dirs/cloned-no-mkdirs/.git/
	M	a.file
r17 = 28af297776f55aca645e778a35027947063f8991 (refs/remotes/origin/1)
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9148-git-svn-propset/svnrepo ...
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/b_two/1 => file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/tags_B/v7, 17
Found branch parent: (refs/remotes/origin/tags/v7) 28af297776f55aca645e778a35027947063f8991
Following parent with do_switch
Successfully followed parent
	M	foo
r18 = 1de5a9716f20c9007032d57cfae71d3beae2e863 (refs/remotes/origin/tags/v7)
	M	a.file
r19 = 4a578bfd69cb89c88cddeaf0a4af36d021365d32 (refs/remotes/origin/2)
Committed r2
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/b_two/2 => file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/tags_B/v8, 19
	M	foo
Found branch parent: (refs/remotes/origin/tags/v8) 4a578bfd69cb89c88cddeaf0a4af36d021365d32
r2 = b31d902b9d8433b20d9a8c1b4b340ac5bd2c5430 (refs/remotes/git-svn)
Following parent with do_switch
No changes between 3191570fc826bb7df32a8302b736d0bf54f7444c and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
Successfully followed parent
A    svn_project/subdir
A    svn_project/subdir/subdir2
r20 = 1b625f32053504178f9b6ed231825a764811fd91 (refs/remotes/origin/tags/v8)
A    svn_project/subdir/subdir2/foo_subdir2
A    svn_project/subdir/foo_subdir
A    svn_project/foo
Checked out revision 2.
ok 3 - add props top level

expecting success: 
	set_props "." "foo" \
		"svn:keywords" "FreeBSD=%H" fbsd:nokeywords yes &&
	git svn dcommit &&
	svn_cmd co "$svnrepo" svn_project &&
	confirm_props "." "foo" \
		"svn:keywords" "FreeBSD=%H" fbsd:nokeywords yes &&
	rm -rf svn_project
	
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/trunk r10
77d4032149791178c76f9ba61ede240ff9c41fdb
c2a5777cc79577eb5b12d5076ce1f0d1b5dd2566
28af297776f55aca645e778a35027947063f8991
4a578bfd69cb89c88cddeaf0a4af36d021365d32
dbb6e60660b1dc26f96e4ea5dda9c412c62dbc73
6457ca0b07fc5e9e4be7310ed938ad22bb25f2ea
3ac3c64b9bd7d49ea03519ee0642eb02753851f0
f021cf77b35d9e3211bd9ad9a13da98c5b0c4e8d
1fbf88e33554b1e42facf1787aa64d6b548d55e0
d6e4f62cceb8d719ecfa7c3c3cbafe8ee0dc188c
1de5a9716f20c9007032d57cfae71d3beae2e863
1b625f32053504178f9b6ed231825a764811fd91
ok 2 - clone multiple branch and tag paths

expecting success: 
	( cd git_project &&
		test_must_fail git svn branch -m "No new branch" Nope &&
		test_must_fail git svn tag -m "No new tag" Tagless &&
		test_must_fail git rev-parse refs/remotes/origin/Nope &&
		test_must_fail git rev-parse refs/remotes/origin/tags/Tagless
	) &&
	( cd svn_project &&
		svn_cmd up &&
		test_must_fail test -d b_one/Nope &&
		test_must_fail test -d b_two/Nope &&
		test_must_fail test -d tags_A/Tagless &&
		test_must_fail test -d tags_B/Tagless
	)

W: +empty_dir: a
r1 = 03e2038c8de87412a92a391d3426b67ab7dd92b5 (refs/remotes/git-svn)
	M	qqq/test_qqq.txt
W: +empty_dir: b
r2 = e9039aad9258f4af3a6e84a9d40ad4e587cf5e9b (refs/remotes/git-svn)
r3 = 02a8190a4769d76a0ba1cb31bd119a6ff7d85030 (refs/remotes/git-svn)
W: +empty_dir: c
r3 = 50a8e50c2999ee238f47cb2fe4c09e9c3f6fbda8 (refs/remotes/git-svn)
First, rewinding head to replay your work on top of it...
Fast-forwarded master to refs/remotes/git-svn.
W: +empty_dir: d
ok 6 - update git svn-cloned repo (config include)

expecting success: 
	(
		cd c &&
		git svn rebase --include-paths="qqq" &&
		printf "test_qqq\nb\n" > expect &&
		for i in */*.txt; do cat $i >> expect2; done &&
		test_cmp expect2 expect &&
		rm expect expect2
	)

r4 = 01a64551cee67b212fc553941bc96bb180db09e3 (refs/remotes/git-svn)
W: +empty_dir: d/e
r5 = ba478ec6b575003ccac43048766cc172c7cb04f4 (refs/remotes/git-svn)
W: +empty_dir: d/e/f
r6 = e8b3e7cab2ec7cf3db7d383d097190367f0d171d (refs/remotes/git-svn)
W: +empty_dir: weird file name
r7 = db5a04befeb8f2d32c10a7a1243a2599a8478755 (refs/remotes/git-svn)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9146-git-svn-empty-dirs/svnrepo r7
ok 4 - option automkdirs set to false

expecting success: 
	svn_cmd mkdir -m "bang bang"  "$svnrepo"/"! !"

Committing transaction...
Multiple branch paths defined for Subversion repository.
You must specify where you want to create the branch with the --destination argument.

Committed revision 8.
ok 5 - more emptiness

expecting success: 
	( cd cloned && git svn rebase ) &&
	test -d cloned/"! !"

	M	qqq/test_qqq.txt
[master d0b3afa] testing propset
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
r3 = 02a8190a4769d76a0ba1cb31bd119a6ff7d85030 (refs/remotes/git-svn)
First, rewinding head to replay your work on top of it...
Fast-forwarded master to refs/remotes/git-svn.
ok 7 - update git svn-cloned repo (option include)

expecting success: 
	(
		cd s &&
		echo zaq >> www/test_www.txt
		svn_cmd commit -m "SVN-side change inside of www/test_www.txt" &&
		svn_cmd up &&
		svn_cmd log -v | fgrep "SVN-side change inside of www/test_www.txt"
	)

Multiple tag paths defined for Subversion repository.
You must specify where you want to create the tag with the --destination argument.

Sending        www/test_www.txt
Transmitting file data .done
Committing transaction...
fatal: ambiguous argument 'refs/remotes/origin/Nope': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
refs/remotes/origin/Nope
fatal: ambiguous argument 'refs/remotes/origin/tags/Tagless': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
refs/remotes/origin/tags/Tagless
Updating '.':
A    tags_B/v5
A    tags_B/v5/a.file
A    tags_B/v6
A    tags_B/v6/a.file
A    tags_B/v7
A    tags_B/v7/a.file
A    tags_B/v8
A    tags_B/v8/a.file
Updated to revision 20.
ok 3 - Multiple branch or tag paths require -d

expecting success: 
	( cd git_project &&
		git svn branch -m "New branch 1" -d b_one New1 ) &&
	( cd svn_project &&
		svn_cmd up && test -e b_one/New1/a.file ) &&

	( cd git_project &&
		git svn branch -m "New branch 2" -d b_two New2 ) &&
	( cd svn_project &&
		svn_cmd up && test -e b_two/New2/a.file ) &&

	( cd git_project &&
		git svn branch -t -m "New tag 1" -d tags_A Tag1 ) &&
	( cd svn_project &&
		svn_cmd up && test -e tags_A/Tag1/a.file ) &&

	( cd git_project &&
		git svn tag -m "New tag 2" -d tags_B Tag2 ) &&
	( cd svn_project &&
		svn_cmd up && test -e tags_B/Tag2/a.file )

Committed revision 4.
Updating '.':
At revision 4.
SVN-side change inside of www/test_www.txt
ok 8 - SVN-side change inside of ignored www

expecting success: 
	(
		cd g &&
		git svn rebase &&
		printf "test_qqq\nb\n" > expect &&
		for i in */*.txt; do cat $i >> expect2; done &&
		test_cmp expect2 expect &&
		rm expect expect2
	)

W: +empty_dir: ! !
r8 = c6ba0004140662b84bfdfe88cf829dfc3055ecf2 (refs/remotes/git-svn)
First, rewinding head to replay your work on top of it...
Fast-forwarded master to refs/remotes/git-svn.
creating empty directory: ! !
ok 6 - git svn rebase creates empty directory

expecting success: 
	(
		cd cloned &&
		rm -r * &&
		git svn mkdirs &&
		for i in a b c d d/e d/e/f "weird file name" "! !"
		do
			if ! test -d "$i"
			then
				echo >&2 "$i does not exist"
				exit 1
			fi
		done
	)

Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9148-git-svn-propset/svnrepo ...
	M	foo
Copying file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/trunk at r10 to file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/b_one/New1...
Committed r3
creating empty directory: ! !
creating empty directory: a
creating empty directory: b
creating empty directory: c
creating empty directory: d
creating empty directory: d/e
creating empty directory: d/e/f
creating empty directory: weird file name
ok 7 - git svn mkdirs recreates empty directories

expecting success: 
	(
		cd cloned &&
		rm -r * &&
		git svn mkdirs -r7 &&
		for i in a b c d d/e d/e/f "weird file name"
		do
			if ! test -d "$i"
			then
				echo >&2 "$i does not exist"
				exit 1
			fi
		done

		if test -d "! !"
		then
			echo >&2 "$i should not exist"
			exit 1
		fi

		git svn mkdirs -r8 &&
		if ! test -d "! !"
		then
			echo >&2 "$i not exist"
			exit 1
		fi
	)

	M	foo
r3 = 0a5485b960f7b5c5cd698864ed16236e94bbe326 (refs/remotes/git-svn)
No changes between d0b3afaaaa3b9644299b2ae78234bc555c8adead and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
r4 = b63649ab2c18a681ed2245a59107803276531f99 (refs/remotes/git-svn)
A    svn_project/subdir
A    svn_project/subdir/subdir2
A    svn_project/subdir/subdir2/foo_subdir2
A    svn_project/subdir/foo_subdir
A    svn_project/foo
Checked out revision 3.
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/b_one/New1, 10
First, rewinding head to replay your work on top of it...
Fast-forwarded master to refs/remotes/git-svn.
ok 4 - add multiple props

expecting success: 
	set_props "." "$foo_subdir2" svn:keywords "FreeBSD=%H" &&
	git svn dcommit &&
	svn_cmd co "$svnrepo" svn_project &&
	confirm_props "." "$foo_subdir2" "svn:keywords" "FreeBSD=%H" &&
	rm -rf svn_project
	
Found branch parent: (refs/remotes/origin/New1) 4993f5f39929967293062a4e1be4111bd5d0af1f
ok 9 - update git svn-cloned repo (config include)

expecting success: 
	(
		cd c &&
		git svn rebase --include-paths="qqq" &&
		printf "test_qqq\nb\n" > expect &&
		for i in */*.txt; do cat $i >> expect2; done &&
		test_cmp expect2 expect &&
		rm expect expect2
	)

Following parent with do_switch
Successfully followed parent
r21 = 02b5165d46e707cdd7b11d0cc178c623486b248b (refs/remotes/origin/New1)
Updating '.':
A    b_one/New1
A    b_one/New1/a.file
Updated to revision 21.
creating empty directory: a
creating empty directory: b
creating empty directory: c
creating empty directory: d
creating empty directory: d/e
creating empty directory: d/e/f
creating empty directory: weird file name
[master de9b5ff] testing propset
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Copying file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/trunk at r10 to file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/b_two/New2...
r4 = b63649ab2c18a681ed2245a59107803276531f99 (refs/remotes/git-svn)
First, rewinding head to replay your work on top of it...
creating empty directory: ! !
Fast-forwarded master to refs/remotes/git-svn.
ok 8 - git svn mkdirs -r works

expecting success: 
	for i in trunk trunk/a trunk/"weird file name"
	do
		svn_cmd mkdir -m "mkdir $i" "$svnrepo"/"$i"
	done

ok 10 - update git svn-cloned repo (option include)

expecting success: 
	(
		cd s &&
		echo cvf >> www/test_www.txt
		echo ygg >> qqq/test_qqq.txt
		svn_cmd commit -m "SVN-side change in and out of ignored www" &&
		svn_cmd up &&
		svn_cmd log -v | fgrep "SVN-side change in and out of ignored www"
	)

Committing transaction...
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/b_two/New2, 10
Sending        qqq/test_qqq.txt
Sending        www/test_www.txt
Transmitting file data ..done
Committing transaction...
Found branch parent: (refs/remotes/origin/New2) 4993f5f39929967293062a4e1be4111bd5d0af1f
Following parent with do_switch
Successfully followed parent
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9148-git-svn-propset/svnrepo ...
Committed revision 9.
r22 = 65dd5fb586b463581212f0247c8e404c09e4a435 (refs/remotes/origin/New2)
Committed revision 5.
Updating '.':
At revision 5.
Updating '.':
SVN-side change in and out of ignored www
ok 11 - SVN-side change in and out of included qqq

expecting success: 
	(
		cd g &&
		git svn rebase &&
		printf "test_qqq\nb\nygg\n" > expect &&
		for i in */*.txt; do cat $i >> expect2; done &&
		test_cmp expect2 expect &&
		rm expect expect2
	)

A    b_two/New2
A    b_two/New2/a.file
Committing transaction...
Updated to revision 22.
	M	subdir/subdir2/foo_subdir2
Committed revision 10.
Committed r4
Committing transaction...
	M	subdir/subdir2/foo_subdir2
r4 = b413e0459bcfdbd58cca7a7c5181708380dc14a7 (refs/remotes/git-svn)
No changes between de9b5ff11107ea033e24b1607e747807ff2de887 and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
Committed revision 11.
ok 9 - initialize trunk

expecting success: git svn clone -s "$svnrepo" trunk
A    svn_project/subdir
A    svn_project/subdir/subdir2
A    svn_project/subdir/subdir2/foo_subdir2
A    svn_project/subdir/foo_subdir
A    svn_project/foo
Checked out revision 4.
ok 5 - add props subdir

expecting success: 
	set_props "subdir/subdir2" "../foo_subdir" \
		svn:keywords "FreeBSD=%H" &&
	git svn dcommit &&
	svn_cmd co "$svnrepo" svn_project &&
	confirm_props "subdir/subdir2" "../foo_subdir" \
		svn:keywords "FreeBSD=%H" &&
	rm -rf svn_project
	
Copying file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/trunk at r10 to file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/tags_A/Tag1...
	M	qqq/test_qqq.txt
r5 = d2ac42acd0ad2e9694a12e3b01d4c47cb5c9aad0 (refs/remotes/git-svn)
First, rewinding head to replay your work on top of it...
Fast-forwarded master to refs/remotes/git-svn.
ok 12 - update git svn-cloned repo again (config include)

expecting success: 
	(
		cd c &&
		git svn rebase --include-paths="qqq" &&
		printf "test_qqq\nb\nygg\n" > expect &&
		for i in */*.txt; do cat $i >> expect2; done &&
		test_cmp expect2 expect &&
		rm expect expect2
	)

Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/tags_A/Tag1, 10
Found branch parent: (refs/remotes/origin/tags/Tag1) 4993f5f39929967293062a4e1be4111bd5d0af1f
Following parent with do_switch
Successfully followed parent
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9146-git-svn-empty-dirs/trunk/.git/
r23 = 3e1aef21ff3122bd82031e14b0888b1bf79b5577 (refs/remotes/origin/tags/Tag1)
[master d05b4af] testing propset
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Updating '.':
A    tags_A/Tag1
A    tags_A/Tag1/a.file
Updated to revision 23.
r9 = 920001706eb1019aa125867a6247a6cbf53a3e57 (refs/remotes/origin/trunk)
W: +empty_dir: trunk/a
r10 = 6b2b2d9766c8cc6843264ae0c760ab40c50b4173 (refs/remotes/origin/trunk)
W: +empty_dir: trunk/weird file name
r11 = b865fc5124dbd324e7babef3fab20d9711557096 (refs/remotes/origin/trunk)
	M	qqq/test_qqq.txt
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9146-git-svn-empty-dirs/svnrepo/trunk r11
creating empty directory: a
creating empty directory: weird file name
r5 = d2ac42acd0ad2e9694a12e3b01d4c47cb5c9aad0 (refs/remotes/git-svn)
ok 10 - clone trunk

expecting success: 
	(
		cd trunk &&
		for i in a "weird file name"
		do
			if ! test -d "$i"
			then
				echo >&2 "$i does not exist"
				exit 1
			fi
		done
	)

ok 11 - empty directories in trunk exist

expecting success: 
	svn_cmd rm -m "remove d" "$svnrepo"/d

First, rewinding head to replay your work on top of it...
Fast-forwarded master to refs/remotes/git-svn.
Committing transaction...
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9148-git-svn-propset/svnrepo ...
ok 13 - update git svn-cloned repo again (option include)

# passed all 13 test(s)
1..13
*** t9150-svk-mergetickets.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9150-svk-mergetickets/.git/
Committed revision 12.
ok 12 - remove a top-level directory from svn

expecting success: 
	git svn clone "$svnrepo" removed &&
	test ! -e removed/d


Copying file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/trunk at r10 to file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/tags_B/Tag2...
	M	subdir/foo_subdir
Committed r5
expecting success: 
	svnadmin load -q '/«PKGBUILDDIR»/t/trash directory.t9150-svk-mergetickets/svnrepo' 	  < '/«PKGBUILDDIR»/t/t9150/svk-merge.dump' &&
	git svn init --minimize-url -R svkmerge 	  --rewrite-root=http://svn.example.org 	  -T trunk -b branches 'file:///«PKGBUILDDIR»/t/trash directory.t9150-svk-mergetickets/svnrepo' &&
	git svn fetch --all
	
	M	subdir/foo_subdir
r5 = bf12edd839d0b44f006b8c2279b632eb8178973d (refs/remotes/git-svn)
No changes between d05b4af69ca6243c4f0a272c4e66bf654cd8b15c and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
A    svn_project/subdir
A    svn_project/subdir/subdir2
A    svn_project/subdir/subdir2/foo_subdir2
A    svn_project/subdir/foo_subdir
A    svn_project/foo
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9141-git-svn-multiple-branches/svnrepo/project/tags_B/Tag2, 10
Checked out revision 5.
ok 6 - add props relative

# passed all 6 test(s)
1..6
Found branch parent: (refs/remotes/origin/tags/Tag2) 4993f5f39929967293062a4e1be4111bd5d0af1f
*** t9151-svn-mergeinfo.sh ***
Following parent with do_switch
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9151-svn-mergeinfo/.git/
Successfully followed parent
r24 = dedbbf4efcc063fe2f818689d909b730d473f552 (refs/remotes/origin/tags/Tag2)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9146-git-svn-empty-dirs/removed/.git/
Updating '.':
A    tags_B/Tag2
A    tags_B/Tag2/a.file
Updated to revision 24.
ok 4 - create new branches and tags

# passed all 4 test(s)
1..4
*** t9152-svn-empty-dirs-after-gc.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9152-svn-empty-dirs-after-gc/.git/
W: +empty_dir: a
r1 = 03e2038c8de87412a92a391d3426b67ab7dd92b5 (refs/remotes/git-svn)
W: +empty_dir: b
expecting success: 
	svnadmin load -q '/«PKGBUILDDIR»/t/trash directory.t9151-svn-mergeinfo/svnrepo' 	  < '/«PKGBUILDDIR»/t/t9151/svn-mergeinfo.dump' &&
	git svn init --minimize-url -R svnmerge 	  --rewrite-root=http://svn.example.org 	  -T trunk -b branches 'file:///«PKGBUILDDIR»/t/trash directory.t9151-svn-mergeinfo/svnrepo' &&
	git svn fetch --all
	
r2 = e9039aad9258f4af3a6e84a9d40ad4e587cf5e9b (refs/remotes/git-svn)
W: +empty_dir: c
r3 = 50a8e50c2999ee238f47cb2fe4c09e9c3f6fbda8 (refs/remotes/git-svn)
W: +empty_dir: d
r4 = 01a64551cee67b212fc553941bc96bb180db09e3 (refs/remotes/git-svn)
W: +empty_dir: d/e
r5 = ba478ec6b575003ccac43048766cc172c7cb04f4 (refs/remotes/git-svn)
W: +empty_dir: d/e/f
expecting success: 
	for i in a b c d d/e d/e/f "weird file name"
	do
		svn_cmd mkdir -m "mkdir $i" "$svnrepo"/"$i"
	done

r6 = e8b3e7cab2ec7cf3db7d383d097190367f0d171d (refs/remotes/git-svn)
W: +empty_dir: weird file name
r7 = db5a04befeb8f2d32c10a7a1243a2599a8478755 (refs/remotes/git-svn)
W: +empty_dir: ! !
Committing transaction...
r8 = c6ba0004140662b84bfdfe88cf829dfc3055ecf2 (refs/remotes/git-svn)
W: +empty_dir: trunk
r9 = d4c97a249a95672e527ca6796519938423052408 (refs/remotes/git-svn)
W: +empty_dir: trunk/a
r10 = 4747860b69c948f1c978fc3921fa777930df39ea (refs/remotes/git-svn)
W: +empty_dir: trunk/weird file name
r11 = 3682029adff838881a8f67698978c89ad9de14d1 (refs/remotes/git-svn)
	D	d
W: -empty_dir: d
r12 = 1c89c8ae9c19a515edae51a3a65b04d5a91789a7 (refs/remotes/git-svn)
Committed revision 1.
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9146-git-svn-empty-dirs/svnrepo r12
creating empty directory: ! !
creating empty directory: a
creating empty directory: b
creating empty directory: c
creating empty directory: trunk
creating empty directory: trunk/a
creating empty directory: trunk/weird file name
creating empty directory: weird file name
ok 13 - removed top-level directory does not exist

expecting success: 
	(
		cd removed &&
		git svn gc &&
		: Compress::Zlib may not be available &&
		if test -f "$unhandled".gz
		then
			svn_cmd mkdir -m gz "$svnrepo"/gz &&
			git reset --hard $(git rev-list HEAD | tail -1) &&
			git svn rebase &&
			test -f "$unhandled".gz &&
			test -f "$unhandled" &&
			for i in a b c "weird file name" gz "! !"
			do
				if ! test -d "$i"
				then
					echo >&2 "$i does not exist"
					exit 1
				fi
			done
		fi
	)

Committing transaction...
Committed revision 2.
Committing transaction...
Committing transaction...
Committed revision 3.
Committed revision 13.
HEAD is now at 03e2038 mkdir a
Committing transaction...
Committed revision 4.
Committing transaction...
r1 = b53c4e1a175ef8929e6e4aab56280e58a0de64a8 (refs/remotes/origin/trunk)
	A	Makefile
r2 = 90f5e8071f5b77e35b17e90dec357e5c88edec7f (refs/remotes/origin/trunk)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9150-svk-mergetickets/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9150-svk-mergetickets/svnrepo/branches/left, 2
Committed revision 5.
Found branch parent: (refs/remotes/origin/left) 90f5e8071f5b77e35b17e90dec357e5c88edec7f
Following parent with do_switch
Successfully followed parent
r3 = 79d9656e5bf2f11fc8ec4e9a20e1cea4615a760a (refs/remotes/origin/left)
W: +empty_dir: gz
Committing transaction...
r13 = 73706b94015f4410d486bb7092a6253276fb6c12 (refs/remotes/git-svn)
	M	Makefile
r4 = 86c978a5a9e208309128c39af65ada54e20c81ab (refs/remotes/origin/left)
First, rewinding head to replay your work on top of it...
Fast-forwarded master to refs/remotes/git-svn.
	M	Makefile
r5 = 242969651859ed31ccc35c99fab280c17353acd2 (refs/remotes/origin/trunk)
	M	Makefile
r6 = 9682859fd9aa34c6573af588d38b75aaaeaa1918 (refs/remotes/origin/left)
creating empty directory: gz
ok 14 - git svn gc-ed files work

# passed all 14 test(s)
1..14
	M	Makefile
*** t9153-git-svn-rewrite-uuid.sh ***
Committed revision 6.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9153-git-svn-rewrite-uuid/.git/
Found merge parent (svk:merge ticket): 9682859fd9aa34c6573af588d38b75aaaeaa1918
r7 = 8f305e8c49bb2f343a16bd4f0bd3386700698bf5 (refs/remotes/origin/trunk)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9150-svk-mergetickets/svnrepo/trunk r7
ok 1 - load svk depot

expecting success: 
	[ 2 -eq 2 ]
	
ok 2 - svk merges were represented coming in

# passed all 2 test(s)
1..2
*** t9154-git-svn-fancy-glob.sh ***
Committing transaction...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9154-git-svn-fancy-glob/.git/
Committed revision 7.
ok 1 - initialize repo

expecting success: git svn clone "$svnrepo" cloned
expecting success: 
	svnadmin load -q '/«PKGBUILDDIR»/t/trash directory.t9153-git-svn-rewrite-uuid/svnrepo' < '/«PKGBUILDDIR»/t/t9153/svn.dump' &&
	git svn init --minimize-url --rewrite-uuid='6cc8ada4-5932-4b4a-8242-3534ed8a3232' 'file:///«PKGBUILDDIR»/t/trash directory.t9153-git-svn-rewrite-uuid/svnrepo' &&
	git svn fetch
	
expecting success: 
	svnadmin load -q '/«PKGBUILDDIR»/t/trash directory.t9154-git-svn-fancy-glob/svnrepo' < '/«PKGBUILDDIR»/t/t9154/svn.dump' &&
	git svn init --minimize-url -T trunk 'file:///«PKGBUILDDIR»/t/trash directory.t9154-git-svn-fancy-glob/svnrepo' &&
	git svn fetch
	
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9152-svn-empty-dirs-after-gc/cloned/.git/
W: +empty_dir: a
r1 = 144f1c3d6ac95aa564aface5aac2883844a7ddd3 (refs/remotes/git-svn)
W: +empty_dir: b
r2 = 4d7aa8ea7c1e7772b0bf2af4fceb03a1d6260ad9 (refs/remotes/git-svn)
W: +empty_dir: c
r3 = 7c5ee3a156ba85ec9fa34a8c426f7d9d719cdb36 (refs/remotes/git-svn)
W: +empty_dir: d
r4 = b87c3eb8156cb63f2f696cfca90d9e07c52d3df2 (refs/remotes/git-svn)
W: +empty_dir: d/e
r5 = 997fc49a543b519946a9ca5cc4ec9d0c00ab7158 (refs/remotes/git-svn)
W: +empty_dir: d/e/f
r6 = 894d7afeb08496b3d7cfcda5f0fc513d2a90a9d4 (refs/remotes/git-svn)
W: +empty_dir: weird file name
r7 = d0f6fdc6e182b558d26e8404b6eee8c62cbc031f (refs/remotes/git-svn)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9152-svn-empty-dirs-after-gc/svnrepo r7
creating empty directory: a
creating empty directory: b
creating empty directory: c
creating empty directory: d
creating empty directory: d/e
creating empty directory: d/e/f
creating empty directory: weird file name
ok 2 - clone

expecting success: 
	(
		cd cloned &&
		git svn gc
	)

ok 3 - git svn gc runs

expecting success: 
	(
		cd cloned &&
		rm -r * &&
		git svn mkdirs &&
		for i in a b c d d/e d/e/f "weird file name"
		do
			if ! test -d "$i"
			then
				echo >&2 "$i does not exist"
				exit 1
			fi
		done
	)

	A	foo
r1 = 112fdaefc58662cca2f9a95160ffc4d65d22624f (refs/remotes/git-svn)
	M	foo
r2 = 0dc41d76847346ad2590bc16220ec0036b9d40a9 (refs/remotes/git-svn)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9153-git-svn-rewrite-uuid/svnrepo r2
ok 1 - load svn repo

expecting success: 
	git cat-file commit refs/remotes/git-svn~0 | 	   grep '^git-svn-id: .*@2 6cc8ada4-5932-4b4a-8242-3534ed8a3232$' &&
	git cat-file commit refs/remotes/git-svn~1 | 	   grep '^git-svn-id: .*@1 6cc8ada4-5932-4b4a-8242-3534ed8a3232$'
	
git-svn-id: file:///«PKGBUILDDIR»/t/trash%20directory.t9153-git-svn-rewrite-uuid/svnrepo@2 6cc8ada4-5932-4b4a-8242-3534ed8a3232
git-svn-id: file:///«PKGBUILDDIR»/t/trash%20directory.t9153-git-svn-rewrite-uuid/svnrepo@1 6cc8ada4-5932-4b4a-8242-3534ed8a3232
ok 2 - verify uuid

# passed all 2 test(s)
1..2
*** t9155-git-svn-fetch-deleted-tag.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9155-git-svn-fetch-deleted-tag/.git/
creating empty directory: a
creating empty directory: b
creating empty directory: c
creating empty directory: d
creating empty directory: d/e
creating empty directory: d/e/f
creating empty directory: weird file name
ok 4 - git svn mkdirs recreates empty directories after git svn gc

# passed all 4 test(s)
1..4
*** t9156-git-svn-fetch-deleted-tag-2.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9156-git-svn-fetch-deleted-tag-2/.git/
expecting success: 
	mkdir -p import/trunk/subdir &&
	mkdir -p import/branches &&
	mkdir -p import/tags &&
	echo "base" >import/trunk/subdir/file &&
	svn_cmd import -m "import for git svn" import "$svnrepo" &&
	rm -rf import &&

	svn_cmd mkdir -m "create mybranch directory" "$svnrepo/branches/mybranch" &&
	svn_cmd cp -m "create branch mybranch" "$svnrepo/trunk" "$svnrepo/branches/mybranch/trunk" &&

	svn_cmd co "$svnrepo/trunk" svn_project &&
	(cd svn_project &&
		echo "trunk change" >>subdir/file &&
		svn_cmd ci -m "trunk change" subdir/file &&

		svn_cmd switch "$svnrepo/branches/mybranch/trunk" &&
		echo "branch change" >>subdir/file &&
		svn_cmd ci -m "branch change" subdir/file
	) &&

	svn_cmd cp -m "create mytag attempt 1" -r5 "$svnrepo/trunk/subdir" "$svnrepo/tags/mytag" &&
	svn_cmd rm -m "delete mytag attempt 1" "$svnrepo/tags/mytag" &&
	svn_cmd cp -m "create mytag attempt 2" -r5 "$svnrepo/branches/mybranch/trunk/subdir" "$svnrepo/tags/mytag"

Adding         import/branches
Adding         import/tags
Adding         import/trunk
Adding         import/trunk/subdir
Adding         import/trunk/subdir/file
Committing transaction...
expecting success: 
	mkdir -p import/branches &&
	mkdir -p import/tags &&
	mkdir -p import/trunk/subdir1 &&
	mkdir -p import/trunk/subdir2 &&
	mkdir -p import/trunk/subdir3 &&
	echo "file1" >import/trunk/subdir1/file &&
	echo "file2" >import/trunk/subdir2/file &&
	echo "file3" >import/trunk/subdir3/file &&
	svn_cmd import -m "import for git svn" import "$svnrepo" &&
	rm -rf import &&

	svn_cmd co "$svnrepo/trunk" svn_project &&
	(cd svn_project &&
		echo "change1" >>subdir1/file &&
		echo "change2" >>subdir2/file &&
		echo "change3" >>subdir3/file &&
		svn_cmd ci -m "change" .
	) &&

	svn_cmd cp -m "create mytag 1" -r2 "$svnrepo/trunk/subdir1" "$svnrepo/tags/mytag" &&
	svn_cmd rm -m "delete mytag 1" "$svnrepo/tags/mytag" &&
	svn_cmd cp -m "create mytag 2" -r2 "$svnrepo/trunk/subdir2" "$svnrepo/tags/mytag" &&
	svn_cmd rm -m "delete mytag 2" "$svnrepo/tags/mytag" &&
	svn_cmd cp -m "create mytag 3" -r2 "$svnrepo/trunk/subdir3" "$svnrepo/tags/mytag"

Committed revision 1.
Adding         import/branches
Adding         import/tags
Adding         import/trunk
Adding         import/trunk/subdir1
Adding         import/trunk/subdir1/file
Adding         import/trunk/subdir2
Adding         import/trunk/subdir2/file
Adding         import/trunk/subdir3
Adding         import/trunk/subdir3/file
Committing transaction...
	A	foo
r1 = 5557edb0c03577a8fb492035de183158037b5c15 (refs/remotes/origin/trunk)
Committing transaction...
	M	foo
r6 = 0c562c708dd1b1c75d0fa929e4d4fc1c97c00e81 (refs/remotes/origin/trunk)
Committed revision 1.
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9154-git-svn-fancy-glob/svnrepo/trunk r6
ok 1 - load svn repo

expecting success: 
	git config svn-remote.svn.branches 'branches/{red}:refs/remotes/*' &&
	git svn fetch &&
	git rev-parse refs/remotes/red &&
	test_must_fail git rev-parse refs/remotes/green &&
	test_must_fail git rev-parse refs/remotes/blue
	
A    svn_project/subdir1
A    svn_project/subdir1/file
A    svn_project/subdir2
A    svn_project/subdir2/file
A    svn_project/subdir3
A    svn_project/subdir3/file
Checked out revision 1.
Committed revision 2.
Sending        subdir1/file
Sending        subdir2/file
Sending        subdir3/file
Transmitting file data ...done
Committing transaction...
Committing transaction...
Committed revision 2.
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9154-git-svn-fancy-glob/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9154-git-svn-fancy-glob/svnrepo/branches/red, 1
Committed revision 3.
Found branch parent: (refs/remotes/red) 5557edb0c03577a8fb492035de183158037b5c15
Following parent with do_switch
A    svn_project/subdir
A    svn_project/subdir/file
Checked out revision 3.
Successfully followed parent
r2 = cb24ee770df48e8d8a2e141d1a3fdd4d105fccad (refs/remotes/red)
Committing transaction...
	M	foo
Sending        subdir/file
Transmitting file data .done
Committing transaction...
r3 = 9d05a20ba3c57327406f9d66b8739e8d0b8cd24e (refs/remotes/red)
9d05a20ba3c57327406f9d66b8739e8d0b8cd24e
fatal: ambiguous argument 'refs/remotes/green': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
refs/remotes/green
fatal: ambiguous argument 'refs/remotes/blue': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
refs/remotes/blue
ok 2 - add red branch

expecting success: 
	git config --file=.git/svn/.metadata --unset svn-remote.svn.branches-maxRev &&
	git config svn-remote.svn.branches 'branches/{red,gre}:refs/remotes/*' &&
	git svn fetch &&
	git rev-parse refs/remotes/red &&
	test_must_fail git rev-parse refs/remotes/green &&
	test_must_fail git rev-parse refs/remotes/blue
	
Committed revision 3.
Committed revision 4.
U    subdir/file
Updated to revision 4.
Committing transaction...
Sending        subdir/file
Transmitting file data .done
Committing transaction...
Committed revision 4.
Committing transaction...
9d05a20ba3c57327406f9d66b8739e8d0b8cd24e
fatal: ambiguous argument 'refs/remotes/green': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
refs/remotes/green
fatal: ambiguous argument 'refs/remotes/blue': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
refs/remotes/blue
ok 3 - add gre branch

expecting success: 
	git config --file=.git/svn/.metadata --unset svn-remote.svn.branches-maxRev &&
	git config svn-remote.svn.branches 'branches/{red,green}:refs/remotes/*' &&
	git svn fetch &&
	git rev-parse refs/remotes/red &&
	git rev-parse refs/remotes/green &&
	test_must_fail git rev-parse refs/remotes/blue
	
Committed revision 5.
Committing transaction...
Committed revision 5.
Committing transaction...
Committed revision 6.
Committing transaction...
Committed revision 6.
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9154-git-svn-fancy-glob/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9154-git-svn-fancy-glob/svnrepo/branches/green, 1
Found branch parent: (refs/remotes/green) 5557edb0c03577a8fb492035de183158037b5c15
Following parent with do_switch
Successfully followed parent
r2 = 0c1fc53cbcffbc0bc16344ed78701e0127f802cd (refs/remotes/green)
Committing transaction...
Committed revision 7.
	M	foo
r4 = c7b593737fed1dea5d1ee111b8c888082449a721 (refs/remotes/green)
9d05a20ba3c57327406f9d66b8739e8d0b8cd24e
c7b593737fed1dea5d1ee111b8c888082449a721
fatal: ambiguous argument 'refs/remotes/blue': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
refs/remotes/blue
ok 4 - add green branch

expecting success: 
	git config --file=.git/svn/.metadata --unset svn-remote.svn.branches-maxRev &&
	git config svn-remote.svn.branches 'branches/*:refs/remotes/*' &&
	git svn fetch &&
	git rev-parse refs/remotes/red &&
	git rev-parse refs/remotes/green &&
	git rev-parse refs/remotes/blue
	
Committed revision 7.
ok 1 - setup svn repo

expecting success: 
	git svn init --stdlayout "$svnrepo" git_project &&
	cd git_project &&
	git svn fetch &&

	git diff --exit-code master:subdir3/file origin/tags/mytag:file &&
	git diff --exit-code master:subdir2/file origin/tags/mytag^:file &&
	git diff --exit-code master:subdir1/file origin/tags/mytag^^:file

Committing transaction...
Committed revision 8.
ok 1 - setup svn repo

expecting success: 
	git svn init --stdlayout "$svnrepo" git_project &&
	cd git_project &&
	git svn fetch &&

	git diff --exit-code origin/mybranch:trunk/subdir/file origin/tags/mytag:file &&
	git diff --exit-code master:subdir/file origin/tags/mytag^:file

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9156-git-svn-fetch-deleted-tag-2/git_project/.git/
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9154-git-svn-fancy-glob/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9154-git-svn-fancy-glob/svnrepo/branches/blue, 1
Found branch parent: (refs/remotes/blue) 5557edb0c03577a8fb492035de183158037b5c15
Following parent with do_switch
Successfully followed parent
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9155-git-svn-fetch-deleted-tag/git_project/.git/
r2 = 43b83a6b200332208fca92b55cea21132a6dd674 (refs/remotes/blue)
	M	foo
r5 = 40d5da220f424a5060cacbb7bd146ff7211625e4 (refs/remotes/blue)
9d05a20ba3c57327406f9d66b8739e8d0b8cd24e
c7b593737fed1dea5d1ee111b8c888082449a721
40d5da220f424a5060cacbb7bd146ff7211625e4
ok 5 - add all branches

# passed all 5 test(s)
1..5
*** t9157-git-svn-fetch-merge.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9157-git-svn-fetch-merge/.git/
	A	subdir1/file
	A	subdir2/file
	A	subdir3/file
expecting success: 
	svn_cmd mkdir -m x "$svnrepo"/trunk &&
	svn_cmd mkdir -m x "$svnrepo"/branches &&
	svn_cmd co "$svnrepo"/trunk "$SVN_TREE" &&
	(
		cd "$SVN_TREE" &&
		touch foo &&
		svn add foo &&
		svn commit -m "initial commit" &&
		svn cp -m branch "$svnrepo"/trunk "$svnrepo"/branches/branch1 &&
		touch bar &&
		svn add bar &&
		svn commit -m x &&
		svn cp -m branch "$svnrepo"/trunk "$svnrepo"/branches/branch2 &&
		svn switch "$svnrepo"/branches/branch1 &&
		touch baz &&
		svn add baz &&
		svn commit -m x &&
		svn switch "$svnrepo"/trunk &&
		svn merge "$svnrepo"/branches/branch1 &&
		svn commit -m "merge" &&
		svn switch "$svnrepo"/branches/branch1 &&
		svn commit -m x &&
		svn switch "$svnrepo"/branches/branch2 &&
		svn merge "$svnrepo"/branches/branch1 &&
		svn commit -m "merge branch1" &&
		svn switch "$svnrepo"/trunk &&
		svn merge "$svnrepo"/branches/branch2 &&
		svn resolved baz &&
		svn commit -m "merge branch2"
	) &&
	rm -rf "$SVN_TREE"

r1 = d76f4f705a50b2f9b8aee9f3b848695fa5c320ec (refs/remotes/origin/trunk)
	M	subdir1/file
	M	subdir2/file
	M	subdir3/file
Committing transaction...
r2 = ad20bdac439648e4355d0fa5b9701fbca15325e7 (refs/remotes/origin/trunk)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9156-git-svn-fetch-deleted-tag-2/svnrepo/trunk/subdir1 => file:///«PKGBUILDDIR»/t/trash%20directory.t9156-git-svn-fetch-deleted-tag-2/svnrepo/tags/mytag, 2
Initializing parent: refs/remotes/origin/tags/mytag@2
	A	subdir/file
r1 = 9ff3bf1db05411ccd2a6ed33022d308fdad55724 (refs/remotes/origin/trunk)
	A	file
Committed revision 1.
r1 = c7e5739fbe77bc1ad7155c9a5df2ae8f82d813f9 (refs/remotes/origin/tags/mytag@2)
	M	file
Committing transaction...
r2 = 0d26a796a748f9a22b6c1c26903ba19f7fa37d5c (refs/remotes/origin/mybranch)
r2 = 579fc3079e672da234eaca2b615392a9875640c8 (refs/remotes/origin/tags/mytag@2)
Found branch parent: (refs/remotes/origin/tags/mytag) 579fc3079e672da234eaca2b615392a9875640c8
Following parent with do_switch
	A	trunk/subdir/file
Successfully followed parent
r3 = 9f40bd8d9ee2814803e3b1bfc9d5fd9224ced38a (refs/remotes/origin/mybranch)
Committed revision 2.
r3 = 991799315f807682a1e9b29b575635d06e11601c (refs/remotes/origin/tags/mytag)
Checked out revision 2.
	M	subdir/file
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9156-git-svn-fetch-deleted-tag-2/svnrepo/trunk/subdir2 => file:///«PKGBUILDDIR»/t/trash%20directory.t9156-git-svn-fetch-deleted-tag-2/svnrepo/tags/mytag, 2
A         foo
r4 = 0936445ef757a7011fd7fbba49c33a8429f5854b (refs/remotes/origin/trunk)
	M	trunk/subdir/file
Initializing parent: refs/remotes/origin/tags/mytag@2-
r5 = 3ac2ce3d82f9247612e10efccffc3cce60e6c693 (refs/remotes/origin/mybranch)
Adding         foo
Transmitting file data .done
Committing transaction...
	A	file
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9155-git-svn-fetch-deleted-tag/svnrepo/trunk/subdir => file:///«PKGBUILDDIR»/t/trash%20directory.t9155-git-svn-fetch-deleted-tag/svnrepo/tags/mytag, 5
r1 = 1fee8156d1311755f299d31decf35090e959bf0e (refs/remotes/origin/tags/mytag@2-)
Initializing parent: refs/remotes/origin/tags/mytag@5
Committed revision 3.
	M	file
r2 = 9981aeca55626ed86eb6de772ab03c282854b9c5 (refs/remotes/origin/tags/mytag@2-)
	A	file
Found branch parent: (refs/remotes/origin/tags/mytag) 9981aeca55626ed86eb6de772ab03c282854b9c5
Index mismatch: 03a4eca29b077f8b0867e84854a2c6e71eeac380 != 7745dab6988f4d78b3241eec1b66b56c15e67e83
rereading 9981aeca55626ed86eb6de772ab03c282854b9c5
Following parent with do_switch
Committing transaction...
r1 = 41124c887c59b6e2dfc0a79cb224665fd08d0796 (refs/remotes/origin/tags/mytag@5)
Successfully followed parent
r5 = a976b743121afbab161e893592ac127d24a53212 (refs/remotes/origin/tags/mytag)
	M	file
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9156-git-svn-fetch-deleted-tag-2/svnrepo/trunk/subdir3 => file:///«PKGBUILDDIR»/t/trash%20directory.t9156-git-svn-fetch-deleted-tag-2/svnrepo/tags/mytag, 2
r4 = f267caaadd22b240a546985a524e19352f2ee9e2 (refs/remotes/origin/tags/mytag@5)
Found branch parent: (refs/remotes/origin/tags/mytag) f267caaadd22b240a546985a524e19352f2ee9e2
Committed revision 4.
Following parent with do_switch
A         bar
Successfully followed parent
Initializing parent: refs/remotes/origin/tags/mytag@2--
r6 = 4710628bcf6f900168e256f33e3334d3cfdb9235 (refs/remotes/origin/tags/mytag)
Adding         bar
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9155-git-svn-fetch-deleted-tag/svnrepo/branches/mybranch/trunk/subdir => file:///«PKGBUILDDIR»/t/trash%20directory.t9155-git-svn-fetch-deleted-tag/svnrepo/tags/mytag, 5
Transmitting file data .done
Committing transaction...
	A	file
r1 = 0c971b8a9d24ba20343f85283696335b57b84380 (refs/remotes/origin/tags/mytag@2--)
Initializing parent: refs/remotes/origin/tags/mytag@5-
Committed revision 5.
branch_from: /trunk => /trunk/subdir
	M	file
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9155-git-svn-fetch-deleted-tag/svnrepo/trunk/subdir => file:///«PKGBUILDDIR»/t/trash%20directory.t9155-git-svn-fetch-deleted-tag/svnrepo/branches/mybranch/trunk/subdir, 2
r2 = 12a59475d572b696a94774db63c06f2d1e473716 (refs/remotes/origin/tags/mytag@2--)
Found branch parent: (refs/remotes/origin/tags/mytag) 12a59475d572b696a94774db63c06f2d1e473716
Index mismatch: de577018db9919b0130637aa9ac28b5dabe70913 != 03a4eca29b077f8b0867e84854a2c6e71eeac380
rereading 12a59475d572b696a94774db63c06f2d1e473716
Initializing parent: refs/remotes/origin/tags/mytag@2
Following parent with do_switch
Successfully followed parent
Committing transaction...
r7 = e3fa521de8e22a0dfe24fe55bfe2d146d580104f (refs/remotes/origin/tags/mytag)
	A	file
r1 = 41124c887c59b6e2dfc0a79cb224665fd08d0796 (refs/remotes/origin/tags/mytag@2)
Found branch parent: (refs/remotes/origin/tags/mytag@5-) 41124c887c59b6e2dfc0a79cb224665fd08d0796
Following parent with do_switch
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9156-git-svn-fetch-deleted-tag-2/svnrepo/trunk r2
Committed revision 6.
Successfully followed parent
ok 2 - fetch deleted tags from same revision with no checksum error

# passed all 2 test(s)
1..2
D    bar
Updated to revision 6.
r3 = f05879176f903462e080a771a1903f57a7c9608b (refs/remotes/origin/tags/mytag@5-)
*** t9158-git-svn-mergeinfo.sh ***
A         baz
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9158-git-svn-mergeinfo/.git/
	M	file
r5 = b27493517d14d14ed24ee3cb1234e9c9bc584065 (refs/remotes/origin/tags/mytag@5-)
Found branch parent: (refs/remotes/origin/tags/mytag) b27493517d14d14ed24ee3cb1234e9c9bc584065
Index mismatch: 13f9c6ca01f81b94d8eca8eba510eafa2445e890 != 343cf4718d6a013cf33cf3cea8e0dc0a8efa64dc
rereading b27493517d14d14ed24ee3cb1234e9c9bc584065
Adding         baz
Transmitting file data .done
Committing transaction...
Following parent with do_switch
Successfully followed parent
r8 = 5d14471b2a7bc3352f4658c6f2bcdec90c426ef8 (refs/remotes/origin/tags/mytag)
Committed revision 7.
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9155-git-svn-fetch-deleted-tag/svnrepo/trunk r4
D    baz
A    bar
Updated to revision 7.
ok 2 - fetch deleted tags from same revision with checksum error

# passed all 2 test(s)
1..2
*** t9159-git-svn-no-parent-mergeinfo.sh ***
--- Merging r4 through r7 into '.':
A    baz
--- Recording mergeinfo for merge of r4 through r7 into '.':
 U   .
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9159-git-svn-no-parent-mergeinfo/.git/
define NO_SVN_TESTS to skip git svn tests
expecting success: 
	svn_cmd mkdir -m x "$svnrepo"/trunk &&
	svn_cmd co "$svnrepo"/trunk "$SVN_TREE" &&
	(
		cd "$SVN_TREE" &&
		touch foo &&
		svn_cmd add foo &&
		svn_cmd commit -m "initial commit"
	) &&
	rm -rf "$SVN_TREE"

Sending        .
r1 = 7ed7a8721885457b4b334110ca70ed04c4f8166a (refs/remotes/origin/trunk)
Adding         baz
Committing transaction...
	A	Makefile
Committing transaction...
r2 = 2d5fcce57cec73616f628fbaed5a49ef3d0e42de (refs/remotes/origin/trunk)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9151-svn-mergeinfo/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9151-svn-mergeinfo/svnrepo/branches/left, 1
Found branch parent: (refs/remotes/origin/left) 7ed7a8721885457b4b334110ca70ed04c4f8166a
Following parent with do_switch
	A	Makefile
Successfully followed parent
r3 = f9ab6c8a604f40729e9b681bb3a1e867f9fa3ae8 (refs/remotes/origin/left)
Committed revision 8.
expecting success: 
	mkdir -p init/trunk init/branches init/tags &&
	echo "r1" > init/trunk/file.txt &&
	svn_cmd import -m "initial import" init "$svnrepo" &&
	svn_cmd co "$svnrepo" tmp &&
	(
		cd tmp &&
		echo "r2" > trunk/file.txt &&
		svn_cmd commit -m "Modify file.txt on trunk" &&
		svn_cmd cp trunk@1 branches/a &&
		svn_cmd commit -m "Create branch a from trunk r1" &&
		svn_cmd propset svn:mergeinfo /trunk:1-2 branches/a &&
		svn_cmd commit -m "Fake merge of trunk r2 into branch a" &&
		mkdir branches/b &&
		echo "r5" > branches/b/file2.txt &&
		svn_cmd add branches/b &&
		svn_cmd commit -m "Create branch b from thin air" &&
		echo "r6" > branches/b/file2.txt &&
		svn_cmd commit -m "Modify file2.txt on branch b" &&
		svn_cmd cp branches/b@5 branches/c &&
		svn_cmd commit -m "Create branch c from branch b r5" &&
		svn_cmd propset svn:mergeinfo /branches/b:5-6 branches/c &&
		svn_cmd commit -m "Fake merge of branch b r6 into branch c"
	) &&
	git svn init -s "$svnrepo" &&
	git svn fetch
	
Committed revision 1.
D    bar
 U   .
Updated to revision 8.
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9151-svn-mergeinfo/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9151-svn-mergeinfo/svnrepo/branches/right, 1
Checked out revision 1.
Found branch parent: (refs/remotes/origin/right) 7ed7a8721885457b4b334110ca70ed04c4f8166a
A         foo
Following parent with do_switch
D    baz
A    bar
Updated to revision 8.
Adding         init/branches
Adding         init/tags
Adding         init/trunk
Adding         init/trunk/file.txt
Committing transaction...
	A	Makefile
Successfully followed parent
--- Merging r4 through r8 into '.':
A    baz
--- Recording mergeinfo for merge of r4 through r8 into '.':
 U   .
r4 = ddaeba46f3443446ad10c8e9f9708015508a3b28 (refs/remotes/origin/right)
Sending        .
	M	Makefile
Adding         foo
Transmitting file data .done
Committing transaction...
r5 = aec3f7b969e8f39a07d95041e1a0fa1084a62636 (refs/remotes/origin/left)
Adding         baz
	M	Makefile
Committing transaction...
Committed revision 1.
r6 = 4e8f83f1ab23aef5373017e90af34f1819af8cab (refs/remotes/origin/right)
A    tmp/branches
A    tmp/tags
A    tmp/trunk
A    tmp/trunk/file.txt
Checked out revision 1.
	M	Makefile
Committed revision 2.
r7 = 6bc3353f7fcec0c37010a59b688fa9d2584a744d (refs/remotes/origin/left)
ok 1 - initialize source svn repo

expecting success: 
	git svn init "$svnrepo"/trunk &&
	git svn fetch

	M	Makefile
Committed revision 9.
r8 = 3126dfd1119e03e412157f726d08c90a3fd4d7d4 (refs/remotes/origin/left)
Sending        trunk/file.txt
Transmitting file data .done
Committing transaction...
 U   .
Updated to revision 9.
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9151-svn-mergeinfo/svnrepo/branches/left => file:///«PKGBUILDDIR»/t/trash%20directory.t9151-svn-mergeinfo/svnrepo/branches/left-sub, 3
--- Merging r6 through r9 into '.':
   C baz
 G   .
--- Recording mergeinfo for merge of r6 through r9 into '.':
 G   .
Summary of conflicts:
  Tree conflicts: 1
Found branch parent: (refs/remotes/origin/left-sub) f9ab6c8a604f40729e9b681bb3a1e867f9fa3ae8
Resolved conflicted state of 'baz'
Following parent with do_switch
Sending        .
	M	Makefile
Successfully followed parent
r9 = 577c6d95762177126ca3068518ff8b75fcf0c25e (refs/remotes/origin/left-sub)
	A	README
Committed revision 2.
r10 = 0f51792c59119f80d15583143eecc11a609f7f4b (refs/remotes/origin/left-sub)
Committing transaction...
Updating 'branches/a':
A    branches/a/file.txt
Updated to revision 1.
A         branches/a
	M	Makefile
Checking svn:mergeinfo changes since r2: 1 sources, 1 changed
Found merge parent (/branches/left:2-10): 3126dfd1119e03e412157f726d08c90a3fd4d7d4
r11 = 684711c1a28ba8ad47b8dbcc1fae523e6d7513a6 (refs/remotes/origin/trunk)
Committed revision 10.
ok 1 - initialize source svn repo

expecting success: 
	git svn init -s "$svnrepo" &&
	git svn fetch

Adding         branches/a
Committing transaction...
	A	zlonk
r12 = 48e21141201f46c911875b76b5656d8baac09a66 (refs/remotes/origin/left)
	A	bang
r13 = 2d65500a924079bcf2a63be861289fc72bc3e87f (refs/remotes/origin/right)
Committed revision 3.
	M	Makefile
property 'svn:mergeinfo' set on 'branches/a'
	A	bang
Checking svn:mergeinfo changes since r11: 2 sources, 1 changed
Sending        branches/a
W: svn cherry-pick ignored (/branches/right:6-13) - missing 1 commit(s) (eg ddaeba46f3443446ad10c8e9f9708015508a3b28)
Committing transaction...
r14 = 963722fb11bb2d08a6acd03123060441585c7d97 (refs/remotes/origin/trunk)
Checking svn:mergeinfo changes since r14: 2 sources, 1 changed
Committed revision 4.
Found merge parent (/branches/right:2-14): 2d65500a924079bcf2a63be861289fc72bc3e87f
A         branches/b
r15 = 7a0288891e49f8f764fafb9c51e0da446284f6e3 (refs/remotes/origin/trunk)
A         branches/b/file2.txt
	A	urkkk
r16 = acd76c6201c8a7f1ba7539daebe82128902deb28 (refs/remotes/origin/right)
Adding         branches/b
Adding         branches/b/file2.txt
Transmitting file data .done
Committing transaction...
	A	vronk
r17 = 3d987e350cb0b84c1a962f28322075148a4769f9 (refs/remotes/origin/trunk)
	M	Makefile
	A	bang
Committed revision 5.
	A	urkkk
Checking svn:mergeinfo changes since r10: 1 sources, 1 changed
Found merge parent (/branches/right:2-17): acd76c6201c8a7f1ba7539daebe82128902deb28
Sending        branches/b/file2.txt
Transmitting file data .done
Committing transaction...
r18 = 33a71c4853e3bc75096416afb6b6a3f84317e11f (refs/remotes/origin/left-sub)
r1 = e61dbc160c0c352f9bb0acf495d8a493c571db8a (refs/remotes/git-svn)
	A	wham_eth
r19 = c18b93e7676efb39156e30479f389f162e075937 (refs/remotes/origin/left-sub)
Committed revision 6.
	A	foo
r2 = 9bcd55e9a2d64fb252501f4c564c332780b31b70 (refs/remotes/git-svn)
	A	glurpp
Updating 'branches/c':
A    branches/c/file2.txt
Updated to revision 5.
A         branches/c
r20 = d3a5e11772cce14223736862eaae254c6361de52 (refs/remotes/origin/left)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9158-git-svn-mergeinfo/svnrepo/trunk r2
ok 2 - clone svn repo

expecting success: 
	touch bar &&
	git add bar &&
	git commit -m "bar" &&
	git svn dcommit --mergeinfo="/branches/foo:1-10"

[master 9b18fd8] bar
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 bar
	A	wham_eth
Checking svn:mergeinfo changes since r20: 1 sources, 1 changed
Adding         branches/c
Committing transaction...
W: svn cherry-pick ignored (/branches/left-sub:19) - missing 6 commit(s) (eg acd76c6201c8a7f1ba7539daebe82128902deb28)
Committed revision 7.
r21 = 26f066648b9fbb8d41953f51720855ea7b504643 (refs/remotes/origin/left)
property 'svn:mergeinfo' set on 'branches/c'
Sending        branches/c
	M	Makefile
	A	README
	A	bang
	A	urkkk
Checking svn:mergeinfo changes since r21: 2 sources, 2 changed
Committing transaction...
Found merge parent (/branches/left-sub:4-19): c18b93e7676efb39156e30479f389f162e075937
Found merge parent (/branches/right:2-17): acd76c6201c8a7f1ba7539daebe82128902deb28
r22 = 873f392f3b5b995738db38ddb497e4133a1eabd6 (refs/remotes/origin/left)
Committed revision 8.
	A	README
	A	glurpp
	A	urkkk
	A	wham_eth
	A	zlonk
Checking svn:mergeinfo changes since r17: 3 sources, 3 changed
r1 = 7eab227ee5c066a29b20a54eb4971eea55d84e1b (refs/remotes/origin/trunk)
Found merge parent (/branches/left:2-22): 873f392f3b5b995738db38ddb497e4133a1eabd6
	A	foo
Found merge parent (/branches/left-sub:4-19): c18b93e7676efb39156e30479f389f162e075937
r3 = 7223fdae95f2e1b95181c280eb46629de3e50ef8 (refs/remotes/origin/trunk)
Found merge parent (/branches/right:2-17): acd76c6201c8a7f1ba7539daebe82128902deb28
r23 = 10f41d438deef69896cd202a8dba696fccb1fc16 (refs/remotes/origin/trunk)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9157-git-svn-fetch-merge/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9157-git-svn-fetch-merge/svnrepo/branches/branch1, 3
Found branch parent: (refs/remotes/origin/branch1) 7223fdae95f2e1b95181c280eb46629de3e50ef8
Checking svn:mergeinfo changes since r23: 3 sources, 1 changed
Following parent with do_switch
Successfully followed parent
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9158-git-svn-mergeinfo/svnrepo/trunk ...
r24 = 8d72d496d3fd4fe5f56c4a458bb6b6bce8074ac3 (refs/remotes/origin/trunk)
r4 = 9dd793ed558161a92a3d0d9c3ad4b4143344c007 (refs/remotes/origin/branch1)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9151-svn-mergeinfo/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9151-svn-mergeinfo/svnrepo/branches/b1, 24
	A	bar
r5 = 827f146e3611c60bec67b0c5c5100e7b5569d7af (refs/remotes/origin/trunk)
Found branch parent: (refs/remotes/origin/b1) 8d72d496d3fd4fe5f56c4a458bb6b6bce8074ac3
Following parent with do_switch
Successfully followed parent
	A	bar
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9157-git-svn-fetch-merge/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9157-git-svn-fetch-merge/svnrepo/branches/branch2, 5
r25 = 9583bc1ca96e396c2e8a6afbe0d7677c952e76f9 (refs/remotes/origin/b1)
Found branch parent: (refs/remotes/origin/branch2) 827f146e3611c60bec67b0c5c5100e7b5569d7af
Following parent with do_switch
Successfully followed parent
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9151-svn-mergeinfo/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9151-svn-mergeinfo/svnrepo/branches/b2, 25
Committed r3
r6 = 7c7b47ed472900fce9581ff8f193143cca273dc9 (refs/remotes/origin/branch2)
Found branch parent: (refs/remotes/origin/b2) 8d72d496d3fd4fe5f56c4a458bb6b6bce8074ac3
Following parent with do_switch
	A	baz
	A	bar
Successfully followed parent
Checking svn:mergeinfo changes since r2: 1 sources, 1 changed
r7 = 5dbc816114a13ce9cca78625a6e47fb2897032eb (refs/remotes/origin/branch1)
Couldn't find revmap for file:///«PKGBUILDDIR»/t/trash%20directory.t9158-git-svn-mergeinfo/svnrepo/trunk/branches/foo
r26 = b956cd3ea8808cb0732e51412dec60ce5d4c66de (refs/remotes/origin/b2)
r3 = b695fe9c5091ab4c28c41ead31bf261c3d1e0db4 (refs/remotes/git-svn)
	A	baz
No changes between 9b18fd88c1687f93abf21d1bc52d72c954c92ca7 and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
Checking svn:mergeinfo changes since r5: 1 sources, 1 changed
	A	b2file
r27 = 689fa6c27d1d57acd4f5e2ed3b78bfd3818cfa48 (refs/remotes/origin/b2)
Found merge parent (/branches/branch1:4-7): 5dbc816114a13ce9cca78625a6e47fb2897032eb
	A	b1file
r8 = 6b764a41529d6730d49c4115c60a05b241250ed8 (refs/remotes/origin/trunk)
r28 = c65e9d2dd0f29cc8756c66041aafca5ae7b40c87 (refs/remotes/origin/b1)
	A	baz
Checking svn:mergeinfo changes since r6: 1 sources, 1 changed
ok 3 - change svn:mergeinfo

expecting success: 
	mergeinfo=$(svn_cmd propget svn:mergeinfo "$svnrepo"/trunk) &&
	test "$mergeinfo" = "/branches/foo:1-10"

	A	b1file
Checking svn:mergeinfo changes since r24: 4 sources, 1 changed
ok 4 - verify svn:mergeinfo

expecting success: 
	touch baz &&
	git add baz &&
	git commit -m "baz" &&
	git svn dcommit --mergeinfo="/branches/bar:1-10 /branches/other:3-5,8,10-11"

[master 8ae265d] baz
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 baz
Found merge parent (/branches/branch1:4-8): 5dbc816114a13ce9cca78625a6e47fb2897032eb
Found merge parent (/branches/b1:25-28): c65e9d2dd0f29cc8756c66041aafca5ae7b40c87
r9 = 59f9b81e3ecbf67d8f9d27e09d7a1678bc5400bb (refs/remotes/origin/branch2)
r29 = 8a70eced3c8b9eb56742bb2b8182d3363ef65c9c (refs/remotes/origin/trunk)
Checking svn:mergeinfo changes since r8: 2 sources, 2 changed
	A	trunkfile
r30 = 94dd10334175598f49a097035fcfba8563928048 (refs/remotes/origin/trunk)
Found merge parent (/branches/branch2:6-9): 59f9b81e3ecbf67d8f9d27e09d7a1678bc5400bb
	A	b1file
	A	trunkfile
r10 = 26c8cb2e80bf359a7e237daafeaee4dfe0a4e29d (refs/remotes/origin/trunk)
Checking svn:mergeinfo changes since r27: 5 sources, 2 changed
Found merge parent (/branches/b1:25-28): c65e9d2dd0f29cc8756c66041aafca5ae7b40c87
Found merge parent (/trunk:26-30): 94dd10334175598f49a097035fcfba8563928048
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9157-git-svn-fetch-merge/svnrepo/trunk r10
r31 = a38a7b8623e016fc7fa3d8e86138d2ac45bf8a24 (refs/remotes/origin/b2)
	A	b2file
Checking svn:mergeinfo changes since r30: 5 sources, 1 changed
ok 2 - clone svn repo

expecting success: git rev-parse HEAD^2
59f9b81e3ecbf67d8f9d27e09d7a1678bc5400bb
ok 3 - verify merge commit

# passed all 3 test(s)
1..3
Found merge parent (/branches/b2:26-31): a38a7b8623e016fc7fa3d8e86138d2ac45bf8a24
*** t9160-git-svn-preserve-empty-dirs.sh ***
r32 = 8357602aacc215884be1cae384e21f61dbe8a70f (refs/remotes/origin/trunk)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9160-git-svn-preserve-empty-dirs/.git/
	A	file.txt
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9151-svn-mergeinfo/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9151-svn-mergeinfo/svnrepo/branches/f1, 32
r1 = 061cd5d6a18ba04914c1eb5e181900f129dd0bd0 (refs/remotes/origin/trunk)
Found branch parent: (refs/remotes/origin/f1) 8357602aacc215884be1cae384e21f61dbe8a70f
Following parent with do_switch
	M	file.txt
	A	f1file
Successfully followed parent
r2 = 19c3e7946eeef806068ec02a0e41e669213ddd15 (refs/remotes/origin/trunk)
r33 = f78f3a5d1e3b322462cb535cfa72092188e5b55f (refs/remotes/origin/f1)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9159-git-svn-no-parent-mergeinfo/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9159-git-svn-no-parent-mergeinfo/svnrepo/branches/a, 1
Found branch parent: (refs/remotes/origin/a) 061cd5d6a18ba04914c1eb5e181900f129dd0bd0
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9151-svn-mergeinfo/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9151-svn-mergeinfo/svnrepo/branches/f2, 33
Following parent with do_switch
Found branch parent: (refs/remotes/origin/f2) 8357602aacc215884be1cae384e21f61dbe8a70f
Successfully followed parent
define NO_SVN_TESTS to skip git svn tests
expecting success: 
	svn_cmd mkdir -m x "$svnrepo"/trunk &&
	svn_cmd co "$svnrepo"/trunk "$SVN_TREE" &&
	(
		cd "$SVN_TREE" &&
		mkdir -p 1 2 3/a 3/b 4 5 6 &&
		echo "First non-empty file"  > 2/file1.txt &&
		echo "Second non-empty file" > 2/file2.txt &&
		echo "Third non-empty file"  > 3/a/file1.txt &&
		echo "Fourth non-empty file" > 3/b/file1.txt &&
		svn_cmd add 1 2 3 4 5 6 &&
		svn_cmd commit -m "initial commit" &&

		mkdir 4/a &&
		svn_cmd add 4/a &&
		svn_cmd commit -m "nested empty directory" &&
		mkdir 4/a/b &&
		svn_cmd add 4/a/b &&
		svn_cmd commit -m "deeply nested empty directory" &&
		mkdir 4/a/b/c &&
		svn_cmd add 4/a/b/c &&
		svn_cmd commit -m "really deeply nested empty directory" &&
		echo "Kill the placeholder file" > 4/a/b/c/foo &&
		svn_cmd add 4/a/b/c/foo &&
		svn_cmd commit -m "Regular file to remove placeholder" &&

		svn_cmd del 2/file2.txt &&
		svn_cmd del 3/b &&
		svn_cmd commit -m "delete non-last entry in directory" &&

		svn_cmd del 2/file1.txt &&
		svn_cmd del 3/a &&
		svn_cmd commit -m "delete last entry in directory" &&

		echo "Conflict file" > 5/.placeholder &&
		mkdir 6/.placeholder &&
		svn_cmd add 5/.placeholder 6/.placeholder &&
		svn_cmd commit -m "Placeholder Namespace conflict"
	) &&
	rm -rf "$SVN_TREE"

Following parent with do_switch
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9158-git-svn-mergeinfo/svnrepo/trunk ...
	A	f2file
Successfully followed parent
r3 = 9d9a740679c7745f48c9887d2d9f79917bde82ad (refs/remotes/origin/a)
r34 = 1f35cafcf36f5273f266e0fdf53b2b0e5cae9932 (refs/remotes/origin/f2)
Committing transaction...
Checking svn:mergeinfo changes since r3: 1 sources, 1 changed
	A	f1file
	A	f2file
Checking svn:mergeinfo changes since r32: 7 sources, 2 changed
Found merge parent (/trunk:1-2): 19c3e7946eeef806068ec02a0e41e669213ddd15
r4 = d81f999e96a348747a50fdc8b3764a53171e60ed (refs/remotes/origin/a)
Found merge parent (/branches/f1:33-34): f78f3a5d1e3b322462cb535cfa72092188e5b55f
	A	baz
	A	file2.txt
Committed revision 1.
Found merge parent (/branches/f2:34): 1f35cafcf36f5273f266e0fdf53b2b0e5cae9932
Checked out revision 1.
r5 = 7fc474cc1196788bdd65f860122b5d9f2820d183 (refs/remotes/origin/b)
r35 = 93881fcc99fb98b085dde9da85df5f471242a3d8 (refs/remotes/origin/trunk)
A         1
A         2
A         2/file1.txt
A         2/file2.txt
A         3
A         3/a
A         3/a/file1.txt
A         3/b
A         3/b/file1.txt
A         4
A         5
A         6
	A	subdir/cowboy
Committed r4
	M	file2.txt
r36 = 71b29806ce50e7abcebc021bddd47ea9925b62d1 (refs/remotes/origin/left)
r6 = e3042934c74e70c66aacee259c02210628e456a5 (refs/remotes/origin/b)
	A	subdir/cowboy
Adding         1
Adding         2
Adding         2/file1.txt
Adding         2/file2.txt
Adding         3
Adding         3/a
Checking svn:mergeinfo changes since r35: 7 sources, 1 changed
Adding         3/a/file1.txt
Adding         3/b
Adding         3/b/file1.txt
Adding         4
Adding         5
	A	baz
Adding         6
Checking svn:mergeinfo changes since r3: 2 sources, 2 changed
Transmitting file data ....done
Committing transaction...
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9159-git-svn-no-parent-mergeinfo/svnrepo/branches/b => file:///«PKGBUILDDIR»/t/trash%20directory.t9159-git-svn-no-parent-mergeinfo/svnrepo/branches/c, 5
Found merge parent (/branches/left:2-36): 71b29806ce50e7abcebc021bddd47ea9925b62d1
Found branch parent: (refs/remotes/origin/c) 7fc474cc1196788bdd65f860122b5d9f2820d183
Following parent with do_switch
r37 = a7818cc97d8d22845c6c4b16c4029f0a19580e17 (refs/remotes/origin/trunk)
Successfully followed parent
Committed revision 2.
Couldn't find revmap for file:///«PKGBUILDDIR»/t/trash%20directory.t9158-git-svn-mergeinfo/svnrepo/trunk/branches/bar
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9151-svn-mergeinfo/svnrepo/trunk/subdir => file:///«PKGBUILDDIR»/t/trash%20directory.t9151-svn-mergeinfo/svnrepo/branches/partial, 37
r7 = 850877376f9ac68eb8e05470adb92b4923a5a21c (refs/remotes/origin/c)
Couldn't find revmap for file:///«PKGBUILDDIR»/t/trash%20directory.t9158-git-svn-mergeinfo/svnrepo/trunk/branches/other
A         4/a
r4 = b60fe895bbed793fdfce176171de7762d7c0a011 (refs/remotes/git-svn)
Initializing parent: refs/remotes/origin/partial@37
No changes between 8ae265d141df4d6a6496a5ec20609009e3cf55ec and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
Checking svn:mergeinfo changes since r7: 1 sources, 1 changed
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9151-svn-mergeinfo/svnrepo/branches/left/subdir => file:///«PKGBUILDDIR»/t/trash%20directory.t9151-svn-mergeinfo/svnrepo/trunk/subdir, 36
Adding         4/a
Committing transaction...
ok 5 - change svn:mergeinfo multiline

expecting success: 
	mergeinfo=$(svn_cmd propget svn:mergeinfo "$svnrepo"/trunk) &&
	test "$mergeinfo" = "/branches/bar:1-10
/branches/other:3-5,8,10-11"

ok 6 - verify svn:mergeinfo multiline

Found merge parent (/branches/b:5-6): e3042934c74e70c66aacee259c02210628e456a5
# passed all 6 test(s)
1..6
Initializing parent: refs/remotes/origin/partial@36
*** t9161-git-svn-mergeinfo-push.sh ***
r8 = ab59acbf2c46fb001f3b7147ff1c6a31680f7253 (refs/remotes/origin/c)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9161-git-svn-mergeinfo-push/.git/
	A	cowboy
Committed revision 3.
r36 = 36ab2d3b9d077028fa3d659325ac8ca081e348bc (refs/remotes/origin/partial@36)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9159-git-svn-no-parent-mergeinfo/svnrepo/trunk r2
A         4/a/b
Found branch parent: (refs/remotes/origin/partial@37) 36ab2d3b9d077028fa3d659325ac8ca081e348bc
Following parent with do_switch
Successfully followed parent
Adding         4/a/b
r37 = 94ef88aa1ebfb64b5525f3aed8dd36d7ec63cecc (refs/remotes/origin/partial@37)
Committing transaction...
Found branch parent: (refs/remotes/origin/partial) 94ef88aa1ebfb64b5525f3aed8dd36d7ec63cecc
ok 1 - test handling of root commits in merge ranges

# passed all 1 test(s)
1..1
Following parent with do_switch
*** t9162-git-svn-dcommit-interactive.sh ***
Successfully followed parent
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9162-git-svn-dcommit-interactive/.git/
r38 = 910f886650e45984540884fbce419222d5dbe772 (refs/remotes/origin/partial)
	A	palindromes
expecting success: 
	svnadmin load -q '/«PKGBUILDDIR»/t/trash directory.t9161-git-svn-mergeinfo-push/svnrepo' 	  < '/«PKGBUILDDIR»/t/t9161/branches.dump' &&
	git svn init --minimize-url -R svnmerge 	  -T trunk -b branches 'file:///«PKGBUILDDIR»/t/trash directory.t9161-git-svn-mergeinfo-push/svnrepo' &&
	git svn fetch --all
	
r39 = fdb537791ee8ba532e49c3d5a34a30feeb87bd59 (refs/remotes/origin/partial)
Committed revision 4.
A         4/a/b/c
	A	subdir/palindromes
r40 = 90411e1b2118e11664e368a24a1eaa5e8749d150 (refs/remotes/origin/trunk)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9151-svn-mergeinfo/svnrepo/tags/v1.0 => file:///«PKGBUILDDIR»/t/trash%20directory.t9151-svn-mergeinfo/svnrepo/branches/bugfix, 41
Adding         4/a/b/c
Committing transaction...
Initializing parent: refs/remotes/origin/bugfix@41
expecting success: 
	svn_cmd mkdir -m"mkdir test-interactive" "$svnrepo/test-interactive" &&
	git svn clone "$svnrepo/test-interactive" test-interactive &&
	cd test-interactive &&
	touch foo && git add foo && git commit -m"foo: first commit" &&
	git svn dcommit
	
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9151-svn-mergeinfo/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9151-svn-mergeinfo/svnrepo/tags/v1.0, 40
Found branch parent: (refs/remotes/origin/bugfix@41) 90411e1b2118e11664e368a24a1eaa5e8749d150
Following parent with do_switch
Successfully followed parent
Committing transaction...
Committed revision 5.
r41 = f4522c2fc7b8b6ab30592330d961ed5321c3ddc7 (refs/remotes/origin/bugfix@41)
Found branch parent: (refs/remotes/origin/bugfix) f4522c2fc7b8b6ab30592330d961ed5321c3ddc7
A         4/a/b/c/foo
Following parent with do_switch
Successfully followed parent
r42 = 21d184ac3dd2fcbc5f88a25abde26db37e05d6db (refs/remotes/origin/bugfix)
	M	subdir/palindromes
Adding         4/a/b/c/foo
Transmitting file data .done
Committing transaction...
r43 = a671eec900764a4ab85a6166def3e0d30f1a2664 (refs/remotes/origin/bugfix)
Committed revision 1.
	M	subdir/palindromes
Checking svn:mergeinfo changes since r40: 9 sources, 2 changed
Couldn't find revmap for file:///«PKGBUILDDIR»/t/trash%20directory.t9151-svn-mergeinfo/svnrepo/tags/v1.0
Found merge parent (/branches/bugfix:42-43): a671eec900764a4ab85a6166def3e0d30f1a2664
r44 = a110dec28a4b152b394906b1303fbf19174f7d26 (refs/remotes/origin/trunk)
Committed revision 6.
D         2/file2.txt
D         3/b
D         3/b/file1.txt
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9151-svn-mergeinfo/svnrepo/trunk r44
ok 1 - load svn dump

expecting success: 
	unmarked=$(git rev-list --parents --all --grep=Merge |
		grep -v " .* " | cut -f1 -d" ") &&
	[ -z "$unmarked" ]
	
ok 2 - all svn merges became git merge commits

expecting success: 
	bad_cherries=$(git rev-list --parents --all --grep=Cherry |
		grep " .* " | cut -f1 -d" ") &&
	[ -z "$bad_cherries" ]
	
ok 3 - cherry picks did not become git merge commits

expecting success: 
	bad_non_merges=$(git rev-list --parents --all --grep=non-merge |
		grep " .* " | cut -f1 -d" ") &&
	[ -z "$bad_non_merges" ]
	
Deleting       2/file2.txt
Deleting       3/b
Committing transaction...
ok 4 - svn non-merge merge commits did not become git merge commits

expecting success: 
	before_commit=$(git rev-list --all --grep="trunk commit before merging trunk to b2") &&
	merge_commit=$(git rev-list --all --grep="Merge trunk to b2") &&
	not_reachable=$(git rev-list -1 $before_commit --not $merge_commit) &&
	[ -z "$not_reachable" ]
	
ok 5 - commit made to merged branch is reachable from the merge

expecting success: 
	f1_commit=$(git rev-list --all --grep="make f1 branch from trunk") &&
	f2_commit=$(git rev-list --all --grep="make f2 branch from trunk") &&
	merge_commit=$(git rev-list --all --grep="Merge f1 and f2 to trunk") &&
	not_reachable=$(git rev-list -1 $f1_commit $f2_commit --not $merge_commit) &&
	[ -z "$not_reachable" ]
	
ok 6 - merging two branches in one commit is detected correctly

checking known breakage: 
	unmerged=$(git rev-list --all --not master) &&
	[ -z "$unmerged" ]
	
not ok 7 - everything got merged in the end # TODO known breakage

# still have 1 known breakage(s)
# passed all remaining 6 test(s)
1..7
*** t9163-git-svn-reset-clears-caches.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9163-git-svn-reset-clears-caches/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9162-git-svn-dcommit-interactive/test-interactive/.git/
Committed revision 7.
D         2/file1.txt
D         3/a
D         3/a/file1.txt
r1 = 96396734148cac4249e5576403db93339c28cafb (refs/remotes/git-svn)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9162-git-svn-dcommit-interactive/svnrepo/test-interactive r1
[master 2862600] foo: first commit
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 foo
Deleting       2/file1.txt
Deleting       3/a
Committing transaction...
expecting success: 
	svn_cmd mkdir -m "create trunk" "$svnrepo"/trunk &&
	svn_cmd mkdir -m "create branches" "$svnrepo/branches" &&
	svn_cmd co "$svnrepo"/trunk "$SVN_TREE" &&
	(
		cd "$SVN_TREE" &&
		touch foo &&
		svn_cmd add foo &&
		svn_cmd commit -m "a" &&
		svn_cmd cp -m branch "$svnrepo"/trunk "$svnrepo"/branches/branch1 &&
		svn_cmd switch "$svnrepo"/branches/branch1 &&
		touch bar &&
		svn_cmd add bar &&
		svn_cmd commit -m b &&
		svn_cmd switch "$svnrepo"/trunk &&
		touch baz &&
		svn_cmd add baz &&
		svn_cmd commit -m c &&
		svn_cmd up &&
		svn_cmd merge "$svnrepo"/branches/branch1 &&
		svn_cmd commit -m "m"
	) &&
	rm -rf "$SVN_TREE"

Committing transaction...
Committed revision 8.
A         5/.placeholder
A         6/.placeholder
Adding         5/.placeholder
Committed revision 1.
Adding         6/.placeholder
Transmitting file data .done
Committing transaction...
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9162-git-svn-dcommit-interactive/svnrepo/test-interactive ...
Committing transaction...
	A	foo
Committed revision 9.
ok 1 - initialize source svn repo containing empty dirs

expecting success: 
	git svn clone "$svnrepo"/trunk --preserve-empty-dirs "$GIT_REPO"

Committed revision 2.
Checked out revision 2.
A         foo
Committed r2
	A	foo
r2 = ad3b9a884f9b4c6f6b1b7d92e30125f1a8d64557 (refs/remotes/git-svn)
No changes between 2862600164382aff00c12c498d8d55edb30fadd6 and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
Adding         foo
Transmitting file data .done
Committing transaction...
ok 1 - initialize repo

expecting success: 
	(
		echo "change #1" >> foo && git commit -a -m"change #1" &&
		echo "change #2" >> foo && git commit -a -m"change #2" &&
		echo "change #3" >> foo && git commit -a -m"change #3" &&
		( echo "y

y" | GIT_SVN_NOTTY=1 git svn dcommit --interactive ) &&
		test $(git rev-parse HEAD) = $(git rev-parse remotes/git-svn)
	)
	
[master 8cd76ed] change #1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master e669b55] change #2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master ebbe5f9] change #3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Committed revision 3.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9160-git-svn-preserve-empty-dirs/git-svn-repo/.git/
Committing transaction...
r1 = fefb6a175e559161cab62112c3d8f0c1bcc9bd44 (refs/remotes/git-svn)
	A	2/file1.txt
	A	2/file2.txt
	A	3/a/file1.txt
	A	3/b/file1.txt
Committed revision 4.
r2 = 6879f65fd6c35f0b9cea9cafb6d85fe4dee9019e (refs/remotes/git-svn)
At revision 4.
A         bar
	D	4/.gitignore
W: -empty_dir: 4/.gitignore
r3 = 00fc2fffd6985fa4168bd58dfce940fabc7d5fd7 (refs/remotes/git-svn)
Adding         bar
Transmitting file data .done
Committing transaction...
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9162-git-svn-dcommit-interactive/svnrepo/test-interactive ...
	D	4/a/.gitignore
commit 8cd76edcecd31dabe162c7da6c14bf97ff9f72ab
Author: A U Thor <author@example.com>
Date:   Wed Dec 16 11:19:39 2015 +0000

    change #1

W: -empty_dir: 4/a/.gitignore
Commit this patch to SVN? ([y]es (default)|[n]o|[q]uit|[a]ll): commit e669b55e052ba8da2411f10dcf40b9d5d4277d1e
Author: A U Thor <author@example.com>
Date:   Wed Dec 16 11:19:39 2015 +0000

    change #2

Commit this patch to SVN? ([y]es (default)|[n]o|[q]uit|[a]ll): commit ebbe5f9df6c37e2d62ff507a645ed585f0e9355b
Author: A U Thor <author@example.com>
Date:   Wed Dec 16 11:19:39 2015 +0000

    change #3

Commit this patch to SVN? ([y]es (default)|[n]o|[q]uit|[a]ll): r4 = b8434573818d9da2b17a302143f0be34d8b79349 (refs/remotes/git-svn)
Committed revision 5.
	D	4/a/b/.gitignore
D    bar
Updated to revision 5.
W: -empty_dir: 4/a/b/.gitignore
A         baz
r5 = 5277374b09165aa78e3b57ccc610484492d80038 (refs/remotes/git-svn)
	M	foo
	D	4/a/b/c/.gitignore
	A	4/a/b/c/foo
W: -empty_dir: 4/a/b/c/.gitignore
r6 = a7749e4bfe9cceba6e882dbcbd433f56666baf99 (refs/remotes/git-svn)
Adding         baz
Transmitting file data .done
Committing transaction...
	D	2/file2.txt
	D	3/b/file1.txt
	D	3/b/
W: -empty_dir: 2/file2.txt
W: -empty_dir: 3/b
Committed r3
r7 = d63c26dd664f3b58151731d9a9f69bc0fbde0800 (refs/remotes/git-svn)
	D	2/file1.txt
	D	3/a/file1.txt
	D	3/a/
	M	foo
Committed revision 6.
W: -empty_dir: 2/file1.txt
W: -empty_dir: 3/a
r3 = b00a43e9d33abfd83bd320ddd8dfb429016f5fd2 (refs/remotes/git-svn)
Updating '.':
At revision 6.
r8 = 720048a5664d79b83a2b0b660fe63ccaa5266337 (refs/remotes/git-svn)
--- Merging r4 through r6 into '.':
A    bar
--- Recording mergeinfo for merge of r4 through r6 into '.':
 U   .
	D	5/.gitignore
	A	5/.placeholder
	D	6/.gitignore
Sending        .
W: -empty_dir: 5/.gitignore
W: -empty_dir: 6/.gitignore
	M	foo
r9 = ea6df5f7807f82a7efecb466e017e3807598a9d8 (refs/remotes/git-svn)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9160-git-svn-preserve-empty-dirs/svnrepo/trunk r9
ok 2 - clone svn repo with --preserve-empty-dirs

expecting success: 
	test -f "$GIT_REPO"/1/.gitignore &&
	test $(find "$GIT_REPO"/1 -type f | wc -l) = "1"

ok 3 - directory empty from inception

expecting success: 
	test -f "$GIT_REPO"/2/.gitignore &&
	test $(find "$GIT_REPO"/2 -type f | wc -l) = "1" &&
	test -f "$GIT_REPO"/3/.gitignore &&
	test $(find "$GIT_REPO"/3 -type f | wc -l) = "1"

ok 4 - directory empty from subsequent svn commit

expecting success: 
	test $(find "$GIT_REPO"/4 -type f | wc -l) = "1" &&
	test -f "$GIT_REPO"/4/a/b/c/foo

ok 5 - add entry to previously empty directory

expecting success: 
	(
		cd "$GIT_REPO" &&
		git checkout HEAD~2
	) &&
	test_must_fail test -f "$GIT_REPO"/2/.gitignore &&
	test_must_fail test -f "$GIT_REPO"/3/.gitignore

Note: checking out 'HEAD~2'.

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 d63c26d... delete non-last entry in directory
ok 6 - remove non-last entry from directory

expecting success: 
	rm -rf "$GIT_REPO" &&
	git svn clone "$svnrepo"/trunk --preserve-empty-dirs \
		--placeholder-file=.placeholder "$GIT_REPO" &&
	find "$GIT_REPO" -type f -name ".placeholder" &&
	test $(find "$GIT_REPO" -type f -name ".placeholder" | wc -l) = "5"

Adding         bar
Committing transaction...
Committed r4
Committed revision 7.
	M	foo
ok 1 - initialize source svn repo

expecting success: 
	git svn init -s "$svnrepo" &&
	git svn fetch --revision BASE:3

r4 = 7efd32e4ca4921460546bba26f03f8e650db117d (refs/remotes/git-svn)
	M	foo
Committed r5
	M	foo
r5 = 962f1125e4766506cd4affcfdf008d84c2de42b1 (refs/remotes/git-svn)
No changes between ebbe5f9df6c37e2d62ff507a645ed585f0e9355b and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
r1 = 31646a606722d9dd23f00d942dc0872eece22873 (refs/remotes/origin/trunk)
ok 2 - answers: y [\n] yes

expecting success: 
	(
		echo "change #1" >> foo && git commit -a -m"change #1" &&
		echo "change #2" >> foo && git commit -a -m"change #2" &&
		echo "change #3" >> foo && git commit -a -m"change #3" &&
		( echo "yes
yes
no" | GIT_SVN_NOTTY=1 git svn dcommit --interactive ) &&
		test $(git rev-parse HEAD^^^) = $(git rev-parse remotes/git-svn) &&
		git reset --hard remotes/git-svn
	)
	
[master 29f3f13] change #1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master a5d5dba] change #2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9160-git-svn-preserve-empty-dirs/git-svn-repo/.git/
[master e1abda1] change #3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9161-git-svn-mergeinfo-push/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9161-git-svn-mergeinfo-push/svnrepo/branches/svnb1, 1
Found branch parent: (refs/remotes/origin/svnb1) 31646a606722d9dd23f00d942dc0872eece22873
Following parent with do_switch
Successfully followed parent
r2 = edf548ed9b5b13479d1a588b8393394a03094208 (refs/remotes/origin/svnb1)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9161-git-svn-mergeinfo-push/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9161-git-svn-mergeinfo-push/svnrepo/branches/svnb2, 1
r1 = fefb6a175e559161cab62112c3d8f0c1bcc9bd44 (refs/remotes/git-svn)
Found branch parent: (refs/remotes/origin/svnb2) 31646a606722d9dd23f00d942dc0872eece22873
Following parent with do_switch
	A	2/file1.txt
	A	2/file2.txt
	A	3/a/file1.txt
	A	3/b/file1.txt
Successfully followed parent
r3 = 063e23359e4e3f07ba029a06f15d7ea989e43ba4 (refs/remotes/origin/svnb2)
r2 = 22f67014e52392d698b6b156da904b74cbab90a4 (refs/remotes/git-svn)
	D	4/.placeholder
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9161-git-svn-mergeinfo-push/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9161-git-svn-mergeinfo-push/svnrepo/branches/svnb3, 1
W: -empty_dir: 4/.placeholder
Found branch parent: (refs/remotes/origin/svnb3) 31646a606722d9dd23f00d942dc0872eece22873
Following parent with do_switch
r3 = 0de0369e38c352bb42c63231050842897f450bdd (refs/remotes/git-svn)
Successfully followed parent
	D	4/a/.placeholder
r4 = d5c190a4d99a74b72c24e87dd8734ddf093ddbce (refs/remotes/origin/svnb3)
W: -empty_dir: 4/a/.placeholder
r4 = c73b50b018f85518ebbf876023909a80553739ef (refs/remotes/git-svn)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9161-git-svn-mergeinfo-push/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9161-git-svn-mergeinfo-push/svnrepo/branches/svnb4, 1
Found branch parent: (refs/remotes/origin/svnb4) 31646a606722d9dd23f00d942dc0872eece22873
	D	4/a/b/.placeholder
Following parent with do_switch
W: -empty_dir: 4/a/b/.placeholder
Successfully followed parent
r5 = 48284eccbbc7479830428ef9c77ec6c65abef125 (refs/remotes/git-svn)
r5 = be83933a183a986dc187c8ccd0ab5cbe37556f91 (refs/remotes/origin/svnb4)
	D	4/a/b/c/.placeholder
	A	4/a/b/c/foo
W: -empty_dir: 4/a/b/c/.placeholder
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9162-git-svn-dcommit-interactive/svnrepo/test-interactive ...
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9161-git-svn-mergeinfo-push/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9161-git-svn-mergeinfo-push/svnrepo/branches/svnb5, 1
r6 = f13199943ad9f5dc50d04d040476b08d8a084c72 (refs/remotes/git-svn)
Found branch parent: (refs/remotes/origin/svnb5) 31646a606722d9dd23f00d942dc0872eece22873
commit 29f3f13425ac3a16a87cd326683d8be4cc71060f
Author: A U Thor <author@example.com>
Date:   Wed Dec 16 11:19:49 2015 +0000

    change #1

Following parent with do_switch
Commit this patch to SVN? ([y]es (default)|[n]o|[q]uit|[a]ll): commit a5d5dba7a7cea5c09415e68b61269bf8bc60367a
Author: A U Thor <author@example.com>
Date:   Wed Dec 16 11:19:50 2015 +0000

    change #2

Commit this patch to SVN? ([y]es (default)|[n]o|[q]uit|[a]ll): commit e1abda129d46c61b5fab9fd1377c2269a05f932e
Author: A U Thor <author@example.com>
Date:   Wed Dec 16 11:19:50 2015 +0000

    change #3

Commit this patch to SVN? ([y]es (default)|[n]o|[q]uit|[a]ll): 	D	2/file2.txt
	D	3/b/file1.txt
	D	3/b/
Successfully followed parent
HEAD is now at 962f112 change #3
ok 3 - answers: yes yes no

expecting success: 
	(
		echo "change #1" >> foo && git commit -a -m"change #1" &&
		echo "change #2" >> foo && git commit -a -m"change #2" &&
		echo "change #3" >> foo && git commit -a -m"change #3" &&
		( echo "yes
quit" | GIT_SVN_NOTTY=1 git svn dcommit --interactive ) &&
		test $(git rev-parse HEAD^^^) = $(git rev-parse remotes/git-svn) &&
		git reset --hard remotes/git-svn
	)
	
[master 832da71] change #1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master 46191a3] change #2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
W: -empty_dir: 2/file2.txt
[master 1d7f87a] change #3
W: -empty_dir: 3/b
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
r6 = 00c853c027aa0310a345d6f9afeda4db3d5c63eb (refs/remotes/origin/svnb5)
r7 = 61fc8602a1f23e6a767fcbfe09b3c57c0f5e5ada (refs/remotes/git-svn)
	A	b1file
	D	2/file1.txt
	D	3/a/file1.txt
	D	3/a/
r7 = b656e6f6483c68cfb6f2e67e03b8ea10c537f4f6 (refs/remotes/origin/svnb1)
W: -empty_dir: 2/file1.txt
W: -empty_dir: 3/a
	A	b2file
r8 = 0340ce78fee380181a52a7aeb149355f35e9ab0b (refs/remotes/git-svn)
r8 = a7d16ae1c60b8b69c3ff5c476e3e98e278a62735 (refs/remotes/origin/svnb2)
	A	5/.placeholder
	D	6/.placeholder
r1 = 333cb536513f48bd76f4d57cd7b4016570a209bc (refs/remotes/origin/trunk)
	A	b3file
r9 = 6f63d1e324e6e86e4942154ab211e25b9360d53a (refs/remotes/origin/svnb3)
r9 = f9d6870a222a14b1b7f6c3f509dd766600dfd89e (refs/remotes/git-svn)
	A	foo
	A	b4file
r3 = 92c2c3a52f5dcdb2b6d1e7ac5a3be43b91a14d4e (refs/remotes/origin/trunk)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9160-git-svn-preserve-empty-dirs/svnrepo/trunk r9
r10 = 40153c2b30fc967c5e9b03c60c199309d2eb5382 (refs/remotes/origin/svnb4)
git-svn-repo/1/.placeholder
git-svn-repo/2/.placeholder
git-svn-repo/3/.placeholder
git-svn-repo/5/.placeholder
git-svn-repo/6/.placeholder/.placeholder
ok 7 - clone svn repo with --placeholder-file specified

expecting success: 
	test -s "$GIT_REPO"/5/.placeholder

ok 8 - placeholder namespace conflict with file

expecting success: 
	test -d "$GIT_REPO"/6/.placeholder &&
	test -f "$GIT_REPO"/6/.placeholder/.placeholder &&
	test $(find "$GIT_REPO"/6 -type f | wc -l) = "1"

ok 9 - placeholder namespace conflict with directory

expecting success: 
	svn_cmd co "$svnrepo"/trunk "$SVN_TREE" &&
	(
		cd "$SVN_TREE" &&
		mkdir -p 7 &&
		echo "This should remove placeholder" > 1/file1.txt &&
		echo "This should not remove placeholder" > 5/file1.txt &&
		svn_cmd add 7 1/file1.txt 5/file1.txt &&
		svn_cmd commit -m "subsequent svn commit for persistence tests"
	) &&
	rm -rf "$SVN_TREE" &&
	(
		cd "$GIT_REPO" &&
		git svn rebase
	)

	A	b5file
A    .git/svn/refs/remotes/git-svn/svn-tree/1
A    .git/svn/refs/remotes/git-svn/svn-tree/2
A    .git/svn/refs/remotes/git-svn/svn-tree/3
A    .git/svn/refs/remotes/git-svn/svn-tree/4
A    .git/svn/refs/remotes/git-svn/svn-tree/4/a
A    .git/svn/refs/remotes/git-svn/svn-tree/4/a/b
A    .git/svn/refs/remotes/git-svn/svn-tree/4/a/b/c
A    .git/svn/refs/remotes/git-svn/svn-tree/4/a/b/c/foo
r11 = 538d7280db0ae5029bb36348be384e01ef4171a7 (refs/remotes/origin/svnb5)
A    .git/svn/refs/remotes/git-svn/svn-tree/5
A    .git/svn/refs/remotes/git-svn/svn-tree/5/.placeholder
A    .git/svn/refs/remotes/git-svn/svn-tree/6
A    .git/svn/refs/remotes/git-svn/svn-tree/6/.placeholder
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9163-git-svn-reset-clears-caches/svnrepo/trunk r3
Checked out revision 9.
ok 2 - fetch to merge-base (a)

expecting success: 
	git svn rebase &&
	git svn fetch &&
	test 1 = $(git cat-file -p master|grep parent|wc -l)

A         7
	A	b5file
A         1/file1.txt
A         5/file1.txt
Checking svn:mergeinfo changes since r10: 1 sources, 1 changed
Found merge parent (/branches/svnb5:6,11): 538d7280db0ae5029bb36348be384e01ef4171a7
r12 = d477328c0dbb4b75a1e52fcbdd7f435e8251ab49 (refs/remotes/origin/svnb4)
Adding         1/file1.txt
Adding         5/file1.txt
Adding         7
Transmitting file data ..done
Committing transaction...
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9161-git-svn-mergeinfo-push/svnrepo/trunk r1
Committed revision 10.
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9162-git-svn-dcommit-interactive/svnrepo/test-interactive ...
commit 832da71b60a8e2b8b8633faa0ea837d5b7f8b82e
Author: A U Thor <author@example.com>
Date:   Wed Dec 16 11:19:55 2015 +0000

    change #1

ok 1 - load svn dump

expecting success: 
	git config svn.pushmergeinfo yes &&
	git checkout origin/svnb1 &&
	git merge --no-ff origin/svnb2 &&
	git svn dcommit
	
Note: checking out 'origin/svnb1'.

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 b656e6f... b1 commit
Commit this patch to SVN? ([y]es (default)|[n]o|[q]uit|[a]ll): commit 46191a386c6d00044578e87ce98ad35807dbbd4a
Author: A U Thor <author@example.com>
Date:   Wed Dec 16 11:19:55 2015 +0000

    change #2

Commit this patch to SVN? ([y]es (default)|[n]o|[q]uit|[a]ll): Merging:
b656e6f b1 commit
virtual origin/svnb2
found 1 common ancestor:
31646a6 Base commit
Merge made by the 'recursive' strategy.
 b2file | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 b2file
HEAD is now at 962f112 change #3
ok 4 - answers: yes quit

expecting success: 
	(
		echo "change #1" >> foo && git commit -a -m"change #1" &&
		echo "change #2" >> foo && git commit -a -m"change #2" &&
		echo "change #3" >> foo && git commit -a -m"change #3" &&
		( echo "all" | GIT_SVN_NOTTY=1 git svn dcommit --interactive ) &&
		test $(git rev-parse HEAD) = $(git rev-parse remotes/git-svn) &&
		git reset --hard remotes/git-svn
	)
	
[master da4d4c8] change #1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master 888bd29] change #2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master 9a9c094] change #3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
	A	baz
r6 = f631f2215d94ada1bbcab23504ef2efd50f4e109 (refs/remotes/origin/trunk)
	A	bar
Checking svn:mergeinfo changes since r6: 1 sources, 1 changed
Couldn't find revmap for file:///«PKGBUILDDIR»/t/trash%20directory.t9163-git-svn-reset-clears-caches/svnrepo/branches/branch1
r7 = 7ed6bb94dd5caa7cbd071734c7fe700684beae11 (refs/remotes/origin/trunk)
First, rewinding head to replay your work on top of it...
Fast-forwarded master to refs/remotes/origin/trunk.
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9161-git-svn-mergeinfo-push/svnrepo/branches/svnb1 ...
	D	1/.placeholder
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9162-git-svn-dcommit-interactive/svnrepo/test-interactive ...
	A	1/file1.txt
	A	5/file1.txt
W: -empty_dir: 1/.placeholder
commit da4d4c83722ee519a4ef32ebb32a81a0df2eafed
Author: A U Thor <author@example.com>
Date:   Wed Dec 16 11:20:00 2015 +0000

    change #1

Commit this patch to SVN? ([y]es (default)|[n]o|[q]uit|[a]ll): r10 = 242642072954546110ed05c036b5938f280d4cb8 (refs/remotes/git-svn)
First, rewinding head to replay your work on top of it...
Fast-forwarded master to refs/remotes/git-svn.
ok 10 - second set of svn commits and rebase

expecting success: 
	test -f "$GIT_REPO"/7/.placeholder &&
	test $(find "$GIT_REPO"/7 -type f | wc -l) = "1"

ok 11 - flag persistence during subsqeuent rebase

expecting success: 
	test -f "$GIT_REPO"/1/file1.txt &&
	test $(find "$GIT_REPO"/1 -type f | wc -l) = "1" &&

	test -f "$GIT_REPO"/5/file1.txt &&
	test -f "$GIT_REPO"/5/.placeholder &&
	test $(find "$GIT_REPO"/5 -type f | wc -l) = "2"

ok 12 - placeholder list persistence during subsqeuent rebase

# passed all 12 test(s)
1..12
	M	foo
	A	b2file
*** t9164-git-svn-dcommit-concurrent.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9164-git-svn-dcommit-concurrent/.git/
Committed r6
Committed r13
expecting success: 
	svn_cmd checkout "$svnrepo" work.svn &&
	(
		cd work.svn &&
		echo >file && echo > auto_updated_file
		svn_cmd add file auto_updated_file &&
		svn_cmd commit -m "initial commit"
	) &&
	svn_cmd checkout "$svnrepo" work-auto-commits.svn

Checked out revision 0.
	M	foo
	A	b2file
Checking svn:mergeinfo changes since r7: 1 sources, 1 changed
A         file
A         auto_updated_file
r6 = e750ce29b8a93091a8291104dd049eb24cfb4bc4 (refs/remotes/git-svn)
Adding         auto_updated_file
Adding         file
Transmitting file data ..done
Committing transaction...
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9163-git-svn-reset-clears-caches/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9163-git-svn-reset-clears-caches/svnrepo/branches/branch1, 3
	M	foo
Found branch parent: (refs/remotes/origin/branch1) 92c2c3a52f5dcdb2b6d1e7ac5a3be43b91a14d4e
Following parent with do_switch
Found merge parent (/branches/svnb2:3,8): a7d16ae1c60b8b69c3ff5c476e3e98e278a62735
Successfully followed parent
r13 = 7302a7b53d3a77bc69c100bfd9c93a93f94b9cbf (refs/remotes/origin/svnb1)
Committed revision 1.
r4 = 55baa7920a52e5eeff12084c1d6b88118fa5092e (refs/remotes/origin/branch1)
No changes between 341716b97c29f739c3e32b7e3303aabdbf6ddeb7 and refs/remotes/origin/svnb1
Resetting to the latest refs/remotes/origin/svnb1
A    work-auto-commits.svn/auto_updated_file
A    work-auto-commits.svn/file
Committed r7
Checked out revision 1.
ok 1 - setup svn repository

expecting success: 
	setup_hook post-commit 1 &&
	(
		cd work.svn &&
		cp auto_updated_file au_file_saved &&
		echo 1 >> file &&
		svn_cmd commit -m "changing file" &&
		svn_cmd up &&
		test_must_fail test_cmp auto_updated_file au_file_saved
	)

ok 2 - propagate merge information

expecting success: 
	mergeinfo=$(svn_cmd propget svn:mergeinfo "$svnrepo"/branches/svnb1) &&
	test "$mergeinfo" = "/branches/svnb2:3,8"
	
	A	bar
ok 3 - check svn:mergeinfo

expecting success: 
	git merge --no-ff origin/svnb3 &&
	git svn dcommit
	
Merging:
7302a7b Merge remote-tracking branch 'origin/svnb2' into HEAD
virtual origin/svnb3
found 1 common ancestor:
31646a6 Base commit
Merge made by the 'recursive' strategy.
 b3file | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 b3file
r5 = f8d343c3715818efa255708a0e8e4640de849c58 (refs/remotes/origin/branch1)
	M	foo
r7 = bef54b2e1f885aee190e350e7bce2903bd1c4bf8 (refs/remotes/git-svn)
Sending        file
Transmitting file data .done
Committing transaction...
ok 3 - rebase looses SVN merge (m)

expecting success: 
	git svn reset -r 3 &&
	git reset --hard origin/trunk &&
	git svn fetch &&
	test 2 = $(git cat-file -p origin/trunk|grep parent|wc -l)

	M	foo
Committed r8
	M	foo
r8 = 4d890ff2a3316a150f2509fb6a7a2a83f0712b98 (refs/remotes/git-svn)
No changes between 9a9c094c0b1543116b5a62bf99ba5262a1aa2446 and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
HEAD is now at 4d890ff change #3
ok 5 - answers: all

# passed all 5 test(s)
1..5
*** t9165-git-svn-fetch-merge-branch-of-branch.sh ***
Committed revision 2.
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9165-git-svn-fetch-merge-branch-of-branch/.git/
Updating '.':
U    auto_updated_file
Updated to revision 3.
--- auto_updated_file	2015-12-16 11:20:13.849564991 +0000
+++ au_file_saved	2015-12-16 11:20:10.661564990 +0000
@@ -1,2 +1 @@
 
-3978
ok 2 - check if post-commit hook creates a concurrent commit

expecting success: 
	setup_hook pre-commit 2 &&
	(
		cd work.svn &&
		echo 2 >> file &&
		svn_cmd commit -m "changing file once again" &&
		echo 3 >> file &&
		test_must_fail svn_cmd commit -m "this commit should fail" &&
		svn_cmd revert file
	)

r3 = 92c2c3a52f5dcdb2b6d1e7ac5a3be43b91a14d4e (refs/remotes/origin/trunk)
HEAD is now at 92c2c3a a
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9161-git-svn-mergeinfo-push/svnrepo/branches/svnb1 ...
Sending        file
Transmitting file data .done
Committing transaction...
Committed revision 4.
	A	b3file
expecting success: 
	svn_cmd mkdir -m x "$svnrepo"/trunk &&
	svn_cmd mkdir -m x "$svnrepo"/branches &&
	svn_cmd co "$svnrepo"/trunk "$SVN_TREE" &&
	(
		cd "$SVN_TREE" &&
		touch foo &&
		svn_cmd add foo &&
		svn_cmd commit -m "initial commit" &&
		svn_cmd cp -m branch "$svnrepo"/trunk "$svnrepo"/branches/branch1 &&
		svn_cmd switch "$svnrepo"/branches/branch1 &&
		touch bar &&
		svn_cmd add bar &&
		svn_cmd commit -m branch1 &&
		svn_cmd cp -m branch "$svnrepo"/branches/branch1 "$svnrepo"/branches/branch2 &&
		svn_cmd switch "$svnrepo"/branches/branch2 &&
		touch baz &&
		svn_cmd add baz &&
		svn_cmd commit -m branch2 &&
		svn_cmd switch "$svnrepo"/trunk &&
		touch bar2 &&
		svn_cmd add bar2 &&
		svn_cmd commit -m trunk &&
		svn_cmd switch "$svnrepo"/branches/branch2 &&
		svn_cmd merge "$svnrepo"/trunk &&
		svn_cmd commit -m "merge trunk"
		svn_cmd switch "$svnrepo"/trunk &&
		svn_cmd merge --reintegrate "$svnrepo"/branches/branch2 &&
		svn_cmd commit -m "merge branch2"
	) &&
	rm -rf "$SVN_TREE"

Sending        file
Transmitting file data .done
Committing transaction...
svn: E165001: Commit failed (details follow):
svn: E165001: Commit blocked by pre-commit hook (exit code 1) with no output.
Reverted 'file'
ok 3 - check if pre-commit hook fails

expecting success: 
	setup_hook pre-commit 2 &&
	next_N && git svn clone "$svnrepo" work$N.git &&
	(
		cd work$N.git &&
		echo 1 >> file && git commit -am "commit change $N.1" &&
		echo 2 >> file && git commit -am "commit change $N.2" &&
		echo 3 >> file && git commit -am "commit change $N.3" &&
		# should fail to dcommit 2nd and 3rd change
		# but still should leave the repository in reasonable state
		test_must_fail git svn dcommit &&
		git update-index --refresh &&
		git show HEAD~2   | grep -q git-svn-id &&
		! git show HEAD~1 | grep -q git-svn-id &&
		! git show HEAD   | grep -q git-svn-id
	)

Committing transaction...
Committed r14
	A	b3file
Checking svn:mergeinfo changes since r13: 2 sources, 1 changed
Committed revision 1.
Committing transaction...
Index mismatch: 4d5fcadc293a348e88f777dc0920f11e7d71441c != 4e126a1a1821dd5763468eb219c1ecdb6f7f0fda
rereading 92c2c3a52f5dcdb2b6d1e7ac5a3be43b91a14d4e
Found merge parent (/branches/svnb3:4,9): 6f63d1e324e6e86e4942154ab211e25b9360d53a
Committed revision 2.
	A	baz
r14 = 821d65c0d6d4935ecf4514260971d99c2dc429c0 (refs/remotes/origin/svnb1)
Checked out revision 2.
No changes between 33e98298ed114d21282d141a78e6d7c26e0d27c9 and refs/remotes/origin/svnb1
Resetting to the latest refs/remotes/origin/svnb1
r6 = f631f2215d94ada1bbcab23504ef2efd50f4e109 (refs/remotes/origin/trunk)
A         foo
ok 4 - merge another branch

expecting success: 
	mergeinfo=$(svn_cmd propget svn:mergeinfo "$svnrepo"/branches/svnb1) &&
	test "$mergeinfo" = "/branches/svnb2:3,8
/branches/svnb3:4,9"
	
	A	bar
Checking svn:mergeinfo changes since r6: 1 sources, 1 changed
ok 5 - check primary parent mergeinfo respected

expecting success: 
	git merge --no-ff origin/svnb4 &&
	git svn dcommit
	
Merging:
821d65c Merge remote-tracking branch 'origin/svnb3' into HEAD
virtual origin/svnb4
found 1 common ancestor:
31646a6 Base commit
Merge made by the 'recursive' strategy.
 b4file | 0
 b5file | 0
 2 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 b4file
 create mode 100644 b5file
Adding         foo
Transmitting file data .done
Committing transaction...
Found merge parent (/branches/branch1:4-6): f8d343c3715818efa255708a0e8e4640de849c58
r7 = 41efb56413098e836644944944823ddb74ad81f9 (refs/remotes/origin/trunk)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9164-git-svn-dcommit-concurrent/work1.git/.git/
Committed revision 3.
Committing transaction...
ok 4 - reset and fetch gets the SVN merge (m) correctly

# passed all 4 test(s)
1..4
*** t9166-git-svn-fetch-merge-branch-of-branch2.sh ***
	A	auto_updated_file
	A	file
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9166-git-svn-fetch-merge-branch-of-branch2/.git/
r1 = 81bef992ba6728ca52cc14227fafed83977a58c1 (refs/remotes/git-svn)
Committed revision 4.
At revision 4.
	M	file
A         bar
r2 = 418f45ddd614e4555be79d8eac201a8096b64461 (refs/remotes/git-svn)
	M	auto_updated_file
r3 = 8b9e0ba58b7c3a36d69be3fd31d0ce333ff93b40 (refs/remotes/git-svn)
Adding         bar
Transmitting file data .done
Committing transaction...
	M	file
r4 = 7aadf4a990c4abb24fff392994f0882431f5a830 (refs/remotes/git-svn)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9164-git-svn-dcommit-concurrent/svnrepo r4
[master a809fef] commit change 1.1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master 73bf907] commit change 1.2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master 6663c80] commit change 1.3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
expecting success: 
	svn_cmd mkdir -m x "$svnrepo"/trunk &&
	svn_cmd mkdir -m x "$svnrepo"/branches &&
	svn_cmd co "$svnrepo"/trunk "$SVN_TREE" &&
	(
		cd "$SVN_TREE" &&
		touch foo &&
		svn_cmd add foo &&
		svn_cmd commit -m "initial commit" &&
		svn_cmd cp -m branch "$svnrepo"/trunk "$svnrepo"/branches/branch1 &&
		svn_cmd switch "$svnrepo"/branches/branch1 &&
		touch bar &&
		svn_cmd add bar &&
		svn_cmd commit -m branch1 &&
		svn_cmd cp -m branch "$svnrepo"/branches/branch1 "$svnrepo"/branches/branch2 &&
		svn_cmd switch "$svnrepo"/branches/branch2 &&
		touch baz &&
		svn_cmd add baz &&
		svn_cmd commit -m branch2 &&
		svn_cmd switch "$svnrepo"/trunk &&
		svn_cmd merge --reintegrate "$svnrepo"/branches/branch2 &&
		svn_cmd commit -m "merge branch2"
	) &&
	rm -rf "$SVN_TREE"

Committed revision 5.
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9161-git-svn-mergeinfo-push/svnrepo/branches/svnb1 ...
Committing transaction...
Committing transaction...
Committed revision 1.
	A	b4file
	A	b5file
Committed revision 6.
At revision 6.
A         baz
Committing transaction...
Adding         baz
Transmitting file data .Committed r15
done
Committing transaction...
	A	b4file
	A	b5file
Checking svn:mergeinfo changes since r14: 4 sources, 2 changed
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9164-git-svn-dcommit-concurrent/svnrepo ...
Committed revision 2.
Checked out revision 2.
Committed revision 7.
A         foo
D    baz
D    bar
Updated to revision 7.
A         bar2
Adding         foo
	M	file
Transmitting file data .done
Committing transaction...
Found merge parent (/branches/svnb4:5-6,10-12): d477328c0dbb4b75a1e52fcbdd7f435e8251ab49
Adding         bar2
Transmitting file data .done
Committing transaction...
Found merge parent (/branches/svnb5:6,11): 538d7280db0ae5029bb36348be384e01ef4171a7
r15 = 7a1447427ddcf2cf56b9cb429258f610930f3ded (refs/remotes/origin/svnb1)
No changes between 10588d7cdeb956aaaed0a9b51a695deb4fd6bf12 and refs/remotes/origin/svnb1
Resetting to the latest refs/remotes/origin/svnb1
ok 6 - merge existing merge

expecting success: 
	mergeinfo=$(svn_cmd propget svn:mergeinfo "$svnrepo"/branches/svnb1) &&
	test "$mergeinfo" = "/branches/svnb2:3,8
/branches/svnb3:4,9
/branches/svnb4:5-6,10-12
/branches/svnb5:6,11"
	
ok 7 - check both parents' mergeinfo respected

expecting success: 
	git checkout origin/svnb2 &&
	touch newb2file &&
	git add newb2file &&
	git commit -m "later b2 commit" &&
	touch newb2file-2 &&
	git add newb2file-2 &&
	git commit -m "later b2 commit 2" &&
	git svn dcommit
	
Previous HEAD position was 7a14474... Merge remote-tracking branch 'origin/svnb4' into HEAD
HEAD is now at a7d16ae... b2 commit
[detached HEAD 0a07c38] later b2 commit
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 newb2file
[detached HEAD 6bdd285] later b2 commit 2
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 newb2file-2
Committed revision 3.
Committed r5
Committed revision 8.
D    bar2
A    bar
A    baz
Updated to revision 8.
	M	file
Committing transaction...
r5 = 4166bae3a35456dfe53fbdf2b94d4aa429f226d2 (refs/remotes/git-svn)
--- Merging r4 through r8 into '.':
A    bar2
--- Recording mergeinfo for merge of r4 through r8 into '.':
 U   .
Sending        .
Adding         bar2
Committing transaction...
	M	file
Committed revision 4.

ERROR from SVN:
A repository hook failed: Commit blocked by pre-commit hook (exit code 1) with no output.
W: 6663c80c48d98528871796ac6e799b755f1ca780 and refs/remotes/git-svn differ, using rebase:
:100644 100644 fb014dd41485c73acf40cd9548cd4cd812fee4ec e6ac0ef8373861d92d8eecf8d88e592606a70872 M	file
At revision 4.
A         bar
First, rewinding head to replay your work on top of it...
Applying: commit change 1.2
Applying: commit change 1.3
Committed revision 9.
ERROR: Not all changes have been committed into SVN, however the committed
ones (if any) seem to be successfully integrated into the working tree.
Please see the above messages for details.

ok 4 - dcommit error handling

expecting success: 
	setup_hook post-commit 2 &&
	next_N && git svn clone "$svnrepo" work$N.git &&
	(
		cd work$N.git &&
		echo 1 >> file && git commit -am "commit change $N.1" &&
		echo 2 >> file && git commit -am "commit change $N.2" &&
		echo 3 >> file && git commit -am "commit change $N.3" &&
		# should rebase and leave the repository in reasonable state
		git svn dcommit &&
		git update-index --refresh &&
		check_contents &&
		git show HEAD~3 | grep -q git-svn-id &&
		git show HEAD~2 | grep -q git-svn-id &&
		git show HEAD~1 | grep -q auto-committing &&
		git show HEAD   | grep -q git-svn-id
	)

D    bar
D    baz
 U   .
Adding         bar
Updated to revision 9.
Transmitting file data .done
Committing transaction...
--- Merging differences between repository URLs into '.':
A    bar
A    baz
--- Recording mergeinfo for merge between repository URLs into '.':
 U   .
Sending        .
Committed revision 5.
Adding         bar
Adding         baz
Committing transaction...
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9161-git-svn-mergeinfo-push/svnrepo/branches/svnb2 ...
Committing transaction...
Committed revision 10.
ok 1 - initialize source svn repo

expecting success: 
	git svn init -s "$svnrepo" &&
	git svn fetch

	A	newb2file
Committed revision 6.
At revision 6.
A         baz
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9164-git-svn-dcommit-concurrent/work2.git/.git/
Committed r16
Adding         baz
Transmitting file data .done
Committing transaction...
	A	newb2file
r16 = 21da7e37ba25d2b46ac71b3dd98d2c7921d53939 (refs/remotes/origin/svnb2)
	A	auto_updated_file
	A	file
r1 = 81bef992ba6728ca52cc14227fafed83977a58c1 (refs/remotes/git-svn)
Committed revision 7.
	M	file
	A	newb2file-2
D    baz
r2 = 418f45ddd614e4555be79d8eac201a8096b64461 (refs/remotes/git-svn)
D    bar
Updated to revision 7.
	M	auto_updated_file
--- Merging differences between repository URLs into '.':
A    bar
A    baz
--- Recording mergeinfo for merge between repository URLs into '.':
 U   .
r3 = 8b9e0ba58b7c3a36d69be3fd31d0ce333ff93b40 (refs/remotes/git-svn)
Sending        .
	M	file
r4 = 7aadf4a990c4abb24fff392994f0882431f5a830 (refs/remotes/git-svn)
	M	file
Committed r17
r5 = 4166bae3a35456dfe53fbdf2b94d4aa429f226d2 (refs/remotes/git-svn)
Adding         bar
Adding         baz
Committing transaction...
	A	newb2file-2
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9164-git-svn-dcommit-concurrent/svnrepo r5
r17 = 98c66d89d29442d57152dbe3be044676804ab319 (refs/remotes/origin/svnb2)
No changes between 6bdd285369f13bb8d2b68fbcb18709d1d0436be9 and refs/remotes/origin/svnb2
Resetting to the latest refs/remotes/origin/svnb2
[master f5af0e9] commit change 2.1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master 54c2d75] commit change 2.2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master 8e0bd4d] commit change 2.3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 8 - make further commits to branch

expecting success: 
	git checkout origin/svnb1 &&
	git merge --no-ff origin/svnb2 &&
	git svn dcommit
	
Previous HEAD position was 98c66d8... later b2 commit 2
HEAD is now at 7a14474... Merge remote-tracking branch 'origin/svnb4' into HEAD
Merging:
7a14474 Merge remote-tracking branch 'origin/svnb4' into HEAD
virtual origin/svnb2
found 1 common ancestor:
a7d16ae b2 commit
Merge made by the 'recursive' strategy.
 newb2file   | 0
 newb2file-2 | 0
 2 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 newb2file
 create mode 100644 newb2file-2
Committed revision 8.
ok 1 - initialize source svn repo

expecting success: 
	git svn init -s "$svnrepo" &&
	git svn fetch

r1 = ca8e6eeb62216b7d8d5eefd951e6340afb79a5b8 (refs/remotes/origin/trunk)
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9164-git-svn-dcommit-concurrent/svnrepo ...
	A	foo
r3 = 5db25e003aebfe386a90bfe17f3f5e7650550b73 (refs/remotes/origin/trunk)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9165-git-svn-fetch-merge-branch-of-branch/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9165-git-svn-fetch-merge-branch-of-branch/svnrepo/branches/branch1, 3
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9161-git-svn-mergeinfo-push/svnrepo/branches/svnb1 ...
Found branch parent: (refs/remotes/origin/branch1) 5db25e003aebfe386a90bfe17f3f5e7650550b73
Following parent with do_switch
	M	file
Successfully followed parent
r4 = 8d6df0a20f2ba618f1c29bb2a90d2db2c5624957 (refs/remotes/origin/branch1)
	A	bar
r5 = 89be2b2b2bc707422759a53368b8990952233d1a (refs/remotes/origin/branch1)
Committed r6
	A	newb2file
	A	newb2file-2
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9165-git-svn-fetch-merge-branch-of-branch/svnrepo/branches/branch1 => file:///«PKGBUILDDIR»/t/trash%20directory.t9165-git-svn-fetch-merge-branch-of-branch/svnrepo/branches/branch2, 5
	M	file
Found branch parent: (refs/remotes/origin/branch2) 89be2b2b2bc707422759a53368b8990952233d1a
r6 = a4ed9e4e15ebbf8bcf2488188ca0326582ede274 (refs/remotes/git-svn)
Following parent with do_switch
Successfully followed parent
Committed r18
r6 = 5ecc3507ab247f519f5783b89adfe707b145851b (refs/remotes/origin/branch2)
	A	newb2file
	A	newb2file-2
	M	file
Checking svn:mergeinfo changes since r15: 4 sources, 1 changed
	A	baz
r7 = 4ba89de1d405bafcd0c7f33aaee4cef563787bb2 (refs/remotes/origin/branch2)
	A	bar2
r8 = cf1d19c0c0def0d0c3d3d9a974c3b96b99c1f505 (refs/remotes/origin/trunk)
	A	bar2
Checking svn:mergeinfo changes since r7: 1 sources, 1 changed
Found merge parent (/trunk:4-8): cf1d19c0c0def0d0c3d3d9a974c3b96b99c1f505
Found merge parent (/branches/svnb2:8,16-17): 98c66d89d29442d57152dbe3be044676804ab319
r9 = cefffecc3d5ede52556dd0f0be3d497834d153c0 (refs/remotes/origin/branch2)
r18 = 885f27c21746686e2da9a8d90a03b1a501d94160 (refs/remotes/origin/svnb1)
No changes between 8b5db43eaabcf9074202abd7147eb85c5ccd3d45 and refs/remotes/origin/svnb1
Resetting to the latest refs/remotes/origin/svnb1
	A	bar
	A	baz
Checking svn:mergeinfo changes since r8: 2 sources, 2 changed
ok 9 - second forward merge

expecting success: 
	mergeinfo=$(svn_cmd propget svn:mergeinfo "$svnrepo"/branches/svnb1) &&
	test "$mergeinfo" = "/branches/svnb2:3,8,16-17
/branches/svnb3:4,9
/branches/svnb4:5-6,10-12
/branches/svnb5:6,11"
	
r1 = fc693029293ac626312b780fa88ba2ff4fcc8b40 (refs/remotes/origin/trunk)
ok 10 - check new mergeinfo added

expecting success: 
	git checkout origin/svnb4 &&
	git merge --no-ff origin/svnb1 &&
	git svn dcommit
	
Previous HEAD position was 885f27c... Merge remote-tracking branch 'origin/svnb2' into HEAD
HEAD is now at d477328... Merge remote-tracking branch 'svnb5' into HEAD
Merging:
d477328 Merge remote-tracking branch 'svnb5' into HEAD
virtual origin/svnb1
found 1 common ancestor:
d477328 Merge remote-tracking branch 'svnb5' into HEAD
Merge made by the 'recursive' strategy.
 b1file      | 0
 b2file      | 0
 b3file      | 0
 newb2file   | 0
 newb2file-2 | 0
 5 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 b1file
 create mode 100644 b2file
 create mode 100644 b3file
 create mode 100644 newb2file
 create mode 100644 newb2file-2
Committed r7
	A	foo
Found merge parent (/branches/branch1:4-5): 89be2b2b2bc707422759a53368b8990952233d1a
r3 = 546eaf80a32b7f42994a68c1cd51e942aeffa500 (refs/remotes/origin/trunk)
Found merge parent (/branches/branch2:6-9): cefffecc3d5ede52556dd0f0be3d497834d153c0
	M	file
r7 = 7bf50464b594c0ccebe33d61b21b970aac055944 (refs/remotes/git-svn)
r10 = 376fa33b53a40f8e7b805ef69c2afc59546a1b20 (refs/remotes/origin/trunk)
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9166-git-svn-fetch-merge-branch-of-branch2/svnrepo/trunk => file:///«PKGBUILDDIR»/t/trash%20directory.t9166-git-svn-fetch-merge-branch-of-branch2/svnrepo/branches/branch1, 3
	M	auto_updated_file
Found branch parent: (refs/remotes/origin/branch1) 546eaf80a32b7f42994a68c1cd51e942aeffa500
r8 = 7875a6e9d54a385095f45a45ae773941cc814463 (refs/remotes/git-svn)
Following parent with do_switch
W: 54c2d75d55cdac212c666edfca552998f1677cfd and refs/remotes/git-svn differ, using rebase:
:100644 100644 a6c1b013520d4952e6637e49c00c903f456917d4 da123e7ee26ff31acf08ef966cd294afbd3463c5 M	auto_updated_file
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9165-git-svn-fetch-merge-branch-of-branch/svnrepo/trunk r10
Successfully followed parent
First, rewinding head to replay your work on top of it...
r4 = fcf16f62f8015c5315aaa54a879b7b4d8b09be95 (refs/remotes/origin/branch1)
Applying: commit change 2.3
	A	bar
r5 = a363d4025bb4928b9f9e534d19a8da1a6c357a7d (refs/remotes/origin/branch1)
ok 2 - clone svn repo

expecting success: x=$(git rev-parse HEAD^2) &&
	y=$(git rev-parse origin/branch2) &&
	test "x$x" = "x$y"

ok 3 - verify merge commit

# passed all 3 test(s)
1..3
*** t9167-git-svn-cmd-branch-subproject.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9167-git-svn-cmd-branch-subproject/.git/
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9166-git-svn-fetch-merge-branch-of-branch2/svnrepo/branches/branch1 => file:///«PKGBUILDDIR»/t/trash%20directory.t9166-git-svn-fetch-merge-branch-of-branch2/svnrepo/branches/branch2, 5
Found branch parent: (refs/remotes/origin/branch2) a363d4025bb4928b9f9e534d19a8da1a6c357a7d
Following parent with do_switch
	M	file
Successfully followed parent
r6 = 8fab58306838f08151f313752f2ae0491b091565 (refs/remotes/origin/branch2)
	A	baz
Committed r9
r7 = 392272a6122a8b0a1969725e0ceb0c5e660411ef (refs/remotes/origin/branch2)
	M	file
	A	bar
	A	baz
Checking svn:mergeinfo changes since r3: 2 sources, 2 changed
r9 = 60be0f3071e237f99130a471ad1631075a3e8d99 (refs/remotes/git-svn)
No changes between 3f2327b9febeab54310c74d52b286d914ea56a6b and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
expecting success: 
	mkdir import &&
	(
		cd import &&
		mkdir -p trunk/project branches tags &&
		(
			cd trunk/project &&
			echo foo > foo
		) &&
		svn_cmd import -m "import for git-svn" . "$svnrepo" >/dev/null
	) &&
	rm -rf import &&
	svn_cmd co "$svnrepo"/trunk/project trunk/project &&
	(
		cd trunk/project &&
		echo bar >> foo &&
		svn_cmd ci -m "updated trunk"
	) &&
	rm -rf trunk

Updating '.':
U    file
U    auto_updated_file
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9161-git-svn-mergeinfo-push/svnrepo/branches/svnb4 ...
Updated to revision 9.
ok 5 - dcommit concurrent change in non-changed file

expecting success: 
	setup_hook post-commit 2 &&
	next_N && git svn clone "$svnrepo" work$N.git &&
	(
		cd work$N.git &&
		cat file >> auto_updated_file &&
			git commit -am "commit change $N.1" &&
		delete_first_line auto_updated_file &&
			git commit -am "commit change $N.2" &&
		delete_first_line auto_updated_file &&
			git commit -am "commit change $N.3" &&
		# should rebase and leave the repository in reasonable state
		git svn dcommit &&
		git update-index --refresh &&
		check_contents &&
		git show HEAD~3 | grep -q git-svn-id &&
		git show HEAD~2 | grep -q git-svn-id &&
		git show HEAD~1 | grep -q auto-committing &&
		git show HEAD   | grep -q git-svn-id
	)

Found merge parent (/branches/branch1:4-5): a363d4025bb4928b9f9e534d19a8da1a6c357a7d
Found merge parent (/branches/branch2:6-7): 392272a6122a8b0a1969725e0ceb0c5e660411ef
r8 = a0baf65c4b395e03ce2a8bd9d536d7991c6dc14d (refs/remotes/origin/trunk)
A    trunk/project/foo
Checked out revision 1.
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9166-git-svn-fetch-merge-branch-of-branch2/svnrepo/trunk r8
	A	b1file
	A	b2file
	A	b3file
Sending        foo
Transmitting file data .	A	newb2file
done
Committing transaction...
	A	newb2file-2
ok 2 - clone svn repo

expecting success: x=$(git rev-parse HEAD^2) &&
	y=$(git rev-parse origin/branch2) &&
	test "x$x" = "x$y"

ok 3 - verify merge commit

# passed all 3 test(s)
1..3
*** t9200-git-cvsexportcommit.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/.git/
Committed revision 2.
ok 1 - initialize svnrepo

expecting success: 
	git svn init --trunk=trunk/project --branches=branches/*/project \
		--tags=tags/*/project "$svnrepo" &&
	git svn fetch &&
	git checkout remotes/origin/trunk

Committed r19
expecting success: mkdir A B C D E F &&
     echo hello1 >A/newfile1.txt &&
     echo hello2 >B/newfile2.txt &&
     cp "$TEST_DIRECTORY"/test-binary-1.png C/newfile3.png &&
     cp "$TEST_DIRECTORY"/test-binary-1.png D/newfile4.png &&
     git add A/newfile1.txt &&
     git add B/newfile2.txt &&
     git add C/newfile3.png &&
     git add D/newfile4.png &&
     git commit -a -m "Test: New file" &&
     id=$(git rev-list --max-count=1 HEAD) &&
     (cd "$CVSWORK" &&
     git cvsexportcommit -c $id &&
     check_entries A "newfile1.txt/1.1/" &&
     check_entries B "newfile2.txt/1.1/" &&
     check_entries C "newfile3.png/1.1/-kb" &&
     check_entries D "newfile4.png/1.1/-kb" &&
     test_cmp A/newfile1.txt ../A/newfile1.txt &&
     test_cmp B/newfile2.txt ../B/newfile2.txt &&
     test_cmp C/newfile3.png ../C/newfile3.png &&
     test_cmp D/newfile4.png ../D/newfile4.png
     )
	A	b1file
	A	b2file
	A	b3file
	A	newb2file
	A	newb2file-2
Checking svn:mergeinfo changes since r12: 4 sources, 3 changed
[master d898ba1] Test: New file
 Author: A U Thor <author@example.com>
 4 files changed, 2 insertions(+)
 create mode 100644 A/newfile1.txt
 create mode 100644 B/newfile2.txt
 create mode 100644 C/newfile3.png
 create mode 100644 D/newfile4.png
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9164-git-svn-dcommit-concurrent/work3.git/.git/
Checking if patch will apply
Applying
Patch applied successfully. Adding new files and directories to CVS
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/D put under version control
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/C put under version control
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/B put under version control
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/A put under version control
cvs add: scheduling file `A/newfile1.txt' for addition
cvs add: use `cvs commit' to add this file permanently
cvs add: scheduling file `B/newfile2.txt' for addition
cvs add: use `cvs commit' to add this file permanently
cvs add: scheduling file `C/newfile3.png' for addition
cvs add: use `cvs commit' to add this file permanently
cvs add: scheduling file `D/newfile4.png' for addition
cvs add: use `cvs commit' to add this file permanently
Commit to CVS
Patch title (first comment line): Test: New file
Autocommit
  cvs commit -F .msg 'A/newfile1.txt' 'B/newfile2.txt' 'C/newfile3.png' 'D/newfile4.png'
	A	auto_updated_file
	A	file
r1 = 81bef992ba6728ca52cc14227fafed83977a58c1 (refs/remotes/git-svn)
	M	file
Found merge parent (/branches/svnb1:2-4,7-9,13-18): 885f27c21746686e2da9a8d90a03b1a501d94160
r2 = 418f45ddd614e4555be79d8eac201a8096b64461 (refs/remotes/git-svn)
	M	auto_updated_file
Found merge parent (/branches/svnb2:3,8,16-17): 98c66d89d29442d57152dbe3be044676804ab319
r3 = 8b9e0ba58b7c3a36d69be3fd31d0ce333ff93b40 (refs/remotes/git-svn)
Found merge parent (/branches/svnb3:4,9): 6f63d1e324e6e86e4942154ab211e25b9360d53a
	M	file
r4 = 7aadf4a990c4abb24fff392994f0882431f5a830 (refs/remotes/git-svn)
r19 = 452188a8105d77f6c3630c2a73dc3472a6fc8434 (refs/remotes/origin/svnb4)
No changes between 3ea31dd416020408738e12b020f4fca04a495056 and refs/remotes/origin/svnb4
Resetting to the latest refs/remotes/origin/svnb4
	M	file
r5 = 4166bae3a35456dfe53fbdf2b94d4aa429f226d2 (refs/remotes/git-svn)
ok 11 - reintegration merge

expecting success: 
	mergeinfo=$(svn_cmd propget svn:mergeinfo "$svnrepo"/branches/svnb4) &&
	test "$mergeinfo" = "/branches/svnb1:2-4,7-9,13-18
/branches/svnb2:3,8,16-17
/branches/svnb3:4,9
/branches/svnb5:6,11"
	
ok 12 - check reintegration mergeinfo

expecting success: 
	git checkout origin/svnb1 &&
	touch anotherfile &&
	git add anotherfile &&
	git commit -m "a commit" &&
	git merge origin/svnb4 &&
	git svn dcommit
	
Previous HEAD position was 452188a... Merge remote-tracking branch 'origin/svnb1' into HEAD
HEAD is now at 885f27c... Merge remote-tracking branch 'origin/svnb2' into HEAD
	M	file
[detached HEAD e582033] a commit
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 anotherfile
Merging:
e582033 a commit
virtual origin/svnb4
found 1 common ancestor:
885f27c Merge remote-tracking branch 'origin/svnb2' into HEAD
Already up-to-date!
Merge made by the 'recursive' strategy.
r6 = a4ed9e4e15ebbf8bcf2488188ca0326582ede274 (refs/remotes/git-svn)
	M	file
/«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/A/newfile1.txt,v  <--  A/newfile1.txt
initial revision: 1.1
/«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/B/newfile2.txt,v  <--  B/newfile2.txt
initial revision: 1.1
/«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/C/newfile3.png,v  <--  C/newfile3.png
initial revision: 1.1
/«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/D/newfile4.png,v  <--  D/newfile4.png
initial revision: 1.1
Committed successfully to CVS
r7 = 7bf50464b594c0ccebe33d61b21b970aac055944 (refs/remotes/git-svn)
ok 1 - New file

expecting success: echo Hello1 >>A/newfile1.txt &&
     rm -f B/newfile2.txt &&
     rm -f C/newfile3.png &&
     echo Hello5  >E/newfile5.txt &&
     cp "$TEST_DIRECTORY"/test-binary-2.png D/newfile4.png &&
     cp "$TEST_DIRECTORY"/test-binary-1.png F/newfile6.png &&
     git add E/newfile5.txt &&
     git add F/newfile6.png &&
     git commit -a -m "Test: Remove, add and update" &&
     id=$(git rev-list --max-count=1 HEAD) &&
     (cd "$CVSWORK" &&
     git cvsexportcommit -c $id &&
     check_entries A "newfile1.txt/1.2/" &&
     check_entries B "" &&
     check_entries C "" &&
     check_entries D "newfile4.png/1.2/-kb" &&
     check_entries E "newfile5.txt/1.1/" &&
     check_entries F "newfile6.png/1.1/-kb" &&
     test_cmp A/newfile1.txt ../A/newfile1.txt &&
     test_cmp D/newfile4.png ../D/newfile4.png &&
     test_cmp E/newfile5.txt ../E/newfile5.txt &&
     test_cmp F/newfile6.png ../F/newfile6.png
     )
	M	auto_updated_file
[master 3e0d87d] Test: Remove, add and update
 Author: A U Thor <author@example.com>
 6 files changed, 2 insertions(+), 1 deletion(-)
 delete mode 100644 B/newfile2.txt
 delete mode 100644 C/newfile3.png
 rewrite D/newfile4.png (99%)
 create mode 100644 E/newfile5.txt
 copy D/newfile4.png => F/newfile6.png (100%)
r8 = 7875a6e9d54a385095f45a45ae773941cc814463 (refs/remotes/git-svn)
	M	file
r9 = 60be0f3071e237f99130a471ad1631075a3e8d99 (refs/remotes/git-svn)
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9164-git-svn-dcommit-concurrent/svnrepo r9
[master 072dedc] commit change 3.1
 Author: A U Thor <author@example.com>
 1 file changed, 7 insertions(+)
[master c514fe6] commit change 3.2
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
Checking if patch will apply
[master 1f5758f] commit change 3.3
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
Applying
Patch applied successfully. Adding new files and directories to CVS
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/F put under version control
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/E put under version control
cvs add: scheduling file `E/newfile5.txt' for addition
cvs add: use `cvs commit' to add this file permanently
cvs add: scheduling file `F/newfile6.png' for addition
cvs add: use `cvs commit' to add this file permanently
cvs remove: scheduling `B/newfile2.txt' for removal
cvs remove: use `cvs commit' to remove this file permanently
cvs remove: scheduling `C/newfile3.png' for removal
cvs remove: use `cvs commit' to remove this file permanently
Commit to CVS
Patch title (first comment line): Test: Remove, add and update
Autocommit
  cvs commit -F .msg 'A/newfile1.txt' 'B/newfile2.txt' 'C/newfile3.png' 'D/newfile4.png' 'E/newfile5.txt' 'F/newfile6.png'
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9161-git-svn-mergeinfo-push/svnrepo/branches/svnb1 ...
	A	foo
r1 = 6865b4b9f187645a44ce3d56c68ec1b8ba7b1134 (refs/remotes/origin/trunk)
/«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/A/newfile1.txt,v  <--  A/newfile1.txt
new revision: 1.2; previous revision: 1.1
/«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/B/newfile2.txt,v  <--  B/newfile2.txt
new revision: delete; previous revision: 1.1
/«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/C/newfile3.png,v  <--  C/newfile3.png
new revision: delete; previous revision: 1.1
/«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/D/newfile4.png,v  <--  D/newfile4.png
new revision: 1.2; previous revision: 1.1
/«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/E/newfile5.txt,v  <--  E/newfile5.txt
initial revision: 1.1
/«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/F/newfile6.png,v  <--  F/newfile6.png
initial revision: 1.1
Committed successfully to CVS
	M	foo
r2 = 270fecf238e4a92f63725728742820e3065d2de3 (refs/remotes/origin/trunk)
ok 2 - Remove two files, add two and update two

expecting success: cat F/newfile6.png >>D/newfile4.png &&
     git commit -a -m "generatiion 1" &&
     cat F/newfile6.png >>D/newfile4.png &&
     git commit -a -m "generation 2" &&
     id=$(git rev-list --max-count=1 HEAD) &&
     (cd "$CVSWORK" &&
     test_must_fail git cvsexportcommit -c $id
     )
[master 3d0984a] generatiion 1
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
[master 6c6b54b] generation 2
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
	A	anotherfile
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9167-git-svn-cmd-branch-subproject/svnrepo/trunk/project r2
Note: checking out 'remotes/origin/trunk'.

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 270fecf... updated trunk
ok 2 - import into git

expecting success: 
	test_must_fail git svn branch a &&
	git svn branch --parents a &&
	test_must_fail git svn branch -t tag1 &&
	git svn branch --parents -t tag1 &&
	test_must_fail git svn branch --tag tag2 &&
	git svn branch --parents --tag tag2 &&
	test_must_fail git svn tag tag3 &&
	git svn tag --parents tag3

Committed r20
Checking if patch will apply
Applying
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9164-git-svn-dcommit-concurrent/svnrepo ...
error: the patch applies to 'D/newfile4.png' (ac22ccbd3ee9f03a3b38249ac8efdbe96b5da2cd), which does not match the current contents.
error: D/newfile4.png: patch does not apply
cannot patch at /«PKGBUILDDIR»/git-cvsexportcommit line 333.
ok 3 - Fail to change binary more than one generation old

expecting success: git reset --hard HEAD^^ &&
     rm -f D/newfile4.png &&
     git commit -a -m "test: remove only a binary file" &&
     id=$(git rev-list --max-count=1 HEAD) &&
     (cd "$CVSWORK" &&
     git cvsexportcommit -c $id &&
     check_entries A "newfile1.txt/1.2/" &&
     check_entries B "" &&
     check_entries C "" &&
     check_entries D "" &&
     check_entries E "newfile5.txt/1.1/" &&
     check_entries F "newfile6.png/1.1/-kb" &&
     test_cmp A/newfile1.txt ../A/newfile1.txt &&
     test_cmp E/newfile5.txt ../E/newfile5.txt &&
     test_cmp F/newfile6.png ../F/newfile6.png
     )
HEAD is now at 3e0d87d Test: Remove, add and update
[master 91102b5] test: remove only a binary file
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 delete mode 100644 D/newfile4.png
	A	anotherfile
r20 = 84fd54a5c698dc529a52497149a6f9e52b73295b (refs/remotes/origin/svnb1)
	M	auto_updated_file
Checking if patch will apply
Applying
Patch applied successfully. Adding new files and directories to CVS
cvs remove: scheduling `D/newfile4.png' for removal
cvs remove: use `cvs commit' to remove this file permanently
Commit to CVS
Patch title (first comment line): test: remove only a binary file
Autocommit
  cvs commit -F .msg 'D/newfile4.png'
Committed r10
Committed r21
No changes
c52decf9262b667a249a740b378e1ec429602249~1 == c52decf9262b667a249a740b378e1ec429602249
	M	auto_updated_file
Checking svn:mergeinfo changes since r20: 4 sources, 1 changed
/«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/D/newfile4.png,v  <--  D/newfile4.png
new revision: delete; previous revision: 1.2
Committed successfully to CVS
r10 = faeb2677b929c1bb167d01599918610c836a4e65 (refs/remotes/git-svn)
Copying file:///«PKGBUILDDIR»/t/trash%20directory.t9167-git-svn-cmd-branch-subproject/svnrepo/trunk/project at r2 to file:///«PKGBUILDDIR»/t/trash%20directory.t9167-git-svn-cmd-branch-subproject/svnrepo/branches/a/project...
ok 4 - Remove only binary files

expecting success: rm -f A/newfile1.txt &&
     git commit -a -m "test: remove only a binary file" &&
     id=$(git rev-list --max-count=1 HEAD) &&
     (cd "$CVSWORK" &&
     git cvsexportcommit -c $id &&
     check_entries A "" &&
     check_entries B "" &&
     check_entries C "" &&
     check_entries D "" &&
     check_entries E "newfile5.txt/1.1/" &&
     check_entries F "newfile6.png/1.1/-kb" &&
     test_cmp E/newfile5.txt ../E/newfile5.txt &&
     test_cmp F/newfile6.png ../F/newfile6.png
     )
[master ae996f2] test: remove only a binary file
 Author: A U Thor <author@example.com>
 1 file changed, 2 deletions(-)
 delete mode 100644 A/newfile1.txt
Filesystem has no item: File not found: transaction '2-2', path '/branches/a/project' at /«PKGBUILDDIR»/git-svn line 1196.

	M	auto_updated_file
Checking if patch will apply
Applying
Patch applied successfully. Adding new files and directories to CVS
cvs remove: scheduling `A/newfile1.txt' for removal
cvs remove: use `cvs commit' to remove this file permanently
Commit to CVS
Patch title (first comment line): test: remove only a binary file
Autocommit
  cvs commit -F .msg 'A/newfile1.txt'
Found merge parent (/branches/svnb4:10-12,19): 452188a8105d77f6c3630c2a73dc3472a6fc8434
r21 = 137525859027033ca730a1daa0d28e986370fcfd (refs/remotes/origin/svnb1)
No changes between c52decf9262b667a249a740b378e1ec429602249 and refs/remotes/origin/svnb1
Resetting to the latest refs/remotes/origin/svnb1
ok 13 - dcommit a merge at the top of a stack

# passed all 13 test(s)
1..13
*** t9300-fast-import.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9300-fast-import/.git/
expecting success: 
	git fast-import </dev/null

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         0 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          0
pack_report: pack_mmap_calls          =          0
pack_report: pack_open_windows        =          0 /          0
pack_report: pack_mapped              =          0 /          0
---------------------------------------------------------------------

ok 1 - empty stream succeeds

expecting success: git fast-import --export-marks=marks.out <input &&
	 git whatchanged master
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            7 (         0 duplicates                  )
      blobs  :            3 (         0 duplicates          0 deltas of          2 attempts)
      trees  :            1 (         0 duplicates          0 deltas of          1 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            2 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         4 unique    )
      atoms:              3
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          6
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        540 /        540
---------------------------------------------------------------------

commit 5ba2d0485e3e071f4ccbfdb22c474b305ebd159c
Author: C O Mitter <committer@example.com>
Date:   Thu Apr 7 15:13:13 2005 -0700

    initial

:000000 100644 0000000... 7123f7f... A	file2
:000000 100644 0000000... 0d92e9f... A	file3
:000000 100755 0000000... 85df507... A	file4
ok 2 - A: create pack from stdin

expecting success: 
	verify_packs

ok 3 - A: verify pack

expecting success: git cat-file commit master | sed 1d >actual &&
	test_cmp expect actual
ok 4 - A: verify commit

expecting success: git cat-file -p master^{tree} | sed "s/ [0-9a-f]*	/ /" >actual &&
	 test_cmp expect actual
ok 5 - A: verify tree

expecting success: git cat-file blob master:file2 >actual && test_cmp expect actual
ok 6 - A: verify file2

expecting success: git cat-file blob master:file3 >actual && test_cmp expect actual
ok 7 - A: verify file3

expecting success: git cat-file blob master:file4 >actual && test_cmp expect actual
ok 8 - A: verify file4

expecting success: 
	git cat-file tag tags/series-A >actual &&
	test_cmp expect actual

ok 9 - A: verify tag/series-A

expecting success: 
	git cat-file tag tags/series-A-blob >actual &&
	test_cmp expect actual

ok 10 - A: verify tag/series-A-blob

/«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/A/newfile1.txt,v  <--  A/newfile1.txt
new revision: delete; previous revision: 1.2
Committed successfully to CVS
expecting success: test_cmp expect marks.out
ok 11 - A: verify marks output

expecting success: git fast-import \
		--import-marks=marks.out \
		--export-marks=marks.new \
		</dev/null &&
	test_cmp expect marks.new
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         4 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          4
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        540 /        540
---------------------------------------------------------------------

ok 12 - A: verify marks import

expecting success: git fast-import <input &&
	git cat-file tag tags/series-A-blob-2 >actual &&
	git cat-file tag tags/series-A-blob-3 >>actual &&
	test_cmp expect actual
100644 blob 038d718da6a1ebbc6a7780a96ed75a70cc2ad6e2	new_blob
ok 5 - Remove only a text file

expecting success: mkdir "G g" &&
      echo ok then >"G g/with spaces.txt" &&
      git add "G g/with spaces.txt" && \
      cp "$TEST_DIRECTORY"/test-binary-1.png "G g/with spaces.png" && \
      git add "G g/with spaces.png" &&
      git commit -a -m "With spaces" &&
      id=$(git rev-list --max-count=1 HEAD) &&
      (cd "$CVSWORK" &&
      git cvsexportcommit -c $id &&
      check_entries "G g" "with spaces.png/1.1/-kb|with spaces.txt/1.1/"
      )
[master 16ac18c] With spaces
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
 create mode 100644 G g/with spaces.png
 create mode 100644 G g/with spaces.txt
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            5 (         0 duplicates                  )
      blobs  :            1 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            1 (         0 duplicates          0 deltas of          1 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            2 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         1 unique    )
      atoms:              1
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          7
pack_report: pack_mmap_calls          =          2
pack_report: pack_open_windows        =          2 /          2
pack_report: pack_mapped              =        909 /        909
---------------------------------------------------------------------

ok 13 - A: tag blob by sha1

expecting success: git fast-import --import-marks=marks.out <input &&
	 git whatchanged verify--import-marks
Committed r11
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            2 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            1 (         0 duplicates          0 deltas of          1 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         4 unique    )
      atoms:              4
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          8
pack_report: pack_mmap_calls          =          2
pack_report: pack_open_windows        =          2 /          2
pack_report: pack_mapped              =        838 /        838
---------------------------------------------------------------------

commit ac2b62088fe0283163c00fa7856bcd0489cf30de
Author: C O Mitter <committer@example.com>
Date:   Thu Apr 7 15:15:13 2005 -0700

    recreate from :5

:000000 100755 0000000... 7123f7f... A	copy-of-file2

commit 5ba2d0485e3e071f4ccbfdb22c474b305ebd159c
Author: C O Mitter <committer@example.com>
Date:   Thu Apr 7 15:13:13 2005 -0700

    initial

:000000 100644 0000000... 7123f7f... A	file2
:000000 100644 0000000... 0d92e9f... A	file3
:000000 100755 0000000... 85df507... A	file4
ok 14 - A: verify marks import does not crash

expecting success: 
	verify_packs

ok 15 - A: verify pack

expecting success: compare_diff_raw expect actual &&
	 test `git rev-parse --verify master:file2` \
	    = `git rev-parse --verify verify--import-marks:copy-of-file2`
	M	auto_updated_file
ok 16 - A: verify diff

r11 = 75c3d594f15c761bafa1680482b9a82f834217b9 (refs/remotes/git-svn)
expecting success: 
	cat input.blob input.commit | git fast-import --export-marks=marks.large &&
	git ls-tree refs/heads/verify--dump-marks >tree.out &&
	test_cmp tree.exp_s tree.out &&
	test_cmp marks.exp marks.large
Creating parent folder file:///«PKGBUILDDIR»/t/trash%20directory.t9167-git-svn-cmd-branch-subproject/svnrepo/branches/a ...
	M	auto_updated_file
Checking if patch will apply
Applying
Patch applied successfully. Adding new files and directories to CVS
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/G g put under version control
cvs add: scheduling file `G g/with spaces.png' for addition
cvs add: use `cvs commit' to add this file permanently
cvs add: scheduling file `G g/with spaces.txt' for addition
cvs add: use `cvs commit' to add this file permanently
Commit to CVS
Patch title (first comment line): With spaces
Autocommit
  cvs commit -F .msg G g/with spaces.png G g/with spaces.txt
r12 = fb02de9b059c0721cc526c13d5f09b2402cbd770 (refs/remotes/git-svn)
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            3 (        80 duplicates                  )
      blobs  :            1 (        80 duplicates          0 deltas of          0 attempts)
      trees  :            1 (         0 duplicates          0 deltas of          1 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:     1073741824 (        81 unique    )
      atoms:             81
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          2
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        441 /        441
---------------------------------------------------------------------

ok 17 - A: export marks with large values

expecting success: 
    test_must_fail git fast-import <input

W: c514fe6d292f9bf7f5ed8a64ec5492f8e09cd45b and refs/remotes/git-svn differ, using rebase:
:100644 100644 f15b852b48514c06a7270a0147b8f60a40cf2b6e db67815e0a626ed23c09f623f06fea3e6939f72a M	auto_updated_file
fatal: Blob not found: M 755 0000000000000000000000000000000000000001 zero1
fast-import: dumping crash report to .git/fast_import_crash_7778
ok 18 - B: fail on invalid blob sha1

expecting success: git fast-import <input &&
	 test -f .git/TEMP_TAG &&
	 test `git rev-parse master` = `git rev-parse TEMP_TAG^`
First, rewinding head to replay your work on top of it...
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            1 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              3
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          4
pack_report: pack_mmap_calls          =          2
pack_report: pack_open_windows        =          2 /          2
pack_report: pack_mapped              =        724 /        724
---------------------------------------------------------------------

Applying: commit change 3.3
ok 19 - B: accept branch name "TEMP_TAG"

expecting success: 
	git fast-import <input &&
	out=$(git fsck) &&
	echo "$out" &&
	test -z "$out"

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            2 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            1 (         0 duplicates          0 deltas of          0 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          2
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        139 /        139
---------------------------------------------------------------------

warning in tag 103553a16e02d76e288cec0f76240f1ad97caeb9: missingTaggerEntry: invalid format - expected 'tagger' line
warning in tag 42d861d649a1b87eb8083ad1d94d9220ecf2c35f: missingTaggerEntry: invalid format - expected 'tagger' line
warning in tag 3750af27267cae07dd3f8b7a9aac2291e374a66a: missingTaggerEntry: invalid format - expected 'tagger' line
warning in tag 56c14ce987117cf2e391ebef3dbab65e4c1ed202: missingTaggerEntry: invalid format - expected 'tagger' line

ok 20 - B: accept empty committer

expecting success: 
	git fast-import <input &&
	out=$(git fsck) &&
	echo "$out" &&
	test -z "$out"

/«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/G g/with spaces.png,v  <--  G g/with spaces.png
initial revision: 1.1
/«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/G g/with spaces.txt,v  <--  G g/with spaces.txt
initial revision: 1.1
Committed successfully to CVS
ok 6 - New file with spaces in file name

expecting success: echo Ok then >>"G g/with spaces.txt" &&
      cat "$TEST_DIRECTORY"/test-binary-1.png >>"G g/with spaces.png" && \
      git add "G g/with spaces.png" &&
      git commit -a -m "Update with spaces" &&
      id=$(git rev-list --max-count=1 HEAD) &&
      (cd "$CVSWORK" &&
      git cvsexportcommit -c $id
      check_entries "G g" "with spaces.png/1.2/-kb|with spaces.txt/1.2/"
      )
	M	auto_updated_file
Copying file:///«PKGBUILDDIR»/t/trash%20directory.t9167-git-svn-cmd-branch-subproject/svnrepo/trunk/project at r2 to file:///«PKGBUILDDIR»/t/trash%20directory.t9167-git-svn-cmd-branch-subproject/svnrepo/branches/a/project...
[master 5a5ca8f] Update with spaces
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            2 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            1 (         0 duplicates          0 deltas of          0 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          2
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        146 /        146
---------------------------------------------------------------------

warning in tag 103553a16e02d76e288cec0f76240f1ad97caeb9: missingTaggerEntry: invalid format - expected 'tagger' line
warning in tag 42d861d649a1b87eb8083ad1d94d9220ecf2c35f: missingTaggerEntry: invalid format - expected 'tagger' line
warning in tag 3750af27267cae07dd3f8b7a9aac2291e374a66a: missingTaggerEntry: invalid format - expected 'tagger' line
warning in tag 56c14ce987117cf2e391ebef3dbab65e4c1ed202: missingTaggerEntry: invalid format - expected 'tagger' line

ok 21 - B: accept and fixup committer with no name

expecting success: 
	test_must_fail git fast-import <input

fatal: Missing < in ident string: Name email> 1112912233 -0700
fast-import: dumping crash report to .git/fast_import_crash_7914
ok 22 - B: fail on invalid committer (1)

expecting success: 
	test_must_fail git fast-import <input

fatal: Missing > in ident string: Name <e<mail> 1112912233 -0700
fast-import: dumping crash report to .git/fast_import_crash_7919
ok 23 - B: fail on invalid committer (2)

expecting success: 
	test_must_fail git fast-import <input

fatal: Missing space after > in ident string: Name <email>> 1112912233 -0700
fast-import: dumping crash report to .git/fast_import_crash_7924
ok 24 - B: fail on invalid committer (3)

expecting success: 
	test_must_fail git fast-import <input

fatal: Missing > in ident string: Name <email 1112912233 -0700
fast-import: dumping crash report to .git/fast_import_crash_7931
ok 25 - B: fail on invalid committer (4)

expecting success: 
	test_must_fail git fast-import <input

fatal: Missing space before < in ident string: Name<email> 1112912233 -0700
fast-import: dumping crash report to .git/fast_import_crash_7941
ok 26 - B: fail on invalid committer (5)

Checking if patch will apply
Applying
expecting success: git fast-import <input &&
	 git whatchanged branch
Patch applied successfully. Adding new files and directories to CVS
Commit to CVS
Patch title (first comment line): Update with spaces
Autocommit
  cvs commit -F .msg G g/with spaces.png G g/with spaces.txt
Committed r13
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            3 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            2 (         0 duplicates          0 deltas of          2 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              5
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          5
pack_report: pack_mmap_calls          =          2
pack_report: pack_open_windows        =          2 /          2
pack_report: pack_mapped              =       1740 /       1740
---------------------------------------------------------------------

commit fe28762c62291fb256d192177ba8264d159a3872
Author: C O Mitter <committer@example.com>
Date:   Thu Apr 7 15:18:13 2005 -0700

    second

:100644 000000 7123f7f... 0000000... D	file2
:000000 100755 0000000... f1fb5da... A	file2/newf
:000000 100644 0000000... 7123f7f... A	file2/oldf
:100644 000000 0d92e9f... 0000000... D	file3

commit 5ba2d0485e3e071f4ccbfdb22c474b305ebd159c
Author: C O Mitter <committer@example.com>
Date:   Thu Apr 7 15:13:13 2005 -0700

    initial

:000000 100644 0000000... 7123f7f... A	file2
:000000 100644 0000000... 0d92e9f... A	file3
:000000 100755 0000000... 85df507... A	file4
ok 27 - C: incremental import create pack from stdin

expecting success: 
	verify_packs

ok 28 - C: verify pack

expecting success: test $newf = `git rev-parse --verify branch:file2/newf` &&
	 test $oldf = `git rev-parse --verify branch:file2/oldf`
	M	auto_updated_file
ok 29 - C: validate reuse existing blob

expecting success: git cat-file commit branch | sed 1d >actual &&
	 test_cmp expect actual
ok 30 - C: verify commit

expecting success: compare_diff_raw expect actual
r13 = ef460deee795f9033dae3083da67dba388f8806f (refs/remotes/git-svn)
ok 31 - C: validate rename result

expecting success: git fast-import <input &&
	 git whatchanged branch
No changes between 4d91888e5c584c87484759b1fcc5c1b797cd3846 and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            5 (         0 duplicates                  )
      blobs  :            2 (         0 duplicates          0 deltas of          1 attempts)
      trees  :            2 (         0 duplicates          0 deltas of          2 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              5
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          7
pack_report: pack_mmap_calls          =          3
pack_report: pack_open_windows        =          3 /          3
pack_report: pack_mapped              =       2194 /       2194
---------------------------------------------------------------------

commit f3aa51c819f0b3cc0ee594d10afaf6c84d7da579
Author: C O Mitter <committer@example.com>
Date:   Thu Apr 7 15:19:13 2005 -0700

    third

:000000 100755 0000000... e74b7d4... A	newdir/exec.sh
:000000 100644 0000000... fcf778c... A	newdir/interesting

commit fe28762c62291fb256d192177ba8264d159a3872
Author: C O Mitter <committer@example.com>
Date:   Thu Apr 7 15:18:13 2005 -0700

    second

:100644 000000 7123f7f... 0000000... D	file2
:000000 100755 0000000... f1fb5da... A	file2/newf
:000000 100644 0000000... 7123f7f... A	file2/oldf
:100644 000000 0d92e9f... 0000000... D	file3

commit 5ba2d0485e3e071f4ccbfdb22c474b305ebd159c
Author: C O Mitter <committer@example.com>
Date:   Thu Apr 7 15:13:13 2005 -0700

    initial

:000000 100644 0000000... 7123f7f... A	file2
:000000 100644 0000000... 0d92e9f... A	file3
:000000 100755 0000000... 85df507... A	file4
ok 32 - D: inline data in commit

expecting success: 
	verify_packs

Updating '.':
ok 33 - D: verify pack

expecting success: compare_diff_raw expect actual
U    auto_updated_file
Updated to revision 13.
ok 34 - D: validate new files added

expecting success: git cat-file blob branch:newdir/interesting >actual &&
	 test_cmp expect actual
ok 35 - D: verify file5

expecting success: git cat-file blob branch:newdir/exec.sh >actual &&
	 test_cmp expect actual
ok 36 - D: verify file6

expecting success: 
    test_must_fail git fast-import --date-format=raw <input

fatal: Invalid raw date "Tue Feb 6 11:22:18 2007 -0500" in ident: A U Thor <author@example.com> Tue Feb 6 11:22:18 2007 -0500
fast-import: dumping crash report to .git/fast_import_crash_8065
ok 37 - E: rfc2822 date, --date-format=raw

expecting success: git fast-import --date-format=rfc2822 <input
ok 6 - dcommit concurrent non-conflicting change

expecting success: 
	setup_hook post-commit 2 &&
	next_N && git svn clone "$svnrepo" work$N.git &&
	(
		cd work$N.git &&
		cat file >> auto_updated_file &&
			git commit -am "commit change $N.1" &&
		delete_first_line auto_updated_file &&
			git commit -am "commit change $N.2" &&
		delete_first_line auto_updated_file &&
			git commit -am "commit change $N.3" &&
		# should fail as rebase is needed
		test_must_fail git svn dcommit --no-rebase &&
		# but should leave HEAD unchanged
		git update-index --refresh &&
		! git show HEAD~2 | grep -q git-svn-id &&
		! git show HEAD~1 | grep -q git-svn-id &&
		! git show HEAD   | grep -q git-svn-id
	)

Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9167-git-svn-cmd-branch-subproject/svnrepo/trunk/project => file:///«PKGBUILDDIR»/t/trash%20directory.t9167-git-svn-cmd-branch-subproject/svnrepo/branches/a/project, 2
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            1 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              3
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          7
pack_report: pack_mmap_calls          =          3
pack_report: pack_open_windows        =          3 /          3
pack_report: pack_mapped              =        986 /        986
---------------------------------------------------------------------

ok 38 - E: rfc2822 date, --date-format=rfc2822

expecting success: 
	verify_packs

ok 39 - E: verify pack

expecting success: git cat-file commit branch | sed 1,2d >actual &&
	test_cmp expect actual
Found branch parent: (refs/remotes/origin/a) 270fecf238e4a92f63725728742820e3065d2de3
ok 40 - E: verify commit

expecting success: if git fast-import <input
	 then
		echo BAD gfi did not fail
		return 1
	 else
		if test $old_branch = `git rev-parse --verify branch^0`
		then
			: branch unaffected and failure returned
			return 0
		else
			echo BAD gfi changed branch $old_branch
			return 1
		fi
	 fi
	
Following parent with do_switch
warning: Not updating refs/heads/branch (new tip fb7baf16109664b6b1d3b3c98d6c252fa7051ae5 does not contain de5766c434bb93360ee19879605fe31f25cdcf20)
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            1 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           2 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              3
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          8
pack_report: pack_mmap_calls          =          4
pack_report: pack_open_windows        =          4 /          4
pack_report: pack_mapped              =       1180 /       1180
---------------------------------------------------------------------

ok 41 - F: non-fast-forward update skips

expecting success: 
	verify_packs

Successfully followed parent
ok 42 - F: verify pack

expecting success: git cat-file commit other >actual &&
	test_cmp expect actual
ok 43 - F: verify other commit

expecting success: git fast-import --force <input
r4 = ca2fcc0341c2d8b318360d99b5fce4f52bd31522 (refs/remotes/origin/a)
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            1 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              3
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          6
pack_report: pack_mmap_calls          =          3
pack_report: pack_open_windows        =          3 /          3
pack_report: pack_mapped              =        850 /        850
---------------------------------------------------------------------

ok 44 - G: non-fast-forward update forced

expecting success: 
	verify_packs

/«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/G g/with spaces.png,v  <--  G g/with spaces.png
new revision: 1.2; previous revision: 1.1
/«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/G g/with spaces.txt,v  <--  G g/with spaces.txt
new revision: 1.2; previous revision: 1.1
Committed successfully to CVS
ok 7 - Update file with spaces in file name

ok 45 - G: verify pack

expecting success: test $old_branch != `git rev-parse --verify branch^0` &&
	 test $old_branch = `git rev-parse --verify branch@{1}`
ok 46 - G: branch changed, but logged

expecting success: mkdir -p Å/goo/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/å/ä/ö &&
      echo Foo >Å/goo/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/å/ä/ö/gårdetsågårdet.txt &&
      git add Å/goo/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/å/ä/ö/gårdetsågårdet.txt &&
      cp "$TEST_DIRECTORY"/test-binary-1.png Å/goo/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/å/ä/ö/gårdetsågårdet.png &&
      git add Å/goo/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/å/ä/ö/gårdetsågårdet.png &&
      git commit -a -m "Går det så går det" && \
      id=$(git rev-list --max-count=1 HEAD) &&
      (cd "$CVSWORK" &&
      git cvsexportcommit -v -c $id &&
      check_entries \
      "Å/goo/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/å/ä/ö" \
      "gårdetsågårdet.png/1.1/-kb|gårdetsågårdet.txt/1.1/"
      )
expecting success: git fast-import <input &&
	 git whatchanged H
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            6 (         1 duplicates                  )
      blobs  :            1 (         1 duplicates          0 deltas of          1 attempts)
      trees  :            4 (         0 duplicates          0 deltas of          4 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              8
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          6
pack_report: pack_mmap_calls          =          3
pack_report: pack_open_windows        =          3 /          3
pack_report: pack_mapped              =       1020 /       1020
---------------------------------------------------------------------

[master e1e7e7d] Går det så går det
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
 create mode 100644 "\303\205/goo/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/\303\245/\303\244/\303\266/g\303\245rdets\303\245g\303\245rdet.png"
 create mode 100644 "\303\205/goo/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/\303\245/\303\244/\303\266/g\303\245rdets\303\245g\303\245rdet.txt"
commit 8c1bf1b9f891df8805c27a54986e5043829939ad
Author: C O Mitter <committer@example.com>
Date:   Thu Apr 7 15:22:13 2005 -0700

    third

:100755 000000 f1fb5da... 0000000... D	file2/newf
:100644 000000 7123f7f... 0000000... D	file2/oldf
:100755 000000 85df507... 0000000... D	file4
:000000 100644 0000000... fcf778c... A	h/e/l/lo
:100755 000000 e74b7d4... 0000000... D	newdir/exec.sh
:100644 000000 fcf778c... 0000000... D	newdir/interesting

commit f3aa51c819f0b3cc0ee594d10afaf6c84d7da579
Author: C O Mitter <committer@example.com>
Date:   Thu Apr 7 15:19:13 2005 -0700

    third

:000000 100755 0000000... e74b7d4... A	newdir/exec.sh
:000000 100644 0000000... fcf778c... A	newdir/interesting

commit fe28762c62291fb256d192177ba8264d159a3872
Author: C O Mitter <committer@example.com>
Date:   Thu Apr 7 15:18:13 2005 -0700

    second

:100644 000000 7123f7f... 0000000... D	file2
:000000 100755 0000000... f1fb5da... A	file2/newf
:000000 100644 0000000... 7123f7f... A	file2/oldf
:100644 000000 0d92e9f... 0000000... D	file3

commit 5ba2d0485e3e071f4ccbfdb22c474b305ebd159c
Author: C O Mitter <committer@example.com>
Date:   Thu Apr 7 15:13:13 2005 -0700

    initial

:000000 100644 0000000... 7123f7f... A	file2
:000000 100644 0000000... 0d92e9f... A	file3
:000000 100755 0000000... 85df507... A	file4
ok 47 - H: deletall, add 1

expecting success: 
	verify_packs

ok 48 - H: verify pack

expecting success: compare_diff_raw expect actual
ok 49 - H: validate old files removed, new files added

expecting success: git cat-file blob H:h/e/l/lo >actual &&
	 test_cmp expect actual
ok 50 - H: verify file

expecting success: git fast-import --export-pack-edges=edges.list <input
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            1 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              3
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          4
pack_report: pack_mmap_calls          =          3
pack_report: pack_open_windows        =          3 /          3
pack_report: pack_mapped              =        860 /        860
---------------------------------------------------------------------

ok 51 - I: export-pack-edges

expecting success: sed -e s/pack-.*pack/pack-.pack/ edges.list >actual &&
	 test_cmp expect actual
ok 52 - I: verify edge list

expecting success: git fast-import <input
Applying to CVS commit e1e7e7de6be72e4f7239d7d52937ea4a2fb74294 from parent 5a5ca8ff45f0813ba889eef1e592d8a04c1774d6
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            3 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            1 (         0 duplicates          0 deltas of          0 attempts)
      commits:            2 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              3
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          4
pack_report: pack_mmap_calls          =          3
pack_report: pack_open_windows        =          3 /          3
pack_report: pack_mapped              =        965 /        965
---------------------------------------------------------------------

ok 53 - J: reset existing branch creates empty commit

expecting success: test 1 = `git rev-list J | wc -l` &&
	 test 0 = `git ls-tree J | wc -l`
Checking if patch will apply
ok 54 - J: branch has 1 commit, empty tree

expecting success: test_must_fail git fast-import <input
Applying
fatal: Can't tag an empty branch.
fast-import: dumping crash report to .git/fast_import_crash_8280
ok 55 - J: tag must fail on empty branch

Patch applied successfully. Adding new files and directories to CVS
expecting success: git fast-import <input
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å put under version control
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo put under version control
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/a put under version control
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/a/b put under version control
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/a/b/c put under version control
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/a/b/c/d put under version control
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/a/b/c/d/e put under version control
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            2 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            2 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              3
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          7
pack_report: pack_mmap_calls          =          3
pack_report: pack_open_windows        =          3 /          3
pack_report: pack_mapped              =        980 /        980
---------------------------------------------------------------------

ok 56 - K: reinit branch with from

expecting success: test `git rev-parse --verify branch^1` \
		= `git rev-parse --verify K^1`
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/a/b/c/d/e/f put under version control
ok 57 - K: verify K^1 = branch^1

Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/a/b/c/d/e/f/g put under version control
expecting success: git fast-import <input &&
	 git diff-tree --abbrev --raw L^ L >output &&
	 test_cmp expect output
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/a/b/c/d/e/f/g/h put under version control
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/a/b/c/d/e/f/g/h/i put under version control
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/a/b/c/d/e/f/g/h/i/j put under version control
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/a/b/c/d/e/f/g/h/i/j/k put under version control
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/a/b/c/d/e/f/g/h/i/j/k/l put under version control
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m put under version control
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n put under version control
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            8 (         0 duplicates                  )
      blobs  :            2 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            4 (         0 duplicates          0 deltas of          4 attempts)
      commits:            2 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         2 unique    )
      atoms:              4
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          2
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        579 /        579
---------------------------------------------------------------------

Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o put under version control
ok 58 - L: verify internal tree sorting

expecting success: git fast-import <input &&
	git ls-tree L2 g/b/ >tmp &&
	cat tmp | cut -f 2 >actual &&
	test_cmp expect actual &&
	git fsck `git rev-parse L2`
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p put under version control
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q put under version control
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r put under version control
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s put under version control
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t put under version control
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u put under version control
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v put under version control
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w put under version control
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x put under version control
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:           10 (         0 duplicates                  )
      blobs  :            1 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            7 (         0 duplicates          1 deltas of          7 attempts)
      commits:            2 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         1 unique    )
      atoms:              8
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          4
pack_report: pack_mmap_calls          =          2
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        659 /        659
---------------------------------------------------------------------

Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/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 put under version control
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/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 put under version control
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/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/å put under version control
warning in tag 103553a16e02d76e288cec0f76240f1ad97caeb9: missingTaggerEntry: invalid format - expected 'tagger' line
warning in tag 42d861d649a1b87eb8083ad1d94d9220ecf2c35f: missingTaggerEntry: invalid format - expected 'tagger' line
warning in tag 3750af27267cae07dd3f8b7a9aac2291e374a66a: missingTaggerEntry: invalid format - expected 'tagger' line
warning in tag 56c14ce987117cf2e391ebef3dbab65e4c1ed202: missingTaggerEntry: invalid format - expected 'tagger' line
dangling blob 8436d07c4b682e3c824ffae4608920535091c4d0
dangling commit 8cecdab6b3e4062de5b06ad3accf5bff1449e99b
dangling commit 8c1bf1b9f891df8805c27a54986e5043829939ad
dangling tag 103553a16e02d76e288cec0f76240f1ad97caeb9
dangling commit 994b824fbe51b899f546383c3ba14a28a07c1022
dangling commit a53846236402ec769ea7f2fd7632de38e28f3273
dangling commit ac2b62088fe0283163c00fa7856bcd0489cf30de
dangling tag 3750af27267cae07dd3f8b7a9aac2291e374a66a
dangling commit 45b12606bd487d1bc687864db7641b9bfd4ddcd0
dangling tag 42d861d649a1b87eb8083ad1d94d9220ecf2c35f
dangling commit c85b9f480bbc2f7616de78fc96c08204e0f5b70e
dangling tag 56c14ce987117cf2e391ebef3dbab65e4c1ed202
dangling commit d892dc32fa7a52ea3a397cfc4449e9df8a39becf
dangling commit 5cdb3613534ced7561d4baa9c18f92e6f446501c
dangling commit de5766c434bb93360ee19879605fe31f25cdcf20
dangling commit 6b33e55cd592e91710d6c0afef1b0e6e3406a2a7
dangling commit fb7baf16109664b6b1d3b3c98d6c252fa7051ae5
ok 59 - L: nested tree copy does not corrupt deltas

Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/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/å/ä put under version control
expecting success: git fast-import <input &&
	 git diff-tree -M -r M1^ M1 >actual &&
	 compare_diff_raw expect actual
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/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/å/ä/ö put under version control
cvs add: scheduling file `Å/goo/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/å/ä/ö/gårdetsågårdet.png' for addition
cvs add: use `cvs commit' to add this file permanently
cvs add: scheduling file `Å/goo/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/å/ä/ö/gårdetsågårdet.txt' for addition
cvs add: use `cvs commit' to add this file permanently
Commit to CVS
Patch title (first comment line): Går det så går det
Autocommit
  cvs commit -F .msg 'Å/goo/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/å/ä/ö/gårdetsågårdet.png' 'Å/goo/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/å/ä/ö/gårdetsågårdet.txt'
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            3 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            2 (         0 duplicates          0 deltas of          2 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              6
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          7
pack_report: pack_mmap_calls          =          4
pack_report: pack_open_windows        =          4 /          4
pack_report: pack_mapped              =       1346 /       1346
---------------------------------------------------------------------

ok 60 - M: rename file in same subdirectory

expecting success: git fast-import <input &&
	 git diff-tree -M -r M2^ M2 >actual &&
	 compare_diff_raw expect actual
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9164-git-svn-dcommit-concurrent/work4.git/.git/
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            7 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            6 (         0 duplicates          0 deltas of          6 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:             10
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          7
pack_report: pack_mmap_calls          =          4
pack_report: pack_open_windows        =          4 /          4
pack_report: pack_mapped              =       1491 /       1491
---------------------------------------------------------------------

ok 61 - M: rename file to new subdirectory

expecting success: git fast-import <input &&
	 git diff-tree -M -r M3^ M3 >actual &&
	 compare_diff_raw expect actual
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            3 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            2 (         0 duplicates          0 deltas of          2 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              6
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          6
pack_report: pack_mmap_calls          =          2
pack_report: pack_open_windows        =          2 /          2
pack_report: pack_mapped              =        868 /        868
---------------------------------------------------------------------

ok 62 - M: rename subdirectory to new subdirectory

expecting success: git fast-import <input &&
	 git diff-tree -M -r M4^ M4 >actual &&
	 cat actual &&
	 compare_diff_raw expect actual
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            2 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            1 (         0 duplicates          0 deltas of          1 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              5
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          6
pack_report: pack_mmap_calls          =          2
pack_report: pack_open_windows        =          2 /          2
pack_report: pack_mapped              =        737 /        737
---------------------------------------------------------------------

:100644 100644 7123f7f44e39be127c5eb701e5968176ee9d78b1 7123f7f44e39be127c5eb701e5968176ee9d78b1 R100	file2/oldf	sub/file2/oldf
:100755 100755 85df50785d62d3b05ab03d9cbf7e4a0b49449730 85df50785d62d3b05ab03d9cbf7e4a0b49449730 R100	file4	sub/file4
:100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc R100	i/am/new/to/you	sub/i/am/new/to/you
:100755 100755 e74b7d465e52746be2b4bae983670711e6e66657 e74b7d465e52746be2b4bae983670711e6e66657 R100	newdir/exec.sh	sub/newdir/exec.sh
:100644 100644 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 R100	newdir/interesting	sub/newdir/interesting
ok 63 - M: rename root to subdirectory

expecting success: git fast-import <input &&
	 git diff-tree -C --find-copies-harder -r N1^ N1 >actual &&
	 compare_diff_raw expect actual
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            3 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            2 (         0 duplicates          0 deltas of          2 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              6
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          7
pack_report: pack_mmap_calls          =          4
pack_report: pack_open_windows        =          4 /          4
pack_report: pack_mapped              =       1345 /       1345
---------------------------------------------------------------------

	A	auto_updated_file
	A	file
ok 64 - N: copy file in same subdirectory

expecting success: git fast-import <input &&
	 git diff-tree -C --find-copies-harder -r N2^^ N2 >actual &&
	 compare_diff_raw expect actual
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            5 (         1 duplicates                  )
      blobs  :            0 (         1 duplicates          0 deltas of          0 attempts)
      trees  :            3 (         0 duplicates          1 deltas of          3 attempts)
      commits:            2 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              7
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          7
pack_report: pack_mmap_calls          =          4
pack_report: pack_open_windows        =          4 /          4
pack_report: pack_mapped              =       1585 /       1585
---------------------------------------------------------------------

r1 = 81bef992ba6728ca52cc14227fafed83977a58c1 (refs/remotes/git-svn)
ok 65 - N: copy then modify subdirectory

expecting success: git fast-import <input &&
	 test `git rev-parse N2^{tree}` = `git rev-parse N3^{tree}`
Copying file:///«PKGBUILDDIR»/t/trash%20directory.t9167-git-svn-cmd-branch-subproject/svnrepo/trunk/project at r2 to file:///«PKGBUILDDIR»/t/trash%20directory.t9167-git-svn-cmd-branch-subproject/svnrepo/tags/tag1/project...
	M	file
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            1 (         4 duplicates                  )
      blobs  :            0 (         1 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         3 duplicates          0 deltas of          0 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              7
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          7
pack_report: pack_mmap_calls          =          4
pack_report: pack_open_windows        =          4 /          4
pack_report: pack_mapped              =       1166 /       1166
---------------------------------------------------------------------

ok 66 - N: copy dirty subdirectory

expecting success: cat >expect <<-\EOF &&
	:100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc C100	file2/newf	file3/newf
	:100644 100644 7123f7f44e39be127c5eb701e5968176ee9d78b1 7123f7f44e39be127c5eb701e5968176ee9d78b1 C100	file2/oldf	file3/oldf
	EOF
	 subdir=$(git rev-parse refs/heads/branch^0:file2) &&
	 cat >input <<-INPUT_END &&
	commit refs/heads/N4
	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
	data <<COMMIT
	copy by tree hash
	COMMIT

	from refs/heads/branch^0
	M 040000 $subdir file3
	INPUT_END
	 git fast-import <input &&
	 git diff-tree -C --find-copies-harder -r N4^ N4 >actual &&
	 compare_diff_raw expect actual
r2 = 418f45ddd614e4555be79d8eac201a8096b64461 (refs/remotes/git-svn)
/«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/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/å/ä/ö/gårdetsågårdet.png,v  <--  Å/goo/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/å/ä/ö/gårdetsågårdet.png
initial revision: 1.1
/«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/Å/goo/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/å/ä/ö/gårdetsågårdet.txt,v  <--  Å/goo/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/å/ä/ö/gårdetsågårdet.txt
initial revision: 1.1
Committed successfully to CVS
ok 8 - File with non-ascii file name

expecting success: date >>"E/newfile5.txt" &&
      git add "E/newfile5.txt" &&
      git commit -a -m "Update one" &&
      date >>"E/newfile5.txt" &&
      git add "E/newfile5.txt" &&
      git commit -a -m "Update two" &&
      id=$(git rev-list --max-count=1 HEAD) &&
      (cd "$CVSWORK" &&
      test_must_fail git cvsexportcommit -c $id
      )
Filesystem has no item: File not found: transaction '4-5', path '/tags/tag1/project' at /«PKGBUILDDIR»/git-svn line 1196.

	M	auto_updated_file
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            1 (         1 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         1 duplicates          0 deltas of          0 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              4
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          7
pack_report: pack_mmap_calls          =          4
pack_report: pack_open_windows        =          4 /          4
pack_report: pack_mapped              =       1168 /       1168
---------------------------------------------------------------------

[master 424aa36] Update one
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 67 - N: copy directory by id

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

)
[master f52e24d] Update two
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
prerequisite PIPE ok
expecting success: 
	cat >expect <<-\EOF &&
	:100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc C100	file2/newf	file3/newf
	:100644 100644 7123f7f44e39be127c5eb701e5968176ee9d78b1 7123f7f44e39be127c5eb701e5968176ee9d78b1 C100	file2/oldf	file3/oldf
	EOF
	git update-ref -d refs/heads/N4 &&
	rm -f backflow &&
	mkfifo backflow &&
	(
		exec <backflow &&
		cat <<-EOF &&
		commit refs/heads/N4
		committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
		data <<COMMIT
		copy by tree hash, part 2
		COMMIT

		from refs/heads/branch^0
		ls "file2"
		EOF
		read mode type tree filename &&
		echo "M 040000 $tree file3"
	) |
	git fast-import --cat-blob-fd=3 3>backflow &&
	git diff-tree -C --find-copies-harder -r N4^ N4 >actual &&
	compare_diff_raw expect actual

r3 = 8b9e0ba58b7c3a36d69be3fd31d0ce333ff93b40 (refs/remotes/git-svn)
	M	file
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            1 (         1 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         1 duplicates          0 deltas of          0 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              4
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          7
pack_report: pack_mmap_calls          =          4
pack_report: pack_open_windows        =          4 /          4
pack_report: pack_mapped              =       1173 /       1173
---------------------------------------------------------------------

r4 = 7aadf4a990c4abb24fff392994f0882431f5a830 (refs/remotes/git-svn)
ok 68 - N: read and copy directory

expecting success: 
	cat <<-\EOF >expect &&
	OBJNAME
	:000000 100644 OBJNAME OBJNAME A	unrelated
	EOF
	echo "missing src" >expect.response &&
	git update-ref -d refs/heads/read-empty &&
	rm -f backflow &&
	mkfifo backflow &&
	(
		exec <backflow &&
		cat <<-EOF &&
		commit refs/heads/read-empty
		committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
		data <<COMMIT
		read "empty" (missing) directory
		COMMIT

		M 100644 inline src/greeting
		data <<BLOB
		hello
		BLOB
		C src/greeting dst1/non-greeting
		C src/greeting unrelated
		# leave behind "empty" src directory
		D src/greeting
		ls "src"
		EOF
		read -r line &&
		printf "%s\n" "$line" >response &&
		cat <<-\EOF
		D dst1
		D dst2
		EOF
	) |
	git fast-import --cat-blob-fd=3 3>backflow &&
	test_cmp expect.response response &&
	git rev-list read-empty |
	git diff-tree -r --root --stdin |
	sed "s/$_x40/OBJNAME/g" >actual &&
	test_cmp expect actual

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            3 (         0 duplicates                  )
      blobs  :            1 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            1 (         0 duplicates          0 deltas of          1 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              5
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
	M	file
pack_report: pack_used_ctr            =          2
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        235 /        235
---------------------------------------------------------------------

ok 69 - N: empty directory reads as missing

expecting success: cat >expect <<-\EOF &&
	:100755 000000 f1fb5da718392694d0076d677d6d0e364c79b0bc 0000000000000000000000000000000000000000 D	file3/newf
	:100644 000000 7123f7f44e39be127c5eb701e5968176ee9d78b1 0000000000000000000000000000000000000000 D	file3/oldf
	EOF
	 root=$(git rev-parse refs/heads/branch^0^{tree}) &&
	 cat >input <<-INPUT_END &&
	commit refs/heads/N6
	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
	data <<COMMIT
	copy root directory by tree hash
	COMMIT

	from refs/heads/branch^0
	M 040000 $root ""
	INPUT_END
	 git fast-import <input &&
	 git diff-tree -C --find-copies-harder -r N4 N6 >actual &&
	 compare_diff_raw expect actual
r5 = 4166bae3a35456dfe53fbdf2b94d4aa429f226d2 (refs/remotes/git-svn)
Checking if patch will apply
Applying
error: patch failed: E/newfile5.txt:1
error: E/newfile5.txt: patch does not apply
cannot patch at /«PKGBUILDDIR»/git-cvsexportcommit line 333.
ok 9 - Mismatching patch should fail

checking prerequisite: FILEMODE

mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
(
	cd "$TRASH_DIRECTORY/prereq-test-dir" &&
	test "$(git config --bool core.filemode)" = true

)
prerequisite FILEMODE ok
expecting success: mkdir G &&
      echo executeon >G/on &&
      chmod +x G/on &&
      echo executeoff >G/off &&
      git add G/on &&
      git add G/off &&
      git commit -a -m "Execute test" &&
      (cd "$CVSWORK" &&
      git cvsexportcommit -c HEAD
      test -x G/on &&
      ! test -x G/off
      )
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            1 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              3
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          7
pack_report: pack_mmap_calls          =          3
pack_report: pack_open_windows        =          3 /          3
pack_report: pack_mapped              =        848 /        848
---------------------------------------------------------------------

ok 70 - N: copy root directory by tree hash

expecting success: cat >expect <<-\EOF &&
	:100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc C100	file2/newf	oldroot/file2/newf
	:100644 100644 7123f7f44e39be127c5eb701e5968176ee9d78b1 7123f7f44e39be127c5eb701e5968176ee9d78b1 C100	file2/oldf	oldroot/file2/oldf
	:100755 100755 85df50785d62d3b05ab03d9cbf7e4a0b49449730 85df50785d62d3b05ab03d9cbf7e4a0b49449730 C100	file4	oldroot/file4
	:100755 100755 e74b7d465e52746be2b4bae983670711e6e66657 e74b7d465e52746be2b4bae983670711e6e66657 C100	newdir/exec.sh	oldroot/newdir/exec.sh
	:100644 100644 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 C100	newdir/interesting	oldroot/newdir/interesting
	EOF
	 cat >input <<-INPUT_END &&
	commit refs/heads/N-copy-root-path
	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
	data <<COMMIT
	copy root directory by (empty) path
	COMMIT

	from refs/heads/branch^0
	C "" oldroot
	INPUT_END
	 git fast-import <input &&
	 git diff-tree -C --find-copies-harder -r branch N-copy-root-path >actual &&
	 compare_diff_raw expect actual
[master aaf2e3a] Execute test
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 G/off
 create mode 100755 G/on
	M	file
r6 = a4ed9e4e15ebbf8bcf2488188ca0326582ede274 (refs/remotes/git-svn)
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            2 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            1 (         0 duplicates          0 deltas of          1 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              4
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          6
pack_report: pack_mmap_calls          =          3
pack_report: pack_open_windows        =          3 /          3
pack_report: pack_mapped              =        983 /        983
---------------------------------------------------------------------

ok 71 - N: copy root by path

expecting success: cat >expect <<-\EOF &&
	OBJID
	:100644 000000 OBJID OBJID D	foo/bar/qux
	OBJID
	:000000 100644 OBJID OBJID A	foo/bar/baz
	:000000 100644 OBJID OBJID A	foo/bar/qux
	EOF
	 empty_tree=$(git mktree </dev/null) &&
	 cat >input <<-INPUT_END &&
	commit refs/heads/N-delete
	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
	data <<COMMIT
	collect data to be deleted
	COMMIT

	deleteall
	M 100644 inline foo/bar/baz
	data <<DATA_END
	hello
	DATA_END
	C "foo/bar/baz" "foo/bar/qux"
	C "foo/bar/baz" "foo/bar/quux/1"
	C "foo/bar/baz" "foo/bar/quuux"
	M 040000 $empty_tree foo/bar/quux
	M 040000 $empty_tree foo/bar/quuux

	commit refs/heads/N-delete
	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
	data <<COMMIT
	delete subdirectory
	COMMIT

	M 040000 $empty_tree foo/bar/qux
	INPUT_END
	 git fast-import <input &&
	 git rev-list N-delete |
		git diff-tree -r --stdin --root --always |
		sed -e "s/$_x40/OBJID/g" >actual &&
	 test_cmp expect actual
	M	file
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            8 (         1 duplicates                  )
      blobs  :            0 (         1 duplicates          0 deltas of          0 attempts)
      trees  :            6 (         0 duplicates          1 deltas of          6 attempts)
      commits:            2 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              7
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          2
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        542 /        542
---------------------------------------------------------------------

ok 72 - N: delete directory by copying

expecting success: cat >expect <<-\EOF &&
	:100644 100644 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 C100	newdir/interesting	file3/file5
	:100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc C100	file2/newf	file3/newf
	:100644 100644 7123f7f44e39be127c5eb701e5968176ee9d78b1 7123f7f44e39be127c5eb701e5968176ee9d78b1 C100	file2/oldf	file3/oldf
	EOF
	 subdir=$(git rev-parse refs/heads/branch^0:file2) &&
	 cat >input <<-INPUT_END &&
	commit refs/heads/N5
	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
	data <<COMMIT
	copy by tree hash
	COMMIT

	from refs/heads/branch^0
	M 040000 $subdir file3

	commit refs/heads/N5
	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
	data <<COMMIT
	modify directory copy
	COMMIT

	M 644 inline file3/file5
	data <<EOF
	$file5_data
	EOF
	INPUT_END
	 git fast-import <input &&
	 git diff-tree -C --find-copies-harder -r N5^^ N5 >actual &&
	 compare_diff_raw expect actual
r7 = 7bf50464b594c0ccebe33d61b21b970aac055944 (refs/remotes/git-svn)
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            1 (         5 duplicates                  )
      blobs  :            0 (         1 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         3 duplicates          0 deltas of          0 attempts)
      commits:            1 (         1 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              7
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          8
pack_report: pack_mmap_calls          =          4
pack_report: pack_open_windows        =          4 /          4
pack_report: pack_mapped              =       1169 /       1169
---------------------------------------------------------------------

	M	auto_updated_file
Checking if patch will apply
Applying
Patch applied successfully. Adding new files and directories to CVS
ok 73 - N: modify copied tree

expecting success: subdir=$(git rev-parse refs/heads/branch^0:file2) &&
	 test_must_fail git fast-import <<-INPUT_END
	commit refs/heads/N5B
	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
	data <<COMMIT
	copy with invalid syntax
	COMMIT

	from refs/heads/branch^0
	M 040000 $subdir file3/
	INPUT_END
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/G put under version control
cvs add: scheduling file `G/off' for addition
cvs add: use `cvs commit' to add this file permanently
fatal: Empty path component found in input
fast-import: dumping crash report to .git/fast_import_crash_8778
cvs add: scheduling file `G/on' for addition
ok 74 - N: reject foo/ syntax

expecting success: test_must_fail git fast-import <<-INPUT_END
	commit refs/heads/N5C
	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
	data <<COMMIT
	copy with invalid syntax
	COMMIT

	from refs/heads/branch^0
	C file2/ file3
	INPUT_END
cvs add: use `cvs commit' to add this file permanently
Commit to CVS
Patch title (first comment line): Execute test
Autocommit
  cvs commit -F .msg 'G/off' 'G/on'
r8 = 7875a6e9d54a385095f45a45ae773941cc814463 (refs/remotes/git-svn)
fatal: Empty path component found in input
fast-import: dumping crash report to .git/fast_import_crash_8785
ok 75 - N: reject foo/ syntax in copy source

expecting success: test_must_fail git fast-import <<-INPUT_END
	commit refs/heads/N5D
	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
	data <<COMMIT
	rename with invalid syntax
	COMMIT

	from refs/heads/branch^0
	R file2/ file3
	INPUT_END
fatal: Path file2/ not in branch
fast-import: dumping crash report to .git/fast_import_crash_8790
ok 76 - N: reject foo/ syntax in rename source

expecting success: test_must_fail git fast-import <<-INPUT_END
	commit refs/heads/N5E
	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
	data <<COMMIT
	copy with invalid syntax
	COMMIT

	from refs/heads/branch^0
	ls "file2/"
	INPUT_END
fatal: Empty path component found in input
fast-import: dumping crash report to .git/fast_import_crash_8795
ok 77 - N: reject foo/ syntax in ls argument

expecting success: echo "hello, world" >expect.foo &&
	 echo hello >expect.bar &&
	 git fast-import <<-SETUP_END &&
	commit refs/heads/N7
	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
	data <<COMMIT
	hello, tree
	COMMIT

	deleteall
	M 644 inline foo/bar
	data <<EOF
	hello
	EOF
	SETUP_END

	 tree=$(git rev-parse --verify N7:) &&
	 git fast-import <<-INPUT_END &&
	commit refs/heads/N8
	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
	data <<COMMIT
	copy to root by id and modify
	COMMIT

	M 040000 $tree ""
	M 644 inline foo/foo
	data <<EOF
	hello, world
	EOF
	INPUT_END
	 git show N8:foo/foo >actual.foo &&
	 git show N8:foo/bar >actual.bar &&
	 test_cmp expect.foo actual.foo &&
	 test_cmp expect.bar actual.bar
	M	file
r9 = 60be0f3071e237f99130a471ad1631075a3e8d99 (refs/remotes/git-svn)
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            3 (         1 duplicates                  )
      blobs  :            0 (         1 duplicates          0 deltas of          0 attempts)
      trees  :            2 (         0 duplicates          0 deltas of          2 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              2
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          2
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        238 /        238
---------------------------------------------------------------------

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            4 (         0 duplicates                  )
      blobs  :            1 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            2 (         0 duplicates          0 deltas of          2 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              2
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          5
pack_report: pack_mmap_calls          =          2
pack_report: pack_open_windows        =          2 /          2
pack_report: pack_mapped              =        535 /        535
---------------------------------------------------------------------

	M	auto_updated_file
ok 78 - N: copy to root by id and modify

expecting success: branch=$(git rev-parse --verify refs/heads/branch^{tree}) &&
	 cat >input <<-INPUT_END &&
	commit refs/heads/N9
	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
	data <<COMMIT
	extract subtree branch:newdir
	COMMIT

	M 040000 $branch ""
	C "newdir" ""
	INPUT_END
	 git fast-import <input &&
	 git diff --exit-code branch:newdir N9
r10 = faeb2677b929c1bb167d01599918610c836a4e65 (refs/remotes/git-svn)
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            1 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              3
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          4
pack_report: pack_mmap_calls          =          2
pack_report: pack_open_windows        =          2 /          2
pack_report: pack_mapped              =        623 /        623
---------------------------------------------------------------------

ok 79 - N: extract subtree

expecting success: echo hello >expect.baz &&
	 echo hello, world >expect.qux &&
	 git fast-import <<-SETUP_END &&
	commit refs/heads/N10
	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
	data <<COMMIT
	hello, tree
	COMMIT

	deleteall
	M 644 inline foo/bar/baz
	data <<EOF
	hello
	EOF
	SETUP_END

	 tree=$(git rev-parse --verify N10:) &&
	 git fast-import <<-INPUT_END &&
	commit refs/heads/N11
	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
	data <<COMMIT
	copy to root by id and modify
	COMMIT

	M 040000 $tree ""
	M 100644 inline foo/bar/qux
	data <<EOF
	hello, world
	EOF
	R "foo" ""
	C "bar/qux" "bar/quux"
	INPUT_END
	 git show N11:bar/baz >actual.baz &&
	 git show N11:bar/qux >actual.qux &&
	 git show N11:bar/quux >actual.quux &&
	 test_cmp expect.baz actual.baz &&
	 test_cmp expect.qux actual.qux &&
	 test_cmp expect.qux actual.quux
	M	auto_updated_file
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            1 (         4 duplicates                  )
      blobs  :            0 (         1 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         3 duplicates          0 deltas of          0 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              3
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          2
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        157 /        157
---------------------------------------------------------------------

r11 = 75c3d594f15c761bafa1680482b9a82f834217b9 (refs/remotes/git-svn)
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            3 (         1 duplicates                  )
      blobs  :            0 (         1 duplicates          0 deltas of          0 attempts)
      trees  :            2 (         0 duplicates          0 deltas of          2 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              5
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          6
pack_report: pack_mmap_calls          =          2
pack_report: pack_open_windows        =          2 /          2
pack_report: pack_mapped              =        823 /        823
---------------------------------------------------------------------

Creating parent folder file:///«PKGBUILDDIR»/t/trash%20directory.t9167-git-svn-cmd-branch-subproject/svnrepo/tags/tag1 ...
ok 80 - N: modify subtree, extract it, and modify again

expecting success: git fast-import <input &&
	 test `git rev-parse N3` = `git rev-parse O1`
	M	auto_updated_file
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         5 duplicates                  )
      blobs  :            0 (         1 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         3 duplicates          0 deltas of          0 attempts)
      commits:            0 (         1 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              7
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          7
pack_report: pack_mmap_calls          =          4
pack_report: pack_open_windows        =          4 /          4
pack_report: pack_mapped              =       1166 /       1166
---------------------------------------------------------------------

ok 81 - O: comments are all skipped

expecting success: git fast-import <input &&
	 test `git rev-parse N3` = `git rev-parse O2`
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         5 duplicates                  )
      blobs  :            0 (         1 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         3 duplicates          0 deltas of          0 attempts)
      commits:            0 (         1 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              7
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          7
pack_report: pack_mmap_calls          =          4
pack_report: pack_open_windows        =          4 /          4
pack_report: pack_mapped              =       1166 /       1166
---------------------------------------------------------------------

r12 = fb02de9b059c0721cc526c13d5f09b2402cbd770 (refs/remotes/git-svn)
ok 82 - O: blank lines not necessary after data commands

expecting success: git repack -a -d
/«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/G/off,v  <--  G/off
initial revision: 1.1
/«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/G/on,v  <--  G/on
initial revision: 1.1
Committed successfully to CVS
ok 10 - Retain execute bit

expecting success: 
      mkdir W &&
      echo foobar >W/file1.txt &&
      echo bazzle >W/file2.txt &&
      git add W/file1.txt &&
      git add W/file2.txt &&
      git commit -m "More updates" &&
      id=$(git rev-list --max-count=1 HEAD) &&
      (cd "$GIT_DIR" &&
      GIT_DIR=. git cvsexportcommit -w "$CVSWORK" -c $id &&
      check_entries "$CVSWORK/W" "file1.txt/1.1/|file2.txt/1.1/" &&
      test_cmp "$CVSWORK/W/file1.txt" ../W/file1.txt &&
      test_cmp "$CVSWORK/W/file2.txt" ../W/file2.txt
      )

	M	auto_updated_file
[master d5c6ebf] More updates
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 W/file1.txt
 create mode 100644 W/file2.txt
r13 = ef460deee795f9033dae3083da67dba388f8806f (refs/remotes/git-svn)
ok 83 - O: repack before next test

expecting success: git fast-import <input &&
	 test 8 = `find .git/objects/pack -type f | wc -l` &&
	 test `git rev-parse refs/tags/O3-2nd` = `git rev-parse O3^` &&
	 git log --reverse --pretty=oneline O3 | sed s/^.*z// >actual &&
	 test_cmp expect actual
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9164-git-svn-dcommit-concurrent/svnrepo r13
[master 79e7ac5] commit change 4.1
 Author: A U Thor <author@example.com>
 1 file changed, 7 insertions(+)
[master 8b53f12] commit change 4.2
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
[master 47a8603] commit change 4.3
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            4 (         1 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         1 duplicates          0 deltas of          0 attempts)
      commits:            4 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           3 (         1 loads     )
      marks:           1024 (         1 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          9
pack_report: pack_mmap_calls          =          3
pack_report: pack_open_windows        =          3 /          3
pack_report: pack_mapped              =        661 /        661
---------------------------------------------------------------------

Checking if patch will apply
Applying
Patch applied successfully. Adding new files and directories to CVS
Directory /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/W put under version control
ok 84 - O: blank lines not necessary after other commands

expecting success: git fast-import <input >actual &&
	 grep "progress " <input >expect &&
	 test_cmp expect actual
cvs add: scheduling file `W/file1.txt' for addition
cvs add: use `cvs commit' to add this file permanently
cvs add: scheduling file `W/file2.txt' for addition
cvs add: use `cvs commit' to add this file permanently
Commit to CVS
Patch title (first comment line): More updates
Autocommit
  cvs commit -F .msg 'W/file1.txt' 'W/file2.txt'
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         5 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         1 duplicates          0 deltas of          0 attempts)
      commits:            0 (         4 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          2
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        180 /        180
---------------------------------------------------------------------

ok 85 - O: progress outputs as requested by input

expecting success: git fast-import <input &&
	 git checkout subuse1 &&
	 rm -rf sub && mkdir sub && (cd sub &&
	 git init &&
	 git fetch --update-head-ok .. refs/heads/sub:refs/heads/master &&
	 git checkout master) &&
	 git submodule init &&
	 git submodule update
Copying file:///«PKGBUILDDIR»/t/trash%20directory.t9167-git-svn-cmd-branch-subproject/svnrepo/trunk/project at r2 to file:///«PKGBUILDDIR»/t/trash%20directory.t9167-git-svn-cmd-branch-subproject/svnrepo/tags/tag1/project...
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:           11 (         0 duplicates                  )
      blobs  :            3 (         0 duplicates          0 deltas of          1 attempts)
      trees  :            4 (         0 duplicates          1 deltas of          4 attempts)
      commits:            4 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           2 (         2 loads     )
      marks:           1024 (         7 unique    )
      atoms:              6
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          6
pack_report: pack_mmap_calls          =          2
pack_report: pack_open_windows        =          2 /          2
pack_report: pack_mapped              =       8377 /       8377
---------------------------------------------------------------------

Switched to branch 'subuse1'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9300-fast-import/sub/.git/
From ..
 * [new branch]      sub        -> master
Already on 'master'
Submodule 'sub' (/«PKGBUILDDIR»/t/trash directory.t9300-fast-import/sub) registered for path 'sub'
ok 86 - P: superproject & submodule mix

expecting success: git branch -D sub &&
	 git gc && git prune &&
	 git fast-import <input &&
	 test $(git rev-parse --verify subuse2) = $(git rev-parse --verify subuse1)
Deleted branch sub (was 51a3fee).
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         5 duplicates                  )
      blobs  :            0 (         1 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         2 duplicates          0 deltas of          0 attempts)
      commits:            0 (         2 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         3 unique    )
      atoms:              5
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          4
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =       7880 /       7880
---------------------------------------------------------------------

ok 87 - P: verbatim SHA gitlinks

expecting success: 
    test_must_fail git fast-import <input
fatal: Git links cannot be specified 'inline': M 160000 inline sub
fast-import: dumping crash report to .git/fast_import_crash_9137
ok 88 - P: fail on inline gitlink

expecting success: 
    test_must_fail git fast-import <input
fatal: Not a commit (actually a blob): M 160000 :1 sub
fast-import: dumping crash report to .git/fast_import_crash_9143
ok 89 - P: fail on blob mark in gitlink

expecting success: git fast-import <input &&
	 git whatchanged notes-test
/«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/W/file1.txt,v  <--  W/file1.txt
initial revision: 1.1
/«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/W/file2.txt,v  <--  W/file2.txt
initial revision: 1.1
Committed successfully to CVS
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:           20 (         4 duplicates                  )
      blobs  :            6 (         4 duplicates          0 deltas of          6 attempts)
      trees  :            7 (         0 duplicates          3 deltas of          7 attempts)
      commits:            7 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           3 (         3 loads     )
      marks:           1024 (        11 unique    )
      atoms:              7
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          6
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =       1857 /       1857
---------------------------------------------------------------------

commit 7aa420e73b93d5b69059a2ff8e850a2ed9411187
Author: C O Mitter <committer@example.com>
Date:   Thu Apr 7 15:27:13 2005 -0700

    third (:6)

:000000 100644 0000000... fcf778c... A	file5
:000000 100755 0000000... e74b7d4... A	file6

commit 42eaf85509b2f5a0e75780657349147fbd74b4f3
Author: C O Mitter <committer@example.com>
Date:   Thu Apr 7 15:27:13 2005 -0700

    second (:5)

:000000 100644 0000000... 85df507... A	file4

commit 08ee95cbee172e3f9b93ebbb501101ad3023d6ed
Author: C O Mitter <committer@example.com>
Date:   Thu Apr 7 15:27:13 2005 -0700

    first (:3)

:000000 100644 0000000... 7123f7f... A	file2
ok 90 - Q: commit notes

expecting success: 
	verify_packs

ok 11 - -w option should work with relative GIT_DIR

expecting success: 

	echo Notes > release-notes &&
	git add release-notes &&
	git commit -m "Add release notes" release-notes &&
	id=$(git rev-parse HEAD) &&
	git cvsexportcommit -w "$CVSWORK" -c $id &&

	echo new > DS &&
	echo new > E/DS &&
	echo modified > release-notes &&
	git add DS E/DS release-notes &&
	git commit -m "Add two files with the same basename" &&
	id=$(git rev-parse HEAD) &&
	git cvsexportcommit -w "$CVSWORK" -c $id &&
	check_entries "$CVSWORK/E" "DS/1.1/|newfile5.txt/1.1/" &&
	check_entries "$CVSWORK" "DS/1.1/|release-notes/1.2/" &&
	test_cmp "$CVSWORK/DS" DS &&
	test_cmp "$CVSWORK/E/DS" E/DS &&
	test_cmp "$CVSWORK/release-notes" release-notes


[master 2d7e24e] Add release notes
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 release-notes
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9167-git-svn-cmd-branch-subproject/svnrepo/trunk/project => file:///«PKGBUILDDIR»/t/trash%20directory.t9167-git-svn-cmd-branch-subproject/svnrepo/tags/tag1/project, 2
ok 91 - Q: verify pack

expecting success: git cat-file commit notes-test~2 | sed 1d >actual &&
	test_cmp expect actual
ok 92 - Q: verify first commit

expecting success: git cat-file commit notes-test^ | sed 1d >actual &&
	test_cmp expect actual
ok 93 - Q: verify second commit

expecting success: git cat-file commit notes-test | sed 1d >actual &&
	test_cmp expect actual
ok 94 - Q: verify third commit

expecting success: git cat-file commit refs/notes/foobar~2 | sed 1d >actual &&
	test_cmp expect actual
ok 95 - Q: verify first notes commit

Found branch parent: (refs/remotes/origin/tags/tag1) 270fecf238e4a92f63725728742820e3065d2de3
expecting success: git cat-file -p refs/notes/foobar~2^{tree} | sed "s/ [0-9a-f]*	/ /" >actual &&
	 test_cmp expect actual
ok 96 - Q: verify first notes tree

expecting success: git cat-file blob refs/notes/foobar~2:$commit1 >actual && test_cmp expect actual
ok 97 - Q: verify first note for first commit

expecting success: git cat-file blob refs/notes/foobar~2:$commit2 >actual && test_cmp expect actual
Following parent with do_switch
ok 98 - Q: verify first note for second commit

expecting success: git cat-file blob refs/notes/foobar~2:$commit3 >actual && test_cmp expect actual
ok 99 - Q: verify first note for third commit

expecting success: git cat-file commit refs/notes/foobar^ | sed 1d >actual &&
	test_cmp expect actual
ok 100 - Q: verify second notes commit

expecting success: git cat-file -p refs/notes/foobar^^{tree} | sed "s/ [0-9a-f]*	/ /" >actual &&
	 test_cmp expect actual
ok 101 - Q: verify second notes tree

expecting success: git cat-file blob refs/notes/foobar^:$commit1 >actual && test_cmp expect actual
Successfully followed parent
ok 102 - Q: verify second note for first commit

expecting success: git cat-file blob refs/notes/foobar^:$commit2 >actual && test_cmp expect actual
ok 103 - Q: verify first note for second commit

expecting success: git cat-file blob refs/notes/foobar^:$commit3 >actual && test_cmp expect actual
ok 104 - Q: verify first note for third commit

expecting success: git cat-file commit refs/notes/foobar2 | sed 1d >actual &&
	test_cmp expect actual
ok 105 - Q: verify third notes commit

expecting success: git cat-file -p refs/notes/foobar2^{tree} | sed "s/ [0-9a-f]*	/ /" >actual &&
	 test_cmp expect actual
ok 106 - Q: verify third notes tree

expecting success: git cat-file blob refs/notes/foobar2:$commit1 >actual && test_cmp expect actual
ok 107 - Q: verify third note for first commit

expecting success: git cat-file commit refs/notes/foobar | sed 1d >actual &&
	test_cmp expect actual
ok 108 - Q: verify fourth notes commit

r6 = d5247ade6ebfaf6755e4fdc0cab9e08ec8fb51d8 (refs/remotes/origin/tags/tag1)
expecting success: git cat-file -p refs/notes/foobar^{tree} | sed "s/ [0-9a-f]*	/ /" >actual &&
	 test_cmp expect actual
ok 109 - Q: verify fourth notes tree

expecting success: git cat-file blob refs/notes/foobar:$commit2 >actual && test_cmp expect actual
ok 110 - Q: verify second note for second commit

expecting success: test_must_fail git fast-import <input
Checking if patch will apply
fatal: Can't add a note on empty branch.
fast-import: dumping crash report to .git/fast_import_crash_9382
ok 111 - Q: deny note on empty branch

expecting success: 
	test_must_fail git fast-import <input

cvs status: nothing known about `release-notes'
Applying
fatal: This version of fast-import does not support feature no-such-feature-exists.
fast-import: dumping crash report to .git/fast_import_crash_9392
Patch applied successfully. Adding new files and directories to CVS
ok 112 - R: abort on unsupported feature

expecting success: 
	git fast-import <input

cvs add: scheduling file `release-notes' for addition
cvs add: use `cvs commit' to add this file permanently
Commit to CVS
Patch title (first comment line): Add release notes
Autocommit
  cvs commit -F .msg 'release-notes'
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         0 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          0
pack_report: pack_mmap_calls          =          0
pack_report: pack_open_windows        =          0 /          0
pack_report: pack_mapped              =          0 /          0
---------------------------------------------------------------------

ok 113 - R: supported feature is accepted

expecting success: 
	test_must_fail git fast-import <input

fatal: Got feature command 'date-format=now' after data command
fast-import: dumping crash report to .git/fast_import_crash_9409
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9164-git-svn-dcommit-concurrent/svnrepo ...
ok 114 - R: abort on receiving feature after data command

expecting success: 
	test_must_fail git fast-import <input

fatal: Only one import-marks command allowed per stream
fast-import: dumping crash report to .git/fast_import_crash_9428
ok 115 - R: only one import-marks feature allowed per stream

expecting success: cat input | git fast-import &&
    grep :1 git.marks
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         1 duplicates                  )
      blobs  :            0 (         1 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         1 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          0
pack_report: pack_mmap_calls          =          0
pack_report: pack_open_windows        =          0 /          0
pack_report: pack_mapped              =          0 /          0
---------------------------------------------------------------------

:1 45b983be36b73c0788dc9cbcb76cbb80fc7bb057
ok 116 - R: export-marks feature results in a marks file being created

expecting success: cat input | git fast-import --export-marks=other.marks &&
    grep :1 other.marks
Attempting to commit more than one change while --no-rebase is enabled.
If these changes depend on each other, re-running without --no-rebase may be required. at /«PKGBUILDDIR»/git-svn line 886.
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         1 duplicates                  )
      blobs  :            0 (         1 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         1 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          0
pack_report: pack_mmap_calls          =          0
pack_report: pack_open_windows        =          0 /          0
pack_report: pack_mapped              =          0 /          0
---------------------------------------------------------------------

:1 45b983be36b73c0788dc9cbcb76cbb80fc7bb057
ok 117 - R: export-marks options can be overridden by commandline options

expecting success: 
	test_must_fail git fast-import --import-marks=nonexistent.marks </dev/null &&
	echo "feature import-marks=nonexistent.marks" |
	test_must_fail git fast-import

fatal: cannot read 'nonexistent.marks': No such file or directory
fast-import: dumping crash report to .git/fast_import_crash_9448
fatal: cannot read 'nonexistent.marks': No such file or directory
fast-import: dumping crash report to .git/fast_import_crash_9454
ok 118 - R: catch typo in marks file name

expecting success: 
	rm -f io.marks &&
	blob=$(echo hi | git hash-object --stdin) &&
	cat >expect <<-EOF &&
	:1 $blob
	:2 $blob
	EOF
	git fast-import --export-marks=io.marks <<-\EOF &&
	blob
	mark :1
	data 3
	hi

	EOF
	git fast-import --import-marks=io.marks --export-marks=io.marks <<-\EOF &&
	blob
	mark :2
	data 3
	hi

	EOF
	test_cmp expect io.marks

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         1 duplicates                  )
      blobs  :            0 (         1 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         1 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          0
pack_report: pack_mmap_calls          =          0
pack_report: pack_open_windows        =          0 /          0
pack_report: pack_mapped              =          0 /          0
---------------------------------------------------------------------

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         1 duplicates                  )
      blobs  :            0 (         1 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         2 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          1
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =         44 /         44
---------------------------------------------------------------------

ok 119 - R: import and output marks can be the same file

expecting success: 
	rm -f io.marks &&
	test_must_fail git fast-import --import-marks=io.marks --export-marks=io.marks <<-\EOF
	blob
	mark :1
	data 3
	hi

	EOF

fatal: cannot read 'io.marks': No such file or directory
fast-import: dumping crash report to .git/fast_import_crash_9472
ok 120 - R: --import-marks=foo --output-marks=foo to create foo fails

expecting success: 
	rm -f io.marks &&
	blob=$(echo hi | git hash-object --stdin) &&
	echo ":1 $blob" >expect &&
	git fast-import --import-marks-if-exists=io.marks --export-marks=io.marks <<-\EOF &&
	blob
	mark :1
	data 3
	hi

	EOF
	test_cmp expect io.marks

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         1 duplicates                  )
      blobs  :            0 (         1 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         1 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          0
pack_report: pack_mmap_calls          =          0
pack_report: pack_open_windows        =          0 /          0
pack_report: pack_mapped              =          0 /          0
---------------------------------------------------------------------

ok 121 - R: --import-marks-if-exists

expecting success: 
	rm -f io.marks &&
	>expect &&

	git fast-import --export-marks=io.marks <<-\EOF &&
	feature import-marks-if-exists=not_io.marks
	EOF
	test_cmp expect io.marks &&

	blob=$(echo hi | git hash-object --stdin) &&

	echo ":1 $blob" >io.marks &&
	echo ":1 $blob" >expect &&
	echo ":2 $blob" >>expect &&

	git fast-import --export-marks=io.marks <<-\EOF &&
	feature import-marks-if-exists=io.marks
	blob
	mark :2
	data 3
	hi

	EOF
	test_cmp expect io.marks &&

	echo ":3 $blob" >>expect &&

	git fast-import --import-marks=io.marks \
			--export-marks=io.marks <<-\EOF &&
	feature import-marks-if-exists=not_io.marks
	blob
	mark :3
	data 3
	hi

	EOF
	test_cmp expect io.marks &&

	>expect &&

	git fast-import --import-marks-if-exists=not_io.marks \
			--export-marks=io.marks <<-\EOF &&
	feature import-marks-if-exists=io.marks
	EOF
	test_cmp expect io.marks

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         0 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          0
pack_report: pack_mmap_calls          =          0
pack_report: pack_open_windows        =          0 /          0
pack_report: pack_mapped              =          0 /          0
---------------------------------------------------------------------

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         1 duplicates                  )
      blobs  :            0 (         1 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         2 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          1
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =         44 /         44
---------------------------------------------------------------------

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         1 duplicates                  )
      blobs  :            0 (         1 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         3 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          1
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =         44 /         44
---------------------------------------------------------------------

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         0 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          0
pack_report: pack_mmap_calls          =          0
pack_report: pack_open_windows        =          0 /          0
pack_report: pack_mapped              =          0 /          0
---------------------------------------------------------------------

ok 122 - R: feature import-marks-if-exists

expecting success: cat input | git fast-import &&
    test_cmp marks.out marks.new
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         4 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          4
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =       7880 /       7880
---------------------------------------------------------------------

ok 123 - R: import to output marks works without any content

expecting success: cat input | git fast-import --import-marks=marks.out &&
    test_cmp marks.out marks.new
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         4 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          4
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =       7880 /       7880
---------------------------------------------------------------------

ok 124 - R: import marks prefers commandline marks file over the stream

expecting success: 
    head -n2 marks.out > one.marks &&
    tail -n +3 marks.out > two.marks &&
    git fast-import --import-marks=one.marks --import-marks=two.marks <input &&
    test_cmp marks.out combined.marks

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         4 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          4
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =       7880 /       7880
---------------------------------------------------------------------

ok 125 - R: multiple --import-marks= should be honoured

expecting success: 
    mkdir -p .git/info/fast-import/ &&
    cp marks.new .git/info/fast-import/relative.in &&
    git fast-import <input &&
    test_cmp marks.new .git/info/fast-import/relative.out

	M	auto_updated_file
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         4 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          4
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =       7880 /       7880
---------------------------------------------------------------------

ok 126 - R: feature relative-marks should be honoured

expecting success: 
    git fast-import <input &&
    test_cmp marks.new non-relative.out

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         4 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          4
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =       7880 /       7880
---------------------------------------------------------------------

ok 127 - R: feature no-relative-marks should be honoured

expecting success: 
	echo "feature ls" |
	git fast-import

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         0 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          0
pack_report: pack_mmap_calls          =          0
pack_report: pack_open_windows        =          0 /          0
pack_report: pack_mapped              =          0 /          0
---------------------------------------------------------------------

ok 128 - R: feature ls supported

expecting success: 
	echo "feature cat-blob" |
	git fast-import

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         0 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          0
pack_report: pack_mmap_calls          =          0
pack_report: pack_open_windows        =          0 /          0
pack_report: pack_mapped              =          0 /          0
---------------------------------------------------------------------

ok 129 - R: feature cat-blob supported

expecting success: 
	test_must_fail git fast-import --cat-blob-fd=-1 </dev/null

fatal: --cat-blob-fd: argument must be a non-negative integer
fast-import: dumping crash report to .git/fast_import_crash_9543
ok 130 - R: cat-blob-fd must be a nonnegative integer

expecting success: 
	blob=$(echo "yes it can" | git hash-object -w --stdin) &&
	cat >expect <<-EOF &&
	${blob} blob 11
	yes it can

	EOF
	echo "cat-blob $blob" |
	git fast-import --cat-blob-fd=6 6>actual &&
	test_cmp expect actual

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         0 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          0
pack_report: pack_mmap_calls          =          0
pack_report: pack_open_windows        =          0 /          0
pack_report: pack_mapped              =          0 /          0
---------------------------------------------------------------------

ok 131 - R: print old blob

expecting success: 
	echo hello >greeting &&
	blob=$(git hash-object -w greeting) &&
	cat >expect <<-EOF &&
	${blob} blob 6
	hello

	EOF
	git fast-import --cat-blob-fd=3 3>actual.3 >actual.1 <<-EOF &&
	cat-blob $blob
	EOF
	test_cmp expect actual.3 &&
	test_cmp empty actual.1 &&
	git fast-import 3>actual.3 >actual.1 <<-EOF &&
	option cat-blob-fd=3
	cat-blob $blob
	EOF
	test_cmp empty actual.3 &&
	test_cmp expect actual.1

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         0 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          1
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =       7880 /       7880
---------------------------------------------------------------------

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         0 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          1
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =       7880 /       7880
---------------------------------------------------------------------

ok 132 - R: in-stream cat-blob-fd not respected

expecting success: 
	echo "effluentish" | git hash-object --stdin >expect &&
	git fast-import --cat-blob-fd=6 6>actual <<-\EOF &&
	blob
	mark :1
	data <<BLOB_END
	effluentish
	BLOB_END
	get-mark :1
	EOF
	test_cmp expect actual

/«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/release-notes,v  <--  release-notes
initial revision: 1.1
Committed successfully to CVS
[master c9aa86d] Add two files with the same basename
 Author: A U Thor <author@example.com>
 3 files changed, 3 insertions(+), 1 deletion(-)
 create mode 100644 DS
 create mode 100644 E/DS
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            1 (         0 duplicates                  )
      blobs  :            1 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         1 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          0
pack_report: pack_mmap_calls          =          0
pack_report: pack_open_windows        =          0 /          0
pack_report: pack_mapped              =          0 /          0
---------------------------------------------------------------------

ok 133 - R: print mark for new blob

expecting success: 
	blob=$(echo "yep yep yep" | git hash-object --stdin) &&
	cat >expect <<-EOF &&
	${blob} blob 12
	yep yep yep

	EOF
	git fast-import --cat-blob-fd=6 6>actual <<-\EOF &&
	blob
	mark :1
	data <<BLOB_END
	yep yep yep
	BLOB_END
	cat-blob :1
	EOF
	test_cmp expect actual

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            1 (         0 duplicates                  )
      blobs  :            1 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         1 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          1
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          0 /          1
pack_report: pack_mapped              =          0 /         48
---------------------------------------------------------------------

ok 134 - R: print new blob

expecting success: 
	blob=$(echo "a new blob named by sha1" | git hash-object --stdin) &&
	cat >expect <<-EOF &&
	${blob} blob 25
	a new blob named by sha1

	EOF
	git fast-import --cat-blob-fd=6 6>actual <<-EOF &&
	blob
	data <<BLOB_END
	a new blob named by sha1
	BLOB_END
	cat-blob $blob
	EOF
	test_cmp expect actual

Committed r14
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            1 (         0 duplicates                  )
      blobs  :            1 (         0 duplicates          0 deltas of          1 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         0 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          1
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          0 /          1
pack_report: pack_mapped              =          0 /         67
---------------------------------------------------------------------

ok 135 - R: print new blob by sha1

expecting success: 
	(
		echo "the quick brown fox jumps over the lazy dog" >big &&
		for i in 1 2 3
		do
			cat big big big big >bigger &&
			cat bigger bigger bigger bigger >big ||
			exit
		done
	)

ok 136 - setup: big file

expecting success: 
	blob1=$(git hash-object big) &&
	blob1_len=$(wc -c <big) &&
	blob2=$(echo hello | git hash-object --stdin) &&
	{
		echo ${blob1} blob $blob1_len &&
		cat big &&
		cat <<-EOF

		${blob2} blob 6
		hello

		EOF
	} >expect &&
	{
		cat <<-\END_PART1 &&
			blob
			mark :1
			data <<data_end
		END_PART1
		cat big &&
		cat <<-\EOF
			data_end
			blob
			mark :2
			data <<data_end
			hello
			data_end
			cat-blob :1
			cat-blob :2
		EOF
	} |
	git fast-import >actual &&
	test_cmp expect actual

Checking if patch will apply
	M	auto_updated_file
cvs status: nothing known about `E/DS'
cvs status: nothing known about `DS'
Applying
Patch applied successfully. Adding new files and directories to CVS
cvs add: scheduling file `DS' for addition
cvs add: use `cvs commit' to add this file permanently
cvs add: scheduling file `E/DS' for addition
cvs add: use `cvs commit' to add this file permanently
Commit to CVS
Patch title (first comment line): Add two files with the same basename
Autocommit
  cvs commit -F .msg 'DS' 'E/DS' 'release-notes'
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            1 (         1 duplicates                  )
      blobs  :            1 (         1 duplicates          0 deltas of          1 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         2 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          2
pack_report: pack_mmap_calls          =          2
pack_report: pack_open_windows        =          1 /          2
pack_report: pack_mapped              =       7880 /       8505
---------------------------------------------------------------------

ok 137 - R: print two blobs to stdout

expecting success: 
	expect_id=$(git hash-object big) &&
	expect_len=$(wc -c <big) &&
	echo $expect_id blob $expect_len >expect.response &&

	rm -f blobs &&
	cat >frontend <<-\FRONTEND_END &&
	#!/bin/sh
	FRONTEND_END

	mkfifo blobs &&
	(
		export GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL GIT_COMMITTER_DATE &&
		cat <<-\EOF &&
		feature cat-blob
		blob
		mark :1
		data <<BLOB
		EOF
		cat big &&
		cat <<-\EOF &&
		BLOB
		cat-blob :1
		EOF

		read blob_id type size <&3 &&
		echo "$blob_id $type $size" >response &&
		head_c $size >blob <&3 &&
		read newline <&3 &&

		cat <<-EOF &&
		commit refs/heads/copied
		committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
		data <<COMMIT
		copy big file as file3
		COMMIT
		M 644 inline file3
		data <<BLOB
		EOF
		cat blob &&
		echo BLOB
	) 3<blobs |
	git fast-import --cat-blob-fd=3 3>blobs &&
	git show copied:file3 >actual &&
	test_cmp expect.response response &&
	test_cmp big actual

r14 = 62bd92c775467e633adf1912c27cf08f38835305 (refs/remotes/git-svn)
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            2 (         2 duplicates                  )
      blobs  :            0 (         2 duplicates          0 deltas of          0 attempts)
      trees  :            1 (         0 duplicates          0 deltas of          1 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         1 unique    )
      atoms:              1
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          3
pack_report: pack_mmap_calls          =          2
pack_report: pack_open_windows        =          2 /          2
pack_report: pack_mapped              =        830 /        830
---------------------------------------------------------------------

ok 138 - R: copy using cat-file

expecting success: 
	rm -f blobs &&
	echo "A blob from _before_ the commit." >expect &&
	mkfifo blobs &&
	(
		exec 3<blobs &&
		cat <<-EOF &&
		feature cat-blob
		blob
		mark :1
		data <<BLOB
		A blob from _before_ the commit.
		BLOB
		commit refs/heads/temporary
		committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
		data <<COMMIT
		Empty commit
		COMMIT
		cat-blob :1
		EOF

		read blob_id type size <&3 &&
		head_c $size >actual <&3 &&
		read newline <&3 &&

		echo
	) |
	git fast-import --cat-blob-fd=3 3>blobs &&
	test_cmp expect actual

Copying file:///«PKGBUILDDIR»/t/trash%20directory.t9167-git-svn-cmd-branch-subproject/svnrepo/trunk/project at r2 to file:///«PKGBUILDDIR»/t/trash%20directory.t9167-git-svn-cmd-branch-subproject/svnrepo/tags/tag2/project...
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            2 (         1 duplicates                  )
      blobs  :            1 (         0 duplicates          0 deltas of          1 attempts)
      trees  :            0 (         1 duplicates          0 deltas of          0 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         1 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          3
pack_report: pack_mmap_calls          =          2
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        198 /        198
---------------------------------------------------------------------

ok 139 - R: print blob mid-commit

expecting success: 
	rm -f blobs &&
	echo "A blob from _within_ the commit." >expect &&
	mkfifo blobs &&
	(
		exec 3<blobs &&
		cat <<-EOF &&
		feature cat-blob
		commit refs/heads/within
		committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
		data <<COMMIT
		Empty commit
		COMMIT
		M 644 inline within
		data <<BLOB
		A blob from _within_ the commit.
		BLOB
		EOF

		to_get=$(
			echo "A blob from _within_ the commit." |
			git hash-object --stdin
		) &&
		echo "cat-blob $to_get" &&

		read blob_id type size <&3 &&
		head_c $size >actual <&3 &&
		read newline <&3 &&

		echo deleteall
	) |
	git fast-import --cat-blob-fd=3 3>blobs &&
	test_cmp expect actual

	M	auto_updated_file
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            1 (         2 duplicates                  )
      blobs  :            1 (         0 duplicates          0 deltas of          1 attempts)
      trees  :            0 (         1 duplicates          0 deltas of          0 attempts)
      commits:            0 (         1 duplicates          0 deltas of          0 attempts)
Filesystem has no item: File not found: transaction '6-8', path '/tags/tag2/project' at /«PKGBUILDDIR»/git-svn line 1196.

      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              1
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          3
pack_report: pack_mmap_calls          =          2
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        198 /        198
---------------------------------------------------------------------

ok 140 - R: print staged blob within commit

expecting success: 
    cat input | git fast-import 2> output &&
    test_cmp empty output

ok 141 - R: quiet option results in no stats being output

expecting success: 
	echo feature done | test_must_fail git fast-import &&
	test_must_fail git fast-import --done </dev/null

fatal: stream ends early
fast-import: dumping crash report to .git/fast_import_crash_9748
fatal: stream ends early
fast-import: dumping crash report to .git/fast_import_crash_9750
ok 142 - R: feature done means terminating "done" is mandatory

expecting success: 
	git fast-import <<-\EOF &&
	feature done
	done
	trailing gibberish
	EOF
	git fast-import <<-\EOF
	done
	more trailing gibberish
	EOF

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         0 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          0
pack_report: pack_mmap_calls          =          0
pack_report: pack_open_windows        =          0 /          0
pack_report: pack_mapped              =          0 /          0
---------------------------------------------------------------------

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         0 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          0
pack_report: pack_mmap_calls          =          0
pack_report: pack_open_windows        =          0 /          0
pack_report: pack_mapped              =          0 /          0
---------------------------------------------------------------------

ok 143 - R: terminating "done" with trailing gibberish is ok

expecting success: 
	cat >expect <<-\EOF &&
	OBJID
	:000000 100644 OBJID OBJID A	hello.c
	:000000 100644 OBJID OBJID A	hello2.c
	EOF
	git fast-import <<-EOF &&
	commit refs/heads/done-ends
	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
	data <<EOT
	Commit terminated by "done" command
	EOT
	M 100644 inline hello.c
	data <<EOT
	Hello, world.
	EOT
	C hello.c hello2.c
	done
	EOF
	git rev-list done-ends |
	git diff-tree -r --stdin --root --always |
	sed -e "s/$_x40/OBJID/g" >actual &&
	test_cmp expect actual

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            3 (         0 duplicates                  )
      blobs  :            1 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            1 (         0 duplicates          0 deltas of          1 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              2
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          2
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        245 /        245
---------------------------------------------------------------------

ok 144 - R: terminating "done" within commit

expecting success: 
    test_must_fail git fast-import <input

fatal: This version of fast-import does not support option: non-existing-option
fast-import: dumping crash report to .git/fast_import_crash_9767
ok 145 - R: die on unknown option

expecting success: \
    test_must_fail git fast-import --non-existing-option < /dev/null

fatal: unknown option --non-existing-option
fast-import: dumping crash report to .git/fast_import_crash_9770
ok 146 - R: unknown commandline options are rejected

expecting success: 
	echo "option git active-branches=-5" |
	test_must_fail git fast-import &&
	echo "option git depth=" |
	test_must_fail git fast-import &&
	test_must_fail git fast-import --depth="5 elephants" </dev/null

fatal: --active-branches: argument must be a non-negative integer
fast-import: dumping crash report to .git/fast_import_crash_9775
fatal: --depth: argument must be a non-negative integer
fast-import: dumping crash report to .git/fast_import_crash_9779
fatal: --depth: argument must be a non-negative integer
fast-import: dumping crash report to .git/fast_import_crash_9781
ok 147 - R: die on invalid option argument

expecting success: 
    git fast-import <input

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         0 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          0
pack_report: pack_mmap_calls          =          0
pack_report: pack_open_windows        =          0 /          0
pack_report: pack_mapped              =          0 /          0
---------------------------------------------------------------------

ok 148 - R: ignore non-git options

/«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/DS,v  <--  DS
initial revision: 1.1
/«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/release-notes,v  <--  release-notes
new revision: 1.2; previous revision: 1.1
/«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/E/DS,v  <--  E/DS
initial revision: 1.1
Committed successfully to CVS
ok 12 - check files before directories

expecting success: 

    (cd "$CVSWORK" &&
     echo >attic_gremlin &&
     cvs -Q add attic_gremlin &&
     cvs -Q ci -m "added attic_gremlin" &&
     rm attic_gremlin &&
     cvs -Q rm attic_gremlin &&
     cvs -Q ci -m "removed attic_gremlin") &&

    echo > attic_gremlin &&
    git add attic_gremlin &&
    git commit -m "Added attic_gremlin" &&
	git cvsexportcommit -w "$CVSWORK" -c HEAD &&
    (cd "$CVSWORK"; cvs -Q update -d) &&
    test -f "$CVSWORK/attic_gremlin"

expecting success: test_create_repo R &&
	 git --git-dir=R/.git fast-import --big-file-threshold=1 <input
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9300-fast-import/R/.git/
Committed r15
[master f755763] Added attic_gremlin
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 attic_gremlin
	M	auto_updated_file
r15 = 5a464ec6289734200f6d42ce169d26aef516a678 (refs/remotes/git-svn)
	M	auto_updated_file
Creating parent folder file:///«PKGBUILDDIR»/t/trash%20directory.t9167-git-svn-cmd-branch-subproject/svnrepo/tags/tag2 ...
r16 = c33747e08f5b53716ac25b63bd8e50e15cd9bbde (refs/remotes/git-svn)
Checking if patch will apply
Applying
<stdin>:7: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
Patch applied successfully. Adding new files and directories to CVS
cvs add: Re-adding file `attic_gremlin' after dead revision 1.2.
cvs add: use `cvs commit' to add this file permanently
Commit to CVS
Patch title (first comment line): Added attic_gremlin
Autocommit
  cvs commit -F .msg 'attic_gremlin'
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            3 (         1 duplicates                  )
      blobs  :            1 (         1 duplicates          0 deltas of          0 attempts)
      trees  :            1 (         0 duplicates          0 deltas of          1 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              2
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          2
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =    2098060 /    2098060
---------------------------------------------------------------------

ok 149 - R: blob bigger than threshold

expecting success: 
	(
		cd R &&
		verify_packs -v > ../verify
	)


ERROR from SVN:
Transaction is out of date: File '/auto_updated_file' is out of date
ERROR: Not all changes have been committed into SVN.
Please see the above messages for details.

ok 150 - R: verify created pack

expecting success: git --git-dir=R/.git cat-file blob big-file:big1 >actual &&
	 test_cmp_bin expect actual &&
	 a=$(git --git-dir=R/.git rev-parse big-file:big1) &&
	 b=$(git --git-dir=R/.git rev-parse big-file:big2) &&
	 test $a = $b
ok 7 - dcommit --no-rebase concurrent non-conflicting change

expecting success: 
	setup_hook post-commit 1 &&
	next_N && git svn clone "$svnrepo" work$N.git &&
	(
		cd work$N.git &&
		echo a >> file &&
			git commit -am "commit change $N.1" &&
		echo b >> auto_updated_file &&
			git commit -am "commit change $N.2" &&
		echo c >> auto_updated_file &&
			git commit -am "commit change $N.3" &&
		test_must_fail git svn dcommit && # rebase should fail
		test_must_fail git update-index --refresh
	)

ok 151 - R: verify written objects

expecting success: n=$(grep $a verify | wc -l) &&
	 test 1 = $n
ok 152 - R: blob appears only once

expecting success: 
	git fast-import --export-marks=marks <input

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            8 (         0 duplicates                  )
      blobs  :            4 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            2 (         0 duplicates          0 deltas of          2 attempts)
      commits:            2 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         4 unique    )
      atoms:              1
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          2
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        453 /        453
---------------------------------------------------------------------

ok 153 - S: initialize for S tests

expecting success: 
	test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
	commit refs/heads/S
	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
	data <<COMMIT
	commit N
	COMMIT
	M 100644 :403x hello.c
	EOF
	cat err &&
	test_i18ngrep "space after mark" err

fatal: Missing space after mark: M 100644 :403x hello.c
fast-import: dumping crash report to .git/fast_import_crash_9941
fatal: Missing space after mark: M 100644 :403x hello.c
ok 154 - S: filemodify with garbage after mark must fail

expecting success: 
	test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
	commit refs/heads/S
	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
	data <<COMMIT
	commit N
	COMMIT
	M 100644 inlineX hello.c
	data <<BLOB
	inline
	BLOB
	EOF
	cat err &&
	test_i18ngrep "nvalid dataref" err

fatal: Invalid dataref: M 100644 inlineX hello.c
fast-import: dumping crash report to .git/fast_import_crash_9946
fatal: Invalid dataref: M 100644 inlineX hello.c
ok 155 - S: filemodify with garbage after inline must fail

expecting success: 
	sha1=$(grep :403 marks | cut -d\  -f2) &&
	test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
	commit refs/heads/S
	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
	data <<COMMIT
	commit N
	COMMIT
	M 100644 ${sha1}x hello.c
	EOF
	cat err &&
	test_i18ngrep "space after SHA1" err

Copying file:///«PKGBUILDDIR»/t/trash%20directory.t9167-git-svn-cmd-branch-subproject/svnrepo/trunk/project at r2 to file:///«PKGBUILDDIR»/t/trash%20directory.t9167-git-svn-cmd-branch-subproject/svnrepo/tags/tag2/project...
fatal: Missing space after SHA1: M 100644 f4b9ac379fda0ad3560620918bf73440e46eeb8cx hello.c
fast-import: dumping crash report to .git/fast_import_crash_9954
fatal: Missing space after SHA1: M 100644 f4b9ac379fda0ad3560620918bf73440e46eeb8cx hello.c
ok 156 - S: filemodify with garbage after sha1 must fail

expecting success: 
	test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
	commit refs/heads/S
	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
	data <<COMMIT
	commit S note dataref markref
	COMMIT
	N :202x :302
	EOF
	cat err &&
	test_i18ngrep "space after mark" err

fatal: Missing space after mark: N :202x :302
fast-import: dumping crash report to .git/fast_import_crash_9959
fatal: Missing space after mark: N :202x :302
ok 157 - S: notemodify with garabge after mark dataref must fail

expecting success: 
	test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
	commit refs/heads/S
	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
	data <<COMMIT
	commit S note dataref inline
	COMMIT
	N inlineX :302
	data <<BLOB
	note blob
	BLOB
	EOF
	cat err &&
	test_i18ngrep "nvalid dataref" err

fatal: Invalid dataref: N inlineX :302
fast-import: dumping crash report to .git/fast_import_crash_9964
fatal: Invalid dataref: N inlineX :302
ok 158 - S: notemodify with garbage after inline dataref must fail

expecting success: 
	sha1=$(grep :202 marks | cut -d\  -f2) &&
	test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
	commit refs/heads/S
	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
	data <<COMMIT
	commit S note dataref sha1
	COMMIT
	N ${sha1}x :302
	EOF
	cat err &&
	test_i18ngrep "space after SHA1" err

fatal: Missing space after SHA1: N d2f48fdae4e23fc19cf4a8454054695714188709x :302
fast-import: dumping crash report to .git/fast_import_crash_9972
fatal: Missing space after SHA1: N d2f48fdae4e23fc19cf4a8454054695714188709x :302
ok 159 - S: notemodify with garbage after sha1 dataref must fail

expecting success: 
	test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
	commit refs/heads/Snotes
	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
	data <<COMMIT
	commit S note commit-ish
	COMMIT
	N :202 :302x
	EOF
	cat err &&
	test_i18ngrep "after mark" err

fatal: Garbage after mark: N :202 :302x
fast-import: dumping crash report to .git/fast_import_crash_9977
fatal: Garbage after mark: N :202 :302x
ok 160 - S: notemodify with garbage after mark commit-ish must fail

expecting success: 
	test_must_fail \
	git fast-import --import-marks=marks --export-marks=marks <<-EOF 2>err &&
	commit refs/heads/S2
	mark :303
	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
	data <<COMMIT
	commit 3
	COMMIT
	from :301x
	M 100644 :403 hello.c
	EOF


	# go create the commit, need it for merge test
	git fast-import --import-marks=marks --export-marks=marks <<-EOF &&
	commit refs/heads/S2
	mark :303
	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
	data <<COMMIT
	commit 3
	COMMIT
	from :301
	M 100644 :403 hello.c
	EOF

	# now evaluate the error
	cat err &&
	test_i18ngrep "after mark" err

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            2 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            1 (         0 duplicates          0 deltas of          1 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         5 unique    )
      atoms:              1
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          8
pack_report: pack_mmap_calls          =          2
pack_report: pack_open_windows        =          2 /          2
pack_report: pack_mapped              =        678 /        678
---------------------------------------------------------------------

fatal: Garbage after mark: from :301x
fast-import: dumping crash report to .git/fast_import_crash_9982
fatal: Garbage after mark: from :301x
ok 161 - S: from with garbage after mark must fail

expecting success: 
	test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
	commit refs/heads/S
	mark :304
	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
	data <<COMMIT
	merge 4
	COMMIT
	from :302
	merge :303x
	M 100644 :403 hello.c
	EOF
	cat err &&
	test_i18ngrep "after mark" err

/«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/attic_gremlin,v  <--  attic_gremlin
new revision: 1.3; previous revision: 1.2
Committed successfully to CVS
fatal: Garbage after mark: merge :303x
fast-import: dumping crash report to .git/fast_import_crash_9989
fatal: Garbage after mark: merge :303x
ok 162 - S: merge with garbage after mark must fail

expecting success: 
	test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
	tag refs/tags/Stag
	from :302x
	tagger $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
	data <<TAG
	tag S
	TAG
	EOF
	cat err &&
	test_i18ngrep "after mark" err

fatal: Garbage after mark: from :302x
fast-import: dumping crash report to .git/fast_import_crash_9995
fatal: Garbage after mark: from :302x
ok 163 - S: tag with garbage after mark must fail

expecting success: 
	test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
	cat-blob :403x
	EOF
	cat err &&
	test_i18ngrep "after mark" err

fatal: Garbage after mark: cat-blob :403x
fast-import: dumping crash report to .git/fast_import_crash_10000
fatal: Garbage after mark: cat-blob :403x
ok 164 - S: cat-blob with garbage after mark must fail

expecting success: 
	test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
	ls :302x hello.c
	EOF
	cat err &&
	test_i18ngrep "space after mark" err

fatal: Missing space after mark: ls :302x hello.c
fast-import: dumping crash report to .git/fast_import_crash_10005
ok 13 - re-commit a removed filename which remains in CVS attic

expecting success: 

	echo space > " space" &&
	git add " space" &&
	git commit -m "Add a file with a leading space" &&
	id=$(git rev-parse HEAD) &&
	git cvsexportcommit -w "$CVSWORK" -c $id &&
	check_entries "$CVSWORK" " space/1.1/|DS/1.1/|attic_gremlin/1.3/|release-notes/1.2/" &&
	test_cmp "$CVSWORK/ space" " space"


fatal: Missing space after mark: ls :302x hello.c
ok 165 - S: ls with garbage after mark must fail

expecting success: 
	sha1=$(grep :302 marks | cut -d\  -f2) &&
	test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
	ls ${sha1}x hello.c
	EOF
	cat err &&
	test_i18ngrep "space after tree-ish" err

fatal: Missing space after tree-ish: ls 09b8212d623219bb80c949d5065e559b231d90adx hello.c
fast-import: dumping crash report to .git/fast_import_crash_10016
[master 4d49bab] Add a file with a leading space
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644  space
fatal: Missing space after tree-ish: ls 09b8212d623219bb80c949d5065e559b231d90adx hello.c
ok 166 - S: ls with garbage after sha1 must fail

expecting success: 
	sed -e "s/Z\$//" >expect <<-EOF &&
	040000 tree $(git rev-parse S^{tree})	Z
	EOF
	sha1=$(git rev-parse --verify S) &&
	git fast-import --import-marks=marks <<-EOF >actual &&
	ls $sha1 ""
	EOF
	test_cmp expect actual

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         5 unique    )
      atoms:              1
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          8
pack_report: pack_mmap_calls          =          2
pack_report: pack_open_windows        =          2 /          2
pack_report: pack_mapped              =        678 /        678
---------------------------------------------------------------------

ok 167 - T: ls root tree

expecting success: 
	git branch to-delete &&
	git fast-import <<-EOF &&
	reset refs/heads/to-delete
	from 0000000000000000000000000000000000000000
	EOF
	test_must_fail git rev-parse --verify refs/heads/to-delete

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         0 loads     )
      marks:           1024 (         0 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          0
pack_report: pack_mmap_calls          =          0
pack_report: pack_open_windows        =          0 /          0
pack_report: pack_mapped              =          0 /          0
---------------------------------------------------------------------

fatal: Needed a single revision
ok 168 - T: delete branch

expecting success: 
	git branch not-to-delete &&
	git fast-import <<-EOF &&
	reset refs/heads/not-to-delete
	EOF
	git show-ref &&
	git rev-parse --verify refs/heads/not-to-delete

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         0 loads     )
      marks:           1024 (         0 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          0
pack_report: pack_mmap_calls          =          0
pack_report: pack_open_windows        =          0 /          0
pack_report: pack_mapped              =          0 /          0
---------------------------------------------------------------------

8c1bf1b9f891df8805c27a54986e5043829939ad refs/heads/H
45b12606bd487d1bc687864db7641b9bfd4ddcd0 refs/heads/J
c85b9f480bbc2f7616de78fc96c08204e0f5b70e refs/heads/K
8cecdab6b3e4062de5b06ad3accf5bff1449e99b refs/heads/L
7144e0bde79efa21349b6a09f1b68b74e59da773 refs/heads/M1
0641406b2b83a2c327e6950aa51f13010fe647b1 refs/heads/M2
b258d10cb71ac72904c40ef2d07b67e3f444ce19 refs/heads/M3
afc4da065d1be07543ab49500b355f7342f5a0bf refs/heads/M4
d80c4052a8e9a163f90de3fa74ec993595d7f0b3 refs/heads/N-copy-root-path
d3d6f982387839292885129c8f925f0437fe8f8f refs/heads/N-delete
3a992f7db92c8513f272cb38ecd20b1891ea3618 refs/heads/N1
c5e590066ca8fc360460c8c12cb33cb852fe8d0e refs/heads/N10
0d366d7b90432787294f20469f92247cd2951e56 refs/heads/N11
feb51e70222384549d211ed8556032a4d8de86d5 refs/heads/N2
c9fa8f49cd89b0c79e2653acbf382fc67897cacc refs/heads/N3
9d4aea7a2664059c10686d61ddd966f87bb2e5e1 refs/heads/N4
72ab72aa5baed6139c0e3d8e970743a3b95c04ff refs/heads/N5
0cc1189ab86929904ba103aecb7d99a9f4ceefb0 refs/heads/N6
94c8d03670e041ed0d66ff5434e05078c76fe308 refs/heads/N7
6377394cead24e0a81b85518dd6aae87af60b2d5 refs/heads/N8
50a2b9031b6d523dbb219a9618b84e771592ce06 refs/heads/N9
c9fa8f49cd89b0c79e2653acbf382fc67897cacc refs/heads/O1
c9fa8f49cd89b0c79e2653acbf382fc67897cacc refs/heads/O2
5fda0e679bf57704417152105e584e0a694c013c refs/heads/O3
5fda0e679bf57704417152105e584e0a694c013c refs/heads/O4
09b8212d623219bb80c949d5065e559b231d90ad refs/heads/S
08ce2f4d8b480172783d3891735f90a7d7e00607 refs/heads/S2
f9eb178a57581c4b6ee59a2a22ee91689c065e26 refs/heads/branch
e539ffaa4ddf139e244fadc551da26e24df78619 refs/heads/copied
c04abfe6415075f472cd37c5c8655c105f9934e6 refs/heads/done-ends
d892dc32fa7a52ea3a397cfc4449e9df8a39becf refs/heads/export-boundary
5ba2d0485e3e071f4ccbfdb22c474b305ebd159c refs/heads/master
994b824fbe51b899f546383c3ba14a28a07c1022 refs/heads/new_blob
cf71ea52d4da512147ae77301c3770dc013a443a refs/heads/not-to-delete
7aa420e73b93d5b69059a2ff8e850a2ed9411187 refs/heads/notes-test
fb7baf16109664b6b1d3b3c98d6c252fa7051ae5 refs/heads/other
e908a53cdb6af68565f1b355f92ce0fc768a58b1 refs/heads/read-empty
cf71ea52d4da512147ae77301c3770dc013a443a refs/heads/subuse1
cf71ea52d4da512147ae77301c3770dc013a443a refs/heads/subuse2
65eaf13fb93713eb9d3f5e4e899ade4effc77e3e refs/heads/temporary
6b33e55cd592e91710d6c0afef1b0e6e3406a2a7 refs/heads/verify--dump-marks
ac2b62088fe0283163c00fa7856bcd0489cf30de refs/heads/verify--import-marks
65eaf13fb93713eb9d3f5e4e899ade4effc77e3e refs/heads/within
b8613b3cac8d5f3f8aecc431636e4c27c64699dc refs/notes/foobar
e684625a6e98f3faaa87d19d490e005e375de0e3 refs/notes/foobar2
c713cf4a9446ade70da02a4734370997de4d36e6 refs/tags/O3-2nd
c713cf4a9446ade70da02a4734370997de4d36e6 refs/tags/O3-3rd
103553a16e02d76e288cec0f76240f1ad97caeb9 refs/tags/series-A
42d861d649a1b87eb8083ad1d94d9220ecf2c35f refs/tags/series-A-blob
3750af27267cae07dd3f8b7a9aac2291e374a66a refs/tags/series-A-blob-2
56c14ce987117cf2e391ebef3dbab65e4c1ed202 refs/tags/series-A-blob-3
cf71ea52d4da512147ae77301c3770dc013a443a
ok 169 - T: empty reset doesnt delete branch

expecting success: 
	git fast-import <input

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            5 (         1 duplicates                  )
      blobs  :            2 (         1 duplicates          0 deltas of          0 attempts)
      trees  :            2 (         0 duplicates          0 deltas of          2 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              4
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          2
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        348 /        348
---------------------------------------------------------------------

ok 170 - U: initialize for U tests

expecting success: 
	git fast-import <input

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            3 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            2 (         0 duplicates          0 deltas of          2 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              4
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          7
pack_report: pack_mmap_calls          =          2
pack_report: pack_open_windows        =          2 /          2
pack_report: pack_mapped              =        660 /        660
---------------------------------------------------------------------

ok 171 - U: filedelete file succeeds

expecting success: 
	compare_diff_raw expect actual

ok 172 - U: validate file delete result

expecting success: 
	git fast-import <input

Checking if patch will apply
cvs status: nothing known about ` space'
Applying
Patch applied successfully. Adding new files and directories to CVS
cvs add: scheduling file ` space' for addition
cvs add: use `cvs commit' to add this file permanently
Commit to CVS
Patch title (first comment line): Add a file with a leading space
Autocommit
  cvs commit -F .msg  space
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            1 (         1 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         1 duplicates          0 deltas of          0 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              2
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          7
pack_report: pack_mmap_calls          =          3
pack_report: pack_open_windows        =          3 /          3
pack_report: pack_mapped              =        846 /        846
---------------------------------------------------------------------

Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9167-git-svn-cmd-branch-subproject/svnrepo/trunk/project => file:///«PKGBUILDDIR»/t/trash%20directory.t9167-git-svn-cmd-branch-subproject/svnrepo/tags/tag2/project, 2
ok 173 - U: filedelete directory succeeds

expecting success: 
	compare_diff_raw expect actual

ok 174 - U: validate directory delete result

expecting success: 
    git fast-import <input

Found branch parent: (refs/remotes/origin/tags/tag2) 270fecf238e4a92f63725728742820e3065d2de3
Following parent with do_switch
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            1 (         1 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         1 duplicates          0 deltas of          0 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              1
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          8
pack_report: pack_mmap_calls          =          5
pack_report: pack_open_windows        =          5 /          5
pack_report: pack_mapped              =       1484 /       1484
---------------------------------------------------------------------

ok 175 - U: filedelete root succeeds

expecting success: 
	compare_diff_raw expect actual

ok 176 - U: validate root delete result

# passed all 176 test(s)
1..176
Successfully followed parent
*** t9301-fast-import-notes.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9301-fast-import-notes/.git/
r8 = 63789c3f55c4d84d1ab45bd588ec29ee2ac37bba (refs/remotes/origin/tags/tag2)
expecting success: 

	git fast-import <input &&
	git whatchanged master

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:           17 (         0 duplicates                  )
      blobs  :            7 (         0 duplicates          0 deltas of          7 attempts)
      trees  :            6 (         0 duplicates          3 deltas of          6 attempts)
      commits:            4 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              4
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          2
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =       1217 /       1217
---------------------------------------------------------------------

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9164-git-svn-dcommit-concurrent/work5.git/.git/
commit 9a93771a958bca801f51ff270bc677be08b70970
Author: C O Mitter <committer@example.com>
Date:   Thu Apr 7 15:13:13 2005 -0700

    fourth commit

:100755 100755 3c9b917... 98d1b63... M	bar

commit dbe3ab44992634d04709231cc00251483e46cff8
Author: C O Mitter <committer@example.com>
Date:   Thu Apr 7 15:13:13 2005 -0700

    third commit

:100644 100644 215df20... 634bd2b... M	foo

commit bcc89d2db5d163929b6fbd169c2559b47a076acb
Author: C O Mitter <committer@example.com>
Date:   Thu Apr 7 15:13:13 2005 -0700

    second commit

:100644 100755 532386d... be960bf... M	baz/xyzzy
:100644 100644 df023b2... 215df20... M	foo

commit 49f8b007d515fc33aed8245ee498753d4270cc78
Author: C O Mitter <committer@example.com>
Date:   Thu Apr 7 15:13:13 2005 -0700

    first commit

:000000 100755 0000000... 3c9b917... A	bar
:000000 100644 0000000... 532386d... A	baz/xyzzy
:000000 100644 0000000... df023b2... A	foo
ok 1 - set up master branch

expecting success: 

	git fast-import <input &&
	GIT_NOTES_REF=refs/notes/test git log | grep "^    " > actual &&
	test_cmp expect actual


git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            4 (         0 duplicates                  )
      blobs  :            2 (         0 duplicates          0 deltas of          2 attempts)
      trees  :            1 (         0 duplicates          0 deltas of          1 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              2
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          2
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        376 /        376
---------------------------------------------------------------------

ok 2 - add notes with simple M command

expecting success: 

	git fast-import <input &&
	GIT_NOTES_REF=refs/notes/test git log | grep "^    " > actual &&
	test_cmp expect actual


git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            4 (         0 duplicates                  )
      blobs  :            2 (         0 duplicates          0 deltas of          2 attempts)
      trees  :            1 (         0 duplicates          0 deltas of          1 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              4
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          8
pack_report: pack_mmap_calls          =          3
pack_report: pack_open_windows        =          3 /          3
pack_report: pack_mapped              =       2118 /       2118
---------------------------------------------------------------------

ok 3 - add notes with simple N command

expecting success: 

	git fast-import <input &&
	GIT_NOTES_REF=refs/notes/test git log | grep "^    " > actual &&
	test_cmp expect actual


/«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/tmpcvsroot/ space,v  <--   space
initial revision: 1.1
Committed successfully to CVS
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            6 (         0 duplicates                  )
      blobs  :            4 (         0 duplicates          0 deltas of          4 attempts)
      trees  :            1 (         0 duplicates          0 deltas of          1 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              4
Memory total:          2294 KiB
       pools:          2098 KiB
	A	auto_updated_file
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =         11
pack_report: pack_mmap_calls          =          4
pack_report: pack_open_windows        =          4 /          4
pack_report: pack_mapped              =       2714 /       2714
---------------------------------------------------------------------

	A	file
ok 14 - commit a file with leading spaces in the name

expecting success: 

	(mkdir shared &&
	 cd shared &&
	 sane_unset GIT_DIR &&
	 cvs co . &&
	 git init &&
	 git add " space" &&
	 git commit -m "fake initial commit" &&
	 echo Hello >> " space" &&
	 git commit -m "Another change" " space" &&
	 git cvsexportcommit -W -p -u -c HEAD &&
	 grep Hello " space" &&
	 git diff-files)


ok 4 - update existing notes with N command

cvs checkout: Updating .
U  space
U DS
U attic_gremlin
U release-notes
cvs checkout: Updating A
expecting success: 

	git fast-import <input &&
	GIT_NOTES_REF=refs/notes/test git log | grep "^    " > actual &&
	test_cmp expect actual


cvs checkout: Updating B
cvs checkout: Updating C
cvs checkout: Updating CVSROOT
U CVSROOT/checkoutlist
U CVSROOT/commitinfo
U CVSROOT/config
U CVSROOT/cvswrappers
U CVSROOT/loginfo
U CVSROOT/modules
U CVSROOT/notify
U CVSROOT/postadmin
U CVSROOT/postproxy
U CVSROOT/posttag
U CVSROOT/postwatch
U CVSROOT/preproxy
U CVSROOT/rcsinfo
U CVSROOT/taginfo
U CVSROOT/verifymsg
cvs checkout: Updating D
cvs checkout: Updating E
U E/DS
U E/newfile5.txt
cvs checkout: Updating F
U F/newfile6.png
cvs checkout: Updating G
U G/off
U G/on
cvs checkout: Updating G g
U G g/with spaces.png
U G g/with spaces.txt
cvs checkout: Updating W
U W/file1.txt
U W/file2.txt
cvs checkout: Updating Å
cvs checkout: Updating Å/goo
cvs checkout: Updating Å/goo/a
cvs checkout: Updating Å/goo/a/b
cvs checkout: Updating Å/goo/a/b/c
cvs checkout: Updating Å/goo/a/b/c/d
cvs checkout: Updating Å/goo/a/b/c/d/e
cvs checkout: Updating Å/goo/a/b/c/d/e/f
cvs checkout: Updating Å/goo/a/b/c/d/e/f/g
cvs checkout: Updating Å/goo/a/b/c/d/e/f/g/h
cvs checkout: Updating Å/goo/a/b/c/d/e/f/g/h/i
cvs checkout: Updating Å/goo/a/b/c/d/e/f/g/h/i/j
cvs checkout: Updating Å/goo/a/b/c/d/e/f/g/h/i/j/k
cvs checkout: Updating Å/goo/a/b/c/d/e/f/g/h/i/j/k/l
cvs checkout: Updating Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m
cvs checkout: Updating Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n
cvs checkout: Updating Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o
cvs checkout: Updating Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p
cvs checkout: Updating Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q
cvs checkout: Updating Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r
r1 = 81bef992ba6728ca52cc14227fafed83977a58c1 (refs/remotes/git-svn)
cvs checkout: Updating Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s
cvs checkout: Updating Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t
cvs checkout: Updating Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u
cvs checkout: Updating Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v
cvs checkout: Updating Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w
cvs checkout: Updating Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x
cvs checkout: Updating Å/goo/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
cvs checkout: Updating Å/goo/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
cvs checkout: Updating Å/goo/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/å
cvs checkout: Updating Å/goo/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/å/ä
cvs checkout: Updating Å/goo/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/å/ä/ö
U Å/goo/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/å/ä/ö/gårdetsågårdet.png
U Å/goo/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/å/ä/ö/gårdetsågårdet.txt
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:           12 (         0 duplicates                  )
      blobs  :            7 (         0 duplicates          0 deltas of          7 attempts)
      trees  :            4 (         0 duplicates          0 deltas of          4 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:             10
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =         11
pack_report: pack_mmap_calls          =          4
pack_report: pack_open_windows        =          4 /          4
pack_report: pack_mapped              =       3371 /       3371
---------------------------------------------------------------------

ok 5 - add concatentation notes with M command

expecting success: 

	git fast-import <input &&
	GIT_NOTES_REF=refs/notes/test git log | grep "^    " > actual &&
	test_cmp expect actual


	M	file
r2 = 418f45ddd614e4555be79d8eac201a8096b64461 (refs/remotes/git-svn)
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            2 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            1 (         0 duplicates          0 deltas of          0 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              6
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          7
pack_report: pack_mmap_calls          =          3
pack_report: pack_open_windows        =          3 /          3
pack_report: pack_mapped              =       1827 /       1827
---------------------------------------------------------------------

ok 6 - verify that deleteall also removes notes

expecting success: 

	git fast-import <input &&
	GIT_NOTES_REF=refs/notes/test git log | grep "^    " > actual &&
	test_cmp expect actual


	M	auto_updated_file
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            4 (         2 duplicates                  )
      blobs  :            2 (         2 duplicates          0 deltas of          2 attempts)
      trees  :            1 (         0 duplicates          0 deltas of          1 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:              2
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          8
pack_report: pack_mmap_calls          =          4
pack_report: pack_open_windows        =          4 /          4
pack_report: pack_mapped              =       2858 /       2858
---------------------------------------------------------------------

ok 7 - verify that later N commands override earlier M commands

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9200-git-cvsexportcommit/shared/.git/
[master (root-commit) 0b50813] fake initial commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644  space
r3 = 8b9e0ba58b7c3a36d69be3fd31d0ce333ff93b40 (refs/remotes/git-svn)
[master 428e84e] Another change
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
	M	file
r4 = 7aadf4a990c4abb24fff392994f0882431f5a830 (refs/remotes/git-svn)
	M	file
r5 = 4166bae3a35456dfe53fbdf2b94d4aa429f226d2 (refs/remotes/git-svn)
	M	file
Checking if patch will apply
Applying
Patch applied successfully. Adding new files and directories to CVS
Commit to CVS
Patch title (first comment line): Another change
Autocommit
  cvs commit -F .msg  space
r6 = a4ed9e4e15ebbf8bcf2488188ca0326582ede274 (refs/remotes/git-svn)
Committed successfully to CVS
HEAD is now at 428e84e... Another change
	M	file
Copying file:///«PKGBUILDDIR»/t/trash%20directory.t9167-git-svn-cmd-branch-subproject/svnrepo/trunk/project at r2 to file:///«PKGBUILDDIR»/t/trash%20directory.t9167-git-svn-cmd-branch-subproject/svnrepo/tags/tag3/project...
r7 = 7bf50464b594c0ccebe33d61b21b970aac055944 (refs/remotes/git-svn)
Hello
ok 15 - use the same checkout for Git and CVS

# passed all 15 test(s)
1..15
	M	auto_updated_file
r8 = 7875a6e9d54a385095f45a45ae773941cc814463 (refs/remotes/git-svn)
Filesystem has no item: File not found: transaction '8-b', path '/tags/tag3/project' at /«PKGBUILDDIR»/git-svn line 1196.

*** t9350-fast-export.sh ***
	M	file
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9350-fast-export/.git/
expecting success: 

	echo break it > file0 &&
	git add file0 &&
	test_tick &&
	echo Wohlauf > file &&
	git add file &&
	test_tick &&
	git commit -m initial &&
	echo die Luft > file &&
	echo geht frisch > file2 &&
	git add file file2 &&
	test_tick &&
	git commit -m second &&
	echo und > file2 &&
	test_tick &&
	git commit -m third file2 &&
	test_tick &&
	git tag rein &&
	git checkout -b wer HEAD^ &&
	echo lange > file2 &&
	test_tick &&
	git commit -m sitzt file2 &&
	test_tick &&
	git tag -a -m valentin muss &&
	git merge -s ours master


r9 = 60be0f3071e237f99130a471ad1631075a3e8d99 (refs/remotes/git-svn)
[master (root-commit) 283ea05] initial
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 file
 create mode 100644 file0
[master 300cb83] second
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 file2
[master 80f15f4] third
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Switched to a new branch 'wer'
	M	auto_updated_file
[wer 708f3c9] sitzt
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
Merge made by the 'ours' strategy.
ok 1 - setup

expecting success: 

	MASTER=$(git rev-parse --verify master) &&
	REIN=$(git rev-parse --verify rein) &&
	WER=$(git rev-parse --verify wer) &&
	MUSS=$(git rev-parse --verify muss) &&
	mkdir new &&
	git --git-dir=new/.git init &&
	git fast-export --all |
	(cd new &&
	 git fast-import &&
	 test $MASTER = $(git rev-parse --verify refs/heads/master) &&
	 test $REIN = $(git rev-parse --verify refs/tags/rein) &&
	 test $WER = $(git rev-parse --verify refs/heads/wer) &&
	 test $MUSS = $(git rev-parse --verify refs/tags/muss))


r10 = faeb2677b929c1bb167d01599918610c836a4e65 (refs/remotes/git-svn)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9350-fast-export/new/.git/
	M	auto_updated_file
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:           16 (         0 duplicates                  )
      blobs  :            6 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            4 (         0 duplicates          3 deltas of          4 attempts)
      commits:            5 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            1 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           4 (         3 loads     )
      marks:           1024 (        11 unique    )
      atoms:              3
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =         13
pack_report: pack_mmap_calls          =          4
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =       1287 /       1287
---------------------------------------------------------------------

ok 2 - fast-export | fast-import

expecting success: 

	git fast-export master~2..master |
		sed "s/master/partial/" |
		(cd new &&
		 git fast-import &&
		 test $MASTER != $(git rev-parse --verify refs/heads/partial) &&
		 git diff --exit-code master partial &&
		 git diff --exit-code master^ partial^ &&
		 test_must_fail git rev-parse partial~2)


r11 = 75c3d594f15c761bafa1680482b9a82f834217b9 (refs/remotes/git-svn)
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            2 (         6 duplicates                  )
      blobs  :            0 (         4 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         2 duplicates          0 deltas of          0 attempts)
      commits:            2 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         6 unique    )
      atoms:              3
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          2
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        320 /        320
---------------------------------------------------------------------

fatal: ambiguous argument 'partial~2': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
partial~2
ok 3 - fast-export master~2..master

expecting success: 

	git config i18n.commitencoding ISO8859-1 &&
	# use author and committer name in ISO-8859-1 to match it.
	. "$TEST_DIRECTORY"/t3901-8859-1.txt &&
	test_tick &&
	echo rosten >file &&
	git commit -s -m den file &&
	git fast-export wer^..wer |
		sed "s/wer/i18n/" |
		(cd new &&
		 git fast-import &&
		 git cat-file commit i18n | grep "Áéí óú")


	M	auto_updated_file
[wer 4b98d28] den
 1 file changed, 1 insertion(+), 1 deletion(-)
r12 = fb02de9b059c0721cc526c13d5f09b2402cbd770 (refs/remotes/git-svn)
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            3 (         2 duplicates                  )
      blobs  :            1 (         2 duplicates          0 deltas of          0 attempts)
      trees  :            1 (         0 duplicates          0 deltas of          1 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         4 unique    )
      atoms:              3
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          2
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        296 /        296
---------------------------------------------------------------------

Signed-off-by: Áéí óú <committer@example.com>
ok 4 - iso-8859-1

expecting success: 

	git checkout -b marks master &&
	git fast-export --export-marks=tmp-marks HEAD &&
	test -s tmp-marks &&
	test_line_count = 3 tmp-marks &&
	test $(
		git fast-export --import-marks=tmp-marks\
		--export-marks=tmp-marks HEAD |
		grep ^commit |
		wc -l) \
	-eq 0 &&
	echo change > file &&
	git commit -m "last commit" file &&
	test $(
		git fast-export --import-marks=tmp-marks \
		--export-marks=tmp-marks HEAD |
		grep ^commit\  |
		wc -l) \
	-eq 1 &&
	test_line_count = 4 tmp-marks


Switched to a new branch 'marks'
blob
mark :1
data 8
Wohlauf

blob
mark :2
data 9
break it

reset refs/heads/marks
commit refs/heads/marks
mark :3
author A U Thor <author@example.com> 1112912053 -0700
committer C O Mitter <committer@example.com> 1112912053 -0700
data 8
initial
M 100644 :2 file0
M 100644 :1 file

blob
mark :4
data 9
die Luft

blob
mark :5
data 12
geht frisch

commit refs/heads/marks
mark :6
author A U Thor <author@example.com> 1112912113 -0700
committer C O Mitter <committer@example.com> 1112912113 -0700
data 7
second
from :3
M 100644 :5 file2
M 100644 :4 file

blob
mark :7
data 4
und

commit refs/heads/marks
mark :8
author A U Thor <author@example.com> 1112912173 -0700
committer C O Mitter <committer@example.com> 1112912173 -0700
data 6
third
from :6
M 100644 :7 file2

[marks 980bbeb] last commit
 1 file changed, 1 insertion(+), 1 deletion(-)
	M	auto_updated_file
ok 5 - import/export-marks

expecting success: 

	cat signed-tag-import | git fast-import


r13 = ef460deee795f9033dae3083da67dba388f8806f (refs/remotes/git-svn)
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            1 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            1 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         0 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          2
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        265 /        265
---------------------------------------------------------------------

ok 6 - set up faked signed tag

expecting success: 

	test_must_fail git fast-export --signed-tags=abort sign-your-name


fatal: Encountered signed tag 30a1ea1d31d22db1cca9472db9cb9a9b98e93ed2; use --signed-tags=<mode> to handle it.
blob
mark :1
data 8
Wohlauf

blob
mark :2
data 9
break it

reset refs/tags/sign-your-name
commit refs/tags/sign-your-name
mark :3
author A U Thor <author@example.com> 1112912053 -0700
committer C O Mitter <committer@example.com> 1112912053 -0700
data 8
initial
M 100644 :2 file0
M 100644 :1 file

blob
mark :4
data 9
die Luft

blob
mark :5
data 12
geht frisch

commit refs/tags/sign-your-name
mark :6
author A U Thor <author@example.com> 1112912113 -0700
committer C O Mitter <committer@example.com> 1112912113 -0700
data 7
second
from :3
M 100644 :5 file2
M 100644 :4 file

blob
mark :7
data 4
und

commit refs/tags/sign-your-name
mark :8
author A U Thor <author@example.com> 1112912173 -0700
committer C O Mitter <committer@example.com> 1112912173 -0700
data 6
third
from :6
M 100644 :7 file2

blob
mark :9
data 7
change

commit refs/tags/sign-your-name
mark :10
data 12
last commit
from :8
M 100644 :9 file

ok 7 - signed-tags=abort

expecting success: 

	git fast-export --signed-tags=verbatim sign-your-name > output &&
	grep PGP output


-----BEGIN PGP SIGNATURE-----
-----END PGP SIGNATURE-----
ok 8 - signed-tags=verbatim

expecting success: 

	git fast-export --signed-tags=strip sign-your-name > output &&
	! grep PGP output


ok 9 - signed-tags=strip

expecting success: 
	git fast-export --signed-tags=warn-strip sign-your-name >output 2>err &&
	! grep PGP output &&
	test -s err

	M	auto_updated_file
ok 10 - signed-tags=warn-strip

expecting success: 

	git checkout -f master &&
	mkdir sub &&
	(
		cd sub &&
		git init  &&
		echo test file > file &&
		git add file &&
		git commit -m sub_initial
	) &&
	git submodule add "`pwd`/sub" sub &&
	git commit -m initial &&
	test_tick &&
	(
		cd sub &&
		echo more data >> file &&
		git add file &&
		git commit -m sub_second
	) &&
	git add sub &&
	git commit -m second


Switched to branch 'master'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9350-fast-export/sub/.git/
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.
r14 = 62bd92c775467e633adf1912c27cf08f38835305 (refs/remotes/git-svn)
[master (root-commit) 5e993c9] sub_initial
 Author: Áéí óú <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
Adding existing repo at 'sub' to the index
	M	auto_updated_file
[master 2f0f47b] initial
 2 files changed, 4 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 sub
r15 = 5a464ec6289734200f6d42ce169d26aef516a678 (refs/remotes/git-svn)
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.
[master 7dd3a5a] sub_second
 Author: Áéí óú <author@example.com>
 1 file changed, 1 insertion(+)
[master 9a3ac15] second
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 11 - setup submodule

expecting success: 

	SUBENT1=$(git ls-tree master^ sub) &&
	SUBENT2=$(git ls-tree master sub) &&
	rm -rf new &&
	mkdir new &&
	git --git-dir=new/.git init &&
	git fast-export --signed-tags=strip --all |
	(cd new &&
	 git fast-import &&
	 test "$SUBENT1" = "$(git ls-tree refs/heads/master^ sub)" &&
	 test "$SUBENT2" = "$(git ls-tree refs/heads/master sub)" &&
	 git checkout master &&
	 git submodule init &&
	 git submodule update &&
	 cmp sub/file ../sub/file)


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9350-fast-export/new/.git/
	M	auto_updated_file
r16 = c33747e08f5b53716ac25b63bd8e50e15cd9bbde (refs/remotes/git-svn)
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:           28 (         0 duplicates                  )
      blobs  :            9 (         0 duplicates          0 deltas of          1 attempts)
      trees  :            8 (         0 duplicates          7 deltas of          8 attempts)
      commits:            9 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            2 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           6 (         5 loads     )
      marks:           1024 (        18 unique    )
      atoms:              5
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =         24
pack_report: pack_mmap_calls          =          6
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =       2459 /       2459
---------------------------------------------------------------------

Already on 'master'
Checked out HEAD:
  file:///«PKGBUILDDIR»/t/trash%20directory.t9164-git-svn-dcommit-concurrent/svnrepo r16
Submodule 'sub' (/«PKGBUILDDIR»/t/trash directory.t9350-fast-export/sub) registered for path 'sub'
[master 0e65434] commit change 5.1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master 50b1351] commit change 5.2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master 4913402] commit change 5.3
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
Creating parent folder file:///«PKGBUILDDIR»/t/trash%20directory.t9167-git-svn-cmd-branch-subproject/svnrepo/tags/tag3 ...
Cloning into 'sub'...
done.
Submodule path 'sub': checked out '7dd3a5a9b932342b35682561c97836beb1adf5ee'
ok 12 - submodule fast-export | fast-import

expecting success: 

	git config --unset i18n.commitencoding &&
	git checkout -b copy rein &&
	git mv file file3 &&
	git commit -m move1 &&
	test_tick &&
	cp file2 file4 &&
	git add file4 &&
	git mv file2 file5 &&
	git commit -m copy1 &&
	test_tick &&
	cp file3 file6 &&
	git add file6 &&
	git commit -m copy2 &&
	test_tick &&
	echo more text >> file6 &&
	echo even more text >> file6 &&
	git add file6 &&
	git commit -m modify &&
	test_tick &&
	cp file6 file7 &&
	echo test >> file7 &&
	git add file7 &&
	git commit -m copy_modify


warning: unable to rmdir sub: Directory not empty
Switched to a new branch 'copy'
[copy 16740da] move1
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename file => file3 (100%)
[copy 0d83758] copy1
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+)
 rename file2 => file4 (100%)
 create mode 100644 file5
[copy 44ca68a] copy2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file6
[copy 22ab272] modify
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+)
[copy ed9d1ab] copy_modify
 Author: A U Thor <author@example.com>
 1 file changed, 4 insertions(+)
 create mode 100644 file7
ok 13 - setup copies

expecting success: 

	ENTRY=$(git rev-parse --verify copy) &&
	rm -rf new &&
	mkdir new &&
	git --git-dir=new/.git init &&
	git fast-export -C -C --signed-tags=strip --all > output &&
	grep "^C file6 file7\$" output &&
	cat output |
	(cd new &&
	 git fast-import &&
	 test $ENTRY = $(git rev-parse --verify refs/heads/copy))


expecting success: 

	git fast-import <input &&
	GIT_NOTES_REF=refs/notes/many_notes git log refs/heads/many_commits |
	    grep "^    " > actual &&
	test_cmp expect actual


Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9350-fast-export/new/.git/
C file6 file7
Copying file:///«PKGBUILDDIR»/t/trash%20directory.t9167-git-svn-cmd-branch-subproject/svnrepo/trunk/project at r2 to file:///«PKGBUILDDIR»/t/trash%20directory.t9167-git-svn-cmd-branch-subproject/svnrepo/tags/tag3/project...
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:           40 (         0 duplicates                  )
      blobs  :           11 (         0 duplicates          1 deltas of          3 attempts)
      trees  :           13 (         0 duplicates         12 deltas of         13 attempts)
      commits:           14 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            2 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           7 (         6 loads     )
      marks:           1024 (        25 unique    )
      atoms:             10
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =         28
pack_report: pack_mmap_calls          =          7
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =       3588 /       3588
---------------------------------------------------------------------

ok 14 - fast-export -C -C | fast-import

expecting success: 

	git tag -m msg last &&
	git fast-export -C -C --signed-tags=strip --all > output &&
	test $(grep -c "^tag " output) = 3


ok 15 - fast-export | fast-import when master is tagged

expecting success: 

	TAG=$(git hash-object -t tag -w tag-content) &&
	git update-ref refs/tags/sonnenschein $TAG &&
	git fast-export -C -C --signed-tags=strip --all > output &&
	test $(grep -c "^tag " output) = 4 &&
	! grep "Unspecified Tagger" output &&
	git fast-export -C -C --signed-tags=strip --all \
		--fake-missing-tagger > output &&
	test $(grep -c "^tag " output) = 4 &&
	grep "Unspecified Tagger" output


tagger Unspecified Tagger <unspecified-tagger> 0 +0000
ok 16 - cope with tagger-less tags

expecting success: 
	mkdir limit-by-paths &&
	(
		cd limit-by-paths &&
		git init &&
		echo hi > there &&
		git add there &&
		git commit -m "First file" &&
		echo foo > bar &&
		git add bar &&
		git commit -m "Second file" &&
		git tag -a -m msg mytag &&
		echo morefoo >> bar &&
		git add bar &&
		git commit -m "Change to second file"
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9350-fast-export/limit-by-paths/.git/
[master (root-commit) c4bb517] First file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 there
[master 5b2b7c2] Second file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 bar
[master 49ac088] Change to second file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
ok 17 - setup for limiting exports by PATH

expecting success: 
(
	cd limit-by-paths &&
	git fast-export --tag-of-filtered-object=drop mytag -- there > output &&
	test_cmp expected output
)

ok 18 - dropping tag of filtered out object

expecting success: 
(
	cd limit-by-paths &&
	git fast-export --tag-of-filtered-object=rewrite mytag -- there > output &&
	test_cmp expected output
)

ok 19 - rewriting tag of filtered out object

checking known breakage: 
	(
		cd limit-by-paths &&
		git fast-export master~2..master~1 > output &&
		test_cmp expected output
	)

--- expected	2015-12-16 11:21:46.101565002 +0000
+++ output	2015-12-16 11:21:46.129565002 +0000
@@ -8,8 +8,7 @@
 data 3
 hi
 
-reset refs/heads/master
-commit refs/heads/master
+commit master~1
 mark :3
 author A U Thor <author@example.com> 1112912713 -0700
 committer C O Mitter <committer@example.com> 1112912713 -0700
not ok 20 - no exact-ref revisions included # TODO known breakage

expecting success: 
	git checkout -b simple marks~2 &&
	git fast-export --export-marks=marks simple -- file > /dev/null &&
	echo more content >> file &&
	test_tick &&
	git commit -mnext file &&
	git fast-export --import-marks=marks simple -- file file0 | grep file0

Switched to a new branch 'simple'
[simple ed6c25d] next
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
M 100644 :6 file0
ok 21 - path limiting with import-marks does not lose unmodified files

expecting success: 
	git checkout -f simple &&
	test $(git fast-export --full-tree simple | grep -c file0) -eq 3

Already on 'simple'
ok 22 - full-tree re-shows unmodified files

expecting success: 
	git checkout -f master &&
	HEAD_TREE=`git show -s --pretty=raw HEAD | grep tree | sed "s/tree //"` &&
	git tag    tree_tag        -m "tagging a tree" $HEAD_TREE &&
	git tag -a tree_tag-obj    -m "tagging a tree" $HEAD_TREE &&
	git tag    tag-obj_tag     -m "tagging a tag" tree_tag-obj &&
	git tag -a tag-obj_tag-obj -m "tagging a tag" tree_tag-obj

Switched to branch 'master'
ok 23 - set-up a few more tags for tag export tests

expecting success: 
	mkdir result &&
	(cd result && git init) &&
	git fast-export tree_tag > fe-stream &&
	(cd result && git fast-import < ../fe-stream)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9350-fast-export/result/.git/
warning: Tag points to object of unexpected type tree, skipping.
warning: Omitting tag 388f9f2cf31e95bf2952f7fb95e3bc54fdd1953f,
since tags of trees (or tags of tags of trees, etc.) are not supported.
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         0 unique    )
      atoms:              0
Memory total:          2243 KiB
       pools:          2048 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          0
pack_report: pack_mmap_calls          =          0
pack_report: pack_open_windows        =          0 /          0
pack_report: pack_mapped              =          0 /          0
---------------------------------------------------------------------

ok 24 - tree_tag

expecting success: git fast-export tree_tag-obj
warning: Tag points to object of unexpected type tree, skipping.
warning: Omitting tag 53e692be257c79f8dab21dfd6cb4d16dbc4353df,
since tags of trees (or tags of tags of trees, etc.) are not supported.
ok 25 - tree_tag-obj

expecting success: git fast-export tag-obj_tag
warning: Tag points to object of unexpected type tree, skipping.
warning: Omitting tag 53e692be257c79f8dab21dfd6cb4d16dbc4353df,
since tags of trees (or tags of tags of trees, etc.) are not supported.
warning: Omitting tag 8470f6391cedcf19ee13b11fd659cb1f8d11b9fc,
since tags of trees (or tags of tags of trees, etc.) are not supported.
ok 26 - tag-obj_tag

expecting success: git fast-export tag-obj_tag-obj
warning: Tag points to object of unexpected type tree, skipping.
warning: Omitting tag 53e692be257c79f8dab21dfd6cb4d16dbc4353df,
since tags of trees (or tags of tags of trees, etc.) are not supported.
warning: Omitting tag 20f1df7ad63a9b1b16b52be269f0d04eea24a1ce,
since tags of trees (or tags of tags of trees, etc.) are not supported.
ok 27 - tag-obj_tag-obj

expecting success: 
	git init dirtosymlink &&
	git init result &&
	(
		cd dirtosymlink &&
		mkdir foo &&
		mkdir bar &&
		echo hello > foo/world &&
		echo hello > bar/world &&
		git add foo/world bar/world &&
		git commit -q -mone &&
		git rm -r foo &&
		test_ln_s_add bar foo &&
		git commit -q -mtwo
	) &&
	(
		cd dirtosymlink &&
		git fast-export master -- foo |
		(cd ../result && git fast-import --quiet)
	) &&
	(cd result && git show master:foo)

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:         1813 (         0 duplicates                  )
      blobs  :          803 (         0 duplicates        363 deltas of        667 attempts)
      trees  :          608 (         0 duplicates          2 deltas of        608 attempts)
      commits:          402 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           2 (         2 loads     )
      marks:           1024 (       400 unique    )
      atoms:            864
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          4
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =     129914 /     129914
---------------------------------------------------------------------

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9350-fast-export/dirtosymlink/.git/
Reinitialized existing Git repository in /«PKGBUILDDIR»/t/trash directory.t9350-fast-export/result/.git/
ok 8 - add lots of commits and notes

expecting success: 

	# None of the entries in the top-level notes tree should be a full SHA1
	git ls-tree --name-only refs/notes/many_notes |
	while read path
	do
		if test $(expr length "$path") -ge 40
		then
			return 1
		fi
	done


rm 'foo/world'
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
barok 28 - directory becomes symlink

expecting success: 
	git init crazy-paths &&
	(cd crazy-paths &&
	 blob=`echo foo | git hash-object -w --stdin` &&
	 git update-index --add \
		--cacheinfo 100644 $blob "$(printf "path with\\nnewline")" \
		--cacheinfo 100644 $blob "path with \"quote\"" \
		--cacheinfo 100644 $blob "path with \\backslash" \
		--cacheinfo 100644 $blob "path with space" &&
	 git commit -m addition &&
	 git ls-files -z -s | perl -0pe "s{\\t}{$&subdir/}" >index &&
	 git read-tree --empty &&
	 git update-index -z --index-info <index &&
	 git commit -m rename &&
	 git read-tree --empty &&
	 git commit -m deletion &&
	 git fast-export -M HEAD >export.out &&
	 git rev-list HEAD >expect &&
	 git init result &&
	 cd result &&
	 git fast-import <../export.out &&
	 git rev-list HEAD >actual &&
	 test_cmp ../expect actual
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9350-fast-export/crazy-paths/.git/
Found possible branch point: file:///«PKGBUILDDIR»/t/trash%20directory.t9167-git-svn-cmd-branch-subproject/svnrepo/trunk/project => file:///«PKGBUILDDIR»/t/trash%20directory.t9167-git-svn-cmd-branch-subproject/svnrepo/tags/tag3/project, 2
[master (root-commit) deac6af] addition
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 "path with\nnewline"
 create mode 100644 "path with \"quote\""
 create mode 100644 "path with \\backslash"
 create mode 100644 path with space
[master 89b4a6a] rename
 Author: A U Thor <author@example.com>
 4 files changed, 0 insertions(+), 0 deletions(-)
 rename "path with\nnewline" => "subdir/path with\nnewline" (100%)
 rename "path with \"quote\"" => "subdir/path with \"quote\"" (100%)
 rename "path with \\backslash" => "subdir/path with \\backslash" (100%)
 rename path with space => subdir/path with space (100%)
[master 39f052a] deletion
 Author: A U Thor <author@example.com>
 4 files changed, 4 deletions(-)
 delete mode 100644 "subdir/path with\nnewline"
 delete mode 100644 "subdir/path with \"quote\""
 delete mode 100644 "subdir/path with \\backslash"
 delete mode 100644 subdir/path with space
Found branch parent: (refs/remotes/origin/tags/tag3) 270fecf238e4a92f63725728742820e3065d2de3
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9350-fast-export/crazy-paths/result/.git/
Following parent with do_switch
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            7 (         1 duplicates                  )
      blobs  :            1 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            3 (         1 duplicates          0 deltas of          2 attempts)
      commits:            3 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         4 unique    )
      atoms:              5
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          2
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        627 /        627
---------------------------------------------------------------------

ok 29 - fast-export quotes pathnames

expecting success: 
	>marks-cur &&
	>marks-new &&
	git init marks-test &&
	git fast-export --export-marks=marks-cur --import-marks=marks-cur --branches | \
	git --git-dir=marks-test/.git fast-import --export-marks=marks-new --import-marks=marks-new &&
	(cd marks-test &&
	git reset --hard &&
	echo Wohlauf > file &&
	git commit -a -m "back in time") &&
	git --git-dir=marks-test/.git fast-export --export-marks=marks-new --import-marks=marks-new --branches | \
	git fast-import --export-marks=marks-cur --import-marks=marks-cur

Successfully followed parent
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9350-fast-export/marks-test/.git/
Committing to file:///«PKGBUILDDIR»/t/trash%20directory.t9164-git-svn-dcommit-concurrent/svnrepo ...
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:           41 (         0 duplicates                  )
      blobs  :           12 (         0 duplicates          1 deltas of          4 attempts)
      trees  :           14 (         0 duplicates         13 deltas of         14 attempts)
      commits:           15 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           5 (         5 loads     )
      marks:           1024 (        27 unique    )
      atoms:             10
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =         18
pack_report: pack_mmap_calls          =          5
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =       3556 /       3556
---------------------------------------------------------------------

r10 = 3877e2185b65ca66332c579fdecfc475bf2f695d (refs/remotes/origin/tags/tag3)
HEAD is now at 2e32bdc second
[master a6a2862] back in time
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 9 - verify that lots of notes trigger a fanout scheme

expecting success: 

	git cat-file -p refs/notes/many_notes:foobar/non-note.txt > actual &&
	test_cmp expect_non-note1 actual &&
	git cat-file -p refs/notes/many_notes:deadbeef > actual &&
	test_cmp expect_non-note2 actual &&
	git cat-file -p refs/notes/many_notes:de/adbeef > actual &&
	test_cmp expect_non-note3 actual


ok 10 - verify that non-notes are untouched by a fanout change

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            3 (         0 duplicates                  )
      blobs  :            1 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            1 (         0 duplicates          0 deltas of          1 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           5 (         1 loads     )
      marks:           1024 (        17 unique    )
      atoms:              5
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =          2
pack_report: pack_mmap_calls          =          1
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =        370 /        370
---------------------------------------------------------------------

ok 30 - test bidirectionality

ok 3 - git svn branch tests

expecting success: 
	> tmp-marks &&
	git fast-export --import-marks=tmp-marks \
		--export-marks=tmp-marks master > /dev/null &&
	git tag v1.0 &&
	git branch uninteresting &&
	echo bump > file &&
	git commit -a -m bump &&
	git fast-export --import-marks=tmp-marks \
		--export-marks=tmp-marks ^uninteresting ^v1.0 master > actual &&
	test_cmp expected actual

expecting success: 

	git fast-import <input &&
	GIT_NOTES_REF=refs/notes/many_notes git log -n3 refs/heads/many_commits |
	    grep "^    " > actual &&
	test_cmp expect actual


# passed all 3 test(s)
1..3
[master 2fad96b] bump
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
*** t9351-fast-export-anonymize.sh ***
ok 31 - avoid uninteresting refs

expecting success: 
	> tmp-marks &&
	git fast-export --import-marks=tmp-marks \
		--export-marks=tmp-marks master > /dev/null &&
	git fast-export --import-marks=tmp-marks \
		--export-marks=tmp-marks master > actual &&
	test_cmp expected actual

ok 32 - refs are updated even if no commits need to be exported

expecting success: 
	git fast-export --refspec refs/heads/master:refs/heads/foobar master | \
		grep "^commit " | sort | uniq > actual &&
	echo "commit refs/heads/foobar" > expected &&
	test_cmp expected actual

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            8 (         0 duplicates                  )
      blobs  :            3 (         0 duplicates          2 deltas of          3 attempts)
      trees  :            4 (         0 duplicates          0 deltas of          4 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:            608
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =        218
pack_report: pack_mmap_calls          =          2
pack_report: pack_open_windows        =          2 /          2
pack_report: pack_mapped              =     135442 /     135442
---------------------------------------------------------------------

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9351-fast-export-anonymize/.git/
expecting success: 
	test_commit base &&
	test_commit foo &&
	git checkout -b other HEAD^ &&
	mkdir subdir &&
	test_commit subdir/bar &&
	test_commit subdir/xyzzy &&
	git tag -m "annotated tag" mytag

ok 33 - use refspec

expecting success: 
	git branch to-delete &&
	git fast-export --refspec :refs/heads/to-delete to-delete ^to-delete > actual &&
	cat > expected <<-EOF &&
	reset refs/heads/to-delete
	from 0000000000000000000000000000000000000000

	EOF
	test_cmp expected actual

ok 11 - change a few existing notes

expecting success: 

	# None of the entries in the top-level notes tree should be a full SHA1
	git ls-tree --name-only refs/notes/many_notes |
	while read path
	do
		if test $(expr length "$path") -ge 40
		then
			return 1
		fi
	done


[master (root-commit) d1ff1c9] base
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 base.t
ok 34 - delete refspec

# still have 1 known breakage(s)
# passed all remaining 33 test(s)
1..34
[master 64bd085] foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo.t
Switched to a new branch 'other'
[other e301bbb] subdir/bar
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 subdir/bar.t
[other 497be6a] subdir/xyzzy
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 subdir/xyzzy.t
*** t9400-git-cvsserver-server.sh ***
	M	file
ok 1 - setup simple repo

expecting success: 
	git fast-export --anonymize --all >stream

ok 2 - export anonymized stream

expecting success: 
	! grep base stream &&
	! grep foo stream &&
	! grep subdir stream &&
	! grep bar stream &&
	! grep xyzzy stream

ok 3 - stream omits path names

expecting success: 
	grep master stream

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9400-git-cvsserver-server/.git/
commit refs/heads/master
ok 4 - stream allows master as refname

expecting success: 
	! grep other stream &&
	! grep mytag stream

ok 5 - stream omits other refnames

expecting success: 
	! grep "$GIT_COMMITTER_NAME" stream &&
	! grep "$GIT_COMMITTER_EMAIL" stream &&
	! grep "$GIT_AUTHOR_NAME" stream &&
	! grep "$GIT_AUTHOR_EMAIL" stream

ok 6 - stream omits identities

expecting success: 
	! grep "annotated tag" stream

ok 7 - stream omits tag message

expecting success: 
	git init new &&
	cd new &&
	git fast-import <../stream

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9351-fast-export-anonymize/new/.git/
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:           15 (         0 duplicates                  )
      blobs  :            4 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            6 (         0 duplicates          4 deltas of          6 attempts)
      commits:            4 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            1 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           7 (         4 loads     )
      marks:           1024 (         8 unique    )
      atoms:              5
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =         19
pack_report: pack_mmap_calls          =          6
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =       1137 /       1137
---------------------------------------------------------------------

ok 8 - import stream to new repository

expecting success: 
	git for-each-ref --format="%(refname)" refs/heads >branches &&
	test_line_count = 2 branches &&
	other_branch=$(grep -v refs/heads/master branches)

ok 9 - result has two branches

expecting success: 
	shape () {
		git log --format="%m %ct" --left-right --boundary "$@"
	} &&
	(cd .. && shape master...other) >expect &&
	shape master...$other_branch >actual &&
	test_cmp expect actual

expecting success: 
  git config push.default matching &&
  echo >empty &&
  git add empty &&
  git commit -q -m "First Commit" &&
  mkdir secondroot &&
  ( cd secondroot &&
  git init &&
  touch secondrootfile &&
  git add secondrootfile &&
  git commit -m "second root") &&
  git pull secondroot master &&
  git clone -q --bare "$WORKDIR/.git" "$SERVERDIR" >/dev/null 2>&1 &&
  GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
  GIT_DIR="$SERVERDIR" git config gitcvs.logfile "$SERVERDIR/gitcvs.log" &&
  GIT_DIR="$SERVERDIR" git config gitcvs.authdb "$SERVERDIR/auth.db" &&
  echo cvsuser:cvGVEarMLnhlA > "$SERVERDIR/auth.db"

ok 10 - repo has original shape and timestamps

expecting success: 
	# the output entries are not necessarily in the same
	# order, but we know at least that we will have one tree
	# and one blob, so just check the sorted order
	cat >expect <<-\EOF &&
	blob
	tree
	EOF
	git ls-tree $other_branch >root &&
	cut -d" " -f2 <root | sort >actual &&
	test_cmp expect actual

ok 11 - root tree has original shape

expecting success: 
	cat >expect <<-\EOF &&
	blob
	blob
	EOF
	tree=$(grep tree root | cut -f2) &&
	git ls-tree $other_branch:$tree >tree &&
	cut -d" " -f2 <tree >actual &&
	test_cmp expect actual

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9400-git-cvsserver-server/secondroot/.git/
ok 12 - paths in subdir ended up in one tree

expecting success: 
	git rev-parse $other_branch >expect &&
	git for-each-ref --format="%(*objectname)" | grep . >actual &&
	test_cmp expect actual

[master (root-commit) 0bfb6d2] second root
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 secondrootfile
ok 13 - tag points to branch tip

expecting success: 
	git log --all --format="%an <%ae>" >authors &&
	sort -u authors >unique &&
	test_line_count = 1 unique &&
	git log --all --format="%cn <%ce>" >committers &&
	sort -u committers >unique &&
	test_line_count = 1 unique &&
	! test_cmp authors committers

warning: no common commits
ok 12 - verify that changing notes respect existing fanout

--- authors	2015-12-16 11:21:50.209565002 +0000
+++ committers	2015-12-16 11:21:50.249565002 +0000
@@ -1,4 +1,4 @@
-User 1 <user1@example.com>
-User 1 <user1@example.com>
-User 1 <user1@example.com>
-User 1 <user1@example.com>
+User 0 <user0@example.com>
+User 0 <user0@example.com>
+User 0 <user0@example.com>
+User 0 <user0@example.com>
ok 14 - idents are shared

# passed all 14 test(s)
1..14
From secondroot
 * branch            master     -> FETCH_HEAD
Merging:
87502c9 First Commit
virtual 0bfb6d2fae7fd8b0fbbc61932a34cbaaaeeda36b
found 0 common ancestors:
Merge made by the 'recursive' strategy.
 secondrootfile | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 secondrootfile
*** t9401-git-cvsserver-crlf.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9401-git-cvsserver-crlf/.git/
ok 1 - setup

expecting success: GIT_CONFIG="$git_config" cvs -Q co -d cvswork master &&
   test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | head -n 1))" = "empty/1.1/" &&
   test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | sed -ne \$p))" = "secondrootfile/1.1/"
expecting success: 
    git config push.default matching &&
    echo "Simple text file" >textfile.c &&
    echo "File with embedded NUL: Q <- there" | q_to_nul > binfile.bin &&
    mkdir subdir &&
    echo "Another text file" > subdir/file.h &&
    echo "Another binary: Q (this time CR)" | q_to_cr > subdir/withCr.bin &&
    echo "Mixed up NUL, but marked text: Q <- there" | q_to_nul > mixedUp.c &&
    echo "Unspecified" > subdir/unspecified.other &&
    echo "/*.bin -crlf" > .gitattributes &&
    echo "/*.c crlf" >> .gitattributes &&
    echo "subdir/*.bin -crlf" >> .gitattributes &&
    echo "subdir/*.c crlf" >> .gitattributes &&
    echo "subdir/file.h crlf" >> .gitattributes &&
    git add .gitattributes textfile.c binfile.bin mixedUp.c subdir/* &&
    git commit -q -m "First Commit" &&
    git clone -q --bare "$WORKDIR/.git" "$SERVERDIR" >/dev/null 2>&1 &&
    GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
    GIT_DIR="$SERVERDIR" git config gitcvs.logfile "$SERVERDIR/gitcvs.log"

ok 1 - setup

expecting success: 
    GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 &&
    test x"$(grep /-k cvswork/CVS/Entries cvswork/subdir/CVS/Entries)" = x""

Committed r17
	M	file
r17 = d8c7398efae8b9b14e5565414f22cd85f1588903 (refs/remotes/git-svn)
	M	auto_updated_file
r18 = 3c3edc495498c7923c8c72d0494b0fefc1b01453 (refs/remotes/git-svn)
W: 0e654343c1f6e310641471fe95aabb2a57d83f89 and refs/remotes/git-svn differ, using rebase:
:100644 100644 11593b2cb4b3b39f4024e4d2c56b69a51c578004 a47a9ff7eeaaae8371f0d0ad34214dbfb0cda26c M	auto_updated_file
First, rewinding head to replay your work on top of it...
Applying: commit change 5.2
Using index info to reconstruct a base tree...
M	auto_updated_file
Falling back to patching base and 3-way merge...
Merging 3c3edc495498c7923c8c72d0494b0fefc1b01453 with commit change 5.2
Merging:
3c3edc4 auto-committing concurrent change
virtual commit change 5.2
found 1 common ancestor:
virtual c226100d2178fb5e7498e05b5fdda47fcedaf78e
Auto-merging auto_updated_file
CONFLICT (content): Merge conflict in auto_updated_file
error: Failed to merge in the changes.
Patch failed at 0001 commit change 5.2
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

rebase refs/remotes/git-svn: command returned error: 128

auto_updated_file: needs merge
ok 8 - dcommit fails on concurrent conflicting change

# passed all 8 test(s)
1..8
*** t9402-git-cvsserver-refs.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9402-git-cvsserver-refs/.git/
U cvswork/empty
U cvswork/secondrootfile
ok 2 - basic checkout

expecting success: cat request-anonymous | git-cvsserver pserver >log 2>&1 &&
   sed -ne \$p log | grep "^I LOVE YOU\$"
expecting success: 
	echo "Simple text file" >textfile.c &&
	echo "t2" >t2 &&
	mkdir adir &&
	echo "adir/afile line1" >adir/afile &&
	echo "adir/afile line2" >>adir/afile &&
	echo "adir/afile line3" >>adir/afile &&
	echo "adir/afile line4" >>adir/afile &&
	echo "adir/a2file" >>adir/a2file &&
	mkdir adir/bdir &&
	echo "adir/bdir/bfile line 1" >adir/bdir/bfile &&
	echo "adir/bdir/bfile line 2" >>adir/bdir/bfile &&
	echo "adir/bdir/b2file" >adir/bdir/b2file &&
	git add textfile.c t2 adir &&
	git commit -q -m "First Commit (v1)" &&
	git tag v1 &&
	git branch b1 &&
	git clone -q --bare "$WORKDIR/.git" "$SERVERDIR" >/dev/null 2>&1 &&
	GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
	GIT_DIR="$SERVERDIR" git config gitcvs.logfile "$SERVERDIR/gitcvs.log"

ok 1 - setup v1, b1

expecting success: 
	cvs -f -Q co -r v1 -d cvswork master >cvs.log 2>&1 &&
	check_start_tree cvswork &&
	check_file cvswork textfile.c v1 &&
	check_file cvswork t2 v1 &&
	check_file cvswork adir/afile v1 &&
	check_file cvswork adir/a2file v1 &&
	check_file cvswork adir/bdir/bfile v1 &&
	check_file cvswork adir/bdir/b2file v1 &&
	check_end_tree cvswork

expecting success: 

	git fast-import <input &&
	GIT_NOTES_REF=refs/notes/many_notes git log refs/heads/many_commits |
	    grep "^    " > actual &&
	test_cmp expect actual


I LOVE YOU
ok 3 - pserver authentication

expecting success: if cat request-git | git-cvsserver pserver >log 2>&1
   then
       false
   else
       true
   fi &&
   sed -ne \$p log | grep "^I HATE YOU\$"
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            3 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            2 (         0 duplicates          0 deltas of          2 attempts)
      commits:            1 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           1 (         1 loads     )
      marks:           1024 (         0 unique    )
      atoms:            618
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =        602
pack_report: pack_mmap_calls          =          3
pack_report: pack_open_windows        =          3 /          3
pack_report: pack_mapped              =     136338 /     136338
---------------------------------------------------------------------

ok 13 - remove lots of notes

expecting success: 

	# All entries in the top-level notes tree should be a full SHA1
	git ls-tree --name-only -r refs/notes/many_notes |
	while read path
	do
		# Explicitly ignore the non-note paths
		test "$path" = "foobar/non-note.txt" && continue
		test "$path" = "deadbeef" && continue
		test "$path" = "de/adbeef" && continue

		if test $(expr length "$path") -ne 40
		then
			return 1
		fi
	done


ok 14 - verify that removing notes trigger fanout consolidation

expecting success: 

	git cat-file -p refs/notes/many_notes:foobar/non-note.txt > actual &&
	test_cmp expect_non-note1 actual &&
	git cat-file -p refs/notes/many_notes:deadbeef > actual &&
	test_cmp expect_non-note2 actual &&
	git cat-file -p refs/notes/many_notes:de/adbeef > actual &&
	test_cmp expect_non-note3 actual


ok 15 - verify that non-notes are untouched by a fanout change

ok 2 - cvs co (default crlf)

expecting success: 
    GIT_DIR="$SERVERDIR" git config --bool gitcvs.allbinary true &&
    GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 &&
    marked_as cvswork textfile.c -kb &&
    marked_as cvswork binfile.bin -kb &&
    marked_as cvswork .gitattributes -kb &&
    marked_as cvswork mixedUp.c -kb &&
    marked_as cvswork/subdir withCr.bin -kb &&
    marked_as cvswork/subdir file.h -kb &&
    marked_as cvswork/subdir unspecified.other -kb

I HATE YOU
ok 4 - pserver authentication failure (non-anonymous user)

expecting success: cat login-git-ok | git-cvsserver pserver >log 2>&1 &&
   sed -ne \$p log | grep "^I LOVE YOU\$"
I LOVE YOU
ok 5 - pserver authentication success (non-anonymous user with password)

expecting success: cat login-anonymous | git-cvsserver pserver >log 2>&1 &&
   sed -ne \$p log | grep "^I LOVE YOU\$"
expecting success: 

	git fast-import --active-branches=5 <input &&
	GIT_NOTES_REF=refs/notes/more_notes_1 git log refs/heads/more_commits |
	    grep "^    " > actual &&
	test_cmp expect actual


git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:           46 (       282 duplicates                  )
      blobs  :            8 (       248 duplicates          0 deltas of          8 attempts)
      trees  :            2 (        34 duplicates          1 deltas of          2 attempts)
      commits:           36 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:          11 (        21 loads     )
      marks:           1024 (        16 unique    )
      atoms:             17
Memory total:          2294 KiB
       pools:          2098 KiB
     objects:           195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize =   33554432
pack_report: core.packedGitLimit      =  268435456
pack_report: pack_used_ctr            =         32
pack_report: pack_mmap_calls          =         11
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =       6506 /       6506
---------------------------------------------------------------------

ok 16 - add notes to 16 commits in each of 10 refs

# passed all 16 test(s)
1..16
*** t9500-gitweb-standalone-no-errors.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9500-gitweb-standalone-no-errors/.git/
ok 3 - cvs co (allbinary)

expecting success: 
    GIT_DIR="$SERVERDIR" git config --bool gitcvs.usecrlfattr true &&
    GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 &&
    marked_as cvswork textfile.c "" &&
    marked_as cvswork binfile.bin -kb &&
    marked_as cvswork .gitattributes -kb &&
    marked_as cvswork mixedUp.c "" &&
    marked_as cvswork/subdir withCr.bin -kb &&
    marked_as cvswork/subdir file.h "" &&
    marked_as cvswork/subdir unspecified.other -kb

I LOVE YOU
ok 6 - pserver authentication (login)

expecting success: if cat login-git | git-cvsserver pserver >log 2>&1
   then
       false
   else
       true
   fi &&
   sed -ne \$p log | grep "^I HATE YOU\$"
expecting success: gitweb_run
I HATE YOU
ok 7 - pserver authentication failure (login/non-anonymous user)

expecting success: if cat request-relative | git-cvsserver pserver >log 2>&1
   then
       echo unexpected success
       false
   else
       true
   fi &&
   tail log | grep "^error 1 Root must be an absolute pathname$"
ok 2 - cvs co v1

expecting success: 
	cvs -f co -r b1 -d cvswork master >cvs.log 2>&1 &&
	check_start_tree cvswork &&
	check_file cvswork textfile.c v1 &&
	check_file cvswork t2 v1 &&
	check_file cvswork adir/afile v1 &&
	check_file cvswork adir/a2file v1 &&
	check_file cvswork adir/bdir/bfile v1 &&
	check_file cvswork adir/bdir/b2file v1 &&
	check_end_tree cvswork

ok 1 - no commits: projects_list (implicit)

expecting success: gitweb_run "a=project_index"
error 1 Root must be an absolute pathname
ok 8 - req_Root failure (relative pathname)

expecting success: cat request-conflict | git-cvsserver pserver >log 2>&1 &&
   tail log | grep "^error 1 Conflicting roots specified$"
ok 2 - no commits: projects_index

expecting success: gitweb_run "p=.git"
ok 4 - cvs co (use attributes/allbinary)

expecting success: 
    GIT_DIR="$SERVERDIR" git config --bool gitcvs.allbinary false &&
    GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 &&
    marked_as cvswork textfile.c "" &&
    marked_as cvswork binfile.bin -kb &&
    marked_as cvswork .gitattributes "" &&
    marked_as cvswork mixedUp.c "" &&
    marked_as cvswork/subdir withCr.bin -kb &&
    marked_as cvswork/subdir file.h "" &&
    marked_as cvswork/subdir unspecified.other ""

error 1 Conflicting roots specified
ok 9 - req_Root failure (conflicting roots)

expecting success: cat request-anonymous | git-cvsserver --strict-paths pserver "$SERVERDIR" >log 2>&1 &&
   sed -ne \$p log | grep "^I LOVE YOU\$"
I LOVE YOU
ok 10 - req_Root (strict paths)

expecting success: 
    ! cat request-anonymous |
    git-cvsserver --strict-paths pserver "$WORKDIR" >log 2>&1

ok 3 - cvs co b1

expecting success: 
	cvs -f co -r b1 -d cvswork3 master >cvs.log 2>&1 &&
	check_start_tree cvswork3 &&
	check_file cvswork3 textfile.c v1 &&
	check_file cvswork3 t2 v1 &&
	check_file cvswork3 adir/afile v1 &&
	check_file cvswork3 adir/a2file v1 &&
	check_file cvswork3 adir/bdir/bfile v1 &&
	check_file cvswork3 adir/bdir/b2file v1 &&
	check_end_full_tree cvswork3 v1

ok 3 - no commits: .git summary (implicit)

expecting success: gitweb_run "p=.git;a=commit"
ok 11 - req_Root failure (strict-paths)

expecting success: cat request-anonymous | git-cvsserver pserver "$WORKDIR/" >log 2>&1 &&
   sed -ne \$p log | grep "^I LOVE YOU\$"
ok 4 - no commits: .git commit (implicit HEAD)

expecting success: gitweb_run "p=.git;a=commitdiff"
I LOVE YOU
ok 12 - req_Root (w/o strict-paths)

expecting success: 
    ! cat request-anonymous |
    git-cvsserver pserver "$WORKDIR/gitcvs" >log 2>&1

ok 5 - cvs co (use attributes)

expecting success: 
    (cd cvswork &&
    (cd subdir &&
    echo "more text" > src.c &&
    GIT_CONFIG="$git_config" cvs -Q add src.c >cvs.log 2>&1 &&
    marked_as . src.c "" &&
    echo "psuedo-binary" > temp.bin
    ) &&
    GIT_CONFIG="$git_config" cvs -Q add subdir/temp.bin >cvs.log 2>&1 &&
    marked_as subdir temp.bin "-kb" &&
    cd subdir &&
    GIT_CONFIG="$git_config" cvs -Q ci -m "adding files" >cvs.log 2>&1 &&
    marked_as . temp.bin "-kb" &&
    marked_as . src.c ""
    )

ok 13 - req_Root failure (w/o strict-paths)

expecting success: cat request-base | git-cvsserver --strict-paths --base-path "$WORKDIR/" pserver "$SERVERDIR" >log 2>&1 &&
   sed -ne \$p log | grep "^I LOVE YOU\$"
ok 5 - no commits: .git commitdiff (implicit HEAD)

expecting success: gitweb_run "p=.git;a=tree"
ok 4 - cvs co b1 [cvswork3]

expecting success: 
	(
		cd cvswork3 &&
		sed -e "s/line1/line1 - data/" adir/afile >adir/afileNEW &&
		mv -f adir/afileNEW adir/afile &&
		echo "afile5" >adir/afile5 &&
		rm t2 &&
		cvs -f add adir/afile5 &&
		cvs -f rm t2 &&
		! cvs -f diff -N -u >"$WORKDIR/cvswork3edit.diff"
	)

I LOVE YOU
ok 14 - req_Root (base-path)

expecting success: 
    ! cat request-anonymous |
    git-cvsserver --strict-paths --base-path "$WORKDIR" pserver "$SERVERDIR" >log 2>&1

cvs add: scheduling file `adir/afile5' for addition
cvs add: use `cvs commit' to add this file permanently
ok 6 - no commits: .git tree (implicit HEAD)

expecting success: gitweb_run "p=.git;a=heads"
ok 15 - req_Root failure (base-path)

expecting success: cat request-anonymous | git-cvsserver --export-all pserver "$WORKDIR" >log 2>&1 &&
   sed -ne \$p log | grep "^I LOVE YOU\$"
I LOVE YOU
ok 16 - req_Root (export-all)

expecting success: ! (cat request-anonymous | git-cvsserver --export-all pserver >log 2>&1 || false)
ok 7 - no commits: .git heads

expecting success: gitweb_run "p=.git;a=tags"
cvs remove: scheduling `t2' for removal
cvs remove: use `cvs commit' to remove this file permanently
ok 17 - req_Root failure (export-all w/o whitelist)

expecting success: cat request-base | git-cvsserver --export-all --strict-paths --base-path "$WORKDIR/" pserver "$SERVERDIR" >log 2>&1 &&
   sed -ne \$p log | grep "^I LOVE YOU\$"
ok 8 - no commits: .git tags

expecting success: echo "Not an empty file." > file &&
	 git add file &&
	 git commit -a -m "Initial commit." &&
	 git branch b
[master (root-commit) 7704ba3] Initial commit.
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
ok 9 - Make initial commit

expecting success: gitweb_run
I LOVE YOU
ok 18 - req_Root (everything together)

expecting success: GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled false &&
   if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1
   then
     echo unexpected cvs success
     false
   else
     true
   fi &&
   grep "GITCVS emulation disabled" cvs.log &&
   test ! -d cvswork2
GITCVS emulation disabled
ok 19 - gitcvs.enabled = false

expecting success: GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
   GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled false &&
   GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&
   test_cmp cvswork cvswork2
ok 10 - projects_list (implicit)

expecting success: gitweb_run "a=project_index"
ok 5 - edit cvswork3 and save diff

expecting success: 
	git checkout b1 &&
	echo "new v1.2" >t3 &&
	rm t2 &&
	sed -e "s/line3/line3 - more data/" adir/afile >adir/afileNEW &&
	mv -f adir/afileNEW adir/afile &&
	rm adir/a2file &&
	echo "a3file" >>adir/a3file &&
	echo "bfile line 3" >>adir/bdir/bfile &&
	rm adir/bdir/b2file &&
	echo "b3file" >adir/bdir/b3file &&
	mkdir cdir &&
	echo "cdir/cfile" >cdir/cfile &&
	git add -A cdir adir t3 t2 &&
	git commit -q -m v1.2 &&
	git tag v1.2 &&
	git push --tags gitcvs.git b1:b1

Switched to branch 'b1'
To gitcvs.git
   ea4c2f9..7073265  b1 -> b1
 * [new tag]         v1.2 -> v1.2
ok 6 - setup v1.2 on b1

expecting success: 
	( cd cvswork/adir && cvs -f up -d ) >cvs.log 2>&1 &&
	check_start_tree cvswork &&
	check_file cvswork textfile.c v1 &&
	check_file cvswork t2 v1 &&
	check_file cvswork adir/afile v1.2 &&
	check_file cvswork adir/a3file v1.2 &&
	check_file cvswork adir/bdir/bfile v1.2 &&
	check_file cvswork adir/bdir/b3file v1.2 &&
	check_end_tree cvswork

ok 6 - adding files

expecting success: 
    git pull gitcvs.git &&
    echo hi > subdir/newfile.bin &&
    echo junk > subdir/file.h &&
    echo hi > subdir/newfile.c &&
    echo hello >> binfile.bin &&
    git add subdir/newfile.bin subdir/file.h subdir/newfile.c binfile.bin &&
    git commit -q -m "Add and change some files" &&
    git push gitcvs.git >/dev/null &&
    (cd cvswork &&
    GIT_CONFIG="$git_config" cvs -Q update
    ) &&
    marked_as cvswork textfile.c "" &&
    marked_as cvswork binfile.bin -kb &&
    marked_as cvswork .gitattributes "" &&
    marked_as cvswork mixedUp.c "" &&
    marked_as cvswork/subdir withCr.bin -kb &&
    marked_as cvswork/subdir file.h "" &&
    marked_as cvswork/subdir unspecified.other "" &&
    marked_as cvswork/subdir newfile.bin -kb &&
    marked_as cvswork/subdir newfile.c "" &&
    echo "File with embedded NUL: Q <- there" | q_to_nul > tmpExpect1 &&
    echo "hello" >> tmpExpect1 &&
    cmp cvswork/binfile.bin tmpExpect1

From gitcvs
 * branch            HEAD       -> FETCH_HEAD
Updating 1b4a93f..b52e70b
Fast-forward
 subdir/src.c    | 1 +
 subdir/temp.bin | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 subdir/src.c
 create mode 100644 subdir/temp.bin
To gitcvs.git
   b52e70b..d0dbfd5  master -> master
ok 11 - projects_index

expecting success: gitweb_run "p=.git"
Common subdirectories: cvswork/CVS and cvswork2/CVS
ok 20 - gitcvs.ext.enabled = true

expecting success: GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled false &&
   GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
   if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1
   then
     echo unexpected cvs success
     false
   else
     true
   fi &&
   grep "GITCVS emulation disabled" cvs.log &&
   test ! -d cvswork2
GITCVS emulation disabled
ok 21 - gitcvs.ext.enabled = false

expecting success: GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
   GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs.%a.%m.sqlite &&
   GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&
   test_cmp cvswork cvswork2 &&
   test -f "$SERVERDIR/gitcvs.ext.master.sqlite" &&
   cmp "$SERVERDIR/gitcvs.master.sqlite" "$SERVERDIR/gitcvs.ext.master.sqlite"
Use of uninitialized value $wrev in string ne at /«PKGBUILDDIR»/git-cvsserver line 1262.
Use of uninitialized value $wrev in string ne at /«PKGBUILDDIR»/git-cvsserver line 1307.
cvs update: `cvs.log' is no longer in the repository
U binfile.bin
Use of uninitialized value $wrev in string ne at /«PKGBUILDDIR»/git-cvsserver line 1262.
Use of uninitialized value $wrev in string ne at /«PKGBUILDDIR»/git-cvsserver line 1307.
cvs update: `subdir/cvs.log' is no longer in the repository
ok 12 - .git summary (implicit)

expecting success: gitweb_run "p=.git;a=commit"
ok 7 - cvs -f up (on b1 adir)

expecting success: 
	( cd cvswork && cvs -f up -d ) >cvs.log 2>&1 &&
	check_start_tree cvswork &&
	check_file cvswork textfile.c v1.2 &&
	check_file cvswork t3 v1.2 &&
	check_file cvswork adir/afile v1.2 &&
	check_file cvswork adir/a3file v1.2 &&
	check_file cvswork adir/bdir/bfile v1.2 &&
	check_file cvswork adir/bdir/b3file v1.2 &&
	check_file cvswork cdir/cfile v1.2 &&
	check_end_tree cvswork

U subdir/file.h
U subdir/newfile.bin
U subdir/newfile.c
ok 7 - updating

expecting success: 
    GIT_DIR="$SERVERDIR" git config gitcvs.allbinary guess &&
    GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 &&
    marked_as cvswork textfile.c "" &&
    marked_as cvswork binfile.bin -kb &&
    marked_as cvswork .gitattributes "" &&
    marked_as cvswork mixedUp.c "" &&
    marked_as cvswork/subdir withCr.bin -kb &&
    marked_as cvswork/subdir file.h "" &&
    marked_as cvswork/subdir unspecified.other "" &&
    marked_as cvswork/subdir newfile.bin -kb &&
    marked_as cvswork/subdir newfile.c ""

ok 13 - .git commit (implicit HEAD)

expecting success: gitweb_run "p=.git;a=commitdiff"
ok 14 - .git commitdiff (implicit HEAD, root commit)

expecting success: gitweb_run "p=.git;a=commitdiff_plain"
ok 8 - cvs up (on b1 /)

expecting success: 
	( cd cvswork && cvs -f up -d ) >cvs.log 2>&1 &&
	check_start_tree cvswork &&
	check_file cvswork textfile.c v1.2 &&
	check_file cvswork t3 v1.2 &&
	check_file cvswork adir/afile v1.2 &&
	check_file cvswork adir/a3file v1.2 &&
	check_file cvswork adir/bdir/bfile v1.2 &&
	check_file cvswork adir/bdir/b3file v1.2 &&
	check_file cvswork cdir/cfile v1.2 &&
	check_end_tree cvswork

Common subdirectories: cvswork/CVS and cvswork2/CVS
ok 22 - gitcvs.dbname

expecting success: GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
   GIT_DIR="$SERVERDIR" git config gitcvs.ext.dbname %Ggitcvs1.%a.%m.sqlite &&
   GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs2.%a.%m.sqlite &&
   GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&
   test_cmp cvswork cvswork2 &&
   test -f "$SERVERDIR/gitcvs1.ext.master.sqlite" &&
   test ! -f "$SERVERDIR/gitcvs2.ext.master.sqlite" &&
   cmp "$SERVERDIR/gitcvs.master.sqlite" "$SERVERDIR/gitcvs1.ext.master.sqlite"
ok 8 - cvs co (use attributes/guess)

expecting success: 
    ( echo "line 1" &&
      echo "line 2" &&
      echo "line 3" &&
      echo "line 4 with NUL: Q <-" ) | q_to_nul > multiline.c &&
    git add multiline.c &&
    ( echo "line 1" &&
      echo "line 2" &&
      echo "line 3" &&
      echo "line 4" ) | q_to_nul > multilineTxt.c &&
    git add multilineTxt.c &&
    git commit -q -m "multiline files" &&
    git push gitcvs.git >/dev/null

ok 15 - .git commitdiff_plain (implicit HEAD, root commit)

expecting success: gitweb_run "p=.git;a=commit;h=HEAD"
To gitcvs.git
   d0dbfd5..b5e3852  master -> master
ok 9 - setup multi-line files

expecting success: 
    GIT_DIR="$SERVERDIR" git config --bool gitcvs.usecrlfattr false &&
    GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 &&
    marked_as cvswork textfile.c "" &&
    marked_as cvswork binfile.bin -kb &&
    marked_as cvswork .gitattributes "" &&
    marked_as cvswork mixedUp.c -kb &&
    marked_as cvswork multiline.c -kb &&
    marked_as cvswork multilineTxt.c "" &&
    marked_as cvswork/subdir withCr.bin -kb &&
    marked_as cvswork/subdir file.h "" &&
    marked_as cvswork/subdir unspecified.other "" &&
    marked_as cvswork/subdir newfile.bin "" &&
    marked_as cvswork/subdir newfile.c ""

ok 9 - cvs up (on b1 /) (again; check CVS/Tag files)

expecting success: 
	( cd cvswork && cvs -f up -r v1 ) >cvs.log 2>&1 &&
	check_start_tree cvswork &&
	check_file cvswork textfile.c v1 &&
	check_file cvswork t2 v1 &&
	check_file cvswork adir/afile v1 &&
	check_file cvswork adir/a2file v1 &&
	check_file cvswork adir/bdir/bfile v1 &&
	check_file cvswork adir/bdir/b2file v1 &&
	check_end_tree cvswork

ok 16 - .git commit (HEAD)

expecting success: gitweb_run "p=.git;a=tree"
ok 17 - .git tree (implicit HEAD)

expecting success: gitweb_run "p=.git;a=blob;f=file"
Common subdirectories: cvswork/CVS and cvswork2/CVS
ok 23 - gitcvs.ext.dbname

expecting success: echo testfile1 >testfile1 &&
   git add testfile1 &&
   git commit -q -m "Add testfile1" &&
   git push gitcvs.git >/dev/null &&
   cd cvswork &&
   GIT_CONFIG="$git_config" cvs -Q update &&
   test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.1/" &&
   test_cmp testfile1 ../testfile1
ok 10 - cvs up -r v1

expecting success: 
	( cd cvswork && cvs -f up ) >cvs.log 2>&1 &&
	check_start_tree cvswork &&
	check_file cvswork textfile.c v1 &&
	check_file cvswork t2 v1 &&
	check_file cvswork adir/afile v1 &&
	check_file cvswork adir/a2file v1 &&
	check_file cvswork adir/bdir/bfile v1 &&
	check_file cvswork adir/bdir/b2file v1 &&
	check_end_tree cvswork

ok 10 - cvs co (guess)

expecting success: 
    GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&
    marked_as cvswork2 textfile.c "" &&
    marked_as cvswork2 binfile.bin -kb &&
    marked_as cvswork2 .gitattributes "" &&
    marked_as cvswork2 mixedUp.c -kb &&
    marked_as cvswork2 multiline.c -kb &&
    marked_as cvswork2 multilineTxt.c "" &&
    marked_as cvswork2/subdir withCr.bin -kb &&
    marked_as cvswork2/subdir file.h "" &&
    marked_as cvswork2/subdir unspecified.other "" &&
    marked_as cvswork2/subdir newfile.bin "" &&
    marked_as cvswork2/subdir newfile.c ""

To gitcvs.git
   7b46b26..8e361b8  master -> master
ok 18 - .git blob (file)

expecting success: gitweb_run "p=.git;a=blob_plain;f=file"
ok 11 - cvs up

expecting success: 
	( cd cvswork && cvs -f up -d ) >cvs.log 2>&1 &&
	check_start_tree cvswork &&
	check_file cvswork textfile.c v1 &&
	check_file cvswork t2 v1 &&
	check_file cvswork adir/afile v1 &&
	check_file cvswork adir/a2file v1 &&
	check_file cvswork adir/bdir/bfile v1 &&
	check_file cvswork adir/bdir/b2file v1 &&
	check_end_tree cvswork

ok 19 - .git blob_plain (file)

expecting success: gitweb_run "p=.git;a=commit;h=non-existent"
ok 20 - .git commit (non-existent)

expecting success: gitweb_run "p=.git;a=commitdiff;h=non-existent"
ok 12 - cvs up (again; check CVS/Tag files)

expecting success: 
	git branch b2 v1 &&
	git push --tags gitcvs.git b2:b2

U testfile1
To gitcvs.git
 * [new branch]      b2 -> b2
ok 13 - setup simple b2

expecting success: 
	cvs -f co -r b2 -d cvswork2 master >cvs.log 2>&1 &&
	check_start_tree cvswork &&
	check_file cvswork textfile.c v1 &&
	check_file cvswork t2 v1 &&
	check_file cvswork adir/afile v1 &&
	check_file cvswork adir/a2file v1 &&
	check_file cvswork adir/bdir/bfile v1 &&
	check_file cvswork adir/bdir/b2file v1 &&
	check_end_tree cvswork

ok 24 - cvs update (create new file)

expecting success: echo line 2 >>testfile1 &&
   git add testfile1 &&
   git commit -q -m "Append to testfile1" &&
   git push gitcvs.git >/dev/null &&
   cd cvswork &&
   GIT_CONFIG="$git_config" cvs -Q update &&
   test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.2/" &&
   test_cmp testfile1 ../testfile1
To gitcvs.git
   8e361b8..15f286f  master -> master
ok 11 - cvs co another copy (guess)

expecting success: 
    check_status_options cvswork2 textfile.c "" &&
    check_status_options cvswork2 binfile.bin -kb &&
    check_status_options cvswork2 .gitattributes "" &&
    check_status_options cvswork2 mixedUp.c -kb &&
    check_status_options cvswork2 multiline.c -kb &&
    check_status_options cvswork2 multilineTxt.c "" &&
    check_status_options cvswork2/subdir withCr.bin -kb &&
    check_status_options cvswork2 subdir/withCr.bin -kb &&
    check_status_options cvswork2/subdir file.h "" &&
    check_status_options cvswork2 subdir/file.h "" &&
    check_status_options cvswork2/subdir unspecified.other "" &&
    check_status_options cvswork2/subdir newfile.bin "" &&
    check_status_options cvswork2/subdir newfile.c ""

ok 21 - .git commitdiff (non-existent)

expecting success: gitweb_run "p=.git;a=commitdiff;hp=non-existent;h=HEAD"
U testfile1
ok 25 - cvs update (update existing file)

checking known breakage: 
   mkdir test &&
   echo >test/empty &&
   git add test &&
   git commit -q -m "Single Subdirectory" &&
   git push gitcvs.git >/dev/null &&
   cd cvswork &&
   GIT_CONFIG="$git_config" cvs -Q update &&
   test ! -d test

To gitcvs.git
   15f286f..61b61d7  master -> master
ok 14 - cvs co b2 [into cvswork2]

expecting success: 
	(
		cd cvswork2 && echo "Line 2" >>textfile.c &&
		! cvs -f diff -u >"$WORKDIR/cvsEdit1.diff" &&
		cvs -f commit -m "edit textfile.c" textfile.c
	) >cvsEdit1.log 2>&1

ok 22 - .git commitdiff (non-existent vs HEAD)

expecting success: gitweb_run "p=.git;a=tree;h=0000000000000000000000000000000000000000"
ok 23 - .git tree (0000000000000000000000000000000000000000)

expecting success: gitweb_run "p=.git;a=tag;h=0000000000000000000000000000000000000000"
U test/empty
not ok 26 - cvs update w/o -d doesn't create subdir (TODO) # TODO known breakage

expecting success: (for dir in A A/B A/B/C A/D E; do
      mkdir $dir &&
      echo "test file in $dir" >"$dir/file_in_$(echo $dir|sed -e "s#/# #g")"  &&
      git add $dir;
   done) &&
   git commit -q -m "deep sub directory structure" &&
   git push gitcvs.git >/dev/null &&
   cd cvswork &&
   GIT_CONFIG="$git_config" cvs -Q update -d &&
   (for dir in A A/B A/B/C A/D E; do
      filename="file_in_$(echo $dir|sed -e "s#/# #g")" &&
      if test "$(echo $(grep -v ^D $dir/CVS/Entries|cut -d/ -f2,3,5))" = "$filename/1.1/" &&
	test_cmp "$dir/$filename" "../$dir/$filename"; then
        :
      else
        echo >failure
      fi
    done) &&
   test ! -f failure
To gitcvs.git
   61b61d7..097b5d4  master -> master
ok 24 - .git tag (0000000000000000000000000000000000000000)

expecting success: gitweb_run "p=.git;a=blob;f=non-existent"
ok 15 - root dir edit [cvswork2]

expecting success: 
	(
		cd cvswork2 &&
		cvs -f rm -f t2 &&
		cvs -f diff -u >../cvsEdit2-empty.diff &&
		! cvs -f diff -N -u >"$WORKDIR/cvsEdit2-N.diff" &&
		cvs -f commit -m "rm t2"
	) >cvsEdit2.log 2>&1

ok 25 - .git blob (non-existent)

expecting success: gitweb_run "p=.git;a=blob_plain;f=non-existent"
U A/file_in_A
U E/file_in_E
U A/B/file_in_A B
U A/D/file_in_A D
U A/B/C/file_in_A B C
ok 27 - cvs update (subdirectories)

expecting success: git rm testfile1 &&
   git commit -q -m "Remove testfile1" &&
   git push gitcvs.git >/dev/null &&
   cd cvswork &&
   GIT_CONFIG="$git_config" cvs -Q update &&
   test -z "$(grep testfile1 CVS/Entries)" &&
   test ! -f testfile1
rm 'testfile1'
To gitcvs.git
   097b5d4..639576b  master -> master
ok 26 - .git blob_plain (non-existent)

expecting success: gitweb_run "p=.git;a=commitdiff"
cvs update: `testfile1' is no longer in the repository
ok 28 - cvs update (delete file)

expecting success: echo readded testfile >testfile1 &&
   git add testfile1 &&
   git commit -q -m "Re-Add testfile1" &&
   git push gitcvs.git >/dev/null &&
   cd cvswork &&
   GIT_CONFIG="$git_config" cvs -Q update &&
   test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.4/" &&
   test_cmp testfile1 ../testfile1
To gitcvs.git
   639576b..03d2b11  master -> master
ok 27 - commitdiff(0): root

expecting success: echo "New file" > new_file &&
	 git add new_file &&
	 git commit -a -m "File added." &&
	 gitweb_run "p=.git;a=commitdiff"
[master 20e6af4] File added.
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 new_file
ok 28 - commitdiff(0): file added

expecting success: test_chmod +x new_file &&
	 git commit -a -m "Mode changed." &&
	 gitweb_run "p=.git;a=commitdiff"
[master 107ad9d] Mode changed.
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 new_file
U testfile1
ok 29 - cvs update (re-add deleted file)

expecting success: echo Line 0 >expected &&
   for i in 1 2 3 4 5 6 7
   do
     echo Line $i >>merge
     echo Line $i >>expected
   done &&
   echo Line 8 >>expected &&
   git add merge &&
   git commit -q -m "Merge test (pre-merge)" &&
   git push gitcvs.git >/dev/null &&
   cd cvswork &&
   GIT_CONFIG="$git_config" cvs -Q update &&
   test "$(echo $(grep merge CVS/Entries|cut -d/ -f2,3,5))" = "merge/1.1/" &&
   test_cmp merge ../merge &&
   ( echo Line 0; cat merge ) >merge.tmp &&
   mv merge.tmp merge &&
   cd "$WORKDIR" &&
   echo Line 8 >>merge &&
   git add merge &&
   git commit -q -m "Merge test (merge)" &&
   git push gitcvs.git >/dev/null &&
   cd cvswork &&
   sleep 1 && touch merge &&
   GIT_CONFIG="$git_config" cvs -Q update &&
   test_cmp merge ../expected
To gitcvs.git
   03d2b11..64b5d0f  master -> master
ok 16 - root dir rm file [cvswork2]

expecting success: 
	(
		cd cvswork2 &&
		sed -e "s/line 1/line 1 (v2)/" adir/bdir/bfile >adir/bdir/bfileNEW &&
		mv -f adir/bdir/bfileNEW adir/bdir/bfile &&
		rm adir/bdir/b2file &&
		cd adir &&
		cvs -f rm bdir/b2file &&
		echo "4th file" >bdir/b4file &&
		cvs -f add bdir/b4file &&
		! cvs -f diff -N -u >"$WORKDIR/cvsEdit3.diff" &&
		git fetch gitcvs.git b2:b2 &&
		(
		  cd .. &&
		  ! cvs -f diff -u -N -r v1.2 >"$WORKDIR/cvsEdit3-v1.2.diff" &&
		  ! cvs -f diff -u -N -r v1.2 -r v1 >"$WORKDIR/cvsEdit3-v1.2-v1.diff"
		) &&
		cvs -f commit -m "various add/rm/edit"
	) >cvs.log 2>&1

ok 29 - commitdiff(0): mode change

expecting success: git mv new_file renamed_file &&
	 git commit -a -m "File renamed." &&
	 gitweb_run "p=.git;a=commitdiff"
[master c821a48] File renamed.
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename new_file => renamed_file (100%)
U merge
To gitcvs.git
   64b5d0f..cc9182d  master -> master
ok 30 - commitdiff(0): file renamed

expecting success: rm renamed_file &&
	 test_ln_s_add file renamed_file &&
	 git commit -a -m "File to symlink." &&
	 gitweb_run "p=.git;a=commitdiff"
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
[master f91d821] File to symlink.
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
 rewrite renamed_file (100%)
 mode change 100755 => 120000
ok 12 - cvs status - sticky options

expecting success: 
    (cd cvswork &&
    echo "simpleText" > simpleText.c &&
    GIT_CONFIG="$git_config" cvs -Q add simpleText.c
    ) &&
    marked_as cvswork simpleText.c ""

ok 31 - commitdiff(0): file to symlink

expecting success: git rm renamed_file &&
	 rm -f renamed_file &&
	 git commit -a -m "File removed." &&
	 gitweb_run "p=.git;a=commitdiff"
rm 'renamed_file'
[master 78ce7f8] File removed.
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 120000 renamed_file
cvs add: scheduling file `simpleText.c' for addition
cvs add: use `cvs commit' to add this file permanently
ok 13 - add text (guess)

expecting success: 
    (cd cvswork &&
    echo "simpleBin: NUL: Q <- there" | q_to_nul > simpleBin.bin &&
    GIT_CONFIG="$git_config" cvs -Q add simpleBin.bin
    ) &&
    marked_as cvswork simpleBin.bin -kb

ok 32 - commitdiff(0): file deleted

expecting success: cp file file2 &&
	 git add file2 &&
	 git commit -a -m "File copied." &&
	 gitweb_run "p=.git;a=commitdiff"
[master 3bf2726] File copied.
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file2
Merging differences between 1.1 and 1.2 into merge
M merge
ok 30 - cvs update (merge)

expecting success: ( echo LINE 0; cat merge ) >merge.tmp &&
   mv merge.tmp merge &&
   git add merge &&
   git commit -q -m "Merge test (conflict)" &&
   git push gitcvs.git >/dev/null &&
   cd cvswork &&
   GIT_CONFIG="$git_config" cvs -Q update &&
   test_cmp merge ../expected.C
cvs add: scheduling file `simpleBin.bin' for addition
cvs add: use `cvs commit' to add this file permanently
To gitcvs.git
   cc9182d..df54699  master -> master
ok 33 - commitdiff(0): file copied / new file

expecting success: echo "New line" >> file2 &&
	 test_chmod +x file2 &&
	 git commit -a -m "Mode change and modification." &&
	 gitweb_run "p=.git;a=commitdiff"
[master f1d11c1] Mode change and modification.
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 mode change 100644 => 100755 file2
ok 14 - add bin (guess)

expecting success: 
    (cd cvswork &&
    GIT_CONFIG="$git_config" cvs -Q rm -f subdir/file.h &&
    (cd subdir &&
    GIT_CONFIG="$git_config" cvs -Q rm -f withCr.bin
    )) &&
    marked_as cvswork/subdir withCr.bin -kb &&
    marked_as cvswork/subdir file.h ""

cvs update: conflicts found in merge
Merging differences between 1.2 and 1.3 into merge
C merge
ok 31 - cvs update (conflict merge)

expecting success: cd cvswork &&
   GIT_CONFIG="$git_config" cvs -Q update -C &&
   test_cmp merge ../merge
ok 34 - commitdiff(0): mode change and modified

expecting success: cat >file2<<EOF &&
Dominus regit me,
et nihil mihi deerit.
In loco pascuae ibi me collocavit,
super aquam refectionis educavit me;
animam meam convertit,
deduxit me super semitas jusitiae,
propter nomen suum.
EOF
	 git commit -a -m "File added." &&
	 git mv file2 file3 &&
	 echo "Propter nomen suum." >> file3 &&
	 git commit -a -m "File rename and modification." &&
	 gitweb_run "p=.git;a=commitdiff"
cvs remove: scheduling `subdir/file.h' for removal
[master 7e8ffbd] File added.
 Author: A U Thor <author@example.com>
 1 file changed, 7 insertions(+), 2 deletions(-)
cvs remove: use `cvs commit' to remove this file permanently
[master 1f33eba] File rename and modification.
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 rename file2 => file3 (90%)
ok 35 - commitdiff(0): renamed and modified

expecting success: git mv file3 file2 &&
	 echo "Propter nomen suum." >> file2 &&
	 test_chmod +x file2 &&
	 git commit -a -m "File rename, mode change and modification." &&
	 gitweb_run "p=.git;a=commitdiff"
[master a1ea16e] File rename, mode change and modification.
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 rename file3 => file2 (91%)
U empty
U merge
U secondrootfile
U testfile1
U A/file_in_A
U E/file_in_E
U test/empty
U A/B/file_in_A B
U A/D/file_in_A D
U A/B/C/file_in_A B C
ok 32 - cvs update (-C)

expecting success: echo Line 9 >>merge &&
    cp merge cvswork/merge &&
    git add merge &&
    git commit -q -m "Merge test (no-op)" &&
    git push gitcvs.git >/dev/null &&
    cd cvswork &&
    sleep 1 && touch merge &&
    GIT_CONFIG="$git_config" cvs -Q update &&
    test_cmp merge ../merge
To gitcvs.git
   df54699..3b72eb5  master -> master
cvs remove: scheduling `subdir/withCr.bin' for removal
cvs remove: use `cvs commit' to remove this file permanently
ok 15 - remove files (guess)

expecting success: 
    (cd cvswork &&
    GIT_CONFIG="$git_config" cvs -Q ci -m "add/rm files" >cvs.log 2>&1
    ) &&
    marked_as cvswork textfile.c "" &&
    marked_as cvswork binfile.bin -kb &&
    marked_as cvswork .gitattributes "" &&
    marked_as cvswork mixedUp.c -kb &&
    marked_as cvswork multiline.c -kb &&
    marked_as cvswork multilineTxt.c "" &&
    not_present cvswork/subdir withCr.bin &&
    not_present cvswork/subdir file.h &&
    marked_as cvswork/subdir unspecified.other "" &&
    marked_as cvswork/subdir newfile.bin "" &&
    marked_as cvswork/subdir newfile.c "" &&
    marked_as cvswork simpleBin.bin -kb &&
    marked_as cvswork simpleText.c ""

ok 36 - commitdiff(0): renamed, mode change and modified

expecting success: 
	echo "hello world" > foo &&
	echo "hi planet" > bar &&
	git update-index --add foo bar &&
	git commit -m initial &&
	git branch initial &&
	rm -f foo &&
	test_ln_s_add bar foo &&
	git commit -m "foo symlinked to bar" &&
	git branch foo-symlinked-to-bar &&
	rm -f foo &&
	echo "how far is the sun?" > foo &&
	git update-index foo &&
	git commit -m "foo back to file" &&
	git branch foo-back-to-file &&
	rm -f foo &&
	git update-index --remove foo &&
	mkdir foo &&
	echo "if only I knew" > foo/baz &&
	git update-index --add foo/baz &&
	git commit -m "foo becomes a directory" &&
	git branch "foo-becomes-a-directory" &&
	echo "hello world" > foo/baz &&
	git update-index foo/baz &&
	git commit -m "foo/baz is the original foo" &&
	git branch foo-baz-renamed-from-foo
	
[master a5db4db] initial
 Author: A U Thor <author@example.com>
 2 files changed, 2 insertions(+)
 create mode 100644 bar
 create mode 100644 foo
[master 5dbfb54] foo symlinked to bar
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
 rewrite foo (100%)
 mode change 100644 => 120000
[master 9885aa8] foo back to file
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
 rewrite foo (100%)
 mode change 120000 => 100644
[master ab2a034] foo becomes a directory
 Author: A U Thor <author@example.com>
 2 files changed, 1 insertion(+), 1 deletion(-)
 delete mode 100644 foo
 create mode 100644 foo/baz
[master 706c586] foo/baz is the original foo
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 37 - setup typechange commits

expecting success: gitweb_run "p=.git;a=commitdiff;hp=initial;h=foo-baz-renamed-from-foo"
ok 38 - commitdiff(2): file renamed from foo to foo/baz

expecting success: gitweb_run "p=.git;a=commitdiff;hp=foo-baz-renamed-from-foo;h=initial"
Merging differences between 1.3 and 1.4 into merge
M merge
ok 33 - cvs update (merge no-op)

expecting success: 
    touch really-empty &&
    echo Line 1 > no-lf &&
    printf "Line 2" >> no-lf &&
    git add really-empty no-lf &&
    git commit -q -m "Update -p test" &&
    git push gitcvs.git >/dev/null &&
    cd cvswork &&
    GIT_CONFIG="$git_config" cvs update &&
    rm -f failures &&
    for i in merge no-lf empty really-empty; do
        GIT_CONFIG="$git_config" cvs update -p "$i" >$i.out
	test_cmp $i.out ../$i >>failures 2>&1
    done &&
    test -z "$(cat failures)"

To gitcvs.git
   3b72eb5..15fc92f  master -> master
ok 16 - cvs ci (guess)

expecting success: 
    (cd cvswork2/subdir &&
    GIT_CONFIG="$git_config" cvs -Q update
    ) &&
    marked_as cvswork2 textfile.c "" &&
    marked_as cvswork2 binfile.bin -kb &&
    marked_as cvswork2 .gitattributes "" &&
    marked_as cvswork2 mixedUp.c -kb &&
    marked_as cvswork2 multiline.c -kb &&
    marked_as cvswork2 multilineTxt.c "" &&
    not_present cvswork2/subdir withCr.bin &&
    not_present cvswork2/subdir file.h &&
    marked_as cvswork2/subdir unspecified.other "" &&
    marked_as cvswork2/subdir newfile.bin "" &&
    marked_as cvswork2/subdir newfile.c "" &&
    not_present cvswork2 simpleBin.bin &&
    not_present cvswork2 simpleText.c

ok 39 - commitdiff(2): file renamed from foo/baz to foo

expecting success: gitweb_run "p=.git;a=commitdiff;hp=foo-becomes-a-directory;h=initial"
ok 17 - subdir edit/add/rm files [cvswork2]

expecting success: 
	git fetch gitcvs.git b2:b2 &&
	git tag v2 b2 &&
	git push --tags gitcvs.git b2:b2 &&
	check_start_tree cvswork2 &&
	check_file cvswork2 textfile.c v2 &&
	check_file cvswork2 adir/afile v2 &&
	check_file cvswork2 adir/a2file v2 &&
	check_file cvswork2 adir/bdir/bfile v2 &&
	check_file cvswork2 adir/bdir/b4file v2 &&
	check_end_full_tree cvswork2 v2

From gitcvs
   8ce9fb2..87db6cf  b2         -> b2
cvs update: `subdir/file.h' is no longer in the repository
cvs update: `subdir/withCr.bin' is no longer in the repository
To gitcvs.git
 * [new tag]         v2 -> v2
cvs update: Updating .
ok 18 - validate result of edits [cvswork2]

expecting success: 
	test $(grep Index: cvsEdit1.diff | wc -l) = 1 &&
	test_must_be_empty cvsEdit2-empty.diff &&
	test $(grep Index: cvsEdit2-N.diff | wc -l) = 1 &&
	test $(grep Index: cvsEdit3.diff | wc -l) = 3 &&
	rm -rf diffSandbox &&
	git clone -q -n . diffSandbox &&
	(
		cd diffSandbox &&
		git checkout v1 &&
		git apply -p0 --index <"$WORKDIR/cvsEdit1.diff" &&
		git apply -p0 --index <"$WORKDIR/cvsEdit2-N.diff" &&
		git apply -p0 --directory=adir --index <"$WORKDIR/cvsEdit3.diff" &&
		git diff --exit-code v2
	) >"check_diff_apply.out" 2>&1

ok 17 - update subdir of other copy (guess)

expecting success: 
    git pull gitcvs.git master &&
    sed "s/3/replaced_3/" < multilineTxt.c > ml.temp &&
    mv ml.temp multilineTxt.c &&
    git add multilineTxt.c &&
    git commit -q -m "modify multiline file" >> "${WORKDIR}/marked.log" &&
    git push gitcvs.git >/dev/null &&
    (cd cvswork2 &&
    sed "s/1/replaced_1/" < multilineTxt.c > ml.temp &&
    mv ml.temp multilineTxt.c &&
    GIT_CONFIG="$git_config" cvs update > cvs.log 2>&1
    ) &&
    marked_as cvswork2 textfile.c "" &&
    marked_as cvswork2 binfile.bin -kb &&
    marked_as cvswork2 .gitattributes "" &&
    marked_as cvswork2 mixedUp.c -kb &&
    marked_as cvswork2 multiline.c -kb &&
    marked_as cvswork2 multilineTxt.c "" &&
    not_present cvswork2/subdir withCr.bin &&
    not_present cvswork2/subdir file.h &&
    marked_as cvswork2/subdir unspecified.other "" &&
    marked_as cvswork2/subdir newfile.bin "" &&
    marked_as cvswork2/subdir newfile.c "" &&
    marked_as cvswork2 simpleBin.bin -kb &&
    marked_as cvswork2 simpleText.c "" &&
    echo "line replaced_1" > tmpExpect2 &&
    echo "line 2" >> tmpExpect2 &&
    echo "line replaced_3" >> tmpExpect2 &&
    echo "line 4" | q_to_nul >> tmpExpect2 &&
    cmp cvswork2/multilineTxt.c tmpExpect2

cvs update: Updating A
M merge
U no-lf
U really-empty
cvs update: Updating E
cvs update: Updating test
cvs update: Updating A/B
cvs update: Updating A/D
cvs update: Updating A/B/C
From gitcvs
 * branch            master     -> FETCH_HEAD
Updating b5e3852..57a6ae7
Fast-forward
 simpleBin.bin     | Bin 0 -> 27 bytes
 simpleText.c      |   1 +
 subdir/file.h     |   1 -
 subdir/withCr.bin |   1 -
 4 files changed, 1 insertion(+), 2 deletions(-)
 create mode 100644 simpleBin.bin
 create mode 100644 simpleText.c
 delete mode 100644 subdir/file.h
 delete mode 100644 subdir/withCr.bin
ok 19 - validate basic diffs saved during above cvswork2 edits

expecting success: 
	test $(grep Index: cvsEdit3-v1.2.diff | wc -l) = 9 &&
	check_diff cvsEdit3-v1.2.diff v1.2 v2

To gitcvs.git
   57a6ae7..677a890  master -> master
ok 20 - validate v1.2 diff saved during last cvswork2 edit

expecting success: 
	test $(grep Index: cvsEdit3-v1.2-v1.diff | wc -l) = 9 &&
	check_diff cvsEdit3-v1.2-v1.diff v1.2 v1

ok 40 - commitdiff(2): directory becomes file

expecting success: gitweb_run "p=.git;a=commitdiff;hp=initial;h=foo-becomes-a-directory"
ok 21 - validate v1.2 v1 diff saved during last cvswork2 edit

expecting success: 
	( cd cvswork2 && cvs -f up ) >cvs.log 2>&1 &&
	check_start_tree cvswork2 &&
	check_file cvswork2 textfile.c v2 &&
	check_file cvswork2 adir/afile v2 &&
	check_file cvswork2 adir/a2file v2 &&
	check_file cvswork2 adir/bdir/bfile v2 &&
	check_file cvswork2 adir/bdir/b4file v2 &&
	check_end_full_tree cvswork2 v2

ok 41 - commitdiff(2): file becomes directory

expecting success: gitweb_run "p=.git;a=commitdiff;hp=initial;h=foo-symlinked-to-bar"
ok 22 - cvs up [cvswork2]

expecting success: 
	( cd cvswork && cvs -f up -r b2 ) >cvs.log 2>&1 &&
	check_start_tree cvswork &&
	check_file cvswork textfile.c v2 &&
	check_file cvswork adir/afile v2 &&
	check_file cvswork adir/a2file v2 &&
	check_file cvswork adir/bdir/bfile v2 &&
	check_file cvswork adir/bdir/b4file v2 &&
	check_end_full_tree cvswork v2

ok 18 - update/merge full other copy (guess)

# passed all 18 test(s)
1..18
ok 42 - commitdiff(2): file becomes symlink

expecting success: gitweb_run "p=.git;a=commitdiff;hp=foo-symlinked-to-bar;h=foo-back-to-file"
*** t9501-gitweb-standalone-http-status.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9501-gitweb-standalone-http-status/.git/
ok 23 - cvs up -r b2 [back to cvswork]

expecting success: 
	( cd cvswork && cvs -f up -r b1 ) >cvs.log 2>&1 &&
	check_start_tree cvswork &&
	check_file cvswork textfile.c v1.2 &&
	check_file cvswork t3 v1.2 &&
	check_file cvswork adir/afile v1.2 &&
	check_file cvswork adir/a3file v1.2 &&
	check_file cvswork adir/bdir/bfile v1.2 &&
	check_file cvswork adir/bdir/b3file v1.2 &&
	check_file cvswork cdir/cfile v1.2 &&
	check_end_full_tree cvswork v1.2

expecting success: 
	test_commit 'SnapshotTests' 'i can has snapshot'

[master (root-commit) cea0920] SnapshotTests
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 i can has snapshot
ok 1 - setup

expecting success: gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tgz" &&
    grep "Status: 200 OK" gitweb.output &&
    gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tbz2" &&
    grep "403 - Unsupported snapshot format" gitweb.output &&
    gitweb_run "p=.git;a=snapshot;h=HEAD;sf=txz" &&
    grep "403 - Snapshot format not allowed" gitweb.output &&
    gitweb_run "p=.git;a=snapshot;h=HEAD;sf=zip" &&
    grep "403 - Unsupported snapshot format" gitweb.output
ok 43 - commitdiff(2): symlink becomes file

expecting success: gitweb_run "p=.git;a=commitdiff;hp=foo-symlinked-to-bar;h=foo-becomes-a-directory"
ok 34 - cvs update (-p)

expecting success: 
    GIT_DIR="$SERVERDIR" git pack-refs --all &&
    GIT_CONFIG="$git_config" cvs -n up -d 2> out &&
    grep "cvs update: New directory \`master'" < out

Binary file gitweb.output matches
cvs update: New directory `master'
ok 35 - cvs update (module list supports packed refs)

expecting success: 
    mkdir status.dir &&
    echo Line > status.dir/status.file &&
    echo Line > status.file &&
    git add status.dir status.file &&
    git commit -q -m "Status test" &&
    git push gitcvs.git >/dev/null &&
    cd cvswork &&
    GIT_CONFIG="$git_config" cvs update &&
    GIT_CONFIG="$git_config" cvs status | grep "^File: status.file" >../out &&
    test_line_count = 2 ../out

To gitcvs.git
   15fc92f..374d4ca  master -> master
ok 44 - commitdiff(2): symlink becomes directory

expecting success: gitweb_run "p=.git;a=commitdiff;hp=foo-becomes-a-directory;h=foo-symlinked-to-bar"
ok 24 - cvs up -r b1

expecting success: 
	( cd cvswork && cvs -f up -A ) >cvs.log 2>&1 &&
	check_start_tree cvswork &&
	check_file cvswork textfile.c v1 &&
	check_file cvswork t2 v1 &&
	check_file cvswork adir/afile v1 &&
	check_file cvswork adir/a2file v1 &&
	check_file cvswork adir/bdir/bfile v1 &&
	check_file cvswork adir/bdir/b2file v1 &&
	check_end_full_tree cvswork v1

403 - Unsupported snapshot format
ok 45 - commitdiff(2): directory becomes symlink

expecting success: 
	cat >file<<-\EOF &&
	Dominus regit me,
	et nihil mihi deerit.
	In loco pascuae ibi me collocavit,
	super aquam refectionis educavit me;
	animam meam convertit,
	deduxit me super semitas jusitiae,
	propter nomen suum.
	CHANGE_ME
	EOF
	git commit -a -m "Preparing for incomplete lines" &&
	echo "incomplete" | tr -d "\\012" >>file &&
	git commit -a -m "Add incomplete line" &&
	git tag incomplete_lines_add &&
	sed -e s/CHANGE_ME/change_me/ <file >file+ &&
	mv -f file+ file &&
	git commit -a -m "Incomplete context line" &&
	git tag incomplete_lines_ctx &&
	echo "Dominus regit me," >file &&
	echo "incomplete line" | tr -d "\\012" >>file &&
	git commit -a -m "Change incomplete line" &&
	git tag incomplete_lines_chg &&
	echo "Dominus regit me," >file &&
	git commit -a -m "Remove incomplete line" &&
	git tag incomplete_lines_rem

[master a7d9d93] Preparing for incomplete lines
 Author: A U Thor <author@example.com>
 1 file changed, 8 insertions(+), 1 deletion(-)
[master 360ecc4] Add incomplete line
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
[master 1a415e9] Incomplete context line
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
cvs update: Updating .
Use of uninitialized value $wrev in string ne at /«PKGBUILDDIR»/git-cvsserver line 1262.
Use of uninitialized value $wrev in string ne at /«PKGBUILDDIR»/git-cvsserver line 1307.
cvs update: `empty.out' is no longer in the repository
Use of uninitialized value $wrev in string ne at /«PKGBUILDDIR»/git-cvsserver line 1262.
Use of uninitialized value $wrev in string ne at /«PKGBUILDDIR»/git-cvsserver line 1307.
cvs update: `failures' is no longer in the repository
Use of uninitialized value $wrev in string ne at /«PKGBUILDDIR»/git-cvsserver line 1262.
Use of uninitialized value $wrev in string ne at /«PKGBUILDDIR»/git-cvsserver line 1307.
cvs update: `merge.out' is no longer in the repository
M merge
Use of uninitialized value $wrev in string ne at /«PKGBUILDDIR»/git-cvsserver line 1262.
Use of uninitialized value $wrev in string ne at /«PKGBUILDDIR»/git-cvsserver line 1307.
cvs update: `no-lf.out' is no longer in the repository
[master 7212823] Change incomplete line
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 8 deletions(-)
Use of uninitialized value $wrev in string ne at /«PKGBUILDDIR»/git-cvsserver line 1262.
Use of uninitialized value $wrev in string ne at /«PKGBUILDDIR»/git-cvsserver line 1307.
cvs update: `really-empty.out' is no longer in the repository
[master b3d2d46] Remove incomplete line
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
cvs update: Updating A
U status.file
cvs update: Updating E
cvs update: Updating status.dir
ok 46 - setup incomplete lines

expecting success: 
	gitweb_run "p=.git;a=commitdiff;h=incomplete_lines_add"

cvs update: Updating test
U status.dir/status.file
cvs update: Updating A/B
cvs update: Updating A/D
cvs update: Updating A/B/C
403 - Snapshot format not allowed
ok 47 - commitdiff(1): addition of incomplete line

expecting success: 
	gitweb_run "p=.git;a=commitdiff;h=incomplete_lines_ctx"

403 - Unsupported snapshot format
ok 2 - snapshots: tgz only default format enabled

expecting success: gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tgz" &&
    grep "Status: 200 OK" gitweb.output &&
    gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tbz2" &&
    grep "Status: 200 OK" gitweb.output &&
    gitweb_run "p=.git;a=snapshot;h=HEAD;sf=txz" &&
    grep "403 - Snapshot format not allowed" gitweb.output &&
    gitweb_run "p=.git;a=snapshot;h=HEAD;sf=zip" &&
    grep "Status: 200 OK" gitweb.output
ok 25 - cvs up -A

expecting success: 
	( cd cvswork && cvs -f up ) >cvs.log 2>&1 &&
	check_start_tree cvswork &&
	check_file cvswork textfile.c v1 &&
	check_file cvswork t2 v1 &&
	check_file cvswork adir/afile v1 &&
	check_file cvswork adir/a2file v1 &&
	check_file cvswork adir/bdir/bfile v1 &&
	check_file cvswork adir/bdir/b2file v1 &&
	check_end_full_tree cvswork v1

ok 36 - cvs status

expecting success: 
    cd cvswork &&
    GIT_CONFIG="$git_config" cvs status -l | grep "^File: status.file" >../out &&
    test_line_count = 1 ../out

ok 48 - commitdiff(1): incomplete line as context line

expecting success: 
	gitweb_run "p=.git;a=commitdiff;h=incomplete_lines_chg"

Binary file gitweb.output matches
ok 37 - cvs status (nonrecursive)

expecting success: 
    cd cvswork &&
    GIT_CONFIG="$git_config" cvs status | grep ^File: >../out &&
    ! grep / <../out

ok 26 - cvs up (check CVS/Tag files)

expecting success: 
	( cd cvswork && cvs -f up -r heads/b1 ) >cvs.log 2>&1 &&
	check_start_tree cvswork &&
	check_file cvswork textfile.c v1.2 &&
	check_file cvswork t3 v1.2 &&
	check_file cvswork adir/afile v1.2 &&
	check_file cvswork adir/a3file v1.2 &&
	check_file cvswork adir/bdir/bfile v1.2 &&
	check_file cvswork adir/bdir/b3file v1.2 &&
	check_file cvswork cdir/cfile v1.2 &&
	check_end_full_tree cvswork v1.2

ok 49 - commitdiff(1): change incomplete line

expecting success: 
	gitweb_run "p=.git;a=commitdiff;h=incomplete_lines_rem"

ok 38 - cvs status (no subdirs in header)

expecting success: 
    GIT_CONFIG="$git_config" cvs co -c > out &&
    grep "^master[	 ][ 	]*master$" <out &&
    ! grep -v "^master[	 ][ 	]*master$" <out

Binary file gitweb.output matches
master	master
ok 39 - cvs co -c (shows module database)

expecting success: 
    cd cvswork &&
    test x"$expectStat" = x"0" &&
    GIT_CONFIG="$git_config" cvs log merge >../out &&
    sed -e "s%2[0-9][0-9][0-9]/[01][0-9]/[0-3][0-9] [0-2][0-9]:[0-5][0-9]:[0-5][0-9]%__DATE__%" ../out > ../actual &&
    test_cmp ../expect ../actual

ok 50 - commitdiff(1): removal of incomplete line

expecting success: git checkout b &&
	 echo "Branch" >> b &&
	 git add b &&
	 git commit -a -m "On branch" &&
	 git checkout master &&
	 git merge b &&
	 git tag merge_commit
Switched to branch 'b'
[b 0140277] On branch
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 b
Switched to branch 'master'
Merging:
b3d2d46 Remove incomplete line
virtual b
found 1 common ancestor:
7704ba3 Initial commit.
Merge made by the 'recursive' strategy.
403 - Snapshot format not allowed
 b | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 b
ok 51 - Create a merge

expecting success: gitweb_run "p=.git;a=commit"
ok 27 - cvs up -r heads/b1

expecting success: 
	( cd cvswork && cvs -f up -r heads_-s-b2 ) >cvs.log 2>&1 &&
	check_start_tree cvswork &&
	check_file cvswork textfile.c v2 &&
	check_file cvswork adir/afile v2 &&
	check_file cvswork adir/a2file v2 &&
	check_file cvswork adir/bdir/bfile v2 &&
	check_file cvswork adir/bdir/b4file v2 &&
	check_end_full_tree cvswork v2

ok 40 - cvs log

expecting success: 
    cd cvswork &&
    GIT_CONFIG="$git_config" cvs annotate merge >../out &&
    sed -e "s/ .*//" ../out >../actual &&
    for i in 3 1 1 1 1 1 1 1 2 4; do echo 1.$i; done >../expect &&
    test_cmp ../expect ../actual

ok 52 - commit(0): merge commit

expecting success: gitweb_run "p=.git;a=commitdiff"
Binary file gitweb.output matches
ok 3 - snapshots: all enabled in default, use default disabled value

expecting success: gitweb_run "p=.git;a=snapshot;h=HEAD;sf=zip" &&
    grep "403 - Snapshot format not allowed" gitweb.output
Annotations for merge
***************
ok 41 - cvs annotate

# still have 1 known breakage(s)
# passed all remaining 40 test(s)
1..41
*** t9502-gitweb-standalone-parse-output.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9502-gitweb-standalone-parse-output/.git/
ok 53 - commitdiff(0): merge commit

expecting success: git checkout b &&
	 echo "To be changed" > 01-change &&
	 echo "To be renamed" > 02-pure-rename-from &&
	 echo "To be deleted" > 03-delete &&
	 echo "To be renamed and changed" > 04-rename-from &&
	 echo "To have mode changed" > 05-mode-change &&
	 echo "File to symlink" > 06-file-or-symlink &&
	 echo "To be changed and have mode changed" > 07-change-mode-change	&&
	 git add 0* &&
	 git commit -a -m "Prepare large commit" &&
	 echo "Changed" > 01-change &&
	 git mv 02-pure-rename-from 02-pure-rename-to &&
	 git rm 03-delete && rm -f 03-delete &&
	 echo "A new file" > 03-new &&
	 git add 03-new &&
	 git mv 04-rename-from 04-rename-to &&
	 echo "Changed" >> 04-rename-to &&
	 test_chmod +x 05-mode-change &&
	 rm -f 06-file-or-symlink &&
	 test_ln_s_add 01-change 06-file-or-symlink &&
	 echo "Changed and have mode changed" > 07-change-mode-change	&&
	 test_chmod +x 07-change-mode-change &&
	 git commit -a -m "Large commit" &&
	 git checkout master
Switched to branch 'b'
403 - Snapshot format not allowed
ok 4 - snapshots: zip explicitly disabled

expecting success: gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tgz" &&
    grep "Status: 200 OK" gitweb.output
[b 4d068c1] Prepare large commit
 Author: A U Thor <author@example.com>
 7 files changed, 7 insertions(+)
 create mode 100644 01-change
 create mode 100644 02-pure-rename-from
 create mode 100644 03-delete
 create mode 100644 04-rename-from
 create mode 100644 05-mode-change
 create mode 100644 06-file-or-symlink
 create mode 100644 07-change-mode-change
rm '03-delete'
expecting success: 
	test_commit first foo &&
	git branch xx/test &&
	FULL_ID=$(git rev-parse --verify HEAD) &&
	SHORT_ID=$(git rev-parse --verify --short=7 HEAD)

[b 3390940] Large commit
 Author: A U Thor <author@example.com>
 8 files changed, 5 insertions(+), 4 deletions(-)
 rename 02-pure-rename-from => 02-pure-rename-to (100%)
 delete mode 100644 03-delete
 create mode 100644 03-new
 rename 04-rename-from => 04-rename-to (76%)
 mode change 100644 => 100755 05-mode-change
 rewrite 06-file-or-symlink (100%)
 mode change 100644 => 120000
 mode change 100644 => 100755 07-change-mode-change
Switched to branch 'master'
ok 54 - Prepare large commit

expecting success: gitweb_run "p=.git;a=commit;h=b"
[master (root-commit) 1005c80] first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 foo
ok 1 - setup

expecting success: 
	gitweb_run "p=.git;a=snapshot;h=$FULL_ID;sf=tar" &&
	check_snapshot ".git-$SHORT_ID"

ok 28 - cvs up -r heads_-s-b2 (cvsserver escape mechanism)

expecting success: 
	test -n "$v1hash" &&
	( cd cvswork && cvs -f up -r "$v1hash" ) >cvs.log 2>&1 &&
	check_start_tree cvswork &&
	check_file cvswork textfile.c v1 &&
	check_file cvswork t2 v1 &&
	check_file cvswork adir/afile v1 &&
	check_file cvswork adir/a2file v1 &&
	check_file cvswork adir/bdir/bfile v1 &&
	check_file cvswork adir/bdir/b2file v1 &&
	check_end_full_tree cvswork v1

Binary file gitweb.output matches
ok 5 - snapshots: tgz explicitly enabled

expecting success: 
	gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
	grep "Status: 200 OK" gitweb.output

basename=.git-1005c80
ok 2 - snapshot: full sha1

expecting success: 
	gitweb_run "p=.git;a=snapshot;h=$SHORT_ID;sf=tar" &&
	check_snapshot ".git-$SHORT_ID"

ok 55 - commit(1): large commit

expecting success: gitweb_run "p=.git;a=commitdiff;h=b"
Binary file gitweb.output matches
ok 6 - snapshots: good tree-ish id

expecting success: 
	gitweb_run "p=.git;a=snapshot;h=frizzumFrazzum;sf=tgz" &&
	grep "404 - Object does not exist" gitweb.output

basename=.git-1005c80
ok 3 - snapshot: shortened sha1

expecting success: 
	ID=$(git rev-parse --short=30 HEAD) &&
	gitweb_run "p=.git;a=snapshot;h=$ID;sf=tar" &&
	check_snapshot ".git-$SHORT_ID"

ok 29 - cvs up -r $(git rev-parse v1)

expecting success: 
	( cd cvswork && cvs -f diff -r v1 -u ) >cvsDiff.out 2>cvs.log &&
	test_must_be_empty cvsDiff.out &&
	test_must_be_empty cvs.log

ok 56 - commitdiff(1): large commit

expecting success: 
	gitweb_run "p=.git;a=commitdiff;h=incomplete_lines_add;ds=sidebyside"

404 - Object does not exist
ok 7 - snapshots: bad tree-ish id

expecting success: 
	echo object > tag-object &&
	git add tag-object &&
	test_tick && git commit -m "Object to be tagged" &&
	git tag tagged-object `git hash-object tag-object` &&
	gitweb_run "p=.git;a=snapshot;h=tagged-object;sf=tgz" &&
	grep "400 - Object is not a tree-ish" gitweb.output

[master 031b7cf] Object to be tagged
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 tag-object
basename=.git-1005c80
ok 4 - snapshot: almost full sha1

expecting success: 
	gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tar" &&
	check_snapshot ".git-HEAD-$SHORT_ID"

ok 30 - cvs diff -r v1 -u

expecting success: 
	( cd cvswork && ! cvs -f diff -N -r v2 -u ) >cvsDiff.out 2>cvs.log &&
	test_must_be_empty cvs.log &&
	test -s cvsDiff.out &&
	check_diff cvsDiff.out v2 v1 >check_diff.out 2>&1

ok 57 - side-by-side: addition of incomplete line

expecting success: 
	gitweb_run "p=.git;a=commitdiff;h=incomplete_lines_ctx;ds=sidebyside"

400 - Object is not a tree-ish
ok 8 - snapshots: bad tree-ish id (tagged object)

expecting success: 
	ID=`git rev-parse --verify HEAD` &&
	gitweb_run "p=.git;a=snapshot;h=$ID;sf=tgz" &&
	grep "Status: 200 OK" gitweb.output

basename=.git-HEAD-1005c80
ok 5 - snapshot: HEAD

expecting success: 
	gitweb_run "p=.git;a=snapshot;h=master;sf=tar" &&
	ID=$(git rev-parse --verify --short=7 master) &&
	check_snapshot ".git-master-$ID"

ok 58 - side-by-side: incomplete line as context line

expecting success: 
	gitweb_run "p=.git;a=commitdiff;h=incomplete_lines_chg;ds=sidebyside"

Binary file gitweb.output matches
ok 9 - snapshots: good object id

expecting success: 
	gitweb_run "p=.git;a=snapshot;h=abcdef01234;sf=tgz" &&
	grep "404 - Object does not exist" gitweb.output

ok 31 - cvs diff -N -r v2 -u

expecting success: 
	( cd cvswork && ! cvs -f diff -N -r v2 -r v1.2 -u ) >cvsDiff.out 2>cvs.log &&
	test_must_be_empty cvs.log &&
	test -s cvsDiff.out &&
	check_diff cvsDiff.out v2 v1.2 >check_diff.out 2>&1

basename=.git-master-1005c80
ok 59 - side-by-side: changed incomplete line

expecting success: 
	gitweb_run "p=.git;a=commitdiff;h=incomplete_lines_rem;ds=sidebyside"

ok 6 - snapshot: short branch name (master)

expecting success: 
	gitweb_run "p=.git;a=snapshot;h=first;sf=tar" &&
	ID=$(git rev-parse --verify --short=7 first) &&
	check_snapshot ".git-first-$ID"

404 - Object does not exist
ok 10 - snapshots: bad object id

expecting success: 
	gitweb_run "p=.git;a=atom;h=master" &&
	grep "Status: 200 OK" gitweb.headers &&
	grep "Last-modified: Thu, 7 Apr 2005 22:14:13 +0000" gitweb.headers

ok 60 - side-by-side: removal of incomplete line

expecting success: 
	gitweb_run "p=.git;a=commitdiff;h=merge_commit;ds=sidebyside"

basename=.git-first-1005c80
ok 7 - snapshot: short tag name (first)

expecting success: 
	gitweb_run "p=.git;a=snapshot;h=refs/heads/master;sf=tar" &&
	ID=$(git rev-parse --verify --short=7 master) &&
	check_snapshot ".git-master-$ID"

Status: 200 OK
Last-modified: Thu, 7 Apr 2005 22:14:13 +0000
ok 11 - modification: feed last-modified

expecting success: 
	HTTP_IF_MODIFIED_SINCE="Wed, 6 Apr 2005 22:14:13 +0000" &&
	export HTTP_IF_MODIFIED_SINCE &&
	test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&
	gitweb_run "p=.git;a=atom;h=master" &&
	grep "Status: 200 OK" gitweb.headers

ok 61 - side-by-side: merge commit

expecting success: git checkout master &&
	 git tag -a -m "Tag commit object" tag-commit HEAD &&
	 git tag -a -m "" tag-commit-nomessage HEAD &&
	 git tag -a -m "Tag tag object" tag-tag tag-commit &&
	 git tag -a -m "Tag tree object" tag-tree HEAD^{tree} &&
	 git tag -a -m "Tag blob object" tag-blob HEAD:file &&
	 git tag lightweight/tag-commit HEAD &&
	 git tag lightweight/tag-tag tag-commit &&
	 git tag lightweight/tag-tree HEAD^{tree} &&
	 git tag lightweight/tag-blob HEAD:file &&
	 gitweb_run "p=.git;a=tags"
Already on 'master'
ok 32 - cvs diff -N -r v2 -r v1.2

expecting success: 
	git clone -q . gitwork3 &&
	(
		cd gitwork3 &&
		git checkout -b b3 v1 &&
		git apply -p0 --index <"$WORKDIR/cvswork3edit.diff" &&
		git commit -m "cvswork3 edits applied"
	) &&
	git fetch gitwork3 b3:b3 &&
	git tag v3 b3

basename=.git-master-1005c80
ok 8 - snapshot: full branch name (refs/heads/master)

expecting success: 
	gitweb_run "p=.git;a=snapshot;h=refs/tags/first;sf=tar" &&
	check_snapshot ".git-first"

Switched to a new branch 'b3'
[b3 bac68f1] cvswork3 edits applied
 Author: A U Thor <author@example.com>
 3 files changed, 2 insertions(+), 2 deletions(-)
 create mode 100644 adir/afile5
 delete mode 100644 t2
From gitwork3
 * [new branch]      b3         -> b3
ok 33 - apply early [cvswork3] diff to b3

expecting success: 
	( cd cvswork3 && ! cvs -f diff -N -u ) >"$WORKDIR/cvsDiff.out" 2>cvs.log &&
	test_must_be_empty cvs.log &&
	test -s cvsDiff.out &&
	test $(grep Index: cvsDiff.out | wc -l) = 3 &&
	test_cmp cvsDiff.out cvswork3edit.diff &&
	check_diff cvsDiff.out v1 v3 >check_diff.out 2>&1

Status: 200 OK
ok 12 - modification: feed if-modified-since (modified)

expecting success: 
	HTTP_IF_MODIFIED_SINCE="Thu, 7 Apr 2005 22:14:13 +0000" &&
	export HTTP_IF_MODIFIED_SINCE &&
	test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&
	gitweb_run "p=.git;a=atom;h=master" &&
	grep "Status: 304 Not Modified" gitweb.headers

basename=.git-first
ok 9 - snapshot: full tag name (refs/tags/first)

expecting success: 
	gitweb_run "p=.git;a=snapshot;h=xx/test;sf=tar" &&
	! grep "filename=.*/" gitweb.headers

ok 62 - tags: list of different types of tags

expecting success: gitweb_run "p=.git;a=tag;h=tag-commit"
Status: 304 Not Modified
ok 13 - modification: feed if-modified-since (unmodified)

expecting success: 
	gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
	grep "Status: 200 OK" gitweb.headers &&
	grep "Last-modified: Thu, 7 Apr 2005 22:14:13 +0000" gitweb.headers

ok 34 - check [cvswork3] diff

expecting success: 
	( cd gitwork3 && git merge -m "message" b1 ) &&
	git fetch gitwork3 b3:b3 &&
	git tag v3merged b3 &&
	git push --tags gitcvs.git b3:b3

Merging:
bac68f1 cvswork3 edits applied
virtual b1
found 1 common ancestor:
ea4c2f9 First Commit (v1)
Removing adir/bdir/b2file
Auto-merging adir/afile
Removing adir/a2file
Merge made by the 'recursive' strategy.
 adir/a2file      | 1 -
 adir/a3file      | 1 +
 adir/afile       | 2 +-
 adir/bdir/b2file | 1 -
 adir/bdir/b3file | 1 +
 adir/bdir/bfile  | 1 +
 cdir/cfile       | 1 +
 t3               | 1 +
 8 files changed, 6 insertions(+), 3 deletions(-)
 delete mode 100644 adir/a2file
 create mode 100644 adir/a3file
 delete mode 100644 adir/bdir/b2file
 create mode 100644 adir/bdir/b3file
 create mode 100644 cdir/cfile
 create mode 100644 t3
From gitwork3
   bac68f1..8e8387c  b3         -> b3
To gitcvs.git
 * [new branch]      b3 -> b3
 * [new tag]         v3 -> v3
 * [new tag]         v3merged -> v3merged
ok 35 - merge early [cvswork3] b3 with b1

expecting success: 
	(
		cd cvswork3 &&
		cvs -f up &&
		! cvs -f diff -N -u >"$WORKDIR/cvsDiff.out"
	) >cvs.log 2>&1 &&
	test -s cvsDiff.out &&
	test $(grep Index: cvsDiff.out | wc -l) = 2 &&
	check_start_tree cvswork3 &&
	check_file cvswork3 textfile.c v3merged &&
	check_file cvswork3 t3 v3merged &&
	check_file cvswork3 adir/afile v3merged &&
	check_file cvswork3 adir/a3file v3merged &&
	check_file cvswork3 adir/afile5 v3merged &&
	check_file cvswork3 adir/bdir/bfile v3merged &&
	check_file cvswork3 adir/bdir/b3file v3merged &&
	check_file cvswork3 cdir/cfile v3merged &&
	check_end_full_tree cvswork3 v3merged

ok 10 - snapshot: hierarchical branch name (xx/test)

expecting success: 
	git init --bare foo.git &&
	echo file > file &&
	git --git-dir=foo.git --work-tree=. add file &&
	git --git-dir=foo.git --work-tree=. commit -m "Initial commit" &&
	echo "foo" > foo.git/description &&
	git clone --bare foo.git foo.bar.git &&
	echo "foo.bar" > foo.bar.git/description &&
	git clone --bare foo.git foo_baz.git &&
	echo "foo_baz" > foo_baz.git/description &&
	rm -fr   foo &&
	mkdir -p foo &&
	(
		cd foo &&
		git clone --shared --bare ../foo.git foo-forked.git &&
		echo "fork of foo" > foo-forked.git/description
	)

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9502-gitweb-standalone-parse-output/foo.git/
[master (root-commit) d29c088] Initial commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
Cloning into bare repository 'foo.bar.git'...
done.
ok 63 - tag: Tag to commit object

expecting success: gitweb_run "p=.git;a=tag;h=lightweight/tag-commit"
Cloning into bare repository 'foo_baz.git'...
done.
Cloning into bare repository 'foo-forked.git'...
done.
ok 11 - forks: setup

expecting success: 
	gitweb_run "a=project_list" &&
	grep -q ">\\.git<"               gitweb.body &&
	grep -q ">foo\\.git<"            gitweb.body &&
	grep -q ">foo_baz\\.git<"        gitweb.body &&
	grep -q ">foo\\.bar\\.git<"      gitweb.body &&
	grep -q ">foo_baz\\.git<"        gitweb.body &&
	grep -q ">foo/foo-forked\\.git<" gitweb.body &&
	grep -q ">fork of .*<"           gitweb.body

Status: 200 OK
Last-modified: Thu, 7 Apr 2005 22:14:13 +0000
ok 14 - modification: snapshot last-modified

expecting success: 
	HTTP_IF_MODIFIED_SINCE="Wed, 6 Apr 2005 22:14:13 +0000" &&
	export HTTP_IF_MODIFIED_SINCE &&
	test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&
	gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
	grep "Status: 200 OK" gitweb.headers

ok 64 - tag: on lightweight tag (invalid)

expecting success: gitweb_run "p=.git;a=log"
Status: 200 OK
ok 15 - modification: snapshot if-modified-since (modified)

expecting success: 
	HTTP_IF_MODIFIED_SINCE="Thu, 7 Apr 2005 22:14:13 +0000" &&
	export HTTP_IF_MODIFIED_SINCE &&
	test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&
	gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
	grep "Status: 304 Not Modified" gitweb.headers

ok 12 - forks: not skipped unless "forks" feature enabled

expecting success: 
	cat >>gitweb_config.perl <<-\EOF
	$feature{"forks"}{"default"} = [1];
	EOF

ok 13 - enable forks feature

expecting success: 
	gitweb_run "a=project_list" &&
	grep -q ">\\.git<"               gitweb.body &&
	grep -q ">foo\\.git<"            gitweb.body &&
	grep -q ">foo_baz\\.git<"        gitweb.body &&
	grep -q ">foo\\.bar\\.git<"      gitweb.body &&
	grep -q ">foo_baz\\.git<"        gitweb.body &&
	grep -v ">foo/foo-forked\\.git<" gitweb.body &&
	grep -v ">fork of .*<"           gitweb.body

ok 65 - logs: log (implicit HEAD)

expecting success: gitweb_run "p=.git;a=shortlog"
Status: 304 Not Modified
ok 16 - modification: snapshot if-modified-since (unmodified)

expecting success: 
	ID=`git rev-parse --verify HEAD^{tree}` &&
	HTTP_IF_MODIFIED_SINCE="Wed, 6 Apr 2005 22:14:13 +0000" &&
	export HTTP_IF_MODIFIED_SINCE &&
	test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&
	gitweb_run "p=.git;a=snapshot;h=$ID;sf=tgz" &&
	grep "Status: 200 OK" gitweb.headers &&
	! grep -i "last-modified" gitweb.headers

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<!-- git web interface version current, (C) 2005-2006, Kay Sievers <kay.sievers@vrfy.org>, Christian Gierke -->
<!-- git core binaries version 2.6.4 -->
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="generator" content="gitweb/current git/2.6.4"/>
<meta name="robots" content="index, nofollow"/>
<title>[localhost]</title>
<link rel="stylesheet" type="text/css" href="file:////«PKGBUILDDIR»/t/../gitweb/static/gitweb.css"/>
<link rel="alternate" title="[localhost] projects list" href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?a=project_index" type="text/plain; charset=utf-8" />
<link rel="alternate" title="[localhost] projects feeds" href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?a=opml" type="text/x-opml" />
<link rel="shortcut icon" href="file:////«PKGBUILDDIR»/t/../gitweb/static/git-favicon.png" type="image/png" />
</head>
<body>
<div class="page_header">
<a href="http://git-scm.com/" title="git homepage"><img alt="git" src="file:////«PKGBUILDDIR»/t/../gitweb/static/git-logo.png" width="72" height="27" class="logo" /></a><a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl">projects</a> / </div>
<div class="projsearch">
<form method="get" action="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl" enctype="multipart/form-data"><input type="hidden" name="a" value="project_list"  />
<input type="text" name="s"  size="60" title="Search project by name and description" />
<span title="Extended regular expression"><label><input type="checkbox" name="sr" value="1" />re</label></span>
<input type="submit" name="btnS" value="Search" />
</form>
<a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl">List all projects</a><br />
</div>
<table class="project_list">
<tr>
<th></th>
<th>Project</th>
<th><a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?a=project_list;o=descr" class="header">Description</a></th>
<th><a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?a=project_list;o=owner" class="header">Owner</a></th>
<th><a class="header" href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?a=project_list;o=age">Last Change</a></th>
<th></th>
</tr>
<tr class="dark">
<td></td>
<td><a class="list" href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=.git;a=summary">.git</a></td>
<td><a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=.git;a=summary" title="t9502-gitweb-standalone-parse-output.sh test repository" class="list">t9502-gitweb-standalone-parse... </a></td>
<td><i>Debian build daemon</i></td>
<td class="age2">10 years ago</td>
<td class="link"><a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=.git;a=summary">summary</a> | <a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=.git;a=shortlog">shortlog</a> | <a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=.git;a=log">log</a> | <a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=.git;a=tree">tree</a></td>
</tr>
<tr class="light">
<td></td>
<td><a class="list" href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo.bar.git;a=summary">foo.bar.git</a></td>
<td><a class="list" title="foo.bar" href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo.bar.git;a=summary">foo.bar</a></td>
<td><i>Debian build daemon</i></td>
<td class="age2">10 years ago</td>
<td class="link"><a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo.bar.git;a=summary">summary</a> | <a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo.bar.git;a=shortlog">shortlog</a> | <a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo.bar.git;a=log">log</a> | <a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo.bar.git;a=tree">tree</a></td>
</tr>
<tr class="dark">
<td><a title="1 forks" href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo.git;a=forks">+</a></td>
<td><a class="list" href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo.git;a=summary">foo.git</a></td>
<td><a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo.git;a=summary" title="foo" class="list">foo</a></td>
<td><i>Debian build daemon</i></td>
<td class="age2">10 years ago</td>
<td class="link"><a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo.git;a=summary">summary</a> | <a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo.git;a=shortlog">shortlog</a> | <a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo.git;a=log">log</a> | <a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo.git;a=tree">tree</a> | <a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo.git;a=forks">forks</a></td>
</tr>
<tr class="light">
<td></td>
<td><a class="list" href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo_baz.git;a=summary">foo_baz.git</a></td>
<td><a title="foo_baz" href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo_baz.git;a=summary" class="list">foo_baz</a></td>
<td><i>Debian build daemon</i></td>
<td class="age2">10 years ago</td>
<td class="link"><a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo_baz.git;a=summary">summary</a> | <a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo_baz.git;a=shortlog">shortlog</a> | <a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo_baz.git;a=log">log</a> | <a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo_baz.git;a=tree">tree</a></td>
</tr>
</table>
<div class="page_footer">
<a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?a=opml" class="rss_logo">OPML</a> <a class="rss_logo" href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?a=project_index">TXT</a>
</div>
<script type="text/javascript" src="%2B%2BGITWEB_JS%2B%2B"></script>
<script type="text/javascript">
window.onload = function () {
	var tz_cookie = { name: 'gitweb_tz', expires: 14, path: '/' };
	onloadTZSetup('local', tz_cookie, 'datetime');
};
</script>
</body>
</html>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<!-- git web interface version current, (C) 2005-2006, Kay Sievers <kay.sievers@vrfy.org>, Christian Gierke -->
<!-- git core binaries version 2.6.4 -->
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="generator" content="gitweb/current git/2.6.4"/>
<meta name="robots" content="index, nofollow"/>
<title>[localhost]</title>
<link rel="stylesheet" type="text/css" href="file:////«PKGBUILDDIR»/t/../gitweb/static/gitweb.css"/>
<link rel="alternate" title="[localhost] projects list" href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?a=project_index" type="text/plain; charset=utf-8" />
<link rel="alternate" title="[localhost] projects feeds" href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?a=opml" type="text/x-opml" />
<link rel="shortcut icon" href="file:////«PKGBUILDDIR»/t/../gitweb/static/git-favicon.png" type="image/png" />
</head>
<body>
<div class="page_header">
<a href="http://git-scm.com/" title="git homepage"><img alt="git" src="file:////«PKGBUILDDIR»/t/../gitweb/static/git-logo.png" width="72" height="27" class="logo" /></a><a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl">projects</a> / </div>
<div class="projsearch">
<form method="get" action="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl" enctype="multipart/form-data"><input type="hidden" name="a" value="project_list"  />
<input type="text" name="s"  size="60" title="Search project by name and description" />
<span title="Extended regular expression"><label><input type="checkbox" name="sr" value="1" />re</label></span>
<input type="submit" name="btnS" value="Search" />
</form>
<a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl">List all projects</a><br />
</div>
<table class="project_list">
<tr>
<th></th>
<th>Project</th>
<th><a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?a=project_list;o=descr" class="header">Description</a></th>
<th><a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?a=project_list;o=owner" class="header">Owner</a></th>
<th><a class="header" href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?a=project_list;o=age">Last Change</a></th>
<th></th>
</tr>
<tr class="dark">
<td></td>
<td><a class="list" href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=.git;a=summary">.git</a></td>
<td><a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=.git;a=summary" title="t9502-gitweb-standalone-parse-output.sh test repository" class="list">t9502-gitweb-standalone-parse... </a></td>
<td><i>Debian build daemon</i></td>
<td class="age2">10 years ago</td>
<td class="link"><a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=.git;a=summary">summary</a> | <a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=.git;a=shortlog">shortlog</a> | <a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=.git;a=log">log</a> | <a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=.git;a=tree">tree</a></td>
</tr>
<tr class="light">
<td></td>
<td><a class="list" href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo.bar.git;a=summary">foo.bar.git</a></td>
<td><a class="list" title="foo.bar" href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo.bar.git;a=summary">foo.bar</a></td>
<td><i>Debian build daemon</i></td>
<td class="age2">10 years ago</td>
<td class="link"><a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo.bar.git;a=summary">summary</a> | <a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo.bar.git;a=shortlog">shortlog</a> | <a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo.bar.git;a=log">log</a> | <a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo.bar.git;a=tree">tree</a></td>
</tr>
<tr class="dark">
<td><a title="1 forks" href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo.git;a=forks">+</a></td>
<td><a class="list" href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo.git;a=summary">foo.git</a></td>
<td><a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo.git;a=summary" title="foo" class="list">foo</a></td>
<td><i>Debian build daemon</i></td>
<td class="age2">10 years ago</td>
<td class="link"><a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo.git;a=summary">summary</a> | <a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo.git;a=shortlog">shortlog</a> | <a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo.git;a=log">log</a> | <a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo.git;a=tree">tree</a> | <a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo.git;a=forks">forks</a></td>
</tr>
<tr class="light">
<td></td>
<td><a class="list" href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo_baz.git;a=summary">foo_baz.git</a></td>
<td><a title="foo_baz" href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo_baz.git;a=summary" class="list">foo_baz</a></td>
<td><i>Debian build daemon</i></td>
<td class="age2">10 years ago</td>
<td class="link"><a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo_baz.git;a=summary">summary</a> | <a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo_baz.git;a=shortlog">shortlog</a> | <a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo_baz.git;a=log">log</a> | <a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?p=foo_baz.git;a=tree">tree</a></td>
</tr>
</table>
<div class="page_footer">
<a href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?a=opml" class="rss_logo">OPML</a> <a class="rss_logo" href="/«PKGBUILDDIR»/t/../gitweb/gitweb.perl?a=project_index">TXT</a>
</div>
<script type="text/javascript" src="%2B%2BGITWEB_JS%2B%2B"></script>
<script type="text/javascript">
window.onload = function () {
	var tz_cookie = { name: 'gitweb_tz', expires: 14, path: '/' };
	onloadTZSetup('local', tz_cookie, 'datetime');
};
</script>
</body>
</html>
ok 14 - forks: forks skipped if "forks" feature enabled

expecting success: 
	gitweb_run "p=foo.git;a=forks" &&
	grep -q ">foo/foo-forked\\.git<" gitweb.body &&
	grep -q ">fork of foo<"          gitweb.body

ok 36 - cvs up dirty [cvswork3]

expecting success: 
	(
		cd cvswork3 &&
		cvs -f commit -m "dirty sandbox after auto-merge"
	) >cvs.log 2>&1 &&
	check_start_tree cvswork3 &&
	check_file cvswork3 textfile.c v3merged &&
	check_file cvswork3 t3 v3merged &&
	check_file cvswork3 adir/afile v3merged &&
	check_file cvswork3 adir/a3file v3merged &&
	check_file cvswork3 adir/afile5 v3merged &&
	check_file cvswork3 adir/bdir/bfile v3merged &&
	check_file cvswork3 adir/bdir/b3file v3merged &&
	check_file cvswork3 cdir/cfile v3merged &&
	check_end_full_tree cvswork3 v3merged &&
	git fetch gitcvs.git b3:b4 &&
	git tag v4.1 b4 &&
	git diff --exit-code v4.1 v3merged >check_diff_apply.out 2>&1

ok 66 - logs: shortlog (implicit HEAD)

expecting success: gitweb_run "p=.git;a=history;f=file"
Status: 200 OK
ok 17 - modification: tree snapshot

expecting success: 
	gitweb_run "p=.git" &&
	grep "Status: 503 Service Unavailable" gitweb.headers &&
	grep "503 - The load average on the server is too high" gitweb.body

ok 15 - forks: "forks" action for forked repository

expecting success: 
	gitweb_run "p=foo/foo-forked.git;a=summary" &&
	grep -q "200 OK"        gitweb.headers &&
	grep -q ">fork of foo<" gitweb.body

Status: 503 Service Unavailable
503 - The load average on the server is too high
ok 18 - load checking: load too high (default action)

expecting success: 
	gitweb_run "a=project_list;s=*\.git;sr=1" &&
	grep "Status: 400" gitweb.headers &&
	grep "400 - Invalid.*regexp" gitweb.body

ok 67 - logs: history (implicit HEAD, file)

expecting success: gitweb_run "p=.git;a=history;f=non-existent"
ok 16 - forks: can access forked repository

expecting success: 
	cat >expected <<-\EOF &&
	.git
	foo.bar.git
	foo.git
	foo/foo-forked.git
	foo_baz.git
	EOF
	gitweb_run "a=project_index" &&
	sed -e "s/ .*//" <gitweb.body | sort >actual &&
	test_cmp expected actual

From gitcvs
 * [new branch]      b3         -> b4
ok 37 - cvs commit [cvswork3]

# passed all 37 test(s)
1..37
Status: 400 Bad Request
400 - Invalid search regexp &#39;*\.git&#39;
ok 68 - logs: history (implicit HEAD, non-existent file)

expecting success: git checkout master &&
	 echo "to be deleted" > deleted_file &&
	 git add deleted_file &&
	 git commit -m "Add file to be deleted" &&
	 git rm deleted_file &&
	 git commit -m "Delete file" &&
	 gitweb_run "p=.git;a=history;f=deleted_file"
ok 19 - invalid arguments: invalid regexp (in project search)

# passed all 19 test(s)
1..19
Already on 'master'
*** t9600-cvsimport.sh ***
[master 41c7fe2] Add file to be deleted
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 deleted_file
rm 'deleted_file'
[master 09cd532] Delete file
 Author: A U Thor <author@example.com>
 1 file changed, 1 deletion(-)
 delete mode 100644 deleted_file
*** t9601-cvsimport-vendor-branch.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9600-cvsimport/.git/
expecting success: 
	CVSROOT=$(pwd)/cvsroot &&
	export CVSROOT

ok 1 - setup cvsroot environment

expecting success: $CVS init
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9601-cvsimport-vendor-branch/.git/
ok 2 - setup cvsroot

expecting success: 

	mkdir "$CVSROOT/module" &&
	$CVS co -d module-cvs module &&
	(cd module-cvs &&
	cat <<EOF >o_fortuna &&
O Fortuna
velut luna
statu variabilis,

semper crescis
aut decrescis;
vita detestabilis

nunc obdurat
et tunc curat
ludo mentis aciem,

egestatem,
potestatem
dissolvit ut glaciem.
EOF
	$CVS add o_fortuna &&
	cat <<EOF >message &&
add "O Fortuna" lyrics

These public domain lyrics make an excellent sample text.
EOF
	$CVS commit -F message
	)

cvs checkout: Updating module-cvs
expecting success: 

	git cvsimport -C module-git module


cvs add: scheduling file `o_fortuna' for addition
cvs add: use `cvs commit' to add this file permanently
cvs commit: Examining .
/«PKGBUILDDIR»/t/trash directory.t9600-cvsimport/cvsroot/module/o_fortuna,v  <--  o_fortuna
initial revision: 1.1
ok 17 - forks: project_index lists all projects (incl. forks)

expecting success: 
	TAG="<magic-xss-tag>" &&
	xss "a=rss&p=$TAG" &&
	xss "a=rss&p=foo.git&f=$TAG"

Checking a=rss&p=<magic-xss-tag>...
ok 3 - setup a cvs module

expecting success: 

	git cvsimport -a -R -z 0 -C module-git module &&
	test_cmp module-cvs/o_fortuna module-git/o_fortuna


ok 69 - logs: history (implicit HEAD, deleted file)

expecting success: gitweb_run "" "/.git"
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9601-cvsimport-vendor-branch/module-git/.git/
Checking a=rss&p=foo.git&f=<magic-xss-tag>...
Skipping #CVSPS_NO_BRANCH
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9600-cvsimport/module-git/.git/
ok 4 - import a trivial module

expecting success: (cd module-git && git gc)
ok 70 - path_info: project

expecting success: gitweb_run "" "/.git/b"
ok 5 - pack refs

expecting success: 

	(cd module-git &&
	 git log --format="o_fortuna 1.1 %H" -1) > expected &&
	test_cmp expected module-git/.git/cvs-revisions

ok 18 - xss checks

# passed all 18 test(s)
1..18
ok 6 - initial import has correct .git/cvs-revisions

expecting success: 
	(cd module-cvs &&
	cat <<EOF >o_fortuna &&
O Fortune,
like the moon
you are changeable,

ever waxing
and waning;
hateful life

first oppresses
and then soothes
as fancy takes it;

poverty
and power
it melts them like ice.
EOF
	cat <<EOF >message &&
translate to English

My Latin is terrible.
EOF
	$CVS commit -F message
	)

cvs commit: Examining .
ok 1 - import a module with a vendor branch

*** t9602-cvsimport-branches-tags.sh ***
expecting success: test_cvs_co master
/«PKGBUILDDIR»/t/trash directory.t9600-cvsimport/cvsroot/module/o_fortuna,v  <--  o_fortuna
new revision: 1.2; previous revision: 1.1
cvs checkout: Updating module-cvs-master
U module-cvs-master/added-imported.txt
U module-cvs-master/imported-anonymously.txt
U module-cvs-master/imported-modified-imported.txt
U module-cvs-master/imported-modified.txt
U module-cvs-master/imported-once.txt
U module-cvs-master/imported-twice.txt
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9602-cvsimport-branches-tags/.git/
expecting success: 

	git cvsimport -C module-git module


ok 7 - update cvs module
ok 2 - check HEAD out of cvs repository


expecting success: test_git_co master
expecting success: 

	(cd module-git &&
	git config cvsimport.trackRevisions true &&
	git cvsimport -a -z 0 module &&
	git merge origin
	) &&
	test_cmp module-cvs/o_fortuna module-git/o_fortuna


Already on 'master'
ok 3 - check master out of git repository

expecting success: 

	test_cmp_branch_file master imported-once.txt


ok 4 - check a file that was imported once

checking known breakage: 

	test_cmp_branch_file master imported-twice.txt


--- module-cvs-master/imported-twice.txt	2004-02-09 15:43:13.000000000 +0000
+++ module-git/imported-twice.txt	2015-12-16 11:23:35.341565015 +0000
@@ -1 +1 @@
-This is vtag-2 (on vbranchA) of imported-twice.txt.
+This is vtag-1 (on vbranchA) of imported-twice.txt.
not ok 5 - check a file that was imported twice # TODO known breakage

expecting success: 

	test_cmp_branch_file master imported-modified.txt


ok 6 - check a file that was imported then modified on HEAD

expecting success: 

	test_cmp_branch_file master imported-modified-imported.txt


ok 7 - check a file that was imported, modified, then imported again

expecting success: 

	test_cmp_branch_file master added-imported.txt


ok 8 - check a file that was added to HEAD then imported

expecting success: 

	test_cmp_branch_file master imported-anonymously.txt


ok 9 - a vendor branch whose tag has been removed

# still have 1 known breakage(s)
# passed all remaining 8 test(s)
1..9
*** t9603-cvsimport-patchsets.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9603-cvsimport-patchsets/.git/
checking known breakage: 

    git cvsimport -p"-x" -C module-git module &&
    (cd module-git &&
        git log --pretty=format:%s > ../actual-master &&
        git log A~2..A --pretty="format:%s %ad" -- > ../actual-A &&
        echo "" >> ../actual-master &&
	echo "" >> ../actual-A
    ) &&
    echo "Rev 4
Rev 3
Rev 2
Rev 1" > expect-master &&
    test_cmp actual-master expect-master &&

    echo "Rev 5 Branch A Wed Mar 11 19:09:10 2009 +0000
Rev 4 Branch A Wed Mar 11 19:03:52 2009 +0000" > expect-A &&
    test_cmp actual-A expect-A

ok 71 - path_info: project/branch

expecting success: gitweb_run "" "/.git/master:file"
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9602-cvsimport-branches-tags/module-git/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9603-cvsimport-patchsets/module-git/.git/
Updating 465e910..30786f3
Fast-forward (no commit created; -m option ignored)
 o_fortuna | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
Already up-to-date.
ok 8 - update git module

expecting success: 

	(cd module-git &&
	 git log --format="o_fortuna 1.1 %H" -1 HEAD^ &&
	 git log --format="o_fortuna 1.2 %H" -1 HEAD) > expected &&
	test_cmp expected module-git/.git/cvs-revisions

ok 9 - update has correct .git/cvs-revisions

expecting success: 

	(cd module-cvs &&
		echo 1 >tick &&
		$CVS add tick &&
		$CVS commit -m 1
	)

cvs add: scheduling file `tick' for addition
cvs add: use `cvs commit' to add this file permanently
ok 72 - path_info: project/branch:file

expecting success: gitweb_run "" "/.git/master:foo/"
cvs commit: Examining .
/«PKGBUILDDIR»/t/trash directory.t9600-cvsimport/cvsroot/module/tick,v  <--  tick
initial revision: 1.1
ok 10 - update cvs module

expecting success: 

	(cd module-git &&
		git config cvsimport.module module &&
		git config cvsimport.trackRevisions true &&
		git cvsimport -a -z0 &&
		git merge origin
	) &&
	test_cmp module-cvs/tick module-git/tick


--- actual-master	2015-12-16 11:23:39.333565015 +0000
+++ expect-master	2015-12-16 11:23:39.337565015 +0000
@@ -1,4 +1,4 @@
 Rev 4
 Rev 3
-Rev 1
 Rev 2
+Rev 1
not ok 1 - import with criss cross times on revisions # TODO known breakage

# still have 1 known breakage(s)
1..1
*** t9604-cvsimport-timestamps.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9604-cvsimport-timestamps/.git/
expecting success: 

	TZ=CST6CDT git cvsimport -p"-x" -C module-1 module &&
	git cvsimport -p"-x" -C module-1 module &&
	(
		cd module-1 &&
		git log --format="%s %ai"
	) >actual-1 &&
	cat >expect-1 <<-EOF &&
	Rev 16 2006-10-29 07:00:01 +0000
	Rev 15 2006-10-29 06:59:59 +0000
	Rev 14 2006-04-02 08:00:01 +0000
	Rev 13 2006-04-02 07:59:59 +0000
	Rev 12 2005-12-01 00:00:00 +0000
	Rev 11 2005-11-01 00:00:00 +0000
	Rev 10 2005-10-01 00:00:00 +0000
	Rev  9 2005-09-01 00:00:00 +0000
	Rev  8 2005-08-01 00:00:00 +0000
	Rev  7 2005-07-01 00:00:00 +0000
	Rev  6 2005-06-01 00:00:00 +0000
	Rev  5 2005-05-01 00:00:00 +0000
	Rev  4 2005-04-01 00:00:00 +0000
	Rev  3 2005-03-01 00:00:00 +0000
	Rev  2 2005-02-01 00:00:00 +0000
	Rev  1 2005-01-01 00:00:00 +0000
	EOF
	test_cmp actual-1 expect-1

ok 73 - path_info: project/branch:dir/

expecting success: gitweb_run "" "/.git/non-existent"
ok 1 - import module

expecting success: 

	test_cmp_branch_tree master


cvs checkout: Updating module-cvs-master
U module-cvs-master/default
cvs checkout: Updating module-cvs-master/sub1
U module-cvs-master/sub1/default
cvs checkout: Updating module-cvs-master/sub1/subsubA
U module-cvs-master/sub1/subsubA/default
cvs checkout: Updating module-cvs-master/sub1/subsubB
U module-cvs-master/sub1/subsubB/default
cvs checkout: Updating module-cvs-master/sub2
U module-cvs-master/sub2/default
cvs checkout: Updating module-cvs-master/sub2/subsubA
U module-cvs-master/sub2/subsubA/default
cvs checkout: Updating module-cvs-master/sub3
U module-cvs-master/sub3/default
Updating 30786f3..3451235
Fast-forward (no commit created; -m option ignored)
 tick | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 tick
Already up-to-date.
ok 11 - cvsimport.module config works

expecting success: 

	(cd module-git &&
	 git log --format="o_fortuna 1.1 %H" -1 HEAD^^ &&
	 git log --format="o_fortuna 1.2 %H" -1 HEAD^
	 git log --format="tick 1.1 %H" -1 HEAD) > expected &&
	test_cmp expected module-git/.git/cvs-revisions

ok 12 - second update has correct .git/cvs-revisions

expecting success: 

	$CVS co -d import-from-wt module &&
	(cd import-from-wt &&
		git config cvsimport.trackRevisions false &&
		git cvsimport -a -z0 &&
		echo 1 >expect &&
		git log -1 --pretty=format:%s%n >actual &&
		test_cmp actual expect
	)


cvs checkout: Updating import-from-wt
U import-from-wt/o_fortuna
U import-from-wt/tick
Already on 'master'
ok 2 - test branch master

expecting success: 

	test_cmp_branch_tree vendorbranch


ok 74 - path_info: project/branch (non-existent)

expecting success: gitweb_run "" "/.git/non-existent:non-existent"
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9604-cvsimport-timestamps/module-1/.git/
cvs checkout: Updating module-cvs-vendorbranch
U module-cvs-vendorbranch/default
cvs checkout: Updating module-cvs-vendorbranch/sub1
U module-cvs-vendorbranch/sub1/default
cvs checkout: Updating module-cvs-vendorbranch/sub1/subsubA
U module-cvs-vendorbranch/sub1/subsubA/default
cvs checkout: Updating module-cvs-vendorbranch/sub1/subsubB
U module-cvs-vendorbranch/sub1/subsubB/default
cvs checkout: Updating module-cvs-vendorbranch/sub2
U module-cvs-vendorbranch/sub2/default
cvs checkout: Updating module-cvs-vendorbranch/sub2/subsubA
U module-cvs-vendorbranch/sub2/subsubA/default
cvs checkout: Updating module-cvs-vendorbranch/sub3
U module-cvs-vendorbranch/sub3/default
Switched to branch 'vendorbranch'
ok 3 - test branch vendorbranch

checking known breakage: 

	test_cmp_branch_tree B_FROM_INITIALS


cvs checkout: Updating module-cvs-B_FROM_INITIALS
U module-cvs-B_FROM_INITIALS/default
cvs checkout: Updating module-cvs-B_FROM_INITIALS/sub1
U module-cvs-B_FROM_INITIALS/sub1/default
cvs checkout: Updating module-cvs-B_FROM_INITIALS/sub1/subsubA
U module-cvs-B_FROM_INITIALS/sub1/subsubA/default
cvs checkout: Updating module-cvs-B_FROM_INITIALS/sub1/subsubB
U module-cvs-B_FROM_INITIALS/sub1/subsubB/default
cvs checkout: Updating module-cvs-B_FROM_INITIALS/sub2
U module-cvs-B_FROM_INITIALS/sub2/default
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9600-cvsimport/import-from-wt/.git/
cvs checkout: Updating module-cvs-B_FROM_INITIALS/sub2/subsubA
U module-cvs-B_FROM_INITIALS/sub2/subsubA/default
cvs checkout: Updating module-cvs-B_FROM_INITIALS/sub3
U module-cvs-B_FROM_INITIALS/sub3/default
ok 75 - path_info: project/branch:filename (non-existent branch)

expecting success: gitweb_run "" "/.git/master:non-existent"
error: pathspec 'B_FROM_INITIALS' did not match any file(s) known to git.
not ok 4 - test branch B_FROM_INITIALS # TODO known breakage

checking known breakage: 

	test_cmp_branch_tree B_FROM_INITIALS_BUT_ONE


cvs checkout: Updating module-cvs-B_FROM_INITIALS_BUT_ONE
U module-cvs-B_FROM_INITIALS_BUT_ONE/default
cvs checkout: Updating module-cvs-B_FROM_INITIALS_BUT_ONE/sub1
ok 13 - import from a CVS working tree

U module-cvs-B_FROM_INITIALS_BUT_ONE/sub1/default
cvs checkout: Updating module-cvs-B_FROM_INITIALS_BUT_ONE/sub1/subsubA
expecting success: 

	! test -e import-from-wt/.git/cvs-revisions


U module-cvs-B_FROM_INITIALS_BUT_ONE/sub1/subsubA/default
ok 14 - no .git/cvs-revisions created by default

cvs checkout: Updating module-cvs-B_FROM_INITIALS_BUT_ONE/sub1/subsubB
expecting success: test_cmp_branch_tree master
cvs checkout: Updating module-cvs-B_FROM_INITIALS_BUT_ONE/sub2
U module-cvs-B_FROM_INITIALS_BUT_ONE/sub2/default
cvs checkout: Updating module-cvs-B_FROM_INITIALS_BUT_ONE/sub2/subsubA
U module-cvs-B_FROM_INITIALS_BUT_ONE/sub2/subsubA/default
cvs checkout: Updating module-cvs-master
cvs checkout: Updating module-cvs-B_FROM_INITIALS_BUT_ONE/sub3
U module-cvs-master/o_fortuna
U module-cvs-master/tick
U module-cvs-B_FROM_INITIALS_BUT_ONE/sub3/default
error: pathspec 'B_FROM_INITIALS_BUT_ONE' did not match any file(s) known to git.
not ok 5 - test branch B_FROM_INITIALS_BUT_ONE # TODO known breakage

checking known breakage: 

	test_cmp_branch_tree B_MIXED


Already on 'master'
cvs checkout: Updating module-cvs-B_MIXED
U module-cvs-B_MIXED/default
cvs checkout: Updating module-cvs-B_MIXED/sub1
U module-cvs-B_MIXED/sub1/default
cvs checkout: Updating module-cvs-B_MIXED/sub1/subsubA
U module-cvs-B_MIXED/sub1/subsubA/default
cvs checkout: Updating module-cvs-B_MIXED/sub1/subsubB
ok 15 - test entire HEAD

U module-cvs-B_MIXED/sub1/subsubB/default
cvs checkout: Updating module-cvs-B_MIXED/sub2
U module-cvs-B_MIXED/sub2/branch_B_MIXED_only
U module-cvs-B_MIXED/sub2/default
cvs checkout: Updating module-cvs-B_MIXED/sub2/subsubA
# passed all 15 test(s)
1..15
U module-cvs-B_MIXED/sub2/subsubA/default
cvs checkout: Updating module-cvs-B_MIXED/sub3
U module-cvs-B_MIXED/sub3/default
ok 76 - path_info: project/branch:file (non-existent)

expecting success: gitweb_run "" "/.git/master:non-existent/"
*** t9700-perl-git.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9700-perl-git/.git/
expecting success: echo "test file 1" > file1 &&
     echo "test file 2" > file2 &&
     mkdir directory1 &&
     echo "in directory1" >> directory1/file &&
     mkdir directory2 &&
     echo "in directory2" >> directory2/file &&
     git add . &&
     git commit -m "first commit" &&

     echo "new file in subdir 2" > directory2/file2 &&
     git add . &&
     git commit -m "commit in directory2" &&

     echo "changed file 1" > file1 &&
     git commit -a -m "second commit" &&

     git config --add color.test.slot1 green &&
     git config --add test.string value &&
     git config --add test.dupstring value1 &&
     git config --add test.dupstring value2 &&
     git config --add test.booltrue true &&
     git config --add test.boolfalse no &&
     git config --add test.boolother other &&
     git config --add test.int 2k &&
     git config --add test.path "~/foo" &&
     git config --add test.pathexpanded "$HOME/foo" &&
     git config --add test.pathmulti foo &&
     git config --add test.pathmulti bar
     
[master (root-commit) bc88708] first commit
 Author: A U Thor <author@example.com>
 4 files changed, 4 insertions(+)
 create mode 100644 directory1/file
 create mode 100644 directory2/file
 create mode 100644 file1
 create mode 100644 file2
[master 271b6ec] commit in directory2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 directory2/file2
[master 48caec1] second commit
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 1 - set up test repository

# run 1: Perl API (perl /«PKGBUILDDIR»/t/t9700/test.pl)
Switched to branch 'B_MIXED'
--- module-cvs-B_MIXED/./sub3/default	2003-05-23 00:15:26.000000000 +0000
+++ module-git/./sub3/default	2015-12-16 11:23:45.049565016 +0000
@@ -3,3 +3,5 @@
 Every directory in the `proj' project has a file named `default'.
 
 This line was added by the first commit (affecting two files).
+
+This line was added in the second commit (affecting all 7 files).
not ok 6 - test branch B_MIXED # TODO known breakage

expecting success: 

	test_cmp_branch_tree B_SPLIT


cvs checkout: Updating module-cvs-B_SPLIT
U module-cvs-B_SPLIT/default
cvs checkout: Updating module-cvs-B_SPLIT/sub1
U module-cvs-B_SPLIT/sub1/default
cvs checkout: Updating module-cvs-B_SPLIT/sub1/subsubA
U module-cvs-B_SPLIT/sub1/subsubA/default
cvs checkout: Updating module-cvs-B_SPLIT/sub1/subsubB
U module-cvs-B_SPLIT/sub1/subsubB/default
cvs checkout: Updating module-cvs-B_SPLIT/sub2
U module-cvs-B_SPLIT/sub2/default
cvs checkout: Updating module-cvs-B_SPLIT/sub2/subsubA
U module-cvs-B_SPLIT/sub2/subsubA/default
cvs checkout: Updating module-cvs-B_SPLIT/sub3
U module-cvs-B_SPLIT/sub3/default
ok 2 - use Git;
ok 3 - open repository
ok 4 - config scalar: string
Already up-to-date.
ok 5 - config array: string
ok 6 - config scalar: nonexistent
ok 77 - path_info: project/branch:dir/ (non-existent)

expecting success: gitweb_run "" "/.git/master:/file"
ok 1 - check timestamps are UTC (TZ=CST6CDT)

ok 7 - config array: nonexistent
expecting success: 

	cat >cvs-authors <<-EOF &&
	user1=User One <user1@domain.org>
	user2=User Two <user2@domain.org> CST6CDT
	user3=User Three <user3@domain.org> EST5EDT
	user4=User Four <user4@domain.org> MST7MDT
	EOF
	git cvsimport -p"-x" -A cvs-authors -C module-2 module &&
	(
		cd module-2 &&
		git log --format="%s %ai %an"
	) >actual-2 &&
	cat >expect-2 <<-EOF &&
	Rev 16 2006-10-29 01:00:01 -0600 User Two
	Rev 15 2006-10-29 01:59:59 -0500 User Two
	Rev 14 2006-04-02 03:00:01 -0500 User Two
	Rev 13 2006-04-02 01:59:59 -0600 User Two
	Rev 12 2005-11-30 17:00:00 -0700 User Four
	Rev 11 2005-10-31 19:00:00 -0500 User Three
	Rev 10 2005-09-30 19:00:00 -0500 User Two
	Rev  9 2005-09-01 00:00:00 +0000 User One
	Rev  8 2005-07-31 18:00:00 -0600 User Four
	Rev  7 2005-06-30 20:00:00 -0400 User Three
	Rev  6 2005-05-31 19:00:00 -0500 User Two
	Rev  5 2005-05-01 00:00:00 +0000 User One
	Rev  4 2005-03-31 17:00:00 -0700 User Four
	Rev  3 2005-02-28 19:00:00 -0500 User Three
	Rev  2 2005-01-31 18:00:00 -0600 User Two
	Rev  1 2005-01-01 00:00:00 +0000 User One
	EOF
	test_cmp actual-2 expect-2

ok 8 - config_int: integer
ok 9 - config_int: nonexistent
ok 10 - config_bool: true
ok 11 - config_bool: false
ok 12 - config_path: ~/foo expansion
ok 13 - config_path: multiple values
ok 14 - get_color
ok 15 - config: multivar
ok 16 - config_bool: non-boolean values fail
ok 17 - ident scalar: author (type)
ok 18 - ident scalar: committer (type)
ok 19 - ident scalar: invalid ident string (no parsing)
ok 20 - ident array: author
ok 21 - ident array: author
ok 22 - ident array: ident string
ok 23 - ident array: invalid ident string
ok 24 - ident_person: author (type)
ok 25 - ident_person: ident string
ok 26 - ident_person: array
ok 27 - (get file hash)
ok 28 - cat_blob: size
ok 29 - cat_blob: data
ok 30 - hash_object: roundtrip
Switched to branch 'B_SPLIT'
ok 31 - hash_and_insert_object: returns hash
ok 32 - cat_blob: roundtrip size
ok 33 - cat_blob: roundtrip data
ok 34 - repo_path
ok 35 - wc_path
ok 36 - wc_subdir initial
ok 37 - wc_subdir after wc_chdir
ok 38 - config after wc_chdir
ok 39 - repo_path (2)
ok 40 - wc_path (2)
ok 41 - wc_subdir initial (2)
ok 42 - rev-parse returned hash
ok 7 - test branch B_SPLIT

checking known breakage: 

	test_cmp_branch_tree vendortag


ok 43 - log . does not show last commit
cvs checkout: Updating module-cvs-vendortag
U module-cvs-vendortag/default
cvs checkout: Updating module-cvs-vendortag/sub1
U module-cvs-vendortag/sub1/default
cvs checkout: Updating module-cvs-vendortag/sub1/subsubA
U module-cvs-vendortag/sub1/subsubA/default
cvs checkout: Updating module-cvs-vendortag/sub1/subsubB
ok 44 - cat_blob(outside): size
1..44
U module-cvs-vendortag/sub1/subsubB/default
cvs checkout: Updating module-cvs-vendortag/sub2
# test_external test Perl API was ok
# expecting no stderr from previous command
# test_external_without_stderr test no stderr: Perl API was ok
U module-cvs-vendortag/sub2/default
cvs checkout: Updating module-cvs-vendortag/sub2/subsubA
U module-cvs-vendortag/sub2/subsubA/default
cvs checkout: Updating module-cvs-vendortag/sub3
U module-cvs-vendortag/sub3/default
*** t9800-git-p4-basic.sh ***
1..0 # SKIP skipping git p4 tests; no p4 or p4d
*** t9801-git-p4-branch.sh ***
1..0 # SKIP skipping git p4 tests; no p4 or p4d
*** t9802-git-p4-filetype.sh ***
1..0 # SKIP skipping git p4 tests; no p4 or p4d
*** t9803-git-p4-shell-metachars.sh ***
1..0 # SKIP skipping git p4 tests; no p4 or p4d
*** t9804-git-p4-label.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9604-cvsimport-timestamps/module-2/.git/
1..0 # SKIP skipping git p4 tests; no p4 or p4d
error: pathspec 'vendortag' did not match any file(s) known to git.
ok 78 - path_info: project/branch:/file

expecting success: gitweb_run "" "/.git/:/file"
not ok 8 - test tag vendortag # TODO known breakage

expecting success: 

	test_cmp_branch_tree T_ALL_INITIAL_FILES


*** t9805-git-p4-skip-submit-edit.sh ***
cvs checkout: Updating module-cvs-T_ALL_INITIAL_FILES
U module-cvs-T_ALL_INITIAL_FILES/default
cvs checkout: Updating module-cvs-T_ALL_INITIAL_FILES/sub1
U module-cvs-T_ALL_INITIAL_FILES/sub1/default
cvs checkout: Updating module-cvs-T_ALL_INITIAL_FILES/sub1/subsubA
U module-cvs-T_ALL_INITIAL_FILES/sub1/subsubA/default
cvs checkout: Updating module-cvs-T_ALL_INITIAL_FILES/sub1/subsubB
U module-cvs-T_ALL_INITIAL_FILES/sub1/subsubB/default
cvs checkout: Updating module-cvs-T_ALL_INITIAL_FILES/sub2
1..0 # SKIP skipping git p4 tests; no p4 or p4d
U module-cvs-T_ALL_INITIAL_FILES/sub2/default
cvs checkout: Updating module-cvs-T_ALL_INITIAL_FILES/sub2/subsubA
U module-cvs-T_ALL_INITIAL_FILES/sub2/subsubA/default
cvs checkout: Updating module-cvs-T_ALL_INITIAL_FILES/sub3
*** t9806-git-p4-options.sh ***
U module-cvs-T_ALL_INITIAL_FILES/sub3/default
1..0 # SKIP skipping git p4 tests; no p4 or p4d
*** t9807-git-p4-submit.sh ***
1..0 # SKIP skipping git p4 tests; no p4 or p4d
*** t9808-git-p4-chdir.sh ***
1..0 # SKIP skipping git p4 tests; no p4 or p4d
*** t9809-git-p4-client-view.sh ***
1..0 # SKIP skipping git p4 tests; no p4 or p4d
*** t9810-git-p4-rcs.sh ***
1..0 # SKIP skipping git p4 tests; no p4 or p4d
*** t9811-git-p4-label-import.sh ***
1..0 # SKIP skipping git p4 tests; no p4 or p4d
*** t9812-git-p4-wildcards.sh ***
Note: checking out 'T_ALL_INITIAL_FILES'.

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 e9bb65d... Initial import.
1..0 # SKIP skipping git p4 tests; no p4 or p4d
*** t9813-git-p4-preserve-users.sh ***
ok 9 - test tag T_ALL_INITIAL_FILES

checking known breakage: 

	test_cmp_branch_tree T_ALL_INITIAL_FILES_BUT_ONE


cvs checkout: Updating module-cvs-T_ALL_INITIAL_FILES_BUT_ONE
U module-cvs-T_ALL_INITIAL_FILES_BUT_ONE/default
cvs checkout: Updating module-cvs-T_ALL_INITIAL_FILES_BUT_ONE/sub1
U module-cvs-T_ALL_INITIAL_FILES_BUT_ONE/sub1/default
1..0 # SKIP skipping git p4 tests; no p4 or p4d
cvs checkout: Updating module-cvs-T_ALL_INITIAL_FILES_BUT_ONE/sub1/subsubA
U module-cvs-T_ALL_INITIAL_FILES_BUT_ONE/sub1/subsubA/default
cvs checkout: Updating module-cvs-T_ALL_INITIAL_FILES_BUT_ONE/sub1/subsubB
*** t9814-git-p4-rename.sh ***
cvs checkout: Updating module-cvs-T_ALL_INITIAL_FILES_BUT_ONE/sub2
U module-cvs-T_ALL_INITIAL_FILES_BUT_ONE/sub2/default
cvs checkout: Updating module-cvs-T_ALL_INITIAL_FILES_BUT_ONE/sub2/subsubA
U module-cvs-T_ALL_INITIAL_FILES_BUT_ONE/sub2/subsubA/default
cvs checkout: Updating module-cvs-T_ALL_INITIAL_FILES_BUT_ONE/sub3
U module-cvs-T_ALL_INITIAL_FILES_BUT_ONE/sub3/default
1..0 # SKIP skipping git p4 tests; no p4 or p4d
*** t9815-git-p4-submit-fail.sh ***
1..0 # SKIP skipping git p4 tests; no p4 or p4d
*** t9816-git-p4-locked.sh ***
ok 79 - path_info: project/:/file (implicit HEAD)

expecting success: gitweb_run "" "/.git/:/"
1..0 # SKIP skipping git p4 tests; no p4 or p4d
*** t9817-git-p4-exclude.sh ***
1..0 # SKIP skipping git p4 tests; no p4 or p4d
*** t9818-git-p4-block.sh ***
1..0 # SKIP skipping git p4 tests; no p4 or p4d
error: pathspec 'T_ALL_INITIAL_FILES_BUT_ONE' did not match any file(s) known to git.
not ok 10 - test tag T_ALL_INITIAL_FILES_BUT_ONE # TODO known breakage

checking known breakage: 

	test_cmp_branch_tree T_MIXED


*** t9819-git-p4-case-folding.sh ***
cvs checkout: Updating module-cvs-T_MIXED
U module-cvs-T_MIXED/default
cvs checkout: Updating module-cvs-T_MIXED/sub1
U module-cvs-T_MIXED/sub1/default
cvs checkout: Updating module-cvs-T_MIXED/sub1/subsubA
U module-cvs-T_MIXED/sub1/subsubA/default
cvs checkout: Updating module-cvs-T_MIXED/sub1/subsubB
U module-cvs-T_MIXED/sub1/subsubB/default
cvs checkout: Updating module-cvs-T_MIXED/sub2
U module-cvs-T_MIXED/sub2/default
cvs checkout: Updating module-cvs-T_MIXED/sub2/subsubA
U module-cvs-T_MIXED/sub2/subsubA/default
cvs checkout: Updating module-cvs-T_MIXED/sub3
U module-cvs-T_MIXED/sub3/default
1..0 # SKIP skipping git p4 tests; no p4 or p4d
*** t9820-git-p4-editor-handling.sh ***
1..0 # SKIP skipping git p4 tests; no p4 or p4d
*** t9821-git-p4-path-variations.sh ***
1..0 # SKIP skipping git p4 tests; no p4 or p4d
*** t9825-git-p4-handle-utf16-without-bom.sh ***
1..0 # SKIP skipping git p4 tests; no p4 or p4d
*** t9901-git-web--browse.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9901-git-web--browse/.git/
expecting success: 
	echo http://example.com/foo\&bar >expect &&
	git config browser.custom.cmd echo &&
	test_web_browse custom http://example.com/foo\&bar

ok 1 - URL with an ampersand in it

expecting success: 
	echo http://example.com/foo\;bar >expect &&
	git config browser.custom.cmd echo &&
	test_web_browse custom http://example.com/foo\;bar

ok 2 - URL with a semi-colon in it

expecting success: 
	echo http://example.com/foo#bar >expect &&
	git config browser.custom.cmd echo &&
	test_web_browse custom http://example.com/foo#bar

Previous HEAD position was e9bb65d... Initial import.
HEAD is now at d875d54... Second commit to proj, affecting all 7 files.
ok 3 - URL with a hash in it

expecting success: 
	echo fake: http://example.com/foo >expect &&
	cat >"fake browser" <<-\EOF &&
	#!/bin/sh
	echo fake: "$@"
	EOF
	chmod +x "fake browser" &&
	git config browser.w3m.path "`pwd`/fake browser" &&
	test_web_browse w3m http://example.com/foo

ok 2 - check timestamps with author-specific timezones

--- module-cvs-T_MIXED/./sub2/subsubA/default	2003-05-22 23:20:19.000000000 +0000
+++ module-git/./sub2/subsubA/default	2015-12-16 11:23:50.053565016 +0000
@@ -1,3 +1,5 @@
 This is sub2/subsub2/default.
 
 Every directory in the `proj' project has a file named `default'.
+
+This line was added in the second commit (affecting all 7 files).
not ok 11 - test tag T_MIXED # TODO known breakage

# passed all 2 test(s)
1..2
# still have 6 known breakage(s)
# passed all remaining 5 test(s)
1..11
ok 4 - browser paths are properly quoted

expecting success: 
	echo "arg: http://example.com/foo" >expect &&
	git config browser.custom.cmd "
		f() {
			for i in \"\$@\"; do
				echo arg: \$i
			done
		}
		f" &&
	test_web_browse custom http://example.com/foo

ok 80 - path_info: project/:/ (implicit HEAD, top tree)

expecting success: gitweb_run "a=opml"
ok 5 - browser command allows arbitrary shell code

# passed all 5 test(s)
1..5
*** t9902-completion.sh ***
*** t9903-bash-prompt.sh ***
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9902-completion/.git/
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9903-bash-prompt/.git/
expecting success: 
	git init otherrepo &&
	echo 1 >file &&
	git add file &&
	test_tick &&
	git commit -m initial &&
	git tag -a -m msg1 t1 &&
	git checkout -b b1 &&
	echo 2 >file &&
	git commit -m "second b1" file &&
	echo 3 >file &&
	git commit -m "third b1" file &&
	git tag -a -m msg2 t2 &&
	git checkout -b b2 master &&
	echo 0 >file &&
	git commit -m "second b2" file &&
	echo 00 >file &&
	git commit -m "another b2" file &&
	echo 000 >file &&
	git commit -m "yet another b2" file &&
	mkdir ignored_dir &&
	echo "ignored_dir/" >>.gitignore &&
	git checkout master

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9903-bash-prompt/otherrepo/.git/
[master (root-commit) 777c62c] initial
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
expecting success: 
	mkdir -p subdir/subsubdir &&
	git init otherrepo

Switched to a new branch 'b1'
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9902-completion/otherrepo/.git/
ok 1 - setup for __gitdir tests

expecting success: 
	echo "$TRASH_DIRECTORY/otherrepo/.git" >expected &&
	(
		__git_dir="$TRASH_DIRECTORY/otherrepo/.git" &&
		__gitdir >"$actual"
	) &&
	test_cmp expected "$actual"

[b1 5792ca5] second b1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 2 - __gitdir - from command line (through $__git_dir)

expecting success: 
	echo "otherrepo/.git" >expected &&
	__gitdir "otherrepo" >"$actual" &&
	test_cmp expected "$actual"

ok 3 - __gitdir - repo as argument

expecting success: 
	echo "remote" >expected &&
	__gitdir "remote" >"$actual" &&
	test_cmp expected "$actual"

[b1 f308b96] third b1
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 4 - __gitdir - remote as argument

expecting success: 
	echo ".git" >expected &&
	__gitdir >"$actual" &&
	test_cmp expected "$actual"

ok 5 - __gitdir - .git directory in cwd

Switched to a new branch 'b2'
expecting success: 
	echo "$(pwd -P)/.git" >expected &&
	(
		cd subdir/subsubdir &&
		__gitdir >"$actual"
	) &&
	test_cmp expected "$actual"

[b2 ac373be] second b2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 6 - __gitdir - .git directory in parent

expecting success: 
	echo "." >expected &&
	(
		cd .git &&
		__gitdir >"$actual"
	) &&
	test_cmp expected "$actual"

[b2 78b9f52] another b2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 7 - __gitdir - cwd is a .git directory

expecting success: 
	echo "$(pwd -P)/.git" >expected &&
	(
		cd .git/refs/heads &&
		__gitdir >"$actual"
	) &&
	test_cmp expected "$actual"

[b2 0de4521] yet another b2
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 8 - __gitdir - parent is a .git directory

expecting success: 
	echo "$TRASH_DIRECTORY/otherrepo/.git" >expected &&
	(
		GIT_DIR="$TRASH_DIRECTORY/otherrepo/.git" &&
		export GIT_DIR &&
		__gitdir >"$actual"
	) &&
	test_cmp expected "$actual"

Switched to branch 'master'
ok 1 - setup for prompt tests

expecting success: 
	printf " (master)" >expected &&
	__git_ps1 >"$actual" &&
	test_cmp expected "$actual"

ok 9 - __gitdir - $GIT_DIR set while .git directory in cwd

expecting success: 
	echo "$TRASH_DIRECTORY/otherrepo/.git" >expected &&
	(
		GIT_DIR="$TRASH_DIRECTORY/otherrepo/.git" &&
		export GIT_DIR &&
		cd subdir &&
		__gitdir >"$actual"
	) &&
	test_cmp expected "$actual"

ok 10 - __gitdir - $GIT_DIR set while .git directory in parent

expecting success: 
	(
		GIT_DIR="$TRASH_DIRECTORY/non-existing" &&
		export GIT_DIR &&
		test_must_fail __gitdir
	)

ok 2 - prompt - branch name

ok 11 - __gitdir - non-existing $GIT_DIR

checking prerequisite: SYMLINKS
expecting success: 
	echo "$(pwd_P_W)/otherrepo/.git" >expected &&
	echo "gitdir: $(pwd_P_W)/otherrepo/.git" >subdir/.git &&
	test_when_finished "rm -f subdir/.git" &&
	(
		cd subdir &&
		__gitdir >"$actual"
	) &&
	test_cmp expected "$actual"


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: 
	printf " (master)" >expected &&
	test_when_finished "git checkout master" &&
	test_config core.preferSymlinkRefs true &&
	git checkout master &&
	__git_ps1 >"$actual" &&
	test_cmp expected "$actual"

ok 12 - __gitdir - gitfile in cwd

expecting success: 
	echo "$(pwd_P_W)/otherrepo/.git" >expected &&
	echo "gitdir: $(pwd_P_W)/otherrepo/.git" >subdir/.git &&
	test_when_finished "rm -f subdir/.git" &&
	(
		cd subdir/subsubdir &&
		__gitdir >"$actual"
	) &&
	test_cmp expected "$actual"

Already on 'master'
ok 13 - __gitdir - gitfile in parent

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: 
	echo "$(pwd -P)/otherrepo/.git" >expected &&
	mkdir otherrepo/dir &&
	test_when_finished "rm -rf otherrepo/dir" &&
	ln -s otherrepo/dir link &&
	test_when_finished "rm -f link" &&
	(
		cd link &&
		__gitdir >"$actual"
	) &&
	test_cmp expected "$actual"

Already on 'master'
ok 3 - prompt - branch name - symlink symref

expecting success: 
	printf " (unborn)" >expected &&
	git checkout --orphan unborn &&
	test_when_finished "git checkout master" &&
	__git_ps1 >"$actual" &&
	test_cmp expected "$actual"

Switched to a new branch 'unborn'
ok 14 - __gitdir - resulting path avoids symlinks

expecting success: 
	(
		cd subdir/subsubdir &&
		GIT_CEILING_DIRECTORIES="$TRASH_DIRECTORY" &&
		export GIT_CEILING_DIRECTORIES &&
		test_must_fail __gitdir
	)

ok 15 - __gitdir - not a git repository

expecting success: 
	test_gitcomp "--re" "--dry-run --reuse-message= --reedit-message=
		--reset-author" <<-EOF
	--reuse-message=Z
	--reedit-message=Z
	--reset-author Z
	EOF

Switched to branch 'master'
ok 4 - prompt - unborn branch

ok 16 - __gitcomp - trailing space - options

expecting success: 
	printf " (master)" >expected &&
	git init "$repo_with_newline" &&
	test_when_finished "rm -rf \"$repo_with_newline\"" &&
	mkdir "$repo_with_newline"/subdir &&
	(
		cd "$repo_with_newline/subdir" &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

expecting success: 
	test_gitcomp "br" "branch. branch.autosetupmerge
		branch.autosetuprebase browser." <<-\EOF
	branch.Z
	branch.autosetupmerge Z
	branch.autosetuprebase Z
	browser.Z
	EOF

ok 17 - __gitcomp - trailing space - config keys

expecting success: 
	test_gitcomp "--strategy=re" "octopus ours recursive resolve subtree" \
		"" "re" <<-\EOF
	recursive Z
	resolve Z
	EOF

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9903-bash-prompt/repo
with
newline/.git/
ok 18 - __gitcomp - option parameter

expecting success: 
	test_gitcomp "branch.me" "remote merge mergeoptions rebase" \
		"branch.maint." "me" <<-\EOF
	branch.maint.merge Z
	branch.maint.mergeoptions Z
	EOF

ok 81 - feeds: OPML

expecting success: gitweb_run "p=.git;a=rss"
ok 19 - __gitcomp - prefix

expecting success: 
	test_gitcomp "branch.me" "master maint next pu" "branch." \
		"ma" "." <<-\EOF
	branch.master.Z
	branch.maint.Z
	EOF

ok 5 - prompt - with newline in path

expecting success: 
	printf " ((%s...))" $(git log -1 --format="%h" --abbrev=13 b1^) >expected &&
	test_config core.abbrev 13 &&
	git checkout b1^ &&
	test_when_finished "git checkout master" &&
	__git_ps1 >"$actual" &&
	test_cmp expected "$actual"

ok 20 - __gitcomp - suffix

expecting success: 
	__gitcomp "$invalid_variable_name"

ok 21 - __gitcomp - doesnt fail because of invalid variable name

expecting success: 
	test_gitcomp_nl "m" "$refs" <<-EOF
	maint Z
	master Z
	EOF

ok 22 - __gitcomp_nl - trailing space

expecting success: 
	test_gitcomp_nl "--fixup=m" "$refs" "--fixup=" "m" <<-EOF
	--fixup=maint Z
	--fixup=master Z
	EOF

Note: checking out 'b1^'.

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 5792ca55e9344... second b1
ok 23 - __gitcomp_nl - prefix

expecting success: 
	test_gitcomp_nl "branch.ma" "$refs" "branch." "ma" "." <<-\EOF
	branch.maint.Z
	branch.master.Z
	EOF

ok 24 - __gitcomp_nl - suffix

expecting success: 
	test_gitcomp_nl "ma" "$refs" "" "ma" "" <<-\EOF
	maintZ
	masterZ
	EOF

Previous HEAD position was 5792ca55e9344... second b1
Switched to branch 'master'
ok 25 - __gitcomp_nl - no suffix

expecting success: 
	__gitcomp_nl "$invalid_variable_name"

ok 26 - __gitcomp_nl - doesnt fail because of invalid variable name

expecting success: 
	cat >expect <<-EOF &&
	remote_from_file_1
	remote_from_file_2
	remote_in_config_1
	remote_in_config_2
	EOF
	test_when_finished "rm -rf .git/remotes" &&
	mkdir -p .git/remotes &&
	>.git/remotes/remote_from_file_1 &&
	>.git/remotes/remote_from_file_2 &&
	test_when_finished "git remote remove remote_in_config_1" &&
	git remote add remote_in_config_1 git://remote_1 &&
	test_when_finished "git remote remove remote_in_config_2" &&
	git remote add remote_in_config_2 git://remote_2 &&
	__git_remotes >actual &&
	test_cmp expect actual

ok 6 - prompt - detached head

expecting success: 
	printf " ((t2~1))" >expected &&
	git checkout b1^ &&
	test_when_finished "git checkout master" &&
	(
		GIT_PS1_DESCRIBE_STYLE=contains &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

Note: checking out 'b1^'.

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 5792ca5... second b1
Previous HEAD position was 5792ca5... second b1
Switched to branch 'master'
ok 7 - prompt - describe detached head - contains

expecting success: 
	printf " ((b1~1))" >expected &&
	git checkout b1^ &&
	test_when_finished "git checkout master" &&
	(
		GIT_PS1_DESCRIBE_STYLE=branch &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

ok 27 - __git_remotes - list remotes from $GIT_DIR/remotes and from config file

Note: checking out 'b1^'.

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 5792ca5... second b1
expecting success: 
	cat >expect <<-EOF &&
	name-1
	name-2
	EOF
	test_config interesting.name-1 good &&
	test_config interesting.name-2 good &&
	test_config subsection.interesting.name-3 bad &&
	__git_get_config_variables interesting >actual &&
	test_cmp expect actual

Previous HEAD position was 5792ca5... second b1
Switched to branch 'master'
ok 8 - prompt - describe detached head - branch

expecting success: 
	printf " ((t1-1-g%s))" $(git log -1 --format="%h" b1^) >expected &&
	git checkout b1^ &&
	test_when_finished "git checkout master" &&
	(
		GIT_PS1_DESCRIBE_STYLE=describe &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

Note: checking out 'b1^'.

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 5792ca5... second b1
ok 28 - __git_get_config_variables

expecting success: 
	cat >expect <<-EOF &&
	author
	hash
	EOF
	test_config pretty.author "%an %ae" &&
	test_config pretty.hash %H &&
	__git_pretty_aliases >actual &&
	test_cmp expect actual

Previous HEAD position was 5792ca5... second b1
Switched to branch 'master'
ok 9 - prompt - describe detached head - describe

expecting success: 
	printf " ((t2))" >expected &&
	git checkout --detach b1 &&
	test_when_finished "git checkout master" &&
	__git_ps1 >"$actual" &&
	test_cmp expected "$actual"

ok 29 - __git_pretty_aliases

expecting success: 
	cat >expect <<-EOF &&
	ci
	co
	EOF
	test_config alias.ci commit &&
	test_config alias.co checkout &&
	__git_aliases >actual &&
	test_cmp expect actual

Note: checking out 'b1'.

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 f308b96... third b1
Previous HEAD position was f308b96... third b1
Switched to branch 'master'
ok 10 - prompt - describe detached head - default

expecting success: 
	printf " (GIT_DIR!)" >expected &&
	(
		cd .git &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

ok 30 - __git_aliases

expecting success: 
	run_completion "git " &&
	# built-in
	grep -q "^add \$" out &&
	# script
	grep -q "^filter-branch \$" out &&
	# plumbing
	! grep -q "^ls-files \$" out &&

	run_completion "git f" &&
	! grep -q -v "^f" out

ok 11 - prompt - inside .git directory

expecting success: 
	printf " (GIT_DIR!)" >expected &&
	(
		cd .git/refs/heads &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

ok 12 - prompt - deep inside .git directory

expecting success: 
	printf " (BARE:master)" >expected &&
	git init --bare bare.git &&
	test_when_finished "rm -rf bare.git" &&
	(
		cd bare.git &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9903-bash-prompt/bare.git/
ok 31 - basic

expecting success: 
	test_completion "git --" <<-\EOF
	--paginate Z
	--no-pager Z
	--git-dir=
	--bare Z
	--version Z
	--exec-path Z
	--exec-path=
	--html-path Z
	--man-path Z
	--info-path Z
	--work-tree=
	--namespace=
	--no-replace-objects Z
	--help Z
	EOF

ok 32 - double dash "git" itself

expecting success: 
	test_completion "git checkout --" <<-\EOF
	--quiet Z
	--ours Z
	--theirs Z
	--track Z
	--no-track Z
	--merge Z
	--conflict=
	--orphan Z
	--patch Z
	EOF

ok 13 - prompt - inside bare repository

expecting success: 
	printf " (b1|REBASE-i 2/3)" >expected &&
	write_script fake_editor.sh <<-\EOF &&
		echo "exec echo" >"$1"
		echo "edit $(git log -1 --format="%h")" >>"$1"
		echo "exec echo" >>"$1"
	EOF
	test_when_finished "rm -f fake_editor.sh" &&
	test_set_editor "$TRASH_DIRECTORY/fake_editor.sh" &&
	git checkout b1 &&
	test_when_finished "git checkout master" &&
	git rebase -i HEAD^ &&
	test_when_finished "git rebase --abort"
	__git_ps1 >"$actual" &&
	test_cmp expected "$actual"

ok 33 - double dash "git checkout"

expecting success: 
	test_completion "git --ver" "--version " &&
	test_completion "git --hel" "--help " &&
	test_completion "git --exe" <<-\EOF &&
	--exec-path Z
	--exec-path=
	EOF
	test_completion "git --htm" "--html-path " &&
	test_completion "git --pag" "--paginate " &&
	test_completion "git --no-p" "--no-pager " &&
	test_completion "git --git" "--git-dir=" &&
	test_completion "git --wor" "--work-tree=" &&
	test_completion "git --nam" "--namespace=" &&
	test_completion "git --bar" "--bare " &&
	test_completion "git --inf" "--info-path " &&
	test_completion "git --no-r" "--no-replace-objects "

Switched to branch 'b1'
ok 34 - general options

expecting success: 
	test_completion "git --version check" "checkout " &&
	test_completion "git --paginate check" "checkout " &&
	test_completion "git --git-dir=foo check" "checkout " &&
	test_completion "git --bare check" "checkout " &&
	test_completion "git --exec-path=foo check" "checkout " &&
	test_completion "git --html-path check" "checkout " &&
	test_completion "git --no-pager check" "checkout " &&
	test_completion "git --work-tree=foo check" "checkout " &&
	test_completion "git --namespace=foo check" "checkout " &&
	test_completion "git --paginate check" "checkout " &&
	test_completion "git --info-path check" "checkout " &&
	test_completion "git --no-replace-objects check" "checkout "

ok 35 - general options plus command

Rebasing (1/3)
Executing: echo
expecting success: 
	test_completion "git --help ad" "add " &&
	test_completion "git --help core" "core-tutorial "


Rebasing (2/3)
ok 36 - git --help completion

expecting success: 
	echo content >file1 &&
	echo more >file2 &&
	git add . &&
	git commit -m one &&
	git branch mybranch &&
	git tag mytag

Stopped at f308b96023a3be722664d58a07ca23a48c96d04b... f308b96
ok 82 - feed: RSS

expecting success: gitweb_run "p=.git;a=atom"
[master (root-commit) 1d30897] one
 Author: A U Thor <author@example.com>
 6 files changed, 8 insertions(+)
 create mode 100644 actual
 create mode 100644 expect
 create mode 100644 expected
 create mode 100644 file1
 create mode 100644 file2
 create mode 100644 out
ok 37 - setup for ref completion

expecting success: 
	test_completion "git checkout m" <<-\EOF
	master Z
	mybranch Z
	mytag Z
	EOF

You can amend the commit now, with

	git commit --amend 

Once you are satisfied with your changes, run

	git rebase --continue

ok 38 - checkout completes ref names

expecting success: 
	test_completion "git show m" <<-\EOF
	master Z
	mybranch Z
	mytag Z
	EOF

ok 39 - show completes all refs

expecting success: 
	test_completion "git show mytag:f" <<-\EOF
	file1 Z
	file2 Z
	EOF

ok 40 - <ref>: completes paths

expecting success: 
	echo content >"name with spaces" &&
	git add . &&
	git commit -m spaces &&
	test_completion "git show HEAD:nam" <<-\EOF
	name with spaces Z
	EOF

Switched to branch 'master'
[master bcc1096] spaces
 Author: A U Thor <author@example.com>
 3 files changed, 5 insertions(+), 2 deletions(-)
 create mode 100644 name with spaces
ok 14 - prompt - interactive rebase

expecting success: 
	printf " (b2|REBASE-m 1/3)" >expected &&
	git checkout b2 &&
	test_when_finished "git checkout master" &&
	test_must_fail git rebase --merge b1 b2 &&
	test_when_finished "git rebase --abort" &&
	__git_ps1 >"$actual" &&
	test_cmp expected "$actual"

Switched to branch 'b2'
ok 41 - complete tree filename with spaces

expecting success: 
	echo content >"name with \${meta}" &&
	git add . &&
	git commit -m meta &&
	test_completion "git show HEAD:nam" <<-\EOF
	name with ${meta} Z
	name with spaces Z
	EOF

[master d5f8429] meta
 Author: A U Thor <author@example.com>
 3 files changed, 3 insertions(+), 4 deletions(-)
 create mode 100644 name with ${meta}
ok 42 - complete tree filename with metacharacters

expecting success: 
	test_completion "git send-email --cov" "--cover-letter " &&
	test_completion "git send-email ma" "master "

ok 43 - send-email

expecting success: 
	git init tmp && cd tmp &&
	test_when_finished "cd .. && rm -rf tmp" &&

	echo "expected" > .gitignore &&
	echo "out" >> .gitignore &&

	git add .gitignore &&
	test_completion "git commit " ".gitignore" &&

	git commit -m ignore &&

	touch new &&
	test_completion "git add " "new" &&

	git add new &&
	git commit -a -m new &&
	test_completion "git add " "" &&

	git mv new modified &&
	echo modify > modified &&
	test_completion "git add " "modified" &&

	touch untracked &&

	: TODO .gitignore should not be here &&
	test_completion "git rm " <<-\EOF &&
	.gitignore
	modified
	EOF

	test_completion "git clean " "untracked" &&

	: TODO .gitignore should not be here &&
	test_completion "git mv " <<-\EOF &&
	.gitignore
	modified
	EOF

	mkdir dir &&
	touch dir/file-in-dir &&
	git add dir/file-in-dir &&
	git commit -m dir &&

	mkdir untracked-dir &&

	: TODO .gitignore should not be here &&
	test_completion "git mv modified " <<-\EOF &&
	.gitignore
	dir
	modified
	untracked
	untracked-dir
	EOF

	test_completion "git commit " "modified" &&

	: TODO .gitignore should not be here &&
	test_completion "git ls-files " <<-\EOF &&
	.gitignore
	dir
	modified
	EOF

	touch momified &&
	test_completion "git add mom" "momified"

First, rewinding head to replay your work on top of it...
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9902-completion/tmp/.git/
Merging b1 with HEAD~2
Merging:
f308b96 third b1
ac373be second b2
found 1 common ancestor:
777c62c initial
Auto-merging file
CONFLICT (content): Merge conflict in file

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

[master (root-commit) 1a34a72] ignore
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+)
 create mode 100644 .gitignore
[master 84ed956] new
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 new
Switched to branch 'master'
ok 15 - prompt - rebase merge

expecting success: 
	printf " (b2|REBASE 1/3)" >expected &&
	git checkout b2 &&
	test_when_finished "git checkout master" &&
	test_must_fail git rebase b1 b2 &&
	test_when_finished "git rebase --abort" &&
	__git_ps1 >"$actual" &&
	test_cmp expected "$actual"

Switched to branch 'b2'
First, rewinding head to replay your work on top of it...
Applying: second b2
Using index info to reconstruct a base tree...
M	file
Falling back to patching base and 3-way merge...
Merging f308b96023a3be722664d58a07ca23a48c96d04b with second b2
Merging:
f308b96 third b1
virtual second b2
found 1 common ancestor:
virtual f27c6ae26adb8396d3861976ba268f87ad8afa0b
Auto-merging file
CONFLICT (content): Merge conflict in file
error: Failed to merge in the changes.
Patch failed at 0001 second b2
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

[master b8bb556] dir
 Author: A U Thor <author@example.com>
 2 files changed, 0 insertions(+), 0 deletions(-)
 rename new => dir/file-in-dir (100%)
 create mode 100644 modified
Switched to branch 'master'
ok 16 - prompt - rebase

expecting success: 
	printf " (b1|MERGING)" >expected &&
	git checkout b1 &&
	test_when_finished "git checkout master" &&
	test_must_fail git merge b2 &&
	test_when_finished "git reset --hard" &&
	__git_ps1 >"$actual" &&
	test_cmp expected "$actual"

Switched to branch 'b1'
Merging:
f308b96 third b1
virtual b2
found 1 common ancestor:
777c62c initial
Auto-merging file
CONFLICT (content): Merge conflict in file
Automatic merge failed; fix conflicts and then commit the result.
HEAD is now at f308b96 third b1
Switched to branch 'master'
ok 17 - prompt - merge

expecting success: 
	printf " (master|CHERRY-PICKING)" >expected &&
	test_must_fail git cherry-pick b1 &&
	test_when_finished "git reset --hard" &&
	__git_ps1 >"$actual" &&
	test_cmp expected "$actual"

error: could not apply f308b96... third b1
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Auto-merging file
CONFLICT (content): Merge conflict in file
ok 44 - complete files

expecting success: 
	test_config alias.co "!sh -c 'git checkout ...'" &&
	test_completion "git co m" <<-\EOF
	master Z
	mybranch Z
	mytag Z
	EOF

HEAD is now at 777c62c initial
ok 18 - prompt - cherry-pick

expecting success: 
	printf " (master|BISECTING)" >expected &&
	git bisect start &&
	test_when_finished "git bisect reset" &&
	__git_ps1 >"$actual" &&
	test_cmp expected "$actual"

ok 83 - feed: Atom

expecting success: . "$TEST_DIRECTORY"/t3901-utf8.txt &&
	 test_when_finished "GIT_AUTHOR_NAME=\"A U Thor\"" &&
	 test_when_finished "GIT_COMMITTER_NAME=\"C O Mitter\"" &&
	 echo "UTF-8" >> file &&
	 git add file &&
	 git commit -F "$TEST_DIRECTORY"/t3900/1-UTF-8.txt &&
	 gitweb_run "p=.git;a=commit"
[master 72fdd35] ÄËÑÏÖ
 Author: Áéí óú <author@example.com>
 1 file changed, 1 insertion(+)
ok 45 - completion uses <cmd> completion for alias: !sh -c 'git <cmd> ...'

expecting success: 
	test_config alias.co "!f () { VAR=val git checkout ... ; } f" &&
	test_completion "git co m" <<-\EOF
	master Z
	mybranch Z
	mytag Z
	EOF

ok 46 - completion uses <cmd> completion for alias: !f () { VAR=val git <cmd> ... }

expecting success: 
	test_config alias.co "!f() { : git checkout ; if ... } f" &&
	test_completion "git co m" <<-\EOF
	master Z
	mybranch Z
	mytag Z
	EOF

Already on 'master'
ok 19 - prompt - bisect

expecting success: 
	printf " (master)" >expected &&
	(
		GIT_PS1_SHOWDIRTYSTATE=y &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

ok 47 - completion used <cmd> completion for alias: !f() { : git <cmd> ; ... }

checking known breakage: 
	git init tmp && cd tmp &&
	test_when_finished "cd .. && rm -rf tmp" &&

	touch ~/tmp/file &&

	test_completion "git add ~/tmp/" "~/tmp/file"

Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9902-completion/tmp/.git/
ok 20 - prompt - dirty status indicator - clean

expecting success: 
	printf " (master *)" >expected &&
	echo "dirty" >file &&
	test_when_finished "git reset --hard" &&
	(
		GIT_PS1_SHOWDIRTYSTATE=y &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

--- expected	2015-12-16 11:23:57.557565017 +0000
+++ out	2015-12-16 11:23:57.673565017 +0000
@@ -1 +1 @@
-~/tmp/file
+
not ok 48 - complete with tilde expansion # TODO known breakage

HEAD is now at 777c62c initial
# still have 1 known breakage(s)
# passed all remaining 47 test(s)
1..48
ok 21 - prompt - dirty status indicator - dirty worktree

expecting success: 
	printf " (master +)" >expected &&
	echo "dirty" >file &&
	test_when_finished "git reset --hard" &&
	git add -u &&
	(
		GIT_PS1_SHOWDIRTYSTATE=y &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

HEAD is now at 777c62c initial
ok 22 - prompt - dirty status indicator - dirty index

expecting success: 
	printf " (master *+)" >expected &&
	echo "dirty index" >file &&
	test_when_finished "git reset --hard" &&
	git add -u &&
	echo "dirty worktree" >file &&
	(
		GIT_PS1_SHOWDIRTYSTATE=y &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

HEAD is now at 777c62c initial
ok 23 - prompt - dirty status indicator - dirty index and worktree

expecting success: 
	printf " (orphan #)" >expected &&
	test_when_finished "git checkout master" &&
	git checkout --orphan orphan &&
	git reset --hard &&
	(
		GIT_PS1_SHOWDIRTYSTATE=y &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

Switched to a new branch 'orphan'
Switched to branch 'master'
ok 24 - prompt - dirty status indicator - orphan branch - clean

expecting success: 
	printf " (orphan +)" >expected &&
	test_when_finished "git checkout master" &&
	git checkout --orphan orphan &&
	(
		GIT_PS1_SHOWDIRTYSTATE=y &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

Switched to a new branch 'orphan'
Switched to branch 'master'
ok 25 - prompt - dirty status indicator - orphan branch - dirty index

expecting success: 
	printf " (orphan *+)" >expected &&
	test_when_finished "git checkout master" &&
	git checkout --orphan orphan &&
	>file &&
	(
		GIT_PS1_SHOWDIRTYSTATE=y &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

Switched to a new branch 'orphan'
ok 84 - encode(commit): utf8

expecting success: . "$TEST_DIRECTORY"/t3901-8859-1.txt &&
	 test_when_finished "GIT_AUTHOR_NAME=\"A U Thor\"" &&
	 test_when_finished "GIT_COMMITTER_NAME=\"C O Mitter\"" &&
	 echo "ISO-8859-1" >> file &&
	 git add file &&
	 test_config i18n.commitencoding ISO-8859-1 &&
	 git commit -F "$TEST_DIRECTORY"/t3900/ISO8859-1.txt &&
	 gitweb_run "p=.git;a=commit"
[master 70af25c] ÄËÑÏÖ
 1 file changed, 1 insertion(+)
Switched to branch 'master'
M	file
ok 26 - prompt - dirty status indicator - orphan branch - dirty index and worktree

expecting success: 
	printf " (master)" >expected &&
	echo "dirty" >file &&
	test_when_finished "git reset --hard" &&
	test_config bash.showDirtyState false &&
	(
		sane_unset GIT_PS1_SHOWDIRTYSTATE &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

HEAD is now at 777c62c initial
ok 27 - prompt - dirty status indicator - shell variable unset with config disabled

expecting success: 
	printf " (master)" >expected &&
	echo "dirty" >file &&
	test_when_finished "git reset --hard" &&
	test_config bash.showDirtyState true &&
	(
		sane_unset GIT_PS1_SHOWDIRTYSTATE &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

HEAD is now at 777c62c initial
ok 28 - prompt - dirty status indicator - shell variable unset with config enabled

expecting success: 
	printf " (master)" >expected &&
	echo "dirty" >file &&
	test_when_finished "git reset --hard" &&
	test_config bash.showDirtyState false &&
	(
		GIT_PS1_SHOWDIRTYSTATE=y &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

HEAD is now at 777c62c initial
ok 29 - prompt - dirty status indicator - shell variable set with config disabled

expecting success: 
	printf " (master *)" >expected &&
	echo "dirty" >file &&
	test_when_finished "git reset --hard" &&
	test_config bash.showDirtyState true &&
	(
		GIT_PS1_SHOWDIRTYSTATE=y &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

HEAD is now at 777c62c initial
ok 30 - prompt - dirty status indicator - shell variable set with config enabled

expecting success: 
	printf " (GIT_DIR!)" >expected &&
	echo "dirty" >file &&
	test_when_finished "git reset --hard" &&
	(
		GIT_PS1_SHOWDIRTYSTATE=y &&
		cd .git &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

HEAD is now at 777c62c initial
ok 31 - prompt - dirty status indicator - not shown inside .git directory

expecting success: 
	printf " (master)" >expected &&
	(
		GIT_PS1_SHOWSTASHSTATE=y &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

ok 32 - prompt - stash status indicator - no stash

expecting success: 
	printf " (master $)" >expected &&
	echo 2 >file &&
	git stash &&
	test_when_finished "git stash drop" &&
	git pack-refs --all &&
	(
		GIT_PS1_SHOWSTASHSTATE=y &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

Saved working directory and index state WIP on master: 777c62c initial
HEAD is now at 777c62c initial
ok 85 - encode(commit): iso-8859-1

expecting success: gitweb_run "p=.git;a=log"
Dropped refs/stash@{0} (d8e6dd9b4a835d2a2ee7bc852da4153c136ea562)
ok 33 - prompt - stash status indicator - stash

expecting success: 
	printf " (GIT_DIR!)" >expected &&
	echo 2 >file &&
	git stash &&
	test_when_finished "git stash drop" &&
	(
		GIT_PS1_SHOWSTASHSTATE=y &&
		cd .git &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

Saved working directory and index state WIP on master: 777c62c initial
HEAD is now at 777c62c initial
Dropped refs/stash@{0} (d8e6dd9b4a835d2a2ee7bc852da4153c136ea562)
ok 34 - prompt - stash status indicator - not shown inside .git directory

expecting success: 
	printf " (master)" >expected &&
	(
		GIT_PS1_SHOWUNTRACKEDFILES=y &&
		cd otherrepo &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

ok 35 - prompt - untracked files status indicator - no untracked files

expecting success: 
	printf " (master %%)" >expected &&
	(
		GIT_PS1_SHOWUNTRACKEDFILES=y &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

ok 36 - prompt - untracked files status indicator - untracked files

expecting success: 
	printf " (master)" >expected &&
	mkdir otherrepo/untracked-dir &&
	test_when_finished "rm -rf otherrepo/untracked-dir" &&
	(
		GIT_PS1_SHOWUNTRACKEDFILES=y &&
		cd otherrepo &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

ok 37 - prompt - untracked files status indicator - empty untracked dir

expecting success: 
	printf " (master %%)" >expected &&
	mkdir otherrepo/untracked-dir &&
	test_when_finished "rm -rf otherrepo/untracked-dir" &&
	>otherrepo/untracked-dir/untracked-file &&
	(
		GIT_PS1_SHOWUNTRACKEDFILES=y &&
		cd otherrepo &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

ok 38 - prompt - untracked files status indicator - non-empty untracked dir

expecting success: 
	printf " (master %%)" >expected &&
	(
		mkdir -p ignored_dir &&
		cd ignored_dir &&
		GIT_PS1_SHOWUNTRACKEDFILES=y &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

ok 39 - prompt - untracked files status indicator - untracked files outside cwd

expecting success: 
	printf " (master)" >expected &&
	test_config bash.showUntrackedFiles false &&
	(
		sane_unset GIT_PS1_SHOWUNTRACKEDFILES &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

ok 40 - prompt - untracked files status indicator - shell variable unset with config disabled

expecting success: 
	printf " (master)" >expected &&
	test_config bash.showUntrackedFiles true &&
	(
		sane_unset GIT_PS1_SHOWUNTRACKEDFILES &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

ok 41 - prompt - untracked files status indicator - shell variable unset with config enabled

expecting success: 
	printf " (master)" >expected &&
	test_config bash.showUntrackedFiles false &&
	(
		GIT_PS1_SHOWUNTRACKEDFILES=y &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

ok 86 - encode(log): utf-8 and iso-8859-1

expecting success: gitweb_run "p=.git;a=log;opt=--no-merges"
ok 42 - prompt - untracked files status indicator - shell variable set with config disabled

expecting success: 
	printf " (master %%)" >expected &&
	test_config bash.showUntrackedFiles true &&
	(
		GIT_PS1_SHOWUNTRACKEDFILES=y &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

ok 43 - prompt - untracked files status indicator - shell variable set with config enabled

expecting success: 
	printf " (GIT_DIR!)" >expected &&
	(
		GIT_PS1_SHOWUNTRACKEDFILES=y &&
		cd .git &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

ok 44 - prompt - untracked files status indicator - not shown inside .git directory

expecting success: 
	printf -- "-master" >expected &&
	__git_ps1 "-%s" >"$actual" &&
	test_cmp expected "$actual"

ok 45 - prompt - format string starting with dash

expecting success: 
	printf "BEFORE: (\${__git_ps1_branch_name}):AFTER\\nmaster" >expected &&
	printf "" >expected_output &&
	(
		__git_ps1 "BEFORE:" ":AFTER" >"$actual" &&
		test_cmp expected_output "$actual" &&
		printf "%s\\n%s" "$PS1" "${__git_ps1_branch_name}" >"$actual"
	) &&
	test_cmp expected "$actual"

ok 46 - prompt - pc mode

expecting success: 
	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear}):AFTER\\nmaster" >expected &&
	(
		GIT_PS1_SHOWCOLORHINTS=y &&
		__git_ps1 "BEFORE:" ":AFTER" >"$actual"
		printf "%s\\n%s" "$PS1" "${__git_ps1_branch_name}" >"$actual"
	) &&
	test_cmp expected "$actual"

ok 47 - prompt - bash color pc mode - branch name

expecting success: 
	printf "BEFORE: (${c_red}\${__git_ps1_branch_name}${c_clear}):AFTER\\n(%s...)" $(git log -1 --format="%h" b1^) >expected &&
	git checkout b1^ &&
	test_when_finished "git checkout master" &&
	(
		GIT_PS1_SHOWCOLORHINTS=y &&
		__git_ps1 "BEFORE:" ":AFTER" &&
		printf "%s\\n%s" "$PS1" "${__git_ps1_branch_name}" >"$actual"
	) &&
	test_cmp expected "$actual"

Note: checking out 'b1^'.

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 5792ca5... second b1
Previous HEAD position was 5792ca5... second b1
Switched to branch 'master'
ok 48 - prompt - bash color pc mode - detached head

expecting success: 
	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_red}*${c_clear}):AFTER\\nmaster" >expected &&
	echo "dirty" >file &&
	test_when_finished "git reset --hard" &&
	(
		GIT_PS1_SHOWDIRTYSTATE=y &&
		GIT_PS1_SHOWCOLORHINTS=y &&
		__git_ps1 "BEFORE:" ":AFTER" &&
		printf "%s\\n%s" "$PS1" "${__git_ps1_branch_name}" >"$actual"
	) &&
	test_cmp expected "$actual"

HEAD is now at 777c62c initial
ok 49 - prompt - bash color pc mode - dirty status indicator - dirty worktree

expecting success: 
	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_green}+${c_clear}):AFTER\\nmaster" >expected &&
	echo "dirty" >file &&
	test_when_finished "git reset --hard" &&
	git add -u &&
	(
		GIT_PS1_SHOWDIRTYSTATE=y &&
		GIT_PS1_SHOWCOLORHINTS=y &&
		__git_ps1 "BEFORE:" ":AFTER" &&
		printf "%s\\n%s" "$PS1" "${__git_ps1_branch_name}" >"$actual"
	) &&
	test_cmp expected "$actual"

HEAD is now at 777c62c initial
ok 50 - prompt - bash color pc mode - dirty status indicator - dirty index

expecting success: 
	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_red}*${c_green}+${c_clear}):AFTER\\nmaster" >expected &&
	echo "dirty index" >file &&
	test_when_finished "git reset --hard" &&
	git add -u &&
	echo "dirty worktree" >file &&
	(
		GIT_PS1_SHOWCOLORHINTS=y &&
		GIT_PS1_SHOWDIRTYSTATE=y &&
		__git_ps1 "BEFORE:" ":AFTER" &&
		printf "%s\\n%s" "$PS1" "${__git_ps1_branch_name}" >"$actual"
	) &&
	test_cmp expected "$actual"

HEAD is now at 777c62c initial
ok 51 - prompt - bash color pc mode - dirty status indicator - dirty index and worktree

expecting success: 
	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_green}#${c_clear}):AFTER\\nmaster" >expected &&
	(
		GIT_PS1_SHOWDIRTYSTATE=y &&
		GIT_PS1_SHOWCOLORHINTS=y &&
		cd otherrepo &&
		__git_ps1 "BEFORE:" ":AFTER" &&
		printf "%s\\n%s" "$PS1" "${__git_ps1_branch_name}" >"$actual"
	) &&
	test_cmp expected "$actual"

ok 52 - prompt - bash color pc mode - dirty status indicator - before root commit

expecting success: 
	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear}):AFTER\\nGIT_DIR!" >expected &&
	echo "dirty" >file &&
	test_when_finished "git reset --hard" &&
	(
		GIT_PS1_SHOWDIRTYSTATE=y &&
		GIT_PS1_SHOWCOLORHINTS=y &&
		cd .git &&
		__git_ps1 "BEFORE:" ":AFTER" &&
		printf "%s\\n%s" "$PS1" "${__git_ps1_branch_name}" >"$actual"
	) &&
	test_cmp expected "$actual"

HEAD is now at 777c62c initial
ok 53 - prompt - bash color pc mode - inside .git directory

expecting success: 
	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_lblue}\$${c_clear}):AFTER\\nmaster" >expected &&
	echo 2 >file &&
	git stash &&
	test_when_finished "git stash drop" &&
	(
		GIT_PS1_SHOWSTASHSTATE=y &&
		GIT_PS1_SHOWCOLORHINTS=y &&
		__git_ps1 "BEFORE:" ":AFTER" &&
		printf "%s\\n%s" "$PS1" "${__git_ps1_branch_name}" >"$actual"
	) &&
	test_cmp expected "$actual"

ok 87 - opt: log --no-merges

expecting success: gitweb_run "p=.git;a=log;opt=--no-merges"
Saved working directory and index state WIP on master: 777c62c initial
HEAD is now at 777c62c initial
Dropped refs/stash@{0} (d8e6dd9b4a835d2a2ee7bc852da4153c136ea562)
ok 54 - prompt - bash color pc mode - stash status indicator

expecting success: 
	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_red}%%${c_clear}):AFTER\\nmaster" >expected &&
	(
		GIT_PS1_SHOWUNTRACKEDFILES=y &&
		GIT_PS1_SHOWCOLORHINTS=y &&
		__git_ps1 "BEFORE:" ":AFTER" &&
		printf "%s\\n%s" "$PS1" "${__git_ps1_branch_name}" >"$actual"
	) &&
	test_cmp expected "$actual"

ok 55 - prompt - bash color pc mode - untracked files status indicator

expecting success: 
	printf "BEFORE: (%%F{green}master%%f):AFTER" >expected &&
	(
		ZSH_VERSION=5.0.0 &&
		GIT_PS1_SHOWCOLORHINTS=y &&
		__git_ps1 "BEFORE:" ":AFTER" &&
		printf "%s" "$PS1" >"$actual"
	) &&
	test_cmp expected "$actual"

ok 56 - prompt - zsh color pc mode

expecting success: 
	printf " (master)" >expected &&
	test_config bash.hideIfPwdIgnored false &&
	(
		cd ignored_dir &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

ok 57 - prompt - hide if pwd ignored - env var unset, config disabled

expecting success: 
	printf "BEFORE: (\${__git_ps1_branch_name}):AFTER" >expected &&
	test_config bash.hideIfPwdIgnored false &&
	(
		cd ignored_dir &&
		__git_ps1 "BEFORE:" ":AFTER" &&
		printf "%s" "$PS1" >"$actual"
	) &&
	test_cmp expected "$actual"

ok 58 - prompt - hide if pwd ignored - env var unset, config disabled, pc mode

expecting success: 
	printf " (master)" >expected &&
	(
		cd ignored_dir &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

ok 59 - prompt - hide if pwd ignored - env var unset, config unset

expecting success: 
	printf "BEFORE: (\${__git_ps1_branch_name}):AFTER" >expected &&
	(
		cd ignored_dir &&
		__git_ps1 "BEFORE:" ":AFTER" &&
		printf "%s" "$PS1" >"$actual"
	) &&
	test_cmp expected "$actual"

ok 60 - prompt - hide if pwd ignored - env var unset, config unset, pc mode

expecting success: 
	printf " (master)" >expected &&
	test_config bash.hideIfPwdIgnored false &&
	(
		cd ignored_dir &&
		GIT_PS1_HIDE_IF_PWD_IGNORED=y &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

ok 61 - prompt - hide if pwd ignored - env var set, config disabled

expecting success: 
	printf "BEFORE: (\${__git_ps1_branch_name}):AFTER" >expected &&
	test_config bash.hideIfPwdIgnored false &&
	(
		cd ignored_dir &&
		GIT_PS1_HIDE_IF_PWD_IGNORED=y &&
		__git_ps1 "BEFORE:" ":AFTER" &&
		printf "%s" "$PS1" >"$actual"
	) &&
	test_cmp expected "$actual"

ok 62 - prompt - hide if pwd ignored - env var set, config disabled, pc mode

expecting success: 
	printf "" >expected &&
	(
		cd ignored_dir &&
		GIT_PS1_HIDE_IF_PWD_IGNORED=y &&
		__git_ps1 >"$actual"
	) &&
	test_cmp expected "$actual"

ok 63 - prompt - hide if pwd ignored - env var set, config unset

expecting success: 
	printf "BEFORE::AFTER" >expected &&
	(
		cd ignored_dir &&
		GIT_PS1_HIDE_IF_PWD_IGNORED=y &&
		__git_ps1 "BEFORE:" ":AFTER" &&
		printf "%s" "$PS1" >"$actual"
	) &&
	test_cmp expected "$actual"

ok 64 - prompt - hide if pwd ignored - env var set, config unset, pc mode

expecting success: 
	printf " (GIT_DIR!)" >expected &&
	(
		GIT_PS1_HIDE_IF_PWD_IGNORED=y &&
		cd .git &&
		__git_ps1 >"$actual" 2>/dev/null
	) &&
	test_cmp expected "$actual"

ok 65 - prompt - hide if pwd ignored - inside gitdir (stdout)

expecting success: 
	printf "" >expected &&
	(
		GIT_PS1_HIDE_IF_PWD_IGNORED=y &&
		cd .git &&
		__git_ps1 >/dev/null 2>"$actual"
	) &&
	test_cmp expected "$actual"

ok 88 - opt: atom --no-merges

expecting success: gitweb_run "p=.git;a=history;f=file;opt=--no-merges"
ok 66 - prompt - hide if pwd ignored - inside gitdir (stderr)

# passed all 66 test(s)
1..66
ok 89 - opt: "file" history --no-merges

expecting success: gitweb_run "p=.git;a=log;opt=--no-such-option"
ok 90 - opt: log --no-such-option (invalid option)

expecting success: gitweb_run "p=.git;a=tree;opt=--no-merges"
ok 91 - opt: tree --no-merges (invalid option for action)

expecting success: gitweb_run "p=.git;a=summary"
ok 92 - URL: no project URLs, no base URL

expecting success: git config --add gitweb.url git://example.com/git/trash.git &&
        git config --add gitweb.url http://example.com/git/trash.git &&
        gitweb_run "p=.git;a=summary"
ok 93 - URL: project URLs via gitweb.url

expecting success: gitweb_run "p=.git;a=summary"
ok 94 - URL: project URLs via cloneurl file

expecting success: gitweb_run
ok 95 - config override: projects list (implicit)

expecting success: gitweb_run "p=.git;a=tree"
ok 96 - config override: tree view, features not overridden in repo config

expecting success: git config gitweb.blame no &&
	 git config gitweb.snapshot none &&
	 git config gitweb.avatar gravatar &&
	 gitweb_run "p=.git;a=tree"
ok 97 - config override: tree view, features disabled in repo config

expecting success: git config gitweb.blame yes &&
	 git config gitweb.snapshot "zip,tgz, tbz2" &&
	 gitweb_run "p=.git;a=tree"
ok 98 - config override: tree view, features enabled in repo config (1)

expecting success: gitweb_run "p=.git;a=tree"
ok 99 - config override: tree view, features enabled in repo config (2)

expecting success: echo "1st MATCH" >>file &&
	 echo "2nd MATCH" >>file &&
	 echo "MATCH" >>bar &&
	 git add file bar &&
	 git commit -m "Added MATCH word"
[master 8819ed1] Added MATCH word
 Author: A U Thor <author@example.com>
 2 files changed, 3 insertions(+)
ok 100 - search: preparation

expecting success: gitweb_run "p=.git;a=search;h=HEAD;st=author;s=A+U+Thor"
ok 101 - search: commit author

expecting success: gitweb_run "p=.git;a=search;h=HEAD;st=commitr;s=MATCH"
ok 102 - search: commit message

expecting success: gitweb_run "p=.git;a=search;h=HEAD;st=grep;s=MATCH"
ok 103 - search: grep

expecting success: gitweb_run "p=.git;a=search;h=HEAD;st=pickaxe;s=MATCH"
ok 104 - search: pickaxe

expecting success: gitweb_run "a=project_list;s=.git"
ok 105 - search: projects

expecting success: echo "<b>UTF-8 example:</b><br />" > .git/README.html &&
	 cat "$TEST_DIRECTORY"/t3900/1-UTF-8.txt >> .git/README.html &&
	 gitweb_run "p=.git;a=summary"
ok 106 - README.html with non-ASCII characters (utf-8)

Skipping syntax highlighting tests: 'highlight' not found
skipping test: syntax highlighting (no highlight, unknown syntax) git config gitweb.highlight yes &&
	 gitweb_run "p=.git;a=blob;f=file"
ok 107 # skip syntax highlighting (no highlight, unknown syntax) (missing HIGHLIGHT)

skipping test: syntax highlighting (highlighted, shell script) git config gitweb.highlight yes &&
	 echo "#!/usr/bin/sh" > test.sh &&
	 git add test.sh &&
	 git commit -m "Add test.sh" &&
	 gitweb_run "p=.git;a=blob;f=test.sh"
ok 108 # skip syntax highlighting (highlighted, shell script) (missing HIGHLIGHT)

expecting success: git init --bare foo.git &&
	 git --git-dir=foo.git --work-tree=. add file &&
	 git --git-dir=foo.git --work-tree=. commit -m "Initial commit" &&
	 echo "foo" > foo.git/description &&
	 mkdir -p foo &&
	 (cd foo &&
	  git clone --shared --bare ../foo.git foo-forked.git &&
	  echo "fork of foo" > foo-forked.git/description)
Initialized empty Git repository in /«PKGBUILDDIR»/t/trash directory.t9500-gitweb-standalone-no-errors/foo.git/
[master (root-commit) 438de01] Initial commit
 Author: A U Thor <author@example.com>
 1 file changed, 5 insertions(+)
 create mode 100644 file
Cloning into bare repository 'foo-forked.git'...
done.
ok 109 - forks: prepare

expecting success: gitweb_run
ok 110 - forks: projects list

expecting success: gitweb_run "p=foo.git;a=forks"
ok 111 - forks: forks action

expecting success: mkdir .git/ctags &&
	 echo "2" > .git/ctags/foo &&
	 echo "1" > .git/ctags/bar &&
	gitweb_run
ok 112 - ctags: tag cloud in projects list

expecting success: gitweb_run "by_tag=foo"
ok 113 - ctags: search projects by existing tag

expecting success: gitweb_run "by_tag=non-existent"
ok 114 - ctags: search projects by non existent tag

expecting success: mkdir -p .git/ctags &&
	 echo "not-a-number" > .git/ctags/nan &&
	 echo "not-a-number-2" > .git/ctags/nan2 &&
	 echo "0.1" >.git/ctags/floating-point &&
	 gitweb_run
ok 115 - ctags: malformed tag weights

expecting success: echo "\$projects_list_group_categories = 1;" >>gitweb_config.perl &&
	 gitweb_run
ok 116 - categories: projects list, only default category

expecting success: {
		git checkout orphan_branch ||
		git checkout --orphan orphan_branch
	 } &&
	 test_when_finished "git checkout master" &&
	 gitweb_run "p=.git;a=summary"
error: pathspec 'orphan_branch' did not match any file(s) known to git.
Switched to a new branch 'orphan_branch'
Switched to branch 'master'
ok 117 - unborn HEAD: "summary" page (with "heads" subview)

# passed all 117 test(s)
1..117
/usr/bin/make aggregate-results
make[4]: Entering directory '/«PKGBUILDDIR»/t'
for f in 'test-results'/t*-*.counts; do \
	echo "$f"; \
done | '/bin/sh' ./aggregate-results.sh
fixed   0
success 13216
failed  0
broken  193
total   13472
make[4]: Leaving directory '/«PKGBUILDDIR»/t'
/usr/bin/make clean
make[4]: Entering directory '/«PKGBUILDDIR»/t'
rm -f -r 'trash directory'.* 'test-results'
rm -f -r valgrind/bin
rm -f .prove
make[4]: Leaving directory '/«PKGBUILDDIR»/t'
make[3]: Leaving directory '/«PKGBUILDDIR»/t'
make[2]: Leaving directory '/«PKGBUILDDIR»/t'
make[1]: Leaving directory '/«PKGBUILDDIR»'
test -z 'test' || \
  DESTDIR='/«PKGBUILDDIR»/debian/git' /usr/bin/make -C contrib/subtree 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 -C contrib/subtree 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»/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»'
/usr/bin/make -C t/ test
make[2]: Entering directory '/«PKGBUILDDIR»/contrib/subtree/t'
rm -f -r test-results
/usr/bin/make aggregate-results-and-cleanup
make[3]: Entering directory '/«PKGBUILDDIR»/contrib/subtree/t'
*** t7900-subtree.sh ***
ok 1 - init subproj
ok 2 - add sub1
ok 3 - add sub2
ok 4 - add sub3
ok 5 - enable log.date=relative to catch errors
ok 6 - add main4
ok 7 - fetch subproj history
ok 8 - no subtree exists in main tree
ok 9 - no pull from non-existant subtree
ok 10 - check if --message works for add
ok 11 - check if --message works as -m and --prefix as -P
ok 12 - check if --message works with squash too
ok 13 - add subproj to mainline
ok 14 - merge fetched subproj
ok 15 - add main-sub5
ok 16 - add main6
ok 17 - add main-sub7
ok 18 - fetch new subproj history
ok 19 - check if --message works for merge
ok 20 - check if --message for merge works with squash too
ok 21 - merge new subproj history into subdir
ok 22 - Check that prefix argument is required for split
ok 23 - Check that the <prefix> exists for a split
ok 24 - check if --message works for split+rejoin
ok 25 - check split with --branch
ok 26 - check hash of split
ok 27 - check split with --branch for an existing branch
ok 28 - check split with --branch for an incompatible branch
ok 29 - check split+rejoin
ok 30 - add main-sub8
ok 31 - merge split into subproj
ok 32 - add sub9
ok 33 - split for sub8
ok 34 - add main-sub10
ok 35 - split for sub10
ok 36 - merge split into subproj
ok 37 - make sure exactly the right set of files ends up in the subproj
ok 38 - make sure the subproj history *only* contains commits that affect the subdir
ok 39 - pull from subproj
ok 40 - make sure exactly the right set of files ends up in the mainline
ok 41 - make sure each filename changed exactly once in the entire history
ok 42 - make sure the --rejoin commits never make it into subproj
ok 43 - make sure no "git subtree" tagged commits make it into subproj
ok 44 - init main
ok 45 - add main1
ok 46 - init sub
ok 47 - add sub2
ok 48 - add sub as subdir in main
ok 49 - add sub3
ok 50 - merge from sub
ok 51 - add main-sub4
ok 52 - split for main-sub4 without --onto
ok 53 - check that the commit parent is sub3
ok 54 - add main-sub5
ok 55 - split for main-sub5 without --onto
ok 56 - verify one file change per commit
# passed all 56 test(s)
1..56
/usr/bin/make aggregate-results
make[4]: Entering directory '/«PKGBUILDDIR»/contrib/subtree/t'
for f in ../../../t/test-results/t*-*.counts; do \
	echo "$f"; \
done | '/bin/sh' ../../../t/aggregate-results.sh
fixed   0
success 56
failed  0
broken  0
total   56
make[4]: Leaving directory '/«PKGBUILDDIR»/contrib/subtree/t'
/usr/bin/make clean
make[4]: Entering directory '/«PKGBUILDDIR»/contrib/subtree/t'
rm -f -r 'trash directory'.* test-results
rm -f -r valgrind/bin
rm -f .prove
make[4]: Leaving directory '/«PKGBUILDDIR»/contrib/subtree/t'
make[3]: Leaving directory '/«PKGBUILDDIR»/contrib/subtree/t'
make[2]: Leaving directory '/«PKGBUILDDIR»/contrib/subtree/t'
make[1]: Leaving directory '/«PKGBUILDDIR»/contrib/subtree'
touch build-arch-stamp
 fakeroot debian/rules binary-arch
# git
rm -rf '/«PKGBUILDDIR»/debian/git'
install -d -m0755 '/«PKGBUILDDIR»/debian/git'/usr/bin
DESTDIR='/«PKGBUILDDIR»/debian/git' /usr/bin/make install 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»'
    GEN git-add--interactive
    GEN git-difftool
    GEN git-archimport
    GEN git-cvsexportcommit
    GEN git-cvsimport
    GEN git-cvsserver
    GEN git-relink
    GEN git-send-email
    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'
install -d -m 755 '/«PKGBUILDDIR»/debian/git/usr/bin'
install -d -m 755 '/«PKGBUILDDIR»/debian/git/usr/lib/git-core'
install   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-bisect git-difftool--helper git-filter-branch git-merge-octopus git-merge-one-file git-merge-resolve git-mergetool 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 '/«PKGBUILDDIR»/debian/git/usr/lib/git-core'
install -m 644  git-mergetool--lib git-parse-remote git-rebase--am git-rebase--interactive git-rebase--merge git-sh-setup git-sh-i18n '/«PKGBUILDDIR»/debian/git/usr/lib/git-core'
install git git-upload-pack git-receive-pack git-upload-archive git-shell git-cvsserver '/«PKGBUILDDIR»/debian/git/usr/bin'
/usr/bin/make -C templates DESTDIR='/«PKGBUILDDIR»/debian/git' install
make[2]: Entering directory '/«PKGBUILDDIR»/templates'
install -d -m 755 '/«PKGBUILDDIR»/debian/git/usr/share/git-core/templates'
(cd blt && tar cf - .) | \
(cd '/«PKGBUILDDIR»/debian/git/usr/share/git-core/templates' && umask 022 && tar xof -)
make[2]: Leaving directory '/«PKGBUILDDIR»/templates'
install -d -m 755 '/«PKGBUILDDIR»/debian/git/usr/lib/git-core/mergetools'
install -m 644 mergetools/* '/«PKGBUILDDIR»/debian/git/usr/lib/git-core/mergetools'
install -d -m 755 '/«PKGBUILDDIR»/debian/git/usr/share/locale'
(cd po/build/locale && tar cf - .) | \
(cd '/«PKGBUILDDIR»/debian/git/usr/share/locale' && umask 022 && tar xof -)
/usr/bin/make -C perl prefix='/usr' DESTDIR='/«PKGBUILDDIR»/debian/git' install
make[2]: Entering directory '/«PKGBUILDDIR»/perl'
make[3]: Entering directory '/«PKGBUILDDIR»/perl'
Installing /«PKGBUILDDIR»/debian/git/usr/share/perl5/Git.pm
Installing /«PKGBUILDDIR»/debian/git/usr/share/perl5/Error.pm
Installing /«PKGBUILDDIR»/debian/git/usr/share/perl5/Git/I18N.pm
Installing /«PKGBUILDDIR»/debian/git/usr/share/perl5/Git/SVN.pm
Installing /«PKGBUILDDIR»/debian/git/usr/share/perl5/Git/IndexInfo.pm
Installing /«PKGBUILDDIR»/debian/git/usr/share/perl5/Git/SVN/GlobSpec.pm
Installing /«PKGBUILDDIR»/debian/git/usr/share/perl5/Git/SVN/Editor.pm
Installing /«PKGBUILDDIR»/debian/git/usr/share/perl5/Git/SVN/Fetcher.pm
Installing /«PKGBUILDDIR»/debian/git/usr/share/perl5/Git/SVN/Migration.pm
Installing /«PKGBUILDDIR»/debian/git/usr/share/perl5/Git/SVN/Log.pm
Installing /«PKGBUILDDIR»/debian/git/usr/share/perl5/Git/SVN/Ra.pm
Installing /«PKGBUILDDIR»/debian/git/usr/share/perl5/Git/SVN/Prompt.pm
Installing /«PKGBUILDDIR»/debian/git/usr/share/perl5/Git/SVN/Utils.pm
Installing /«PKGBUILDDIR»/debian/git/usr/share/perl5/Git/SVN/Memoize/YAML.pm
Installing /«PKGBUILDDIR»/debian/git/usr/share/man/man3/Git.3pm
Installing /«PKGBUILDDIR»/debian/git/usr/share/man/man3/Git::I18N.3pm
Installing /«PKGBUILDDIR»/debian/git/usr/share/man/man3/Git::SVN::Editor.3pm
Installing /«PKGBUILDDIR»/debian/git/usr/share/man/man3/Git::SVN::Fetcher.3pm
Installing /«PKGBUILDDIR»/debian/git/usr/share/man/man3/Git::SVN::Memoize::YAML.3pm
Installing /«PKGBUILDDIR»/debian/git/usr/share/man/man3/Git::SVN::Prompt.3pm
Installing /«PKGBUILDDIR»/debian/git/usr/share/man/man3/Git::SVN::Ra.3pm
Installing /«PKGBUILDDIR»/debian/git/usr/share/man/man3/Git::SVN::Utils.3pm
Installing /«PKGBUILDDIR»/debian/git/usr/share/man/man3/private-Error.3pm
make[3]: Leaving directory '/«PKGBUILDDIR»/perl'
make[2]: Leaving directory '/«PKGBUILDDIR»/perl'
/usr/bin/make -C gitweb install
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»'
    GEN static/gitweb.js
    GEN gitweb.cgi
install -d -m 755 '/«PKGBUILDDIR»/debian/git/usr/share/gitweb'
install -m 755 gitweb.cgi '/«PKGBUILDDIR»/debian/git/usr/share/gitweb'
install -d -m 755 '/«PKGBUILDDIR»/debian/git/usr/share/gitweb/static'
install -m 644 static/gitweb.js static/gitweb.css static/git-logo.png static/git-favicon.png '/«PKGBUILDDIR»/debian/git/usr/share/gitweb/static'
make[2]: Leaving directory '/«PKGBUILDDIR»/gitweb'
/usr/bin/make -C gitk-git install
make[2]: Entering directory '/«PKGBUILDDIR»/gitk-git'
install -m 755 gitk-wish '/«PKGBUILDDIR»/debian/git/usr/bin'/gitk
install -d -m 755 '/«PKGBUILDDIR»/debian/git/usr/share/gitk/lib/msgs'
install -m 644 po/de.msg '/«PKGBUILDDIR»/debian/git/usr/share/gitk/lib/msgs' &&  install -m 644 po/ja.msg '/«PKGBUILDDIR»/debian/git/usr/share/gitk/lib/msgs' &&  install -m 644 po/ca.msg '/«PKGBUILDDIR»/debian/git/usr/share/gitk/lib/msgs' &&  install -m 644 po/sv.msg '/«PKGBUILDDIR»/debian/git/usr/share/gitk/lib/msgs' &&  install -m 644 po/it.msg '/«PKGBUILDDIR»/debian/git/usr/share/gitk/lib/msgs' &&  install -m 644 po/bg.msg '/«PKGBUILDDIR»/debian/git/usr/share/gitk/lib/msgs' &&  install -m 644 po/fr.msg '/«PKGBUILDDIR»/debian/git/usr/share/gitk/lib/msgs' &&  install -m 644 po/pt_br.msg '/«PKGBUILDDIR»/debian/git/usr/share/gitk/lib/msgs' &&  install -m 644 po/ru.msg '/«PKGBUILDDIR»/debian/git/usr/share/gitk/lib/msgs' &&  install -m 644 po/hu.msg '/«PKGBUILDDIR»/debian/git/usr/share/gitk/lib/msgs' &&  install -m 644 po/vi.msg '/«PKGBUILDDIR»/debian/git/usr/share/gitk/lib/msgs' &&  install -m 644 po/es.msg '/«PKGBUILDDIR»/debian/git/usr/share/gitk/lib/msgs' && true
make[2]: Leaving directory '/«PKGBUILDDIR»/gitk-git'
/usr/bin/make -C git-gui gitexecdir='/usr/lib/git-core' install
make[2]: Entering directory '/«PKGBUILDDIR»/git-gui'
  DEST /«PKGBUILDDIR»/debian/git/usr/lib/git-core
    INSTALL 755 git-gui
    INSTALL 755 git-gui--askpass
    LINK        git-citool -> git-gui
  DEST /«PKGBUILDDIR»/debian/git/usr/share/git-gui/lib
    INSTALL 644 tclIndex
    INSTALL 644 themed.tcl
    INSTALL 644 line.tcl
    INSTALL 644 console.tcl
    INSTALL 644 checkout_op.tcl
    INSTALL 644 transport.tcl
    INSTALL 644 remote_add.tcl
    INSTALL 644 browser.tcl
    INSTALL 644 tools.tcl
    INSTALL 644 branch_checkout.tcl
    INSTALL 644 spellcheck.tcl
    INSTALL 644 status_bar.tcl
    INSTALL 644 diff.tcl
    INSTALL 644 remote.tcl
    INSTALL 644 choose_font.tcl
    INSTALL 644 option.tcl
    INSTALL 644 mergetool.tcl
    INSTALL 644 tools_dlg.tcl
    INSTALL 644 search.tcl
    INSTALL 644 shortcut.tcl
    INSTALL 644 branch_rename.tcl
    INSTALL 644 class.tcl
    INSTALL 644 remote_branch_delete.tcl
    INSTALL 644 choose_repository.tcl
    INSTALL 644 about.tcl
    INSTALL 644 blame.tcl
    INSTALL 644 branch.tcl
    INSTALL 644 win32.tcl
    INSTALL 644 sshkey.tcl
    INSTALL 644 branch_create.tcl
    INSTALL 644 commit.tcl
    INSTALL 644 branch_delete.tcl
    INSTALL 644 index.tcl
    INSTALL 644 encoding.tcl
    INSTALL 644 logo.tcl
    INSTALL 644 date.tcl
    INSTALL 644 choose_rev.tcl
    INSTALL 644 database.tcl
    INSTALL 644 error.tcl
    INSTALL 644 merge.tcl
    INSTALL 644 git-gui.ico
    INSTALL 644 win32_shortcut.js
  DEST /«PKGBUILDDIR»/debian/git/usr/share/git-gui/lib/msgs
    INSTALL 644 pt_br.msg
    INSTALL 644 hu.msg
    INSTALL 644 zh_cn.msg
    INSTALL 644 de.msg
    INSTALL 644 ja.msg
    INSTALL 644 sv.msg
    INSTALL 644 it.msg
    INSTALL 644 ru.msg
    INSTALL 644 fr.msg
    INSTALL 644 el.msg
    INSTALL 644 vi.msg
    INSTALL 644 bg.msg
    INSTALL 644 nb.msg
make[2]: Leaving directory '/«PKGBUILDDIR»/git-gui'
bindir=$(cd '/«PKGBUILDDIR»/debian/git/usr/bin' && pwd) && \
execdir=$(cd '/«PKGBUILDDIR»/debian/git/usr/lib/git-core' && pwd) && \
{ test "$bindir/" = "$execdir/" || \
  for p in git git-shell git-upload-pack git-cvsserver; do \
	rm -f "$execdir/$p" && \
	test -z "11" && \
	ln "$bindir/$p" "$execdir/$p" 2>/dev/null || \
	cp "$bindir/$p" "$execdir/$p" || exit; \
  done; \
} && \
for p in git-receive-pack git-upload-archive; do \
	rm -f "$bindir/$p" && \
	test -z "1" && \
	ln "$bindir/git" "$bindir/$p" 2>/dev/null || \
	ln -s "git" "$bindir/$p" 2>/dev/null || \
	cp "$bindir/git" "$bindir/$p" || exit; \
done && \
for p in  git-add git-am 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-pull 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; do \
	rm -f "$execdir/$p" && \
	test -z "1" && \
	ln "$execdir/git" "$execdir/$p" 2>/dev/null || \
	ln -s "git" "$execdir/$p" 2>/dev/null || \
	cp "$execdir/git" "$execdir/$p" || exit; \
done && \
remote_curl_aliases="git-remote-https git-remote-ftp git-remote-ftps" && \
for p in $remote_curl_aliases; do \
	rm -f "$execdir/$p" && \
	test -z "1" && \
	ln "$execdir/git-remote-http" "$execdir/$p" 2>/dev/null || \
	ln -s "git-remote-http" "$execdir/$p" 2>/dev/null || \
	cp "$execdir/git-remote-http" "$execdir/$p" || exit; \
done && \
./check_bindir "z$bindir" "z$execdir" "$bindir/git-add"
make[1]: Leaving directory '/«PKGBUILDDIR»'
DESTDIR='/«PKGBUILDDIR»/debian/git' /usr/bin/make -C contrib/subtree install 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»'
install -d -m 755 /«PKGBUILDDIR»/debian/git/usr/lib/git-core
install -m 755 git-subtree /«PKGBUILDDIR»/debian/git/usr/lib/git-core
make[1]: Leaving directory '/«PKGBUILDDIR»/contrib/subtree'
install -d -m0755 '/«PKGBUILDDIR»/debian/git'/var/lib/git
rm -f '/«PKGBUILDDIR»/debian/git'/usr/share/perl5/Error.pm
rm -rf '/«PKGBUILDDIR»/debian/git'/usr/share/man
chmod 644 '/«PKGBUILDDIR»/debian/git'/usr/share/perl5/Git.pm
find '/«PKGBUILDDIR»/debian/git'/usr/share/perl5/Git -type d | xargs chmod 0755
find '/«PKGBUILDDIR»/debian/git'/usr/share/perl5/Git -type f | xargs chmod 0644
# don't include arch, cvs, p4, svn, email, gui tools, and gitk program
for i in git-archimport git-cvs git-p4 git-svn git-send-email \
 git-gui git-citool; do \
  rm -f '/«PKGBUILDDIR»/debian/git'/usr/lib/git-core/$i*; \
done
rm -f '/«PKGBUILDDIR»/debian/git'/usr/bin/git-cvsserver
rm -f '/«PKGBUILDDIR»/debian/git'/usr/bin/gitk
for i in '/«PKGBUILDDIR»/debian/git'/usr/bin/* '/«PKGBUILDDIR»/debian/git'/usr/lib/git-core/*; do \
  test -d $i || \
  test "`head -c2 $i`" = '#!' || \
  test "`head -c2 $i`" = '# ' || \
  strip -R .comment -R .note $i; \
done
# don't include git-gui's lib
rm -rf '/«PKGBUILDDIR»/debian/git'/usr/share/git-gui/
# don't include gitk's lib
rm -rf '/«PKGBUILDDIR»/debian/git'/usr/share/gitk/
# don't include git-svn's lib
rm -rf '/«PKGBUILDDIR»/debian/git'/usr/share/perl5/Git/SVN*
# bash completion
install -d -m0755 '/«PKGBUILDDIR»/debian/git'/usr/share/bash-completion/completions
install -m0644 contrib/completion/git-completion.bash \
  '/«PKGBUILDDIR»/debian/git'/usr/share/bash-completion/completions/git
ln -s git '/«PKGBUILDDIR»/debian/git'/usr/share/bash-completion/completions/gitk
# bash prompt
install -m0644 contrib/completion/git-prompt.sh \
  '/«PKGBUILDDIR»/debian/git'/usr/lib/git-core/git-sh-prompt
install -d -m0755 '/«PKGBUILDDIR»/debian/git'/etc/bash_completion.d
install -m0644 debian/git-prompt.completion \
  '/«PKGBUILDDIR»/debian/git'/etc/bash_completion.d/git-prompt
# sanity check that #642603 fix is still in place
test $(stat -c%h '/«PKGBUILDDIR»/debian/git'/usr/lib/git-core/git-branch) -le 10
# gitweb
install -d -m0755 '/«PKGBUILDDIR»/debian/git'/usr/share/gitweb
ln -s gitweb.cgi '/«PKGBUILDDIR»/debian/git'/usr/share/gitweb/index.cgi
# contrib hooks
install -d -m0755 '/«PKGBUILDDIR»/debian/git'/usr/share/git-core/contrib/hooks
set -e; for i in contrib/hooks/*; do \
  test "$i" != contrib/hooks/multimail || continue; \
  install -m0755 "$i" \
    '/«PKGBUILDDIR»/debian/git'/usr/share/git-core/contrib/hooks/; \
done
# contrib
install -d -m0755 '/«PKGBUILDDIR»/debian/git'/usr/share/doc/git
cp -R contrib '/«PKGBUILDDIR»/debian/git'/usr/share/doc/git/
rm -rf '/«PKGBUILDDIR»/debian/git'/usr/share/doc/git/contrib/completion
rm -rf '/«PKGBUILDDIR»/debian/git'/usr/share/doc/git/contrib/emacs
rm -rf '/«PKGBUILDDIR»/debian/git'/usr/share/doc/git/contrib/mw-to-git
find '/«PKGBUILDDIR»/debian/git'/usr/share/doc/git/contrib -type f | xargs chmod 0644
find '/«PKGBUILDDIR»/debian/git'/usr/share/doc/git/contrib -type d | xargs chmod 0755
# remove contrib hooks, they are now installed in
# /usr/share/git-core/contrib, keep symlink for backward compatibility
rm -rf '/«PKGBUILDDIR»/debian/git'/usr/share/doc/git/contrib/hooks
ln -s ../../../git-core/contrib/hooks \
  '/«PKGBUILDDIR»/debian/git'/usr/share/doc/git/contrib/
find '/«PKGBUILDDIR»/debian/git'/usr/share/doc/git/ -name .gitignore | xargs rm -f
: implicit
rm: cannot remove 'debian/git/usr/share/doc/git/contrib': Is a directory
: debian/git/usr/share/doc/git/
+ install -m0644 debian/copyright debian/git/usr/share/doc/git/
+ install -m0644 debian/changelog debian/git/usr/share/doc/git/changelog.Debian
+ install -m0644 debian/changelog.upstream debian/git/usr/share/doc/git/changelog
+ install -m0644 README debian/git/usr/share/doc/git/
+ install -d -m0755 debian/git/usr/share/doc/git/RelNotes
+ install -m0644 Documentation/RelNotes/1.5.0.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.0.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.0.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.0.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.0.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.0.6.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.0.7.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.0.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.1.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.1.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.1.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.1.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.1.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.1.6.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.2.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.2.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.2.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.2.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.2.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.3.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.3.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.3.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.3.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.3.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.3.6.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.3.7.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.3.8.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.4.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.4.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.4.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.4.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.4.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.4.6.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.4.7.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.5.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.5.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.5.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.5.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.5.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.5.6.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.6.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.6.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.6.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.6.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.6.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.6.6.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.5.6.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.0.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.0.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.0.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.0.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.0.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.0.6.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.0.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.1.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.1.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.1.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.1.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.2.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.2.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.2.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.2.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.2.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.3.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.3.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.3.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.3.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.4.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.4.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.4.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.4.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.4.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.5.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.5.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.5.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.5.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.5.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.5.6.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.5.7.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.5.8.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.5.9.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.6.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.6.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.6.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.6.6.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.0.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.0.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.0.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.0.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.0.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.0.6.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.0.7.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.0.8.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.0.9.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.0.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.1.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.1.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.1.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.1.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.10.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.10.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.10.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.10.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.10.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.10.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.11.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.11.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.11.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.11.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.11.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.11.6.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.11.7.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.11.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.12.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.12.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.12.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.12.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.12.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.2.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.2.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.2.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.2.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.2.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.3.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.3.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.3.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.3.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.3.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.4.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.4.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.4.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.4.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.4.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.5.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.5.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.5.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.5.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.6.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.6.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.6.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.6.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.6.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.6.6.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.6.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.7.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.7.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.7.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.7.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.7.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.7.6.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.7.7.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.7.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.8.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.8.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.8.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.8.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.8.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.8.6.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.8.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.9.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.9.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.9.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.9.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.9.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.9.6.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.9.7.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.7.9.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.0.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.0.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.0.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.0.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.1.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.1.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.1.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.1.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.1.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.1.6.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.2.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.2.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.2.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.3.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.3.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.3.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.3.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.4.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.4.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.4.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.4.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.4.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.5.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.5.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.5.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.5.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.5.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.5.6.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.8.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.9.0.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.9.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.9.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.9.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.9.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/1.9.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.0.0.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.0.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.0.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.0.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.0.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.0.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.1.0.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.1.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.1.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.1.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.1.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.2.0.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.2.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.2.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.2.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.3.0.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.3.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.3.10.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.3.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.3.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.3.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.3.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.3.6.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.3.7.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.3.8.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.3.9.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.4.0.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.4.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.4.10.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.4.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.4.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.4.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.4.5.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.4.6.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.4.7.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.4.8.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.4.9.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.5.0.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.5.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.5.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.5.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.5.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.6.0.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.6.1.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.6.2.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.6.3.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 Documentation/RelNotes/2.6.4.txt debian/git/usr/share/doc/git/RelNotes/
+ install -m0644 debian/git.README.Debian debian/git/usr/share/doc/git/README.Debian
+ install -m0644 debian/git.README.emacs debian/git/usr/share/doc/git/README.emacs
+ install -m0644 debian/git.README.source debian/git/usr/share/doc/git/README.source
+ install -m0644 debian/git.NEWS.Debian debian/git/usr/share/doc/git/NEWS.Debian
+ gzip -9 debian/git/usr/share/doc/git/NEWS.Debian
: debian/git/usr/share/doc/git/examples/
: debian/git/usr/share/doc/git/ ok
: debian/git/usr/share/lintian/overrides
+ install -m0644 debian/git.lintian-overrides debian/git/usr/share/lintian/overrides/git
: debian/git/usr/share/doc-base
ls: cannot access debian/git.doc-base.*: No such file or directory
: debian/git/usr/share/doc,doc-base,lintian ok
: debian/git/DEBIAN/
+ install -m0644 debian/git.conffiles debian/git/DEBIAN/conffiles
+ install -m0755 debian/git.preinst debian/git/DEBIAN/preinst
+ install -m0755 debian/git.prerm debian/git/DEBIAN/prerm
+ install -m0755 debian/git.postinst debian/git/DEBIAN/postinst
+ install -m0755 debian/git.postrm debian/git/DEBIAN/postrm
: debian/git/DEBIAN/md5sums
: debian/git/DEBIAN/ ok
: git.deb ok
rm -f debian/substvars
dpkg-shlibdeps '/«PKGBUILDDIR»/debian/git'/usr/bin/* '/«PKGBUILDDIR»/debian/git'/usr/lib/git-core/*
objdump: Warning: '/«PKGBUILDDIR»/debian/git/usr/lib/git-core/mergetools' is not an ordinary file
objdump: /«PKGBUILDDIR»/debian/git/usr/lib/git-core/git-mergetool: File format not recognized
objdump: /«PKGBUILDDIR»/debian/git/usr/lib/git-core/git-merge-one-file: File format not recognized
objdump: /«PKGBUILDDIR»/debian/git/usr/lib/git-core/git-relink: File format not recognized
objdump: /«PKGBUILDDIR»/debian/git/usr/lib/git-core/git-quiltimport: File format not recognized
objdump: /«PKGBUILDDIR»/debian/git/usr/lib/git-core/git-stash: File format not recognized
objdump: /«PKGBUILDDIR»/debian/git/usr/lib/git-core/git-mergetool--lib: File format not recognized
objdump: /«PKGBUILDDIR»/debian/git/usr/lib/git-core/git-subtree: File format not recognized
objdump: /«PKGBUILDDIR»/debian/git/usr/lib/git-core/git-merge-octopus: File format not recognized
objdump: /«PKGBUILDDIR»/debian/git/usr/lib/git-core/git-sh-setup: File format not recognized
objdump: /«PKGBUILDDIR»/debian/git/usr/lib/git-core/git-difftool: File format not recognized
objdump: /«PKGBUILDDIR»/debian/git/usr/lib/git-core/git-difftool--helper: File format not recognized
objdump: /«PKGBUILDDIR»/debian/git/usr/lib/git-core/git-add--interactive: File format not recognized
objdump: /«PKGBUILDDIR»/debian/git/usr/lib/git-core/git-rebase--interactive: File format not recognized
objdump: /«PKGBUILDDIR»/debian/git/usr/lib/git-core/git-sh-i18n: File format not recognized
objdump: /«PKGBUILDDIR»/debian/git/usr/lib/git-core/git-filter-branch: File format not recognized
objdump: /«PKGBUILDDIR»/debian/git/usr/lib/git-core/git-instaweb: File format not recognized
objdump: /«PKGBUILDDIR»/debian/git/usr/lib/git-core/git-rebase: File format not recognized
objdump: /«PKGBUILDDIR»/debian/git/usr/lib/git-core/git-rebase--merge: File format not recognized
objdump: /«PKGBUILDDIR»/debian/git/usr/lib/git-core/git-sh-prompt: File format not recognized
objdump: /«PKGBUILDDIR»/debian/git/usr/lib/git-core/git-merge-resolve: File format not recognized
objdump: /«PKGBUILDDIR»/debian/git/usr/lib/git-core/git-request-pull: File format not recognized
objdump: /«PKGBUILDDIR»/debian/git/usr/lib/git-core/git-web--browse: File format not recognized
objdump: /«PKGBUILDDIR»/debian/git/usr/lib/git-core/git-submodule: File format not recognized
objdump: /«PKGBUILDDIR»/debian/git/usr/lib/git-core/git-parse-remote: File format not recognized
objdump: /«PKGBUILDDIR»/debian/git/usr/lib/git-core/git-bisect: File format not recognized
objdump: /«PKGBUILDDIR»/debian/git/usr/lib/git-core/git-rebase--am: File format not recognized
dpkg-gencontrol -isp -pgit -P'/«PKGBUILDDIR»/debian/git'
dpkg-gencontrol: warning: -isp is deprecated; it is without effect
dpkg-gencontrol: warning: File::FcntlLock not available; using flock which is not NFS-safe
dpkg -b '/«PKGBUILDDIR»/debian/git' ..
dpkg-deb: building package 'git' in '../git_2.6.4-1_armhf.deb'.
 dpkg-genchanges -B -mRaspbian nitrogen6x test autobuilder <root@raspbian.org> >../git_2.6.4-1_armhf.changes
dpkg-genchanges: binary-only arch-specific upload (source code and arch-indep packages not included)
 dpkg-source --after-build git-2.6.4
dpkg-buildpackage: binary-only upload (no source included)
────────────────────────────────────────────────────────────────────────────────
Build finished at 20151216-1128

Finished
────────

I: Built successfully

┌──────────────────────────────────────────────────────────────────────────────┐
│ Post Build Chroot                                                            │
└──────────────────────────────────────────────────────────────────────────────┘


┌──────────────────────────────────────────────────────────────────────────────┐
│ Changes                                                                      │
└──────────────────────────────────────────────────────────────────────────────┘


git_2.6.4-1_armhf.changes:
──────────────────────────

Format: 1.8
Date: Thu, 10 Dec 2015 16:07:19 -0800
Source: git
Binary: git git-man git-core git-doc git-arch git-cvs git-svn git-mediawiki git-email git-daemon-run git-daemon-sysvinit git-gui gitk git-el gitweb git-all
Architecture: armhf
Version: 1:2.6.4-1
Distribution: stretch-staging
Urgency: medium
Maintainer: Raspbian nitrogen6x test autobuilder <root@raspbian.org>
Changed-By: Jonathan Nieder <jrnieder@gmail.com>
Description:
 git        - fast, scalable, distributed revision control system
 git-all    - fast, scalable, distributed revision control system (all subpacka
 git-arch   - fast, scalable, distributed revision control system (arch interop
 git-core   - fast, scalable, distributed revision control system (obsolete)
 git-cvs    - fast, scalable, distributed revision control system (cvs interope
 git-daemon-run - fast, scalable, distributed revision control system (git-daemon s
 git-daemon-sysvinit - fast, scalable, distributed revision control system (git-daemon s
 git-doc    - fast, scalable, distributed revision control system (documentatio
 git-el     - fast, scalable, distributed revision control system (emacs suppor
 git-email  - fast, scalable, distributed revision control system (email add-on
 git-gui    - fast, scalable, distributed revision control system (GUI)
 git-man    - fast, scalable, distributed revision control system (manual pages
 git-mediawiki - fast, scalable, distributed revision control system (MediaWiki in
 git-svn    - fast, scalable, distributed revision control system (svn interope
 gitk       - fast, scalable, distributed revision control system (revision tre
 gitweb     - fast, scalable, distributed revision control system (web interfac
Changes:
 git (1:2.6.4-1) unstable; urgency=medium
 .
   * new upstream point release (see RelNotes/2.6.4.txt).
Checksums-Sha1:
 9603ff3966d4992a2b55fe212b7db3e9dc1c3c34 3012732 git_2.6.4-1_armhf.deb
Checksums-Sha256:
 c2dfcdeff52d1361fbbb3d4d7e8da6c8c463718779ef9d9a186b11ec2044b81c 3012732 git_2.6.4-1_armhf.deb
Files:
 be1f648991ad76953429e3727205a9b8 3012732 vcs optional git_2.6.4-1_armhf.deb

┌──────────────────────────────────────────────────────────────────────────────┐
│ Package contents                                                             │
└──────────────────────────────────────────────────────────────────────────────┘


git_2.6.4-1_armhf.deb
─────────────────────

 new debian package, version 2.0.
 size 3012732 bytes: control archive=15995 bytes.
      34 bytes,     1 lines      conffiles            
    1693 bytes,    29 lines      control              
   35809 bytes,   481 lines      md5sums              
    1570 bytes,    45 lines   *  postinst             #!/bin/sh
    1080 bytes,    35 lines   *  postrm               #!/bin/sh
    3143 bytes,    98 lines   *  preinst              #!/bin/sh
     478 bytes,    12 lines   *  prerm                #!/bin/sh
 Package: git
 Version: 1:2.6.4-1
 Architecture: armhf
 Maintainer: Gerrit Pape <pape@smarden.org>
 Installed-Size: 21135
 Depends: libc6 (>= 2.16), libcurl3-gnutls (>= 7.16.2), libexpat1 (>= 2.0.1), libpcre3 (>= 1:8.35), zlib1g (>= 1:1.2.0), perl-modules, liberror-perl, git-man (>> 1:2.6.4), git-man (<< 1:2.6.4-.)
 Recommends: patch, less, rsync, ssh-client
 Suggests: gettext-base, git-daemon-run | git-daemon-sysvinit, git-doc, git-el, git-email, git-gui, gitk, gitweb, git-arch, git-cvs, git-mediawiki, git-svn
 Breaks: bash-completion (<< 1:1.90-1), cogito (<= 0.18.2+), git-buildpackage (<< 0.6.5), git-core (<< 1:1.7.0.4-1.), gitosis (<< 0.2+20090917-7), gitpkg (<< 0.15), gitweb (<< 1:1.7.4~rc1), guilt (<< 0.33), stgit (<< 0.15), stgit-contrib (<< 0.15)
 Replaces: git-core (<< 1:1.7.0.4-1.), gitweb (<< 1:1.7.4~rc1)
 Provides: git-completion, git-core
 Section: vcs
 Priority: optional
 Multi-Arch: foreign
 Homepage: http://git-scm.com/
 Description: fast, scalable, distributed revision control system
  Git is popular version control system designed to handle very large
  projects with speed and efficiency; it is used for many high profile
  open source projects, most notably the Linux kernel.
  .
  Git falls in the category of distributed source code management tools.
  Every Git working directory is a full-fledged repository with full
  revision tracking capabilities, not dependent on network access or a
  central server.
  .
  This package provides the git main components with minimal dependencies.
  Additional functionality, e.g. a graphical user interface and revision
  tree visualizer, tools for interoperating with other VCS's, or a web
  interface, is provided as separate git* packages.

drwxr-xr-x root/root         0 2015-12-16 11:25 ./
drwxr-xr-x root/root         0 2015-12-16 11:25 ./etc/
drwxr-xr-x root/root         0 2015-12-16 11:25 ./etc/bash_completion.d/
-rw-r--r-- root/root       439 2015-12-16 11:25 ./etc/bash_completion.d/git-prompt
drwxr-xr-x root/root         0 2015-12-16 11:24 ./usr/
drwxr-xr-x root/root         0 2015-12-16 11:24 ./usr/bin/
-rwxr-xr-x root/root   1545432 2015-12-16 11:24 ./usr/bin/git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/bin/git-receive-pack -> git
-rwxr-xr-x root/root    718216 2015-12-16 11:24 ./usr/bin/git-shell
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/bin/git-upload-archive -> git
-rwxr-xr-x root/root    792180 2015-12-16 11:24 ./usr/bin/git-upload-pack
drwxr-xr-x root/root         0 2015-12-16 11:24 ./usr/lib/
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/lib/git-core/
-rwxr-xr-x root/root   1545432 2015-12-16 11:25 ./usr/lib/git-core/git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-add -> git
-rwxr-xr-x root/root     37051 2015-12-16 11:24 ./usr/lib/git-core/git-add--interactive
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-am -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-annotate -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-apply -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-archive -> git
-rwxr-xr-x root/root     13692 2015-12-16 11:24 ./usr/lib/git-core/git-bisect
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-bisect--helper -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-blame -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-branch -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-bundle -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-cat-file -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-check-attr -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-check-ignore -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-check-mailmap -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-check-ref-format -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-checkout -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-checkout-index -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-cherry -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-cherry-pick -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-clean -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-clone -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-column -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-commit -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-commit-tree -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-config -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-count-objects -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-credential -> git
-rwxr-xr-x root/root    718160 2015-12-16 11:24 ./usr/lib/git-core/git-credential-cache
-rwxr-xr-x root/root    726416 2015-12-16 11:24 ./usr/lib/git-core/git-credential-cache--daemon
-rwxr-xr-x root/root    722276 2015-12-16 11:24 ./usr/lib/git-core/git-credential-store
-rwxr-xr-x root/root    796328 2015-12-16 11:24 ./usr/lib/git-core/git-daemon
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-describe -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-diff -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-diff-files -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-diff-index -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-diff-tree -> git
-rwxr-xr-x root/root     13545 2015-12-16 11:24 ./usr/lib/git-core/git-difftool
-rwxr-xr-x root/root      2100 2015-12-16 11:24 ./usr/lib/git-core/git-difftool--helper
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-fast-export -> git
-rwxr-xr-x root/root    755276 2015-12-16 11:24 ./usr/lib/git-core/git-fast-import
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-fetch -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-fetch-pack -> git
-rwxr-xr-x root/root     11876 2015-12-16 11:24 ./usr/lib/git-core/git-filter-branch
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-fmt-merge-msg -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-for-each-ref -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-format-patch -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-fsck -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-fsck-objects -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-gc -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-get-tar-commit-id -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-grep -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-hash-object -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-help -> git
-rwxr-xr-x root/root    726508 2015-12-16 11:25 ./usr/lib/git-core/git-http-backend
-rwxr-xr-x root/root    816900 2015-12-16 11:25 ./usr/lib/git-core/git-http-fetch
-rwxr-xr-x root/root    829220 2015-12-16 11:25 ./usr/lib/git-core/git-http-push
-rwxr-xr-x root/root    821212 2015-12-16 11:25 ./usr/lib/git-core/git-imap-send
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-index-pack -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-init -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-init-db -> git
-rwxr-xr-x root/root     18546 2015-12-16 11:24 ./usr/lib/git-core/git-instaweb
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-interpret-trailers -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-log -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-ls-files -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-ls-remote -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-ls-tree -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-mailinfo -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-mailsplit -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-merge -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-merge-base -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-merge-file -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-merge-index -> git
-rwxr-xr-x root/root      2207 2015-12-16 11:24 ./usr/lib/git-core/git-merge-octopus
-rwxr-xr-x root/root      3707 2015-12-16 11:24 ./usr/lib/git-core/git-merge-one-file
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-merge-ours -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-merge-recursive -> git
-rwxr-xr-x root/root       944 2015-12-16 11:24 ./usr/lib/git-core/git-merge-resolve
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-merge-subtree -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-merge-tree -> git
-rwxr-xr-x root/root      9314 2015-12-16 11:24 ./usr/lib/git-core/git-mergetool
-rw-r--r-- root/root      7433 2015-12-16 11:24 ./usr/lib/git-core/git-mergetool--lib
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-mktag -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-mktree -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-mv -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-name-rev -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-notes -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-pack-objects -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-pack-redundant -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-pack-refs -> git
-rw-r--r-- root/root      2313 2015-12-16 11:24 ./usr/lib/git-core/git-parse-remote
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-patch-id -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-prune -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-prune-packed -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-pull -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-push -> git
-rwxr-xr-x root/root      3368 2015-12-16 11:24 ./usr/lib/git-core/git-quiltimport
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-read-tree -> git
-rwxr-xr-x root/root     16116 2015-12-16 11:24 ./usr/lib/git-core/git-rebase
-rw-r--r-- root/root      2449 2015-12-16 11:24 ./usr/lib/git-core/git-rebase--am
-rw-r--r-- root/root     34181 2015-12-16 11:24 ./usr/lib/git-core/git-rebase--interactive
-rw-r--r-- root/root      3806 2015-12-16 11:24 ./usr/lib/git-core/git-rebase--merge
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-receive-pack -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-reflog -> git
-rwxr-xr-x root/root      4198 2015-12-16 11:24 ./usr/lib/git-core/git-relink
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-remote -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-remote-ext -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-remote-fd -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-remote-ftp -> git-remote-http
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-remote-ftps -> git-remote-http
-rwxr-xr-x root/root    825128 2015-12-16 11:25 ./usr/lib/git-core/git-remote-http
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-remote-https -> git-remote-http
-rwxr-xr-x root/root    734604 2015-12-16 11:25 ./usr/lib/git-core/git-remote-testsvn
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-repack -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-replace -> git
-rwxr-xr-x root/root      3861 2015-12-16 11:24 ./usr/lib/git-core/git-request-pull
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-rerere -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-reset -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-rev-list -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-rev-parse -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-revert -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-rm -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-send-pack -> git
-rw-r--r-- root/root      1972 2015-12-16 11:24 ./usr/lib/git-core/git-sh-i18n
-rwxr-xr-x root/root    718144 2015-12-16 11:25 ./usr/lib/git-core/git-sh-i18n--envsubst
-rw-r--r-- root/root     16102 2015-12-16 11:25 ./usr/lib/git-core/git-sh-prompt
-rw-r--r-- root/root      8306 2015-12-16 11:24 ./usr/lib/git-core/git-sh-setup
-rwxr-xr-x root/root    718216 2015-12-16 11:25 ./usr/lib/git-core/git-shell
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-shortlog -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-show -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-show-branch -> git
-rwxr-xr-x root/root    718164 2015-12-16 11:25 ./usr/lib/git-core/git-show-index
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-show-ref -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-stage -> git
-rwxr-xr-x root/root     13824 2015-12-16 11:24 ./usr/lib/git-core/git-stash
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-status -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-stripspace -> git
-rwxr-xr-x root/root     32601 2015-12-16 11:24 ./usr/lib/git-core/git-submodule
-rwxr-xr-x root/root     15761 2015-12-16 11:24 ./usr/lib/git-core/git-subtree
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-symbolic-ref -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-tag -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-unpack-file -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-unpack-objects -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-update-index -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-update-ref -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-update-server-info -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-upload-archive -> git
-rwxr-xr-x root/root    792180 2015-12-16 11:25 ./usr/lib/git-core/git-upload-pack
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-var -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-verify-commit -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-verify-pack -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-verify-tag -> git
-rwxr-xr-x root/root      4401 2015-12-16 11:24 ./usr/lib/git-core/git-web--browse
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-whatchanged -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-worktree -> git
lrwxrwxrwx root/root         0 2015-12-16 11:24 ./usr/lib/git-core/git-write-tree -> git
drwxr-xr-x root/root         0 2015-12-16 11:24 ./usr/lib/git-core/mergetools/
-rw-r--r-- root/root       392 2015-12-16 11:24 ./usr/lib/git-core/mergetools/araxis
-rw-r--r-- root/root       401 2015-12-16 11:24 ./usr/lib/git-core/mergetools/bc
-rw-r--r-- root/root        24 2015-12-16 11:24 ./usr/lib/git-core/mergetools/bc3
-rw-r--r-- root/root       387 2015-12-16 11:24 ./usr/lib/git-core/mergetools/codecompare
-rw-r--r-- root/root       628 2015-12-16 11:24 ./usr/lib/git-core/mergetools/deltawalker
-rw-r--r-- root/root       275 2015-12-16 11:24 ./usr/lib/git-core/mergetools/diffmerge
-rw-r--r-- root/root       282 2015-12-16 11:24 ./usr/lib/git-core/mergetools/diffuse
-rw-r--r-- root/root       340 2015-12-16 11:24 ./usr/lib/git-core/mergetools/ecmerge
-rw-r--r-- root/root       404 2015-12-16 11:24 ./usr/lib/git-core/mergetools/emerge
-rw-r--r-- root/root        29 2015-12-16 11:24 ./usr/lib/git-core/mergetools/gvimdiff
-rw-r--r-- root/root        29 2015-12-16 11:24 ./usr/lib/git-core/mergetools/gvimdiff2
-rw-r--r-- root/root        29 2015-12-16 11:24 ./usr/lib/git-core/mergetools/gvimdiff3
-rw-r--r-- root/root       488 2015-12-16 11:24 ./usr/lib/git-core/mergetools/kdiff3
-rw-r--r-- root/root        83 2015-12-16 11:24 ./usr/lib/git-core/mergetools/kompare
-rw-r--r-- root/root       876 2015-12-16 11:24 ./usr/lib/git-core/mergetools/meld
-rw-r--r-- root/root       301 2015-12-16 11:24 ./usr/lib/git-core/mergetools/opendiff
-rw-r--r-- root/root       651 2015-12-16 11:24 ./usr/lib/git-core/mergetools/p4merge
-rw-r--r-- root/root       224 2015-12-16 11:24 ./usr/lib/git-core/mergetools/tkdiff
-rw-r--r-- root/root       638 2015-12-16 11:24 ./usr/lib/git-core/mergetools/tortoisemerge
-rw-r--r-- root/root       878 2015-12-16 11:24 ./usr/lib/git-core/mergetools/vimdiff
-rw-r--r-- root/root        29 2015-12-16 11:24 ./usr/lib/git-core/mergetools/vimdiff2
-rw-r--r-- root/root        29 2015-12-16 11:24 ./usr/lib/git-core/mergetools/vimdiff3
-rw-r--r-- root/root       823 2015-12-16 11:24 ./usr/lib/git-core/mergetools/winmerge
-rw-r--r-- root/root       618 2015-12-16 11:24 ./usr/lib/git-core/mergetools/xxdiff
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/bash-completion/
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/bash-completion/completions/
-rw-r--r-- root/root     56618 2015-12-16 11:25 ./usr/share/bash-completion/completions/git
lrwxrwxrwx root/root         0 2015-12-16 11:25 ./usr/share/bash-completion/completions/gitk -> git
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/doc/
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/doc/git/
-rw-r--r-- root/root      1744 2015-12-16 11:25 ./usr/share/doc/git/NEWS.Debian.gz
-rw-r--r-- root/root      2628 2015-12-16 11:25 ./usr/share/doc/git/README
-rw-r--r-- root/root      2561 2015-12-16 11:25 ./usr/share/doc/git/README.Debian
-rw-r--r-- root/root      1294 2015-12-16 11:25 ./usr/share/doc/git/README.emacs
-rw-r--r-- root/root      3040 2015-12-16 11:25 ./usr/share/doc/git/README.source
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/
-rw-r--r-- root/root      1255 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.0.1.txt
-rw-r--r-- root/root      2308 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.0.2.txt
-rw-r--r-- root/root      1577 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.0.3.txt
-rw-r--r-- root/root       462 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.0.4.txt
-rw-r--r-- root/root       609 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.0.5.txt
-rw-r--r-- root/root       484 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.0.6.txt
-rw-r--r-- root/root       482 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.0.7.txt
-rw-r--r-- root/root     18638 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.0.txt
-rw-r--r-- root/root      2164 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.1.1.txt
-rw-r--r-- root/root      1651 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.1.2.txt
-rw-r--r-- root/root      1566 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.1.3.txt
-rw-r--r-- root/root       843 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.1.4.txt
-rw-r--r-- root/root      1430 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.1.5.txt
-rw-r--r-- root/root      1519 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.1.6.txt
-rw-r--r-- root/root     13288 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.1.txt
-rw-r--r-- root/root      1457 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.2.1.txt
-rw-r--r-- root/root      2086 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.2.2.txt
-rw-r--r-- root/root       796 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.2.3.txt
-rw-r--r-- root/root       802 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.2.4.txt
-rw-r--r-- root/root       928 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.2.5.txt
-rw-r--r-- root/root      7355 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.2.txt
-rw-r--r-- root/root       326 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.3.1.txt
-rw-r--r-- root/root      1931 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.3.2.txt
-rw-r--r-- root/root       896 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.3.3.txt
-rw-r--r-- root/root      1208 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.3.4.txt
-rw-r--r-- root/root      3376 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.3.5.txt
-rw-r--r-- root/root      1432 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.3.6.txt
-rw-r--r-- root/root      1584 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.3.7.txt
-rw-r--r-- root/root       783 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.3.8.txt
-rw-r--r-- root/root     14030 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.3.txt
-rw-r--r-- root/root       524 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.4.1.txt
-rw-r--r-- root/root      1530 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.4.2.txt
-rw-r--r-- root/root       997 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.4.3.txt
-rw-r--r-- root/root      2617 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.4.4.txt
-rw-r--r-- root/root      2241 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.4.5.txt
-rw-r--r-- root/root      1440 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.4.6.txt
-rw-r--r-- root/root       342 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.4.7.txt
-rw-r--r-- root/root     14424 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.4.txt
-rw-r--r-- root/root      1499 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.5.1.txt
-rw-r--r-- root/root       772 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.5.2.txt
-rw-r--r-- root/root       305 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.5.3.txt
-rw-r--r-- root/root       140 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.5.4.txt
-rw-r--r-- root/root       449 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.5.5.txt
-rw-r--r-- root/root       342 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.5.6.txt
-rw-r--r-- root/root      7596 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.5.txt
-rw-r--r-- root/root       793 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.6.1.txt
-rw-r--r-- root/root      1457 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.6.2.txt
-rw-r--r-- root/root      2113 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.6.3.txt
-rw-r--r-- root/root      1573 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.6.4.txt
-rw-r--r-- root/root      1041 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.6.5.txt
-rw-r--r-- root/root       342 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.6.6.txt
-rw-r--r-- root/root      3843 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.5.6.txt
-rw-r--r-- root/root      1188 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.0.1.txt
-rw-r--r-- root/root      2840 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.0.2.txt
-rw-r--r-- root/root      4318 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.0.3.txt
-rw-r--r-- root/root      1293 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.0.4.txt
-rw-r--r-- root/root      2014 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.0.5.txt
-rw-r--r-- root/root      1193 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.0.6.txt
-rw-r--r-- root/root     10049 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.0.txt
-rw-r--r-- root/root      1976 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.1.1.txt
-rw-r--r-- root/root      1640 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.1.2.txt
-rw-r--r-- root/root       847 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.1.3.txt
-rw-r--r-- root/root      1593 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.1.4.txt
-rw-r--r-- root/root     10322 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.1.txt
-rw-r--r-- root/root       597 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.2.1.txt
-rw-r--r-- root/root      1508 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.2.2.txt
-rw-r--r-- root/root       781 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.2.3.txt
-rw-r--r-- root/root      1351 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.2.4.txt
-rw-r--r-- root/root       688 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.2.5.txt
-rw-r--r-- root/root      5892 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.2.txt
-rw-r--r-- root/root       343 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.3.1.txt
-rw-r--r-- root/root      2271 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.3.2.txt
-rw-r--r-- root/root      1379 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.3.3.txt
-rw-r--r-- root/root      1206 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.3.4.txt
-rw-r--r-- root/root      6791 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.3.txt
-rw-r--r-- root/root      1906 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.4.1.txt
-rw-r--r-- root/root      1210 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.4.2.txt
-rw-r--r-- root/root      1146 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.4.3.txt
-rw-r--r-- root/root      1034 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.4.4.txt
-rw-r--r-- root/root       605 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.4.5.txt
-rw-r--r-- root/root      5357 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.4.txt
-rw-r--r-- root/root       549 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.5.1.txt
-rw-r--r-- root/root       581 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.5.2.txt
-rw-r--r-- root/root      2485 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.5.3.txt
-rw-r--r-- root/root      1275 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.5.4.txt
-rw-r--r-- root/root      1891 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.5.5.txt
-rw-r--r-- root/root       791 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.5.6.txt
-rw-r--r-- root/root       771 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.5.7.txt
-rw-r--r-- root/root       900 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.5.8.txt
-rw-r--r-- root/root       581 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.5.9.txt
-rw-r--r-- root/root      6294 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.5.txt
-rw-r--r-- root/root      1230 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.6.1.txt
-rw-r--r-- root/root      1599 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.6.2.txt
-rw-r--r-- root/root       751 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.6.3.txt
-rw-r--r-- root/root      9463 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.6.6.txt
-rw-r--r-- root/root      1287 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.0.1.txt
-rw-r--r-- root/root      1476 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.0.2.txt
-rw-r--r-- root/root      1176 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.0.3.txt
-rw-r--r-- root/root       888 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.0.4.txt
-rw-r--r-- root/root       915 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.0.5.txt
-rw-r--r-- root/root       365 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.0.6.txt
-rw-r--r-- root/root       467 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.0.7.txt
-rw-r--r-- root/root       452 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.0.8.txt
-rw-r--r-- root/root       219 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.0.9.txt
-rw-r--r-- root/root      8765 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.0.txt
-rw-r--r-- root/root      3825 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.1.1.txt
-rw-r--r-- root/root      1069 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.1.2.txt
-rw-r--r-- root/root       452 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.1.3.txt
-rw-r--r-- root/root       219 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.1.4.txt
-rw-r--r-- root/root      2941 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.1.txt
-rw-r--r-- root/root      3074 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.10.1.txt
-rw-r--r-- root/root      3445 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.10.2.txt
-rw-r--r-- root/root      1876 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.10.3.txt
-rw-r--r-- root/root      1056 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.10.4.txt
-rw-r--r-- root/root       397 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.10.5.txt
-rw-r--r-- root/root      9025 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.10.txt
-rw-r--r-- root/root       224 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.11.1.txt
-rw-r--r-- root/root      2291 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.11.2.txt
-rw-r--r-- root/root      2314 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.11.3.txt
-rw-r--r-- root/root      1171 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.11.4.txt
-rw-r--r-- root/root      1292 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.11.5.txt
-rw-r--r-- root/root      3436 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.11.6.txt
-rw-r--r-- root/root      1959 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.11.7.txt
-rw-r--r-- root/root      5506 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.11.txt
-rw-r--r-- root/root      5800 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.12.1.txt
-rw-r--r-- root/root      1767 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.12.2.txt
-rw-r--r-- root/root      1330 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.12.3.txt
-rw-r--r-- root/root       712 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.12.4.txt
-rw-r--r-- root/root      5336 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.12.txt
-rw-r--r-- root/root       806 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.2.1.txt
-rw-r--r-- root/root       695 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.2.2.txt
-rw-r--r-- root/root      1355 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.2.3.txt
-rw-r--r-- root/root       452 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.2.4.txt
-rw-r--r-- root/root       219 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.2.5.txt
-rw-r--r-- root/root      5978 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.2.txt
-rw-r--r-- root/root       425 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.3.1.txt
-rw-r--r-- root/root       149 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.3.2.txt
-rw-r--r-- root/root      2075 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.3.3.txt
-rw-r--r-- root/root      1639 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.3.4.txt
-rw-r--r-- root/root      1454 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.3.5.txt
-rw-r--r-- root/root      2642 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.3.txt
-rw-r--r-- root/root       899 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.4.1.txt
-rw-r--r-- root/root      2290 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.4.2.txt
-rw-r--r-- root/root      1245 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.4.3.txt
-rw-r--r-- root/root      1288 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.4.4.txt
-rw-r--r-- root/root       127 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.4.5.txt
-rw-r--r-- root/root      6502 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.4.txt
-rw-r--r-- root/root      1905 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.5.1.txt
-rw-r--r-- root/root      2189 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.5.2.txt
-rw-r--r-- root/root      1101 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.5.3.txt
-rw-r--r-- root/root       754 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.5.4.txt
-rw-r--r-- root/root      5329 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.5.txt
-rw-r--r-- root/root      2248 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.6.1.txt
-rw-r--r-- root/root       245 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.6.2.txt
-rw-r--r-- root/root       792 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.6.3.txt
-rw-r--r-- root/root      1264 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.6.4.txt
-rw-r--r-- root/root       969 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.6.5.txt
-rw-r--r-- root/root       587 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.6.6.txt
-rw-r--r-- root/root      5507 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.6.txt
-rw-r--r-- root/root      2432 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.7.1.txt
-rw-r--r-- root/root      1630 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.7.2.txt
-rw-r--r-- root/root       696 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.7.3.txt
-rw-r--r-- root/root       444 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.7.4.txt
-rw-r--r-- root/root       481 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.7.5.txt
-rw-r--r-- root/root       791 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.7.6.txt
-rw-r--r-- root/root       334 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.7.7.txt
-rw-r--r-- root/root      5408 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.7.txt
-rw-r--r-- root/root      1438 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.8.1.txt
-rw-r--r-- root/root      2925 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.8.2.txt
-rw-r--r-- root/root       431 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.8.3.txt
-rw-r--r-- root/root       921 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.8.4.txt
-rw-r--r-- root/root       606 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.8.5.txt
-rw-r--r-- root/root       621 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.8.6.txt
-rw-r--r-- root/root      6351 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.8.txt
-rw-r--r-- root/root      2461 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.9.1.txt
-rw-r--r-- root/root      2706 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.9.2.txt
-rw-r--r-- root/root      1958 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.9.3.txt
-rw-r--r-- root/root       887 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.9.4.txt
-rw-r--r-- root/root       731 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.9.5.txt
-rw-r--r-- root/root       432 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.9.6.txt
-rw-r--r-- root/root       371 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.9.7.txt
-rw-r--r-- root/root      4373 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.7.9.txt
-rw-r--r-- root/root      2454 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.0.1.txt
-rw-r--r-- root/root      1250 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.0.2.txt
-rw-r--r-- root/root       424 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.0.3.txt
-rw-r--r-- root/root     11073 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.0.txt
-rw-r--r-- root/root      3577 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.1.1.txt
-rw-r--r-- root/root       991 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.1.2.txt
-rw-r--r-- root/root      1740 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.1.3.txt
-rw-r--r-- root/root       337 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.1.4.txt
-rw-r--r-- root/root      1940 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.1.5.txt
-rw-r--r-- root/root      1563 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.1.6.txt
-rw-r--r-- root/root      9624 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.1.txt
-rw-r--r-- root/root      4561 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.2.1.txt
-rw-r--r-- root/root      2438 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.2.2.txt
-rw-r--r-- root/root       672 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.2.3.txt
-rw-r--r-- root/root     22140 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.2.txt
-rw-r--r-- root/root       433 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.3.1.txt
-rw-r--r-- root/root      2406 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.3.2.txt
-rw-r--r-- root/root      1778 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.3.3.txt
-rw-r--r-- root/root       700 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.3.4.txt
-rw-r--r-- root/root     18336 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.3.txt
-rw-r--r-- root/root      3012 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.4.1.txt
-rw-r--r-- root/root      3294 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.4.2.txt
-rw-r--r-- root/root      2208 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.4.3.txt
-rw-r--r-- root/root       342 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.4.4.txt
-rw-r--r-- root/root       421 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.4.5.txt
-rw-r--r-- root/root     21237 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.4.txt
-rw-r--r-- root/root       254 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.5.1.txt
-rw-r--r-- root/root       656 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.5.2.txt
-rw-r--r-- root/root       859 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.5.3.txt
-rw-r--r-- root/root      1912 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.5.4.txt
-rw-r--r-- root/root      1466 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.5.5.txt
-rw-r--r-- root/root      1686 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.5.6.txt
-rw-r--r-- root/root     20348 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.8.5.txt
-rw-r--r-- root/root     15197 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.9.0.txt
-rw-r--r-- root/root      2409 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.9.1.txt
-rw-r--r-- root/root      2807 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.9.2.txt
-rw-r--r-- root/root       635 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.9.3.txt
-rw-r--r-- root/root       607 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.9.4.txt
-rw-r--r-- root/root      1678 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/1.9.5.txt
-rw-r--r-- root/root     15911 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.0.0.txt
-rw-r--r-- root/root      5171 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.0.1.txt
-rw-r--r-- root/root      1350 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.0.2.txt
-rw-r--r-- root/root       592 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.0.3.txt
-rw-r--r-- root/root       153 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.0.4.txt
-rw-r--r-- root/root      1678 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.0.5.txt
-rw-r--r-- root/root     17336 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.1.0.txt
-rw-r--r-- root/root      1806 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.1.1.txt
-rw-r--r-- root/root       768 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.1.2.txt
-rw-r--r-- root/root       970 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.1.3.txt
-rw-r--r-- root/root      1678 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.1.4.txt
-rw-r--r-- root/root     13338 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.2.0.txt
-rw-r--r-- root/root      1674 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.2.1.txt
-rw-r--r-- root/root      2357 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.2.2.txt
-rw-r--r-- root/root       284 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.2.3.txt
-rw-r--r-- root/root     12859 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.3.0.txt
-rw-r--r-- root/root      1998 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.3.1.txt
-rw-r--r-- root/root       711 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.3.10.txt
-rw-r--r-- root/root      3009 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.3.2.txt
-rw-r--r-- root/root      1522 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.3.3.txt
-rw-r--r-- root/root      1150 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.3.4.txt
-rw-r--r-- root/root      1767 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.3.5.txt
-rw-r--r-- root/root       400 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.3.6.txt
-rw-r--r-- root/root       761 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.3.7.txt
-rw-r--r-- root/root       814 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.3.8.txt
-rw-r--r-- root/root       284 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.3.9.txt
-rw-r--r-- root/root     22110 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.4.0.txt
-rw-r--r-- root/root      1654 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.4.1.txt
-rw-r--r-- root/root       711 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.4.10.txt
-rw-r--r-- root/root      1954 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.4.2.txt
-rw-r--r-- root/root      3067 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.4.3.txt
-rw-r--r-- root/root      1230 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.4.4.txt
-rw-r--r-- root/root      1066 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.4.5.txt
-rw-r--r-- root/root       744 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.4.6.txt
-rw-r--r-- root/root      2213 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.4.7.txt
-rw-r--r-- root/root       704 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.4.8.txt
-rw-r--r-- root/root       284 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.4.9.txt
-rw-r--r-- root/root     26120 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.5.0.txt
-rw-r--r-- root/root      2861 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.5.1.txt
-rw-r--r-- root/root      2654 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.5.2.txt
-rw-r--r-- root/root       565 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.5.3.txt
-rw-r--r-- root/root       709 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.5.4.txt
-rw-r--r-- root/root     16434 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.6.0.txt
-rw-r--r-- root/root       705 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.6.1.txt
-rw-r--r-- root/root      2678 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.6.2.txt
-rw-r--r-- root/root      4904 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.6.3.txt
-rw-r--r-- root/root      2163 2015-12-16 11:25 ./usr/share/doc/git/RelNotes/2.6.4.txt
-rw-r--r-- root/root     34662 2015-12-16 11:25 ./usr/share/doc/git/changelog.Debian.gz
-rw-r--r-- root/root    578520 2015-12-16 11:25 ./usr/share/doc/git/changelog.gz
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/doc/git/contrib/
-rw-r--r-- root/root      2113 2015-12-16 11:25 ./usr/share/doc/git/contrib/README
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/doc/git/contrib/buildsystems/
-rw-r--r-- root/root      1100 2015-12-16 11:25 ./usr/share/doc/git/contrib/buildsystems/Generators.pm
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/doc/git/contrib/buildsystems/Generators/
-rw-r--r-- root/root      5063 2015-12-16 11:25 ./usr/share/doc/git/contrib/buildsystems/Generators/QMake.pm
-rw-r--r-- root/root     16344 2015-12-16 11:25 ./usr/share/doc/git/contrib/buildsystems/Generators/Vcproj.pm
-rw-r--r-- root/root     11033 2015-12-16 11:25 ./usr/share/doc/git/contrib/buildsystems/engine.pl
-rw-r--r-- root/root      1208 2015-12-16 11:25 ./usr/share/doc/git/contrib/buildsystems/generate
-rw-r--r-- root/root      6675 2015-12-16 11:25 ./usr/share/doc/git/contrib/buildsystems/parse.pl
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/doc/git/contrib/contacts/
-rw-r--r-- root/root      1759 2015-12-16 11:25 ./usr/share/doc/git/contrib/contacts/Makefile
-rw-r--r-- root/root      4497 2015-12-16 11:25 ./usr/share/doc/git/contrib/contacts/git-contacts
-rw-r--r-- root/root      2584 2015-12-16 11:25 ./usr/share/doc/git/contrib/contacts/git-contacts.txt
-rw-r--r-- root/root       751 2015-12-16 11:25 ./usr/share/doc/git/contrib/convert-grafts-to-replace-refs.sh
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/doc/git/contrib/convert-objects/
-rw-r--r-- root/root      7436 2015-12-16 11:25 ./usr/share/doc/git/contrib/convert-objects/convert-objects.c
-rw-r--r-- root/root       464 2015-12-16 11:25 ./usr/share/doc/git/contrib/convert-objects/git-convert-objects.txt
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/doc/git/contrib/credential/
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/doc/git/contrib/credential/gnome-keyring/
-rw-r--r-- root/root       459 2015-12-16 11:25 ./usr/share/doc/git/contrib/credential/gnome-keyring/Makefile
-rw-r--r-- root/root     11707 2015-12-16 11:25 ./usr/share/doc/git/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/doc/git/contrib/credential/netrc/
-rw-r--r-- root/root        48 2015-12-16 11:25 ./usr/share/doc/git/contrib/credential/netrc/Makefile
-rw-r--r-- root/root     10285 2015-12-16 11:25 ./usr/share/doc/git/contrib/credential/netrc/git-credential-netrc
-rw-r--r-- root/root       337 2015-12-16 11:25 ./usr/share/doc/git/contrib/credential/netrc/test.netrc
-rw-r--r-- root/root      2950 2015-12-16 11:25 ./usr/share/doc/git/contrib/credential/netrc/test.pl
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/doc/git/contrib/credential/osxkeychain/
-rw-r--r-- root/root       420 2015-12-16 11:25 ./usr/share/doc/git/contrib/credential/osxkeychain/Makefile
-rw-r--r-- root/root      3865 2015-12-16 11:25 ./usr/share/doc/git/contrib/credential/osxkeychain/git-credential-osxkeychain.c
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/doc/git/contrib/credential/wincred/
-rw-r--r-- root/root       438 2015-12-16 11:25 ./usr/share/doc/git/contrib/credential/wincred/Makefile
-rw-r--r-- root/root      7847 2015-12-16 11:25 ./usr/share/doc/git/contrib/credential/wincred/git-credential-wincred.c
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/doc/git/contrib/diff-highlight/
-rw-r--r-- root/root      6674 2015-12-16 11:25 ./usr/share/doc/git/contrib/diff-highlight/README
-rw-r--r-- root/root      5399 2015-12-16 11:25 ./usr/share/doc/git/contrib/diff-highlight/diff-highlight
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/doc/git/contrib/examples/
-rw-r--r-- root/root       167 2015-12-16 11:25 ./usr/share/doc/git/contrib/examples/README
-rw-r--r-- root/root     13055 2015-12-16 11:25 ./usr/share/doc/git/contrib/examples/builtin-fetch--tool.c
-rw-r--r-- root/root     24378 2015-12-16 11:25 ./usr/share/doc/git/contrib/examples/git-am.sh
-rw-r--r-- root/root      7621 2015-12-16 11:25 ./usr/share/doc/git/contrib/examples/git-checkout.sh
-rw-r--r-- root/root      2261 2015-12-16 11:25 ./usr/share/doc/git/contrib/examples/git-clean.sh
-rw-r--r-- root/root     12711 2015-12-16 11:25 ./usr/share/doc/git/contrib/examples/git-clone.sh
-rw-r--r-- root/root     14390 2015-12-16 11:25 ./usr/share/doc/git/contrib/examples/git-commit.sh
-rw-r--r-- root/root      9114 2015-12-16 11:25 ./usr/share/doc/git/contrib/examples/git-fetch.sh
-rw-r--r-- root/root       594 2015-12-16 11:25 ./usr/share/doc/git/contrib/examples/git-gc.sh
-rw-r--r-- root/root       372 2015-12-16 11:25 ./usr/share/doc/git/contrib/examples/git-log.sh
-rw-r--r-- root/root      2546 2015-12-16 11:25 ./usr/share/doc/git/contrib/examples/git-ls-remote.sh
-rw-r--r-- root/root       338 2015-12-16 11:25 ./usr/share/doc/git/contrib/examples/git-merge-ours.sh
-rw-r--r-- root/root     14431 2015-12-16 11:25 ./usr/share/doc/git/contrib/examples/git-merge.sh
-rw-r--r-- root/root      2717 2015-12-16 11:25 ./usr/share/doc/git/contrib/examples/git-notes.sh
-rw-r--r-- root/root     10495 2015-12-16 11:25 ./usr/share/doc/git/contrib/examples/git-pull.sh
-rw-r--r-- root/root     10388 2015-12-16 11:25 ./usr/share/doc/git/contrib/examples/git-remote.perl
-rw-r--r-- root/root      4994 2015-12-16 11:25 ./usr/share/doc/git/contrib/examples/git-repack.sh
-rw-r--r-- root/root      6195 2015-12-16 11:25 ./usr/share/doc/git/contrib/examples/git-rerere.perl
-rw-r--r-- root/root      2302 2015-12-16 11:25 ./usr/share/doc/git/contrib/examples/git-reset.sh
-rw-r--r-- root/root      2721 2015-12-16 11:25 ./usr/share/doc/git/contrib/examples/git-resolve.sh
-rw-r--r-- root/root      4695 2015-12-16 11:25 ./usr/share/doc/git/contrib/examples/git-revert.sh
-rw-r--r-- root/root     24971 2015-12-16 11:25 ./usr/share/doc/git/contrib/examples/git-svnimport.perl
-rw-r--r-- root/root      5391 2015-12-16 11:25 ./usr/share/doc/git/contrib/examples/git-svnimport.txt
-rw-r--r-- root/root      4028 2015-12-16 11:25 ./usr/share/doc/git/contrib/examples/git-tag.sh
-rw-r--r-- root/root       749 2015-12-16 11:25 ./usr/share/doc/git/contrib/examples/git-verify-tag.sh
-rw-r--r-- root/root       924 2015-12-16 11:25 ./usr/share/doc/git/contrib/examples/git-whatchanged.sh
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/doc/git/contrib/fast-import/
-rw-r--r-- root/root      1451 2015-12-16 11:25 ./usr/share/doc/git/contrib/fast-import/git-import.perl
-rw-r--r-- root/root       724 2015-12-16 11:25 ./usr/share/doc/git/contrib/fast-import/git-import.sh
-rw-r--r-- root/root       476 2015-12-16 11:25 ./usr/share/doc/git/contrib/fast-import/git-p4.README
-rw-r--r-- root/root     11191 2015-12-16 11:25 ./usr/share/doc/git/contrib/fast-import/import-directories.perl
-rw-r--r-- root/root      5330 2015-12-16 11:25 ./usr/share/doc/git/contrib/fast-import/import-tars.perl
-rw-r--r-- root/root      2241 2015-12-16 11:25 ./usr/share/doc/git/contrib/fast-import/import-zips.py
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/doc/git/contrib/git-jump/
-rw-r--r-- root/root      2829 2015-12-16 11:25 ./usr/share/doc/git/contrib/git-jump/README
-rw-r--r-- root/root      1353 2015-12-16 11:25 ./usr/share/doc/git/contrib/git-jump/git-jump
-rw-r--r-- root/root      4407 2015-12-16 11:25 ./usr/share/doc/git/contrib/git-resurrect.sh
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/doc/git/contrib/git-shell-commands/
-rw-r--r-- root/root       839 2015-12-16 11:25 ./usr/share/doc/git/contrib/git-shell-commands/README
-rw-r--r-- root/root       283 2015-12-16 11:25 ./usr/share/doc/git/contrib/git-shell-commands/help
-rw-r--r-- root/root       227 2015-12-16 11:25 ./usr/share/doc/git/contrib/git-shell-commands/list
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/doc/git/contrib/gitview/
-rw-r--r-- root/root     38465 2015-12-16 11:25 ./usr/share/doc/git/contrib/gitview/gitview
-rw-r--r-- root/root       835 2015-12-16 11:25 ./usr/share/doc/git/contrib/gitview/gitview.txt
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/doc/git/contrib/hg-to-git/
-rw-r--r-- root/root      8074 2015-12-16 11:25 ./usr/share/doc/git/contrib/hg-to-git/hg-to-git.py
-rw-r--r-- root/root       890 2015-12-16 11:25 ./usr/share/doc/git/contrib/hg-to-git/hg-to-git.txt
lrwxrwxrwx root/root         0 2015-12-16 11:25 ./usr/share/doc/git/contrib/hooks -> ../../../git-core/contrib/hooks
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/doc/git/contrib/persistent-https/
-rw-r--r-- root/root     11358 2015-12-16 11:25 ./usr/share/doc/git/contrib/persistent-https/LICENSE
-rw-r--r-- root/root      1383 2015-12-16 11:25 ./usr/share/doc/git/contrib/persistent-https/Makefile
-rw-r--r-- root/root      1659 2015-12-16 11:25 ./usr/share/doc/git/contrib/persistent-https/README
-rw-r--r-- root/root      4937 2015-12-16 11:25 ./usr/share/doc/git/contrib/persistent-https/client.go
-rw-r--r-- root/root      2424 2015-12-16 11:25 ./usr/share/doc/git/contrib/persistent-https/main.go
-rw-r--r-- root/root      4786 2015-12-16 11:25 ./usr/share/doc/git/contrib/persistent-https/proxy.go
-rw-r--r-- root/root      2917 2015-12-16 11:25 ./usr/share/doc/git/contrib/persistent-https/socket.go
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/doc/git/contrib/remote-helpers/
-rw-r--r-- root/root       649 2015-12-16 11:25 ./usr/share/doc/git/contrib/remote-helpers/README
-rw-r--r-- root/root       497 2015-12-16 11:25 ./usr/share/doc/git/contrib/remote-helpers/git-remote-bzr
-rw-r--r-- root/root       491 2015-12-16 11:25 ./usr/share/doc/git/contrib/remote-helpers/git-remote-hg
-rw-r--r-- root/root       770 2015-12-16 11:25 ./usr/share/doc/git/contrib/remotes2config.sh
-rw-r--r-- root/root      1011 2015-12-16 11:25 ./usr/share/doc/git/contrib/rerere-train.sh
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/doc/git/contrib/stats/
-rw-r--r-- root/root       708 2015-12-16 11:25 ./usr/share/doc/git/contrib/stats/git-common-hash
-rw-r--r-- root/root      1319 2015-12-16 11:25 ./usr/share/doc/git/contrib/stats/mailmap.pl
-rw-r--r-- root/root      6675 2015-12-16 11:25 ./usr/share/doc/git/contrib/stats/packinfo.pl
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/doc/git/contrib/subtree/
-rw-r--r-- root/root     17987 2015-12-16 11:25 ./usr/share/doc/git/contrib/subtree/COPYING
-rw-r--r-- root/root       566 2015-12-16 11:25 ./usr/share/doc/git/contrib/subtree/INSTALL
-rw-r--r-- root/root      1917 2015-12-16 11:25 ./usr/share/doc/git/contrib/subtree/Makefile
-rw-r--r-- root/root       211 2015-12-16 11:25 ./usr/share/doc/git/contrib/subtree/README
-rw-r--r-- root/root     15761 2015-12-16 11:25 ./usr/share/doc/git/contrib/subtree/git-subtree
-rw-r--r-- root/root     15761 2015-12-16 11:25 ./usr/share/doc/git/contrib/subtree/git-subtree.sh
-rw-r--r-- root/root     12692 2015-12-16 11:25 ./usr/share/doc/git/contrib/subtree/git-subtree.txt
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/doc/git/contrib/subtree/t/
-rw-r--r-- root/root      1637 2015-12-16 11:25 ./usr/share/doc/git/contrib/subtree/t/Makefile
-rw-r--r-- root/root     12459 2015-12-16 11:25 ./usr/share/doc/git/contrib/subtree/t/t7900-subtree.sh
-rw-r--r-- root/root      1733 2015-12-16 11:25 ./usr/share/doc/git/contrib/subtree/todo
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/doc/git/contrib/svn-fe/
-rw-r--r-- root/root      2292 2015-12-16 11:25 ./usr/share/doc/git/contrib/svn-fe/Makefile
-rw-r--r-- root/root       361 2015-12-16 11:25 ./usr/share/doc/git/contrib/svn-fe/svn-fe.c
-rw-r--r-- root/root      2107 2015-12-16 11:25 ./usr/share/doc/git/contrib/svn-fe/svn-fe.txt
-rw-r--r-- root/root      2044 2015-12-16 11:25 ./usr/share/doc/git/contrib/svn-fe/svnrdump_sim.py
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/doc/git/contrib/thunderbird-patch-inline/
-rw-r--r-- root/root       725 2015-12-16 11:25 ./usr/share/doc/git/contrib/thunderbird-patch-inline/README
-rw-r--r-- root/root      1409 2015-12-16 11:25 ./usr/share/doc/git/contrib/thunderbird-patch-inline/appp.sh
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/doc/git/contrib/workdir/
-rw-r--r-- root/root      2402 2015-12-16 11:25 ./usr/share/doc/git/contrib/workdir/git-new-workdir
-rw-r--r-- root/root     18067 2015-12-16 11:25 ./usr/share/doc/git/copyright
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/git-core/
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/git-core/contrib/
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/git-core/contrib/hooks/
-rwxr-xr-x root/root     22070 2015-12-16 11:25 ./usr/share/git-core/contrib/hooks/post-receive-email
-rwxr-xr-x root/root      1249 2015-12-16 11:25 ./usr/share/git-core/contrib/hooks/pre-auto-gc-battery
-rwxr-xr-x root/root      6920 2015-12-16 11:25 ./usr/share/git-core/contrib/hooks/setgitperms.perl
-rwxr-xr-x root/root     11647 2015-12-16 11:25 ./usr/share/git-core/contrib/hooks/update-paranoid
drwxr-xr-x root/root         0 2015-12-16 10:47 ./usr/share/git-core/templates/
drwxr-xr-x root/root         0 2015-12-16 10:47 ./usr/share/git-core/templates/branches/
-rw-r--r-- root/root        73 2015-12-16 10:47 ./usr/share/git-core/templates/description
drwxr-xr-x root/root         0 2015-12-16 10:47 ./usr/share/git-core/templates/hooks/
-rwxr-xr-x root/root       478 2015-12-16 10:47 ./usr/share/git-core/templates/hooks/applypatch-msg.sample
-rwxr-xr-x root/root       896 2015-12-16 10:47 ./usr/share/git-core/templates/hooks/commit-msg.sample
-rwxr-xr-x root/root       189 2015-12-16 10:47 ./usr/share/git-core/templates/hooks/post-update.sample
-rwxr-xr-x root/root       424 2015-12-16 10:47 ./usr/share/git-core/templates/hooks/pre-applypatch.sample
-rwxr-xr-x root/root      1642 2015-12-16 10:47 ./usr/share/git-core/templates/hooks/pre-commit.sample
-rwxr-xr-x root/root      1348 2015-12-16 10:47 ./usr/share/git-core/templates/hooks/pre-push.sample
-rwxr-xr-x root/root      4898 2015-12-16 10:47 ./usr/share/git-core/templates/hooks/pre-rebase.sample
-rwxr-xr-x root/root      1239 2015-12-16 10:47 ./usr/share/git-core/templates/hooks/prepare-commit-msg.sample
-rwxr-xr-x root/root      3611 2015-12-16 10:47 ./usr/share/git-core/templates/hooks/update.sample
drwxr-xr-x root/root         0 2015-12-16 10:47 ./usr/share/git-core/templates/info/
-rw-r--r-- root/root       240 2015-12-16 10:47 ./usr/share/git-core/templates/info/exclude
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/gitweb/
-rwxr-xr-x root/root    251433 2015-12-16 11:24 ./usr/share/gitweb/gitweb.cgi
lrwxrwxrwx root/root         0 2015-12-16 11:25 ./usr/share/gitweb/index.cgi -> gitweb.cgi
drwxr-xr-x root/root         0 2015-12-16 11:24 ./usr/share/gitweb/static/
-rw-r--r-- root/root       115 2015-12-16 11:24 ./usr/share/gitweb/static/git-favicon.png
-rw-r--r-- root/root       207 2015-12-16 11:24 ./usr/share/gitweb/static/git-logo.png
-rw-r--r-- root/root     10637 2015-12-16 11:24 ./usr/share/gitweb/static/gitweb.css
-rw-r--r-- root/root     48814 2015-12-16 11:24 ./usr/share/gitweb/static/gitweb.js
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/lintian/
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/lintian/overrides/
-rw-r--r-- root/root       486 2015-12-16 11:25 ./usr/share/lintian/overrides/git
drwxrwxr-x root/root         0 2015-12-16 10:46 ./usr/share/locale/
drwxrwxr-x root/root         0 2015-12-16 10:46 ./usr/share/locale/bg/
drwxrwxr-x root/root         0 2015-12-16 10:46 ./usr/share/locale/bg/LC_MESSAGES/
-rw-rw-r-- root/root    362941 2015-12-16 10:46 ./usr/share/locale/bg/LC_MESSAGES/git.mo
drwxrwxr-x root/root         0 2015-12-16 10:46 ./usr/share/locale/ca/
drwxrwxr-x root/root         0 2015-12-16 10:46 ./usr/share/locale/ca/LC_MESSAGES/
-rw-rw-r-- root/root    268416 2015-12-16 10:46 ./usr/share/locale/ca/LC_MESSAGES/git.mo
drwxrwxr-x root/root         0 2015-12-16 10:46 ./usr/share/locale/de/
drwxrwxr-x root/root         0 2015-12-16 10:46 ./usr/share/locale/de/LC_MESSAGES/
-rw-rw-r-- root/root    275579 2015-12-16 10:46 ./usr/share/locale/de/LC_MESSAGES/git.mo
drwxrwxr-x root/root         0 2015-12-16 10:46 ./usr/share/locale/fr/
drwxrwxr-x root/root         0 2015-12-16 10:46 ./usr/share/locale/fr/LC_MESSAGES/
-rw-rw-r-- root/root    275427 2015-12-16 10:46 ./usr/share/locale/fr/LC_MESSAGES/git.mo
drwxrwxr-x root/root         0 2015-12-16 10:46 ./usr/share/locale/is/
drwxrwxr-x root/root         0 2015-12-16 10:46 ./usr/share/locale/is/LC_MESSAGES/
-rw-rw-r-- root/root      1734 2015-12-16 10:46 ./usr/share/locale/is/LC_MESSAGES/git.mo
drwxrwxr-x root/root         0 2015-12-16 10:46 ./usr/share/locale/it/
drwxrwxr-x root/root         0 2015-12-16 10:46 ./usr/share/locale/it/LC_MESSAGES/
-rw-rw-r-- root/root     71710 2015-12-16 10:46 ./usr/share/locale/it/LC_MESSAGES/git.mo
drwxrwxr-x root/root         0 2015-12-16 10:46 ./usr/share/locale/pt_PT/
drwxrwxr-x root/root         0 2015-12-16 10:46 ./usr/share/locale/pt_PT/LC_MESSAGES/
-rw-rw-r-- root/root     23297 2015-12-16 10:46 ./usr/share/locale/pt_PT/LC_MESSAGES/git.mo
drwxrwxr-x root/root         0 2015-12-16 10:46 ./usr/share/locale/ru/
drwxrwxr-x root/root         0 2015-12-16 10:46 ./usr/share/locale/ru/LC_MESSAGES/
-rw-rw-r-- root/root    357701 2015-12-16 10:46 ./usr/share/locale/ru/LC_MESSAGES/git.mo
drwxrwxr-x root/root         0 2015-12-16 10:46 ./usr/share/locale/sv/
drwxrwxr-x root/root         0 2015-12-16 10:46 ./usr/share/locale/sv/LC_MESSAGES/
-rw-rw-r-- root/root    259950 2015-12-16 10:46 ./usr/share/locale/sv/LC_MESSAGES/git.mo
drwxrwxr-x root/root         0 2015-12-16 10:46 ./usr/share/locale/vi/
drwxrwxr-x root/root         0 2015-12-16 10:46 ./usr/share/locale/vi/LC_MESSAGES/
-rw-rw-r-- root/root    298131 2015-12-16 10:46 ./usr/share/locale/vi/LC_MESSAGES/git.mo
drwxrwxr-x root/root         0 2015-12-16 10:46 ./usr/share/locale/zh_CN/
drwxrwxr-x root/root         0 2015-12-16 10:46 ./usr/share/locale/zh_CN/LC_MESSAGES/
-rw-rw-r-- root/root    247128 2015-12-16 10:46 ./usr/share/locale/zh_CN/LC_MESSAGES/git.mo
drwxr-xr-x root/root         0 2015-12-16 11:24 ./usr/share/perl5/
-rw-r--r-- root/root     46651 2015-12-08 22:54 ./usr/share/perl5/Git.pm
drwxr-xr-x root/root         0 2015-12-16 11:25 ./usr/share/perl5/Git/
-rw-r--r-- root/root      1977 2015-12-08 22:54 ./usr/share/perl5/Git/I18N.pm
-rw-r--r-- root/root       644 2015-12-08 22:54 ./usr/share/perl5/Git/IndexInfo.pm
drwxr-xr-x root/root         0 2015-12-16 11:24 ./var/
drwxr-xr-x root/root         0 2015-12-16 11:24 ./var/lib/
drwxr-xr-x root/root         0 2015-12-16 11:24 ./var/lib/git/


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


┌──────────────────────────────────────────────────────────────────────────────┐
│ Cleanup                                                                      │
└──────────────────────────────────────────────────────────────────────────────┘

Purging /«BUILDDIR»
Not cleaning session: cloned chroot in use

┌──────────────────────────────────────────────────────────────────────────────┐
│ Summary                                                                      │
└──────────────────────────────────────────────────────────────────────────────┘

Build Architecture: armhf
Build-Space: 247324
Build-Time: 2710
Distribution: stretch-staging
Host Architecture: armhf
Install-Time: 292
Job: git_1:2.6.4-1
Machine Architecture: armhf
Package: git
Package-Time: 3068
Source-Version: 1:2.6.4-1
Space: 247324
Status: successful
Version: 1:2.6.4-1
────────────────────────────────────────────────────────────────────────────────
Finished at 20151216-1128
Build needed 00:51:08, 247324k disc space