X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=local-fetch.c;h=7b6875cce6c5a08db06e637abc48ce8f26216db4;hb=4cabf8583f934260697a065186f3dce135834ede;hp=b216bdd55742ef8214ed1193ef184f8bba70eb70;hpb=fff8fd5b1ee9c13694c29ba3544f5b1ebf0f4fb2;p=git.git diff --git a/local-fetch.c b/local-fetch.c index b216bdd55..7b6875cce 100644 --- a/local-fetch.c +++ b/local-fetch.c @@ -5,10 +5,10 @@ #include "commit.h" #include "fetch.h" -static int use_link = 0; -static int use_symlink = 0; +static int use_link; +static int use_symlink; static int use_filecopy = 1; -static int commits_on_stdin = 0; +static int commits_on_stdin; static const char *path; /* "Remote" git repository */ @@ -16,7 +16,7 @@ void prefetch(unsigned char *sha1) { } -static struct packed_git *packs = NULL; +static struct packed_git *packs; static void setup_index(unsigned char *sha1) { @@ -43,8 +43,8 @@ static int setup_indices(void) return -1; while ((de = readdir(dir)) != NULL) { int namelen = strlen(de->d_name); - if (namelen != 50 || - strcmp(de->d_name + namelen - 5, ".pack")) + if (namelen != 50 || + !has_extension(de->d_name, ".pack")) continue; get_sha1_hex(de->d_name + 5, sha1); setup_index(sha1); @@ -210,6 +210,7 @@ int main(int argc, const char **argv) char **commit_id; int arg = 1; + setup_ident(); setup_git_directory(); git_config(git_default_config);