File: t3200-non-ascii-filenames.sh

package info (click to toggle)
stgit 0.19-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,748 kB
  • sloc: python: 10,558; sh: 5,739; lisp: 2,678; makefile: 142; perl: 42
file content (59 lines) | stat: -rwxr-xr-x 1,331 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh
test_description='Handle files with non-ASCII characters in their names'

. ./test-lib.sh

# Ignore our own output files.
cat >> .git/info/exclude <<EOF
/expected.txt
/output.txt
EOF

test_expect_success 'Setup' '
    echo "Fjäderholmarna" > skärgårdsö.txt &&
    stg add skärgårdsö.txt &&
    git commit -m "Create island" &&
    stg init &&
    echo foo > unrelated.txt &&
    stg add unrelated.txt &&
    stg new p0 -m "Unrelated file" &&
    stg refresh &&
    stg pop &&
    rm skärgårdsö.txt &&
    git commit -a -m "Remove island" &&
    git tag upstream &&
    git reset --hard HEAD^ &&
    stg push
'

test_expect_success 'Rebase onto changed non-ASCII file' '
    stg rebase upstream
'

test_expect_success 'Setup' '
    stg delete p0 &&
    git reset --hard HEAD^ &&
    echo "-- ett liv mitt ute i vattnet" >> skärgårdsö.txt &&
    stg new p1 -m "Describe island"
'

cat > expected.txt <<EOF
 M "sk\303\244rg\303\245rds\303\266.txt"
EOF
test_expect_success 'Status of modified non-ASCII file' '
    stg status > output.txt &&
    diff -u expected.txt output.txt
'

test_expect_success 'Refresh changes to non-ASCII file' '
    stg refresh
'

cat > expected.txt <<EOF
EOF
test_expect_success 'Status after refresh' '
    stg status > output.txt &&
    diff -u expected.txt output.txt
'

test_done