diff options
Diffstat (limited to 't')
120 files changed, 3592 insertions, 280 deletions
diff --git a/t/diff-lib.sh b/t/diff-lib.sh index 745a1b0311..4624fe654c 100755 --- a/t/diff-lib.sh +++ b/t/diff-lib.sh @@ -11,7 +11,7 @@ compare_diff_raw () { sed -e "$sanitize_diff_raw" <"$1" >.tmp-1 sed -e "$sanitize_diff_raw" <"$2" >.tmp-2 - diff -u .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2 + git diff .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2 } sanitize_diff_raw_z='/^:/s/ '"$_x40"' '"$_x40"' \([A-Z]\)[0-9]*$/ X X \1#/' @@ -23,7 +23,7 @@ compare_diff_raw_z () { tr '\0' '\012' <"$1" | sed -e "$sanitize_diff_raw_z" >.tmp-1 tr '\0' '\012' <"$2" | sed -e "$sanitize_diff_raw_z" >.tmp-2 - diff -u .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2 + git diff .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2 } compare_diff_patch () { @@ -37,5 +37,5 @@ compare_diff_patch () { /^[dis]*imilarity index [0-9]*%$/d /^index [0-9a-f]*\.\.[0-9a-f]/d ' <"$2" >.tmp-2 - diff -u .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2 + git diff .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2 } diff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh index 67d08cf740..f6fe78cd27 100644 --- a/t/lib-git-svn.sh +++ b/t/lib-git-svn.sh @@ -42,9 +42,9 @@ then exit fi +rawsvnrepo="$svnrepo" svnrepo="file://$svnrepo" - poke() { - perl -e '@x = stat($ARGV[0]); utime($x[8], $x[9] + 1, $ARGV[0])' "$1" + test-chmtime +1 "$1" } diff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh new file mode 100755 index 0000000000..723b29ad17 --- /dev/null +++ b/t/t0020-crlf.sh @@ -0,0 +1,217 @@ +#!/bin/sh + +test_description='CRLF conversion' + +. ./test-lib.sh + +append_cr () { + sed -e 's/$/Q/' | tr Q '\015' +} + +remove_cr () { + tr '\015' Q <"$1" | grep Q >/dev/null && + tr '\015' Q <"$1" | sed -ne 's/Q$//p' +} + +test_expect_success setup ' + + git repo-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/two && + git add . && + + git commit -m initial && + + one=`git rev-parse HEAD:one` && + dir=`git rev-parse HEAD:dir` && + two=`git rev-parse HEAD:dir/two` && + + for w in Some extra lines here; do echo $w; done >>one && + git diff >patch.file && + patched=`git hash-object --stdin <one` && + git read-tree --reset -u HEAD && + + echo happy. +' + +test_expect_success 'update with autocrlf=input' ' + + rm -f tmp one dir/two && + git read-tree --reset -u HEAD && + git repo-config core.autocrlf input && + + for f in one dir/two + do + append_cr <$f >tmp && mv -f tmp $f && + git update-index -- $f || { + echo Oops + false + break + } + done && + + differs=`git diff-index --cached HEAD` && + test -z "$differs" || { + echo Oops "$differs" + false + } + +' + +test_expect_success 'update with autocrlf=true' ' + + rm -f tmp one dir/two && + git read-tree --reset -u HEAD && + git repo-config core.autocrlf true && + + for f in one dir/two + do + append_cr <$f >tmp && mv -f tmp $f && + git update-index -- $f || { + echo "Oops $f" + false + break + } + done && + + differs=`git diff-index --cached HEAD` && + test -z "$differs" || { + echo Oops "$differs" + false + } + +' + +test_expect_success 'checkout with autocrlf=true' ' + + rm -f tmp one dir/two && + git repo-config core.autocrlf true && + git read-tree --reset -u HEAD && + + for f in one dir/two + do + remove_cr "$f" >tmp && mv -f tmp $f && + git update-index -- $f || { + echo "Eh? $f" + false + break + } + done && + test "$one" = `git hash-object --stdin <one` && + test "$two" = `git hash-object --stdin <dir/two` && + differs=`git diff-index --cached HEAD` && + test -z "$differs" || { + echo Oops "$differs" + false + } +' + +test_expect_success 'checkout with autocrlf=input' ' + + rm -f tmp one dir/two && + git repo-config core.autocrlf input && + git read-tree --reset -u HEAD && + + for f in one dir/two + do + if remove_cr "$f" >/dev/null + then + echo "Eh? $f" + false + break + else + git update-index -- $f + fi + done && + test "$one" = `git hash-object --stdin <one` && + test "$two" = `git hash-object --stdin <dir/two` && + differs=`git diff-index --cached HEAD` && + test -z "$differs" || { + echo Oops "$differs" + false + } +' + +test_expect_success 'apply patch (autocrlf=input)' ' + + rm -f tmp one dir/two && + git repo-config core.autocrlf input && + git read-tree --reset -u HEAD && + + git apply patch.file && + test "$patched" = "`git hash-object --stdin <one`" || { + echo "Eh? apply without index" + false + } +' + +test_expect_success 'apply patch --cached (autocrlf=input)' ' + + rm -f tmp one dir/two && + git repo-config core.autocrlf input && + git read-tree --reset -u HEAD && + + git apply --cached patch.file && + test "$patched" = `git rev-parse :one` || { + echo "Eh? apply with --cached" + false + } +' + +test_expect_success 'apply patch --index (autocrlf=input)' ' + + rm -f tmp one dir/two && + git repo-config core.autocrlf input && + git read-tree --reset -u HEAD && + + git apply --index patch.file && + test "$patched" = `git rev-parse :one` && + test "$patched" = `git hash-object --stdin <one` || { + echo "Eh? apply with --index" + false + } +' + +test_expect_success 'apply patch (autocrlf=true)' ' + + rm -f tmp one dir/two && + git repo-config core.autocrlf true && + git read-tree --reset -u HEAD && + + git apply patch.file && + test "$patched" = "`remove_cr one | git hash-object --stdin`" || { + echo "Eh? apply without index" + false + } +' + +test_expect_success 'apply patch --cached (autocrlf=true)' ' + + rm -f tmp one dir/two && + git repo-config core.autocrlf true && + git read-tree --reset -u HEAD && + + git apply --cached patch.file && + test "$patched" = `git rev-parse :one` || { + echo "Eh? apply without index" + false + } +' + +test_expect_success 'apply patch --index (autocrlf=true)' ' + + rm -f tmp one dir/two && + git repo-config core.autocrlf true && + git read-tree --reset -u HEAD && + + git apply --index patch.file && + test "$patched" = `git rev-parse :one` && + test "$patched" = "`remove_cr one | git hash-object --stdin`" || { + echo "Eh? apply with --index" + false + } +' + +test_done diff --git a/t/t1000-read-tree-m-3way.sh b/t/t1000-read-tree-m-3way.sh index d0af8c3d52..e26a36cf0f 100755 --- a/t/t1000-read-tree-m-3way.sh +++ b/t/t1000-read-tree-m-3way.sh @@ -131,7 +131,7 @@ _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40" check_result () { git-ls-files --stage | sed -e 's/ '"$_x40"' / X /' >current && - diff -u expected current + git diff expected current } # This is done on an empty work directory, which is the normal diff --git a/t/t1001-read-tree-m-2way.sh b/t/t1001-read-tree-m-2way.sh index 75e4c9a886..030226bbfb 100755 --- a/t/t1001-read-tree-m-2way.sh +++ b/t/t1001-read-tree-m-2way.sh @@ -33,7 +33,7 @@ compare_change () { -e '/^--- /d; /^+++ /d; /^@@ /d;' \ -e 's/^\([-+][0-7][0-7][0-7][0-7][0-7][0-7]\) '"$_x40"' /\1 X /p' \ "$1" - diff -u expected current + git diff expected current } check_cache_at () { @@ -86,7 +86,7 @@ test_expect_success \ 'rm -f .git/index && read_tree_twoway $treeH $treeM && git-ls-files --stage >1-3.out && - diff -u M.out 1-3.out && + git diff M.out 1-3.out && check_cache_at bozbar dirty && check_cache_at frotz dirty && check_cache_at nitfol dirty' @@ -101,7 +101,7 @@ test_expect_success \ git-update-index --add yomin && read_tree_twoway $treeH $treeM && git-ls-files --stage >4.out || return 1 - diff -u M.out 4.out >4diff.out + git diff M.out 4.out >4diff.out compare_change 4diff.out expected && check_cache_at yomin clean' @@ -115,7 +115,7 @@ test_expect_success \ echo yomin yomin >yomin && read_tree_twoway $treeH $treeM && git-ls-files --stage >5.out || return 1 - diff -u M.out 5.out >5diff.out + git diff M.out 5.out >5diff.out compare_change 5diff.out expected && check_cache_at yomin dirty' @@ -127,7 +127,7 @@ test_expect_success \ git-update-index --add frotz && read_tree_twoway $treeH $treeM && git-ls-files --stage >6.out && - diff -u M.out 6.out && + git diff M.out 6.out && check_cache_at frotz clean' test_expect_success \ @@ -140,7 +140,7 @@ test_expect_success \ echo frotz frotz >frotz && read_tree_twoway $treeH $treeM && git-ls-files --stage >7.out && - diff -u M.out 7.out && + git diff M.out 7.out && check_cache_at frotz dirty' test_expect_success \ @@ -171,7 +171,7 @@ test_expect_success \ git-update-index --add rezrov && read_tree_twoway $treeH $treeM && git-ls-files --stage >10.out && - diff -u M.out 10.out' + git diff M.out 10.out' test_expect_success \ '11 - dirty path removed.' \ @@ -216,7 +216,7 @@ test_expect_success \ git-update-index --add nitfol && read_tree_twoway $treeH $treeM && git-ls-files --stage >14.out || return 1 - diff -u M.out 14.out >14diff.out + git diff M.out 14.out >14diff.out compare_change 14diff.out expected && check_cache_at nitfol clean' @@ -230,7 +230,7 @@ test_expect_success \ echo nitfol nitfol nitfol >nitfol && read_tree_twoway $treeH $treeM && git-ls-files --stage >15.out || return 1 - diff -u M.out 15.out >15diff.out + git diff M.out 15.out >15diff.out compare_change 15diff.out expected && check_cache_at nitfol dirty' @@ -262,7 +262,7 @@ test_expect_success \ git-update-index --add bozbar && read_tree_twoway $treeH $treeM && git-ls-files --stage >18.out && - diff -u M.out 18.out && + git diff M.out 18.out && check_cache_at bozbar clean' test_expect_success \ @@ -275,7 +275,7 @@ test_expect_success \ echo gnusto gnusto >bozbar && read_tree_twoway $treeH $treeM && git-ls-files --stage >19.out && - diff -u M.out 19.out && + git diff M.out 19.out && check_cache_at bozbar dirty' test_expect_success \ @@ -287,7 +287,7 @@ test_expect_success \ git-update-index --add bozbar && read_tree_twoway $treeH $treeM && git-ls-files --stage >20.out && - diff -u M.out 20.out && + git diff M.out 20.out && check_cache_at bozbar dirty' test_expect_success \ @@ -337,7 +337,7 @@ test_expect_success \ git-update-index --add DF && read_tree_twoway $treeDF $treeDFDF && git-ls-files --stage >DFDFcheck.out && - diff -u DFDF.out DFDFcheck.out && + git diff DFDF.out DFDFcheck.out && check_cache_at DF/DF dirty && :' diff --git a/t/t1002-read-tree-m-u-2way.sh b/t/t1002-read-tree-m-u-2way.sh index da3c81357b..87fe993f59 100755 --- a/t/t1002-read-tree-m-u-2way.sh +++ b/t/t1002-read-tree-m-u-2way.sh @@ -16,7 +16,7 @@ compare_change () { sed >current \ -e '/^--- /d; /^+++ /d; /^@@ /d;' \ -e 's/^\(.[0-7][0-7][0-7][0-7][0-7][0-7]\) '"$_x40"' /\1 X /' "$1" - diff -u expected current + git diff expected current } check_cache_at () { diff --git a/t/t1200-tutorial.sh b/t/t1200-tutorial.sh index eebe643bda..ca2c30f7af 100755 --- a/t/t1200-tutorial.sh +++ b/t/t1200-tutorial.sh @@ -101,7 +101,9 @@ echo "Play, play, play" >>hello echo "Lots of fun" >>example git commit -m 'Some fun.' -i hello example -test_expect_failure 'git resolve now fails' 'git resolve HEAD mybranch "Merge work in mybranch"' +test_expect_failure 'git resolve now fails' ' + git merge -m "Merge work in mybranch" mybranch +' cat > hello << EOF Hello World @@ -134,8 +136,8 @@ Updating from VARIABLE to VARIABLE 2 files changed, 2 insertions(+), 0 deletions(-) EOF -git resolve HEAD master "Merge upstream changes." | \ - sed -e "1s/[0-9a-f]\{40\}/VARIABLE/g" > resolve.output +git merge -s "Merge upstream changes." master | \ + sed -e "1s/[0-9a-f]\{40\}/VARIABLE/g" >resolve.output test_expect_success 'git resolve' 'cmp resolve.expect resolve.output' cat > show-branch2.expect << EOF diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index 49b5666b33..78c2e0864f 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@ -368,12 +368,12 @@ cat > expect << EOF weird EOF -test_expect_success "rename succeeded" "diff -u expect .git/config" +test_expect_success "rename succeeded" "git diff expect .git/config" test_expect_failure "rename non-existing section" \ 'git-config --rename-section branch."world domination" branch.drei' -test_expect_success "rename succeeded" "diff -u expect .git/config" +test_expect_success "rename succeeded" "git diff expect .git/config" test_expect_success "rename another section" \ 'git-config --rename-section branch."1 234 blabl/a" branch.drei' @@ -389,7 +389,23 @@ cat > expect << EOF weird EOF -test_expect_success "rename succeeded" "diff -u expect .git/config" +test_expect_success "rename succeeded" "git diff expect .git/config" + +cat >> .git/config << EOF + [branch "zwei"] a = 1 [branch "vier"] +EOF + +test_expect_success "remove section" "git config --remove-section branch.zwei" + +cat > expect << EOF +# Hallo + #Bello +[branch "drei"] +weird +EOF + +test_expect_success "section was removed properly" \ + "git diff -u expect .git/config" test_expect_success numbers ' diff --git a/t/t2005-checkout-index-symlinks.sh b/t/t2005-checkout-index-symlinks.sh new file mode 100755 index 0000000000..e34a515333 --- /dev/null +++ b/t/t2005-checkout-index-symlinks.sh @@ -0,0 +1,28 @@ +#!/bin/sh +# +# Copyright (c) 2007 Johannes Sixt +# + +test_description='git-checkout-index on filesystem w/o symlinks test. + +This tests that git-checkout-index creates a symbolic link as a plain +file if core.symlinks is false.' + +. ./test-lib.sh + +test_expect_success \ +'preparation' ' +git-config core.symlinks false && +l=$(echo -n file | git-hash-object -t blob -w --stdin) && +echo "120000 $l symlink" | git-update-index --index-info' + +test_expect_success \ +'the checked-out symlink must be a file' ' +git-checkout-index symlink && +test -f symlink' + +test_expect_success \ +'the file must be the blob we added during the setup' ' +test "$(git-hash-object -t blob symlink)" = $l' + +test_done diff --git a/t/t2102-update-index-symlinks.sh b/t/t2102-update-index-symlinks.sh new file mode 100755 index 0000000000..969ef891d3 --- /dev/null +++ b/t/t2102-update-index-symlinks.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# +# Copyright (c) 2007 Johannes Sixt +# + +test_description='git-update-index on filesystem w/o symlinks test. + +This tests that git-update-index keeps the symbolic link property +even if a plain file is in the working tree if core.symlinks is false.' + +. ./test-lib.sh + +test_expect_success \ +'preparation' ' +git-config core.symlinks false && +l=$(echo -n file | git-hash-object -t blob -w --stdin) && +echo "120000 $l symlink" | git-update-index --index-info' + +test_expect_success \ +'modify the symbolic link' ' +echo -n new-file > symlink && +git-update-index symlink' + +test_expect_success \ +'the index entry must still be a symbolic link' ' +case "`git-ls-files --stage --cached symlink`" in +120000" "*symlink) echo ok;; +*) echo fail; git-ls-files --stage --cached symlink; (exit 1);; +esac' + +test_done diff --git a/t/t3001-ls-files-others-exclude.sh b/t/t3001-ls-files-others-exclude.sh index 6979b7c1c0..db7a847a5d 100755 --- a/t/t3001-ls-files-others-exclude.sh +++ b/t/t3001-ls-files-others-exclude.sh @@ -65,7 +65,7 @@ test_expect_success \ --exclude-per-directory=.gitignore \ --exclude-from=.git/ignore \ >output && - diff -u expect output' + git diff expect output' # Test \r\n (MSDOS-like systems) printf '*.1\r\n/*.3\r\n!*.6\r\n' >.gitignore @@ -77,6 +77,6 @@ test_expect_success \ --exclude-per-directory=.gitignore \ --exclude-from=.git/ignore \ >output && - diff -u expect output' + git diff expect output' test_done diff --git a/t/t3002-ls-files-dashpath.sh b/t/t3002-ls-files-dashpath.sh index b42f1382bc..cc8967d76b 100755 --- a/t/t3002-ls-files-dashpath.sh +++ b/t/t3002-ls-files-dashpath.sh @@ -23,7 +23,7 @@ test_expect_success \ test_expect_success \ 'git-ls-files without path restriction.' \ 'git-ls-files --others >output && - diff -u output - <<EOF + git diff output - <<EOF -- -foo output @@ -34,7 +34,7 @@ EOF test_expect_success \ 'git-ls-files with path restriction.' \ 'git-ls-files --others path0 >output && - diff -u output - <<EOF + git diff output - <<EOF path0 EOF ' @@ -42,7 +42,7 @@ EOF test_expect_success \ 'git-ls-files with path restriction with --.' \ 'git-ls-files --others -- path0 >output && - diff -u output - <<EOF + git diff output - <<EOF path0 EOF ' @@ -50,7 +50,7 @@ EOF test_expect_success \ 'git-ls-files with path restriction with -- --.' \ 'git-ls-files --others -- -- >output && - diff -u output - <<EOF + git diff output - <<EOF -- EOF ' @@ -58,7 +58,7 @@ EOF test_expect_success \ 'git-ls-files with no path restriction.' \ 'git-ls-files --others -- >output && - diff -u output - <<EOF + git diff output - <<EOF -- -foo output diff --git a/t/t3100-ls-tree-restrict.sh b/t/t3100-ls-tree-restrict.sh index 2ec06d3d39..e10749245b 100755 --- a/t/t3100-ls-tree-restrict.sh +++ b/t/t3100-ls-tree-restrict.sh @@ -35,7 +35,7 @@ _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]' _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40" test_output () { sed -e "s/ $_x40 / X /" <current >check - diff -u expected check + git diff expected check } test_expect_success \ diff --git a/t/t3101-ls-tree-dirname.sh b/t/t3101-ls-tree-dirname.sh index d78deb1e71..087929a4bf 100755 --- a/t/t3101-ls-tree-dirname.sh +++ b/t/t3101-ls-tree-dirname.sh @@ -43,7 +43,7 @@ _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]' _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40" test_output () { sed -e "s/ $_x40 / X /" <current >check - diff -u expected check + git diff expected check } test_expect_success \ diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh index 5565c27033..75c000a968 100755 --- a/t/t3200-branch.sh +++ b/t/t3200-branch.sh @@ -47,17 +47,6 @@ test_expect_success \ test ! -f .git/refs/heads/d/e/f && test ! -f .git/logs/refs/heads/d/e/f' -cat >expect <<EOF -0000000000000000000000000000000000000000 $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000 checkout: Created from master -EOF -test_expect_success \ - 'git checkout -b g/h/i -l should create a branch and a log' \ - 'GIT_COMMITTER_DATE="2005-05-26 23:30" \ - git-checkout -b g/h/i -l master && - test -f .git/refs/heads/g/h/i && - test -f .git/logs/refs/heads/g/h/i && - diff expect .git/logs/refs/heads/g/h/i' - test_expect_success \ 'git branch j/k should work after branch j has been deleted' \ 'git-branch j && @@ -117,4 +106,58 @@ test_expect_failure \ ln -s real-u .git/logs/refs/heads/u && git-branch -m u v' +test_expect_success 'test tracking setup via --track' \ + 'git-config remote.local.url . && + git-config remote.local.fetch refs/heads/*:refs/remotes/local/* && + (git-show-ref -q refs/remotes/local/master || git-fetch local) && + git-branch --track my1 local/master && + test $(git-config branch.my1.remote) = local && + test $(git-config branch.my1.merge) = refs/heads/master' + +test_expect_success 'test tracking setup (non-wildcard, matching)' \ + 'git-config remote.local.url . && + git-config remote.local.fetch refs/heads/master:refs/remotes/local/master && + (git-show-ref -q refs/remotes/local/master || git-fetch local) && + git-branch --track my4 local/master && + test $(git-config branch.my4.remote) = local && + test $(git-config branch.my4.merge) = refs/heads/master' + +test_expect_success 'test tracking setup (non-wildcard, not matching)' \ + 'git-config remote.local.url . && + git-config remote.local.fetch refs/heads/s:refs/remotes/local/s && + (git-show-ref -q refs/remotes/local/master || git-fetch local) && + git-branch --track my5 local/master && + ! test $(git-config branch.my5.remote) = local && + ! test $(git-config branch.my5.merge) = refs/heads/master' + +test_expect_success 'test tracking setup via config' \ + 'git-config branch.autosetupmerge true && + git-config remote.local.url . && + git-config remote.local.fetch refs/heads/*:refs/remotes/local/* && + (git-show-ref -q refs/remotes/local/master || git-fetch local) && + git-branch my3 local/master && + test $(git-config branch.my3.remote) = local && + test $(git-config branch.my3.merge) = refs/heads/master' + +test_expect_success 'test overriding tracking setup via --no-track' \ + 'git-config branch.autosetupmerge true && + git-config remote.local.url . && + git-config remote.local.fetch refs/heads/*:refs/remotes/local/* && + (git-show-ref -q refs/remotes/local/master || git-fetch local) && + git-branch --no-track my2 local/master && + ! test $(git-config branch.my2.remote) = local && + ! test $(git-config branch.my2.merge) = refs/heads/master' + +# Keep this test last, as it changes the current branch +cat >expect <<EOF +0000000000000000000000000000000000000000 $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000 branch: Created from master +EOF +test_expect_success \ + 'git checkout -b g/h/i -l should create a branch and a log' \ + 'GIT_COMMITTER_DATE="2005-05-26 23:30" \ + git-checkout -b g/h/i -l master && + test -f .git/refs/heads/g/h/i && + test -f .git/logs/refs/heads/g/h/i && + diff expect .git/logs/refs/heads/g/h/i' + test_done diff --git a/t/t3300-funny-names.sh b/t/t3300-funny-names.sh index c12270efab..b5a1400e18 100755 --- a/t/t3300-funny-names.sh +++ b/t/t3300-funny-names.sh @@ -35,7 +35,7 @@ no-funny' >expected test_expect_success 'git-ls-files no-funny' \ 'git-update-index --add "$p0" "$p2" && git-ls-files >current && - diff -u expected current' + git diff expected current' t0=`git-write-tree` echo "$t0" >t0 @@ -48,14 +48,14 @@ EOF test_expect_success 'git-ls-files with-funny' \ 'git-update-index --add "$p1" && git-ls-files >current && - diff -u expected current' + git diff expected current' echo 'just space no-funny tabs ," (dq) and spaces' >expected test_expect_success 'git-ls-files -z with-funny' \ 'git-ls-files -z | tr \\0 \\012 >current && - diff -u expected current' + git diff expected current' t1=`git-write-tree` echo "$t1" >t1 @@ -67,28 +67,28 @@ no-funny EOF test_expect_success 'git-ls-tree with funny' \ 'git-ls-tree -r $t1 | sed -e "s/^[^ ]* //" >current && - diff -u expected current' + git diff expected current' cat > expected <<\EOF A "tabs\t,\" (dq) and spaces" EOF test_expect_success 'git-diff-index with-funny' \ 'git-diff-index --name-status $t0 >current && - diff -u expected current' + git diff expected current' test_expect_success 'git-diff-tree with-funny' \ 'git-diff-tree --name-status $t0 $t1 >current && - diff -u expected current' + git diff expected current' echo 'A tabs ," (dq) and spaces' >expected test_expect_success 'git-diff-index -z with-funny' \ 'git-diff-index -z --name-status $t0 | tr \\0 \\012 >current && - diff -u expected current' + git diff expected current' test_expect_success 'git-diff-tree -z with-funny' \ 'git-diff-tree -z --name-status $t0 $t1 | tr \\0 \\012 >current && - diff -u expected current' + git diff expected current' cat > expected <<\EOF CNUM no-funny "tabs\t,\" (dq) and spaces" @@ -96,7 +96,7 @@ EOF test_expect_success 'git-diff-tree -C with-funny' \ 'git-diff-tree -C --find-copies-harder --name-status \ $t0 $t1 | sed -e 's/^C[0-9]*/CNUM/' >current && - diff -u expected current' + git diff expected current' cat > expected <<\EOF RNUM no-funny "tabs\t,\" (dq) and spaces" @@ -105,7 +105,7 @@ test_expect_success 'git-diff-tree delete with-funny' \ 'git-update-index --force-remove "$p0" && git-diff-index -M --name-status \ $t0 | sed -e 's/^R[0-9]*/RNUM/' >current && - diff -u expected current' + git diff expected current' cat > expected <<\EOF diff --git a/no-funny "b/tabs\t,\" (dq) and spaces" @@ -116,7 +116,7 @@ EOF test_expect_success 'git-diff-tree delete with-funny' \ 'git-diff-index -M -p $t0 | sed -e "s/index [0-9]*%/index NUM%/" >current && - diff -u expected current' + git diff expected current' chmod +x "$p1" cat > expected <<\EOF @@ -130,7 +130,7 @@ EOF test_expect_success 'git-diff-tree delete with-funny' \ 'git-diff-index -M -p $t0 | sed -e "s/index [0-9]*%/index NUM%/" >current && - diff -u expected current' + git diff expected current' cat >expected <<\EOF "tabs\t,\" (dq) and spaces" @@ -139,7 +139,7 @@ EOF test_expect_success 'git-diff-tree rename with-funny applied' \ 'git-diff-index -M -p $t0 | git-apply --stat | sed -e "s/|.*//" -e "s/ *\$//" >current && - diff -u expected current' + git diff expected current' cat > expected <<\EOF no-funny @@ -149,12 +149,12 @@ EOF test_expect_success 'git-diff-tree delete with-funny applied' \ 'git-diff-index -p $t0 | git-apply --stat | sed -e "s/|.*//" -e "s/ *\$//" >current && - diff -u expected current' + git diff expected current' test_expect_success 'git-apply non-git diff' \ 'git-diff-index -p $t0 | sed -ne "/^[-+@]/p" | git-apply --stat | sed -e "s/|.*//" -e "s/ *\$//" >current && - diff -u expected current' + git diff expected current' test_done diff --git a/t/t3900-i18n-commit.sh b/t/t3900-i18n-commit.sh index e54fe0f401..ffddb68db3 100755 --- a/t/t3900-i18n-commit.sh +++ b/t/t3900-i18n-commit.sh @@ -9,7 +9,7 @@ test_description='commit and log output encodings' compare_with () { git-show -s $1 | sed -e '1,/^$/d' -e 's/^ //' -e '$d' >current && - diff -u current "$2" + git diff current "$2" } test_expect_success setup ' diff --git a/t/t4006-diff-mode.sh b/t/t4006-diff-mode.sh index ca342f48a1..e72c6fd1b4 100755 --- a/t/t4006-diff-mode.sh +++ b/t/t4006-diff-mode.sh @@ -38,7 +38,7 @@ echo ":100644 100755 X X M rezrov" >expected test_expect_success \ 'verify' \ - 'diff -u expected check' + 'git diff expected check' test_done diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh index 3d85ceaae9..488e075c16 100755 --- a/t/t4013-diff-various.sh +++ b/t/t4013-diff-various.sh @@ -106,12 +106,12 @@ do echo "\$ git $cmd" git $cmd | sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \ - -e "s/^\\( *boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/" + -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/" echo "\$" } >"$actual" && if test -f "$expect" then - diff -u "$expect" "$actual" && + git diff "$expect" "$actual" && rm -f "$actual" else # this is to help developing new tests. @@ -238,6 +238,9 @@ format-patch --stdout initial..master format-patch --attach --stdout initial..side format-patch --attach --stdout initial..master^ format-patch --attach --stdout initial..master +format-patch --inline --stdout initial..side +format-patch --inline --stdout initial..master^ +format-patch --inline --stdout initial..master diff --abbrev initial..side diff -r initial..side diff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..master b/t/t4013/diff.format-patch_--attach_--stdout_initial..master index e5ddd6fcbb..cf6891f748 100644 --- a/t/t4013/diff.format-patch_--attach_--stdout_initial..master +++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master @@ -4,8 +4,7 @@ From: A U Thor <author@example.com> Date: Mon, 26 Jun 2006 00:01:00 +0000 Subject: [PATCH] Second MIME-Version: 1.0 -Content-Type: multipart/mixed; - boundary="------------g-i-t--v-e-r-s-i-o-n" +Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n" This is a multi-part message in MIME format. --------------g-i-t--v-e-r-s-i-o-n @@ -21,11 +20,9 @@ This is the second commit. 3 files changed, 5 insertions(+), 3 deletions(-) delete mode 100644 file2 --------------g-i-t--v-e-r-s-i-o-n -Content-Type: text/x-patch; - name="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff" +Content-Type: text/x-patch; name="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff" Content-Transfer-Encoding: 8bit -Content-Disposition: inline; - filename="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff" +Content-Disposition: attachment; filename="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff" diff --git a/dir/sub b/dir/sub index 35d242b..8422d40 100644 @@ -66,8 +63,7 @@ From: A U Thor <author@example.com> Date: Mon, 26 Jun 2006 00:02:00 +0000 Subject: [PATCH] Third MIME-Version: 1.0 -Content-Type: multipart/mixed; - boundary="------------g-i-t--v-e-r-s-i-o-n" +Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n" This is a multi-part message in MIME format. --------------g-i-t--v-e-r-s-i-o-n @@ -80,11 +76,9 @@ Content-Transfer-Encoding: 8bit 2 files changed, 5 insertions(+), 0 deletions(-) create mode 100644 file1 --------------g-i-t--v-e-r-s-i-o-n -Content-Type: text/x-patch; - name="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff" +Content-Type: text/x-patch; name="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff" Content-Transfer-Encoding: 8bit -Content-Disposition: inline; - filename="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff" +Content-Disposition: attachment; filename="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff" diff --git a/dir/sub b/dir/sub index 8422d40..cead32e 100644 @@ -115,8 +109,7 @@ From: A U Thor <author@example.com> Date: Mon, 26 Jun 2006 00:03:00 +0000 Subject: [PATCH] Side MIME-Version: 1.0 -Content-Type: multipart/mixed; - boundary="------------g-i-t--v-e-r-s-i-o-n" +Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n" This is a multi-part message in MIME format. --------------g-i-t--v-e-r-s-i-o-n @@ -130,11 +123,9 @@ Content-Transfer-Encoding: 8bit 3 files changed, 9 insertions(+), 0 deletions(-) create mode 100644 file3 --------------g-i-t--v-e-r-s-i-o-n -Content-Type: text/x-patch; - name="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff" +Content-Type: text/x-patch; name="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff" Content-Transfer-Encoding: 8bit -Content-Disposition: inline; - filename="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff" +Content-Disposition: attachment; filename="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff" diff --git a/dir/sub b/dir/sub index 35d242b..7289e35 100644 diff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..master^ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master^ index d0dd19b623..fe0258720c 100644 --- a/t/t4013/diff.format-patch_--attach_--stdout_initial..master^ +++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master^ @@ -4,8 +4,7 @@ From: A U Thor <author@example.com> Date: Mon, 26 Jun 2006 00:01:00 +0000 Subject: [PATCH] Second MIME-Version: 1.0 -Content-Type: multipart/mixed; - boundary="------------g-i-t--v-e-r-s-i-o-n" +Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n" This is a multi-part message in MIME format. --------------g-i-t--v-e-r-s-i-o-n @@ -21,11 +20,9 @@ This is the second commit. 3 files changed, 5 insertions(+), 3 deletions(-) delete mode 100644 file2 --------------g-i-t--v-e-r-s-i-o-n -Content-Type: text/x-patch; - name="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff" +Content-Type: text/x-patch; name="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff" Content-Transfer-Encoding: 8bit -Content-Disposition: inline; - filename="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff" +Content-Disposition: attachment; filename="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff" diff --git a/dir/sub b/dir/sub index 35d242b..8422d40 100644 @@ -66,8 +63,7 @@ From: A U Thor <author@example.com> Date: Mon, 26 Jun 2006 00:02:00 +0000 Subject: [PATCH] Third MIME-Version: 1.0 -Content-Type: multipart/mixed; - boundary="------------g-i-t--v-e-r-s-i-o-n" +Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n" This is a multi-part message in MIME format. --------------g-i-t--v-e-r-s-i-o-n @@ -80,11 +76,9 @@ Content-Transfer-Encoding: 8bit 2 files changed, 5 insertions(+), 0 deletions(-) create mode 100644 file1 --------------g-i-t--v-e-r-s-i-o-n -Content-Type: text/x-patch; - name="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff" +Content-Type: text/x-patch; name="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff" Content-Transfer-Encoding: 8bit -Content-Disposition: inline; - filename="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff" +Content-Disposition: attachment; filename="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff" diff --git a/dir/sub b/dir/sub index 8422d40..cead32e 100644 diff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..side b/t/t4013/diff.format-patch_--attach_--stdout_initial..side index 67a95c5cba..9ff828ee9d 100644 --- a/t/t4013/diff.format-patch_--attach_--stdout_initial..side +++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..side @@ -4,8 +4,7 @@ From: A U Thor <author@example.com> Date: Mon, 26 Jun 2006 00:03:00 +0000 Subject: [PATCH] Side MIME-Version: 1.0 -Content-Type: multipart/mixed; - boundary="------------g-i-t--v-e-r-s-i-o-n" +Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n" This is a multi-part message in MIME format. --------------g-i-t--v-e-r-s-i-o-n @@ -19,11 +18,9 @@ Content-Transfer-Encoding: 8bit 3 files changed, 9 insertions(+), 0 deletions(-) create mode 100644 file3 --------------g-i-t--v-e-r-s-i-o-n -Content-Type: text/x-patch; - name="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff" +Content-Type: text/x-patch; name="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff" Content-Transfer-Encoding: 8bit -Content-Disposition: inline; - filename="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff" +Content-Disposition: attachment; filename="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff" diff --git a/dir/sub b/dir/sub index 35d242b..7289e35 100644 diff --git a/t/t4013/diff.format-patch_--inline_--stdout_initial..master b/t/t4013/diff.format-patch_--inline_--stdout_initial..master new file mode 100644 index 0000000000..aa110c0e7f --- /dev/null +++ b/t/t4013/diff.format-patch_--inline_--stdout_initial..master @@ -0,0 +1,164 @@ +$ git format-patch --inline --stdout initial..master +From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001 +From: A U Thor <author@example.com> +Date: Mon, 26 Jun 2006 00:01:00 +0000 +Subject: [PATCH] Second +MIME-Version: 1.0 +Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n" + +This is a multi-part message in MIME format. +--------------g-i-t--v-e-r-s-i-o-n +Content-Type: text/plain; charset=UTF-8; format=fixed +Content-Transfer-Encoding: 8bit + + +This is the second commit. +--- + dir/sub | 2 ++ + file0 | 3 +++ + file2 | 3 --- + 3 files changed, 5 insertions(+), 3 deletions(-) + delete mode 100644 file2 +--------------g-i-t--v-e-r-s-i-o-n +Content-Type: text/x-patch; name="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff" +Content-Transfer-Encoding: 8bit +Content-Disposition: inline; filename="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff" + +diff --git a/dir/sub b/dir/sub +index 35d242b..8422d40 100644 +--- a/dir/sub ++++ b/dir/sub +@@ -1,2 +1,4 @@ + A + B ++C ++D +diff --git a/file0 b/file0 +index 01e79c3..b414108 100644 +--- a/file0 ++++ b/file0 +@@ -1,3 +1,6 @@ + 1 + 2 + 3 ++4 ++5 ++6 +diff --git a/file2 b/file2 +deleted file mode 100644 +index 01e79c3..0000000 +--- a/file2 ++++ /dev/null +@@ -1,3 +0,0 @@ +-1 +-2 +-3 + +--------------g-i-t--v-e-r-s-i-o-n-- + + + +From 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Mon Sep 17 00:00:00 2001 +From: A U Thor <author@example.com> +Date: Mon, 26 Jun 2006 00:02:00 +0000 +Subject: [PATCH] Third +MIME-Version: 1.0 +Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n" + +This is a multi-part message in MIME format. +--------------g-i-t--v-e-r-s-i-o-n +Content-Type: text/plain; charset=UTF-8; format=fixed +Content-Transfer-Encoding: 8bit + +--- + dir/sub | 2 ++ + file1 | 3 +++ + 2 files changed, 5 insertions(+), 0 deletions(-) + create mode 100644 file1 +--------------g-i-t--v-e-r-s-i-o-n +Content-Type: text/x-patch; name="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff" +Content-Transfer-Encoding: 8bit +Content-Disposition: inline; filename="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff" + +diff --git a/dir/sub b/dir/sub +index 8422d40..cead32e 100644 +--- a/dir/sub ++++ b/dir/sub +@@ -2,3 +2,5 @@ A + B + C + D ++E ++F +diff --git a/file1 b/file1 +new file mode 100644 +index 0000000..b1e6722 +--- /dev/null ++++ b/file1 +@@ -0,0 +1,3 @@ ++A ++B ++C + +--------------g-i-t--v-e-r-s-i-o-n-- + + + +From c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a Mon Sep 17 00:00:00 2001 +From: A U Thor <author@example.com> +Date: Mon, 26 Jun 2006 00:03:00 +0000 +Subject: [PATCH] Side +MIME-Version: 1.0 +Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n" + +This is a multi-part message in MIME format. +--------------g-i-t--v-e-r-s-i-o-n +Content-Type: text/plain; charset=UTF-8; format=fixed +Content-Transfer-Encoding: 8bit + +--- + dir/sub | 2 ++ + file0 | 3 +++ + file3 | 4 ++++ + 3 files changed, 9 insertions(+), 0 deletions(-) + create mode 100644 file3 +--------------g-i-t--v-e-r-s-i-o-n +Content-Type: text/x-patch; name="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff" +Content-Transfer-Encoding: 8bit +Content-Disposition: inline; filename="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff" + +diff --git a/dir/sub b/dir/sub +index 35d242b..7289e35 100644 +--- a/dir/sub ++++ b/dir/sub +@@ -1,2 +1,4 @@ + A + B ++1 ++2 +diff --git a/file0 b/file0 +index 01e79c3..f4615da 100644 +--- a/file0 ++++ b/file0 +@@ -1,3 +1,6 @@ + 1 + 2 + 3 ++A ++B ++C +diff --git a/file3 b/file3 +new file mode 100644 +index 0000000..7289e35 +--- /dev/null ++++ b/file3 +@@ -0,0 +1,4 @@ ++A ++B ++1 ++2 + +--------------g-i-t--v-e-r-s-i-o-n-- + + +$ diff --git a/t/t4013/diff.format-patch_--inline_--stdout_initial..master^ b/t/t4013/diff.format-patch_--inline_--stdout_initial..master^ new file mode 100644 index 0000000000..95e9ea4c59 --- /dev/null +++ b/t/t4013/diff.format-patch_--inline_--stdout_initial..master^ @@ -0,0 +1,106 @@ +$ git format-patch --inline --stdout initial..master^ +From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001 +From: A U Thor <author@example.com> +Date: Mon, 26 Jun 2006 00:01:00 +0000 +Subject: [PATCH] Second +MIME-Version: 1.0 +Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n" + +This is a multi-part message in MIME format. +--------------g-i-t--v-e-r-s-i-o-n +Content-Type: text/plain; charset=UTF-8; format=fixed +Content-Transfer-Encoding: 8bit + + +This is the second commit. +--- + dir/sub | 2 ++ + file0 | 3 +++ + file2 | 3 --- + 3 files changed, 5 insertions(+), 3 deletions(-) + delete mode 100644 file2 +--------------g-i-t--v-e-r-s-i-o-n +Content-Type: text/x-patch; name="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff" +Content-Transfer-Encoding: 8bit +Content-Disposition: inline; filename="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff" + +diff --git a/dir/sub b/dir/sub +index 35d242b..8422d40 100644 +--- a/dir/sub ++++ b/dir/sub +@@ -1,2 +1,4 @@ + A + B ++C ++D +diff --git a/file0 b/file0 +index 01e79c3..b414108 100644 +--- a/file0 ++++ b/file0 +@@ -1,3 +1,6 @@ + 1 + 2 + 3 ++4 ++5 ++6 +diff --git a/file2 b/file2 +deleted file mode 100644 +index 01e79c3..0000000 +--- a/file2 ++++ /dev/null +@@ -1,3 +0,0 @@ +-1 +-2 +-3 + +--------------g-i-t--v-e-r-s-i-o-n-- + + + +From 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Mon Sep 17 00:00:00 2001 +From: A U Thor <author@example.com> +Date: Mon, 26 Jun 2006 00:02:00 +0000 +Subject: [PATCH] Third +MIME-Version: 1.0 +Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n" + +This is a multi-part message in MIME format. +--------------g-i-t--v-e-r-s-i-o-n +Content-Type: text/plain; charset=UTF-8; format=fixed +Content-Transfer-Encoding: 8bit + +--- + dir/sub | 2 ++ + file1 | 3 +++ + 2 files changed, 5 insertions(+), 0 deletions(-) + create mode 100644 file1 +--------------g-i-t--v-e-r-s-i-o-n +Content-Type: text/x-patch; name="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff" +Content-Transfer-Encoding: 8bit +Content-Disposition: inline; filename="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff" + +diff --git a/dir/sub b/dir/sub +index 8422d40..cead32e 100644 +--- a/dir/sub ++++ b/dir/sub +@@ -2,3 +2,5 @@ A + B + C + D ++E ++F +diff --git a/file1 b/file1 +new file mode 100644 +index 0000000..b1e6722 +--- /dev/null ++++ b/file1 +@@ -0,0 +1,3 @@ ++A ++B ++C + +--------------g-i-t--v-e-r-s-i-o-n-- + + +$ diff --git a/t/t4013/diff.format-patch_--inline_--stdout_initial..side b/t/t4013/diff.format-patch_--inline_--stdout_initial..side new file mode 100644 index 0000000000..86ae923d71 --- /dev/null +++ b/t/t4013/diff.format-patch_--inline_--stdout_initial..side @@ -0,0 +1,59 @@ +$ git format-patch --inline --stdout initial..side +From c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a Mon Sep 17 00:00:00 2001 +From: A U Thor <author@example.com> +Date: Mon, 26 Jun 2006 00:03:00 +0000 +Subject: [PATCH] Side +MIME-Version: 1.0 +Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n" + +This is a multi-part message in MIME format. +--------------g-i-t--v-e-r-s-i-o-n +Content-Type: text/plain; charset=UTF-8; format=fixed +Content-Transfer-Encoding: 8bit + +--- + dir/sub | 2 ++ + file0 | 3 +++ + file3 | 4 ++++ + 3 files changed, 9 insertions(+), 0 deletions(-) + create mode 100644 file3 +--------------g-i-t--v-e-r-s-i-o-n +Content-Type: text/x-patch; name="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff" +Content-Transfer-Encoding: 8bit +Content-Disposition: inline; filename="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff" + +diff --git a/dir/sub b/dir/sub +index 35d242b..7289e35 100644 +--- a/dir/sub ++++ b/dir/sub +@@ -1,2 +1,4 @@ + A + B ++1 ++2 +diff --git a/file0 b/file0 +index 01e79c3..f4615da 100644 +--- a/file0 ++++ b/file0 +@@ -1,3 +1,6 @@ + 1 + 2 + 3 ++A ++B ++C +diff --git a/file3 b/file3 +new file mode 100644 +index 0000000..7289e35 +--- /dev/null ++++ b/file3 +@@ -0,0 +1,4 @@ ++A ++B ++1 ++2 + +--------------g-i-t--v-e-r-s-i-o-n-- + + +$ diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh index adf4993bac..930e209d31 100755 --- a/t/t4015-diff-whitespace.sh +++ b/t/t4015-diff-whitespace.sh @@ -43,13 +43,13 @@ index adf3937..6edc172 100644 EOF git-diff > out -test_expect_success "Ray's example without options" 'diff -u expect out' +test_expect_success "Ray's example without options" 'git diff expect out' git-diff -w > out -test_expect_success "Ray's example with -w" 'diff -u expect out' +test_expect_success "Ray's example with -w" 'git diff expect out' git-diff -b > out -test_expect_success "Ray's example with -b" 'diff -u expect out' +test_expect_success "Ray's example with -b" 'git diff expect out' tr 'Q' '\015' << EOF > x whitespace at beginning @@ -90,14 +90,14 @@ index d99af23..8b32fb5 100644 +CR at end EOF git-diff > out -test_expect_success 'another test, without options' 'diff -u expect out' +test_expect_success 'another test, without options' 'git diff expect out' cat << EOF > expect diff --git a/x b/x index d99af23..8b32fb5 100644 EOF git-diff -w > out -test_expect_success 'another test, with -w' 'diff -u expect out' +test_expect_success 'another test, with -w' 'git diff expect out' tr 'Q' '\015' << EOF > expect diff --git a/x b/x @@ -115,6 +115,6 @@ index d99af23..8b32fb5 100644 CR at endQ EOF git-diff -b > out -test_expect_success 'another test, with -b' 'diff -u expect out' +test_expect_success 'another test, with -b' 'git diff expect out' test_done diff --git a/t/t4016-diff-quote.sh b/t/t4016-diff-quote.sh index edde8f5568..5dbdc0c9fa 100755 --- a/t/t4016-diff-quote.sh +++ b/t/t4016-diff-quote.sh @@ -13,6 +13,10 @@ P1='pathname with HT' P2='pathname with SP' P3='pathname with LF' +: >"$P1" 2>&1 && test -f "$P1" && rm -f "$P1" || { + echo >&2 'Filesystem does not support tabs in names' + test_done +} test_expect_success setup ' echo P0.0 >"$P0.0" && @@ -45,7 +49,7 @@ cat >expect <<\EOF EOF test_expect_success 'git diff --summary -M HEAD' ' git diff --summary -M HEAD >actual && - diff -u expect actual + git diff expect actual ' cat >expect <<\EOF @@ -60,7 +64,7 @@ cat >expect <<\EOF EOF test_expect_success 'git diff --stat -M HEAD' ' git diff --stat -M HEAD >actual && - diff -u expect actual + git diff expect actual ' test_done diff --git a/t/t4100-apply-stat.sh b/t/t4100-apply-stat.sh index 6579f06b05..7b81c32e57 100755 --- a/t/t4100-apply-stat.sh +++ b/t/t4100-apply-stat.sh @@ -11,37 +11,37 @@ test_description='git-apply --stat --summary test. test_expect_success \ 'rename' \ 'git-apply --stat --summary <../t4100/t-apply-1.patch >current && - diff -u ../t4100/t-apply-1.expect current' + git diff ../t4100/t-apply-1.expect current' test_expect_success \ 'copy' \ 'git-apply --stat --summary <../t4100/t-apply-2.patch >current && - diff -u ../t4100/t-apply-2.expect current' + git diff ../t4100/t-apply-2.expect current' test_expect_success \ 'rewrite' \ 'git-apply --stat --summary <../t4100/t-apply-3.patch >current && - diff -u ../t4100/t-apply-3.expect current' + git diff ../t4100/t-apply-3.expect current' test_expect_success \ 'mode' \ 'git-apply --stat --summary <../t4100/t-apply-4.patch >current && - diff -u ../t4100/t-apply-4.expect current' + git diff ../t4100/t-apply-4.expect current' test_expect_success \ 'non git' \ 'git-apply --stat --summary <../t4100/t-apply-5.patch >current && - diff -u ../t4100/t-apply-5.expect current' + git diff ../t4100/t-apply-5.expect current' test_expect_success \ 'non git' \ 'git-apply --stat --summary <../t4100/t-apply-6.patch >current && - diff -u ../t4100/t-apply-6.expect current' + git diff ../t4100/t-apply-6.expect current' test_expect_success \ 'non git' \ 'git-apply --stat --summary <../t4100/t-apply-7.patch >current && - diff -u ../t4100/t-apply-7.expect current' + git diff ../t4100/t-apply-7.expect current' test_done diff --git a/t/t4104-apply-boundary.sh b/t/t4104-apply-boundary.sh index 2ff800c23f..a5fb3ea40e 100755 --- a/t/t4104-apply-boundary.sh +++ b/t/t4104-apply-boundary.sh @@ -90,7 +90,7 @@ do cat '"$kind-patch.$with"' (exit 1) } && - diff -u '"$kind"'-expect victim + git diff '"$kind"'-expect victim ' done done @@ -108,7 +108,7 @@ do cat '"$kind-ng.without"' (exit 1) } && - diff -u '"$kind"'-expect victim + git diff '"$kind"'-expect victim ' done diff --git a/t/t4115-apply-symlink.sh b/t/t4115-apply-symlink.sh index d5f2cfb186..b947ed83bb 100755 --- a/t/t4115-apply-symlink.sh +++ b/t/t4115-apply-symlink.sh @@ -33,7 +33,7 @@ test_expect_success 'apply symlink patch' ' git checkout side && git apply patch && git diff-files -p >patched && - diff -u patch patched + git diff patch patched ' @@ -42,7 +42,7 @@ test_expect_success 'apply --index symlink patch' ' git checkout -f side && git apply --index patch && git diff-index --cached -p HEAD >patched && - diff -u patch patched + git diff patch patched ' diff --git a/t/t4116-apply-reverse.sh b/t/t4116-apply-reverse.sh index aa2c869e0e..2685b22630 100755 --- a/t/t4116-apply-reverse.sh +++ b/t/t4116-apply-reverse.sh @@ -42,7 +42,7 @@ test_expect_success 'apply in reverse' ' git reset --hard second && git apply --reverse --binary --index patch && git diff >diff && - diff -u /dev/null diff + git diff /dev/null diff ' diff --git a/t/t4117-apply-reject.sh b/t/t4117-apply-reject.sh index b4de075a3e..91931f0e3f 100755 --- a/t/t4117-apply-reject.sh +++ b/t/t4117-apply-reject.sh @@ -54,7 +54,7 @@ test_expect_success 'apply without --reject should fail' ' exit 1 fi - diff -u file1 saved.file1 + git diff file1 saved.file1 ' test_expect_success 'apply without --reject should fail' ' @@ -65,7 +65,7 @@ test_expect_success 'apply without --reject should fail' ' exit 1 fi - diff -u file1 saved.file1 + git diff file1 saved.file1 ' test_expect_success 'apply with --reject should fail but update the file' ' @@ -79,7 +79,7 @@ test_expect_success 'apply with --reject should fail but update the file' ' exit 1 fi - diff -u file1 expected && + git diff file1 expected && cat file1.rej && @@ -105,7 +105,7 @@ test_expect_success 'apply with --reject should fail but update the file' ' echo "file1 still exists?" exit 1 } - diff -u file2 expected && + git diff file2 expected && cat file2.rej && @@ -132,7 +132,7 @@ test_expect_success 'the same test with --verbose' ' echo "file1 still exists?" exit 1 } - diff -u file2 expected && + git diff file2 expected && cat file2.rej && @@ -151,7 +151,7 @@ test_expect_success 'apply cleanly with --verbose' ' git apply --verbose patch.1 && - diff -u file1 clean + git diff file1 clean ' test_done diff --git a/t/t4118-apply-empty-context.sh b/t/t4118-apply-empty-context.sh index 7309422fe5..690a182003 100755 --- a/t/t4118-apply-empty-context.sh +++ b/t/t4118-apply-empty-context.sh @@ -37,7 +37,7 @@ test_expect_success 'apply --numstat' ' echo "0 1 file1" && echo "0 1 file2" } >expect && - diff -u expect actual + git diff expect actual ' @@ -47,8 +47,8 @@ test_expect_success 'apply --apply' ' cat file2.orig >file2 && git update-index file1 file2 && git apply --index diff.output && - diff -u file1.mods file1 && - diff -u file2.mods file2 + git diff file1.mods file1 && + git diff file2.mods file2 ' test_done diff --git a/t/t4119-apply-config.sh b/t/t4119-apply-config.sh new file mode 100755 index 0000000000..620a9207bf --- /dev/null +++ b/t/t4119-apply-config.sh @@ -0,0 +1,162 @@ +#!/bin/sh +# +# Copyright (c) 2007 Junio C Hamano +# + +test_description='git-apply --whitespace=strip and configuration file. + +' + +. ./test-lib.sh + +test_expect_success setup ' + mkdir sub && + echo A >sub/file1 && + cp sub/file1 saved && + git add sub/file1 && + echo "B " >sub/file1 && + git diff >patch.file +' + +# Also handcraft GNU diff output; note this has trailing whitespace. +cat >gpatch.file <<\EOF && +--- file1 2007-02-21 01:04:24.000000000 -0800 ++++ file1+ 2007-02-21 01:07:44.000000000 -0800 +@@ -1 +1 @@ +-A ++B +EOF + +sed -e 's|file1|sub/&|' gpatch.file >gpatch-sub.file && +sed -e ' + /^--- /s|file1|a/sub/&| + /^+++ /s|file1|b/sub/&| +' gpatch.file >gpatch-ab-sub.file && + +check_result () { + if grep " " "$1" + then + echo "Eh?" + false + elif grep B "$1" + then + echo Happy + else + echo "Huh?" + false + fi +} + +test_expect_success 'apply --whitespace=strip' ' + + rm -f sub/file1 && + cp saved sub/file1 && + git update-index --refresh && + + git apply --whitespace=strip patch.file && + check_result sub/file1 +' + +test_expect_success 'apply --whitespace=strip from config' ' + + rm -f sub/file1 && + cp saved sub/file1 && + git update-index --refresh && + + git config apply.whitespace strip && + git apply patch.file && + check_result sub/file1 +' + +D=`pwd` + +test_expect_success 'apply --whitespace=strip in subdir' ' + + cd "$D" && + git config --unset-all apply.whitespace + rm -f sub/file1 && + cp saved sub/file1 && + git update-index --refresh && + + cd sub && + git apply --whitespace=strip ../patch.file && + check_result file1 +' + +test_expect_success 'apply --whitespace=strip from config in subdir' ' + + cd "$D" && + git config apply.whitespace strip && + rm -f sub/file1 && + cp saved sub/file1 && + git update-index --refresh && + + cd sub && + git apply ../patch.file && + check_result file1 +' + +test_expect_success 'same in subdir but with traditional patch input' ' + + cd "$D" && + git config apply.whitespace strip && + rm -f sub/file1 && + cp saved sub/file1 && + git update-index --refresh && + + cd sub && + git apply ../gpatch.file && + check_result file1 +' + +test_expect_success 'same but with traditional patch input of depth 1' ' + + cd "$D" && + git config apply.whitespace strip && + rm -f sub/file1 && + cp saved sub/file1 && + git update-index --refresh && + + cd sub && + git apply ../gpatch-sub.file && + check_result file1 +' + +test_expect_success 'same but with traditional patch input of depth 2' ' + + cd "$D" && + git config apply.whitespace strip && + rm -f sub/file1 && + cp saved sub/file1 && + git update-index --refresh && + + cd sub && + git apply ../gpatch-ab-sub.file && + check_result file1 +' + +test_expect_success 'same but with traditional patch input of depth 1' ' + + cd "$D" && + git config apply.whitespace strip && + rm -f sub/file1 && + cp saved sub/file1 && + git update-index --refresh && + + git apply -p0 gpatch-sub.file && + check_result sub/file1 +' + +test_expect_success 'same but with traditional patch input of depth 2' ' + + cd "$D" && + git config apply.whitespace strip && + rm -f sub/file1 && + cp saved sub/file1 && + git update-index --refresh && + + git apply gpatch-ab-sub.file && + check_result sub/file1 +' + +test_done diff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh index c571a1bd74..e081b32aff 100755 --- a/t/t4200-rerere.sh +++ b/t/t4200-rerere.sh @@ -70,7 +70,7 @@ EOF git rerere diff > out -test_expect_success 'rerere diff' 'diff -u expect out' +test_expect_success 'rerere diff' 'git diff expect out' cat > expect << EOF a1 @@ -78,7 +78,7 @@ EOF git rerere status > out -test_expect_success 'rerere status' 'diff -u expect out' +test_expect_success 'rerere status' 'git diff expect out' test_expect_success 'commit succeeds' \ "git commit -q -a -m 'prefer first over second'" @@ -94,7 +94,7 @@ test_expect_failure 'another conflicting merge' 'git pull . first' git show first:a1 | sed 's/To die: t/To die! T/' > expect test_expect_success 'rerere kicked in' "! grep ======= a1" -test_expect_success 'rerere prefers first change' 'diff -u a1 expect' +test_expect_success 'rerere prefers first change' 'git diff a1 expect' rm $rr/postimage echo "$sha1 a1" | tr '\012' '\0' > .git/rr-cache/MERGE_RR @@ -112,39 +112,26 @@ rr2=.git/rr-cache/$sha2 mkdir $rr2 echo Hello > $rr2/preimage -case "$(date -d @11111111 +%s 2>/dev/null)" in -11111111) - # 'date' must be able to take arbitrary input with @11111111 notation. - # for this test to succeed. We should fix this part using more - # portable script someday. +almost_15_days_ago=$((60-15*86400)) +just_over_15_days_ago=$((-1-15*86400)) +almost_60_days_ago=$((60-60*86400)) +just_over_60_days_ago=$((-1-60*86400)) - now=$(date +%s) - almost_15_days_ago=$(($now+60-15*86400)) - just_over_15_days_ago=$(($now-1-15*86400)) - almost_60_days_ago=$(($now+60-60*86400)) - just_over_60_days_ago=$(($now-1-60*86400)) - predate1="$(date -d "@$almost_60_days_ago" +%Y%m%d%H%M.%S)" - predate2="$(date -d "@$almost_15_days_ago" +%Y%m%d%H%M.%S)" - postdate1="$(date -d "@$just_over_60_days_ago" +%Y%m%d%H%M.%S)" - postdate2="$(date -d "@$just_over_15_days_ago" +%Y%m%d%H%M.%S)" +test-chmtime =$almost_60_days_ago $rr/preimage +test-chmtime =$almost_15_days_ago $rr2/preimage - touch -m -t "$predate1" $rr/preimage - touch -m -t "$predate2" $rr2/preimage +test_expect_success 'garbage collection (part1)' 'git rerere gc' - test_expect_success 'garbage collection (part1)' 'git rerere gc' +test_expect_success 'young records still live' \ + "test -f $rr/preimage && test -f $rr2/preimage" - test_expect_success 'young records still live' \ - "test -f $rr/preimage -a -f $rr2/preimage" +test-chmtime =$just_over_60_days_ago $rr/preimage +test-chmtime =$just_over_15_days_ago $rr2/preimage - touch -m -t "$postdate1" $rr/preimage - touch -m -t "$postdate2" $rr2/preimage +test_expect_success 'garbage collection (part2)' 'git rerere gc' - test_expect_success 'garbage collection (part2)' 'git rerere gc' - - test_expect_success 'old records rest in peace' \ - "test ! -f $rr/preimage -a ! -f $rr2/preimage" - ;; -esac +test_expect_success 'old records rest in peace' \ + "test ! -f $rr/preimage && test ! -f $rr2/preimage" test_done diff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh index 7d93d0d7c9..477b267599 100755 --- a/t/t5400-send-pack.sh +++ b/t/t5400-send-pack.sh @@ -108,9 +108,9 @@ test_expect_success \ cd victim && git-config receive.denyNonFastforwards true && cd .. && - git-update-ref refs/heads/master master^ && - git-send-pack --force ./victim/.git/ master && - ! diff -u .git/refs/heads/master victim/.git/refs/heads/master + git-update-ref refs/heads/master master^ || return 1 + git-send-pack --force ./victim/.git/ master && return 1 + ! git diff .git/refs/heads/master victim/.git/refs/heads/master ' test_done diff --git a/t/t5401-update-hooks.sh b/t/t5401-update-hooks.sh index 0514056ca6..f1c7ff0c0a 100755 --- a/t/t5401-update-hooks.sh +++ b/t/t5401-update-hooks.sh @@ -11,71 +11,126 @@ test_expect_success setup ' git-update-index --add a && tree0=$(git-write-tree) && commit0=$(echo setup | git-commit-tree $tree0) && - git-update-ref HEAD $commit0 && - git-clone ./. victim && echo We hope it works. >a && git-update-index a && tree1=$(git-write-tree) && commit1=$(echo modify | git-commit-tree $tree1 -p $commit0) && - git-update-ref HEAD $commit1 + git-update-ref refs/heads/master $commit0 && + git-update-ref refs/heads/tofail $commit1 && + git-clone ./. victim && + GIT_DIR=victim/.git git-update-ref refs/heads/tofail $commit1 && + git-update-ref refs/heads/master $commit1 && + git-update-ref refs/heads/tofail $commit0 ' +cat >victim/.git/hooks/pre-receive <<'EOF' +#!/bin/sh +printf "$@" >>$GIT_DIR/pre-receive.args +cat - >$GIT_DIR/pre-receive.stdin +echo STDOUT pre-receive +echo STDERR pre-receive >&2 +EOF +chmod u+x victim/.git/hooks/pre-receive + cat >victim/.git/hooks/update <<'EOF' #!/bin/sh -echo "$@" >$GIT_DIR/update.args +echo "$@" >>$GIT_DIR/update.args read x; printf "$x" >$GIT_DIR/update.stdin -echo STDOUT update -echo STDERR update >&2 +echo STDOUT update $1 +echo STDERR update $1 >&2 +test "$1" = refs/heads/master || exit EOF chmod u+x victim/.git/hooks/update +cat >victim/.git/hooks/post-receive <<'EOF' +#!/bin/sh +printf "$@" >>$GIT_DIR/post-receive.args +cat - >$GIT_DIR/post-receive.stdin +echo STDOUT post-receive +echo STDERR post-receive >&2 +EOF +chmod u+x victim/.git/hooks/post-receive + cat >victim/.git/hooks/post-update <<'EOF' #!/bin/sh -echo "$@" >$GIT_DIR/post-update.args +echo "$@" >>$GIT_DIR/post-update.args read x; printf "$x" >$GIT_DIR/post-update.stdin echo STDOUT post-update echo STDERR post-update >&2 EOF chmod u+x victim/.git/hooks/post-update -test_expect_success push ' - git-send-pack ./victim/.git/ master >send.out 2>send.err +test_expect_failure push ' + git-send-pack --force ./victim/.git master tofail >send.out 2>send.err +' + +test_expect_success 'updated as expected' ' + test $(GIT_DIR=victim/.git git-rev-parse master) = $commit1 && + test $(GIT_DIR=victim/.git git-rev-parse tofail) = $commit1 ' test_expect_success 'hooks ran' ' + test -f victim/.git/pre-receive.args && + test -f victim/.git/pre-receive.stdin && test -f victim/.git/update.args && test -f victim/.git/update.stdin && + test -f victim/.git/post-receive.args && + test -f victim/.git/post-receive.stdin && test -f victim/.git/post-update.args && test -f victim/.git/post-update.stdin ' +test_expect_success 'pre-receive hook input' ' + (echo $commit0 $commit1 refs/heads/master; + echo $commit1 $commit0 refs/heads/tofail + ) | git diff - victim/.git/pre-receive.stdin +' + test_expect_success 'update hook arguments' ' - echo refs/heads/master $commit0 $commit1 | - diff -u - victim/.git/update.args + (echo refs/heads/master $commit0 $commit1; + echo refs/heads/tofail $commit1 $commit0 + ) | git diff - victim/.git/update.args +' + +test_expect_success 'post-receive hook input' ' + echo $commit0 $commit1 refs/heads/master | + git diff - victim/.git/post-receive.stdin ' test_expect_success 'post-update hook arguments' ' echo refs/heads/master | - diff -u - victim/.git/post-update.args + git diff - victim/.git/post-update.args ' -test_expect_failure 'update hook stdin is /dev/null' ' - test -s victim/.git/update.stdin +test_expect_success 'all hook stdin is /dev/null' ' + ! test -s victim/.git/update.stdin && + ! test -s victim/.git/post-update.stdin ' -test_expect_failure 'post-update hook stdin is /dev/null' ' - test -s victim/.git/post-update.stdin +test_expect_success 'all *-receive hook args are empty' ' + ! test -s victim/.git/pre-receive.args && + ! test -s victim/.git/post-receive.args ' test_expect_failure 'send-pack produced no output' ' test -s send.out ' +cat <<EOF >expect +STDOUT pre-receive +STDERR pre-receive +STDOUT update refs/heads/master +STDERR update refs/heads/master +STDOUT update refs/heads/tofail +STDERR update refs/heads/tofail +STDOUT post-receive +STDERR post-receive +STDOUT post-update +STDERR post-update +EOF test_expect_success 'send-pack stderr contains hook messages' ' - grep "STDOUT update" send.err && - grep "STDERR update" send.err && - grep "STDOUT post-update" send.err && - grep "STDERR post-update" send.err + egrep ^STD send.err >actual && + git diff - actual <expect ' test_done diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh index 50c64856f0..426017e1d0 100755 --- a/t/t5510-fetch.sh +++ b/t/t5510-fetch.sh @@ -35,7 +35,9 @@ test_expect_success "clone and setup child repos" ' echo "URL: ../two/.git/" echo "Pull: refs/heads/master:refs/heads/two" echo "Pull: refs/heads/one:refs/heads/one" - } >.git/remotes/two + } >.git/remotes/two && + cd .. && + git clone . bundle ' test_expect_success "fetch test" ' @@ -81,4 +83,66 @@ test_expect_success 'fetch following tags' ' ' +test_expect_success 'create bundle 1' ' + cd "$D" && + echo >file updated again by origin && + git commit -a -m "tip" && + git bundle create bundle1 master^..master +' + +test_expect_success 'header of bundle looks right' ' + head -n 1 "$D"/bundle1 | grep "^#" && + head -n 2 "$D"/bundle1 | grep "^-[0-9a-f]\{40\} " && + head -n 3 "$D"/bundle1 | grep "^[0-9a-f]\{40\} " && + head -n 4 "$D"/bundle1 | grep "^$" +' + +test_expect_success 'create bundle 2' ' + cd "$D" && + git bundle create bundle2 master~2..master +' + +test_expect_failure 'unbundle 1' ' + cd "$D/bundle" && + git checkout -b some-branch && + git fetch "$D/bundle1" master:master +' + +test_expect_success 'bundle 1 has only 3 files ' ' + cd "$D" && + ( + while read x && test -n "$x" + do + :; + done + cat + ) <bundle1 >bundle.pack && + git index-pack bundle.pack && + verify=$(git verify-pack -v bundle.pack) && + test 4 = $(echo "$verify" | wc -l) +' + +test_expect_success 'unbundle 2' ' + cd "$D/bundle" && + git fetch ../bundle2 master:master && + test "tip" = "$(git log -1 --pretty=oneline master | cut -b42-)" +' + +test_expect_success 'bundle does not prerequisite objects' ' + cd "$D" && + touch file2 && + git add file2 && + git commit -m add.file2 file2 && + git bundle create bundle3 -1 HEAD && + ( + while read x && test -n "$x" + do + :; + done + cat + ) <bundle3 >bundle.pack && + git index-pack bundle.pack && + test 4 = $(git verify-pack -v bundle.pack | wc -l) +' + test_done diff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh new file mode 100755 index 0000000000..6c9cc67508 --- /dev/null +++ b/t/t5515-fetch-merge-logic.sh @@ -0,0 +1,162 @@ +#!/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 && + + echo >file original && + git add file && + git commit -a -m One && + git tag tag-one && + git tag tag-one-tree HEAD^{tree} && + git branch one && + + echo two >> file && + git commit -a -m Two && + git tag -a -m "Tag Two" tag-two && + git branch two && + + echo three >> file && + git commit -a -m Three && + git tag -a -m "Tag Three" tag-three && + git tag -a -m "Tag Three file" tag-three-file HEAD^{tree}:file && + git branch three && + + echo master >> file && + git commit -a -m Master && + git tag -a -m "Tag Master" tag-master && + + git checkout three && + + git clone . cloned && + cd cloned && + git config remote.origin.url ../.git/ && + + git config remote.config-explicit.url ../.git/ && + git config remote.config-explicit.fetch refs/heads/master:remotes/rem/master && + git config --add remote.config-explicit.fetch refs/heads/one:remotes/rem/one && + git config --add remote.config-explicit.fetch two:remotes/rem/two && + git config --add remote.config-explicit.fetch refs/heads/three:remotes/rem/three && + remotes="config-explicit" && + + git config remote.config-glob.url ../.git/ && + git config remote.config-glob.fetch refs/heads/*:refs/remotes/rem/* && + remotes="$remotes config-glob" && + + mkdir -p .git/remotes && + { + echo "URL: ../.git/" + echo "Pull: refs/heads/master:remotes/rem/master" + echo "Pull: refs/heads/one:remotes/rem/one" + echo "Pull: two:remotes/rem/two" + echo "Pull: refs/heads/three:remotes/rem/three" + } >.git/remotes/remote-explicit && + remotes="$remotes remote-explicit" && + + { + echo "URL: ../.git/" + echo "Pull: refs/heads/*:refs/remotes/rem/*" + } >.git/remotes/remote-glob && + remotes="$remotes remote-glob" && + + mkdir -p .git/branches && + echo "../.git" > .git/branches/branches-default && + remotes="$remotes branches-default" && + + echo "../.git#one" > .git/branches/branches-one && + remotes="$remotes branches-one" && + + for remote in $remotes ; do + git config branch.br-$remote.remote $remote && + git config branch.br-$remote-merge.remote $remote && + git config branch.br-$remote-merge.merge refs/heads/three && + git config branch.br-$remote-octopus.remote $remote && + git config branch.br-$remote-octopus.merge refs/heads/one && + git config --add branch.br-$remote-octopus.merge two && + git config --add branch.br-$remote-octopus.merge remotes/rem/three + done +' + +# Merge logic depends on branch properties and Pull: or .fetch lines +for remote in $remotes ; do + for branch in "" "-merge" "-octopus" ; do +cat <<EOF +br-$remote$branch +br-$remote$branch $remote +EOF + done +done > tests + +# Merge logic does not depend on branch properties, +# but does depend on Pull: or fetch lines. +# Use two branches completely unrelated from the arguments, +# the clone default and one without branch properties +for branch in master br-unconfig ; do + echo $branch + for remote in $remotes ; do + echo $branch $remote + done +done >> tests + +# Merge logic does not depend on branch properties +# neither in the Pull: or .fetch config +for branch in master br-unconfig ; do + cat <<EOF +$branch ../.git +$branch ../.git one +$branch ../.git one two +$branch --tags ../.git +$branch ../.git tag tag-one tag tag-three +$branch ../.git tag tag-one-tree tag tag-three-file +$branch ../.git one tag tag-one tag tag-three-file +EOF +done >> tests + +while read cmd +do + case "$cmd" in + '' | '#'*) continue ;; + esac + test=`echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g'` + cnt=`expr $test_count + 1` + pfx=`printf "%04d" $cnt` + expect="../../t5515/fetch.$test" + actual="$pfx-fetch.$test" + + test_expect_success "$cmd" ' + { + echo "# $cmd" + set x $cmd; shift + git symbolic-ref HEAD refs/heads/$1 ; shift + rm -f .git/FETCH_HEAD + rm -f .git/refs/heads/* + rm -f .git/refs/remotes/rem/* + rm -f .git/refs/tags/* + git fetch "$@" >/dev/null + cat .git/FETCH_HEAD + } >"$actual" && + if test -f "$expect" + then + git diff -u "$expect" "$actual" && + rm -f "$actual" + else + # this is to help developing new tests. + cp "$actual" "$expect" + false + fi + ' +done < tests + +test_done diff --git a/t/t5515/fetch.br-branches-default b/t/t5515/fetch.br-branches-default new file mode 100644 index 0000000000..2e0414f6c3 --- /dev/null +++ b/t/t5515/fetch.br-branches-default @@ -0,0 +1,8 @@ +# br-branches-default +754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-branches-default-merge b/t/t5515/fetch.br-branches-default-merge new file mode 100644 index 0000000000..ea65f31bde --- /dev/null +++ b/t/t5515/fetch.br-branches-default-merge @@ -0,0 +1,8 @@ +# br-branches-default-merge +754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-branches-default-merge_branches-default b/t/t5515/fetch.br-branches-default-merge_branches-default new file mode 100644 index 0000000000..7b5fa949e6 --- /dev/null +++ b/t/t5515/fetch.br-branches-default-merge_branches-default @@ -0,0 +1,8 @@ +# br-branches-default-merge branches-default +754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-branches-default-octopus b/t/t5515/fetch.br-branches-default-octopus new file mode 100644 index 0000000000..128397d737 --- /dev/null +++ b/t/t5515/fetch.br-branches-default-octopus @@ -0,0 +1,8 @@ +# br-branches-default-octopus +754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-branches-default-octopus_branches-default b/t/t5515/fetch.br-branches-default-octopus_branches-default new file mode 100644 index 0000000000..4b37cd481a --- /dev/null +++ b/t/t5515/fetch.br-branches-default-octopus_branches-default @@ -0,0 +1,8 @@ +# br-branches-default-octopus branches-default +754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-branches-default_branches-default b/t/t5515/fetch.br-branches-default_branches-default new file mode 100644 index 0000000000..4a2bf3c95c --- /dev/null +++ b/t/t5515/fetch.br-branches-default_branches-default @@ -0,0 +1,8 @@ +# br-branches-default branches-default +754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-branches-one b/t/t5515/fetch.br-branches-one new file mode 100644 index 0000000000..12ac8d20fb --- /dev/null +++ b/t/t5515/fetch.br-branches-one @@ -0,0 +1,8 @@ +# br-branches-one +8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-branches-one-merge b/t/t5515/fetch.br-branches-one-merge new file mode 100644 index 0000000000..3a4e77ead5 --- /dev/null +++ b/t/t5515/fetch.br-branches-one-merge @@ -0,0 +1,8 @@ +# br-branches-one-merge +8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-branches-one-merge_branches-one b/t/t5515/fetch.br-branches-one-merge_branches-one new file mode 100644 index 0000000000..00e04b435e --- /dev/null +++ b/t/t5515/fetch.br-branches-one-merge_branches-one @@ -0,0 +1,8 @@ +# br-branches-one-merge branches-one +8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-branches-one-octopus b/t/t5515/fetch.br-branches-one-octopus new file mode 100644 index 0000000000..53fe808a3b --- /dev/null +++ b/t/t5515/fetch.br-branches-one-octopus @@ -0,0 +1,8 @@ +# br-branches-one-octopus +8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-branches-one-octopus_branches-one b/t/t5515/fetch.br-branches-one-octopus_branches-one new file mode 100644 index 0000000000..41b18ff78a --- /dev/null +++ b/t/t5515/fetch.br-branches-one-octopus_branches-one @@ -0,0 +1,8 @@ +# br-branches-one-octopus branches-one +8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-branches-one_branches-one b/t/t5515/fetch.br-branches-one_branches-one new file mode 100644 index 0000000000..281fa09d48 --- /dev/null +++ b/t/t5515/fetch.br-branches-one_branches-one @@ -0,0 +1,8 @@ +# br-branches-one branches-one +8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-config-explicit b/t/t5515/fetch.br-config-explicit new file mode 100644 index 0000000000..e2fa9c8654 --- /dev/null +++ b/t/t5515/fetch.br-config-explicit @@ -0,0 +1,11 @@ +# br-config-explicit +754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-config-explicit-merge b/t/t5515/fetch.br-config-explicit-merge new file mode 100644 index 0000000000..ec1a7231aa --- /dev/null +++ b/t/t5515/fetch.br-config-explicit-merge @@ -0,0 +1,11 @@ +# br-config-explicit-merge +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-config-explicit-merge_config-explicit b/t/t5515/fetch.br-config-explicit-merge_config-explicit new file mode 100644 index 0000000000..54f689151f --- /dev/null +++ b/t/t5515/fetch.br-config-explicit-merge_config-explicit @@ -0,0 +1,11 @@ +# br-config-explicit-merge config-explicit +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-config-explicit-octopus b/t/t5515/fetch.br-config-explicit-octopus new file mode 100644 index 0000000000..7011dfc181 --- /dev/null +++ b/t/t5515/fetch.br-config-explicit-octopus @@ -0,0 +1,11 @@ +# br-config-explicit-octopus +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-config-explicit-octopus_config-explicit b/t/t5515/fetch.br-config-explicit-octopus_config-explicit new file mode 100644 index 0000000000..bdad51f871 --- /dev/null +++ b/t/t5515/fetch.br-config-explicit-octopus_config-explicit @@ -0,0 +1,11 @@ +# br-config-explicit-octopus config-explicit +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-config-explicit_config-explicit b/t/t5515/fetch.br-config-explicit_config-explicit new file mode 100644 index 0000000000..1b237dde6e --- /dev/null +++ b/t/t5515/fetch.br-config-explicit_config-explicit @@ -0,0 +1,11 @@ +# br-config-explicit config-explicit +754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-config-glob b/t/t5515/fetch.br-config-glob new file mode 100644 index 0000000000..e75ec2f72b --- /dev/null +++ b/t/t5515/fetch.br-config-glob @@ -0,0 +1,11 @@ +# br-config-glob +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-config-glob-merge b/t/t5515/fetch.br-config-glob-merge new file mode 100644 index 0000000000..ce8f739a0d --- /dev/null +++ b/t/t5515/fetch.br-config-glob-merge @@ -0,0 +1,11 @@ +# br-config-glob-merge +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-config-glob-merge_config-glob b/t/t5515/fetch.br-config-glob-merge_config-glob new file mode 100644 index 0000000000..5817bed8f8 --- /dev/null +++ b/t/t5515/fetch.br-config-glob-merge_config-glob @@ -0,0 +1,11 @@ +# br-config-glob-merge config-glob +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-config-glob-octopus b/t/t5515/fetch.br-config-glob-octopus new file mode 100644 index 0000000000..9ee213ea45 --- /dev/null +++ b/t/t5515/fetch.br-config-glob-octopus @@ -0,0 +1,11 @@ +# br-config-glob-octopus +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-config-glob-octopus_config-glob b/t/t5515/fetch.br-config-glob-octopus_config-glob new file mode 100644 index 0000000000..44bd0ec59f --- /dev/null +++ b/t/t5515/fetch.br-config-glob-octopus_config-glob @@ -0,0 +1,11 @@ +# br-config-glob-octopus config-glob +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-config-glob_config-glob b/t/t5515/fetch.br-config-glob_config-glob new file mode 100644 index 0000000000..a6c20f92ce --- /dev/null +++ b/t/t5515/fetch.br-config-glob_config-glob @@ -0,0 +1,11 @@ +# br-config-glob config-glob +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-remote-explicit b/t/t5515/fetch.br-remote-explicit new file mode 100644 index 0000000000..83534d2ec8 --- /dev/null +++ b/t/t5515/fetch.br-remote-explicit @@ -0,0 +1,11 @@ +# br-remote-explicit +754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-remote-explicit-merge b/t/t5515/fetch.br-remote-explicit-merge new file mode 100644 index 0000000000..a9064dd65a --- /dev/null +++ b/t/t5515/fetch.br-remote-explicit-merge @@ -0,0 +1,11 @@ +# br-remote-explicit-merge +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-remote-explicit-merge_remote-explicit b/t/t5515/fetch.br-remote-explicit-merge_remote-explicit new file mode 100644 index 0000000000..732a37e4d3 --- /dev/null +++ b/t/t5515/fetch.br-remote-explicit-merge_remote-explicit @@ -0,0 +1,11 @@ +# br-remote-explicit-merge remote-explicit +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-remote-explicit-octopus b/t/t5515/fetch.br-remote-explicit-octopus new file mode 100644 index 0000000000..ecf020d929 --- /dev/null +++ b/t/t5515/fetch.br-remote-explicit-octopus @@ -0,0 +1,11 @@ +# br-remote-explicit-octopus +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-remote-explicit-octopus_remote-explicit b/t/t5515/fetch.br-remote-explicit-octopus_remote-explicit new file mode 100644 index 0000000000..af77531011 --- /dev/null +++ b/t/t5515/fetch.br-remote-explicit-octopus_remote-explicit @@ -0,0 +1,11 @@ +# br-remote-explicit-octopus remote-explicit +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-remote-explicit_remote-explicit b/t/t5515/fetch.br-remote-explicit_remote-explicit new file mode 100644 index 0000000000..51fae567c8 --- /dev/null +++ b/t/t5515/fetch.br-remote-explicit_remote-explicit @@ -0,0 +1,11 @@ +# br-remote-explicit remote-explicit +754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-remote-glob b/t/t5515/fetch.br-remote-glob new file mode 100644 index 0000000000..94e6ad31e3 --- /dev/null +++ b/t/t5515/fetch.br-remote-glob @@ -0,0 +1,11 @@ +# br-remote-glob +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-remote-glob-merge b/t/t5515/fetch.br-remote-glob-merge new file mode 100644 index 0000000000..09362e25af --- /dev/null +++ b/t/t5515/fetch.br-remote-glob-merge @@ -0,0 +1,11 @@ +# br-remote-glob-merge +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-remote-glob-merge_remote-glob b/t/t5515/fetch.br-remote-glob-merge_remote-glob new file mode 100644 index 0000000000..e2eabec62e --- /dev/null +++ b/t/t5515/fetch.br-remote-glob-merge_remote-glob @@ -0,0 +1,11 @@ +# br-remote-glob-merge remote-glob +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-remote-glob-octopus b/t/t5515/fetch.br-remote-glob-octopus new file mode 100644 index 0000000000..c1554f8f2d --- /dev/null +++ b/t/t5515/fetch.br-remote-glob-octopus @@ -0,0 +1,11 @@ +# br-remote-glob-octopus +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-remote-glob-octopus_remote-glob b/t/t5515/fetch.br-remote-glob-octopus_remote-glob new file mode 100644 index 0000000000..e6134345b8 --- /dev/null +++ b/t/t5515/fetch.br-remote-glob-octopus_remote-glob @@ -0,0 +1,11 @@ +# br-remote-glob-octopus remote-glob +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-remote-glob_remote-glob b/t/t5515/fetch.br-remote-glob_remote-glob new file mode 100644 index 0000000000..646dbc8770 --- /dev/null +++ b/t/t5515/fetch.br-remote-glob_remote-glob @@ -0,0 +1,11 @@ +# br-remote-glob remote-glob +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-unconfig b/t/t5515/fetch.br-unconfig new file mode 100644 index 0000000000..65ce6d99e2 --- /dev/null +++ b/t/t5515/fetch.br-unconfig @@ -0,0 +1,11 @@ +# br-unconfig +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-unconfig_--tags_.._.git b/t/t5515/fetch.br-unconfig_--tags_.._.git new file mode 100644 index 0000000000..8258c80868 --- /dev/null +++ b/t/t5515/fetch.br-unconfig_--tags_.._.git @@ -0,0 +1,7 @@ +# br-unconfig --tags ../.git +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-unconfig_.._.git b/t/t5515/fetch.br-unconfig_.._.git new file mode 100644 index 0000000000..284bb1fb61 --- /dev/null +++ b/t/t5515/fetch.br-unconfig_.._.git @@ -0,0 +1,2 @@ +# br-unconfig ../.git +0567da4d5edd2ff4bb292a465ba9e64dcad9536b ../ diff --git a/t/t5515/fetch.br-unconfig_.._.git_one b/t/t5515/fetch.br-unconfig_.._.git_one new file mode 100644 index 0000000000..11eb5a6ef2 --- /dev/null +++ b/t/t5515/fetch.br-unconfig_.._.git_one @@ -0,0 +1,2 @@ +# br-unconfig ../.git one +8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../ diff --git a/t/t5515/fetch.br-unconfig_.._.git_one_tag_tag-one_tag_tag-three-file b/t/t5515/fetch.br-unconfig_.._.git_one_tag_tag-one_tag_tag-three-file new file mode 100644 index 0000000000..f02bab2fb4 --- /dev/null +++ b/t/t5515/fetch.br-unconfig_.._.git_one_tag_tag-one_tag_tag-three-file @@ -0,0 +1,8 @@ +# br-unconfig ../.git one tag tag-one tag tag-three-file +8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 tag 'tag-one' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-unconfig_.._.git_one_two b/t/t5515/fetch.br-unconfig_.._.git_one_two new file mode 100644 index 0000000000..3f1be224b8 --- /dev/null +++ b/t/t5515/fetch.br-unconfig_.._.git_one_two @@ -0,0 +1,3 @@ +# br-unconfig ../.git one two +8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../ diff --git a/t/t5515/fetch.br-unconfig_.._.git_tag_tag-one-tree_tag_tag-three-file b/t/t5515/fetch.br-unconfig_.._.git_tag_tag-one-tree_tag_tag-three-file new file mode 100644 index 0000000000..85de41109e --- /dev/null +++ b/t/t5515/fetch.br-unconfig_.._.git_tag_tag-one-tree_tag_tag-three-file @@ -0,0 +1,7 @@ +# br-unconfig ../.git tag tag-one-tree tag tag-three-file +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-unconfig_.._.git_tag_tag-one_tag_tag-three b/t/t5515/fetch.br-unconfig_.._.git_tag_tag-one_tag_tag-three new file mode 100644 index 0000000000..0da2337f1b --- /dev/null +++ b/t/t5515/fetch.br-unconfig_.._.git_tag_tag-one_tag_tag-three @@ -0,0 +1,7 @@ +# br-unconfig ../.git tag tag-one tag tag-three +8e32a6d901327a23ef831511badce7bf3bf46689 tag 'tag-one' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b tag 'tag-three' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-unconfig_branches-default b/t/t5515/fetch.br-unconfig_branches-default new file mode 100644 index 0000000000..fc7041eefc --- /dev/null +++ b/t/t5515/fetch.br-unconfig_branches-default @@ -0,0 +1,8 @@ +# br-unconfig branches-default +754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-unconfig_branches-one b/t/t5515/fetch.br-unconfig_branches-one new file mode 100644 index 0000000000..e94cde745b --- /dev/null +++ b/t/t5515/fetch.br-unconfig_branches-one @@ -0,0 +1,8 @@ +# br-unconfig branches-one +8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-unconfig_config-explicit b/t/t5515/fetch.br-unconfig_config-explicit new file mode 100644 index 0000000000..01a283e70d --- /dev/null +++ b/t/t5515/fetch.br-unconfig_config-explicit @@ -0,0 +1,11 @@ +# br-unconfig config-explicit +754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-unconfig_config-glob b/t/t5515/fetch.br-unconfig_config-glob new file mode 100644 index 0000000000..3a556c5e96 --- /dev/null +++ b/t/t5515/fetch.br-unconfig_config-glob @@ -0,0 +1,11 @@ +# br-unconfig config-glob +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-unconfig_remote-explicit b/t/t5515/fetch.br-unconfig_remote-explicit new file mode 100644 index 0000000000..db216dfa56 --- /dev/null +++ b/t/t5515/fetch.br-unconfig_remote-explicit @@ -0,0 +1,11 @@ +# br-unconfig remote-explicit +754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.br-unconfig_remote-glob b/t/t5515/fetch.br-unconfig_remote-glob new file mode 100644 index 0000000000..aee65c204d --- /dev/null +++ b/t/t5515/fetch.br-unconfig_remote-glob @@ -0,0 +1,11 @@ +# br-unconfig remote-glob +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.master b/t/t5515/fetch.master new file mode 100644 index 0000000000..950fd078db --- /dev/null +++ b/t/t5515/fetch.master @@ -0,0 +1,11 @@ +# master +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.master_--tags_.._.git b/t/t5515/fetch.master_--tags_.._.git new file mode 100644 index 0000000000..0e59950c7b --- /dev/null +++ b/t/t5515/fetch.master_--tags_.._.git @@ -0,0 +1,7 @@ +# master --tags ../.git +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.master_.._.git b/t/t5515/fetch.master_.._.git new file mode 100644 index 0000000000..66d1aaddae --- /dev/null +++ b/t/t5515/fetch.master_.._.git @@ -0,0 +1,2 @@ +# master ../.git +0567da4d5edd2ff4bb292a465ba9e64dcad9536b ../ diff --git a/t/t5515/fetch.master_.._.git_one b/t/t5515/fetch.master_.._.git_one new file mode 100644 index 0000000000..35deddbd2c --- /dev/null +++ b/t/t5515/fetch.master_.._.git_one @@ -0,0 +1,2 @@ +# master ../.git one +8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../ diff --git a/t/t5515/fetch.master_.._.git_one_tag_tag-one_tag_tag-three-file b/t/t5515/fetch.master_.._.git_one_tag_tag-one_tag_tag-three-file new file mode 100644 index 0000000000..82868524ca --- /dev/null +++ b/t/t5515/fetch.master_.._.git_one_tag_tag-one_tag_tag-three-file @@ -0,0 +1,8 @@ +# master ../.git one tag tag-one tag tag-three-file +8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 tag 'tag-one' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.master_.._.git_one_two b/t/t5515/fetch.master_.._.git_one_two new file mode 100644 index 0000000000..35ec5782c8 --- /dev/null +++ b/t/t5515/fetch.master_.._.git_one_two @@ -0,0 +1,3 @@ +# master ../.git one two +8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../ diff --git a/t/t5515/fetch.master_.._.git_tag_tag-one-tree_tag_tag-three-file b/t/t5515/fetch.master_.._.git_tag_tag-one-tree_tag_tag-three-file new file mode 100644 index 0000000000..2e133eff29 --- /dev/null +++ b/t/t5515/fetch.master_.._.git_tag_tag-one-tree_tag_tag-three-file @@ -0,0 +1,7 @@ +# master ../.git tag tag-one-tree tag tag-three-file +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.master_.._.git_tag_tag-one_tag_tag-three b/t/t5515/fetch.master_.._.git_tag_tag-one_tag_tag-three new file mode 100644 index 0000000000..92b18b40cc --- /dev/null +++ b/t/t5515/fetch.master_.._.git_tag_tag-one_tag_tag-three @@ -0,0 +1,7 @@ +# master ../.git tag tag-one tag tag-three +8e32a6d901327a23ef831511badce7bf3bf46689 tag 'tag-one' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b tag 'tag-three' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.master_branches-default b/t/t5515/fetch.master_branches-default new file mode 100644 index 0000000000..603d6d2331 --- /dev/null +++ b/t/t5515/fetch.master_branches-default @@ -0,0 +1,8 @@ +# master branches-default +754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.master_branches-one b/t/t5515/fetch.master_branches-one new file mode 100644 index 0000000000..fe9bb0b798 --- /dev/null +++ b/t/t5515/fetch.master_branches-one @@ -0,0 +1,8 @@ +# master branches-one +8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.master_config-explicit b/t/t5515/fetch.master_config-explicit new file mode 100644 index 0000000000..4be97c7575 --- /dev/null +++ b/t/t5515/fetch.master_config-explicit @@ -0,0 +1,11 @@ +# master config-explicit +754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.master_config-glob b/t/t5515/fetch.master_config-glob new file mode 100644 index 0000000000..cb0726ff8d --- /dev/null +++ b/t/t5515/fetch.master_config-glob @@ -0,0 +1,11 @@ +# master config-glob +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.master_remote-explicit b/t/t5515/fetch.master_remote-explicit new file mode 100644 index 0000000000..44a1ca8429 --- /dev/null +++ b/t/t5515/fetch.master_remote-explicit @@ -0,0 +1,11 @@ +# master remote-explicit +754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t5515/fetch.master_remote-glob b/t/t5515/fetch.master_remote-glob new file mode 100644 index 0000000000..724e8db0a5 --- /dev/null +++ b/t/t5515/fetch.master_remote-glob @@ -0,0 +1,11 @@ +# master remote-glob +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../ +8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../ +22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../ +0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../ +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../ diff --git a/t/t6023-merge-file.sh b/t/t6023-merge-file.sh index f3cd3dba4d..c76fccfb5a 100644 --- a/t/t6023-merge-file.sh +++ b/t/t6023-merge-file.sh @@ -63,7 +63,7 @@ test_expect_success "merge without conflict (missing LF at EOF)" \ "git-merge-file test2.txt orig.txt new2.txt" test_expect_success "merge result added missing LF" \ - "diff -u test.txt test2.txt" + "git diff test.txt test2.txt" cp test.txt backup.txt test_expect_failure "merge with conflicts" \ @@ -86,7 +86,7 @@ non timebo mala, quoniam tu mecum es: virga tua et baculus tuus ipsa me consolata sunt. EOF -test_expect_success "expected conflict markers" "diff -u test.txt expect.txt" +test_expect_success "expected conflict markers" "git diff test.txt expect.txt" cp backup.txt test.txt test_expect_failure "merge with conflicts, using -L" \ @@ -110,7 +110,7 @@ virga tua et baculus tuus ipsa me consolata sunt. EOF test_expect_success "expected conflict markers, with -L" \ - "diff -u test.txt expect.txt" + "git diff test.txt expect.txt" sed "s/ tu / TU /" < new1.txt > new5.txt test_expect_failure "conflict in removed tail" \ @@ -132,7 +132,7 @@ virga tua et baculus tuus ipsa me consolata sunt. >>>>>>> new5.txt EOF -test_expect_success "expected conflict markers" "diff -u expect out" +test_expect_success "expected conflict markers" "git diff expect out" test_done diff --git a/t/t6024-recursive-merge.sh b/t/t6024-recursive-merge.sh index 31b96257b4..a398556137 100644 --- a/t/t6024-recursive-merge.sh +++ b/t/t6024-recursive-merge.sh @@ -70,7 +70,7 @@ G >>>>>>> G:a1 EOF -test_expect_success "result contains a conflict" "diff -u expect a1" +test_expect_success "result contains a conflict" "git diff expect a1" git ls-files --stage > out cat > expect << EOF @@ -79,6 +79,6 @@ cat > expect << EOF 100644 fd7923529855d0b274795ae3349c5e0438333979 3 a1 EOF -test_expect_success "virtual trees were processed" "diff -u expect out" +test_expect_success "virtual trees were processed" "git diff expect out" test_done diff --git a/t/t6025-merge-symlinks.sh b/t/t6025-merge-symlinks.sh new file mode 100644 index 0000000000..3c1a6972bd --- /dev/null +++ b/t/t6025-merge-symlinks.sh @@ -0,0 +1,62 @@ +#!/bin/sh +# +# Copyright (c) 2007 Johannes Sixt +# + +test_description='merging symlinks on filesystem w/o symlink support. + +This tests that git-merge-recursive writes merge results as plain files +if core.symlinks is false.' + +. ./test-lib.sh + +test_expect_success \ +'setup' ' +git-config core.symlinks false && +> file && +git-add file && +git-commit -m initial && +git-branch b-symlink && +git-branch b-file && +l=$(echo -n file | git-hash-object -t blob -w --stdin) && +echo "120000 $l symlink" | git-update-index --index-info && +git-commit -m master && +git-checkout b-symlink && +l=$(echo -n file-different | git-hash-object -t blob -w --stdin) && +echo "120000 $l symlink" | git-update-index --index-info && +git-commit -m b-symlink && +git-checkout b-file && +echo plain-file > symlink && +git-add symlink && +git-commit -m b-file' + +test_expect_failure \ +'merge master into b-symlink, which has a different symbolic link' ' +! git-checkout b-symlink || +git-merge master' + +test_expect_success \ +'the merge result must be a file' ' +test -f symlink' + +test_expect_failure \ +'merge master into b-file, which has a file instead of a symbolic link' ' +! (git-reset --hard && +git-checkout b-file) || +git-merge master' + +test_expect_success \ +'the merge result must be a file' ' +test -f symlink' + +test_expect_failure \ +'merge b-file, which has a file instead of a symbolic link, into master' ' +! (git-reset --hard && +git-checkout master) || +git-merge b-file' + +test_expect_success \ +'the merge result must be a file' ' +test -f symlink' + +test_done diff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh index ea14023616..526d7d1c44 100755 --- a/t/t6200-fmt-merge-msg.sh +++ b/t/t6200-fmt-merge-msg.sh @@ -79,7 +79,7 @@ test_expect_success 'merge-msg test #1' ' git fetch . left && git fmt-merge-msg <.git/FETCH_HEAD >actual && - diff -u actual expected + git diff actual expected ' cat >expected <<\EOF @@ -92,7 +92,7 @@ test_expect_success 'merge-msg test #2' ' git fetch ../trash left && git fmt-merge-msg <.git/FETCH_HEAD >actual && - diff -u actual expected + git diff actual expected ' cat >expected <<\EOF @@ -115,7 +115,7 @@ test_expect_success 'merge-msg test #3' ' git fetch . left && git fmt-merge-msg <.git/FETCH_HEAD >actual && - diff -u actual expected + git diff actual expected ' cat >expected <<\EOF @@ -145,7 +145,7 @@ test_expect_success 'merge-msg test #4' ' git fetch . left right && git fmt-merge-msg <.git/FETCH_HEAD >actual && - diff -u actual expected + git diff actual expected ' test_expect_success 'merge-msg test #5' ' @@ -157,7 +157,7 @@ test_expect_success 'merge-msg test #5' ' git fetch . left right && git fmt-merge-msg <.git/FETCH_HEAD >actual && - diff -u actual expected + git diff actual expected ' test_done diff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh index 040da92756..eb628fe075 100755 --- a/t/t9100-git-svn-basic.sh +++ b/t/t9100-git-svn-basic.sh @@ -169,7 +169,7 @@ test_expect_success "$name" " svn up '$SVN_TREE' && test -f '$SVN_TREE'/exec-2.sh && test ! -L '$SVN_TREE'/exec-2.sh && - diff -u help $SVN_TREE/exec-2.sh" + git diff help $SVN_TREE/exec-2.sh" if test "$have_utf8" = t then @@ -193,7 +193,7 @@ test_expect_success "$name" \ "git-svn init $svnrepo && git-svn fetch && git-rev-list --pretty=raw remotes/git-svn | grep ^tree | uniq > a && git-rev-list --pretty=raw remotes/alt | grep ^tree | uniq > b && - diff -u a b" + git diff a b" name='check imported tree checksums expected tree checksums' rm -f expected @@ -211,8 +211,58 @@ tree d667270a1f7b109f5eb3aaea21ede14b56bfdd6e tree 8f51f74cf0163afc9ad68a4b1537288c4558b5a4 EOF -echo tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904 >> expected +test_expect_success "$name" "git diff a expected" -test_expect_success "$name" "diff -u a expected" +test_expect_failure 'exit if remote refs are ambigious' " + git-config --add svn-remote.svn.fetch \ + bar:refs/remotes/git-svn && + git-svn migrate + " + +test_expect_failure 'exit if init-ing a would clobber a URL' " + svnadmin create ${PWD}/svnrepo2 && + svn mkdir -m 'mkdir bar' ${svnrepo}2/bar && + git-config --unset svn-remote.svn.fetch \ + '^bar:refs/remotes/git-svn$' && + git-svn init ${svnrepo}2/bar + " + +test_expect_success \ + 'init allows us to connect to another directory in the same repo' " + git-svn init -i bar $svnrepo/bar && + git config --get svn-remote.svn.fetch \ + '^bar:refs/remotes/bar$' && + git config --get svn-remote.svn.fetch \ + '^:refs/remotes/git-svn$' + " + +test_expect_success 'able to dcommit to a subdirectory' " + git-svn fetch -i bar && + git checkout -b my-bar refs/remotes/bar && + echo abc > d && + git update-index --add d && + git commit -m '/bar/d should be in the log' && + git-svn dcommit -i bar && + test -z \"\`git diff refs/heads/my-bar refs/remotes/bar\`\" && + mkdir newdir && + echo new > newdir/dir && + git update-index --add newdir/dir && + git commit -m 'add a new directory' && + git-svn dcommit -i bar && + test -z \"\`git diff refs/heads/my-bar refs/remotes/bar\`\" && + echo foo >> newdir/dir && + git update-index newdir/dir && + git commit -m 'modify a file in new directory' && + git-svn dcommit -i bar && + test -z \"\`git diff refs/heads/my-bar refs/remotes/bar\`\" + " + +test_expect_success 'able to set-tree to a subdirectory' " + echo cba > d && + git update-index d && + git commit -m 'update /bar/d' && + git-svn set-tree -i bar HEAD && + test -z \"\`git diff refs/heads/my-bar refs/remotes/bar\`\" + " test_done diff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh index e8133d81cb..622ea1c0df 100755 --- a/t/t9101-git-svn-props.sh +++ b/t/t9101-git-svn-props.sh @@ -121,4 +121,30 @@ b_ne_cr="`git-hash-object ne_cr`" test_expect_success 'CRLF + $Id$' "test '$a_cr' = '$b_cr'" test_expect_success 'CRLF + $Id$ (no newline)' "test '$a_ne_cr' = '$b_ne_cr'" +cat > show-ignore.expect <<\EOF + +# / +/no-such-file* + +# deeply +/deeply/no-such-file* + +# deeply/nested +/deeply/nested/no-such-file* + +# deeply/nested/directory +/deeply/nested/directory/no-such-file* +EOF + +test_expect_success 'test show-ignore' " + cd test_wc && + mkdir -p deeply/nested/directory && + svn add deeply && + svn propset -R svn:ignore 'no-such-file*' . + svn commit -m 'propset svn:ignore' + cd .. && + git-svn show-ignore > show-ignore.got && + cmp show-ignore.expect show-ignore.got + " + test_done diff --git a/t/t9103-git-svn-graft-branches.sh b/t/t9103-git-svn-graft-branches.sh deleted file mode 100755 index 183ae3b1c2..0000000000 --- a/t/t9103-git-svn-graft-branches.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh -test_description='git-svn graft-branches' -. ./lib-git-svn.sh - -svnrepo="$svnrepo/test-git-svn" - -test_expect_success 'initialize repo' " - mkdir import && - cd import && - mkdir -p trunk branches tags && - echo hello > trunk/readme && - svn import -m 'import for git-svn' . $svnrepo && - cd .. && - svn cp -m 'tag a' $svnrepo/trunk $svnrepo/tags/a && - svn cp -m 'branch a' $svnrepo/trunk $svnrepo/branches/a && - svn co $svnrepo wc && - cd wc && - echo feedme >> branches/a/readme && - poke branches/a/readme && - svn commit -m hungry && - cd trunk && - svn merge -r3:4 $svnrepo/branches/a && - svn commit -m 'merge with a' && - cd ../.. && - git-svn multi-init $svnrepo -T trunk -b branches -t tags && - git-svn multi-fetch - " - -r1=`git-rev-list remotes/trunk | tail -n1` -r2=`git-rev-list remotes/tags/a | tail -n1` -r3=`git-rev-list remotes/a | tail -n1` -r4=`git-rev-parse remotes/a` -r5=`git-rev-parse remotes/trunk` - -test_expect_success 'test graft-branches regexes and copies' " - test -n "$r1" && - test -n "$r2" && - test -n "$r3" && - test -n "$r4" && - test -n "$r5" && - git-svn graft-branches && - grep '^$r2 $r1' $GIT_DIR/info/grafts && - grep '^$r3 $r1' $GIT_DIR/info/grafts && - grep '^$r5 ' $GIT_DIR/info/grafts | grep '$r4' | grep '$r1' - " - -test_debug 'gitk --all & sleep 1' - -test_expect_success 'test graft-branches with tree-joins' " - rm $GIT_DIR/info/grafts && - git-svn graft-branches --no-default-regex --no-graft-copy -B && - grep '^$r3 ' $GIT_DIR/info/grafts | grep '$r1' | grep '$r2' && - grep '^$r2 $r1' $GIT_DIR/info/grafts && - grep '^$r5 ' $GIT_DIR/info/grafts | grep '$r1' | grep '$r4' - " - -# the result of this is kinda funky, we have a strange history and -# this is just a test :) -test_debug 'gitk --all &' - -test_done diff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh index 405b555368..bd4f366e86 100755 --- a/t/t9104-git-svn-follow-parent.sh +++ b/t/t9104-git-svn-follow-parent.sh @@ -3,7 +3,7 @@ # Copyright (c) 2006 Eric Wong # -test_description='git-svn --follow-parent fetching' +test_description='git-svn fetching' . ./lib-git-svn.sh test_expect_success 'initialize repo' " @@ -27,11 +27,141 @@ test_expect_success 'initialize repo' " cd .. " -test_expect_success 'init and fetch --follow-parent a moved directory' " +test_expect_success 'init and fetch a moved directory' " git-svn init -i thunk $svnrepo/thunk && - git-svn fetch --follow-parent -i thunk && - git-rev-parse --verify refs/remotes/trunk && - test '$?' -eq '0' + git-svn fetch -i thunk && + test \"\`git-rev-parse --verify refs/remotes/thunk@2\`\" \ + = \"\`git-rev-parse --verify refs/remotes/thunk~1\`\" && + test \"\`git-cat-file blob refs/remotes/thunk:readme |\ + sed -n -e '3p'\`\" = goodbye && + test -z \"\`git-config --get svn-remote.svn.fetch \ + '^trunk:refs/remotes/thunk@2$'\`\" + " + +test_expect_success 'init and fetch from one svn-remote' " + git-config svn-remote.svn.url $svnrepo && + git-config --add svn-remote.svn.fetch \ + trunk:refs/remotes/svn/trunk && + git-config --add svn-remote.svn.fetch \ + thunk:refs/remotes/svn/thunk && + git-svn fetch -i svn/thunk && + test \"\`git-rev-parse --verify refs/remotes/svn/trunk\`\" \ + = \"\`git-rev-parse --verify refs/remotes/svn/thunk~1\`\" && + test \"\`git-cat-file blob refs/remotes/svn/thunk:readme |\ + sed -n -e '3p'\`\" = goodbye + " + +test_expect_success 'follow deleted parent' " + svn cp -m 'resurrecting trunk as junk' \ + -r2 $svnrepo/trunk $svnrepo/junk && + git-config --add svn-remote.svn.fetch \ + junk:refs/remotes/svn/junk && + git-svn fetch -i svn/thunk && + git-svn fetch -i svn/junk && + test -z \"\`git diff svn/junk svn/trunk\`\" && + test \"\`git merge-base svn/junk svn/trunk\`\" \ + = \"\`git rev-parse svn/trunk\`\" + " + +test_expect_success 'follow larger parent' " + mkdir -p import/trunk/thunk/bump/thud && + echo hi > import/trunk/thunk/bump/thud/file && + svn import -m 'import a larger parent' import $svnrepo/larger-parent && + svn cp -m 'hi' $svnrepo/larger-parent $svnrepo/another-larger && + git-svn init -i larger $svnrepo/another-larger/trunk/thunk/bump/thud && + git-svn fetch -i larger && + git-rev-parse --verify refs/remotes/larger && + git-rev-parse --verify \ + refs/remotes/larger-parent/trunk/thunk/bump/thud && + test \"\`git-merge-base \ + refs/remotes/larger-parent/trunk/thunk/bump/thud \ + refs/remotes/larger\`\" = \ + \"\`git-rev-parse refs/remotes/larger\`\" + true + " + +test_expect_success 'follow higher-level parent' " + svn mkdir -m 'follow higher-level parent' $svnrepo/blob && + svn co $svnrepo/blob blob && + cd blob && + echo hi > hi && + svn add hi && + svn commit -m 'hihi' && + cd .. + svn mkdir -m 'new glob at top level' $svnrepo/glob && + svn mv -m 'move blob down a level' $svnrepo/blob $svnrepo/glob/blob && + git-svn init -i blob $svnrepo/glob/blob && + git-svn fetch -i blob + " + +test_expect_success 'follow deleted directory' " + svn mv -m 'bye!' $svnrepo/glob/blob/hi $svnrepo/glob/blob/bye && + svn rm -m 'remove glob' $svnrepo/glob && + git-svn init -i glob $svnrepo/glob && + git-svn fetch -i glob && + test \"\`git cat-file blob refs/remotes/glob:blob/bye\`\" = hi && + test \"\`git ls-tree refs/remotes/glob | wc -l \`\" -eq 1 + " + +# ref: r9270 of the Subversion repository: (http://svn.collab.net/repos/svn) +# in trunk/subversion/bindings/swig/perl +test_expect_success 'follow-parent avoids deleting relevant info' " + mkdir -p import/trunk/subversion/bindings/swig/perl/t && + for i in a b c ; do \ + echo \$i > import/trunk/subversion/bindings/swig/perl/\$i.pm && + echo _\$i > import/trunk/subversion/bindings/swig/perl/t/\$i.t; \ + done && + echo 'bad delete test' > \ + import/trunk/subversion/bindings/swig/perl/t/larger-parent && + echo 'bad delete test 2' > \ + import/trunk/subversion/bindings/swig/perl/another-larger && + cd import && + svn import -m 'r9270 test' . $svnrepo/r9270 && + cd .. && + svn co $svnrepo/r9270/trunk/subversion/bindings/swig/perl r9270 && + cd r9270 && + svn mkdir native && + svn mv t native/t && + for i in a b c; do svn mv \$i.pm native/\$i.pm; done && + echo z >> native/t/c.t && + poke native/t/c.t && + svn commit -m 'reorg test' && + cd .. && + git-svn init -i r9270-t \ + $svnrepo/r9270/trunk/subversion/bindings/swig/perl/native/t && + git-svn fetch -i r9270-t && + test \`git rev-list r9270-t | wc -l\` -eq 2 && + test \"\`git ls-tree --name-only r9270-t~1\`\" = \ + \"\`git ls-tree --name-only r9270-t\`\" + " + +test_expect_success "track initial change if it was only made to parent" " + svn cp -m 'wheee!' $svnrepo/r9270/trunk $svnrepo/r9270/drunk && + git-svn init -i r9270-d \ + $svnrepo/r9270/drunk/subversion/bindings/swig/perl/native/t && + git-svn fetch -i r9270-d && + test \`git rev-list r9270-d | wc -l\` -eq 3 && + test \"\`git ls-tree --name-only r9270-t\`\" = \ + \"\`git ls-tree --name-only r9270-d\`\" && + test \"\`git rev-parse r9270-t\`\" = \ + \"\`git rev-parse r9270-d~1\`\" + " + +test_expect_success "track multi-parent paths" " + svn cp -m 'resurrect /glob' $svnrepo/r9270 $svnrepo/glob && + git-svn multi-fetch && + test \`git cat-file commit refs/remotes/glob | \ + grep '^parent ' | wc -l\` -eq 2 + " + +test_expect_success "multi-fetch continues to work" " + git-svn multi-fetch + " + +test_expect_success "multi-fetch works off a 'clean' repository" " + rm -r $GIT_DIR/svn $GIT_DIR/refs/remotes $GIT_DIR/logs && + mkdir $GIT_DIR/svn && + git-svn multi-fetch " test_debug 'gitk --all &' diff --git a/t/t9105-git-svn-commit-diff.sh b/t/t9105-git-svn-commit-diff.sh index 6323c7e3ac..c668dd1270 100755 --- a/t/t9105-git-svn-commit-diff.sh +++ b/t/t9105-git-svn-commit-diff.sh @@ -31,4 +31,13 @@ test_expect_success 'test the commit-diff command' " cmp readme wc/readme " +test_expect_success 'commit-diff to a sub-directory (with git-svn config)' " + svn import -m 'sub-directory' import $svnrepo/subdir && + git-svn init $svnrepo/subdir && + git-svn fetch && + git-svn commit-diff -r3 '$prev' '$head' && + svn cat $svnrepo/subdir/readme > readme.2 && + cmp readme readme.2 + " + test_done diff --git a/t/t9107-git-svn-migrate.sh b/t/t9107-git-svn-migrate.sh new file mode 100755 index 0000000000..dc2afdaa45 --- /dev/null +++ b/t/t9107-git-svn-migrate.sh @@ -0,0 +1,112 @@ +#!/bin/sh +# Copyright (c) 2006 Eric Wong +test_description='git-svn metadata migrations from previous versions' +. ./lib-git-svn.sh + +test_expect_success 'setup old-looking metadata' " + cp $GIT_DIR/config $GIT_DIR/config-old-git-svn && + mkdir import && + cd import && + for i in trunk branches/a branches/b \ + tags/0.1 tags/0.2 tags/0.3; do + mkdir -p \$i && \ + echo hello >> \$i/README || exit 1 + done && \ + svn import -m test . $svnrepo + cd .. && + git-svn init $svnrepo && + git-svn fetch && + mv $GIT_DIR/svn/* $GIT_DIR/ && + mv $GIT_DIR/svn/.metadata $GIT_DIR/ && + rmdir $GIT_DIR/svn && + git-update-ref refs/heads/git-svn-HEAD refs/remotes/git-svn && + git-update-ref refs/heads/svn-HEAD refs/remotes/git-svn && + git-update-ref -d refs/remotes/git-svn refs/remotes/git-svn + " + +head=`git rev-parse --verify refs/heads/git-svn-HEAD^0` +test_expect_success 'git-svn-HEAD is a real HEAD' "test -n '$head'" + +test_expect_success 'initialize old-style (v0) git-svn layout' " + mkdir -p $GIT_DIR/git-svn/info $GIT_DIR/svn/info && + echo $svnrepo > $GIT_DIR/git-svn/info/url && + echo $svnrepo > $GIT_DIR/svn/info/url && + git-svn migrate && + ! test -d $GIT_DIR/git-svn && + git-rev-parse --verify refs/remotes/git-svn^0 && + git-rev-parse --verify refs/remotes/svn^0 && + test \`git config --get svn-remote.svn.url\` = '$svnrepo' && + test \`git config --get svn-remote.svn.fetch\` = \ + ':refs/remotes/git-svn' + " + +test_expect_success 'initialize a multi-repository repo' " + git-svn init $svnrepo -T trunk -t tags -b branches && + git-config --get-all svn-remote.svn.fetch > fetch.out && + grep '^trunk:refs/remotes/trunk$' fetch.out && + test -n \"\`git-config --get svn-remote.svn.branches \ + '^branches/\*:refs/remotes/\*$'\`\" && + test -n \"\`git-config --get svn-remote.svn.tags \ + '^tags/\*:refs/remotes/tags/\*$'\`\" && + git config --unset svn-remote.svn.branches \ + '^branches/\*:refs/remotes/\*$' && + git config --unset svn-remote.svn.tags \ + '^tags/\*:refs/remotes/tags/\*$' && + git-config --add svn-remote.svn.fetch 'branches/a:refs/remotes/a' && + git-config --add svn-remote.svn.fetch 'branches/b:refs/remotes/b' && + for i in tags/0.1 tags/0.2 tags/0.3; do + git-config --add svn-remote.svn.fetch \ + \$i:refs/remotes/\$i || exit 1; done + " + +# refs should all be different, but the trees should all be the same: +test_expect_success 'multi-fetch works on partial urls + paths' " + git-svn multi-fetch && + for i in trunk a b tags/0.1 tags/0.2 tags/0.3; do + git rev-parse --verify refs/remotes/\$i^0 >> refs.out || exit 1; + done && + test -z \"\`sort < refs.out | uniq -d\`\" && + for i in trunk a b tags/0.1 tags/0.2 tags/0.3; do + for j in trunk a b tags/0.1 tags/0.2 tags/0.3; do + if test \$j != \$i; then continue; fi + test -z \"\`git diff refs/remotes/\$i \ + refs/remotes/\$j\`\" ||exit 1; done; done + " + +test_expect_success 'migrate --minimize on old inited layout' " + git config --unset-all svn-remote.svn.fetch && + git config --unset-all svn-remote.svn.url && + rm -rf $GIT_DIR/svn && + for i in \`cat fetch.out\`; do + path=\`expr \$i : '\\([^:]*\\):.*$'\` + ref=\`expr \$i : '[^:]*:refs/remotes/\\(.*\\)$'\` + if test -z \"\$ref\"; then continue; fi + if test -n \"\$path\"; then path=\"/\$path\"; fi + ( mkdir -p $GIT_DIR/svn/\$ref/info/ && + echo $svnrepo\$path > $GIT_DIR/svn/\$ref/info/url ) || exit 1; + done && + git-svn migrate --minimize && + test -z \"\`git-config -l |grep -v '^svn-remote\.git-svn\.'\`\" && + git-config --get-all svn-remote.svn.fetch > fetch.out && + grep '^trunk:refs/remotes/trunk$' fetch.out && + grep '^branches/a:refs/remotes/a$' fetch.out && + grep '^branches/b:refs/remotes/b$' fetch.out && + grep '^tags/0\.1:refs/remotes/tags/0\.1$' fetch.out && + grep '^tags/0\.2:refs/remotes/tags/0\.2$' fetch.out && + grep '^tags/0\.3:refs/remotes/tags/0\.3$' fetch.out + grep '^:refs/remotes/git-svn' fetch.out + " + +test_expect_success ".rev_db auto-converted to .rev_db.UUID" " + git-svn fetch -i trunk && + expect=$GIT_DIR/svn/trunk/.rev_db.* && + test -n \"\$expect\" && + mv \$expect $GIT_DIR/svn/trunk/.rev_db && + git-svn fetch -i trunk && + test -L $GIT_DIR/svn/trunk/.rev_db && + test -f \$expect && + cmp \$expect $GIT_DIR/svn/trunk/.rev_db + " + +test_done + diff --git a/t/t9108-git-svn-glob.sh b/t/t9108-git-svn-glob.sh new file mode 100755 index 0000000000..db4344cc84 --- /dev/null +++ b/t/t9108-git-svn-glob.sh @@ -0,0 +1,86 @@ +#!/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 'goodbye world' > trunk/src/b/readme && + svn import -m 'initial' trunk $svnrepo/trunk && + svn co $svnrepo tmp && + cd tmp && + mkdir branches tags && + svn add branches tags && + svn cp trunk branches/start && + svn commit -m 'start a new branch' && + svn up && + echo 'hi' >> branches/start/src/b/readme && + poke branches/start/src/b/readme && + echo 'hey' >> branches/start/src/a/readme && + poke branches/start/src/a/readme && + svn commit -m 'hi' && + svn up && + svn cp branches/start tags/end && + echo 'bye' >> tags/end/src/b/readme && + poke tags/end/src/b/readme && + echo 'aye' >> tags/end/src/a/readme && + poke tags/end/src/a/readme && + svn commit -m 'the end' && + echo 'byebye' >> tags/end/src/b/readme && + poke tags/end/src/b/readme && + svn commit -m 'nothing to see here' + cd .. && + git config --add svn-remote.svn.url $svnrepo && + git config --add svn-remote.svn.fetch \ + 'trunk/src/a:refs/remotes/trunk' && + git config --add svn-remote.svn.branches \ + 'branches/*/src/a:refs/remotes/branches/*' && + git config --add svn-remote.svn.tags\ + 'tags/*/src/a:refs/remotes/tags/*' && + git-svn multi-fetch && + git log --pretty=oneline refs/remotes/tags/end | \ + sed -e 's/^.\{41\}//' > output.end && + cmp expect.end output.end && + test \"\`git rev-parse refs/remotes/tags/end~1\`\" = \ + \"\`git rev-parse refs/remotes/branches/start\`\" && + test \"\`git rev-parse refs/remotes/branches/start~2\`\" = \ + \"\`git rev-parse refs/remotes/trunk\`\" + " + +echo try to try > expect.two +echo nothing to see here >> expect.two +cat expect.end >> expect.two + +test_expect_success 'test left-hand-side only globbing' " + git config --add svn-remote.two.url $svnrepo && + git config --add svn-remote.two.fetch trunk:refs/remotes/two/trunk && + git config --add svn-remote.two.branches \ + 'branches/*:refs/remotes/two/branches/*' && + git config --add svn-remote.two.tags \ + 'tags/*:refs/remotes/two/tags/*' && + cd tmp && + echo 'try try' >> tags/end/src/b/readme && + poke tags/end/src/b/readme && + svn commit -m 'try to try' + cd .. && + git-svn fetch two && + test \`git rev-list refs/remotes/two/tags/end | wc -l\` -eq 6 && + test \`git rev-list refs/remotes/two/branches/start | wc -l\` -eq 3 && + test \`git rev-parse refs/remotes/two/branches/start~2\` = \ + \`git rev-parse refs/remotes/two/trunk\` && + test \`git rev-parse refs/remotes/two/tags/end~3\` = \ + \`git rev-parse refs/remotes/two/branches/start\` && + git log --pretty=oneline refs/remotes/two/tags/end | \ + sed -e 's/^.\{41\}//' > output.two && + cmp expect.two output.two + " + +test_done diff --git a/t/t9110-git-svn-use-svm-props.sh b/t/t9110-git-svn-use-svm-props.sh new file mode 100755 index 0000000000..9db0d8fd8d --- /dev/null +++ b/t/t9110-git-svn-use-svm-props.sh @@ -0,0 +1,51 @@ +#!/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 < ../t9110/svm.dump && + git-svn init -R arr -i bar $svnrepo/mirror/arr && + git-svn init -R argh -i dir $svnrepo/mirror/argh && + git-svn init -R argh -i e $svnrepo/mirror/argh/a/b/c/d/e && + git-config svn.useSvmProps true && + git-svn fetch --all + " + +uuid=161ce429-a9dd-4828-af4a-52023f968c89 + +bar_url=http://mayonaise/svnrepo/bar +test_expect_success 'verify metadata for /bar' " + git-cat-file commit refs/remotes/bar | \ + grep '^git-svn-id: $bar_url@12 $uuid$' && + git-cat-file commit refs/remotes/bar~1 | \ + grep '^git-svn-id: $bar_url@11 $uuid$' && + git-cat-file commit refs/remotes/bar~2 | \ + grep '^git-svn-id: $bar_url@10 $uuid$' && + git-cat-file commit refs/remotes/bar~3 | \ + grep '^git-svn-id: $bar_url@9 $uuid$' && + git-cat-file commit refs/remotes/bar~4 | \ + grep '^git-svn-id: $bar_url@6 $uuid$' && + git-cat-file commit refs/remotes/bar~5 | \ + grep '^git-svn-id: $bar_url@1 $uuid$' + " + +e_url=http://mayonaise/svnrepo/dir/a/b/c/d/e +test_expect_success 'verify metadata for /dir/a/b/c/d/e' " + git-cat-file commit refs/remotes/e | \ + grep '^git-svn-id: $e_url@1 $uuid$' + " + +dir_url=http://mayonaise/svnrepo/dir +test_expect_success 'verify metadata for /dir' " + git-cat-file commit refs/remotes/dir | \ + grep '^git-svn-id: $dir_url@2 $uuid$' && + git-cat-file commit refs/remotes/dir~1 | \ + grep '^git-svn-id: $dir_url@1 $uuid$' + " + +test_done diff --git a/t/t9110/svm.dump b/t/t9110/svm.dump new file mode 100644 index 0000000000..cc799c238d --- /dev/null +++ b/t/t9110/svm.dump @@ -0,0 +1,511 @@ +SVN-fs-dump-format-version: 2 + +UUID: de5973c6-545d-41da-aded-c265f9039e74 + +Revision-number: 0 +Prop-content-length: 56 +Content-length: 56 + +K 8 +svn:date +V 27 +2007-02-17T06:54:59.793104Z +PROPS-END + +Revision-number: 1 +Prop-content-length: 200 +Content-length: 200 + +K 7 +svn:log +V 40 +SVM: initializing mirror for /mirror/arr +K 10 +svn:author +V 3 +svm +K 11 +svm:headrev +V 39 +161ce429-a9dd-4828-af4a-52023f968c89:0 + +K 8 +svn:date +V 27 +2007-02-17T06:55:00.121647Z +PROPS-END + +Node-path: +Node-kind: dir +Node-action: change +Prop-content-length: 44 +Content-length: 44 + +K 10 +svm:mirror +V 12 +/mirror/arr + +PROPS-END + + +Node-path: mirror +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: mirror/arr +Node-kind: dir +Node-action: add +Prop-content-length: 116 +Content-length: 116 + +K 10 +svm:source +V 29 +http://mayonaise/svnrepo!/bar +K 8 +svm:uuid +V 36 +161ce429-a9dd-4828-af4a-52023f968c89 +PROPS-END + + +Revision-number: 2 +Prop-content-length: 182 +Content-length: 182 + +K 7 +svn:log +V 18 +import for git-svn +K 10 +svn:author +V 7 +svnsync +K 11 +svm:headrev +V 39 +161ce429-a9dd-4828-af4a-52023f968c89:1 + +K 8 +svn:date +V 27 +2007-02-17T05:10:52.108847Z +PROPS-END + +Node-path: mirror/arr +Node-kind: dir +Node-action: change +Prop-content-length: 116 +Content-length: 116 + +K 10 +svm:source +V 29 +http://mayonaise/svnrepo!/bar +K 8 +svm:uuid +V 36 +161ce429-a9dd-4828-af4a-52023f968c89 +PROPS-END + + +Node-path: mirror/arr/zzz +Node-kind: file +Node-action: add +Prop-content-length: 10 +Text-content-length: 4 +Text-content-md5: 33b02bc15ce9557d2dd8484d58f95ac4 +Content-length: 14 + +PROPS-END +zzz + + +Revision-number: 3 +Prop-content-length: 230 +Content-length: 230 + +K 7 +svn:log +V 66 +new symlink is added to a file that was also just made executable + +K 10 +svn:author +V 7 +svnsync +K 11 +svm:headrev +V 39 +161ce429-a9dd-4828-af4a-52023f968c89:6 + +K 8 +svn:date +V 27 +2007-02-17T05:11:01.686891Z +PROPS-END + +Node-path: mirror/arr/zzz +Node-kind: file +Node-action: change +Prop-content-length: 36 +Text-content-length: 4 +Text-content-md5: 33b02bc15ce9557d2dd8484d58f95ac4 +Content-length: 40 + +K 14 +svn:executable +V 1 +* +PROPS-END +zzz + + +Revision-number: 4 +Prop-content-length: 192 +Content-length: 192 + +K 7 +svn:log +V 28 +/bar/d should be in the log + +K 10 +svn:author +V 7 +svnsync +K 11 +svm:headrev +V 39 +161ce429-a9dd-4828-af4a-52023f968c89:9 + +K 8 +svn:date +V 27 +2007-02-17T05:11:07.686552Z +PROPS-END + +Node-path: mirror/arr/d +Node-kind: file +Node-action: add +Prop-content-length: 10 +Text-content-length: 4 +Text-content-md5: 0bee89b07a248e27c83fc3d5951213c1 +Content-length: 14 + +PROPS-END +abc + + +Revision-number: 5 +Prop-content-length: 185 +Content-length: 185 + +K 7 +svn:log +V 20 +add a new directory + +K 10 +svn:author +V 7 +svnsync +K 11 +svm:headrev +V 40 +161ce429-a9dd-4828-af4a-52023f968c89:10 + +K 8 +svn:date +V 27 +2007-02-17T05:11:08.405953Z +PROPS-END + +Node-path: mirror/arr/newdir +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: mirror/arr/newdir/dir +Node-kind: file +Node-action: add +Prop-content-length: 10 +Text-content-length: 4 +Text-content-md5: 9cd599a3523898e6a12e13ec787da50a +Content-length: 14 + +PROPS-END +new + + +Revision-number: 6 +Prop-content-length: 196 +Content-length: 196 + +K 7 +svn:log +V 31 +modify a file in new directory + +K 10 +svn:author +V 7 +svnsync +K 11 +svm:headrev +V 40 +161ce429-a9dd-4828-af4a-52023f968c89:11 + +K 8 +svn:date +V 27 +2007-02-17T05:11:09.126645Z +PROPS-END + +Node-path: mirror/arr/newdir/dir +Node-kind: file +Node-action: change +Text-content-length: 8 +Text-content-md5: a950e20332358e523a5e9d571e47fa64 +Content-length: 8 + +new +foo + + +Revision-number: 7 +Prop-content-length: 179 +Content-length: 179 + +K 7 +svn:log +V 14 +update /bar/d + +K 10 +svn:author +V 7 +svnsync +K 11 +svm:headrev +V 40 +161ce429-a9dd-4828-af4a-52023f968c89:12 + +K 8 +svn:date +V 27 +2007-02-17T05:11:09.846221Z +PROPS-END + +Node-path: mirror/arr/d +Node-kind: file +Node-action: change +Text-content-length: 4 +Text-content-md5: 7abb78de7f2756ca8b511cbc879fd5e7 +Content-length: 4 + +cba + + +Revision-number: 8 +Prop-content-length: 201 +Content-length: 201 + +K 7 +svn:log +V 41 +SVM: initializing mirror for /mirror/argh +K 10 +svn:author +V 3 +svm +K 11 +svm:headrev +V 39 +161ce429-a9dd-4828-af4a-52023f968c89:0 + +K 8 +svn:date +V 27 +2007-02-17T06:56:03.703677Z +PROPS-END + +Node-path: +Node-kind: dir +Node-action: change +Prop-content-length: 57 +Content-length: 57 + +K 10 +svm:mirror +V 25 +/mirror/argh +/mirror/arr + +PROPS-END + + +Node-path: mirror/argh +Node-kind: dir +Node-action: add +Prop-content-length: 116 +Content-length: 116 + +K 10 +svm:source +V 29 +http://mayonaise/svnrepo!/dir +K 8 +svm:uuid +V 36 +161ce429-a9dd-4828-af4a-52023f968c89 +PROPS-END + + +Revision-number: 9 +Prop-content-length: 182 +Content-length: 182 + +K 7 +svn:log +V 18 +import for git-svn +K 10 +svn:author +V 7 +svnsync +K 11 +svm:headrev +V 39 +161ce429-a9dd-4828-af4a-52023f968c89:1 + +K 8 +svn:date +V 27 +2007-02-17T05:10:52.108847Z +PROPS-END + +Node-path: mirror/argh +Node-kind: dir +Node-action: change +Prop-content-length: 116 +Content-length: 116 + +K 10 +svm:source +V 29 +http://mayonaise/svnrepo!/dir +K 8 +svm:uuid +V 36 +161ce429-a9dd-4828-af4a-52023f968c89 +PROPS-END + + +Node-path: mirror/argh/a +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: mirror/argh/a/b +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: mirror/argh/a/b/c +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: mirror/argh/a/b/c/d +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: mirror/argh/a/b/c/d/e +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: mirror/argh/a/b/c/d/e/file +Node-kind: file +Node-action: add +Prop-content-length: 10 +Text-content-length: 9 +Text-content-md5: 3fd46fe46fcdcf062c802ca60dc826d5 +Content-length: 19 + +PROPS-END +deep dir + + +Revision-number: 10 +Prop-content-length: 197 +Content-length: 197 + +K 7 +svn:log +V 33 +try a deep --rmdir with a commit + +K 10 +svn:author +V 7 +svnsync +K 11 +svm:headrev +V 39 +161ce429-a9dd-4828-af4a-52023f968c89:2 + +K 8 +svn:date +V 27 +2007-02-17T05:10:54.847015Z +PROPS-END + +Node-path: mirror/argh/file +Node-kind: file +Node-action: add +Node-copyfrom-rev: 9 +Node-copyfrom-path: mirror/argh/a/b/c/d/e/file +Text-content-length: 9 +Text-content-md5: 3fd46fe46fcdcf062c802ca60dc826d5 +Content-length: 9 + +deep dir + + +Node-path: mirror/argh/a +Node-action: delete + + diff --git a/t/t9111-git-svn-use-svnsync-props.sh b/t/t9111-git-svn-use-svnsync-props.sh new file mode 100755 index 0000000000..483d7f8159 --- /dev/null +++ b/t/t9111-git-svn-use-svnsync-props.sh @@ -0,0 +1,51 @@ +#!/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 < ../t9111/svnsync.dump && + git-svn init -R arr -i bar $svnrepo/bar && + git-svn init -R argh -i dir $svnrepo/dir && + git-svn init -R argh -i e $svnrepo/dir/a/b/c/d/e && + git-config svn.useSvnsyncProps true && + git-svn fetch --all + " + +uuid=161ce429-a9dd-4828-af4a-52023f968c89 + +bar_url=http://mayonaise/svnrepo/bar +test_expect_success 'verify metadata for /bar' " + git-cat-file commit refs/remotes/bar | \ + grep '^git-svn-id: $bar_url@12 $uuid$' && + git-cat-file commit refs/remotes/bar~1 | \ + grep '^git-svn-id: $bar_url@11 $uuid$' && + git-cat-file commit refs/remotes/bar~2 | \ + grep '^git-svn-id: $bar_url@10 $uuid$' && + git-cat-file commit refs/remotes/bar~3 | \ + grep '^git-svn-id: $bar_url@9 $uuid$' && + git-cat-file commit refs/remotes/bar~4 | \ + grep '^git-svn-id: $bar_url@6 $uuid$' && + git-cat-file commit refs/remotes/bar~5 | \ + grep '^git-svn-id: $bar_url@1 $uuid$' + " + +e_url=http://mayonaise/svnrepo/dir/a/b/c/d/e +test_expect_success 'verify metadata for /dir/a/b/c/d/e' " + git-cat-file commit refs/remotes/e | \ + grep '^git-svn-id: $e_url@1 $uuid$' + " + +dir_url=http://mayonaise/svnrepo/dir +test_expect_success 'verify metadata for /dir' " + git-cat-file commit refs/remotes/dir | \ + grep '^git-svn-id: $dir_url@2 $uuid$' && + git-cat-file commit refs/remotes/dir~1 | \ + grep '^git-svn-id: $dir_url@1 $uuid$' + " + +test_done diff --git a/t/t9111/svnsync.dump b/t/t9111/svnsync.dump new file mode 100644 index 0000000000..a9a46eeb29 --- /dev/null +++ b/t/t9111/svnsync.dump @@ -0,0 +1,562 @@ +SVN-fs-dump-format-version: 2 + +UUID: b4bfe35e-f256-4096-874c-08c5639ecad7 + +Revision-number: 0 +Prop-content-length: 240 +Content-length: 240 + +K 18 +svn:sync-from-uuid +V 36 +161ce429-a9dd-4828-af4a-52023f968c89 +K 10 +svn:author +V 7 +svnsync +K 24 +svn:sync-last-merged-rev +V 2 +12 +K 8 +svn:date +V 27 +2007-02-17T05:10:52.017552Z +K 17 +svn:sync-from-url +V 24 +http://mayonaise/svnrepo +PROPS-END + +Revision-number: 1 +Prop-content-length: 120 +Content-length: 120 + +K 7 +svn:log +V 18 +import for git-svn +K 10 +svn:author +V 7 +svnsync +K 8 +svn:date +V 27 +2007-02-17T05:10:52.108847Z +PROPS-END + +Node-path: bar +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: bar/zzz +Node-kind: file +Node-action: add +Prop-content-length: 10 +Text-content-length: 4 +Text-content-md5: 33b02bc15ce9557d2dd8484d58f95ac4 +Content-length: 14 + +PROPS-END +zzz + + +Node-path: dir +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: dir/a +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: dir/a/b +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: dir/a/b/c +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: dir/a/b/c/d +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: dir/a/b/c/d/e +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: dir/a/b/c/d/e/file +Node-kind: file +Node-action: add +Prop-content-length: 10 +Text-content-length: 9 +Text-content-md5: 3fd46fe46fcdcf062c802ca60dc826d5 +Content-length: 19 + +PROPS-END +deep dir + + +Node-path: exec.sh +Node-kind: file +Node-action: add +Prop-content-length: 35 +Text-content-length: 10 +Text-content-md5: 3e2b31c72181b87149ff995e7202c0e3 +Content-length: 45 + +K 14 +svn:executable +V 0 + +PROPS-END +#!/bin/sh + + +Node-path: foo +Node-kind: file +Node-action: add +Prop-content-length: 10 +Text-content-length: 4 +Text-content-md5: d3b07384d113edec49eaa6238ad5ff00 +Content-length: 14 + +PROPS-END +foo + + +Node-path: foo.link +Node-kind: file +Node-action: add +Prop-content-length: 33 +Text-content-length: 8 +Text-content-md5: 1043146e49ef02cab12eef865cb34ff3 +Content-length: 41 + +K 11 +svn:special +V 1 +* +PROPS-END +link foo + +Revision-number: 2 +Prop-content-length: 135 +Content-length: 135 + +K 7 +svn:log +V 33 +try a deep --rmdir with a commit + +K 10 +svn:author +V 7 +svnsync +K 8 +svn:date +V 27 +2007-02-17T05:10:54.847015Z +PROPS-END + +Node-path: dir/file +Node-kind: file +Node-action: add +Node-copyfrom-rev: 1 +Node-copyfrom-path: dir/a/b/c/d/e/file +Text-content-length: 9 +Text-content-md5: 3fd46fe46fcdcf062c802ca60dc826d5 +Content-length: 9 + +deep dir + + +Node-path: dir/a +Node-action: delete + + +Node-path: file +Node-kind: file +Node-action: add +Node-copyfrom-rev: 1 +Node-copyfrom-path: dir/a/b/c/d/e/file +Text-content-length: 9 +Text-content-md5: 3fd46fe46fcdcf062c802ca60dc826d5 +Content-length: 9 + +deep dir + + +Revision-number: 3 +Prop-content-length: 136 +Content-length: 136 + +K 7 +svn:log +V 34 +remove executable bit from a file + +K 10 +svn:author +V 7 +svnsync +K 8 +svn:date +V 27 +2007-02-17T05:10:58.232691Z +PROPS-END + +Node-path: exec.sh +Node-kind: file +Node-action: change +Prop-content-length: 10 +Text-content-length: 10 +Text-content-md5: 3e2b31c72181b87149ff995e7202c0e3 +Content-length: 20 + +PROPS-END +#!/bin/sh + + +Revision-number: 4 +Prop-content-length: 131 +Content-length: 131 + +K 7 +svn:log +V 29 +add executable bit back file + +K 10 +svn:author +V 7 +svnsync +K 8 +svn:date +V 27 +2007-02-17T05:10:59.666560Z +PROPS-END + +Node-path: exec.sh +Node-kind: file +Node-action: change +Prop-content-length: 36 +Text-content-length: 10 +Text-content-md5: 3e2b31c72181b87149ff995e7202c0e3 +Content-length: 46 + +K 14 +svn:executable +V 1 +* +PROPS-END +#!/bin/sh + + +Revision-number: 5 +Prop-content-length: 154 +Content-length: 154 + +K 7 +svn:log +V 52 +executable file becomes a symlink to bar/zzz (file) + +K 10 +svn:author +V 7 +svnsync +K 8 +svn:date +V 27 +2007-02-17T05:11:00.676495Z +PROPS-END + +Node-path: exec.sh +Node-kind: file +Node-action: change +Prop-content-length: 33 +Text-content-length: 12 +Text-content-md5: f138693371665cc117742508761d684d +Content-length: 45 + +K 11 +svn:special +V 1 +* +PROPS-END +link bar/zzz + +Revision-number: 6 +Prop-content-length: 168 +Content-length: 168 + +K 7 +svn:log +V 66 +new symlink is added to a file that was also just made executable + +K 10 +svn:author +V 7 +svnsync +K 8 +svn:date +V 27 +2007-02-17T05:11:01.686891Z +PROPS-END + +Node-path: bar/zzz +Node-kind: file +Node-action: change +Prop-content-length: 36 +Text-content-length: 4 +Text-content-md5: 33b02bc15ce9557d2dd8484d58f95ac4 +Content-length: 40 + +K 14 +svn:executable +V 1 +* +PROPS-END +zzz + + +Node-path: exec-2.sh +Node-kind: file +Node-action: add +Node-copyfrom-rev: 5 +Node-copyfrom-path: exec.sh +Text-content-length: 12 +Text-content-md5: f138693371665cc117742508761d684d +Content-length: 12 + +link bar/zzz + +Revision-number: 7 +Prop-content-length: 136 +Content-length: 136 + +K 7 +svn:log +V 34 +modify a symlink to become a file + +K 10 +svn:author +V 7 +svnsync +K 8 +svn:date +V 27 +2007-02-17T05:11:02.677035Z +PROPS-END + +Node-path: exec-2.sh +Node-kind: file +Node-action: change +Prop-content-length: 10 +Text-content-length: 9 +Text-content-md5: 8e92eff9e911886cede27d420f89c735 +Content-length: 19 + +PROPS-END +git help + + +Revision-number: 8 +Prop-content-length: 109 +Content-length: 109 + +K 7 +svn:log +V 8 +éï∏ + +K 10 +svn:author +V 7 +svnsync +K 8 +svn:date +V 27 +2007-02-17T05:11:03.676862Z +PROPS-END + +Node-path: exec-2.sh +Node-kind: file +Node-action: change +Text-content-length: 17 +Text-content-md5: 49881954063cf26ca48c212396a957ca +Content-length: 17 + +git help +# hello + + +Revision-number: 9 +Prop-content-length: 130 +Content-length: 130 + +K 7 +svn:log +V 28 +/bar/d should be in the log + +K 10 +svn:author +V 7 +svnsync +K 8 +svn:date +V 27 +2007-02-17T05:11:07.686552Z +PROPS-END + +Node-path: bar/d +Node-kind: file +Node-action: add +Prop-content-length: 10 +Text-content-length: 4 +Text-content-md5: 0bee89b07a248e27c83fc3d5951213c1 +Content-length: 14 + +PROPS-END +abc + + +Revision-number: 10 +Prop-content-length: 122 +Content-length: 122 + +K 7 +svn:log +V 20 +add a new directory + +K 10 +svn:author +V 7 +svnsync +K 8 +svn:date +V 27 +2007-02-17T05:11:08.405953Z +PROPS-END + +Node-path: bar/newdir +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: bar/newdir/dir +Node-kind: file +Node-action: add +Prop-content-length: 10 +Text-content-length: 4 +Text-content-md5: 9cd599a3523898e6a12e13ec787da50a +Content-length: 14 + +PROPS-END +new + + +Revision-number: 11 +Prop-content-length: 133 +Content-length: 133 + +K 7 +svn:log +V 31 +modify a file in new directory + +K 10 +svn:author +V 7 +svnsync +K 8 +svn:date +V 27 +2007-02-17T05:11:09.126645Z +PROPS-END + +Node-path: bar/newdir/dir +Node-kind: file +Node-action: change +Text-content-length: 8 +Text-content-md5: a950e20332358e523a5e9d571e47fa64 +Content-length: 8 + +new +foo + + +Revision-number: 12 +Prop-content-length: 116 +Content-length: 116 + +K 7 +svn:log +V 14 +update /bar/d + +K 10 +svn:author +V 7 +svnsync +K 8 +svn:date +V 27 +2007-02-17T05:11:09.846221Z +PROPS-END + +Node-path: bar/d +Node-kind: file +Node-action: change +Text-content-length: 4 +Text-content-md5: 7abb78de7f2756ca8b511cbc879fd5e7 +Content-length: 4 + +cba + + diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh index 970d683650..8e958da536 100755 --- a/t/t9300-fast-import.sh +++ b/t/t9300-fast-import.sh @@ -74,7 +74,7 @@ EOF test_expect_success \ 'A: verify commit' \ 'git-cat-file commit master | sed 1d >actual && - diff -u expect actual' + git diff expect actual' cat >expect <<EOF 100644 blob file2 @@ -84,22 +84,22 @@ EOF test_expect_success \ 'A: verify tree' \ 'git-cat-file -p master^{tree} | sed "s/ [0-9a-f]* / /" >actual && - diff -u expect actual' + git diff expect actual' echo "$file2_data" >expect test_expect_success \ 'A: verify file2' \ - 'git-cat-file blob master:file2 >actual && diff -u expect actual' + 'git-cat-file blob master:file2 >actual && git diff expect actual' echo "$file3_data" >expect test_expect_success \ 'A: verify file3' \ - 'git-cat-file blob master:file3 >actual && diff -u expect actual' + 'git-cat-file blob master:file3 >actual && git diff expect actual' printf "$file4_data" >expect test_expect_success \ 'A: verify file4' \ - 'git-cat-file blob master:file4 >actual && diff -u expect actual' + 'git-cat-file blob master:file4 >actual && git diff expect actual' cat >expect <<EOF :2 `git-rev-parse --verify master:file2` @@ -109,7 +109,15 @@ cat >expect <<EOF EOF test_expect_success \ 'A: verify marks output' \ - 'diff -u expect marks.out' + 'git diff expect marks.out' + +test_expect_success \ + 'A: verify marks import' \ + 'git-fast-import \ + --import-marks=marks.out \ + --export-marks=marks.new \ + </dev/null && + git diff -u expect marks.new' ### ### series B @@ -175,7 +183,7 @@ EOF test_expect_success \ 'C: verify commit' \ 'git-cat-file commit branch | sed 1d >actual && - diff -u expect actual' + git diff expect actual' cat >expect <<EOF :000000 100755 0000000000000000000000000000000000000000 f1fb5da718392694d0076d677d6d0e364c79b0bc A file2/newf @@ -232,13 +240,13 @@ echo "$file5_data" >expect test_expect_success \ 'D: verify file5' \ 'git-cat-file blob branch:newdir/interesting >actual && - diff -u expect actual' + git diff expect actual' echo "$file6_data" >expect test_expect_success \ 'D: verify file6' \ 'git-cat-file blob branch:newdir/exec.sh >actual && - diff -u expect actual' + git diff expect actual' ### ### series E @@ -274,7 +282,7 @@ EOF test_expect_success \ 'E: verify commit' \ 'git-cat-file commit branch | sed 1,2d >actual && - diff -u expect actual' + git diff expect actual' ### ### series F @@ -327,7 +335,7 @@ EOF test_expect_success \ 'F: verify other commit' \ 'git-cat-file commit other >actual && - diff -u expect actual' + git diff expect actual' ### ### series G @@ -405,7 +413,7 @@ echo "$file5_data" >expect test_expect_success \ 'H: verify file' \ 'git-cat-file blob H:h/e/l/lo >actual && - diff -u expect actual' + git diff expect actual' ### ### series I @@ -431,7 +439,7 @@ EOF test_expect_success \ 'I: verify edge list' \ 'sed -e s/pack-.*pack/pack-.pack/ edges.list >actual && - diff -u expect actual' + git diff expect actual' ### ### series J @@ -493,4 +501,54 @@ test_expect_success \ 'test `git-rev-parse --verify branch^1` \ = `git-rev-parse --verify K^1`' +### +### series L +### + +cat >input <<INPUT_END +blob +mark :1 +data <<EOF +some data +EOF + +blob +mark :2 +data <<EOF +other data +EOF + +commit refs/heads/L +committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE +data <<COMMIT +create L +COMMIT + +M 644 :1 b. +M 644 :1 b/other +M 644 :1 ba + +commit refs/heads/L +committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE +data <<COMMIT +update L +COMMIT + +M 644 :2 b. +M 644 :2 b/other +M 644 :2 ba +INPUT_END + +cat >expect <<EXPECT_END +:100644 100644 4268632... 55d3a52... M b. +:040000 040000 0ae5cac... 443c768... M b +:100644 100644 4268632... 55d3a52... M ba +EXPECT_END + +test_expect_success \ + 'L: verify internal tree sorting' \ + 'git-fast-import <input && + git-diff --raw L^ L >output && + git diff expect output' + test_done diff --git a/t/test-lib.sh b/t/test-lib.sh index 37822fc13d..c0754747fb 100755 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -255,8 +255,8 @@ test_done () { PATH=$(pwd)/..:$PATH GIT_EXEC_PATH=$(pwd)/.. GIT_TEMPLATE_DIR=$(pwd)/../templates/blt -HOME=$(pwd)/trash -export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR HOME +GIT_CONFIG=.git/config +export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG GITPERLLIB=$(pwd)/../perl/blib/lib:$(pwd)/../perl/blib/arch/auto/Git export GITPERLLIB @@ -264,6 +264,12 @@ test -d ../templates/blt || { error "You haven't built things yet, have you?" } +if ! test -x ../test-chmtime; then + echo >&2 'You need to build test-chmtime:' + echo >&2 'Run "make test-chmtime" in the source (toplevel) directory' + exit 1 +fi + # Test repository test=trash rm -fr "$test" |