"git diff --no-pager --exit-code" errors out but returns zero exit code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I recently found out (the hard way :-) ) that running the following
command prints an appropriate error on stderr but returns a zero exit
code:

> $ git diff --no-pager --exit-code
> error: invalid option: --no-pager
> $ echo $?
> 0

I would expect a non-zero exit code to be returned.

Interestingly, running `git diff --no-pager --exit-code HEAD` shows a
usage instead and does return a non-zero exit code as expected.

Thanks,
-- 
Romain Chossart



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux