summaryrefslogtreecommitdiff
path: root/reflog-walk.c
diff options
context:
space:
mode:
authorLibravatar brian m. carlson <sandals@crustytoothpaste.net>2017-02-21 23:47:29 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-02-22 10:12:15 -0800
commit2928325fc0b676876fcda5ffcbc461695aaedbb8 (patch)
treebbe6fa6cbfad815394e85025adbd8fda34c9b7cf /reflog-walk.c
parentbuiltin/merge: convert to struct object_id (diff)
downloadtgif-2928325fc0b676876fcda5ffcbc461695aaedbb8.tar.xz
Convert remaining callers of resolve_refdup to object_id
There are a few leaf functions in various files that call resolve_refdup. Convert these functions to use struct object_id internally to prepare for transitioning resolve_refdup itself. 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 a246af2767..f98748e2ae 100644
--- a/reflog-walk.c
+++ b/reflog-walk.c
@@ -45,11 +45,11 @@ static struct complete_reflogs *read_complete_reflog(const char *ref)
reflogs->ref = xstrdup(ref);
for_each_reflog_ent(ref, read_one_reflog, reflogs);
if (reflogs->nr == 0) {
- unsigned char sha1[20];
+ struct object_id oid;
const char *name;
void *name_to_free;
name = name_to_free = resolve_refdup(ref, RESOLVE_REF_READING,
- sha1, NULL);
+ oid.hash, NULL);
if (name) {
for_each_reflog_ent(name, read_one_reflog, reflogs);
free(name_to_free);
@@ -172,18 +172,18 @@ int add_reflog_for_walk(struct reflog_walk_info *info,
reflogs = item->util;
else {
if (*branch == '\0') {
- unsigned char sha1[20];
+ struct object_id oid;
free(branch);
- branch = resolve_refdup("HEAD", 0, sha1, NULL);
+ branch = resolve_refdup("HEAD", 0, oid.hash, NULL);
if (!branch)
die ("No current branch");
}
reflogs = read_complete_reflog(branch);
if (!reflogs || reflogs->nr == 0) {
- unsigned char sha1[20];
+ struct object_id oid;
char *b;
- if (dwim_log(branch, strlen(branch), sha1, &b) == 1) {
+ if (dwim_log(branch, strlen(branch), oid.hash, &b) == 1) {
if (reflogs) {
free(reflogs->ref);
free(reflogs);