1
1
mirror of https://github.com/cooperspencer/gickup synced 2024-11-08 12:09:18 +01:00

Issue 200 (#203)

* force fetch

* do not fetch

* log push

* log clone too
This commit is contained in:
Andreas Wachter 2024-01-29 12:31:36 +01:00 committed by GitHub
parent 4f6317326a
commit 76bcf763aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

@ -470,6 +470,7 @@ func TempClone(repo types.Repo, tempdir string) (*git.Repository, error) {
err = r.Fetch(&git.FetchOptions{
RefSpecs: []config.RefSpec{"refs/*:refs/*"},
Auth: auth,
Force: true,
})
if err == git.NoErrAlreadyUpToDate {
return r, nil

@ -253,6 +253,7 @@ func backup(repos []types.Repo, conf *types.Conf) {
log.Error().
Str("stage", "tempclone").
Str("url", r.URL).
Str("git", "clone").
Msg(err.Error())
os.RemoveAll(tempdir)
continue
@ -280,6 +281,7 @@ func backup(repos []types.Repo, conf *types.Conf) {
log.Error().
Str("stage", "github").
Str("url", r.URL).
Str("git", "push").
Msg(err.Error())
os.RemoveAll(tempdir)
continue