blob: f0fbd3aff7e63f64f8ba388db805013c43b4b22c [file] [log] [blame]
Eric Wong29633bb2007-07-15 21:53:50 -07001#!/bin/sh
2#
3# Copyright (c) 2007 Eric Wong
4
5
6test_description='git-svn dcommit can commit renames of files with ugly names'
7
8. ./lib-git-svn.sh
9
Bryan Donlanf69e8362008-05-04 01:37:59 -040010test_expect_success 'load repository with strange names' '
11 svnadmin load -q "$rawsvnrepo" < ../t9115/funky-names.dump &&
Eric Wongd1a8d0e2008-05-10 17:14:49 -070012 start_httpd gtk+
Bryan Donlanf69e8362008-05-04 01:37:59 -040013 '
Eric Wong29633bb2007-07-15 21:53:50 -070014
Bryan Donlanf69e8362008-05-04 01:37:59 -040015test_expect_success 'init and fetch repository' '
16 git svn init "$svnrepo" &&
Eric Wong29633bb2007-07-15 21:53:50 -070017 git svn fetch &&
18 git reset --hard git-svn
Bryan Donlanf69e8362008-05-04 01:37:59 -040019 '
Eric Wong29633bb2007-07-15 21:53:50 -070020
21test_expect_success 'create file in existing ugly and empty dir' '
22 mkdir "#{bad_directory_name}" &&
23 echo hi > "#{bad_directory_name}/ foo" &&
24 git update-index --add "#{bad_directory_name}/ foo" &&
25 git commit -m "new file in ugly parent" &&
26 git svn dcommit
27 '
28
29test_expect_success 'rename ugly file' '
30 git mv "#{bad_directory_name}/ foo" "file name with feces" &&
31 git commit -m "rename ugly file" &&
32 git svn dcommit
33 '
34
35test_expect_success 'rename pretty file' '
36 echo :x > pretty &&
37 git update-index --add pretty &&
38 git commit -m "pretty :x" &&
39 git svn dcommit &&
40 mkdir regular_dir_name &&
41 git mv pretty regular_dir_name/pretty &&
42 git commit -m "moved pretty file" &&
43 git svn dcommit
44 '
45
46test_expect_success 'rename pretty file into ugly one' '
47 git mv regular_dir_name/pretty "#{bad_directory_name}/ booboo" &&
48 git commit -m booboo &&
49 git svn dcommit
50 '
51
Eric Wongd1a8d0e2008-05-10 17:14:49 -070052test_expect_success 'add a file with plus signs' '
53 echo .. > +_+ &&
54 git update-index --add +_+ &&
55 git commit -m plus &&
56 mkdir gtk+ &&
57 git mv +_+ gtk+/_+_ &&
58 git commit -m plus_dir &&
59 git svn dcommit
60 '
61
Junio C Hamano761adeb2008-05-14 13:45:16 -070062test_expect_success 'clone the repository to test rebase' '
63 git svn clone "$svnrepo" test-rebase &&
Eric Wongd1a8d0e2008-05-10 17:14:49 -070064 cd test-rebase &&
65 echo test-rebase > test-rebase &&
66 git add test-rebase &&
67 git commit -m test-rebase &&
68 cd ..
Junio C Hamano761adeb2008-05-14 13:45:16 -070069 '
Eric Wongd1a8d0e2008-05-10 17:14:49 -070070
Junio C Hamano761adeb2008-05-14 13:45:16 -070071test_expect_success 'make a commit to test rebase' '
Eric Wongd1a8d0e2008-05-10 17:14:49 -070072 echo test-rebase-main > test-rebase-main &&
73 git add test-rebase-main &&
74 git commit -m test-rebase-main &&
75 git svn dcommit
Junio C Hamano761adeb2008-05-14 13:45:16 -070076 '
Eric Wongd1a8d0e2008-05-10 17:14:49 -070077
Junio C Hamano761adeb2008-05-14 13:45:16 -070078test_expect_success 'git-svn rebase works inside a fresh-cloned repository' '
Eric Wongd1a8d0e2008-05-10 17:14:49 -070079 cd test-rebase &&
80 git svn rebase &&
81 test -e test-rebase-main &&
82 test -e test-rebase
Junio C Hamano761adeb2008-05-14 13:45:16 -070083 '
Eric Wongd1a8d0e2008-05-10 17:14:49 -070084
Eric Wong29633bb2007-07-15 21:53:50 -070085stop_httpd
86
87test_done