Skip to content

SSH URL support for tfs repos  #142

Open
@claudiosteuernagel

Description

@claudiosteuernagel

I'm trying to create a pull request to master branch, but i'm getting the error message "ERROR: must be str, not NoneType".

The problem only ocurrs when i'm using SSH Url to clone the repository. If i'm clone the repository using HTTP, works normaly.

I'm running the following command to create the pull request:

git pr create --target-branch master

Running the same command with --debug option, i'm getting this detailed error:

DEBUG: Command arguments: ['code', 'pr', 'create', '--target-branch', 'master', '--debug']
DEBUG: Event: Cli.PreExecute [<function VstsCLI.pre_execute at 0x0000012C5E273488>]
DEBUG: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x0000012C5D4E7F28>, <function OutputProducer.on_global_arguments at 0x0000012C5D504EA0>, <function CLIQuery.on_global_arguments at 0x0000012C5D583AE8>]
DEBUG: Event: CommandInvoker.OnPreCommandTableCreate [<function CLILogging.remove_logger_flags at 0x0000012C5D4EA048>]
DEBUG: Event: CommandLoader.OnLoadCommandTable []
DEBUG: Event: CommandLoader.OnLoadArguments []
DEBUG: Event: CommandInvoker.OnPostCommandTableCreate []
DEBUG: Event: CommandInvoker.OnCommandTableLoaded []
DEBUG: Event: CommandInvoker.OnPreParseArgs []
DEBUG: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x0000012C5D504F28>, <function CLIQuery.handle_query_parameter at 0x0000012C5D583B70>]
DEBUG: root : Remote url: ssh://MY-TFS-SERVER:22/tfs/COLLECTION/SAMPLE_PROJECT/_git/SAMPLE_PROJECT
INFO: root : Loading cache file: C:\Users\USER\.vsts\cli\cache\remotes.json
DEBUG: root : attempting to read file C:\Users\USER\.vsts\cli\cache\remotes.json as utf-8-sig
ERROR: root : must be str, not NoneType
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft SDKs\VSTS\CLI\lib\site-packages\vsts\cli\code\common\pull_request.py", line 166, in create_pull_request
    repo=repository)
  File "C:\Program Files (x86)\Microsoft SDKs\VSTS\CLI\lib\site-packages\vsts\cli\common\services.py", line 135, in resolve_instance_project_and_repo
    git_info = get_vsts_info_from_current_remote_url()
  File "C:\Program Files (x86)\Microsoft SDKs\VSTS\CLI\lib\site-packages\vsts\cli\common\services.py", line 187, in get_vsts_info_from_current_remote_url
    info = VstsGitUrlInfo(get_remote_url(VstsGitUrlInfo.is_vsts_url_candidate))
  File "C:\Program Files (x86)\Microsoft SDKs\VSTS\CLI\lib\site-packages\vsts\cli\common\vsts_git_url_info.py", line 41, in __init__
    vsts_info = self.get_vsts_info(remote_url)
  File "C:\Program Files (x86)\Microsoft SDKs\VSTS\CLI\lib\site-packages\vsts\cli\common\vsts_git_url_info.py", line 67, in get_vsts_info
    uri = 'https://' + netloc + '/' + components.path
TypeError: must be str, not NoneType
ERROR: must be str, not NoneType

thanks,
Cláudio

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions