To make it more flexible and support SSH signature.
The existing tests are not changed, there are also tests covering
`parseTagRef` which also calls `parsePayloadSignature` now. Add some new
tests to `Test_parseTagData`
The 4 functions are duplicated, especially as interface methods. I think
we just need to keep `MustID` the only one and remove other 3.
```
MustID(b []byte) ObjectID
MustIDFromString(s string) ObjectID
NewID(b []byte) (ObjectID, error)
NewIDFromString(s string) (ObjectID, error)
```
Introduced the new interfrace method `ComputeHash` which will replace
the interface `HasherInterface`. Now we don't need to keep two
interfaces.
Reintroduced `git.NewIDFromString` and `git.MustIDFromString`. The new
function will detect the hash length to decide which objectformat of it.
If it's 40, then it's SHA1. If it's 64, then it's SHA256. This will be
right if the commitID is a full one. So the parameter should be always a
full commit id.
@AdamMajer Please review.
Refactor Hash interfaces and centralize hash function. This will allow
easier introduction of different hash function later on.
This forms the "no-op" part of the SHA256 enablement patch.
Change all license headers to comply with REUSE specification.
Fix#16132
Co-authored-by: flynnnnnnnnnn <flynnnnnnnnnn@github>
Co-authored-by: John Olheiser <[email protected]>
Unfortunately some old repositories can have tags with empty Tagger, Commit
or Author. Go-Git variants will always have empty values for these whereas
the native git variant leaves them at nil. The simplest solution is just to
always have these set to empty Signatures.
v156 migration also makes the incorrect assumption that these cannot be empty.
Therefore add some handling to this and add logging and adjust broken
logging elsewhere in this migration.
Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
There is a slight bug in the commit_reader introduced in #13673 whereby
commit messages which have a final unterminated line miss their final line.
This PR fixes this.
Signed-off-by: Andrew Thornton <[email protected]>
* Move last commit cache back into modules/git
Signed-off-by: Andrew Thornton <[email protected]>
* Remove go-git from the interface for last commit cache
Signed-off-by: Andrew Thornton <[email protected]>
* move cacheref to last_commit_cache
Signed-off-by: Andrew Thornton <[email protected]>
* Remove go-git from routers/private/hook
Signed-off-by: Andrew Thornton <[email protected]>
* Move FindLFSFiles to pipeline
Signed-off-by: Andrew Thornton <[email protected]>
* Make no-go-git variants
Signed-off-by: Andrew Thornton <[email protected]>
* Submodule RefID
Signed-off-by: Andrew Thornton <[email protected]>
* fix issue with GetCommitsInfo
Signed-off-by: Andrew Thornton <[email protected]>
* fix GetLastCommitForPaths
Signed-off-by: Andrew Thornton <[email protected]>
* Improve efficiency
Signed-off-by: Andrew Thornton <[email protected]>
* More efficiency
Signed-off-by: Andrew Thornton <[email protected]>
* even faster
Signed-off-by: Andrew Thornton <[email protected]>
* Reduce duplication
* As per @lunny
Signed-off-by: Andrew Thornton <[email protected]>
* attempt to fix drone
Signed-off-by: Andrew Thornton <[email protected]>
* fix test-tags
Signed-off-by: Andrew Thornton <[email protected]>
* default to use no-go-git variants and add gogit build tag
Signed-off-by: Andrew Thornton <[email protected]>
* placate lint
Signed-off-by: Andrew Thornton <[email protected]>
* as per @6543
Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: 6543 <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
* Add require signed commit for protected branch
* Fix fmt
* Make editor show if they will be signed
* bugfix
* Add basic merge check and better information for CRUD
* linting comment
* Add descriptors to merge signing
* Slight refactor
* Slight improvement to appearances
* Handle Merge API
* manage CRUD API
* Move error to error.go
* Remove fix to delete.go
* prep for merge
* need to tolerate \r\n in message
* check protected branch before trying to load it
* Apply suggestions from code review
Co-Authored-By: guillep2k <[email protected]>
* fix commit-reader
Co-authored-by: guillep2k <[email protected]>