Skip to content

Commit

Permalink
Clean up output of "for_each_ref()" when GIT_DIR is "."
Browse files Browse the repository at this point in the history
Remove the "./" at the head, it just looks much nicer.
  • Loading branch information
Linus Torvalds committed Jul 4, 2005
1 parent def88e9 commit 6cada6a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions refs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++] = '/';
Expand Down

0 comments on commit 6cada6a

Please sign in to comment.