mirror of
https://github.com/git/git.git
synced 2024-05-08 23:46:08 +02:00
Compare commits
9 Commits
264c9f2e28
...
b87c692e99
Author | SHA1 | Date | |
---|---|---|---|
Elijah Newren | b87c692e99 | ||
Junio C Hamano | e326e52010 | ||
Junio C Hamano | c9d1ee7cdf | ||
Rubén Justo | 16727404c4 | ||
Rubén Justo | ec9b74b18e | ||
Rubén Justo | 5861aa84a7 | ||
Rubén Justo | 71c7916053 | ||
René Scharfe | 0283cd5161 | ||
Elijah Newren | babbb4d4cd |
|
@ -865,6 +865,7 @@ static int get_untracked_files(struct repository *r,
|
|||
}
|
||||
|
||||
strbuf_release(&buf);
|
||||
dir_clear(&dir);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1646,6 +1646,7 @@ static int patch_update_file(struct add_p_state *s,
|
|||
err(s, _("No hunk matches the given pattern"));
|
||||
break;
|
||||
}
|
||||
regfree(®ex);
|
||||
hunk_index = i;
|
||||
} else if (s->answer.buf[0] == 's') {
|
||||
size_t splittable_into = hunk->splittable_into;
|
||||
|
|
4
apply.c
4
apply.c
|
@ -3712,8 +3712,10 @@ static int apply_data(struct apply_state *state, struct patch *patch,
|
|||
fprintf(stderr, _("Falling back to direct application...\n"));
|
||||
|
||||
/* Note: with --reject, apply_fragments() returns 0 */
|
||||
if (patch->direct_to_threeway || apply_fragments(state, &image, patch) < 0)
|
||||
if (patch->direct_to_threeway || apply_fragments(state, &image, patch) < 0) {
|
||||
clear_image(&image);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
patch->result = image.buf;
|
||||
patch->resultsize = image.len;
|
||||
|
|
|
@ -150,7 +150,7 @@ static int refresh(int verbose, const struct pathspec *pathspec)
|
|||
int interactive_add(const char **argv, const char *prefix, int patch)
|
||||
{
|
||||
struct pathspec pathspec;
|
||||
int unused;
|
||||
int unused, ret;
|
||||
|
||||
if (!git_config_get_bool("add.interactive.usebuiltin", &unused))
|
||||
warning(_("the add.interactive.useBuiltin setting has been removed!\n"
|
||||
|
@ -163,9 +163,12 @@ int interactive_add(const char **argv, const char *prefix, int patch)
|
|||
prefix, argv);
|
||||
|
||||
if (patch)
|
||||
return !!run_add_p(the_repository, ADD_P_ADD, NULL, &pathspec);
|
||||
ret = !!run_add_p(the_repository, ADD_P_ADD, NULL, &pathspec);
|
||||
else
|
||||
return !!run_add_i(the_repository, &pathspec);
|
||||
ret = !!run_add_i(the_repository, &pathspec);
|
||||
|
||||
clear_pathspec(&pathspec);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int edit_patch(int argc, const char **argv, const char *prefix)
|
||||
|
|
|
@ -112,7 +112,9 @@ method _start {} {
|
|||
close $fh
|
||||
set _last_merged_branch $branch
|
||||
|
||||
if {[git-version >= "2.5.0"]} {
|
||||
if {[git-version >= "2.34.0"]} {
|
||||
set cmd [list git merge --strategy=ort FETCH_HEAD]
|
||||
} elseif {[git-version >= "2.5.0"]} {
|
||||
set cmd [list git merge --strategy=recursive FETCH_HEAD]
|
||||
} else {
|
||||
set cmd [list git]
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include "git-compat-util.h"
|
||||
#include "mem-pool.h"
|
||||
#include "gettext.h"
|
||||
|
||||
#define BLOCK_GROWTH_SIZE (1024 * 1024 - sizeof(struct mp_block))
|
||||
|
||||
|
@ -122,7 +123,7 @@ static char *mem_pool_strvfmt(struct mem_pool *pool, const char *fmt,
|
|||
len = vsnprintf(next_free, available, fmt, cp);
|
||||
va_end(cp);
|
||||
if (len < 0)
|
||||
BUG("your vsnprintf is broken (returned %d)", len);
|
||||
die(_("unable to format message: %s"), fmt);
|
||||
|
||||
size = st_add(len, 1); /* 1 for NUL */
|
||||
ret = mem_pool_alloc(pool, size);
|
||||
|
|
4
strbuf.c
4
strbuf.c
|
@ -277,7 +277,7 @@ void strbuf_vinsertf(struct strbuf *sb, size_t pos, const char *fmt, va_list ap)
|
|||
len = vsnprintf(sb->buf + sb->len, 0, fmt, cp);
|
||||
va_end(cp);
|
||||
if (len < 0)
|
||||
BUG("your vsnprintf is broken (returned %d)", len);
|
||||
die(_("unable to format message: %s"), fmt);
|
||||
if (!len)
|
||||
return; /* nothing to do */
|
||||
if (unsigned_add_overflows(sb->len, len))
|
||||
|
@ -404,7 +404,7 @@ void strbuf_vaddf(struct strbuf *sb, const char *fmt, va_list ap)
|
|||
len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, cp);
|
||||
va_end(cp);
|
||||
if (len < 0)
|
||||
BUG("your vsnprintf is broken (returned %d)", len);
|
||||
die(_("unable to format message: %s"), fmt);
|
||||
if (len > strbuf_avail(sb)) {
|
||||
strbuf_grow(sb, len);
|
||||
len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap);
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
test_description='git checkout --patch'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./lib-patch-mode.sh
|
||||
|
||||
test_expect_success 'setup' '
|
||||
|
|
|
@ -4,6 +4,7 @@ test_description='add -i basic tests'
|
|||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
. "$TEST_DIRECTORY"/lib-terminal.sh
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ test_description='git apply handling binary patches
|
|||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success 'setup' '
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
test_description='git apply boundary tests'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
L="c d e f g h i j k l m n o p q r s t u v w x"
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
test_description='git apply trying to add an ending line.
|
||||
|
||||
'
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
# setup
|
||||
|
|
|
@ -7,6 +7,7 @@ test_description='git apply with rejects
|
|||
|
||||
'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success setup '
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
test_description='apply a patch that is larger than the preimage'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
cat >F <<\EOF
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
test_description='git am with options and not losing them'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
tm="$TEST_DIRECTORY/t4252"
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
test_description='test am --quoted-cr=<action>'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
DATA="$TEST_DIRECTORY/t4258"
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
test_description='hunk edit with "commit -p -m"'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success 'setup (initial)' '
|
||||
|
|
Loading…
Reference in New Issue