summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2018-04-30 08:28:43 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2018-05-02 15:01:10 +0200
commit26d986c3bc5cf11fd1b5bc850f91009bbb1029be (patch)
tree965ef80e2d237be748f3cac6ac22184b378fe182
parent515d6e1dfd445697a7f3d99e752f52a5612720e6 (diff)
dim: handle parse failures in apply_pull better
We're relying on get fetch failing and set -e, but that doesn't work if we parse nothing: In that case git fetch just fetches upstream and succeed. Dave stumbled over this by feeding a .mbox with dos linefeeds into dim. v2: Use -z and return 1. Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Dave Airlie <airlied@gmail.com> Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
-rwxr-xr-xdim7
1 files changed, 6 insertions, 1 deletions
diff --git a/dim b/dim
index ec51e36b1269..1d78ca275c5d 100755
--- a/dim
+++ b/dim
@@ -901,7 +901,12 @@ function dim_apply_pull
pull_branch=$(sed -e '0,/[gG]it repository at:$/d' $file | head -n 2 | tail -n 1)
- echo $pull_branch
+ if [[ -z "$pull_branch" ]] ; then
+ echoerr "no pull request found"
+ return 1
+ fi
+
+ echo Pulling $pull_branch ...
git fetch $pull_branch
for sha1 in $(git rev-list "HEAD..FETCH_HEAD" --no-merges) ; do