summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-08-22 10:20:03 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-08-22 10:20:03 -0400
commitffb0bf0ed51c3454fafdf7dcbc074910f5709942 (patch)
treeabb222ae52022457d0f37311813359b795764c6e
parent40e63f87c409d47686480a7ddf8b5034d1d7ddcd (diff)
unused: Pay attention to symlinks that are not yet staged in the index.
-rw-r--r--Command/Unused.hs2
-rw-r--r--Git/LsFiles.hs6
-rw-r--r--debian/changelog1
3 files changed, 8 insertions, 1 deletions
diff --git a/Command/Unused.hs b/Command/Unused.hs
index 0a060aae6..7c43cbc6f 100644
--- a/Command/Unused.hs
+++ b/Command/Unused.hs
@@ -241,7 +241,7 @@ withKeysReferenced' mdir initial a = do
( return ([], return True)
, do
top <- fromRepo Git.repoPath
- inRepo $ LsFiles.inRepo [top]
+ inRepo $ LsFiles.allFiles [top]
)
Just dir -> inRepo $ LsFiles.inRepo [dir]
go v [] = return v
diff --git a/Git/LsFiles.hs b/Git/LsFiles.hs
index f4e467215..e2e29ea36 100644
--- a/Git/LsFiles.hs
+++ b/Git/LsFiles.hs
@@ -8,6 +8,7 @@
module Git.LsFiles (
inRepo,
notInRepo,
+ allFiles,
deleted,
modified,
staged,
@@ -41,6 +42,11 @@ notInRepo include_ignored l repo = pipeNullSplit params repo
| include_ignored = []
| otherwise = [Param "--exclude-standard"]
+{- Finds all files in the specified locations, whether checked into git or
+ - not. -}
+allFiles :: [FilePath] -> Repo -> IO ([FilePath], IO Bool)
+allFiles l = pipeNullSplit $ Params "ls-files --cached --others -z --" : map File l
+
{- Returns a list of files in the specified locations that have been
- deleted. -}
deleted :: [FilePath] -> Repo -> IO ([FilePath], IO Bool)
diff --git a/debian/changelog b/debian/changelog
index 3101a99bd..571b4112e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,7 @@ git-annex (4.20130816) UNRELEASED; urgency=low
--duplicate, --deduplicate, and --clean-duplicates
* mirror: New command, makes two repositories contain the same set of files.
* Set --clobber when running wget to ensure resuming works properly.
+ * unused: Pay attention to symlinks that are not yet staged in the index.
-- Joey Hess <joeyh@debian.org> Thu, 15 Aug 2013 15:47:52 +0200