aboutsummaryrefslogtreecommitdiff
path: root/t/t3415-rebase-autosquash.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-07-08 18:55:50 -0700
committerJunio C Hamano <gitster@pobox.com>2010-07-08 18:55:50 -0700
commit037c43c68e220739e690540de89a6d5835fefe73 (patch)
tree3e201f833fc63e48db6983e45ce2425d884408db /t/t3415-rebase-autosquash.sh
parentb1f47514f207b0601de7b0936cf13b3c0ae70081 (diff)
parent9918285fb10d81af9021dae99c5f4de88ded497c (diff)
downloadgit-037c43c68e220739e690540de89a6d5835fefe73.tar.gz
git-037c43c68e220739e690540de89a6d5835fefe73.tar.xz
Merge remote branch 'ko/master' into jc/read-tree-cache-tree-fix
* ko/master: (2325 commits) Git 1.7.2-rc2 backmerge a few more fixes to 1.7.1.X series fix git branch -m in presence of cross devices t/t0006: specify timezone as EST5 not EST to comply with POSIX add missing && to submodule-merge testcase t/README: document more test helpers test-date: fix sscanf type conversion xdiff: optimise for no whitespace difference when ignoring whitespace. gitweb: Move evaluate_gitweb_config out of run_request parse_date: fix signedness in timezone calculation t0006: test timezone parsing rerere.txt: Document forget subcommand t/README: proposed rewording... t/README: Document the do's and don'ts of tests t/README: Add a section about skipping tests t/README: Document test_expect_code t/README: Document test_external* t/README: Document the prereq functions, and 3-arg test_* t/README: Typo: paralell -> parallel t/README: The trash is in 't/trash directory.$name' ... Conflicts: builtin-read-tree.c
Diffstat (limited to 't/t3415-rebase-autosquash.sh')
-rwxr-xr-xt/t3415-rebase-autosquash.sh73
1 files changed, 73 insertions, 0 deletions
diff --git a/t/t3415-rebase-autosquash.sh b/t/t3415-rebase-autosquash.sh
new file mode 100755
index 000000000..b63f4e2d6
--- /dev/null
+++ b/t/t3415-rebase-autosquash.sh
@@ -0,0 +1,73 @@
+#!/bin/sh
+
+test_description='auto squash'
+
+. ./test-lib.sh
+
+test_expect_success setup '
+ echo 0 >file0 &&
+ git add . &&
+ test_tick &&
+ git commit -m "initial commit" &&
+ echo 0 >file1 &&
+ echo 2 >file2 &&
+ git add . &&
+ test_tick &&
+ git commit -m "first commit" &&
+ echo 3 >file3 &&
+ git add . &&
+ test_tick &&
+ git commit -m "second commit" &&
+ git tag base
+'
+
+test_expect_success 'auto fixup' '
+ git reset --hard base &&
+ echo 1 >file1 &&
+ git add -u &&
+ test_tick &&
+ git commit -m "fixup! first"
+
+ git tag final-fixup &&
+ test_tick &&
+ git rebase --autosquash -i HEAD^^^ &&
+ git log --oneline >actual &&
+ test 3 = $(wc -l <actual) &&
+ git diff --exit-code final-fixup &&
+ test 1 = "$(git cat-file blob HEAD^:file1)" &&
+ test 1 = $(git cat-file commit HEAD^ | grep first | wc -l)
+'
+
+test_expect_success 'auto squash' '
+ git reset --hard base &&
+ echo 1 >file1 &&
+ git add -u &&
+ test_tick &&
+ git commit -m "squash! first"
+
+ git tag final-squash &&
+ test_tick &&
+ git rebase --autosquash -i HEAD^^^ &&
+ git log --oneline >actual &&
+ test 3 = $(wc -l <actual) &&
+ git diff --exit-code final-squash &&
+ test 1 = "$(git cat-file blob HEAD^:file1)" &&
+ test 2 = $(git cat-file commit HEAD^ | grep first | wc -l)
+'
+
+test_expect_success 'misspelled auto squash' '
+ git reset --hard base &&
+ echo 1 >file1 &&
+ git add -u &&
+ test_tick &&
+ git commit -m "squash! forst"
+ git tag final-missquash &&
+ test_tick &&
+ git rebase --autosquash -i HEAD^^^ &&
+ git log --oneline >actual &&
+ test 4 = $(wc -l <actual) &&
+ git diff --exit-code final-missquash &&
+ test 0 = $(git rev-list final-missquash...HEAD | wc -l)
+'
+
+test_done