1
0
mirror of https://github.com/danog/gift.git synced 2024-11-30 04:19:37 +01:00

Fix ending problems that corruptes the remotes fixture repository

This commit is contained in:
feugy 2012-09-15 09:49:35 +02:00
parent 6fb57d68c7
commit 3e966bc8d5
43 changed files with 41 additions and 49 deletions

10
.gitattributes vendored Normal file
View File

@ -0,0 +1,10 @@
# automatic ending correction
* text
# To avoid corrupting fixtures
test/fixtures/remotes/* binary
test/fixtures/remotes/hooks/* binary
test/fixtures/remotes/info/* binary
test/fixtures/remotes/objects/pack/* binary
test/fixtures/remotes/refs/heads/* binary
test/fixtures/remotes/refs/remotes/origin/* binary

View File

@ -24,7 +24,7 @@
, "dependencies": {"underscore": "1.x.x"}
, "devDependencies":
{ "chai": "1.0.x"
, "mocha": "0.x.x"
, "mocha": "1.4.x"
, "coffee-script": "1.3.x"
, "rimraf": "2.0.x"
}

View File

@ -1,14 +1,11 @@
[core]
repositoryformatversion = 0
filemode = false
filemode = true
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
hideDotFiles = dotGitOnly
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = https://github.com/feugy/gift.git
url = git@github.com:octocat/Spoon-Knife.git
[branch "master"]
remote = origin
merge = refs/heads/master

0
test/fixtures/remotes/hooks/applypatch-msg.sample vendored Executable file → Normal file
View File

2
test/fixtures/remotes/hooks/commit-msg.sample vendored Executable file → Normal file
View File

@ -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.

0
test/fixtures/remotes/hooks/post-commit.sample vendored Executable file → Normal file
View File

0
test/fixtures/remotes/hooks/post-receive.sample vendored Executable file → Normal file
View File

2
test/fixtures/remotes/hooks/post-update.sample vendored Executable file → Normal file
View File

@ -5,4 +5,4 @@
#
# To enable this hook, rename this file to "post-update".
exec git update-server-info
exec git-update-server-info

0
test/fixtures/remotes/hooks/pre-applypatch.sample vendored Executable file → Normal file
View File

12
test/fixtures/remotes/hooks/pre-commit.sample vendored Executable file → Normal file
View File

@ -1,13 +1,13 @@
#!/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
if git-rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
@ -18,9 +18,6 @@ fi
# If you want to allow non-ascii filenames set this variable to true.
allownonascii=$(git config hooks.allownonascii)
# Redirect output to stderr.
exec 1>&2
# Cross platform projects tend to avoid non-ascii filenames; prevent
# them from being added to the repository. We exploit the fact that the
# printable range starts at the space character and ends with tilde.
@ -28,8 +25,8 @@ if [ "$allownonascii" != "true" ] &&
# 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' | wc -c) != 0
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 file name."
echo
@ -46,5 +43,4 @@ then
exit 1
fi
# If there are whitespace errors, print the offending file names and fail.
exec git diff-index --check --cached $against --

20
test/fixtures/remotes/hooks/pre-rebase.sample vendored Executable file → Normal file
View File

@ -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"`
/usr/bin/perl -e '
not_in_next=`git-rev-list --pretty=oneline ^${publish} "$topic"`
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".

6
test/fixtures/remotes/hooks/prepare-commit-msg.sample vendored Executable file → Normal file
View File

@ -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,)
/usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;;
perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;;
# ,|template,)
# /usr/bin/perl -i.bak -pe '
# perl -i.bak -pe '
# print "\n" . `git diff --cached --name-status -r`
# if /^#/ && $first++ == 0' "$1" ;;

4
test/fixtures/remotes/hooks/update.sample vendored Executable file → Normal file
View File

@ -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

Binary file not shown.

View File

@ -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):

View File

@ -1,3 +1 @@
0000000000000000000000000000000000000000 80b4f47883767e410b1e533020db7bcdfacb760f feugy <pioupiou@gmail.com> 1347602361 +0200 clone: from https://github.com/feugy/gift.git
80b4f47883767e410b1e533020db7bcdfacb760f c8bc9abb44b3f7a0b01ea2c4fd2543b55705aced feugy <pioupiou@gmail.com> 1347605639 +0200 commit: initial commit
c8bc9abb44b3f7a0b01ea2c4fd2543b55705aced 80b4f47883767e410b1e533020db7bcdfacb760f feugy <pioupiou@gmail.com> 1347605708 +0200 reset: moving to HEAD~1
0000000000000000000000000000000000000000 bdd3996d38d885e18e5c5960df1c2c06e34d673f sentientwaffle <sentientwaffle@gmail.com> 1329101708 -0700 clone: from git@github.com:octocat/Spoon-Knife.git

View File

@ -1,3 +1 @@
0000000000000000000000000000000000000000 80b4f47883767e410b1e533020db7bcdfacb760f feugy <pioupiou@gmail.com> 1347602361 +0200 clone: from https://github.com/feugy/gift.git
80b4f47883767e410b1e533020db7bcdfacb760f c8bc9abb44b3f7a0b01ea2c4fd2543b55705aced feugy <pioupiou@gmail.com> 1347605639 +0200 commit: initial commit
c8bc9abb44b3f7a0b01ea2c4fd2543b55705aced 80b4f47883767e410b1e533020db7bcdfacb760f feugy <pioupiou@gmail.com> 1347605708 +0200 reset: moving to HEAD~1
0000000000000000000000000000000000000000 bdd3996d38d885e18e5c5960df1c2c06e34d673f sentientwaffle <sentientwaffle@gmail.com> 1329101708 -0700 clone: from git@github.com:octocat/Spoon-Knife.git

View File

@ -1 +0,0 @@
0000000000000000000000000000000000000000 80b4f47883767e410b1e533020db7bcdfacb760f feugy <pioupiou@gmail.com> 1347602361 +0200 clone: from https://github.com/feugy/gift.git

View File

@ -1,8 +1,2 @@
# pack-refs with: peeled
80b4f47883767e410b1e533020db7bcdfacb760f refs/remotes/origin/master
418ad9607ddd6bd7eeae370e87195ffcede37c00 refs/tags/v0.0.2
^b566b6db9d8ca20ee9501c59e9e8ddf7a90fb2fe
2fd494b53f81f0df5465f4786f3f3b4c9bd827c6 refs/tags/v0.0.3
^50f81834a787ce5800044be2397bb07368a9ae70
a84da5dfda3cded9e0801ab16103500fd6c44ac8 refs/tags/v0.0.4
a92e358f21b417e568512e24103bebe852683dba refs/tags/v0.0.5
bdd3996d38d885e18e5c5960df1c2c06e34d673f refs/remotes/origin/master

View File

@ -1 +1 @@
80b4f47883767e410b1e533020db7bcdfacb760f
bdd3996d38d885e18e5c5960df1c2c06e34d673f

View File

@ -182,9 +182,9 @@ describe "Repo", ->
remotes[0].should.be.an.instanceof Ref
it "contains the correct Refs", ->
remotes[0].commit.id.should.eql "80b4f47883767e410b1e533020db7bcdfacb760f"
remotes[0].commit.id.should.eql "bdd3996d38d885e18e5c5960df1c2c06e34d673f"
remotes[0].name.should.eql "origin/HEAD"
remotes[1].commit.id.should.eql "80b4f47883767e410b1e533020db7bcdfacb760f"
remotes[1].commit.id.should.eql "bdd3996d38d885e18e5c5960df1c2c06e34d673f"
remotes[1].name.should.eql "origin/master"
describe "when there are no remotes", ->