Merge branch 'ae/better-template-failure-report'
[gitweb.git] / contrib / hooks / post-receive-email
index 85724bfc08f61d3b928460a8d2ad5ec03cf80b52..21989fc6ab84c0503cdc9418673d9d0bf06f9d49 100755 (executable)
@@ -144,13 +144,13 @@ prep_for_email()
                        short_refname=${refname##refs/remotes/}
                        echo >&2 "*** Push-update of tracking branch, $refname"
                        echo >&2 "***  - no email generated."
-                       exit 0
+                       return 1
                        ;;
                *)
                        # Anything else (is there anything else?)
                        echo >&2 "*** Unknown type of update to $refname ($rev_type)"
                        echo >&2 "***  - no email generated"
-                       return 0
+                       return 1
                        ;;
        esac
 
@@ -166,10 +166,10 @@ prep_for_email()
                esac
                echo >&2 "*** $config_name is not set so no email will be sent"
                echo >&2 "*** for $refname update $oldrev->$newrev"
-               return 0
+               return 1
        fi
 
-       return 1
+       return 0
 }
 
 #
@@ -709,7 +709,7 @@ if [ -z "$GIT_DIR" ]; then
        exit 1
 fi
 
-projectdesc=$(sed -ne '1p' "$GIT_DIR/description")
+projectdesc=$(sed -ne '1p' "$GIT_DIR/description" 2>/dev/null)
 # Check if the description is unchanged from it's default, and shorten it to
 # a more manageable length if it is
 if expr "$projectdesc" : "Unnamed repository.*$" >/dev/null