diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-04 15:28:19 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-04 15:28:19 -0700 |
commit | 6cada6a98d357a4891cafa241e04c5fcb500107a (patch) | |
tree | 3e4b562be429e44de0918a909777bf2f2ebb406e /refs.c | |
parent | def88e9afbf915ad76781aba7274398963b5e1a7 (diff) | |
download | git-6cada6a98d357a4891cafa241e04c5fcb500107a.tar.gz git-6cada6a98d357a4891cafa241e04c5fcb500107a.tar.xz |
Clean up output of "for_each_ref()" when GIT_DIR is "."
Remove the "./" at the head, it just looks much nicer.
Diffstat (limited to 'refs.c')
-rw-r--r-- | refs.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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++] = '/'; |