Code

submodule: move update configuration variable further up
[git.git] / t / t9116-git-svn-log.sh
index 4b2cc878f685e65b2ccd5d8153efb533320d6ee9..cf4c05261b42ddd0711f78951adfc4a49ffdcc1e 100755 (executable)
@@ -3,21 +3,23 @@
 # Copyright (c) 2007 Eric Wong
 #
 
-test_description='git-svn log tests'
+test_description='git svn log tests'
 . ./lib-git-svn.sh
 
 test_expect_success 'setup repository and import' '
        mkdir import &&
-       cd import &&
-               for i in trunk branches/a branches/b \
-                        tags/0.1 tags/0.2 tags/0.3; do
-                       mkdir -p $i && \
-                       echo hello >> $i/README || exit 1
-               done && \
-               svn import -m test . "$svnrepo"
-               cd .. &&
-       git-svn init "$svnrepo" -T trunk -b branches -t tags &&
-       git-svn fetch &&
+       (
+               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_cmd import -m test . "$svnrepo"
+       ) &&
+       git svn init "$svnrepo" -T trunk -b branches -t tags &&
+       git svn fetch &&
        git reset --hard trunk &&
        echo bye >> README &&
        git commit -a -m bye &&
@@ -58,6 +60,21 @@ test_expect_success 'test ascending revision range' "
        git svn log -r 1:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2-r4 -
        "
 
+test_expect_success 'test ascending revision range with --show-commit' "
+       git reset --hard trunk &&
+       git svn log --show-commit -r 1:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2-r4 -
+       "
+
+test_expect_success 'test ascending revision range with --show-commit (sha1)' "
+       git svn find-rev r1 >expected-range-r1-r2-r4-sha1 &&
+       git svn find-rev r2 >>expected-range-r1-r2-r4-sha1 &&
+       git svn find-rev r4 >>expected-range-r1-r2-r4-sha1 &&
+       git reset --hard trunk &&
+       git svn log --show-commit -r 1:4 | grep '^r[0-9]' | cut -d'|' -f2 >out &&
+       git rev-parse \$(cat out) >actual &&
+       test_cmp expected-range-r1-r2-r4-sha1 actual
+       "
+
 printf 'r4 \nr2 \nr1 \n' > expected-range-r4-r2-r1
 
 test_expect_success 'test descending revision range' "