Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

tools: Avoid `readlink -f` in *-pull-request scripts.

Greg Priceda8763d88975
diff --git a/tools/fetch-pull-request b/tools/fetch-pull-request
index d23b34f7742..0d6c4c961e8 100755
--- a/tools/fetch-pull-request
+++ b/tools/fetch-pull-request
@@ -1,9 +1,9 @@
#!/usr/bin/env bash
set -e
-this_file=$(readlink -f "${BASH_SOURCE[0]}")
+this_dir=${BASH_SOURCE[0]%/*}
# shellcheck source=lib/git-tools.bash
-. "${this_file%/*}"/lib/git-tools.bash
+. "${this_dir}"/lib/git-tools.bash
require_clean_work_tree 'check out PR as branch'
diff --git a/tools/fetch-rebase-pull-request b/tools/fetch-rebase-pull-request
index 115f61d9d84..31ff4cdf750 100755
--- a/tools/fetch-rebase-pull-request
+++ b/tools/fetch-rebase-pull-request
@@ -1,9 +1,9 @@
#!/usr/bin/env bash
set -e
-this_file=$(readlink -f "${BASH_SOURCE[0]}")
+this_dir=${BASH_SOURCE[0]%/*}
# shellcheck source=lib/git-tools.bash
-. "${this_file%/*}"/lib/git-tools.bash
+. "${this_dir}"/lib/git-tools.bash
require_clean_work_tree 'check out PR as branch'
diff --git a/tools/reset-to-pull-request b/tools/reset-to-pull-request
index 0480d5535fe..6e5962ac622 100755
--- a/tools/reset-to-pull-request
+++ b/tools/reset-to-pull-request
@@ -39,9 +39,9 @@ if [ -z "$request_id" ]; then
usage
fi
-this_file=$(readlink -f "${BASH_SOURCE[0]}")
+this_dir=${BASH_SOURCE[0]%/*}
# shellcheck source=lib/git-tools.bash
-. "${this_file%/*}"/lib/git-tools.bash
+. "${this_dir}"/lib/git-tools.bash
require_clean_work_tree 'reset to PR'