fix for new git api
This commit is contained in:
parent
ab13a29cb5
commit
4ee6bc4fca
5 changed files with 61 additions and 19 deletions
|
@ -85,11 +85,17 @@ func Diff(ctx *middleware.Context, params martini.Params) {
|
|||
return false
|
||||
}
|
||||
|
||||
data, err := blob.Data()
|
||||
dataRc, err := blob.Data()
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
_, isImage := base.IsImageFile(data)
|
||||
buf := make([]byte, 1024)
|
||||
n, _ := dataRc.Read(buf)
|
||||
if n > 0 {
|
||||
buf = buf[:n]
|
||||
}
|
||||
dataRc.Close()
|
||||
_, isImage := base.IsImageFile(buf)
|
||||
return isImage
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue