diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2017-10-15 22:06:59 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-10-16 11:05:51 +0900 |
commit | 334dc52f49ee3e56a32142d3500fe93ef79aac67 (patch) | |
tree | b9f130941739b6515f7d3588331bc562e1376e3a /refs.c | |
parent | b8acac54c8f91e2b677137665a2d750b086875dc (diff) | |
download | git-334dc52f49ee3e56a32142d3500fe93ef79aac67.tar.gz |
refs: convert dwim_log to struct object_id
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.c')
-rw-r--r-- | refs.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -497,7 +497,7 @@ int expand_ref(const char *str, int len, struct object_id *oid, char **ref) return refs_found; } -int dwim_log(const char *str, int len, unsigned char *sha1, char **log) +int dwim_log(const char *str, int len, struct object_id *oid, char **log) { char *last_branch = substitute_branch_name(&str, &len); const char **p; @@ -506,13 +506,13 @@ int dwim_log(const char *str, int len, unsigned char *sha1, char **log) *log = NULL; for (p = ref_rev_parse_rules; *p; p++) { - unsigned char hash[20]; + struct object_id hash; const char *ref, *it; strbuf_reset(&path); strbuf_addf(&path, *p, len, str); ref = resolve_ref_unsafe(path.buf, RESOLVE_REF_READING, - hash, NULL); + hash.hash, NULL); if (!ref) continue; if (reflog_exists(path.buf)) @@ -523,7 +523,7 @@ int dwim_log(const char *str, int len, unsigned char *sha1, char **log) continue; if (!logs_found++) { *log = xstrdup(it); - hashcpy(sha1, hash); + oidcpy(oid, &hash); } if (!warn_ambiguous_refs) break; |