summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fbf5df0)
raw | patch | inline | side by side (parent: fbf5df0)
author | Martin Waitz <tali@admingilde.org> | |
Mon, 21 May 2007 20:08:28 +0000 (22:08 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 22 May 2007 06:34:54 +0000 (23:34 -0700) |
Unify naming of plumbing dirlink/gitlink concept:
git ls-files -z '*.[ch]' |
xargs -0 perl -pi -e 's/dirlink/gitlink/g;' -e 's/DIRLNK/GITLINK/g;'
Signed-off-by: Junio C Hamano <junkio@cox.net>
git ls-files -z '*.[ch]' |
xargs -0 perl -pi -e 's/dirlink/gitlink/g;' -e 's/DIRLNK/GITLINK/g;'
Signed-off-by: Junio C Hamano <junkio@cox.net>
14 files changed:
archive-tar.c | patch | blob | history | |
archive-zip.c | patch | blob | history | |
builtin-fsck.c | patch | blob | history | |
builtin-ls-tree.c | patch | blob | history | |
builtin-update-index.c | patch | blob | history | |
cache-tree.c | patch | blob | history | |
cache.h | patch | blob | history | |
diff.c | patch | blob | history | |
dir.c | patch | blob | history | |
dir.h | patch | blob | history | |
entry.c | patch | blob | history | |
list-objects.c | patch | blob | history | |
read-cache.c | patch | blob | history | |
tree.c | patch | blob | history |
diff --git a/archive-tar.c b/archive-tar.c
index 33e76576f149d89922deda1de5548be7bc42d0eb..66fe3e375b545613faba4e051dc41c1acb5d8cee 100644 (file)
--- a/archive-tar.c
+++ b/archive-tar.c
} else {
if (verbose)
fprintf(stderr, "%.*s\n", path->len, path->buf);
- if (S_ISDIR(mode) || S_ISDIRLNK(mode)) {
+ if (S_ISDIR(mode) || S_ISGITLINK(mode)) {
*header.typeflag = TYPEFLAG_DIR;
mode = (mode | 0777) & ~tar_umask;
} else if (S_ISLNK(mode)) {
memcpy(path.buf + baselen, filename, filenamelen);
path.len = baselen + filenamelen;
path.buf[path.len] = '\0';
- if (S_ISDIR(mode) || S_ISDIRLNK(mode)) {
+ if (S_ISDIR(mode) || S_ISGITLINK(mode)) {
strbuf_append_string(&path, "/");
buffer = NULL;
size = 0;
diff --git a/archive-zip.c b/archive-zip.c
index 3cbf6bb8ac4045803140ca5019126015e817155e..444e1623db66fe4f5d8983e1e9e2cf4083b005b4 100644 (file)
--- a/archive-zip.c
+++ b/archive-zip.c
goto out;
}
- if (S_ISDIR(mode) || S_ISDIRLNK(mode)) {
+ if (S_ISDIR(mode) || S_ISGITLINK(mode)) {
method = 0;
attr2 = 16;
result = (S_ISDIR(mode) ? READ_TREE_RECURSIVE : 0);
diff --git a/builtin-fsck.c b/builtin-fsck.c
index 44ce629a498f986f239e008a61d32e10968907e0..cbbcaf011a09d1dd9b3f2a01d18e1ab93e26fd3b 100644 (file)
--- a/builtin-fsck.c
+++ b/builtin-fsck.c
case S_IFREG | 0644:
case S_IFLNK:
case S_IFDIR:
- case S_IFDIRLNK:
+ case S_IFGITLINK:
break;
/*
* This is nonstandard, but we had a few of these
struct object *obj;
mode = ntohl(active_cache[i]->ce_mode);
- if (S_ISDIRLNK(mode))
+ if (S_ISGITLINK(mode))
continue;
blob = lookup_blob(active_cache[i]->sha1);
if (!blob)
diff --git a/builtin-ls-tree.c b/builtin-ls-tree.c
index 1cb4dca277b511315d3b914239c57621fc60bcf3..9a5977fb99c3c61522fee3678fb94b1815575c61 100644 (file)
--- a/builtin-ls-tree.c
+++ b/builtin-ls-tree.c
int retval = 0;
const char *type = blob_type;
- if (S_ISDIRLNK(mode)) {
+ if (S_ISGITLINK(mode)) {
/*
* Maybe we want to have some recursive version here?
*
diff --git a/builtin-update-index.c b/builtin-update-index.c
index 8f9899178b1755ee0acd4a34ee185a4f54fb4219..509369e9e7b1719e53ba2dd2d976066fb9513353 100644 (file)
--- a/builtin-update-index.c
+++ b/builtin-update-index.c
/* Exact match: file or existing gitlink */
if (pos >= 0) {
struct cache_entry *ce = active_cache[pos];
- if (S_ISDIRLNK(ntohl(ce->ce_mode))) {
+ if (S_ISGITLINK(ntohl(ce->ce_mode))) {
/* Do nothing to the index if there is no HEAD! */
if (resolve_gitlink_ref(path, "HEAD", sha1) < 0)
int pos = cache_name_pos(path, len);
struct cache_entry *ce = pos < 0 ? NULL : active_cache[pos];
- if (ce && S_ISDIRLNK(ntohl(ce->ce_mode)))
+ if (ce && S_ISGITLINK(ntohl(ce->ce_mode)))
return error("%s is already a gitlink, not replacing", path);
return add_one_path(ce, path, len, st);
diff --git a/cache-tree.c b/cache-tree.c
index 6369cc7c536ba7b82a6afcb191628beefe889b72..350a79b768e7c032e1b4815f7201c9ce5f88bc8d 100644 (file)
--- a/cache-tree.c
+++ b/cache-tree.c
mode = ntohl(ce->ce_mode);
entlen = pathlen - baselen;
}
- if (mode != S_IFDIRLNK && !missing_ok && !has_sha1_file(sha1))
+ if (mode != S_IFGITLINK && !missing_ok && !has_sha1_file(sha1))
return error("invalid object %s", sha1_to_hex(sha1));
if (!ce->ce_mode)
index 65b4685c1fedf4fd7da1b5f4ab3c4ba9645331e3..cd875bc2e95ded83eb8619eec106fff88a9012c4 100644 (file)
--- a/cache.h
+++ b/cache.h
* happens that everybody shares the same bit representation
* in the UNIX world (and apparently wider too..)
*/
-#define S_IFDIRLNK 0160000
-#define S_ISDIRLNK(m) (((m) & S_IFMT) == S_IFDIRLNK)
+#define S_IFGITLINK 0160000
+#define S_ISGITLINK(m) (((m) & S_IFMT) == S_IFGITLINK)
/*
* Intensive research over the course of many years has shown that
{
if (S_ISLNK(mode))
return htonl(S_IFLNK);
- if (S_ISDIR(mode) || S_ISDIRLNK(mode))
- return htonl(S_IFDIRLNK);
+ if (S_ISDIR(mode) || S_ISGITLINK(mode))
+ return htonl(S_IFGITLINK);
return htonl(S_IFREG | ce_permissions(mode));
}
static inline unsigned int ce_mode_from_stat(struct cache_entry *ce, unsigned int mode)
@@ -142,7 +142,7 @@ static inline unsigned int ce_mode_from_stat(struct cache_entry *ce, unsigned in
}
#define canon_mode(mode) \
(S_ISREG(mode) ? (S_IFREG | ce_permissions(mode)) : \
- S_ISLNK(mode) ? S_IFLNK : S_ISDIR(mode) ? S_IFDIR : S_IFDIRLNK)
+ S_ISLNK(mode) ? S_IFLNK : S_ISDIR(mode) ? S_IFDIR : S_IFGITLINK)
#define cache_entry_size(len) ((offsetof(struct cache_entry,name) + (len) + 8) & ~7)
index b23e1906783664103cf9b363a93a35f7d043c8ee..0e260490d7fd74aa9761f286f1ad671a6ea39841 100644 (file)
--- a/diff.c
+++ b/diff.c
if (size_only && 0 < s->size)
return 0;
- if (S_ISDIRLNK(s->mode))
+ if (S_ISGITLINK(s->mode))
return diff_populate_gitlink(s, size_only);
if (!s->sha1_valid ||
index 11fab7f4bf9b93be33795dfd5c1a3c55c8a8079d..f543f50f42d5bca1a6a6f981e8bb1b3cafd352ea 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -321,7 +321,7 @@ static enum exist_status directory_exists_in_index(const char *dirname, int len)
break;
if (endchar == '/')
return index_directory;
- if (!endchar && S_ISDIRLNK(ntohl(ce->ce_mode)))
+ if (!endchar && S_ISGITLINK(ntohl(ce->ce_mode)))
return index_gitdir;
}
return index_nonexistent;
@@ -356,7 +356,7 @@ static enum exist_status directory_exists_in_index(const char *dirname, int len)
* also true and the directory is empty, in which case
* we just ignore it entirely.
* (b) if it looks like a git directory, and we don't have
- * 'no_dirlinks' set we treat it as a gitlink, and show it
+ * 'no_gitlinks' set we treat it as a gitlink, and show it
* as a directory.
* (c) otherwise, we recurse into it.
*/
case index_nonexistent:
if (dir->show_other_directories)
break;
- if (!dir->no_dirlinks) {
+ if (!dir->no_gitlinks) {
unsigned char sha1[20];
if (resolve_gitlink_ref(dirname, "HEAD", sha1) == 0)
return show_directory;
index 817c674da1e017cffea9dddae672f9125aca8475..172147fd3d4711c9ea95cd76048b7188bf9a1e2c 100644 (file)
--- a/dir.h
+++ b/dir.h
unsigned int show_ignored:1,
show_other_directories:1,
hide_empty_directories:1,
- no_dirlinks:1;
+ no_gitlinks:1;
struct dir_entry **entries;
/* Exclude info */
index 82bf7259a7d1d34a92a9bf214bccd9771748c582..ae6476496a81b23938569ab0e4c148ba45aba923 100644 (file)
--- a/entry.c
+++ b/entry.c
@@ -145,7 +145,7 @@ static int write_entry(struct cache_entry *ce, char *path, const struct checkout
"symlink %s (%s)", path, strerror(errno));
}
break;
- case S_IFDIRLNK:
+ case S_IFGITLINK:
if (to_tempfile)
return error("git-checkout-index: cannot create temporary subproject %s", path);
if (mkdir(path, 0777) < 0)
@@ -194,7 +194,7 @@ int checkout_entry(struct cache_entry *ce, const struct checkout *state, char *t
unlink(path);
if (S_ISDIR(st.st_mode)) {
/* If it is a gitlink, leave it alone! */
- if (S_ISDIRLNK(ntohl(ce->ce_mode)))
+ if (S_ISGITLINK(ntohl(ce->ce_mode)))
return 0;
if (!state->force)
return error("%s is a directory", path);
diff --git a/list-objects.c b/list-objects.c
index 310f8d39082a12d2c3daddd1fca454686e7425c3..e5c88c278fe23eefbf4cb4dd0c66251b208e48bd 100644 (file)
--- a/list-objects.c
+++ b/list-objects.c
process_tree(revs,
lookup_tree(entry.sha1),
p, &me, entry.path);
- else if (S_ISDIRLNK(entry.mode))
+ else if (S_ISGITLINK(entry.mode))
process_gitlink(revs, entry.sha1,
p, &me, entry.path);
else
diff --git a/read-cache.c b/read-cache.c
index d9f46da5cc547d8cfaa34c901be50a13995b120e..ad4e18753777a951e396116c989896f393d56e47 100644 (file)
--- a/read-cache.c
+++ b/read-cache.c
/*
* We don't actually require that the .git directory
- * under DIRLNK directory be a valid git directory. It
+ * under GITLINK directory be a valid git directory. It
* might even be missing (in case nobody populated that
* sub-project).
*
return DATA_CHANGED;
break;
case S_IFDIR:
- if (S_ISDIRLNK(ntohl(ce->ce_mode)))
+ if (S_ISGITLINK(ntohl(ce->ce_mode)))
return 0;
default:
return TYPE_CHANGED;
(has_symlinks || !S_ISREG(st->st_mode)))
changed |= TYPE_CHANGED;
break;
- case S_IFDIRLNK:
+ case S_IFGITLINK:
if (!S_ISDIR(st->st_mode))
changed |= TYPE_CHANGED;
else if (ce_compare_gitlink(ce))
index e4a39aa3c36964c9034d2393a8b9cb483d1543da..a3728270b4027cd56e09e1a56ec17e177d0a6998 100644 (file)
--- a/tree.c
+++ b/tree.c
/* Count how many entries there are.. */
init_tree_desc(&desc, item->buffer, item->size);
while (tree_entry(&desc, &entry)) {
- if (S_ISDIRLNK(entry.mode))
+ if (S_ISGITLINK(entry.mode))
continue;
n_refs++;
}
while (tree_entry(&desc, &entry)) {
struct object *obj;
- if (S_ISDIRLNK(entry.mode))
+ if (S_ISGITLINK(entry.mode))
continue;
if (S_ISDIR(entry.mode))
obj = &lookup_tree(entry.sha1)->object;