Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* maint:
  Documentation: fix a typo in git-apply.txt
  init: remove unnecessary check
  • Loading branch information
Junio C Hamano committed Mar 4, 2011
2 parents 6d74e5c + 964498e commit 07873dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Documentation/git-apply.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
12 changes: 5 additions & 7 deletions builtin/init-db.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 07873dc

Please sign in to comment.