diff -urp git-0.04-b64/fsck-cache.c git-0.04-b64-flat/fsck-cache.c --- git-0.04-b64/fsck-cache.c 2005-04-12 16:19:01.000000000 -0700 +++ git-0.04-b64-flat/fsck-cache.c 2005-04-12 17:50:20.000000000 -0700 @@ -202,7 +202,7 @@ static int fsck_name(char *hex) return -1; } -static int fsck_dir(int i, char *path) +static int fsck_dir(char *path) { DIR *dir = opendir(path); struct dirent *de; @@ -224,10 +224,8 @@ static int fsck_dir(int i, char *path) if (de->d_name[0] != '.') break; continue; - case 25: - name[0] = base64sym[i >> 6]; - name[1] = base64sym[i & 0x3f]; - memcpy(name+2, de->d_name, len+1); + case 27: + memcpy(name, de->d_name, len+1); if (!fsck_name(name)) continue; } @@ -240,17 +238,12 @@ static int fsck_dir(int i, char *path) int main(int argc, char **argv) { int i; - char *sha1_dir; + char *sha1_dir, *db_dir; if (argc != 1) usage("fsck-cache"); sha1_dir = getenv(DB_ENVIRONMENT) ? : DEFAULT_DB_ENVIRONMENT; - for (i = 0; i < 4096; i++) { - static char dir[4096]; - sprintf(dir, "%s/%c%c", sha1_dir, - base64sym[i >> 6], base64sym[i & 0x3f]); - fsck_dir(i, dir); - } + fsck_dir(sha1_dir); check_connectivity(); return 0; } diff -urp git-0.04-b64/init-db.c git-0.04-b64-flat/init-db.c --- git-0.04-b64/init-db.c 2005-04-12 15:52:23.000000000 -0700 +++ git-0.04-b64-flat/init-db.c 2005-04-12 17:49:12.000000000 -0700 @@ -44,21 +44,5 @@ int main(int argc, char **argv) exit(1); } } - path = malloc(len + 40); - memcpy(path, sha1_dir, len); - path[len] = '/'; - path[len+3] = '\0'; - for (i = 0; i < 64; i++) { - path[len+1] = base64sym[i]; - for (j = 0; j < 64; j++) { - path[len+2] = base64sym[j]; - if (mkdir(path, 0755) < 0) { - if (errno != EEXIST) { - perror(path); - exit(1); - } - } - } - } return 0; } diff -urp git-0.04-b64/read-cache.c git-0.04-b64-flat/read-cache.c --- git-0.04-b64/read-cache.c 2005-04-12 17:33:42.000000000 -0700 +++ git-0.04-b64-flat/read-cache.c 2005-04-12 18:15:48.000000000 -0700 @@ -111,10 +111,7 @@ char *sha1_file_name(const unsigned char base[len] = '/'; name = base + len + 1; } - sha1_to_b64_p(sha1, name+1); - name[0] = name[1]; - name[1] = name[2]; - name[2] = '/'; + sha1_to_b64_p(sha1, name); return base; }