Git clone "checking connectivity" - what is it?
When doing a git clone
of a repo over SSH or HTTP, you get output that looks something like this:
Cloning into 'some_directory'...
remote: Counting objects: 7, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 7 (delta 0), reused 5 (delta 0), pack-reused 0
Unpacking objects: 100% (7/7), done.
Checking connectivity... done.
I'm interested in that last "Checking connectivity" step. It happens after the repo and all of its metadata has been downloaded, i.e. well after any internet connectivity has finished.
What exactly is this step of the process accomplishing?
I think the word connectivity
has nothing to do with network connectivity here. The message is displayed after all data were already received from git server.
One can find some clues in git sources. There is following comment in connected.c file:
/*
* If we feed all the commits we want to verify to this command
*
* $ git rev-list --objects --stdin --not --all
*
* and if it does not error out, that means everything reachable from
* these commits locally exists and is connected to our existing refs.
* Note that this does _not_ validate the individual objects.
*
* Returns 0 if everything is connected, non-zero otherwise.
*/
It is related to function check_everything_connected_real
that is called after Checking connectivity...
message is displayed.
So it basically means that git is checking whether all objects were received correctly (are connected to existing refs).