Re: [PATCH v4 04/14] commit-graph: load commit-graph chains

2019-06-07 Thread Derrick Stolee
On 6/6/2019 6:20 PM, Junio C Hamano wrote: > "Derrick Stolee via GitGitGadget" writes: > >> +if (stat(chain_name, &st)) { >> ... >> +if (st.st_size <= the_hash_algo->hexsz) { >> ... >> +fp = fopen(chain_name, "r"); >> +free(chain_name); >> + >> +if (!fp) >> +return

Re: [PATCH v4 04/14] commit-graph: load commit-graph chains

2019-06-06 Thread Junio C Hamano
"Derrick Stolee via GitGitGadget" writes: > + if (stat(chain_name, &st)) { > ... > + if (st.st_size <= the_hash_algo->hexsz) { > ... > + fp = fopen(chain_name, "r"); > + free(chain_name); > + > + if (!fp) > + return NULL; Checking for size before opening is an inv

[PATCH v4 04/14] commit-graph: load commit-graph chains

2019-06-06 Thread Derrick Stolee via GitGitGadget
From: Derrick Stolee Prepare the logic for reading a chain of commit-graphs. First, look for a file at $OBJDIR/info/commit-graph. If it exists, then use that file and stop. Next, look for the chain file at $OBJDIR/info/commit-graphs/commit-graph-chain. If this file exists, then load the hash va