From: Stephen Haberman Date: Thu, 14 Apr 2011 21:14:01 +0000 (-0500) Subject: Get tests passing again. X-Git-Url: http://git.droids-corp.org/?p=git-central.git;a=commitdiff_plain;h=4aca6f6a15deb23b6c7e58aff25769afbcddc8cd Get tests passing again. * Lots of /bin/sh -> bin/bash changes * Change "server" directory in tests to be a bare repository * Remove "lockfile" usage for a plain, always-available "mkdir" Partially contributed and otherwise prompted by Aaron Boxer. --- diff --git a/scripts/checkout b/scripts/checkout index 8576a70..654d61f 100755 --- a/scripts/checkout +++ b/scripts/checkout @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Makes checkout "just work" in terms of checking out the branch whether or not # it exists locally or remotely. diff --git a/scripts/create-gitconfig b/scripts/create-gitconfig index 12cfeae..e47d5e6 100755 --- a/scripts/create-gitconfig +++ b/scripts/create-gitconfig @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Creates a separate DAG in your repo for git config files. # diff --git a/scripts/pull b/scripts/pull index c8bcbdd..dbf868f 100755 --- a/scripts/pull +++ b/scripts/pull @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Makes pull "just work" by correctly rebasing of local commits on top of new # incoming commits. diff --git a/scripts/push b/scripts/push index ac9151d..0c393eb 100755 --- a/scripts/push +++ b/scripts/push @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Makes push "just work" by only pushing the current branch to origin. # diff --git a/scripts/refollow b/scripts/refollow index 35a6369..4b31ea2 100755 --- a/scripts/refollow +++ b/scripts/refollow @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Goes through the ensure-follows branches and makes sure diff --git a/server/functions b/server/functions index 5040ef7..f00dcb9 100644 --- a/server/functions +++ b/server/functions @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Sets: new_commits # Assumes: $oldrev $newrev $refname @@ -85,7 +85,7 @@ # "remotes/" will be ignored as well. # ################################################## -function set_new_commits() { +set_new_commits() { nl=$'\n' # Get all the current branches, not'd as we want only new ones @@ -114,7 +114,7 @@ function set_new_commits() { # 0000->1234 (create) # 1234->2345 (update) # 2345->0000 (delete) -function set_change_type() { +set_change_type() { if [ "$oldrev" == "0000000000000000000000000000000000000000" ] ; then change_type="create" else @@ -129,7 +129,7 @@ function set_change_type() { # Sets: $newrev_type $oldrev_type $rev $rev_type # Assumes: $newrev $oldrev # --- Get the revision types -function set_rev_types() { +set_rev_types() { newrev_type=$(git cat-file -t "$newrev" 2> /dev/null) oldrev_type=$(git cat-file -t "$oldrev" 2> /dev/null) if [ "$newrev" == "0000000000000000000000000000000000000000" ] ; then @@ -145,7 +145,7 @@ function set_rev_types() { # Assumes: $rev # # The email subject will contain the best description of the ref that we can build from the parameters -function set_describe() { +set_describe() { rev_to_describe="$rev" if [ "$1" != "" ] ; then rev_to_describe="$1" @@ -161,7 +161,7 @@ function set_describe() { # Assumes: $rev # # The email subject will contain the best description of the ref that we can build from the parameters -function set_describe_tags() { +set_describe_tags() { rev_to_describe="$rev" if [ "$1" != "" ] ; then rev_to_describe="$1" @@ -179,34 +179,35 @@ function set_describe_tags() { # # with_lock "foo.lock" "echo a" # Works # with_lock "foo.lock" "echo b1 ; echo b2" # Work -# function several() { +# several() { # echo several1 ; echo several2 # } # with_lock "foo.lock" several # Works # -function with_lock() { +with_lock() { lockfile="$1" block="$2" with_lock_has_lock=1 trap with_lock_unlock_if_held INT TERM EXIT - lockfile -1 -r 300 "$lockfile" + # used to use lockfile to try multiple times but it's not always available + mkdir "$lockfile" with_lock_has_lock=$? if [ $with_lock_has_lock -ne 0 ] ; then exit $? fi eval "$block" - rm -f "$lockfile" + rmdir "$lockfile" with_lock_has_lock=1 } -function with_lock_unlock_if_held() { +with_lock_unlock_if_held() { if [[ "$with_lock_has_lock" -eq 0 ]] ; then rm -f "$lockfile" fi } -function display_error_message() { +display_error_message() { echo "----------------------------------------------------" >&2 echo "" >&2 echo "" >&2 diff --git a/server/post-receive-commitnumbers b/server/post-receive-commitnumbers old mode 100644 new mode 100755 index 7bd130a..3a01342 --- a/server/post-receive-commitnumbers +++ b/server/post-receive-commitnumbers @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Creates commitnumbers as lightweight tags named "r/X" where X increases # monotonically. diff --git a/server/post-receive-email b/server/post-receive-email index cea8bfb..cc39f38 100755 --- a/server/post-receive-email +++ b/server/post-receive-email @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Copyright (c) 2007 Andy Parkins # Copyright (c) 2008 Stephen Haberman diff --git a/server/post-receive-gitconfig b/server/post-receive-gitconfig old mode 100644 new mode 100755 index 98dab4a..ee4c22d --- a/server/post-receive-gitconfig +++ b/server/post-receive-gitconfig @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Copyright (c) 2008 Stephen Haberman # diff --git a/server/post-receive-hudson b/server/post-receive-hudson old mode 100644 new mode 100755 index 594be61..2e2ea07 --- a/server/post-receive-hudson +++ b/server/post-receive-hudson @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Copyright (c) 2008 Stephen Haberman # diff --git a/server/post-receive-trac b/server/post-receive-trac old mode 100644 new mode 100755 index 083837c..b98445e --- a/server/post-receive-trac +++ b/server/post-receive-trac @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash . $(dirname $0)/functions diff --git a/server/post-receive-trac.py b/server/post-receive-trac.py old mode 100644 new mode 100755 diff --git a/server/post-receive.sample b/server/post-receive.sample index bb2fc2d..2c22dc5 100644 --- a/server/post-receive.sample +++ b/server/post-receive.sample @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash nl=$'\n' input="" diff --git a/server/update-allow-tags-branches b/server/update-allow-tags-branches old mode 100644 new mode 100755 index 3714762..6267956 --- a/server/update-allow-tags-branches +++ b/server/update-allow-tags-branches @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # An example hook script to blocks unannotated tags from entering. # Called by git-receive-pack with arguments: refname sha1-old sha1-new diff --git a/server/update-ensure-follows b/server/update-ensure-follows old mode 100644 new mode 100755 index 779fa9d..3cc35a0 --- a/server/update-ensure-follows +++ b/server/update-ensure-follows @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # When updating a branch, ensure it has the latest changes # from other branches, e.g. stable. diff --git a/server/update-ensure-ticket-reference b/server/update-ensure-ticket-reference old mode 100644 new mode 100755 index 3dc9c29..6616624 --- a/server/update-ensure-ticket-reference +++ b/server/update-ensure-ticket-reference @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash . $(dirname $0)/functions diff --git a/server/update-lock-check b/server/update-lock-check old mode 100644 new mode 100755 index 46931c2..44936d2 --- a/server/update-lock-check +++ b/server/update-lock-check @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # # Checks $GIT_DIR/locked and $GIT_DIR/preserved for branches that cannot be diff --git a/server/update-stable b/server/update-stable old mode 100644 new mode 100755 index 8cdc6c9..e0b97af --- a/server/update-stable +++ b/server/update-stable @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # This enforces stable moving in approved ways. diff --git a/server/update.sample b/server/update.sample index 6176b99..6a4f2c2 100644 --- a/server/update.sample +++ b/server/update.sample @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash /srv/git/gc/server/update-one $1 $2 $3 && /srv/git/gc/server/update-two $1 $2 $3 diff --git a/tests/Makefile b/tests/Makefile index 11c10c1..ba3db94 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -10,7 +10,7 @@ T = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh) all: $(T) clean $(T): - @echo "*** $@ ***"; GIT_CONFIG=.git/config /bin/sh $@ $(GIT_TEST_OPTS) + @echo "*** $@ ***"; GIT_CONFIG=.git/config /bin/bash $@ $(GIT_TEST_OPTS) clean: rm -fr 'trash directory' diff --git a/tests/t1000-commit-msg-trac.sh b/tests/t1000-commit-msg-trac.sh index 5e70a4c..a6cb15b 100644 --- a/tests/t1000-commit-msg-trac.sh +++ b/tests/t1000-commit-msg-trac.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash test_description='client commit-msg trac ticket enforcer' diff --git a/tests/t1001-commit-msg-trac-merges.sh b/tests/t1001-commit-msg-trac-merges.sh index 3cfbd72..8e94258 100644 --- a/tests/t1001-commit-msg-trac-merges.sh +++ b/tests/t1001-commit-msg-trac-merges.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash test_description='client commit-msg trac ticket enforcer for merges' diff --git a/tests/t2000-update-ensure-ticket-reference.sh b/tests/t2000-update-ensure-ticket-reference.sh index 3d966ab..7bca2c3 100644 --- a/tests/t2000-update-ensure-ticket-reference.sh +++ b/tests/t2000-update-ensure-ticket-reference.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash test_description='server update trac ticket enforcer' @@ -8,9 +8,9 @@ test_expect_success 'setup' ' echo This is a test. >a && git add a && git commit -m "a" && - git clone ./. server && - rm -fr server/.git/hooks && - git remote add origin ./server && + git clone --bare -l ./ server.git && + rm -fr server.git/hooks && + git remote add origin ./server.git && git config --add branch.master.remote origin && git config --add branch.master.merge refs/heads/master ' diff --git a/tests/t2001-update-ensure-ticket-reference-merges.sh b/tests/t2001-update-ensure-ticket-reference-merges.sh index 1db3550..a90fe15 100644 --- a/tests/t2001-update-ensure-ticket-reference-merges.sh +++ b/tests/t2001-update-ensure-ticket-reference-merges.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash test_description='server update trac ticket enforcer via shim' diff --git a/tests/t2002-update-ensure-ticket-reference-branches.sh b/tests/t2002-update-ensure-ticket-reference-branches.sh index 5e12566..090ecdb 100644 --- a/tests/t2002-update-ensure-ticket-reference-branches.sh +++ b/tests/t2002-update-ensure-ticket-reference-branches.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash test_description='server update trac ticket enforcer via shim' @@ -8,9 +8,9 @@ test_expect_success 'setup' ' echo "setup" >a && git add a && git commit -m "setup" && - git clone ./. server && - rm -fr server/.git/hooks && - git remote add origin ./server && + git clone -l . --bare server.git && + rm -fr server.git/hooks && + git remote add origin ./server.git && git config --add branch.master.remote origin && git config --add branch.master.merge refs/heads/master ' @@ -75,7 +75,7 @@ test_expect_success 'accept branch that has been excused' ' ! git push origin topic5 - cd server + cd server.git git config hooks.update-ensure-ticket-reference.excused topic5 cd .. diff --git a/tests/t2100-update-stable.sh b/tests/t2100-update-stable.sh index 0ec4839..fa72974 100644 --- a/tests/t2100-update-stable.sh +++ b/tests/t2100-update-stable.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash test_description='server update stable enforcer' @@ -8,9 +8,9 @@ test_expect_success 'setup' ' echo setup >a && git add a && git commit -m "a" && - git clone ./. server && - git remote add origin ./server && - rm -fr server/.git/hooks + git clone -l . --bare server.git && + git remote add origin ./server.git && + rm -fr server.git/hooks ' # setup the update hook @@ -47,7 +47,7 @@ test_expect_success 'reject fast-forward to candidate branch' ' git checkout stable && git merge topic1 >merge.out && - cat merge.out | grep "Fast forward" && + cat merge.out | grep "Fast-forward" && ! git push 2>push.err && cat push.err | grep "Moving stable must entail a single commit" && git reset --hard ORIG_HEAD diff --git a/tests/t2200-post-receive-email.sh b/tests/t2200-post-receive-email.sh index 45d3e4f..a5fed8e 100644 --- a/tests/t2200-post-receive-email.sh +++ b/tests/t2200-post-receive-email.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash test_description='server post-receive email notification' @@ -10,14 +10,14 @@ test_expect_success 'setup' ' echo "setup" >a && git add a && git commit -m "setup" && - git clone ./. server && - rm -fr server/.git/hooks && - git remote add origin ./server && + git clone -l . --bare server.git && + rm -fr server.git/hooks && + git remote add origin ./server.git && git config branch.master.remote origin && git config branch.master.merge refs/heads/master && - GIT_DIR=./server/.git git config hooks.post-receive-email.mailinglist commits@list.com && - GIT_DIR=./server/.git git config hooks.post-receive-email.debug true && - echo cbas >./server/.git/description + GIT_DIR=./server.git git config hooks.post-receive-email.mailinglist commits@list.com && + GIT_DIR=./server.git git config hooks.post-receive-email.debug true && + echo cbas >./server.git/description ' install_post_receive_hook 'post-receive-email' @@ -34,7 +34,7 @@ test_expect_success 'simple commit' ' new_commit_abbrev=$(git rev-parse --short HEAD) && interpolate ../t2200-1.txt 1.txt old_commit_hash old_commit_abbrev new_commit_hash new_commit_date new_commit_abbrev && - test_cmp 1.txt server/.git/refs.heads.master.out + test_cmp 1.txt server.git/refs.heads.master.out ' test_expect_success 'simple commit with commitnumber' ' @@ -51,7 +51,7 @@ test_expect_success 'simple commit with commitnumber' ' new_commit_abbrev=$(git rev-parse --short HEAD) && interpolate ../t2200-2.txt 2.txt old_commit_hash old_commit_abbrev new_commit_hash new_commit_date new_commit_abbrev && - test_cmp 2.txt server/.git/refs.heads.master.out + test_cmp 2.txt server.git/refs.heads.master.out ' test_done diff --git a/tests/t2201-8.txt b/tests/t2201-8.txt index 500b78c..c9abe27 100644 --- a/tests/t2201-8.txt +++ b/tests/t2201-8.txt @@ -11,8 +11,6 @@ The annotated tag, 2.0 has been deleted ----------------------------------------------------------------------- tag 2.0 -Tagger: C O Mitter -Date: $old_tag_date 2.0 $new_commit_hash force update annotated tag diff --git a/tests/t2201-post-receive-email-tags.sh b/tests/t2201-post-receive-email-tags.sh index 4b9f5a5..4e1d06b 100644 --- a/tests/t2201-post-receive-email-tags.sh +++ b/tests/t2201-post-receive-email-tags.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash test_description='server post-receive email notification' @@ -10,14 +10,14 @@ test_expect_success 'setup' ' echo "setup" >a && git add a && git commit -m "setup" && - git clone ./. server && - rm -fr server/.git/hooks && - git remote add origin ./server && + git clone -l . --bare server.git && + rm -fr server.git/hooks && + git remote add origin ./server.git && git config branch.master.remote origin && git config branch.master.merge refs/heads/master && - GIT_DIR=./server/.git git config hooks.post-receive-email.mailinglist commits@list.com && - GIT_DIR=./server/.git git config hooks.post-receive-email.debug true && - echo cbas >./server/.git/description + GIT_DIR=./server.git git config hooks.post-receive-email.mailinglist commits@list.com && + GIT_DIR=./server.git git config hooks.post-receive-email.debug true && + echo cbas >./server.git/description ' install_post_receive_hook 'post-receive-email' @@ -30,7 +30,7 @@ test_expect_success 'create annotated tag' ' eval $(git for-each-ref --shell "--format=tag_date=%(taggerdate)" refs/tags/1.0) && interpolate ../t2201-1.txt 1.txt new_commit_hash tag_hash tag_date && - test_cmp 1.txt server/.git/refs.tags.1.0.out + test_cmp 1.txt server.git/refs.tags.1.0.out ' test_expect_success 'commit on annotated tagged branch' ' @@ -52,7 +52,7 @@ test_expect_success 'commit on annotated tagged branch' ' git push && new_commit_abbrev=$(git rev-list -n 1 --pretty=format:%h HEAD | grep -v commit) && interpolate ../t2201-2.txt 2.txt old_commit_hash new_commit_hash new_commit_date new_commit_abbrev prior_commit_hash prior_commit_date old_commit_abbrev prior_commit_abbrev new_commit_abbrev && - test_cmp 2.txt server/.git/refs.heads.master.out + test_cmp 2.txt server.git/refs.heads.master.out ' test_expect_success 're-annotated tag branch' ' @@ -63,7 +63,7 @@ test_expect_success 're-annotated tag branch' ' eval $(git for-each-ref --shell "--format=tag_date=%(taggerdate)" refs/tags/2.0) && interpolate ../t2201-3.txt 3.txt new_commit_hash tag_hash tag_date && - test_cmp 3.txt server/.git/refs.tags.2.0.out + test_cmp 3.txt server.git/refs.tags.2.0.out ' test_expect_success 'force update annotated tag' ' @@ -80,7 +80,7 @@ test_expect_success 'force update annotated tag' ' eval $(git for-each-ref --shell "--format=tag_date=%(taggerdate)" refs/tags/2.0) && interpolate ../t2201-7.txt 7.txt old_tag_hash new_commit_hash new_tag_hash tag_date && - test_cmp 7.txt server/.git/refs.tags.2.0.out + test_cmp 7.txt server.git/refs.tags.2.0.out ' test_expect_success 'delete annotated tag' ' @@ -94,7 +94,7 @@ test_expect_success 'delete annotated tag' ' new_commit_hash=$(git rev-parse HEAD) && interpolate ../t2201-8.txt 8.txt old_tag_hash old_tag_date new_commit_describe new_commit_hash && - test_cmp 8.txt server/.git/refs.tags.2.0.out + test_cmp 8.txt server.git/refs.tags.2.0.out ' test_expect_success 'create lightweight tag' ' @@ -109,7 +109,7 @@ test_expect_success 'create lightweight tag' ' new_commit_date=$(git rev-list --no-walk --pretty=format:%ad HEAD | tail -n 1) && interpolate ../t2201-4.txt 4.txt new_commit_hash new_commit_describe new_commit_date && - test_cmp 4.txt server/.git/refs.tags.2.1.out + test_cmp 4.txt server.git/refs.tags.2.1.out ' test_expect_success 'force update lightweight tag' ' @@ -125,7 +125,7 @@ test_expect_success 'force update lightweight tag' ' new_commit_date=$(git rev-list --no-walk --pretty=format:%ad HEAD | tail -n 1) && interpolate ../t2201-5.txt 5.txt new_commit_hash new_commit_describe new_commit_date old_commit_hash && - test_cmp 5.txt server/.git/refs.tags.2.1.out + test_cmp 5.txt server.git/refs.tags.2.1.out ' test_expect_success 'delete lightweight tag' ' @@ -135,7 +135,7 @@ test_expect_success 'delete lightweight tag' ' git push origin :refs/tags/2.1 && interpolate ../t2201-6.txt 6.txt old_commit_hash old_commit_describe && - test_cmp 6.txt server/.git/refs.tags.2.1.out + test_cmp 6.txt server.git/refs.tags.2.1.out ' test_done diff --git a/tests/t2202-post-receive-email-branches.sh b/tests/t2202-post-receive-email-branches.sh index d794b11..a9d6658 100644 --- a/tests/t2202-post-receive-email-branches.sh +++ b/tests/t2202-post-receive-email-branches.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash test_description='server post-receive email notification' @@ -10,14 +10,14 @@ test_expect_success 'setup' ' echo "setup" >a && git add a && git commit -m "setup" && - git clone ./. server && - rm -fr server/.git/hooks && - git remote add origin ./server && + git clone -l . --bare server.git && + rm -fr server.git/hooks && + git remote add origin ./server.git && git config branch.master.remote origin && git config branch.master.merge refs/heads/master && - GIT_DIR=./server/.git git config hooks.post-receive-email.mailinglist commits@list.com && - GIT_DIR=./server/.git git config hooks.post-receive-email.debug true && - echo cbas >./server/.git/description + GIT_DIR=./server.git git config hooks.post-receive-email.mailinglist commits@list.com && + GIT_DIR=./server.git git config hooks.post-receive-email.debug true && + echo cbas >./server.git/description ' install_post_receive_hook 'post-receive-email' @@ -38,7 +38,7 @@ test_expect_success 'create branch' ' git push origin topic && interpolate ../t2202-1.txt 1.txt new_commit_hash new_commit_abbrev new_commit_date prior_commit_hash prior_commit_date && - test_cmp 1.txt server/.git/refs.heads.topic.out + test_cmp 1.txt server.git/refs.heads.topic.out ' test_expect_success 'create branch with existing commits does not replay them' ' @@ -50,7 +50,7 @@ test_expect_success 'create branch with existing commits does not replay them' ' git push origin topic2 && interpolate ../t2202-3.txt 3.txt existing_commit_hash existing_commit_abbrev existing_commit_date && - test_cmp 3.txt server/.git/refs.heads.topic2.out + test_cmp 3.txt server.git/refs.heads.topic2.out ' test_expect_success 'update branch with existing commits does not replay them' ' @@ -69,7 +69,7 @@ test_expect_success 'update branch with existing commits does not replay them' ' git push && interpolate ../t2202-4.txt 4.txt old_commit_hash old_commit_abbrev existing_commit_hash existing_commit_abbrev && - test_cmp 4.txt server/.git/refs.heads.topic.out + test_cmp 4.txt server.git/refs.heads.topic.out ' test_expect_success 'rewind branch' ' @@ -82,7 +82,7 @@ test_expect_success 'rewind branch' ' new_commit_hash=$(git rev-parse HEAD) && interpolate ../t2202-5.txt 5.txt old_commit_hash new_commit_hash old_commit_abbrev && - test_cmp 5.txt server/.git/refs.heads.topic.out + test_cmp 5.txt server.git/refs.heads.topic.out ' test_expect_success 'rewind and continue branch' ' @@ -99,7 +99,7 @@ test_expect_success 'rewind and continue branch' ' git push --force && interpolate ../t2202-6.txt 6.txt old_commit_hash new_commit_hash new_commit_date new_commit_abbrev old_commit_abbrev && - test_cmp 6.txt server/.git/refs.heads.topic.out + test_cmp 6.txt server.git/refs.heads.topic.out ' test_expect_success 'delete branch' ' @@ -107,7 +107,7 @@ test_expect_success 'delete branch' ' git push origin :refs/heads/topic && interpolate ../t2202-2.txt 2.txt old_commit_hash && - test_cmp 2.txt server/.git/refs.heads.topic.out + test_cmp 2.txt server.git/refs.heads.topic.out ' test_done diff --git a/tests/t2203-1.txt b/tests/t2203-1.txt index bf8d28f..738bce0 100644 --- a/tests/t2203-1.txt +++ b/tests/t2203-1.txt @@ -17,7 +17,7 @@ revisions in full, below. - Log ----------------------------------------------------------------- commit $new_commit_hash -Merge: $old_commit_hash $second_stable_hash +Merge: $old_commit_abbrev $second_stable_abbrev Author: A U Thor Date: $new_commit_date diff --git a/tests/t2203-2.txt b/tests/t2203-2.txt index 3da2cdb..9057f6f 100644 --- a/tests/t2203-2.txt +++ b/tests/t2203-2.txt @@ -17,7 +17,7 @@ revisions in full, below. - Log ----------------------------------------------------------------- commit $new_commit_hash -Merge: $old_commit_hash $second_stable_hash +Merge: $old_commit_abbrev $second_stable_abbrev Author: A U Thor Date: $new_commit_date diff --git a/tests/t2203-post-receive-email-stable.sh b/tests/t2203-post-receive-email-stable.sh index bf545f9..7240f0b 100644 --- a/tests/t2203-post-receive-email-stable.sh +++ b/tests/t2203-post-receive-email-stable.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash test_description='server post-receive email notification and how it behaves in our stable-based envrionment' @@ -12,14 +12,14 @@ test_expect_success 'setup' ' echo "setup" >c && git add a b c && git commit -m "setup" && - git clone ./. server && - rm -fr server/.git/hooks && - git remote add origin ./server && + git clone -l . --bare server.git && + rm -fr server.git/hooks && + git remote add origin ./server.git && git config branch.master.remote origin && git config branch.master.merge refs/heads/master && - GIT_DIR=./server/.git git config hooks.post-receive-email.mailinglist commits@list.com && - GIT_DIR=./server/.git git config hooks.post-receive-email.debug true && - echo cbas >./server/.git/description && + GIT_DIR=./server.git git config hooks.post-receive-email.mailinglist commits@list.com && + GIT_DIR=./server.git git config hooks.post-receive-email.debug true && + echo cbas >./server.git/description && git checkout -b stable && git push origin stable @@ -48,7 +48,7 @@ test_expect_success 'merge in stable' ' echo "$test_name 2" >b && echo "$test_name 2" >c && git commit -a -m "move stable 2" && - second_stable_hash=$(git rev-parse HEAD) && + second_stable_abbrev=$(git rev-parse --short HEAD) && git push origin stable && # Merge stable @@ -60,8 +60,8 @@ test_expect_success 'merge in stable' ' new_commit_date=$(git log -n 1 --pretty=format:%cd HEAD) && new_commit_abbrev=$(git rev-parse --short HEAD) && - interpolate ../t2203-1.txt 1.txt old_commit_hash old_commit_abbrev new_commit_hash new_commit_abbrev new_commit_date first_stable_hash second_stable_hash && - test_cmp 1.txt server/.git/refs.heads.topic1.out + interpolate ../t2203-1.txt 1.txt old_commit_hash old_commit_abbrev new_commit_hash new_commit_abbrev new_commit_date first_stable_hash second_stable_abbrev && + test_cmp 1.txt server.git/refs.heads.topic1.out ' test_expect_success 'merge in stable with conflict' ' @@ -84,7 +84,7 @@ test_expect_success 'merge in stable with conflict' ' echo "$test_name 2" >b && echo "$test_name 2" >c && git commit -a -m "move stable 2" && - second_stable_hash=$(git rev-parse HEAD) && + second_stable_abbrev=$(git rev-parse --short HEAD) && git push origin stable && # Merge stable @@ -99,8 +99,8 @@ test_expect_success 'merge in stable with conflict' ' new_commit_date=$(git log -n 1 --pretty=format:%cd HEAD) && new_commit_abbrev=$(git rev-parse --short HEAD) && - interpolate ../t2203-2.txt 2.txt old_commit_hash old_commit_abbrev new_commit_hash new_commit_abbrev new_commit_date first_stable_hash second_stable_hash && - test_cmp 2.txt server/.git/refs.heads.topic1.out + interpolate ../t2203-2.txt 2.txt old_commit_hash old_commit_abbrev new_commit_hash new_commit_abbrev new_commit_date first_stable_hash second_stable_abbrev && + test_cmp 2.txt server.git/refs.heads.topic1.out ' test_done diff --git a/tests/t2204-1.txt b/tests/t2204-1.txt index 8e5bef1..6a9433b 100644 --- a/tests/t2204-1.txt +++ b/tests/t2204-1.txt @@ -17,7 +17,7 @@ revisions in full, below. - Log ----------------------------------------------------------------- commit $new_commit_hash -Merge: $old_commit_hash $stable_hash +Merge: $old_commit_abbrev $stable_abbrev Author: A U Thor Date: $new_commit_date diff --git a/tests/t2204-post-receive-email-conflicts.sh b/tests/t2204-post-receive-email-conflicts.sh index f86e6ba..2cda80b 100644 --- a/tests/t2204-post-receive-email-conflicts.sh +++ b/tests/t2204-post-receive-email-conflicts.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash test_description='server post-receive email notification and how it behaves in our stable-based envrionment' @@ -12,14 +12,14 @@ test_expect_success 'setup' ' echo "setup" >c && git add a b c && git commit -m "setup" && - git clone ./. server && - rm -fr server/.git/hooks && - git remote add origin ./server && + git clone -l . --bare server.git && + rm -fr server.git/hooks && + git remote add origin ./server.git && git config branch.master.remote origin && git config branch.master.merge refs/heads/master && - GIT_DIR=./server/.git git config hooks.post-receive-email.mailinglist commits@list.com && - GIT_DIR=./server/.git git config hooks.post-receive-email.debug true && - echo cbas >./server/.git/description && + GIT_DIR=./server.git git config hooks.post-receive-email.mailinglist commits@list.com && + GIT_DIR=./server.git git config hooks.post-receive-email.debug true && + echo cbas >./server.git/description && git checkout -b stable && git push origin stable @@ -53,7 +53,7 @@ test_expect_success 'conflict diff' ' git commit -a -m "lines changed on stable" && git push origin stable && - stable_hash=$(git rev-parse HEAD) && + stable_abbrev=$(git rev-parse --short HEAD) && git checkout topic1 && ! git merge stable && @@ -70,8 +70,8 @@ test_expect_success 'conflict diff' ' new_commit_date=$(git log -n 1 --pretty=format:%cd HEAD) && new_commit_abbrev=$(git rev-parse --short HEAD) && - interpolate ../t2204-1.txt 1.txt old_commit_hash old_commit_abbrev new_commit_hash new_commit_abbrev new_commit_date stable_hash && - test_cmp 1.txt server/.git/refs.heads.topic1.out + interpolate ../t2204-1.txt 1.txt old_commit_hash old_commit_abbrev new_commit_hash new_commit_abbrev new_commit_date stable_abbrev && + test_cmp 1.txt server.git/refs.heads.topic1.out ' test_done diff --git a/tests/t2700-ensure-follows.sh b/tests/t2700-ensure-follows.sh index 514ca73..f3b3867 100644 --- a/tests/t2700-ensure-follows.sh +++ b/tests/t2700-ensure-follows.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash test_description='server update ensure follows' @@ -8,9 +8,9 @@ test_expect_success 'setup' ' echo "setup" >a && git add a && git commit -m "setup" && - git clone ./. server && - rm -fr server/.git/hooks && - git remote add origin ./server && + git clone -l . --bare server.git && + rm -fr server.git/hooks && + git remote add origin ./server.git && git fetch ' @@ -22,9 +22,7 @@ test_expect_success 'pushing stable works' ' ' test_expect_success 'branch with unmoved stable is okay' ' - cd server && - git config hooks.update-ensure-follows.branches stable && - cd .. && + GIT_DIR=server.git git config hooks.update-ensure-follows.branches stable && git checkout -b topic1 && echo "$test_name" >a.topic1 && @@ -56,9 +54,12 @@ test_expect_success 'branch with moved stable is told to update first' ' git push origin stable && # Someone fixes stable first - cd server && + git clone server.git person2 && + cd person2 && git checkout -f topic1 && - git merge stable && + git remote add server ../server.git && + git merge origin/stable && + git push server topic1 && cd .. && git checkout topic1 && @@ -73,9 +74,7 @@ test_expect_success 'branch with moved stable is told to update first' ' ' test_expect_success 'branch with moved stable as second branch requires merge' ' - cd server && - git config hooks.update-ensure-follows.branches "foo stable" && - cd .. && + GIT_DIR=server.git git config hooks.update-ensure-follows.branches "foo stable" && git checkout stable && echo "$test_name" >a && @@ -128,9 +127,7 @@ test_expect_success 'excused branch with moved stable is okay' ' git commit -a -m "Change on topic2 again" && ! git push origin topic2 && - cd server && - git config hooks.update-ensure-follows.excused topic2 && - cd .. && + GIT_DIR=server.git git config hooks.update-ensure-follows.excused topic2 && git push origin topic2 ' diff --git a/tests/t2800-post-receive-gitconfig.sh b/tests/t2800-post-receive-gitconfig.sh index 6933fc8..4691139 100644 --- a/tests/t2800-post-receive-gitconfig.sh +++ b/tests/t2800-post-receive-gitconfig.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash test_description='server update git config' @@ -8,9 +8,9 @@ test_expect_success 'setup' ' echo "setup" >a && git add a && git commit -m "setup" && - git clone ./. server && - rm -fr server/.git/hooks && - git remote add origin ./server && + git clone -l . --bare server.git && + rm -fr server.git/hooks && + git remote add origin ./server.git && git config branch.master.remote origin && git config branch.master.merge refs/heads/master && git fetch @@ -19,9 +19,7 @@ test_expect_success 'setup' ' install_post_receive_hook 'post-receive-gitconfig' test_expect_success 'pushing initial value works' ' - cd server && - ! git config --list | grep foo && - cd .. && + ! GIT_DIR=server.git git config --list | grep foo && ../../scripts/create-gitconfig && git checkout gitconfig && @@ -29,13 +27,11 @@ test_expect_success 'pushing initial value works' ' git commit -a -m "Set foo.foo=bar." git push origin gitconfig - cd server && - git config --list | grep foo && - cd .. + GIT_DIR=server.git git config --list | grep foo ' test_expect_success 'pushing locked works' ' - ! test -f server/.git/locked && + ! test -f server.git/locked && git checkout gitconfig && echo "foo" > locked && @@ -43,7 +39,7 @@ test_expect_success 'pushing locked works' ' git commit -m "Add locked" git push origin gitconfig - test -f server/.git/locked + test -f server.git/locked ' test_done diff --git a/tests/t2801-post-receive-gitconfig-hooks.sh b/tests/t2801-post-receive-gitconfig-hooks.sh index 464f262..908ce03 100644 --- a/tests/t2801-post-receive-gitconfig-hooks.sh +++ b/tests/t2801-post-receive-gitconfig-hooks.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash test_description='server update git config' @@ -8,24 +8,24 @@ test_expect_success 'setup' ' echo "setup" >a && git add a && git commit -m "setup" && - git clone ./. server && - rm -fr server/.git/hooks && - git remote add origin ./server + git clone -l . --bare server.git && + rm -fr server.git/hooks && + git remote add origin ./server.git ' install_post_receive_hook 'post-receive-gitconfig' test_expect_success 'adding hook' ' - ls server/.git/hooks | grep post-receive && + ls server.git/hooks | grep post-receive && ../../scripts/create-gitconfig && git checkout gitconfig && mkdir hooks && cd hooks && - echo "#!/bin/sh" > post-receive && - echo "../../../../server/post-receive-gitconfig" >> post-receive && + echo "#!/bin/bash" > post-receive && + echo "../../../server/post-receive-gitconfig" >> post-receive && echo "echo barbar" >> post-receive && - echo "#!/bin/sh" > update && + echo "#!/bin/bash" > update && echo "echo foofoo" >> update && git add post-receive && git add update && @@ -33,19 +33,19 @@ test_expect_success 'adding hook' ' git push origin gitconfig && cd .. && - cat server/.git/hooks/post-receive | grep barbar && - cat server/.git/hooks/update | grep foofoo + cat server.git/hooks/post-receive | grep barbar && + cat server.git/hooks/update | grep foofoo ' test_expect_success 'changing hook' ' - echo "#!/bin/sh" > hooks/update && + echo "#!/bin/bash" > hooks/update && echo "echo lala" >> hooks/update && git commit -a -m "changed update" && git push origin gitconfig && - cat server/.git/hooks/post-receive | grep barbar && - ! cat server/.git/hooks/update | grep barbar && - cat server/.git/hooks/update | grep lala + cat server.git/hooks/post-receive | grep barbar && + ! cat server.git/hooks/update | grep barbar && + cat server.git/hooks/update | grep lala ' test_expect_success 'removing hook does not work' ' @@ -53,8 +53,8 @@ test_expect_success 'removing hook does not work' ' git commit -m "removed update" && git push origin gitconfig && - ls server/.git/hooks | grep post-receive - ls server/.git/hooks | grep update + ls server.git/hooks | grep post-receive + ls server.git/hooks | grep update ' test_done diff --git a/tests/t2900-update-lock-check.sh b/tests/t2900-update-lock-check.sh index 2a10ddc..dd0189a 100644 --- a/tests/t2900-update-lock-check.sh +++ b/tests/t2900-update-lock-check.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash test_description='server update lock check' @@ -8,9 +8,9 @@ test_expect_success 'setup' ' echo "setup" >a && git add a && git commit -m "setup" && - git clone ./. server && - rm -fr server/.git/hooks && - git remote add origin ./server && + git clone -l . --bare server.git && + rm -fr server.git/hooks && + git remote add origin ./server.git && git config branch.master.remote origin && git config branch.master.merge refs/heads/master && git fetch @@ -19,7 +19,7 @@ test_expect_success 'setup' ' install_update_hook 'update-lock-check' test_expect_success 'locked branch is rejected' ' - echo master >> server/.git/locked && + echo master >> server.git/locked && echo "$test_name" >a && git commit -a -m "changed" && @@ -28,8 +28,8 @@ test_expect_success 'locked branch is rejected' ' ' test_expect_success 'locked branch is rejected with multiple branches set' ' - echo foo >> server/.git/locked && - echo bar >> server/.git/locked && + echo foo >> server.git/locked && + echo bar >> server.git/locked && echo "$test_name" >a && git commit -a -m "changed" && @@ -38,11 +38,12 @@ test_expect_success 'locked branch is rejected with multiple branches set' ' ' test_expect_success 'preserved branch cannot be deleted' ' - echo > server/.git/locked && - echo master > server/.git/preserved && + echo > server.git/locked && + git push origin master:master2 && + echo master2 > server.git/preserved && - ! git push origin :master 2>push.err && - cat push.err | grep "Branch master cannot be deleted" + ! git push origin :master2 2>push.err && + cat push.err | grep "Branch master2 cannot be deleted" ' test_done diff --git a/tests/t3000-post-receive-trac.sh b/tests/t3000-post-receive-trac.sh index bdb783e..e745066 100644 --- a/tests/t3000-post-receive-trac.sh +++ b/tests/t3000-post-receive-trac.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash test_description='server update lock check' @@ -11,9 +11,9 @@ test_expect_success 'setup' ' echo "setup" >a && git add a && git commit -m "setup" && - git clone ./. server && - rm -fr server/.git/hooks && - git remote add origin ./server + git clone -l . --bare server.git && + rm -fr server.git/hooks && + git remote add origin ./server.git ' install_post_receive_hook 'post-receive-trac' diff --git a/tests/t3001-post-receive-trac-with-commitnumbers.sh b/tests/t3001-post-receive-trac-with-commitnumbers.sh index 8a337d4..870c371 100644 --- a/tests/t3001-post-receive-trac-with-commitnumbers.sh +++ b/tests/t3001-post-receive-trac-with-commitnumbers.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash test_description='server post receive trac with commit numbers' @@ -11,9 +11,9 @@ test_expect_success 'setup' ' echo "setup" >a && git add a && git commit -m "setup" && - git clone ./. server && - rm -fr server/.git/hooks && - git remote add origin ./server + git clone -l . --bare server.git && + rm -fr server.git/hooks && + git remote add origin ./server.git ' install_post_receive_hook 'post-receive-commitnumbers' 'post-receive-trac' diff --git a/tests/t3100-update-allow-tags-branches.sh b/tests/t3100-update-allow-tags-branches.sh index ecac232..4cff0ff 100644 --- a/tests/t3100-update-allow-tags-branches.sh +++ b/tests/t3100-update-allow-tags-branches.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash test_description='server update allow tags and branches' @@ -8,9 +8,9 @@ test_expect_success 'setup' ' echo "setup" >a && git add a && git commit -m "setup" && - git clone ./. server && - rm -fr server/.git/hooks && - git remote add origin ./server + git clone -l . --bare server.git && + rm -fr server.git/hooks && + git remote add origin ./server.git ' install_update_hook 'update-allow-tags-branches' @@ -35,7 +35,7 @@ test_expect_success 'push works if done at the same time' ' ' test_expect_success 'moving branch back and deleting tag works' ' - GIT_DIR=./server/.git git config hooks.update-allow-tags-branches.deletetag true + GIT_DIR=./server.git git config hooks.update-allow-tags-branches.deletetag true git reset --hard HEAD^ && git push --force origin master:master :r2 ' diff --git a/tests/t3200-post-receive-commitnumbers.sh b/tests/t3200-post-receive-commitnumbers.sh index 985aadc..24b653b 100644 --- a/tests/t3200-post-receive-commitnumbers.sh +++ b/tests/t3200-post-receive-commitnumbers.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash test_description='server assign commit numbers' @@ -8,9 +8,9 @@ test_expect_success 'setup' ' echo "setup" >a && git add a && git commit -m "setup" && - git clone ./. server && - rm -fr server/.git/hooks && - git remote add origin ./server && + git clone -l . --bare server.git && + rm -fr server.git/hooks && + git remote add origin ./server.git && git config branch.master.remote origin && git config branch.master.merge refs/heads/master && git fetch @@ -27,7 +27,7 @@ test_expect_success 'assign one new commit' ' test "$(git rev-parse HEAD)" = "$(git rev-parse r/1)" && test "$(git describe --tags)" = "r/1" && - test "$(git rev-parse HEAD) refs/heads/master" = "$(cat server/.git/commitnumbers)" + test "$(git rev-parse HEAD) refs/heads/master" = "$(cat server.git/commitnumbers)" ' test_expect_success 'assign two new commits' ' diff --git a/tests/t5000-checkout.sh b/tests/t5000-checkout.sh index c9ce960..999bc26 100644 --- a/tests/t5000-checkout.sh +++ b/tests/t5000-checkout.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash test_description='script checkout' @@ -10,29 +10,31 @@ test_expect_success 'setup' ' echo "setup" >a && git add a && git commit -m "setup" && - git clone ./. server && - rm -fr server/.git/hooks && - git remote add origin ./server + git clone -l . --bare server.git && + rm -fr server.git/hooks && + git remote add origin ./server.git git checkout -b stable && git push origin stable ' test_expect_success 'checkout a new branch clones stable' ' - gc-checkout topic1 && + checkout topic1 && git branch | grep topic1 && git branch -r | grep origin/topic1 && git config --list | grep "branch.topic1.merge=refs/heads/topic1" ' test_expect_success 'checkout an existing remote branch' ' - cd server && - git checkout -b topic2 stable && + git clone server.git person2 && + cd person2 && + git checkout -b topic2 origin/stable && echo "$test_name on server" >a && git commit -a -m "Made topic2 on server" && + git push origin topic2 cd .. && ! git branch | grep topic2 && - gc-checkout topic2 && + checkout topic2 && git branch | grep topic2 && git branch -r | grep origin/topic2 && git config --list | grep "branch.topic2.merge=refs/heads/topic2" && @@ -43,7 +45,7 @@ test_expect_success 'checkout an existing remote branch' ' ' test_expect_success 'checkout an existing local branch' ' - gc-checkout topic1 + checkout topic1 ' test_expect_success 'checkout a revision does not create a new branch' ' @@ -51,7 +53,7 @@ test_expect_success 'checkout a revision does not create a new branch' ' git commit -a -m "$test_name" && prior=$(git rev-parse HEAD^) && - gc-checkout $prior && + checkout $prior && git branch | grep "no branch" ' diff --git a/tests/t5100-push.sh b/tests/t5100-push.sh index 587e036..dc27dff 100644 --- a/tests/t5100-push.sh +++ b/tests/t5100-push.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash test_description='script create branch' diff --git a/tests/t5200-pull.sh b/tests/t5200-pull.sh index 911f7a4..345df58 100644 --- a/tests/t5200-pull.sh +++ b/tests/t5200-pull.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash test_description='script pull' @@ -10,9 +10,9 @@ test_expect_success 'setup' ' echo "setup" >a && git add a && git commit -m "setup" && - git clone ./. server && - rm -fr server/.git/hooks && - git remote add origin ./server && + git clone -l . --bare server.git && + rm -fr server.git/hooks && + git remote add origin ./server.git && git checkout -b stable && git push origin stable ' @@ -24,10 +24,12 @@ test_expect_success 'pull does a rebase' ' git commit -m "move topic1" && # Move topic1 on the server - cd server && + git clone server.git person2 && + cd person2 && git checkout topic1 && echo "$test_name" >a && git commit -a -m "move topic1 on the server" && + git push origin && cd .. && # Only one parent @@ -53,11 +55,13 @@ test_expect_success 'pull does a rebase but does not fuck up merges' ' git merge stable && # Move topic2 on the server - cd server && - git checkout topic2 && + cd person2 && + git fetch && + git checkout -b topic2 origin/topic2 && echo "$test_name" >a.topic2.server && git add a.topic2.server && git commit -m "move topic2 on the server" && + git push origin && cd .. && # Merge stable locally too--should conflict @@ -71,10 +75,11 @@ test_expect_success 'pull moves when we have no local changes' ' git checkout topic2 && # Move topic2 on the server - cd server && - git checkout topic2 && + cd person2 && + git pull && echo "$test_name" > a.topic2.server && git commit -a -m "move topic2 on the server" && + git push origin && cd .. && pull && diff --git a/tests/t5400-refollow.sh b/tests/t5400-refollow.sh index 70e90d4..1c9ae3b 100644 --- a/tests/t5400-refollow.sh +++ b/tests/t5400-refollow.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash test_description='script refollow' @@ -10,15 +10,15 @@ test_expect_success 'setup' ' echo "setup" >a && git add a && git commit -m "setup" && - git clone ./. server && - rm -fr server/.git/hooks && - git remote add origin ./server && + git clone -l . --bare server.git && + rm -fr server.git/hooks && + git remote add origin ./server.git && git checkout -b stable && git push origin stable ' test_expect_success 'setup gitconfig' ' - make-gitconfig-branch && + create-gitconfig && git checkout gitconfig && echo "hooks.update-ensure-follows.branches=stable" >>config && echo "hooks.update-ensure-follows.excused=master gitconfig" >>config && diff --git a/tests/t9000-notes.sh b/tests/t9000-notes.sh index 9034f21..4583bd3 100644 --- a/tests/t9000-notes.sh +++ b/tests/t9000-notes.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash test_description='sanity check of commands listed in GitNotes' diff --git a/tests/test-lib.sh b/tests/test-lib.sh index 01d0cee..781f342 100644 --- a/tests/test-lib.sh +++ b/tests/test-lib.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Copyright (c) 2005 Junio C Hamano # @@ -334,6 +334,7 @@ test_must_fail () { # - not all diff versions understand "-u" test_cmp() { + echo "t=${GIT_TEST_CMP}" $GIT_TEST_CMP "$@" } @@ -468,19 +469,19 @@ install_post_checkout_hook () { } install_server_hook () { - mkdir -p "server/.git/hooks" - cp "../../server/$1" "server/.git/hooks/$2" - chmod +x "server/.git/hooks/$2" + mkdir -p "server.git/hooks" + cp "../../server.git/$1" "server.git/hooks/$2" + chmod +x "server.git/hooks/$2" } install_update_hook () { - mkdir -p "server/.git/hooks" - hook="server/.git/hooks/update" + mkdir -p "server.git/hooks" + hook="server.git/hooks/update" - echo "#!/bin/sh" >$hook + echo "#!/bin/bash" >$hook for ((i=1;i<=$#;i+=1)); do eval script_name="$"$i - echo "../../../../server/$script_name \$1 \$2 \$3 &&" >>$hook + echo "../../../server/$script_name \$1 \$2 \$3 &&" >>$hook done echo "echo >/dev/null" >>$hook @@ -488,11 +489,11 @@ install_update_hook () { } install_post_receive_hook () { - mkdir -p "server/.git/hooks" - hook="server/.git/hooks/post-receive" + mkdir -p "server.git/hooks" + hook="server.git/hooks/post-receive" cat >$hook <<-'EOF' - #!/bin/sh + #!/bin/bash nl=$'\n' input="" while read newref oldref refname ; do @@ -502,7 +503,7 @@ install_post_receive_hook () { for ((i=1;i<=$#;i+=1)); do eval script_name="$"$i - echo "echo -n \"\$input\" | ../../../../server/$script_name" >>$hook + echo "echo -n \"\$input\" | ../../../server/$script_name" >>$hook done chmod +x $hook