diff options
Diffstat (limited to 't')
-rwxr-xr-x | t/t0001-init.sh | 11 | ||||
-rwxr-xr-x | t/t5505-remote.sh | 18 | ||||
-rwxr-xr-x | t/t7502-commit.sh | 14 | ||||
-rw-r--r-- | t/test-lib.sh | 4 |
4 files changed, 46 insertions, 1 deletions
diff --git a/t/t0001-init.sh b/t/t0001-init.sh index b0289e397..d31887f9b 100755 --- a/t/t0001-init.sh +++ b/t/t0001-init.sh @@ -79,6 +79,17 @@ test_expect_success 'GIT_DIR bare' ' check_config git-dir-bare.git true unset ' +test_expect_success 'init --bare' ' + + ( + unset GIT_DIR GIT_WORK_TREE GIT_CONFIG + mkdir git-init-bare.git && + cd git-init-bare.git && + git init --bare + ) && + check_config git-init-bare.git true unset +' + test_expect_success 'GIT_DIR non-bare' ' ( diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh index a37b6f521..0d7ed1f99 100755 --- a/t/t5505-remote.sh +++ b/t/t5505-remote.sh @@ -164,6 +164,24 @@ test_expect_success 'add --mirror && prune' ' git rev-parse --verify refs/heads/side) ' +test_expect_success 'add alt && prune' ' + (mkdir alttst && + cd alttst && + git init && + git remote add -f origin ../one && + git config remote.alt.url ../one && + git config remote.alt.fetch "+refs/heads/*:refs/remotes/origin/*") && + (cd one && + git branch -m side side2) && + (cd alttst && + git rev-parse --verify refs/remotes/origin/side && + ! git rev-parse --verify refs/remotes/origin/side2 && + git fetch alt && + git remote prune alt && + ! git rev-parse --verify refs/remotes/origin/side && + git rev-parse --verify refs/remotes/origin/side2) +' + cat > one/expect << EOF apis/master apis/side diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh index 3531a992a..46ec1ce8a 100755 --- a/t/t7502-commit.sh +++ b/t/t7502-commit.sh @@ -212,4 +212,18 @@ test_expect_success 'do not fire editor in the presence of conflicts' ' test "`cat .git/result`" = "editor not started" ' +pwd=`pwd` +cat > .git/FAKE_EDITOR << EOF +#! /bin/sh +# kill -TERM command added below. +EOF + +test_expect_success 'a SIGTERM should break locks' ' + echo >>negative && + sh -c '\'' + echo kill -TERM $$ >> .git/FAKE_EDITOR + GIT_EDITOR=.git/FAKE_EDITOR exec git commit -a'\'' && exit 1 # should fail + ! test -f .git/index.lock +' + test_done diff --git a/t/test-lib.sh b/t/test-lib.sh index 3bf570b06..7a8bd27ab 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -419,7 +419,9 @@ rm -fr "$test" || { } test_create_repo "$test" -cd "$test" || exit 1 +# Use -P to resolve symlinks in our working directory so that the cwd +# in subprocesses like git equals our $PWD (for pathname comparisons). +cd -P "$test" || exit 1 this_test=$(expr "./$0" : '.*/\(t[0-9]*\)-[^/]*$') for skp in $GIT_SKIP_TESTS |