Sha256: 9681a71b1cf5014cde84d0cd0710814e50387d8278b3802e3097b3f1f1a8423a

Contents?: true

Size: 861 Bytes

Versions: 268

Compression:

Stored size: 861 Bytes

Contents

#!/usr/bin/env bash

set -e

source test/setup

use Test::More

clone-foo-and-bar

subrepo-clone-bar-into-foo

before="$(date -r $OWNER/foo/Foo '+%s')"

(
  cd $OWNER/foo
  add-new-files bar/file
  add-new-files .gitrepo
)

save-original-state $OWNER/foo bar

# Make sure that time stamps differ
sleep 1

is "$(
  cd $OWNER/foo
  git subrepo branch bar
)" \
  "Created branch 'subrepo/bar' and worktree '.git/tmp/subrepo/bar'." \
  "subrepo branch command output is correct"


after="$(date -r $OWNER/foo/Foo '+%s')"
assert-original-state $OWNER/foo bar

# Check that we haven't checked out any temporary files
is "$before" "$after" \
  "No modification on Foo"

test-exists "$OWNER/foo/.git/tmp/subrepo/bar/"

is "$(
  cd $OWNER/foo/.git/tmp/subrepo/bar
  git branch | grep \*
)" \
  "* subrepo/bar" \
  "Correct branch is checked out"

done_testing

teardown

Version data entries

268 entries across 268 versions & 4 rubygems

Version Path
eac_tools-0.86.5 sub/eac_git/vendor/git-subrepo/test/branch.t
eac_tools-0.86.4 sub/eac_git/vendor/git-subrepo/test/branch.t
eac_tools-0.86.3 sub/eac_git/vendor/git-subrepo/test/branch.t
eac_git-0.16.0 vendor/git-subrepo/test/branch.t
eac_tools-0.86.2 sub/eac_git/vendor/git-subrepo/test/branch.t
eac_git-0.15.0 vendor/git-subrepo/test/branch.t
eac_tools-0.84.2 sub/eac_git/vendor/git-subrepo/test/branch.t
eac_tools-0.84.1 sub/eac_git/vendor/git-subrepo/test/branch.t
eac_tools-0.84.0 sub/eac_git/vendor/git-subrepo/test/branch.t
eac_tools-0.83.0 sub/eac_git/vendor/git-subrepo/test/branch.t
eac_tools-0.82.0 sub/eac_git/vendor/git-subrepo/test/branch.t
eac_tools-0.81.0 sub/eac_git/vendor/git-subrepo/test/branch.t
eac_tools-0.80.0 sub/eac_git/vendor/git-subrepo/test/branch.t
eac_tools-0.79.0 sub/eac_git/vendor/git-subrepo/test/branch.t
eac_tools-0.78.0 sub/eac_git/vendor/git-subrepo/test/branch.t
eac_tools-0.77.1 sub/eac_git/vendor/git-subrepo/test/branch.t
eac_tools-0.77.0 sub/eac_git/vendor/git-subrepo/test/branch.t
eac_tools-0.76.1 sub/eac_git/vendor/git-subrepo/test/branch.t
eac_tools-0.76.0 sub/eac_git/vendor/git-subrepo/test/branch.t
eac_tools-0.75.2 sub/eac_git/vendor/git-subrepo/test/branch.t