{"thread":{"id":"22662","subject":"Re: [PATCH v2] require_work_tree broken with NONGIT_OK","startedAt":"2010-02-15T15:44:56Z","lastAt":"2010-02-16T06:46:46Z","messageCount":2,"participants":["Gabriel Filion","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"134646","messageId":"4B796BF8.7000408@gmail.com","threadId":"22662","inReplyTo":null,"subject":"Re: [PATCH v2] require_work_tree broken with NONGIT_OK","fromName":"Gabriel Filion","fromEmail":"lelutin@gmail.com","sentAt":"2010-02-15T15:44:56Z","receivedAt":"2010-02-15T15:44:56Z","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---\n\nThis is a fixup rollout after discussion on the patch:\n - Commit message better identifies the cause of the problem\n - the test was not working in v1. fixed this up\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"},{"id":"134705","messageId":"7vhbphd6eh.fsf@alter.siamese.dyndns.org","threadId":"22662","inReplyTo":"4B796BF8.7000408@gmail.com","subject":"Re: [PATCH v2] require_work_tree broken with NONGIT_OK","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-16T06:46:46Z","receivedAt":"2010-02-16T06:46:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Gabriel Filion <lelutin@gmail.com> writes:\n\n> Sourcing git-sh-setup: After having set NONGIT_OK, when calling the\n> function require_work_tree while outside of a git repository shows a\n> syntax error.\n> This is caused by the call to git rev-parse --is-inside-work-tree\n> printing nothing when it is called outside of a git repository.\n>\n> Quoting the call removes the syntax error and sending stderr to\n> /dev/null removes duplicate error messages.\n> ---\n\nSign-off?\n\n>\n> This is a fixup rollout after discussion on the patch:\n>  - Commit message better identifies the cause of the problem\n>  - the test was not working in v1. fixed this up\n>\n>  git-sh-setup.sh |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n>\n> diff --git a/git-sh-setup.sh b/git-sh-setup.sh\n> index 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"}]}