Changed batch mode to update the repo state before exiting in the case of an error

This commit is contained in:
Zach Musgrave
2021-06-08 16:43:25 -07:00
parent d223f390bb
commit eb34eacec8

View File

@@ -394,6 +394,10 @@ func execBatch(sqlCtx *sql.Context, readOnly bool, mrEnv env.MultiRepoEnv, roots
err = runBatchMode(sqlCtx, se, batchInput)
if err != nil {
// If we encounter an error, flush what we have so far to disk before exiting
_ = flushBatchedEdits(sqlCtx, se)
_ = writeRoots(sqlCtx, se, mrEnv, roots)
return errhand.BuildDError("Error processing batch").Build()
}