diff options
| author | Carlos Martín Nieto <cmn@dwim.me> | 2015-05-22 12:11:42 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <cmn@dwim.me> | 2015-05-22 12:11:42 +0200 |
| commit | 7cd4ba1b17d579134ac6cc172fc858021d4aa407 (patch) | |
| tree | 6577897a31e21ce743c5f84425c729204e83341a /tests | |
| parent | a6ea108b569073c6e8dc915f1757a34a461ab56e (diff) | |
| download | libgit2-7cd4ba1b17d579134ac6cc172fc858021d4aa407.tar.gz | |
refspec: make sure matching refspecs have src, dst and input strings
When we find out that we're dealing with a matching refspec, we set the
flag and return immediately. This leaves the strings as NULL, which
breaks the contract.
Assign these pointers to a string with the correct values.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/network/refspecs.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/network/refspecs.c b/tests/network/refspecs.c index c6bcb10e8..614d91d07 100644 --- a/tests/network/refspecs.c +++ b/tests/network/refspecs.c @@ -146,3 +146,13 @@ void test_network_refspecs__invalid_reverse(void) assert_invalid_rtransform("refs/heads/*:refs/remotes/origin/*", "master"); assert_invalid_rtransform("refs/heads/*:refs/remotes/origin/*", "refs/remotes/o/master"); } + +void test_network_refspecs__matching(void) +{ + git_refspec spec; + + cl_git_pass(git_refspec__parse(&spec, ":", false)); + cl_assert_equal_s(":", spec.string); + cl_assert_equal_s("", spec.src); + cl_assert_equal_s("", spec.dst); +} |
