SHA256
1
0
forked from pool/quilt
quilt/quilt-files-return-nothing-if-there-are-no-files.patch
Jean Delvare 3a7d64b475 Backport functional and performance regression fixes from upstream:
* Fix bash completion of patch names
* Fix refresh error message
* Fix quilt diff -z on file names including spaces
* Fix quilt files output when there are no files
* Fix patches heuristic for unapplied patches with timestamps
* Re-enable testing of patch-wrapper
* Fix performance regression in quilt patches
* Performance boost for series, applies and unapplied commands

OBS-URL: https://build.opensuse.org/package/show/devel:tools:scm/quilt?expand=0&rev=78
2014-04-25 16:11:32 +00:00

38 lines
1.1 KiB
Diff

From: Jean Delvare <jdelvare@suse.de>
Date: Fri, 14 Feb 2014 15:52:57 +0100
Subject: files: Return nothing if there are no files
Patch-mainline: yes
Git-commit: 4d8358ae52ce574920c7f3aba7453f305fabf1ba
References: bnc#872719
"quilt files" returns a blank line if no files are included in the
patch. This could easily break constructs such as "quilt files | wc
-l". Let "quilt files" return nothing at all if there are no files in
the patch.
diff --git a/quilt/files.in b/quilt/files.in
index 6e107ee..355fa21 100644
--- a/quilt/files.in
+++ b/quilt/files.in
@@ -128,7 +128,7 @@ list_files_in_patch()
fi
# Note: If opt_labels is set, then use_status is not set.
IFS=
- echo $(files_in_patch "$patch") |
+ files_in_patch "$patch" |
sort |
while read file
do
diff --git a/test/example1.test b/test/example1.test
index ec73b81..7eaa228 100644
--- a/test/example1.test
+++ b/test/example1.test
@@ -12,6 +12,7 @@ http://the-tech.mit.edu/Shakespeare/midsummer/full.html
$ quilt new flower.diff
> Patch %{P}flower.diff is now on top
+ $ quilt files
$ quilt add Oberon.txt
> File Oberon.txt added to patch %{P}flower.diff