Code

Merge branch 'cb/receive-pack-keep-errors' into maint
authorJunio C Hamano <gitster@pobox.com>
Tue, 21 Feb 2012 23:14:41 +0000 (15:14 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 21 Feb 2012 23:14:41 +0000 (15: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)