Skip to content
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

git: Fix submodule fetch, rewrite logic #104

Merged
merged 1 commit into from
Jun 16, 2024
Merged

Commits on Jun 14, 2024

  1. git: Fix submodule fetch, rewrite logic

    The logic for this was quite broken and had several failure cases due to that. This commit re-writes that to be saner.
    
    Changes:
    - Individual exec commands are all split out to separate functions so that they can be more easily composed. No function does more than a single command
    - Control flow now happens entirely in the Fetch() function
    - Before there were several failure states around submodules due to the `git switch` command happening immediately after the `git fetch` if the repo was already cloned. This is fixed by moving to a unified control flow.
    - `Fetch()` will now run either the initial clone OR update refs before moving onto further steps
    - `git clone` no longer attempts to initialize submodules. Several features from `git submodules` aren't yet implemented by `git clone` and so submodule initialization is moved entirely into a `git submodule` command
    - `git switch` now happens after the clone/fetch but before `git submodule`
    - `git switch` now no longer runs with any submodule-related flags. Like `git clone` the features we need are just not implemented yet and as far as I can tell there are subtle behavioral differences that were causing issues.
    - `git submodule` will now use `--filter=blob:none` to specify that submodule checkouts should themselves be blobless when possible. As far as I can tell this works correctly with `--recursive` and recursive submodules.
    - Because we are now checking out submodules with blobless clones when possible the `fixPermissions()` logic has been updated to account for promisor files that could be in submodule `.git` directories
    ReillyBrogan committed Jun 14, 2024
    Configuration menu
    Copy the full SHA
    a6c2b80 View commit details
    Browse the repository at this point in the history