aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/packfile/diff_delta.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2018-06-08 09:32:46 +0200
committerGitHub <noreply@github.com>2018-06-08 09:32:46 +0200
commitb23570073eaee3489e5e3d666f22ba5cbeb53243 (patch)
treeb8bfa26e2215a20810f482ca281cc831ce48e806 /plumbing/format/packfile/diff_delta.go
parenta8a12e0edc6af6ea44fe8cce76d7b4658d85a50c (diff)
parent88f0dc3d89a0391f9f52d913207556d15a4c2a77 (diff)
downloadgo-git-b23570073eaee3489e5e3d666f22ba5cbeb53243.tar.gz
Merge pull request #856 from kuba--/fix-840/corrupted-objectsv4.4.1
plumbing: packfile, Don't copy empty objects. Fixes #840
Diffstat (limited to 'plumbing/format/packfile/diff_delta.go')
-rw-r--r--plumbing/format/packfile/diff_delta.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/plumbing/format/packfile/diff_delta.go b/plumbing/format/packfile/diff_delta.go
index 4d56dc1..d35e78a 100644
--- a/plumbing/format/packfile/diff_delta.go
+++ b/plumbing/format/packfile/diff_delta.go
@@ -111,7 +111,7 @@ func diffDelta(index *deltaIndex, src []byte, tgt []byte) []byte {
rl := l
aOffset := offset
- for {
+ for rl > 0 {
if rl < maxCopySize {
buf.Write(encodeCopyOperation(aOffset, rl))
break