Re: [PATCH] t7811 (grep-open): remove test_config() redefinition

2013-03-19 Thread Junio C Hamano
Ramkumar Ramachandra  writes:

> test_config() is already a well-defined function in
> test-lib-functions.sh.  Don't duplicate it unnecessarily.

There are other instances of it in t7810 and t4018, with slightly
different styles.

t/t4018-diff-funcname.sh:test_config () {
t/t7810-grep.sh:test_config() {
t/t7811-grep-open.sh:test_config() {
t/test-lib-functions.sh:test_config () {

Incidentally, this is why a consistent coding style helps.  It
should be possible to catch all ofhtme with a single

git grep 'test_config () {' t/

but the ones in t78xx wouldn't have been found.

> Signed-off-by: Ramkumar Ramachandra 
> ---
>  Found this while randomly grep'ping around.
>
>  t/t7811-grep-open.sh | 5 -
>  1 file changed, 5 deletions(-)
>
> diff --git a/t/t7811-grep-open.sh b/t/t7811-grep-open.sh
> index a895778..e1951a5 100755
> --- a/t/t7811-grep-open.sh
> +++ b/t/t7811-grep-open.sh
> @@ -125,11 +125,6 @@ test_expect_success 'modified file' '
>   test_cmp empty out
>  '
>  
> -test_config() {
> - git config "$1" "$2" &&
> - test_when_finished "git config --unset $1"
> -}
> -
>  test_expect_success 'copes with color settings' '
>   rm -f actual &&
>   echo grep.h >expect &&
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] t7811 (grep-open): remove test_config() redefinition

2013-03-19 Thread Ramkumar Ramachandra
test_config() is already a well-defined function in
test-lib-functions.sh.  Don't duplicate it unnecessarily.

Signed-off-by: Ramkumar Ramachandra 
---
 Found this while randomly grep'ping around.

 t/t7811-grep-open.sh | 5 -
 1 file changed, 5 deletions(-)

diff --git a/t/t7811-grep-open.sh b/t/t7811-grep-open.sh
index a895778..e1951a5 100755
--- a/t/t7811-grep-open.sh
+++ b/t/t7811-grep-open.sh
@@ -125,11 +125,6 @@ test_expect_success 'modified file' '
test_cmp empty out
 '
 
-test_config() {
-   git config "$1" "$2" &&
-   test_when_finished "git config --unset $1"
-}
-
 test_expect_success 'copes with color settings' '
rm -f actual &&
echo grep.h >expect &&
-- 
1.8.2

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html