Sha256: e46245c3853a37f01264b4a987d85d67e0a2fcc69b76782ce75593d18c581bb6

Contents?: true

Size: 1.3 KB

Versions: 268

Compression:

Stored size: 1.3 KB

Contents

#!/usr/bin/env bash

set -e

source test/setup

use Test::More

git clone $UPSTREAM/init $OWNER/init &>/dev/null

gitrepo=$OWNER/init/doc/.gitrepo

# Test that the initial repo look ok:
{
  test-exists \
    "$OWNER/init/.git/" \
    "$OWNER/init/ReadMe" \
    "$OWNER/init/doc/" \
    "$OWNER/init/doc/init.swim" \
    "!$gitrepo"
}

output="$(
  cd "$OWNER/init"
  git subrepo init doc
)"

is "$output" "Subrepo created from 'doc' (with no remote)." \
  'Command output is correct'

{
  test-exists \
    "$gitrepo"
}

# Test init/doc/.gitrepo file contents:
{
  init_clone_commit="$(cd $OWNER/init; git rev-parse HEAD^)"
  test-gitrepo-comment-block
  test-gitrepo-field "remote" "none"
  test-gitrepo-field "branch" "master"
  test-gitrepo-field "commit" ""
  test-gitrepo-field "parent" ""
  test-gitrepo-field "method" "merge"
  test-gitrepo-field "cmdver" "`git subrepo --version`"
}

rm -fr "$OWNER/init"
git clone $UPSTREAM/init $OWNER/init &>/dev/null
(
  cd "$OWNER/init"
  git subrepo init doc -r git@github.com:user/repo -b foo -M rebase
) >/dev/null

test-gitrepo-field "remote" "git@github.com:user/repo"
test-gitrepo-field "branch" "foo"
test-gitrepo-field "commit" ""
test-gitrepo-field "parent" ""
test-gitrepo-field "method" "rebase"
test-gitrepo-field "cmdver" "`git subrepo --version`"

done_testing

teardown

Version data entries

268 entries across 268 versions & 4 rubygems

Version Path
eac_tools-0.75.1 sub/eac_git/vendor/git-subrepo/test/init.t
eac_tools-0.75.0 sub/eac_git/vendor/git-subrepo/test/init.t
eac_tools-0.74.1 sub/eac_git/vendor/git-subrepo/test/init.t
eac_tools-0.74.0 sub/eac_git/vendor/git-subrepo/test/init.t
eac_tools-0.73.0 sub/eac_git/vendor/git-subrepo/test/init.t
eac_tools-0.72.0 sub/eac_git/vendor/git-subrepo/test/init.t
eac_tools-0.70.1 sub/eac_git/vendor/git-subrepo/test/init.t
eac_tools-0.70.0 sub/eac_git/vendor/git-subrepo/test/init.t
eac_tools-0.69.1 sub/eac_git/vendor/git-subrepo/test/init.t
eac_tools-0.69.0 sub/eac_git/vendor/git-subrepo/test/init.t
eac_tools-0.68.0 sub/eac_git/vendor/git-subrepo/test/init.t
eac_tools-0.67.1 sub/eac_git/vendor/git-subrepo/test/init.t
eac_tools-0.67.0 sub/eac_git/vendor/git-subrepo/test/init.t
eac_tools-0.66.0 sub/eac_git/vendor/git-subrepo/test/init.t
eac_tools-0.65.1 sub/eac_git/vendor/git-subrepo/test/init.t
eac_tools-0.65.0 sub/eac_git/vendor/git-subrepo/test/init.t
eac_tools-0.64.0 sub/eac_git/vendor/git-subrepo/test/init.t
eac_tools-0.63.0 sub/eac_git/vendor/git-subrepo/test/init.t
eac_tools-0.62.1 sub/eac_git/vendor/git-subrepo/test/init.t
eac_tools-0.62.0 sub/eac_git/vendor/git-subrepo/test/init.t