Skip to content

Commit 1619409

Browse files
committed
shellcheck fix: tests/functional/fetchGitRefs.sh
1 parent 32e1b52 commit 1619409

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

maintainers/flake-module.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@
107107
excludes = [
108108
# We haven't linted these files yet
109109
''^tests/functional/dump-db\.sh$''
110-
''^tests/functional/fetchGitRefs\.sh$''
111110
''^tests/functional/fetchGitSubmodules\.sh$''
112111
''^tests/functional/fetchGitVerification\.sh$''
113112
''^tests/functional/fetchMercurial\.sh$''

tests/functional/fetchGitRefs.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@ path=$(nix eval --raw --impure --expr "(builtins.fetchGit { url = $repo; ref = \
3838
# 10. They cannot contain a \.
3939

4040
valid_ref() {
41-
{ set +x; printf >&2 '\n>>>>>>>>>> valid_ref %s\b <<<<<<<<<<\n' $(printf %s "$1" | sed -n -e l); set -x; }
41+
{ set +x; printf >&2 '\n>>>>>>>>>> valid_ref %s\b <<<<<<<<<<\n' "$(printf %s "$1" | sed -n -e l)"; set -x; }
4242
git check-ref-format --branch "$1" >/dev/null
4343
git -C "$repo" branch "$1" master >/dev/null
4444
path1=$(nix eval --raw --impure --expr "(builtins.fetchGit { url = $repo; ref = ''$1''; }).outPath")
45-
[[ $path1 = $path ]]
45+
[[ $path1 = "$path" ]]
4646
git -C "$repo" branch -D "$1" >/dev/null
4747
}
4848

4949
invalid_ref() {
50-
{ set +x; printf >&2 '\n>>>>>>>>>> invalid_ref %s\b <<<<<<<<<<\n' $(printf %s "$1" | sed -n -e l); set -x; }
50+
{ set +x; printf >&2 '\n>>>>>>>>>> invalid_ref %s\b <<<<<<<<<<\n' "$(printf %s "$1" | sed -n -e l)"; set -x; }
5151
# special case for a sole @:
5252
# --branch @ will try to interpret @ as a branch reference and not fail. Thus we need --allow-onelevel
5353
if [ "$1" = "@" ]; then
@@ -68,6 +68,7 @@ valid_ref 'heads/foo@bar'
6868
valid_ref "$(printf 'heads/fu\303\237')"
6969
valid_ref 'foo-bar-baz'
7070
valid_ref 'branch#'
71+
# shellcheck disable=SC2016
7172
valid_ref '$1'
7273
valid_ref 'foo.locke'
7374

0 commit comments

Comments
 (0)