### Introduction

This should work right, or did the syntax change:

```bash
❯ go run ./cmd/git-sync sync
```

Flags:
- `--protocol v2`
- `--measure-memory`
- `-v`
- `--target-username git`
- `--target-insecure-skip-tls-verify`
- `--tags`

Example URLs:
- [Kubernetes Repo](https://github.com/kubernetes/kubernetes.git)
- [Local Target](https://localhost:8080/git/test/git-sync-smoke-8)

### Error Message

```plaintext
error: list target refs: pkt-line 1: cannot read hash, pkt-line too short (# service=git-receive-pack)
exit status 1
```

### Debugging Steps

1. Checking the current CLI and sync path in this repo.
2. Tracing the origin of the `git-receive-pack` pkt-line error to determine if it's due to syntax or protocol behavior.
3. Confirming that flags are still valid and checking for target ref discovery issues.

### Additional Details

- The target is always queried via v1 `receive-pack` discovery regardless of `--protocol v2` applied to the source side.
- Issue may stem from unexpected `info/refs?service=git-receive-pack` responses.
- Valid command syntax confirmed; however, further checks needed on the target endpoint handling.

### Notes on Workflows

- It's important to ensure that the target URL points to a valid Git smart-HTTP endpoint.
- Likewise, checking that authentication for the target repo is configured properly is crucial.

### Candidate Changes to Investigate

1. **Target Discovery:** Inspect changes in the target discovery mechanism following codebase rewrites.
2. **Decoder Logic:** Ensure the decoding logic is robust against empty or unexpected advertisement shapes.

### Conclusion

If issues persist regarding the target `receive-pack` advertisement, logging improvements should be implemented to show the first bytes of any malformed response to expedite debugging.
