summaryrefslogtreecommitdiff
path: root/tests/refs/normalize.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2019-04-26 10:15:49 +0200
committerPatrick Steinhardt <ps@pks.im>2019-04-26 10:25:09 +0200
commit51214b85dedc39b734cce9d09b9311221a31de4b (patch)
tree54ed5649d35949e70fab3d215cc2bd1ef0a9d16e /tests/refs/normalize.c
parent9d651e05f07513b26c44c97304282ad49e49fe9e (diff)
downloadlibgit2-51214b85dedc39b734cce9d09b9311221a31de4b.tar.gz
refs: loosen restriction on wildcard "*" refspecs
In commit cd377f45c9 (refs: loosen restriction on wildcard "*" refspecs, 2015-07-22) in git.git, the restrictions on wildcard "*" refspecs has been loosened. While wildcards were previously only allowed if the component is a single "*", this was changed to also accept other patterns as part of the component. We never adapted to that change and still reject any wildcard patterns that aren't a single "*" only. Update our tests to reflect the upstream change and adjust our own code accordingly.
Diffstat (limited to 'tests/refs/normalize.c')
-rw-r--r--tests/refs/normalize.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/refs/normalize.c b/tests/refs/normalize.c
index 6da005da0..ff815002c 100644
--- a/tests/refs/normalize.c
+++ b/tests/refs/normalize.c
@@ -352,12 +352,12 @@ void test_refs_normalize__buffer_has_to_be_big_enough_to_hold_the_normalized_ver
void test_refs_normalize__refspec_pattern(void)
{
- ensure_refname_invalid(
- GIT_REFERENCE_FORMAT_REFSPEC_PATTERN, "heads/*foo/bar");
- ensure_refname_invalid(
- GIT_REFERENCE_FORMAT_REFSPEC_PATTERN, "heads/foo*/bar");
- ensure_refname_invalid(
- GIT_REFERENCE_FORMAT_REFSPEC_PATTERN, "heads/f*o/bar");
+ ensure_refname_normalized(
+ GIT_REFERENCE_FORMAT_REFSPEC_PATTERN, "heads/*foo/bar", "heads/*foo/bar");
+ ensure_refname_normalized(
+ GIT_REFERENCE_FORMAT_REFSPEC_PATTERN, "heads/foo*/bar", "heads/foo*/bar");
+ ensure_refname_normalized(
+ GIT_REFERENCE_FORMAT_REFSPEC_PATTERN, "heads/f*o/bar", "heads/f*o/bar");
ensure_refname_invalid(
GIT_REFERENCE_FORMAT_REFSPEC_PATTERN, "foo");