Skip to contentSkip to conversation

confused by git diff --exit-code

PATCH Bogolisk 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore

Bogolisk

author
#0 lore raw

With merge conflicts in the work-tree, diff's exit-code seems inconsistent. I thought --quiet implied --exit-code

/others/foo$ git diff --quiet
/others/foo$ echo $?
1

/others/foo$ git diff --exit-code

foo.txt +0 -0
diff --cc foo.txt
index f3dc283,bea67fd..0000000

/others/foo$ echo $?
0

/others/foo$ git diff --cc --quiet
/others/foo$ echo $?
0

/others/foo$ git diff --cc --exit-code

foo.txt +0 -0
diff --cc foo.txt
index f3dc283,bea67fd..0000000

/others/foo$ echo $?
0