git.getContentPathFromURLorPath pulls the correct branch if it is the first time to clone a repo. However, if the repo already exists locally but uses a different branch than the one in the function call, the function will neither checkout the correct branch nor raise an error.
Steps to reproduce
Clone any repo using getContentPathFromURLorPath, then repeat the call using another branch, you'll find that the branch didn't change locally.
In [2]: j.clients.git.getContentPathFromURLorPath('https://github.com/threefoldtech/minio/tree/optimize-filemeta')
Out[2]: '/root/code/github/threefoldtech/minio/'
In [3]: !git branch
* optimize-filemeta
In [4]: j.clients.git.getContentPathFromURLorPath('https://github.com/threefoldtech/minio/tree/zerostor')
Out[4]: '/root/code/github/threefoldtech/minio/'
In [5]: !git branch
* optimize-filemeta
Installation information
Detailed description
git.getContentPathFromURLorPath
pulls the correct branch if it is the first time to clone a repo. However, if the repo already exists locally but uses a different branch than the one in the function call, the function will neither checkout the correct branch nor raise an error.Steps to reproduce
Clone any repo using
getContentPathFromURLorPath
, then repeat the call using another branch, you'll find that the branch didn't change locally.