1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-01 14:57:52 +01:00

Merge early parts of branch 'ff/c99'

This commit is contained in:
Junio C Hamano 2006-06-18 22:13:54 -07:00
commit 275fb96ae6
8 changed files with 50 additions and 38 deletions

View file

@ -301,9 +301,9 @@ static void fill_line_map(struct commit *commit, struct commit *other,
if (DEBUG)
printf("map: i1: %d %d %p i2: %d %d %p\n",
i1, map[i1],
i1 != -1 ? blame_lines[map[i1]] : NULL,
(void *) (i1 != -1 ? blame_lines[map[i1]] : NULL),
i2, map2[i2],
i2 != -1 ? blame_lines[map2[i2]] : NULL);
(void *) (i2 != -1 ? blame_lines[map2[i2]] : NULL));
if (map2[i2] != -1 &&
blame_lines[map[i1]] &&
!blame_lines[map2[i2]])

View file

@ -31,8 +31,7 @@ static int merge_size = 0;
static struct object_list *trees = NULL;
static struct cache_entry df_conflict_entry = {
};
static struct cache_entry df_conflict_entry;
struct tree_entry_list {
struct tree_entry_list *next;

View file

@ -22,6 +22,7 @@
#include <string.h>
#include "delta.h"
#include "git-compat-util.h"
/* maximum hash entry list for the same hash bucket */
#define HASH_LIMIT 64
@ -131,7 +132,7 @@ struct delta_index {
const void *src_buf;
unsigned long src_size;
unsigned int hash_mask;
struct index_entry *hash[0];
struct index_entry *hash[FLEX_ARRAY];
};
struct delta_index * create_delta_index(const void *buf, unsigned long bufsize)

View file

@ -34,21 +34,23 @@ int run_diff_files(struct rev_info *revs, int silent_on_removed)
continue;
if (ce_stage(ce)) {
struct {
struct combine_diff_path p;
struct combine_diff_parent filler[5];
} combine;
struct combine_diff_path *dpath;
int num_compare_stages = 0;
size_t path_len;
combine.p.next = NULL;
combine.p.len = ce_namelen(ce);
combine.p.path = xmalloc(combine.p.len + 1);
memcpy(combine.p.path, ce->name, combine.p.len);
combine.p.path[combine.p.len] = 0;
combine.p.mode = 0;
memset(combine.p.sha1, 0, 20);
memset(&combine.p.parent[0], 0,
sizeof(combine.filler));
path_len = ce_namelen(ce);
dpath = xmalloc (combine_diff_path_size (5, path_len));
dpath->path = (char *) &(dpath->parent[5]);
dpath->next = NULL;
dpath->len = path_len;
memcpy(dpath->path, ce->name, path_len);
dpath->path[path_len] = '\0';
dpath->mode = 0;
memset(dpath->sha1, 0, 20);
memset(&(dpath->parent[0]), 0,
sizeof(struct combine_diff_parent)*5);
while (i < entries) {
struct cache_entry *nce = active_cache[i];
@ -64,11 +66,11 @@ int run_diff_files(struct rev_info *revs, int silent_on_removed)
if (2 <= stage) {
int mode = ntohl(nce->ce_mode);
num_compare_stages++;
memcpy(combine.p.parent[stage-2].sha1,
memcpy(dpath->parent[stage-2].sha1,
nce->sha1, 20);
combine.p.parent[stage-2].mode =
dpath->parent[stage-2].mode =
canon_mode(mode);
combine.p.parent[stage-2].status =
dpath->parent[stage-2].status =
DIFF_STATUS_MODIFIED;
}
@ -83,13 +85,14 @@ int run_diff_files(struct rev_info *revs, int silent_on_removed)
i--;
if (revs->combine_merges && num_compare_stages == 2) {
show_combined_diff(&combine.p, 2,
show_combined_diff(dpath, 2,
revs->dense_combined_merges,
revs);
free(combine.p.path);
free(dpath);
continue;
}
free(combine.p.path);
free(dpath);
dpath = NULL;
/*
* Show the diff for the 'ce' if we found the one

View file

@ -1136,13 +1136,14 @@ int fetch(unsigned char *sha1)
static inline int needs_quote(int ch)
{
switch (ch) {
case '/': case '-': case '.':
case 'A'...'Z': case 'a'...'z': case '0'...'9':
if (((ch >= 'A') && (ch <= 'Z'))
|| ((ch >= 'a') && (ch <= 'z'))
|| ((ch >= '0') && (ch <= '9'))
|| (ch == '/')
|| (ch == '-')
|| (ch == '.'))
return 0;
default:
return 1;
}
return 1;
}
static inline int hex(int v)

View file

@ -1077,13 +1077,14 @@ static int fetch_indices(void)
static inline int needs_quote(int ch)
{
switch (ch) {
case '/': case '-': case '.':
case 'A'...'Z': case 'a'...'z': case '0'...'9':
if (((ch >= 'A') && (ch <= 'Z'))
|| ((ch >= 'a') && (ch <= 'z'))
|| ((ch >= '0') && (ch <= '9'))
|| (ch == '/')
|| (ch == '-')
|| (ch == '.'))
return 0;
default:
return 1;
}
return 1;
}
static inline int hex(int v)

View file

@ -93,7 +93,7 @@ typedef struct {
char *data;
int len;
unsigned char flags;
unsigned char crlf:1;
unsigned int crlf:1;
} msg_data_t;
#define DRV_OK 0

View file

@ -206,7 +206,14 @@ char *unquote_c_style(const char *quoted, const char **endp)
case '\\': case '"':
break; /* verbatim */
case '0'...'7':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
/* octal */
ac = ((ch - '0') << 6);
if ((ch = *sp++) < '0' || '7' < ch)