Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 4a83680

Browse files
committed
test: Factor abspath_of_dir for testing 'absolute paths'
Signed-off-by: Michael Geddes <[email protected]>
1 parent dda0d3d commit 4a83680

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

t/t0060-path-utils.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ test_expect_success SYMLINKS 'real path works on symlinks' '
178178
mkdir second &&
179179
ln -s ../first second/other &&
180180
mkdir third &&
181-
dir="$(cd .git; pwd -P)" &&
181+
dir="$(abspath_of_dir .git)" &&
182182
dir2=third/../second/other/.git &&
183183
test "$dir" = "$(test-path-utils real_path $dir2)" &&
184184
file="$dir"/index &&

t/test-lib.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,10 @@ yes () {
794794
done
795795
}
796796

797+
abspath_of_dir () {
798+
(cd "$1" ; pwd -P)
799+
}
800+
797801
# Fix some commands on Windows
798802
case $(uname -s) in
799803
*MINGW*)

0 commit comments

Comments
 (0)