diff options
author | Vincent Ambo <mail@tazj.in> | 2021-09-21T10·03+0300 |
---|---|---|
committer | Vincent Ambo <mail@tazj.in> | 2021-09-21T11·29+0300 |
commit | 43b1791ec601732ac31195df96781a848360a9ac (patch) | |
tree | daae8d638343295d2f1f7da955e556ef4c958864 /third_party/git/t/t4139-apply-escape.sh | |
parent | 2d8e7dc9d9c38127ec4ebd13aee8e8f586a43318 (diff) |
chore(3p/git): Unvendor git and track patches instead r/2903
This was vendored a long time ago under the expectation that keeping it in sync with cgit would be easier this way, but it has proven not to be a big issue. On the other hand, a vendored copy of git is an annoying maintenance burden. It is much easier to rebase the single (dottime) patch that we have. This removes the vendored copy of git and instead passes the git source code to cgit via `pkgs.srcOnly`, which includes the applied patch so that cgit can continue rendering dottime. Change-Id: If31f62dea7ce688fd1b9050204e9378019775f2b
Diffstat (limited to 'third_party/git/t/t4139-apply-escape.sh')
-rwxr-xr-x | third_party/git/t/t4139-apply-escape.sh | 141 |
1 files changed, 0 insertions, 141 deletions
diff --git a/third_party/git/t/t4139-apply-escape.sh b/third_party/git/t/t4139-apply-escape.sh deleted file mode 100755 index 45b5660a47d8..000000000000 --- a/third_party/git/t/t4139-apply-escape.sh +++ /dev/null @@ -1,141 +0,0 @@ -#!/bin/sh - -test_description='paths written by git-apply cannot escape the working tree' -. ./test-lib.sh - -# tests will try to write to ../foo, and we do not -# want them to escape the trash directory when they -# fail -test_expect_success 'bump git repo one level down' ' - mkdir inside && - mv .git inside/ && - cd inside -' - -# $1 = name of file -# $2 = current path to file (if different) -mkpatch_add () { - rm -f "${2:-$1}" && - cat <<-EOF - diff --git a/$1 b/$1 - new file mode 100644 - index 0000000..53c74cd - --- /dev/null - +++ b/$1 - @@ -0,0 +1 @@ - +evil - EOF -} - -mkpatch_del () { - echo evil >"${2:-$1}" && - cat <<-EOF - diff --git a/$1 b/$1 - deleted file mode 100644 - index 53c74cd..0000000 - --- a/$1 - +++ /dev/null - @@ -1 +0,0 @@ - -evil - EOF -} - -# $1 = name of file -# $2 = content of symlink -mkpatch_symlink () { - rm -f "$1" && - cat <<-EOF - diff --git a/$1 b/$1 - new file mode 120000 - index 0000000..$(printf "%s" "$2" | git hash-object --stdin) - --- /dev/null - +++ b/$1 - @@ -0,0 +1 @@ - +$2 - \ No newline at end of file - EOF -} - -test_expect_success 'cannot create file containing ..' ' - mkpatch_add ../foo >patch && - test_must_fail git apply patch && - test_path_is_missing ../foo -' - -test_expect_success 'can create file containing .. with --unsafe-paths' ' - mkpatch_add ../foo >patch && - git apply --unsafe-paths patch && - test_path_is_file ../foo -' - -test_expect_success 'cannot create file containing .. (index)' ' - mkpatch_add ../foo >patch && - test_must_fail git apply --index patch && - test_path_is_missing ../foo -' - -test_expect_success 'cannot create file containing .. with --unsafe-paths (index)' ' - mkpatch_add ../foo >patch && - test_must_fail git apply --index --unsafe-paths patch && - test_path_is_missing ../foo -' - -test_expect_success 'cannot delete file containing ..' ' - mkpatch_del ../foo >patch && - test_must_fail git apply patch && - test_path_is_file ../foo -' - -test_expect_success 'can delete file containing .. with --unsafe-paths' ' - mkpatch_del ../foo >patch && - git apply --unsafe-paths patch && - test_path_is_missing ../foo -' - -test_expect_success 'cannot delete file containing .. (index)' ' - mkpatch_del ../foo >patch && - test_must_fail git apply --index patch && - test_path_is_file ../foo -' - -test_expect_success SYMLINKS 'symlink escape via ..' ' - { - mkpatch_symlink tmp .. && - mkpatch_add tmp/foo ../foo - } >patch && - test_must_fail git apply patch && - test_path_is_missing tmp && - test_path_is_missing ../foo -' - -test_expect_success SYMLINKS 'symlink escape via .. (index)' ' - { - mkpatch_symlink tmp .. && - mkpatch_add tmp/foo ../foo - } >patch && - test_must_fail git apply --index patch && - test_path_is_missing tmp && - test_path_is_missing ../foo -' - -test_expect_success SYMLINKS 'symlink escape via absolute path' ' - { - mkpatch_symlink tmp "$(pwd)" && - mkpatch_add tmp/foo ../foo - } >patch && - test_must_fail git apply patch && - test_path_is_missing tmp && - test_path_is_missing ../foo -' - -test_expect_success SYMLINKS 'symlink escape via absolute path (index)' ' - { - mkpatch_symlink tmp "$(pwd)" && - mkpatch_add tmp/foo ../foo - } >patch && - test_must_fail git apply --index patch && - test_path_is_missing tmp && - test_path_is_missing ../foo -' - -test_done |