summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Nguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-08-31 08:04:14 +0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-09-03 11:14:58 -0700
commit487a2b732230608fe7f2cdc46c9f11bd646cb1ac (patch)
treeed1d7d7dd69c2338d686b0c610171090c9e402bc /t
parentparse-options: fix clang opterror() -Wunused-value warning (diff)
downloadtgif-487a2b732230608fe7f2cdc46c9f11bd646cb1ac.tar.xz
Make setup_git_env() resolve .git file when $GIT_DIR is not specified
This makes reinitializing on a .git file repository work. This is probably the only case that setup_git_env() (via set_git_dir()) is called on a .git file. Other cases in setup_git_dir_gently() and enter_repo() both cover .git file case explicitly because they need to verify the target repo is valid. Reported-by: Ximin Luo <infinity0@gmx.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> 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')
-rwxr-xr-xt/t0001-init.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index ad66410564..9fb582b192 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -379,6 +379,10 @@ test_expect_success 'init with separate gitdir' '
test -d realgitdir/refs
'
+test_expect_success 're-init on .git file' '
+ ( cd newdir && git init )
+'
+
test_expect_success 're-init to update git link' '
(
cd newdir &&