summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbner Silva <abner@collabora.co.uk>2013-10-18 14:42:41 -0300
committerEdward Hervey <edward@collabora.com>2013-11-15 16:54:44 +0100
commit85018e2e96c6bf22dbbf588f2aa43386c96b22ce (patch)
tree92977dc97be60f912984ac9f0b0674d2dadaf0f9
parentc6e54c374a5f8ccba1e35df34f99e77fdaf91838 (diff)
commit-repo-tag: Checking if there's something new to commit.
-rwxr-xr-xcommit-repo-tag.sh26
1 files changed, 15 insertions, 11 deletions
diff --git a/commit-repo-tag.sh b/commit-repo-tag.sh
index 4ac52c6..79510ab 100755
--- a/commit-repo-tag.sh
+++ b/commit-repo-tag.sh
@@ -62,22 +62,26 @@ rm -fr $TMP_M_FILENAME
TMP_C_FILENAME=`mktemp --suffix=.msg`
# Store changes for commiting
-git diff $MANIFEST_FILENAME > $TMP_C_FILENAME
+git diff --exit-code $MANIFEST_FILENAME > $TMP_C_FILENAME
-# Commit new manifest file
-git commit -F $TMP_C_FILENAME -- $MANIFEST_FILENAME || true
+# Check if there's something new to commit
+if [ $? = 1 ];
+then
+ # Commit new manifest file
+ git commit -F $TMP_C_FILENAME -- $MANIFEST_FILENAME || true
-echo "Tagging manifest for storaging."
+ echo "Tagging manifest for storaging."
-# Tag the new manifest version
-CUR_DATE=`date +%Y%m%d`
-git tag -a "build_$CUR_DATE-$BUILD_NUMBER" \
- -m "Tagging manifest build $BUILD_NUMBER on $CURDATE"
+ # Tag the new manifest version
+ CUR_DATE=`date +%Y%m%d`
+ git tag -a "build_$CUR_DATE-$BUILD_NUMBER" \
+ -m "Tagging manifest build $BUILD_NUMBER on $CURDATE"
-echo "Pushing new manifest to the branch $BUILD_BRANCH"
+ echo "Pushing new manifest to the branch $BUILD_BRANCH"
-# Push new manifest to the build branch
-git push origin $BUILD_BRANCH
+ # Push new manifest to the build branch
+ git push --tags origin $BUILD_BRANCH
+fi
# Remove temporary file
rm -fr $TMP_C_FILENAME