Closed vdye closed 1 year ago
Upon doing more testing, I've found more bugs (e.g., git-bundle-server update
never calls git fetch
, so no new bundles will ever be created). I don't think that affects the other bugfixes (those can be reviewed as-is), but I will be pushing more things to this branch in the near future.
Fixes #32
While end-to-end testing, I ran into #32; while investigating that bug, I found a couple others. This PR fixes all of the ones I've found, and adds some unit test coverage for good measure.
TraceLogger
from suppressing the message intended to be logged to the console inFatal()
&Fatalf()
.logger.Error*()
call up the call stack (and only log the first it sees), but instead it logged every error except the first one. 🤦♀️GitHelper
GitHelper.CreateIncrementalBundle()
. Specifically, the function was intended to return no error if the Git error message indicated that any new incremental bundle would be empty; that message wasn't captured, soCreateIncrementalBundle()
would never see it and always return an error.BundleProvider.WriteBundleList
to write two bundle lists: one with bundle paths relative to a request URI with a trailing slash (with relative paths likebundle-123456.bundle
), and one (new) for URIs with no trailing slash (relative path likemyrepo/bundle-123456.bundle
). This is the first step to fixing how we serve bundle list requests with no trailing slash.bundleServer.serve()
to serve the relative-to-org (rather than relative-to-repo) bundle file if there is no trailing slash on the request URI.git-bundle-server update
. Without that, no new incremental bundles will ever be generated.bundle.heuristic
config to the bundle lists served by the bundle server, ensuring incremental bundles will be applied on fetches after an initial clone.Other approaches to #32
I also considered generating the bundle list config contents on the fly (by reading the
bundle-list.json
and formatting the output), but the cost tradeoff of computation for every request vs. a bit of extra disk space seemed to favor the latter.