Identify parts of the code that knows that we use SHA-1 hash to
name our objects too much, and use (1) symbolic constants instead
of hardcoded 20 as byte count and/or (2) use struct object_id
instead of unsigned char [20] for object names.
* bc/object-id:
apply: convert threeway_stage to object_id
patch-id: convert to use struct object_id
commit: convert parts to struct object_id
diff: convert struct combine_diff_path to object_id
bulk-checkin.c: convert to use struct object_id
zip: use GIT_SHA1_HEXSZ for trailers
archive.c: convert to use struct object_id
bisect.c: convert leaf functions to use struct object_id
define utility functions for object IDs
define a structure for object IDs
@ -903,7 +903,7 @@ int bisect_next_all(const char *prefix, int no_checkout)
@@ -903,7 +903,7 @@ int bisect_next_all(const char *prefix, int no_checkout)
struct commit_list *tried;
int reaches = 0, all = 0, nr, steps;
const unsigned char *bisect_rev;
char bisect_rev_hex[41];
char bisect_rev_hex[GIT_SHA1_HEXSZ + 1];
if (read_bisect_refs())
die("reading bisect refs failed");
@ -927,7 +927,7 @@ int bisect_next_all(const char *prefix, int no_checkout)
@@ -927,7 +927,7 @@ int bisect_next_all(const char *prefix, int no_checkout)
exit_if_skipped_commits(tried, NULL);
printf("%s was both good and bad\n",
sha1_to_hex(current_bad_sha1));
oid_to_hex(current_bad_oid));
exit(1);
}
@ -938,10 +938,10 @@ int bisect_next_all(const char *prefix, int no_checkout)
@@ -938,10 +938,10 @@ int bisect_next_all(const char *prefix, int no_checkout)
@ -53,23 +53,23 @@ static int scan_hunk_header(const char *p, int *p_before, int *p_after)
@@ -53,23 +53,23 @@ static int scan_hunk_header(const char *p, int *p_before, int *p_after)
for (i = GIT_SHA1_HEXSZ; i < len; i += entry_size) {
if (buf[i] != ' ')
goto bad_graft_data;
if (get_sha1_hex(buf + i + 1, graft->parent[i/41]))
if (get_sha1_hex(buf + i + 1, graft->parent[i/entry_size].hash))
goto bad_graft_data;
}
return graft;
@ -302,39 +303,42 @@ int parse_commit_buffer(struct commit *item, const void *buffer, unsigned long s
@@ -302,39 +303,42 @@ int parse_commit_buffer(struct commit *item, const void *buffer, unsigned long s
@ -342,7 +346,7 @@ int parse_commit_buffer(struct commit *item, const void *buffer, unsigned long s
@@ -342,7 +346,7 @@ int parse_commit_buffer(struct commit *item, const void *buffer, unsigned long s