Skip to content

Commit 6d26918

Browse files
committed
handle sync error
Signed-off-by: Andrew Thornton <[email protected]>
1 parent 6664940 commit 6d26918

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

modules/git/repo_attribute.go

+7-3
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,13 @@ func (c *CheckAttributeReader) CheckPath(path string) (map[string]string, error)
176176
return nil, c.ctx.Err()
177177
case <-c.running:
178178
}
179-
_, err := c.stdinWriter.Write([]byte(path + "\x00"))
180-
_ = c.stdinWriter.Sync()
181-
if err != nil {
179+
180+
if _, err := c.stdinWriter.Write([]byte(path + "\x00")); err != nil {
181+
defer c.cancel()
182+
return nil, err
183+
}
184+
185+
if err := c.stdinWriter.Sync(); err != nil {
182186
defer c.cancel()
183187
return nil, err
184188
}

0 commit comments

Comments
 (0)