mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-06 09:41:04 +00:00
Style: Fix brace placement and spacing
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Andreas Ericsson <ae@op5.se>
This commit is contained in:
parent
702bd70595
commit
b2bc567f25
@ -85,8 +85,7 @@ int git_commit_parse_existing(git_commit *commit)
|
|||||||
if (error < 0)
|
if (error < 0)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
if (commit_obj.type != GIT_OBJ_COMMIT)
|
if (commit_obj.type != GIT_OBJ_COMMIT) {
|
||||||
{
|
|
||||||
error = GIT_EOBJTYPE;
|
error = GIT_EOBJTYPE;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ BEGIN_TEST(parse_oid_test)
|
|||||||
|
|
||||||
git_oid oid;
|
git_oid oid;
|
||||||
|
|
||||||
#define TEST_OID_PASS(string, header){ \
|
#define TEST_OID_PASS(string, header) { \
|
||||||
char *ptr = string;\
|
char *ptr = string;\
|
||||||
char *ptr_original = ptr;\
|
char *ptr_original = ptr;\
|
||||||
size_t len = strlen(ptr);\
|
size_t len = strlen(ptr);\
|
||||||
@ -102,7 +102,7 @@ BEGIN_TEST(parse_oid_test)
|
|||||||
must_be_true(ptr == ptr_original + len);\
|
must_be_true(ptr == ptr_original + len);\
|
||||||
}
|
}
|
||||||
|
|
||||||
#define TEST_OID_FAIL(string, header){ \
|
#define TEST_OID_FAIL(string, header) { \
|
||||||
char *ptr = string;\
|
char *ptr = string;\
|
||||||
size_t len = strlen(ptr);\
|
size_t len = strlen(ptr);\
|
||||||
must_fail(git_commit__parse_oid(&oid, &ptr, ptr + len, header));\
|
must_fail(git_commit__parse_oid(&oid, &ptr, ptr + len, header));\
|
||||||
|
@ -13,8 +13,7 @@ BEGIN_TEST(list_timesort_test)
|
|||||||
|
|
||||||
#define TEST_SORTED() \
|
#define TEST_SORTED() \
|
||||||
previous_time = INT_MAX;\
|
previous_time = INT_MAX;\
|
||||||
for (n = list.head; n != NULL; n = n->next)\
|
for (n = list.head; n != NULL; n = n->next) {\
|
||||||
{\
|
|
||||||
must_be_true(n->commit->commit_time <= previous_time);\
|
must_be_true(n->commit->commit_time <= previous_time);\
|
||||||
previous_time = n->commit->commit_time;\
|
previous_time = n->commit->commit_time;\
|
||||||
}
|
}
|
||||||
@ -22,13 +21,11 @@ BEGIN_TEST(list_timesort_test)
|
|||||||
memset(&list, 0x0, sizeof(git_commit_list));
|
memset(&list, 0x0, sizeof(git_commit_list));
|
||||||
srand((unsigned int)time(NULL));
|
srand((unsigned int)time(NULL));
|
||||||
|
|
||||||
for (t = 0; t < 20; ++t)
|
for (t = 0; t < 20; ++t) {
|
||||||
{
|
|
||||||
const int test_size = rand() % 500 + 500;
|
const int test_size = rand() % 500 + 500;
|
||||||
|
|
||||||
// Purely random sorting test
|
// Purely random sorting test
|
||||||
for (i = 0; i < test_size; ++i)
|
for (i = 0; i < test_size; ++i) {
|
||||||
{
|
|
||||||
git_commit *c = git__malloc(sizeof(git_commit));
|
git_commit *c = git__malloc(sizeof(git_commit));
|
||||||
c->commit_time = (time_t)rand();
|
c->commit_time = (time_t)rand();
|
||||||
|
|
||||||
@ -41,8 +38,7 @@ BEGIN_TEST(list_timesort_test)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Try to sort list with all dates equal.
|
// Try to sort list with all dates equal.
|
||||||
for (i = 0; i < 200; ++i)
|
for (i = 0; i < 200; ++i) {
|
||||||
{
|
|
||||||
git_commit *c = git__malloc(sizeof(git_commit));
|
git_commit *c = git__malloc(sizeof(git_commit));
|
||||||
c->commit_time = 0;
|
c->commit_time = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user