diff --git a/.lib/git-fleximod/git_fleximod/cli.py b/.lib/git-fleximod/git_fleximod/cli.py index 139083344..fdcf102a1 100644 --- a/.lib/git-fleximod/git_fleximod/cli.py +++ b/.lib/git-fleximod/git_fleximod/cli.py @@ -2,7 +2,7 @@ import argparse from git_fleximod import utils -__version__ = "0.8.1" +__version__ = "0.8.2" def find_root_dir(filename=".gitmodules"): """ finds the highest directory in tree diff --git a/.lib/git-fleximod/git_fleximod/submodule.py b/.lib/git-fleximod/git_fleximod/submodule.py index 713ea344d..48657272e 100644 --- a/.lib/git-fleximod/git_fleximod/submodule.py +++ b/.lib/git-fleximod/git_fleximod/submodule.py @@ -1,6 +1,7 @@ import os import textwrap import shutil +import string from configparser import NoOptionError from git_fleximod import utils from git_fleximod.gitinterface import GitInterface @@ -162,7 +163,8 @@ def _add_remote(self, git): if remotes: upstream = git.git_operation("ls-remote", "--get-url").rstrip() newremote = "newremote.00" - line = next((s for s in remotes if self.url or tmpurl in s), None) + tmpurl = self.url.replace("git@github.com:", "https://github.com/") + line = next((s for s in remotes if self.url in s or tmpurl in s), None) if line: newremote = line.split()[0] return newremote @@ -357,6 +359,13 @@ def update(self): if self.fxtag: smgit = GitInterface(repodir, self.logger) + newremote = self._add_remote(smgit) + # Trying to distingush a tag from a hash + allowed = set(string.digits + 'abcdef') + if not set(self.fxtag) <= allowed: + # This is a tag + tag = f"refs/tags/{self.fxtag}:refs/tags/{self.fxtag}" + smgit.git_operation("fetch", newremote, tag) smgit.git_operation("checkout", self.fxtag) if not os.path.exists(os.path.join(repodir, ".git")): diff --git a/.lib/git-fleximod/pyproject.toml b/.lib/git-fleximod/pyproject.toml index ef8f541f1..9cff1423c 100644 --- a/.lib/git-fleximod/pyproject.toml +++ b/.lib/git-fleximod/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "git-fleximod" -version = "0.8.1" +version = "0.8.2" description = "Extended support for git-submodule and git-sparse-checkout" authors = ["Jim Edwards "] maintainers = ["Jim Edwards "] diff --git a/.lib/git-fleximod/tbump.toml b/.lib/git-fleximod/tbump.toml index 0b0d5ac7a..b4eed7d40 100644 --- a/.lib/git-fleximod/tbump.toml +++ b/.lib/git-fleximod/tbump.toml @@ -2,7 +2,7 @@ github_url = "https://github.com/jedwards4b/git-fleximod/" [version] -current = "0.8.1" +current = "0.8.2" # Example of a semver regexp. # Make sure this matches current_version before