The stash step fails if there's no files are selected to be stashed. Allowing that to optionally work would make it easier to make Jenkinsfile more generic, by stashing files that might not get generated on some repositories, instead of passing information around with fields, or catching failure when unstashing (which still leaves the corresponding log marked as Failure in the build).

          [JENKINS-37327] Allow stashing/unstashing empty sets

          Daniel Sobral created issue -
          Andrew Bayer made changes -
          Component/s New: pipeline-general [ 21692 ]
          Andrew Bayer made changes -
          Component/s Original: workflow-plugin [ 18820 ]

          Max Wahler added a comment -

          Moreover, stash doesn't include empty directories that might be used after an unstash.

          Max Wahler added a comment - Moreover, stash doesn't include empty directories that might be used after an unstash .
          Jesse Glick made changes -
          Component/s New: workflow-basic-steps-plugin [ 21712 ]
          Component/s Original: pipeline [ 21692 ]
          Jesse Glick made changes -
          Assignee Original: Jesse Glick [ jglick ]
          Jesse Glick made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Jesse Glick made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Jesse Glick made changes -
          Remote Link New: This issue links to "workflow-basic-steps PR 42 (Web Link)" [ 16933 ]

          Code changed in jenkins
          User: Iain Adams
          Path:
          src/main/java/org/jenkinsci/plugins/workflow/flow/StashManager.java
          http://jenkins-ci.org/commit/workflow-api-plugin/9e3a0d00ce97280a906018a82a5b1cf3b745f62c
          Log:
          JENKINS-37327 allow empty stash.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Iain Adams Path: src/main/java/org/jenkinsci/plugins/workflow/flow/StashManager.java http://jenkins-ci.org/commit/workflow-api-plugin/9e3a0d00ce97280a906018a82a5b1cf3b745f62c Log: JENKINS-37327 allow empty stash.

            Unassigned Unassigned
            dcsobral Daniel Sobral
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: