Merge branch 'nd/clean-preserve-errno-in-warning'
[gitweb.git] / builtin / clone.c
index 6c76a6ed66fef567ca06e3e864b37fc3bed151d5..3f63edbbf94fdf83307621ed822722e5c9f89321 100644 (file)
@@ -99,7 +99,7 @@ static struct option builtin_clone_options[] = {
        OPT_STRING(0, "shallow-since", &option_since, N_("time"),
                    N_("create a shallow clone since a specific time")),
        OPT_STRING_LIST(0, "shallow-exclude", &option_not, N_("revision"),
-                       N_("deepen history of shallow clone by excluding rev")),
+                       N_("deepen history of shallow clone, excluding rev")),
        OPT_BOOL(0, "single-branch", &option_single_branch,
                    N_("clone only one branch, HEAD or --branch")),
        OPT_BOOL(0, "shallow-submodules", &option_shallow_submodules,
@@ -170,7 +170,7 @@ static char *get_repo_path(const char *repo, int *is_bundle)
 
        strbuf_addstr(&path, repo);
        raw = get_repo_path_1(&path, is_bundle);
-       canon = raw ? xstrdup(absolute_path(raw)) : NULL;
+       canon = raw ? absolute_pathdup(raw) : NULL;
        strbuf_release(&path);
        return canon;
 }
@@ -711,7 +711,7 @@ static int checkout(int submodule_progress)
        setup_work_tree();
 
        lock_file = xcalloc(1, sizeof(struct lock_file));
-       hold_locked_index(lock_file, 1);
+       hold_locked_index(lock_file, LOCK_DIE_ON_ERROR);
 
        memset(&opts, 0, sizeof opts);
        opts.update = 1;
@@ -894,7 +894,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 
        path = get_repo_path(repo_name, &is_bundle);
        if (path)
-               repo = xstrdup(absolute_path(repo_name));
+               repo = absolute_pathdup(repo_name);
        else if (!strchr(repo_name, ':'))
                die(_("repository '%s' does not exist"), repo_name);
        else