]> git.ipfire.org Git - thirdparty/git.git/blame - t/t9105-git-svn-commit-diff.sh
parse-opt: ignore negation of OPT_NONEG for ambiguity checks
[thirdparty/git.git] / t / t9105-git-svn-commit-diff.sh
CommitLineData
27e9fb8d
EW
1#!/bin/sh
2#
3# Copyright (c) 2006 Eric Wong
1364ff27 4test_description='git svn commit-diff'
27e9fb8d
EW
5. ./lib-git-svn.sh
6
f69e836f 7test_expect_success 'initialize repo' '
27e9fb8d
EW
8 mkdir import &&
9 cd import &&
10 echo hello > readme &&
da083d68 11 svn_cmd import -m "initial" . "$svnrepo" &&
27e9fb8d
EW
12 cd .. &&
13 echo hello > readme &&
14 git update-index --add readme &&
f69e836f 15 git commit -a -m "initial" &&
27e9fb8d 16 echo world >> readme &&
f69e836f
BD
17 git commit -a -m "another"
18 '
27e9fb8d
EW
19
20head=`git rev-parse --verify HEAD^0`
21prev=`git rev-parse --verify HEAD^1`
22
23# the internals of the commit-diff command are the same as the regular
24# commit, so only a basic test of functionality is needed since we've
25# already tested commit extensively elsewhere
26
f69e836f
BD
27test_expect_success 'test the commit-diff command' '
28 test -n "$prev" && test -n "$head" &&
1364ff27 29 git svn commit-diff -r1 "$prev" "$head" "$svnrepo" &&
da083d68 30 svn_cmd co "$svnrepo" wc &&
27e9fb8d 31 cmp readme wc/readme
f69e836f 32 '
27e9fb8d 33
1364ff27 34test_expect_success 'commit-diff to a sub-directory (with git svn config)' '
da083d68 35 svn_cmd import -m "sub-directory" import "$svnrepo"/subdir &&
1364ff27
NS
36 git svn init --minimize-url "$svnrepo"/subdir &&
37 git svn fetch &&
38 git svn commit-diff -r3 "$prev" "$head" &&
da083d68 39 svn_cmd cat "$svnrepo"/subdir/readme > readme.2 &&
d3a840dc 40 cmp readme readme.2
f69e836f 41 '
d3a840dc 42
27e9fb8d 43test_done