We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d16546c commit 89ea17fCopy full SHA for 89ea17f
t/t0400-pre-command-hook.sh
@@ -31,4 +31,27 @@ test_expect_success 'with failing hook' '
31
test_path_is_missing "$(cat .git/pre-command.out)"
32
'
33
34
+test_expect_success 'in a subdirectory' '
35
+ echo touch i-was-here | write_script .git/hooks/pre-command &&
36
+ mkdir sub &&
37
+ (
38
+ cd sub &&
39
+ git version
40
+ ) &&
41
+ test_path_is_file sub/i-was-here
42
+'
43
+
44
+test_expect_success 'in a subdirectory, using an alias' '
45
+ git reset --hard &&
46
+ echo "echo \"\$@; \$(pwd)\" >>log" |
47
+ write_script .git/hooks/pre-command &&
48
+ mkdir -p sub &&
49
50
51
+ git -c alias.v="version" v
52
53
+ test_path_is_missing log &&
54
+ test_line_count = 2 sub/log
55
56
57
test_done
0 commit comments