summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Annex/View.hs8
-rw-r--r--Command/View.hs10
-rw-r--r--Git/DiffTree.hs2
-rw-r--r--debian/changelog2
-rw-r--r--doc/backends.mdwn4
-rw-r--r--doc/bugs/__34__git-annex:_direct:_1_failed__34___on_Windows.mdwn2
6 files changed, 18 insertions, 10 deletions
diff --git a/Annex/View.hs b/Annex/View.hs
index 4cbf274aa..e148203c2 100644
--- a/Annex/View.hs
+++ b/Annex/View.hs
@@ -340,8 +340,9 @@ applyView' mkviewedfile getfilemetadata view = do
genViewBranch view $ do
uh <- inRepo Git.UpdateIndex.startUpdateIndex
hasher <- inRepo hashObjectStart
- forM_ l $ \f ->
- go uh hasher f =<< Backend.lookupFile f
+ forM_ l $ \f -> do
+ relf <- getTopFilePath <$> inRepo (toTopFilePath f)
+ go uh hasher relf =<< Backend.lookupFile f
liftIO $ do
hashObjectStop hasher
void $ stopUpdateIndex uh
@@ -352,7 +353,8 @@ applyView' mkviewedfile getfilemetadata view = do
metadata <- getCurrentMetaData k
let metadata' = getfilemetadata f `unionMetaData` metadata
forM_ (genviewedfiles f metadata') $ \fv -> do
- stagesymlink uh hasher fv =<< inRepo (gitAnnexLink fv k)
+ f' <- fromRepo $ fromTopFilePath $ asTopFilePath fv
+ stagesymlink uh hasher f' =<< inRepo (gitAnnexLink f' k)
go uh hasher f Nothing
| "." `isPrefixOf` f = do
s <- liftIO $ getSymbolicLinkStatus f
diff --git a/Command/View.hs b/Command/View.hs
index bfe030e23..ae8fe824e 100644
--- a/Command/View.hs
+++ b/Command/View.hs
@@ -53,10 +53,8 @@ mkView params = go =<< inRepo Git.Branch.current
checkoutViewBranch :: View -> (View -> Annex Git.Branch) -> CommandCleanup
checkoutViewBranch view mkbranch = do
- oldcwd <- liftIO getCurrentDirectory
+ here <- liftIO getCurrentDirectory
- {- Change to top of repository before creating view branch. -}
- liftIO . setCurrentDirectory =<< fromRepo Git.repoPath
branch <- mkbranch view
showOutput
@@ -68,9 +66,9 @@ checkoutViewBranch view mkbranch = do
setView view
{- A git repo can easily have empty directories in it,
- and this pollutes the view, so remove them. -}
- liftIO $ removeemptydirs "."
- unlessM (liftIO $ doesDirectoryExist oldcwd) $ do
- top <- fromRepo Git.repoPath
+ top <- fromRepo Git.repoPath
+ liftIO $ removeemptydirs top
+ unlessM (liftIO $ doesDirectoryExist here) $ do
showLongNote (cwdmissing top)
return ok
where
diff --git a/Git/DiffTree.hs b/Git/DiffTree.hs
index 5981ed1a2..3ea14a15f 100644
--- a/Git/DiffTree.hs
+++ b/Git/DiffTree.hs
@@ -61,7 +61,7 @@ diffIndex' :: Ref -> [CommandParam] -> Repo -> IO ([DiffTreeItem], IO Bool)
diffIndex' ref params repo =
ifM (Git.Ref.headExists repo)
( getdiff (Param "diff-index")
- ( params ++ [Param $ fromRef ref] )
+ ( params ++ [Param $ fromRef ref] ++ [Param "--"] )
repo
, return ([], return True)
)
diff --git a/debian/changelog b/debian/changelog
index 40a0a6707..8b73121ae 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -15,6 +15,8 @@ git-annex (5.20141232) UNRELEASED; urgency=medium
* Generate shorter keys for WORM and URL, avoiding keys that are longer
than used for SHA256, so as to not break on systems like Windows that
have very small maximum path length limits.
+ * Bugfix: A file named HEAD in the work tree could confuse some git commands
+ run by git-annex.
-- Joey Hess <id@joeyh.name> Fri, 02 Jan 2015 13:35:13 -0400
diff --git a/doc/backends.mdwn b/doc/backends.mdwn
index 06475adfb..bf6471fa7 100644
--- a/doc/backends.mdwn
+++ b/doc/backends.mdwn
@@ -25,6 +25,10 @@ can use different ones for different files.
-- [Skein hash](http://en.wikipedia.org/wiki/Skein_hash),
a well-regarded SHA3 hash competition finalist.
+Note that the SHA512, SKEIN512 and SHA384 generate long paths,
+which are known to not work on Windows. If interoperability on Windows is a
+concern, avoid those backends.
+
The `annex.backends` git-config setting can be used to list the backends
git-annex should use. The first one listed will be used by default when
new files are added.
diff --git a/doc/bugs/__34__git-annex:_direct:_1_failed__34___on_Windows.mdwn b/doc/bugs/__34__git-annex:_direct:_1_failed__34___on_Windows.mdwn
index f8c84b440..d127934fa 100644
--- a/doc/bugs/__34__git-annex:_direct:_1_failed__34___on_Windows.mdwn
+++ b/doc/bugs/__34__git-annex:_direct:_1_failed__34___on_Windows.mdwn
@@ -105,3 +105,5 @@ c:\temp\sbv>
# End of transcript or log.
"""]]
+
+[[!meta title="window's tiny mind is confused by some long paths used by git-annex"]]