Skip to content

Commit 96220d8

Browse files
committed
Merge branch 'jc/fetch-progressive-stride'
* jc/fetch-progressive-stride: Fix potential local deadlock during fetch-pack
2 parents 2eee139 + 44d8dc5 commit 96220d8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

builtin/fetch-pack.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,16 +230,17 @@ static void insert_alternate_refs(void)
230230
}
231231

232232
#define INITIAL_FLUSH 16
233+
#define PIPESAFE_FLUSH 32
233234
#define LARGE_FLUSH 1024
234235

235236
static int next_flush(int count)
236237
{
237-
if (count < INITIAL_FLUSH * 2)
238-
count += INITIAL_FLUSH;
239-
else if (count < LARGE_FLUSH)
238+
int flush_limit = args.stateless_rpc ? LARGE_FLUSH : PIPESAFE_FLUSH;
239+
240+
if (count < flush_limit)
240241
count <<= 1;
241242
else
242-
count += LARGE_FLUSH;
243+
count += flush_limit;
243244
return count;
244245
}
245246

0 commit comments

Comments
 (0)