Skip to content

Commit a5203a3

Browse files
committed
Merge branch 'lf/echo-n-is-not-portable'
* lf/echo-n-is-not-portable: Avoid using `echo -n` anywhere
2 parents 400bf4c + 19c3c5f commit a5203a3

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

contrib/subtree/git-subtree.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ copy_commit()
311311
GIT_COMMITTER_NAME \
312312
GIT_COMMITTER_EMAIL \
313313
GIT_COMMITTER_DATE
314-
(echo -n "$annotate"; cat ) |
314+
(printf "%s" "$annotate"; cat ) |
315315
git commit-tree "$2" $3 # reads the rest of stdin
316316
) || die "Can't copy commit $1"
317317
}

contrib/subtree/t/t7900-subtree.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ test_expect_success 'merge new subproj history into subdir' '
182182
test_expect_success 'Check that prefix argument is required for split' '
183183
echo "You must provide the --prefix option." > expected &&
184184
test_must_fail git subtree split > actual 2>&1 &&
185-
test_debug "echo -n expected: " &&
185+
test_debug "printf '"'"'expected: '"'"'" &&
186186
test_debug "cat expected" &&
187-
test_debug "echo -n actual: " &&
187+
test_debug "printf '"'"'actual: '"'"'" &&
188188
test_debug "cat actual" &&
189189
test_cmp expected actual &&
190190
rm -f expected actual
@@ -193,9 +193,9 @@ test_expect_success 'Check that prefix argument is required for split' '
193193
test_expect_success 'Check that the <prefix> exists for a split' '
194194
echo "'"'"'non-existent-directory'"'"'" does not exist\; use "'"'"'git subtree add'"'"'" > expected &&
195195
test_must_fail git subtree split --prefix=non-existent-directory > actual 2>&1 &&
196-
test_debug "echo -n expected: " &&
196+
test_debug "printf '"'"'expected: '"'"'" &&
197197
test_debug "cat expected" &&
198-
test_debug "echo -n actual: " &&
198+
test_debug "printf '"'"'actual: '"'"'" &&
199199
test_debug "cat actual" &&
200200
test_cmp expected actual
201201
# rm -f expected actual

t/perf/perf-lib.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ test_perf () {
161161
echo "$test_count" >>"$perf_results_dir"/$base.subtests
162162
echo "$1" >"$perf_results_dir"/$base.$test_count.descr
163163
if test -z "$verbose"; then
164-
echo -n "perf $test_count - $1:"
164+
printf "%s" "perf $test_count - $1:"
165165
else
166166
echo "perf $test_count - $1:"
167167
fi
@@ -170,7 +170,7 @@ test_perf () {
170170
if test_run_perf_ "$2"
171171
then
172172
if test -z "$verbose"; then
173-
echo -n " $i"
173+
printf " %s" "$i"
174174
else
175175
echo "* timing run $i/$GIT_PERF_REPEAT_COUNT:"
176176
fi

0 commit comments

Comments
 (0)