Unverified Commit 8a00de08 by Patrick Steinhardt Committed by GitHub

Merge pull request #4699 from nelhage/fetch-null-dst

git_refspec_transform: Handle NULL dst
parents c43658f6 ff8edac9
......@@ -277,7 +277,7 @@ int git_refspec_transform(git_buf *out, const git_refspec *spec, const char *nam
}
if (!spec->pattern)
return git_buf_puts(out, spec->dst);
return git_buf_puts(out, spec->dst ? spec->dst : "");
return refspec_transform(out, spec->src, spec->dst, name);
}
......
......@@ -111,6 +111,11 @@ void test_network_refspecs__transform_mid_star(void)
assert_valid_transform("refs/*:refs/*", "refs/heads/master", "refs/heads/master");
}
void test_network_refspecs__no_dst(void)
{
assert_valid_transform("refs/heads/master:", "refs/heads/master", "");
}
static void assert_invalid_transform(const char *refspec, const char *name)
{
git_refspec spec;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment