* Re: [PATCH v2] require_work_tree broken with NONGIT_OK
@ 2010-02-15 15:44 Gabriel Filion
2010-02-16 6:46 ` Junio C Hamano
0 siblings, 1 reply; 3+ messages in thread
From: Gabriel Filion @ 2010-02-15 15:44 UTC (permalink / raw)
To: git
Sourcing git-sh-setup: After having set NONGIT_OK, when calling the
function require_work_tree while outside of a git repository shows a
syntax error.
This is caused by the call to git rev-parse --is-inside-work-tree
printing nothing when it is called outside of a git repository.
Quoting the call removes the syntax error and sending stderr to
/dev/null removes duplicate error messages.
---
This is a fixup rollout after discussion on the patch:
- Commit message better identifies the cause of the problem
- the test was not working in v1. fixed this up
git-sh-setup.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index d56426d..5e22440 100755
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -128,7 +128,7 @@ cd_to_toplevel () {
}
require_work_tree () {
- test $(git rev-parse --is-inside-work-tree) = true ||
+ test "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = true ||
die "fatal: $0 cannot be used without a working tree."
}
-- 1.6.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] require_work_tree broken with NONGIT_OK
2010-02-15 15:44 Gabriel Filion
@ 2010-02-16 6:46 ` Junio C Hamano
0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2010-02-16 6:46 UTC (permalink / raw)
To: Gabriel Filion; +Cc: git
Gabriel Filion <lelutin@gmail.com> writes:
> Sourcing git-sh-setup: After having set NONGIT_OK, when calling the
> function require_work_tree while outside of a git repository shows a
> syntax error.
> This is caused by the call to git rev-parse --is-inside-work-tree
> printing nothing when it is called outside of a git repository.
>
> Quoting the call removes the syntax error and sending stderr to
> /dev/null removes duplicate error messages.
> ---
Sign-off?
>
> This is a fixup rollout after discussion on the patch:
> - Commit message better identifies the cause of the problem
> - the test was not working in v1. fixed this up
>
> git-sh-setup.sh | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/git-sh-setup.sh b/git-sh-setup.sh
> index d56426d..5e22440 100755
> --- a/git-sh-setup.sh
> +++ b/git-sh-setup.sh
> @@ -128,7 +128,7 @@ cd_to_toplevel () {
> }
> require_work_tree () {
> - test $(git rev-parse --is-inside-work-tree) = true ||
> + test "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = true ||
> die "fatal: $0 cannot be used without a working tree."
> }
> -- 1.6.6
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] require_work_tree broken with NONGIT_OK
@ 2010-02-17 4:18 Gabriel Filion
0 siblings, 0 replies; 3+ messages in thread
From: Gabriel Filion @ 2010-02-17 4:18 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Jeff King
Sourcing git-sh-setup: After having set NONGIT_OK, when calling the
function require_work_tree while outside of a git repository shows a
syntax error.
This is caused by the call to git rev-parse --is-inside-work-tree
printing nothing when it is called outside of a git repository.
Quoting the call removes the syntax error and sending stderr to
/dev/null removes duplicate error messages.
Signed-off-by: Gabriel Filion <lelutin@gmail.com>
---
git-sh-setup.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index d56426d..5e22440 100755
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -128,7 +128,7 @@ cd_to_toplevel () {
}
require_work_tree () {
- test $(git rev-parse --is-inside-work-tree) = true ||
+ test "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = true ||
die "fatal: $0 cannot be used without a working tree."
}
-- 1.6.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-02-17 4:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-17 4:18 [PATCH v2] require_work_tree broken with NONGIT_OK Gabriel Filion
-- strict thread matches above, loose matches on Subject: below --
2010-02-15 15:44 Gabriel Filion
2010-02-16 6:46 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).