summaryrefslogtreecommitdiffstats
path: root/test/perms.test
blob: 7211b746bd09977448724df2ec8c6fe2b592f596 (plain) (blame)
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
60
61
62
63
64
65
66
	$ rm -rf d
	$ umask 022
	$ mkdir -p d/patches
	$ cd d
	$ echo foo > foo
	$ chmod 704 foo
	$ ls -l foo | awk '{ print $1,$NF }'
	> -rwx---r-- foo

	$ quilt new test.diff
	> Patch %{P}test.diff is now on top

	$ quilt add foo
	> File foo added to patch %{P}test.diff

	$ ls -l foo | awk '{ print $1,$NF }'
	> -rwx---r-- foo

	$ echo foobar > foo
	$ quilt ref
	> Refreshed patch %{P}test.diff

	$ quilt new test2.diff
	> Patch %{P}test2.diff is now on top

	$ quilt add foo
	> File foo added to patch %{P}test2.diff

	$ chmod 702 foo
	$ ls -l foo | awk '{ print $1,$NF }'
	> -rwx----w- foo

	$ echo foobaz > foo
	$ quilt ref
	> Refreshed patch %{P}test2.diff

The permissions of foo as they were in patch2 are lost here (there is no
way to preserve them in the patch). Quilt will restore the permissions of
the backup file.

	$ quilt pop -q
	> Removing patch %{P}test2.diff
	> Now at patch %{P}test.diff

	$ ls -l foo | awk '{ print $1,$NF }'
	> -rwx---r-- foo

	$ quilt push -q
	> Applying patch %{P}test2.diff
	> Now at patch %{P}test2.diff

	$ ls -l foo | awk '{ print $1,$NF }'
	> -rwx---r-- foo

	$ quilt pop -q
	> Removing patch %{P}test2.diff
	> Now at patch %{P}test.diff

	$ quilt remove foo
	> File foo removed from patch %{P}test.diff

	$ ls -l foo | awk '{ print $1,$NF }'
	> -rwx---r-- foo

	$ cd ..
	$ rm -rf d