1#!/bin/sh
   2test_description='git ls-remote'
   4. ./test-lib.sh
   6test_expect_success setup '
   8        >file &&
  10        git add file &&
  11        test_tick &&
  12        git commit -m initial &&
  13        git tag mark &&
  14        git show-ref --tags -d | sed -e "s/ /   /" >expected.tag &&
  15        (
  16                echo "$(git rev-parse HEAD)     HEAD"
  17                git show-ref -d | sed -e "s/ /  /"
  18        ) >expected.all &&
  19        git remote add self "$(pwd)/.git"
  21'
  23test_expect_success 'ls-remote --tags .git' '
  25        git ls-remote --tags .git >actual &&
  27        test_cmp expected.tag actual
  28'
  30test_expect_success 'ls-remote .git' '
  32        git ls-remote .git >actual &&
  34        test_cmp expected.all actual
  35'
  37test_expect_success 'ls-remote --tags self' '
  39        git ls-remote --tags self >actual &&
  41        test_cmp expected.tag actual
  42'
  44test_expect_success 'ls-remote self' '
  46        git ls-remote self >actual &&
  48        test_cmp expected.all actual
  49'
  51test_done