Code

refactor duplicated code in builtin-send-pack.c and transport.c
authorMichael Lukashov <michael.lukashov@gmail.com>
Tue, 16 Feb 2010 23:42:52 +0000 (23:42 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 17 Feb 2010 23:07:15 +0000 (15:07 -0800)
commitf1863d0d16b9a5288671e17b7fa2eba8244ead2f
treeddd1b513802a0a97f715b47a22e2ed790364c2da
parent6d816301cd53e54af3398b634d47588a6f184be4
refactor duplicated code in builtin-send-pack.c and transport.c

The following functions are (almost) identical:

  verify_remote_names
  update_tracking_ref
  refs_pushed
  print_push_status

Move common versions of these functions to transport.c and rename
them, as suggested by Jeff King and Junio C Hamano.

These functions have been removed entirely from builtin-send-pack.c,
since they are only used internally by print_push_status():

  print_ref_status
  status_abbrev
  print_ok_ref_status
  print_one_push_status

Also, move #define SUMMARY_WIDTH to transport.h and rename it
TRANSPORT_SUMMARY_WIDTH as it is used in builtin-fetch.c and
transport.c

Signed-off-by: Michael Lukashov <michael.lukashov@gmail.com>
Acked-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-fetch.c
builtin-send-pack.c
transport.c
transport.h