import: Preserve top-level directory structure.

This commit is contained in:
Joey Hess 2013-09-25 13:16:55 -04:00
parent 9cae3a21f6
commit c923c981b9
3 changed files with 4 additions and 4 deletions

View file

@ -60,7 +60,7 @@ withPathContents :: ((FilePath, FilePath) -> CommandStart) -> CommandSeek
withPathContents a params = map a . concat <$> liftIO (mapM get params)
where
get p = ifM (isDirectory <$> getFileStatus p)
( map (\f -> (f, makeRelative p f)) <$> dirContentsRecursive p
( map (\f -> (f, makeRelative (parentDir p) f)) <$> dirContentsRecursive p
, return [(p, takeFileName p)]
)

1
debian/changelog vendored
View file

@ -4,6 +4,7 @@ git-annex (4.20130921) UNRELEASED; urgency=low
if you created one you must manually upgrade it.
See http://git-annex.branchable.com/upgrades/gcrypt/
* git-annex-shell: Added support for operating inside gcrypt repositories.
* import: Preserve top-level directory structure.
* Use cryptohash rather than SHA for hashing when no external hash program
is available. This is a significant speedup for SHA256 on OSX, for
example.

View file

@ -206,10 +206,9 @@ subdirectories).
Moves files from somewhere outside the git working copy, and adds them to
the annex. Individual files to import can be specified.
If a directory is specified, all files in it are imported, and any
subdirectory structure inside it is preserved.
If a directory is specified, the entire directory is imported.
git annex import /media/camera/DCIM/
git annex import /media/camera/DCIM/*
By default, importing two files with the same contents from two different
locations will result in both files being added to the repository.