Skip to content

Commit dfe0171

Browse files
committed
Merge branch 'jn/maint-bundle'
* jn/maint-bundle: fix "bundle --stdin" segfault t5704 (bundle): add tests for bundle --stdin
2 parents 4d54494 + 97a20ee commit dfe0171

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

object.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,10 @@ void add_object_array_with_mode(struct object *obj, const char *name, struct obj
252252

253253
void object_array_remove_duplicates(struct object_array *array)
254254
{
255-
int ref, src, dst;
255+
unsigned int ref, src, dst;
256256
struct object_array_entry *objects = array->objects;
257257

258-
for (ref = 0; ref < array->nr - 1; ref++) {
258+
for (ref = 0; ref + 1 < array->nr; ref++) {
259259
for (src = ref + 1, dst = src;
260260
src < array->nr;
261261
src++) {

t/t5704-bundle.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,20 @@ test_expect_success 'tags can be excluded by rev-list options' '
3030
3131
'
3232

33+
test_expect_failure 'bundle --stdin' '
34+
35+
echo master | git bundle create stdin-bundle.bdl --stdin &&
36+
git ls-remote stdin-bundle.bdl >output &&
37+
grep master output
38+
39+
'
40+
41+
test_expect_failure 'bundle --stdin <rev-list options>' '
42+
43+
echo master | git bundle create hybrid-bundle.bdl --stdin tag &&
44+
git ls-remote hybrid-bundle.bdl >output &&
45+
grep master output
46+
47+
'
48+
3349
test_done

0 commit comments

Comments
 (0)