diff options
author | Guido Günther <agx@sigxcpu.org> | 2023-05-31 10:41:53 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2023-05-31 10:53:59 +0200 |
commit | 8dfec59527a75145c94d5c5e5abe30369869eee5 (patch) | |
tree | 42e2bf482c480716e4705cbde318df7a93f2f232 | |
parent | 4f909d243950715e305b5dde8d28fa401a121858 (diff) |
patch_series: Ignore whitespace lines
E.g. python-coverage has a form feed in the series file.
Closes: #1030534
Thanks: Ian Jackson for the detailed report
-rw-r--r-- | gbp/patch_series.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gbp/patch_series.py b/gbp/patch_series.py index 4ce0327f..04e495f4 100644 --- a/gbp/patch_series.py +++ b/gbp/patch_series.py @@ -334,6 +334,7 @@ class PatchSeries(list): >>> PatchSeries._read_series(['a/b', ... 'a -p1 # comment', + ... '', ... 'a/b -p2'], '.') ... # doctest:+NORMALIZE_WHITESPACE [<gbp.patch_series.Patch path='./a/b' topic='a' >, @@ -349,8 +350,11 @@ class PatchSeries(list): @type patch_dir: string """ queue = PatchSeries() + ws = re.compile('^\\s+$') for line in series: try: + if ws.match(line): + continue if line[0] in ['\n', '#']: continue except IndexError: |