From 8ec00d0534c28763ed07533920daa47baca0d6a6 Mon Sep 17 00:00:00 2001 From: Stephan Beyer Date: Sun, 1 Jun 2008 00:11:43 +0200 Subject: [PATCH] Merge t4150-am-subdir.sh and t4151-am.sh into t4150-am.sh This patch moves the am test cases in t4150-am.sh and the am subdirectory test cases from t/t4150-am-subdir.sh into t/4151-am.sh. Signed-off-by: Stephan Beyer Signed-off-by: Junio C Hamano --- t/t4150-am-subdir.sh | 72 ------------------------------------------ t/{t4151-am.sh => t4150-am.sh} | 34 ++++++++++++++++++++ 2 files changed, 34 insertions(+), 72 deletions(-) delete mode 100755 t/t4150-am-subdir.sh rename t/{t4151-am.sh => t4150-am.sh} (90%) diff --git a/t/t4150-am-subdir.sh b/t/t4150-am-subdir.sh deleted file mode 100755 index 52069b469b..0000000000 --- a/t/t4150-am-subdir.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/sh - -test_description='git am running from a subdirectory' - -. ./test-lib.sh - -test_expect_success setup ' - echo hello >world && - git add world && - test_tick && - git commit -m initial && - git tag initial && - echo goodbye >world && - git add world && - test_tick && - git commit -m second && - git format-patch --stdout HEAD^ >patchfile && - : >expect -' - -test_expect_success 'am regularly from stdin' ' - git checkout initial && - git am actual && - test_cmp expect actual -' - -test_expect_success 'am regularly from file' ' - git checkout initial && - git am patchfile && - git diff master >actual && - test_cmp expect actual -' - -test_expect_success 'am regularly from stdin in subdirectory' ' - rm -fr subdir && - git checkout initial && - ( - mkdir -p subdir && - cd subdir && - git am <../patchfile - ) && - git diff master>actual && - test_cmp expect actual -' - -test_expect_success 'am regularly from file in subdirectory' ' - rm -fr subdir && - git checkout initial && - ( - mkdir -p subdir && - cd subdir && - git am ../patchfile - ) && - git diff master >actual && - test_cmp expect actual -' - -test_expect_success 'am regularly from file in subdirectory with full path' ' - rm -fr subdir && - git checkout initial && - P=$(pwd) && - ( - mkdir -p subdir && - cd subdir && - git am "$P/patchfile" - ) && - git diff master >actual && - test_cmp expect actual -' - -test_done diff --git a/t/t4151-am.sh b/t/t4150-am.sh similarity index 90% rename from t/t4151-am.sh rename to t/t4150-am.sh index ec1b4423c6..722ae96cd5 100755 --- a/t/t4151-am.sh +++ b/t/t4150-am.sh @@ -223,4 +223,38 @@ test_expect_success 'am fails on empty patch' ' ! test -d .dotest ' +test_expect_success 'am works from stdin in subdirectory' ' + rm -fr subdir && + git checkout first && + ( + mkdir -p subdir && + cd subdir && + git am <../patch1 + ) && + test -z "$(git diff second)" +' + +test_expect_success 'am works from file (relative path given) in subdirectory' ' + rm -fr subdir && + git checkout first && + ( + mkdir -p subdir && + cd subdir && + git am ../patch1 + ) && + test -z "$(git diff second)" +' + +test_expect_success 'am works from file (absolute path given) in subdirectory' ' + rm -fr subdir && + git checkout first && + P=$(pwd) && + ( + mkdir -p subdir && + cd subdir && + git am "$P/patch1" + ) && + test -z "$(git diff second)" +' + test_done -- 2.11.4.GIT