diff --git a/CHANGELOG b/CHANGELOG index 9ad9f1a6d3..1c3f6d045e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -34,6 +34,7 @@ git-annex (7.20190220) UNRELEASED; urgency=medium * Removed bundled gpg from the Linux standalone build and OSX dmg, because gpg now always wants to use gpg-agent, and shipping such a daemon in those is not a good idea. + * import: Let --force overwrite symlinks, not only regular files. -- Joey Hess Wed, 20 Feb 2019 14:20:59 -0400 diff --git a/Command/Import.hs b/Command/Import.hs index 743a15f1d3..2452337710 100644 --- a/Command/Import.hs +++ b/Command/Import.hs @@ -146,7 +146,12 @@ startLocal largematcher mode (srcfile, destfile) = Nothing -> importfilechecked ld k Just s | isDirectory s -> notoverwriting "(is a directory)" - | isSymbolicLink s -> notoverwriting "(is a symlink)" + | isSymbolicLink s -> ifM (Annex.getState Annex.force) + ( do + liftIO $ nukeFile destfile + importfilechecked ld k + , notoverwriting "(is a symlink)" + ) | otherwise -> ifM (Annex.getState Annex.force) ( do liftIO $ nukeFile destfile diff --git a/doc/bugs/import_--force_does_not_operate_on_locked_files.mdwn b/doc/bugs/import_--force_does_not_operate_on_locked_files.mdwn index 03b771fa00..b0ba103622 100644 --- a/doc/bugs/import_--force_does_not_operate_on_locked_files.mdwn +++ b/doc/bugs/import_--force_does_not_operate_on_locked_files.mdwn @@ -1 +1,3 @@ `git-annex import --force` does not work on locked files (only unlocked files). Running `7.20181106-g352f88226` on macOS 10.12.6 + +> Nicely spotted! [[fixed|done]] --[[Joey]]