summaryrefslogtreecommitdiff
path: root/reflog-walk.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2017-02-21 23:47:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-02-22 18:12:15 (GMT)
commit8ebc3fd01bcedcb9a442da1114f37d1a4b8869a0 (patch)
treef7ebbc56900867cdd00729c7f6334b3fa4f5fa05 /reflog-walk.c
parentcea4332e5414f5506e6d0803811ba0b095d08518 (diff)
downloadgit-8ebc3fd01bcedcb9a442da1114f37d1a4b8869a0.zip
git-8ebc3fd01bcedcb9a442da1114f37d1a4b8869a0.tar.gz
git-8ebc3fd01bcedcb9a442da1114f37d1a4b8869a0.tar.bz2
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>
Diffstat (limited to 'reflog-walk.c')
-rw-r--r--reflog-walk.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/reflog-walk.c b/reflog-walk.c
index f98748e..fe5be41 100644
--- a/reflog-walk.c
+++ b/reflog-walk.c
@@ -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) {