From 1abbb5705c081fb82c9d92e1c901c4e19f5c1afc Mon Sep 17 00:00:00 2001 From: priley86 Date: Mon, 15 Aug 2016 17:22:39 -0400 Subject: [PATCH] ensure master-dist retains Travis dist file commit history * this is the corresponding change for Patternfly core --- scripts/publish.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/publish.sh b/scripts/publish.sh index 4a34c2b960..58d5cbf4be 100644 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -25,6 +25,16 @@ git add dist --force git commit -m "Added files generated by Travis build" # Push to dist branch -git push upstream $TRAVIS_BRANCH:$TRAVIS_BRANCH-dist --force -v +EXISTING=`git ls-remote --heads https://github.com/"$TRAVIS_REPO_SLUG".git "$TRAVIS_BRANCH"-dist` + +if [ -n "$EXISTING" ] +then + git fetch upstream $TRAVIS_BRANCH-dist:$TRAVIS_BRANCH-dist + git checkout $TRAVIS_BRANCH-dist + git merge -Xtheirs $TRAVIS_BRANCH --no-edit --ff + git push upstream $TRAVIS_BRANCH-dist --force -v +else + git push upstream $TRAVIS_BRANCH:$TRAVIS_BRANCH-dist --force -v +fi exit $?