Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: greenpau/go-authcrunch
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f605230fcb0fd2c7243e96f447ed3d6f3a817979
Choose a base ref
..
head repository: greenpau/go-authcrunch
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 348a8ab926f052038aedd0c78c02b1c69828f98f
Choose a head ref
Showing with 3 additions and 4 deletions.
  1. +3 −4 pkg/identity/database.go
7 changes: 3 additions & 4 deletions pkg/identity/database.go
Original file line number Diff line number Diff line change
@@ -485,14 +485,13 @@ func (db *Database) Copy(fp string) error {
func (db *Database) commit() error {
db.Revision++
db.LastModified = time.Now().UTC()
if db.inMemory {
return nil
}
data, err := json.MarshalIndent(db, "", " ")
if err != nil {
return errors.ErrDatabaseCommit.WithArgs(db.path, err)
}
if db.inMemory {
return nil
}

if err := os.WriteFile(db.path, []byte(data), 0600); err != nil {
return errors.ErrDatabaseCommit.WithArgs(db.path, err)
}