Git status exit status ?
2008-03-15
1 $ git status 2 # On branch master 3 nothing to commit (working directory clean) 4 $ echo $? 5 1
Shouldn’t a successful git status in a git repository return a status code of 0 ? Doing it in a random folder returns a sensible value:
1 $ git status 2 fatal: Not a git repository 3 Failed to find a valid git directory. 4 $ echo $? 5 128
Can anybody shed some light on this ?
I found Possible bug in ‘git status’ exit code is 1 instead of 0. What is the rational for this ? It goes against everything Unix ?!?
blog comments powered by Disqus