import qualified Data.Set as S
import qualified Data.Map as M
import qualified Data.ByteString.Lazy as L
+import qualified Utility.RawFilePath as R
{- Merges from a branch into the current branch (which may not exist yet),
- with automatic merge conflict resolution.
inks = maybe False (flip S.member ks)
matchesresolved is i f
| S.member f fs || S.member (conflictCruftBase f) fs = anyM id
- [ pure (S.member i is)
+ [ pure $ either (const False) (`S.member` is) i
, inks <$> isAnnexLink (toRawFilePath f)
, inks <$> liftIO (isPointerFile (toRawFilePath f))
]
reuseOldFile srcmap key origfile destfile = do
is <- map (inodeCacheToKey Strongly)
<$> Database.Keys.getInodeCaches key
- liftIO $ go $ mapMaybe (\i -> M.lookup i srcmap) is
+ liftIO $ go $ mapMaybe (\i -> M.lookup (Right i) srcmap) is
where
go [] = return False
go (f:fs)
, Param "git-annex automatic merge conflict fix"
]
-type InodeMap = M.Map InodeCacheKey FilePath
+type InodeMap = M.Map (Either FilePath InodeCacheKey) FilePath
inodeMap :: Annex ([RawFilePath], IO Bool) -> Annex InodeMap
inodeMap getfiles = do
(fs, cleanup) <- getfiles
fsis <- forM fs $ \f -> do
- mi <- withTSDelta (liftIO . genInodeCache f)
- return $ case mi of
- Nothing -> Nothing
- Just i -> Just (inodeCacheToKey Strongly i, fromRawFilePath f)
+ s <- liftIO $ R.getSymbolicLinkStatus f
+ let f' = fromRawFilePath f
+ if isSymbolicLink s
+ then pure $ Just (Left f', f')
+ else withTSDelta (\d -> liftIO $ toInodeCache d f' s)
+ >>= return . \case
+ Just i -> Just (Right (inodeCacheToKey Strongly i), f')
+ Nothing -> Nothing
void $ liftIO cleanup
return $ M.fromList $ catMaybes fsis
behavior that git-annex has had for a long time.
* Retry transfers to exporttree=yes remotes same as for other remotes.
* import: Retry downloads that fail, same as is done for downloads generally.
- * resolvemerge: Improve cleanup of files that were deleted by one side of
- a conflicted merge, and modified by the other side.
* sync, assistant, merge: When merge.directoryRenames is not set,
default it it to "false", which works better with automatic merge
conflict resolution than git's ususual default of "conflict".
(This is not done when automatic merge conflict resolution is disabled.)
+ * resolvemerge: Improve cleanup of cruft left in the working tree
+ by a conflicted merge.
-- Joey Hess <id@joeyh.name> Fri, 14 Aug 2020 14:57:45 -0400
files like `foo~refs_remotes_origin_master`, which are not checked into
git.
-Also happens with merge.directoryRenames=conflict --[[Joey]]
+Also happens with merge.directoryRenames=conflict
+
+Seems to only happen sometimes, unsure why.. Maybe git doesn't always
+write those files, or sometimes something done with git deletes them?
+
+Root cause seems to be that it's making an InodeCache, but that can't
+be done of a broken symlink. So, it's probably a reversion introduced with
+v7 unlocked files or so.
+
+> [[fixed|done]] --[[Joey]]