diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-03-04 15:02:45 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-03-04 15:02:45 -0800 |
commit | 07873dc5dd67398324278ff0d7627bb1a863ba89 (patch) | |
tree | 6e40258b627f26c729083c1cca9920f89aac637f /builtin | |
parent | 6d74e5c9dbe71e2eb63c6e8862ec979e9a5f068b (diff) | |
parent | 964498e7f90bc5d822746bbf953fb66c6b01ac1c (diff) | |
download | git-07873dc5dd67398324278ff0d7627bb1a863ba89.tar.gz git-07873dc5dd67398324278ff0d7627bb1a863ba89.tar.xz |
Merge branch 'maint'
* maint:
Documentation: fix a typo in git-apply.txt
init: remove unnecessary check
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/init-db.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/builtin/init-db.c b/builtin/init-db.c index 4f5348eec..fbeb380ee 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); |