summaryrefslogblamecommitdiffstats
path: root/test/hard-linked-patch.test
blob: 10f5f9d1d95ae38877b58dab396d0381fa1711a8 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16















                                                                    

                          


                          
                           













                   







                                    
                                    














                            
If a patch file has hard links, refreshing it should break the links
so that the other copies are left unmodified.

$ mkdir patches

$ cat > patches/patch
< --- file.orig
< +++ file
< @@ -1 +1 @@
< -a
< +b
$ echo patch -p0 > patches/series
$ ln patches/patch hardlink

$ echo a > file
$ quilt push -q
> Applying patch %{P}patch
> Now at patch %{P}patch

$ echo c > file
$ quilt refresh --no-index
> Refreshed patch %{P}patch

$ cat patches/patch
> --- file.orig
> +++ file
> @@ -1 +1 @@
> -a
> +c

$ cat hardlink
> --- file.orig
> +++ file
> @@ -1 +1 @@
> -a
> +b

Same goes for a patch header update.

$ rm -f hardlink
$ ln patches/patch hardlink

$ quilt header -r
< c is so much better than a
> Replaced header of patch %{P}patch

$ cat patches/patch
> c is so much better than a
> --- file.orig
> +++ file
> @@ -1 +1 @@
> -a
> +c

$ cat hardlink
> --- file.orig
> +++ file
> @@ -1 +1 @@
> -a
> +c