diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-06-12 13:37:15 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-06-12 13:37:15 -0700 |
| commit | 22cf18fd9ede79bdfe5ac93e09986a64052e5781 (patch) | |
| tree | 8ab7f912a4b11df3c9397d4a7332510eb3594205 /builtin/submodule--helper.c | |
| parent | 56346ba24e16274196180a859d27a8199acb6150 (diff) | |
| parent | 279493254864f0cbc002e1768de6e4f634c8150c (diff) | |
| download | git-22cf18fd9ede79bdfe5ac93e09986a64052e5781.tar.gz | |
Merge branch 'gt/t-hash-unit-test'
A pair of test helpers that essentially are unit tests on hash
algorithms have been rewritten using the unit-tests framework.
* gt/t-hash-unit-test:
t/: migrate helper/test-{sha1, sha256} to unit-tests/t-hash
strbuf: introduce strbuf_addstrings() to repeatedly add a string
Diffstat (limited to 'builtin/submodule--helper.c')
| -rw-r--r-- | builtin/submodule--helper.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index 897f19868e..880ab4456e 100644 --- a/builtin/submodule--helper.c +++ b/builtin/submodule--helper.c @@ -256,11 +256,9 @@ static void module_list_active(struct module_list *list) static char *get_up_path(const char *path) { - int i; struct strbuf sb = STRBUF_INIT; - for (i = count_slashes(path); i; i--) - strbuf_addstr(&sb, "../"); + strbuf_addstrings(&sb, "../", count_slashes(path)); /* * Check if 'path' ends with slash or not |
