mirror of
https://github.com/git/git.git
synced 2026-01-17 22:26:32 +00:00
Merge early part of branch 'jc/diff-apply-patch'
This commit is contained in:
@@ -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
26
date.c
@@ -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
2
diff.c
@@ -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);
|
||||
|
||||
@@ -257,6 +257,7 @@ fi
|
||||
fetch_main () {
|
||||
reflist="$1"
|
||||
refs=
|
||||
rref=
|
||||
|
||||
for ref in $reflist
|
||||
do
|
||||
|
||||
Reference in New Issue
Block a user