X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/86795a31727823391e412417010eccbfb6cbd6f9..809f4f1c1b59a01820f8d259306857cb42ef8ca8:/t/t1205-push-subdir.sh diff --git a/t/t1205-push-subdir.sh b/t/t1205-push-subdir.sh index 6502c20..175d36d 100755 --- a/t/t1205-push-subdir.sh +++ b/t/t1205-push-subdir.sh @@ -9,7 +9,7 @@ test_expect_success 'Create some patches' ' stg new p$i -m p$i && echo x$i >> x.txt && echo y$i >> foo/y.txt && - stg add x.txt foo/y.txt && + git add x.txt foo/y.txt && stg refresh done && [ "$(echo $(stg applied))" = "p0 p1 p2" ] && @@ -27,13 +27,13 @@ test_expect_success 'Fast-forward push from a subdir' ' [ "$(echo $(cat foo/y.txt))" = "y0 y1 y2" ] ' -test_expect_failure 'Modifying push from a subdir' ' +test_expect_success 'Modifying push from a subdir' ' stg pop && [ "$(echo $(cat x.txt))" = "x0 x1" ] && [ "$(echo $(cat foo/y.txt))" = "y0 y1" ] && stg new extra -m extra && echo extra >> extra.txt && - stg add extra.txt && + git add extra.txt && stg refresh && cd foo && stg push && @@ -42,7 +42,7 @@ test_expect_failure 'Modifying push from a subdir' ' [ "$(echo $(cat foo/y.txt))" = "y0 y1 y2" ] ' -test_expect_failure 'Conflicting push from subdir' ' +test_expect_success 'Conflicting push from subdir' ' stg pop p1 p2 && [ "$(echo $(cat x.txt))" = "x0" ] && [ "$(echo $(cat foo/y.txt))" = "y0" ] && @@ -52,4 +52,18 @@ test_expect_failure 'Conflicting push from subdir' ' [ "$(echo $(stg status --conflict))" = "foo/y.txt x.txt" ] ' +test_expect_success 'Conflicting add/unknown file in subdir' ' + stg status --reset && + stg new foo -m foo && + mkdir d && + echo foo > d/test && + git add d/test && + stg refresh && + stg pop && + mkdir -p d && + echo bar > d/test && + ! stg push foo && + [ $(stg top) != "foo" ] +' + test_done