summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eb3a9dd)
raw | patch | inline | side by side (parent: eb3a9dd)
author | Benjamin Kramer <benny.kra@googlemail.com> | |
Sat, 7 Mar 2009 20:02:26 +0000 (21:02 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 8 Mar 2009 04:52:23 +0000 (20:52 -0800) |
These weren't used outside and can be safely moved
Signed-off-by: Benjamin Kramer <benny.kra@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Benjamin Kramer <benny.kra@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-fmt-merge-msg.c | patch | blob | history | |
combine-diff.c | patch | blob | history | |
log-tree.c | patch | blob | history | |
upload-pack.c | patch | blob | history |
index df18f4070f3877ed907476f2179590001ec972b7..a7883690d74cb1bcef7b20f27ebbea6f6c5dcc53 100644 (file)
--- a/builtin-fmt-merge-msg.c
+++ b/builtin-fmt-merge-msg.c
int fmt_merge_msg(int merge_summary, struct strbuf *in, struct strbuf *out) {
int limit = 20, i = 0, pos = 0;
- char line[1024];
- char *p = line, *sep = "";
+ char *sep = "";
unsigned char head_sha1[20];
const char *current_branch;
/* get a line */
while (pos < in->len) {
int len;
- char *newline;
+ char *newline, *p = in->buf + pos;
- p = in->buf + pos;
newline = strchr(p, '\n');
len = newline ? newline - p : strlen(p);
pos += len + !!newline;
diff --git a/combine-diff.c b/combine-diff.c
index bccc018ab2666e769e7865d3cad1d61f04443700..b3b86aebcb81972ca50a031f4e15bb7a905101e0 100644 (file)
--- a/combine-diff.c
+++ b/combine-diff.c
return; /* result deleted */
while (1) {
- struct sline *sl = &sline[lno];
unsigned long hunk_end;
unsigned long rlines;
const char *hunk_comment = NULL;
struct lline *ll;
int j;
unsigned long p_mask;
- sl = &sline[lno++];
+ struct sline *sl = &sline[lno++];
ll = (sl->flag & no_pre_delete) ? NULL : sl->lost_head;
while (ll) {
fputs(c_old, stdout);
diff --git a/log-tree.c b/log-tree.c
index 84a74e544b7bcc20c887f321e389ecf3cfb560d6..63cff74350521cf4cc86cdc253cd95a036fa1c75 100644 (file)
--- a/log-tree.c
+++ b/log-tree.c
*/
static int detect_any_signoff(char *letter, int size)
{
- char ch, *cp;
+ char *cp;
int seen_colon = 0;
int seen_at = 0;
int seen_name = 0;
int seen_head = 0;
cp = letter + size;
- while (letter <= --cp && (ch = *cp) == '\n')
+ while (letter <= --cp && *cp == '\n')
continue;
while (letter <= cp) {
- ch = *cp--;
+ char ch = *cp--;
if (ch == '\n')
break;
diff --git a/upload-pack.c b/upload-pack.c
index e15ebdc287e9ed7b91677a2bb8cb13dfc1abe639..a49d87244706a4faacaadf7916ec86f2e2c0f04e 100644 (file)
--- a/upload-pack.c
+++ b/upload-pack.c
static char line[1000];
unsigned char sha1[20];
char hex[41], last_hex[41];
- int len;
save_commit_buffer = 0;
for(;;) {
- len = packet_read_line(0, line, sizeof(line));
+ int len = packet_read_line(0, line, sizeof(line));
reset_timeout();
if (!len) {
packet_write(1, "NAK\n");
continue;
}
- len = strip(line, len);
+ strip(line, len);
if (!prefixcmp(line, "have ")) {
switch (got_sha1(line+5, sha1)) {
case -1: /* they have what we do not */