forked from forgejo/forgejo
Add support for sha256 repositories (#23894)
Currently only SHA1 repositories are supported by Gitea. This adds
support for alternate SHA256 with the additional aim of easier support
for additional hash types in the future.
Fixes: #13794
Limited by: https://github.com/go-git/go-git/issues/899
Depend on: #28138
<img width="776" alt="图片" src="5448c9a7
-608e-4341-a149-5dd0069c9447">
---------
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
parent
07ba4d9f87
commit
d68a613ba8
98 changed files with 834 additions and 76 deletions
1
modules/git/tests/repos/repo1_bare_sha256/HEAD
Normal file
1
modules/git/tests/repos/repo1_bare_sha256/HEAD
Normal file
|
@ -0,0 +1 @@
|
|||
ref: refs/heads/main
|
6
modules/git/tests/repos/repo1_bare_sha256/config
Normal file
6
modules/git/tests/repos/repo1_bare_sha256/config
Normal file
|
@ -0,0 +1,6 @@
|
|||
[core]
|
||||
repositoryformatversion = 1
|
||||
filemode = true
|
||||
bare = true
|
||||
[extensions]
|
||||
objectformat = sha256
|
1
modules/git/tests/repos/repo1_bare_sha256/description
Normal file
1
modules/git/tests/repos/repo1_bare_sha256/description
Normal file
|
@ -0,0 +1 @@
|
|||
Unnamed repository; edit this file 'description' to name the repository.
|
6
modules/git/tests/repos/repo1_bare_sha256/info/exclude
Normal file
6
modules/git/tests/repos/repo1_bare_sha256/info/exclude
Normal file
|
@ -0,0 +1,6 @@
|
|||
# git ls-files --others --exclude-from=.git/info/exclude
|
||||
# Lines that start with '#' are comments.
|
||||
# For a project mostly in C, the following would be a good set of
|
||||
# exclude patterns (uncomment them if you want to use them):
|
||||
# *.[oa]
|
||||
# *~
|
7
modules/git/tests/repos/repo1_bare_sha256/info/refs
Normal file
7
modules/git/tests/repos/repo1_bare_sha256/info/refs
Normal file
|
@ -0,0 +1,7 @@
|
|||
42e334efd04cd36eea6da0599913333c26116e1a537ca76e5b6e4af4dda00236 refs/heads/branch1
|
||||
5bc2249e32e0ba40a08879fba2bd4e97a13cb345831549f4bc5649525da8f6cc refs/heads/branch2
|
||||
9433b2a62b964c17a4485ae180f45f595d3e69d31b786087775e28c6b6399df0 refs/heads/main
|
||||
29a82d4fc02e19190fb489cc90d5730ed91970b49f4e39acda2798b3dd4f814e refs/tags/signed-tag
|
||||
9433b2a62b964c17a4485ae180f45f595d3e69d31b786087775e28c6b6399df0 refs/tags/signed-tag^{}
|
||||
171822a62559f3aa28a00aa3785dbe915d6a8eb02712682740db44fc8bd2187a refs/tags/test
|
||||
6aae864a3d1d0d6a5be0cc64028c1e7021e2632b031fd8eb82afc5a283d1c3d1 refs/tags/test^{}
|
Binary file not shown.
|
@ -0,0 +1,2 @@
|
|||
P pack-c01aa121b9c5e345fe0da2f9be78665970b0c38c6b495d5fc034bc7a7b95334b.pack
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
8
modules/git/tests/repos/repo1_bare_sha256/packed-refs
Normal file
8
modules/git/tests/repos/repo1_bare_sha256/packed-refs
Normal file
|
@ -0,0 +1,8 @@
|
|||
# pack-refs with: peeled fully-peeled sorted
|
||||
42e334efd04cd36eea6da0599913333c26116e1a537ca76e5b6e4af4dda00236 refs/heads/branch1
|
||||
5bc2249e32e0ba40a08879fba2bd4e97a13cb345831549f4bc5649525da8f6cc refs/heads/branch2
|
||||
9433b2a62b964c17a4485ae180f45f595d3e69d31b786087775e28c6b6399df0 refs/heads/main
|
||||
29a82d4fc02e19190fb489cc90d5730ed91970b49f4e39acda2798b3dd4f814e refs/tags/signed-tag
|
||||
^9433b2a62b964c17a4485ae180f45f595d3e69d31b786087775e28c6b6399df0
|
||||
171822a62559f3aa28a00aa3785dbe915d6a8eb02712682740db44fc8bd2187a refs/tags/test
|
||||
^6aae864a3d1d0d6a5be0cc64028c1e7021e2632b031fd8eb82afc5a283d1c3d1
|
|
@ -0,0 +1 @@
|
|||
9433b2a62b964c17a4485ae180f45f595d3e69d31b786087775e28c6b6399df0
|
1
modules/git/tests/repos/repo5_pulls_sha256/HEAD
Normal file
1
modules/git/tests/repos/repo5_pulls_sha256/HEAD
Normal file
|
@ -0,0 +1 @@
|
|||
ref: refs/heads/main
|
6
modules/git/tests/repos/repo5_pulls_sha256/config
Normal file
6
modules/git/tests/repos/repo5_pulls_sha256/config
Normal file
|
@ -0,0 +1,6 @@
|
|||
[core]
|
||||
repositoryformatversion = 1
|
||||
filemode = true
|
||||
bare = true
|
||||
[extensions]
|
||||
objectformat = sha256
|
1
modules/git/tests/repos/repo5_pulls_sha256/description
Normal file
1
modules/git/tests/repos/repo5_pulls_sha256/description
Normal file
|
@ -0,0 +1 @@
|
|||
Unnamed repository; edit this file 'description' to name the repository.
|
4
modules/git/tests/repos/repo5_pulls_sha256/info/refs
Normal file
4
modules/git/tests/repos/repo5_pulls_sha256/info/refs
Normal file
|
@ -0,0 +1,4 @@
|
|||
35ecd0f946c8baeb76fa5a3876f46bf35218655e2304d8505026fa4bfb496a4b refs/heads/main
|
||||
35ecd0f946c8baeb76fa5a3876f46bf35218655e2304d8505026fa4bfb496a4b refs/heads/main-clone
|
||||
7f50a4906503378b0bbb7d61bd2ca8d8d8ff4f7a2474980f99402d742ccc9665 refs/heads/test-patch-1
|
||||
1e35a51dc00fd7de730344c07061acfe80e8117e075ac979b6a29a3a045190ca refs/tags/v0.9.99
|
Binary file not shown.
|
@ -0,0 +1,2 @@
|
|||
P pack-bfe8f09d42ef5dd1610bf42641fe145d4a02b788eb26c31022a362312660a29d.pack
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
5
modules/git/tests/repos/repo5_pulls_sha256/packed-refs
Normal file
5
modules/git/tests/repos/repo5_pulls_sha256/packed-refs
Normal file
|
@ -0,0 +1,5 @@
|
|||
# pack-refs with: peeled fully-peeled sorted
|
||||
35ecd0f946c8baeb76fa5a3876f46bf35218655e2304d8505026fa4bfb496a4b refs/heads/main
|
||||
35ecd0f946c8baeb76fa5a3876f46bf35218655e2304d8505026fa4bfb496a4b refs/heads/main-clone
|
||||
7f50a4906503378b0bbb7d61bd2ca8d8d8ff4f7a2474980f99402d742ccc9665 refs/heads/test-patch-1
|
||||
1e35a51dc00fd7de730344c07061acfe80e8117e075ac979b6a29a3a045190ca refs/tags/v0.9.99
|
|
@ -0,0 +1 @@
|
|||
35ecd0f946c8baeb76fa5a3876f46bf35218655e2304d8505026fa4bfb496a4b
|
1
modules/git/tests/repos/repo6_blame_sha256/HEAD
Normal file
1
modules/git/tests/repos/repo6_blame_sha256/HEAD
Normal file
|
@ -0,0 +1 @@
|
|||
ref: refs/heads/main
|
6
modules/git/tests/repos/repo6_blame_sha256/config
Normal file
6
modules/git/tests/repos/repo6_blame_sha256/config
Normal file
|
@ -0,0 +1,6 @@
|
|||
[core]
|
||||
repositoryformatversion = 1
|
||||
filemode = true
|
||||
bare = true
|
||||
[extensions]
|
||||
objectformat = sha256
|
1
modules/git/tests/repos/repo6_blame_sha256/description
Normal file
1
modules/git/tests/repos/repo6_blame_sha256/description
Normal file
|
@ -0,0 +1 @@
|
|||
Unnamed repository; edit this file 'description' to name the repository.
|
6
modules/git/tests/repos/repo6_blame_sha256/info/exclude
Normal file
6
modules/git/tests/repos/repo6_blame_sha256/info/exclude
Normal file
|
@ -0,0 +1,6 @@
|
|||
# git ls-files --others --exclude-from=.git/info/exclude
|
||||
# Lines that start with '#' are comments.
|
||||
# For a project mostly in C, the following would be a good set of
|
||||
# exclude patterns (uncomment them if you want to use them):
|
||||
# *.[oa]
|
||||
# *~
|
1
modules/git/tests/repos/repo6_blame_sha256/info/refs
Normal file
1
modules/git/tests/repos/repo6_blame_sha256/info/refs
Normal file
|
@ -0,0 +1 @@
|
|||
e2f5660e15159082902960af0ed74fc144921d2b0c80e069361853b3ece29ba3 refs/heads/main
|
Binary file not shown.
|
@ -0,0 +1,2 @@
|
|||
P pack-fcb8a221b76025fd8415d3c562b611ac24312a5ffc3d3703d7c5cc906bdaee8e.pack
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2
modules/git/tests/repos/repo6_blame_sha256/packed-refs
Normal file
2
modules/git/tests/repos/repo6_blame_sha256/packed-refs
Normal file
|
@ -0,0 +1,2 @@
|
|||
# pack-refs with: peeled fully-peeled sorted
|
||||
e2f5660e15159082902960af0ed74fc144921d2b0c80e069361853b3ece29ba3 refs/heads/main
|
|
@ -0,0 +1 @@
|
|||
e2f5660e15159082902960af0ed74fc144921d2b0c80e069361853b3ece29ba3
|
1
modules/git/tests/repos/repo6_merge_sha256/HEAD
Normal file
1
modules/git/tests/repos/repo6_merge_sha256/HEAD
Normal file
|
@ -0,0 +1 @@
|
|||
ref: refs/heads/main
|
6
modules/git/tests/repos/repo6_merge_sha256/config
Normal file
6
modules/git/tests/repos/repo6_merge_sha256/config
Normal file
|
@ -0,0 +1,6 @@
|
|||
[core]
|
||||
repositoryformatversion = 1
|
||||
filemode = true
|
||||
bare = true
|
||||
[extensions]
|
||||
objectformat = sha256
|
1
modules/git/tests/repos/repo6_merge_sha256/description
Normal file
1
modules/git/tests/repos/repo6_merge_sha256/description
Normal file
|
@ -0,0 +1 @@
|
|||
Unnamed repository; edit this file 'description' to name the repository.
|
6
modules/git/tests/repos/repo6_merge_sha256/info/exclude
Normal file
6
modules/git/tests/repos/repo6_merge_sha256/info/exclude
Normal file
|
@ -0,0 +1,6 @@
|
|||
# git ls-files --others --exclude-from=.git/info/exclude
|
||||
# Lines that start with '#' are comments.
|
||||
# For a project mostly in C, the following would be a good set of
|
||||
# exclude patterns (uncomment them if you want to use them):
|
||||
# *.[oa]
|
||||
# *~
|
4
modules/git/tests/repos/repo6_merge_sha256/info/refs
Normal file
4
modules/git/tests/repos/repo6_merge_sha256/info/refs
Normal file
|
@ -0,0 +1,4 @@
|
|||
d2e5609f630dd8db500f5298d05d16def282412e3e66ed68cc7d0833b29129a1 refs/heads/main
|
||||
b45258e9823233edea2d40d183742f29630e1e69300479fb4a55eabfe9b1d8bf refs/heads/merge/add_file
|
||||
ff2b996e2fa366146300e4c9e51ccb6818147b360e46fa1437334f4a690955ce refs/heads/merge/modify_file
|
||||
da1ded40dc8e5b7c564171f4bf2fc8370487decfb1cb6a99ef28f3ed73d09172 refs/heads/merge/remove_file
|
Binary file not shown.
|
@ -0,0 +1,3 @@
|
|||
P pack-2fff0848f8d8eab8f7902ac91ab6a096c7530f577d5c0a79c63d9ac2b44f7510.pack
|
||||
P pack-65162b86afdbac3c566696d487e67bb2a4a5501ca1fa3528fad8a9474fba7e50.pack
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
5
modules/git/tests/repos/repo6_merge_sha256/packed-refs
Normal file
5
modules/git/tests/repos/repo6_merge_sha256/packed-refs
Normal file
|
@ -0,0 +1,5 @@
|
|||
# pack-refs with: peeled fully-peeled sorted
|
||||
d2e5609f630dd8db500f5298d05d16def282412e3e66ed68cc7d0833b29129a1 refs/heads/main
|
||||
b45258e9823233edea2d40d183742f29630e1e69300479fb4a55eabfe9b1d8bf refs/heads/merge/add_file
|
||||
ff2b996e2fa366146300e4c9e51ccb6818147b360e46fa1437334f4a690955ce refs/heads/merge/modify_file
|
||||
da1ded40dc8e5b7c564171f4bf2fc8370487decfb1cb6a99ef28f3ed73d09172 refs/heads/merge/remove_file
|
|
@ -0,0 +1 @@
|
|||
d2e5609f630dd8db500f5298d05d16def282412e3e66ed68cc7d0833b29129a1
|
Loading…
Add table
Add a link
Reference in a new issue