You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Jason Song a35714372d
Fix halfCommitter and WithTx (#22366)
Related to #22362.

I overlooked that there's always `committer.Close()`, like:

```go
		ctx, committer, err := db.TxContext(db.DefaultContext)
		if err != nil {
			return nil
		}
		defer committer.Close()

		// ...

		if err != nil {
			return nil
		}

		// ...

		return committer.Commit()
```

So the `Close` of `halfCommitter` should ignore `commit and close`, it's
not a rollback.

See: [Why `halfCommitter` and `WithTx` should rollback IMMEDIATELY or
commit
LATER](https://github.com/go-gitea/gitea/pull/22366#issuecomment-1374778612).

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
1 year ago
..
install Implement FSFE REUSE for golang files (#21840) 2 years ago
paginator Implement FSFE REUSE for golang files (#21840) 2 years ago
common.go Implement FSFE REUSE for golang files (#21840) 2 years ago
consistency.go Implement FSFE REUSE for golang files (#21840) 2 years ago
context.go Fix halfCommitter and WithTx (#22366) 1 year ago
context_committer_test.go Fix halfCommitter and WithTx (#22366) 1 year ago
context_test.go Always reuse transaction (#22362) 2 years ago
convert.go Implement FSFE REUSE for golang files (#21840) 2 years ago
engine.go Update xorm (#22094) 2 years ago
engine_test.go Check primary keys for all tables and drop ForeignReference (#21721) 2 years ago
error.go Always reuse transaction (#22362) 2 years ago
index.go Fix generate index failure possibility on postgres (#21998) 2 years ago
index_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
iterate.go Implement FSFE REUSE for golang files (#21840) 2 years ago
iterate_test.go Test views of LFS files (#22196) 2 years ago
list_options.go Implement FSFE REUSE for golang files (#21840) 2 years ago
log.go Implement FSFE REUSE for golang files (#21840) 2 years ago
main_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
name.go Implement FSFE REUSE for golang files (#21840) 2 years ago
search.go Implement FSFE REUSE for golang files (#21840) 2 years ago
sequence.go Implement FSFE REUSE for golang files (#21840) 2 years ago
sql_postgres_with_schema.go Implement FSFE REUSE for golang files (#21840) 2 years ago