]>
Commit | Line | Data |
---|---|---|
27e9fb8d EW |
1 | #!/bin/sh |
2 | # | |
3 | # Copyright (c) 2006 Eric Wong | |
1364ff27 | 4 | test_description='git svn commit-diff' |
27e9fb8d EW |
5 | . ./lib-git-svn.sh |
6 | ||
f69e836f | 7 | test_expect_success 'initialize repo' ' |
27e9fb8d | 8 | mkdir import && |
18a82692 JN |
9 | ( |
10 | cd import && | |
11 | echo hello >readme && | |
12 | svn_cmd import -m "initial" . "$svnrepo" | |
fd4ec4f2 | 13 | ) && |
27e9fb8d EW |
14 | echo hello > readme && |
15 | git update-index --add readme && | |
f69e836f | 16 | git commit -a -m "initial" && |
27e9fb8d | 17 | echo world >> readme && |
f69e836f BD |
18 | git commit -a -m "another" |
19 | ' | |
27e9fb8d | 20 | |
32858a01 EP |
21 | head=$(git rev-parse --verify HEAD^0) |
22 | prev=$(git rev-parse --verify HEAD^1) | |
27e9fb8d EW |
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 | ||
f69e836f BD |
28 | test_expect_success 'test the commit-diff command' ' |
29 | test -n "$prev" && test -n "$head" && | |
1364ff27 | 30 | git svn commit-diff -r1 "$prev" "$head" "$svnrepo" && |
da083d68 | 31 | svn_cmd co "$svnrepo" wc && |
27e9fb8d | 32 | cmp readme wc/readme |
f69e836f | 33 | ' |
27e9fb8d | 34 | |
1364ff27 | 35 | test_expect_success 'commit-diff to a sub-directory (with git svn config)' ' |
da083d68 | 36 | svn_cmd import -m "sub-directory" import "$svnrepo"/subdir && |
1364ff27 NS |
37 | git svn init --minimize-url "$svnrepo"/subdir && |
38 | git svn fetch && | |
39 | git svn commit-diff -r3 "$prev" "$head" && | |
da083d68 | 40 | svn_cmd cat "$svnrepo"/subdir/readme > readme.2 && |
d3a840dc | 41 | cmp readme readme.2 |
f69e836f | 42 | ' |
d3a840dc | 43 | |
27e9fb8d | 44 | test_done |