diff options
author | Martin Ågren <martin.agren@gmail.com> | 2020-09-27 15:15:41 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-09-27 23:21:47 +0200 |
commit | b1f1ade87be595b5854c82850658c80465fdb16b (patch) | |
tree | ab0476e0d51c98e169951a183edd3a02456ac49c /wt-status.c | |
parent | Thirteenth batch (diff) | |
download | git-b1f1ade87be595b5854c82850658c80465fdb16b.tar.xz git-b1f1ade87be595b5854c82850658c80465fdb16b.zip |
wt-status: replace sha1 mentions with oid
`abbrev_sha1_in_line()` uses a `struct object_id oid` and should be
fully prepared to handle non-SHA1 object ids. Rename it to
`abbrev_oid_in_line()`.
A few comments in `wt_status_get_detached_from()` mention "sha1". The
variable they refer to was renamed in e86ab2c1cd ("wt-status: convert to
struct object_id", 2017-02-21). Update the comments to reference "oid"
instead.
Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'wt-status.c')
-rw-r--r-- | wt-status.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/wt-status.c b/wt-status.c index bb0f9120de..528130614b 100644 --- a/wt-status.c +++ b/wt-status.c @@ -1227,7 +1227,7 @@ static int split_commit_in_progress(struct wt_status *s) * The function assumes that the line does not contain useless spaces * before or after the command. */ -static void abbrev_sha1_in_line(struct strbuf *line) +static void abbrev_oid_in_line(struct strbuf *line) { struct strbuf **split; int i; @@ -1277,7 +1277,7 @@ static int read_rebase_todolist(const char *fname, struct string_list *lines) strbuf_trim(&line); if (!line.len) continue; - abbrev_sha1_in_line(&line); + abbrev_oid_in_line(&line); string_list_append(lines, line.buf); } fclose(f); @@ -1570,9 +1570,9 @@ static void wt_status_get_detached_from(struct repository *r, } if (dwim_ref(cb.buf.buf, cb.buf.len, &oid, &ref) == 1 && - /* sha1 is a commit? match without further lookup */ + /* oid is a commit? match without further lookup */ (oideq(&cb.noid, &oid) || - /* perhaps sha1 is a tag, try to dereference to a commit */ + /* perhaps oid is a tag, try to dereference to a commit */ ((commit = lookup_commit_reference_gently(r, &oid, 1)) != NULL && oideq(&cb.noid, &commit->object.oid)))) { const char *from = ref; |