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/t4111-apply-subdir.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/t4111-apply-subdir.sh')
-rwxr-xr-x | third_party/git/t/t4111-apply-subdir.sh | 156 |
1 files changed, 0 insertions, 156 deletions
diff --git a/third_party/git/t/t4111-apply-subdir.sh b/third_party/git/t/t4111-apply-subdir.sh deleted file mode 100755 index 1618a6dbc7c7..000000000000 --- a/third_party/git/t/t4111-apply-subdir.sh +++ /dev/null @@ -1,156 +0,0 @@ -#!/bin/sh - -test_description='patching from inconvenient places' - -. ./test-lib.sh - -test_expect_success 'setup' ' - cat >patch <<-\EOF && - diff file.orig file - --- a/file.orig - +++ b/file - @@ -1 +1,2 @@ - 1 - +2 - EOF - patch="$(pwd)/patch" && - - echo 1 >preimage && - printf "%s\n" 1 2 >postimage && - echo 3 >other && - - test_tick && - git commit --allow-empty -m basis -' - -test_expect_success 'setup: subdir' ' - reset_subdir() { - git reset && - mkdir -p sub/dir/b && - mkdir -p objects && - cp "$1" file && - cp "$1" objects/file && - cp "$1" sub/dir/file && - cp "$1" sub/dir/b/file && - git add file sub/dir/file sub/dir/b/file objects/file && - cp "$2" file && - cp "$2" sub/dir/file && - cp "$2" sub/dir/b/file && - cp "$2" objects/file && - test_might_fail git update-index --refresh -q - } -' - -test_expect_success 'apply from subdir of toplevel' ' - cp postimage expected && - reset_subdir other preimage && - ( - cd sub/dir && - git apply "$patch" - ) && - test_cmp expected sub/dir/file -' - -test_expect_success 'apply --cached from subdir of toplevel' ' - cp postimage expected && - cp other expected.working && - reset_subdir preimage other && - ( - cd sub/dir && - git apply --cached "$patch" - ) && - git show :sub/dir/file >actual && - test_cmp expected actual && - test_cmp expected.working sub/dir/file -' - -test_expect_success 'apply --index from subdir of toplevel' ' - cp postimage expected && - reset_subdir preimage other && - ( - cd sub/dir && - test_must_fail git apply --index "$patch" - ) && - reset_subdir other preimage && - ( - cd sub/dir && - test_must_fail git apply --index "$patch" - ) && - reset_subdir preimage preimage && - ( - cd sub/dir && - git apply --index "$patch" - ) && - git show :sub/dir/file >actual && - test_cmp expected actual && - test_cmp expected sub/dir/file -' - -test_expect_success 'apply half-broken patch from subdir of toplevel' ' - ( - cd sub/dir && - test_must_fail git apply <<-EOF - --- sub/dir/file - +++ sub/dir/file - @@ -1,0 +1,0 @@ - --- file_in_root - +++ file_in_root - @@ -1,0 +1,0 @@ - EOF - ) -' - -test_expect_success 'apply from .git dir' ' - cp postimage expected && - cp preimage .git/file && - cp preimage .git/objects/file && - ( - cd .git && - git apply "$patch" - ) && - test_cmp expected .git/file -' - -test_expect_success 'apply from subdir of .git dir' ' - cp postimage expected && - cp preimage .git/file && - cp preimage .git/objects/file && - ( - cd .git/objects && - git apply "$patch" - ) && - test_cmp expected .git/objects/file -' - -test_expect_success 'apply --cached from .git dir' ' - cp postimage expected && - cp other expected.working && - cp other .git/file && - reset_subdir preimage other && - ( - cd .git && - git apply --cached "$patch" - ) && - git show :file >actual && - test_cmp expected actual && - test_cmp expected.working file && - test_cmp expected.working .git/file -' - -test_expect_success 'apply --cached from subdir of .git dir' ' - cp postimage expected && - cp preimage expected.subdir && - cp other .git/file && - cp other .git/objects/file && - reset_subdir preimage other && - ( - cd .git/objects && - git apply --cached "$patch" - ) && - git show :file >actual && - git show :objects/file >actual.subdir && - test_cmp expected actual && - test_cmp expected.subdir actual.subdir -' - -test_done |