t1301: fix wrong template dir for git-init
commita0883a2440903bcfcb6b0f0c9d0439168258e819
authorJiang Xin <zhiyou.jx@alibaba-inc.com>
Tue, 29 Nov 2022 13:15:09 +0000 (29 21:15 +0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 30 Nov 2022 01:21:50 +0000 (30 10:21 +0900)
treeeb3b7e902930d8f850c988e98ac073c3866d84b5
parente7e5c6f715b2de7bea0d39c7d2ba887335b40aa0
t1301: fix wrong template dir for git-init

The template dir prepared in test case "forced modes" is not used as
expected because a wrong template dir is provided to "git init". This is
because the $CWD for "git-init" command is a sibling directory alongside
the template directory. Change it to the right template directory and
add a protection test using "test_path_is_file".

The wrong template directory was introduced by mistake in commit
e1df7fe43f (init: make --template path relative to $CWD, 2019-05-10).

Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1301-shared-repo.sh