aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-09-09 14:48:54 -0700
committerJunio C Hamano <junkio@cox.net>2005-09-09 14:48:54 -0700
commita9ab586a5db015d200dfdadcf5876d62f15dd36c (patch)
tree7631ead8e5869cad95d4e4c8e33415508335b7a5 /t
parent44ec46a9dff34d0d0d207741094b3a8ebd0e5324 (diff)
downloadgit-a9ab586a5db015d200dfdadcf5876d62f15dd36c.tar.gz
git-a9ab586a5db015d200dfdadcf5876d62f15dd36c.tar.xz
Retire support for old environment variables.
We have deprecated the old environment variable names for quite a while and now it's time to remove them. Gone are: SHA1_FILE_DIRECTORIES AUTHOR_DATE AUTHOR_EMAIL AUTHOR_NAME COMMIT_AUTHOR_EMAIL COMMIT_AUTHOR_NAME SHA1_FILE_DIRECTORY Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 't')
-rwxr-xr-xt/t0100-environment-names.sh84
-rwxr-xr-xt/t0110-environment-names-old.sh132
2 files changed, 0 insertions, 216 deletions
diff --git a/t/t0100-environment-names.sh b/t/t0100-environment-names.sh
deleted file mode 100755
index 3493bd4de..000000000
--- a/t/t0100-environment-names.sh
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/bin/sh
-#
-# Copyright (c) 2005 Junio C Hamano
-#
-
-test_description='general environment name warning test.
-
-This test makes sure that use of deprecated environment variables
-trigger the warnings from gitenv().'
-
-env_vars='GIT_AUTHOR_DATE:AUTHOR_DATE
-GIT_AUTHOR_EMAIL:AUTHOR_EMAIL
-GIT_AUTHOR_NAME:AUTHOR_NAME
-GIT_COMMITTER_EMAIL:COMMIT_AUTHOR_EMAIL
-GIT_COMMITTER_NAME:COMMIT_AUTHOR_NAME
-GIT_ALTERNATE_OBJECT_DIRECTORIES:SHA1_FILE_DIRECTORIES
-GIT_OBJECT_DIRECTORY:SHA1_FILE_DIRECTORY
-'
-
-. ./test-lib.sh
-
-export_them () {
- for ev in $env_vars
- do
- new=$(expr "$ev" : '\(.*\):')
- old=$(expr "$ev" : '.*:\(.*\)')
- # Build and eval the following:
- # case "${VAR+set}" in set) export VAR;; esac
- evstr='case "${'$new'+set}" in set) export '$new';; esac'
- eval "$evstr"
- evstr='case "${'$old'+set}" in set) export '$old';; esac'
- eval "$evstr"
- done
-}
-
-date >path0
-git-update-index --add path0
-tree=$(git-write-tree)
-
-AUTHOR_DATE='Wed May 11 23:55:18 2005'
-AUTHOR_EMAIL='author@example.xz'
-AUTHOR_NAME='A U Thor'
-COMMIT_AUTHOR_EMAIL='author@example.xz'
-COMMIT_AUTHOR_NAME='A U Thor'
-SHA1_FILE_DIRECTORY=.git/objects
-
-export_them
-
-echo 'foo' | git-commit-tree $tree >/dev/null 2>errmsg
-cat >expected-err <<\EOF
-warning: Attempting to use SHA1_FILE_DIRECTORY
-warning: GIT environment variables have been renamed.
-warning: Please adjust your scripts and environment.
-warning: old AUTHOR_DATE => new GIT_AUTHOR_DATE
-warning: old AUTHOR_EMAIL => new GIT_AUTHOR_EMAIL
-warning: old AUTHOR_NAME => new GIT_AUTHOR_NAME
-warning: old COMMIT_AUTHOR_EMAIL => new GIT_COMMITTER_EMAIL
-warning: old COMMIT_AUTHOR_NAME => new GIT_COMMITTER_NAME
-warning: old SHA1_FILE_DIRECTORY => new GIT_OBJECT_DIRECTORY
-EOF
-sed -ne '/^warning: /p' <errmsg >generated-err
-
-test_expect_success \
- 'using old names should issue warnings.' \
- 'cmp generated-err expected-err'
-
-for ev in $env_vars
-do
- new=$(expr "$ev" : '\(.*\):')
- old=$(expr "$ev" : '.*:\(.*\)')
- # Build and eval the following:
- # NEWENV=$OLDENV
- evstr="$new=\$$old"
- eval "$evstr"
-done
-export_them
-echo 'foo' | git-commit-tree $tree >/dev/null 2>errmsg
-sed -ne '/^warning: /p' <errmsg >generated-err
-
-test_expect_success \
- 'using old names but having new names should not issue warnings.' \
- 'cmp generated-err /dev/null'
-
-test_done
diff --git a/t/t0110-environment-names-old.sh b/t/t0110-environment-names-old.sh
deleted file mode 100755
index 5d602cc21..000000000
--- a/t/t0110-environment-names-old.sh
+++ /dev/null
@@ -1,132 +0,0 @@
-#!/bin/sh
-#
-# Copyright (c) 2005 Junio C Hamano
-#
-
-test_description='Using new and old environment names.
-
-This test makes sure that use of deprecated environment variables
-still works, using both new and old names makes new one take precedence,
-and GIT_DIR and GIT_ALTERNATE_OBJECT_DIRECTORIES mechanism works.'
-
-env_vars='GIT_AUTHOR_DATE:AUTHOR_DATE
-GIT_AUTHOR_EMAIL:AUTHOR_EMAIL
-GIT_AUTHOR_NAME:AUTHOR_NAME
-GIT_COMMITTER_EMAIL:COMMIT_AUTHOR_EMAIL
-GIT_COMMITTER_NAME:COMMIT_AUTHOR_NAME
-GIT_ALTERNATE_OBJECT_DIRECTORIES:SHA1_FILE_DIRECTORIES
-GIT_OBJECT_DIRECTORY:SHA1_FILE_DIRECTORY
-'
-
-. ./test-lib.sh
-
-export_them () {
- for ev in $env_vars
- do
- new=$(expr "$ev" : '\(.*\):')
- old=$(expr "$ev" : '.*:\(.*\)')
- # Build and eval the following:
- # case "${VAR+set}" in set) export VAR;; esac
- evstr='case "${'$new'+set}" in set) export '$new';; esac'
- eval "$evstr"
- evstr='case "${'$old'+set}" in set) export '$old';; esac'
- eval "$evstr"
- done
-}
-
-SHA1_FILE_DIRECTORY=.svn/objects ;# whoa
-export SHA1_FILE_DIRECTORY
-
-rm -fr .git
-mkdir .svn
-test_expect_success \
- 'using SHA1_FILE_DIRECTORY in git-init-db' \
- 'git-init-db && test -d .svn/objects/cb'
-
-unset SHA1_FILE_DIRECTORY
-GIT_DIR=.svn
-export GIT_DIR
-rm -fr .git .svn
-mkdir .svn
-test_expect_success \
- 'using GIT_DIR in git-init-db' \
- 'git-init-db && test -d .svn/objects/cb'
-
-date >path0
-test_expect_success \
- 'using GIT_DIR in git-update-index' \
- 'git-update-index --add path0 && test -f .svn/index'
-
-sedScript='s|\(..\)|.svn/objects/\1/|'
-
-test_expect_success \
- 'using GIT_DIR in git-write-tree' \
- 'tree=$(git-write-tree) &&
- test -f $(echo "$tree" | sed -e "$sedScript")'
-
-AUTHOR_DATE='Sat May 14 00:00:00 2005 -0000'
-AUTHOR_EMAIL='author@example.xz'
-AUTHOR_NAME='A U Thor'
-COMMIT_AUTHOR_EMAIL='author@example.xz'
-COMMIT_AUTHOR_NAME='A U Thor'
-export_them
-
-test_expect_success \
- 'using GIT_DIR and old variable names in git-commit-tree' \
- 'commit=$(echo foo | git-commit-tree $tree) &&
- test -f $(echo "$commit" | sed -e "$sedScript")'
-
-test_expect_success \
- 'using GIT_DIR in git-cat-file' \
- 'git-cat-file commit $commit >current'
-
-cat >expected <<\EOF
-author A U Thor <author@example.xz>
-committer A U Thor <author@example.xz>
-EOF
-test_expect_success \
- 'verify old AUTHOR variables were used correctly in commit' \
- 'sed -ne '\''/^\(author\)/s|>.*|>|p'\'' -e'\''/^\(committer\)/s|>.*|>|p'\''\ current > out && cmp out expected'
-
-unset GIT_DIR
-test_expect_success \
- 'git-init-db without GIT_DIR' \
- 'git-init-db && test -d .git && test -d .git/objects/ef'
-
-SHA1_FILE_DIRECTORIES=.svn/objects
-export SHA1_FILE_DIRECTORIES
-
-test_expect_success \
- 'using SHA1_FILE_DIRECTORIES with git-ls-tree' \
- 'git-ls-tree $commit && git-ls-tree $tree'
-
-GIT_AUTHOR_DATE='Sat May 14 12:00:00 2005 -0000'
-GIT_AUTHOR_EMAIL='rohtua@example.xz'
-GIT_AUTHOR_NAME='R O Htua'
-GIT_COMMITTER_EMAIL='rohtua@example.xz'
-GIT_COMMITTER_NAME='R O Htua'
-export_them
-
-sedScript='s|\(..\)|.git/objects/\1/|'
-test_expect_success \
- 'using new author variables with git-commit-tree' \
- 'commit2=$(echo foo | git-commit-tree $tree) &&
- test -f $(echo "$commit2" | sed -e "$sedScript")'
-
-GIT_ALTERNATE_OBJECT_DIRECTORIES=.git/objects
-GIT_DIR=nowhere
-export GIT_DIR GIT_ALTERNATE_OBJECT_DIRECTORIES
-
-test_expect_success \
- 'git-cat-file with GIT_DIR and GIT_ALTERNATE_OBJECT_DIRECTORIES' \
- 'git-cat-file commit $commit2 >current'
-
-cat >expected <<\EOF
-author R O Htua <rohtua@example.xz>
-committer R O Htua <rohtua@example.xz>
-EOF
-test_expect_success \
- 'verify new AUTHOR variables were used correctly in commit.' \
- 'sed -ne '\''/^\(author\)/s|>.*|>|p'\'' -e'\''/^\(committer\)/s|>.*|>|p'\''\ current > out && cmp out expected'
-
-test_done