-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove seen
map from getLastCommitForPaths
#6807
Conversation
Ensures correctly traversing the commit graph for all path and avoids erroneously skipping some. Also preallocate some arrays to correct size to prevent unnecessary reallocations. Fixes go-gitea#6708. Signed-off-by: Filip Navara <filip.navara@gmail.com>
Note that on specially corrupted repositories (cyclic commit graph) this could pose a problem since the algorithm could end up in a loop. It's non trivial to create such repository but it should probably be fixed anyway to prevent intentional DoS attacks. It is no longer possible to prevent it with simple map but maybe it's possible to impose some other limit (time, depth). Previous code from Gitea 1.8.0 used to do the processing in parallel and give up after one minute. Not sure what would be rendered on output then. |
Codecov Report
@@ Coverage Diff @@
## master #6807 +/- ##
==========================================
- Coverage 41.21% 41.21% -0.01%
==========================================
Files 421 421
Lines 58064 58059 -5
==========================================
- Hits 23931 23927 -4
+ Misses 30966 30965 -1
Partials 3167 3167
Continue to review full report at Codecov.
|
We have to backport this to 1.8 ? |
1.8 is not affected |
Ensures correctly traversing the commit graph for all path and avoids
erroneously skipping some. Also preallocate some arrays to correct size
to prevent unnecessary reallocations.
Fixes #6708.