Hi Junio, On Tue, 23 Jun 2020, Junio C Hamano wrote: > "Johannes Schindelin via GitGitGadget" <gitgitgadget@xxxxxxxxx> > writes: > > > From: Johannes Schindelin <johannes.schindelin@xxxxxx> > > > > In `run_diff_files()`, files that have been staged with the intention to > > add are queued without a valid OID in the `diff_filepair`. > > > > When the output mode is, say, `DIFF_FORMAT_PATCH`, the > > `diff_fill_oid_info()` function, called from `run_diff()`, will remedy > > that situation by reading the file contents from disk. > > The above is true. What do we do for a path that is actually added > to the index but is stat-dirty or actually modified in the working > tree when we are giving the raw output? Don't we give 0{40} to mean > "we dunno---you go look at the working tree"? I think we should do > the same for i-t-a file wrt the object name. In both cases, the > index does not know what the actual object name is, and we do not > want to run the index_path() and write out a new object in the > object database. Sure, but my intention was to synchronize the `--raw` vs the `--patch` output: the latter _already_ shows the correct hash. This here patch makes the hash in the former's output match the latter's. Besides, we're talking about the post-image of `diff-files`, i.e. the worktree version, here. I seem to remember that the pre-image already uses the all-zero hash to indicate precisely what you mentioned above. Ciao, Dscho > Using the status letter 'A' would also be appropriate, as we would > show "new file ..." in the --patch output in this case, which would > be consistent. > >