summaryrefslogtreecommitdiffstats
path: root/test/nolink.test
Commit message (Collapse)AuthorAgeFilesLines
* "quilt revert" accidentally creates a hard link, it shouldn't do that.Jean Delvare2009-06-171-0/+20
| | | | | | | | | | | | | | | | | | | | | | I think the reason is that apply_patch_temporarily() uses backup-files to create the temporary files, and by default backup-files uses hard links. For files which are modified by the patch, this isn't a problem because patch will unlink the file before modifying it. But for files which are not modified by the patch, the hard link is preserved. Then quilt revert also makes a hard link to restore the file, on the assumption that the temporary copy will be deleted right away. At this point, files not modified by the patch will have a link count of 3 (.pc/<patch>/<file>, d.*/<file> and <file>). When the temporary file is deleted, the link count is still 2 (.pc/<patch>/<file> and <file>). A simple way to fix this is to always use cp instead of ln when restoring the files. Performance is not as good, but at least it is always correct. We could optimize the code to use ln when possible and cp for the other cases, but honestly I don't think it is worth the extra complexity. The speed of "quilt revert" is hardly critical, given how infrequently this command is used.
* - lib/backup-files.c: Do not modify the original file wheneverAndreas Gruenbacher2007-04-161-0/+57
possible: previously, a ``quilt add'' usually linked the file to he backup and then copied the backup over the file to ensure a link count of one. Recognize this case, and create a copy in the first place instead.