Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Commit 7cfca5b

Browse files
authored
Merge pull request #326 from carolynvs/rename-repo-to-source
Rename the lock field "repo" to "source"
2 parents 55422bc + 6ae7723 commit 7cfca5b

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

lock.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ type rawLock struct {
2828
}
2929

3030
type lockedDep struct {
31-
Name string `json:"name"`
32-
Version string `json:"version,omitempty"`
33-
Branch string `json:"branch,omitempty"`
34-
Revision string `json:"revision"`
35-
Repository string `json:"repo,omitempty"`
36-
Packages []string `json:"packages"`
31+
Name string `json:"name"`
32+
Version string `json:"version,omitempty"`
33+
Branch string `json:"branch,omitempty"`
34+
Revision string `json:"revision"`
35+
Source string `json:"source,omitempty"`
36+
Packages []string `json:"packages"`
3737
}
3838

3939
func readLock(r io.Reader) (*Lock, error) {
@@ -69,7 +69,7 @@ func readLock(r io.Reader) (*Lock, error) {
6969

7070
id := gps.ProjectIdentifier{
7171
ProjectRoot: gps.ProjectRoot(ld.Name),
72-
Source: ld.Repository,
72+
Source: ld.Source,
7373
}
7474
l.P[i] = gps.NewLockedProject(id, v, ld.Packages)
7575
}
@@ -96,9 +96,9 @@ func (l *Lock) MarshalJSON() ([]byte, error) {
9696
for k, lp := range l.P {
9797
id := lp.Ident()
9898
ld := lockedDep{
99-
Name: string(id.ProjectRoot),
100-
Repository: id.Source,
101-
Packages: lp.Packages(),
99+
Name: string(id.ProjectRoot),
100+
Source: id.Source,
101+
Packages: lp.Packages(),
102102
}
103103

104104
v := lp.Version()

test_project_context_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func NewTestProjectContext(h *test.Helper, projectName string) *TestProjectConte
3535
h.Cd(pc.Project.AbsRoot)
3636
h.Setenv("GOPATH", pc.tempDir)
3737

38-
// Setup a Source Manager
38+
// Set up a Source Manager
3939
var err error
4040
pc.Context = &Ctx{GOPATH: pc.tempDir}
4141
pc.SourceManager, err = pc.Context.SourceManager()

testdata/txn_writer/expected_diff_output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Remove: [
2121
Modify: [
2222
{
2323
"name": "github.com/foo/bar",
24-
"repo": "+ http://github.example.com/foo/bar",
24+
"source": "+ http://github.example.com/foo/bar",
2525
"version": "+ 1.2.0",
2626
"branch": "- master",
2727
"revision": "f24338400f072ef18125ae0fbe6b06fe6d1783e7 -> 2a3a211e171803acb82d1d5d42ceb53228f51751",

testdata/txn_writer/updated_lock.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"projects": [
44
{
55
"name": "github.com/foo/bar",
6-
"repo": "http://github.example.com/foo/bar",
6+
"source": "http://github.example.com/foo/bar",
77
"version": "1.2.0",
88
"revision": "2a3a211e171803acb82d1d5d42ceb53228f51751",
99
"packages": [

txn_writer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func (diff *LockDiff) Format() (string, error) {
112112
// TODO(carolynvs) this should be moved to gps
113113
type LockedProjectDiff struct {
114114
Name gps.ProjectRoot `json:"name"`
115-
Source *StringDiff `json:"repo,omitempty"`
115+
Source *StringDiff `json:"source,omitempty"`
116116
Version *StringDiff `json:"version,omitempty"`
117117
Branch *StringDiff `json:"branch,omitempty"`
118118
Revision *StringDiff `json:"revision,omitempty"`

0 commit comments

Comments
 (0)