To make a long story short, what I'm looking for is to be able to fetch only a specific branch in a local repository, even though this repository wasn't originally cloned with "--single-branch -branch <branch_name>".
To share the complete story - we would like to use shallow clone for reducing git run time in general and specifically in our custom CI tool. Also I should state that we use the Android's "repo" tool.
As far as I understand, we first need to clone the git repository using --depth=1, which the Android's "repo" tool supports, but that is not quite enough for our CI tool which needs to deepen the fetch for being able to have a common git history when pulling updates from users' repositories. So when we try to deepen the fetch (for simplicity - "git fetch --deepen=1") then git fetches all branches and tags and spends a lot of run-time doing so, although we only need to deepen the fetch for a very specific branch.
This is resolved if the git repository is initially cloned using "--single-branch -branch " (in addition to --depth=1) and then "git fetch --deepen=1" runs ultra fast. But the issue is that it seems that the Android's "repo" tool does not support cloning git repos using "--single-branch -branch ", hence my question at the top. Alternatively, if there is another way of being able to deepen the fetch for a specific branch - I would be glad to know the details.
Thank you!