summaryrefslogtreecommitdiff
path: root/t/t1501-worktree.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2010-07-08 18:55:50 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-07-08 18:55:50 -0700
commit037c43c68e220739e690540de89a6d5835fefe73 (patch)
tree3e201f833fc63e48db6983e45ce2425d884408db /t/t1501-worktree.sh
parentFix "read-tree -m A B" priming the cache-tree (diff)
parentGit 1.7.2-rc2 (diff)
downloadtgif-037c43c68e220739e690540de89a6d5835fefe73.tar.xz
Merge remote branch 'ko/master' into jc/read-tree-cache-tree-fix
* ko/master: (2325 commits) Git 1.7.2-rc2 backmerge a few more fixes to 1.7.1.X series fix git branch -m in presence of cross devices t/t0006: specify timezone as EST5 not EST to comply with POSIX add missing && to submodule-merge testcase t/README: document more test helpers test-date: fix sscanf type conversion xdiff: optimise for no whitespace difference when ignoring whitespace. gitweb: Move evaluate_gitweb_config out of run_request parse_date: fix signedness in timezone calculation t0006: test timezone parsing rerere.txt: Document forget subcommand t/README: proposed rewording... t/README: Document the do's and don'ts of tests t/README: Add a section about skipping tests t/README: Document test_expect_code t/README: Document test_external* t/README: Document the prereq functions, and 3-arg test_* t/README: Typo: paralell -> parallel t/README: The trash is in 't/trash directory.$name' ... Conflicts: builtin-read-tree.c
Diffstat (limited to 't/t1501-worktree.sh')
-rwxr-xr-xt/t1501-worktree.sh33
1 files changed, 31 insertions, 2 deletions
diff --git a/t/t1501-worktree.sh b/t/t1501-worktree.sh
index f6a6f839a1..bd8b60732b 100755
--- a/t/t1501-worktree.sh
+++ b/t/t1501-worktree.sh
@@ -30,6 +30,7 @@ test_rev_parse() {
EMPTY_TREE=$(git write-tree)
mkdir -p work/sub/dir || exit 1
+mkdir -p work2 || exit 1
mv .git repo.git || exit 1
say "core.worktree = relative path"
@@ -54,7 +55,9 @@ GIT_DIR=$(pwd)/repo.git
GIT_CONFIG=$GIT_DIR/config
git config core.worktree "$(pwd)/work"
test_rev_parse 'outside' false false false
-cd work || exit 1
+cd work2
+test_rev_parse 'outside2' false false false
+cd ../work || exit 1
test_rev_parse 'inside' false false true ''
cd sub/dir || exit 1
test_rev_parse 'subdirectory' false false true sub/dir/
@@ -67,7 +70,9 @@ git config core.worktree non-existent
GIT_WORK_TREE=work
export GIT_WORK_TREE
test_rev_parse 'outside' false false false
-cd work || exit 1
+cd work2
+test_rev_parse 'outside' false false false
+cd ../work || exit 1
GIT_WORK_TREE=.
test_rev_parse 'inside' false false true ''
cd sub/dir || exit 1
@@ -76,6 +81,7 @@ test_rev_parse 'subdirectory' false false true sub/dir/
cd ../../.. || exit 1
mv work repo.git/work
+mv work2 repo.git/work2
say "GIT_WORK_TREE=absolute path, work tree below git dir"
GIT_DIR=$(pwd)/repo.git
@@ -86,6 +92,8 @@ cd repo.git || exit 1
test_rev_parse 'in repo.git' false true false
cd objects || exit 1
test_rev_parse 'in repo.git/objects' false true false
+cd ../work2 || exit 1
+test_rev_parse 'in repo.git/work2' false true false
cd ../work || exit 1
test_rev_parse 'in repo.git/work' false true true ''
cd sub/dir || exit 1
@@ -174,4 +182,25 @@ test_expect_success 'git grep' '
GIT_DIR=../.. GIT_WORK_TREE=.. git grep -l changed | grep dir/tracked)
'
+test_expect_success 'git commit' '
+ (
+ cd repo.git &&
+ GIT_DIR=. GIT_WORK_TREE=work git commit -a -m done
+ )
+'
+
+test_expect_success 'absolute pathspec should fail gracefully' '
+ (
+ cd repo.git || exit 1
+ git config --unset core.worktree
+ test_must_fail git log HEAD -- /home
+ )
+'
+
+test_expect_success 'make_relative_path handles double slashes in GIT_DIR' '
+ : > 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
+'
+
test_done