X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=test-path-utils.c;h=3bc20e91da561f4edd5c3eddb0988735759234e4;hb=d82829b6128263951569221ca0c00dd143da055c;hp=d261398d6c50aeefa7450b99caae23ee5cdff0d0;hpb=03f94ae9f909952ed5a78917ab319a312889354b;p=git.git diff --git a/test-path-utils.c b/test-path-utils.c index d261398d6..3bc20e91d 100644 --- a/test-path-utils.c +++ b/test-path-utils.c @@ -11,9 +11,18 @@ int main(int argc, char **argv) return 0; } - if (argc >= 2 && !strcmp(argv[1], "make_absolute_path")) { + if (argc >= 2 && !strcmp(argv[1], "real_path")) { while (argc > 2) { - puts(make_absolute_path(argv[2])); + puts(real_path(argv[2])); + argc--; + argv++; + } + return 0; + } + + if (argc >= 2 && !strcmp(argv[1], "absolute_path")) { + while (argc > 2) { + puts(absolute_path(argv[2])); argc--; argv++; } @@ -26,6 +35,19 @@ int main(int argc, char **argv) return 0; } + if (argc >= 4 && !strcmp(argv[1], "prefix_path")) { + char *prefix = argv[2]; + int prefix_len = strlen(prefix); + int nongit_ok; + setup_git_directory_gently(&nongit_ok); + while (argc > 3) { + puts(prefix_path(prefix, prefix_len, argv[3])); + argc--; + argv++; + } + return 0; + } + if (argc == 4 && !strcmp(argv[1], "strip_path_suffix")) { char *prefix = strip_path_suffix(argv[2], argv[3]); printf("%s\n", prefix ? prefix : "(null)");