summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-12-04 00:13:06 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-12-04 00:13:06 (GMT)
commit9bec60d3a52fa10b276214f8d255d6ff05a04b77 (patch)
tree0952a0582193715b67d97de9cf8c0875455bc10d /commit.c
parent45a7b55d6fe69581d12b83f63337eaa1015b6717 (diff)
parent7951bd3029a849411181935f84600ddbcd97cd0c (diff)
downloadgit-9bec60d3a52fa10b276214f8d255d6ff05a04b77.zip
git-9bec60d3a52fa10b276214f8d255d6ff05a04b77.tar.gz
git-9bec60d3a52fa10b276214f8d255d6ff05a04b77.tar.bz2
Merge branch 'pn/commit-autosquash'
* pn/commit-autosquash: add tests of commit --squash commit: --squash option for use with rebase --autosquash add tests of commit --fixup commit: --fixup option for use with rebase --autosquash pretty.c: teach format_commit_message() to reencode the output commit: helper methods to reduce redundant blocks of code Conflicts: Documentation/git-commit.txt t/t3415-rebase-autosquash.sh
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/commit.c b/commit.c
index 2d9265d..b21335e 100644
--- a/commit.c
+++ b/commit.c
@@ -49,6 +49,19 @@ struct commit *lookup_commit(const unsigned char *sha1)
return check_commit(obj, sha1, 0);
}
+struct commit *lookup_commit_reference_by_name(const char *name)
+{
+ unsigned char sha1[20];
+ struct commit *commit;
+
+ if (get_sha1(name, sha1))
+ return NULL;
+ commit = lookup_commit_reference(sha1);
+ if (!commit || parse_commit(commit))
+ return NULL;
+ return commit;
+}
+
static unsigned long parse_commit_date(const char *buf, const char *tail)
{
const char *dateptr;