Skip to content

Commit 5b06250

Browse files
committed
fail if current branch has uncommited changes
1 parent 3ce20c8 commit 5b06250

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

git-opensource.sh

+8-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function main(){
5858
MESSAGE="git-opensource";
5959
TARGET_BRANCH="git-opensource";
6060

61-
POSITIONAL=()
61+
POSITIONAL=()
6262
while [[ $# -gt 0 ]]
6363
do
6464
key="$1"
@@ -117,6 +117,13 @@ function main(){
117117
exit 1;
118118
fi
119119

120+
DIFF=`git diff`;
121+
if [[ $DIFF != "" ]]; then
122+
echo "Error: Current branch has uncommited changes." >&2
123+
echo "$USAGE" >&2
124+
exit 1;
125+
fi
126+
120127
ulimit -n 2048;
121128
rm /tmp/git-opensource 2> /dev/null;
122129

0 commit comments

Comments
 (0)