Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* maint:
  change throughput display units with fast links
  clone: Supply the right commit hash to post-checkout when -b is used
  remote-curl: add missing initialization of argv0_path
  • Loading branch information
Junio C Hamano committed Oct 14, 2009
2 parents 9ecb2a7 + 583371a commit 18a5364
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion builtin-clone.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
die("unable to write new index file");

err |= run_hook(NULL, "post-checkout", sha1_to_hex(null_sha1),
sha1_to_hex(remote_head->old_sha1), "1", NULL);
sha1_to_hex(our_head_points_at->old_sha1), "1",
NULL);

if (!err && option_recursive)
err = run_command_v_opt(argv_submodule, RUN_GIT_CMD);
Expand Down
8 changes: 7 additions & 1 deletion progress.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,13 @@ static void throughput_string(struct throughput *tp, off_t total,
} else {
l -= snprintf(tp->display, l, ", %u bytes", (int)total);
}
if (rate)

if (rate > 1 << 10) {
int x = rate + 5; /* for rounding */
snprintf(tp->display + sizeof(tp->display) - l, l,
" | %u.%2.2u MiB/s",
x >> 10, ((x & ((1 << 10) - 1)) * 100) >> 10);
} else if (rate)
snprintf(tp->display + sizeof(tp->display) - l, l,
" | %u KiB/s", rate);
}
Expand Down
2 changes: 2 additions & 0 deletions remote-curl.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "strbuf.h"
#include "walker.h"
#include "http.h"
#include "exec_cmd.h"

static struct ref *get_refs(struct walker *walker, const char *url)
{
Expand Down Expand Up @@ -82,6 +83,7 @@ int main(int argc, const char **argv)
const char *url;
struct walker *walker = NULL;

git_extract_argv0_path(argv[0]);
setup_git_directory();
if (argc < 2) {
fprintf(stderr, "Remote needed\n");
Expand Down

0 comments on commit 18a5364

Please sign in to comment.