Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
reflog-walk: convert struct reflog_info to struct object_id
author
brian m. carlson
<sandals@crustytoothpaste.net>
Tue, 21 Feb 2017 23:47:31 +0000
(23:47 +0000)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 22 Feb 2017 18:12:15 +0000
(10:12 -0800)
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>
reflog-walk.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
cea4332
)
diff --git
a/reflog-walk.c
b/reflog-walk.c
index f98748e2aea4a390f23174d179f3d2b1c73fa836..fe5be41471983086a7d3b00c85b0a77891904641 100644
(file)
--- a/
reflog-walk.c
+++ b/
reflog-walk.c
@@
-10,7
+10,7
@@
struct complete_reflogs {
char *ref;
const char *short_ref;
struct reflog_info {
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;
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;
ALLOC_GROW(array->items, array->nr + 1, array->alloc);
item = array->items + array->nr;
- hashcpy(item->o
sha1
, osha1);
- hashcpy(item->n
sha1
, nsha1);
+ hashcpy(item->o
oid.hash
, osha1);
+ hashcpy(item->n
oid.hash
, nsha1);
item->email = xstrdup(email);
item->timestamp = timestamp;
item->tz = tz;
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--;
do {
reflog = &commit_reflog->reflogs->items[commit_reflog->recno];
commit_reflog->recno--;
- logobj = parse_object(reflog->o
sha1
);
+ logobj = parse_object(reflog->o
oid.hash
);
} while (commit_reflog->recno && (logobj && logobj->type != OBJ_COMMIT));
} while (commit_reflog->recno && (logobj && logobj->type != OBJ_COMMIT));
- if (!logobj && commit_reflog->recno >= 0 && is_null_sha1(reflog->o
sha1
)) {
+ if (!logobj && commit_reflog->recno >= 0 && is_null_sha1(reflog->o
oid.hash
)) {
/* a root commit, but there are still more entries to show */
reflog = &commit_reflog->reflogs->items[commit_reflog->recno];
/* a root commit, but there are still more entries to show */
reflog = &commit_reflog->reflogs->items[commit_reflog->recno];
- logobj = parse_object(reflog->n
sha1
);
+ logobj = parse_object(reflog->n
oid.hash
);
}
if (!logobj || logobj->type != OBJ_COMMIT) {
}
if (!logobj || logobj->type != OBJ_COMMIT) {