Commit Graph

7 Commits

Author SHA1 Message Date
Taylor Blau
ab9842c3f9 commands: use config's GetenvBool, add tests 2016-07-21 10:38:59 -06:00
Taylor Blau
36b0664fe0 commands/test: make lock commands opt-in using GITLFSLOCKSENABLED=1
To prepare for the upcoming release of Git LFS v1.3, the `git-lfs lock` and
`git-lfs locks` commands are now hidden behind a enviornment variable
`GITLFSLOCKSENABLED`. Since most (all?) implementations of LFS do not yet
support this new locking API, it makes sense to allow users to experiment with
the command while at the same time, not making it a "full" part of the release.

If users wish to run any `git-lfs lock{,s}` command, they may do so according
to the following:

```
$ GITLFSLOCKSEANBLED=1 git lfs lock <flags> [args]
$ GITLFSLOCKSEANBLED=1 git lfs locks <flags> [args]
```

This commit, when applied, adds two new things:

1. The `isCommandEnabled(cmd string) bool` func in the commands package. This
   new func checks the OS's enviornment variables and determines whether or not
   a command is "enabled".

2. Updates the `lock` and `locks` tests to use the
   GITLFSLOCKSENABLED=1 flag such that they are able to run.

Since the `isCommandEnabled` func defaults to "false", it should only guard
commands which are deemed "experimental", as noted in the godoc.
2016-07-21 10:07:06 -06:00
Taylor Blau
8fb44158b5 locks: path formatting changes
* strip leading slash from paths
* disallow directory locking (+ test)
2016-06-04 11:26:36 -06:00
Taylor Blau
21b92381f4 commands/lock: properly trim prefix from lock path 2016-06-03 14:59:13 -06:00
Taylor Blau
36804efc84 commands_{lock,locks,unlock}: implement lockPath for great good 2016-06-03 09:22:20 -06:00
Taylor Blau
fad308366f commands_{lock,locks,unlock}: allow custom --remote specification 2016-06-03 09:22:20 -06:00
Taylor Blau
2680afc34a commands_{lock,unlock,locks}: implement lock commands 2016-06-03 09:22:19 -06:00