Code

Merge branch 'cb/receive-pack-keep-errors'
authorJunio C Hamano <gitster@pobox.com>
Mon, 20 Feb 2012 08:14:50 +0000 (00:14 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 20 Feb 2012 08:14:50 +0000 (00:14 -0800)
* cb/receive-pack-keep-errors:
  do not override receive-pack errors

1  2 
builtin/receive-pack.c

index fa7448be5aaf9d2830168b77f9a555e9b6740993,798dca95f63ddb97032049b52216c1b45200d337..0afb8b289621c419bd7472097335e4235da37d61
@@@ -714,12 -699,17 +718,18 @@@ static void execute_commands(struct com
  
        check_aliased_updates(commands);
  
 -      head_name = resolve_ref("HEAD", sha1, 0, NULL);
 +      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)