~ubuntu-branches/ubuntu/gutsy/git-core/gutsy-updates

« back to all changes in this revision

Viewing changes to builtin-read-tree.c

  • Committer: Package Import Robot
  • Author(s): Gerrit Pape
  • Date: 2007-05-30 12:38:45 UTC
  • mfrom: (1.1.17)
  • Revision ID: package-import@ubuntu.com-20070530123845-mhso4051d7vx1189
Tags: 1:1.5.2-1
* merge branch debian-experimental.
* new upstream release.
  * gitweb: choose appropriate view for file type if a= parameter missing
    (closes: #410465).
  * git fetch -q is supported (closes: #423165).
* /usr/bin/git transition (thx Ian Beckwith!).
  * debian/git-core.preinst: new; remove /usr/bin/git alternative if
    upgrading from versions older than 1:1.5.2~rc3-2.
  * debian/git-core.prerm, debian/git-core.postinst: remove; no longer
    handle /usr/bin/git alternative through update-alternatives.
  * debian/rules: no longer install git program as git-scm.

Show diffs side-by-side

added added

removed removed

Lines of Context:
84
84
 
85
85
}
86
86
 
87
 
static const char read_tree_usage[] = "git-read-tree (<sha> | [[-m [--aggressive] | --reset | --prefix=<prefix>] [-u | -i]] [--exclude-per-directory=<gitignore>] <sha1> [<sha2> [<sha3>]])";
 
87
static const char read_tree_usage[] = "git-read-tree (<sha> | [[-m [--aggressive] | --reset | --prefix=<prefix>] [-u | -i]] [--exclude-per-directory=<gitignore>] [--index-output=<file>] <sha1> [<sha2> [<sha3>]])";
88
88
 
89
89
static struct lock_file lock_file;
90
90
 
100
100
        setup_git_directory();
101
101
        git_config(git_default_config);
102
102
 
103
 
        newfd = hold_lock_file_for_update(&lock_file, get_index_file(), 1);
 
103
        newfd = hold_locked_index(&lock_file, 1);
104
104
 
105
105
        git_config(git_default_config);
106
106
 
128
128
                        continue;
129
129
                }
130
130
 
 
131
                if (!prefixcmp(arg, "--index-output=")) {
 
132
                        set_alternate_index_output(arg + 15);
 
133
                        continue;
 
134
                }
 
135
 
131
136
                /* "--prefix=<subdirectory>/" means keep the current index
132
137
                 *  entries and put the entries from the tree under the
133
138
                 * given subdirectory.
228
233
                if (0 <= pos)
229
234
                        die("file '%.*s' already exists.",
230
235
                                        pfxlen-1, opts.prefix);
 
236
                opts.pos = -1 - pos;
231
237
        }
232
238
 
233
239
        if (opts.merge) {
267
273
        }
268
274
 
269
275
        if (write_cache(newfd, active_cache, active_nr) ||
270
 
            close(newfd) || commit_lock_file(&lock_file))
 
276
            close(newfd) || commit_locked_index(&lock_file))
271
277
                die("unable to write new index file");
272
278
        return 0;
273
279
}