Code

Merge branch 'tr/maint-bundle-boundary' into maint-1.7.8
[git.git] / t / t1501-worktree.sh
index 2c8f01f6684cbe492132575209f79371ad761d87..63849836c8b088eb495dc565ff909c367c868301 100755 (executable)
@@ -7,7 +7,6 @@ test_expect_success 'setup' '
        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) &&
-       ZEROES=0000000000000000000000000000000000000000 &&
        EMPTY_BLOB7=$(echo $EMPTY_BLOB | sed "s/\(.......\).*/\1/") &&
        CHANGED_BLOB7=$(echo $CHANGED_BLOB | sed "s/\(.......\).*/\1/") &&
 
@@ -239,10 +238,10 @@ test_expect_success '_gently() groks relative GIT_DIR & GIT_WORK_TREE' '
 
 test_expect_success 'diff-index respects work tree under .git dir' '
        cat >diff-index-cached.expected <<-EOF &&
-       :000000 100644 $ZEROES $EMPTY_BLOB A    sub/dir/tracked
+       :000000 100644 $_z40 $EMPTY_BLOB A      sub/dir/tracked
        EOF
        cat >diff-index.expected <<-EOF &&
-       :000000 100644 $ZEROES $ZEROES A        sub/dir/tracked
+       :000000 100644 $_z40 $_z40 A    sub/dir/tracked
        EOF
 
        (
@@ -258,7 +257,7 @@ test_expect_success 'diff-index respects work tree under .git dir' '
 
 test_expect_success 'diff-files respects work tree under .git dir' '
        cat >diff-files.expected <<-EOF &&
-       :100644 100644 $EMPTY_BLOB $ZEROES M    sub/dir/tracked
+       :100644 100644 $EMPTY_BLOB $_z40 M      sub/dir/tracked
        EOF
 
        (
@@ -340,4 +339,11 @@ test_expect_success 'make_relative_path handles double slashes in GIT_DIR' '
        git --git-dir="$(pwd)//repo.git" --work-tree="$(pwd)" add dummy_file
 '
 
+test_expect_success 'relative $GIT_WORK_TREE and git subprocesses' '
+       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
+'
+
 test_done