1) EXEC: create myapp in tools with openshift in ~/git/myapp
2) EXEC: take the git url and clone the app into a separate directory (to simulate other changes)
mkdir temp (different directory than the git-repo created by our tooling!!)
cd temp
git clone ssh:<specifichost>/myapp.git/
cd myapp
3) EXEC: edit README or some other existing file
4) EXEC: git commit -m "external change" README
5) EXEC: git push
<ton of output>
6) ASSERT: (verifying that now pushing from the repo created by our tooling is now failing because of "non-fastforward"):
cd ~/git/myapp
echo "-------------" > README (or change README manually with vim
git push will now fail with something like:
ax@slowbeard: $ git push ~/git/appmy
To ssh://b8ab8a46a2984d16b1666f3b172c4199@appmy-man.rhcloud.com/~/git/appmy.git/
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'ssh://b8ab8a46a2984d16b1666f3b172c4199@appmy-man.rhcloud.com/~/git/appmy.git/'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
7) EXEC: in Eclipse, open README, edit it, and choose Publish from the context-menu of the server adapter.
Result:
Thus when trying to publish from tools it should not let you push and it should ask you before pushing with force.
You can verify it did not push force by using
git pull
git log README
and check that "external change" is still present.