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>
Martin Ågren committed
Sep 27, 2020 at 15:15 UTC
b1f1ade87be595b5854c82850658c80465fdb16b
1 file changed
+4
-4
wt-status.c
+4
-4
@@ -1227,7 +1227,7 @@ static int split_commit_in_progress(struct wt_status *s)
1227
* The function assumes that the line does not contain useless spaces
1228
* before or after the command.
1229
*/
1230
-static void abbrev_sha1_in_line(struct strbuf *line)
1230
+static void abbrev_oid_in_line(struct strbuf *line)
1231
{
1232
struct strbuf **split;
1233
int i;
@@ -1277,7 +1277,7 @@ static int read_rebase_todolist(const char *fname, struct string_list *lines)
1277
strbuf_trim(&line);
1278
if (!line.len)
1279
continue;
1280
- abbrev_sha1_in_line(&line);
1280
+ abbrev_oid_in_line(&line);
1281
string_list_append(lines, line.buf);
1282
}
1283
fclose(f);
@@ -1570,9 +1570,9 @@ static void wt_status_get_detached_from(struct repository *r,
1570
}
1571
1572
if (dwim_ref(cb.buf.buf, cb.buf.len, &oid, &ref) == 1 &&
1573
- /* sha1 is a commit? match without further lookup */
1573
+ /* oid is a commit? match without further lookup */
1574
(oideq(&cb.noid, &oid) ||
1575
- /* perhaps sha1 is a tag, try to dereference to a commit */
1575
+ /* perhaps oid is a tag, try to dereference to a commit */
1576
((commit = lookup_commit_reference_gently(r, &oid, 1)) != NULL &&
1577
oideq(&cb.noid, &commit->object.oid)))) {
1578
const char *from = ref;