Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2019-05-10 13:46:57 +0300
committerJunio C Hamano <gitster@pobox.com>2019-05-13 09:13:24 +0300
commite1df7fe43f4e2e607ed24668e2942d45df8d2743 (patch)
tree0f29c758dea88ebb71a2d08c1c215d0a715de296 /t/t0001-init.sh
parentaeb582a98374c094361cba1bd756dc6307432c42 (diff)
init: make --template path relative to $CWD
During git-init we chdir() to the target directory, but --template is not adjusted. So it's relative to the target directory instead of current directory. It would be ok if it's documented, but --template in git-init.txt mentions nothing about this behavior. Change it to be relative to $CWD, which is much more intuitive. The changes in the test suite show that this relative-to-target behavior is actually used. I just hope that it's only used in the test suite and it's safe to change. Otherwise, the other option is just document it (i.e. relative to target dir) and move on. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0001-init.sh')
-rwxr-xr-xt/t0001-init.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index 42a263cada..802edb6c8f 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -174,7 +174,7 @@ test_expect_success 'reinit' '
test_expect_success 'init with --template' '
mkdir template-source &&
echo content >template-source/file &&
- git init --template=../template-source template-custom &&
+ git init --template=template-source template-custom &&
test_cmp template-source/file template-custom/.git/file
'