]> khamidou — GitHub mirrors - arcanist.git/commit
In "arc patch", use "cat-file -t" instead of "rev-parse --verify" to check for commits.
authorepriestley <git@epriestley.com>
Tue, 20 Mar 2012 02:11:52 +0000 (19:11 -0700)
committerepriestley <git@epriestley.com>
Tue, 20 Mar 2012 02:11:52 +0000 (19:11 -0700)
commit4e888458d70a520a2bf8ca6ea6a4c743761c56cb
treeeea7cf4a826a64920049354427aa7ebb286a1cf9
parent718b8b6d4f96d57caff339157390613484e46477
In "arc patch", use "cat-file -t" instead of "rev-parse --verify" to check for commits.

Summary:
  - `git rev-parse --verify` "verifies" very valid-looking commit name, not just valid commit names.
  - Currently, if we can't find the base rev we'll incorrectly "verify" it and then fail on "git checkout -b <branch> <some bogus commit>".
  - Instead, use `git cat-file -t`.
  - See similar fix in D1590.

Example:

  $ git rev-parse --verify aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Test Plan: Ran "arc patch" in a mismatched local, hit "Y" to branch, got a branch off HEAD instead of an error.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran, epriestley
Differential Revision: https://secure.phabricator.com/D1947
src/workflow/patch/ArcanistPatchWorkflow.php