summaryrefslogtreecommitdiff
path: root/t/t1430-bad-ref-name.sh
diff options
context:
space:
mode:
authorLibravatar René Scharfe <l.s.r@web.de>2020-08-19 00:08:54 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-08-18 16:14:01 -0700
commit82a62015a7b55a56f779b9ddfb98a3b0552d2bb4 (patch)
tree0000a420a30cea4448b2da8954ec3dce797dfcdf /t/t1430-bad-ref-name.sh
parentGit 2.28 (diff)
downloadtgif-82a62015a7b55a56f779b9ddfb98a3b0552d2bb4.tar.xz
patch-id: ignore newline at end of file in diff_flush_patch_id()
Whitespace is ignored when calculating patch IDs. This is done by removing all whitespace from diff lines before hashing them, including a newline at the end of a file. If that newline is missing, however, diff reports that fact in a separate line containing "\ No newline at end of file\n", and this marker is hashed like a context line. This goes against our goal of making patch IDs independent of whitespace. Use the same heuristic that 2485eab55cc (git-patch-id: do not trip over "no newline" markers, 2011-02-17) added to git patch-id instead and skip diff lines that start with a backslash and a space and are longer than twelve characters. Reported-by: Tilman Vogel <tilman.vogel@web.de> Initial-test-by: Tilman Vogel <tilman.vogel@web.de> Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1430-bad-ref-name.sh')
0 files changed, 0 insertions, 0 deletions