chiark / gitweb /
git-debpush: check_treesame: Show diffstat when there is a diff
[dgit.git] / git-debpush
index 744212af17cd0dae568caab5d9ff44784f48a32c..bd0357b5dc3a301979297023efc67dce5fb727e3 100755 (executable)
@@ -105,10 +105,15 @@ check_treesame () {
     shift 2
 
     set +e
-    git diff --exit-code "$first".."$second" -- . "$@"
+    git diff --quiet --exit-code "$first".."$second" -- . "$@"
     git_diff_rc=$?
     set -e
 
+    # show the user what the difference was
+    if [ $git_diff_rc = 1 ]; then
+        git diff --compact-summary "$first".."$second" -- . "$@"
+    fi
+
     if [ $git_diff_rc -le 1 ]; then
         return $git_diff_rc
     else
@@ -246,9 +251,9 @@ case "$format" in
     '3.0 (quilt)')  upstream=true ;;
     '3.0 (native)') upstream=false ;;
     '1.0'|'')
-       if get_file_from_ref debian/source/options | grep '^-sn *$'; then
+       if get_file_from_ref debian/source/options | grep -q '^-sn *$'; then
            upstream=false
-        elif get_file_from_ref debian/source/options | grep '^-sk *$'; then
+        elif get_file_from_ref debian/source/options | grep -q '^-sk *$'; then
            upstream=true
        else
            fail 'please see "SOURCE FORMAT 1.0" in git-debpush(1)'