# [PATCH] Make GIT_INDEX_FILE apply to git-commit

4 messages from 2007-11-10 to 2007-11-10. Participants: Remi Vanicat, Junio C Hamano.
Thread: https://gitlist.dev/t/10782

## Remi Vanicat, 2007-11-10 10:00

Subject: [PATCH] Make GIT_INDEX_FILE apply to git-commit
Message-ID: <87abpml8rx.dlv@vanicat.homelinux.org>
URL: https://gitlist.dev/e/87abpml8rx.dlv%40vanicat.homelinux.org

```
Currently, when committing, git-commit ignore the value of
GIT_INDEX_FILE, and always use $GIT_DIR/index. This patch
fix it.

Signed-off-by: Rémi Vanicat <vanicat@debian.org>
---
 git-commit.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-commit.sh b/git-commit.sh
index fcb8443..6490045 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -26,7 +26,7 @@ refuse_partial () {
 }

 TMP_INDEX=
-THIS_INDEX="$GIT_DIR/index"
+THIS_INDEX="${GIT_INDEX_FILE:-$GIT_DIR/index}"
 NEXT_INDEX="$GIT_DIR/next-index$$"
 rm -f "$NEXT_INDEX"
 save_index () {
--
1.5.3.5

```

## Junio C Hamano, 2007-11-10 10:39

Subject: Re: [PATCH] Make GIT_INDEX_FILE apply to git-commit
Message-ID: <7vode2mljf.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vode2mljf.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <87abpml8rx.dlv@vanicat.homelinux.org>

```
Sounds sensible.  Tests?

```

## Remi Vanicat, 2007-11-10 18:38

Subject: Re: [PATCH] Make GIT_INDEX_FILE apply to git-commit
Message-ID: <6b8a91420711101038t3b2ca647v422f81d9365dd05d@mail.gmail.com>
URL: https://gitlist.dev/e/6b8a91420711101038t3b2ca647v422f81d9365dd05d%40mail.gmail.com
In-Reply-To: <7vode2mljf.fsf@gitster.siamese.dyndns.org>

```
2007/11/10, Junio C Hamano <gitster@pobox.com>:
> Sounds sensible.  Tests?
>

all test pass

```

## Junio C Hamano, 2007-11-10 18:45

Subject: Re: [PATCH] Make GIT_INDEX_FILE apply to git-commit
Message-ID: <7vbqa2lz1z.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vbqa2lz1z.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <6b8a91420711101038t3b2ca647v422f81d9365dd05d@mail.gmail.com>

```
"Remi Vanicat" <vanicat@debian.org> writes:

> 2007/11/10, Junio C Hamano <gitster@pobox.com>:
>> Sounds sensible.  Tests?
>>
>
> all test pass

Sorry for being too terse.  I did not mean existing tests.

Additional tests to make sure your fix will not be broken by
other people who touch the codepath later are requested.

```
