Skip to content

Commit

Permalink
Merge commit '75a03373577f5ed19a00d2c387ca36bff1172d76' into cesm3.0-…
Browse files Browse the repository at this point in the history
…alphabranch
  • Loading branch information
jedwards4b committed Jul 9, 2024
2 parents 81da998 + 75a0337 commit 611db33
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .lib/git-fleximod/git_fleximod/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion .lib/git-fleximod/git_fleximod/submodule.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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")):
Expand Down
2 changes: 1 addition & 1 deletion .lib/git-fleximod/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <jedwards@ucar.edu>"]
maintainers = ["Jim Edwards <jedwards@ucar.edu>"]
Expand Down
2 changes: 1 addition & 1 deletion .lib/git-fleximod/tbump.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 611db33

Please sign in to comment.