mtt icon indicating copy to clipboard operation
mtt copied to clipboard

Git plugin fails to clone repo URLs with trailing /

Open ribab opened this issue 4 years ago • 3 comments
trafficstars

When a repo URL ends in / MTT thinks the name of this repo is an empty string and fails to chdir into it.

This is the error:

=======================================
Exception was raised: <class 'FileNotFoundError'> [Errno 2] No such file or directory: ''
=======================================
Traceback (most recent call last):

  File "/opt/mtt/pylib/Tools/Executor/sequential.py", line 284, in execute_sections
    plugin.execute(stageLog, keyvals, testDef)

  File "/opt/mtt/pylib/Tools/Fetch/Git.py", line 456, in execute
    os.chdir(repo)

FileNotFoundError: [Errno 2] No such file or directory: ''

The fix might be to filter out the trailing slash before computing the name of the repo.

ribab avatar Oct 21 '21 18:10 ribab

@ribab are you going to open a pr to fix this?

hppritcha avatar Oct 21 '21 18:10 hppritcha

@ribab did PR #922 fix this issue?

hppritcha avatar Nov 12 '21 16:11 hppritcha

@hppritcha no it doesn't fix that issue. The workaround is to just not have a trailing slash in the ini file. I think this would be easy to fix though

ribab avatar Nov 12 '21 17:11 ribab