ls -1 is a no-op when stdout is redirected to a file; pointed out by naddy
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
diff --git a/regress/cmdline/cleanup.sh b/regress/cmdline/cleanup.sh
index 2cd63ed..c3bf21f 100755
--- a/regress/cmdline/cleanup.sh
+++ b/regress/cmdline/cleanup.sh
@@ -67,7 +67,7 @@ test_cleanup_unreferenced_loose_objects() {
got ref -r $testroot/repo -d "refs/got/worktree/base-$wt_uuid"
# cleanup -n should not remove any objects
- ls -1 -R $testroot/repo/.git/objects > $testroot/objects-before
+ ls -R $testroot/repo/.git/objects > $testroot/objects-before
gotadmin cleanup -n -q -r $testroot/repo > $testroot/stdout
echo -n > $testroot/stdout.expected
cmp -s $testroot/stdout.expected $testroot/stdout
@@ -77,7 +77,7 @@ test_cleanup_unreferenced_loose_objects() {
test_done "$testroot" "$ret"
return 1
fi
- ls -1 -R $testroot/repo/.git/objects > $testroot/objects-after
+ ls -R $testroot/repo/.git/objects > $testroot/objects-after
cmp -s $testroot/objects-before $testroot/objects-after
ret="$?"
if [ "$ret" != "0" ]; then
@@ -164,7 +164,7 @@ test_cleanup_redundant_loose_objects() {
fi
# cleanup -n should not remove any objects
- ls -1 -R $testroot/repo/.git/objects > $testroot/objects-before
+ ls -R $testroot/repo/.git/objects > $testroot/objects-before
gotadmin cleanup -n -q -r $testroot/repo > $testroot/stdout
echo -n > $testroot/stdout.expected
cmp -s $testroot/stdout.expected $testroot/stdout
@@ -174,7 +174,7 @@ test_cleanup_redundant_loose_objects() {
test_done "$testroot" "$ret"
return 1
fi
- ls -1 -R $testroot/repo/.git/objects > $testroot/objects-after
+ ls -R $testroot/repo/.git/objects > $testroot/objects-after
cmp -s $testroot/objects-before $testroot/objects-after
ret="$?"
if [ "$ret" != "0" ]; then