From: Linus Torvalds Date: Mon, 4 Jul 2005 22:28:19 +0000 (-0700) Subject: Clean up output of "for_each_ref()" when GIT_DIR is "." X-Git-Tag: v0.99~79 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6cada6a98d357a4891cafa241e04c5fcb500107a;p=git.git Clean up output of "for_each_ref()" when GIT_DIR is "." Remove the "./" at the head, it just looks much nicer. --- diff --git a/refs.c b/refs.c index 447080edd..7ccd721a4 100644 --- a/refs.c +++ b/refs.c @@ -26,6 +26,11 @@ static int do_for_each_ref(const char *base, int (*fn)(const char *path, const u struct dirent *de; int baselen = strlen(base); char *path = xmalloc(baselen + 257); + + if (!strncmp(base, "./", 2)) { + base += 2; + baselen -= 2; + } memcpy(path, base, baselen); if (baselen && base[baselen-1] != '/') path[baselen++] = '/';