summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
Diffstat (limited to 'builtin')
-rw-r--r--builtin/am.c13
-rw-r--r--builtin/blame.c11
-rw-r--r--builtin/fsck.c18
-rw-r--r--builtin/ls-remote.c2
-rw-r--r--builtin/pull.c2
5 files changed, 38 insertions, 8 deletions
diff --git a/builtin/am.c b/builtin/am.c
index 4f77e07..3bd4fd7 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -2208,6 +2208,17 @@ enum resume_mode {
RESUME_ABORT
};
+static int git_am_config(const char *k, const char *v, void *cb)
+{
+ int status;
+
+ status = git_gpg_config(k, v, NULL);
+ if (status)
+ return status;
+
+ return git_default_config(k, v, NULL);
+}
+
int cmd_am(int argc, const char **argv, const char *prefix)
{
struct am_state state;
@@ -2308,7 +2319,7 @@ int cmd_am(int argc, const char **argv, const char *prefix)
OPT_END()
};
- git_config(git_default_config, NULL);
+ git_config(git_am_config, NULL);
am_state_init(&state, git_path("rebase-apply"));
diff --git a/builtin/blame.c b/builtin/blame.c
index 245d253..295ce92 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -1371,8 +1371,15 @@ static void pass_whole_blame(struct scoreboard *sb,
*/
static struct commit_list *first_scapegoat(struct rev_info *revs, struct commit *commit)
{
- if (!reverse)
+ if (!reverse) {
+ if (revs->first_parent_only &&
+ commit->parents &&
+ commit->parents->next) {
+ free_commit_list(commit->parents->next);
+ commit->parents->next = NULL;
+ }
return commit->parents;
+ }
return lookup_decoration(&revs->children, &commit->object);
}
@@ -2685,6 +2692,8 @@ parse_done:
}
else if (contents_from)
die("--contents and --children do not blend well.");
+ else if (revs.first_parent_only)
+ die("combining --first-parent and --reverse is not supported");
else {
final_commit_name = prepare_initial(&sb);
sb.commits.compare = compare_commits_by_reverse_commit_date;
diff --git a/builtin/fsck.c b/builtin/fsck.c
index 0794703..b9a74f0 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -38,6 +38,7 @@ static int show_dangling = 1;
#define ERROR_OBJECT 01
#define ERROR_REACHABLE 02
#define ERROR_PACK 04
+#define ERROR_REFS 010
#ifdef NO_D_INO_IN_DIRENT
#define SORT_DIRENT 0
@@ -521,8 +522,10 @@ static int fsck_handle_ref(const char *refname, const struct object_id *oid,
/* We'll continue with the rest despite the error.. */
return 0;
}
- if (obj->type != OBJ_COMMIT && is_branch(refname))
+ if (obj->type != OBJ_COMMIT && is_branch(refname)) {
error("%s: not a commit", refname);
+ errors_found |= ERROR_REFS;
+ }
default_refs++;
obj->used = 1;
mark_object_reachable(obj);
@@ -585,17 +588,23 @@ static int fsck_head_link(void)
fprintf(stderr, "Checking HEAD link\n");
head_points_at = resolve_ref_unsafe("HEAD", 0, head_oid.hash, &flag);
- if (!head_points_at)
+ if (!head_points_at) {
+ errors_found |= ERROR_REFS;
return error("Invalid HEAD");
+ }
if (!strcmp(head_points_at, "HEAD"))
/* detached HEAD */
null_is_error = 1;
- else if (!starts_with(head_points_at, "refs/heads/"))
+ else if (!starts_with(head_points_at, "refs/heads/")) {
+ errors_found |= ERROR_REFS;
return error("HEAD points to something strange (%s)",
head_points_at);
+ }
if (is_null_oid(&head_oid)) {
- if (null_is_error)
+ if (null_is_error) {
+ errors_found |= ERROR_REFS;
return error("HEAD: detached HEAD points at nothing");
+ }
fprintf(stderr, "notice: HEAD points to an unborn branch (%s)\n",
head_points_at + 11);
}
@@ -615,6 +624,7 @@ static int fsck_cache_tree(struct cache_tree *it)
if (!obj) {
error("%s: invalid sha1 pointer in cache-tree",
sha1_to_hex(it->sha1));
+ errors_found |= ERROR_REFS;
return 1;
}
obj->used = 1;
diff --git a/builtin/ls-remote.c b/builtin/ls-remote.c
index 4554dbc..5e9d545 100644
--- a/builtin/ls-remote.c
+++ b/builtin/ls-remote.c
@@ -4,7 +4,7 @@
#include "remote.h"
static const char ls_remote_usage[] =
-"git ls-remote [--heads] [--tags] [-u <exec> | --upload-pack <exec>]\n"
+"git ls-remote [--heads] [--tags] [--upload-pack=<exec>]\n"
" [-q | --quiet] [--exit-code] [--get-url] [<repository> [<refs>...]]";
/*
diff --git a/builtin/pull.c b/builtin/pull.c
index a39bb0a..bf3fd3f 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -66,7 +66,7 @@ static int parse_opt_rebase(const struct option *opt, const char *arg, int unset
}
static const char * const pull_usage[] = {
- N_("git pull [options] [<repository> [<refspec>...]]"),
+ N_("git pull [<options>] [<repository> [<refspec>...]]"),
NULL
};