Permalink
Browse files

Cleaning up code and output.

  • Loading branch information...
Manuel Koller
Manuel Koller committed Dec 1, 2011
1 parent 37756d9 commit 3c8936559b363512be7055502ce55fb29354e60f
Showing with 6 additions and 8 deletions.
  1. +1 −1 git-attach-head
  2. +1 −1 git-ccommit
  3. +2 −2 git-check-branch
  4. +0 −1 git-rcheckout
  5. +1 −2 git-rpull
  6. +1 −1 git-rpush
View
@@ -27,7 +27,7 @@ fi
## TODO: do some error checking?
## stop if HEAD is a ref already
-if git symbolic-ref HEAD 2> /dev/null ; then
+if git symbolic-ref -q HEAD > /dev/null ; then
exit 0
fi
View
@@ -53,7 +53,7 @@ fi
if [[ "$@" == *--allow-empty* ]] || ([ $a -eq 1 ] && ! git check-clean --unstaged --unmerged --exit-code --ignore-submodules=dirty) || ! git check-clean --uncommitted --exit-code --ignore-submodules=dirty;
then
## check for detached head
- if ! git symbolic-ref HEAD 2> /dev/null ; then
+ if ! git symbolic-ref -q HEAD > /dev/null ; then
echo "Error in $PWD:"
echo " Refused to commit in detached head state. Use \"git rcheckout <branchname>\" to attach HEAD. List branches with \"git branch -v\"."
exit 1
View
@@ -17,12 +17,12 @@ EOF
exit 0;
fi
-if ! git symbolic-ref HEAD 2> /dev/null ; then
+if ! git symbolic-ref -q HEAD > /dev/null ; then
## detached head cannot be remote tracking branch...
## ...but: if there are no new commits, we can safely ignore this
## FIXME: this test only succeed if the new commit is actually
## checked out
- if [[ $(git diff origin... --quiet || echo "FAIL") == "FAIL" ]]; then
+ if ! git diff origin... --quiet; then
echo "Error in $PWD:"
echo " Detached head and new commits. Attach the HEAD by creating"
echo " a new branch or risk losing the commits."
View
@@ -25,7 +25,6 @@ fi
git check-clean || exit 1
## do the checkout
-## git pull --recurse-submodules (does not work)
git checkout "$@" || exit 1
## fix submodule
git fix-submodules --skip-checks
View
@@ -25,7 +25,7 @@ fi
## check for modified content and uncommitted changes
git check-clean --ignore-submodules=untracked --unstaged --uncommitted --unmerged || exit 1
## check for untracked files
-if [[ $(git check-clean --untracked --unstaged --exit-code || echo "FAIL") == "FAIL" ]]; then
+if ! git check-clean --untracked --unstaged --exit-code; then
cat<<EOF
Error: Untracked files in submodules. Add them to .gitignore
in the respective submodules or remove them.
@@ -50,7 +50,6 @@ fi
## git check-unpushed # no need to check in master
## do the pull
-## git pull --recurse-submodules (does not work)
git pull || exit 1
if [ -f .gitmodules ]; then
View
@@ -23,7 +23,7 @@ fi
## check for modified content and uncommitted changes
git check-clean --ignore-submodules=untracked --unstaged --uncommitted --unmerged || exit 1
## check for untracked files
-if [[ $(git check-clean --untracked --unstaged --exit-code || echo "FAIL") == "FAIL" ]]; then
+if ! git check-clean --untracked --unstaged --exit-code; then
cat<<EOF
Warning: Untracked files in submodules. Add them to .gitignore
in the respective submodules or remove them.

0 comments on commit 3c89365

Please sign in to comment.