prevent find running in bare repo

This commit is contained in:
Joey Hess 2018-10-16 10:44:09 -04:00
parent 62afca598d
commit 40dba8e933
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 14 additions and 1 deletions

View file

@ -18,7 +18,7 @@ import qualified Utility.Format
import Utility.DataUnits
cmd :: Command
cmd = withGlobalOptions [annexedMatchingOptions] $ mkCommand $
cmd = notBareRepo $ withGlobalOptions [annexedMatchingOptions] $ mkCommand $
command "find" SectionQuery "lists available files"
paramPaths (seek <$$> optParser)

View file

@ -0,0 +1,13 @@
[[!comment format=mdwn
username="joey"
subject="""comment 2"""
date="2018-10-16T14:40:57Z"
content="""
You can use `git annex findref master` in a bare repository, which is like
find but operates on some branch.
I am not convinced that find --all would really be that useful, since it
would have to display keys and not filenames, and find is all about displaying
filenames. I did make find error out in a bare repo rather than not doing
anything.
"""]]