# Close pack streams on push preflight errors

`6c10774`→[main](/content/gh/entireio/git-sync/commits/main/index.html)·

Soph·3mo ago·3 files·+5 added/-0 removed

## Sessions

a66d4355d81dView transcript

## Changes

3

- docs

- Mrewrite-issue-list.md+1

- internal/gitproto

- Mpush.go+1

- Mpush_test.go+3

```
158 unmodified lines

159
160
161
162
163
164
165

158 unmodified lines

- Ownership of stream lifecycle is clearer than on `main`, and the rewrite now has direct tests for key pack-stream close behavior on success and error paths.
- Direct strategy-level error-path tests now verify that relay bootstrap and incremental paths close source pack streams when pushes fail.
- Batched integration coverage now also exercises a failed checkpoint pack push followed by a resume-from-temp-ref retry.
- Lower-level `gitproto.PushPack` rejection paths now also close the provided pack stream instead of leaking it on preflight command errors.
- This still wants a fuller close-audit around lower-level transport interruption paths before it should be considered fully done.

### 6. Protocol v2 tag fetches request `include-tag` without capability gating
```

Mdocs/rewrite-issue-list.md+1

```
181 unmodified lines

182
183
184
185
186
187
188

181 unmodified lines

) error {
	for _, cmd := range commands {
		if cmd.Delete {
			_ = pack.Close()
			return fmt.Errorf("pack push only supports create and update actions")
		}
	}
```

Minternal/gitproto/push.go+1

```
216 unmodified lines

217
218
219
220
221
222
223
224
225

216 unmodified lines

if err == nil {
		t.Fatal("expected error for delete in pack push")
	}
	if !pack.closed {
		t.Fatal("expected pack to be closed when delete commands are rejected")
	}
}

type trackingReadCloser struct {
