summaryrefslogtreecommitdiff
path: root/t/t9903-bash-prompt.sh
diff options
context:
space:
mode:
authorTorstein Hegge <hegge@resisty.net>2013-04-11 18:53:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-04-11 23:07:22 (GMT)
commit3ba40b45d8db66c72ed38aa36afac1cd48c05534 (patch)
tree4ece2ad6b381989180c0c5341471046b1ce9bd3a /t/t9903-bash-prompt.sh
parent5bda18c186e455f8e65f976d3bf333ab1f4b5b53 (diff)
downloadgit-3ba40b45d8db66c72ed38aa36afac1cd48c05534.zip
git-3ba40b45d8db66c72ed38aa36afac1cd48c05534.tar.gz
git-3ba40b45d8db66c72ed38aa36afac1cd48c05534.tar.bz2
t9903: Don't fail when run from path accessed through symlink
When the git directory is accessed through a symlink like ln -s /tmp/git /tmp/git-symlink cd /tmp/git-symlink/t make -C .. && ./t9903-bash-prompt.sh $TRASH_DIRECTORY is /tmp/git-symlink/t/trash directory.t9903-bash-prompt and $(pwd -P) is /tmp/git/t/trash directory.t9903-bash-prompt. When __gitdir looks up the path through 'git rev-parse --git-dir', it will return paths similar to $(pwd -P). This behavior is already tested in t9903 'gitdir - resulting path avoids symlinks'. Signed-off-by: Torstein Hegge <hegge@resisty.net> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9903-bash-prompt.sh')
-rwxr-xr-xt/t9903-bash-prompt.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh
index 2101d91..e147a8d 100755
--- a/t/t9903-bash-prompt.sh
+++ b/t/t9903-bash-prompt.sh
@@ -59,7 +59,7 @@ test_expect_success 'gitdir - .git directory in cwd' '
'
test_expect_success 'gitdir - .git directory in parent' '
- echo "$TRASH_DIRECTORY/.git" > expected &&
+ echo "$(pwd -P)/.git" > expected &&
(
cd subdir/subsubdir &&
__gitdir > "$actual"
@@ -77,7 +77,7 @@ test_expect_success 'gitdir - cwd is a .git directory' '
'
test_expect_success 'gitdir - parent is a .git directory' '
- echo "$TRASH_DIRECTORY/.git" > expected &&
+ echo "$(pwd -P)/.git" > expected &&
(
cd .git/refs/heads &&
__gitdir > "$actual"
@@ -115,7 +115,7 @@ test_expect_success 'gitdir - non-existing $GIT_DIR' '
'
test_expect_success 'gitdir - gitfile in cwd' '
- echo "$TRASH_DIRECTORY/otherrepo/.git" > expected &&
+ echo "$(pwd -P)/otherrepo/.git" > expected &&
echo "gitdir: $TRASH_DIRECTORY/otherrepo/.git" > subdir/.git &&
test_when_finished "rm -f subdir/.git" &&
(
@@ -126,7 +126,7 @@ test_expect_success 'gitdir - gitfile in cwd' '
'
test_expect_success 'gitdir - gitfile in parent' '
- echo "$TRASH_DIRECTORY/otherrepo/.git" > expected &&
+ echo "$(pwd -P)/otherrepo/.git" > expected &&
echo "gitdir: $TRASH_DIRECTORY/otherrepo/.git" > subdir/.git &&
test_when_finished "rm -f subdir/.git" &&
(
@@ -137,7 +137,7 @@ test_expect_success 'gitdir - gitfile in parent' '
'
test_expect_success SYMLINKS 'gitdir - resulting path avoids symlinks' '
- echo "$TRASH_DIRECTORY/otherrepo/.git" > expected &&
+ echo "$(pwd -P)/otherrepo/.git" > expected &&
mkdir otherrepo/dir &&
test_when_finished "rm -rf otherrepo/dir" &&
ln -s otherrepo/dir link &&