romkatv / gitstatus

Git status for Bash and Zsh prompt
GNU General Public License v3.0
1.65k stars 101 forks source link

Negative fetch refspec breaks gitstatus #438

Open Frederick888 opened 3 weeks ago

Frederick888 commented 3 weeks ago

My CI pushes some generate files to <current branch/tag>-deploy branches/tags. Usually I don't want to fetch them, so I added two negative fetch refspecs:

[remote "origin"]
    url = https://github.com/Frederick888/playground.git
    pushurl = git@github.com:Frederick888/playground.git
    fetch = +refs/heads/*:refs/remotes/origin/*
    fetch = ^refs/heads/*-deploy
    fetch = ^refs/tags/*-deploy
    tagOpt = --tags
    gh-resolved = base

This breaks gitstatus.

For example, git clone https://github.com/Frederick888/playground.git; cd playground; git reset --hard HEAD~, then without the negative refspecs, the response is:

'id'
'1'
'/Users/frederick/programming/Others/playground'
'b46755b65173bbc9733356ec8a7a8c0214f33910'
'master'
'master'
'origin'
'https://github.com/Frederick888/playground.git'
''
'16'
'0'
'0'
'0'
'0'
'0'
'1'
'0'
''
'0'
'0'
'0'
'origin'
'https://github.com/Frederick888/playground.git'
'0'
'1'
'0'
'0'
''
'Commit 2 on master'

With the negative refspecs, the response is:

'id'
'1'
'/Users/frederick/programming/Others/playground'
'b46755b65173bbc9733356ec8a7a8c0214f33910'
'master'
''
''
''
''
'16'
'0'
'0'
'0'
'0'
'0'
'0'
'0'
''
'0'
'0'
'0'
''
''
'0'
'0'
'0'
'0'
''
'Commit 2 on master'