Commit 8ec00d05 authored by Stephan Beyer's avatar Stephan Beyer Committed by Junio C Hamano

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: default avatarStephan Beyer <[email protected]>
Signed-off-by: default avatarJunio C Hamano <[email protected]>
parent d3a7b8f5
#!/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 <patchfile &&
git diff master >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
......@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment