summaryrefslogtreecommitdiff
path: root/test-path-utils.c
diff options
context:
space:
mode:
authorDavid Reiss <dreiss@facebook.com>2008-05-20 06:49:26 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-05-23 21:15:01 (GMT)
commit0454dd93bfb2334355ec62fff670d8c6cb3570a1 (patch)
tree8c0b1ada7cce01e71c2a2bbed0cfd23a26db8ba2 /test-path-utils.c
parentd553e737897e8edbbc2092bf345fc58b2dae5251 (diff)
downloadgit-0454dd93bfb2334355ec62fff670d8c6cb3570a1.zip
git-0454dd93bfb2334355ec62fff670d8c6cb3570a1.tar.gz
git-0454dd93bfb2334355ec62fff670d8c6cb3570a1.tar.bz2
Add support for GIT_CEILING_DIRECTORIES
Make git recognize a new environment variable that prevents it from chdir'ing up into specified directories when looking for a GIT_DIR. Useful for avoiding slow network directories. For example, I use git in an environment where homedirs are automounted and "ls /home/nonexistent" takes about 9 seconds. Setting GIT_CEILING_DIRS="/home" allows "git help -a" (for bash completion) and "git symbolic-ref" (for my shell prompt) to run in a reasonable time. Signed-off-by: David Reiss <dreiss@facebook.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'test-path-utils.c')
-rw-r--r--test-path-utils.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/test-path-utils.c b/test-path-utils.c
index 842b580..a0bcb0e 100644
--- a/test-path-utils.c
+++ b/test-path-utils.c
@@ -17,5 +17,10 @@ int main(int argc, char **argv)
}
}
+ if (argc == 4 && !strcmp(argv[1], "longest_ancestor_length")) {
+ int len = longest_ancestor_length(argv[2], argv[3]);
+ printf("%d\n", len);
+ }
+
return 0;
}