diff options
-rwxr-xr-x | t/t0050-filesystem.sh | 4 | ||||
-rwxr-xr-x | t/t3404-rebase-interactive.sh | 3 | ||||
-rwxr-xr-x | t/t3419-rebase-patch-id.sh | 4 | ||||
-rw-r--r-- | t/test-lib.sh | 2 | ||||
-rw-r--r-- | wt-status.c | 10 | ||||
-rw-r--r-- | xdiff-interface.c | 4 |
6 files changed, 20 insertions, 7 deletions
diff --git a/t/t0050-filesystem.sh b/t/t0050-filesystem.sh index 41df6bcf2..07357ee1f 100755 --- a/t/t0050-filesystem.sh +++ b/t/t0050-filesystem.sh @@ -4,8 +4,8 @@ test_description='Various filesystem issues' . ./test-lib.sh -auml=`printf '\xc3\xa4'` -aumlcdiar=`printf '\x61\xcc\x88'` +auml=$(printf '\303\244') +aumlcdiar=$(printf '\141\314\210') case_insensitive= unibad= diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh index 7d20a74c5..9e9474e94 100755 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3404-rebase-interactive.sh @@ -67,8 +67,9 @@ test_expect_success 'setup' ' # "exec" commands are ran with the user shell by default, but this may # be non-POSIX. For example, if SHELL=zsh then ">file" doesn't work # to create a file. Unseting SHELL avoids such non-portable behavior -# in tests. +# in tests. It must be exported for it to take effect where needed. SHELL= +export SHELL test_expect_success 'rebase -i with the exec command' ' git checkout master && diff --git a/t/t3419-rebase-patch-id.sh b/t/t3419-rebase-patch-id.sh index 1aee48351..bd8efaf00 100755 --- a/t/t3419-rebase-patch-id.sh +++ b/t/t3419-rebase-patch-id.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh test_description='git rebase - test patch id computation' @@ -27,7 +27,7 @@ scramble() then echo "$x" fi - i=$(((i+1) % 10)) + i=$((($i+1) % 10)) done < "$1" > "$1.new" mv -f "$1.new" "$1" } diff --git a/t/test-lib.sh b/t/test-lib.sh index c6afebb00..1fb76abd1 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -260,7 +260,7 @@ test_decode_color () { if (n == 47) return "BWHITE"; } { - while (match($0, /\x1b\[[0-9;]*m/) != 0) { + while (match($0, /\033\[[0-9;]*m/) != 0) { printf "%s<", substr($0, 1, RSTART-1); codes = substr($0, RSTART+2, RLENGTH-3); if (length(codes) == 0) diff --git a/wt-status.c b/wt-status.c index fc2438f60..9624865e2 100644 --- a/wt-status.c +++ b/wt-status.c @@ -744,10 +744,20 @@ static void wt_shortstatus_status(int null_termination, struct string_list_item const char *one; if (d->head_path) { one = quote_path(d->head_path, -1, &onebuf, s->prefix); + if (*one != '"' && strchr(one, ' ') != NULL) { + putchar('"'); + strbuf_addch(&onebuf, '"'); + one = onebuf.buf; + } printf("%s -> ", one); strbuf_release(&onebuf); } one = quote_path(it->string, -1, &onebuf, s->prefix); + if (*one != '"' && strchr(one, ' ') != NULL) { + putchar('"'); + strbuf_addch(&onebuf, '"'); + one = onebuf.buf; + } printf("%s\n", one); strbuf_release(&onebuf); } diff --git a/xdiff-interface.c b/xdiff-interface.c index e1e054e4d..164581f87 100644 --- a/xdiff-interface.c +++ b/xdiff-interface.c @@ -212,8 +212,10 @@ int read_mmfile(mmfile_t *ptr, const char *filename) return error("Could not open %s", filename); sz = xsize_t(st.st_size); ptr->ptr = xmalloc(sz ? sz : 1); - if (sz && fread(ptr->ptr, sz, 1, f) != 1) + if (sz && fread(ptr->ptr, sz, 1, f) != 1) { + fclose(f); return error("Could not read %s", filename); + } fclose(f); ptr->size = sz; return 0; |