summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3140825)
raw | patch | inline | side by side (parent: 3140825)
author | Linus Torvalds <torvalds@osdl.org> | |
Sat, 13 Aug 2005 17:50:56 +0000 (10:50 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 14 Aug 2005 01:28:50 +0000 (18:28 -0700) |
You can resolve a tag, and it does the right thing except that it might
end up writing the tag itself into the resulting HEAD, which will confuse
subsequent operations no end.
This makes sure that when we resolve two heads, we will have turned them
into proper commits before we start acting on them.
This also fixes the parsing of "treeish^0", which would incorrectly
resolve to "treeish" instead of causing an error.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
end up writing the tag itself into the resulting HEAD, which will confuse
subsequent operations no end.
This makes sure that when we resolve two heads, we will have turned them
into proper commits before we start acting on them.
This also fixes the parsing of "treeish^0", which would incorrectly
resolve to "treeish" instead of causing an error.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-resolve-script | patch | blob | history | |
sha1_name.c | patch | blob | history |
diff --git a/git-resolve-script b/git-resolve-script
index 52dd83bae0d6ca95cc083cd6df06a289c51558a5..4641119e0f00848f5dacce40fd376efc1cbdbcb5 100755 (executable)
--- a/git-resolve-script
+++ b/git-resolve-script
#
. git-sh-setup-script || die "Not a git archive"
-head=$(git-rev-parse --verify "$1")
-merge=$(git-rev-parse --verify "$2")
+head=$(git-rev-parse --verify "$1"^0) || exit
+merge=$(git-rev-parse --verify "$2"^0) || exit
merge_msg="$3"
dropheads() {
diff --git a/sha1_name.c b/sha1_name.c
index 5d1e441e5a9b7c0d6a03e3ee9add8a51238a3227..df45b172a3033cad47e5039defc6de45748aeb5f 100644 (file)
--- a/sha1_name.c
+++ b/sha1_name.c
} else
parent = -1;
- if (0 <= parent) {
- ret = get_parent(name, len, sha1, parent);
- if (!ret)
- return 0;
- else if(parent>0)
- return ret;
- }
+ if (parent >= 0)
+ return get_parent(name, len, sha1, parent);
+
ret = get_sha1_basic(name, len, sha1);
if (!ret)
return 0;