Skip to content

Commit 538a05d

Browse files
committed
Remove uses of deprecated git_buf_free
1 parent 973938c commit 538a05d

File tree

10 files changed

+16
-16
lines changed

10 files changed

+16
-16
lines changed

branch.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ func (repo *Repository) RemoteName(canonicalBranchName string) (string, error) {
208208
if ret < 0 {
209209
return "", MakeGitError(ret)
210210
}
211-
defer C.git_buf_free(&nameBuf)
211+
defer C.git_buf_dispose(&nameBuf)
212212

213213
return C.GoString(nameBuf.ptr), nil
214214
}
@@ -256,7 +256,7 @@ func (repo *Repository) UpstreamName(canonicalBranchName string) (string, error)
256256
if ret < 0 {
257257
return "", MakeGitError(ret)
258258
}
259-
defer C.git_buf_free(&nameBuf)
259+
defer C.git_buf_dispose(&nameBuf)
260260

261261
return C.GoString(nameBuf.ptr), nil
262262
}

commit.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ func (c *Commit) RawMessage() string {
3737
func (c *Commit) ExtractSignature() (string, string, error) {
3838

3939
var c_signed C.git_buf
40-
defer C.git_buf_free(&c_signed)
40+
defer C.git_buf_dispose(&c_signed)
4141

4242
var c_signature C.git_buf
43-
defer C.git_buf_free(&c_signature)
43+
defer C.git_buf_dispose(&c_signature)
4444

4545
oid := c.Id()
4646
repo := C.git_commit_owner(c.cast_ptr)

config.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ func (c *Config) LookupString(name string) (string, error) {
134134
if ret < 0 {
135135
return "", MakeGitError(ret)
136136
}
137-
defer C.git_buf_free(&valBuf)
137+
defer C.git_buf_dispose(&valBuf)
138138

139139
return C.GoString(valBuf.ptr), nil
140140
}
@@ -390,7 +390,7 @@ func (iter *ConfigIterator) Free() {
390390

391391
func ConfigFindGlobal() (string, error) {
392392
var buf C.git_buf
393-
defer C.git_buf_free(&buf)
393+
defer C.git_buf_dispose(&buf)
394394

395395
runtime.LockOSThread()
396396
defer runtime.UnlockOSThread()
@@ -405,7 +405,7 @@ func ConfigFindGlobal() (string, error) {
405405

406406
func ConfigFindSystem() (string, error) {
407407
var buf C.git_buf
408-
defer C.git_buf_free(&buf)
408+
defer C.git_buf_dispose(&buf)
409409

410410
runtime.LockOSThread()
411411
defer runtime.UnlockOSThread()
@@ -420,7 +420,7 @@ func ConfigFindSystem() (string, error) {
420420

421421
func ConfigFindXDG() (string, error) {
422422
var buf C.git_buf
423-
defer C.git_buf_free(&buf)
423+
defer C.git_buf_dispose(&buf)
424424

425425
runtime.LockOSThread()
426426
defer runtime.UnlockOSThread()
@@ -438,7 +438,7 @@ func ConfigFindXDG() (string, error) {
438438
// Look for the file in %PROGRAMDATA%\Git\config used by portable git.
439439
func ConfigFindProgramdata() (string, error) {
440440
var buf C.git_buf
441-
defer C.git_buf_free(&buf)
441+
defer C.git_buf_dispose(&buf)
442442

443443
runtime.LockOSThread()
444444
defer runtime.UnlockOSThread()

describe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ func (result *DescribeResult) Format(opts *DescribeFormatOptions) (string, error
212212
if ecode < 0 {
213213
return "", MakeGitError(ecode)
214214
}
215-
defer C.git_buf_free(&resultBuf)
215+
defer C.git_buf_dispose(&resultBuf)
216216

217217
return C.GoString(resultBuf.ptr), nil
218218
}

diff.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ const (
246246
func (stats *DiffStats) String(format DiffStatsFormat,
247247
width uint) (string, error) {
248248
buf := C.git_buf{}
249-
defer C.git_buf_free(&buf)
249+
defer C.git_buf_dispose(&buf)
250250

251251
runtime.LockOSThread()
252252
defer runtime.UnlockOSThread()

git.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ func Discover(start string, across_fs bool, ceiling_dirs []string) (string, erro
309309
defer C.free(unsafe.Pointer(cstart))
310310

311311
var buf C.git_buf
312-
defer C.git_buf_free(&buf)
312+
defer C.git_buf_dispose(&buf)
313313

314314
runtime.LockOSThread()
315315
defer runtime.UnlockOSThread()

note.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func (c *NoteCollection) DefaultRef() (string, error) {
132132
}
133133

134134
ret := C.GoString(buf.ptr)
135-
C.git_buf_free(&buf)
135+
C.git_buf_dispose(&buf)
136136

137137
return ret, nil
138138
}

object.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func (o *Object) ShortId() (string, error) {
6767
if ecode < 0 {
6868
return "", MakeGitError(ecode)
6969
}
70-
defer C.git_buf_free(&resultBuf)
70+
defer C.git_buf_dispose(&resultBuf)
7171
return C.GoString(resultBuf.ptr), nil
7272
}
7373

patch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func (patch *Patch) String() (string, error) {
5151
if ecode < 0 {
5252
return "", MakeGitError(ecode)
5353
}
54-
defer C.git_buf_free(&buf)
54+
defer C.git_buf_dispose(&buf)
5555

5656
return C.GoString(buf.ptr), nil
5757
}

settings.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import (
3131

3232
func SearchPath(level ConfigLevel) (string, error) {
3333
var buf C.git_buf
34-
defer C.git_buf_free(&buf)
34+
defer C.git_buf_dispose(&buf)
3535

3636
runtime.LockOSThread()
3737
defer runtime.UnlockOSThread()

0 commit comments

Comments
 (0)