aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-06-22 18:13:11 -0300
committerEuAndreh <eu@euandre.org>2021-06-22 18:13:11 -0300
commite002a38f2caa29563e78e3ebddb57dc469905a3c (patch)
tree9f2f8772427755120d4b9e884342a593abc3eed6
parentCHANGELOG.md: Mention integration tests (diff)
downloadgit-permalink-e002a38f2caa29563e78e3ebddb57dc469905a3c.tar.gz
git-permalink-e002a38f2caa29563e78e3ebddb57dc469905a3c.tar.xz
src/git-permalink.sh.in, tests/remotes.sh: Address ShellCheck issues
-rwxr-xr-xsrc/git-permalink.sh.in2
-rwxr-xr-xtests/remotes.sh22
2 files changed, 12 insertions, 12 deletions
diff --git a/src/git-permalink.sh.in b/src/git-permalink.sh.in
index 9c26293..6c83787 100755
--- a/src/git-permalink.sh.in
+++ b/src/git-permalink.sh.in
@@ -134,7 +134,7 @@ while getopts 'phV' flag; do
esac
done
-shift $(($OPTIND - 1))
+shift $((OPTIND - 1))
if [ -z "${1:-}" ]; then
printf '%s\n\n' "$MSG_MISSING_FILE" >&2
diff --git a/tests/remotes.sh b/tests/remotes.sh
index 27bb903..06d3fdc 100755
--- a/tests/remotes.sh
+++ b/tests/remotes.sh
@@ -10,7 +10,7 @@ PATH="$PWD/tests:$TEST_PREFIX/bin:$PATH"
new_repo() {
REPO="$PWD/tests/remotes/$(uuidgen)"
mkdir -p "$REPO"
- pushd "$REPO" > /dev/null
+ cd "$REPO" || exit 1
git init > /dev/null
git remote add origin "$1"
echo '' > f.txt
@@ -30,7 +30,7 @@ test_supported_remotes() {
assert_empty_stdout
assert_fgrep_stderr 'Opening https://git.euandreh.xyz'
assert_fgrep_stderr 'xdg-open: https://git.euandreh.xyz'
- popd > /dev/null
+ cd - > /dev/null || exit 1
OUT="$(mktemp)"
ERR="$(mktemp)"
@@ -40,7 +40,7 @@ test_supported_remotes() {
assert_status 0
assert_fgrep_stdout 'https://git.sr.ht'
assert_empty_stderr
- popd > /dev/null
+ cd - > /dev/null || exit 1
OUT="$(mktemp)"
ERR="$(mktemp)"
@@ -51,7 +51,7 @@ test_supported_remotes() {
assert_empty_stdout
assert_fgrep_stderr 'Opening https://git.kernel.org'
assert_fgrep_stderr 'xdg-open: https://git.kernel.org'
- popd > /dev/null
+ cd - > /dev/null || exit 1
OUT="$(mktemp)"
ERR="$(mktemp)"
@@ -61,7 +61,7 @@ test_supported_remotes() {
assert_status 0
assert_fgrep_stdout 'https://git.savannah.gnu.org'
assert_empty_stderr
- popd > /dev/null
+ cd - > /dev/null || exit 1
OUT="$(mktemp)"
ERR="$(mktemp)"
@@ -72,7 +72,7 @@ test_supported_remotes() {
assert_empty_stdout
assert_fgrep_stderr 'Opening https://notabug.org'
assert_fgrep_stderr 'xdg-open: https://notabug.org'
- popd > /dev/null
+ cd - > /dev/null || exit 1
OUT="$(mktemp)"
ERR="$(mktemp)"
@@ -82,7 +82,7 @@ test_supported_remotes() {
assert_status 0
assert_fgrep_stdout 'https://codeberg.org'
assert_empty_stderr
- popd > /dev/null
+ cd - > /dev/null || exit 1
OUT="$(mktemp)"
ERR="$(mktemp)"
@@ -93,7 +93,7 @@ test_supported_remotes() {
assert_empty_stdout
assert_fgrep_stderr 'Opening https://bitbucket.org'
assert_fgrep_stderr 'xdg-open: https://bitbucket.org'
- popd > /dev/null
+ cd - > /dev/null || exit 1
OUT="$(mktemp)"
ERR="$(mktemp)"
@@ -103,7 +103,7 @@ test_supported_remotes() {
assert_status 0
assert_fgrep_stdout 'https://pagure.io'
assert_empty_stderr
- popd > /dev/null
+ cd - > /dev/null || exit 1
OUT="$(mktemp)"
ERR="$(mktemp)"
@@ -114,7 +114,7 @@ test_supported_remotes() {
assert_empty_stdout
assert_fgrep_stderr 'Opening https://gitlab.com/nonguix/nonguix'
assert_fgrep_stderr 'xdg-open: https://gitlab.com/nonguix/nonguix'
- popd > /dev/null
+ cd - > /dev/null || exit 1
OUT="$(mktemp)"
ERR="$(mktemp)"
@@ -124,7 +124,7 @@ test_supported_remotes() {
assert_status 0
assert_fgrep_stdout 'https://github.com'
assert_empty_stderr
- popd > /dev/null
+ cd - > /dev/null || exit 1
test_ok
}