-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test coverage to the important features of [`routers.web.repo.renderReadmeFile`](https://github.com/go-gitea/gitea/blob/067b0c2664d127c552ccdfd264257caca4907a77/routers/web/repo/view.go#L273); namely that: - it can handle looking in docs/, .gitea/, and .github/ - it can handle choosing between multiple competing READMEs - it prefers the localized README to the markdown README to the plaintext README - it can handle broken symlinks when processing all the options - it uses the name of the symlink, not the name of the target of the symlink
- Loading branch information
Showing
48 changed files
with
194 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ref: refs/heads/master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[core] | ||
repositoryformatversion = 0 | ||
filemode = true | ||
bare = true |
6 changes: 6 additions & 0 deletions
6
tests/gitea-repositories-meta/user2/readme-test.git/info/exclude
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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] | ||
# *~ |
21 changes: 21 additions & 0 deletions
21
tests/gitea-repositories-meta/user2/readme-test.git/info/refs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
ea9ef877d1d88af76682d8798418081264f10cfc refs/heads/fallbacks | ||
0d4c14db927c9ffba01fa7e126cc748b5c02c01e refs/heads/fallbacks2 | ||
c66d5b07c2063d3268707f22226c708b589574ef refs/heads/fallbacks3 | ||
89f8426e9eb5eff35c09b3565836c8f8e15d0ce9 refs/heads/fallbacks4 | ||
b0e902496eae435ad03c92a5d479f916ef2d4893 refs/heads/fallbacks5 | ||
84a5500b5cc040b11daf53fc42c542a99589dc76 refs/heads/fallbacks6 | ||
cf406a96e416d7de5c4c1bbfffdd672300c822bf refs/heads/fallbacks7 | ||
0d6ac644b969e9199915a492da9dba08c179fd23 refs/heads/fallbacks8 | ||
5038febc0c57215beb3748d7ae4091a25a4acc93 refs/heads/fallbacks9 | ||
9134e1f178ca4cccf1a197142646f2d7627e8cd5 refs/heads/i18n | ||
744d2441e55bc0010d6b340d303f0106a627ad29 refs/heads/master | ||
3c492566170b057e962c025515ab38bbd7444077 refs/heads/plain | ||
3882d6373a0882a6739b3cd9b24d21c630621234 refs/heads/sp-ace | ||
bf5ed898252eaa50dcc01108ed4417c3ea98a294 refs/heads/special-subdir-.gitea | ||
c03543573ab088ce1cf7090a387d2be621426234 refs/heads/special-subdir-.github | ||
e75957ad9b7e6ed16dda183529ec283db0bbc5fe refs/heads/special-subdir-docs | ||
46f5d5ab33d701642e08c713fab42af89fdd4fea refs/heads/special-subdir-nested | ||
9c0f872256b839c2b97ec22fd348d87b14045513 refs/heads/subdir | ||
d7a854fff61e45b98234d7aa79ecbcb1619cd3dd refs/heads/symlink | ||
30b9c0ed4b1039dbd99f3fb537b84ca507e0549d refs/heads/symlink-loop | ||
41489b7be5c2244d2b7b524dcb31caf3bd1f9ccc refs/heads/txt |
Binary file added
BIN
+169 Bytes
...repositories-meta/user2/readme-test.git/objects/12/11481f7314efbfe4e44703170d96c8fac8172b
Binary file not shown.
Binary file added
BIN
+214 Bytes
...repositories-meta/user2/readme-test.git/objects/17/2343566bf11fc71ba4acf8d2ea70d12bc1d037
Binary file not shown.
Binary file added
BIN
+167 Bytes
...repositories-meta/user2/readme-test.git/objects/1a/48cae3f18ccd9c929e6608f67087dbaac3cf9e
Binary file not shown.
Binary file added
BIN
+83 Bytes
...repositories-meta/user2/readme-test.git/objects/1e/1e08102cf1b1fc01c069c88ee75445974363ab
Binary file not shown.
2 changes: 2 additions & 0 deletions
2
...repositories-meta/user2/readme-test.git/objects/21/470f9b3e8ff24e0fa083d2dbc447f4c3401355
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
x��;�0@�s | ||
_�*N��H��1q�u(�?�t��T�0��==���Q��+�*4��d��h�S�η.z���͙Z3�ct��0'�As�5h�zL�=D��B�\cx-ݴ��!O������q�����<����� 0�T�装���5�=-�����U s�7,O�#�M� |
Binary file added
BIN
+175 Bytes
...repositories-meta/user2/readme-test.git/objects/23/65bfe0c5714e2e3f2d53bb302b10d8d5b4fc7d
Binary file not shown.
Binary file added
BIN
+48 Bytes
...repositories-meta/user2/readme-test.git/objects/38/9d08c6a71d024a91f14089007cd789cd977ca6
Binary file not shown.
Binary file added
BIN
+140 Bytes
...repositories-meta/user2/readme-test.git/objects/3a/a8f4e0e1a535f0f9e0ae40e6ec1bce42642bc4
Binary file not shown.
1 change: 1 addition & 0 deletions
1
...repositories-meta/user2/readme-test.git/objects/3b/23d7f1a9cb904cb46f5f2272bfa5ed5f871fb9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+166 Bytes
...repositories-meta/user2/readme-test.git/objects/50/6ff7310f420e878595b4bc8f11688e3f0ae14e
Binary file not shown.
Binary file added
BIN
+169 Bytes
...repositories-meta/user2/readme-test.git/objects/58/3eb775c596858380273492759d39081d65d029
Binary file not shown.
3 changes: 3 additions & 0 deletions
3
...repositories-meta/user2/readme-test.git/objects/60/ea618ae7d4ecbe9c1962591c7da1b05bb1a5c8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
x��;�0@�s | ||
_�*N뤕bcc���Њ�Tҁ�S!N�����d�>���!���քLu�Ul�#q����l�Q�,�ꔡ��lCBn$6��X�Dɹ�bbҖR0���y�[/O�n��� | ||
�i�����2�1��Ї@�e�p�d���iޭ�殯��!�<���N� |
Binary file added
BIN
+169 Bytes
...repositories-meta/user2/readme-test.git/objects/6a/b05db4c52530726c1856eb558228e9d1949e7f
Binary file not shown.
Binary file added
BIN
+167 Bytes
...repositories-meta/user2/readme-test.git/objects/71/60a063b5544b5a78131b94f47bfd200046eda2
Binary file not shown.
Binary file added
BIN
+28 Bytes
...repositories-meta/user2/readme-test.git/objects/75/6c70c97047d8aeb11ca3c71edd9fb76cefee9c
Binary file not shown.
Binary file added
BIN
+211 Bytes
...repositories-meta/user2/readme-test.git/objects/7f/2b9f991d99362eb827b67f4ae2f5fbc5fa2271
Binary file not shown.
Binary file added
BIN
+166 Bytes
...repositories-meta/user2/readme-test.git/objects/7f/792e709143fb0f021da2371e5f40d1bcc284fd
Binary file not shown.
Binary file added
BIN
+51 Bytes
...repositories-meta/user2/readme-test.git/objects/82/817856dadc7f6b944633e1b77d5b6e302dde06
Binary file not shown.
Binary file added
BIN
+169 Bytes
...repositories-meta/user2/readme-test.git/objects/8b/4149e7dede3cd53ba11c64c88b057c5fe2c200
Binary file not shown.
Binary file added
BIN
+28 Bytes
...repositories-meta/user2/readme-test.git/objects/93/54813d81053c14afe878a9f056b937ec42bb48
Binary file not shown.
Binary file added
BIN
+136 Bytes
...repositories-meta/user2/readme-test.git/objects/9c/72c10e55e7d6ea21f591aa424e2625e8ad8094
Binary file not shown.
Binary file added
BIN
+82 Bytes
...repositories-meta/user2/readme-test.git/objects/a3/cd04bb110e17591ac04e156c7df2c2f5c96fa6
Binary file not shown.
Binary file added
BIN
+76 Bytes
...repositories-meta/user2/readme-test.git/objects/b0/e851a5619e2d6cee1da25a15ab67305f0861ec
Binary file not shown.
Binary file added
BIN
+112 Bytes
...repositories-meta/user2/readme-test.git/objects/b4/4c8eb00bdaf0522de61e591fee5f66851ef4b5
Binary file not shown.
Binary file added
BIN
+77 Bytes
...repositories-meta/user2/readme-test.git/objects/b8/eaa80ad86072e1f23d2638842154ce9aceff8d
Binary file not shown.
Binary file added
BIN
+31 Bytes
...repositories-meta/user2/readme-test.git/objects/d5/34f914944c3c943a6bdb677d869ac54934928d
Binary file not shown.
Binary file added
BIN
+117 Bytes
...repositories-meta/user2/readme-test.git/objects/e2/f9904cd97b4045feecfffef5a426e9461bee70
Binary file not shown.
3 changes: 3 additions & 0 deletions
3
...repositories-meta/user2/readme-test.git/objects/e3/a6fd8fe49e323ee10017f72b777a53fbd8076f
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+171 Bytes
...repositories-meta/user2/readme-test.git/objects/e7/bf02fcfa7a86f7fe9e8158b55d58ddf9d877ec
Binary file not shown.
Binary file added
BIN
+77 Bytes
...repositories-meta/user2/readme-test.git/objects/ea/57c91ddb8b4ac705b5ac4c34c7a48f2d0fc180
Binary file not shown.
Binary file added
BIN
+197 Bytes
...repositories-meta/user2/readme-test.git/objects/fe/495ea336f079ef2bed68648d0ba9a37cdbd4aa
Binary file not shown.
Binary file added
BIN
+2.55 KB
tests/gitea-repositories-meta/user2/readme-test.git/objects/info/commit-graph
Binary file not shown.
2 changes: 2 additions & 0 deletions
2
tests/gitea-repositories-meta/user2/readme-test.git/objects/info/packs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
P pack-8933bd634b76f8154310cccb52537a0195e43166.pack | ||
|
Binary file added
BIN
+1.6 KB
...a/user2/readme-test.git/objects/pack/pack-8933bd634b76f8154310cccb52537a0195e43166.bitmap
Binary file not shown.
Binary file added
BIN
+3.92 KB
...meta/user2/readme-test.git/objects/pack/pack-8933bd634b76f8154310cccb52537a0195e43166.idx
Binary file not shown.
Binary file added
BIN
+7.67 KB
...eta/user2/readme-test.git/objects/pack/pack-8933bd634b76f8154310cccb52537a0195e43166.pack
Binary file not shown.
22 changes: 22 additions & 0 deletions
22
tests/gitea-repositories-meta/user2/readme-test.git/packed-refs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# pack-refs with: peeled fully-peeled sorted | ||
ea9ef877d1d88af76682d8798418081264f10cfc refs/heads/fallbacks | ||
0d4c14db927c9ffba01fa7e126cc748b5c02c01e refs/heads/fallbacks2 | ||
c66d5b07c2063d3268707f22226c708b589574ef refs/heads/fallbacks3 | ||
89f8426e9eb5eff35c09b3565836c8f8e15d0ce9 refs/heads/fallbacks4 | ||
b0e902496eae435ad03c92a5d479f916ef2d4893 refs/heads/fallbacks5 | ||
84a5500b5cc040b11daf53fc42c542a99589dc76 refs/heads/fallbacks6 | ||
cf406a96e416d7de5c4c1bbfffdd672300c822bf refs/heads/fallbacks7 | ||
0d6ac644b969e9199915a492da9dba08c179fd23 refs/heads/fallbacks8 | ||
5038febc0c57215beb3748d7ae4091a25a4acc93 refs/heads/fallbacks9 | ||
9134e1f178ca4cccf1a197142646f2d7627e8cd5 refs/heads/i18n | ||
744d2441e55bc0010d6b340d303f0106a627ad29 refs/heads/master | ||
3c492566170b057e962c025515ab38bbd7444077 refs/heads/plain | ||
3882d6373a0882a6739b3cd9b24d21c630621234 refs/heads/sp-ace | ||
bf5ed898252eaa50dcc01108ed4417c3ea98a294 refs/heads/special-subdir-.gitea | ||
c03543573ab088ce1cf7090a387d2be621426234 refs/heads/special-subdir-.github | ||
e75957ad9b7e6ed16dda183529ec283db0bbc5fe refs/heads/special-subdir-docs | ||
46f5d5ab33d701642e08c713fab42af89fdd4fea refs/heads/special-subdir-nested | ||
9c0f872256b839c2b97ec22fd348d87b14045513 refs/heads/subdir | ||
d7a854fff61e45b98234d7aa79ecbcb1619cd3dd refs/heads/symlink | ||
30b9c0ed4b1039dbd99f3fb537b84ca507e0549d refs/heads/symlink-loop | ||
41489b7be5c2244d2b7b524dcb31caf3bd1f9ccc refs/heads/txt |
1 change: 1 addition & 0 deletions
1
tests/gitea-repositories-meta/user2/readme-test.git/refs/heads/fallbacks-broken-symlinks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fe495ea336f079ef2bed68648d0ba9a37cdbd4aa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters