Skip to content

Commit

Permalink
Merge branch 'lf/echo-n-is-not-portable'
Browse files Browse the repository at this point in the history
* lf/echo-n-is-not-portable:
  Avoid using `echo -n` anywhere
  • Loading branch information
gitster committed Aug 1, 2013
2 parents 400bf4c + 19c3c5f commit a5203a3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion contrib/subtree/git-subtree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ copy_commit()
GIT_COMMITTER_NAME \
GIT_COMMITTER_EMAIL \
GIT_COMMITTER_DATE
(echo -n "$annotate"; cat ) |
(printf "%s" "$annotate"; cat ) |
git commit-tree "$2" $3 # reads the rest of stdin
) || die "Can't copy commit $1"
}
Expand Down
8 changes: 4 additions & 4 deletions contrib/subtree/t/t7900-subtree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ test_expect_success 'merge new subproj history into subdir' '
test_expect_success 'Check that prefix argument is required for split' '
echo "You must provide the --prefix option." > expected &&
test_must_fail git subtree split > actual 2>&1 &&
test_debug "echo -n expected: " &&
test_debug "printf '"'"'expected: '"'"'" &&
test_debug "cat expected" &&
test_debug "echo -n actual: " &&
test_debug "printf '"'"'actual: '"'"'" &&
test_debug "cat actual" &&
test_cmp expected actual &&
rm -f expected actual
Expand All @@ -193,9 +193,9 @@ test_expect_success 'Check that prefix argument is required for split' '
test_expect_success 'Check that the <prefix> exists for a split' '
echo "'"'"'non-existent-directory'"'"'" does not exist\; use "'"'"'git subtree add'"'"'" > expected &&
test_must_fail git subtree split --prefix=non-existent-directory > actual 2>&1 &&
test_debug "echo -n expected: " &&
test_debug "printf '"'"'expected: '"'"'" &&
test_debug "cat expected" &&
test_debug "echo -n actual: " &&
test_debug "printf '"'"'actual: '"'"'" &&
test_debug "cat actual" &&
test_cmp expected actual
# rm -f expected actual
Expand Down
4 changes: 2 additions & 2 deletions t/perf/perf-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ test_perf () {
echo "$test_count" >>"$perf_results_dir"/$base.subtests
echo "$1" >"$perf_results_dir"/$base.$test_count.descr
if test -z "$verbose"; then
echo -n "perf $test_count - $1:"
printf "%s" "perf $test_count - $1:"
else
echo "perf $test_count - $1:"
fi
Expand All @@ -170,7 +170,7 @@ test_perf () {
if test_run_perf_ "$2"
then
if test -z "$verbose"; then
echo -n " $i"
printf " %s" "$i"
else
echo "* timing run $i/$GIT_PERF_REPEAT_COUNT:"
fi
Expand Down

0 comments on commit a5203a3

Please sign in to comment.