summaryrefslogtreecommitdiff
path: root/builtin-name-rev.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-11-03 08:23:52 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-11-03 08:23:52 (GMT)
commit407e1d6e127357a0fbe1a9f91ee616a2b7ec29db (patch)
treea2efb8d179aff14b73db024f936ef0dd092b7a7c /builtin-name-rev.c
parentaac91b7eeae4e8cf6521a5370caf03eb432ce492 (diff)
parent6255ef08ae746bdad34851297a989ad6f36f6a21 (diff)
downloadgit-407e1d6e127357a0fbe1a9f91ee616a2b7ec29db.zip
git-407e1d6e127357a0fbe1a9f91ee616a2b7ec29db.tar.gz
git-407e1d6e127357a0fbe1a9f91ee616a2b7ec29db.tar.bz2
Merge branch 'master' into np/index-pack
* master: (90 commits) gitweb: Better support for non-CSS aware web browsers gitweb: Output also empty patches in "commitdiff" view gitweb: Use git-for-each-ref to generate list of heads and/or tags for-each-ref: "creator" and "creatordate" fields Add --global option to git-repo-config. pack-refs: Store the full name of the ref even when packing only tags. git-clone documentation didn't mention --origin as equivalent of -o Minor grammar fixes for git-diff-index.txt link_temp_to_file: call adjust_shared_perm() only when we created the directory Remove uneccessarily similar printf() from print_ref_list() in builtin-branch pack-objects doesn't create random pack names branch: work in subdirectories. gitweb: Use 's' regexp modifier to secure against filenames with LF gitweb: Secure against commit-ish/tree-ish with the same name as path gitweb: esc_html() author in blame git-svnimport: support for partial imports link_temp_to_file: don't leave the path truncated on adjust_shared_perm failure Move deny_non_fast_forwards handling completely into receive-pack. revision traversal: --unpacked does not limit commit list anymore. Continue traversal when rev-list --unpacked finds a packed commit. ...
Diffstat (limited to 'builtin-name-rev.c')
-rw-r--r--builtin-name-rev.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin-name-rev.c b/builtin-name-rev.c
index 52886b6..618aa31 100644
--- a/builtin-name-rev.c
+++ b/builtin-name-rev.c
@@ -75,11 +75,10 @@ copy_data:
}
}
-static int tags_only;
-
-static int name_ref(const char *path, const unsigned char *sha1)
+static int name_ref(const char *path, const unsigned char *sha1, int flags, void *cb_data)
{
struct object *o = parse_object(sha1);
+ int tags_only = *(int*)cb_data;
int deref = 0;
if (tags_only && strncmp(path, "refs/tags/", 10))
@@ -131,6 +130,7 @@ int cmd_name_rev(int argc, const char **argv, const char *prefix)
{
struct object_array revs = { 0, 0, NULL };
int as_is = 0, all = 0, transform_stdin = 0;
+ int tags_only = 0;
git_config(git_default_config);
@@ -186,7 +186,7 @@ int cmd_name_rev(int argc, const char **argv, const char *prefix)
add_object_array((struct object *)commit, *argv, &revs);
}
- for_each_ref(name_ref);
+ for_each_ref(name_ref, &tags_only);
if (transform_stdin) {
char buffer[2048];