We are planning to use git ls-remote <repository> [<refs>…]
without any additional parameters concurrently to virtually any other Git operation. I'm looking for a confirmation that ls-remote
is read-only, so it can't break any other operation.
Yes, it is a read-only operation.
Nothing in builtin/ls-remote.c suggests any operation modifying the local repo.
It sets as transport the TRANS_OPT_UPLOADPACK
, which is used also in two other git commands (which don't modify the remote repo):
git clone
(builtin/clone.c:919
) and git fetch
(builtin/fetch.c:807
)
/* The program to use on the remote side to send a pack */
#define TRANS_OPT_UPLOADPACK "uploadpack"
It is asking the remote repo to send packs, nothing more.