File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
gix-worktree/tests/fixtures Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -12,18 +12,23 @@ date >vulnerable
12
12
EOF
13
13
}
14
14
15
+ # Initialize the repository.
15
16
repo=" $1 "
16
17
git init -- " $repo "
17
18
cd -- " $repo "
18
19
branch=" $( git symbolic-ref --short HEAD) "
19
20
21
+ # Create the blob of the payload.
20
22
blob_hash=" $( emit_payload | git hash-object -w --stdin) "
21
23
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.
22
26
tree_hash=" $(
23
27
printf ' %s %s\0' " $escaped_blob_hash " " $filemode " " $filename " |
24
28
git hash-object -t tree -w --stdin
25
29
) "
30
+
31
+ # Commit the tree as an initial commit, setting the default branch to it.
26
32
commit_hash=" $( git commit-tree -m ' Initial commit' " $tree_hash " ) "
27
33
git branch -f -- " $branch " " $commit_hash "
28
-
29
34
git show
You can’t perform that action at this time.
0 commit comments