diff options
| author | Jeff Carr <[email protected]> | 2025-01-28 21:50:07 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-01-29 12:18:16 -0600 |
| commit | 438a8812f6cbd83556ad2d146068e8eca37ca2f4 (patch) | |
| tree | e7012823f56b3237f19b358ef5b9f206230f9c4c /doPull.go | |
| parent | eee88af0ce0afd82046985572d2bea0090c7e087 (diff) | |
smarter git pull
Diffstat (limited to 'doPull.go')
| -rw-r--r-- | doPull.go | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -14,12 +14,19 @@ func rillPull(repo *gitpb.Repo) error { return nil } t, _ := repo.LastGitPull() - if time.Since(t) < time.Minute*10 { + if time.Since(t) < time.Minute*10 && !argv.Force { if argv.Verbose { log.Info(repo.GetFullPath(), "git pulled too recently", shell.FormatDuration(time.Since(t))) } return nil } + cur := repo.GetCurrentBranchName() + if !repo.IsBranchRemote(cur) { + if argv.Verbose { + log.Info(repo.GetFullPath(), "branch is not remote", cur) + } + return nil + } var cmd []string cmd = append(cmd, "git", "pull") |
