This repository was archived by the owner on Jan 16, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ type syncCommand struct {
4747 NetworkOnly bool
4848 DetachHead bool
4949 CurrentBranchOnly bool
50+ CheckPublished bool
5051 Jobs int
5152 ManifestName string
5253 NoCache bool
@@ -105,6 +106,10 @@ func (v *syncCommand) Command() *cobra.Command {
105106 "c" ,
106107 false ,
107108 "fetch only current branch from server" )
109+ v .cmd .Flags ().BoolVar (& v .O .CheckPublished ,
110+ "check-published" ,
111+ false ,
112+ "do not sync project which is published but not merged" )
108113 v .cmd .Flags ().IntVarP (& v .O .Jobs ,
109114 "jobs" ,
110115 "j" ,
Original file line number Diff line number Diff line change @@ -23,9 +23,10 @@ import (
2323type CheckoutOptions struct {
2424 RepoSettings
2525
26- Quiet bool
27- DetachHead bool
28- IsManifest bool
26+ Quiet bool
27+ DetachHead bool
28+ IsManifest bool
29+ CheckPublished bool
2930}
3031
3132// IsClean indicates git worktree is clean.
@@ -300,7 +301,7 @@ func (v Project) SyncLocalHalf(o *CheckoutOptions) error {
300301 }
301302
302303 // Manifest project do not need to check publish ref.
303- if ! o .IsManifest {
304+ if ! o .IsManifest && o . CheckPublished {
304305 pubid := v .PublishedRevision (branch )
305306 // Local branched is published.
306307 if pubid != "" {
You can’t perform that action at this time.
0 commit comments