summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a94d994)
raw | patch | inline | side by side (parent: a94d994)
author | Junio C Hamano <junkio@cox.net> | |
Wed, 11 Jan 2006 22:20:09 +0000 (14:20 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 11 Jan 2006 22:47:20 +0000 (14:47 -0800) |
In a repository with mainto/1.0 (to keep maintaining the 1.0.X
series) and fixo/1.0 (to keep fixes that apply to both 1.0.X
series and upwards) branches, "git-name-rev mainto/1.0" answered
just "1.0" making things ambiguous. Show refnames unambiguously
like show-branch does.
Signed-off-by: Junio C Hamano <junkio@cox.net>
series) and fixo/1.0 (to keep fixes that apply to both 1.0.X
series and upwards) branches, "git-name-rev mainto/1.0" answered
just "1.0" making things ambiguous. Show refnames unambiguously
like show-branch does.
Signed-off-by: Junio C Hamano <junkio@cox.net>
name-rev.c | patch | blob | history | |
t/t6010-merge-base.sh | patch | blob | history |
diff --git a/name-rev.c b/name-rev.c
index 65333d4166da845d8594d2dc397c0026eebe2421..bbadb91aa0f51fe1ef7135866912d806c70fc457 100644 (file)
--- a/name-rev.c
+++ b/name-rev.c
}
if (o && o->type == commit_type) {
struct commit *commit = (struct commit *)o;
- const char *p;
- while ((p = strchr(path, '/')))
- path = p+1;
+ if (!strncmp(path, "refs/heads/", 11))
+ path = path + 11;
+ else if (!strncmp(path, "refs/", 5))
+ path = path + 5;
name_rev(commit, strdup(path), 0, 0, deref);
}
diff --git a/t/t6010-merge-base.sh b/t/t6010-merge-base.sh
index c3a9680e2efe632f6e7cc46c828a393eef959d44..1dce123aecd0baa4bbcf122b9a91c478d6e2ef53 100755 (executable)
--- a/t/t6010-merge-base.sh
+++ b/t/t6010-merge-base.sh
test_expect_success 'compute merge-base (single)' \
'MB=$(git-merge-base G H) &&
- expr "$(git-name-rev "$MB")" : "[0-9a-f]* B"'
+ expr "$(git-name-rev "$MB")" : "[0-9a-f]* tags/B"'
test_expect_success 'compute merge-base (all)' \
'MB=$(git-merge-base --all G H) &&
- expr "$(git-name-rev "$MB")" : "[0-9a-f]* B"'
+ expr "$(git-name-rev "$MB")" : "[0-9a-f]* tags/B"'
test_expect_success 'compute merge-base with show-branch' \
'MB=$(git-show-branch --merge-base G H) &&
- expr "$(git-name-rev "$MB")" : "[0-9a-f]* B"'
+ expr "$(git-name-rev "$MB")" : "[0-9a-f]* tags/B"'
test_done