So here is my proposal for a single test harness for submodule updates. It is
intended to be easily applicable to all work tree manipulating commands. The
current version tests the status quo (and it documents two bugs in current
Git). This framework will be extended to cover recursive submodule update too
in a later series.

The first patch adds a simple helper function to the test lib which makes
it easier to test for an empty submodule directory.

The second patch contains the heavy lifting, it adds the test framework for
switching submodules. Currently only transitions without merge conflicts are
tested for, I intend to add others producing merge conflicts in a follow-up
series.

The third and forth patch show how to apply this framework to a simple
command (checkout) and a more complicated case where a helper function is
used to execute a preparing command (diff) which produces the input for the
then to-be-tested command (apply).

I'm currently working on adding this harness to more commands. read-tree and
reset are finished, merge and pull still show some oddities when used with
the --no-ff option, also cherry-pick and checkout-index are not working as
expected yet. And then there are am, apply, bisect, rebase, revert & stash
apply which still need to be covered.

Jens Lehmann (4):
  test-lib: add test_dir_is_empty()
  Submodules: Add the lib-submodule-update.sh test library
  checkout: call the new submodule update test framework
  apply: add t4137 for submodule updates

 t/lib-submodule-update.sh     | 627 ++++++++++++++++++++++++++++++++++++++++++
 t/t2013-checkout-submodule.sh |   5 +
 t/t4137-apply-submodule.sh    |  20 ++
 t/test-lib-functions.sh       |  11 +
 4 files changed, 663 insertions(+)
 create mode 100755 t/lib-submodule-update.sh
 create mode 100755 t/t4137-apply-submodule.sh

-- 
1.9.1.327.g3d8d896

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to