jenkinsci / jenkinsci/workflow-basic-steps-plugin

[JENKINS-56098] Not a git repository after unstash when useDefaultExcludes: false

Aperta
#484 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub
component:workflow-basic-steps-plugin imported-jira-issue priority:major resolution:unresolved
Lingua principale
Java
Stelle
73
Fork
129
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

 

Not a git repository after unstash when useDefaultExcludes: false

Jenkins ver. 2.150.2


 
Pipeline: Basic Steps

Commonly used steps for Pipelines.
2.14

Pipeline:

pipeline {

agent none
stages {
stage('Checkout') {
agent {
label('node1')
}
steps {
checkout()
sh("ls -la .git")
sh("git whatchanged -n 1")
}
post {
success {
stash(name: 'workspace', useDefaultExcludes: false)
}
}
}
stage('Unstash') {
agent {
label('node2')
}
steps {
unstash('workspace')
sh("ls -la .git")
sh("git whatchanged -n 1")
}
}
}
}


Output:

 

```
> git rev-parse FETCH_HEAD^{commit} # timeout=10
> git config core.sparsecheckout # timeout=10
> git checkout -f fefba0cbdef04b2c80b8fa6bdd3ba660c5fe8937
> git rev-parse FETCH_HEAD^{commit} # timeout=10
> git rev-list --no-walk d4ff6fe4a6b83cc332774f18630ab5caacabe970 # timeout=10
[Pipeline] sh
+ ls -la .git
total 656
drwxrwxr-x 8 jenkins jenkins   4096 Feb 11 12:21 .
drwxrwxr-x 6 jenkins jenkins   4096 Feb 11 12:21 ..
drwxrwxr-x 2 jenkins jenkins   4096 Feb 11 12:21 branches
-rw-rw-r-- 1 jenkins jenkins    212 Feb 11 12:21 config
-rw-rw-r-- 1 jenkins jenkins     73 Feb 11 12:21 description
-rw-rw-r-- 1 jenkins jenkins    133 Feb 11 12:21 FETCH_HEAD
-rw-rw-r-- 1 jenkins jenkins     41 Feb 11 12:21 HEAD
drwxrwxr-x 2 jenkins jenkins   4096 Feb 11 12:21 hooks
-rw-rw-r-- 1 jenkins jenkins 619636 Feb 11 12:21 index
drwxrwxr-x 2 jenkins jenkins   4096 Feb 11 12:21 info
drwxrwxr-x 2 jenkins jenkins   4096 Feb 11 12:21 logs
drwxrwxr-x 4 jenkins jenkins   4096 Feb 11 12:21 objects
drwxrwxr-x 4 jenkins jenkins   4096 Feb 11 12:21 refs
[Pipeline] sh
+ git whatchanged -n 1
commit fefba0cbdef04b2c80b8fa6bdd3ba660c5fe8937
Author: user
Date:   Tue Feb 5 09:55:01 2019 +0100

    NOGM test

    Change-Id: I6c734ddf56ff950f44e43225a97e0dec997eebf7
:100644 100644 023b364... dd5f106... M SysConf/OverCurrentDetectorTest.cp
:100644 100644 5a4ccd2... 75ef104... M SysConf/PhoneUIHandlerMock.h
:100644 100644 0342fd4... 11394f8... M SysConf/RebootServiceTest.cpp
Post stage
[Pipeline] stash
Stashed 5065 file(s)
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Stash)
[Pipeline] node
[Pipeline] {
[Pipeline] unstash
[Pipeline] sh
+ ls -la .git
total 648
drwxrwxr-x 6 jenkins jenkins   4096 Feb 11 12:21 .
drwxrwxr-x 6 jenkins jenkins   4096 Feb 11 12:22 ..
-rw-rw-r-- 1 jenkins jenkins    212 Feb 11 12:21 config
-rw-rw-r-- 1 jenkins jenkins     73 Feb 11 12:21 description
-rw-rw-r-- 1 jenkins jenkins    133 Feb 11 12:21 FETCH_HEAD
-rw-rw-r-- 1 jenkins jenkins     41 Feb 11 12:21 HEAD
drwxrwxr-x 2 jenkins jenkins   4096 Feb 11 12:21 hooks
-rw-rw-r-- 1 jenkins jenkins 619636 Feb 11 12:21 index
drwxrwxr-x 2 jenkins jenkins   4096 Feb 11 12:21 info
drwxrwxr-x 2 jenkins jenkins   4096 Feb 11 12:21 logs
drwxrwxr-x 3 jenkins jenkins   4096 Feb 11 12:21 objects
[Pipeline] dir
[Pipeline] {
[Pipeline] sh
+ git whatchanged -n 1
fatal: Not a git repository (or any of the parent directories): .git

```

