Merge branch 'maint'
* maint: Document -<n> for git-format-patch glossary: add 'reflog' diff --no-index: fix --name-status with added files Don't smash stack when $GIT_ALTERNATE_OBJECT_DIRECTORIES is too long
This commit is contained in:
commit
e2b1accc59
@ -53,6 +53,9 @@ OPTIONS
|
||||
-------
|
||||
include::diff-options.txt[]
|
||||
|
||||
-<n>::
|
||||
Limits the number of patches to prepare.
|
||||
|
||||
-o|--output-directory <dir>::
|
||||
Use <dir> to store the resulting files, instead of the
|
||||
current working directory.
|
||||
|
@ -330,6 +330,12 @@ This commit is referred to as a "merge commit", or sometimes just a
|
||||
denotes a particular <<def_object,object>>. These may be stored in
|
||||
`$GIT_DIR/refs/`.
|
||||
|
||||
[[def_reflog]]reflog::
|
||||
A reflog shows the local "history" of a ref. In other words,
|
||||
it can tell you what the 3rd last revision in _this_ repository
|
||||
was, and what was the current state in _this_ repository,
|
||||
yesterday 9:14pm. See gitlink:git-reflog[1] for details.
|
||||
|
||||
[[def_refspec]]refspec::
|
||||
A "refspec" is used by <<def_fetch,fetch>> and
|
||||
<<def_push,push>> to describe the mapping between remote
|
||||
|
3
diff.c
3
diff.c
@ -2418,7 +2418,8 @@ static void diff_flush_raw(struct diff_filepair *p,
|
||||
printf("%s ",
|
||||
diff_unique_abbrev(p->two->sha1, abbrev));
|
||||
}
|
||||
printf("%s%c%s", status, inter_name_termination, path_one);
|
||||
printf("%s%c%s", status, inter_name_termination,
|
||||
two_paths || p->one->mode ? path_one : path_two);
|
||||
if (two_paths)
|
||||
printf("%c%s", inter_name_termination, path_two);
|
||||
putchar(line_termination);
|
||||
|
16
sha1_file.c
16
sha1_file.c
@ -352,10 +352,14 @@ static void read_info_alternates(const char * relative_base, int depth)
|
||||
char *map;
|
||||
size_t mapsz;
|
||||
struct stat st;
|
||||
char path[PATH_MAX];
|
||||
const char alt_file_name[] = "info/alternates";
|
||||
/* Given that relative_base is no longer than PATH_MAX,
|
||||
ensure that "path" has enough space to append "/", the
|
||||
file name, "info/alternates", and a trailing NUL. */
|
||||
char path[PATH_MAX + 1 + sizeof alt_file_name];
|
||||
int fd;
|
||||
|
||||
sprintf(path, "%s/info/alternates", relative_base);
|
||||
sprintf(path, "%s/%s", relative_base, alt_file_name);
|
||||
fd = open(path, O_RDONLY);
|
||||
if (fd < 0)
|
||||
return;
|
||||
@ -836,7 +840,10 @@ void install_packed_git(struct packed_git *pack)
|
||||
|
||||
static void prepare_packed_git_one(char *objdir, int local)
|
||||
{
|
||||
char path[PATH_MAX];
|
||||
/* Ensure that this buffer is large enough so that we can
|
||||
append "/pack/" without clobbering the stack even if
|
||||
strlen(objdir) were PATH_MAX. */
|
||||
char path[PATH_MAX + 1 + 4 + 1 + 1];
|
||||
int len;
|
||||
DIR *dir;
|
||||
struct dirent *de;
|
||||
@ -858,6 +865,9 @@ static void prepare_packed_git_one(char *objdir, int local)
|
||||
if (!has_extension(de->d_name, ".idx"))
|
||||
continue;
|
||||
|
||||
if (len + namelen + 1 > sizeof(path))
|
||||
continue;
|
||||
|
||||
/* Don't reopen a pack we already have. */
|
||||
strcpy(path + len, de->d_name);
|
||||
for (p = packed_git; p; p = p->next) {
|
||||
|
@ -17,6 +17,7 @@ test_expect_success setup '
|
||||
export GIT_AUTHOR_DATE GIT_COMMITTER_DATE &&
|
||||
|
||||
mkdir dir &&
|
||||
mkdir dir2 &&
|
||||
for i in 1 2 3; do echo $i; done >file0 &&
|
||||
for i in A B; do echo $i; done >dir/sub &&
|
||||
cat file0 >file2 &&
|
||||
@ -254,6 +255,7 @@ diff --patch-with-stat initial..side
|
||||
diff --patch-with-raw initial..side
|
||||
diff --patch-with-stat -r initial..side
|
||||
diff --patch-with-raw -r initial..side
|
||||
diff --name-status dir2 dir
|
||||
EOF
|
||||
|
||||
test_done
|
||||
|
3
t/t4013/diff.diff_--name-status_dir2_dir
Normal file
3
t/t4013/diff.diff_--name-status_dir2_dir
Normal file
@ -0,0 +1,3 @@
|
||||
$ git diff --name-status dir2 dir
|
||||
A dir/sub
|
||||
$
|
Loading…
Reference in New Issue
Block a user