Thread (14 messages) 14 messages, 3 authors, 2016-06-16

Re: [PATCH 4/6] t1500: avoid setting configuration options outside of tests

From: Eric Sunshine <hidden>
Date: 2016-06-16 02:19:17

On Tue, May 10, 2016 at 1:20 AM, Eric Sunshine [off-list ref] wrote:
quoted hunk ↗ jump to hunk
Ideally, each test should be responsible for setting up state it needs
rather than relying upon transient global state. Toward this end, teach
test_rev_parse() to accept a "-b <value>" option to allow callers to set
"core.bare" explicitly or undefine it, and take advantage of this new
option to avoid setting "core.bare" outside of tests.
[...snip...]

Signed-off-by: Eric Sunshine <redacted>
---
diff --git a/t/t1500-rev-parse.sh b/t/t1500-rev-parse.sh
@@ -6,15 +6,25 @@ test_description='test git rev-parse'
+       case "$bare" in
+       '') ;;
+       t*) bare="test_config $dir core.bare true" ;;
+       f*) bare="test_config $dir core.bare false" ;;
+       u*) bare="test_unconfig $dir core.bare" ;;
+       *) error "test_rev_parse: unrecognized core.bare value '$bare'"
Oops, this line lost its ;; at some point while refining the code.
+       esac
+
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help