]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jc/merge-symlink' into maint
authorJunio C Hamano <junkio@cox.net>
Mon, 26 Feb 2007 03:09:59 +0000 (19:09 -0800)
committerJunio C Hamano <junkio@cox.net>
Mon, 26 Feb 2007 03:09:59 +0000 (19:09 -0800)
* jc/merge-symlink:
  merge-recursive: fix longstanding bug in merging symlinks
  merge-index: fix longstanding bug in merging symlinks

merge-index.c
merge-recursive.c

index a9983dd78ad5cd1e364f0e00c259bdb7e6f151f0..7027d7865971646f178690a150246d9bc4d674c0 100644 (file)
@@ -60,7 +60,7 @@ static int merge_entry(int pos, const char *path)
                        break;
                found++;
                strcpy(hexbuf[stage], sha1_to_hex(ce->sha1));
-               sprintf(ownbuf[stage], "%o", ntohl(ce->ce_mode) & (~S_IFMT));
+               sprintf(ownbuf[stage], "%o", ntohl(ce->ce_mode));
                arguments[stage] = hexbuf[stage];
                arguments[stage + 4] = ownbuf[stage];
        } while (++pos < active_nr);
index 58989424d77467da018e7daf5761f1f85040d2f6..397a7ad85b4968b9376438f12d0c3c70b7aed880 100644 (file)
@@ -589,7 +589,7 @@ static void update_file_flags(const unsigned char *sha,
                        memcpy(lnk, buf, size);
                        lnk[size] = '\0';
                        mkdir_p(path, 0777);
-                       unlink(lnk);
+                       unlink(path);
                        symlink(lnk, path);
                } else
                        die("do not know what to do with %06o %s '%s'",