]> khamidou — GitHub mirrors - arcanist.git/commit
Improve git behavior in the zero- and one- commit case
authorepriestley <git@epriestley.com>
Wed, 30 Nov 2011 17:15:37 +0000 (09:15 -0800)
committerepriestley <git@epriestley.com>
Wed, 30 Nov 2011 19:17:37 +0000 (11:17 -0800)
commitc3c4f6ed4c8d68430003319b636b60af416a5fc3
tree75134f149e84f0094c38e23c03a3b7c29558dd80
parent3629308f2faa5d212d4b57737181525761146f71
Improve git behavior in the zero- and one- commit case

Summary:
Git works completely differently for commits zero and one than for 2..N so add
more special casing to handle them. See:

  - {T206}
  - {T596}

The getCommitRange() block is also fatal land, although I wasn't able to reach
it. I'll follow up with @s on T596.

Test Plan:
  - Created a new, empty repository ("mkdir x; cd x; git init").
  - Ran "arc lint", "arc unit", "arc diff" against it with no commits (the first
two work, the third fails helpfully).
  - Made an initial commit.
  - Ran "arc lint", "arc unit", "arc diff" against it (all work correctly).

Reviewers: btrahan, jungejason, aran

Reviewed By: aran

CC: s, aran
Differential Revision: 1142
src/repository/api/git/ArcanistGitAPI.php
src/workflow/diff/ArcanistDiffWorkflow.php