Skip to content

Commit 9436f3f

Browse files
committed
Split into commented sections
1 parent 981cf5b commit 9436f3f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

gix-worktree/tests/fixtures/make_traverse_dotgit_slashes.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,23 @@ date >vulnerable
1212
EOF
1313
}
1414

15+
# Initialize the repository.
1516
repo="$1"
1617
git init -- "$repo"
1718
cd -- "$repo"
1819
branch="$(git symbolic-ref --short HEAD)"
1920

21+
# Create the blob of the payload.
2022
blob_hash="$(emit_payload | git hash-object -w --stdin)"
2123
escaped_blob_hash="$(printf '%s' "$blob_hash" | sed 's/../\\x&/g')"
24+
25+
# Create the top-level tree object referencing the blob with the stange name.
2226
tree_hash="$(
2327
printf '%s %s\0'"$escaped_blob_hash" "$filemode" "$filename" |
2428
git hash-object -t tree -w --stdin
2529
)"
30+
31+
# Commit the tree as an initial commit, setting the default branch to it.
2632
commit_hash="$(git commit-tree -m 'Initial commit' "$tree_hash")"
2733
git branch -f -- "$branch" "$commit_hash"
28-
2934
git show

0 commit comments

Comments
 (0)