diff options
| author | tv <tv@krebsco.de> | 2026-11-13 21:08:21 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-13 22:14:19 +0100 |
| commit | c3ca6d4b991ea24192ac4ddec156d0530b462c3e (patch) | |
| tree | debd57542fb475f46c6accef974ce1ca4e6fd670 /tests/scenarios.nix | |
| parent | 4afd7d2793e85f260a2a3c20a423f0d1a4844ea7 (diff) | |
populate: keep URLs, refs, and names from being taken for options
A git source's url and ref are strings, and git clone, git remote, and
git fetch took ones starting with - for options, e.g. --upload-pack,
which runs a command where the repository is local. They come after
-- now, and so does a pass source's name for git log and pass show.
git-ref-option gives a ref that git fetch would take for
--upload-pack.
Diffstat (limited to 'tests/scenarios.nix')
| -rw-r--r-- | tests/scenarios.nix | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/scenarios.nix b/tests/scenarios.nix index 2fc1bd7..8093e02 100644 --- a/tests/scenarios.nix +++ b/tests/scenarios.nix @@ -2104,6 +2104,29 @@ assert !(krops.isLocalTarget (targets.remote "/")); } ]; })) + # A ref that git fetch would take for an option: --upload-pack runs a + # command where the repository is local. + (s "git-ref-option" (let + elsewhere = "/var/krops-elsewhere"; + in { + isolate = true; + prepare = '' + rm -fR ${elsewhere} + git clone -q --bare ${gitUrl} ${elsewhere}/repo.git + ''; + phases = [ + { + sources.x.git = { + url = "${elsewhere}/repo.git"; + ref = "--upload-pack=touch ${elsewhere}/ran; git-upload-pack"; + }; + expect.fail = "invalid refspec"; + check = '' + test ! -e ${elsewhere}/ran || fail "the ref ran a command" + ''; + } + ]; + })) # A file in populate's state replaced by a symlink to a file outside. (s "state-key" (let sources.x.flake-input = { |
