You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2020/06/13 12:39:25 UTC

[whimsy] branch master updated: Handle status exit code better

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 3b30824  Handle status exit code better
3b30824 is described below

commit 3b30824b2c44da0294d96f4b50f9fe01bb10a210
Author: Sebb <se...@apache.org>
AuthorDate: Sat Jun 13 13:27:51 2020 +0100

    Handle status exit code better
---
 lib/whimsy/asf/svn.rb | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lib/whimsy/asf/svn.rb b/lib/whimsy/asf/svn.rb
index 3f64b7d..469767e 100644
--- a/lib/whimsy/asf/svn.rb
+++ b/lib/whimsy/asf/svn.rb
@@ -348,8 +348,14 @@ module ASF
 
       # issue svn command
       out, err, status = Open3.capture3(*cmd, open_opts)
+
+      # Note: svn status exits with status 0 even if the target directory is missing or not a checkout
       if status.success?
-        return out
+        if out == '' and err != '' and %w(status stat st).include? command
+          return nil, err
+        else
+          return out
+        end
       else
         return nil, err
       end
@@ -603,6 +609,7 @@ module ASF
 
         # fail if there are pending changes
         status = `svn st #{tmpfile || tmpdir}`
+        # out, err = self.svn('status', tmpfile || tmpdir)
         unless rc == 0 && status.empty?
           raise "svn failure #{rc} #{path.inspect} #{status}"
         end