private String parseName(String expect, int ptr, int end) { if (ptr == end) return expect; String r; if (buf[ptr] == '"') { // New style GNU diff format // r = QuotedString.GIT_PATH.dequote(buf, ptr, end - 1); } else { // Older style GNU diff format, an optional tab ends the name. // int tab = end; while (ptr < tab && buf[tab - 1] != '\t') tab--; if (ptr == tab) tab = end; r = decode(UTF_8, buf, ptr, tab - 1); } if (r.equals(DEV_NULL)) r = DEV_NULL; return r; }
@Override public void consume(String line) { if (line.trim().length() != 0) changedFiles.add(QuotedString.GIT_PATH.dequote(line)); }
@Override public void consume(String line) { if (line.contains("\t")) { StringTokenizer tokenizer = new StringTokenizer(line, "\t"); int additions; String field = tokenizer.nextToken(); if (field.equals("-")) additions = -1; else additions = Integer.parseInt(field); int deletions; field = tokenizer.nextToken(); if (field.equals("-")) deletions = -1; else deletions = Integer.parseInt(field); String file = QuotedString.GIT_PATH.dequote(tokenizer.nextToken()); fileChanges.add(new FileChange(null, file, additions, deletions)); } }
return eol; oldPath = QuotedString.GIT_PATH.dequote(buf, bol, sp - 1); oldPath = p1(oldPath); } else {
return eol; oldPath = QuotedString.GIT_PATH.dequote(buf, bol, sp - 1); oldPath = p1(oldPath); } else {
new FileChange(oldPath, newPath, additions, deletions)); } else { String oldPath = QuotedString.GIT_PATH.dequote(path.substring(0, renameSignIndex)); String newPath = QuotedString.GIT_PATH.dequote(path.substring(renameSignIndex+4)); commitBuilderRef.get().fileChanges.add( new FileChange(oldPath, newPath, additions, deletions)); path = QuotedString.GIT_PATH.dequote(path); commitBuilderRef.get().fileChanges.add(new FileChange(null, path, additions, deletions));
private String parseName(String expect, int ptr, int end) { if (ptr == end) return expect; String r; if (buf[ptr] == '"') { // New style GNU diff format // r = QuotedString.GIT_PATH.dequote(buf, ptr, end - 1); } else { // Older style GNU diff format, an optional tab ends the name. // int tab = end; while (ptr < tab && buf[tab - 1] != '\t') tab--; if (ptr == tab) tab = end; r = decode(UTF_8, buf, ptr, tab - 1); } if (r.equals(DEV_NULL)) r = DEV_NULL; return r; }
private String parseName(final String expect, int ptr, final int end) { if (ptr == end) return expect; String r; if (buf[ptr] == '"') { // New style GNU diff format // r = QuotedString.GIT_PATH.dequote(buf, ptr, end - 1); } else { // Older style GNU diff format, an optional tab ends the name. // int tab = end; while (ptr < tab && buf[tab - 1] != '\t') tab--; if (ptr == tab) tab = end; r = decode(Constants.CHARSET, buf, ptr, tab - 1); } if (r.equals(DEV_NULL)) r = DEV_NULL; return r; }
return eol; oldPath = QuotedString.GIT_PATH.dequote(buf, bol, sp - 1); oldPath = p1(oldPath); } else {