summaryrefslogtreecommitdiff
path: root/src/annotated_commit.h
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@github.com>2016-04-26 11:39:53 -0400
committerEdward Thomson <ethomson@github.com>2016-04-26 13:19:58 -0400
commitd55923788c6b43351db2bc7555aef3bea391a1f4 (patch)
tree05e15007fa8284488c5f15aa12fd2730c364414f /src/annotated_commit.h
parentb3ffd8f63840b2401fa2e636163512a8f0f17b47 (diff)
downloadlibgit2-ethomson/annotated_commit_refs.tar.gz
annotated_commit: provide refs and descriptionethomson/annotated_commit_refs
Differentiate between the ref_name used to create an annotated_commit (that can subsequently be used to look up the reference) and the description that we resolved this with (which _cannot_ be looked up). The description is used for things like reflogs (and may be a ref name, and ID something that we revparsed to get here), while the ref name must actually be a reference name, and is used for things like rebase to return to the initial branch.
Diffstat (limited to 'src/annotated_commit.h')
-rw-r--r--src/annotated_commit.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/annotated_commit.h b/src/annotated_commit.h
index cbb88fd22..3ac8b5f69 100644
--- a/src/annotated_commit.h
+++ b/src/annotated_commit.h
@@ -33,8 +33,11 @@ struct git_annotated_commit {
git_index *index;
git_array_oid_t parents;
- char *ref_name;
- char *remote_url;
+ /* how this commit was looked up */
+ const char *description;
+
+ const char *ref_name;
+ const char *remote_url;
char id_str[GIT_OID_HEXSZ+1];
};