File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -24,15 +24,27 @@ julia> run(`$(git()) clone https://github.com/JuliaRegistries/General`)
2424
2525This can equivalently be written with explicitly split arguments as
2626
27- ```
27+ ``` julia
2828julia> run (git ([" clone" , " https://github.com/JuliaRegistries/General" ]))
2929```
3030
31- to bypass the parsing of the command string.
31+ to bypass the parsing of the command string. Of course, one can also do
3232
33- To read a single line of output from a git command you can use ` readchomp ` ,
33+ ``` julia
34+ julia> import Git
35+
36+ julia> const git = Git. git ()
3437
38+ julia> run (` $git clone https://github.com/JuliaRegistries/General` )
3539```
40+
41+ This is thread-safe since ` Cmd ` objects are not stateful. However, note that the
42+ ` git ` command object won't notice any changes to environmental variables
43+ (like ` GIT_CURL_VERBOSE ` for example) since it was created.
44+
45+ To read a single line of output from a git command you can use ` readchomp ` ,
46+
47+ ``` julia
3648julia> cd (" General" )
3749
3850julia> readchomp (` $(git ()) remote get-url origin` )
@@ -41,7 +53,7 @@ julia> readchomp(`$(git()) remote get-url origin`)
4153
4254and ` readlines ` for multiple lines.
4355
44- ```
56+ ``` julia
4557julia> readlines (` $(git ()) log` )
4658```
4759
You can’t perform that action at this time.
0 commit comments