view: Refuse to enter a view when no branch is currently checked out.
This commit is contained in:
parent
06e39e6a79
commit
0ac8912f9c
2 changed files with 5 additions and 6 deletions
|
@ -45,13 +45,11 @@ paramView :: String
|
||||||
paramView = paramPair (paramRepeating "TAG") (paramRepeating "FIELD=VALUE")
|
paramView = paramPair (paramRepeating "TAG") (paramRepeating "FIELD=VALUE")
|
||||||
|
|
||||||
mkView :: [String] -> Annex View
|
mkView :: [String] -> Annex View
|
||||||
mkView params = do
|
mkView params = go =<< inRepo Git.Branch.current
|
||||||
v <- View <$> viewbranch <*> pure []
|
|
||||||
return $ fst $ refineView v $
|
|
||||||
map parseViewParam $ reverse params
|
|
||||||
where
|
where
|
||||||
viewbranch = fromMaybe (error "not on any branch!")
|
go Nothing = error "not on any branch!"
|
||||||
<$> inRepo Git.Branch.current
|
go (Just b) = return $ fst $ refineView (View b []) $
|
||||||
|
map parseViewParam $ reverse params
|
||||||
|
|
||||||
checkoutViewBranch :: View -> (View -> Annex Git.Branch) -> CommandCleanup
|
checkoutViewBranch :: View -> (View -> Annex Git.Branch) -> CommandCleanup
|
||||||
checkoutViewBranch view mkbranch = do
|
checkoutViewBranch view mkbranch = do
|
||||||
|
|
1
debian/changelog
vendored
1
debian/changelog
vendored
|
@ -15,6 +15,7 @@ git-annex (5.20140228) UNRELEASED; urgency=medium
|
||||||
* view, vfilter: Add support for filtering tags and values out of a view,
|
* view, vfilter: Add support for filtering tags and values out of a view,
|
||||||
using !tag and field!=value.
|
using !tag and field!=value.
|
||||||
* vadd: Allow listing multiple desired values for a field.
|
* vadd: Allow listing multiple desired values for a field.
|
||||||
|
* view: Refuse to enter a view when no branch is currently checked out.
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Fri, 28 Feb 2014 14:52:15 -0400
|
-- Joey Hess <joeyh@debian.org> Fri, 28 Feb 2014 14:52:15 -0400
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue