Merge branch 'maint'
* maint: Documentation: fix a typo in git-apply.txt init: remove unnecessary check
This commit is contained in:
@ -22,7 +22,7 @@ DESCRIPTION
|
|||||||
-----------
|
-----------
|
||||||
Reads the supplied diff output (i.e. "a patch") and applies it to files.
|
Reads the supplied diff output (i.e. "a patch") and applies it to files.
|
||||||
With the `--index` option the patch is also applied to the index, and
|
With the `--index` option the patch is also applied to the index, and
|
||||||
with the `--cache` option the patch is only applied to the index.
|
with the `--cached` option the patch is only applied to the index.
|
||||||
Without these options, the command applies the patch only to files,
|
Without these options, the command applies the patch only to files,
|
||||||
and does not require them to be in a git repository.
|
and does not require them to be in a git repository.
|
||||||
|
|
||||||
|
@ -498,13 +498,11 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
|
|||||||
is_bare_repository_cfg = guess_repository_type(git_dir);
|
is_bare_repository_cfg = guess_repository_type(git_dir);
|
||||||
|
|
||||||
if (!is_bare_repository_cfg) {
|
if (!is_bare_repository_cfg) {
|
||||||
if (git_dir) {
|
const char *git_dir_parent = strrchr(git_dir, '/');
|
||||||
const char *git_dir_parent = strrchr(git_dir, '/');
|
if (git_dir_parent) {
|
||||||
if (git_dir_parent) {
|
char *rel = xstrndup(git_dir, git_dir_parent - git_dir);
|
||||||
char *rel = xstrndup(git_dir, git_dir_parent - git_dir);
|
git_work_tree_cfg = xstrdup(make_absolute_path(rel));
|
||||||
git_work_tree_cfg = xstrdup(make_absolute_path(rel));
|
free(rel);
|
||||||
free(rel);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!git_work_tree_cfg) {
|
if (!git_work_tree_cfg) {
|
||||||
git_work_tree_cfg = xcalloc(PATH_MAX, 1);
|
git_work_tree_cfg = xcalloc(PATH_MAX, 1);
|
||||||
|
Reference in New Issue
Block a user