Skip to content

Commit 746a33e

Browse files
tidy up unused code
1 parent 773a8ec commit 746a33e

File tree

3 files changed

+1
-23
lines changed

3 files changed

+1
-23
lines changed

cmd/g/integration_test.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ import (
55
"fmt"
66
"github.com/richardjennings/g"
77
"github.com/stretchr/testify/assert"
8-
"io/fs"
98
"os"
109
"path/filepath"
11-
"strings"
1210
"testing"
1311
"time"
1412
)
@@ -162,23 +160,6 @@ func testDir(t *testing.T) string {
162160
return dir
163161
}
164162

165-
func testListFiles(t *testing.T, path string, dirs bool) []string {
166-
var files []string
167-
if err := filepath.Walk(path, func(p string, info fs.FileInfo, err error) error {
168-
if p == path {
169-
return nil
170-
}
171-
if !dirs && info.IsDir() {
172-
return nil
173-
}
174-
files = append(files, strings.TrimPrefix(p, path+string(filepath.Separator)))
175-
return nil
176-
}); err != nil {
177-
t.Fatal(err)
178-
}
179-
return files
180-
}
181-
182163
func testAdd(t *testing.T, path string, numIdxFiles int) {
183164
if err := Add(path); err != nil {
184165
t.Fatal(err)

cmd/g/switch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func SwitchBranch(name string) error {
2424
return err
2525
}
2626
if len(errFiles) > 0 {
27-
return fmt.Errorf("error: The following untracked working tree files would be overwritten by checkout:\n\t%s\nPlease move or remove them before you switch branches.", strings.Join(errFiles, "\n\t"))
27+
return fmt.Errorf("the following untracked working tree files would be overwritten by checkout:\n\t%s\nplease move or remove them before you switch branches", strings.Join(errFiles, "\n\t"))
2828
}
2929
return nil
3030
}

object.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,6 @@ func readCommitter(b []byte, c *Commit) error {
650650
// Free-function shims — delegate to defaultRepo during migration.
651651
// ---------------------------------------------------------------------------
652652

653-
func objectPath(sha Sha) string { return defaultRepo.objectFilePath(sha) }
654653
func ObjectReadCloser(sha []byte) func() (io.ReadCloser, error) { return defaultRepo.objectReadCloser(sha) }
655654
func ReadObject(sha Sha) (*Object, error) { return defaultRepo.readObject(sha) }
656655
func ReadObjectTree(sha Sha) (*Object, error) { return defaultRepo.readObjectTree(sha) }
@@ -661,8 +660,6 @@ func WriteObject(header []byte, content []byte, contentFile string, path string)
661660
return defaultRepo.writeObject(header, content, contentFile, path)
662661
}
663662
func WriteBlob(path string) (*Object, error) { return defaultRepo.writeBlob(path) }
664-
func writeCommit(c *Commit) (Sha, error) { return defaultRepo.writeCommit(c) }
665-
func writeObjectToWorkingTree(sha Sha, path string) error { return defaultRepo.writeObjectToWorkingTree(sha, path) }
666663

667664
// WriteTree shim on Object — delegates to defaultRepo.
668665
func (o *Object) WriteTree() (Sha, error) { return defaultRepo.writeTreeRecursive(o) }

0 commit comments

Comments
 (0)