Skip to content

Commit

Permalink
Rename acquire-repository command to clone-repository
Browse files Browse the repository at this point in the history
  • Loading branch information
extsoft committed Jul 25, 2019
1 parent 3b99078 commit da7152b
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Also, there are several optional addons which can be useful in some circumstance

#### Test name template
Use the following test name template - `'<command args>': <describe what will be tested>` like
`'acquire-repository': raise an error if cloneable URL isn't set`.
`'clone-repository': raise an error if cloneable URL isn't set`.

### Documentation preview
In order to get the documentation preview locally, please install required dependencies with
Expand Down
19 changes: 15 additions & 4 deletions docs/commands.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
`git elegant <command>` where `<command>` is one of

- `clone-repository`
- `start-work`
- `save-work`
- `deliver-work`
- `accept-work`
- `pull`
- `init`
- `acquire-repository`
- `add`
- `clear-local`
- `configure-repository`
- `check`
- `save`

# `clone-repository`
Clones a repository into a new directory and runs its configuration.

```bash
usage: git elegant clone-repository <URL>
```

A sequence of original `git` commands:
```bash
git clone <URL>
cd <repo root directory>
# execute commands provided by `git elegant configure-repository`
```

# `start-work`
Creates a new local branch based on latest version of `master`. If there are some uncommitted
changes, they will be moved to the new branch.
Expand Down Expand Up @@ -83,9 +97,6 @@ Downloads new updates for a local branch.
# `init`
Creates an empty Git repository or reinitialize an existing one. Then runs local repository configuration.

# `acquire-repository`
Clone a repository into a new directory. Then runs local repository configuration.

# `add`
Adds file contents to the index interactively.

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion libexec/git-elegant-commands
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
set -e

default() {
echo "clone-repository"
echo "start-work"
echo "save-work"
echo "deliver-work"
echo "accept-work"
echo "pull"
echo "init"
echo "acquire-repository"
echo "add"
echo "clear-local"
echo "configure-repository"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ load addons-cd
load addons-fake

setup() {
fake-pass git acquire-repository
fake-pass git clone-repository
fake-pass git "clone https://github.com/extsoft/elegant-git.git"
fake-pass git "elegant configure-repository"
}
Expand All @@ -15,12 +15,12 @@ teardown() {
clean-fake
}

@test "'acquire-repository': raise an error if cloneable URL isn't set" {
check git-elegant acquire-repository
@test "'clone-repository': raise an error if cloneable URL isn't set" {
check git-elegant clone-repository
[[ "${lines[0]}" =~ "Cloneable URL is not set" ]]
}

@test "'acquire-repository': clone the repo" {
check git-elegant acquire-repository https://github.com/extsoft/elegant-git.git
@test "'clone-repository': clone the repo" {
check git-elegant clone-repository https://github.com/extsoft/elegant-git.git
[ "$status" -eq 0 ]
}
2 changes: 1 addition & 1 deletion tests/git-elegant-commands.bats
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ teardown() {

@test "'commands': print all available commands" {
COMMANDS=(
"clone-repository"
"start-work"
"save-work"
"deliver-work"
"accept-work"
"pull"
"init"
"acquire-repository"
"add"
"clear-local"
"configure-repository"
Expand Down

0 comments on commit da7152b

Please sign in to comment.