Skip to content

Commit cc38894

Browse files
authored
Merge pull request #259 from LoopPerfect/fix/set-git-workdir
feat: set git-workdir instead of gitdir
2 parents 05461ef + b0995e2 commit cc38894

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

buckaroo/GitCli.fs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ type GitCli (console : ConsoleManager) =
3636
member this.LocalTags (repository : String) = async {
3737
let gitDir = repository
3838
let command =
39-
"--no-pager --git-dir=" + gitDir +
39+
"--no-pager -C " + gitDir +
4040
" tag"
4141
let! output = runBash(command)
4242

@@ -49,7 +49,7 @@ type GitCli (console : ConsoleManager) =
4949
member this.LocalBranches (repository : String) = async {
5050
let gitDir = repository
5151
let command =
52-
"git --no-pager --git-dir=" + gitDir +
52+
"git --no-pager -C " + gitDir +
5353
" branch"
5454
let! output = runBash(command)
5555

@@ -69,7 +69,7 @@ type GitCli (console : ConsoleManager) =
6969

7070
member this.HasCommit (gitPath : string) (revision : Revision) = async {
7171
let command =
72-
"git --no-pager --git-dir=" + gitPath +
72+
"git --no-pager -C " + gitPath +
7373
" log " + revision + " --pretty=format:'%H' -n0"
7474
let! result = runBash(command) |> Async.Catch
7575
return
@@ -79,7 +79,7 @@ type GitCli (console : ConsoleManager) =
7979
}
8080

8181
member this.DefaultBranch (gitPath : string) = async {
82-
let! result = runBash ("git --git-dir=" + gitPath + " symbolic-ref HEAD")
82+
let! result = runBash ("git -C " + gitPath + " symbolic-ref HEAD")
8383
return result.Trim()
8484
}
8585

@@ -92,13 +92,13 @@ type GitCli (console : ConsoleManager) =
9292

9393
member this.Unshallow (gitDir : string) = async {
9494
do!
95-
runBash ("git --git-dir=" + gitDir + " fetch --unshallow || true; git --git-dir=" + gitDir + " fetch origin '+refs/heads/*:refs/heads/*' '+refs/tags/*:refs/tags/*'")
95+
runBash ("git -C " + gitDir + " fetch --unshallow || true; git -C " + gitDir + " fetch origin '+refs/heads/*:refs/heads/*' '+refs/tags/*:refs/tags/*'")
9696
|> Async.Ignore
9797
}
9898

9999
member this.UpdateRefs (gitDir : string) = async {
100100
do!
101-
runBash ("git --git-dir=" + gitDir + " fetch origin '+refs/heads/*:refs/heads/*' '+refs/tags/*:refs/tags/*'")
101+
runBash ("git -C " + gitDir + " fetch origin '+refs/heads/*:refs/heads/*' '+refs/tags/*:refs/tags/*'")
102102
|> Async.Ignore
103103
}
104104

@@ -118,7 +118,7 @@ type GitCli (console : ConsoleManager) =
118118
member this.FetchBranch (repository : String) (branch : Branch) = async {
119119
let gitDir = repository
120120
let command =
121-
"git --no-pager --git-dir=" + gitDir +
121+
"git --no-pager -C " + gitDir +
122122
" fetch origin " + branch + ":" + branch
123123
do!
124124
runBash(command)
@@ -129,7 +129,7 @@ type GitCli (console : ConsoleManager) =
129129
do! (this :> IGit).FetchBranch repository branch
130130
let gitDir = repository
131131
let command =
132-
"git --no-pager --git-dir=" + gitDir +
132+
"git --no-pager -C " + gitDir +
133133
" log " + branch + " --pretty=format:'%H'"
134134
let! output = runBash(command)
135135
return
@@ -141,7 +141,7 @@ type GitCli (console : ConsoleManager) =
141141
member this.FetchCommit (repository : String) (commit : Revision) = async {
142142
let gitDir = repository
143143
let command =
144-
"git --git-dir=" + gitDir +
144+
"git -C " + gitDir +
145145
" fetch origin " + commit
146146
do!
147147
runBash(command)
@@ -151,7 +151,7 @@ type GitCli (console : ConsoleManager) =
151151
member this.FetchFile (repository : String) (commit : Revision) (path : String) = async {
152152
let gitDir = repository
153153
let command =
154-
"git --git-dir=" + gitDir +
154+
"git -C " + gitDir +
155155
" show " + commit + ":" + path
156156
return! runBash(command)
157157
}

0 commit comments

Comments
 (0)