projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Plug leak in Daniel's read-tree.
[git.git]
/
diff-files.c
diff --git
a/diff-files.c
b/diff-files.c
index
39dd54f
..
89eb29b
100644
(file)
--- a/
diff-files.c
+++ b/
diff-files.c
@@
-6,7
+6,7
@@
#include "cache.h"
#include "diff.h"
#include "cache.h"
#include "diff.h"
-static const char
*diff_files_usage
=
+static const char
diff_files_usage[]
=
"git-diff-files [-q] "
"[<common diff options>] [<path>...]"
COMMON_DIFF_OPTIONS_HELP;
"git-diff-files [-q] "
"[<common diff options>] [<path>...]"
COMMON_DIFF_OPTIONS_HELP;
@@
-41,12
+41,12
@@
static void show_modified(int oldmode, int mode,
diff_change(oldmode, mode, old_sha1, sha1, path, NULL);
}
diff_change(oldmode, mode, old_sha1, sha1, path, NULL);
}
-int main(int argc, c
onst c
har **argv)
+int main(int argc, char **argv)
{
static const unsigned char null_sha1[20] = { 0, };
const char **pathspec;
{
static const unsigned char null_sha1[20] = { 0, };
const char **pathspec;
-
int entries = read_cache
();
- int i;
+
const char *prefix = setup_git_directory
();
+ int
entries,
i;
while (1 < argc && argv[1][0] == '-') {
if (!strcmp(argv[1], "-p") || !strcmp(argv[1], "-u"))
while (1 < argc && argv[1][0] == '-') {
if (!strcmp(argv[1], "-p") || !strcmp(argv[1], "-u"))
@@
-95,8
+95,9
@@
int main(int argc, const char **argv)
argv++; argc--;
}
argv++; argc--;
}
- /* Do we have a pathspec? */
- pathspec = (argc > 1) ? argv + 1 : NULL;
+ /* Find the directory, and set up the pathspec */
+ pathspec = get_pathspec(prefix, argv + 1);
+ entries = read_cache();
if (find_copies_harder && detect_rename != DIFF_DETECT_COPY)
usage(diff_files_usage);
if (find_copies_harder && detect_rename != DIFF_DETECT_COPY)
usage(diff_files_usage);