Re: [PATCH v2 4/5] diff.c: initialize hash algo when running in --no-index mode

2018-02-24 Thread brian m. carlson
On Sat, Feb 24, 2018 at 09:36:03PM +0700, Duy Nguyen wrote: > On Sat, Feb 24, 2018 at 10:34 AM, Nguyễn Thái Ngọc Duy > wrote: > > @@ -3995,6 +3995,18 @@ static void run_diff(struct diff_filepair *p, struct > > diff_options *o) > > return; > > } > > > > + /* > > +

Re: [PATCH v2 4/5] diff.c: initialize hash algo when running in --no-index mode

2018-02-24 Thread Duy Nguyen
On Sat, Feb 24, 2018 at 10:34 AM, Nguyễn Thái Ngọc Duy wrote: > @@ -3995,6 +3995,18 @@ static void run_diff(struct diff_filepair *p, struct > diff_options *o) > return; > } > > + /* > +* NEEDSWORK: When running in no-index mode (and no repo is > +* fo

Re: [PATCH v2 4/5] diff.c: initialize hash algo when running in --no-index mode

2018-02-24 Thread Duy Nguyen
On Sat, Feb 24, 2018 at 3:15 PM, Eric Sunshine wrote: > On Fri, Feb 23, 2018 at 10:34 PM, Nguyễn Thái Ngọc Duy > wrote: >> before, compared to the alternative that we simply do not hash). >> >> dòng được > > Accidental paste? Oops. I blame Emacs. -- Duy

Re: [PATCH v2 4/5] diff.c: initialize hash algo when running in --no-index mode

2018-02-24 Thread Eric Sunshine
On Fri, Feb 23, 2018 at 10:34 PM, Nguyễn Thái Ngọc Duy wrote: > Our "git diff" command supports running as a standalone tool. In this > code path, we try to hash the file content but after > 18e2588e11 (sha1_file: switch uses of SHA-1 to the_hash_algo - > 2018-02-01), there is a chance that the_ha

[PATCH v2 4/5] diff.c: initialize hash algo when running in --no-index mode

2018-02-23 Thread Nguyễn Thái Ngọc Duy
Our "git diff" command supports running as a standalone tool. In this code path, we try to hash the file content but after 18e2588e11 (sha1_file: switch uses of SHA-1 to the_hash_algo - 2018-02-01), there is a chance that the_hash_algo (required by index_path) may still be uninitialized if no repos