summaryrefslogtreecommitdiff
path: root/strbuf.c
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2021-10-08 21:08:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-10-08 22:06:06 (GMT)
commit155b517d5c8701f3b8bef78fe59d8fe33adbee96 (patch)
tree73c5f0876086349e4bc518a6a938f68e65cfa9dc /strbuf.c
parent8788195c8846be949e6cd4bd19c8dc5e6371ffd3 (diff)
downloadgit-155b517d5c8701f3b8bef78fe59d8fe33adbee96.zip
git-155b517d5c8701f3b8bef78fe59d8fe33adbee96.tar.gz
git-155b517d5c8701f3b8bef78fe59d8fe33adbee96.tar.bz2
merge-{ort,recursive}: remove add_submodule_odb()
After the parent commit and some of its ancestors, the only place commits are being accessed through alternates is in the user-facing message formatting code. Fix those, and remove the add_submodule_odb() calls. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'strbuf.c')
-rw-r--r--strbuf.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/strbuf.c b/strbuf.c
index c8a5789..b22e981 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -1059,15 +1059,21 @@ void strbuf_addftime(struct strbuf *sb, const char *fmt, const struct tm *tm,
strbuf_setlen(sb, sb->len + len);
}
-void strbuf_add_unique_abbrev(struct strbuf *sb, const struct object_id *oid,
- int abbrev_len)
+void strbuf_repo_add_unique_abbrev(struct strbuf *sb, struct repository *repo,
+ const struct object_id *oid, int abbrev_len)
{
int r;
strbuf_grow(sb, GIT_MAX_HEXSZ + 1);
- r = find_unique_abbrev_r(sb->buf + sb->len, oid, abbrev_len);
+ r = repo_find_unique_abbrev_r(repo, sb->buf + sb->len, oid, abbrev_len);
strbuf_setlen(sb, sb->len + r);
}
+void strbuf_add_unique_abbrev(struct strbuf *sb, const struct object_id *oid,
+ int abbrev_len)
+{
+ strbuf_repo_add_unique_abbrev(sb, the_repository, oid, abbrev_len);
+}
+
/*
* Returns the length of a line, without trailing spaces.
*