summaryrefslogtreecommitdiff
path: root/trace2/tr2_tgt.h
diff options
context:
space:
mode:
authorLibravatar Johannes Schindelin <johannes.schindelin@gmx.de>2019-12-21 21:57:16 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-12-21 16:06:22 -0800
commitc480eeb574e649a19f27dc09a994e45f9b2c2622 (patch)
treed23f602efc4f3886c3e6b24d0811537d6b398af3 /trace2/tr2_tgt.h
parentbuilt-in add -p: implement the "worktree" patch modes (diff)
downloadtgif-c480eeb574e649a19f27dc09a994e45f9b2c2622.tar.xz
commit --interactive: make it work with the built-in `add -i`
The built-in `git add -i` machinery obviously has its `the_repository` structure initialized at the point where `cmd_commit()` calls it, and therefore does not look at the environment variable `GIT_INDEX_FILE`. But when being called from `commit --interactive`, it has to, because the index was already locked in that case, and we want to ask the interactive add machinery to work on the `index.lock` file instead of the `index` file. Technically, we could teach `run_add_i()`, or for that matter `run_add_p()`, to look specifically at that environment variable, but the entire idea of passing in a parameter of type `struct repository *` is to allow working on multiple repositories (and their index files) independently. So let's instead override the `index_file` field of that structure temporarily. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'trace2/tr2_tgt.h')
0 files changed, 0 insertions, 0 deletions