Skip to content

t0025 and t9018 are not executable, so running the suite dirties the working tree #203

Description

@mizchi

Summary

Two test files are committed as 100644 while every other t/*.sh is 100755:

$ git ls-files -s t/*.sh | awk '$1!="100755"{print $1, $4}'
100644 t/t0025-worktree-common-dir.sh
100644 t/t9018-workspace-flow-affected.sh

t/run-tests.sh chmods a test before running it:

if ! test -x "$test"; then
	chmod +x "$test"
fi

so this does not break anything — but it means every run of the suite leaves a mode change in the working tree:

$ bash t/run-tests.sh t901
$ git status --short
 M t/t9018-workspace-flow-affected.sh

That is a small papercut with a real edge: it is easy to sweep the stray mode change into an unrelated commit with git add -A. I did exactly that while preparing #201 and had to strip it back out.

Suggested fix

chmod +x t/t0025-worktree-common-dir.sh t/t9018-workspace-flow-affected.sh

and commit the mode change, so the repository matches what the runner expects.

Worth considering alongside it: run-tests.sh could skip a non-executable test with a clear message instead of silently chmodding, so a file committed with the wrong mode is visible rather than papered over.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions