Skip to content

Commit

Permalink
Fix docs for static methods
Browse files Browse the repository at this point in the history
The three static operations, clone/open/init showed examples using an
instance grgit instead of calling via the class Grgit. This can
mislead users and result in NPEs if they're trying to use it with
org.ajoberstar.grgit for a project without a git repo.

Fixes #372
  • Loading branch information
ajoberstar committed Sep 17, 2022
1 parent 1cb8ff0 commit e780a05
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/modules/ROOT/pages/grgit-clone.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ grgit-clone - Clone a repository into a new directory

[source, groovy]
----
grgit.clone(dir: <path>, uri: <path or uri>, remote: <name>, all: <boolean>,
Grgit.clone(dir: <path>, uri: <path or uri>, remote: <name>, all: <boolean>,
bare: <boolean>, branches: <full refs>, checkout: <boolean>,
refToCheckout: <name>, credentials: <credentials>)
----

[source, groovy]
----
grgit.clone {
Grgit.clone {
dir = <path>
uri = <path or uri>
remote = <name>
Expand Down
4 changes: 2 additions & 2 deletions docs/modules/ROOT/pages/grgit-init.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ grgit-init - Create an empty Git repository

[source, groovy]
----
grgit.init(dir: <path>, bare: <boolean>)
Grgit.init(dir: <path>, bare: <boolean>)
----

[source, groovy]
----
grgit.init {
Grgit.init {
dir = <path>
bare = <boolean>
}
Expand Down
6 changes: 3 additions & 3 deletions docs/modules/ROOT/pages/grgit-open.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ grgit-open - Open an existing Git repository

[source, groovy]
----
grgit.open()
Grgit.open()
----

[source, groovy]
----
grgit.open(dir: <path>, currentDir: <path>, credentials: <credentials>)
Grgit.open(dir: <path>, currentDir: <path>, credentials: <credentials>)
----

[source, groovy]
----
grgit.open {
Grgit.open {
dir = <path>
currentDir = <path>
credentials = <credentals>
Expand Down

0 comments on commit e780a05

Please sign in to comment.