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

0 views
Skip to first unread message

grzegorz.zieba.ext@gigaset.com (JIRA)

unread,
Feb 12, 2019, 3:43:04 AM2/12/19
to jenkinsc...@googlegroups.com
Grzegorz Zieba created an issue
 
Jenkins / Bug JENKINS-56098
Not a git repository after unstash when useDefaultExcludes: false
Issue Type: Bug Bug
Assignee: Unassigned
Components: workflow-basic-steps-plugin
Created: 2019-02-12 08:42
Priority: Major Major
Reporter: Grzegorz Zieba

 

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 <us...@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
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

grzegorz.zieba.ext@gigaset.com (JIRA)

unread,
Feb 21, 2019, 2:18:03 AM2/21/19
to jenkinsc...@googlegroups.com

fofanamomo@hotmail.com (JIRA)

unread,
May 15, 2019, 10:52:36 AM5/15/19
to jenkinsc...@googlegroups.com
AbouBakar Fofana commented on Bug JENKINS-56098
 
Re: Not a git repository after unstash when useDefaultExcludes: false

I am having the same issue when running a git status in a stage after unstashing. The error display is fatal: Not a git repository (or any of the parent directories): .git. I am running Jenkins 2.164.3

grzegorz.zieba.ext@gigaset.com (JIRA)

unread,
Nov 20, 2019, 2:15:02 PM11/20/19
to jenkinsc...@googlegroups.com

AbouBakar Fofana run 'git init' after unstash as a workaround. 

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages