Description: Exit with an error when diff's retcode=2 (error) on patch
 refresh
Bug-Debian: http://bugs.debian.org/638313
Forwarded: not forwarded yet
Author: Martin Quinson

---
 quilt/refresh.in          |    2 +-
 quilt/scripts/patchfns.in |    6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)
 
pipestatus: 1  
Index: b/quilt/scripts/patchfns.in
===================================================================
--- a/quilt/scripts/patchfns.in
+++ b/quilt/scripts/patchfns.in
@@ -766,6 +766,12 @@
 		echo "$line"
 		cat
 	fi
+
+	# Test the return value of diff, and propagate the error retcode if any
+	if [ ${PIPESTATUS[0]} == 2 ] ;
+	then
+		return 1
+	fi
 }
 
 cat_file()
Index: b/quilt/refresh.in
===================================================================
--- a/quilt/refresh.in
+++ b/quilt/refresh.in
@@ -231,7 +231,7 @@
 	fi
 	if ! diff_file "$file" "$old_file" "$new_file"
 	then
-		printf $"Diff failed, aborting\n" >&2
+		printf $"Diff failed on '$new_file', aborting. Is it a binary file?\n" >&2
 		die 1
 	fi
 
