--- oslo-series-final/0017-guilt-graph-no-longer-loops-when-no-patches-are-appl.patch +++ oslo-series-v2/v2-0017-guilt-graph-no-longer-loops-when-no-patches-are-a.patch @@ -1,7 +1,7 @@ -From f53d403081888ad84227e6361a3438020cf7481a Mon Sep 17 00:00:00 2001 +From a5d070346e556c8d7796574f422c41d280e36fcf Mon Sep 17 00:00:00 2001 From: Per Cederqvist -Date: Wed, 19 Mar 2014 21:44:58 +0100 -Subject: [GUILT 17/28] "guilt graph" no longer loops when no patches are +Date: Tue, 13 May 2014 21:03:58 +0200 +Subject: [GUILT v2 17/29] "guilt graph" no longer loops when no patches are applied. To: Jeff Sipek Cc: git@vger.kernel.org @@ -11,10 +11,10 @@ Signed-off-by: Per Cederqvist --- - guilt-graph | 10 ++++++++-- + guilt-graph | 9 +++++++-- regression/t-033.out | 3 +++ - regression/t-033.sh | 11 +++++++++++ - 3 files changed, 22 insertions(+), 2 deletions(-) + regression/t-033.sh | 13 +++++++++++++ + 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 regression/t-033.out create mode 100755 regression/t-033.sh diff --git a/guilt-graph b/guilt-graph index b3469dc..00301d5 100755 --- a/guilt-graph +++ b/guilt-graph - @@ -17,8 +17,14 @@ fi + @@ -17,8 +17,13 @@ fi patchname="$1" -bottom=`git rev-parse refs/patches/$branch/$(head_n 1 < "$applied")` -base=`git rev-parse $bottom^` +bottompatch=$(head_n 1 < "$applied") - +if [ -z "$bottompatch" ] - +then + +if [ -z "$bottompatch" ]; then + echo "No patch applied." >&2 + exit 1 +fi [...] if [ -z "$patchname" ]; then top=`git rev-parse HEAD` diff --git a/regression/t-033.sh b/regression/t-033.sh new file mode 100755 index 0000000..ae40577 --- /dev/null +++ b/regression/t-033.sh - @@ -0,0 +1,11 @@ + @@ -0,0 +1,13 @@ +#!/bin/bash +# +# Test the graph code [...] + +cmd setup_repo + + +# Check that "guilt graph" gives a proper "No patch applied" error + +# message when no patches are applied. (An older version of guilt + +# used to enter an endless loop in this situation.) +shouldfail guilt graph - + --