Merge branch 'maint'
* maint: git-submodule.sh: separate parens by a space to avoid confusing some shells Documentation/technical/api-diff.txt: correct name of diff_unmerge() read_gitfile_gently: use ssize_t to hold read result remove tests of always-false condition rerere.c: diagnose a corrupt MERGE_RR when hitting EOF between TAB and '\0'
This commit is contained in:
commit
fb674d7671
@ -32,7 +32,7 @@ Calling sequence
|
|||||||
|
|
||||||
* As you find different pairs of files, call `diff_change()` to feed
|
* As you find different pairs of files, call `diff_change()` to feed
|
||||||
modified files, `diff_addremove()` to feed created or deleted files,
|
modified files, `diff_addremove()` to feed created or deleted files,
|
||||||
or `diff_unmerged()` to feed a file whose state is 'unmerged' to the
|
or `diff_unmerge()` to feed a file whose state is 'unmerged' to the
|
||||||
API. These are thin wrappers to a lower-level `diff_queue()` function
|
API. These are thin wrappers to a lower-level `diff_queue()` function
|
||||||
that is flexible enough to record any of these kinds of changes.
|
that is flexible enough to record any of these kinds of changes.
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ Data structures
|
|||||||
This is the internal representation for a single file (blob). It
|
This is the internal representation for a single file (blob). It
|
||||||
records the blob object name (if known -- for a work tree file it
|
records the blob object name (if known -- for a work tree file it
|
||||||
typically is a NUL SHA-1), filemode and pathname. This is what the
|
typically is a NUL SHA-1), filemode and pathname. This is what the
|
||||||
`diff_addremove()`, `diff_change()` and `diff_unmerged()` synthesize and
|
`diff_addremove()`, `diff_change()` and `diff_unmerge()` synthesize and
|
||||||
feed `diff_queue()` function with.
|
feed `diff_queue()` function with.
|
||||||
|
|
||||||
* `struct diff_filepair`
|
* `struct diff_filepair`
|
||||||
|
2
fsck.c
2
fsck.c
@ -349,7 +349,7 @@ int fsck_error_function(struct object *obj, int type, const char *fmt, ...)
|
|||||||
va_list ap;
|
va_list ap;
|
||||||
struct strbuf sb = STRBUF_INIT;
|
struct strbuf sb = STRBUF_INIT;
|
||||||
|
|
||||||
strbuf_addf(&sb, "object %s:", obj->sha1?sha1_to_hex(obj->sha1):"(null)");
|
strbuf_addf(&sb, "object %s:", sha1_to_hex(obj->sha1));
|
||||||
|
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
strbuf_vaddf(&sb, fmt, ap);
|
strbuf_vaddf(&sb, fmt, ap);
|
||||||
|
@ -495,7 +495,7 @@ cmd_update()
|
|||||||
# Run fetch only if $sha1 isn't present or it
|
# Run fetch only if $sha1 isn't present or it
|
||||||
# is not reachable from a ref.
|
# is not reachable from a ref.
|
||||||
(clear_local_git_env; cd "$path" &&
|
(clear_local_git_env; cd "$path" &&
|
||||||
((rev=$(git rev-list -n 1 $sha1 --not --all 2>/dev/null) &&
|
( (rev=$(git rev-list -n 1 $sha1 --not --all 2>/dev/null) &&
|
||||||
test -z "$rev") || git-fetch)) ||
|
test -z "$rev") || git-fetch)) ||
|
||||||
die "Unable to fetch in submodule path '$path'"
|
die "Unable to fetch in submodule path '$path'"
|
||||||
fi
|
fi
|
||||||
|
10
rerere.c
10
rerere.c
@ -47,8 +47,14 @@ static void read_rr(struct string_list *rr)
|
|||||||
name = xstrdup(buf);
|
name = xstrdup(buf);
|
||||||
if (fgetc(in) != '\t')
|
if (fgetc(in) != '\t')
|
||||||
die("corrupt MERGE_RR");
|
die("corrupt MERGE_RR");
|
||||||
for (i = 0; i < sizeof(buf) && (buf[i] = fgetc(in)); i++)
|
for (i = 0; i < sizeof(buf); i++) {
|
||||||
; /* do nothing */
|
int c = fgetc(in);
|
||||||
|
if (c < 0)
|
||||||
|
die("corrupt MERGE_RR");
|
||||||
|
buf[i] = c;
|
||||||
|
if (c == 0)
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (i == sizeof(buf))
|
if (i == sizeof(buf))
|
||||||
die("filename too long");
|
die("filename too long");
|
||||||
string_list_insert(rr, buf)->util = name;
|
string_list_insert(rr, buf)->util = name;
|
||||||
|
2
setup.c
2
setup.c
@ -382,7 +382,7 @@ const char *read_gitfile_gently(const char *path)
|
|||||||
const char *slash;
|
const char *slash;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
int fd;
|
int fd;
|
||||||
size_t len;
|
ssize_t len;
|
||||||
|
|
||||||
if (stat(path, &st))
|
if (stat(path, &st))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -156,7 +156,7 @@ static void set_upstreams(struct transport *transport, struct ref *refs,
|
|||||||
continue;
|
continue;
|
||||||
if (!ref->peer_ref)
|
if (!ref->peer_ref)
|
||||||
continue;
|
continue;
|
||||||
if (!ref->new_sha1 || is_null_sha1(ref->new_sha1))
|
if (is_null_sha1(ref->new_sha1))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Follow symbolic refs (mainly for HEAD). */
|
/* Follow symbolic refs (mainly for HEAD). */
|
||||||
|
Loading…
Reference in New Issue
Block a user