Skip to content

Conversation

@bk2204
Copy link
Member

@bk2204 bk2204 commented Dec 16, 2022

Right now, creating a checkout object as used by the checkout and pull commands creates a manifest. This manifest in turn creates an SSHTransfer object to potentially connect via the new pure SSH protocol. However, connecting to the Internet during git lfs checkout is unexpected and may cause this operation to fail when one is not online.

In order to set the manifest's configuration parameters correctly, we need to know whether it's possible to make a pure SSH protocol connection, so it's non-trivial to avoid this connection by delaying the initialization of SSHTransfer object. Instead, let's lazily create our manifest in the checkout code to avoid creating the connection. If we're performing a git lfs pull, then it will be used and we'll initialize it very quickly, making the connection, and if we're using git lfs checkout, it won't be initialized at all, and we'll remain offline.

Fixes #5191

Right now, creating a checkout object as used by the checkout and pull
commands creates a manifest.  This manifest in turn creates an
SSHTransfer object to potentially connect via the new pure SSH protocol.
However, connecting to the Internet during `git lfs checkout` is
unexpected and may cause this operation to fail when one is not online.

In order to set the manifest's configuration parameters correctly, we
need to know whether it's possible to make a pure SSH protocol
connection, so it's non-trivial to avoid this connection by delaying the
initialization of SSHTransfer object.  Instead, let's lazily create our
manifest in the checkout code to avoid creating the connection.  If
we're performing a `git lfs pull`, then it will be used and we'll
initialize it very quickly, making the connection, and if we're using
`git lfs checkout`, it won't be initialized at all, and we'll remain
offline.
@bk2204 bk2204 marked this pull request as ready for review December 16, 2022 18:23
@bk2204 bk2204 requested a review from a team as a code owner December 16, 2022 18:23
@bk2204 bk2204 merged commit f62ded1 into git-lfs:main Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

git lfs checkout communicates with remotes despite expectations

2 participants