Skip to content

Commit 1abbb57

Browse files
committed
ensure master-dist retains Travis dist file commit history
* this is the corresponding change for Patternfly core
1 parent 56b5375 commit 1abbb57

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

scripts/publish.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ git add dist --force
2525
git commit -m "Added files generated by Travis build"
2626

2727
# Push to dist branch
28-
git push upstream $TRAVIS_BRANCH:$TRAVIS_BRANCH-dist --force -v
28+
EXISTING=`git ls-remote --heads https://github.com/"$TRAVIS_REPO_SLUG".git "$TRAVIS_BRANCH"-dist`
29+
30+
if [ -n "$EXISTING" ]
31+
then
32+
git fetch upstream $TRAVIS_BRANCH-dist:$TRAVIS_BRANCH-dist
33+
git checkout $TRAVIS_BRANCH-dist
34+
git merge -Xtheirs $TRAVIS_BRANCH --no-edit --ff
35+
git push upstream $TRAVIS_BRANCH-dist --force -v
36+
else
37+
git push upstream $TRAVIS_BRANCH:$TRAVIS_BRANCH-dist --force -v
38+
fi
2939

3040
exit $?

0 commit comments

Comments
 (0)