diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2007-09-02 15:19:07 -0400 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2007-09-03 23:01:44 -0400 |
commit | 6e4ba05c7fee0d0140e2057b63f5ca4eea9a6053 (patch) | |
tree | 01a9096e0bb99779e8987bfeff055b8df7effe80 | |
parent | c80d25dbce759a8483ffc1f085fdf4cd63cf9f05 (diff) | |
download | git-6e4ba05c7fee0d0140e2057b63f5ca4eea9a6053.tar.gz |
git-gui: Correct starting of git-remote to handle -w option
Current versions of git-remote apparently are passing the -w option
to Perl as part of the shbang line:
#!/usr/bin/perl -w
this caused a problem in git-gui and gave the user a Tcl error with
the message: "git-remote not supported: #!/usr/bin/perl -w".
The fix for this is to treat the shbang line as a Tcl list and look
at the first element only for guessing the executable name. Once
we know the executable name we use the remaining elements (if any
exist) as arguments to the executable, before the script filename.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
-rwxr-xr-x | git-gui.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/git-gui.sh b/git-gui.sh index fa30ccc5d6..e495046c3b 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -261,7 +261,7 @@ proc _git_cmd {name} { set s [gets $f] close $f - switch -glob -- $s { + switch -glob -- [lindex $s 0] { #!*sh { set i sh } #!*perl { set i perl } #!*python { set i python } @@ -275,7 +275,7 @@ proc _git_cmd {name} { if {$interp eq {}} { error "git-$name requires $i (not in PATH)" } - set v [list $interp $p] + set v [concat [list $interp] [lrange $s 1 end] [list $p]] } else { # Assume it is builtin to git somehow and we # aren't actually able to see a file for it. |