diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-07-15 18:59:45 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-07-15 18:59:45 -0700 |
commit | 223bb84572c8b2058e175e8452913bcb1bdb0ade (patch) | |
tree | ec3704442ab81fdd9a1453878e0bd151dc019e62 | |
parent | Merge branch 'js/more-win' (diff) | |
parent | We need to check for msys as well as Windows in add--interactive. (diff) | |
download | tgif-223bb84572c8b2058e175e8452913bcb1bdb0ade.tar.xz |
Merge branch 'sp/win'
* sp/win:
We need to check for msys as well as Windows in add--interactive.
Convert CR/LF to LF in tag signatures
Fixed text file auto-detection: treat EOF character 032 at the end of file as printable
-rw-r--r-- | builtin-tag.c | 10 | ||||
-rw-r--r-- | convert.c | 4 | ||||
-rwxr-xr-x | git-add--interactive.perl | 2 |
3 files changed, 15 insertions, 1 deletions
diff --git a/builtin-tag.c b/builtin-tag.c index 3c97c696a5..a70922b21c 100644 --- a/builtin-tag.c +++ b/builtin-tag.c @@ -202,6 +202,7 @@ static int do_sign(struct strbuf *buffer) const char *args[4]; char *bracket; int len; + int i, j; if (!*signingkey) { if (strlcpy(signingkey, git_committer_info(IDENT_ERROR_ON_NO_NAME), @@ -241,6 +242,15 @@ static int do_sign(struct strbuf *buffer) if (finish_command(&gpg) || !len || len < 0) return error("gpg failed to sign the tag"); + /* Strip CR from the line endings, in case we are on Windows. */ + for (i = j = 0; i < buffer->len; i++) + if (buffer->buf[i] != '\r') { + if (i != j) + buffer->buf[j] = buffer->buf[i]; + j++; + } + strbuf_setlen(buffer, j); + return 0; } @@ -61,6 +61,10 @@ static void gather_stats(const char *buf, unsigned long size, struct text_stat * else stats->printable++; } + + /* If file ends with EOF then don't count this EOF as non-printable. */ + if (size >= 1 && buf[size-1] == '\032') + stats->nonprintable--; } /* diff --git a/git-add--interactive.perl b/git-add--interactive.perl index a6a5c52b59..da768ee7ac 100755 --- a/git-add--interactive.perl +++ b/git-add--interactive.perl @@ -54,7 +54,7 @@ sub colored { my $patch_mode; sub run_cmd_pipe { - if ($^O eq 'MSWin32') { + if ($^O eq 'MSWin32' || $^O eq 'msys') { my @invalid = grep {m/[":*]/} @_; die "$^O does not support: @invalid\n" if @invalid; my @args = map { m/ /o ? "\"$_\"": $_ } @_; |