Skip to content

Commit ec181fb

Browse files
committed
assigning readonly separate from the var assignment
https://www.shellcheck.net/ | ./git_sync.sh:214:10: warning: Declare and assign separately to avoid masking return values. [SC2155] | ./git_sync.sh:218:10: warning: Declare and assign separately to avoid masking return values. [SC2155] | ./git_sync.sh:220:10: warning: Declare and assign separately to avoid masking return values. [SC2155]
1 parent 98d4ecc commit ec181fb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

git_sync.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,16 @@ print_info "\nDetected default branch: \"${default_branch}\"."
211211

212212
print_and_run git status
213213

214-
readonly original_stashes_count=$(count_stashes)
214+
original_stashes_count=$(count_stashes)
215+
readonly original_stashes_count
215216

216217
print_and_run git stash
217218

218-
readonly stashes_count_after_stash=$(count_stashes)
219+
stashes_count_after_stash=$(count_stashes)
220+
readonly stashes_count_after_stash
219221

220-
readonly original_branch=$(git branch --show-current)
222+
original_branch=$(git branch --show-current)
223+
readonly original_branch
221224

222225
print_and_run git checkout "${default_branch}"
223226

0 commit comments

Comments
 (0)