-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve tests by using temporary Git config
Adds a test fixture that generates a .gitconfig file within a temporary folder for each test. This ensures that the user running the test doesn't have their global Git config changed under them. Also removes `go-homedir` in favour of stdlib.
- Loading branch information
Showing
5 changed files
with
118 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,19 +4,7 @@ | |
|
||
## Usage | ||
|
||
Set a `GETPATH` with `git config` or use the default of `~/src` | ||
|
||
```console | ||
$ git config --global get.path "~/src" | ||
``` | ||
|
||
The environmental variable `$GETPATH` may also be set: | ||
|
||
```shell | ||
export GETPATH=~/src | ||
``` | ||
|
||
Get a repository. | ||
Get a repository to `~/src` | ||
|
||
```console | ||
$ git get github.com/arbourd/git-get | ||
|
@@ -29,6 +17,18 @@ $ git get [email protected]:arbourd/git-get.git | |
~/src/github.com/arbourd/git-get | ||
``` | ||
|
||
Set a custom `GETPATH` with `git config`. | ||
|
||
```console | ||
$ git config --global get.path "~/dev" | ||
``` | ||
|
||
Set a custom `GETPATH` with the environmental variable `$GETPATH`. | ||
|
||
```shell | ||
export GETPATH=~/dev | ||
``` | ||
|
||
### Using SSH as the default | ||
|
||
By default, when getting a repository without specifying a protocol (eg: github.com/arbourd/git-get) HTTPS will be used. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
github.com/ldez/go-git-cmd-wrapper/v2 v2.6.0 h1:o5QIusOiH9phm1gY2UGO6JQjYSPFYbgFCcntOigBvMg= | ||
github.com/ldez/go-git-cmd-wrapper/v2 v2.6.0/go.mod h1:whnaSah+AmezZS8vwp8FyFzEBHZCLKywWILUj5D8Jq0= | ||
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= | ||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= |