summaryrefslogtreecommitdiff
path: root/tests/tests/badcommit-rewrite
blob: bcec8e66b2df1d9d3299d7391ba61792c1fcdd68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
set -e
. tests/lib

t-setup-import examplegit

cd example

suite=stable

t-commit 'No changes, just send to stable' '' stable

t-make-badcommit
git reset --hard $badcommit

t-dgit -wgf build
t-dgit push --overwrite=1.2 stable
t-archive-process-incoming stable

rstable=refs/remotes/dgit/dgit/stable

t-dgit fetch stable
t-has-parent-or-is $rstable $badcommit

cd $tmp/git/$p.git
${DGIT_BADCOMMIT_FIXUP} --real

cd $tmp/$p
${DGIT_BADCOMMIT_FIXUP} --real

t-dgit fetch stable

t-expect-fail "child $rstable lacks parent $badcommit" \
t-has-parent-or-is $rstable $badcommit

t-ok