X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=fast-import.c;h=7089e6f9e6c5fa9142f468e54afe7d33a6d2eec7;hb=d14e7407b34b8c11b407358b9677c283c381a71c;hp=e72b28679410155cb43968d315f02588e89fd5f1;hpb=60727b5800d7791e5b107620cb5b2d344cf97fe9;p=git.git diff --git a/fast-import.c b/fast-import.c index e72b28679..7089e6f9e 100644 --- a/fast-import.c +++ b/fast-import.c @@ -1868,6 +1868,7 @@ static void file_change_m(struct branch *b) case S_IFREG | 0644: case S_IFREG | 0755: case S_IFLNK: + case S_IFGITLINK: case 0644: case 0755: /* ok */ @@ -1900,7 +1901,20 @@ static void file_change_m(struct branch *b) p = uq.buf; } - if (inline_data) { + if (S_ISGITLINK(mode)) { + if (inline_data) + die("Git links cannot be specified 'inline': %s", + command_buf.buf); + else if (oe) { + if (oe->type != OBJ_COMMIT) + die("Not a commit (actually a %s): %s", + typename(oe->type), command_buf.buf); + } + /* + * Accept the sha1 without checking; it expected to be in + * another repository. + */ + } else if (inline_data) { static struct strbuf buf = STRBUF_INIT; if (p != uq.buf) { @@ -2374,7 +2388,7 @@ static int git_pack_config(const char *k, const char *v, void *cb) } static const char fast_import_usage[] = -"git-fast-import [--date-format=f] [--max-pack-size=n] [--depth=n] [--active-branches=n] [--export-marks=marks.file]"; +"git fast-import [--date-format=f] [--max-pack-size=n] [--depth=n] [--active-branches=n] [--export-marks=marks.file]"; int main(int argc, const char **argv) {