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