about summary refs log tree commit diff
path: root/third_party/git/t/t7113-post-index-change-hook.sh
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-09-21T10·03+0300
committerVincent Ambo <mail@tazj.in>2021-09-21T11·29+0300
commit43b1791ec601732ac31195df96781a848360a9ac (patch)
treedaae8d638343295d2f1f7da955e556ef4c958864 /third_party/git/t/t7113-post-index-change-hook.sh
parent2d8e7dc9d9c38127ec4ebd13aee8e8f586a43318 (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/t7113-post-index-change-hook.sh')
-rwxr-xr-xthird_party/git/t/t7113-post-index-change-hook.sh144
1 files changed, 0 insertions, 144 deletions
diff --git a/third_party/git/t/t7113-post-index-change-hook.sh b/third_party/git/t/t7113-post-index-change-hook.sh
deleted file mode 100755
index f011ad7eece8..000000000000
--- a/third_party/git/t/t7113-post-index-change-hook.sh
+++ /dev/null
@@ -1,144 +0,0 @@
-#!/bin/sh
-
-test_description='post index change hook'
-
-. ./test-lib.sh
-
-test_expect_success 'setup' '
-	mkdir -p dir1 &&
-	touch dir1/file1.txt &&
-	echo testing >dir1/file2.txt &&
-	git add . &&
-	git commit -m "initial"
-'
-
-test_expect_success 'test status, add, commit, others trigger hook without flags set' '
-	mkdir -p .git/hooks &&
-	write_script .git/hooks/post-index-change <<-\EOF &&
-		if test "$1" -eq 1; then
-			echo "Invalid combination of flags passed to hook; updated_workdir is set." >testfailure
-			exit 1
-		fi
-		if test "$2" -eq 1; then
-			echo "Invalid combination of flags passed to hook; updated_skipworktree is set." >testfailure
-			exit 1
-		fi
-		if test -f ".git/index.lock"; then
-			echo ".git/index.lock exists" >testfailure
-			exit 3
-		fi
-		if ! test -f ".git/index"; then
-			echo ".git/index does not exist" >testfailure
-			exit 3
-		fi
-		echo "success" >testsuccess
-	EOF
-	mkdir -p dir2 &&
-	touch dir2/file1.txt &&
-	touch dir2/file2.txt &&
-	: force index to be dirty &&
-	test-tool chmtime +60 dir1/file1.txt &&
-	git status &&
-	test_path_is_file testsuccess && rm -f testsuccess &&
-	test_path_is_missing testfailure &&
-	git add . &&
-	test_path_is_file testsuccess && rm -f testsuccess &&
-	test_path_is_missing testfailure &&
-	git commit -m "second" &&
-	test_path_is_file testsuccess && rm -f testsuccess &&
-	test_path_is_missing testfailure &&
-	git checkout -- dir1/file1.txt &&
-	test_path_is_file testsuccess && rm -f testsuccess &&
-	test_path_is_missing testfailure &&
-	git update-index &&
-	test_path_is_missing testsuccess &&
-	test_path_is_missing testfailure &&
-	git reset --soft &&
-	test_path_is_missing testsuccess &&
-	test_path_is_missing testfailure
-'
-
-test_expect_success 'test checkout and reset trigger the hook' '
-	write_script .git/hooks/post-index-change <<-\EOF &&
-		if test "$1" -eq 1 && test "$2" -eq 1; then
-			echo "Invalid combination of flags passed to hook; updated_workdir and updated_skipworktree are both set." >testfailure
-			exit 1
-		fi
-		if test "$1" -eq 0 && test "$2" -eq 0; then
-			echo "Invalid combination of flags passed to hook; neither updated_workdir or updated_skipworktree are set." >testfailure
-			exit 2
-		fi
-		if test "$1" -eq 1; then
-			if test -f ".git/index.lock"; then
-				echo "updated_workdir set but .git/index.lock exists" >testfailure
-				exit 3
-			fi
-			if ! test -f ".git/index"; then
-				echo "updated_workdir set but .git/index does not exist" >testfailure
-				exit 3
-			fi
-		else
-			echo "update_workdir should be set for checkout" >testfailure
-			exit 4
-		fi
-		echo "success" >testsuccess
-	EOF
-	: force index to be dirty &&
-	test-tool chmtime +60 dir1/file1.txt &&
-	git checkout master &&
-	test_path_is_file testsuccess && rm -f testsuccess &&
-	test_path_is_missing testfailure &&
-	test-tool chmtime +60 dir1/file1.txt &&
-	git checkout HEAD &&
-	test_path_is_file testsuccess && rm -f testsuccess &&
-	test_path_is_missing testfailure &&
-	test-tool chmtime +60 dir1/file1.txt &&
-	git reset --hard &&
-	test_path_is_file testsuccess && rm -f testsuccess &&
-	test_path_is_missing testfailure &&
-	git checkout -B test &&
-	test_path_is_file testsuccess && rm -f testsuccess &&
-	test_path_is_missing testfailure
-'
-
-test_expect_success 'test reset --mixed and update-index triggers the hook' '
-	write_script .git/hooks/post-index-change <<-\EOF &&
-		if test "$1" -eq 1 && test "$2" -eq 1; then
-			echo "Invalid combination of flags passed to hook; updated_workdir and updated_skipworktree are both set." >testfailure
-			exit 1
-		fi
-		if test "$1" -eq 0 && test "$2" -eq 0; then
-			echo "Invalid combination of flags passed to hook; neither updated_workdir or updated_skipworktree are set." >testfailure
-			exit 2
-		fi
-		if test "$2" -eq 1; then
-			if test -f ".git/index.lock"; then
-				echo "updated_skipworktree set but .git/index.lock exists" >testfailure
-				exit 3
-			fi
-			if ! test -f ".git/index"; then
-				echo "updated_skipworktree set but .git/index does not exist" >testfailure
-				exit 3
-			fi
-		else
-			echo "updated_skipworktree should be set for reset --mixed and update-index" >testfailure
-			exit 4
-		fi
-		echo "success" >testsuccess
-	EOF
-	: force index to be dirty &&
-	test-tool chmtime +60 dir1/file1.txt &&
-	git reset --mixed --quiet HEAD~1 &&
-	test_path_is_file testsuccess && rm -f testsuccess &&
-	test_path_is_missing testfailure &&
-	git hash-object -w --stdin <dir1/file2.txt >expect &&
-	git update-index --cacheinfo 100644 "$(cat expect)" dir1/file1.txt &&
-	test_path_is_file testsuccess && rm -f testsuccess &&
-	test_path_is_missing testfailure &&
-	git update-index --skip-worktree dir1/file2.txt &&
-	git update-index --remove dir1/file2.txt &&
-	test_path_is_file testsuccess && rm -f testsuccess &&
-	test_path_is_missing testfailure
-'
-
-test_done