File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ func (cmd *PullCommand) Run(config *phrase.Config) error {
6868 target .Params .Branch = optional .NewString (cmd .Branch )
6969 }
7070
71- val , ok := localesCache [LocalesCacheKey {target .ProjectID , target .Params . Branch . Value ()}]
71+ val , ok := localesCache [LocalesCacheKey {target .ProjectID , target .GetBranch ()}]
7272 if ! ok || len (val ) == 0 {
7373 if cmd .Branch != "" {
7474 continue
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ type Targets []*Target
1818func (targets Targets ) GetAllLocalesCacheKeys () []LocalesCacheKey {
1919 localesCacheKeys := []LocalesCacheKey {}
2020 for _ , target := range targets {
21- localesCacheKeys = append (localesCacheKeys , LocalesCacheKey {target .ProjectID , target .Params . Branch . Value ()})
21+ localesCacheKeys = append (localesCacheKeys , LocalesCacheKey {target .ProjectID , target .GetBranch ()})
2222 }
2323 return localesCacheKeys
2424}
@@ -32,6 +32,13 @@ type Target struct {
3232 RemoteLocales []* phrase.Locale
3333}
3434
35+ func (target * Target ) GetBranch () string {
36+ if target .Params != nil {
37+ return target .Params .Branch .Value ()
38+ }
39+ return ""
40+ }
41+
3542func (target * Target ) CheckPreconditions () error {
3643 if err := paths .Validate (target .File , target .FileFormat , "" ); err != nil {
3744 return err
You can’t perform that action at this time.
0 commit comments