]> asedeno.scripts.mit.edu Git - git.git/blobdiff - fast-import.c
Merge git://git.kernel.org/pub/scm/gitk/gitk
[git.git] / fast-import.c
index c4d054ecc7f921d15916441b8323dda28aa30d2c..7089e6f9e6c5fa9142f468e54afe7d33a6d2eec7 100644 (file)
@@ -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) {