Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'en/rev-parse-invalid-range'
author
Junio C Hamano
<gitster@pobox.com>
Fri, 1 Jun 2018 06:06:39 +0000
(15:06 +0900)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 1 Jun 2018 06:06:39 +0000
(15:06 +0900)
"git rev-parse Y..." etc. misbehaved when given endpoints were
not committishes.
* en/rev-parse-invalid-range:
rev-parse: check lookup'ed commit references for NULL
1
2
builtin/rev-parse.c
patch
|
diff1
|
diff2
|
blob
|
history
raw
|
combined
(merge:
caf0c98
0ed556d
)
diff --cc
builtin/rev-parse.c
index 55c0b904410dd4bc12420ff0cb95042d697940fe,da5748bdaef376f35fdb49125e959474913c6ad9..4f49e96bfd0166aeb6f9875a688ff0dd83d631b5
---
1
/
builtin/rev-parse.c
---
2
/
builtin/rev-parse.c
+++ b/
builtin/rev-parse.c
@@@
-280,8
-280,12
+280,12
@@@
static int try_difference(const char *a
if (symmetric) {
struct commit_list *exclude;
struct commit *a, *b;
- a = lookup_commit_reference(&oid);
- b = lookup_commit_reference(&end);
+ a = lookup_commit_reference(&start_oid);
+ b = lookup_commit_reference(&end_oid);
+ if (!a || !b) {
+ *dotdot = '.';
+ return 0;
+ }
exclude = get_merge_bases(a, b);
while (exclude) {
struct commit *commit = pop_commit(&exclude);