code
stringlengths
1
1.96M
language
stringclasses
1 value
#!/bin/sh test_description='test multi-tree read-tree without merging' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-read-tree.sh test_expect_success setup ' echo one >a && git add a && git commit -m initial && git tag initial && echo two >b && git add b && git commit -m second && git checkout -b side initial && ...
Shell
#!/bin/sh # # Copyright (c) 2010 Brad King # test_description='git update-index for gitlink to .git file. ' . ./test-lib.sh test_expect_success 'submodule with absolute .git file' ' mkdir sub1 && (cd sub1 && git init && REAL="$(pwd)/.real" && mv .git "$REAL" && echo "gitdir: $REAL" >.git && test_commit f...
Shell
#!/bin/sh test_description='test recreated svn branch with empty files' . ./lib-git-svn.sh test_expect_success 'load svn dumpfile' ' svnadmin load "$rawsvnrepo" < "${TEST_DIRECTORY}/t9136/svn.dump" ' test_expect_success 'clone using git svn' 'git svn clone -s "$svnrepo" x' test_done
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 failed_tests= fixed=0 success=0 failed=0 broken=0 total=0 while read file do while read type value do case $type in '') continue ;; fixed) fixed=$(($fixed + $value)) ;; success) success=$(($success + $value)) ;; failed) failed=$(($failed + $value)) if test $value != 0 then ...
Shell
#!/bin/sh test_description='magic pathspec tests using git-log' . ./test-lib.sh test_expect_success 'setup' ' test_commit initial && test_tick && git commit --allow-empty -m empty && mkdir sub ' test_expect_success '"git log :/" should be ambiguous' ' test_must_fail git log :/ 2>error && grep ambiguous error ...
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 test_description='basic work tree status reporting' . ./test-lib.sh test_expect_success setup ' test_commit A && test_commit B oneside added && git checkout A^0 && test_commit C oneside created ' test_expect_success 'A/A conflict' ' git checkout B^0 && test_must_fail git merge C ' test_expect_succe...
Shell
#!/bin/sh test_description='git cvsimport basic tests' . ./lib-cvs.sh test_expect_success PERL 'setup cvsroot environment' ' CVSROOT=$(pwd)/cvsroot && export CVSROOT ' test_expect_success PERL 'setup cvsroot' '$CVS init' test_expect_success PERL 'setup a cvs module' ' mkdir "$CVSROOT/module" && $CVS co -d modu...
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 init.t H sub/1 H sub/2 EOF cat >expect.skip <<EOF S 1 H 2 H init.t S sub/1 H sub/2 EOF NULL_SHA1=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 setup_absent() { test -f 1 &...
Shell
#!/bin/sh test_description='signed commit tests' . ./test-lib.sh . "$TEST_DIRECTORY/lib-gpg.sh" test_expect_success GPG 'create signed commits' ' echo 1 >file && git add file && test_tick && git commit -S -m initial && git tag initial && git branch side && echo 2 >file && test_tick && git commit -a -S -m second...
Shell
#!/bin/sh # # Copyright (c) 2008 Eric Wong test_description='git svn honors i18n.commitEncoding in config' . ./lib-git-svn.sh compare_git_head_with () { nr=`wc -l < "$1"` a=7 b=$(($a + $nr - 1)) git cat-file commit HEAD | sed -ne "$a,${b}p" >current && test_cmp current "$1" } a_utf8_locale=$(locale -a | sed -n...
Shell
#!/bin/sh test_expect_success 'determine default pager' ' test_might_fail git config --unset core.pager && less=$( unset PAGER GIT_PAGER; git var GIT_PAGER ) && test -n "$less" ' if expr "$less" : '[a-z][a-z]*$' >/dev/null then test_set_prereq SIMPLEPAGER fi
Shell
#!/bin/sh # # Copyright (c) 2007 Lars Hjemli # test_description='git merge Testing basic merge operations/option parsing. ! [c0] commit 0 ! [c1] commit 1 ! [c2] commit 2 ! [c3] commit 3 ! [c4] c4 ! [c5] c5 ! [c6] c6 * [master] Merge commit 'c1' -------- - [master] Merge commit 'c1'...
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 # # Copyright (c) 2008 Timo Hirvonen # test_description='Test diff/status color escape codes' . ./test-lib.sh color() { actual=$(git config --get-color no.such.slot "$1") && test "$actual" = "$2" } invalid_color() { test_must_fail git config --get-color no.such.slot "$1" } test_expect_success 'reset' ...
Shell
#!/bin/sh # # Copyright (c) 2007 Eric Wong # test_description='git svn tracking removed top-level path' . ./lib-git-svn.sh test_expect_success 'make history for tracking' ' mkdir import && mkdir import/trunk && echo hello >> import/trunk/README && svn_cmd import -m initial import "$svnrepo" && rm -rf import && ...
Shell
#!/bin/sh # # Copyright (c) 2008 Christian Couder # test_description='test git rev-parse --verify' exec </dev/null . ./test-lib.sh add_line_into_file() { _line=$1 _file=$2 if [ -f "$_file" ]; then echo "$_line" >> $_file || return $? MSG="Add <$_line> into <$_file>." else ech...
Shell
#!/bin/sh test_description='.git file Verify that plumbing commands work when .git is a file ' . ./test-lib.sh objpath() { echo "$1" | sed -e 's|\(..\)|\1/|' } objck() { p=$(objpath "$1") if test ! -f "$REAL/objects/$p" then echo "Object not found: $REAL/objects/$p" false fi } test_expect_success 'ini...
Shell
#!/bin/sh # # Copyright (c) 2005 Junio C Hamano # test_description='git pack-object ' . ./test-lib.sh TRASH=`pwd` test_expect_success \ 'setup' \ 'rm -f .git/index* && perl -e "print \"a\" x 4096;" > a && perl -e "print \"b\" x 4096;" > b && perl -e "print \"c\" x 4096;" > c && test-genr...
Shell
#!/bin/sh test_description='git svn authorship' . ./lib-git-svn.sh test_expect_success 'setup svn repository' ' svn_cmd checkout "$svnrepo" work.svn && ( cd work.svn && echo >file svn_cmd add file svn_cmd commit -m "first commit" file ) ' test_expect_success 'interact with it via git svn' ' mkdir work.gi...
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 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='merge-recursive backend test' . ./test-lib.sh # A <- create some files # / \ # B C <- cause rename/delete conflicts between B and C # / \ # |\ /| # | D E | # | \ / | # | X | # | / \ | # | / \ | # |/ \|...
Shell
#!/bin/sh test_description='unpack-trees error messages' . ./test-lib.sh test_expect_success 'setup' ' echo one >one && git add one && git commit -a -m First && git checkout -b branch && echo two >two && echo three >three && echo four >four && echo five >five && git add two three four five && git commit ...
Shell
#!/bin/sh # test_description='git web--browse basic tests This test checks that git web--browse can handle various valid URLs.' . ./test-lib.sh test_web_browse () { # browser=$1 url=$2 git web--browse --browser="$1" "$2" >actual && tr -d '\015' <actual >text && test_cmp expect text } test_expect_success \ 'UR...
Shell
#!/bin/sh test_description='applying patch with mode bits' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh test_expect_success setup ' echo original >file && git add file && test_tick && git commit -m initial && git tag initial && echo modified >file && git diff --stat -p >patch-0.txt && chmod +x ...
Shell
#!/bin/sh # # Copyright (c) 2009 Eric Wong test_description='git svn old rev_map preservd' . ./lib-git-svn.sh test_expect_success 'setup test repository with old layout' ' mkdir i && (cd i && > a) && svn_cmd import -m- i "$svnrepo" && git svn init "$svnrepo" && git svn fetch && test -d .git/svn/refs/remotes/git...
Shell
#!/bin/sh test_description='check various push.default settings' . ./test-lib.sh test_expect_success 'setup bare remotes' ' git init --bare repo1 && git remote add parent1 repo1 && git init --bare repo2 && git remote add parent2 repo2 && test_commit one && git push parent1 HEAD && git push parent2 HEAD ' test...
Shell
#!/bin/sh # # Copyright (c) 2006 Carl D. Worth # test_description='Test of git add, including the -- option.' . ./test-lib.sh test_expect_success \ 'Test of git add' \ 'touch foo && git add foo' test_expect_success \ 'Post-check that foo is in the index' \ 'git ls-files foo | grep foo' test_expect_...
Shell
#!/bin/sh test_expect_success PERL 'set up terminal for tests' ' # Reading from the pty master seems to get stuck _sometimes_ # on Mac OS X 10.5.0, using Perl 5.10.0 or 5.8.9. # # Reproduction recipe: run # # i=0 # while ./test-terminal.perl echo hi $i # do # : $((i = $i + 1)) # done # # After 2000 iterat...
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='git am with corrupt input' . ./test-lib.sh # Note the missing "+++" line: cat > bad-patch.diff <<'EOF' From: A U Thor <au.thor@example.com> diff --git a/f b/f index 7898192..6178079 100644 --- a/f @@ -1 +1 @@ -a +b EOF test_expect_success setup ' test $? = 0 && echo a > f && git add f ...
Shell
#!/bin/sh # # Copyright (c) 2005 Junio C Hamano # test_description='git apply should not get confused with rename/copy. ' . ./test-lib.sh # setup mkdir -p klibc/arch/x86_64/include/klibc cat >klibc/arch/x86_64/include/klibc/archsetjmp.h <<\EOF /* * arch/x86_64/include/klibc/archsetjmp.h */ #ifndef _KLIBC_ARCHS...
Shell
#!/bin/sh # # Copyright (c) 2009 Eric Wong test_description='git svn refuses to dcommit non-UTF8 messages' . ./lib-git-svn.sh # ISO-2022-JP can pass for valid UTF-8, so skipping that in this test for H in ISO8859-1 eucJP do test_expect_success "$H setup" ' mkdir $H && svn_cmd import -m "$H test" $H "$svnrepo"/...
Shell
#!/bin/sh # # Copyright (c) 2007 Johannes E. Schindelin # test_description='Test fsck --lost-found' . ./test-lib.sh test_expect_success setup ' git config core.logAllRefUpdates 0 && : > file1 && git add file1 && test_tick && git commit -m initial && echo 1 > file1 && echo 2 > file2 && git add file1 file2 && ...
Shell
#!/bin/sh # # Copyright (c) 2009 Marc Branchaud # test_description='git svn multiple branch and tag paths in the svn repo' . ./lib-git-svn.sh test_expect_success 'setup svnrepo' ' mkdir project \ project/trunk \ project/b_one \ project/b_two \ project/tags_A \ project/tags_B && echo 1 > project/trunk/a.fi...
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 && for w in Hello world how are you; do echo $w; done >one && mkdir dir && for w in I am very very fine thank you; do echo $w; done >dir/t...
Shell
#!/bin/sh # # Copyright (c) 2005 Junio C Hamano # test_description='git apply boundary tests ' . ./test-lib.sh L="c d e f g h i j k l m n o p q r s t u v w x" test_expect_success setup ' for i in b '"$L"' y do echo $i done >victim && cat victim >original && git update-index --add victim && : add to the hea...
Shell
#!/bin/sh test_description='histogram diff algorithm' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-diff-alternative.sh test_diff_frobnitz "histogram" test_diff_unique "histogram" test_done
Shell
#!/bin/sh test_description='am --abort' . ./test-lib.sh test_expect_success setup ' for i in a b c d e f g do echo $i done >file-1 && cp file-1 file-2 && test_tick && git add file-1 file-2 && git commit -m initial && git tag initial && for i in 2 3 4 5 6 do echo $i >>file-1 && echo $i >otherfile-$i &...
Shell
#!/bin/sh # # Copyright (c) 2006 Junio C Hamano # test_description='quoted output' . ./test-lib.sh FN='濱野' GN='純' HT=' ' DQ='"' echo foo 2>/dev/null > "Name and an${HT}HT" if ! test -f "Name and an${HT}HT" then # FAT/NTFS does not allow tabs in filenames say 'Your filesystem does not allow tabs in filenames' else...
Shell
#!/bin/sh test_description='git p4 submit' . ./lib-git-p4.sh test_expect_success 'start p4d' ' start_p4d ' test_expect_success 'init depot' ' ( cd "$cli" && echo file1 >file1 && p4 add file1 && p4 submit -d "change 1" ) ' test_expect_success 'submit with no client dir' ' test_when_finished cleanup_git ...
Shell
#!/bin/sh # # Copyright (c) 2007 Eric Wong # test_description='git svn log tests' . ./lib-git-svn.sh test_expect_success 'setup repository and import' ' mkdir import && ( cd import && for i in trunk branches/a branches/b tags/0.1 tags/0.2 tags/0.3 do mkdir -p $i && echo hello >>$i/README || exit 1 ...
Shell
#!/bin/sh test_description='test various @{X} syntax combinations together' . ./test-lib.sh check() { test_expect_${3:-success} "$1 = $2" " echo '$2' >expect && git log -1 --format=%s '$1' >actual && test_cmp expect actual " } nonsense() { test_expect_${2:-success} "$1 is nonsensical" " test_must_fail git log -1 ...
Shell
#!/bin/sh test_description='git p4 skipSubmitEdit config variables' . ./lib-git-p4.sh test_expect_success 'start p4d' ' start_p4d ' test_expect_success 'init depot' ' ( cd "$cli" && echo file1 >file1 && p4 add file1 && p4 submit -d "change 1" ) ' # this works because EDITOR is set to : test_expect_succe...
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 # # Copyright (c) 2006 Junio C Hamano # test_description='Try various core-level commands in subdirectory. ' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-read-tree.sh test_expect_success setup ' long="a b c d e f g h i j k l m n o p q r s t u v w x y z" && for c in $long; do echo $c; done >one && mkdir dir &...
Shell
#!/bin/sh test_description='git rev-list should notice bad commits' . ./test-lib.sh # Note: # - compression level is set to zero to make "corruptions" easier to perform # - reflog is disabled to avoid extra references which would twart the test test_expect_success 'setup' \ ' git init && git config core.co...
Shell
#!/bin/sh test_description='git blame' . ./test-lib.sh PROG='git blame -c' . "$TEST_DIRECTORY"/annotate-tests.sh PROG='git blame -c -e' test_expect_success 'Blame --show-email works' ' check_count "<A@test.git>" 1 "<B@test.git>" 1 "<B1@test.git>" 1 "<B2@test.git>" 1 "<author@example.com>" 1 "<C@test.git>" 1 "<D@...
Shell
#!/bin/sh # # Copyright (C) 2006 Martin Waitz <tali@admingilde.org> # test_description='test clone --reference' . ./test-lib.sh base_dir=`pwd` U=$base_dir/UPLOAD_LOG test_expect_success 'preparing first repository' \ 'test_create_repo A && cd A && echo first > file1 && git add file1 && git commit -m initial' cd "$...
Shell
#!/bin/sh test_description='reset --hard unmerged' . ./test-lib.sh test_expect_success setup ' mkdir before later && >before/1 && >before/2 && >hello && >later/3 && git add before hello later && git commit -m world && H=$(git rev-parse :hello) && git rm --cached hello && echo "100644 $H 2 hello" | git up...
Shell
#!/bin/sh test_description='checkout handling of ambiguous (branch/tag) refs' . ./test-lib.sh test_expect_success 'setup ambiguous refs' ' test_commit branch file && git branch ambiguity && git branch vagueness && test_commit tag file && git tag ambiguity && git tag vagueness HEAD:file && test_commit other fil...
Shell
#!/bin/sh test_description='test cherry-picking with --ff option' . ./test-lib.sh test_expect_success setup ' echo first > file1 && git add file1 && test_tick && git commit -m "first" && git tag first && git checkout -b other && echo second >> file1 && git add file1 && test_tick && git commit -m "second" ...
Shell
#!/bin/sh # # Copyright (c) 2005 Junio C Hamano # test_description='Test built-in diff output engine. ' . ./test-lib.sh . "$TEST_DIRECTORY"/diff-lib.sh echo >path0 'Line 1 Line 2 line 3' cat path0 >path1 chmod +x path1 test_expect_success \ 'update-index --add two files with and without +x.' \ 'git update-i...
Shell
#!/bin/sh test_description='push to a repository that borrows from elsewhere' . ./test-lib.sh test_expect_success setup ' mkdir alice-pub && ( cd alice-pub && GIT_DIR=. git init ) && mkdir alice-work && ( cd alice-work && git init && >file && git add . && git commit -m initial && git push ../ali...
Shell
#!/bin/sh # # Copyright (c) 2007 Eric Wong # test_description='git svn useSvnsyncProps test' . ./lib-git-svn.sh test_expect_success 'load svnsync repo' ' svnadmin load -q "$rawsvnrepo" < "$TEST_DIRECTORY"/t9111/svnsync.dump && git svn init --minimize-url -R arr -i bar "$svnrepo"/bar && git svn init --minimize-url...
Shell
#!/bin/sh # # Copyright (c) 2010 Andreas Gruenbacher # test_description='git apply filename consistency check' . ./test-lib.sh test_expect_success setup ' cat > bad1.patch <<EOF && diff --git a/f b/f new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/f-blah @@ -0,0 +1 @@ +1 EOF cat > bad2.patch <<EOF ...
Shell
#!/bin/sh # # Copyright (c) 2007 Lars Hjemli # test_description='Basic porcelain support for submodules This test tries to verify basic sanity of the init, update and status subcommands of git submodule. ' . ./test-lib.sh test_expect_success 'setup - initial commit' ' >t && git add t && git commit -m "initial co...
Shell
#!/bin/sh test_description='combined and merge diff handle binary files and textconv' . ./test-lib.sh test_expect_success 'setup binary merge conflict' ' echo oneQ1 | q_to_nul >binary && git add binary && git commit -m one && echo twoQ2 | q_to_nul >binary && git commit -a -m two && git checkout -b branch-binary...
Shell
#!/bin/sh test_description='external diff interface test' . ./test-lib.sh test_expect_success setup ' test_tick && echo initial >file && git add file && git commit -m initial && test_tick && echo second >file && git add file && git commit -m second && test_tick && echo third >file ' test_expect_success...
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='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 repack works correctly' . ./test-lib.sh fsha1= csha1= tsha1= test_expect_success '-A with -d option leaves unreachable objects unpacked' ' echo content > file1 && git add . && test_tick && git commit -m initial_commit && # create a transient branch with unique content git check...
Shell
#!/bin/sh test_description='git blame corner cases' . ./test-lib.sh pick_fc='s/^[0-9a-f^]* *\([^ ]*\) *(\([^ ]*\) .*/\1-\2/' test_expect_success setup ' echo A A A A A >one && echo B B B B B >two && echo C C C C C >tres && echo ABC >mouse && for i in 1 2 3 4 5 6 7 8 9 do echo $i done >nine_lines && for i ...
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) 2011, Google Inc. test_description='diff --stat-count' . ./test-lib.sh test_expect_success setup ' >a && >b && >c && >d && git add a b c d && chmod +x c d && echo a >a && echo b >b && cat >expect <<-\EOF a | 1 + b | 1 + 2 files changed, 2 insertions(+) EOF git diff --s...
Shell
#!/bin/sh # # Copyright (c) 2009 Vitaly Shukela # Copyright (c) 2009 Eric Wong # test_description='git svn property tests' . ./lib-git-svn.sh test_expect_success 'setup test repository' ' svn_cmd co "$svnrepo" s && ( cd s && mkdir qqq www && echo test_qqq > qqq/test_qqq.txt && echo test_www > www/test_www.t...
Shell
#!/bin/sh test_description='merge-recursive options * [master] Clarify ! [remote] Remove cruft -- + [remote] Remove cruft * [master] Clarify *+ [remote^] Initial revision * ok 1: setup ' . ./test-lib.sh test_have_prereq SED_STRIPS_CR && SED_OPTIONS=-b test_have_prereq MINGW && export GREP_OPTIONS=-U test_expe...
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 test_description='git apply for contextually independent diffs' . ./test-lib.sh echo '1 2 3 4 5 6 7 8' >file test_expect_success 'setup' \ 'git add file && git commit -q -m 1 && git checkout -b test && mv file file.tmp && echo 0 >file && cat file.tmp >>file && rm file.tmp && git commit -a -q -m 2 &...
Shell
#!/bin/sh test_description='test git-http-backend-noserver' . ./test-lib.sh HTTPD_DOCUMENT_ROOT_PATH="$TRASH_DIRECTORY" test_have_prereq MINGW && export GREP_OPTIONS=-U run_backend() { echo "$2" | QUERY_STRING="${1#*\?}" \ PATH_TRANSLATED="$HTTPD_DOCUMENT_ROOT_PATH/${1%%\?*}" \ git http-backend >act.out 2>act.e...
Shell
#!/bin/sh test_description='git p4 label tests' . ./lib-git-p4.sh test_expect_success 'start p4d' ' start_p4d ' # Basic p4 label import tests. # test_expect_success 'basic p4 labels' ' test_when_finished cleanup_git && ( cd "$cli" && mkdir -p main && echo f1 >main/f1 && p4 add main/f1 && p4 submit -d ...
Shell
#!/bin/sh test_description='git svn rmdir' . ./lib-git-svn.sh test_expect_success 'initialize repo' ' mkdir import && ( cd import && mkdir -p deeply/nested/directory/number/1 && mkdir -p deeply/nested/directory/number/2 && echo foo >deeply/nested/directory/number/1/file && echo foo >deeply/nested/directory...
Shell
#!/bin/sh test_description='.mailmap configurations' . ./test-lib.sh fuzz_blame () { sed " s/$_x05[0-9a-f][0-9a-f][0-9a-f]/OBJID/g s/$_x05[0-9a-f][0-9a-f]/OBJI/g s/[-0-9]\{10\} [:0-9]\{8\} [-+][0-9]\{4\}/DATE/g " "$@" } test_expect_success setup ' echo one >one && git add one && test_tick && git commit ...
Shell
#!/bin/sh # # Copyright (c) 2011 Frédéric Heitzmann test_description='git svn dcommit --interactive series' . ./lib-git-svn.sh test_expect_success 'initialize repo' ' svn_cmd mkdir -m"mkdir test-interactive" "$svnrepo/test-interactive" && git svn clone "$svnrepo/test-interactive" test-interactive && cd test-intera...
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 # # Copyright (c) 2008 Lea Wiemann # test_description='perl interface (Git.pm)' . ./test-lib.sh if ! test_have_prereq PERL; then skip_all='skipping perl interface tests, perl not available' test_done fi "$PERL_PATH" -MTest::More -e 0 2>/dev/null || { skip_all="Perl Test::More unavailable, skipping test"...
Shell
#!/bin/sh test_description='ask merge-recursive to merge binary files' . ./test-lib.sh test_expect_success setup ' cat "$TEST_DIRECTORY"/test-binary-1.png >m && git add m && git ls-files -s | sed -e "s/ 0 / 1 /" >E1 && test_tick && git commit -m "initial" && git branch side && echo frotz >a && git add a &&...
Shell
#!/bin/sh test_description='fetch --all works correctly' . ./test-lib.sh setup_repository () { mkdir "$1" && ( cd "$1" && git init && >file && git add file && test_tick && git commit -m "Initial" && git checkout -b side && >elif && git add elif && test_tick && git commit -m "Second" && git checkout mast...
Shell
#!/bin/sh test_description='more git add -u' . ./test-lib.sh test_expect_success setup ' >xyzzy && _empty=$(git hash-object --stdin <xyzzy) && >yomin && >caskly && if test_have_prereq SYMLINKS; then ln -s frotz nitfol && T_letter=T else printf %s frotz > nitfol && T_letter=M fi && mkdir rezrov && >r...
Shell
#!/bin/sh # # Copyright (c) 2005 Junio C Hamano # Copyright (c) 2005 Robert Fitzsimons # test_description='git apply test patches with multiple fragments.' . ./test-lib.sh cp "$TEST_DIRECTORY/t4109/patch1.patch" . cp "$TEST_DIRECTORY/t4109/patch2.patch" . cp "$TEST_DIRECTORY/t4109/patch3.patch" . cp "$TEST_DIRECTORY...
Shell
#!/bin/sh # # Copyright (c) 2006 Eric Wong # test_description='git svn fetching' . ./lib-git-svn.sh test_expect_success 'initialize repo' ' mkdir import && ( cd import && mkdir -p trunk && echo hello >trunk/readme && svn_cmd import -m "initial" . "$svnrepo" ) && svn_cmd co "$svnrepo" wc && ( cd wc && ...
Shell
#!/bin/sh test_description='ls-files tests with relative paths This test runs git ls-files with various relative path arguments. ' . ./test-lib.sh new_line=' ' sq=\' test_expect_success 'prepare' ' : >never-mind-me && git add never-mind-me && mkdir top && ( cd top && mkdir sub && x="x xa xbc xdef xghij x...
Shell
#!/bin/sh # # Copyright (C) 2005 Rene Scharfe # test_description='git tar-tree and git get-tar-commit-id test This test covers the topics of file contents, commit date handling and commit id embedding: The contents of the repository is compared to the extracted tar archive. The repository contains simple text f...
Shell
#!/bin/sh # # Copyright (c) 2010 Ævar Arnfjörð Bjarmason # test_description="The Git C functions aren't broken by setlocale(3)" . ./lib-gettext.sh test_expect_success 'git show a ISO-8859-1 commit under C locale' ' . "$TEST_DIRECTORY"/t3901-8859-1.txt && test_commit "iso-c-commit" iso-under-c && git show >out 2>e...
Shell
#!/bin/sh test_description='git update-index --assume-unchanged test. ' . ./test-lib.sh test_expect_success 'setup' \ ': >file && git add file && git commit -m initial && git branch other && echo upstream >file && git add file && git commit -m upstream' test_expect_success 'do not switch branches with ...
Shell
#!/bin/sh test_description='ls-files --exclude does not affect index files' . ./test-lib.sh test_expect_success 'create repo with file' ' echo content >file && git add file && git commit -m file && echo modification >file ' check_output() { test_expect_success "ls-files output contains file ($1)" " echo '$2' >e...
Shell
#!/bin/sh # Copyright (c) 2008 Marcus Griep test_description='git svn multi-glob branch names' . ./lib-git-svn.sh test_expect_success 'setup svnrepo' ' mkdir project project/trunk project/branches \ project/branches/v14.1 project/tags && echo foo > project/trunk/foo && svn_cmd import -m "$test_description" proj...
Shell
#!/bin/sh test_description='basic symbolic-ref tests' . ./test-lib.sh # If the tests munging HEAD fail, they can break detection of # the git repo, meaning that further tests will operate on # the surrounding git repo instead of the trash directory. reset_to_sane() { echo ref: refs/heads/foo >.git/HEAD } test_expec...
Shell
#!/bin/sh # # Copyright (C) 2006 Carl D. Worth <cworth@cworth.org> # test_description='test git clone to cleanup after failure This test covers the fact that if git clone fails, it should remove the directory it created, to avoid the user having to manually remove the directory before attempting a clone again.' . ./...
Shell
#!/bin/sh test_description='unpack-objects' . ./test-lib.sh test_expect_success setup ' mkdir pub.git && GIT_DIR=pub.git git init --bare && GIT_DIR=pub.git git config receive.fsckobjects true && mkdir work && ( cd work && git init && mkdir -p gar/bage && ( cd gar/bage && git init && >junk && ...
Shell
#!/bin/sh # # Copyright (c) 2009 Johan Herland # test_description='Test "git submodule foreach" This test verifies that "git submodule foreach" correctly visits all submodules that are currently checked out. ' . ./test-lib.sh test_expect_success 'setup a submodule tree' ' echo file > file && git add file && tes...
Shell
#!/bin/sh test_description='git status with certain file name lengths' . ./test-lib.sh files="0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z" check() { len=$1 prefix=$2 for i in $files do : >$prefix$i done test_expect_success "status, filename length $len" " git add $prefix* && ...
Shell
#!/bin/sh test_description='pre-commit hook' . ./test-lib.sh test_expect_success 'with no hook' ' echo "foo" > file && git add file && git commit -m "first" ' test_expect_success '--no-verify with no hook' ' echo "bar" > file && git add file && git commit --no-verify -m "bar" ' # now install hook that al...
Shell
#!/bin/sh # # Copyright (c) 2010 Jay Soffian # test_description='git svn --rewrite-uuid test' . ./lib-git-svn.sh uuid=6cc8ada4-5932-4b4a-8242-3534ed8a3232 test_expect_success 'load svn repo' " svnadmin load -q '$rawsvnrepo' < '$TEST_DIRECTORY/t9153/svn.dump' && git svn init --minimize-url --rewrite-uuid='$uuid' '...
Shell
#!/bin/sh test_description='git merge Testing pull.* configuration parsing.' . ./test-lib.sh test_expect_success 'setup' ' echo c0 >c0.c && git add c0.c && git commit -m c0 && git tag c0 && echo c1 >c1.c && git add c1.c && git commit -m c1 && git tag c1 && git reset --hard c0 && echo c2 >c2.c && git add ...
Shell
#!/bin/sh test_description='tests for git clone -c key=value' . ./test-lib.sh test_expect_success 'clone -c sets config in cloned repo' ' rm -rf child && git clone -c core.foo=bar . child && echo bar >expect && git --git-dir=child/.git config core.foo >actual && test_cmp expect actual ' test_expect_success 'clo...
Shell
#!/bin/sh # # Copyright (c) 2006 Catalin Marinas # test_description='git apply trying to add an ending line. ' . ./test-lib.sh # setup cat >test-patch <<\EOF diff --git a/file b/file --- a/file +++ b/file @@ -1,2 +1,3 @@ a b +c EOF echo 'a' >file echo 'b' >>file echo 'c' >>file test_expect_success setup \ '...
Shell
#!/bin/sh test_description='test cherry-picking many commits' . ./test-lib.sh check_head_differs_from() { head=$(git rev-parse --verify HEAD) && arg=$(git rev-parse --verify "$1") && test "$head" != "$arg" } check_head_equals() { head=$(git rev-parse --verify HEAD) && arg=$(git rev-parse --verify "$1") && tes...
Shell