path: root/t/lib-httpd
diff options
authorDenton Liu <>2019-11-27 19:53:06 (GMT)
committerJunio C Hamano <>2019-11-29 21:20:14 (GMT)
commit77a946be98f4cf2947f9aefac924c0ee78a042c7 (patch)
tree9ef27ae1523410408bbeb841dfee13c4c84e2aa9 /t/lib-httpd
parentdf6d3d6802abcb89a30f4808fcca3bfe1485ce34 (diff)
git-77a946be98f4cf2947f9aefac924c0ee78a042c7.tar.bz2 modernize style
Convert `[ ... ]` to use `test` and test for the existence of a regular file (`-f`) instead of any file (`-e`). Move the `then`s onto their own lines so that it conforms with the general test style. Instead of redirecting input into sed, allow it to open its own input. Use `cmp -s` instead of `diff` since we only care about whether the two files are equal and `diff` is overkill for this. Signed-off-by: Denton Liu <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 't/lib-httpd')
1 files changed, 5 insertions, 3 deletions
diff --git a/t/lib-httpd/ b/t/lib-httpd/
index fcef728..bf7689d 100644
--- a/t/lib-httpd/
+++ b/t/lib-httpd/
@@ -7,11 +7,13 @@
# This can be used to simulate the effects of the repository changing in
# between HTTP request-response pairs.
-if [ -e one-time-sed ]; then
+if test -f one-time-sed
"$GIT_EXEC_PATH/git-http-backend" >out
- sed "$(cat one-time-sed)" <out >out_modified
+ sed "$(cat one-time-sed)" out >out_modified
- if diff out out_modified >/dev/null; then
+ if cmp -s out out_modified
+ then
cat out
cat out_modified