diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-03-08 20:10:05 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-03-08 20:10:05 -0800 |
commit | dabc42c7134596092bf59adb83c79b09f729c290 (patch) | |
tree | 0e14f06997bf7a70cbcda9b1481b8295098b5f5e /t | |
parent | b59fd2098e6606e1a696fc1cafe897e074ed6d6f (diff) | |
parent | 3041c324305e2bad59d7372336940846646dd46a (diff) | |
download | git-dabc42c7134596092bf59adb83c79b09f729c290.tar.gz git-dabc42c7134596092bf59adb83c79b09f729c290.tar.xz |
Merge branch 'jc/am'
* jc/am:
am: --rebasing
am: remove support for -d .dotest
am: read from the right mailbox when started from a subdirectory
Diffstat (limited to 't')
-rwxr-xr-x | t/t4150-am-subdir.sh | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/t/t4150-am-subdir.sh b/t/t4150-am-subdir.sh new file mode 100755 index 000000000..929d2cbd8 --- /dev/null +++ b/t/t4150-am-subdir.sh @@ -0,0 +1,72 @@ +#!/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 && + diff -u expect actual +' + +test_expect_success 'am regularly from file' ' + git checkout initial && + git am patchfile && + git diff master >actual && + diff -u 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 && + diff -u 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 && + diff -u 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 && + diff -u expect actual +' + +test_done |