Blame


1 4027f31a 2017-11-04 stsp /* A symbolic reference. */
2 4027f31a 2017-11-04 stsp struct got_symref {
3 4027f31a 2017-11-04 stsp char *name;
4 4027f31a 2017-11-04 stsp char *ref;
5 4027f31a 2017-11-04 stsp };
6 4027f31a 2017-11-04 stsp
7 4027f31a 2017-11-04 stsp /* A non-symbolic reference (there is no better designation). */
8 4027f31a 2017-11-04 stsp struct got_ref {
9 4027f31a 2017-11-04 stsp char *name;
10 4027f31a 2017-11-04 stsp u_int8_t sha1[SHA1_DIGEST_LENGTH];
11 4027f31a 2017-11-04 stsp };
12 4027f31a 2017-11-04 stsp
13 4027f31a 2017-11-04 stsp /* A reference which points to an arbitrary object. */
14 4027f31a 2017-11-04 stsp struct got_reference {
15 4027f31a 2017-11-04 stsp unsigned int flags;
16 4027f31a 2017-11-04 stsp #define GOT_REF_IS_SYMBOLIC 0x01
17 4027f31a 2017-11-04 stsp
18 4027f31a 2017-11-04 stsp union {
19 4027f31a 2017-11-04 stsp struct got_ref ref;
20 4027f31a 2017-11-04 stsp struct got_symref symref;
21 4027f31a 2017-11-04 stsp } ref;
22 4027f31a 2017-11-04 stsp };
23 4027f31a 2017-11-04 stsp
24 4027f31a 2017-11-04 stsp /* Well-known reference names. */
25 4027f31a 2017-11-04 stsp #define GOT_REF_HEAD "HEAD"
26 4027f31a 2017-11-04 stsp #define GOT_REF_ORIG_HEAD "ORIG_HEAD"
27 4027f31a 2017-11-04 stsp #define GOT_REF_MERGE_HEAD "MERGE_HEAD"
28 4027f31a 2017-11-04 stsp
29 4027f31a 2017-11-04 stsp const struct got_error *
30 4027f31a 2017-11-04 stsp got_ref_open(struct got_reference **, const char *, const char *);
31 4027f31a 2017-11-04 stsp
32 4027f31a 2017-11-04 stsp void got_ref_close(struct got_reference *);
33 4027f31a 2017-11-04 stsp