{"thread":{"id":"22686","subject":"Re: [PATCH v2] require_work_tree broken with NONGIT_OK","startedAt":"2010-02-17T04:18:50Z","lastAt":"2010-02-17T04:18:50Z","messageCount":1,"participants":["Gabriel Filion"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"134835","messageId":"4B7B6E2A.3050704@gmail.com","threadId":"22686","inReplyTo":null,"subject":"Re: [PATCH v2] require_work_tree broken with NONGIT_OK","fromName":"Gabriel Filion","fromEmail":"lelutin@gmail.com","sentAt":"2010-02-17T04:18:50Z","receivedAt":"2010-02-17T04:18:50Z","isPatch":true,"sender":{"key":"lelutin@gmail.com","avatar":"https://avatars.githubusercontent.com/u/108728?v=4"},"body":"Sourcing git-sh-setup: After having set NONGIT_OK, when calling the\nfunction require_work_tree while outside of a git repository shows a\nsyntax error.\nThis is caused by the call to git rev-parse --is-inside-work-tree\nprinting nothing when it is called outside of a git repository.\n\nQuoting the call removes the syntax error and sending stderr to\n/dev/null removes duplicate error messages.\n\nSigned-off-by: Gabriel Filion <lelutin@gmail.com>\n---\n git-sh-setup.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-sh-setup.sh b/git-sh-setup.sh\nindex d56426d..5e22440 100755\n--- a/git-sh-setup.sh\n+++ b/git-sh-setup.sh\n@@ -128,7 +128,7 @@ cd_to_toplevel () {\n }\n  require_work_tree () {\n-\ttest $(git rev-parse --is-inside-work-tree) = true ||\n+\ttest \"$(git rev-parse --is-inside-work-tree 2>/dev/null)\" = true ||\n \tdie \"fatal: $0 cannot be used without a working tree.\"\n }\n -- 1.6.6\n"}]}