Skip to contentSkip to conversation

Make GIT_INDEX_FILE apply to git-commit

PATCH In review Remi Vanicat 2 participants 4 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make GIT_INDEX_FILE apply to git-commit

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

---
 git-commit.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
git-commit.sh +1 -1
index fcb8443..6490045 100755
@@ -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

#3 lore raw
Quoted 5 lines · Remi Vanicat

2007/11/10, Junio C Hamano <[email protected]>:

Quoted 2 lines

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.