---
Originally reported by grzzie, imported from: Not a git repository after unstash when useDefaultExcludes: false


  • assignee: rsandell
  • status: Open
  • priority: Major
  • component(s): workflow-basic-steps-plugin
  • resolution: Unresolved
  • votes: 6
  • watchers: 8
  • imported: 20251215-220547

Raw content of original issue

 

Not a git repository after unstash when useDefaultExcludes: false

Jenkins ver. 2.150.2


 
Pipeline: Basic Steps
Commonly used steps for Pipelines.
2.14

Pipeline:



pipeline {

agent none
stages {
stage('Checkout') {
agent {
label('node1')
}
steps {
checkout()
sh("ls -la .git")
sh("git whatchanged -n 1")
}
post {
success {
stash(name: 'workspace', useDefaultExcludes: false)
}
}
}
stage('Unstash') {
agent {
label('node2')
}
steps {
unstash('workspace')
sh("ls -la .git")
sh("git whatchanged -n 1")
}
}
}
}



Output:

 



 > git rev-parse FETCH_HEAD^{commit} # timeout=10

> git config core.sparsecheckout # timeout=10
> git checkout -f fefba0cbdef04b2c80b8fa6bdd3ba660c5fe8937
> git rev-parse FETCH_HEAD^{commit} # timeout=10
> git rev-list --no-walk d4ff6fe4a6b83cc332774f18630ab5caacabe970 # timeout=10
[Pipeline] sh
+ ls -la .git
total 656
drwxrwxr-x 8 jenkins jenkins   4096 Feb 11 12:21 .
drwxrwxr-x 6 jenkins jenkins   4096 Feb 11 12:21 ..
drwxrwxr-x 2 jenkins jenkins   4096 Feb 11 12:21 branches
-rw-rw-r-- 1 jenkins jenkins    212 Feb 11 12:21 config
-rw-rw-r-- 1 jenkins jenkins     73 Feb 11 12:21 description
-rw-rw-r-- 1 jenkins jenkins    133 Feb 11 12:21 FETCH_HEAD
-rw-rw-r-- 1 jenkins jenkins     41 Feb 11 12:21 HEAD
drwxrwxr-x 2 jenkins jenkins   4096 Feb 11 12:21 hooks
-rw-rw-r-- 1 jenkins jenkins 619636 Feb 11 12:21 index
drwxrwxr-x 2 jenkins jenkins   4096 Feb 11 12:21 info
drwxrwxr-x 2 jenkins jenkins   4096 Feb 11 12:21 logs
drwxrwxr-x 4 jenkins jenkins   4096 Feb 11 12:21 objects
drwxrwxr-x 4 jenkins jenkins   4096 Feb 11 12:21 refs
[Pipeline] sh
+ git whatchanged -n 1
commit fefba0cbdef04b2c80b8fa6bdd3ba660c5fe8937
Author: user <user@domain.com>
Date:   Tue Feb 5 09:55:01 2019 +0100

    NOGM test

    Change-Id: I6c734ddf56ff950f44e43225a97e0dec997eebf7
:100644 100644 023b364... dd5f106... M SysConf/OverCurrentDetectorTest.cp
:100644 100644 5a4ccd2... 75ef104... M SysConf/PhoneUIHandlerMock.h
:100644 100644 0342fd4... 11394f8... M SysConf/RebootServiceTest.cpp
Post stage
[Pipeline] stash
Stashed 5065 file(s)
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Stash)
[Pipeline] node
[Pipeline] {
[Pipeline] unstash
[Pipeline] sh
+ ls -la .git
total 648
drwxrwxr-x 6 jenkins jenkins   4096 Feb 11 12:21 .
drwxrwxr-x 6 jenkins jenkins   4096 Feb 11 12:22 ..
-rw-rw-r-- 1 jenkins jenkins    212 Feb 11 12:21 config
-rw-rw-r-- 1 jenkins jenkins     73 Feb 11 12:21 description
-rw-rw-r-- 1 jenkins jenkins    133 Feb 11 12:21 FETCH_HEAD
-rw-rw-r-- 1 jenkins jenkins     41 Feb 11 12:21 HEAD
drwxrwxr-x 2 jenkins jenkins   4096 Feb 11 12:21 hooks
-rw-rw-r-- 1 jenkins jenkins 619636 Feb 11 12:21 index
drwxrwxr-x 2 jenkins jenkins   4096 Feb 11 12:21 info
drwxrwxr-x 2 jenkins jenkins   4096 Feb 11 12:21 logs
drwxrwxr-x 3 jenkins jenkins   4096 Feb 11 12:21 objects
[Pipeline] dir
[Pipeline] {
[Pipeline] sh
+ git whatchanged -n 1
fatal: Not a git repository (or any of the parent directories): .git


Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.