Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
builtin/pull: convert portions to struct object_id
author
brian m. carlson
<sandals@crustytoothpaste.net>
Sun, 26 Mar 2017 16:01:27 +0000
(16:01 +0000)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 27 Mar 2017 05:08:21 +0000
(22:08 -0700)
Convert the caller of sha1_array_append to struct object_id.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/pull.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
9c4b0f6
)
diff --git
a/builtin/pull.c
b/builtin/pull.c
index 3ecb881b0bcacbf1a453bf9a6cb95ae00cdecb1d..a9f7553f30b92dbf2cc99cca568efa4cf257a4b7 100644
(file)
--- a/
builtin/pull.c
+++ b/
builtin/pull.c
@@
-335,16
+335,16
@@
static void get_merge_heads(struct sha1_array *merge_heads)
const char *filename = git_path("FETCH_HEAD");
FILE *fp;
struct strbuf sb = STRBUF_INIT;
const char *filename = git_path("FETCH_HEAD");
FILE *fp;
struct strbuf sb = STRBUF_INIT;
-
unsigned char sha1[GIT_SHA1_RAWSZ]
;
+
struct object_id oid
;
if (!(fp = fopen(filename, "r")))
die_errno(_("could not open '%s' for reading"), filename);
while (strbuf_getline_lf(&sb, fp) != EOF) {
if (!(fp = fopen(filename, "r")))
die_errno(_("could not open '%s' for reading"), filename);
while (strbuf_getline_lf(&sb, fp) != EOF) {
- if (get_
sha1_hex(sb.buf, sha1
))
+ if (get_
oid_hex(sb.buf, &oid
))
continue; /* invalid line: does not start with SHA1 */
if (starts_with(sb.buf + GIT_SHA1_HEXSZ, "\tnot-for-merge\t"))
continue; /* ref is not-for-merge */
continue; /* invalid line: does not start with SHA1 */
if (starts_with(sb.buf + GIT_SHA1_HEXSZ, "\tnot-for-merge\t"))
continue; /* ref is not-for-merge */
- sha1_array_append(merge_heads,
sha1
);
+ sha1_array_append(merge_heads,
oid.hash
);
}
fclose(fp);
strbuf_release(&sb);
}
fclose(fp);
strbuf_release(&sb);