1#!/bin/sh
   2test_description='--all includes detached HEADs'
   4. ./test-lib.sh
   6commit () {
   9        test_tick &&
  10        echo $1 > foo &&
  11        git add foo &&
  12        git commit -m "$1"
  13}
  14test_expect_success 'setup' '
  16        commit one &&
  18        commit two &&
  19        git checkout HEAD^ &&
  20        commit detached
  21'
  23test_expect_success 'rev-list --all lists detached HEAD' '
  25        test 3 = $(git rev-list --all | wc -l)
  27'
  29test_expect_success 'repack does not lose detached HEAD' '
  31        git gc &&
  33        git prune --expire=now &&
  34        git show HEAD
  35'
  37test_expect_success 'rev-list --graph --no-walk is forbidden' '
  39        test_must_fail git rev-list --graph --no-walk HEAD
  40'
  41test_done