Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorMichael J Gruber <git@drmicha.warpmail.net>2011-04-27 12:36:27 +0400
committerJunio C Hamano <gitster@pobox.com>2011-04-27 21:50:05 +0400
commit7cf16a14f5c070f7b14cf28023769450133172ae (patch)
tree6d90ac2effe3cb7ec57ad9172b0563b11c9c35d8 /t
parent0daed41791373a5530c2b33e09b134ce8820e0c2 (diff)
handle_alias: provide GIT_PREFIX to !alias
Provide an environment variable GIT_PREFIX which contains the subdirectory from which a !alias was called (i.e. 'git rev-parse --show-prefix') since these cd to the to level directory before they are executed. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t1020-subdirectory.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t1020-subdirectory.sh b/t/t1020-subdirectory.sh
index 66e40d38a3..ddc3921ac6 100755
--- a/t/t1020-subdirectory.sh
+++ b/t/t1020-subdirectory.sh
@@ -129,6 +129,16 @@ test_expect_success '!alias expansion' '
test_cmp expect actual
'
+test_expect_success 'GIT_PREFIX for !alias' '
+ printf "dir/" >expect &&
+ (
+ git config alias.test "!sh -c \"printf \$GIT_PREFIX\"" &&
+ cd dir &&
+ git test >../actual
+ ) &&
+ test_cmp expect actual
+'
+
test_expect_success 'no file/rev ambiguity check inside .git' '
git commit -a -m 1 &&
(