Skip to content

Git Sync v4.4.0 sync error with one-time and HEAD #944

@AlanZhang2002

Description

@AlanZhang2002

Hello!

{"logger":"","ts":"2025-04-28 23:19:03.199264","caller":{"file":"main.go","line":626},"level":0,"msg":"starting up","version":"v4.4.0","pid":14,"uid":65533,"gid":65533,"home":"/tmp","flags":[]}                  │
│ {"logger":"","ts":"2025-04-28 23:19:03.199411","caller":{"file":"main.go","line":663},"level":0,"msg":"normalized root path","root":"/git/src/","result":"/git/src"}                                               │
│ {"logger":"","ts":"2025-04-28 23:19:03.200899","caller":{"file":"main.go","line":731},"level":0,"msg":"git version","version":"git version 2.39.5"}                                                                │
│ {"logger":"","ts":"2025-04-28 23:19:06.128665","caller":{"file":"main.go","line":1775},"level":0,"msg":"update required","ref":"HEAD","local":"f6c7eeaf26e32d86140c7e5d18e8f49b111e3f65","remote":"f6c7eeaf26e32d8 │
│ 6140c7e5d18e8f49b111e3f65","syncCount":0}                                                                                                                                                                          │
│ {"logger":"","ts":"2025-04-28 23:19:06.141481","caller":{"file":"main.go","line":924},"msg":"too many failures, aborting","error":"Run(git reset --soft f6c7eeaf26e32d86140c7e5d18e8f49b111e3f65): exit status 128 │
│ : { stdout: \"\", stderr: \"fatal: ambiguous argument 'f6c7eeaf26e32d86140c7e5d18e8f49b111e3f65': both revision and filename\\nUse '--' to separate paths from revisions, like this:\\n'git <command> [<revision>. │
│ ..] -- [<file>...]'\" }","failCount":1}

On v4.4.0, I've set up git-sync to sync on HEAD with GITSYNC_ONE_TIME set to true within a K8 Job, but am getting this error related to git reset. I'm not sure if it is intended for it to try to sync when it is on the same commit hash, or if there is something else going on. There's no file in the repo with the same name as the commit hash, HEAD, or the HEAD branch name. Should the reset command be updated to fix, as suggested by the error message? Setting it to sync on a different commit has no issue, but syncing on HEAD, the commit hash itself, or the HEAD branch name all fails with the same error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions