code
stringlengths
1
1.96M
language
stringclasses
1 value
#!/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 p4 client view' . ./lib-git-p4.sh test_expect_success 'start p4d' ' start_p4d ' # # Construct a client with this list of View lines # client_view() { ( cat <<-EOF && Client: client Description: client Root: $cli View: EOF for arg ; do printf "\t$arg\n" done ) | ...
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) 2012 Felipe Contreras # if test -n "$BASH" && test -z "$POSIXLY_CORRECT"; then # we are in full-on bash mode true elif type bash >/dev/null 2>&1; then # execute in full-on bash mode unset POSIXLY_CORRECT exec bash "$0" "$@" else echo '1..0 #SKIP skipping bash completion tests; bash no...
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) 2010 Ævar Arnfjörð Bjarmason # test_description='Perl gettext interface (Git::I18N)' . ./lib-gettext.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 ...
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='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='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 $3 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]notes...
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 # Try a set of credential helpers; the expected stdin, # stdout and stderr should be provided on stdin, # separated by "--". check() { read_chunk >stdin && read_chunk >expect-stdout && read_chunk >expect-stderr && test-credential "$@" <stdin >stdout 2>stderr && test_cmp expect-stdout stdout && test_cmp...
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 if test -z "$GIT_TEST_GIT_DAEMON" then skip_all="git-daemon testing disabled (define GIT_TEST_GIT_DAEMON to enable)" test_done fi LIB_GIT_DAEMON_PORT=${LIB_GIT_DAEMON_PORT-'8121'} GIT_DAEMON_PID= GIT_DAEMON_DOCUMENT_ROOT_PATH="$PWD"/repo GIT_DAEMON_URL=git://127.0.0.1:$LIB_GIT_DAEMON_PORT start_git_daem...
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> --yes get a boolean -D, --no-doubt begins with 'no-' -B, --no-fear be brave -b, --boolean inc...
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='git p4 tests for p4 branches' . ./lib-git-p4.sh test_expect_success 'start p4d' ' start_p4d ' # # 1: //depot/main/f1 # 2: //depot/main/f2 # 3: integrate //depot/main/... -> //depot/branch1/... # 4: //depot/main/f4 # 5: //depot/branch1/f5 # .: named branch branch2 # 6: integrate -b branc...
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 test_expect_success $prereq "ref name '$1' is valid${2:+ with options $2}" " git check-ref-format $2 '$1' " } invalid_ref() { prereq= case $1 in [A-Z]*) prereq=$1 sh...
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' ' 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 # 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 LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5550'} . "$TEST_DIRECTORY"/lib-httpd.sh 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='git p4 transparency to shell metachars in filenames' . ./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 "file1" ) ' test_expect_success 'shell metachars in filenam...
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='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
#!/bin/sh test_description='Test cherry-pick with directory/file conflicts' . ./test-lib.sh test_expect_success 'Initialize repository' ' mkdir a && >a/f && git add a && git commit -m a ' test_expect_success SYMLINKS 'Setup rename across paths each below D/F conflicts' ' mkdir b && ln -s ../a b/a && git add b...
Shell
#!/bin/sh # # Copyright (c) 2010 Johan Herland # test_description='Test merging of notes trees' . ./test-lib.sh test_expect_success setup ' test_commit 1st && test_commit 2nd && test_commit 3rd && test_commit 4th && test_commit 5th && # Create notes on 4 first commits git config core.notesRef refs/notes/x && ...
Shell
#!/bin/sh # # Copyright (c) 2006 Eric Wong test_description='git svn commit-diff' . ./lib-git-svn.sh test_expect_success 'initialize repo' ' mkdir import && ( cd import && echo hello >readme && svn_cmd import -m "initial" . "$svnrepo" ) && echo hello > readme && git update-index --add readme && git commit ...
Shell
#!/bin/sh test_description='git rebase --onto A...B' . ./test-lib.sh . "$TEST_DIRECTORY/lib-rebase.sh" # Rebase only the tip commit of "topic" on merge base between "master" # and "topic". Cannot do this for "side" with "master" because there # is no single merge base. # # # F---G topic ...
Shell
#!/bin/sh # There's more than one "correct" way to represent the history graphically. # These tests depend on the current behavior of the graphing code. If the # graphing code is ever changed to draw the output differently, these tests # cases will need to be updated to know about the new layout. test_description='-...
Shell
#!/bin/sh # # Copyright (c) 2006 Eric Wong # test_description='git svn property tests' . ./lib-git-svn.sh mkdir import a_crlf= a_lf= a_cr= a_ne_crlf= a_ne_lf= a_ne_cr= a_empty= a_empty_lf= a_empty_cr= a_empty_crlf= cd import cat >> kw.c <<\EOF /* Somebody prematurely put a keyword into this file */ /* $Id$ */ EOF ...
Shell
#!/bin/sh . ./test-lib.sh unset CVS_SERVER if ! type cvs >/dev/null 2>&1 then skip_all='skipping cvsimport tests, cvs not found' test_done fi CVS="cvs -f" export CVS cvsps_version=`cvsps -h 2>&1 | sed -ne 's/cvsps version //p'` case "$cvsps_version" in 2.1 | 2.2*) ;; '') skip_all='skipping cvsimport tests, cvs...
Shell
#!/bin/sh test_description='recursive merge corner cases involving criss-cross merges' . ./test-lib.sh get_clean_checkout () { git reset --hard && git clean -fdqx && git checkout "$1" } # # L1 L2 # o---o # / \ / \ # o X ? # \ / \ / # o---o # R1 R2 # test_expect_success 'setup basic criss-cross + r...
Shell
#!/bin/sh test_description='git show' . ./test-lib.sh test_expect_success setup ' echo hello world >foo && H=$(git hash-object -w foo) && git tag -a foo-tag -m "Tags $H" $H && HH=$(expr "$H" : "\(..\)") && H38=$(expr "$H" : "..\(.*\)") && rm -f .git/objects/$HH/$H38 ' test_expect_success 'showing a tag that p...
Shell
#!/bin/sh # # Copyright (c) 2006 Junio C Hamano # test_description='Binary diff and apply ' . ./test-lib.sh cat >expect.binary-numstat <<\EOF 1 1 a - - b 1 1 c - - d EOF test_expect_success 'prepare repository' \ 'echo AIT >a && echo BIT >b && echo CIT >c && echo DIT >d && git update-index --add a b c d && ech...
Shell
#!/bin/sh test_description='Revision traversal vs grafts and path limiter' . ./test-lib.sh test_expect_success setup ' mkdir subdir && echo >fileA fileA && echo >subdir/fileB fileB && git add fileA subdir/fileB && git commit -a -m "Initial in one history." && A0=`git rev-parse --verify HEAD` && echo >fileA f...
Shell
#!/bin/sh test_description='rewrite diff' . ./test-lib.sh test_expect_success setup ' cat "$TEST_DIRECTORY"/../COPYING >test && git add test && tr \ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" \ "nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM" \ <"$TEST_DIRECTORY"/../COPYING >test && e...
Shell
#!/bin/sh # # Copyright (c) 2006 Junio C Hamano # test_description='git grep various. ' . ./test-lib.sh cat >hello.c <<EOF #include <stdio.h> int main(int argc, const char **argv) { printf("Hello world.\n"); return 0; /* char ?? */ } EOF test_expect_success setup ' { echo foo mmap bar echo foo_mmap bar ec...
Shell
#!/bin/sh test_description='git rev-list trivial path optimization test d/z1 b0 b1 o------------------------*----o master / / o---------o----o----o----o side a0 c0 c1 a1 c2 d/f0 d/f1 d/z0 ' . ./test-lib.sh test_expect_success setup...
Shell
#!/bin/sh test_description='git filter-branch' . ./test-lib.sh test_expect_success 'setup' ' test_commit A && test_commit B && git checkout -b branch B && test_commit D && mkdir dir && test_commit dir/D && test_commit E && git checkout master && test_commit C && git checkout branch && git merge C && git t...
Shell
#!/bin/sh test_description='test git-http-backend' . ./test-lib.sh if test -n "$NO_CURL"; then skip_all='skipping test, git built without http support' test_done fi LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5561'} . "$TEST_DIRECTORY"/lib-httpd.sh start_httpd GET() { curl --include "$HTTPD_URL/$SMART/repo.git/$1" >out 2>/...
Shell
#!/bin/sh # Structure of the test cvs repository # # Message File:Content Commit Time # Rev 1 a: 1.1 2009-02-21 19:11:43 +0100 # Rev 2 a: 1.2 b: 1.1 2009-02-21 19:11:14 +0100 # Rev 3 b: 1.2 2009-02-21 19:11:43 +0100 # # As you can see the commit of Rev 3 has the...
Shell
#!/bin/sh test_description='apply with fuzz and offset' . ./test-lib.sh dotest () { name="$1" && shift && test_expect_success "$name" " git checkout-index -f -q -u file && git apply $* && test_cmp expect file " } test_expect_success setup ' for i in 1 2 3 4 5 6 7 8 9 10 11 12 do echo $i done >file &&...
Shell
#!/bin/sh test_description='Return value of diffs' . ./test-lib.sh test_expect_success 'setup' ' echo "1 " >a && git add . && git commit -m zeroth && echo 1 >a && git add . && git commit -m first && echo 2 >b && git add . && git commit -a -m second ' test_expect_success 'git diff --quiet -w HEAD^^ HEAD^' ...
Shell
#!/bin/sh test_description='test read-tree into a fresh index file' . ./test-lib.sh test_expect_success setup ' echo one >a && git add a && git commit -m initial ' test_expect_success 'non-existent index file' ' rm -f new-index && GIT_INDEX_FILE=new-index git read-tree master ' test_expect_success 'empty inde...
Shell
#!/bin/sh test_description='test conversion filters on large files' . ./test-lib.sh set_attr() { test_when_finished 'rm -f .gitattributes' && echo "* $*" >.gitattributes } check_input() { git read-tree --empty && git add small large && git cat-file blob :small >small.index && git cat-file blob :large | head -n...
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 test_description='git p4 filetype tests' . ./lib-git-p4.sh test_expect_success 'start p4d' ' start_p4d ' test_expect_success 'utf-16 file create' ' ( cd "$cli" && # p4 saves this verbatim printf "three\nline\ntext\n" >f-ascii && p4 add -t text f-ascii && # p4 adds \377\376 header cp f-asci...
Shell
#!/bin/sh # # Copyright (c) 2007 Johannes E. Schindelin # test_description='git rev-list involving submodules that this repo has' . ./test-lib.sh test_expect_success 'setup' ' : > file && git add file && test_tick && git commit -m initial && echo 1 > file && test_tick && git commit -m second file && echo 2 >...
Shell
#!/bin/sh test_description='diff with assume-unchanged entries' . ./test-lib.sh # external diff has been tested in t4020-diff-external.sh test_expect_success 'setup' ' echo zero > zero && git add zero && git commit -m zero && echo one > one && echo two > two && git add one two && git commit -m onetwo && git...
Shell