By returning when the count goes to zero rather than below it, setting
`howmany` to 7 in fact writes out the string 6 times.
Correct the termination condition to write out the string the amount of
times we specify.
count = (int *)payload;
(*count)--;
count = (int *)payload;
(*count)--;
return 0;
strcpy(content, textual_content);
return 0;
strcpy(content, textual_content);
{
git_oid expected_oid, oid;
git_object *blob;
{
git_oid expected_oid, oid;
git_object *blob;
cl_git_pass(git_oid_fromstr(&expected_oid, "321cbdf08803c744082332332838df6bd160f8f9"));
cl_git_pass(git_oid_fromstr(&expected_oid, "321cbdf08803c744082332332838df6bd160f8f9"));
git_buf path = GIT_BUF_INIT;
git_buf content = GIT_BUF_INIT;
git_oid expected_oid, oid;
git_buf path = GIT_BUF_INIT;
git_buf content = GIT_BUF_INIT;
git_oid expected_oid, oid;
cl_git_pass(git_oid_fromstr(&expected_oid, "321cbdf08803c744082332332838df6bd160f8f9"));
cl_git_pass(git_oid_fromstr(&expected_oid, "321cbdf08803c744082332332838df6bd160f8f9"));
static void assert_named_chunked_blob(const char *expected_sha, const char *fake_name)
{
git_oid expected_oid, oid;
static void assert_named_chunked_blob(const char *expected_sha, const char *fake_name)
{
git_oid expected_oid, oid;
cl_git_pass(git_oid_fromstr(&expected_oid, expected_sha));
cl_git_pass(git_oid_fromstr(&expected_oid, expected_sha));
for (i = 0; i < howmany; i++)
cl_git_pass(stream->write(stream, textual_content, strlen(textual_content)));
for (i = 0; i < howmany; i++)
cl_git_pass(stream->write(stream, textual_content, strlen(textual_content)));
- cl_git_pass(git_blob_create_fromstream_end(&id, stream));
+ cl_git_pass(git_blob_create_fromstream_commit(&id, stream));
cl_assert_equal_oid(&expected_id, &id);
cl_git_pass(git_object_lookup(&blob, repo, &expected_id, GIT_OBJ_BLOB));
cl_assert_equal_oid(&expected_id, &id);
cl_git_pass(git_object_lookup(&blob, repo, &expected_id, GIT_OBJ_BLOB));
for (i = 0; i < howmany; i++)
cl_git_pass(stream->write(stream, textual_content, strlen(textual_content)));
for (i = 0; i < howmany; i++)
cl_git_pass(stream->write(stream, textual_content, strlen(textual_content)));
- cl_git_pass(git_blob_create_fromstream_end(&id, stream));
+ cl_git_pass(git_blob_create_fromstream_commit(&id, stream));
cl_assert_equal_oid(&expected_id, &id);
}
cl_assert_equal_oid(&expected_id, &id);
}