code stringlengths 1 1.96M | language stringclasses 1
value |
|---|---|
#!/bin/sh
#
# Copyright (c) 2008 Johannes E. Schindelin
#
test_description='prune'
. ./test-lib.sh
day=$((60*60*24))
week=$(($day*7))
add_blob() {
before=$(git count-objects | sed "s/ .*//") &&
BLOB=$(echo aleph_0 | git hash-object -w --stdin) &&
BLOB_FILE=.git/objects/$(echo $BLOB | sed "s/^../&\//") &&
test $(... | Shell |
#!/bin/sh
test_description='git merge
Testing pull.* configuration parsing.'
. ./test-lib.sh
test_expect_success 'setup' '
echo c0 >c0.c &&
git add c0.c &&
git commit -m c0 &&
git tag c0 &&
echo c1 >c1.c &&
git add c1.c &&
git commit -m c1 &&
git tag c1 &&
git reset --hard c0 &&
echo c2 >c2.c &&
git add ... | Shell |
#!/bin/sh
test_description='CRLF merge conflict across text=auto change
* [master] remove .gitattributes
! [side] add line from b
--
+ [side] add line from b
* [master] remove .gitattributes
* [master^] add line from a
* [master~2] normalize file
*+ [side^] Initial
'
. ./test-lib.sh
test_have_prereq SED_STRIPS... | Shell |
#!/bin/sh
test_description='typechange rename detection'
. ./test-lib.sh
test_expect_success SYMLINKS setup '
rm -f foo bar &&
cat "$TEST_DIRECTORY"/../COPYING >foo &&
ln -s linklink bar &&
git add foo bar &&
git commit -a -m Initial &&
git tag one &&
rm -f foo bar &&
cat "$TEST_DIRECTORY"/../COPYING >bar ... | Shell |
#!/bin/sh
#
# Copyright (c) 2006 Johannes E. Schindelin
#
test_description='git rerere
! [fifth] version1
! [first] first
! [fourth] version1
! [master] initial
! [second] prefer first over second
! [third] version2
------
+ [third] version2
+ [fifth] version1
+ [fourth] version1
+ + + ... | Shell |
#!/bin/sh
#
# Copyright (c) 2005 Junio C Hamano
#
test_description='git apply should handle files with incomplete lines.
'
. ./test-lib.sh
# setup
(echo a; echo b) >frotz.0
(echo a; echo b; echo c) >frotz.1
(echo a; echo b | tr -d '\012') >frotz.2
(echo a; echo c; echo b | tr -d '\012') >frotz.3
for i in 0 1 2 3
d... | Shell |
# This file isn't used as a test script directly, instead it is
# sourced from t8001-annotate.sh and t8002-blame.sh.
check_count () {
head=
case "$1" in -h) head="$2"; shift; shift ;; esac
echo "$PROG file $head" >&4
$PROG file $head >.result || return 1
cat .result | perl -e '
my %expect = (@ARGV);
my %count... | Shell |
#!/bin/sh
test_description='basic symbolic-ref tests'
. ./test-lib.sh
# If the tests munging HEAD fail, they can break detection of
# the git repo, meaning that further tests will operate on
# the surrounding git repo instead of the trash directory.
reset_to_sane() {
echo ref: refs/heads/foo >.git/HEAD
}
test_expec... | Shell |
#!/bin/sh
#
# Portions copyright (c) 2007, 2009 Sam Vilain
# Portions copyright (c) 2011 Bryan Jacobs
#
test_description='git-svn svn mergeinfo propagation'
. ./lib-git-svn.sh
test_expect_success 'load svn dump' "
svnadmin load -q '$rawsvnrepo' \
< '$TEST_DIRECTORY/t9161/branches.dump' &&
git svn init --minimiz... | Shell |
#!/bin/sh
#
# Copyright (c) 2009 Eric Wong, Mark Lodato
#
test_description='git svn authors prog tests'
. ./lib-git-svn.sh
cat > svn-authors-prog <<'EOF'
#!/usr/bin/perl
$_ = shift;
if (s/-sub$//) {
print "$_ <$_\@sub.example.com>\n";
}
else {
print "$_ <$_\@example.com>\n";
}
EOF
chmod +x svn-authors-prog
cat >... | Shell |
#!/bin/sh
test_description='git p4 filetype tests'
. ./lib-git-p4.sh
test_expect_success 'start p4d' '
start_p4d
'
#
# This series of tests checks newline handling Both p4 and
# git store newlines as \n, and have options to choose how
# newlines appear in checked-out files.
#
test_expect_success 'p4 client newlin... | Shell |
#!/bin/sh
test_description='git ls-remote'
. ./test-lib.sh
test_expect_success setup '
>file &&
git add file &&
test_tick &&
git commit -m initial &&
git tag mark &&
git show-ref --tags -d | sed -e "s/ / /" >expected.tag &&
(
echo "$(git rev-parse HEAD) HEAD"
git show-ref -d | sed -e "s/ / /"
) >expected... | Shell |
#!/bin/sh
#
# Copyright (c) 2006 Johannes E. Schindelin
#
test_description='Test special whitespace in diff engine.
'
. ./test-lib.sh
. "$TEST_DIRECTORY"/diff-lib.sh
# Ray Lehtiniemi's example
cat << EOF > x
do {
nothing;
} while (0);
EOF
git update-index --add x
cat << EOF > x
do
{
nothing;
}
while (0);
EO... | Shell |
#!/bin/sh
#
# Copyright (c) 2009 Mark Rada
#
test_description='gitweb as standalone script (http status tests).
This test runs gitweb (git web interface) as a CGI script from the
commandline, and checks that it returns the expected HTTP status
code and message.'
. ./gitweb-lib.sh
#
# Gitweb only provides the funct... | Shell |
#!/bin/sh
test_description='git svn handling of root commits in merge ranges'
. ./lib-git-svn.sh
svn_ver="$(svn --version --quiet)"
case $svn_ver in
0.* | 1.[0-4].*)
skip_all="skipping git-svn test - SVN too old ($svn_ver)"
test_done
;;
esac
test_expect_success 'test handling of root commits in merge ranges' '
mk... | Shell |
#!/bin/sh
#
# Copyright (c) 2005 Junio C Hamano
#
test_description='More rename detection tests.
The rename detection logic should be able to detect pure rename or
copy of symbolic links, but should not produce rename/copy followed
by an edit for them.
'
. ./test-lib.sh
. "$TEST_DIRECTORY"/diff-lib.sh
test_expect_su... | Shell |
#!/bin/sh
#
# Copyright (C) 2006 Martin Waitz <tali@admingilde.org>
#
test_description='test clone --reference'
. ./test-lib.sh
base_dir=`pwd`
U=$base_dir/UPLOAD_LOG
test_expect_success 'preparing first repository' \
'test_create_repo A && cd A &&
echo first > file1 &&
git add file1 &&
git commit -m initial'
cd "$... | Shell |
#!/bin/sh
#
# Copyright (c) 2008 Christian Couder
#
test_description='test git rev-parse --verify'
exec </dev/null
. ./test-lib.sh
add_line_into_file()
{
_line=$1
_file=$2
if [ -f "$_file" ]; then
echo "$_line" >> $_file || return $?
MSG="Add <$_line> into <$_file>."
else
ech... | Shell |
#!/bin/sh
test_description='checkout from unborn branch'
. ./test-lib.sh
test_expect_success 'setup' '
mkdir parent &&
(cd parent &&
git init &&
echo content >file &&
git add file &&
git commit -m base
) &&
git fetch parent master:origin
'
test_expect_success 'checkout from unborn preserves untracked fil... | Shell |
#!/bin/sh
test_description='test cherry-pick and revert with renames
--
+ rename2: renames oops to opos
+ rename1: renames oops to spoo
+ added: adds extra line to oops
++ initial: has lines in oops
'
. ./test-lib.sh
test_expect_success setup '
for l in a b c d e f g h i j k l m n o
do
echo $l$... | Shell |
#!/bin/sh
#
# Copyright (c) 2007 Johannes E. Schindelin
#
test_description='Test custom diff function name patterns'
. ./test-lib.sh
LF='
'
cat >Beer.java <<\EOF
public class Beer
{
int special;
public static void main(String args[])
{
String s=" ";
for(int x = 99; x > 0; x--)
{
System.out.print(x + " bo... | Shell |
#!/bin/sh
test_description='auto squash'
. ./test-lib.sh
test_expect_success setup '
echo 0 >file0 &&
git add . &&
test_tick &&
git commit -m "initial commit" &&
echo 0 >file1 &&
echo 2 >file2 &&
git add . &&
test_tick &&
git commit -m "first commit" &&
git tag first-commit &&
echo 3 >file3 &&
git add . ... | Shell |
#!/bin/sh
#
# Copyright (c) 2012 Daniel Graña
#
test_description='Test submodules on detached working tree
This test verifies that "git submodule" initialization, update and addition works
on detahced working trees
'
TEST_NO_CREATE_REPO=1
. ./test-lib.sh
test_expect_success 'submodule on detached working tree' '
g... | Shell |
#!/bin/sh
#
# Copyright (c) 2008 Christian Couder
#
test_description='Tests replace refs functionality'
exec </dev/null
. ./test-lib.sh
add_and_commit_file()
{
_file="$1"
_msg="$2"
git add $_file || return $?
test_tick || return $?
git commit --quiet -m "$_file: $_msg"
}
HASH1=
HASH2=
HASH3=
HA... | Shell |
#!/bin/sh
test_description='combined diff'
. ./test-lib.sh
setup_helper () {
one=$1 branch=$2 side=$3 &&
git branch $side $branch &&
for l in $one two three fyra
do
echo $l
done >file &&
git add file &&
test_tick &&
git commit -m $branch &&
git checkout $side &&
for l in $one two three quatro
do
echo... | Shell |
#!/bin/sh
test_description='histogram diff algorithm'
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-diff-alternative.sh
test_diff_frobnitz "histogram"
test_diff_unique "histogram"
test_done
| Shell |
#!/bin/sh
#
# Copyright (c) 2006 Junio C Hamano
#
test_description='Various diff formatting options'
. ./test-lib.sh
LF='
'
test_expect_success setup '
GIT_AUTHOR_DATE="2006-06-26 00:00:00 +0000" &&
GIT_COMMITTER_DATE="2006-06-26 00:00:00 +0000" &&
export GIT_AUTHOR_DATE GIT_COMMITTER_DATE &&
mkdir dir &&
mk... | Shell |
#!/bin/sh
#
# Copyright (c) 2006 Shawn Pearce
#
test_description='mmap sliding window tests'
. ./test-lib.sh
test_expect_success \
'setup' \
'rm -f .git/index* &&
for i in a b c
do
echo $i >$i &&
test-genrandom "$i" 32768 >>$i &&
git update-index --add $i || return 1
... | Shell |
#!/bin/sh
#
# Copyright (c) 2005 Junio C Hamano
#
test_description='git pack-object
'
. ./test-lib.sh
TRASH=`pwd`
test_expect_success \
'setup' \
'rm -f .git/index* &&
"$PERL_PATH" -e "print \"a\" x 4096;" > a &&
"$PERL_PATH" -e "print \"b\" x 4096;" > b &&
"$PERL_PATH" -e "print \"c\" x 4096... | Shell |
#!/bin/sh
test_description='am --abort'
. ./test-lib.sh
test_expect_success setup '
for i in a b c d e f g
do
echo $i
done >file-1 &&
cp file-1 file-2 &&
test_tick &&
git add file-1 file-2 &&
git commit -m initial &&
git tag initial &&
for i in 2 3 4 5 6
do
echo $i >>file-1 &&
echo $i >otherfile-$i &... | Shell |
#!/bin/sh
#
# Helper functions to check if read-tree would succeed/fail as expected with
# and without the dry-run option. They also test that the dry-run does not
# write the index and that together with -u it doesn't touch the work tree.
#
read_tree_must_succeed () {
git ls-files -s >pre-dry-run &&
git read-t... | Shell |
#!/bin/sh
test_description='test fetching of oddly-named refs'
. ./test-lib.sh
# afterwards we will have:
# HEAD - two
# refs/for/refs/heads/master - one
# refs/heads/master - three
test_expect_success 'setup repo with odd suffix ref' '
echo content >file &&
git add . &&
git commit -m one &&
git update-ref ref... | Shell |
#!/bin/sh
test_description='git rev-list should notice bad commits'
. ./test-lib.sh
# Note:
# - compression level is set to zero to make "corruptions" easier to perform
# - reflog is disabled to avoid extra references which would twart the test
test_expect_success 'setup' \
'
git init &&
git config core.co... | Shell |
#!/bin/sh
test_description='--ancestry-path'
# D---E-------F
# / \ \
# B---C---G---H---I---J
# / \
# A-------K---------------L--M
#
# D..M == E F G H I J K L M
# --ancestry-path D..M == E F H I J L M
#
# D..M -- M.t == M
# --ance... | Shell |
#!/bin/sh
#
# Copyright (c) 2012 Valentin Duperray, Lucien Kong, Franck Jonas,
# Thomas Nguy, Khoi Nguyen
# Grenoble INP Ensimag
#
test_description='Compatibility with $XDG_CONFIG_HOME/git/ files'
. ./test-lib.sh
test_expect_success 'read config: xdg file exists and ~/.gitconfig doesn'\''t' '
mkdir -p .... | Shell |
#!/bin/sh
#
test_description='git web--browse basic tests
This test checks that git web--browse can handle various valid URLs.'
. ./test-lib.sh
test_web_browse () {
# browser=$1 url=$2
git web--browse --browser="$1" "$2" >actual &&
tr -d '\015' <actual >text &&
test_cmp expect text
}
test_expect_success \
'UR... | Shell |
#!/bin/sh
test_description='magic pathspec tests using git-add'
. ./test-lib.sh
test_expect_success 'setup' '
mkdir sub anothersub &&
: >sub/foo &&
: >anothersub/foo
'
test_expect_success 'add :/' "
cat >expected <<-EOF &&
add 'anothersub/foo'
add 'expected'
add 'sub/actual'
add 'sub/foo'
EOF
(cd sub && g... | Shell |
#!/bin/sh
#
# Copyright (c) 2010 Stefan-W. Hahn
#
test_description='git-am mbox with dos line ending.
'
. ./test-lib.sh
# Three patches which will be added as files with dos line ending.
cat >file1 <<\EOF
line 1
EOF
cat >file1a <<\EOF
line 1
line 4
EOF
cat >file2 <<\EOF
line 1
line 2
EOF
cat >file3 <<\EOF
line 1... | Shell |
#!/bin/sh
test_description='credential-store tests'
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-credential.sh
helper_test store
test_done
| Shell |
#!/bin/sh
#
# Copyright (c) 2005 Junio C Hamano
#
test_description='git ls-tree test.
This test runs git ls-tree with the following in a tree.
path0 - a file
path1 - a symlink
path2/foo - a file in a directory
path2/bazbo - a symlink in a directory
path2/baz/b - a file in a directory in a... | Shell |
#!/bin/sh
#
# Copyright (c) 2009 Erick Mattos
#
test_description='git commit --reset-author'
. ./test-lib.sh
author_header () {
git cat-file commit "$1" |
sed -n -e '/^$/q' -e '/^author /p'
}
message_body () {
git cat-file commit "$1" |
sed -e '1,/^$/d'
}
test_expect_success '-C option copies authorship and me... | Shell |
#!/bin/sh
#
# Copyright (c) 2010 Christian Couder
#
test_description='Tests to check that "reset" options follow a known table'
. ./test-lib.sh
test_expect_success 'creating initial commits' '
test_commit E file1 &&
test_commit D file1 &&
test_commit C file1
'
while read W1 I1 H1 T opt W2 I2 H2
do
... | Shell |
#!/bin/sh
test_description='remote tracking stats'
. ./test-lib.sh
advance () {
echo "$1" >"$1" &&
git add "$1" &&
test_tick &&
git commit -m "$1"
}
test_expect_success setup '
for i in a b c;
do
advance $i || break
done &&
git clone . test &&
(
cd test &&
git checkout -b b1 origin &&
git reset --h... | Shell |
#!/bin/sh
#
# Copyright (c) 2006 Junio C Hamano
#
test_description='git read-tree --prefix test.
'
. ./test-lib.sh
test_expect_success setup '
echo hello >one &&
git update-index --add one &&
tree=`git write-tree` &&
echo tree is $tree
'
echo 'one
two/one' >expect
test_expect_success 'read-tree --prefix' '
gi... | Shell |
#!/bin/sh
# Copyright (c) 2010, Jens Lehmann
test_description='Recursive "git fetch" for submodules'
. ./test-lib.sh
pwd=$(pwd)
add_upstream_commit() {
(
cd submodule &&
head1=$(git rev-parse --short HEAD) &&
echo new >> subfile &&
test_tick &&
git add subfile &&
git commit -m new subfile &&
head2=$(... | Shell |
#!/bin/sh
test_description='fetching via git:// using core.gitproxy'
. ./test-lib.sh
test_expect_success 'setup remote repo' '
git init remote &&
(cd remote &&
echo content >file &&
git add file &&
git commit -m one
)
'
cat >proxy <<'EOF'
#!/bin/sh
echo >&2 "proxying for $*"
cmd=`"$PERL_PATH" -e '
read(STD... | Shell |
#!/bin/sh
test_description='git repack works correctly'
. ./test-lib.sh
fsha1=
csha1=
tsha1=
test_expect_success '-A with -d option leaves unreachable objects unpacked' '
echo content > file1 &&
git add . &&
test_tick &&
git commit -m initial_commit &&
# create a transient branch with unique content
git check... | Shell |
#!/bin/sh
#
# Copyright (c) 2007, 2009 Sam Vilain
#
test_description='git-svn svn mergeinfo properties'
. ./lib-git-svn.sh
test_expect_success 'load svn dump' "
svnadmin load -q '$rawsvnrepo' \
< '$TEST_DIRECTORY/t9151/svn-mergeinfo.dump' &&
git svn init --minimize-url -R svnmerge \
--rewrite-root=http://svn... | Shell |
#!/bin/sh
test_description='merge conflict in crlf repo
b---M
/ /
initial---a
'
. ./test-lib.sh
test_expect_success setup '
git config core.autocrlf true &&
echo foo | append_cr >file &&
git add file &&
git commit -m "Initial" &&
git tag initial &&
git branch side &&
echo line from a | append_c... | Shell |
#!/bin/sh
test_description='clone --branch option'
. ./test-lib.sh
check_HEAD() {
echo refs/heads/"$1" >expect &&
git symbolic-ref HEAD >actual &&
test_cmp expect actual
}
check_file() {
echo "$1" >expect &&
test_cmp expect file
}
test_expect_success 'setup' '
mkdir parent &&
(cd parent && git init &&
echo... | Shell |
#!/bin/sh
test_description='Merge-recursive merging renames'
. ./test-lib.sh
test_expect_success setup \
'
cat >A <<\EOF &&
a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
c cccccccccccccccccccccccccccccccccccccccccccccccc
d ddddddddddddddddddddddddddddddddddddddd... | Shell |
#!/bin/sh
test_description='checkout '
. ./test-lib.sh
# Arguments: <branch> <sha> [<checkout options>]
#
# Runs "git checkout" to switch to <branch>, testing that
#
# 1) we are on the specified branch, <branch>;
# 2) HEAD is <sha>; if <sha> is not specified, the old HEAD is used.
#
# If <checkout options> is no... | Shell |
#!/bin/sh
test_description='git add --all'
. ./test-lib.sh
test_expect_success setup '
(
echo .gitignore
echo will-remove
) >expect &&
(
echo actual
echo expect
echo ignored
) >.gitignore &&
>will-remove &&
git add --all &&
test_tick &&
git commit -m initial &&
git ls-files >actual &&
test_cmp ex... | Shell |
#!/bin/sh
#
# Copyright (c) 2008 Lea Wiemann
#
test_description='perl interface (Git.pm)'
. ./test-lib.sh
if ! test_have_prereq PERL; then
skip_all='skipping perl interface tests, perl not available'
test_done
fi
"$PERL_PATH" -MTest::More -e 0 2>/dev/null || {
skip_all="Perl Test::More unavailable, skipping test"... | Shell |
#!/bin/sh
#
# Copyright (c) 2007 Shawn Pearce
#
test_description='test git fast-import utility'
. ./test-lib.sh
. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
# Print $1 bytes from stdin to stdout.
#
# This could be written as "head -c $1", but IRIX "head" does not
# support the -c option.
head_c () {... | Shell |
#!/bin/sh
test_description='git p4 label tests'
. ./lib-git-p4.sh
test_expect_success 'start p4d' '
start_p4d
'
# Basic p4 label tests.
#
# Note: can't have more than one label per commit - others
# are silently discarded.
#
test_expect_success 'basic p4 labels' '
test_when_finished cleanup_git &&
(
cd "$cli" ... | Shell |
#!/bin/sh
test_description='Return value of diffs'
. ./test-lib.sh
test_expect_success 'setup' '
echo 1 >a &&
git add . &&
git commit -m first &&
echo 2 >b &&
git add . &&
git commit -a -m second &&
mkdir -p test-outside/repo && (
cd test-outside/repo &&
git init &&
echo "1 1" >a &&
git add . &&
git... | Shell |
#!/bin/sh
#
# Copyright (c) 2005 Junio C Hamano
#
test_description='git checkout-index --prefix test.
This test makes sure that --prefix option works as advertised, and
also verifies that such leading path may contain symlinks, unlike
the GIT controlled paths.
'
. ./test-lib.sh
test_expect_success \
'setup' \
... | Shell |
#!/bin/sh
#
# Copyright (c) 2005 Junio C Hamano
#
test_description='Two way merge with read-tree -m -u $H $M
This is identical to t1001, but uses -u to update the work tree as well.
'
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-read-tree.sh
compare_change () {
sed >current \
-e '1{/^diff --git /d;}' \
-e '2{... | Shell |
#!/bin/sh
test_description='git-merge
Do not overwrite changes.'
. ./test-lib.sh
test_expect_success 'setup' '
test_commit c0 c0.c &&
test_commit c1 c1.c &&
test_commit c1a c1.c "c1 a" &&
git reset --hard c0 &&
test_commit c2 c2.c &&
git reset --hard c0 &&
mkdir sub &&
echo "sub/f" > sub/f &&
mkdir sub2 &&... | Shell |
#!/bin/sh
test_description='some bundle related tests'
. ./test-lib.sh
test_expect_success 'setup' '
test_commit initial &&
test_tick &&
git tag -m tag tag &&
test_commit second &&
test_commit third &&
git tag -d initial &&
git tag -d second &&
git tag -d third
'
test_expect_success 'tags can be excluded by ... | Shell |
#!/bin/sh
#
# Copyright (c) 2005 Junio C Hamano
# Copyright (c) 2005 Robert Fitzsimons
#
test_description='git apply test patches with multiple fragments.'
. ./test-lib.sh
cp "$TEST_DIRECTORY/t4109/patch1.patch" .
cp "$TEST_DIRECTORY/t4109/patch2.patch" .
cp "$TEST_DIRECTORY/t4109/patch3.patch" .
cp "$TEST_DIRECTORY... | Shell |
#!/bin/sh
test_description='test separate work tree'
. ./test-lib.sh
test_expect_success 'setup' '
EMPTY_TREE=$(git write-tree) &&
EMPTY_BLOB=$(git hash-object -t blob --stdin </dev/null) &&
CHANGED_BLOB=$(echo changed | git hash-object -t blob --stdin) &&
EMPTY_BLOB7=$(echo $EMPTY_BLOB | sed "s/\(.......\).*/\1/... | Shell |
#!/bin/sh
#
# Copyright (c) 2006 Junio C Hamano
#
test_description='git apply with new style GNU diff with empty context
'
. ./test-lib.sh
test_expect_success setup '
{
echo; echo;
echo A; echo B; echo C;
echo;
} >file1 &&
cat file1 >file1.orig &&
{
cat file1 &&
echo Q | tr -d "\\012"
} >file2 &&
ca... | Shell |
#!/bin/sh
#
# Copyright (c) 2005 Fredrik Kuivinen
#
# See http://marc.theaimsgroup.com/?l=git&m=111463358500362&w=2 for a
# nice description of what this is about.
test_description='Test criss-cross merge'
. ./test-lib.sh
test_expect_success 'prepare repository' \
'echo "1
2
3
4
5
6
7
8
9" > file &&
git add file &&... | Shell |
#!/bin/sh
test_description='miscellaneous rev-list tests'
. ./test-lib.sh
test_expect_success setup '
echo content1 >wanted_file &&
echo content2 >unwanted_file &&
git add wanted_file unwanted_file &&
git commit -m one
'
test_expect_success 'rev-list --objects heeds pathspecs' '
git rev-list --objects HEAD -- ... | Shell |
#!/bin/sh
test_description='unpack-trees error messages'
. ./test-lib.sh
test_expect_success 'setup' '
echo one >one &&
git add one &&
git commit -a -m First &&
git checkout -b branch &&
echo two >two &&
echo three >three &&
echo four >four &&
echo five >five &&
git add two three four five &&
git commit ... | Shell |
#!/bin/sh
test_description='core.whitespace rules and git apply'
. ./test-lib.sh
prepare_test_file () {
# A line that has character X is touched iff RULE is in effect:
# X RULE
# ! trailing-space
# @ space-before-tab
# # indent-with-non-tab (default tab width 8)
# = indent-with-non-tab,tab... | Shell |
#!/bin/sh
test_description='ancestor culling and limiting by parent number'
. ./test-lib.sh
check_revlist () {
rev_list_args="$1" &&
shift &&
git rev-parse "$@" >expect &&
git rev-list $rev_list_args --all >actual &&
test_cmp expect actual
}
test_expect_success setup '
touch file &&
git add file &&
test_c... | Shell |
#!/bin/sh
#
# Copyright (c) 2008 Clemens Buchacher <drizzd@aon.at>
#
test_description='test smart pushing over http via http-backend'
. ./test-lib.sh
if test -n "$NO_CURL"; then
skip_all='skipping test, git built without http support'
test_done
fi
ROOT_PATH="$PWD"
LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5541'}
. "$TEST_D... | Shell |
#!/bin/sh
#
# Copyright (c) 2008 Santhosh Kumar Mani
test_description='git svn can fetch renamed directories'
. ./lib-git-svn.sh
test_expect_success 'load repository with renamed directory' '
svnadmin load -q "$rawsvnrepo" < "$TEST_DIRECTORY"/t9121/renamed-dir.dump
'
test_expect_success 'init and fetch repositor... | Shell |
#!/bin/sh
#
# Copyright (c) 2007 David D. Kilzer
test_description='git svn info'
. ./lib-git-svn.sh
# Tested with: svn, version 1.4.4 (r25188)
# Tested with: svn, version 1.6.[12345689]
v=`svn_cmd --version | sed -n -e 's/^svn, version \(1\.[0-9]*\.[0-9]*\).*$/\1/p'`
case $v in
1.[456].*)
;;
*)
skip_all="skipping ... | Shell |
#!/bin/sh
#
# Copyright (c) 2007 Johannes Sixt
#
test_description='merging symlinks on filesystem w/o symlink support.
This tests that git merge-recursive writes merge results as plain files
if core.symlinks is false.'
. ./test-lib.sh
test_expect_success \
'setup' '
git config core.symlinks false &&
> file &&
git a... | Shell |
#!/bin/sh
#
# Copyright (c) 2005 Junio C Hamano
# Copyright (c) 2005 Robert Fitzsimons
#
test_description='git ls-tree directory and filenames handling.
This test runs git ls-tree with the following in a tree.
1.txt - a file
2.txt - a file
path0/a/b/c/1.txt - a file in a direct... | Shell |
#!/bin/sh
test_description='giving ignored paths to git add'
. ./test-lib.sh
test_expect_success setup '
mkdir sub dir dir/sub &&
echo sub >.gitignore &&
echo ign >>.gitignore &&
for p in . sub dir dir/sub
do
>"$p/ign" &&
>"$p/file" || exit 1
done
'
for i in file dir/file dir 'd*'
do
test_expect_success ... | Shell |
#!/bin/sh
#
# Copyright(C) 2008 Stephen Habermann & Andreas Ericsson
#
test_description='git rebase -p should preserve merges
Run "git rebase -p" and check that merges are properly carried along
'
. ./test-lib.sh
GIT_AUTHOR_EMAIL=bogus_email_address
export GIT_AUTHOR_EMAIL
# Clone 1 (trivial merge):
#
# A1--A2 <-- ... | Shell |
#!/bin/sh
#
# Copyright (c) 2007 Nguyễn Thái Ngọc Duy
#
test_description='Test repository version check'
. ./test-lib.sh
test_expect_success 'setup' '
cat >test.patch <<-\EOF &&
diff --git a/test.txt b/test.txt
new file mode 100644
--- /dev/null
+++ b/test.txt
@@ -0,0 +1 @@
+123
EOF
test_create_repo "test"... | Shell |
#!/bin/sh
test_description='Test notes trees that also contain non-notes'
. ./test-lib.sh
number_of_commits=100
start_note_commit () {
test_tick &&
cat <<INPUT_END
commit refs/notes/commits
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
notes
COMMIT
from refs/notes/commits... | Shell |
#!/bin/sh
#
# Copyright (c) 2010 Matthieu Moy
#
test_description='Test repository with default ACL'
# Create the test repo with restrictive umask
# => this must come before . ./test-lib.sh
umask 077
. ./test-lib.sh
# We need an arbitrary other user give permission to using ACLs. root
# is a good candidate: exists o... | Shell |
#!/bin/sh
test_description='Merge-recursive merging renames'
. ./test-lib.sh
modify () {
sed -e "$1" <"$2" >"$2.x" &&
mv "$2.x" "$2"
}
test_expect_success setup \
'
cat >A <<\EOF &&
a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
c ccccccccccccccccccccccccccccc... | Shell |
#!/bin/sh
test_description='git apply should exit non-zero with unrecognized input.'
. ./test-lib.sh
test_expect_success 'setup' '
test_commit 1
'
test_expect_success 'apply --check exits non-zero with unrecognized input' '
test_must_fail git apply --check - <<-\EOF
I am not a patch
I look nothing like a patch
... | Shell |
#!/bin/sh
#
# Copyright (c) 2005 Junio C Hamano
#
test_description='git checkout-index test.
This test registers the following filesystem structure in the
cache:
path0 - a file
path1/file1 - a file in a directory
And then tries to checkout in a work tree that has the following:
path0/file0 - a fi... | Shell |
#!/bin/sh
# Copyright (c) 2007 Eric Wong
test_description='git svn globbing refspecs'
. ./lib-git-svn.sh
cat > expect.end <<EOF
the end
hi
start a new branch
initial
EOF
test_expect_success 'test refspec globbing' '
mkdir -p trunk/src/a trunk/src/b trunk/doc &&
echo "hello world" > trunk/src/a/readme &&
echo "good... | Shell |
#!/bin/sh
test_description='test cherry-picking many commits'
. ./test-lib.sh
check_head_differs_from() {
! test_cmp_rev HEAD "$1"
}
check_head_equals() {
test_cmp_rev HEAD "$1"
}
test_expect_success setup '
echo first > file1 &&
git add file1 &&
test_tick &&
git commit -m "first" &&
git tag first &&
git ... | Shell |
#!/bin/sh
test_description='git p4 relative chdir'
. ./lib-git-p4.sh
test_expect_success 'start p4d' '
start_p4d
'
test_expect_success 'init depot' '
(
cd "$cli" &&
echo file1 >file1 &&
p4 add file1 &&
p4 submit -d "change 1"
)
'
# P4 reads from P4CONFIG file to find its server params, if the
# environm... | Shell |
#!/bin/sh
test_description='Test git check-ref-format'
. ./test-lib.sh
valid_ref() {
prereq=
case $1 in
[A-Z]*)
prereq=$1
shift
esac
desc="ref name '$1' is valid${2:+ with options $2}"
test_expect_success $prereq "$desc" "
git check-ref-format $2 '$1'
"
}
invalid_ref() {
prereq=
case $1 in
[A-Z]*)
... | Shell |
#!/bin/sh
test_description='ls-files --exclude does not affect index files'
. ./test-lib.sh
test_expect_success 'create repo with file' '
echo content >file &&
git add file &&
git commit -m file &&
echo modification >file
'
check_output() {
test_expect_success "ls-files output contains file ($1)" "
echo '$2' >e... | Shell |
#!/bin/sh
test_description='checkout must not overwrite an untracked objects'
. ./test-lib.sh
test_expect_success 'setup' '
mkdir -p a/b/c &&
>a/b/c/d &&
git add -A &&
git commit -m base &&
git tag start
'
test_expect_success 'create a commit where dir a/b changed to file' '
git checkout -b file &&
rm -rf a... | Shell |
#!/bin/sh
test_description='git svn fetch deleted tag 2'
. ./lib-git-svn.sh
test_expect_success 'setup svn repo' '
mkdir -p import/branches &&
mkdir -p import/tags &&
mkdir -p import/trunk/subdir1 &&
mkdir -p import/trunk/subdir2 &&
mkdir -p import/trunk/subdir3 &&
echo "file1" >import/trunk/subdir1/file &&
e... | Shell |
#!/bin/sh
echo "commit message" >> "$1"
echo "# comment" >> "$1"
exit 0
| Shell |
#!/bin/sh
echo "Signed-off-by: foo <bar@frotz>" >> "$1"
exit 0
| Shell |
#!/bin/sh
echo "# this is a new comment" >> "$1"
echo "# and so is this" >> "$1"
exit 0
| Shell |
#!/bin/sh
sed -e "s/intermediate/edited/g" <"$1" >"$1-"
mv "$1-" "$1"
exit 0
| Shell |
#!/bin/sh
sed -e 's/|$//' >>"$1" <<\EOF
|
commit message |
EOF
exit 0
| Shell |
#!/bin/sh
echo "commit message" >> "$1"
exit 0
| Shell |
#!/bin/sh
test_description='git rebase --continue tests'
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-rebase.sh
set_fake_editor
test_expect_success 'setup' '
test_commit "commit-new-file-F1" F1 1 &&
test_commit "commit-new-file-F2" F2 2 &&
git checkout -b topic HEAD^ &&
test_commit "commit-new-file-F2-on-topic-bra... | Shell |
#!/bin/sh
test_description='test cherry-picking (and reverting) a root commit'
. ./test-lib.sh
test_expect_success setup '
echo first > file1 &&
git add file1 &&
test_tick &&
git commit -m "first" &&
git symbolic-ref HEAD refs/heads/second &&
rm .git/index file1 &&
echo second > file2 &&
git add file2 &&
... | Shell |
#!/bin/sh
test_description='basic checkout-index tests
'
. ./test-lib.sh
test_expect_success 'checkout-index --gobbledegook' '
test_expect_code 129 git checkout-index --gobbledegook 2>err &&
test_i18ngrep "[Uu]sage" err
'
test_expect_success 'checkout-index -h in broken repository' '
mkdir broken &&
(
cd brok... | Shell |
#!/bin/sh
#
# Copyright (c) 2007 Lars Hjemli
#
test_description='Basic porcelain support for submodules
This test tries to verify basic sanity of the init, update and status
subcommands of git submodule.
'
. ./test-lib.sh
test_expect_success 'setup - initial commit' '
>t &&
git add t &&
git commit -m "initial co... | Shell |
#!/bin/sh
test_description=clone
. ./test-lib.sh
test_expect_success setup '
rm -fr .git &&
test_create_repo src &&
(
cd src &&
>file &&
git add file &&
git commit -m initial &&
echo 1 >file &&
git add file &&
git commit -m updated
)
'
test_expect_success 'clone with excess parameters (1)' '
r... | Shell |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.