fix: Subplot step to run git in sub directory

Subplot's Rust lib/runcmd library currently sets HOME to the directory
in which a command is run. If the step is "when I run, in foo, git",
then git is run with HOME set to point to the sub-directory foo under
the per-scenario data directory. I suspect this is a bug in Subplot,
but until that is confirmed and fixed by Subplot, and the fix included
in a release, we can avoid that by running "env -C foo git" instead.
This has the effect of changing the working directory to foo before
running git, without affecting any environment variables, which is
what we want.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
This commit is contained in:
Lars Wirzenius
2025-04-04 15:00:38 +03:00
parent 6ec75d1978
commit 756d7ac81d
+1 -1
View File
@@ -928,7 +928,7 @@ then stdout doesn't contain ""repo_name": "xyzzy""
when I try to run cibtool --db ci-broker.db trigger --repo xyzzy --commit v1.0
then command fails
when I run, in xyzzy, git tag -am "version 1.0" v1.0
when I run env -C xyzzy git tag -am "version 1.0" v1.0
when I run cibtool --db ci-broker.db trigger --repo xyzzy
when I run ./env.sh cib --config config.yaml queued
when I run cibtool --db ci-broker.db run list --json