Turned example.sh into a proper automatic test
This commit is contained in:
parent
f8e488eec8
commit
2a9775dfc8
50
example.sh
50
example.sh
|
@ -10,19 +10,57 @@ fi
|
||||||
git init git-rebasei-example
|
git init git-rebasei-example
|
||||||
pushd git-rebasei-example >/dev/null
|
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
|
git tag -a -m 'base for the git rebase -i example' rebase-base
|
||||||
touch b; git add b; git commit -m "Added b."
|
touch b; git add b; git commit -m "Added b."
|
||||||
touch c; git add c; git commit -m "Added c."
|
touch c; git add c; git commit -m "Added c."
|
||||||
rm b; git rm b; git commit -m "Removed b."
|
rm b; git rm b; git commit -m "Removed b."
|
||||||
touch d; git add d; git commit -m "Added d."
|
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 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
|
git log --oneline --decorate --graph
|
||||||
|
|
||||||
|
echo "Comparing with expected git log --name-status…"
|
||||||
|
diff <(git log --pretty=format:%s --name-status) - <<EOF
|
||||||
|
Added d.
|
||||||
|
A d
|
||||||
|
|
||||||
|
Removed b.
|
||||||
|
D b
|
||||||
|
|
||||||
|
Added c.
|
||||||
|
A c
|
||||||
|
|
||||||
|
Added b.
|
||||||
|
A b
|
||||||
|
|
||||||
|
Added a.
|
||||||
|
A a
|
||||||
|
EOF
|
||||||
|
|
||||||
|
echo "Comparing with expected git log --numstat…"
|
||||||
|
diff <(git log --pretty=format:%s --numstat) - <<EOF
|
||||||
|
Added d.
|
||||||
|
0 0 d
|
||||||
|
|
||||||
|
Removed b.
|
||||||
|
0 0 b
|
||||||
|
|
||||||
|
Added c.
|
||||||
|
1 0 c
|
||||||
|
|
||||||
|
Added b.
|
||||||
|
0 0 b
|
||||||
|
|
||||||
|
Added a.
|
||||||
|
0 0 a
|
||||||
|
EOF
|
||||||
|
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
|
|
||||||
rm -fr ./git-rebasei-example
|
rm -fr ./git-rebasei-example
|
||||||
|
|
Loading…
Reference in New Issue
Block a user