t / t5704-bundle.shon commit bundle: use a strbuf to scan the log for boundary commits (bc2fed4)
   1#!/bin/sh
   2
   3test_description='some bundle related tests'
   4. ./test-lib.sh
   5
   6test_expect_success 'setup' '
   7
   8        : > file &&
   9        git add file &&
  10        test_tick &&
  11        git commit -m initial &&
  12        test_tick &&
  13        git tag -m tag tag &&
  14        : > file2 &&
  15        git add file2 &&
  16        : > file3 &&
  17        test_tick &&
  18        git commit -m second &&
  19        git add file3 &&
  20        test_tick &&
  21        git commit -m third
  22
  23'
  24
  25test_expect_success 'tags can be excluded by rev-list options' '
  26
  27        git bundle create bundle --all --since=7.Apr.2005.15:16:00.-0700 &&
  28        git ls-remote bundle > output &&
  29        ! grep tag output
  30
  31'
  32
  33test_expect_success 'die if bundle file cannot be created' '
  34
  35        mkdir adir &&
  36        test_must_fail git bundle create adir --all
  37
  38'
  39
  40test_expect_failure 'bundle --stdin' '
  41
  42        echo master | git bundle create stdin-bundle.bdl --stdin &&
  43        git ls-remote stdin-bundle.bdl >output &&
  44        grep master output
  45
  46'
  47
  48test_expect_failure 'bundle --stdin <rev-list options>' '
  49
  50        echo master | git bundle create hybrid-bundle.bdl --stdin tag &&
  51        git ls-remote hybrid-bundle.bdl >output &&
  52        grep master output
  53
  54'
  55
  56test_expect_success 'empty bundle file is rejected' '
  57
  58    >empty-bundle && test_must_fail git fetch empty-bundle
  59
  60'
  61
  62# This triggers a bug in older versions where the resulting line (with
  63# --pretty=oneline) was longer than a 1024-char buffer.
  64test_expect_success 'ridiculously long subject in boundary' '
  65        : >file4 &&
  66        test_tick &&
  67        git add file4 &&
  68        printf "%01200d\n" 0 | git commit -F - &&
  69        test_commit fifth &&
  70        git bundle create long-subject-bundle.bdl HEAD^..HEAD &&
  71        git bundle list-heads long-subject-bundle.bdl >heads &&
  72        test -s heads &&
  73        git fetch long-subject-bundle.bdl &&
  74        sed -n "/^-/{p;q}" long-subject-bundle.bdl >boundary &&
  75        grep "^-$_x40 " boundary
  76'
  77
  78test_done