From: Junio C Hamano Date: Fri, 24 May 2024 19:29:35 +0000 (-0700) Subject: Merge branch 'jc/fix-2.45.1-and-friends-for-2.39' into fixes/2.45.1/2.40 X-Git-Tag: v2.40.3~1^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=48440f60a730b93b2a39449a69cb56db5e7114c7;p=thirdparty%2Fgit.git Merge branch 'jc/fix-2.45.1-and-friends-for-2.39' into fixes/2.45.1/2.40 Revert overly aggressive "layered defence" that went into 2.45.1 and friends, which broke "git-lfs", "git-annex", and other use cases, so that we can rebuild necessary counterparts in the open. * jc/fix-2.45.1-and-friends-for-2.39: Revert "fsck: warn about symlink pointing inside a gitdir" Revert "Add a helper function to compare file contents" clone: drop the protections where hooks aren't run tests: verify that `clone -c core.hooksPath=/dev/null` works again Revert "core.hooksPath: add some protection while cloning" init: use the correct path of the templates directory again hook: plug a new memory leak ci: stop installing "gcc-13" for osx-gcc ci: avoid bare "gcc" for osx-gcc job ci: drop mention of BREW_INSTALL_PACKAGES variable send-email: avoid creating more than one Term::ReadLine object send-email: drop FakeTerm hack --- 48440f60a730b93b2a39449a69cb56db5e7114c7 diff --cc builtin/clone.c index 5fa2901400,9ec500d427..399b2d3f42 --- a/builtin/clone.c +++ b/builtin/clone.c @@@ -1456,8 -1421,7 +1447,8 @@@ int cmd_clone(int argc, const char **ar free(unborn_head); free(dir); free(path); + free(repo_to_free); - free(template_dir_dup); + UNLEAK(repo); junk_mode = JUNK_LEAVE_ALL; transport_ls_refs_options_release(&transport_ls_refs_options); diff --cc t/t1800-hook.sh index 0f0c706d07,2ef3579fa7..3506f627b6 --- a/t/t1800-hook.sh +++ b/t/t1800-hook.sh @@@ -177,37 -177,4 +177,22 @@@ test_expect_success 'git hook run a hoo test_cmp expect actual ' +test_expect_success 'stdin to hooks' ' + write_script .git/hooks/test-hook <<-\EOF && + echo BEGIN stdin + cat + echo END stdin + EOF + + cat >expect <<-EOF && + BEGIN stdin + hello + END stdin + EOF + + echo hello >input && + git hook run --to-stdin=input test-hook 2>actual && + test_cmp expect actual +' + - test_expect_success 'clone protections' ' - test_config core.hooksPath "$(pwd)/my-hooks" && - mkdir -p my-hooks && - write_script my-hooks/test-hook <<-\EOF && - echo Hook ran $1 - EOF - - git hook run test-hook 2>err && - grep "Hook ran" err && - test_must_fail env GIT_CLONE_PROTECTION_ACTIVE=true \ - git hook run test-hook 2>err && - grep "active .core.hooksPath" err && - ! grep "Hook ran" err - ' - test_done