X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=local-fetch.c;h=7cfe8b3587c10bf0791c066a72482771e7daae77;hb=ed35dece2776b0b83d7a35c84ab961668ec11ef4;hp=7d01845d392ab891c8cfe9db9a218e4c2d70e53e;hpb=c1e4572b7d3447949ed2da1ab290217a70cf3933;p=git.git diff --git a/local-fetch.c b/local-fetch.c index 7d01845d3..7cfe8b358 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) { @@ -184,7 +184,7 @@ int fetch_ref(char *ref, unsigned char *sha1) fprintf(stderr, "cannot open %s\n", filename); return -1; } - if (read(ifd, hex, 40) != 40 || get_sha1_hex(hex, sha1)) { + if (read_in_full(ifd, hex, 40) != 40 || get_sha1_hex(hex, sha1)) { close(ifd); fprintf(stderr, "cannot read from %s\n", filename); return -1; @@ -210,7 +210,6 @@ int main(int argc, const char **argv) char **commit_id; int arg = 1; - setup_ident(); setup_git_directory(); git_config(git_default_config);