diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2007-01-30 11:07:24 -0500 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2007-01-30 11:07:24 -0500 |
commit | 76db9dec8132d4377f6c32e4d45eb75fa0cc7a9a (patch) | |
tree | 80a6b54d21978b5c3879662bdc4f5951f804b808 /t | |
parent | Accept 'inline' file data in fast-import commit structure. (diff) | |
parent | blameview: Use git-cat-file to read the file content. (diff) | |
download | tgif-76db9dec8132d4377f6c32e4d45eb75fa0cc7a9a.tar.xz |
Merge branch 'master' into sp/gfi
git-fast-import requires use of inttypes.h, but the master branch has
added it to git-compat-util differently than git-fast-import originally
had used it. This merge back of master to the fast-import topic is to
get (and use) inttypes.h the way master is using it.
This is a partially evil merge to remove the call to setup_ident(),
as the master branch now contains a change which makes this implicit
and therefore removed the function declaration. (commit 01754769).
Conflicts:
git-compat-util.h
Diffstat (limited to 't')
38 files changed, 676 insertions, 124 deletions
diff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh index a0f2814083..bb1d7b84bc 100644 --- a/t/lib-git-svn.sh +++ b/t/lib-git-svn.sh @@ -26,7 +26,7 @@ use SVN::Core; use SVN::Repos; \$SVN::Core::VERSION gt '1.1.0' or exit(42); system(qw/svnadmin create --fs-type fsfs/, '$svnrepo') == 0 or exit(41); -" +" >&3 2>&4 x=$? if test $x -ne 0 then diff --git a/t/t1020-subdirectory.sh b/t/t1020-subdirectory.sh index 4409b87f8d..c090c96185 100755 --- a/t/t1020-subdirectory.sh +++ b/t/t1020-subdirectory.sh @@ -106,4 +106,33 @@ test_expect_success 'read-tree' ' cmp ../one ../original.one ' +test_expect_success 'no file/rev ambuguity check inside .git' ' + cd $HERE && + git commit -a -m 1 && + cd $HERE/.git && + git show -s HEAD +' + +test_expect_success 'no file/rev ambuguity check inside a bare repo' ' + cd $HERE && + git clone -s --bare .git foo.git && + cd foo.git && GIT_DIR=. git show -s HEAD +' + +# This still does not work as it should... +: test_expect_success 'no file/rev ambuguity check inside a bare repo' ' + cd $HERE && + git clone -s --bare .git foo.git && + cd foo.git && git show -s HEAD +' + +test_expect_success 'detection should not be fooled by a symlink' ' + cd $HERE && + rm -fr foo.git && + git clone -s .git another && + ln -s another yetanother && + cd yetanother/.git && + git show -s HEAD +' + test_done diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index 60acdd368b..49b5666b33 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@ -3,13 +3,13 @@ # Copyright (c) 2005 Johannes Schindelin # -test_description='Test git-repo-config in different settings' +test_description='Test git-config in different settings' . ./test-lib.sh test -f .git/config && rm .git/config -git-repo-config core.penguin "little blue" +git-config core.penguin "little blue" cat > expect << EOF [core] @@ -18,7 +18,7 @@ EOF test_expect_success 'initial' 'cmp .git/config expect' -git-repo-config Core.Movie BadPhysics +git-config Core.Movie BadPhysics cat > expect << EOF [core] @@ -28,7 +28,7 @@ EOF test_expect_success 'mixed case' 'cmp .git/config expect' -git-repo-config Cores.WhatEver Second +git-config Cores.WhatEver Second cat > expect << EOF [core] @@ -40,7 +40,7 @@ EOF test_expect_success 'similar section' 'cmp .git/config expect' -git-repo-config CORE.UPPERCASE true +git-config CORE.UPPERCASE true cat > expect << EOF [core] @@ -54,10 +54,10 @@ EOF test_expect_success 'similar section' 'cmp .git/config expect' test_expect_success 'replace with non-match' \ - 'git-repo-config core.penguin kingpin !blue' + 'git-config core.penguin kingpin !blue' test_expect_success 'replace with non-match (actually matching)' \ - 'git-repo-config core.penguin "very blue" !kingpin' + 'git-config core.penguin "very blue" !kingpin' cat > expect << EOF [core] @@ -86,7 +86,7 @@ EOF cp .git/config .git/config2 test_expect_success 'multiple unset' \ - 'git-repo-config --unset-all beta.haha' + 'git-config --unset-all beta.haha' cat > expect << EOF [beta] ; silly comment # another comment @@ -102,7 +102,7 @@ test_expect_success 'multiple unset is correct' 'cmp .git/config expect' mv .git/config2 .git/config test_expect_success '--replace-all' \ - 'git-repo-config --replace-all beta.haha gamma' + 'git-config --replace-all beta.haha gamma' cat > expect << EOF [beta] ; silly comment # another comment @@ -116,7 +116,7 @@ EOF test_expect_success 'all replaced' 'cmp .git/config expect' -git-repo-config beta.haha alpha +git-config beta.haha alpha cat > expect << EOF [beta] ; silly comment # another comment @@ -130,7 +130,7 @@ EOF test_expect_success 'really mean test' 'cmp .git/config expect' -git-repo-config nextsection.nonewline wow +git-config nextsection.nonewline wow cat > expect << EOF [beta] ; silly comment # another comment @@ -145,8 +145,8 @@ EOF test_expect_success 'really really mean test' 'cmp .git/config expect' -test_expect_success 'get value' 'test alpha = $(git-repo-config beta.haha)' -git-repo-config --unset beta.haha +test_expect_success 'get value' 'test alpha = $(git-config beta.haha)' +git-config --unset beta.haha cat > expect << EOF [beta] ; silly comment # another comment @@ -160,7 +160,7 @@ EOF test_expect_success 'unset' 'cmp .git/config expect' -git-repo-config nextsection.NoNewLine "wow2 for me" "for me$" +git-config nextsection.NoNewLine "wow2 for me" "for me$" cat > expect << EOF [beta] ; silly comment # another comment @@ -176,18 +176,18 @@ EOF test_expect_success 'multivar' 'cmp .git/config expect' test_expect_success 'non-match' \ - 'git-repo-config --get nextsection.nonewline !for' + 'git-config --get nextsection.nonewline !for' test_expect_success 'non-match value' \ - 'test wow = $(git-repo-config --get nextsection.nonewline !for)' + 'test wow = $(git-config --get nextsection.nonewline !for)' test_expect_failure 'ambiguous get' \ - 'git-repo-config --get nextsection.nonewline' + 'git-config --get nextsection.nonewline' test_expect_success 'get multivar' \ - 'git-repo-config --get-all nextsection.nonewline' + 'git-config --get-all nextsection.nonewline' -git-repo-config nextsection.nonewline "wow3" "wow$" +git-config nextsection.nonewline "wow3" "wow$" cat > expect << EOF [beta] ; silly comment # another comment @@ -202,15 +202,15 @@ EOF test_expect_success 'multivar replace' 'cmp .git/config expect' -test_expect_failure 'ambiguous value' 'git-repo-config nextsection.nonewline' +test_expect_failure 'ambiguous value' 'git-config nextsection.nonewline' test_expect_failure 'ambiguous unset' \ - 'git-repo-config --unset nextsection.nonewline' + 'git-config --unset nextsection.nonewline' test_expect_failure 'invalid unset' \ - 'git-repo-config --unset somesection.nonewline' + 'git-config --unset somesection.nonewline' -git-repo-config --unset nextsection.nonewline "wow3$" +git-config --unset nextsection.nonewline "wow3$" cat > expect << EOF [beta] ; silly comment # another comment @@ -224,12 +224,12 @@ EOF test_expect_success 'multivar unset' 'cmp .git/config expect' -test_expect_failure 'invalid key' 'git-repo-config inval.2key blabla' +test_expect_failure 'invalid key' 'git-config inval.2key blabla' -test_expect_success 'correct key' 'git-repo-config 123456.a123 987' +test_expect_success 'correct key' 'git-config 123456.a123 987' test_expect_success 'hierarchical section' \ - 'git-repo-config Version.1.2.3eX.Alpha beta' + 'git-config Version.1.2.3eX.Alpha beta' cat > expect << EOF [beta] ; silly comment # another comment @@ -255,7 +255,7 @@ version.1.2.3eX.alpha=beta EOF test_expect_success 'working --list' \ - 'git-repo-config --list > output && cmp output expect' + 'git-config --list > output && cmp output expect' cat > expect << EOF beta.noindent sillyValue @@ -263,9 +263,9 @@ nextsection.nonewline wow2 for me EOF test_expect_success '--get-regexp' \ - 'git-repo-config --get-regexp in > output && cmp output expect' + 'git-config --get-regexp in > output && cmp output expect' -git-repo-config --add nextsection.nonewline "wow4 for you" +git-config --add nextsection.nonewline "wow4 for you" cat > expect << EOF wow2 for me @@ -273,7 +273,7 @@ wow4 for you EOF test_expect_success '--add' \ - 'git-repo-config --get-all nextsection.nonewline > output && cmp output expect' + 'git-config --get-all nextsection.nonewline > output && cmp output expect' cat > .git/config << EOF [novalue] @@ -281,9 +281,9 @@ cat > .git/config << EOF EOF test_expect_success 'get variable with no value' \ - 'git-repo-config --get novalue.variable ^$' + 'git-config --get novalue.variable ^$' -git-repo-config > output 2>&1 +git-config > output 2>&1 test_expect_success 'no arguments, but no crash' \ "test $? = 129 && grep usage output" @@ -293,7 +293,7 @@ cat > .git/config << EOF c = d EOF -git-repo-config a.x y +git-config a.x y cat > expect << EOF [a.b] @@ -304,8 +304,8 @@ EOF test_expect_success 'new section is partial match of another' 'cmp .git/config expect' -git-repo-config b.x y -git-repo-config a.b c +git-config b.x y +git-config a.b c cat > expect << EOF [a.b] @@ -328,11 +328,11 @@ cat > expect << EOF ein.bahn=strasse EOF -GIT_CONFIG=other-config git-repo-config -l > output +GIT_CONFIG=other-config git-config -l > output test_expect_success 'alternative GIT_CONFIG' 'cmp output expect' -GIT_CONFIG=other-config git-repo-config anwohner.park ausweis +GIT_CONFIG=other-config git-config anwohner.park ausweis cat > expect << EOF [ein] @@ -355,7 +355,7 @@ weird EOF test_expect_success "rename section" \ - "git-repo-config --rename-section branch.eins branch.zwei" + "git-config --rename-section branch.eins branch.zwei" cat > expect << EOF # Hallo @@ -371,12 +371,12 @@ EOF test_expect_success "rename succeeded" "diff -u expect .git/config" test_expect_failure "rename non-existing section" \ - 'git-repo-config --rename-section branch."world domination" branch.drei' + 'git-config --rename-section branch."world domination" branch.drei' test_expect_success "rename succeeded" "diff -u expect .git/config" test_expect_success "rename another section" \ - 'git-repo-config --rename-section branch."1 234 blabl/a" branch.drei' + 'git-config --rename-section branch."1 234 blabl/a" branch.drei' cat > expect << EOF # Hallo @@ -393,20 +393,20 @@ test_expect_success "rename succeeded" "diff -u expect .git/config" test_expect_success numbers ' - git-repo-config kilo.gram 1k && - git-repo-config mega.ton 1m && - k=$(git-repo-config --int --get kilo.gram) && + git-config kilo.gram 1k && + git-config mega.ton 1m && + k=$(git-config --int --get kilo.gram) && test z1024 = "z$k" && - m=$(git-repo-config --int --get mega.ton) && + m=$(git-config --int --get mega.ton) && test z1048576 = "z$m" ' rm .git/config -git-repo-config quote.leading " test" -git-repo-config quote.ending "test " -git-repo-config quote.semicolon "test;test" -git-repo-config quote.hash "test#test" +git-config quote.leading " test" +git-config quote.ending "test " +git-config quote.semicolon "test;test" +git-config quote.hash "test#test" cat > expect << EOF [quote] @@ -418,5 +418,31 @@ EOF test_expect_success 'quoting' 'cmp .git/config expect' +test_expect_failure 'key with newline' 'git config key.with\\\ +newline 123' + +test_expect_success 'value with newline' 'git config key.sub value.with\\\ +newline' + +cat > .git/config <<\EOF +[section] + ; comment \ + continued = cont\ +inued + noncont = not continued ; \ + quotecont = "cont;\ +inued" +EOF + +cat > expect <<\EOF +section.continued=continued +section.noncont=not continued +section.quotecont=cont;inued +EOF + +git config --list > result + +test_expect_success 'value continued on next line' 'cmp result expect' + test_done diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh index 5637cb5eac..d0aba2c2ae 100755 --- a/t/t1400-update-ref.sh +++ b/t/t1400-update-ref.sh @@ -93,8 +93,8 @@ rm -rf .git/$m .git/logs expect test_expect_success \ 'enable core.logAllRefUpdates' \ - 'git-repo-config core.logAllRefUpdates true && - test true = $(git-repo-config --bool --get core.logAllRefUpdates)' + 'git-config core.logAllRefUpdates true && + test true = $(git-config --bool --get core.logAllRefUpdates)' test_expect_success \ "create $m (logged by config)" \ @@ -138,19 +138,19 @@ test_expect_success \ 'rm -f o e git-rev-parse --verify "master@{May 25 2005}" >o 2>e && test '"$C"' = $(cat o) && - test "warning: Log .git/logs/'"$m only goes back to $ed"'." = "$(cat e)"' + test "warning: Log for '\'master\'' only goes back to $ed." = "$(cat e)"' test_expect_success \ "Query master@{2005-05-25} (before history)" \ 'rm -f o e git-rev-parse --verify master@{2005-05-25} >o 2>e && test '"$C"' = $(cat o) && - echo test "warning: Log .git/logs/'"$m only goes back to $ed"'." = "$(cat e)"' + echo test "warning: Log for '\'master\'' only goes back to $ed." = "$(cat e)"' test_expect_success \ 'Query "master@{May 26 2005 23:31:59}" (1 second before history)' \ 'rm -f o e git-rev-parse --verify "master@{May 26 2005 23:31:59}" >o 2>e && test '"$C"' = $(cat o) && - test "warning: Log .git/logs/'"$m only goes back to $ed"'." = "$(cat e)"' + test "warning: Log for '\''master'\'' only goes back to $ed." = "$(cat e)"' test_expect_success \ 'Query "master@{May 26 2005 23:32:00}" (exactly history start)' \ 'rm -f o e diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh index 8e8d526ef2..e5bbc384f7 100755 --- a/t/t1410-reflog.sh +++ b/t/t1410-reflog.sh @@ -20,7 +20,7 @@ check_have () { } check_fsck () { - output=$(git fsck-objects --full) + output=$(git fsck --full) case "$1" in '') test -z "$output" ;; @@ -71,7 +71,7 @@ test_expect_success setup ' check_fsck && chmod +x C && - ( test "`git repo-config --bool core.filemode`" != false || + ( test "`git config --bool core.filemode`" != false || echo executable >>C ) && git add C && test_tick && git commit -m dragon && diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh index bb80e4286a..5565c27033 100755 --- a/t/t3200-branch.sh +++ b/t/t3200-branch.sh @@ -94,7 +94,7 @@ test_expect_failure \ git-branch r && git-branch -m q r/q' -git-repo-config branch.s/s.dummy Hello +git-config branch.s/s.dummy Hello test_expect_success \ 'git branch -m s/s s should work when s/t is deleted' \ @@ -107,8 +107,8 @@ test_expect_success \ test -f .git/logs/refs/heads/s' test_expect_success 'config information was renamed, too' \ - "test $(git-repo-config branch.s.dummy) = Hello && - ! git-repo-config branch.s/s/dummy" + "test $(git-config branch.s.dummy) = Hello && + ! git-config branch.s/s/dummy" test_expect_failure \ 'git-branch -m u v should fail when the reflog for u is a symlink' \ diff --git a/t/t3210-pack-refs.sh b/t/t3210-pack-refs.sh index 16bdae4f23..f0c7e22b36 100755 --- a/t/t3210-pack-refs.sh +++ b/t/t3210-pack-refs.sh @@ -96,4 +96,13 @@ test_expect_success \ git-branch -d n/o/p && git-branch n' +test_expect_success 'pack, prune and repack' ' + git-tag foo && + git-pack-refs --all --prune && + git-show-ref >all-of-them && + git-pack-refs && + git-show-ref >again && + diff all-of-them again +' + test_done diff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh new file mode 100755 index 0000000000..552af1c4d2 --- /dev/null +++ b/t/t3501-revert-cherry-pick.sh @@ -0,0 +1,62 @@ +#!/bin/sh + +test_description='test cherry-pick and revert with renames + + -- + + rename2: renames oops to opos + + rename1: renames oops to spoo + + added: adds extra line to oops + ++ initial: has lines in oops + +' + +. ./test-lib.sh + +test_expect_success setup ' + + for l in a b c d e f g h i j k l m n o + do + echo $l$l$l$l$l$l$l$l$l + done >oops && + + test_tick && + git add oops && + git commit -m initial && + git tag initial && + + test_tick && + echo "Add extra line at the end" >>oops && + git commit -a -m added && + git tag added && + + test_tick && + git mv oops spoo && + git commit -m rename1 && + git tag rename1 && + + test_tick && + git checkout -b side initial && + git mv oops opos && + git commit -m rename2 && + git tag rename2 +' + +test_expect_success 'cherry-pick after renaming branch' ' + + git checkout rename2 && + EDITOR=: VISUAL=: git cherry-pick added && + test -f opos && + grep "Add extra line at the end" opos + +' + +test_expect_success 'revert after renaming branch' ' + + git checkout rename1 && + EDITOR=: VISUAL=: git revert added && + test -f spoo && + ! grep "Add extra line at the end" spoo + +' + +test_done diff --git a/t/t3700-add.sh b/t/t3700-add.sh index e98786de32..caaab26c2f 100755 --- a/t/t3700-add.sh +++ b/t/t3700-add.sh @@ -21,7 +21,7 @@ test_expect_success \ test_expect_success \ 'git-add: Test that executable bit is not used if core.filemode=0' \ - 'git repo-config core.filemode 0 && + 'git config core.filemode 0 && echo foo >xfoo1 && chmod 755 xfoo1 && git-add xfoo1 && @@ -32,7 +32,7 @@ test_expect_success \ test_expect_success \ 'git-update-index --add: Test that executable bit is not used...' \ - 'git repo-config core.filemode 0 && + 'git config core.filemode 0 && echo foo >xfoo2 && chmod 755 xfoo2 && git-update-index --add xfoo2 && @@ -43,7 +43,7 @@ test_expect_success \ test_expect_success \ 'git-update-index --add: Test that executable bit is not used...' \ - 'git repo-config core.filemode 0 && + 'git config core.filemode 0 && ln -s xfoo2 xfoo3 && git-update-index --add xfoo3 && case "`git-ls-files --stage xfoo3`" in diff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh index 5b23b7769d..ede4d42495 100755 --- a/t/t3800-mktag.sh +++ b/t/t3800-mktag.sh @@ -88,7 +88,7 @@ check_verify_failure '"type" line label check' # 5. type line eol check echo "object 779e9b33986b1c2670fff52c5067603117b3e895" >tag.sig -echo -n "type tagsssssssssssssssssssssssssssssss" >>tag.sig +printf "type tagsssssssssssssssssssssssssssssss" >>tag.sig cat >expect.pat <<EOF ^error: char48: .*"[\]n"$ diff --git a/t/t3900-i18n-commit.sh b/t/t3900-i18n-commit.sh index 6714b0dd6e..e54fe0f401 100755 --- a/t/t3900-i18n-commit.sh +++ b/t/t3900-i18n-commit.sh @@ -29,7 +29,7 @@ test_expect_success 'no encoding header for base case' ' for H in ISO-8859-1 EUCJP ISO-2022-JP do test_expect_success "$H setup" ' - git-repo-config i18n.commitencoding $H && + git-config i18n.commitencoding $H && git-checkout -b $H C0 && echo $H >F && git-commit -a -F ../t3900/$H.txt @@ -44,16 +44,16 @@ do ' done -test_expect_success 'repo-config to remove customization' ' - git-repo-config --unset-all i18n.commitencoding && - if Z=$(git-repo-config --get-all i18n.commitencoding) +test_expect_success 'config to remove customization' ' + git-config --unset-all i18n.commitencoding && + if Z=$(git-config --get-all i18n.commitencoding) then echo Oops, should have failed. false else test z = "z$Z" fi && - git-repo-config i18n.commitencoding utf-8 + git-config i18n.commitencoding utf-8 ' test_expect_success 'ISO-8859-1 should be shown in UTF-8 now' ' @@ -67,9 +67,9 @@ do ' done -test_expect_success 'repo-config to add customization' ' - git-repo-config --unset-all i18n.commitencoding && - if Z=$(git-repo-config --get-all i18n.commitencoding) +test_expect_success 'config to add customization' ' + git-config --unset-all i18n.commitencoding && + if Z=$(git-config --get-all i18n.commitencoding) then echo Oops, should have failed. false @@ -81,13 +81,13 @@ test_expect_success 'repo-config to add customization' ' for H in ISO-8859-1 EUCJP ISO-2022-JP do test_expect_success "$H should be shown in itself now" ' - git-repo-config i18n.commitencoding '$H' && + git-config i18n.commitencoding '$H' && compare_with '$H' ../t3900/'$H'.txt ' done -test_expect_success 'repo-config to tweak customization' ' - git-repo-config i18n.logoutputencoding utf-8 +test_expect_success 'config to tweak customization' ' + git-config i18n.logoutputencoding utf-8 ' test_expect_success 'ISO-8859-1 should be shown in UTF-8 now' ' @@ -103,7 +103,7 @@ done for J in EUCJP ISO-2022-JP do - git-repo-config i18n.logoutputencoding $J + git-config i18n.logoutputencoding $J for H in EUCJP ISO-2022-JP do test_expect_success "$H should be shown in $J now" ' diff --git a/t/t3901-8859-1.txt b/t/t3901-8859-1.txt new file mode 100755 index 0000000000..38c21a6a7f --- /dev/null +++ b/t/t3901-8859-1.txt @@ -0,0 +1,4 @@ +: to be sourced in t3901 -- this is latin-1 +GIT_AUTHOR_NAME="Αιν σϊ" && +GIT_COMMITTER_NAME=$GIT_AUTHOR_NAME && +export GIT_AUTHOR_NAME GIT_COMMITTER_NAME diff --git a/t/t3901-i18n-patch.sh b/t/t3901-i18n-patch.sh new file mode 100755 index 0000000000..a881797bc7 --- /dev/null +++ b/t/t3901-i18n-patch.sh @@ -0,0 +1,255 @@ +#!/bin/sh +# +# Copyright (c) 2006 Junio C Hamano +# + +test_description='i18n settings and format-patch | am pipe' + +. ./test-lib.sh + +check_encoding () { + # Make sure characters are not corrupted + cnt="$1" header="$2" i=1 j=0 bad=0 + while test "$i" -le $cnt + do + git format-patch --encoding=UTF-8 --stdout HEAD~$i..HEAD~$j | + grep "^From: =?UTF-8?q?=C3=81=C3=A9=C3=AD_=C3=B3=C3=BA?=" && + git-cat-file commit HEAD~$j | + case "$header" in + 8859) + grep "^encoding ISO-8859-1" ;; + *) + ! grep "^encoding ISO-8859-1" ;; + esac || { + bad=1 + break + } + j=$i + i=$(($i+1)) + done + (exit $bad) +} + +test_expect_success setup ' + git-config i18n.commitencoding UTF-8 && + + # use UTF-8 in author and committer name to match the + # i18n.commitencoding settings + . ../t3901-utf8.txt && + + test_tick && + echo "$GIT_AUTHOR_NAME" >mine && + git add mine && + git commit -s -m "Initial commit" && + + test_tick && + echo Hello world >mine && + git add mine && + git commit -s -m "Second on main" && + + # the first commit on the side branch is UTF-8 + test_tick && + git checkout -b side master^ && + echo Another file >yours && + git add yours && + git commit -s -m "Second on side" && + + # the second one on the side branch is ISO-8859-1 + git-config i18n.commitencoding ISO-8859-1 && + # use author and committer name in ISO-8859-1 to match it. + . ../t3901-8859-1.txt && + test_tick && + echo Yet another >theirs && + git add theirs && + git commit -s -m "Third on side" && + + # Back to default + git-config i18n.commitencoding UTF-8 +' + +test_expect_success 'format-patch output (ISO-8859-1)' ' + git-config i18n.logoutputencoding ISO-8859-1 && + + git format-patch --stdout master..HEAD^ >out-l1 && + git format-patch --stdout HEAD^ >out-l2 && + grep "^Content-Type: text/plain; charset=ISO-8859-1" out-l1 && + grep "^From: =?ISO-8859-1?q?=C1=E9=ED_=F3=FA?=" out-l1 && + grep "^Content-Type: text/plain; charset=ISO-8859-1" out-l2 && + grep "^From: =?ISO-8859-1?q?=C1=E9=ED_=F3=FA?=" out-l2 +' + +test_expect_success 'format-patch output (UTF-8)' ' + git config i18n.logoutputencoding UTF-8 && + + git format-patch --stdout master..HEAD^ >out-u1 && + git format-patch --stdout HEAD^ >out-u2 && + grep "^Content-Type: text/plain; charset=UTF-8" out-u1 && + grep "^From: =?UTF-8?q?=C3=81=C3=A9=C3=AD_=C3=B3=C3=BA?=" out-u1 && + grep "^Content-Type: text/plain; charset=UTF-8" out-u2 && + grep "^From: =?UTF-8?q?=C3=81=C3=A9=C3=AD_=C3=B3=C3=BA?=" out-u2 +' + +test_expect_success 'rebase (U/U)' ' + # We want the result of rebase in UTF-8 + git-config i18n.commitencoding UTF-8 && + + # The test is about logoutputencoding not affecting the + # final outcome -- it is used internally to generate the + # patch and the log. + + git config i18n.logoutputencoding UTF-8 && + + # The result will be committed by GIT_COMMITTER_NAME -- + # we want UTF-8 encoded name. + . ../t3901-utf8.txt && + git checkout -b test && + git-rebase master && + + check_encoding 2 +' + +test_expect_success 'rebase (U/L)' ' + git-config i18n.commitencoding UTF-8 && + git config i18n.logoutputencoding ISO-8859-1 && + . ../t3901-utf8.txt && + + git reset --hard side && + git-rebase master && + + check_encoding 2 +' + +test_expect_success 'rebase (L/L)' ' + # In this test we want ISO-8859-1 encoded commits as the result + git-config i18n.commitencoding ISO-8859-1 && + git config i18n.logoutputencoding ISO-8859-1 && + . ../t3901-8859-1.txt && + + git reset --hard side && + git-rebase master && + + check_encoding 2 8859 +' + +test_expect_success 'rebase (L/U)' ' + # This is pathological -- use UTF-8 as intermediate form + # to get ISO-8859-1 results. + git-config i18n.commitencoding ISO-8859-1 && + git config i18n.logoutputencoding UTF-8 && + . ../t3901-8859-1.txt && + + git reset --hard side && + git-rebase master && + + check_encoding 2 8859 +' + +test_expect_success 'cherry-pick(U/U)' ' + # Both the commitencoding and logoutputencoding is set to UTF-8. + + git-config i18n.commitencoding UTF-8 && + git config i18n.logoutputencoding UTF-8 && + . ../t3901-utf8.txt && + + git reset --hard master && + git cherry-pick side^ && + git cherry-pick side && + EDITOR=: VISUAL=: git revert HEAD && + + check_encoding 3 +' + +test_expect_success 'cherry-pick(L/L)' ' + # Both the commitencoding and logoutputencoding is set to ISO-8859-1 + + git-config i18n.commitencoding ISO-8859-1 && + git config i18n.logoutputencoding ISO-8859-1 && + . ../t3901-8859-1.txt && + + git reset --hard master && + git cherry-pick side^ && + git cherry-pick side && + EDITOR=: VISUAL=: git revert HEAD && + + check_encoding 3 8859 +' + +test_expect_success 'cherry-pick(U/L)' ' + # Commitencoding is set to UTF-8 but logoutputencoding is ISO-8859-1 + + git-config i18n.commitencoding UTF-8 && + git config i18n.logoutputencoding ISO-8859-1 && + . ../t3901-utf8.txt && + + git reset --hard master && + git cherry-pick side^ && + git cherry-pick side && + EDITOR=: VISUAL=: git revert HEAD && + + check_encoding 3 +' + +test_expect_success 'cherry-pick(L/U)' ' + # Again, the commitencoding is set to ISO-8859-1 but + # logoutputencoding is set to UTF-8. + + git-config i18n.commitencoding ISO-8859-1 && + git config i18n.logoutputencoding UTF-8 && + . ../t3901-8859-1.txt && + + git reset --hard master && + git cherry-pick side^ && + git cherry-pick side && + EDITOR=: VISUAL=: git revert HEAD && + + check_encoding 3 8859 +' + +test_expect_success 'rebase --merge (U/U)' ' + git-config i18n.commitencoding UTF-8 && + git config i18n.logoutputencoding UTF-8 && + . ../t3901-utf8.txt && + + git reset --hard side && + git-rebase --merge master && + + check_encoding 2 +' + +test_expect_success 'rebase --merge (U/L)' ' + git-config i18n.commitencoding UTF-8 && + git config i18n.logoutputencoding ISO-8859-1 && + . ../t3901-utf8.txt && + + git reset --hard side && + git-rebase --merge master && + + check_encoding 2 +' + +test_expect_success 'rebase --merge (L/L)' ' + # In this test we want ISO-8859-1 encoded commits as the result + git-config i18n.commitencoding ISO-8859-1 && + git config i18n.logoutputencoding ISO-8859-1 && + . ../t3901-8859-1.txt && + + git reset --hard side && + git-rebase --merge master && + + check_encoding 2 8859 +' + +test_expect_success 'rebase --merge (L/U)' ' + # This is pathological -- use UTF-8 as intermediate form + # to get ISO-8859-1 results. + git-config i18n.commitencoding ISO-8859-1 && + git config i18n.logoutputencoding UTF-8 && + . ../t3901-8859-1.txt && + + git reset --hard side && + git-rebase --merge master && + + check_encoding 2 8859 +' + +test_done diff --git a/t/t3901-utf8.txt b/t/t3901-utf8.txt new file mode 100755 index 0000000000..5f5205cd02 --- /dev/null +++ b/t/t3901-utf8.txt @@ -0,0 +1,4 @@ +: to be sourced in t3901 -- this is utf8 +GIT_AUTHOR_NAME="Γéà óú" && +GIT_COMMITTER_NAME=$GIT_AUTHOR_NAME && +export GIT_AUTHOR_NAME GIT_COMMITTER_NAME diff --git a/t/t4000-diff-format.sh b/t/t4000-diff-format.sh index 67b9681d36..9c58d77cc2 100755 --- a/t/t4000-diff-format.sh +++ b/t/t4000-diff-format.sh @@ -28,7 +28,7 @@ test_expect_success \ 'git-diff-files -p >current' # that's as far as it comes -if [ "$(git repo-config --get core.filemode)" = false ] +if [ "$(git config --get core.filemode)" = false ] then say 'filemode disabled on the filesystem' test_done diff --git a/t/t4006-diff-mode.sh b/t/t4006-diff-mode.sh index 8ad69d1115..ca342f48a1 100755 --- a/t/t4006-diff-mode.sh +++ b/t/t4006-diff-mode.sh @@ -15,7 +15,7 @@ test_expect_success \ tree=`git-write-tree` && echo $tree' -if [ "$(git repo-config --get core.filemode)" = false ] +if [ "$(git config --get core.filemode)" = false ] then say 'filemode disabled on the filesystem, using update-index --chmod=+x' test_expect_success \ diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh index ed37141b6e..3d85ceaae9 100755 --- a/t/t4013-diff-various.sh +++ b/t/t4013-diff-various.sh @@ -73,7 +73,7 @@ test_expect_success setup ' for i in 1 2; do echo $i; done >>dir/sub && git update-index file0 dir/sub && - git repo-config log.showroot false && + git config log.showroot false && git commit --amend && git show-branch ' diff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..master b/t/t4013/diff.format-patch_--attach_--stdout_initial..master index b4745e1001..e5ddd6fcbb 100644 --- a/t/t4013/diff.format-patch_--attach_--stdout_initial..master +++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master @@ -19,6 +19,7 @@ This is the second commit. 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" @@ -77,6 +78,7 @@ 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" @@ -126,6 +128,7 @@ Content-Transfer-Encoding: 8bit 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" diff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..master^ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master^ index a9d1cd368b..d0dd19b623 100644 --- a/t/t4013/diff.format-patch_--attach_--stdout_initial..master^ +++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master^ @@ -19,6 +19,7 @@ This is the second commit. 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" @@ -77,6 +78,7 @@ 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" diff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..side b/t/t4013/diff.format-patch_--attach_--stdout_initial..side index 57b9d0bdc1..67a95c5cba 100644 --- a/t/t4013/diff.format-patch_--attach_--stdout_initial..side +++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..side @@ -17,6 +17,7 @@ Content-Transfer-Encoding: 8bit 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" diff --git a/t/t4013/diff.format-patch_--stdout_initial..master b/t/t4013/diff.format-patch_--stdout_initial..master index c33302e92f..8b88ca4927 100644 --- a/t/t4013/diff.format-patch_--stdout_initial..master +++ b/t/t4013/diff.format-patch_--stdout_initial..master @@ -10,6 +10,7 @@ This is the second commit. file0 | 3 +++ file2 | 3 --- 3 files changed, 5 insertions(+), 3 deletions(-) + delete mode 100644 file2 diff --git a/dir/sub b/dir/sub index 35d242b..8422d40 100644 @@ -53,6 +54,7 @@ Subject: [PATCH] Third dir/sub | 2 ++ file1 | 3 +++ 2 files changed, 5 insertions(+), 0 deletions(-) + create mode 100644 file1 diff --git a/dir/sub b/dir/sub index 8422d40..cead32e 100644 @@ -87,6 +89,7 @@ Subject: [PATCH] Side file0 | 3 +++ file3 | 4 ++++ 3 files changed, 9 insertions(+), 0 deletions(-) + create mode 100644 file3 diff --git a/dir/sub b/dir/sub index 35d242b..7289e35 100644 diff --git a/t/t4013/diff.format-patch_--stdout_initial..master^ b/t/t4013/diff.format-patch_--stdout_initial..master^ index 03d0f9693c..47a4b88637 100644 --- a/t/t4013/diff.format-patch_--stdout_initial..master^ +++ b/t/t4013/diff.format-patch_--stdout_initial..master^ @@ -10,6 +10,7 @@ This is the second commit. file0 | 3 +++ file2 | 3 --- 3 files changed, 5 insertions(+), 3 deletions(-) + delete mode 100644 file2 diff --git a/dir/sub b/dir/sub index 35d242b..8422d40 100644 @@ -53,6 +54,7 @@ Subject: [PATCH] Third dir/sub | 2 ++ file1 | 3 +++ 2 files changed, 5 insertions(+), 0 deletions(-) + create mode 100644 file1 diff --git a/dir/sub b/dir/sub index 8422d40..cead32e 100644 diff --git a/t/t4013/diff.format-patch_--stdout_initial..side b/t/t4013/diff.format-patch_--stdout_initial..side index d10a46523b..e765088475 100644 --- a/t/t4013/diff.format-patch_--stdout_initial..side +++ b/t/t4013/diff.format-patch_--stdout_initial..side @@ -9,6 +9,7 @@ Subject: [PATCH] Side file0 | 3 +++ file3 | 4 ++++ 3 files changed, 9 insertions(+), 0 deletions(-) + create mode 100644 file3 diff --git a/dir/sub b/dir/sub index 35d242b..7289e35 100644 diff --git a/t/t4102-apply-rename.sh b/t/t4102-apply-rename.sh index 22da6a00cc..b4662b0364 100755 --- a/t/t4102-apply-rename.sh +++ b/t/t4102-apply-rename.sh @@ -31,7 +31,7 @@ test_expect_success setup \ test_expect_success apply \ 'git-apply --index --stat --summary --apply test-patch' -if [ "$(git repo-config --get core.filemode)" = false ] +if [ "$(git config --get core.filemode)" = false ] then say 'filemode disabled on the filesystem' else diff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh index 5ee5b23095..91be272ac4 100755 --- a/t/t4200-rerere.sh +++ b/t/t4200-rerere.sh @@ -120,29 +120,29 @@ case "$(date -d @11111111 +%s 2>/dev/null)" in 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" +%c)" - predate2="$(date -d "@$almost_15_days_ago" +%c)" - postdate1="$(date -d "@$just_over_60_days_ago" +%c)" - postdate2="$(date -d "@$just_over_15_days_ago" +%c)" + 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)" ;; *) # it is not GNU date. oh, well. - predate1="$(date)" - predate2="$(date)" - postdate1='1 Oct 2006 00:00:00' - postdate2='1 Dec 2006 00:00:00' + predate1="$(date +%Y%m%d%H%M.%S)" + predate2="$(date +%Y%m%d%H%M.%S)" + postdate1='200610010000.00' + postdate2='200612010000.00' esac -touch -m -d "$predate1" $rr/preimage -touch -m -d "$predate2" $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 'young records still live' \ "test -f $rr/preimage -a -f $rr2/preimage" -touch -m -d "$postdate1" $rr/preimage -touch -m -d "$postdate2" $rr2/preimage +touch -m -t "$postdate1" $rr/preimage +touch -m -t "$postdate2" $rr2/preimage test_expect_success 'garbage collection (part2)' 'git rerere gc' diff --git a/t/t5301-sliding-window.sh b/t/t5301-sliding-window.sh index 5a7232a577..a6dbb04a86 100755 --- a/t/t5301-sliding-window.sh +++ b/t/t5301-sliding-window.sh @@ -30,19 +30,19 @@ test_expect_success \ test_expect_success \ 'verify-pack -v, packedGitWindowSize == 1 page' \ - 'git-repo-config core.packedGitWindowSize 512 && + 'git-config core.packedGitWindowSize 512 && git-verify-pack -v "$pack1"' test_expect_success \ 'verify-pack -v, packedGit{WindowSize,Limit} == 1 page' \ - 'git-repo-config core.packedGitWindowSize 512 && - git-repo-config core.packedGitLimit 512 && + 'git-config core.packedGitWindowSize 512 && + git-config core.packedGitLimit 512 && git-verify-pack -v "$pack1"' test_expect_success \ 'repack -a -d, packedGit{WindowSize,Limit} == 1 page' \ - 'git-repo-config core.packedGitWindowSize 512 && - git-repo-config core.packedGitLimit 512 && + 'git-config core.packedGitWindowSize 512 && + git-config core.packedGitLimit 512 && commit2=`git-commit-tree $tree -p $commit1 </dev/null` && git-update-ref HEAD $commit2 && git-repack -a -d && @@ -53,8 +53,8 @@ test_expect_success \ test_expect_success \ 'verify-pack -v, defaults' \ - 'git-repo-config --unset core.packedGitWindowSize && - git-repo-config --unset core.packedGitLimit && + 'git-config --unset core.packedGitWindowSize && + git-config --unset core.packedGitLimit && git-verify-pack -v "$pack2"' test_done diff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh index 2c151912a3..7d93d0d7c9 100755 --- a/t/t5400-send-pack.sh +++ b/t/t5400-send-pack.sh @@ -106,7 +106,7 @@ export HOME ;# this way we force the victim/.git/config to be used. test_expect_success \ 'pushing with --force should be denied with denyNonFastforwards' ' cd victim && - git-repo-config receive.denyNonFastforwards true && + git-config receive.denyNonFastforwards true && cd .. && git-update-ref refs/heads/master master^ && git-send-pack --force ./victim/.git/ master && diff --git a/t/t5401-update-hooks.sh b/t/t5401-update-hooks.sh index cd8cee6ae8..0514056ca6 100755 --- a/t/t5401-update-hooks.sh +++ b/t/t5401-update-hooks.sh @@ -23,7 +23,7 @@ test_expect_success setup ' cat >victim/.git/hooks/update <<'EOF' #!/bin/sh echo "$@" >$GIT_DIR/update.args -read x; echo -n "$x" >$GIT_DIR/update.stdin +read x; printf "$x" >$GIT_DIR/update.stdin echo STDOUT update echo STDERR update >&2 EOF @@ -32,7 +32,7 @@ chmod u+x victim/.git/hooks/update cat >victim/.git/hooks/post-update <<'EOF' #!/bin/sh echo "$@" >$GIT_DIR/post-update.args -read x; echo -n "$x" >$GIT_DIR/post-update.stdin +read x; printf "$x" >$GIT_DIR/post-update.stdin echo STDOUT post-update echo STDERR post-update >&2 EOF diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh index ef78df67ea..48e3d1705f 100755 --- a/t/t5500-fetch-pack.sh +++ b/t/t5500-fetch-pack.sh @@ -63,13 +63,13 @@ pull_to_client () { case "$heads" in *B*) echo $BTIP > .git/refs/heads/B;; esac git-symbolic-ref HEAD refs/heads/`echo $heads | sed -e 's/^\(.\).*$/\1/'` - test_expect_success "fsck" 'git-fsck-objects --full > fsck.txt 2>&1' + test_expect_success "fsck" 'git-fsck --full > fsck.txt 2>&1' test_expect_success 'check downloaded results' \ 'mv .git/objects/pack/pack-* . && p=`ls -1 pack-*.pack` && git-unpack-objects <$p && - git-fsck-objects --full' + git-fsck --full' test_expect_success "new object count after $number pull" \ 'idx=`echo pack-*.idx` && @@ -97,7 +97,8 @@ pull_to_client () { ( mkdir client && cd client && - git-init 2>> log2.txt + git-init 2>> log2.txt && + git config transfer.unpacklimit 0 ) add A1 @@ -144,7 +145,7 @@ test_expect_success "clone shallow object count (part 2)" ' ' test_expect_success "fsck in shallow repo" \ - "(cd shallow; git-fsck-objects --full)" + "(cd shallow; git-fsck --full)" #test_done; exit diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh index 3ce9446210..50c64856f0 100755 --- a/t/t5510-fetch.sh +++ b/t/t5510-fetch.sh @@ -22,14 +22,14 @@ test_expect_success "clone and setup child repos" ' cd .. && git clone . two && cd two && - git repo-config branch.master.remote one && - git repo-config remote.one.url ../one/.git/ && - git repo-config remote.one.fetch refs/heads/master:refs/heads/one && + git config branch.master.remote one && + git config remote.one.url ../one/.git/ && + git config remote.one.fetch refs/heads/master:refs/heads/one && cd .. && git clone . three && cd three && - git repo-config branch.master.remote two && - git repo-config branch.master.merge refs/heads/one && + git config branch.master.remote two && + git config branch.master.merge refs/heads/one && mkdir -p .git/remotes && { echo "URL: ../two/.git/" diff --git a/t/t5710-info-alternate.sh b/t/t5710-info-alternate.sh index b9f6d96363..2f8e97cb7e 100755 --- a/t/t5710-info-alternate.sh +++ b/t/t5710-info-alternate.sh @@ -17,7 +17,7 @@ reachable_via() { } test_valid_repo() { - git fsck-objects --full > fsck.log && + git fsck --full > fsck.log && test `wc -l < fsck.log` = 0 } diff --git a/t/t6023-merge-file.sh b/t/t6023-merge-file.sh index 1c21d8c986..f3cd3dba4d 100644 --- a/t/t6023-merge-file.sh +++ b/t/t6023-merge-file.sh @@ -52,7 +52,7 @@ super aquam refectionis educavit me; animam meam convertit, deduxit me super semitas jusitiae, EOF -echo -n "propter nomen suum." >> new4.txt +printf "propter nomen suum." >> new4.txt cp new1.txt test.txt test_expect_success "merge without conflict" \ diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh new file mode 100755 index 0000000000..3e9edda1ca --- /dev/null +++ b/t/t6120-describe.sh @@ -0,0 +1,97 @@ +#!/bin/sh + +test_description='test describe + + B + .--------------o----o----o----x + / / / + o----o----o----o----o----. / + \ A c / + .------------o---o---o + D e +' +. ./test-lib.sh + +check_describe () { + expect="$1" + shift + R=$(git describe "$@") && + test_expect_success "describe $*" ' + case "$R" in + $expect) echo happy ;; + *) echo "Oops - $R is not $expect"; + false ;; + esac + ' +} + +test_expect_success setup ' + + test_tick && + echo one >file && git-add file && git-commit -m initial && + one=$(git-rev-parse HEAD) && + + test_tick && + echo two >file && git-add file && git-commit -m second && + two=$(git-rev-parse HEAD) && + + test_tick && + echo three >file && git-add file && git-commit -m third && + + test_tick && + echo A >file && git-add file && git-commit -m A && + test_tick && + git-tag -a -m A A && + + test_tick && + echo c >file && git-add file && git-commit -m c && + test_tick && + git-tag c && + + git reset --hard $two && + test_tick && + echo B >side && git-add side && git-commit -m B && + test_tick && + git-tag -a -m B B && + + test_tick && + git-merge -m Merged c && + merged=$(git-rev-parse HEAD) && + + git reset --hard $two && + test_tick && + echo D >another && git-add another && git-commit -m D && + test_tick && + git-tag -a -m D D && + + test_tick && + echo DD >another && git commit -a -m another && + + test_tick && + git-tag e && + + test_tick && + echo DDD >another && git commit -a -m "yet another" && + + test_tick && + git-merge -m Merged $merged && + + test_tick && + echo X >file && echo X >side && git-add file side && + git-commit -m x + +' + +check_describe A-* HEAD +check_describe A-* HEAD^ +check_describe D-* HEAD^^ +check_describe A-* HEAD^^2 +check_describe B HEAD^^2^ + +check_describe A-* --tags HEAD +check_describe A-* --tags HEAD^ +check_describe D-* --tags HEAD^^ +check_describe A-* --tags HEAD^^2 +check_describe B --tags HEAD^^2^ + +test_done diff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh index 63e49f310c..ea14023616 100755 --- a/t/t6200-fmt-merge-msg.sh +++ b/t/t6200-fmt-merge-msg.sh @@ -108,7 +108,7 @@ EOF test_expect_success 'merge-msg test #3' ' - git repo-config merge.summary true && + git config merge.summary true && git checkout master && setdate && @@ -138,7 +138,7 @@ EOF test_expect_success 'merge-msg test #4' ' - git repo-config merge.summary true && + git config merge.summary true && git checkout master && setdate && @@ -150,7 +150,7 @@ test_expect_success 'merge-msg test #4' ' test_expect_success 'merge-msg test #5' ' - git repo-config merge.summary yes && + git config merge.summary yes && git checkout master && setdate && diff --git a/t/t7201-co.sh b/t/t7201-co.sh index 085d4a096b..867bbd26cb 100755 --- a/t/t7201-co.sh +++ b/t/t7201-co.sh @@ -14,15 +14,23 @@ fill () { done } + test_expect_success setup ' - fill 1 2 3 4 5 >one && + fill 1 2 3 4 5 6 7 8 >one && fill a b c d e >two && git add one two && git commit -m "Initial A one, A two" && - git checkout -b side && - fill 1 2 3 >one && + git checkout -b renamer && + rm -f one && + fill 1 3 4 5 6 7 8 >uno && + git add uno && + fill a b c d e f >two && + git commit -a -m "Renamer R one->uno, M two" && + + git checkout -b side master && + fill 1 2 3 4 5 6 7 >one && fill A B C D E >three && rm -f two && git update-index --add --remove one two three && @@ -42,7 +50,7 @@ test_expect_success "checkout from non-existing branch" ' test_expect_success "checkout with dirty tree without -m" ' - fill 0 1 2 3 4 5 >one && + fill 0 1 2 3 4 5 6 7 8 >one && if git checkout side then echo Not happy @@ -58,12 +66,10 @@ test_expect_success "checkout -m with dirty tree" ' git checkout -f master && git clean && - fill 0 1 2 3 4 5 >one && + fill 0 1 2 3 4 5 6 7 8 >one && git checkout -m side && - fill " master" "* side" >expect.branch && - git branch >current.branch && - diff expect.branch current.branch && + test "$(git symbolic-ref HEAD)" = "refs/heads/side" && fill "M one" "A three" "D two" >expect.master && git diff --name-status master >current.master && @@ -78,4 +84,49 @@ test_expect_success "checkout -m with dirty tree" ' diff expect.index current.index ' +test_expect_success "checkout -m with dirty tree, renamed" ' + + git checkout -f master && git clean && + + fill 1 2 3 4 5 7 8 >one && + if git checkout renamer + then + echo Not happy + false + else + echo "happy - failed correctly" + fi && + + git checkout -m renamer && + fill 1 3 4 5 7 8 >expect && + diff expect uno && + ! test -f one && + git diff --cached >current && + ! test -s current + +' + +test_expect_success 'checkout -m with merge conflict' ' + + git checkout -f master && git clean && + + fill 1 T 3 4 5 6 S 8 >one && + if git checkout renamer + then + echo Not happy + false + else + echo "happy - failed correctly" + fi && + + git checkout -m renamer && + + git diff master:one :3:uno | + sed -e "1,/^@@/d" -e "/^ /d" -e "s/^-/d/" -e "s/^+/a/" >current && + fill d2 aT d7 aS >expect && + diff current expect && + git diff --cached two >current && + ! test -s current +' + test_done diff --git a/t/t9102-git-svn-deep-rmdir.sh b/t/t9102-git-svn-deep-rmdir.sh index 572aaedc06..4e0808380f 100755 --- a/t/t9102-git-svn-deep-rmdir.sh +++ b/t/t9102-git-svn-deep-rmdir.sh @@ -1,3 +1,4 @@ +#!/bin/sh test_description='git-svn rmdir' . ./lib-git-svn.sh diff --git a/t/t9103-git-svn-graft-branches.sh b/t/t9103-git-svn-graft-branches.sh index b5f7677021..4e55778a47 100755 --- a/t/t9103-git-svn-graft-branches.sh +++ b/t/t9103-git-svn-graft-branches.sh @@ -1,3 +1,4 @@ +#!/bin/sh test_description='git-svn graft-branches' . ./lib-git-svn.sh diff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh index 315119abff..fd0a5549fe 100755 --- a/t/t9200-git-cvsexportcommit.sh +++ b/t/t9200-git-cvsexportcommit.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Copyright (c) Robin Rosenberg # |