Skip to contentSkip to conversation

t2203: fix wrong commit command

PATCH In review Nguyễn Thái Ngọc Duy 3 participants 5 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 t2203: fix wrong commit command

Add commit message to avoid commit's aborting due to the lack of commit message, not because there are INTENT_TO_ADD entries in index.

---
 t/t2203-add-intent.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
t/t2203-add-intent.sh +1 -1
index 58a3299..2543529 100755
@@ -41,7 +41,7 @@ test_expect_success 'cannot commit with i-t-a entry' '
 	echo frotz >nitfol &&
 	git add rezrov &&
 	git add -N nitfol &&
-	test_must_fail git commit
+	test_must_fail git commit -m initial
 '
 
 test_expect_success 'can commit with an unrelated i-t-a entry in index' '
Signature · 1 line
1.7.3.1.256.g2539c.dirty
#2 lore raw
In reply to Nguyễn Thái Ngọc Duy

Hi Duy,

Quoted 2 lines · Nguyễn Thái Ngọc Duy

Add commit message to avoid commit's aborting due to the lack of commit message, not because there are INTENT_TO_ADD entries in index.

Is there any way to differentiate between the two kinds of errors, so that we can avoid this in the future? Can we grep the error message for something, or inspect the exit status?

-- Ram

#3 lore raw

2012/1/11 Ramkumar Ramachandra <[email protected]>:

Quoted 9 lines

Hi Duy,

Quoted 2 lines · Nguyễn Thái Ngọc Duy

Add commit message to avoid commit's aborting due to the lack of commit message, not because there are INTENT_TO_ADD entries in index.

Is there any way to differentiate between the two kinds of errors, so that we can avoid this in the future?  Can we grep the error message for something, or inspect the exit status?

commit exits with 1 in both cases, so no.

Signature · 1 line
Duy
#4 lore raw
Quoted 4 lines · Nguyen Thai Ngoc Duy

2012/1/11 Ramkumar Ramachandra <[email protected]>:

Quoted 3 lines

Hi Duy,

Nguyễn Thái Ngọc Duy wrote:

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Add commit message to avoid commit's aborting due to the lack of commit message, not because there are INTENT_TO_ADD entries in index.

Is there any way to differentiate between the two kinds of errors, so that we can avoid this in the future?  Can we grep the error message for something, or inspect the exit status?

commit exits with 1 in both cases, so no.

but grepping error message should work, sorry I hit send too fast

Signature · 1 line
Duy