reflog-walk: convert struct reflog_info to struct object_id
Convert struct reflog_info to use struct object_id by changing the structure definition and applying the following semantic patch: @@ struct reflog_info E1; @@ - E1.osha1 + E1.ooid.hash @@ struct reflog_info *E1; @@ - E1->osha1 + E1->ooid.hash @@ struct reflog_info E1; @@ - E1.nsha1 + E1.noid.hash @@ struct reflog_info *E1; @@ - E1->nsha1 + E1->noid.hash Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
cea4332e54
commit
8ebc3fd01b
@ -10,7 +10,7 @@ struct complete_reflogs {
|
||||
char *ref;
|
||||
const char *short_ref;
|
||||
struct reflog_info {
|
||||
unsigned char osha1[20], nsha1[20];
|
||||
struct object_id ooid, noid;
|
||||
char *email;
|
||||
unsigned long timestamp;
|
||||
int tz;
|
||||
@ -28,8 +28,8 @@ static int read_one_reflog(unsigned char *osha1, unsigned char *nsha1,
|
||||
|
||||
ALLOC_GROW(array->items, array->nr + 1, array->alloc);
|
||||
item = array->items + array->nr;
|
||||
hashcpy(item->osha1, osha1);
|
||||
hashcpy(item->nsha1, nsha1);
|
||||
hashcpy(item->ooid.hash, osha1);
|
||||
hashcpy(item->noid.hash, nsha1);
|
||||
item->email = xstrdup(email);
|
||||
item->timestamp = timestamp;
|
||||
item->tz = tz;
|
||||
@ -238,13 +238,13 @@ void fake_reflog_parent(struct reflog_walk_info *info, struct commit *commit)
|
||||
do {
|
||||
reflog = &commit_reflog->reflogs->items[commit_reflog->recno];
|
||||
commit_reflog->recno--;
|
||||
logobj = parse_object(reflog->osha1);
|
||||
logobj = parse_object(reflog->ooid.hash);
|
||||
} while (commit_reflog->recno && (logobj && logobj->type != OBJ_COMMIT));
|
||||
|
||||
if (!logobj && commit_reflog->recno >= 0 && is_null_sha1(reflog->osha1)) {
|
||||
if (!logobj && commit_reflog->recno >= 0 && is_null_sha1(reflog->ooid.hash)) {
|
||||
/* a root commit, but there are still more entries to show */
|
||||
reflog = &commit_reflog->reflogs->items[commit_reflog->recno];
|
||||
logobj = parse_object(reflog->nsha1);
|
||||
logobj = parse_object(reflog->noid.hash);
|
||||
}
|
||||
|
||||
if (!logobj || logobj->type != OBJ_COMMIT) {
|
||||
|
Loading…
Reference in New Issue
Block a user