Compare commits
27 Commits
Author | SHA1 | Date | |
---|---|---|---|
ecad27cf98 | |||
8267cd11d6 | |||
441c4a4017 | |||
f54cb059b1 | |||
78f23bdf68 | |||
5015f01c12 | |||
c29edfefb6 | |||
f514ef9787 | |||
9a3d637541 | |||
811ce1b47c | |||
cd0120857b | |||
1add9aed85 | |||
13ec221d8c | |||
16018ae5fb | |||
ad34ad614d | |||
89ba311df3 | |||
631f6f1d47 | |||
0269f968b7 | |||
d349e0ee60 | |||
7e11052442 | |||
f6e6362107 | |||
7fcec48da9 | |||
852ff1c362 | |||
6b6c5f7a2f | |||
afcb6ee30a | |||
0615173998 | |||
c9e1f2c7f2 |
9
Documentation/RelNotes/2.2.3.txt
Normal file
9
Documentation/RelNotes/2.2.3.txt
Normal file
@ -0,0 +1,9 @@
|
||||
Git v2.2.3 Release Notes
|
||||
========================
|
||||
|
||||
Fixes since v2.2.2
|
||||
------------------
|
||||
|
||||
* A handful of codepaths that used to use fixed-sized arrays to hold
|
||||
pathnames have been corrected to use strbuf and other mechanisms to
|
||||
allow longer pathnames without fearing overflows.
|
21
Documentation/RelNotes/2.3.7.txt
Normal file
21
Documentation/RelNotes/2.3.7.txt
Normal file
@ -0,0 +1,21 @@
|
||||
Git v2.3.7 Release Notes
|
||||
========================
|
||||
|
||||
Fixes since v2.3.6
|
||||
------------------
|
||||
|
||||
* An earlier update to the parser that disects a URL broke an
|
||||
address, followed by a colon, followed by an empty string (instead
|
||||
of the port number), e.g. ssh://example.com:/path/to/repo.
|
||||
|
||||
* The completion script (in contrib/) contaminated global namespace
|
||||
and clobbered on a shell variable $x.
|
||||
|
||||
* The "git push --signed" protocol extension did not limit what the
|
||||
"nonce" that is a server-chosen string can contain or how long it
|
||||
can be, which was unnecessarily lax. Limit both the length and the
|
||||
alphabet to a reasonably small space that can still have enough
|
||||
entropy.
|
||||
|
||||
Also contains typofixes, documentation updates and trivial code
|
||||
clean-ups.
|
22
Documentation/RelNotes/2.3.8.txt
Normal file
22
Documentation/RelNotes/2.3.8.txt
Normal file
@ -0,0 +1,22 @@
|
||||
Git v2.3.8 Release Notes
|
||||
========================
|
||||
|
||||
Fixes since v2.3.7
|
||||
------------------
|
||||
|
||||
* The usual "git diff" when seeing a file turning into a directory
|
||||
showed a patchset to remove the file and create all files in the
|
||||
directory, but "git diff --no-index" simply refused to work. Also,
|
||||
when asked to compare a file and a directory, imitate POSIX "diff"
|
||||
and compare the file with the file with the same name in the
|
||||
directory, instead of refusing to run.
|
||||
|
||||
* The default $HOME/.gitconfig file created upon "git config --global"
|
||||
that edits it had incorrectly spelled user.name and user.email
|
||||
entries in it.
|
||||
|
||||
* "git commit --date=now" or anything that relies on approxidate lost
|
||||
the daylight-saving-time offset.
|
||||
|
||||
Also contains typofixes, documentation updates and trivial code
|
||||
clean-ups.
|
9
Documentation/RelNotes/2.3.9.txt
Normal file
9
Documentation/RelNotes/2.3.9.txt
Normal file
@ -0,0 +1,9 @@
|
||||
Git v2.3.9 Release Notes
|
||||
========================
|
||||
|
||||
Fixes since v2.3.8
|
||||
------------------
|
||||
|
||||
* A handful of codepaths that used to use fixed-sized arrays to hold
|
||||
pathnames have been corrected to use strbuf and other mechanisms to
|
||||
allow longer pathnames without fearing overflows.
|
@ -10,7 +10,7 @@
|
||||
Include additional statistics at the end of blame output.
|
||||
|
||||
-L <start>,<end>::
|
||||
-L :<regex>::
|
||||
-L :<funcname>::
|
||||
Annotate only the given line range. May be specified multiple times.
|
||||
Overlapping ranges are allowed.
|
||||
+
|
||||
|
@ -62,9 +62,9 @@ produced by `--stat`, etc.
|
||||
output by allowing them to allocate space in advance.
|
||||
|
||||
-L <start>,<end>:<file>::
|
||||
-L :<regex>:<file>::
|
||||
-L :<funcname>:<file>::
|
||||
Trace the evolution of the line range given by "<start>,<end>"
|
||||
(or the funcname regex <regex>) within the <file>. You may
|
||||
(or the function name regex <funcname>) within the <file>. You may
|
||||
not give any pathspec limiters. This is currently limited to
|
||||
a walk starting from a single revision, i.e., you may only
|
||||
give zero or one positive revision arguments.
|
||||
|
@ -43,9 +43,12 @@ unreleased) version of Git, that is available from the 'master'
|
||||
branch of the `git.git` repository.
|
||||
Documentation for older releases are available here:
|
||||
|
||||
* link:v2.3.6/git.html[documentation for release 2.3.6]
|
||||
* link:v2.3.9/git.html[documentation for release 2.3.9]
|
||||
|
||||
* release notes for
|
||||
link:RelNotes/2.3.9.txt[2.3.9],
|
||||
link:RelNotes/2.3.8.txt[2.3.8],
|
||||
link:RelNotes/2.3.7.txt[2.3.7],
|
||||
link:RelNotes/2.3.6.txt[2.3.6],
|
||||
link:RelNotes/2.3.5.txt[2.3.5],
|
||||
link:RelNotes/2.3.4.txt[2.3.4],
|
||||
@ -54,9 +57,10 @@ Documentation for older releases are available here:
|
||||
link:RelNotes/2.3.1.txt[2.3.1],
|
||||
link:RelNotes/2.3.0.txt[2.3].
|
||||
|
||||
* link:v2.2.2/git.html[documentation for release 2.2.2]
|
||||
* link:v2.2.3/git.html[documentation for release 2.2.3]
|
||||
|
||||
* release notes for
|
||||
link:RelNotes/2.2.3.txt[2.2.3],
|
||||
link:RelNotes/2.2.2.txt[2.2.2],
|
||||
link:RelNotes/2.2.1.txt[2.2.1],
|
||||
link:RelNotes/2.2.0.txt[2.2].
|
||||
|
@ -99,10 +99,10 @@ linkgit:git-rev-list[1] for a complete list.
|
||||
detailed explanation.)
|
||||
|
||||
-L<start>,<end>:<file>::
|
||||
-L:<regex>:<file>::
|
||||
-L:<funcname>:<file>::
|
||||
|
||||
Trace the evolution of the line range given by "<start>,<end>"
|
||||
(or the funcname regex <regex>) within the <file>. You may
|
||||
(or the function name regex <funcname>) within the <file>. You may
|
||||
not give any pathspec limiters. This is currently limited to
|
||||
a walk starting from a single revision, i.e., you may only
|
||||
give zero or one positive revision arguments.
|
||||
|
@ -22,8 +22,9 @@ This is only valid for <end> and will specify a number
|
||||
of lines before or after the line given by <start>.
|
||||
|
||||
+
|
||||
If ``:<regex>'' is given in place of <start> and <end>, it denotes the range
|
||||
from the first funcname line that matches <regex>, up to the next
|
||||
funcname line. ``:<regex>'' searches from the end of the previous `-L` range,
|
||||
if any, otherwise from the start of file.
|
||||
``^:<regex>'' searches from the start of file.
|
||||
If ``:<funcname>'' is given in place of <start> and <end>, it is a
|
||||
regular expression that denotes the range from the first funcname line
|
||||
that matches <funcname>, up to the next funcname line. ``:<funcname>''
|
||||
searches from the end of the previous `-L` range, if any, otherwise
|
||||
from the start of file. ``^:<funcname>'' searches from the start of
|
||||
file.
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
GVF=GIT-VERSION-FILE
|
||||
DEF_VER=v2.3.6
|
||||
DEF_VER=v2.3.9
|
||||
|
||||
LF='
|
||||
'
|
||||
|
@ -455,9 +455,9 @@ static char *default_user_config(void)
|
||||
struct strbuf buf = STRBUF_INIT;
|
||||
strbuf_addf(&buf,
|
||||
_("# This is Git's per-user configuration file.\n"
|
||||
"[core]\n"
|
||||
"[user]\n"
|
||||
"# Please adapt and uncomment the following lines:\n"
|
||||
"# user = %s\n"
|
||||
"# name = %s\n"
|
||||
"# email = %s\n"),
|
||||
ident_default_name(),
|
||||
ident_default_email());
|
||||
|
@ -723,7 +723,6 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
|
||||
|
||||
if (reflog) {
|
||||
unsigned char sha1[20];
|
||||
char nth_desc[256];
|
||||
char *ref;
|
||||
int base = 0;
|
||||
unsigned int flags = 0;
|
||||
@ -762,6 +761,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
|
||||
|
||||
for (i = 0; i < reflog; i++) {
|
||||
char *logmsg;
|
||||
char *nth_desc;
|
||||
const char *msg;
|
||||
unsigned long timestamp;
|
||||
int tz;
|
||||
@ -780,8 +780,10 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
|
||||
show_date(timestamp, tz, 1),
|
||||
msg);
|
||||
free(logmsg);
|
||||
sprintf(nth_desc, "%s@{%d}", *av, base+i);
|
||||
|
||||
nth_desc = xstrfmt("%s@{%d}", *av, base+i);
|
||||
append_ref(nth_desc, sha1, 1);
|
||||
free(nth_desc);
|
||||
}
|
||||
free(ref);
|
||||
}
|
||||
|
@ -310,6 +310,8 @@ static void get_host_and_port(char **host, const char **port)
|
||||
if (end != colon + 1 && *end == '\0' && 0 <= portnr && portnr < 65536) {
|
||||
*colon = 0;
|
||||
*port = colon + 1;
|
||||
} else if (!colon[1]) {
|
||||
*colon = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -186,7 +186,7 @@ fi
|
||||
|
||||
__gitcompappend ()
|
||||
{
|
||||
local i=${#COMPREPLY[@]}
|
||||
local x i=${#COMPREPLY[@]}
|
||||
for x in $1; do
|
||||
if [[ "$x" == "$3"* ]]; then
|
||||
COMPREPLY[i++]="$2$x$4"
|
||||
|
14
date.c
14
date.c
@ -704,10 +704,17 @@ int parse_date_basic(const char *date, unsigned long *timestamp, int *offset)
|
||||
date += match;
|
||||
}
|
||||
|
||||
/* mktime uses local timezone */
|
||||
/* do not use mktime(), which uses local timezone, here */
|
||||
*timestamp = tm_to_time_t(&tm);
|
||||
if (*timestamp == -1)
|
||||
return -1;
|
||||
|
||||
if (*offset == -1) {
|
||||
time_t temp_time = mktime(&tm);
|
||||
time_t temp_time;
|
||||
|
||||
/* gmtime_r() in match_digit() may have clobbered it */
|
||||
tm.tm_isdst = -1;
|
||||
temp_time = mktime(&tm);
|
||||
if ((time_t)*timestamp > temp_time) {
|
||||
*offset = ((time_t)*timestamp - temp_time) / 60;
|
||||
} else {
|
||||
@ -715,9 +722,6 @@ int parse_date_basic(const char *date, unsigned long *timestamp, int *offset)
|
||||
}
|
||||
}
|
||||
|
||||
if (*timestamp == -1)
|
||||
return -1;
|
||||
|
||||
if (!tm_gmt)
|
||||
*timestamp -= *offset * 60;
|
||||
return 0; /* success */
|
||||
|
@ -97,8 +97,27 @@ static int queue_diff(struct diff_options *o,
|
||||
if (get_mode(name1, &mode1) || get_mode(name2, &mode2))
|
||||
return -1;
|
||||
|
||||
if (mode1 && mode2 && S_ISDIR(mode1) != S_ISDIR(mode2))
|
||||
return error("file/directory conflict: %s, %s", name1, name2);
|
||||
if (mode1 && mode2 && S_ISDIR(mode1) != S_ISDIR(mode2)) {
|
||||
struct diff_filespec *d1, *d2;
|
||||
|
||||
if (S_ISDIR(mode1)) {
|
||||
/* 2 is file that is created */
|
||||
d1 = noindex_filespec(NULL, 0);
|
||||
d2 = noindex_filespec(name2, mode2);
|
||||
name2 = NULL;
|
||||
mode2 = 0;
|
||||
} else {
|
||||
/* 1 is file that is deleted */
|
||||
d1 = noindex_filespec(name1, mode1);
|
||||
d2 = noindex_filespec(NULL, 0);
|
||||
name1 = NULL;
|
||||
mode1 = 0;
|
||||
}
|
||||
/* emit that file */
|
||||
diff_queue(&diff_queued_diff, d1, d2);
|
||||
|
||||
/* and then let the entire directory be created or deleted */
|
||||
}
|
||||
|
||||
if (S_ISDIR(mode1) || S_ISDIR(mode2)) {
|
||||
struct strbuf buffer1 = STRBUF_INIT;
|
||||
@ -182,12 +201,50 @@ static int queue_diff(struct diff_options *o,
|
||||
}
|
||||
}
|
||||
|
||||
/* append basename of F to D */
|
||||
static void append_basename(struct strbuf *path, const char *dir, const char *file)
|
||||
{
|
||||
const char *tail = strrchr(file, '/');
|
||||
|
||||
strbuf_addstr(path, dir);
|
||||
while (path->len && path->buf[path->len - 1] == '/')
|
||||
path->len--;
|
||||
strbuf_addch(path, '/');
|
||||
strbuf_addstr(path, tail ? tail + 1 : file);
|
||||
}
|
||||
|
||||
/*
|
||||
* DWIM "diff D F" into "diff D/F F" and "diff F D" into "diff F D/F"
|
||||
* Note that we append the basename of F to D/, so "diff a/b/file D"
|
||||
* becomes "diff a/b/file D/file", not "diff a/b/file D/a/b/file".
|
||||
*/
|
||||
static void fixup_paths(const char **path, struct strbuf *replacement)
|
||||
{
|
||||
unsigned int isdir0, isdir1;
|
||||
|
||||
if (path[0] == file_from_standard_input ||
|
||||
path[1] == file_from_standard_input)
|
||||
return;
|
||||
isdir0 = is_directory(path[0]);
|
||||
isdir1 = is_directory(path[1]);
|
||||
if (isdir0 == isdir1)
|
||||
return;
|
||||
if (isdir0) {
|
||||
append_basename(replacement, path[0], path[1]);
|
||||
path[0] = replacement->buf;
|
||||
} else {
|
||||
append_basename(replacement, path[1], path[0]);
|
||||
path[1] = replacement->buf;
|
||||
}
|
||||
}
|
||||
|
||||
void diff_no_index(struct rev_info *revs,
|
||||
int argc, const char **argv,
|
||||
const char *prefix)
|
||||
{
|
||||
int i, prefixlen;
|
||||
const char *paths[2];
|
||||
struct strbuf replacement = STRBUF_INIT;
|
||||
|
||||
diff_setup(&revs->diffopt);
|
||||
for (i = 1; i < argc - 2; ) {
|
||||
@ -217,6 +274,9 @@ void diff_no_index(struct rev_info *revs,
|
||||
p = xstrdup(prefix_filename(prefix, prefixlen, p));
|
||||
paths[i] = p;
|
||||
}
|
||||
|
||||
fixup_paths(paths, &replacement);
|
||||
|
||||
revs->diffopt.skip_stat_unmatch = 1;
|
||||
if (!revs->diffopt.output_format)
|
||||
revs->diffopt.output_format = DIFF_FORMAT_PATCH;
|
||||
@ -235,6 +295,8 @@ void diff_no_index(struct rev_info *revs,
|
||||
diffcore_std(&revs->diffopt);
|
||||
diff_flush(&revs->diffopt);
|
||||
|
||||
strbuf_release(&replacement);
|
||||
|
||||
/*
|
||||
* The return code for --no-index imitates diff(1):
|
||||
* 0 = no changes, 1 = changes, else error
|
||||
|
@ -575,7 +575,7 @@ parse_lines(struct commit *commit, const char *prefix, struct string_list *args)
|
||||
|
||||
name_part = skip_range_arg(item->string);
|
||||
if (!name_part || *name_part != ':' || !name_part[1])
|
||||
die("-L argument '%s' not of the form start,end:file",
|
||||
die("-L argument not 'start,end:file' or ':funcname:file': %s",
|
||||
item->string);
|
||||
range_part = xstrndup(item->string, name_part - item->string);
|
||||
name_part++;
|
||||
|
19
notes.c
19
notes.c
@ -362,13 +362,14 @@ static int non_note_cmp(const struct non_note *a, const struct non_note *b)
|
||||
return strcmp(a->path, b->path);
|
||||
}
|
||||
|
||||
static void add_non_note(struct notes_tree *t, const char *path,
|
||||
/* note: takes ownership of path string */
|
||||
static void add_non_note(struct notes_tree *t, char *path,
|
||||
unsigned int mode, const unsigned char *sha1)
|
||||
{
|
||||
struct non_note *p = t->prev_non_note, *n;
|
||||
n = (struct non_note *) xmalloc(sizeof(struct non_note));
|
||||
n->next = NULL;
|
||||
n->path = xstrdup(path);
|
||||
n->path = path;
|
||||
n->mode = mode;
|
||||
hashcpy(n->sha1, sha1);
|
||||
t->prev_non_note = n;
|
||||
@ -482,17 +483,17 @@ handle_non_note:
|
||||
* component.
|
||||
*/
|
||||
{
|
||||
char non_note_path[PATH_MAX];
|
||||
char *p = non_note_path;
|
||||
struct strbuf non_note_path = STRBUF_INIT;
|
||||
const char *q = sha1_to_hex(subtree->key_sha1);
|
||||
int i;
|
||||
for (i = 0; i < prefix_len; i++) {
|
||||
*p++ = *q++;
|
||||
*p++ = *q++;
|
||||
*p++ = '/';
|
||||
strbuf_addch(&non_note_path, *q++);
|
||||
strbuf_addch(&non_note_path, *q++);
|
||||
strbuf_addch(&non_note_path, '/');
|
||||
}
|
||||
strcpy(p, entry.path);
|
||||
add_non_note(t, non_note_path, entry.mode, entry.sha1);
|
||||
strbuf_addstr(&non_note_path, entry.path);
|
||||
add_non_note(t, strbuf_detach(&non_note_path, NULL),
|
||||
entry.mode, entry.sha1);
|
||||
}
|
||||
}
|
||||
free(buf);
|
||||
|
23
send-pack.c
23
send-pack.c
@ -281,6 +281,28 @@ free_return:
|
||||
return update_seen;
|
||||
}
|
||||
|
||||
#define NONCE_LEN_LIMIT 256
|
||||
|
||||
static void reject_invalid_nonce(const char *nonce, int len)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
if (NONCE_LEN_LIMIT <= len)
|
||||
die("the receiving end asked to sign an invalid nonce <%.*s>",
|
||||
len, nonce);
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
int ch = nonce[i] & 0xFF;
|
||||
if (isalnum(ch) ||
|
||||
ch == '-' || ch == '.' ||
|
||||
ch == '/' || ch == '+' ||
|
||||
ch == '=' || ch == '_')
|
||||
continue;
|
||||
die("the receiving end asked to sign an invalid nonce <%.*s>",
|
||||
len, nonce);
|
||||
}
|
||||
}
|
||||
|
||||
int send_pack(struct send_pack_args *args,
|
||||
int fd[], struct child_process *conn,
|
||||
struct ref *remote_refs,
|
||||
@ -323,6 +345,7 @@ int send_pack(struct send_pack_args *args,
|
||||
push_cert_nonce = server_feature_value("push-cert", &len);
|
||||
if (!push_cert_nonce)
|
||||
die(_("the receiving end does not support --signed push"));
|
||||
reject_invalid_nonce(push_cert_nonce, len);
|
||||
push_cert_nonce = xmemdupz(push_cert_nonce, len);
|
||||
}
|
||||
|
||||
|
@ -377,15 +377,12 @@ void read_info_alternates(const char * relative_base, int depth)
|
||||
char *map;
|
||||
size_t mapsz;
|
||||
struct stat st;
|
||||
const char alt_file_name[] = "info/alternates";
|
||||
/* Given that relative_base is no longer than PATH_MAX,
|
||||
ensure that "path" has enough space to append "/", the
|
||||
file name, "info/alternates", and a trailing NUL. */
|
||||
char path[PATH_MAX + 1 + sizeof alt_file_name];
|
||||
char *path;
|
||||
int fd;
|
||||
|
||||
sprintf(path, "%s/%s", relative_base, alt_file_name);
|
||||
path = xstrfmt("%s/info/alternates", relative_base);
|
||||
fd = git_open_noatime(path);
|
||||
free(path);
|
||||
if (fd < 0)
|
||||
return;
|
||||
if (fstat(fd, &st) || (st.st_size == 0)) {
|
||||
|
@ -55,4 +55,38 @@ test_expect_success 'git diff --no-index executed outside repo gives correct err
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success 'diff D F and diff F D' '
|
||||
(
|
||||
cd repo &&
|
||||
echo in-repo >a &&
|
||||
echo non-repo >../non/git/a &&
|
||||
mkdir sub &&
|
||||
echo sub-repo >sub/a &&
|
||||
|
||||
test_must_fail git diff --no-index sub/a ../non/git/a >expect &&
|
||||
test_must_fail git diff --no-index sub/a ../non/git/ >actual &&
|
||||
test_cmp expect actual &&
|
||||
|
||||
test_must_fail git diff --no-index a ../non/git/a >expect &&
|
||||
test_must_fail git diff --no-index a ../non/git/ >actual &&
|
||||
test_cmp expect actual &&
|
||||
|
||||
test_must_fail git diff --no-index ../non/git/a a >expect &&
|
||||
test_must_fail git diff --no-index ../non/git a >actual &&
|
||||
test_cmp expect actual
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success 'turning a file into a directory' '
|
||||
(
|
||||
cd non/git &&
|
||||
mkdir d e e/sub &&
|
||||
echo 1 >d/sub &&
|
||||
echo 2 >e/sub/file &&
|
||||
printf "D\td/sub\nA\te/sub/file\n" >expect &&
|
||||
test_must_fail git diff --no-index --name-status d e >actual &&
|
||||
test_cmp expect actual
|
||||
)
|
||||
'
|
||||
|
||||
test_done
|
||||
|
@ -54,14 +54,14 @@ canned_test "-L 4:a.c -L 8,12:a.c simple" multiple-superset
|
||||
canned_test "-L 8,12:a.c -L 4:a.c simple" multiple-superset
|
||||
|
||||
test_bad_opts "-L" "switch.*requires a value"
|
||||
test_bad_opts "-L b.c" "argument.*not of the form"
|
||||
test_bad_opts "-L 1:" "argument.*not of the form"
|
||||
test_bad_opts "-L b.c" "argument not .start,end:file"
|
||||
test_bad_opts "-L 1:" "argument not .start,end:file"
|
||||
test_bad_opts "-L 1:nonexistent" "There is no path"
|
||||
test_bad_opts "-L 1:simple" "There is no path"
|
||||
test_bad_opts "-L '/foo:b.c'" "argument.*not of the form"
|
||||
test_bad_opts "-L '/foo:b.c'" "argument not .start,end:file"
|
||||
test_bad_opts "-L 1000:b.c" "has only.*lines"
|
||||
test_bad_opts "-L 1,1000:b.c" "has only.*lines"
|
||||
test_bad_opts "-L :b.c" "argument.*not of the form"
|
||||
test_bad_opts "-L :b.c" "argument not .start,end:file"
|
||||
test_bad_opts "-L :foo:b.c" "no match"
|
||||
|
||||
test_expect_success '-L X (X == nlines)' '
|
||||
|
@ -576,13 +576,16 @@ do
|
||||
do
|
||||
for h in host user@host user@[::1] user@::1
|
||||
do
|
||||
test_expect_success "fetch-pack --diag-url $p://$h/$r" '
|
||||
check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
|
||||
'
|
||||
# "/~" -> "~" conversion
|
||||
test_expect_success "fetch-pack --diag-url $p://$h/~$r" '
|
||||
check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
|
||||
'
|
||||
for c in "" :
|
||||
do
|
||||
test_expect_success "fetch-pack --diag-url $p://$h$c/$r" '
|
||||
check_prot_host_port_path $p://$h/$r $p "$h" NONE "/$r"
|
||||
'
|
||||
# "/~" -> "~" conversion
|
||||
test_expect_success "fetch-pack --diag-url $p://$h$c/~$r" '
|
||||
check_prot_host_port_path $p://$h/~$r $p "$h" NONE "~$r"
|
||||
'
|
||||
done
|
||||
done
|
||||
for h in host User@host User@[::1]
|
||||
do
|
||||
|
@ -387,14 +387,17 @@ do
|
||||
done
|
||||
|
||||
#with ssh:// scheme
|
||||
test_expect_success 'clone ssh://host.xz/home/user/repo' '
|
||||
test_clone_url "ssh://host.xz/home/user/repo" host.xz "/home/user/repo"
|
||||
'
|
||||
|
||||
# from home directory
|
||||
test_expect_success 'clone ssh://host.xz/~repo' '
|
||||
test_clone_url "ssh://host.xz/~repo" host.xz "~repo"
|
||||
#ignore trailing colon
|
||||
for tcol in "" :
|
||||
do
|
||||
test_expect_success "clone ssh://host.xz$tcol/home/user/repo" '
|
||||
test_clone_url "ssh://host.xz$tcol/home/user/repo" host.xz /home/user/repo
|
||||
'
|
||||
# from home directory
|
||||
test_expect_success "clone ssh://host.xz$tcol/~repo" '
|
||||
test_clone_url "ssh://host.xz$tcol/~repo" host.xz "~repo"
|
||||
'
|
||||
done
|
||||
|
||||
# with port number
|
||||
test_expect_success 'clone ssh://host.xz:22/home/user/repo' '
|
||||
@ -407,9 +410,9 @@ test_expect_success 'clone ssh://host.xz:22/~repo' '
|
||||
'
|
||||
|
||||
#IPv6
|
||||
for tuah in ::1 [::1] user@::1 user@[::1] [user@::1]
|
||||
for tuah in ::1 [::1] [::1]: user@::1 user@[::1] user@[::1]: [user@::1] [user@::1]:
|
||||
do
|
||||
ehost=$(echo $tuah | tr -d "[]")
|
||||
ehost=$(echo $tuah | sed -e "s/1]:/1]/ "| tr -d "[]")
|
||||
test_expect_success "clone ssh://$tuah/home/user/repo" "
|
||||
test_clone_url ssh://$tuah/home/user/repo $ehost /home/user/repo
|
||||
"
|
||||
|
@ -1434,15 +1434,18 @@ static int verify_absent_1(const struct cache_entry *ce,
|
||||
if (!len)
|
||||
return 0;
|
||||
else if (len > 0) {
|
||||
char path[PATH_MAX + 1];
|
||||
memcpy(path, ce->name, len);
|
||||
path[len] = 0;
|
||||
if (lstat(path, &st))
|
||||
return error("cannot stat '%s': %s", path,
|
||||
strerror(errno));
|
||||
char *path;
|
||||
int ret;
|
||||
|
||||
return check_ok_to_remove(path, len, DT_UNKNOWN, NULL, &st,
|
||||
error_type, o);
|
||||
path = xmemdupz(ce->name, len);
|
||||
if (lstat(path, &st))
|
||||
ret = error("cannot stat '%s': %s", path,
|
||||
strerror(errno));
|
||||
else
|
||||
ret = check_ok_to_remove(path, len, DT_UNKNOWN, NULL,
|
||||
&st, error_type, o);
|
||||
free(path);
|
||||
return ret;
|
||||
} else if (lstat(ce->name, &st)) {
|
||||
if (errno != ENOENT)
|
||||
return error("cannot stat '%s': %s", ce->name,
|
||||
|
Reference in New Issue
Block a user