summaryrefslogtreecommitdiff
path: root/t/t9167-git-svn-cmd-branch-subproject.sh
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2014-12-04 20:28:54 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-12-05 11:11:35 -0800
commite5e73ff20b5a750b9622438fd877f4e4a4c3519b (patch)
treef64518215456c5ee2e0f2d02b92eec097668a5b5 /t/t9167-git-svn-cmd-branch-subproject.sh
parentgit-tag.txt: Add a missing hyphen to `-s` (diff)
downloadtgif-e5e73ff20b5a750b9622438fd877f4e4a4c3519b.tar.xz
for_each_reflog_ent_reverse: fix newlines on block boundaries
When we read a reflog file in reverse, we read whole chunks of BUFSIZ bytes, then loop over the buffer, parsing any lines we find. We find the beginning of each line by looking for the newline from the previous line. If we don't find one, we know that we are either at the beginning of the file, or that we have to read another block. In the latter case, we stuff away what we have into a strbuf, read another block, and continue our parse. But we missed one case here. If we did find a newline, and it is at the beginning of the block, we must also stuff that newline into the strbuf, as it belongs to the block we are about to read. The minimal fix here would be to add this special case to the conditional that checks whether we found a newline. But we can make the flow a little clearer by rearranging a bit: we first handle lines that we are going to show, and then at the end of each loop, stuff away any leftovers if necessary. That lets us fold this special-case in with the more common "we ended in the middle of a line" case. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9167-git-svn-cmd-branch-subproject.sh')
0 files changed, 0 insertions, 0 deletions