From 191559601a8cd6ba2d9e7c3e429efa694f6ff460 Mon Sep 17 00:00:00 2001 From: Anish Athalye Date: Tue, 5 Apr 2016 18:04:42 -0400 Subject: Fix linking when using both relink and relative Prior to this patch, the following config led to incorrect behavior: - link: ~/.folder/file: path: file create: true relative: true relink: true Prior to the change, running the config the first time would result in expected behavior. However, running the config for the second time would result in deletion and re-creation of the link (even when the link is correct). This patch improves the interaction of relink and relative, taking relative paths into account when checking the validity of existing links in the `_delete()` method. --- test/tests/link-relink-relative-leaves-file.bash | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 test/tests/link-relink-relative-leaves-file.bash (limited to 'test') diff --git a/test/tests/link-relink-relative-leaves-file.bash b/test/tests/link-relink-relative-leaves-file.bash new file mode 100644 index 0000000..af49174 --- /dev/null +++ b/test/tests/link-relink-relative-leaves-file.bash @@ -0,0 +1,32 @@ +test_description='relink relative does not incorrectly relink file' +. '../test-lib.bash' + +test_expect_success 'setup' ' +echo "apple" > ${DOTFILES}/f && +echo "grape" > ~/.f +' + +test_expect_success 'run1' ' +run_dotbot <