summaryrefslogblamecommitdiffstats
path: root/test/hard-linked-patch.test
blob: 279c595ec23ddfda12c352980b80451cc5a6f412 (plain) (tree)



































                                                                    























                                        
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 patches/patch
> Now at patch patches/patch

$ echo c > file
$ quilt refresh --no-index
> Refreshed patch patches/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 patches/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