memset(commit, 0x0, sizeof(git_commit));
- // Initialize parent object
+ /* Initialize parent object */
git_oid_cpy(&commit->object.id, id);
commit->object.pool = pool;
if ((parent = git_commit_lookup(commit->object.pool, &oid)) == NULL)
return GIT_ENOTFOUND;
- // Inherit uninteresting flag
+ /* Inherit uninteresting flag */
if (commit->uninteresting)
parent->uninteresting = 1;
if (table == NULL)
return NULL;
- // round up size to closest power of 2
+ /* round up size to closest power of 2 */
min_size--;
min_size |= min_size >> 1;
min_size |= min_size >> 2;
return error;
}
- // Sanity check: make sure that if the commit
- // has been manually marked as uninteresting,
- // all the parent commits are too.
+ /*
+ * Sanity check: make sure that if the commit
+ * has been manually marked as uninteresting,
+ * all the parent commits are too.
+ */
if (commit->uninteresting)
git_commit__mark_uninteresting(commit);
return next;
}
- // No commits left to iterate
+ /* No commits left to iterate */
gitrp_reset(pool);
return NULL;
}
static char *test_commits_broken[] = {
- // empty commit
+ /* empty commit */
"",
- // random garbage
+ /* random garbage */
"asd97sa9du902e9a0jdsuusad09as9du098709aweu8987sd\n",
- // broken endlines 1
+ /* broken endlines 1 */
"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\r\n\
parent 05452d6349abcd67aa396dfb28660d765d8b2a36\r\n\
author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\r\n\
\r\n\
a test commit with broken endlines\r\n",
- // broken endlines 2
+ /* broken endlines 2 */
"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\
parent 05452d6349abcd67aa396dfb28660d765d8b2a36\
author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\
\
another test commit with broken endlines",
- // starting endlines
+ /* starting endlines */
"\ntree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
parent 05452d6349abcd67aa396dfb28660d765d8b2a36\n\
author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
\n\
a test commit with a starting endline\n",
- // corrupted commit 1
+ /* corrupted commit 1 */
"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
parent 05452d6349abcd67aa396df",
- // corrupted commit 2
+ /* corrupted commit 2 */
"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
parent ",
- // corrupted commit 3
+ /* corrupted commit 3 */
"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
parent ",
- // corrupted commit 4
+ /* corrupted commit 4 */
"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
par",
- // FIXME: duplicated parents?
- // It this supposed to pass?
+ /*
+ * FIXME: duplicated parents?
+ * It this supposed to pass?
+ */
/*
"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
parent 05452d6349abcd67aa396dfb28660d765d8b2a36\n\
static char *test_commits_working[] = {
- // simple commit with no message
+ /* simple commit with no message */
"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
\n",
- // simple commit, no parent
+ /* simple commit, no parent */
"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
\n\
a simple commit which works\n",
- // simple commit, 1 parents
+ /* simple commit, 1 parents */
"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
parent 05452d6349abcd67aa396dfb28660d765d8b2a36\n\
author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
for (t = 0; t < 20; ++t) {
const int test_size = rand() % 500 + 500;
- // Purely random sorting test
+ /* Purely random sorting test */
for (i = 0; i < test_size; ++i) {
git_commit *c = git__malloc(sizeof(git_commit));
c->commit_time = (time_t)rand();
git_commit_list_clear(&list, 1);
}
- // Try to sort list with all dates equal.
+ /* Try to sort list with all dates equal. */
for (i = 0; i < 200; ++i) {
git_commit *c = git__malloc(sizeof(git_commit));
c->commit_time = 0;
TEST_SORTED();
git_commit_list_clear(&list, 1);
- // Try to sort empty list
+ /* Try to sort empty list */
git_commit_list_timesort(&list);
TEST_SORTED();
static const char *commit_head = "a4a7dce85cf63874e984719f4fdd239f5145052f";
static const char *commit_ids[] = {
- "a4a7dce85cf63874e984719f4fdd239f5145052f", // 0
- "9fd738e8f7967c078dceed8190330fc8648ee56a", // 1
- "4a202b346bb0fb0db7eff3cffeb3c70babbd2045", // 2
- "c47800c7266a2be04c571c04d5a6614691ea99bd", // 3
- "8496071c1b46c854b31185ea97743be6a8774479", // 4
- "5b5b025afb0b4c913b4c338a42934a3863bf3644", // 5
+ "a4a7dce85cf63874e984719f4fdd239f5145052f", /* 0 */
+ "9fd738e8f7967c078dceed8190330fc8648ee56a", /* 1 */
+ "4a202b346bb0fb0db7eff3cffeb3c70babbd2045", /* 2 */
+ "c47800c7266a2be04c571c04d5a6614691ea99bd", /* 3 */
+ "8496071c1b46c854b31185ea97743be6a8774479", /* 4 */
+ "5b5b025afb0b4c913b4c338a42934a3863bf3644", /* 5 */
};
static const int commit_sorting_topo[] = {0, 1, 2, 3, 5, 4};