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`)
24
24
25
25
This can equivalently be written with explicitly split arguments as
26
26
27
- ```
27
+ ``` julia
28
28
julia> run (git ([" clone" , " https://github.com/JuliaRegistries/General" ]))
29
29
```
30
30
31
- to bypass the parsing of the command string.
31
+ to bypass the parsing of the command string. Of course, one can also do
32
32
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 ()
34
37
38
+ julia> run (` $git clone https://github.com/JuliaRegistries/General` )
35
39
```
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
36
48
julia> cd (" General" )
37
49
38
50
julia> readchomp (` $(git ()) remote get-url origin` )
@@ -41,7 +53,7 @@ julia> readchomp(`$(git()) remote get-url origin`)
41
53
42
54
and ` readlines ` for multiple lines.
43
55
44
- ```
56
+ ``` julia
45
57
julia> readlines (` $(git ()) log` )
46
58
```
47
59
You can’t perform that action at this time.
0 commit comments