@@ -109,7 +109,7 @@ const defaultDirMode = os.FileMode(0775) // subject to umask
109
109
type repoSync struct {
110
110
cmd string // the git command to run
111
111
root absPath // absolute path to the root directory
112
- repo string // remote repo to sync
112
+ remoteRepo string // remote repo to sync
113
113
ref string // the ref to sync
114
114
depth int // for shallow sync
115
115
submodules submodulesMode // how to handle submodules
@@ -597,7 +597,7 @@ func main() {
597
597
git := & repoSync {
598
598
cmd : * flGitCmd ,
599
599
root : absRoot ,
600
- repo : * flRepo ,
600
+ remoteRepo : * flRepo ,
601
601
ref : * flRef ,
602
602
depth : * flDepth ,
603
603
submodules : submodulesMode (* flSubmodules ),
@@ -1104,12 +1104,12 @@ func (git *repoSync) initRepo(ctx context.Context) error {
1104
1104
return err
1105
1105
}
1106
1106
// It doesn't exist - make it.
1107
- if _ , _ , err := git .Run (ctx , git .root , "remote" , "add" , "origin" , git .repo ); err != nil {
1107
+ if _ , _ , err := git .Run (ctx , git .root , "remote" , "add" , "origin" , git .remoteRepo ); err != nil {
1108
1108
return err
1109
1109
}
1110
- } else if strings .TrimSpace (stdout ) != git .repo {
1110
+ } else if strings .TrimSpace (stdout ) != git .remoteRepo {
1111
1111
// It exists, but is wrong.
1112
- if _ , _ , err := git .Run (ctx , git .root , "remote" , "set-url" , "origin" , git .repo ); err != nil {
1112
+ if _ , _ , err := git .Run (ctx , git .root , "remote" , "set-url" , "origin" , git .remoteRepo ); err != nil {
1113
1113
return err
1114
1114
}
1115
1115
}
@@ -1535,7 +1535,7 @@ func (git *repoSync) currentWorktree() (worktree, error) {
1535
1535
// and tries to clean up any detritus. This function returns whether the
1536
1536
// current hash has changed and what the new hash is.
1537
1537
func (git * repoSync ) SyncRepo (ctx context.Context , refreshCreds func (context.Context ) error ) (bool , string , error ) {
1538
- git .log .V (3 ).Info ("syncing" , "repo" , git .repo )
1538
+ git .log .V (3 ).Info ("syncing" , "repo" , git .remoteRepo )
1539
1539
1540
1540
if err := refreshCreds (ctx ); err != nil {
1541
1541
return false , "" , fmt .Errorf ("credential refresh failed: %w" , err )
@@ -1660,11 +1660,11 @@ func (git *repoSync) SyncRepo(ctx context.Context, refreshCreds func(context.Con
1660
1660
1661
1661
// fetch retrieves the specified ref from the upstream repo.
1662
1662
func (git * repoSync ) fetch (ctx context.Context , ref string ) error {
1663
- git .log .V (2 ).Info ("fetching" , "ref" , ref , "repo" , git .repo )
1663
+ git .log .V (2 ).Info ("fetching" , "ref" , ref , "repo" , git .remoteRepo )
1664
1664
1665
1665
// Fetch the ref and do some cleanup, setting or un-setting the repo's
1666
1666
// shallow flag as appropriate.
1667
- args := []string {"fetch" , git .repo , ref , "--verbose" , "--no-progress" , "--prune" , "--no-auto-gc" }
1667
+ args := []string {"fetch" , git .remoteRepo , ref , "--verbose" , "--no-progress" , "--prune" , "--no-auto-gc" }
1668
1668
if git .depth > 0 {
1669
1669
args = append (args , "--depth" , strconv .Itoa (git .depth ))
1670
1670
} else {
@@ -1822,7 +1822,7 @@ func (git *repoSync) CallAskPassURL(ctx context.Context) error {
1822
1822
}
1823
1823
}
1824
1824
1825
- if err := git .StoreCredentials (ctx , git .repo , username , password ); err != nil {
1825
+ if err := git .StoreCredentials (ctx , git .remoteRepo , username , password ); err != nil {
1826
1826
return err
1827
1827
}
1828
1828
0 commit comments