diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2016-06-10 08:50:53 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-06-20 11:49:00 -0700 |
commit | 0e4b63b5a8b8d369720f0671040113e347221042 (patch) | |
tree | 6a9f093a5d144983cf24153398a3f968102e9513 /t/t1404-update-ref-errors.sh | |
parent | t1404: rename file to t1404-update-ref-errors.sh (diff) | |
download | tgif-0e4b63b5a8b8d369720f0671040113e347221042.tar.xz |
t1404: remove "prefix" argument to test_update_rejected
The tests already set a variable called prefix and passed its value as
the first argument to this function. The old argument handling was
overwriting the global variable with its same value rather than creating
a local variable.
So change test_update_rejected to refer to the global variable rather
than taking the prefix as an argument.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1404-update-ref-errors.sh')
-rwxr-xr-x | t/t1404-update-ref-errors.sh | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/t/t1404-update-ref-errors.sh b/t/t1404-update-ref-errors.sh index 2818460ba9..541cad12a4 100755 --- a/t/t1404-update-ref-errors.sh +++ b/t/t1404-update-ref-errors.sh @@ -4,11 +4,10 @@ test_description='Test git update-ref error handling' . ./test-lib.sh test_update_rejected () { - prefix="$1" && - before="$2" && - pack="$3" && - create="$4" && - error="$5" && + before="$1" && + pack="$2" && + create="$3" && + error="$4" && printf "create $prefix/%s $C\n" $before | git update-ref --stdin && git for-each-ref $prefix >unchanged && @@ -37,7 +36,7 @@ test_expect_success 'setup' ' test_expect_success 'existing loose ref is a simple prefix of new' ' prefix=refs/1l && - test_update_rejected $prefix "a c e" false "b c/x d" \ + test_update_rejected "a c e" false "b c/x d" \ "$Q$prefix/c$Q exists; cannot create $Q$prefix/c/x$Q" ' @@ -45,7 +44,7 @@ test_expect_success 'existing loose ref is a simple prefix of new' ' test_expect_success 'existing packed ref is a simple prefix of new' ' prefix=refs/1p && - test_update_rejected $prefix "a c e" true "b c/x d" \ + test_update_rejected "a c e" true "b c/x d" \ "$Q$prefix/c$Q exists; cannot create $Q$prefix/c/x$Q" ' @@ -53,7 +52,7 @@ test_expect_success 'existing packed ref is a simple prefix of new' ' test_expect_success 'existing loose ref is a deeper prefix of new' ' prefix=refs/2l && - test_update_rejected $prefix "a c e" false "b c/x/y d" \ + test_update_rejected "a c e" false "b c/x/y d" \ "$Q$prefix/c$Q exists; cannot create $Q$prefix/c/x/y$Q" ' @@ -61,7 +60,7 @@ test_expect_success 'existing loose ref is a deeper prefix of new' ' test_expect_success 'existing packed ref is a deeper prefix of new' ' prefix=refs/2p && - test_update_rejected $prefix "a c e" true "b c/x/y d" \ + test_update_rejected "a c e" true "b c/x/y d" \ "$Q$prefix/c$Q exists; cannot create $Q$prefix/c/x/y$Q" ' @@ -69,7 +68,7 @@ test_expect_success 'existing packed ref is a deeper prefix of new' ' test_expect_success 'new ref is a simple prefix of existing loose' ' prefix=refs/3l && - test_update_rejected $prefix "a c/x e" false "b c d" \ + test_update_rejected "a c/x e" false "b c d" \ "$Q$prefix/c/x$Q exists; cannot create $Q$prefix/c$Q" ' @@ -77,7 +76,7 @@ test_expect_success 'new ref is a simple prefix of existing loose' ' test_expect_success 'new ref is a simple prefix of existing packed' ' prefix=refs/3p && - test_update_rejected $prefix "a c/x e" true "b c d" \ + test_update_rejected "a c/x e" true "b c d" \ "$Q$prefix/c/x$Q exists; cannot create $Q$prefix/c$Q" ' @@ -85,7 +84,7 @@ test_expect_success 'new ref is a simple prefix of existing packed' ' test_expect_success 'new ref is a deeper prefix of existing loose' ' prefix=refs/4l && - test_update_rejected $prefix "a c/x/y e" false "b c d" \ + test_update_rejected "a c/x/y e" false "b c d" \ "$Q$prefix/c/x/y$Q exists; cannot create $Q$prefix/c$Q" ' @@ -93,7 +92,7 @@ test_expect_success 'new ref is a deeper prefix of existing loose' ' test_expect_success 'new ref is a deeper prefix of existing packed' ' prefix=refs/4p && - test_update_rejected $prefix "a c/x/y e" true "b c d" \ + test_update_rejected "a c/x/y e" true "b c d" \ "$Q$prefix/c/x/y$Q exists; cannot create $Q$prefix/c$Q" ' @@ -101,7 +100,7 @@ test_expect_success 'new ref is a deeper prefix of existing packed' ' test_expect_success 'one new ref is a simple prefix of another' ' prefix=refs/5 && - test_update_rejected $prefix "a e" false "b c c/x d" \ + test_update_rejected "a e" false "b c c/x d" \ "cannot process $Q$prefix/c$Q and $Q$prefix/c/x$Q at the same time" ' |