Skip to content

Commit

Permalink
Use << rather than <<- heredoc operator
Browse files Browse the repository at this point in the history
Because `<<-` only makes a difference when the contents of the here
document are indented with tabs, which was not being done anywhere
that `<<-` was used. See GitoxideLabs#1423 for details.

This also removes some spurious indentation (outside of the here
document) in make_dangling_symlink.sh and changes its blank lines
for readability and to match the style in similar scripts.
  • Loading branch information
EliahKagan committed Jun 30, 2024
1 parent 1e79c5c commit 2641f8b
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gix-dir/tests/fixtures/many.sh
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ git init type-mismatch-icase
git init type-mismatch-icase-clash-dir-is-file
(cd type-mismatch-icase-clash-dir-is-file
empty_oid=$(git hash-object -w --stdin </dev/null)
git update-index --index-info <<-EOF
git update-index --index-info <<EOF
100644 $empty_oid D/a
100644 $empty_oid d
EOF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ symlink_target=$(echo -n 'X' | git hash-object -w --stdin)
echo "FILE_? filter=arrow" > .gitattributes
git add -A

git update-index --index-info <<-EOF
git update-index --index-info <<EOF
100644 $content_oid FILE_X
100644 $content_oid FILE_x
100644 $content_oid file_X
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ empty_oid=$(git hash-object -w --stdin </dev/null)
fake_dir_target=$(echo -n 'A-dir' | git hash-object -w --stdin)
fake_file_target=$(echo -n 'A-file' | git hash-object -w --stdin)

git update-index --index-info <<-EOF
git update-index --index-info <<EOF
100644 $empty_oid A-dir/a
100644 $empty_oid A-file
120000 $fake_dir_target FAKE-DIR
Expand Down
3 changes: 2 additions & 1 deletion gix-worktree-state/tests/fixtures/make_dangling_symlink.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ set -eu -o pipefail
git init -q

target_oid=$(echo -n "non-existing-target" | git hash-object -w --stdin)
git update-index --index-info <<-EOF

git update-index --index-info <<EOF
120000 $target_oid dangling
EOF

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ symlink_target=$(echo -n 'X' | git hash-object -w --stdin)
echo "FILE_? filter=arrow" > .gitattributes
git add -A

git update-index --index-info <<-EOF
git update-index --index-info <<EOF
100644 $content_oid FILE_X
100644 $content_oid FILE_x
100644 $content_oid file_X
Expand Down
2 changes: 1 addition & 1 deletion gix/tests/fixtures/make_rev_spec_parse_repos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ git init ambiguous_blob_tree_commit
# create one tree 0000000000cdc
git write-tree

sed -e "s/|$//" >patch <<-EOF
sed -e "s/|$//" >patch <<EOF
diff --git a/frotz b/frotz
index 000000000..ffffff 100644
--- a/frotz
Expand Down

0 comments on commit 2641f8b

Please sign in to comment.