Skip to content

Commit

Permalink
fix history rewrite replace origin file
Browse files Browse the repository at this point in the history
  • Loading branch information
chzyer committed Oct 8, 2015
1 parent d0699b8 commit 9f55547
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions history.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ func (o *opHistory) HistoryRewrite() {
}
buf.Flush()

// replace history file
if err = os.Rename(tmpFile, o.cfg.HistoryFile); err != nil {
return
}

if o.fd != nil {
o.fd.Close()
}
Expand Down

0 comments on commit 9f55547

Please sign in to comment.