-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Since baaf233 (connect: improve check for plink to reduce false positives, 2015-04-26), t5601 writes out a `plink.exe` for testing that is actually a shell script. So the assumption that the `.exe` extension implies that the file is *not* a shell script is now wrong. Since there was no love for the idea of allowing `.exe` files to be shell scripts on Windows, let's go the other way round: *make* `plink.exe` a real `.exe`. This fixes t5601-clone.sh in Git for Windows' SDK. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
- Loading branch information
Johannes Schindelin
authored and
Junio C Hamano
committed
Jan 27, 2016
1 parent
4b0abd5
commit 3064d5a
Showing
3 changed files
with
39 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include "git-compat-util.h" | ||
#include "run-command.h" | ||
#include "strbuf.h" | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
const char *trash_directory = getenv("TRASH_DIRECTORY"); | ||
struct strbuf buf = STRBUF_INIT; | ||
FILE *f; | ||
int i; | ||
const char *child_argv[] = { NULL, NULL }; | ||
|
||
/* First, print all parameters into $TRASH_DIRECTORY/ssh-output */ | ||
if (!trash_directory) | ||
die("Need a TRASH_DIRECTORY!"); | ||
strbuf_addf(&buf, "%s/ssh-output", trash_directory); | ||
f = fopen(buf.buf, "w"); | ||
if (!f) | ||
die("Could not write to %s", buf.buf); | ||
for (i = 0; i < argc; i++) | ||
fprintf(f, "%s%s", i > 0 ? " " : "", i > 0 ? argv[i] : "ssh:"); | ||
fprintf(f, "\n"); | ||
fclose(f); | ||
|
||
/* Now, evaluate the *last* parameter */ | ||
if (argc < 2) | ||
return 0; | ||
child_argv[0] = argv[argc - 1]; | ||
return run_command_v_opt(child_argv, RUN_USING_SHELL); | ||
} |