Re: [PATCH v2 11/53] fast-import: convert to struct object_id
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- May 1, 2017, 22:07 UTC
- Message-ID
- <165f4108-267b-f522-d78d-36b0064ee48c@google.com>
- In-Reply-To
- <20170501022946.258735-12-sandals@crustytoothpaste.net>
On 04/30/2017 07:29 PM, brian m. carlson wrote:
Show 13 quoted lines
> @@ -391,10 +391,8 @@ static void write_branch_report(FILE *rpt, struct branch *b)
> fputc('\n', rpt);
>
> fprintf(rpt, " tip commit : %s\n", oid_to_hex(&b->oid));
> - fprintf(rpt, " old tree : %s\n",
> - oid_to_hex(&b->branch_tree.versions[0].oid));
> - fprintf(rpt, " cur tree : %s\n",
> - oid_to_hex(&b->branch_tree.versions[1].oid));
> + fprintf(rpt, " old tree : %s\n", oid_to_hex(&b->branch_tree.versions[0].oid));
> + fprintf(rpt, " cur tree : %s\n", oid_to_hex(&b->branch_tree.versions[1].oid));
> fprintf(rpt, " commit clock: %" PRIuMAX "\n", b->last_commit);
>
> fputs(" last pack : ", rpt);These look like unnecessary line rewrappings.
Show 11 quoted lines
> @@ -2298,8 +2296,12 @@ static uintmax_t do_change_note_fanout(
> static uintmax_t change_note_fanout(struct tree_entry *root,
> unsigned char fanout)
> {
> - char hex_sha1[40], path[60];
> - return do_change_note_fanout(root, root, hex_sha1, 0, path, 0, fanout);
> + /*
> + * The size of path is due to one slash between every two hex digits,
> + * plus the terminating NUL.
> + */
> + char hex_oid[GIT_MAX_HEXSZ], path[GIT_MAX_HEXSZ * 3 / 2];If your comment is correct, shouldn't the size of path be 61 (that is, add "+ 1")? I took a look at do_change_note_fanout() and your comment seems correct.
> + return do_change_note_fanout(root, root, hex_oid, 0, path, 0, fanout); > } > > /*
Other than these, patches 10 and 11 look fine.