Re: [PATCH 2/2] worktree: add: change to new worktree directory before running hook

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 12.02.2018 um 04:15 schrieb Eric Sunshine:
--- a/t/t2025-worktree-add.sh
+++ b/t/t2025-worktree-add.sh
@@ -454,20 +454,29 @@ post_checkout_hook () {
  	test_when_finished "rm -f .git/hooks/post-checkout" &&
  	mkdir -p .git/hooks &&
  	write_script .git/hooks/post-checkout <<-\EOF
-	echo $* >hook.actual
+	{
+		echo $*
+		git rev-parse --show-toplevel
+	} >../hook.actual
  	EOF
  }
test_expect_success '"add" invokes post-checkout hook (branch)' '
  	post_checkout_hook &&
-	printf "%s %s 1\n" $_z40 $(git rev-parse HEAD) >hook.expect &&
+	{
+		echo $_z40 $(git rev-parse HEAD) 1 &&
+		echo $(pwd)/gumby

$(pwd) is here and in the other tests correct. $PWD would be wrong on Windows. Thanks for being considerate.

+	} >hook.expect &&
  	git worktree add gumby &&
  	test_cmp hook.expect hook.actual

-- Hannes



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux