diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-03-05 02:02:45 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-03-05 02:02:45 +0300 |
commit | 07873dc5dd67398324278ff0d7627bb1a863ba89 (patch) | |
tree | 6e40258b627f26c729083c1cca9920f89aac637f | |
parent | 6d74e5c9dbe71e2eb63c6e8862ec979e9a5f068b (diff) | |
parent | 964498e7f90bc5d822746bbf953fb66c6b01ac1c (diff) |
Merge branch 'maint'
* maint:
Documentation: fix a typo in git-apply.txt
init: remove unnecessary check
-rw-r--r-- | Documentation/git-apply.txt | 2 | ||||
-rw-r--r-- | builtin/init-db.c | 12 |
2 files changed, 6 insertions, 8 deletions
diff --git a/Documentation/git-apply.txt b/Documentation/git-apply.txt index 881652f490..2dcfc097d3 100644 --- a/Documentation/git-apply.txt +++ b/Documentation/git-apply.txt @@ -22,7 +22,7 @@ DESCRIPTION ----------- 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 `--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, and does not require them to be in a git repository. diff --git a/builtin/init-db.c b/builtin/init-db.c index 4f5348eec6..fbeb380ee2 100644 --- a/builtin/init-db.c +++ b/builtin/init-db.c @@ -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); if (!is_bare_repository_cfg) { - if (git_dir) { - const char *git_dir_parent = strrchr(git_dir, '/'); - if (git_dir_parent) { - char *rel = xstrndup(git_dir, git_dir_parent - git_dir); - git_work_tree_cfg = xstrdup(make_absolute_path(rel)); - free(rel); - } + const char *git_dir_parent = strrchr(git_dir, '/'); + if (git_dir_parent) { + char *rel = xstrndup(git_dir, git_dir_parent - git_dir); + git_work_tree_cfg = xstrdup(make_absolute_path(rel)); + free(rel); } if (!git_work_tree_cfg) { git_work_tree_cfg = xcalloc(PATH_MAX, 1); |