Skip to content

Commit

Permalink
Not calling changed code (#2)
Browse files Browse the repository at this point in the history
* fix behavour for urls; should not require ".git"

* remove git import

* assume default bracnh/tag is main
  • Loading branch information
dcl10 authored Jul 31, 2023
1 parent fdf762e commit 45563a6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 deletions.
27 changes: 24 additions & 3 deletions tests/fetchers/test_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@
RemoteRepo(
repo_url="https://github.com/inab/WfExS-backend.git",
repo_type=RepoType.Git,
tag="main",
),
),
(
"git+https://github.com/inab/WfExS-backend.git",
RemoteRepo(
repo_url="https://github.com/inab/WfExS-backend.git",
repo_type=RepoType.Git,
tag="main",
),
),
(
Expand All @@ -35,20 +37,23 @@
repo_url="https://github.com/inab/WfExS-backend.git",
repo_type=RepoType.Git,
rel_path="workflow_examples/ipc/cosifer_test1_cwl.wfex.stage",
tag="main",
),
),
(
"ssh://[email protected]:inab/WfExS-backend.git",
RemoteRepo(
repo_url="[email protected]:inab/WfExS-backend.git",
repo_type=RepoType.Git,
tag="main",
),
),
(
"git+ssh://[email protected]:inab/WfExS-backend.git",
RemoteRepo(
repo_url="[email protected]:inab/WfExS-backend.git",
repo_type=RepoType.Git,
tag="main",
),
),
(
Expand All @@ -65,20 +70,23 @@
repo_url="[email protected]:inab/WfExS-backend.git",
repo_type=RepoType.Git,
rel_path="workflow_examples/ipc/cosifer_test1_cwl.wfex.stage",
tag="main",
),
),
(
"file:///inab/WfExS-backend/.git",
RemoteRepo(
repo_url="file:///inab/WfExS-backend/.git",
repo_type=RepoType.Git,
tag="main",
),
),
(
"git+file:///inab/WfExS-backend/.git",
RemoteRepo(
repo_url="file:///inab/WfExS-backend/.git",
repo_type=RepoType.Git,
tag="main",
),
),
(
Expand All @@ -95,6 +103,7 @@
repo_url="file:///inab/WfExS-backend/.git",
repo_type=RepoType.Git,
rel_path="workflow_examples/ipc/cosifer_test1_cwl.wfex.stage",
tag="main",
),
),
(
Expand All @@ -107,15 +116,27 @@
),
(
"ssh://[email protected]:inab/WfExS-backend",
None,
RemoteRepo(
repo_url="[email protected]:inab/WfExS-backend",
repo_type=RepoType.Git,
tag="main",
),
),
(
"https://github.com/inab/WfExS-backend",
None,
RemoteRepo(
repo_url="https://github.com/inab/WfExS-backend",
repo_type=RepoType.Git,
tag="main",
),
),
(
"file:///inab/WfExS-backend",
None,
RemoteRepo(
repo_url="file:///inab/WfExS-backend",
repo_type=RepoType.Git,
tag="main",
),
),
],
)
Expand Down
10 changes: 1 addition & 9 deletions wfexs_backend/fetchers/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
from urllib import parse, request

import dulwich.porcelain
import git

from . import (
AbstractRepoFetcher,
Expand Down Expand Up @@ -380,7 +379,7 @@ def guess_git_repo_params(
if no repo was found.
"""
repoURL = None
repoTag = None
repoTag = "main"
repoRelPath = None
repoType: "Optional[RepoType]" = RepoType.Git

Expand All @@ -396,13 +395,6 @@ def guess_git_repo_params(
f"No scheme in repo URL. Choices are: {', '.join(GIT_SCHEMES)}"
)
return None

# Return None if no scheme in URL. Can't choose how to proceed
if not ".git" in parsed_wf_url.path:
logger.debug(
f"URL does not seem to point to a git repo."
)
return None

# Getting the scheme git is going to understand
git_scheme = parsed_wf_url.scheme.removeprefix("git+")
Expand Down

0 comments on commit 45563a6

Please sign in to comment.