summaryrefslogtreecommitdiff
path: root/t/helper
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-03-25 13:57:42 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-03-25 13:57:43 -0700
commit4d0e8996ec54e53149c2f24075eb64921ca61812 (patch)
tree32333cbbf2a91ed8708ceda7e8ce998ccb369fc2 /t/helper
parentMerge branch 'sg/commit-slab-clarify-peek' (diff)
parentget_superproject_working_tree(): return strbuf (diff)
downloadtgif-4d0e8996ec54e53149c2f24075eb64921ca61812.tar.xz
Merge branch 'am/real-path-fix'
The real_path() convenience function can easily be misused; with a bit of code refactoring in the callers' side, its use has been eliminated. * am/real-path-fix: get_superproject_working_tree(): return strbuf real_path_if_valid(): remove unsafe API real_path: remove unsafe API set_git_dir: fix crash when used with real_path()
Diffstat (limited to 't/helper')
-rw-r--r--t/helper/test-path-utils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/t/helper/test-path-utils.c b/t/helper/test-path-utils.c
index 409034cf4e..313a153209 100644
--- a/t/helper/test-path-utils.c
+++ b/t/helper/test-path-utils.c
@@ -290,11 +290,14 @@ int cmd__path_utils(int argc, const char **argv)
}
if (argc >= 2 && !strcmp(argv[1], "real_path")) {
+ struct strbuf realpath = STRBUF_INIT;
while (argc > 2) {
- puts(real_path(argv[2]));
+ strbuf_realpath(&realpath, argv[2], 1);
+ puts(realpath.buf);
argc--;
argv++;
}
+ strbuf_release(&realpath);
return 0;
}