{"thread":{"id":"9510","subject":"[PATCH] Add a test for git-commit being confused by relative GIT_DIR","startedAt":"2007-08-13T05:38:11Z","lastAt":"2007-08-13T23:51:00Z","messageCount":2,"participants":["David Kastrup","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"50614","messageId":"853ayo570c.fsf@lola.goethe.zz","threadId":"9510","inReplyTo":null,"subject":"[PATCH] Add a test for git-commit being confused by relative GIT_DIR","fromName":"David Kastrup","fromEmail":"dak@gnu.org","sentAt":"2007-08-13T05:38:11Z","receivedAt":"2007-08-13T05:38:11Z","isPatch":true,"sender":{"key":"dak@gnu.org","avatar":"https://avatars.githubusercontent.com/u/52141349?v=4"},"body":"\nSigned-off-by: David Kastrup <dak@gnu.org>\n---\n t/t2050-git-dir-relative.sh |   55 +++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 55 insertions(+), 0 deletions(-)\n create mode 100755 t/t2050-git-dir-relative.sh\n\ndiff --git a/t/t2050-git-dir-relative.sh b/t/t2050-git-dir-relative.sh\nnew file mode 100755\nindex 0000000..8b8e233\n--- /dev/null\n+++ b/t/t2050-git-dir-relative.sh\n@@ -0,0 +1,55 @@\n+#!/bin/sh\n+\n+test_description='check problems with relative GIT_DIR\n+\n+This test creates a working tree state with a file and subdir:\n+\n+  top (committed several times)\n+  subdir (a subdirectory)\n+\n+It creates a commit-hook and tests it, then moves .git\n+into the subdir while keeping the worktree location, \n+and tries commits from the top and the subdir, checking\n+that the commit-hook still gets called.'\n+\n+. ./test-lib.sh\n+\n+COMMIT_FILE=\"$(pwd)/output\"\n+export COMMIT_FILE\n+\n+test_expect_success 'Setting up post-commit hook' '\n+mkdir -p .git/hooks &&\n+echo >.git/hooks/post-commit \"#!/bin/sh\n+touch \\\"\\${COMMIT_FILE}\\\"\n+echo Post commit hook was called.\" &&\n+chmod +x .git/hooks/post-commit'\n+\n+test_expect_success 'post-commit hook used ordinarily' '\n+echo initial >top &&\n+git-add top\n+git-commit -m initial &&\n+test -r \"${COMMIT_FILE}\"\n+'\n+\n+rm -rf \"${COMMIT_FILE}\"\n+mkdir subdir\n+mv .git subdir\n+\n+test_expect_success 'post-commit-hook created and used from top dir' '\n+echo changed >top &&\n+git --git-dir subdir/.git add top &&\n+git --git-dir subdir/.git commit -m topcommit &&\n+test -r \"${COMMIT_FILE}\"\n+'\n+\n+rm -rf \"${COMMIT_FILE}\"\n+\n+test_expect_success 'post-commit-hook from sub dir' '\n+echo changed again >top\n+cd subdir &&\n+git --git-dir .git --work-tree .. add ../top &&\n+git --git-dir .git --work-tree .. commit -m subcommit &&\n+test -r \"${COMMIT_FILE}\"\n+'\n+\n+test_done\n-- \n1.5.3.rc2.257.gd8a21\n"},{"id":"50668","messageId":"7vy7gfdme3.fsf@assigned-by-dhcp.cox.net","threadId":"9510","inReplyTo":"853ayo570c.fsf@lola.goethe.zz","subject":"Re: [PATCH] Add a test for git-commit being confused by relative GIT_DIR","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-08-13T23:51:00Z","receivedAt":"2007-08-13T23:51:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks.  Queued this along with the earlier \"GIT_DIR to absolute\npath\" patch.\n"}]}