mirror of
https://github.com/git/git.git
synced 2024-11-24 18:33:43 +08:00
Merge branch 'maint-1.6.1' into maint
* maint-1.6.1: textconv: stop leaking file descriptors commit: --cleanup is a message option git count-objects: handle packs bigger than 4G t7102: make the test fail if one of its check fails Conflicts: builtin-commit.c diff.c
This commit is contained in:
commit
b0b3a241e2
@ -86,8 +86,8 @@ static int opt_parse_m(const struct option *opt, const char *arg, int unset)
|
||||
static struct option builtin_commit_options[] = {
|
||||
OPT__QUIET(&quiet),
|
||||
OPT__VERBOSE(&verbose),
|
||||
OPT_GROUP("Commit message options"),
|
||||
|
||||
OPT_GROUP("Commit message options"),
|
||||
OPT_FILENAME('F', "file", &logfile, "read log from file"),
|
||||
OPT_STRING(0, "author", &force_author, "AUTHOR", "override author for commit"),
|
||||
OPT_CALLBACK('m', "message", &message, "MESSAGE", "specify commit message", opt_parse_m),
|
||||
@ -97,6 +97,8 @@ static struct option builtin_commit_options[] = {
|
||||
OPT_BOOLEAN('s', "signoff", &signoff, "add Signed-off-by:"),
|
||||
OPT_FILENAME('t', "template", &template_file, "use specified template file"),
|
||||
OPT_BOOLEAN('e', "edit", &edit_flag, "force edit of commit"),
|
||||
OPT_STRING(0, "cleanup", &cleanup_arg, "default", "how to strip spaces and #comments from message"),
|
||||
/* end commit message options */
|
||||
|
||||
OPT_GROUP("Commit contents options"),
|
||||
OPT_BOOLEAN('a', "all", &all, "commit all changed files"),
|
||||
@ -108,7 +110,7 @@ static struct option builtin_commit_options[] = {
|
||||
OPT_BOOLEAN(0, "amend", &amend, "amend previous commit"),
|
||||
{ OPTION_STRING, 'u', "untracked-files", &untracked_files_arg, "mode", "show untracked files, optional modes: all, normal, no. (Default: all)", PARSE_OPT_OPTARG, NULL, (intptr_t)"all" },
|
||||
OPT_BOOLEAN(0, "allow-empty", &allow_empty, "ok to record an empty change"),
|
||||
OPT_STRING(0, "cleanup", &cleanup_arg, "default", "how to strip spaces and #comments from message"),
|
||||
/* end commit contents options */
|
||||
|
||||
OPT_END()
|
||||
};
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
static void count_objects(DIR *d, char *path, int len, int verbose,
|
||||
unsigned long *loose,
|
||||
unsigned long *loose_size,
|
||||
off_t *loose_size,
|
||||
unsigned long *packed_loose,
|
||||
unsigned long *garbage)
|
||||
{
|
||||
@ -77,7 +77,7 @@ int cmd_count_objects(int argc, const char **argv, const char *prefix)
|
||||
int len = strlen(objdir);
|
||||
char *path = xmalloc(len + 50);
|
||||
unsigned long loose = 0, packed = 0, packed_loose = 0, garbage = 0;
|
||||
unsigned long loose_size = 0;
|
||||
off_t loose_size = 0;
|
||||
struct option opts[] = {
|
||||
OPT__VERBOSE(&verbose),
|
||||
OPT_END(),
|
||||
@ -103,7 +103,7 @@ int cmd_count_objects(int argc, const char **argv, const char *prefix)
|
||||
if (verbose) {
|
||||
struct packed_git *p;
|
||||
unsigned long num_pack = 0;
|
||||
unsigned long size_pack = 0;
|
||||
off_t size_pack = 0;
|
||||
if (!packed_git)
|
||||
prepare_packed_git();
|
||||
for (p = packed_git; p; p = p->next) {
|
||||
@ -116,15 +116,15 @@ int cmd_count_objects(int argc, const char **argv, const char *prefix)
|
||||
num_pack++;
|
||||
}
|
||||
printf("count: %lu\n", loose);
|
||||
printf("size: %lu\n", loose_size / 1024);
|
||||
printf("size: %lu\n", (unsigned long) (loose_size / 1024));
|
||||
printf("in-pack: %lu\n", packed);
|
||||
printf("packs: %lu\n", num_pack);
|
||||
printf("size-pack: %lu\n", size_pack / 1024);
|
||||
printf("size-pack: %lu\n", (unsigned long) (size_pack / 1024));
|
||||
printf("prune-packable: %lu\n", packed_loose);
|
||||
printf("garbage: %lu\n", garbage);
|
||||
}
|
||||
else
|
||||
printf("%lu objects, %lu kilobytes\n",
|
||||
loose, loose_size / 1024);
|
||||
loose, (unsigned long) (loose_size / 1024));
|
||||
return 0;
|
||||
}
|
||||
|
2
diff.c
2
diff.c
@ -3776,11 +3776,13 @@ static char *run_textconv(const char *pgm, struct diff_filespec *spec,
|
||||
if (start_command(&child) != 0 ||
|
||||
strbuf_read(&buf, child.out, 0) < 0 ||
|
||||
finish_command(&child) != 0) {
|
||||
close(child.out);
|
||||
strbuf_release(&buf);
|
||||
remove_tempfile();
|
||||
error("error running textconv command '%s'", pgm);
|
||||
return NULL;
|
||||
}
|
||||
close(child.out);
|
||||
remove_tempfile();
|
||||
|
||||
return strbuf_detach(&buf, outsize);
|
||||
|
@ -139,19 +139,19 @@ test_expect_success \
|
||||
test_expect_success \
|
||||
'resetting to HEAD with no changes should succeed and do nothing' '
|
||||
git reset --hard &&
|
||||
check_changes 3ec39651e7f44ea531a5de18a9fa791c0fd370fc
|
||||
check_changes 3ec39651e7f44ea531a5de18a9fa791c0fd370fc &&
|
||||
git reset --hard HEAD &&
|
||||
check_changes 3ec39651e7f44ea531a5de18a9fa791c0fd370fc
|
||||
check_changes 3ec39651e7f44ea531a5de18a9fa791c0fd370fc &&
|
||||
git reset --soft &&
|
||||
check_changes 3ec39651e7f44ea531a5de18a9fa791c0fd370fc
|
||||
check_changes 3ec39651e7f44ea531a5de18a9fa791c0fd370fc &&
|
||||
git reset --soft HEAD &&
|
||||
check_changes 3ec39651e7f44ea531a5de18a9fa791c0fd370fc
|
||||
check_changes 3ec39651e7f44ea531a5de18a9fa791c0fd370fc &&
|
||||
git reset --mixed &&
|
||||
check_changes 3ec39651e7f44ea531a5de18a9fa791c0fd370fc
|
||||
check_changes 3ec39651e7f44ea531a5de18a9fa791c0fd370fc &&
|
||||
git reset --mixed HEAD &&
|
||||
check_changes 3ec39651e7f44ea531a5de18a9fa791c0fd370fc
|
||||
check_changes 3ec39651e7f44ea531a5de18a9fa791c0fd370fc &&
|
||||
git reset &&
|
||||
check_changes 3ec39651e7f44ea531a5de18a9fa791c0fd370fc
|
||||
check_changes 3ec39651e7f44ea531a5de18a9fa791c0fd370fc &&
|
||||
git reset HEAD &&
|
||||
check_changes 3ec39651e7f44ea531a5de18a9fa791c0fd370fc
|
||||
'
|
||||
|
Loading…
Reference in New Issue
Block a user