Skip to content

Commit b1f1ade

Browse files
Martin Ågrengitster
authored andcommitted
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 e86ab2c ("wt-status: convert to struct object_id", 2017-02-21). Update the comments to reference "oid" instead. Signed-off-by: Martin Ågren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3a238e5 commit b1f1ade

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

wt-status.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,7 @@ static int split_commit_in_progress(struct wt_status *s)
12271227
* The function assumes that the line does not contain useless spaces
12281228
* before or after the command.
12291229
*/
1230-
static void abbrev_sha1_in_line(struct strbuf *line)
1230+
static void abbrev_oid_in_line(struct strbuf *line)
12311231
{
12321232
struct strbuf **split;
12331233
int i;
@@ -1277,7 +1277,7 @@ static int read_rebase_todolist(const char *fname, struct string_list *lines)
12771277
strbuf_trim(&line);
12781278
if (!line.len)
12791279
continue;
1280-
abbrev_sha1_in_line(&line);
1280+
abbrev_oid_in_line(&line);
12811281
string_list_append(lines, line.buf);
12821282
}
12831283
fclose(f);
@@ -1570,9 +1570,9 @@ static void wt_status_get_detached_from(struct repository *r,
15701570
}
15711571

15721572
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 */
15741574
(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 */
15761576
((commit = lookup_commit_reference_gently(r, &oid, 1)) != NULL &&
15771577
oideq(&cb.noid, &commit->object.oid)))) {
15781578
const char *from = ref;

0 commit comments

Comments
 (0)