summaryrefslogtreecommitdiff
path: root/t/helper
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-03-25 20:57:42 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-03-25 20:57:43 (GMT)
commit4d0e8996ec54e53149c2f24075eb64921ca61812 (patch)
tree32333cbbf2a91ed8708ceda7e8ce998ccb369fc2 /t/helper
parent38afd2d1ad8afc59e3bed02b8c4be2080e8e5150 (diff)
parent49d3c4b481f12c2ec655a71d5a5b9259a398d059 (diff)
downloadgit-4d0e8996ec54e53149c2f24075eb64921ca61812.zip
git-4d0e8996ec54e53149c2f24075eb64921ca61812.tar.gz
git-4d0e8996ec54e53149c2f24075eb64921ca61812.tar.bz2
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 409034c..313a153 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;
}