Jump to conversation
Unresolved conversations (3)
@wxiaoguang wxiaoguang Apr 26, 2024
Here and below, a regression ..... the "content" is not written into the hasher 😭 -> Fix incorrect object id hash function #30708
modules/git/object_id.go
@wxiaoguang wxiaoguang Dec 14, 2023
Why it needs "integer" number? I think `type ObjectFormat string` and `Sha1 = "sha1"` work better?
modules/git/object_format.go
lunny AdamMajer
Lunny Xiao and Adam Majer
@lunny lunny Nov 25, 2023
Could we have an `IsObjectIDEmpty` function? So in many places, we can just use this function but not use an equal sign?
Outdated
modules/git/hash.go
AdamMajer
Adam Majer
Resolved conversations (11)
@lunny lunny Dec 13, 2023
It seems the logic changed?
Outdated
services/pull/check.go
AdamMajer
Adam Majer
@AdamMajer AdamMajer Nov 27, 2023
this is to be removed ....
Outdated
modules/git/object_id.go
@AdamMajer AdamMajer Nov 27, 2023
renamed to `object_id_test.go`
Outdated
modules/git/hash_test.go
@AdamMajer AdamMajer Nov 27, 2023
this is renamed to `object_id_gogit.go` and functions renamed accordingly....
Outdated
modules/git/hash_gogit.go
@lunny lunny Nov 25, 2023
Maybe we can rename the file name to `object_format.go` and `object_id.go`.
Outdated
modules/git/hash.go
AdamMajer
Adam Majer
@wxiaoguang wxiaoguang Nov 22, 2023
`hash` but `ObjectFormat` ? I think it should be `objectFormat ObjectFormat`
Outdated
modules/git/blame.go
@wxiaoguang wxiaoguang Nov 22, 2023
```suggestion objectFormat, err := git.ObjectFormatFromString(repo.GitObjectFormat) ``` ?
Outdated
models/git/branch_test.go
AdamMajer
Adam Majer
@wxiaoguang wxiaoguang Nov 22, 2023
A lot of such changes could be reverted. `Errorf("%s", opts.SHA)` should work well.
Outdated
models/git/commit_status.go
@wxiaoguang wxiaoguang Nov 22, 2023
I meant, could it be `if !git.IsEmptyOID(rs.OldOID)` ? Only 1 line, just like before
cmd/hook.go
AdamMajer
Adam Majer
@wxiaoguang wxiaoguang Nov 21, 2023
TBH, `hash` doesn't seem a good concept here. Although I don't know how git calls it internally/officially, while I think Gitea also uses `commit id` for such type, which reads better than `hash`. Could there be something like: ``` var commitID git.CommitID git.IsCommitIDEmpty(...) git.CommitIDFromString(...) ``` ?
Outdated
cmd/hook.go
AdamMajer lunny
6543
Adam Majer, Lunny Xiao, and 6543
@wxiaoguang wxiaoguang Nov 21, 2023
Here and below, it makes the code more complex. Could it be simplified to something like: ``` if git.IsEmptyXxxx() ``` ?
Outdated
cmd/hook.go
AdamMajer
Adam Majer