Merge early part of branch 'jc/diff-apply-patch'

This commit is contained in:
Junio C Hamano
2006-09-29 19:22:50 -07:00
4 changed files with 20 additions and 13 deletions

View File

@@ -360,7 +360,7 @@ static int gitdiff_hdrend(const char *line, struct patch *patch)
static char *gitdiff_verify_name(const char *line, int isnull, char *orig_name, const char *oldnew)
{
if (!orig_name && !isnull)
return find_name(line, NULL, 1, 0);
return find_name(line, NULL, 1, TERM_TAB);
if (orig_name) {
int len;
@@ -370,7 +370,7 @@ static char *gitdiff_verify_name(const char *line, int isnull, char *orig_name,
len = strlen(name);
if (isnull)
die("git-apply: bad git-diff - expected /dev/null, got %s on line %d", name, linenr);
another = find_name(line, NULL, 1, 0);
another = find_name(line, NULL, 1, TERM_TAB);
if (!another || memcmp(another, name, len))
die("git-apply: bad git-diff - inconsistent %s filename on line %d", oldnew, linenr);
free(another);

26
date.c
View File

@@ -256,8 +256,12 @@ static int match_alpha(const char *date, struct tm *tm, int *offset)
}
if (match_string(date, "PM") == 2) {
if (tm->tm_hour > 0 && tm->tm_hour < 12)
tm->tm_hour += 12;
tm->tm_hour = (tm->tm_hour % 12) + 12;
return 2;
}
if (match_string(date, "AM") == 2) {
tm->tm_hour = (tm->tm_hour % 12) + 0;
return 2;
}
@@ -600,28 +604,30 @@ static void date_tea(struct tm *tm, int *num)
static void date_pm(struct tm *tm, int *num)
{
int hour = *num;
int hour, n = *num;
*num = 0;
if (hour > 0 && hour < 12) {
tm->tm_hour = hour;
hour = tm->tm_hour;
if (n) {
hour = n;
tm->tm_min = 0;
tm->tm_sec = 0;
}
if (tm->tm_hour > 0 && tm->tm_hour < 12)
tm->tm_hour += 12;
tm->tm_hour = (hour % 12) + 12;
}
static void date_am(struct tm *tm, int *num)
{
int hour = *num;
int hour, n = *num;
*num = 0;
if (hour > 0 && hour < 12) {
tm->tm_hour = hour;
hour = tm->tm_hour;
if (n) {
hour = n;
tm->tm_min = 0;
tm->tm_sec = 0;
}
tm->tm_hour = (hour % 12);
}
static const struct special {

2
diff.c
View File

@@ -208,7 +208,7 @@ static void emit_rewrite_diff(const char *name_a,
diff_populate_filespec(two, 0);
lc_a = count_lines(one->data, one->size);
lc_b = count_lines(two->data, two->size);
printf("--- %s\n+++ %s\n@@ -", name_a, name_b);
printf("--- a/%s\n+++ b/%s\n@@ -", name_a, name_b);
print_line_count(lc_a);
printf(" +");
print_line_count(lc_b);

View File

@@ -257,6 +257,7 @@ fi
fetch_main () {
reflist="$1"
refs=
rref=
for ref in $reflist
do