aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-09-11 11:23:45 -0700
committerJunio C Hamano <gitster@pobox.com>2012-09-11 11:23:54 -0700
commit1c88a6d17492b197b9b3298cbc34efa804928302 (patch)
treeb0370caa6322930a13898673c5a559aef20c8791 /builtin
parent31190841049549b5daaffeb0b9888ebed0bbfc8a (diff)
parente09e4024a070e666ed40b66442e8151b91d623e4 (diff)
downloadgit-1c88a6d17492b197b9b3298cbc34efa804928302.tar.gz
git-1c88a6d17492b197b9b3298cbc34efa804928302.tar.xz
Sync with 1.7.11.6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/apply.c1
-rw-r--r--builtin/blame.c9
-rw-r--r--builtin/checkout.c3
-rw-r--r--builtin/config.c8
-rw-r--r--builtin/diff.c3
-rw-r--r--builtin/merge.c3
6 files changed, 12 insertions, 15 deletions
diff --git a/builtin/apply.c b/builtin/apply.c
index d453c8337..3bf71dc45 100644
--- a/builtin/apply.c
+++ b/builtin/apply.c
@@ -188,7 +188,6 @@ struct patch {
int is_new, is_delete; /* -1 = unknown, 0 = false, 1 = true */
int rejected;
unsigned ws_rule;
- unsigned long deflate_origlen;
int lines_added, lines_deleted;
int score;
unsigned int is_toplevel_relative:1;
diff --git a/builtin/blame.c b/builtin/blame.c
index f2c48ef5a..ed5d01b36 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -407,8 +407,7 @@ static struct origin *find_origin(struct scoreboard *sb,
paths[1] = NULL;
diff_tree_setup_paths(paths, &diff_opts);
- if (diff_setup_done(&diff_opts) < 0)
- die("diff-setup");
+ diff_setup_done(&diff_opts);
if (is_null_sha1(origin->commit->object.sha1))
do_diff_cache(parent->tree->object.sha1, &diff_opts);
@@ -494,8 +493,7 @@ static struct origin *find_rename(struct scoreboard *sb,
diff_opts.single_follow = origin->path;
paths[0] = NULL;
diff_tree_setup_paths(paths, &diff_opts);
- if (diff_setup_done(&diff_opts) < 0)
- die("diff-setup");
+ diff_setup_done(&diff_opts);
if (is_null_sha1(origin->commit->object.sha1))
do_diff_cache(parent->tree->object.sha1, &diff_opts);
@@ -1075,8 +1073,7 @@ static int find_copy_in_parent(struct scoreboard *sb,
paths[0] = NULL;
diff_tree_setup_paths(paths, &diff_opts);
- if (diff_setup_done(&diff_opts) < 0)
- die("diff-setup");
+ diff_setup_done(&diff_opts);
/* Try "find copies harder" on new path if requested;
* we do not want to use diffcore_rename() actually to
diff --git a/builtin/checkout.c b/builtin/checkout.c
index d812219b3..7d922c612 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -316,8 +316,7 @@ static void show_local_changes(struct object *head, struct diff_options *opts)
init_revisions(&rev, NULL);
rev.diffopt.flags = opts->flags;
rev.diffopt.output_format |= DIFF_FORMAT_NAME_STATUS;
- if (diff_setup_done(&rev.diffopt) < 0)
- die(_("diff_setup_done failed"));
+ diff_setup_done(&rev.diffopt);
add_pending_object(&rev, head, NULL);
run_diff_index(&rev, 0);
}
diff --git a/builtin/config.c b/builtin/config.c
index 8cd08da99..ada6e1211 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -160,7 +160,7 @@ static int show_config(const char *key_, const char *value_, void *cb)
static int get_value(const char *key_, const char *regex_)
{
- int ret = -1;
+ int ret = CONFIG_GENERIC_ERROR;
char *global = NULL, *xdg = NULL, *repo_config = NULL;
const char *system_wide = NULL, *local;
struct config_include_data inc = CONFIG_INCLUDE_INIT;
@@ -196,11 +196,14 @@ static int get_value(const char *key_, const char *regex_)
if (regcomp(key_regexp, key, REG_EXTENDED)) {
fprintf(stderr, "Invalid key pattern: %s\n", key_);
free(key);
+ ret = CONFIG_INVALID_PATTERN;
goto free_strings;
}
} else {
- if (git_config_parse_key(key_, &key, NULL))
+ if (git_config_parse_key(key_, &key, NULL)) {
+ ret = CONFIG_INVALID_KEY;
goto free_strings;
+ }
}
if (regex_) {
@@ -212,6 +215,7 @@ static int get_value(const char *key_, const char *regex_)
regexp = (regex_t*)xmalloc(sizeof(regex_t));
if (regcomp(regexp, regex_, REG_EXTENDED)) {
fprintf(stderr, "Invalid pattern: %s\n", regex_);
+ ret = CONFIG_INVALID_PATTERN;
goto free_strings;
}
}
diff --git a/builtin/diff.c b/builtin/diff.c
index bf7229875..9650be2c5 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -302,8 +302,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
argc = setup_revisions(argc, argv, &rev, NULL);
if (!rev.diffopt.output_format) {
rev.diffopt.output_format = DIFF_FORMAT_PATCH;
- if (diff_setup_done(&rev.diffopt) < 0)
- die(_("diff_setup_done failed"));
+ diff_setup_done(&rev.diffopt);
}
DIFF_OPT_SET(&rev.diffopt, RECURSIVE);
diff --git a/builtin/merge.c b/builtin/merge.c
index dd50a0c57..e81fde6d7 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -404,8 +404,7 @@ static void finish(struct commit *head_commit,
opts.output_format |=
DIFF_FORMAT_SUMMARY | DIFF_FORMAT_DIFFSTAT;
opts.detect_rename = DIFF_DETECT_RENAME;
- if (diff_setup_done(&opts) < 0)
- die(_("diff_setup_done failed"));
+ diff_setup_done(&opts);
diff_tree_sha1(head, new_head, "", &opts);
diffcore_std(&opts);
diff_flush(&opts);