]> git.ipfire.org Git - thirdparty/git.git/commit
t4013: improve diff-post-processor logic
authorbrian m. carlson <sandals@crustytoothpaste.net>
Fri, 21 Aug 2020 11:51:46 +0000 (18:51 +0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 21 Aug 2020 19:43:05 +0000 (12:43 -0700)
commitfc7e73d7ef3bd987716b9f3ece57d2d15d631bc2
tree422529c74cae33cff876a3e899221f7078737db2
parent878e727637ec5815ccb3301eb994a54df95b21b8
t4013: improve diff-post-processor logic

From 72f936b1 (t4013: make test hash independent, 2020-02-07),
we started to adjust metadata of git-diff's output in order to
ignore uninteresting metadata which is dependent of underlying hash
algorithm.

However, we forgot to special case all-zero object names, which is
special for missing objects, in consequence, we could't catch
possible future bugs where object names is all-zeros including but
not limited to:
* show intend-to-add entry
* deleted entry
* diff between index and working tree with new file

We also mistakenly munged file-modes as if they were object names
abbreviated to 6 hexadecimal digits.

In addition, in the upcoming change, we would like to test for
customizing the length of abbreviated blob objects on the index line,
which is not supported by current diff-processor logic.

Let's fix the bug for all-zero object names, and file modes.
While we're at it, support abbreviation of object names up to 16 bytes.

Based-on-patch-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4013-diff-various.sh