diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-08-21 01:54:49 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-08-21 01:54:49 -0700 |
commit | 436edc6eae34b5b70371d87239d7883f41b705a2 (patch) | |
tree | c35c4532c49914f1dc69e62eda7f5157446cf5ce | |
parent | 1a1fcf4abeb2ed4ef6075970788711cf62405158 (diff) | |
parent | a81892dd8c37b6f13793739721b520fee3ce4c2c (diff) | |
download | git-436edc6eae34b5b70371d87239d7883f41b705a2.tar.gz git-436edc6eae34b5b70371d87239d7883f41b705a2.tar.xz |
Merge branch 'maint'
* maint:
compat/snprintf.c: handle snprintf's that always return the # chars transmitted
git-svn: fix dcommit to urls with embedded usernames
revision.h: make show_early_output an extern which is defined in revision.c
-rw-r--r-- | compat/snprintf.c | 4 | ||||
-rwxr-xr-x | git-svn.perl | 8 | ||||
-rw-r--r-- | revision.h | 2 |
3 files changed, 10 insertions, 4 deletions
diff --git a/compat/snprintf.c b/compat/snprintf.c index 580966e56..357e73307 100644 --- a/compat/snprintf.c +++ b/compat/snprintf.c @@ -17,6 +17,8 @@ int git_vsnprintf(char *str, size_t maxsize, const char *format, va_list ap) if (maxsize > 0) { ret = vsnprintf(str, maxsize-SNPRINTF_SIZE_CORR, format, ap); + if (ret == maxsize-1) + ret = -1; /* Windows does not NUL-terminate if result fills buffer */ str[maxsize-1] = 0; } @@ -34,6 +36,8 @@ int git_vsnprintf(char *str, size_t maxsize, const char *format, va_list ap) break; s = str; ret = vsnprintf(str, maxsize-SNPRINTF_SIZE_CORR, format, ap); + if (ret == maxsize-1) + ret = -1; } free(s); return ret; diff --git a/git-svn.perl b/git-svn.perl index 099fd02b3..7a1d26db8 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -421,7 +421,7 @@ sub cmd_dcommit { $head ||= 'HEAD'; my @refs; my ($url, $rev, $uuid, $gs) = working_head_info($head, \@refs); - $url = $_commit_url if defined $_commit_url; + $url = defined $_commit_url ? $_commit_url : $gs->full_url; my $last_rev = $_revision if defined $_revision; if ($url) { print "Committing to $url ...\n"; @@ -437,6 +437,8 @@ sub cmd_dcommit { "If these changes depend on each other, re-running ", "without --no-rebase may be required." } + my $expect_url = $url; + Git::SVN::remove_username($expect_url); while (1) { my $d = shift @$linear_refs or last; unless (defined $last_rev) { @@ -511,9 +513,9 @@ sub cmd_dcommit { $gs->refname, "\nBefore dcommitting"; } - if ($url_ ne $url) { + if ($url_ ne $expect_url) { fatal "URL mismatch after rebase: ", - "$url_ != $url"; + "$url_ != $expect_url"; } if ($uuid_ ne $uuid) { fatal "uuid mismatch after rebase: ", diff --git a/revision.h b/revision.h index f64e8ce7f..1b045669a 100644 --- a/revision.h +++ b/revision.h @@ -119,7 +119,7 @@ struct rev_info { void read_revisions_from_stdin(struct rev_info *revs); typedef void (*show_early_output_fn_t)(struct rev_info *, struct commit_list *); -volatile show_early_output_fn_t show_early_output; +extern volatile show_early_output_fn_t show_early_output; extern void init_revisions(struct rev_info *revs, const char *prefix); extern int setup_revisions(int argc, const char **argv, struct rev_info *revs, const char *def); |