From: Dan Brook Date: Mon, 1 Apr 2013 17:46:16 +0000 (+0200) Subject: Fix the bare.git test repo. X-Git-Tag: 0.004002~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FGitalist.git;a=commitdiff_plain;h=af2c5a6d465a126c3158967289bf8fb57d4010de Fix the bare.git test repo. In it's previous state recent git versions didn't consider it a git repo which resulted in noisy (but passing) tests. Now the tests are less noisy and still passing. --- diff --git a/t/lib/repositories/bare.git/config b/t/lib/repositories/bare.git/config index c53d818..937807d 100644 --- a/t/lib/repositories/bare.git/config +++ b/t/lib/repositories/bare.git/config @@ -2,4 +2,5 @@ repositoryformatversion = 0 filemode = true bare = true - ignorecase = true +[remote "origin"] + url = /home/dbrook/dev/Gitalist/t/lib/repositories/./tmp diff --git a/t/lib/repositories/bare.git/hooks/commit-msg.sample b/t/lib/repositories/bare.git/hooks/commit-msg.sample index 6ef1d29..b58d118 100755 --- a/t/lib/repositories/bare.git/hooks/commit-msg.sample +++ b/t/lib/repositories/bare.git/hooks/commit-msg.sample @@ -1,7 +1,7 @@ #!/bin/sh # # An example hook script to check the commit log message. -# Called by git-commit with one argument, the name of the file +# Called by "git commit" with one argument, the name of the file # that has the commit message. The hook should exit with non-zero # status after issuing an appropriate message if it wants to stop the # commit. The hook is allowed to edit the commit message file. diff --git a/t/lib/repositories/bare.git/hooks/post-receive.sample b/t/lib/repositories/bare.git/hooks/post-receive.sample index 18d2e0f..7a83e17 100755 --- a/t/lib/repositories/bare.git/hooks/post-receive.sample +++ b/t/lib/repositories/bare.git/hooks/post-receive.sample @@ -9,7 +9,7 @@ # For example: # aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master # -# see contrib/hooks/ for an sample, or uncomment the next line and +# see contrib/hooks/ for a sample, or uncomment the next line and # rename the file to "post-receive". #. /usr/share/doc/git-core/contrib/hooks/post-receive-email diff --git a/t/lib/repositories/bare.git/hooks/post-update.sample b/t/lib/repositories/bare.git/hooks/post-update.sample index 5323b56..ec17ec1 100755 --- a/t/lib/repositories/bare.git/hooks/post-update.sample +++ b/t/lib/repositories/bare.git/hooks/post-update.sample @@ -5,4 +5,4 @@ # # To enable this hook, rename this file to "post-update". -exec git-update-server-info +exec git update-server-info diff --git a/t/lib/repositories/bare.git/hooks/pre-commit.sample b/t/lib/repositories/bare.git/hooks/pre-commit.sample index b11ad6a..b187c4b 100755 --- a/t/lib/repositories/bare.git/hooks/pre-commit.sample +++ b/t/lib/repositories/bare.git/hooks/pre-commit.sample @@ -1,12 +1,20 @@ #!/bin/sh # # An example hook script to verify what is about to be committed. -# Called by git-commit with no arguments. The hook should +# Called by "git commit" with no arguments. The hook should # exit with non-zero status after issuing an appropriate message if # it wants to stop the commit. # # To enable this hook, rename this file to "pre-commit". +if git rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 +fi + # If you want to allow non-ascii filenames set this variable to true. allownonascii=$(git config hooks.allownonascii) @@ -14,15 +22,18 @@ allownonascii=$(git config hooks.allownonascii) # them from being added to the repository. We exploit the fact that the # printable range starts at the space character and ends with tilde. if [ "$allownonascii" != "true" ] && - test "$(git diff --cached --name-only --diff-filter=A -z | + # Note that the use of brackets around a tr range is ok here, (it's + # even required, for portability to Solaris 10's /usr/bin/tr), since + # the square bracket bytes happen to fall in the designated range. + test "$(git diff --cached --name-only --diff-filter=A -z $against | LC_ALL=C tr -d '[ -~]\0')" then - echo "Error: Attempt to add a non-ascii filename." + echo "Error: Attempt to add a non-ascii file name." echo - echo "This can cause problems if you want to work together" - echo "with people on other platforms than you." + echo "This can cause problems if you want to work" + echo "with people on other platforms." echo - echo "To be portable it is adviseable to rename the file ..." + echo "To be portable it is advisable to rename the file ..." echo echo "If you know what you are doing you can disable this" echo "check using:" @@ -32,12 +43,4 @@ then exit 1 fi -if git-rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 -fi - exec git diff-index --check --cached $against -- diff --git a/t/lib/repositories/bare.git/hooks/pre-rebase.sample b/t/lib/repositories/bare.git/hooks/pre-rebase.sample index be1b06e..9773ed4 100755 --- a/t/lib/repositories/bare.git/hooks/pre-rebase.sample +++ b/t/lib/repositories/bare.git/hooks/pre-rebase.sample @@ -2,7 +2,7 @@ # # Copyright (c) 2006, 2008 Junio C Hamano # -# The "pre-rebase" hook is run just before "git-rebase" starts doing +# The "pre-rebase" hook is run just before "git rebase" starts doing # its job, and can prevent the command from running by exiting with # non-zero status. # @@ -43,7 +43,7 @@ git show-ref -q "$topic" || { } # Is topic fully merged to master? -not_in_master=`git-rev-list --pretty=oneline ^master "$topic"` +not_in_master=`git rev-list --pretty=oneline ^master "$topic"` if test -z "$not_in_master" then echo >&2 "$topic is fully merged to master; better remove it." @@ -51,11 +51,11 @@ then fi # Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git-rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git-rev-list ^master ${publish} | sort` +only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` +only_next_2=`git rev-list ^master ${publish} | sort` if test "$only_next_1" = "$only_next_2" then - not_in_topic=`git-rev-list "^$topic" master` + not_in_topic=`git rev-list "^$topic" master` if test -z "$not_in_topic" then echo >&2 "$topic is already up-to-date with master" @@ -64,8 +64,8 @@ then exit 0 fi else - not_in_next=`git-rev-list --pretty=oneline ^${publish} "$topic"` - perl -e ' + not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` + /usr/bin/perl -e ' my $topic = $ARGV[0]; my $msg = "* $topic has commits already merged to public branch:\n"; my (%not_in_next) = map { @@ -157,13 +157,13 @@ B to be deleted. To compute (1): - git-rev-list ^master ^topic next - git-rev-list ^master next + git rev-list ^master ^topic next + git rev-list ^master next if these match, topic has not merged in next at all. To compute (2): - git-rev-list master..topic + git rev-list master..topic if this is empty, it is fully merged to "master". diff --git a/t/lib/repositories/bare.git/hooks/prepare-commit-msg.sample b/t/lib/repositories/bare.git/hooks/prepare-commit-msg.sample index 3652424..f093a02 100755 --- a/t/lib/repositories/bare.git/hooks/prepare-commit-msg.sample +++ b/t/lib/repositories/bare.git/hooks/prepare-commit-msg.sample @@ -1,7 +1,7 @@ #!/bin/sh # # An example hook script to prepare the commit log message. -# Called by git-commit with the name of the file that has the +# Called by "git commit" with the name of the file that has the # commit message, followed by the description of the commit # message's source. The hook's purpose is to edit the commit # message file. If the hook fails with a non-zero status, @@ -22,10 +22,10 @@ case "$2,$3" in merge,) - perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; + /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; # ,|template,) -# perl -i.bak -pe ' +# /usr/bin/perl -i.bak -pe ' # print "\n" . `git diff --cached --name-status -r` # if /^#/ && $first++ == 0' "$1" ;; diff --git a/t/lib/repositories/bare.git/hooks/update.sample b/t/lib/repositories/bare.git/hooks/update.sample index fd63b2d..71ab04e 100755 --- a/t/lib/repositories/bare.git/hooks/update.sample +++ b/t/lib/repositories/bare.git/hooks/update.sample @@ -1,7 +1,7 @@ #!/bin/sh # # An example hook script to blocks unannotated tags from entering. -# Called by git-receive-pack with arguments: refname sha1-old sha1-new +# Called by "git receive-pack" with arguments: refname sha1-old sha1-new # # To enable this hook, rename this file to "update". # @@ -64,7 +64,7 @@ zero="0000000000000000000000000000000000000000" if [ "$newrev" = "$zero" ]; then newrev_type=delete else - newrev_type=$(git-cat-file -t $newrev) + newrev_type=$(git cat-file -t $newrev) fi case "$refname","$newrev_type" in diff --git a/t/lib/repositories/bare.git/info/exclude b/t/lib/repositories/bare.git/info/exclude index 2c87b72..a5196d1 100644 --- a/t/lib/repositories/bare.git/info/exclude +++ b/t/lib/repositories/bare.git/info/exclude @@ -1,4 +1,4 @@ -# git-ls-files --others --exclude-from=.git/info/exclude +# git ls-files --others --exclude-from=.git/info/exclude # Lines that start with '#' are comments. # For a project mostly in C, the following would be a good set of # exclude patterns (uncomment them if you want to use them): diff --git a/t/lib/repositories/bare.git/objects/14/d4a45fe754bb3050e30b9395e93141e4fe9966 b/t/lib/repositories/bare.git/objects/14/d4a45fe754bb3050e30b9395e93141e4fe9966 new file mode 100644 index 0000000..baaea41 Binary files /dev/null and b/t/lib/repositories/bare.git/objects/14/d4a45fe754bb3050e30b9395e93141e4fe9966 differ diff --git a/t/lib/repositories/bare.git/objects/6f/ed92d478142d92f155adbcfa0d368cf926b890 b/t/lib/repositories/bare.git/objects/6f/ed92d478142d92f155adbcfa0d368cf926b890 new file mode 100644 index 0000000..907b956 Binary files /dev/null and b/t/lib/repositories/bare.git/objects/6f/ed92d478142d92f155adbcfa0d368cf926b890 differ diff --git a/t/lib/repositories/bare.git/objects/e0/1ab12f8706746dc92e9901ee555984c9597693 b/t/lib/repositories/bare.git/objects/e0/1ab12f8706746dc92e9901ee555984c9597693 new file mode 100644 index 0000000..39875f5 Binary files /dev/null and b/t/lib/repositories/bare.git/objects/e0/1ab12f8706746dc92e9901ee555984c9597693 differ diff --git a/t/lib/repositories/bare.git/packed-refs b/t/lib/repositories/bare.git/packed-refs new file mode 100644 index 0000000..8242b7b --- /dev/null +++ b/t/lib/repositories/bare.git/packed-refs @@ -0,0 +1,2 @@ +# pack-refs with: peeled +14d4a45fe754bb3050e30b9395e93141e4fe9966 refs/heads/master