diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2019-05-10 17:46:57 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-05-13 15:13:24 +0900 |
commit | e1df7fe43f4e2e607ed24668e2942d45df8d2743 (patch) | |
tree | 0f29c758dea88ebb71a2d08c1c215d0a715de296 /t/t1301-shared-repo.sh | |
parent | aeb582a98374c094361cba1bd756dc6307432c42 (diff) | |
download | git-e1df7fe43f4e2e607ed24668e2942d45df8d2743.tar.gz |
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/t1301-shared-repo.sh')
-rwxr-xr-x | t/t1301-shared-repo.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/t/t1301-shared-repo.sh b/t/t1301-shared-repo.sh index dfece751b5..2dc853d1be 100755 --- a/t/t1301-shared-repo.sh +++ b/t/t1301-shared-repo.sh @@ -136,7 +136,7 @@ test_expect_success POSIXPERM 'forced modes' ' ( cd new && umask 002 && - git init --shared=0660 --template=../templates && + git init --shared=0660 --template=templates && >frotz && git add frotz && git commit -a -m initial && @@ -192,7 +192,7 @@ test_expect_success POSIXPERM 're-init respects core.sharedrepository (remote)' umask 0022 && git init --bare --shared=0666 child.git && test_path_is_missing child.git/foo && - git init --bare --template=../templates child.git && + git init --bare --template=templates child.git && echo "-rw-rw-rw-" >expect && test_modebits child.git/foo >actual && test_cmp expect actual @@ -203,7 +203,7 @@ test_expect_success POSIXPERM 'template can set core.sharedrepository' ' umask 0022 && git config core.sharedrepository 0666 && cp .git/config templates/config && - git init --bare --template=../templates child.git && + git init --bare --template=templates child.git && echo "-rw-rw-rw-" >expect && test_modebits child.git/HEAD >actual && test_cmp expect actual |