code
stringlengths
1
1.96M
language
stringclasses
1 value
#!/bin/sh test_description='git am running' . ./test-lib.sh test_expect_success 'setup: messages' ' cat >msg <<-\EOF && second Lorem ipsum dolor sit amet, consectetuer sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et ...
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='blame output in various formats on a simple case' . ./test-lib.sh test_expect_success 'setup' ' echo a >file && git add file test_tick && git commit -m one && echo b >>file && echo c >>file && echo d >>file && test_tick && git commit -a -m two ' cat >expect <<'EOF' ^baf5e0b (A U ...
Shell
#!/bin/sh test_description='git p4 tests' . ./lib-git-p4.sh test_expect_success 'start p4d' ' start_p4d ' test_expect_success 'add p4 files' ' ( cd "$cli" && echo file1 >file1 && p4 add file1 && p4 submit -d "file1" && echo file2 >file2 && p4 add file2 && p4 submit -d "file2" ) ' test_expect_succe...
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='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 # # Copyright (c) 2010 Jakub Narebski, Christian Couder # test_description='Move a binary file' . ./test-lib.sh test_expect_success 'prepare repository' ' git init && echo foo > foo && echo "barQ" | q_to_nul > bar && git add . && git commit -m "Initial commit" ' test_expect_success 'move the files i...
Shell
#!/bin/sh test_description='test git rev-list --cherry-pick -- file' . ./test-lib.sh # A---B---D---F # \ # \ # C---E # # B changes a file foo.c, adding a line of text. C changes foo.c as # well as bar.c, but the change in foo.c was identical to change B. # D and C change bar in the same way, E and F different...
Shell
#!/bin/sh test_description='--show-all --parents does not rewrite TREESAME commits' . ./test-lib.sh test_expect_success 'set up --show-all --parents test' ' test_commit one foo.txt && commit1=`git rev-list -1 HEAD` && test_commit two bar.txt && commit2=`git rev-list -1 HEAD` && test_commit three foo.txt && com...
Shell
#!/bin/sh test_description='respect crlf in git archive' . ./test-lib.sh test_expect_success setup ' git config core.autocrlf true && printf "CRLF line ending\r\nAnd another\r\n" > sample && git add sample && test_tick && git commit -m Initial ' test_expect_success 'tar archive' ' git archive --format=ta...
Shell
#!/bin/sh test_description='checkout into detached HEAD state' . ./test-lib.sh check_detached () { test_must_fail git symbolic-ref -q HEAD >/dev/null } check_not_detached () { git symbolic-ref -q HEAD >/dev/null } PREV_HEAD_DESC='Previous HEAD position was' check_orphan_warning() { test_i18ngrep "you are leaving...
Shell
#!/bin/sh # # Copyright (c) 2006 Yann Dirson, based on t3400 by Amos Waterland # test_description='git cherry should detect patches integrated upstream This test cherry-picks one local change of two into master branch, and checks that git cherry only returns the second patch in the local branch ' . ./test-lib.sh GIT...
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='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 do_filename() { desc=$1 postimage=$2 rm -fr file-creation && git init file-creation && ( cd file-creation && git commit --allow-empty -m init && echo postimage >"$postimage" && git add -N "$postimage" && git diff HEAD >"../git-$desc.diff" ) && rm -fr trad-modification && mkdir trad-modifi...
Shell
#!/bin/sh test_description='test describe B .--------------o----o----o----x / / / o----o----o----o----o----. / \ A c / .------------o---o---o D,R e ' . ./test-lib.sh check_describe () { expect="$1" s...
Shell
#!/bin/sh test_description='checkout can switch to last branch and merge base' . ./test-lib.sh test_expect_success 'setup' ' echo hello >world && git add world && git commit -m initial && git branch other && echo "hello again" >>world && git add world && git commit -m second ' test_expect_success '"checkout ...
Shell
#!/bin/sh test_description='diff whitespace error detection' . ./test-lib.sh test_expect_success setup ' git config diff.color.whitespace "blue reverse" && >F && git add F && echo " Eight SP indent" >>F && echo " HT and SP indent" >>F && echo "With trailing SP " >>F && echo "Carriage ReturnQ" | tr Q...
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 # # Copyright (c) 2005 Junio C Hamano # test_description='git apply handling copy/rename patch. ' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh # setup cat >test-patch <<\EOF diff --git a/foo b/bar similarity index 47% rename from foo rename to bar --- a/foo +++ b/bar @@ -1 +1 @@ -This is foo...
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) 2006 Eric Wong test_description='git svn commit-diff clobber' . ./lib-git-svn.sh test_expect_success 'initialize repo' ' mkdir import && ( cd import && echo initial >file && svn_cmd import -m "initial" . "$svnrepo" ) && echo initial > file && git update-index --add file && git c...
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
# This is a phony Shell program that's only here to test xgettext # message extraction # so the above comment won't be folded into the next one by xgettext echo # TRANSLATORS: This is a test. You don't need to translate it. gettext "TEST: A Shell test string" # TRANSLATORS: This is a test. You don't need to translat...
Shell
#!/bin/sh test_description=' Miscellaneous tests for git ls-tree. 1. git ls-tree fails in presence of tree damage. ' . ./test-lib.sh test_expect_success 'setup' ' mkdir a && touch a/one && git add a/one && git commit -m test ' test_expect_success 'ls-tree fails with non-zero exit code on broken tree' '...
Shell
#!/bin/sh # # Copyright (c) 2010 Ævar Arnfjörð Bjarmason # test_description='Gettext Shell fallbacks' GIT_INTERNAL_GETTEXT_TEST_FALLBACKS=YesPlease export GIT_INTERNAL_GETTEXT_TEST_FALLBACKS . ./lib-gettext.sh test_expect_success "sanity: \$GIT_INTERNAL_GETTEXT_SH_SCHEME is set (to $GIT_INTERNAL_GETTEXT_SH_SCHEME)"...
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='git rebase - test patch id computation' . ./test-lib.sh test_set_prereq NOT_EXPENSIVE test -n "$GIT_PATCHID_TIMING_TESTS" && test_set_prereq EXPENSIVE test -x /usr/bin/time && test_set_prereq USR_BIN_TIME count() { i=0 while test $i -lt $1 do echo "$i" i=$(($i+1)) done } scrambl...
Shell
#!/bin/sh test_description='read-tree -m -u checks working tree files' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-read-tree.sh # two-tree test test_expect_success 'two-way setup' ' mkdir subdir && echo >file1 file one && echo >file2 file two && echo >subdir/file1 file one in subdirectory && echo >subdir/file2 fi...
Shell
#!/bin/sh test_description='git send-email' . ./test-lib.sh # May be altered later in the test PREREQ="PERL" test_expect_success $PREREQ \ 'prepare reference tree' \ 'echo "1A quick brown fox jumps over the" >file && echo "lazy dog" >>file && git add file && GIT_AUTHOR_NAME="A" git commit -a -...
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 test_description='git checkout --patch' . ./lib-patch-mode.sh test_expect_success PERL 'setup' ' mkdir dir && echo parent > dir/foo && echo dummy > bar && git add bar dir/foo && git commit -m initial && test_tick && test_commit second dir/foo head && set_and_save_state bar bar_work bar_index && sa...
Shell
#!/bin/sh # # Ensures that tests are run under Bash; primarily intended for running tests # of the completion script. 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" "...
Shell
#!/bin/sh # # Copyright (c) 2008 Johannes Schindelin # test_description='Test rebasing, stashing, etc. with submodules' . ./test-lib.sh test_expect_success setup ' echo file > file && git add file && test_tick && git commit -m initial && git clone . submodule && git add submodule && test_tick && git commit ...
Shell
#!/bin/sh # # this script sets up a Subversion repository for Makefile in the # first ever git merge, as if it were done with svnmerge (SVN 1.5+) # rm -rf foo.svn foo set -e mkdir foo.svn svnadmin create foo.svn svn co file://`pwd`/foo.svn foo commit() { i=$(( $1 + 1 )) shift; svn commit -m "(r$i) $*" >/...
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
#!/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 test_description='git-status with core.ignorecase=true' . ./test-lib.sh test_expect_success 'status with hash collisions' ' # note: "V/", "V/XQANY/" and "WURZAUP/" produce the same hash code # in name-hash.c::hash_name mkdir V && mkdir V/XQANY && mkdir WURZAUP && touch V/XQANY/test && git config cor...
Shell
#!/bin/sh test_description="git merge Testing a custom strategy. * (HEAD, master) Merge commit 'c3' |\ | * (tag: c3) c3 * | (tag: c1) c1 |/ | * tag: c2) c2 |/ * (tag: c0) c0 " . ./test-lib.sh test_expect_success 'set up custom strategy' ' cat >git-merge-theirs <<-EOF && #!$SHELL_PATH eval git read-tree --rese...
Shell
#!/bin/sh test_description='avoiding conflicting update thru symref aliasing' . ./test-lib.sh test_expect_success 'setup' ' test_commit one && git clone . src && git clone src dst1 && git clone src dst2 && test_commit two && ( cd src && git pull ) ' test_expect_success 'push' ' ( cd src && git push ../ds...
Shell
#!/bin/sh test_description='tests for the peel_ref optimization of packed-refs' . ./test-lib.sh test_expect_success 'create annotated tag in refs/tags' ' test_commit base && git tag -m annotated foo ' test_expect_success 'create annotated tag outside of refs/tags' ' git update-ref refs/outside/foo refs/tags/foo '...
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 test_diff_frobnitz() { cat >file1 <<\EOF #include <stdio.h> // Frobs foo heartily int frobnitz(int foo) { int i; for(i = 0; i < 10; i++) { printf("Your answer is: "); printf("%d\n", foo); } } int fact(int n) { if(n > 1) { return fact(n-1) * n; } retu...
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 test_description='git mktree' . ./test-lib.sh test_expect_success setup ' for d in a a. a0 do mkdir "$d" && echo "$d/one" >"$d/one" && git add "$d" done && echo zero >one && git update-index --add --info-only one && git write-tree --missing-ok >tree.missing && git ls-tree $(cat tree.missing) >to...
Shell
#!/bin/sh test_description='git rebase --abort tests' . ./test-lib.sh ### Test that we handle space characters properly work_dir="$(pwd)/test dir" test_expect_success setup ' mkdir -p "$work_dir" && cd "$work_dir" && git init && echo a > a && git add a && git commit -m a && git branch to-rebase && echo b >...
Shell
#!/bin/sh test_description='tagopt variable affects "git fetch" and is overridden by commandline.' . ./test-lib.sh setup_clone () { git clone --mirror . $1 && git remote add remote_$1 $1 && (cd $1 && git tag tag_$1) } test_expect_success setup ' test_commit test && setup_clone one && git config remote.remote...
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='overly long paths' . ./test-lib.sh test_expect_success setup ' p=filefilefilefilefilefilefilefile && p=$p$p$p$p$p$p$p$p$p$p$p$p$p$p$p$p && p=$p$p$p$p$p$p$p$p$p$p$p$p$p$p$p$p && path_a=${p}_a && path_z=${p}_z && blob_a=$(echo frotz | git hash-object -w --stdin) && blob_z=$(echo nit...
Shell
#!/bin/sh # # Copyright (c) 2006 Junio C Hamano # test_description='git update-index --again test. ' . ./test-lib.sh cat > expected <<\EOF 100644 3b18e512dba79e4c8300dd08aeb37f8e728b8dad 0 file1 100644 9db8893856a8a02eaa73470054b7c1c5a7c82e47 0 file2 EOF test_expect_success 'update-index --add' \ 'echo hello world ...
Shell
#!/bin/sh # # Copyright (c) 2010 Nazri Ramliy # test_description='Test for "git log --decorate" colors' . ./test-lib.sh get_color () { git config --get-color no.such.slot "$1" } test_expect_success setup ' git config diff.color.commit yellow && git config color.decorate.branch green && git config color.decorate...
Shell
#!/bin/sh # # Copyright (c) 2008 Nguyễn Thái Ngọc Duy # test_description='skip-worktree bit test' . ./test-lib.sh cat >expect.full <<EOF H 1 H 2 H sub/1 H sub/2 EOF cat >expect.skip <<EOF S 1 H 2 S sub/1 H sub/2 EOF test_expect_success 'setup' ' mkdir sub && touch ./1 ./2 sub/1 sub/2 && git add 1 2 sub/1 sub/2 ...
Shell
#!/bin/sh # # Copyright (c) 2012 Peter Baumann # test_description='git svn reset clears memoized caches' . ./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 # ... a - b - m <- trunk # \ /...
Shell
#!/bin/sh test_description='git grep --open-files-in-pager ' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-pager.sh unset PAGER GIT_PAGER test_expect_success 'setup' ' test_commit initial grep.h " enum grep_pat_token { GREP_PATTERN, GREP_PATTERN_HEAD, GREP_PATTERN_BODY, GREP_AND, GREP_OPEN_PAREN, GREP_CLOSE_PAREN, ...
Shell
#!/bin/sh # # Copyright (c) 2012 Felipe Contreras # test_description='test bash completion' . ./lib-bash.sh complete () { # do nothing return 0 } # Be careful when updating this list: # # (1) The build tree may have build artifact from different branch, or # the user's $PATH may have a random executable that ...
Shell
#!/bin/sh # # Copyright (c) 2008 Alec Berryman test_description='git svn fetch repository with deleted and readded directory' . ./lib-git-svn.sh # Don't run this by default; it opens up a port. require_svnserve test_expect_success 'load repository' ' svnadmin load -q "$rawsvnrepo" < "$TEST_DIRECTORY"/t9126/foll...
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) 2008 Ping Yin # test_description='Summary support for submodules This test tries to verify the sanity of summary subcommand of git submodule. ' . ./test-lib.sh add_file () { sm=$1 shift owd=$(pwd) cd "$sm" for name; do echo "$name" > "$name" && git add "$name" && test_tick && ...
Shell
#!/bin/sh # # Copyright (c) 2007 Eric Wong # test_description='git svn funky branch names' . ./lib-git-svn.sh # Abo-Uebernahme (Bug #994) scary_uri='Abo-Uebernahme%20%28Bug%20%23994%29' scary_ref='Abo-Uebernahme%20(Bug%20#994)' test_expect_success 'setup svnrepo' ' mkdir project project/trunk project/branches proje...
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) 2012 Valentin Duperray, Lucien Kong, Franck Jonas, # Thomas Nguy, Khoi Nguyen # Grenoble INP Ensimag # test_description='git status advice' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-rebase.sh set_fake_editor test_expect_success 'prepare for conflicts' ' git config --global ad...
Shell
#!/bin/sh # # Copyright (c) 2012 Mozilla Foundation # test_description='diff.context configuration' . ./test-lib.sh test_expect_success 'setup' ' cat >template <<-\EOF && firstline b c d e f preline TARGET postline i j k l m n EOF sed "/TARGET/d" >x <template && git update-index --add x && git co...
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 gpg_version=`gpg --version 2>&1` if test $? = 127; then say "You do not seem to have gpg installed" else # As said here: http://www.gnupg.org/documentation/faqs.html#q6.19 # the gpg version 1.0.6 didn't parse trust packets correctly, so for # that version, creation of signed tags using the generated key ...
Shell
#!/bin/sh test_description='add -i basic tests' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh test_expect_success PERL 'setup (initial)' ' echo content >file && git add file && echo more >>file && echo lines >>file ' test_expect_success PERL 'status works (initial)' ' git add -i </dev/null >output &...
Shell
#!/bin/sh # # Copyright (c) 2006 Junio C Hamano # test_description='git checkout tests. Creates master, forks renamer and side branches from it. Test switching across them. ! [master] Initial A one, A two * [renamer] Renamer R one->uno, M two ! [side] Side M one, D two, A three ! [simple] Simple D one,...
Shell
#!/bin/sh test_description='test smart fetching 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 LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5551'} . "$TEST_DIRECTORY"/lib-httpd.sh start_httpd test_expect_success 'setup repository' ...
Shell
#!/bin/sh test_description='Test reflog display routines' . ./test-lib.sh test_expect_success 'setup' ' echo content >file && git add file && test_tick && git commit -m one ' cat >expect <<'EOF' Reflog: HEAD@{0} (C O Mitter <committer@example.com>) Reflog message: commit (initial): one EOF test_expect_success 'l...
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 Andy Parkins # test_description='for-each-ref test' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-gpg.sh # Mon Jul 3 15:18:43 2006 +0000 datestamp=1151939923 setdate_and_increment () { GIT_COMMITTER_DATE="$datestamp +0200" datestamp=$(expr "$datestamp" + 1) GIT_AUTHOR_DATE="$da...
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='git cat-file' . ./test-lib.sh echo_without_newline () { printf '%s' "$*" } strlen () { echo_without_newline "$1" | wc -c | sed -e 's/^ *//' } maybe_remove_timestamp () { if test -z "$2"; then echo_without_newline "$1" else echo_without_newline "$(printf '%s\n' "...
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) 2008 Clemens Buchacher <drizzd@aon.at> # test_description='test WebDAV http-push This test runs various sanity checks on http-push.' . ./test-lib.sh if git http-push > /dev/null 2>&1 || [ $? -eq 128 ] then skip_all="skipping test, USE_CURL_MULTI is not defined" test_done fi LIB_HTTPD_...
Shell
#!/bin/sh test_description="git hash-object" . ./test-lib.sh echo_without_newline() { printf '%s' "$*" } test_blob_does_not_exist() { test_expect_success 'blob does not exist in database' " test_must_fail git cat-file blob $1 " } test_blob_exists() { test_expect_success 'blob exists in database' " git cat-...
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 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 test_description='git log' . ./test-lib.sh test_expect_success setup ' echo one >one && git add one && test_tick && git commit -m initial && echo ichi >one && git add one && test_tick && git commit -m second && git mv one ichi && test_tick && git commit -m third && cp ichi ein && git add e...
Shell
#!/bin/sh # # Copyright (c) 2010 Erick Mattos # test_description='git checkout --orphan Main Tests for --orphan functionality.' . ./test-lib.sh TEST_FILE=foo test_expect_success 'Setup' ' echo "Initial" >"$TEST_FILE" && git add "$TEST_FILE" && git commit -m "First Commit" && test_tick && echo "State 1" >>"$TE...
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 test_description='read-tree -u --reset' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-read-tree.sh # two-tree test test_expect_success 'setup' ' git init && mkdir df && echo content >df/file && git add df/file && git commit -m one && git ls-files >expect && rm -rf df && echo content >df && git...
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 # # Copyright (c) 2007 Eric Wong # test_description='git svn useSvmProps test' . ./lib-git-svn.sh test_expect_success 'load svm repo' ' svnadmin load -q "$rawsvnrepo" < "$TEST_DIRECTORY"/t9110/svm.dump && git svn init --minimize-url -R arr -i bar "$svnrepo"/mirror/arr && git svn init --minimize-url -R a...
Shell
#!/bin/sh # # Copyright (c) 2010 Ævar Arnfjörð Bjarmason # . ./test-lib.sh GIT_TEXTDOMAINDIR="$GIT_BUILD_DIR/po/build/locale" GIT_PO_PATH="$GIT_BUILD_DIR/po" export GIT_TEXTDOMAINDIR GIT_PO_PATH . "$GIT_BUILD_DIR"/git-sh-i18n if test_have_prereq GETTEXT && ! test_have_prereq GETTEXT_POISON then # is_IS.UTF-8 on So...
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 # # 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 test_description='basic ls-files tests This test runs git ls-files with various unusual or malformed command-line arguments. ' . ./test-lib.sh >empty test_expect_success 'ls-files in empty repository' ' git ls-files >actual && test_cmp empty actual ' test_expect_success 'ls-files with nonexistent path...
Shell
#!/bin/sh # # Copyright (c) 2007 Sam Vilain # test_description='git-svn svk merge tickets' . ./lib-git-svn.sh test_expect_success 'load svk depot' " svnadmin load -q '$rawsvnrepo' \ < '$TEST_DIRECTORY/t9150/svk-merge.dump' && git svn init --minimize-url -R svkmerge \ --rewrite-root=http://svn.example.org \ ...
Shell
#!/bin/sh test_description='test aborting in-progress merges Set up repo with conflicting and non-conflicting branches: There are three files foo/bar/baz, and the following graph illustrates the content of these files in each commit: # foo/bar/baz --- foo/bar/bazz <-- master # \ # --- f...
Shell
#!/bin/sh # # Copyright (c) 2007 Johannes E. Schindelin # test_description='git status' . ./test-lib.sh test_expect_success 'status -h in broken repository' ' git config --global advice.statusuoption false && mkdir broken && test_when_finished "rm -fr broken" && ( cd broken && git init && echo "[status] sh...
Shell
#!/bin/sh # # Copyright (c) 2007 Johannes E. Schindelin # test_description='git rebase interactive This test runs git rebase "interactively", by faking an edit, and verifies that the result still makes sense. Initial setup: one - two - three - four (conflict-branch) / A - B - C - D - E (master) ...
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 die() { echo >&2 "$@" exit 1 } xmkdir() { while [ -n "$1" ]; do [ -d "$1" ] || mkdir "$1" || die "Unable to mkdir $1" shift done } R="$1" [ -n "$R" ] || die "usage: prepare-chroot.sh <root>" [ -x git ] || die "This script needs to be executed at git source code's top directory" [ -x /bin/busybox ]...
Shell
#!/bin/sh # # Copyright (c) 2011 Roberto Tyley # test_description='Correctly identify and parse loose object headers There are two file formats for loose objects - the original standard format, and the experimental format introduced with Git v1.4.3, later deprecated with v1.5.3. Although Git no longer writes the expe...
Shell
#!/bin/sh test_description='check that the most basic functions work Verify wrappers and compatibility functions. ' . ./test-lib.sh test_expect_success 'character classes (isspace, isalpha etc.)' ' test-ctype ' test_expect_success 'mktemp to nonexistent directory prints filename' ' test_must_fail test-mktemp do...
Shell
#!/bin/sh test_description='merging with submodules' . ./test-lib.sh # # history # # a --- c # / \ / # root X # \ / \ # b --- d # test_expect_success setup ' mkdir sub && (cd sub && git init && echo original > file && git add file && test_tick && git commit -m sub-root)...
Shell
#!/bin/sh test_description="Tests of cwd/prefix/worktree/gitdir setup in all cases A few rules for repo setup: 1. GIT_DIR is relative to user's cwd. --git-dir is equivalent to GIT_DIR. 2. .git file is relative to parent directory. .git file is basically symlink in disguise. The directory where .git file point...
Shell
#!/bin/sh # # Copyright (c) 2007 Eric Wong # Based on a script by Joakim Tjernlund <joakim.tjernlund@transmode.se> test_description='git svn dcommit handles merges' . ./lib-git-svn.sh big_text_block () { cat << EOF # # (C) Copyright 2000 - 2005 # Wolfgang Denk, DENX Software Engineering, wd@denx.de. # # See file CRE...
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