Skip to content

Commit 119ada7

Browse files
committed
Removed an unnecessary if statement
1 parent 24dd2fc commit 119ada7

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

git-open

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,8 @@ elif [[ "${#pathargs[@]}" -ge 3 && ${pathargs[${#pathargs[@]} - 3]} == 'scm' ]];
130130
# Bitbucket server always has /scm/ as the third to last segment in the url path, e.g. /scm/ppp/test-repo.git
131131
# Anything before the 'scm' is part of the server's root context
132132

133-
# Check whether there are other context parts before the 'scm' part
134-
pathPref=()
135-
if [[ "${#pathargs[@]}" -gt 3 ]]; then
136-
# If there are other context parts, add them, up to (but not including) the found 'scm'
137-
pathPref=("${pathargs[*]:0:${#pathargs[@]} - 3}")
138-
fi
133+
# If there are other context parts, add them, up to (but not including) the found 'scm'
134+
pathPref=("${pathargs[*]:0:${#pathargs[@]} - 3}")
139135

140136
# Replace the 'scm' element, with 'projects'. Keep the first argument, the string 'repos', and finally the rest of the arguments.
141137
pathargs=(${pathPref[@]} 'projects' ${pathargs[${#pathargs[@]} - 2]} 'repos' "${pathargs[@]:${#pathargs[@]} - 1}")

0 commit comments

Comments
 (0)