Repository: seeraven/gitcache

Issue:
Add support for `git remote`
A relatively common pattern, particularly for CI clone steps, appears to be to not do a full `git clone`, but rather to do:

```
cd src
git init
git remote add origin ${URL}
```
and then goes on to manually check out a branch, commit, etc. depending on the CI job that is running.

For example, drone-ci uses this script for the clone step with this pattern: https://github.com/drone/drone-git/blob/master/posix/clone-pull-request.

(This is basically what a `git pull` does, except that it's missing the final checkout of the target branch -- and that's a bit easier in a CI script to avoid unnecessarily checking out code you're not going to use.)

Unfortunately this makes gitcache not work, because the `remote` is not recognized and gitcache just says that this isn't a handled repository when initialized this way, passing all commands through to the underlying git without doing anything itself.

It would be great to have this pattern be recognized and handled.

Hints from issue comments:
@seeraven: Sorry for the delay and thank you for the issue. I guess it should be quite easy to implement. It would need to intercept the `git remote add` command and perform the following steps:
- Create or update the mirror for the specified URL.
- Issue a `git remote add` command with the local mirror directory.
- Issue a `git remote set-url --push` command with the specified URL.

As far as I can tell, `gitcache` could intercept all kind of `git remote add <name> <url>` commands, not only ones specified for `origin`. However, I would stick at handling only `git remote add origin <url>` commands as it simplifies the testing effort. What do you think?@jagerman: > As far as I can tell, gitcache could intercept all kind of git remote add <name> <url> commands, not only ones specified for origin. However, I would stick at handling only git remote add origin <url> commands as it simplifies the testing effort. What do you think?

It sounds like handling more than just origin could get complicated fast; but just having handling of origin would be a big gain.@seeraven: I've added the `git remote add origin <url>` handling and published the new release https://github.com/seeraven/gitcache/releases/tag/v1.0.25 . Any feedback on it is highly welcome. ;-)@dgow: i'm getting an error then executing `git remote -v` on 1.0.25. downgrading to 1.0.24 works fine.

```
E:\my_worker\Release\develop>gitcache git remote -v
2025-03-21 08:02:38 Python executable: E:\bin\gitcache.exe
2025-03-21 08:02:38 Called as ['gitcache', 'git', 'remote', '-v']
2025-03-21 08:02:38 handle_git_command(['gitcache', 'git'], ['remote', '-v']) started
Traceback (most recent call last):
  File "gitcache.py", line 21, in <module>
  File "git_cache\cli.py", line 57, in main_cli
  File "git_cache\git_command.py", line 72, in handle_git_command
  File "git_cache\git_options.py", line 297, in __init__
  File "git_cache\git_options.py", line 413, in _parse
KeyError: 'remote'
[PYI-4716:ERROR] Failed to execute script 'gitcache' due to unhandled exception!
```

Problem spotted when executing `gh release create`@seeraven: Thanks for reporting the error! Fixed it and added a test. Latest release 1.0.16 contains that fix.

Solution patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b67c1b9..3391185 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,10 @@
 
 ## Upcoming Version
 
+## v1.0.26
+
+- Bugfix: Fix command line handling when using the `git remote` command.
+
 ## v1.0.25
 
 - Handle `git remote add origin` by cloning the remote if it was not mirrored
diff --git a/README.md b/README.md
index d468adb..ea30efb 100644
--- a/README.md
+++ b/README.md
@@ -77,8 +77,8 @@ gitcache is distributed as a single executable packaged using [pyInstaller].
 So all you have to do is to download the latest executable and copy it to a
 location of your choice, for example `~/bin`:
 
-    wget https://github.com/seeraven/gitcache/releases/download/v1.0.25/gitcache_v1.0.25_Ubuntu22.04_x86_64
-    mv gitcache_v1.0.25_Ubuntu22.04_x86_64 ~/bin/gitcache
+    wget https://github.com/seeraven/gitcache/releases/download/v1.0.26/gitcache_v1.0.26_Ubuntu22.04_x86_64
+    mv gitcache_v1.0.26_Ubuntu22.04_x86_64 ~/bin/gitcache
     chmod +x ~/bin/gitcache
 
 gitcache can be used as a stand-alone command, but it is much easier to use
@@ -115,9 +115,9 @@ gitcache is distributed as a tar-ball (`*.tgz` file). Download the archive and
 extract it at your desired target location (the archive contains a subfolder):
 
     cd /my/target/destination
-    tar xfz gitcache_v1.0.25_Darwin_arm64.tgz
-    xattr -cr gitcache_v1.0.25_Darwin_arm64
-    ls gitcache_v1.0.25_Darwin_arm64
+    tar xfz gitcache_v1.0.26_Darwin_arm64.tgz
+    xattr -cr gitcache_v1.0.26_Darwin_arm64
+    ls gitcache_v1.0.26_Darwin_arm64
 
 To use the `gitcache` command, the final installation directory should be put
 into your `PATH` variable. To use it as a wrapper to the `git` command, you
@@ -136,7 +136,7 @@ before opening a bug ticket.
 The latest wheel is found on the release page
 https://github.com/seeraven/gitcache/releases and is installed using pip:
 
-    pip install gitcache-1.0.25-py3-none-any.whl
+    pip install gitcache-1.0.26-py3-none-any.whl
 
 As with the other installation methods, you have to make sure to create a
 symlink named `git` to the location of the `gitcache` script and ensure it
@@ -359,7 +359,7 @@ is pushed to the repository. This changes the release process a little bit:
     `src/git_cache/git_cache_command.py` and `doc/source/installation.rst` and
     replace the version number:
 
-        sed -i 's/1.0.25/1.0.26/g' Makefile pyproject.toml src/git_cache/git_cache_command.py doc/source/installation.rst
+        sed -i 's/1.0.26/1.0.27/g' Makefile pyproject.toml src/git_cache/git_cache_command.py doc/source/installation.rst
 
 
 ## Notes on Building a Pip-Package
diff --git a/doc/source/installation.rst b/doc/source/installation.rst
index 3c2389d..b8aec7a 100644
--- a/doc/source/installation.rst
+++ b/doc/source/installation.rst
@@ -14,8 +14,8 @@ So all you have to do is to download the latest executable from the release page
 |release_url| and copy it to a location of your choice, for example
 :code:`/usr/local/bin`.
 
-    $ wget https://github.com/seeraven/gitcache/releases/download/v1.0.26/gitcache_v1.0.26_Ubuntu22.04_amd64
-    $ mv gitcache_v1.0.26_Ubuntu22.04_amd64 /usr/local/bin/gitcache
+    $ wget https://github.com/seeraven/gitcache/releases/download/v1.0.27/gitcache_v1.0.27_Ubuntu22.04_amd64
+    $ mv gitcache_v1.0.27_Ubuntu22.04_amd64 /usr/local/bin/gitcache
     $ chmod +x /usr/local/bin/gitcache
     $ ln -s /usr/local/bin/gitcache /usr/local/bin/git
 
diff --git a/pip_deps/dev_requirements-linux-py3.10.12.txt b/pip_deps/dev_requirements-linux-py3.10.12.txt
index 71bbd5d..587d6f3 100644
--- a/pip_deps/dev_requirements-linux-py3.10.12.txt
+++ b/pip_deps/dev_requirements-linux-py3.10.12.txt
@@ -2,13 +2,13 @@ alabaster==1.0.0
     # via sphinx
 altgraph==0.17.4
     # via pyinstaller
-astroid==3.3.8
+astroid==3.3.9
     # via pylint
 asttokens==3.0.0
     # via stack-data
-attrs==25.1.0
+attrs==25.3.0
     # via flake8-bugbear
-babel==2.16.0
+babel==2.17.0
     # via sphinx
 black==25.1.0
     # via
@@ -22,11 +22,11 @@ click==8.1.8
     # via black
 coloredlogs==15.0.1
     # via gitcache (pyproject.toml)
-coverage[toml]==7.6.10
+coverage[toml]==7.7.0
     # via
     #   gitcache (pyproject.toml)
     #   pytest-cov
-decorator==5.1.1
+decorator==5.2.1
     # via ipython
 dill==0.3.9
     # via pylint
@@ -34,9 +34,9 @@ docutils==0.21.2
     # via
     #   sphinx
     #   sphinx-rtd-theme
-dom-toml==2.0.0
+dom-toml==2.0.1
     # via sphinx-pyproject
-domdf-python-tools==3.9.0
+domdf-python-tools==3.10.0
     # via
     #   dom-toml
     #   sphinx-pyproject
@@ -46,7 +46,7 @@ exceptiongroup==1.2.2
     #   pytest
 executing==2.2.0
     # via stack-data
-flake8==7.1.1
+flake8==7.1.2
     # via
     #   flake8-black
     #   flake8-bugbear
@@ -71,18 +71,18 @@ idna==3.10
     # via requests
 imagesize==1.4.1
     # via sphinx
-iniconfig==2.0.0
+iniconfig==2.1.0
     # via pytest
-ipython==8.32.0
+ipython==8.34.0
     # via gitcache (pyproject.toml)
-isort==6.0.0
+isort==6.0.1
     # via
     #   flake8-isort
     #   gitcache (pyproject.toml)
     #   pylint
 jedi==0.19.2
     # via ipython
-jinja2==3.1.5
+jinja2==3.1.6
     # via sphinx
 markupsafe==3.0.2
     # via jinja2
@@ -92,9 +92,9 @@ mccabe==0.7.0
     # via
     #   flake8
     #   pylint
-mock==5.1.0
+mock==5.2.0
     # via gitcache (pyproject.toml)
-mypy==1.14.1
+mypy==1.15.0
     # via gitcache (pyproject.toml)
 mypy-extensions==1.0.0
     # via
@@ -117,7 +117,7 @@ pep8-naming==0.14.1
     # via gitcache (pyproject.toml)
 pexpect==4.9.0
     # via ipython
-platformdirs==4.3.6
+platformdirs==4.3.7
     # via
     #   black
     #   pylint
@@ -141,13 +141,13 @@ pygments==2.19.1
     # via
     #   ipython
     #   sphinx
-pyinstaller==6.11.1
+pyinstaller==6.12.0
     # via gitcache (pyproject.toml)
 pyinstaller-hooks-contrib==2025.1
     # via pyinstaller
-pylint==3.3.4
+pylint==3.3.6
     # via gitcache (pyproject.toml)
-pytest==8.3.4
+pytest==8.3.5
     # via
     #   gitcache (pyproject.toml)
     #   pytest-cov
@@ -204,7 +204,7 @@ traitlets==5.14.3
     # via
     #   ipython
     #   matplotlib-inline
-types-mock==5.1.0.20240425
+types-mock==5.2.0.20250306
     # via gitcache (pyproject.toml)
 typing-extensions==4.12.2
     # via
diff --git a/pip_deps/dev_requirements-linux-py3.12.3.txt b/pip_deps/dev_requirements-linux-py3.12.3.txt
index 7b81d51..570c409 100644
--- a/pip_deps/dev_requirements-linux-py3.12.3.txt
+++ b/pip_deps/dev_requirements-linux-py3.12.3.txt
@@ -2,13 +2,13 @@ alabaster==1.0.0
     # via sphinx
 altgraph==0.17.4
     # via pyinstaller
-astroid==3.3.8
+astroid==3.3.9
     # via pylint
 asttokens==3.0.0
     # via stack-data
-attrs==25.1.0
+attrs==25.3.0
     # via flake8-bugbear
-babel==2.16.0
+babel==2.17.0
     # via sphinx
 black==25.1.0
     # via
@@ -22,11 +22,11 @@ click==8.1.8
     # via black
 coloredlogs==15.0.1
     # via gitcache (pyproject.toml)
-coverage[toml]==7.6.10
+coverage[toml]==7.7.0
     # via
     #   gitcache (pyproject.toml)
     #   pytest-cov
-decorator==5.1.1
+decorator==5.2.1
     # via ipython
 dill==0.3.9
     # via pylint
@@ -34,15 +34,15 @@ docutils==0.21.2
     # via
     #   sphinx
     #   sphinx-rtd-theme
-dom-toml==2.0.0
+dom-toml==2.0.1
     # via sphinx-pyproject
-domdf-python-tools==3.9.0
+domdf-python-tools==3.10.0
     # via
     #   dom-toml
     #   sphinx-pyproject
 executing==2.2.0
     # via stack-data
-flake8==7.1.1
+flake8==7.1.2
     # via
     #   flake8-black
     #   flake8-bugbear
@@ -67,18 +67,20 @@ idna==3.10
     # via requests
 imagesize==1.4.1
     # via sphinx
-iniconfig==2.0.0
+iniconfig==2.1.0
     # via pytest
-ipython==8.32.0
+ipython==9.0.2
     # via gitcache (pyproject.toml)
-isort==6.0.0
+ipython-pygments-lexers==1.1.1
+    # via ipython
+isort==6.0.1
     # via
     #   flake8-isort
     #   gitcache (pyproject.toml)
     #   pylint
 jedi==0.19.2
     # via ipython
-jinja2==3.1.5
+jinja2==3.1.6
     # via sphinx
 markupsafe==3.0.2
     # via jinja2
@@ -88,9 +90,9 @@ mccabe==0.7.0
     # via
     #   flake8
     #   pylint
-mock==5.1.0
+mock==5.2.0
     # via gitcache (pyproject.toml)
-mypy==1.14.1
+mypy==1.15.0
     # via gitcache (pyproject.toml)
 mypy-extensions==1.0.0
     # via
@@ -113,7 +115,7 @@ pep8-naming==0.14.1
     # via gitcache (pyproject.toml)
 pexpect==4.9.0
     # via ipython
-platformdirs==4.3.6
+platformdirs==4.3.7
     # via
     #   black
     #   pylint
@@ -136,14 +138,15 @@ pyflakes==3.2.0
 pygments==2.19.1
     # via
     #   ipython
+    #   ipython-pygments-lexers
     #   sphinx
-pyinstaller==6.11.1
+pyinstaller==6.12.0
     # via gitcache (pyproject.toml)
 pyinstaller-hooks-contrib==2025.1
     # via pyinstaller
-pylint==3.3.4
+pylint==3.3.6
     # via gitcache (pyproject.toml)
-pytest==8.3.4
+pytest==8.3.5
     # via
     #   gitcache (pyproject.toml)
     #   pytest-cov
@@ -156,9 +159,11 @@ pytimeparse==1.1.8
     # via gitcache (pyproject.toml)
 requests==2.32.3
     # via sphinx
+roman-numerals-py==3.1.0
+    # via sphinx
 snowballstemmer==2.2.0
     # via sphinx
-sphinx==8.1.3
+sphinx==8.2.3
     # via
     #   gitcache (pyproject.toml)
     #   sphinx-rtd-theme
@@ -191,7 +196,7 @@ traitlets==5.14.3
     # via
     #   ipython
     #   matplotlib-inline
-types-mock==5.1.0.20240425
+types-mock==5.2.0.20250306
     # via gitcache (pyproject.toml)
 typing-extensions==4.12.2
     # via
diff --git a/pip_deps/dev_requirements-linux-py3.8.10.txt b/pip_deps/dev_requirements-linux-py3.8.10.txt
index 13ae976..36218ca 100644
--- a/pip_deps/dev_requirements-linux-py3.8.10.txt
+++ b/pip_deps/dev_requirements-linux-py3.8.10.txt
@@ -6,9 +6,9 @@ astroid==3.2.4
     # via pylint
 asttokens==3.0.0
     # via stack-data
-attrs==25.1.0
+attrs==25.3.0
     # via flake8-bugbear
-babel==2.16.0
+babel==2.17.0
     # via sphinx
 backcall==0.2.0
     # via ipython
@@ -28,7 +28,7 @@ coverage[toml]==7.6.1
     # via
     #   gitcache (pyproject.toml)
     #   pytest-cov
-decorator==5.1.1
+decorator==5.2.1
     # via ipython
 dill==0.3.9
     # via pylint
@@ -36,9 +36,9 @@ docutils==0.20.1
     # via
     #   sphinx
     #   sphinx-rtd-theme
-dom-toml==2.0.0
+dom-toml==2.0.1
     # via sphinx-pyproject
-domdf-python-tools==3.9.0
+domdf-python-tools==3.10.0
     # via
     #   dom-toml
     #   sphinx-pyproject
@@ -46,7 +46,7 @@ exceptiongroup==1.2.2
     # via pytest
 executing==2.2.0
     # via stack-data
-flake8==7.1.1
+flake8==7.1.2
     # via
     #   flake8-black
     #   flake8-bugbear
@@ -79,7 +79,7 @@ importlib-metadata==8.5.0
     #   sphinx
 importlib-resources==6.4.5
     # via domdf-python-tools
-iniconfig==2.0.0
+iniconfig==2.1.0
     # via pytest
 ipython==8.12.3
     # via gitcache (pyproject.toml)
@@ -90,7 +90,7 @@ isort==5.13.2
     #   pylint
 jedi==0.19.2
     # via ipython
-jinja2==3.1.5
+jinja2==3.1.6
     # via sphinx
 markupsafe==2.1.5
     # via jinja2
@@ -100,7 +100,7 @@ mccabe==0.7.0
     # via
     #   flake8
     #   pylint
-mock==5.1.0
+mock==5.2.0
     # via gitcache (pyproject.toml)
 mypy==1.14.1
     # via gitcache (pyproject.toml)
@@ -151,13 +151,13 @@ pygments==2.19.1
     # via
     #   ipython
     #   sphinx
-pyinstaller==6.11.1
+pyinstaller==6.12.0
     # via gitcache (pyproject.toml)
 pyinstaller-hooks-contrib==2025.1
     # via pyinstaller
 pylint==3.2.7
     # via gitcache (pyproject.toml)
-pytest==8.3.4
+pytest==8.3.5
     # via
     #   gitcache (pyproject.toml)
     #   pytest-cov
diff --git a/pip_deps/dev_requirements-win32-py3.11.9.txt b/pip_deps/dev_requirements-win32-py3.11.9.txt
index 312a26b..6f9d9a2 100644
--- a/pip_deps/dev_requirements-win32-py3.11.9.txt
+++ b/pip_deps/dev_requirements-win32-py3.11.9.txt
@@ -2,13 +2,13 @@ alabaster==1.0.0
     # via sphinx
 altgraph==0.17.4
     # via pyinstaller
-astroid==3.3.8
+astroid==3.3.9
     # via pylint
 asttokens==3.0.0
     # via stack-data
-attrs==25.1.0
+attrs==25.3.0
     # via flake8-bugbear
-babel==2.16.0
+babel==2.17.0
     # via sphinx
 black==25.1.0
     # via
@@ -29,11 +29,11 @@ colorama==0.4.6
     #   sphinx
 coloredlogs==15.0.1
     # via gitcache (pyproject.toml)
-coverage[toml]==7.6.10
+coverage[toml]==7.7.0
     # via
     #   gitcache (pyproject.toml)
     #   pytest-cov
-decorator==5.1.1
+decorator==5.2.1
     # via ipython
 dill==0.3.9
     # via pylint
@@ -41,15 +41,15 @@ docutils==0.21.2
     # via
     #   sphinx
     #   sphinx-rtd-theme
-dom-toml==2.0.0
+dom-toml==2.0.1
     # via sphinx-pyproject
-domdf-python-tools==3.9.0
+domdf-python-tools==3.10.0
     # via
     #   dom-toml
     #   sphinx-pyproject
 executing==2.2.0
     # via stack-data
-flake8==7.1.1
+flake8==7.1.2
     # via
     #   flake8-black
     #   flake8-bugbear
@@ -74,18 +74,20 @@ idna==3.10
     # via requests
 imagesize==1.4.1
     # via sphinx
-iniconfig==2.0.0
+iniconfig==2.1.0
     # via pytest
-ipython==8.32.0
+ipython==9.0.2
     # via gitcache (pyproject.toml)
-isort==6.0.0
+ipython-pygments-lexers==1.1.1
+    # via ipython
+isort==6.0.1
     # via
     #   flake8-isort
     #   gitcache (pyproject.toml)
     #   pylint
 jedi==0.19.2
     # via ipython
-jinja2==3.1.5
+jinja2==3.1.6
     # via sphinx
 markupsafe==3.0.2
     # via jinja2
@@ -95,9 +97,9 @@ mccabe==0.7.0
     # via
     #   flake8
     #   pylint
-mock==5.1.0
+mock==5.2.0
     # via gitcache (pyproject.toml)
-mypy==1.14.1
+mypy==1.15.0
     # via gitcache (pyproject.toml)
 mypy-extensions==1.0.0
     # via
@@ -120,7 +122,7 @@ pefile==2023.2.7
     # via pyinstaller
 pep8-naming==0.14.1
     # via gitcache (pyproject.toml)
-platformdirs==4.3.6
+platformdirs==4.3.7
     # via
     #   black
     #   pylint
@@ -141,16 +143,17 @@ pyflakes==3.2.0
 pygments==2.19.1
     # via
     #   ipython
+    #   ipython-pygments-lexers
     #   sphinx
-pyinstaller==6.11.1
+pyinstaller==6.12.0
     # via gitcache (pyproject.toml)
 pyinstaller-hooks-contrib==2025.1
     # via pyinstaller
-pylint==3.3.4
+pylint==3.3.6
     # via gitcache (pyproject.toml)
 pyreadline3==3.5.4
     # via humanfriendly
-pytest==8.3.4
+pytest==8.3.5
     # via
     #   gitcache (pyproject.toml)
     #   pytest-cov
@@ -161,15 +164,17 @@ pytest-timeout==2.3.1
     # via gitcache (pyproject.toml)
 pytimeparse==1.1.8
     # via gitcache (pyproject.toml)
-pywin32==308
+pywin32==310
     # via portalocker
 pywin32-ctypes==0.2.3
     # via pyinstaller
 requests==2.32.3
     # via sphinx
+roman-numerals-py==3.1.0
+    # via sphinx
 snowballstemmer==2.2.0
     # via sphinx
-sphinx==8.1.3
+sphinx==8.2.3
     # via
     #   gitcache (pyproject.toml)
     #   sphinx-rtd-theme
@@ -202,7 +207,7 @@ traitlets==5.14.3
     # via
     #   ipython
     #   matplotlib-inline
-types-mock==5.1.0.20240425
+types-mock==5.2.0.20250306
     # via gitcache (pyproject.toml)
 typing-extensions==4.12.2
     # via
diff --git a/pip_deps/requirements-win32-py3.11.9.txt b/pip_deps/requirements-win32-py3.11.9.txt
index 98d00df..805585f 100644
--- a/pip_deps/requirements-win32-py3.11.9.txt
+++ b/pip_deps/requirements-win32-py3.11.9.txt
@@ -8,5 +8,5 @@ pyreadline3==3.5.4
     # via humanfriendly
 pytimeparse==1.1.8
     # via gitcache (pyproject.toml)
-pywin32==308
+pywin32==310
     # via portalocker
diff --git a/pyproject.toml b/pyproject.toml
index f0c3c4b..07e10c1 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -8,7 +8,7 @@ build-backend = 'setuptools.build_meta'
 
 [project]
 name = "gitcache"
-version = "1.0.26"
+version = "1.0.27"
 authors = [{name = "Clemens Rabe", email = "clemens.rabe@clemensrabe.de"}]
 description = "Local cache for git repositories to speed up working with large repositories and multiple clones."
 readme = "README.md"
diff --git a/src/git_cache/git_cache_command.py b/src/git_cache/git_cache_command.py
index faf1cf6..b0f5024 100644
--- a/src/git_cache/git_cache_command.py
+++ b/src/git_cache/git_cache_command.py
@@ -53,7 +53,7 @@ If called with the first argument 'git' or when called as 'git' using a symlink,
 it acts as a wrapper for the git command and intercepts the commands required
 for the mirror handling.
 """
-GITCACHE_VERSION = "1.0.26"
+GITCACHE_VERSION = "1.0.27"
 
 
 # -----------------------------------------------------------------------------
diff --git a/src/git_cache/git_options.py b/src/git_cache/git_options.py
index 632337d..3ba1b26 100644
--- a/src/git_cache/git_options.py
+++ b/src/git_cache/git_options.py
@@ -259,6 +259,7 @@ REMOTE_ADD_OPTIONS = [
 COMMAND_OPTIONS = {
     "lfs": [],  # Options between 'lfs' and the subcommand
     "submodule": [],  # Options between 'submodule' and the subcommand
+    "remote": [],  # Options between 'remote' and the subcommand
     "cleanup": [],
     "update-mirrors": [],
     "delete-mirror": [],


Test patch:
diff --git a/test/functional_tests/test_17_remote_add.py b/test/functional_tests/test_17_remote_add.py
index 846ee64..b3a5637 100644
--- a/test/functional_tests/test_17_remote_add.py
+++ b/test/functional_tests/test_17_remote_add.py
@@ -41,3 +41,16 @@ def test_remote_add_after_clone(gitcache_ifc: GitcacheIfc):
 
     # Configure remote
     gitcache_ifc.run_fail(["git", "-C", checkout, "remote", "add", "origin", repo])
+
+
+def test_remote_v(gitcache_ifc: GitcacheIfc):
+    """Test the 'git remote -v' command after a clone to still work."""
+    repo = "https://github.com/seeraven/gitcache"
+    checkout = os.path.join(gitcache_ifc.workspace.workspace_path, "gitcache")
+
+    # Create initial local git repository
+    gitcache_ifc.run_ok(["git", "clone", repo, checkout])
+
+    # Execute git remote -v
+    result = gitcache_ifc.run_ok(["git", "remote", "-v"], checkout)
+    assert "(fetch)" in result.stdout