Skip to content

Commit 0877f5d

Browse files
committed
shears: allow overriding the editor via GIT_EDITOR
If the GIT_EDITOR variable was already exported, `git var GIT_EDITOR` would pick up the *already-overridden* editor, causing an infinite loop. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent a7b41a0 commit 0877f5d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

shears.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -585,15 +585,15 @@ setup () {
585585
586586
git config alias..r "!sh \"$this\"" &&
587587
generate_script > "$git_dir"/SHEARS-SCRIPT &&
588-
GIT_EDITOR="$(cd "$git_dir" && pwd)/SHEARS-EDITOR" &&
589-
cat > "$GIT_EDITOR" << EOF &&
588+
shears_editor="$(cd "$git_dir" && pwd)/SHEARS-EDITOR" &&
589+
cat > "$shears_editor" << EOF &&
590590
#!/bin/sh
591591
592592
exec "$this" edit "$(git var GIT_EDITOR)" "\$@"
593593
EOF
594-
chmod +x "$GIT_EDITOR" &&
595-
GIT_EDITOR="\"$GIT_EDITOR\"" &&
596-
GIT_SEQUENCE_EDITOR="$GIT_EDITOR" &&
594+
chmod +x "$shears_editor" &&
595+
GIT_EDITOR="\"$shears_editor\"" &&
596+
GIT_SEQUENCE_EDITOR="$shears_editor" &&
597597
export GIT_EDITOR GIT_SEQUENCE_EDITOR
598598
}
599599

0 commit comments

Comments
 (0)