git-commit-vandalism/t/t3512-cherry-pick-submodule.sh
Junio C Hamano 0f57f731ea Merge branch 'pw/sequencer-in-process-commit'
The sequencer infrastructure is shared across "git cherry-pick",
"git rebase -i", etc., and has always spawned "git commit" when it
needs to create a commit.  It has been taught to do so internally,
when able, by reusing the codepath "git commit" itself uses, which
gives performance boost for a few tens of percents in some sample
scenarios.

* pw/sequencer-in-process-commit:
  sequencer: run 'prepare-commit-msg' hook
  t7505: add tests for cherry-pick and rebase -i/-p
  t7505: style fixes
  sequencer: assign only free()able strings to gpg_sign
  sequencer: improve config handling
  t3512/t3513: remove KNOWN_FAILURE_CHERRY_PICK_SEES_EMPTY_COMMIT=1
  sequencer: try to commit without forking 'git commit'
  sequencer: load commit related config
  sequencer: simplify adding Signed-off-by: trailer
  commit: move print_commit_summary() to libgit
  commit: move post-rewrite code to libgit
  Add a function to update HEAD after creating a commit
  commit: move empty message checks to libgit
  t3404: check intermediate squash messages
2018-02-13 13:39:15 -08:00

49 lines
1.0 KiB
Bash
Executable File

#!/bin/sh
test_description='cherry-pick can handle submodules'
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-submodule-update.sh
KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR=1
KNOWN_FAILURE_NOFF_MERGE_ATTEMPTS_TO_MERGE_REMOVED_SUBMODULE_FILES=1
test_submodule_switch "git cherry-pick"
test_expect_success 'unrelated submodule/file conflict is ignored' '
test_create_repo sub &&
touch sub/file &&
git -C sub add file &&
git -C sub commit -m "add a file in a submodule" &&
test_create_repo a_repo &&
(
cd a_repo &&
>a_file &&
git add a_file &&
git commit -m "add a file" &&
git branch test &&
git checkout test &&
mkdir sub &&
>sub/content &&
git add sub/content &&
git commit -m "add a regular folder with name sub" &&
echo "123" >a_file &&
git add a_file &&
git commit -m "modify a file" &&
git checkout master &&
git submodule add ../sub sub &&
git submodule update sub &&
git commit -m "add a submodule info folder with name sub" &&
git cherry-pick test
)
'
test_done