code
stringlengths
1
1.96M
language
stringclasses
1 value
#!/bin/sh # # Copyright (c) 2006 Brian C Gernhardt # test_description='Format-patch numbering options' . ./test-lib.sh test_expect_success setup ' echo A > file && git add file && git commit -m First && echo B >> file && git commit -a -m Second && echo C >> file && git commit -a -m Third ' # Each of thes...
Shell
#!/bin/sh # # Copyright (c) 2005 Junio C Hamano # test_description='git ls-files test (--others should pick up symlinks). This test runs git ls-files --others with the following on the filesystem. path0 - a file path1 - a symlink path2/file2 - a file in a directory path3-junk - a file to confu...
Shell
#!/bin/sh # # Copyright (c) 2007 Junio C Hamano # test_description='Quoting paths in diff output. ' . ./test-lib.sh P0='pathname' P1='pathname with HT' P2='pathname with SP' P3='pathname with LF' if : 2>/dev/null >"$P1" && test -f "$P1" && rm -f "$P1" then test_set_prereq TABS_IN_FILENAMES else say 'Your filesyste...
Shell
#!/bin/sh # # Copyright (c) 2005 Johannes Schindelin # test_description='Test git rev-parse with different parent options' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-t6000.sh # t6xxx specific functions date >path0 git update-index --add path0 save_tag tree git write-tree hide_error save_tag start unique_commit "start" ...
Shell
#!/bin/sh # # Copyright (c) 2006 Eric Wong # test_description='git apply should not get confused with type changes. ' . ./test-lib.sh test_expect_success SYMLINKS 'setup repository and commits' ' echo "hello world" > foo && echo "hi planet" > bar && git update-index --add foo bar && git commit -m initial && gi...
Shell
#!/bin/sh # Copyright (c) 2006 Eric Wong test_description='git svn metadata migrations from previous versions' . ./lib-git-svn.sh test_expect_success 'setup old-looking metadata' ' cp "$GIT_DIR"/config "$GIT_DIR"/config-old-git-svn && mkdir import && ( cd import && for i in trunk branches/a branches/b tags/0.1 ...
Shell
#!/bin/sh # # Copyright (c) 2005 Johannes Schindelin # test_description='Testing multi_ack pack fetching' . ./test-lib.sh # Test fetch-pack/upload-pack pair. # Some convenience functions add () { name=$1 && text="$@" && branch=`echo $name | sed -e 's/^\(.\).*$/\1/'` && parents="" && shift && while test $1; ...
Shell
. ./test-lib.sh remotes_git_svn=remotes/git""-svn git_svn_id=git""-svn-id if test -n "$NO_SVN_TESTS" then skip_all='skipping git svn tests, NO_SVN_TESTS defined' test_done fi if ! test_have_prereq PERL; then skip_all='skipping git svn tests, perl not available' test_done fi GIT_DIR=$PWD/.git GIT_SVN_DIR=$GIT_DIR...
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 test_description='tracking branch update checks for git push' . ./test-lib.sh test_expect_success 'setup' ' echo 1 >file && git add file && git commit -m 1 && git branch b1 && git branch b2 && git branch b3 && git clone . aa && git checkout b1 && echo b1 >>file && git commit -a -m b1 && git chec...
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 test_description='common tail optimization' . ./test-lib.sh z=zzzzzzzz ;# 8 z="$z$z$z$z$z$z$z$z" ;# 64 z="$z$z$z$z$z$z$z$z" ;# 512 z="$z$z$z$z" ;# 2048 z2047=$(expr "$z" : '.\(.*\)') ; #2047 x=zzzzzzzzzz ;# 10 y="$x$x$x$x$x$x$x$x$x$x" ;# 100 z="$y$y$y$y$y$y$y$y$y$y" ;# 1000 z1000=$z z100=$y z10=$x zs()...
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) 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 test_description='CRLF conversion' . ./test-lib.sh has_cr() { tr '\015' Q <"$1" | grep Q >/dev/null } test_expect_success setup ' git config core.autocrlf false && echo "one text" > .gitattributes && for w in Hello world how are you; do echo $w; done >one && for w in I am very very fine thank you;...
Shell
#!/bin/sh # # Copyright (c) 2007 Johannes Sixt # test_description='git update-index on filesystem w/o symlinks test. This tests that git update-index keeps the symbolic link property even if a plain file is in the working tree if core.symlinks is false.' . ./test-lib.sh test_expect_success \ 'preparation' ' git con...
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) 2005 Junio C Hamano # test_description='git mailinfo and git mailsplit test' . ./test-lib.sh test_expect_success 'split sample box' \ 'git mailsplit -o. "$TEST_DIRECTORY"/t5100/sample.mbox >last && last=`cat last` && echo total is $last && test `cat last` = 16' check_mailinfo () { m...
Shell
#!/bin/sh # # Copyright (c) 2009 Johan Herland # test_description='test git fast-import of notes objects' . ./test-lib.sh test_tick cat >input <<INPUT_END commit refs/heads/master committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT first commit COMMIT M 644 inline foo data <<EOF f...
Shell
#!/bin/sh test_description='test cloning a repository with detached HEAD' . ./test-lib.sh head_is_detached() { git --git-dir=$1/.git rev-parse --verify HEAD && test_must_fail git --git-dir=$1/.git symbolic-ref HEAD } test_expect_success 'setup' ' echo one >file && git add file && git commit -m one && echo two ...
Shell
#!/bin/sh # # Copyright (c) 2005 Amos Waterland # test_description='git rebase assorted tests This test runs git rebase and checks that the author information is not lost among other things. ' . ./test-lib.sh GIT_AUTHOR_NAME=author@name GIT_AUTHOR_EMAIL=bogus@email@address export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL te...
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='merging when a directory was replaced with a symlink' . ./test-lib.sh test_expect_success SYMLINKS 'create a commit where dir a/b changed to symlink' ' mkdir -p a/b/c a/b-2/c && > a/b/c/d && > a/b-2/c/d && > a/x && git add -A && git commit -m base && git tag start && rm -rf a/b && ...
Shell
: included from t2016 and others . ./test-lib.sh set_state () { echo "$3" > "$1" && git add "$1" && echo "$2" > "$1" } save_state () { noslash="$(echo "$1" | tr / _)" && cat "$1" > _worktree_"$noslash" && git show :"$1" > _index_"$noslash" } set_and_save_state () { set_state "$@" && save_state "$1" } verif...
Shell
#!/bin/sh # # Copyright (c) 2009 Ben Jackson # test_description='git svn reset' . ./lib-git-svn.sh test_expect_success 'setup test repository' ' svn_cmd co "$svnrepo" s && ( cd s && mkdir vis && echo always visible > vis/vis.txt && svn_cmd add vis && svn_cmd commit -m "create visible files" && mkdir hid...
Shell
#!/bin/sh test_description='test cherry-picking an empty commit' . ./test-lib.sh test_expect_success setup ' echo first > file1 && git add file1 && test_tick && git commit -m "first" && git checkout -b empty-branch && test_tick && git commit --allow-empty -m "empty" && echo third >> file1 && git add file...
Shell
#!/bin/sh test_description='setup taking and sanitizing funny paths' . ./test-lib.sh test_expect_success setup ' mkdir -p a/b/c a/e && D=$(pwd) && >a/b/c/d && >a/e/f ' test_expect_success 'git add (absolute)' ' git add "$D/a/b/c/d" && git ls-files >current && echo a/b/c/d >expect && test_cmp expect curre...
Shell
#!/bin/sh # # Copyright (c) 2009 Giuseppe Bilotta # test_description='git-apply --ignore-whitespace. ' . ./test-lib.sh # This primes main.c file that indents without using HT at all. # Various patches with HT and other spaces are attempted in the test. cat > patch1.patch <<\EOF diff --git a/main.c b/main.c new file...
Shell
#!/bin/sh # # Copyright (c) 2005 Jon Seymour # test_description='Tests git rev-list --bisect functionality' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-t6000.sh # t6xxx specific functions # usage: test_bisection max-diff bisect-option head ^prune... # # e.g. test_bisection 1 --bisect l1 ^l0 # test_bisection_diff() { _ma...
Shell
#!/bin/sh # # Copyright (c) 2008 Nicolas Pitre # test_description='resilience to pack corruptions with redundant objects' . ./test-lib.sh # Note: the test objects are created with knowledge of their pack encoding # to ensure good code path coverage, and to facilitate direct alteration # later on. The assumed charact...
Shell
#!/bin/sh # # Copyright (c) 2007 Nicolas Pitre # test_description='pack index with 64-bit offsets and object CRC' . ./test-lib.sh test_expect_success \ 'setup' \ 'rm -rf .git && git init && git config pack.threads 1 && i=1 && while test $i -le 100 do iii=`printf '%03i' $i` ...
Shell
#!/bin/sh # # Copyright (c) 2006 Yann Dirson, based on t3400 by Amos Waterland # test_description='git rebase should detect patches integrated upstream This test cherry-picks one local change of two into master branch, and checks that git rebase succeeds with only the second patch in the local branch. ' . ./test-lib....
Shell
#!/bin/sh # # Copyright (c) 2011 David Caldwell # test_description='Test git stash --include-untracked' . ./test-lib.sh test_expect_success 'stash save --include-untracked some dirty working directory' ' echo 1 > file && git add file && test_tick && git commit -m initial && echo 2 > file && git add file && ec...
Shell
#!/bin/sh test_description='git init' . ./test-lib.sh check_config () { if test -d "$1" && test -f "$1/config" && test -d "$1/refs" then : happy else echo "expected a directory $1, a file $1/config and $1/refs" return 1 fi bare=$(GIT_CONFIG="$1/config" git config --bool core.bare) worktree=$(GIT_CONFIG="...
Shell
#!/bin/sh test_description='test local clone' . ./test-lib.sh D=`pwd` test_expect_success 'preparing origin repository' ' : >file && git add . && git commit -m1 && git clone --bare . a.git && git clone --bare . x && test "$(GIT_CONFIG=a.git/config git config --bool core.bare)" = true && test "$(GIT_CONFIG=x/con...
Shell
#!/bin/sh # # Copyright (c) 2007 Santi Béjar, based on t4013 by Junio C Hamano # # test_description='Merge logic in fetch' . ./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 ...
Shell
#!/bin/sh # # Copyright (c) 2005 Junio C Hamano # test_description='Same rename detection as t4003 but testing diff-raw -z. ' . ./test-lib.sh . "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash test_expect_success \ 'prepare reference tree' \ 'cat "$TEST_DIRECTORY"/../COPYING >COPYING && echo...
Shell
#!/bin/sh # A description of the repository used for this test can be found in # t9602/README. test_description='git cvsimport handling of branches and tags' . ./lib-cvs.sh setup_cvs_test_repository t9602 test_expect_success PERL 'import module' ' git cvsimport -C module-git module ' test_expect_success PERL 't...
Shell
#!/bin/sh # # Copyright (c) 2008 Eric Wong # test_description='git svn authors file tests' . ./lib-git-svn.sh cat > svn-authors <<EOF aa = AAAAAAA AAAAAAA <aa@example.com> bb = BBBBBBB BBBBBBB <bb@example.com> EOF test_expect_success 'setup svnrepo' ' for i in aa bb cc dd do svn_cmd mkdir -m $i --username $i "$...
Shell
#!/bin/sh test_description='fetch follows remote-tracking branches correctly' . ./test-lib.sh test_expect_success setup ' >file && git add . && test_tick && git commit -m Initial && git branch b-0 && git branch b1 && git branch b/one && test_create_repo other && ( cd other && git config remote.origin.ur...
Shell
#!/bin/sh test_description='signals work as we expect' . ./test-lib.sh cat >expect <<EOF three two one EOF test_expect_success 'sigchain works' ' test-sigchain >actual case "$?" in 143) true ;; # POSIX w/ SIGTERM=15 271) true ;; # ksh w/ SIGTERM=15 3) true ;; # Windows *) false ;; esac && test_cmp expect...
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 # # Copyright (c) 2008 Jan Krüger # test_description='git svn respects rewriteRoot during rebuild' . ./lib-git-svn.sh mkdir import (cd import touch foo svn_cmd import -m 'import for git svn' . "$svnrepo" >/dev/null ) rm -rf import test_expect_success 'init, fetch and checkout repository' ' git svn init...
Shell
#!/bin/sh # # Copyright (c) 2005 Junio C Hamano # Copyright (c) 2005 Robert Fitzsimons # test_description='git apply test for patches which require scanning forwards and backwards. ' . ./test-lib.sh test_expect_success 'git apply scan' ' git apply \ "$TEST_DIRECTORY/t4110/patch1.patch" \ "$TEST_DIRECTORY/t4110/...
Shell
#!/bin/sh # # Copyright (c) 2009, Junio C Hamano # test_description='log family learns --stdin' . ./test-lib.sh check () { for cmd in rev-list "log --stat" do for i in "$@" do printf "%s\n" $i done >input && test_expect_success "check $cmd $*" ' git $cmd $(cat input) >expect && git $cmd --stdin <i...
Shell
#!/bin/sh test_description='rebasing a commit with multi-line first paragraph.' . ./test-lib.sh test_expect_success setup ' >file && git add file && test_tick && git commit -m initial && echo hello >file && test_tick && git commit -a -m "A sample commit log message that has a long summary that spills over m...
Shell
#!/bin/sh # # Copyright (c) 2005 Junio C Hamano # test_description='Three way merge with read-tree -m This test tries three-way merge with read-tree -m There is one ancestor (called O for Original) and two branches A and B derived from it. We want to do a 3-way merge between A and B, using O as the common ancestor....
Shell
#!/bin/sh test_description='format-patch mime headers and extra headers do not conflict' . ./test-lib.sh test_expect_success 'create commit with utf-8 body' ' echo content >file && git add file && git commit -m one && echo more >>file && git commit -a -m "two utf-8 body: ñ" ' test_expect_success 'patch has mi...
Shell
#!/bin/sh test_description='git fsck random collection of tests * (HEAD) B * (master) A ' . ./test-lib.sh test_expect_success setup ' git config gc.auto 0 && git config i18n.commitencoding ISO-8859-1 && test_commit A fileA one && git config --unset i18n.commitencoding && git checkout HEAD^0 && test_commit B f...
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 # # 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) 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 test_description='checkout $tree -- $paths' . ./test-lib.sh test_expect_success setup ' mkdir dir && >dir/master && echo common >dir/common && git add dir/master dir/common && test_tick && git commit -m "master has dir/master" && git checkout -b next && git mv dir/master dir/next0 && echo next >dir/...
Shell
#!/bin/sh test_description='merge-recursive backend test' . ./test-lib.sh test_expect_success 'setup 1' ' echo hello >a && o0=$(git hash-object a) && cp a b && cp a c && mkdir d && cp a d/e && test_tick && git add a b c d/e && git commit -m initial && c0=$(git rev-parse --verify HEAD) && git branch side...
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=gitattributes . ./test-lib.sh attr_check () { path="$1" expect="$2" git check-attr test -- "$path" >actual 2>err && echo "$path: test: $2" >expect && test_cmp expect actual && test_line_count = 0 err } test_expect_success 'setup' ' mkdir -p a/b/d a/c b && ( echo "[attr]notest !...
Shell
#!/bin/sh # # Copyright (c) 2005 Junio C Hamano # test_description='See why rewinding head breaks send-pack ' . ./test-lib.sh cnt=64 test_expect_success setup ' test_tick && mkdir mozart mozart/is && echo "Commit #0" >mozart/is/pink && git update-index --add mozart/is/pink && tree=$(git write-tree) && commit=$...
Shell
#!/bin/sh # # Copyright (c) 2010 Steven Walter # test_description='git svn merge detection' . ./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 'initialize source svn repo' ' svn_cm...
Shell
#!/bin/sh # # Copyright (c) 2007 Johannes E. Schindelin # test_description='Test commit notes index (expensive!)' . ./test-lib.sh test_set_prereq NOT_EXPENSIVE test -n "$GIT_NOTES_TIMING_TESTS" && test_set_prereq EXPENSIVE test -x /usr/bin/time && test_set_prereq USR_BIN_TIME create_repo () { number_of_commits=$1 ...
Shell
#!/bin/sh test_description='git merge Testing the resolve strategy.' . ./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 c2.c ...
Shell
#!/bin/sh test_description='prepare-commit-msg hook' . ./test-lib.sh test_expect_success 'with no hook' ' echo "foo" > file && git add file && git commit -m "first" ' # set up fake editor for interactive editing cat > fake-editor <<'EOF' #!/bin/sh exit 0 EOF chmod +x fake-editor ## Not using test_set_editor h...
Shell
#!/bin/sh # # Copyright (c) 2005 Junio C Hamano # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # # This program is di...
Shell
#!/bin/sh test_description='pulling into void' . ./test-lib.sh modify () { sed -e "$1" <"$2" >"$2.x" && mv "$2.x" "$2" } D=`pwd` test_expect_success setup ' echo file >file && git add file && git commit -a -m original ' test_expect_success 'pulling into void' ' mkdir cloned && cd cloned && git init && ...
Shell
#!/bin/sh test_description='git apply --numstat - <patch' . ./test-lib.sh test_expect_success setup ' echo hello >text && git add text && echo goodbye >text && git diff >patch ' test_expect_success 'git apply --numstat - < patch' ' echo "1 1 text" >expect && git apply --numstat - <patch >actual && test_cmp e...
Shell
#!/bin/sh test_description='applying patch that has broken whitespaces in context' . ./test-lib.sh test_expect_success setup ' >file && git add file && # file-0 is full of whitespace breakages for l in a bb c d eeee f ggg h do echo "$l " done >file-0 && # patch-0 creates a whitespace broken file cat fil...
Shell
#!/bin/sh # # Copyright (c) 2005 Junio C Hamano # test_description='Break and then rename We have two very different files, file0 and file1, registered in a tree. We update file1 so drastically that it is more similar to file0, and then remove file0. With -B, changes to file1 should be broken into separate delete a...
Shell
#!/bin/sh test_description='RCS merge replacement: merge-file' . ./test-lib.sh cat > orig.txt << EOF Dominus regit me, et nihil mihi deerit. In loco pascuae ibi me collocavit, super aquam refectionis educavit me; animam meam convertit, deduxit me super semitas jusitiae, propter nomen suum. EOF cat > new1.txt << EOF ...
Shell
#!/bin/sh test_description='check problems with relative GIT_DIR This test creates a working tree state with a file and subdir: top (committed several times) subdir (a subdirectory) It creates a commit-hook and tests it, then moves .git into the subdir while keeping the worktree location, and tries commits from...
Shell
#!/bin/sh test_description='rev-list/rev-parse --glob' . ./test-lib.sh commit () { test_tick && echo $1 > foo && git add foo && git commit -m "$1" } compare () { # Split arguments on whitespace. git $1 $2 >expected && git $1 $3 >actual && test_cmp expected actual } test_expect_success 'setup' ' commit ma...
Shell
#!/bin/sh # # Copyright (c) 2007 Carlos Rica # test_description='git reset Documented tests for git reset' . ./test-lib.sh test_expect_success 'creating initial files and commits' ' test_tick && echo "1st file" >first && git add first && git commit -m "create 1st file" && echo "2nd file" >second && git add s...
Shell
#!/bin/sh # # Copyright (c) 2006 Eric Wong # test_description='git svn basic tests' GIT_SVN_LC_ALL=${LC_ALL:-$LANG} . ./lib-git-svn.sh say 'define NO_SVN_TESTS to skip git svn tests' case "$GIT_SVN_LC_ALL" in *.UTF-8) test_set_prereq UTF8 ;; *) say "# UTF-8 locale not set, some tests skipped ($GIT_SVN_LC_ALL)" ...
Shell
#!/bin/sh # # Copyright (c) 2010 Johan Herland # test_description='Test notes merging with auto-resolving strategies' . ./test-lib.sh # Set up a notes merge scenario with all kinds of potential conflicts test_expect_success 'setup commits' ' test_commit 1st && test_commit 2nd && test_commit 3rd && test_commit 4t...
Shell
#!/bin/sh test_description='git status for submodule' . ./test-lib.sh test_create_repo_with_commit () { test_create_repo "$1" && ( cd "$1" && : >bar && git add bar && git commit -m " Add bar" && : >foo && git add foo && git commit -m " Add foo" ) } test_expect_success 'setup' ' test_create_repo_wi...
Shell
#!/bin/sh test_description='Intent to add' . ./test-lib.sh test_expect_success 'intent to add' ' echo hello >file && echo hello >elif && git add -N file && git add elif ' test_expect_success 'check result of "add -N"' ' git ls-files -s file >actual && empty=$(git hash-object --stdin </dev/null) && echo "1006...
Shell
#!/bin/sh # # Copyright (c) 2007 Johannes Schindelin # test_description='our own option parser' . ./test-lib.sh cat > expect << EOF usage: test-parse-options <options> -b, --boolean get a boolean -4, --or4 bitwise-or boolean with ...0100 --neg-or4 same as --no-or4 -i...
Shell
#!/bin/sh test_description='test that git handles an svn repository with empty symlinks' . ./lib-git-svn.sh test_expect_success 'load svn dumpfile' ' svnadmin load "$rawsvnrepo" <<EOF SVN-fs-dump-format-version: 2 UUID: 60780f9a-7df5-43b4-83ab-60e2c0673ef7 Revision-number: 0 Prop-content-length: 56 Content-length:...
Shell
#!/bin/sh test_description='fetch/receive strict mode' . ./test-lib.sh test_expect_success setup ' echo hello >greetings && git add greetings && git commit -m greetings && S=$(git rev-parse :greetings | sed -e "s|^..|&/|") && X=$(echo bye | git hash-object -w --stdin | sed -e "s|^..|&/|") && mv -f .git/objects...
Shell
#!/bin/sh test_description='forced push to replace commit we do not have' . ./test-lib.sh test_expect_success setup ' >file1 && git add file1 && test_tick && git commit -m Initial && git config receive.denyCurrentBranch warn && mkdir another && ( cd another && git init && git fetch --update-head-ok .. ma...
Shell
#!/bin/sh test_description='Test Git when git repository is located at root This test requires write access in root. Do not bother if you do not have a throwaway chroot or VM. Script t1509/prepare-chroot.sh may help you setup chroot, then you can chroot in and execute this test from there. ' . ./test-lib.sh test_c...
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) 2005 Junio C Hamano # test_description='git checkout-index -u test. With -u flag, git checkout-index internally runs the equivalent of git update-index --refresh on the checked out entry.' . ./test-lib.sh test_expect_success \ 'preparation' ' echo frotz >path0 && git update-index --add p...
Shell
#!/bin/sh test_description='Test git check-ref-format' . ./test-lib.sh valid_ref() { if test "$#" = 1 then test_expect_success "ref name '$1' is valid" \ "git check-ref-format '$1'" else test_expect_success "ref name '$1' is valid with options $2" \ "git check-ref-format $2 '$1'" fi } invalid_ref() { ...
Shell
#!/bin/sh test_description='messages from rebase operation' . ./test-lib.sh quick_one () { echo "$1" >"file$1" && git add "file$1" && test_tick && git commit -m "$1" } test_expect_success setup ' quick_one O && git branch topic && quick_one X && quick_one A && quick_one B && quick_one Y && git checkout ...
Shell
#!/bin/sh # # Copyright (c) 2005 Junio C Hamano # test_description='Test mode change diffs. ' . ./test-lib.sh test_expect_success \ 'setup' \ 'echo frotz >rezrov && git update-index --add rezrov && tree=`git write-tree` && echo $tree' test_expect_success \ 'chmod' \ 'test_chmod +x rez...
Shell
#!/bin/sh # # Copyright (c) 2007 Johannes Sixt # test_description='git checkout-index on filesystem w/o symlinks test. This tests that git checkout-index creates a symbolic link as a plain file if core.symlinks is false.' . ./test-lib.sh test_expect_success \ 'preparation' ' git config core.symlinks false && l=$(pr...
Shell
#!/bin/sh test_description='git rebase --root Tests if git rebase --root --onto <newparent> can rebase the root commit. ' . ./test-lib.sh log_with_names () { git rev-list --topo-order --parents --pretty="tformat:%s" HEAD | git name-rev --stdin --name-only --refs=refs/heads/$1 } test_expect_success 'prepare repos...
Shell
#!/bin/sh test_description='some bundle related tests' . ./test-lib.sh test_expect_success 'setup' ' : > file && git add file && test_tick && git commit -m initial && test_tick && git tag -m tag tag && : > file2 && git add file2 && : > file3 && test_tick && git commit -m second && git add file3 && test_...
Shell
#!/bin/sh # # Copyright (c) 2005 Junio C Hamano # test_description='Test the very basics part #1. The rest of the test suite does not check the basic operation of git plumbing commands to work very carefully. Their job is to concentrate on tricky features that caused bugs in the past to detect regression. This test...
Shell
#!/bin/sh test_description='test dumb fetching over http via static file' . ./test-lib.sh if test -n "$NO_CURL"; then skip_all='skipping test, git built without http support' test_done fi . "$TEST_DIRECTORY"/lib-httpd.sh LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5550'} start_httpd test_expect_success 'setup repository' ' ...
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 # # Copyright (c) 2009 Eric Wong # test_description='git svn property tests' . ./lib-git-svn.sh test_expect_success 'setup repo with a git repo inside it' ' svn_cmd co "$svnrepo" s && ( cd s && git init && test -f .git/HEAD && > .git/a && echo a > a && svn_cmd add .git a && svn_cmd commit -m...
Shell
#!/bin/sh test_description='operations that cull histories in unusual ways' . ./test-lib.sh test_expect_success setup ' test_commit A && test_commit B && test_commit C && git checkout -b side HEAD^ && test_commit D && test_commit E && git merge master ' test_expect_success 'rev-list --first-parent --boundary'...
Shell
#!/bin/sh # # Copyright (c) 2006 Junio C Hamano # test_description='git rebase --merge test' . ./test-lib.sh T="A quick brown fox jumps over the lazy dog." for i in 1 2 3 4 5 6 7 8 9 10 do echo "$i $T" done >original test_expect_success setup ' git add original && git commit -m"initial" && git branch side && e...
Shell
#!/bin/sh test_description='cherry-pick should rerere for conflicts' . ./test-lib.sh test_expect_success setup ' echo foo >foo && git add foo && test_tick && git commit -q -m 1 && echo foo-master >foo && git add foo && test_tick && git commit -q -m 2 && git checkout -b dev HEAD^ && echo foo-dev >foo && git a...
Shell
#!/bin/sh test_description='fetch/push involving ref namespaces' . ./test-lib.sh test_expect_success setup ' test_tick && git init original && ( cd original && echo 0 >count && git add count && test_commit 0 && echo 1 >count && git add count && test_commit 1 && git remote add pushee-namespaced "ext...
Shell
#!/bin/sh # # Copyright (c) 2009 Eric Wong # test_description='git svn initial master branch is "trunk" if possible' . ./lib-git-svn.sh test_expect_success 'setup test repository' ' mkdir i && > i/a && svn_cmd import -m trunk i "$svnrepo/trunk" && svn_cmd import -m b/a i "$svnrepo/branches/a" && svn_cmd import -m...
Shell
#!/bin/sh test_description='check infrastructure for svn importer' . ./test-lib.sh uint32_max=4294967295 test_expect_success 'obj pool: store data' ' cat <<-\EOF >expected && 0 1 EOF test-obj-pool <<-\EOF >actual && alloc one 16 set one 13 test one 13 reset one EOF test_cmp expected actual ' test_expect...
Shell
#!/bin/sh test_description='basic git merge-index / git-merge-one-file tests' . ./test-lib.sh test_expect_success 'setup diverging branches' ' for i in 1 2 3 4 5 6 7 8 9 10; do echo $i done >file && git add file && git commit -m base && git tag base && sed s/2/two/ <file >tmp && mv tmp file && git commit -a...
Shell
#!/bin/sh # # Copyright (c) 2008 Clemens Buchacher <drizzd@aon.at> # if test -z "$GIT_TEST_HTTPD" then skip_all="Network testing disabled (define GIT_TEST_HTTPD to enable)" test_done fi HTTPD_PARA="" for DEFAULT_HTTPD_PATH in '/usr/sbin/httpd' '/usr/sbin/apache2' do if test -x "$DEFAULT_HTTPD_PATH" then break ...
Shell
#!/bin/sh # # Copyright (c) 2005 Junio C Hamano # test_description='git ls-files --others --exclude This test runs git ls-files --others and tests --exclude patterns. ' . ./test-lib.sh rm -fr one three for dir in . one one/two three do mkdir -p $dir && for i in 1 2 3 4 5 6 7 8 do >$dir/a.$i done done >"...
Shell