3 # Copyright (c) 2006 Yann Dirson
6 test_description
='Exercise pushing patches applied upstream.
8 Especially, consider the case of a patch that adds a file, while a
9 subsequent one modifies it, so we have to use --merged for push to
10 detect the merge. Reproduce the common workflow where one does not
11 specify --merged, then rollback and retry with the correct flag.'
15 # don't need this repo, but better not drop it, see t1100
18 # Need a repo to clone
22 'Clone tree and setup changes' \
24 (cd bar && stg new p1 -m p1
25 printf 'a\nc\n' > file && stg add file && stg refresh &&
27 printf 'a\nb\nc\n' > file && stg refresh
32 'Port those patches to orig tree' \
34 GIT_DIR=../bar/.git git-format-patch --stdout \
35 $(cd ../bar && stg id base@master)..HEAD |
41 'Pull to sync with parent, preparing for the problem' \
42 "(cd bar && stg pop --all &&
48 'Attempt to push the first of those patches without --merged' \
55 "(cd bar && stg push --undo
60 'Push those patches while checking they were merged upstream' \
61 "(cd bar && stg push --merged --all