aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-09-06 08:36:46 +0200
committermarha <marha@users.sourceforge.net>2012-09-06 08:36:46 +0200
commita4d007b9b60f2fc7c8de46533e2f47ecb24f3c9c (patch)
tree6004036376ff1c1ea894d678902ed9f596fc4237
parent5f8e1a7bd57e5a413d7f86c2d00b00882c3a1bc6 (diff)
parentaf1e359cc622a0c53d5632fb03ef9bd4c17de897 (diff)
downloadvcxsrv-a4d007b9b60f2fc7c8de46533e2f47ecb24f3c9c.tar.gz
vcxsrv-a4d007b9b60f2fc7c8de46533e2f47ecb24f3c9c.tar.bz2
vcxsrv-a4d007b9b60f2fc7c8de46533e2f47ecb24f3c9c.zip
Merge remote-tracking branch 'origin/released'
-rw-r--r--fastforwardotherbranch.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/fastforwardotherbranch.sh b/fastforwardotherbranch.sh
new file mode 100644
index 000000000..4b6d1e9a4
--- /dev/null
+++ b/fastforwardotherbranch.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+BRANCH=master
+NEWER=origin/master
+
+if [ $(git symbolic-ref HEAD) = "refs/heads/$BRANCH" ]
+then
+ echo "This doesn't make sense if you're already on the branch '$BRANCH'"
+ echo "Just run: git merge $NEWER"
+ exit 1
+fi
+
+BRANCH_HASH=$(git rev-parse $BRANCH)
+NEWER_HASH=$(git rev-parse $NEWER)
+MERGE_BASE=$(git merge-base $BRANCH_HASH $NEWER_HASH)
+
+if [ "$MERGE_BASE" = "$BRANCH_HASH" ]
+then
+ git update-ref "refs/heads/$BRANCH" "$NEWER_HASH" "$BRANCH_HASH"
+else
+ echo "$BRANCH can't be fast-forwarded to $NEWER"
+ exit 1
+fi