From 40dba8e9330243cb57e83771719852c2906bb27b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 16 Oct 2018 10:44:09 -0400 Subject: [PATCH] prevent find running in bare repo --- Command/Find.hs | 2 +- ...ment_2_191421867cc01ab920071d13ebcb6293._comment | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 doc/git-annex-find/comment_2_191421867cc01ab920071d13ebcb6293._comment diff --git a/Command/Find.hs b/Command/Find.hs index ab4707c910..46b8d98038 100644 --- a/Command/Find.hs +++ b/Command/Find.hs @@ -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) diff --git a/doc/git-annex-find/comment_2_191421867cc01ab920071d13ebcb6293._comment b/doc/git-annex-find/comment_2_191421867cc01ab920071d13ebcb6293._comment new file mode 100644 index 0000000000..1953649058 --- /dev/null +++ b/doc/git-annex-find/comment_2_191421867cc01ab920071d13ebcb6293._comment @@ -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. +"""]]