Skip to content

Commit 45c5d4a

Browse files
felipecgitster
authored andcommitted
fast-{import,export}: use get_sha1_hex() to read from marks file
It's wrong to call get_sha1() if they should be SHA-1s, plus inefficient. Signed-off-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 47bd9bf commit 45c5d4a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

builtin/fast-export.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ static void import_marks(char *input_file)
623623

624624
mark = strtoumax(line + 1, &mark_end, 10);
625625
if (!mark || mark_end == line + 1
626-
|| *mark_end != ' ' || get_sha1(mark_end + 1, sha1))
626+
|| *mark_end != ' ' || get_sha1_hex(mark_end + 1, sha1))
627627
die("corrupt mark line: %s", line);
628628

629629
if (last_idnum < mark)

fast-import.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1822,7 +1822,7 @@ static void read_marks(void)
18221822
*end = 0;
18231823
mark = strtoumax(line + 1, &end, 10);
18241824
if (!mark || end == line + 1
1825-
|| *end != ' ' || get_sha1(end + 1, sha1))
1825+
|| *end != ' ' || get_sha1_hex(end + 1, sha1))
18261826
die("corrupt mark line: %s", line);
18271827
e = find_object(sha1);
18281828
if (!e) {

0 commit comments

Comments
 (0)