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
1212EOF
1313}
1414
15- # Initialize the repository.
1615repo=" $1 "
1716git init -- " $repo "
1817cd -- " $repo "
19- branch=" $( git symbolic-ref --short HEAD) "
2018
21- # Create the blob of the payload.
2219blob_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
2421
25- # Create the top-level tree object referencing the blob with the stange name.
2622tree_hash=" $(
27- printf ' %s %s\0' " $escaped_blob_hash " " $filemode " " $filename " |
23+ printf ' %s %s\0' " $filemode " " $filename " |
24+ cat - blob-hash-bytes |
2825 git hash-object -t tree -w --stdin
2926) "
3027
31- # Commit the tree as an initial commit, setting the default branch to it.
28+ rm blob-hash-bytes
29+
3230commit_hash=" $( git commit-tree -m ' Initial commit' " $tree_hash " ) "
31+ branch=" $( git symbolic-ref --short HEAD) "
3332git branch -f -- " $branch " " $commit_hash "
3433git show
You can’t perform that action at this time.
0 commit comments