lock: Require --force.
This commit is contained in:
parent
139c4c3a9f
commit
cde099fe80
3 changed files with 6 additions and 0 deletions
|
@ -10,6 +10,7 @@ module Command.Lock where
|
||||||
import Common.Annex
|
import Common.Annex
|
||||||
import Command
|
import Command
|
||||||
import qualified Annex.Queue
|
import qualified Annex.Queue
|
||||||
|
import qualified Annex
|
||||||
|
|
||||||
def :: [Command]
|
def :: [Command]
|
||||||
def = [notDirect $ command "lock" paramPaths seek SectionCommon
|
def = [notDirect $ command "lock" paramPaths seek SectionCommon
|
||||||
|
@ -21,6 +22,8 @@ seek = [withFilesUnlocked start, withFilesUnlockedToBeCommitted start]
|
||||||
start :: FilePath -> CommandStart
|
start :: FilePath -> CommandStart
|
||||||
start file = do
|
start file = do
|
||||||
showStart "lock" file
|
showStart "lock" file
|
||||||
|
unlessM (Annex.getState Annex.force) $
|
||||||
|
error "Locking this file would discard any changes you have made to it. Use 'git annex add' to stage your changes. (Or, use --force to override)"
|
||||||
next $ perform file
|
next $ perform file
|
||||||
|
|
||||||
perform :: FilePath -> CommandPerform
|
perform :: FilePath -> CommandPerform
|
||||||
|
|
1
debian/changelog
vendored
1
debian/changelog
vendored
|
@ -16,6 +16,7 @@ git-annex (5.20131131) UNRELEASED; urgency=low
|
||||||
command to find DNS server, since there is no resolv.conf.
|
command to find DNS server, since there is no resolv.conf.
|
||||||
* import: Add --skip-duplicates option.
|
* import: Add --skip-duplicates option.
|
||||||
* Windows: watch and assistant work! (very experimental)
|
* Windows: watch and assistant work! (very experimental)
|
||||||
|
* lock: Require --force.
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Sun, 01 Dec 2013 13:57:58 -0400
|
-- Joey Hess <joeyh@debian.org> Sun, 01 Dec 2013 13:57:58 -0400
|
||||||
|
|
||||||
|
|
|
@ -15,3 +15,5 @@ If you want my opinion, `git annex lock` should either require `-f` to throw awa
|
||||||
### What version of git-annex are you using? On what operating system?
|
### What version of git-annex are you using? On what operating system?
|
||||||
|
|
||||||
git version 1.8.1.2, git-annex version: 4.20130815, Kubuntu 13.04
|
git version 1.8.1.2, git-annex version: 4.20130815, Kubuntu 13.04
|
||||||
|
|
||||||
|
> Agreed; [[done]] --[[Joey]]
|
||||||
|
|
Loading…
Add table
Reference in a new issue