From 2a9775dfc841967cd23d28fc553a373c2597c3bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Fri, 6 Apr 2018 01:26:35 +0200 Subject: [PATCH] Turned example.sh into a proper automatic test --- example.sh | 50 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 44 insertions(+), 6 deletions(-) diff --git a/example.sh b/example.sh index 1eb6b76..98a19fc 100755 --- a/example.sh +++ b/example.sh @@ -10,19 +10,57 @@ fi git init git-rebasei-example pushd git-rebasei-example >/dev/null -touch a; git add a; git commit -m "Added a." +touch a; git add a; git commit -m "Added a." git tag -a -m 'base for the git rebase -i example' rebase-base -touch b; git add b; git commit -m "Added b." -touch c; git add c; git commit -m "Added c." -rm b; git rm b; git commit -m "Removed b." -touch d; git add d; git commit -m "Added d." +touch b; git add b; git commit -m "Added b." +touch c; git add c; git commit -m "Added c." +rm b; git rm b; git commit -m "Removed b." +echo c > c; git add c; git commit --fixup="HEAD~1" +touch d; git add d; git commit -m "Added d." git log --oneline --decorate --graph -git rebase -i rebase-base +git config git-rebasei-editor.editor cat +git rebase -i --autosquash rebase-base git log --oneline --decorate --graph +echo "Comparing with expected git log --name-status…" +diff <(git log --pretty=format:%s --name-status) - < /dev/null rm -fr ./git-rebasei-example