Commit | Line | Data |
---|---|---|
82863c3c KH |
1 | #!/bin/sh |
2 | test_description='Handle files with non-ASCII characters in their names' | |
3 | ||
4 | . ./test-lib.sh | |
5 | ||
adb61608 KH |
6 | # Ignore our own output files. |
7 | cat > .git/info/exclude <<EOF | |
8 | /expected.txt | |
9 | /output.txt | |
10 | EOF | |
11 | ||
82863c3c KH |
12 | test_expect_success 'Setup' ' |
13 | echo "Fjäderholmarna" > skärgårdsö.txt && | |
14 | git add skärgårdsö.txt && | |
15 | git commit -m "Create island" && | |
16 | stg init && | |
17 | echo foo > unrelated.txt && | |
18 | git add unrelated.txt && | |
adb61608 | 19 | stg new p0 -m "Unrelated file" && |
82863c3c KH |
20 | stg refresh && |
21 | stg pop && | |
22 | rm skärgårdsö.txt && | |
23 | git commit -a -m "Remove island" && | |
24 | git tag upstream && | |
25 | git reset --hard HEAD^ && | |
26 | stg push | |
27 | ' | |
28 | ||
fb9b3c02 | 29 | test_expect_success 'Rebase onto changed non-ASCII file' ' |
82863c3c KH |
30 | stg rebase upstream |
31 | ' | |
32 | ||
adb61608 KH |
33 | test_expect_success 'Setup' ' |
34 | stg delete p0 && | |
35 | git reset --hard HEAD^ && | |
36 | echo "-- ett liv mitt ute i vattnet" >> skärgårdsö.txt && | |
37 | stg new p1 -m "Describe island" | |
38 | ' | |
39 | ||
40 | cat > expected.txt <<EOF | |
41 | M skärgårdsö.txt | |
42 | EOF | |
8fe07fa4 | 43 | test_expect_success 'Status of modified non-ASCII file' ' |
adb61608 KH |
44 | stg status > output.txt && |
45 | diff -u expected.txt output.txt | |
46 | ' | |
47 | ||
48 | test_expect_success 'Refresh changes to non-ASCII file' ' | |
49 | stg refresh | |
50 | ' | |
51 | ||
52 | cat > expected.txt <<EOF | |
53 | EOF | |
54 | test_expect_success 'Status after refresh' ' | |
55 | stg status > output.txt && | |
56 | diff -u expected.txt output.txt | |
57 | ' | |
58 | ||
82863c3c | 59 | test_done |