summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@intel.com>2018-05-09 14:28:33 -0700
committerJani Nikula <jani.nikula@intel.com>2018-05-17 12:13:11 +0300
commit5979a716a3704271aabba38ad371b746012afad0 (patch)
treebca87b3b9d5c2d053c56bb3771ed0eea3b54c6c1
parent14b1641d3e85e7713297fe8f65f42de2639c3ad0 (diff)
dim: replace pipe commands with single sed
A single sed can do the job of taking the second line after a match and it looks simpler. Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
-rwxr-xr-xdim2
1 files changed, 1 insertions, 1 deletions
diff --git a/dim b/dim
index 09e9e91e9eb2..7de5e0a95369 100755
--- a/dim
+++ b/dim
@@ -924,7 +924,7 @@ function dim_apply_pull
cat > $file
- pull_branch=$(sed -e '0,/[gG]it repository at:$/d' $file | head -n 2 | tail -n 1)
+ pull_branch=$(sed -ne '/[gG]it repository at:$/{n;n;p}' $file)
if [[ -z "$pull_branch" ]] ; then
echoerr "no pull request found"