Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Start-Process "git" returns strange 129 exit code

In Bash

$ git status > /dev/null; echo $?
0

Same repository in Powershell

$> (Start-Process git -ArgumentList="status" -Wait -PassThru).ExitCode
129

What is going on here, what 129 means and why it is not equal to 0 and how to get it right?

like image 617
ДМИТРИЙ МАЛИКОВ Avatar asked Feb 12 '14 16:02

ДМИТРИЙ МАЛИКОВ


1 Answers

When you specify the arguments to git incorrectly (and needs to print its usage) it will exit with error code 129:

C:\Temp>git status --asdf
error: unknown option `asdf`
usage: git status [options] [--] <filepattern>...

    .... help is printed here ....

C:\Temp>echo %ERRORLEVEL%
129

Is it possible that you are passing the commands through PowerShell incorrectly? (Eg, is -Wait -Passthrough being delivered to git-status?)

You could avoid passing arguments entirely by calling the git-status command instead of calling git with the status argument.

like image 156
Edward Thomson Avatar answered Nov 01 '22 00:11

Edward Thomson