summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-12-03 16:13:06 -0800
committerJunio C Hamano <gitster@pobox.com>2010-12-03 16:13:06 -0800
commit9bec60d3a52fa10b276214f8d255d6ff05a04b77 (patch)
tree0952a0582193715b67d97de9cf8c0875455bc10d /commit.c
parent45a7b55d6fe69581d12b83f63337eaa1015b6717 (diff)
parent7951bd3029a849411181935f84600ddbcd97cd0c (diff)
downloadgit-9bec60d3a52fa10b276214f8d255d6ff05a04b77.tar.gz
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 2d9265d9fe..b21335ee4c 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;