threads / patch / 10782

patchMake GIT_INDEX_FILE apply to git-commit

Subject: [PATCH] Make GIT_INDEX_FILE apply to git-commit

## tl;dr

4 messages between Nov 10, 2007 and Nov 10, 2007. Diffs are folded; open one to read it.

replies: 3people: 2as markdown or json

Remi Vanicat· Nov 10, 2007, 10:00 UTC · lore

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(-)
Show changes to git-commit.sh +1 −2
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· Nov 10, 2007, 18:45 UTC · re: Remi Vanicat · lore

Re: [PATCH] Make GIT_INDEX_FILE apply to git-commit

"Remi Vanicat" <vanicat@debian.org> writes:
Show 5 quoted lines
> 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.

← back to recent threads