Sha256: 0961367534ff68432b3166ed499ce410155b11bd45320714359bf3c8634777af

Contents?: true

Size: 1.37 KB

Versions: 268

Compression:

Stored size: 1.37 KB

Contents

#!/usr/bin/env bash

set -e

source test/setup

use Test::More

clone-foo-and-bar

subrepo-clone-bar-into-foo

note "Pull - Conflict - Use theirs - Push"

#
# When you perform rebase ours/theirs are reversed, so this test case will
# test using the subrepo change (theirs) although in the step below
# we actually use git checkout --ours to accomplish this
#

(
  cd $OWNER/bar
  add-new-files Bar2
  git push
) &> /dev/null || die

(
  cd $OWNER/foo
  git subrepo pull bar
  modify-files-ex bar/Bar2
  git push
) &> /dev/null || die

(
  cd $OWNER/bar
  modify-files-ex Bar2
  git push
) &> /dev/null || die

(
  cd $OWNER/foo
  git subrepo pull bar || {
      cd .git/tmp/subrepo/bar
      git checkout --theirs Bar2
      git add Bar2
      git commit --file ../../../../.git/worktrees/bar/MERGE_MSG
      cd ../../../..
      git subrepo commit bar
      git subrepo clean bar
  }
) &> /dev/null || die

test-exists \
  "$OWNER/foo/bar/Bar2" \
  "$OWNER/bar/Bar2" \

is "$(cat $OWNER/foo/bar/Bar2)" \
  "new file Bar2"$'\n'"Bar2" \
  "The readme file in the mainrepo is theirs"

(
  cd $OWNER/foo
  cat bar/Bar2
  git subrepo push bar
) &> /dev/null || die

(
  cd $OWNER/bar
  git pull
) &> /dev/null || die

test-exists \
  "$OWNER/foo/bar/Bar2" \
  "$OWNER/bar/Bar2" \

is "$(cat $OWNER/bar/Bar2)" \
  "new file Bar2"$'\n'"Bar2" \
  "The readme file in the subrepo is theirs"

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/pull-theirs.t
eac_tools-0.86.4 sub/eac_git/vendor/git-subrepo/test/pull-theirs.t
eac_tools-0.86.3 sub/eac_git/vendor/git-subrepo/test/pull-theirs.t
eac_git-0.16.0 vendor/git-subrepo/test/pull-theirs.t
eac_tools-0.86.2 sub/eac_git/vendor/git-subrepo/test/pull-theirs.t
eac_git-0.15.0 vendor/git-subrepo/test/pull-theirs.t
eac_tools-0.84.2 sub/eac_git/vendor/git-subrepo/test/pull-theirs.t
eac_tools-0.84.1 sub/eac_git/vendor/git-subrepo/test/pull-theirs.t
eac_tools-0.84.0 sub/eac_git/vendor/git-subrepo/test/pull-theirs.t
eac_tools-0.83.0 sub/eac_git/vendor/git-subrepo/test/pull-theirs.t
eac_tools-0.82.0 sub/eac_git/vendor/git-subrepo/test/pull-theirs.t
eac_tools-0.81.0 sub/eac_git/vendor/git-subrepo/test/pull-theirs.t
eac_tools-0.80.0 sub/eac_git/vendor/git-subrepo/test/pull-theirs.t
eac_tools-0.79.0 sub/eac_git/vendor/git-subrepo/test/pull-theirs.t
eac_tools-0.78.0 sub/eac_git/vendor/git-subrepo/test/pull-theirs.t
eac_tools-0.77.1 sub/eac_git/vendor/git-subrepo/test/pull-theirs.t
eac_tools-0.77.0 sub/eac_git/vendor/git-subrepo/test/pull-theirs.t
eac_tools-0.76.1 sub/eac_git/vendor/git-subrepo/test/pull-theirs.t
eac_tools-0.76.0 sub/eac_git/vendor/git-subrepo/test/pull-theirs.t
eac_tools-0.75.2 sub/eac_git/vendor/git-subrepo/test/pull-theirs.t