summaryrefslogtreecommitdiff
path: root/doPull.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-01-28 21:50:07 -0600
committerJeff Carr <[email protected]>2025-01-29 12:18:16 -0600
commit438a8812f6cbd83556ad2d146068e8eca37ca2f4 (patch)
treee7012823f56b3237f19b358ef5b9f206230f9c4c /doPull.go
parenteee88af0ce0afd82046985572d2bea0090c7e087 (diff)
smarter git pull
Diffstat (limited to 'doPull.go')
-rw-r--r--doPull.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/doPull.go b/doPull.go
index 41e7815..93e9c0b 100644
--- a/doPull.go
+++ b/doPull.go
@@ -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")