Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/t9105-git-svn-commit-diff.sh # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / t9105-git-svn-commit-diff.sh` 44 lines ยท 1202 bytes Raw Blame History 1 #!/bin/sh 2 # 3 # Copyright (c) 2006 Eric Wong 4 test_description='git svn commit-diff' 5 . ./lib-git-svn.sh 6 7 test_expect_success 'initialize repo' ' 8 mkdir import && 9 ( 10 cd import && 11 echo hello >readme && 12 svn_cmd import -m "initial" . "$svnrepo" 13 ) && 14 echo hello > readme && 15 git update-index --add readme && 16 git commit -a -m "initial" && 17 echo world >> readme && 18 git commit -a -m "another" 19 ' 20 21 head=$(git rev-parse --verify HEAD^0) 22 prev=$(git rev-parse --verify HEAD^1) 23 24 # the internals of the commit-diff command are the same as the regular 25 # commit, so only a basic test of functionality is needed since we've 26 # already tested commit extensively elsewhere 27 28 test_expect_success 'test the commit-diff command' ' 29 test -n "$prev" && test -n "$head" && 30 git svn commit-diff -r1 "$prev" "$head" "$svnrepo" && 31 svn_cmd co "$svnrepo" wc && 32 cmp readme wc/readme 33 ' 34 35 test_expect_success 'commit-diff to a sub-directory (with git svn config)' ' 36 svn_cmd import -m "sub-directory" import "$svnrepo"/subdir && 37 git svn init --minimize-url "$svnrepo"/subdir && 38 git svn fetch && 39 git svn commit-diff -r3 "$prev" "$head" && 40 svn_cmd cat "$svnrepo"/subdir/readme > readme.2 && 41 cmp readme readme.2 42 ' 43 44 test_done