summaryrefslogtreecommitdiff
path: root/builtin/receive-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-02-21 23:14:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-02-21 23:14:41 (GMT)
commite147e9693ace9f7c6dafd4095d3cde80d047e787 (patch)
tree64c5bf2ec4982c34a353c0fa1b70993d8fc54b12 /builtin/receive-pack.c
parentc7707a4354f36c59f3310d4edfb18377c064220e (diff)
parentef7e93d90866e91bba5ff7f274c49dc44427a8ff (diff)
downloadgit-e147e9693ace9f7c6dafd4095d3cde80d047e787.zip
git-e147e9693ace9f7c6dafd4095d3cde80d047e787.tar.gz
git-e147e9693ace9f7c6dafd4095d3cde80d047e787.tar.bz2
Merge branch 'cb/receive-pack-keep-errors' into maint
* cb/receive-pack-keep-errors: do not override receive-pack errors
Diffstat (limited to 'builtin/receive-pack.c')
-rw-r--r--builtin/receive-pack.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index fa7448b..0afb8b2 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -642,8 +642,10 @@ static void check_aliased_updates(struct command *commands)
}
sort_string_list(&ref_list);
- for (cmd = commands; cmd; cmd = cmd->next)
- check_aliased_update(cmd, &ref_list);
+ for (cmd = commands; cmd; cmd = cmd->next) {
+ if (!cmd->error_string)
+ check_aliased_update(cmd, &ref_list);
+ }
string_list_clear(&ref_list, 0);
}
@@ -707,8 +709,10 @@ static void execute_commands(struct command *commands, const char *unpacker_erro
set_connectivity_errors(commands);
if (run_receive_hook(commands, pre_receive_hook, 0)) {
- for (cmd = commands; cmd; cmd = cmd->next)
- cmd->error_string = "pre-receive hook declined";
+ for (cmd = commands; cmd; cmd = cmd->next) {
+ if (!cmd->error_string)
+ cmd->error_string = "pre-receive hook declined";
+ }
return;
}
@@ -717,9 +721,15 @@ static void execute_commands(struct command *commands, const char *unpacker_erro
free(head_name_to_free);
head_name = head_name_to_free = resolve_refdup("HEAD", sha1, 0, NULL);
- for (cmd = commands; cmd; cmd = cmd->next)
- if (!cmd->skip_update)
- cmd->error_string = update(cmd);
+ for (cmd = commands; cmd; cmd = cmd->next) {
+ if (cmd->error_string)
+ continue;
+
+ if (cmd->skip_update)
+ continue;
+
+ cmd->error_string = update(cmd);
+ }
}
static struct command *read_head_info(void)