summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-12-07 15:45:08 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-12-07 15:45:08 -0400
commitad2339e17f69373e75aae5d1394de5d76d94c790 (patch)
treeffe51f9c236dadd340802c4604dcdd3fc190c9e9 /Command
parentee0c34c8f2f94775b39ef10ed580cab47d2f929c (diff)
require "annex/objects/" before key in pointer files
This removes ambiguity, because while someone might have "WORM--foo" in a file that's not intended to be a git-annex pointer file, "annex/objects/WORM--foo" is less likely. Also, ee0c34c8f2f94775b39ef10ed580cab47d2f929c had a caveat about symlink targets being parsed as pointer files, and now the same parser is used for both. I did not include any hash directories before the key in the pointer file, as they're not needed. However, if they were included, the parser would still work ok.
Diffstat (limited to 'Command')
-rw-r--r--Command/Smudge.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/Command/Smudge.hs b/Command/Smudge.hs
index c2dc28540..e08afed6b 100644
--- a/Command/Smudge.hs
+++ b/Command/Smudge.hs
@@ -18,6 +18,7 @@ import Types.KeySource
import Backend
import Logs.Location
import qualified Database.AssociatedFiles as AssociatedFiles
+import Git.FilePath
import qualified Data.ByteString.Lazy as B
@@ -104,7 +105,8 @@ ingest file = do
-- Could add a newline and some text explaining this file is a pointer.
-- parsePointer only looks at the first line.
emitPointer :: Key -> IO ()
-emitPointer = putStrLn . key2file
+emitPointer k = putStrLn $ toInternalGitPath $
+ pathSeparator:objectDir </> key2file k
updateAssociatedFiles :: Key -> FilePath -> Annex ()
updateAssociatedFiles k f = do