diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-12-07 15:22:01 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-12-07 15:35:36 -0400 |
commit | ee0c34c8f2f94775b39ef10ed580cab47d2f929c (patch) | |
tree | 8b1b26a7f379d85f4658003a5e8a72559d009fcc /Command/Undo.hs | |
parent | 42a370de0544e65fc1f150d3b2406b6683b7e5e1 (diff) |
support pointer files
Backend.lookupFile is changed to always fall back to catKey when
operating on a file that's not a symlink.
catKey is changed to understand pointer files, as well as annex symlinks.
Before, catKey needed a file mode witness, to be sure it was looking at a
symlink. That was complicated stuff. Now, it doesn't actually care if a
file in git is a symlink or not; in either case asking git for the content
of the file will get the pointer to the key.
This does mean that git-annex will treat a link
foo -> WORM--bar as a git-annex file, and also treats
a regular file containing annex/objects/WORM--bar as a git-annex file.
Calling catKey could make git-annex commands need to do more work than
before. This would especially be the case if a repo contained many regular
files, and only a few annexed files, as now git-annex will need to ask
git about the contents of the regular files.
Diffstat (limited to 'Command/Undo.hs')
-rw-r--r-- | Command/Undo.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Command/Undo.hs b/Command/Undo.hs index c647dfba4..0692dce34 100644 --- a/Command/Undo.hs +++ b/Command/Undo.hs @@ -72,7 +72,7 @@ perform p = do f <- mkrel di whenM isDirect $ maybe noop (`removeDirect` f) - =<< catKey (srcsha di) (srcmode di) + =<< catKey (srcsha di) liftIO $ nukeFile f forM_ adds $ \di -> do @@ -80,6 +80,6 @@ perform p = do inRepo $ Git.run [Param "checkout", Param "--", File f] whenM isDirect $ maybe noop (`toDirect` f) - =<< catKey (dstsha di) (dstmode di) + =<< catKey (dstsha di) next $ liftIO cleanup |