summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Carbonneaux2014-08-15 10:37:31 -0400
committerQuentin Carbonneaux2014-08-15 10:37:31 -0400
commite257d93ac6a5aa717d8e765062357043c07f5c9f (patch)
tree9a32b3bf16e3b11a45adebca00bc82a3fbf42a33
parent2c084d9ad98c4fd226f83aaea2cf3fa53984d5e4 (diff)
do not return a revision for dirty edit buffers
-rw-r--r--edit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/edit.c b/edit.c
index 8376e35..778cc87 100644
--- a/edit.c
+++ b/edit.c
@@ -82,8 +82,8 @@ log_delete(Log *l, Buf *b, unsigned p0, unsigned p1)
unsigned
log_revision(Log *l)
{
- while (l->type != Commit)
- l = l->next;
+ if (l->type != Commit)
+ return 0;
return l->p0;
}