code
stringlengths
1
1.96M
language
stringclasses
1 value
#!/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 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 && echo git >a && cat "$TEST_DIRECTORY"/test-binary-1.png >b && e...
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 # # Copyright (c) 2005 Junio C Hamano # test_description='git checkout-index test. This test registers the following filesystem structure in the cache: path0 - a file path1/file1 - a file in a directory And then tries to checkout in a work tree that has the following: path0/file0 - a fi...
Shell
#!/bin/sh # # Copyright (c) 2007 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
#!/bin/sh test_description='Merge-recursive merging renames' . ./test-lib.sh test_expect_success setup \ ' cat >A <<\EOF && a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb c cccccccccccccccccccccccccccccccccccccccccccccccc d ddddddddddddddddddddddddddddddddddddddd...
Shell
#!/bin/sh # # Copyright (c) 2010 Johan Herland # test_description='Test notes merging with manual conflict resolution' . ./test-lib.sh # Set up a notes merge scenario with different kinds of conflicts test_expect_success 'setup commits' ' test_commit 1st && test_commit 2nd && test_commit 3rd && test_commit 4th &...
Shell
#!/bin/sh test_description='update-index with options' . ./test-lib.sh test_expect_success basics ' >one && >two && >three && # need --add when adding test_must_fail git update-index one && test -z "$(git ls-files)" && git update-index --add one && test zone = "z$(git ls-files)" && # update-index is atomi...
Shell
#!/bin/sh test_description='merging with large rename matrix' . ./test-lib.sh count() { i=1 while test $i -le $1; do echo $i i=$(($i + 1)) done } test_expect_success 'setup (initial)' ' touch file && git add . && git commit -m initial && git tag initial ' make_text() { echo $1: $2 for i in `count 20`; ...
Shell
#!/bin/sh test_description='Test wacky input to git config' . ./test-lib.sh setup() { (printf "[section]\n" && printf " key = foo") >.git/config } check() { echo "$2" >expected git config --get "$1" >actual 2>&1 test_cmp actual expected } test_expect_success 'modify same key' ' setup && git config section.k...
Shell
#!/bin/sh test_description='Test notes trees that also contain non-notes' . ./test-lib.sh number_of_commits=100 start_note_commit () { test_tick && cat <<INPUT_END commit refs/notes/commits committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT notes COMMIT from refs/notes/commits...
Shell
#!/bin/sh # # Copyright (c) 2007 Kristian Høgsberg <krh@redhat.com> # # FIXME: Test the various index usages, -i and -o, test reflog, # signoff test_description='git commit' . ./test-lib.sh test_tick test_expect_success \ "initial status" \ "echo 'bongo bongo' >file && git add file" test_expect_success "Constr...
Shell
#!/bin/sh test_description='test GIT_CEILING_DIRECTORIES' . ./test-lib.sh test_prefix() { test_expect_success "$1" \ "test '$2' = \"\$(git rev-parse --show-prefix)\"" } test_fail() { test_expect_success "$1: prefix" ' test_expect_code 128 git rev-parse --show-prefix ' } TRASH_ROOT="$PWD" ROOT_PARENT=$(dirname...
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 # # Copyright (c) 2007 Johannes E. Schindelin # test_description='add -e basic tests' . ./test-lib.sh cat > file << EOF LO, praise of the prowess of people-kings of spear-armed Danes, in days long sped, we have heard, and what honor the athelings won! Oft Scyld the Scefing from squadroned foes, from many a...
Shell
#!/bin/sh # # Copyright (c) 2009 Eric Wong test_description='git svn creates empty directories' . ./lib-git-svn.sh test_expect_success 'initialize repo' ' for i in a b c d d/e d/e/f "weird file name" do svn_cmd mkdir -m "mkdir $i" "$svnrepo"/"$i" done ' test_expect_success 'clone' 'git svn clone "$svnrepo" clon...
Shell
#!/bin/sh test_description='git grep in binary files' . ./test-lib.sh test_expect_success 'setup' " echo 'binaryQfile' | q_to_nul >a && git add a && git commit -m. " test_expect_success 'git grep ina a' ' echo Binary file a matches >expect && git grep ina a >actual && test_cmp expect actual ' test_expect_suc...
Shell
#!/bin/sh # # Copyright (c) 2010 Bo Yang # test_description='Test --follow should always find copies hard in git log. ' . ./test-lib.sh . "$TEST_DIRECTORY"/diff-lib.sh echo >path0 'Line 1 Line 2 Line 3 ' test_expect_success \ 'add a file path0 and commit.' \ 'git add path0 && git commit -m "Add path0"'...
Shell
#!/bin/sh # # Copyright (c) 2005 Fredrik Kuivinen # # See http://marc.theaimsgroup.com/?l=git&m=111463358500362&w=2 for a # nice description of what this is about. test_description='Test criss-cross merge' . ./test-lib.sh test_expect_success 'prepare repository' \ 'echo "1 2 3 4 5 6 7 8 9" > file && git add file &&...
Shell
#!/bin/sh # # 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='combined diff' . ./test-lib.sh setup_helper () { one=$1 branch=$2 side=$3 && git branch $side $branch && for l in $one two three fyra do echo $l done >file && git add file && test_tick && git commit -m $branch && git checkout $side && for l in $one two three quatro do echo...
Shell
#!/bin/sh # # Copyright (c) 2008 Brad King test_description='git svn dcommit honors auto-props' . ./lib-git-svn.sh generate_auto_props() { cat << EOF [miscellany] enable-auto-props=$1 [auto-props] *.sh = svn:mime-type=application/x-shellscript; svn:eol-style=LF *.txt = svn:mime-type=text/plain; svn:eol-style = nati...
Shell
#!/bin/sh # # Copyright (c) 2008 Kevin Ballard # test_description='git svn clone with percent escapes' . ./lib-git-svn.sh test_expect_success 'setup svnrepo' ' mkdir project project/trunk project/branches project/tags && echo foo > project/trunk/foo && svn_cmd import -m "$test_description" project "$svnrepo/pr jec...
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 -e ' read(STDIN, $buf...
Shell
#!/bin/sh # # Copyright (c) 2008 Dmitry V. Levin # test_description='fetch exit status test' . ./test-lib.sh test_expect_success setup ' >file && git add file && git commit -m initial && git checkout -b side && echo side >file && git commit -a -m side && git checkout master && echo next >file && git comm...
Shell
#!/bin/sh test_description='git rebase with its hook(s)' . ./test-lib.sh test_expect_success setup ' echo hello >file && git add file && test_tick && git commit -m initial && echo goodbye >file && git add file && test_tick && git commit -m second && git checkout -b side HEAD^ && echo world >git && git add...
Shell
#!/bin/sh test_description='checkout and pathspecs/refspecs ambiguities' . ./test-lib.sh test_expect_success 'setup' ' echo hello >world && echo hello >all && git add all world && git commit -m initial && git branch world ' test_expect_success 'reference must be a tree' ' test_must_fail git checkout $(git has...
Shell
#!/bin/sh test_description='diff --dirstat tests' . ./test-lib.sh # set up two commits where the second commit has these files # (10 lines in each file): # # unchanged/text (unchanged from 1st commit) # changed/text (changed 1st line) # rearranged/text (swapped 1st and 2nd line) #...
Shell
: sanitize_diff_raw='/^:/s/ '"$_x40"' '"$_x40"' \([A-Z]\)[0-9]* / X X \1# /' compare_diff_raw () { # When heuristics are improved, the score numbers would change. # Ignore them while comparing. # Also we do not check SHA1 hash generation in this test, which # is a job for t0000-basic.sh sed -e "$s...
Shell
#!/bin/sh test_description='Test cloning a repository larger than 2 gigabyte' . ./test-lib.sh if test -z "$GIT_TEST_CLONE_2GB" then say 'Skipping expensive 2GB clone test; enable it with GIT_TEST_CLONE_2GB=t' else test_set_prereq CLONE_2GB fi test_expect_success CLONE_2GB 'setup' ' git config pack.compression 0 ...
Shell
#!/bin/sh # # Copyright (c) 2005 Junio C Hamano # test_description='git update-index nonsense-path test. This test creates the following structure in the cache: path0 - a file path1 - a symlink path2/file2 - a file in a directory path3/file3 - a file in a directory and tries to git updat...
Shell
#!/bin/sh # # Copyright (c) 2007 Shawn O. Pearce # test_description='git apply -p handling.' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh test_expect_success setup ' mkdir sub && echo A >sub/file1 && cp sub/file1 file1.saved && git add sub/file1 && echo B >sub/file1 && git diff >patch.file && gi...
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='checkout from unborn branch protects contents' . ./test-lib.sh test_expect_success 'setup' ' mkdir parent && (cd parent && git init && echo content >file && git add file && git commit -m base ) && git fetch parent master:origin ' test_expect_success 'checkout from unborn prese...
Shell
#!/bin/sh # # Copyright (c) 2009 Mark Rada # test_description='gitweb as standalone script (parsing script output). This test runs gitweb (git web interface) as a CGI script from the commandline, and checks that it produces the correct output, either in the HTTP header or the actual script output.' . ./gitweb-lib.s...
Shell
#!/bin/sh test_description='git svn fetch deleted tag' . ./lib-git-svn.sh test_expect_success 'setup svn repo' ' mkdir -p import/trunk/subdir && mkdir -p import/branches && mkdir -p import/tags && echo "base" >import/trunk/subdir/file && svn_cmd import -m "import for git svn" import "$svnrepo" && rm -rf import...
Shell
#!/bin/sh test_description='fetch/push involving alternates' . ./test-lib.sh count_objects () { loose=0 inpack=0 eval "$( git count-objects -v | sed -n -e 's/^count: \(.*\)/loose=\1/p' \ -e 's/^in-pack: \(.*\)/inpack=\1/p' )" && echo $(( $loose + $inpack )) } test_expect_success setup ' ( git init ...
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 # # 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 # # Copyright (c) 2011 Ray Chen # test_description='git svn test (option --preserve-empty-dirs) This test uses git to clone a Subversion repository that contains empty directories, and checks that corresponding directories are created in the local Git repository with placeholder files.' . ./lib-git-svn.sh ...
Shell
#!/bin/sh test_description='git rev-list --pretty=format test' . ./test-lib.sh test_tick test_expect_success 'setup' ' touch foo && git add foo && git commit -m "added foo" && echo changed >foo && git commit -a -m "changed foo" ' # usage: test_format name format_string <expected_output test_format() { cat >expec...
Shell
#!/bin/sh # # Copyright (c) 2005 Junio C Hamano # test_description='git apply --stat --summary test, with --recount ' . ./test-lib.sh UNC='s/^\(@@ -[1-9][0-9]*\),[0-9]* \(+[1-9][0-9]*\),[0-9]* @@/\1,999 \2,999 @@/' num=0 while read title do num=$(( $num + 1 )) test_expect_success "$title" ' git apply --stat --s...
Shell
#!/bin/sh # Copyright (c) 2006, Junio C Hamano. test_description='Per branch config variables affects "git fetch". ' . ./test-lib.sh D=`pwd` test_bundle_object_count () { git verify-pack -v "$1" >verify.out && test "$2" = $(grep '^[0-9a-f]\{40\} ' verify.out | wc -l) } test_expect_success setup ' echo >file or...
Shell
#!/bin/sh test_description='test subject preservation with format-patch | am' . ./test-lib.sh make_patches() { type=$1 subject=$2 test_expect_success "create patches with $type subject" ' git reset --hard baseline && echo $type >file && git commit -a -m "$subject" && git format-patch -1 --stdout >$type.pat...
Shell
#!/bin/sh test_description='read-tree D/F conflict corner cases' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-read-tree.sh maketree () { ( rm -f .git/index .git/index.lock && git clean -d -f -f -q -x && name="$1" && shift && for it do path=$(expr "$it" : '\([^:]*\)') && mkdir -p $(dirname "$path") && ...
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/file0 - a file in a directory path1/file1 - a file in a directory and attempts to check it out when the work tree has: path0/file0 - a ...
Shell
#!/bin/sh test_description='checkout switching away from an invalid branch' . ./test-lib.sh test_expect_success 'setup' ' echo hello >world && git add world && git commit -m initial ' test_expect_success 'checkout should not start branch from a tree' ' test_must_fail git checkout -b newbranch master^{tree} ' t...
Shell
#!/bin/sh test_description='git am with options and not losing them' . ./test-lib.sh tm="$TEST_DIRECTORY/t4252" test_expect_success setup ' cp "$tm/file-1-0" file-1 && cp "$tm/file-2-0" file-2 && git add file-1 file-2 && test_tick && git commit -m initial && git tag initial ' test_expect_success 'interrupted ...
Shell
#!/bin/sh # # Copyright (c) 2007 Jakub Narebski # test_description='gitweb as standalone script (basic tests). This test runs gitweb (git web interface) as CGI script from commandline, and checks that it would not write any errors or warnings to log.' . ./gitweb-lib.sh # -------------------------------------------...
Shell
#!/bin/sh # # Copyright (c) 2008 David Aguilar # test_description='git submodule sync These tests exercise the "git submodule sync" subcommand. ' . ./test-lib.sh test_expect_success setup ' echo file > file && git add file && test_tick && git commit -m upstream && git clone . super && git clone super submodul...
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 # # Copyright (c) 2009 Mark Rada # test_description='gitweb as standalone script (http status tests). This test runs gitweb (git web interface) as a CGI script from the commandline, and checks that it returns the expected HTTP status code and message.' . ./gitweb-lib.sh # --------------------------------...
Shell
#!/bin/sh # # Copyright (c) 2007 Nguyễn Thái Ngọc Duy # test_description='Test repository version check' . ./test-lib.sh test_expect_success 'setup' ' cat >test.patch <<-\EOF && diff --git a/test.txt b/test.txt new file mode 100644 --- /dev/null +++ b/test.txt @@ -0,0 +1 @@ +123 EOF test_create_repo "test"...
Shell
#!/bin/sh test_description='cd_to_toplevel' . ./test-lib.sh test_cd_to_toplevel () { test_expect_success $3 "$2" ' ( cd '"'$1'"' && . "$(git --exec-path)"/git-sh-setup && cd_to_toplevel && [ "$(pwd -P)" = "$TOPLEVEL" ] ) ' } TOPLEVEL="$(pwd -P)/repo" mkdir -p repo/sub/dir mv .git repo/ SUBDIRECTOR...
Shell
#!/bin/sh # # Copyright (c) 2007 Eric Wong test_description='git svn dcommit can commit renames of files with ugly names' . ./lib-git-svn.sh test_expect_success 'load repository with strange names' ' svnadmin load -q "$rawsvnrepo" < "$TEST_DIRECTORY"/t9115/funky-names.dump && start_httpd gtk+ ' test_expect_succ...
Shell
#!/bin/sh test_description='ignore CR in CRLF sequence while computing similiarity' . ./test-lib.sh test_expect_success setup ' cat "$TEST_DIRECTORY"/t0022-crlf-rename.sh >sample && git add sample && test_tick && git commit -m Initial && append_cr <"$TEST_DIRECTORY"/t0022-crlf-rename.sh >elpmas && git add e...
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="recursive merge corner cases w/ renames but not criss-crosses" # t6036 has corner cases that involve both criss-cross merges and renames . ./test-lib.sh test_expect_success 'setup rename/delete + untracked file' ' echo "A pretty inscription" >ring && git add ring && test_tick && git c...
Shell
#!/bin/sh test_description='GIT_EDITOR, core.editor, and stuff' . ./test-lib.sh unset EDITOR VISUAL GIT_EDITOR test_expect_success 'determine default editor' ' vi=$(TERM=vt100 git var GIT_EDITOR) && test -n "$vi" ' if ! expr "$vi" : '[a-z]*$' >/dev/null then vi= fi for i in GIT_EDITOR core_editor EDITOR VISU...
Shell
#!/bin/sh test_description='git svn handling of root commits in merge ranges' . ./lib-git-svn.sh svn_ver="$(svn --version --quiet)" case $svn_ver in 0.* | 1.[0-4].*) skip_all="skipping git-svn test - SVN too old ($svn_ver)" test_done ;; esac test_expect_success 'test handling of root commits in merge ranges' ' mk...
Shell
#!/bin/sh # # Copyright (c) 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='test quickfetch from local' . ./test-lib.sh test_expect_success setup ' test_tick && echo ichi >file && git add file && git commit -m initial && cnt=$( ( git count-objects | sed -e "s/ *objects,.*//" ) ) && test $cnt -eq 3 ' test_expect_success 'clone without alternate' ' ( ...
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 # # 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 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 # # 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) 2006 Josh England # test_description='Test the post-checkout hook.' . ./test-lib.sh test_expect_success setup ' echo Data for commit0. >a && echo Data for commit0. >b && git update-index --add a && git update-index --add b && tree0=$(git write-tree) && commit0=$(echo setup | git comm...
Shell
#!/bin/sh test_description='Merge-recursive ours and theirs variants' . ./test-lib.sh test_expect_success setup ' for i in 1 2 3 4 5 6 7 8 9 do echo "$i" done >file && git add file && cp file elif && git commit -m initial && sed -e "s/1/one/" -e "s/9/nine/" >file <elif && git commit -a -m ours && git che...
Shell
#!/bin/sh # # Copyright (c) 2006 Junio C Hamano # test_description='various format-patch tests' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-terminal.sh test_expect_success setup ' for i in 1 2 3 4 5 6 7 8 9 10; do echo "$i"; done >file && cat file >elif && git add file elif && test_tick && git commit -m Initial &&...
Shell
#!/bin/sh test_description='git cat-file textconv support' . ./test-lib.sh cat >helper <<'EOF' #!/bin/sh grep -q '^bin: ' "$1" || { echo "E: $1 is not \"binary\" file" 1>&2; exit 1; } sed 's/^bin: /converted: /' "$1" EOF chmod +x helper test_expect_success 'setup ' ' echo "bin: test" >one.bin && if test_have_prere...
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='--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 # Copyright (c) 2007 Eric Wong test_description='git svn globbing refspecs' . ./lib-git-svn.sh cat > expect.end <<EOF the end hi start a new branch initial EOF test_expect_success 'test refspec globbing' ' mkdir -p trunk/src/a trunk/src/b trunk/doc && echo "hello world" > trunk/src/a/readme && echo "good...
Shell
#!/bin/sh # # Copyright (c) 2005 Junio C Hamano # test_description='git ls-tree test. This test runs git ls-tree with the following in a tree. path0 - a file path1 - a symlink path2/foo - a file in a directory path2/bazbo - a symlink in a directory path2/baz/b - a file in a directory in a...
Shell
#!/bin/sh test_description='git svn fetch deleted tag 2' . ./lib-git-svn.sh test_expect_success 'setup svn repo' ' mkdir -p import/branches && mkdir -p import/tags && mkdir -p import/trunk/subdir1 && mkdir -p import/trunk/subdir2 && mkdir -p import/trunk/subdir3 && echo "file1" >import/trunk/subdir1/file && e...
Shell
#!/bin/sh # # Copyright (c) 2006 Junio C Hamano # test_description='git apply with new style GNU diff with empty context ' . ./test-lib.sh test_expect_success setup ' { echo; echo; echo A; echo B; echo C; echo; } >file1 && cat file1 >file1.orig && { cat file1 && echo Q | tr -d "\\012" } >file2 && ca...
Shell
#!/bin/sh test_description='merge fast-forward and up to date' . ./test-lib.sh test_expect_success setup ' >file && git add file && test_tick && git commit -m initial && git tag c0 && echo second >file && git add file && test_tick && git commit -m second && git tag c1 && git branch test ' test_expect_su...
Shell
#!/bin/sh # # Copyright (c) 2007, 2009 Sam Vilain # test_description='git-svn svn mergeinfo properties' . ./lib-git-svn.sh test_expect_success 'load svn dump' " svnadmin load -q '$rawsvnrepo' \ < '$TEST_DIRECTORY/t9151/svn-mergeinfo.dump' && git svn init --minimize-url -R svnmerge \ --rewrite-root=http://svn...
Shell
#!/bin/sh test_description='blob conversion via gitattributes' . ./test-lib.sh cat <<EOF >rot13.sh #!$SHELL_PATH tr \ 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' \ 'nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM' EOF chmod +x rot13.sh test_expect_success setup ' git config filter.rot13.smudge ...
Shell
#!/bin/sh # # Copyright (c) 2006 Junio C Hamano # test_description='i18n settings and format-patch | am pipe' . ./test-lib.sh check_encoding () { # Make sure characters are not corrupted cnt="$1" header="$2" i=1 j=0 bad=0 while test "$i" -le $cnt do git format-patch --encoding=UTF-8 --stdout HEAD~$i..HEAD~$j |...
Shell
#!/bin/sh # # Copyright (c) 2010 Jay Soffian # test_description='git svn fancy glob test' . ./lib-git-svn.sh test_expect_success 'load svn repo' " svnadmin load -q '$rawsvnrepo' < '$TEST_DIRECTORY/t9154/svn.dump' && git svn init --minimize-url -T trunk '$svnrepo' && git svn fetch " test_expect_success 'add red ...
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