chiark / gitweb /
git-debrebase: gbp_pq_export: Return flag, are there any patches?
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 25 Aug 2018 12:21:09 +0000 (13:21 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 25 Aug 2018 12:21:09 +0000 (13:21 +0100)
All callers currently ignore the return value, so NFC.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
git-debrebase

index 529286e697c4d346313a54bf3228e3ce9b460814..a0fc2aaa63fbd7f85795a45b299a691606d200ac 100755 (executable)
@@ -494,6 +494,7 @@ sub gbp_pq_export ($$$) {
     # must be run in a workarea.  $bname and patch-queue/$bname
     # ought not to exist.  Leaves you on patch-queue/$bname with
     # the patches staged but not committed.
     # must be run in a workarea.  $bname and patch-queue/$bname
     # ought not to exist.  Leaves you on patch-queue/$bname with
     # the patches staged but not committed.
+    # returns 1 if there were any patches
     printdebug "gbp_pq_export $bname $base $tip\n";
     runcmd @git, qw(checkout -q -b), $bname, $base;
     runcmd @git, qw(checkout -q -b), "patch-queue/$bname", $tip;
     printdebug "gbp_pq_export $bname $base $tip\n";
     runcmd @git, qw(checkout -q -b), $bname, $base;
     runcmd @git, qw(checkout -q -b), "patch-queue/$bname", $tip;
@@ -503,7 +504,9 @@ sub gbp_pq_export ($$$) {
        { local ($!,$?); copy('../gbp-pq-err', \*STDERR); }
        failedcmd @gbp_cmd;
     }
        { local ($!,$?); copy('../gbp-pq-err', \*STDERR); }
        failedcmd @gbp_cmd;
     }
-    runcmd @git, qw(add -f debian/patches) if stat_exists 'debian/patches';
+    return 0 unless stat_exists 'debian/patches';
+    runcmd @git, qw(add -f debian/patches);
+    return 1;
 }
 
 
 }