Code

quiltimport: Skip non-existent patches
authorDan Nicholson <dbn.lists@gmail.com>
Thu, 27 Sep 2007 20:30:59 +0000 (13:30 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 27 Sep 2007 23:19:19 +0000 (16:19 -0700)
When quiltimport encounters a non-existent patch in the series file,
just skip to the next patch. This matches the behavior of quilt.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-quiltimport.sh

index 74a54d5d08f86ebbd6a4b3af1f6950dbfd91c743..880c81d121bfb9555c729bc299f8ae8baf1db32c 100755 (executable)
@@ -71,6 +71,10 @@ commit=$(git rev-parse HEAD)
 
 mkdir $tmp_dir || exit 2
 for patch_name in $(grep -v '^#' < "$QUILT_PATCHES/series" ); do
+       if ! [ -f "$QUILT_PATCHES/$patch_name" ] ; then
+               echo "$patch_name doesn't exist. Skipping."
+               continue
+       fi
        echo $patch_name
        git mailinfo "$tmp_msg" "$tmp_patch" \
                <"$QUILT_PATCHES/$patch_name" >"$tmp_info" || exit 3