Guilt v0.37-rc1
[guilt.git] / regression / t-034.sh
blob66e39f0667e626b652fcef3c8dfe6eada7f00585
1 #!/bin/bash
3 # Test import-commit
6 function create_commit
8 echo $1 >> $1 &&
9 git add $1 &&
10 git commit -m"$2"
13 source "$REG_DIR/scaffold"
15 b()
17 printf "%b" "$1"
20 cmd setup_git_repo
22 cmd git tag base
24 # Create a series of commits whose first line of the commit message
25 # each violates one of the rules in get-check-ref-format(1).
27 cmd create_commit a "The sequence /. is forbidden."
28 cmd create_commit a "The sequence .lock/ is forbidden."
29 cmd create_commit a "A/component/may/not/end/in/foo.lock"
30 cmd create_commit a "Two consecutive dots (..) is forbidden."
31 cmd create_commit a "Check/multiple/../dots/...../foo..patch"
32 cmd create_commit a "Space is forbidden."
33 cmd create_commit a "Tilde~is~forbidden."
34 cmd create_commit a "Caret^is^forbidden."
35 cmd create_commit a "Colon:is:forbidden."
36 cmd create_commit a `b 'Del\177is\177forbidden.'`
37 # Create a branch and a tag from the current commit, to ensure that
38 # doing so does not affect how the commit is imported.
39 cmd git branch some-branch
40 cmd git tag some-tag
41 cmd create_commit a `b 'Ctrl\001is\002forbidden.'`
42 cmd create_commit a `b 'CR\ris\ralso\rforbidden.'`
43 cmd create_commit a "Question-mark?is?forbidden."
44 cmd create_commit a "Asterisk*is*forbidden."
45 cmd create_commit a "Open[bracket[is[forbidden."
46 cmd create_commit a "Multiple/slashes//are//forbidden."
47 cmd create_commit a "Cannot/end/in/slash/"
48 cmd create_commit a "Cannot end in .."
49 cmd create_commit a "Cannot@{have@{the@{sequence@{at-brace."
50 cmd create_commit a "@"
51 cmd create_commit a "Backslash\\is\\forbidden."
53 # Slash is sometimes allowed; this is not problematic.
54 cmd create_commit a "Can/have/embedded/single/slashes"
56 cmd git log
58 # Import all the commits to guilt.
59 cmd guilt init
60 cmd git config log.decorate short
61 cmd guilt import-commit base..HEAD
62 cmd git config log.decorate no
64 for patch in .git/patches/master/*.patch; do
65 touch -a -m -t "$TOUCH_DATE" "$patch"
66 done
68 # If push and pop works, the names we created are good.
69 cmd guilt push -a
70 cmd git log
71 cmd git log some-branch
72 cmd list_files
73 cmd guilt pop -a