mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2024-12-12 05:20:26 +00:00
Fix the bug with different mime-types of uploaded binary parts
This commit is contained in:
parent
4c852f60c4
commit
a18ff06663
@ -125,6 +125,6 @@ func unixTimestampAsTime(ts string) *time.Time {
|
||||
// Rename renames from `from` to `to` using `git mv`.
|
||||
func Rename(from, to string) error {
|
||||
log.Println(util.ShorterPath(from), util.ShorterPath(to))
|
||||
_, err := gitsh("mv", from, to)
|
||||
_, err := gitsh("mv", "--force", from, to)
|
||||
return err
|
||||
}
|
||||
|
@ -77,7 +77,9 @@ func (hop *HistoryOp) WithFilesRenamed(pairs map[string]string) *HistoryOp {
|
||||
for from, to := range pairs {
|
||||
if from != "" {
|
||||
os.MkdirAll(filepath.Dir(to), 0777)
|
||||
Rename(from, to)
|
||||
if err := Rename(from, to); err != nil {
|
||||
hop.Errs = append(hop.Errs, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return hop
|
||||
|
2
hypha.go
2
hypha.go
@ -80,7 +80,7 @@ func (hd *HyphaData) UploadBinary(hyphaName, mime string, file multipart.File, i
|
||||
data, err = ioutil.ReadAll(file)
|
||||
)
|
||||
if err != nil {
|
||||
return hop.WithError(err)
|
||||
return hop.WithError(err).Apply()
|
||||
}
|
||||
|
||||
return hd.uploadHelp(hop, hyphaName, MimeToExtension(mime), &hd.binaryPath, isOld, data)
|
||||
|
Loading…
Reference in New Issue
Block a user