Add test for nested Git repository

I don’t know how this should work, but let’s at least record the current behaviour in case it changes
This commit is contained in:
Benjamin Sago 2017-08-28 18:24:20 +01:00
parent 040dbb2414
commit cfc05eef00
6 changed files with 24 additions and 10 deletions

5
Vagrantfile vendored
View File

@ -544,6 +544,11 @@ Vagrant.configure(2) do |config|
mkdir "target" mkdir "target"
touch "target/another ignored file" touch "target/another ignored file"
mkdir "deeply/nested/repository"
cd "deeply/nested/repository"
git init
touch subfile
find "#{test_dir}/git2" -exec touch {} -t #{some_date} \\; find "#{test_dir}/git2" -exec touch {} -t #{some_date} \\;
sudo chown #{user}:#{user} -R "#{test_dir}/git2" sudo chown #{user}:#{user} -R "#{test_dir}/git2"
EOF EOF

View File

@ -13,3 +13,4 @@
/testcases/git2/deeply/nested: /testcases/git2/deeply/nested:
drwxrwxr-x - cassowary  1 Jan 12:34 -N directory drwxrwxr-x - cassowary  1 Jan 12:34 -N directory
drwxrwxr-x - cassowary  1 Jan 12:34 -N repository

View File

@ -7,11 +7,15 @@
/testcases/git2/deeply/nested: /testcases/git2/deeply/nested:
drwxrwxr-x - cassowary  1 Jan 12:34 directory drwxrwxr-x - cassowary  1 Jan 12:34 directory
drwxrwxr-x - cassowary  1 Jan 12:34 repository
/testcases/git2/deeply/nested/directory: /testcases/git2/deeply/nested/directory:
.rw-rw-r-- 0 cassowary  1 Jan 12:34 l8st .rw-rw-r-- 0 cassowary  1 Jan 12:34 l8st
.rw-rw-r-- 18 cassowary  1 Jan 12:34 upd8d .rw-rw-r-- 18 cassowary  1 Jan 12:34 upd8d
/testcases/git2/deeply/nested/repository:
.rw-rw-r-- 0 cassowary  1 Jan 12:34 subfile
/testcases/git2/ignoreds: /testcases/git2/ignoreds:
.rw-rw-r-- 0 cassowary  1 Jan 12:34 music.m4a .rw-rw-r-- 0 cassowary  1 Jan 12:34 music.m4a
.rw-rw-r-- 0 cassowary  1 Jan 12:34 music.mp3 .rw-rw-r-- 0 cassowary  1 Jan 12:34 music.mp3

1
xtests/git_2_repository Normal file
View File

@ -0,0 +1 @@
.rw-rw-r-- 0 cassowary  1 Jan 12:34 -N subfile

View File

@ -1,9 +1,11 @@
drwxrwxr-x - cassowary  1 Jan 12:34 /testcases/git2 drwxrwxr-x - cassowary  1 Jan 12:34 /testcases/git2
drwxrwxr-x - cassowary  1 Jan 12:34 ├── deeply drwxrwxr-x - cassowary  1 Jan 12:34 ├── deeply
drwxrwxr-x - cassowary  1 Jan 12:34 │ └── nested drwxrwxr-x - cassowary  1 Jan 12:34 │ └── nested
drwxrwxr-x - cassowary  1 Jan 12:34 │ └── directory drwxrwxr-x - cassowary  1 Jan 12:34 │ ├── directory
.rw-rw-r-- 0 cassowary  1 Jan 12:34 │ ├── l8st .rw-rw-r-- 0 cassowary  1 Jan 12:34 │ │ ├── l8st
.rw-rw-r-- 18 cassowary  1 Jan 12:34 │ └── upd8d .rw-rw-r-- 18 cassowary  1 Jan 12:34 │ │ └── upd8d
drwxrwxr-x - cassowary  1 Jan 12:34 │ └── repository
.rw-rw-r-- 0 cassowary  1 Jan 12:34 │ └── subfile
drwxrwxr-x - cassowary  1 Jan 12:34 ├── ignoreds drwxrwxr-x - cassowary  1 Jan 12:34 ├── ignoreds
.rw-rw-r-- 0 cassowary  1 Jan 12:34 │ ├── music.m4a .rw-rw-r-- 0 cassowary  1 Jan 12:34 │ ├── music.m4a
.rw-rw-r-- 0 cassowary  1 Jan 12:34 │ └── music.mp3 .rw-rw-r-- 0 cassowary  1 Jan 12:34 │ └── music.mp3

View File

@ -202,6 +202,7 @@ $exa $testcases/git2 --tree -l --git 2>&1 | diff -q - $results
$exa $testcases/git2 --recurse -l --git 2>&1 | diff -q - $results/git_2_recurse || exit 1 $exa $testcases/git2 --recurse -l --git 2>&1 | diff -q - $results/git_2_recurse || exit 1
$exa $testcases/git2/ignoreds -l --git 2>&1 | diff -q - $results/git_2_ignoreds || exit 1 $exa $testcases/git2/ignoreds -l --git 2>&1 | diff -q - $results/git_2_ignoreds || exit 1
$exa $testcases/git2/target -l --git 2>&1 | diff -q - $results/git_2_target || exit 1 $exa $testcases/git2/target -l --git 2>&1 | diff -q - $results/git_2_target || exit 1
$exa $testcases/git2/deeply/nested/repository -l --git 2>&1 | diff -q - $results/git_2_repository || exit 1
$exa $testcases/git2/{deeply,ignoreds,target} -l --git 2>&1 | diff -q - $results/git_2_all || exit 1 $exa $testcases/git2/{deeply,ignoreds,target} -l --git 2>&1 | diff -q - $results/git_2_all || exit 1
$exa $testcases/git $testcases/git2 --git --long | diff -q - $results/git_12 || exit 1 $exa $testcases/git $testcases/git2 --git --long | diff -q - $results/git_12 || exit 1