mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
Merge branch 'maint'
* maint: Fix non-literal format in printf-style calls git-submodule: Avoid printing a spurious message. git ls-remote: make usage string match manpage Makefile: help people who run 'make check' by mistake
This commit is contained in:
11
Makefile
11
Makefile
@@ -1355,7 +1355,16 @@ check-sha1:: test-sha1$X
|
|||||||
./test-sha1.sh
|
./test-sha1.sh
|
||||||
|
|
||||||
check: common-cmds.h
|
check: common-cmds.h
|
||||||
for i in *.c; do sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || exit; done
|
if sparse; \
|
||||||
|
then \
|
||||||
|
for i in *.c; \
|
||||||
|
do \
|
||||||
|
sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || exit; \
|
||||||
|
done; \
|
||||||
|
else \
|
||||||
|
echo 2>&1 "Did you mean 'make test'?"; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
|
||||||
remove-dashes:
|
remove-dashes:
|
||||||
./fixup-builtins $(BUILT_INS) $(PROGRAMS) $(SCRIPTS)
|
./fixup-builtins $(BUILT_INS) $(PROGRAMS) $(SCRIPTS)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include "remote.h"
|
#include "remote.h"
|
||||||
|
|
||||||
static const char ls_remote_usage[] =
|
static const char ls_remote_usage[] =
|
||||||
"git ls-remote [--upload-pack=<git-upload-pack>] [<host>:]<directory>";
|
"git ls-remote [--heads] [--tags] [-u <exec> | --upload-pack <exec>] <repository> <refs>...";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Is there one among the list of patterns that match the tail part
|
* Is there one among the list of patterns that match the tail part
|
||||||
|
|||||||
@@ -320,7 +320,7 @@ static int add_branch_for_removal(const char *refname,
|
|||||||
|
|
||||||
/* make sure that symrefs are deleted */
|
/* make sure that symrefs are deleted */
|
||||||
if (flags & REF_ISSYMREF)
|
if (flags & REF_ISSYMREF)
|
||||||
return unlink(git_path(refname));
|
return unlink(git_path("%s", refname));
|
||||||
|
|
||||||
item = string_list_append(refname, branches->branches);
|
item = string_list_append(refname, branches->branches);
|
||||||
item->util = xmalloc(20);
|
item->util = xmalloc(20);
|
||||||
|
|||||||
4
bundle.c
4
bundle.c
@@ -114,7 +114,7 @@ int verify_bundle(struct bundle_header *header, int verbose)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (++ret == 1)
|
if (++ret == 1)
|
||||||
error(message);
|
error("%s", message);
|
||||||
error("%s %s", sha1_to_hex(e->sha1), e->name);
|
error("%s %s", sha1_to_hex(e->sha1), e->name);
|
||||||
}
|
}
|
||||||
if (revs.pending.nr != p->nr)
|
if (revs.pending.nr != p->nr)
|
||||||
@@ -139,7 +139,7 @@ int verify_bundle(struct bundle_header *header, int verbose)
|
|||||||
for (i = 0; i < req_nr; i++)
|
for (i = 0; i < req_nr; i++)
|
||||||
if (!(refs.objects[i].item->flags & SHOWN)) {
|
if (!(refs.objects[i].item->flags & SHOWN)) {
|
||||||
if (++ret == 1)
|
if (++ret == 1)
|
||||||
error(message);
|
error("%s", message);
|
||||||
error("%s %s", sha1_to_hex(refs.objects[i].item->sha1),
|
error("%s %s", sha1_to_hex(refs.objects[i].item->sha1),
|
||||||
refs.objects[i].name);
|
refs.objects[i].name);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ const char *get_git_work_tree(void)
|
|||||||
work_tree = git_work_tree_cfg;
|
work_tree = git_work_tree_cfg;
|
||||||
/* make_absolute_path also normalizes the path */
|
/* make_absolute_path also normalizes the path */
|
||||||
if (work_tree && !is_absolute_path(work_tree))
|
if (work_tree && !is_absolute_path(work_tree))
|
||||||
work_tree = xstrdup(make_absolute_path(git_path(work_tree)));
|
work_tree = xstrdup(make_absolute_path(git_path("%s", work_tree)));
|
||||||
} else if (work_tree)
|
} else if (work_tree)
|
||||||
work_tree = xstrdup(make_absolute_path(work_tree));
|
work_tree = xstrdup(make_absolute_path(work_tree));
|
||||||
git_work_tree_initialized = 1;
|
git_work_tree_initialized = 1;
|
||||||
|
|||||||
2
fsck.c
2
fsck.c
@@ -326,7 +326,7 @@ int fsck_error_function(struct object *obj, int type, const char *fmt, ...)
|
|||||||
die("this should not happen, your snprintf is broken");
|
die("this should not happen, your snprintf is broken");
|
||||||
}
|
}
|
||||||
|
|
||||||
error(sb.buf);
|
error("%s", sb.buf);
|
||||||
strbuf_release(&sb);
|
strbuf_release(&sb);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -323,7 +323,7 @@ cmd_update()
|
|||||||
# Only mention uninitialized submodules when its
|
# Only mention uninitialized submodules when its
|
||||||
# path have been specified
|
# path have been specified
|
||||||
test "$#" != "0" &&
|
test "$#" != "0" &&
|
||||||
say "Submodule path '$path' not initialized"
|
say "Submodule path '$path' not initialized" &&
|
||||||
say "Maybe you want to use 'update --init'?"
|
say "Maybe you want to use 'update --init'?"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|||||||
6
grep.c
6
grep.c
@@ -514,7 +514,7 @@ static int grep_buffer_1(struct grep_opt *opt, const char *name,
|
|||||||
if (from <= last_shown)
|
if (from <= last_shown)
|
||||||
from = last_shown + 1;
|
from = last_shown + 1;
|
||||||
if (last_shown && from != last_shown + 1)
|
if (last_shown && from != last_shown + 1)
|
||||||
printf(hunk_mark);
|
fputs(hunk_mark, stdout);
|
||||||
while (from < lno) {
|
while (from < lno) {
|
||||||
pcl = &prev[lno-from-1];
|
pcl = &prev[lno-from-1];
|
||||||
show_line(opt, pcl->bol, pcl->eol,
|
show_line(opt, pcl->bol, pcl->eol,
|
||||||
@@ -524,7 +524,7 @@ static int grep_buffer_1(struct grep_opt *opt, const char *name,
|
|||||||
last_shown = lno-1;
|
last_shown = lno-1;
|
||||||
}
|
}
|
||||||
if (last_shown && lno != last_shown + 1)
|
if (last_shown && lno != last_shown + 1)
|
||||||
printf(hunk_mark);
|
fputs(hunk_mark, stdout);
|
||||||
if (!opt->count)
|
if (!opt->count)
|
||||||
show_line(opt, bol, eol, name, lno, ':');
|
show_line(opt, bol, eol, name, lno, ':');
|
||||||
last_shown = last_hit = lno;
|
last_shown = last_hit = lno;
|
||||||
@@ -535,7 +535,7 @@ static int grep_buffer_1(struct grep_opt *opt, const char *name,
|
|||||||
* we need to show this line.
|
* we need to show this line.
|
||||||
*/
|
*/
|
||||||
if (last_shown && lno != last_shown + 1)
|
if (last_shown && lno != last_shown + 1)
|
||||||
printf(hunk_mark);
|
fputs(hunk_mark, stdout);
|
||||||
show_line(opt, bol, eol, name, lno, '-');
|
show_line(opt, bol, eol, name, lno, '-');
|
||||||
last_shown = lno;
|
last_shown = lno;
|
||||||
}
|
}
|
||||||
|
|||||||
4
path.c
4
path.c
@@ -41,7 +41,7 @@ char *mksnpath(char *buf, size_t n, const char *fmt, ...)
|
|||||||
len = vsnprintf(buf, n, fmt, args);
|
len = vsnprintf(buf, n, fmt, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
if (len >= n) {
|
if (len >= n) {
|
||||||
snprintf(buf, n, bad_path);
|
strlcpy(buf, bad_path, n);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
return cleanup_path(buf);
|
return cleanup_path(buf);
|
||||||
@@ -63,7 +63,7 @@ static char *git_vsnpath(char *buf, size_t n, const char *fmt, va_list args)
|
|||||||
goto bad;
|
goto bad;
|
||||||
return cleanup_path(buf);
|
return cleanup_path(buf);
|
||||||
bad:
|
bad:
|
||||||
snprintf(buf, n, bad_path);
|
strlcpy(buf, bad_path, n);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
refs.c
2
refs.c
@@ -940,7 +940,7 @@ int delete_ref(const char *refname, const unsigned char *sha1, int delopt)
|
|||||||
lock->lk->filename[i] = 0;
|
lock->lk->filename[i] = 0;
|
||||||
path = lock->lk->filename;
|
path = lock->lk->filename;
|
||||||
} else {
|
} else {
|
||||||
path = git_path(refname);
|
path = git_path("%s", refname);
|
||||||
}
|
}
|
||||||
err = unlink(path);
|
err = unlink(path);
|
||||||
if (err && errno != ENOENT) {
|
if (err && errno != ENOENT) {
|
||||||
|
|||||||
@@ -352,7 +352,7 @@ static int unpack_failed(struct unpack_trees_options *o, const char *message)
|
|||||||
discard_index(&o->result);
|
discard_index(&o->result);
|
||||||
if (!o->gently) {
|
if (!o->gently) {
|
||||||
if (message)
|
if (message)
|
||||||
return error(message);
|
return error("%s", message);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user