summaryrefslogtreecommitdiff
path: root/t/t4013/diff.format-patch_--stdout_initial..master^
diff options
context:
space:
mode:
authorLibravatar René Scharfe <rene.scharfe@lsrfire.ath.cx>2010-03-13 18:37:50 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-03-13 13:18:09 -0800
commit8ca788035644f2aaf7a951272ae16a7bd319554c (patch)
tree0a9029d417f819d361294a1f2710a1a57ad99089 /t/t4013/diff.format-patch_--stdout_initial..master^
parentt/Makefile: remove test artifacts upon "make clean" (diff)
downloadtgif-8ca788035644f2aaf7a951272ae16a7bd319554c.tar.xz
for_each_recent_reflog_ent(): use strbuf, fix offset handling
As Vladimir reported, "git log -g refs/stash" surprisingly showed the reflog of HEAD if the message in the reflog file was too long. To fix this, convert for_each_recent_reflog_ent() to use strbuf_getwholeline() instead of fgets(), for safety and to avoid any size limits for reflog entries. Also reverse the logic of the part of the function that only looks at file tails. It used to close the file if fgets() succeeded. The following fgets() call in the while loop was likely to fail in this case, too, so passing an offset to for_each_recent_reflog_ent() never worked. Change it to error out if strbuf_getwholeline() fails instead. Reported-by: Vladimir Panteleev <vladimir@thecybershadow.net> Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4013/diff.format-patch_--stdout_initial..master^')
0 files changed, 0 insertions, 0 deletions