summaryrefslogtreecommitdiff
path: root/t/t1501-worktree.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2010-01-21 19:05:19 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-01-22 15:34:56 -0800
commit288123f01cb1b835edbf6e2e188159c2ff858aca (patch)
treec10efa0ec8474dc08928427134ad7116d3bee046 /t/t1501-worktree.sh
parentmerge-recursive: do not return NULL only to cause segfault (diff)
downloadtgif-288123f01cb1b835edbf6e2e188159c2ff858aca.tar.xz
ignore duplicated slashes in make_relative_path()
The function takes two paths, an early part of abs is supposed to match base; otherwise abs is not a path under base and the function returns the full path of abs. The caller can easily confuse the implementation by giving duplicated and needless slashes in these path arguments. Credit for test script, motivation and initial patch goes to Thomas Rast. A follow-up fix (squashed) is by Hannes. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1501-worktree.sh')
-rwxr-xr-xt/t1501-worktree.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/t/t1501-worktree.sh b/t/t1501-worktree.sh
index 74e6443664..9df301211c 100755
--- a/t/t1501-worktree.sh
+++ b/t/t1501-worktree.sh
@@ -189,4 +189,10 @@ test_expect_success 'absolute pathspec should fail gracefully' '
)
'
+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