Make Phabricator clone bare git repositories

Summary:
This doesn't really impact anything very much, but is a little cleaner than cloning repositories with a working copy. It's somewhat important for allowing pushes, because you can't push to a checked-out branch.

Mercurial has a similar option (`--noupdate`) but leave that alone for now.

The origin stuff was mostly for sanity/explicitness purposes -- I believe it's safe to remove in all non-ridiculous cases. Git fails with it in bare repositories (it automatically creates an `origin`, but doesn't create the local refs for it, or something).

Test Plan: Nuked a repo, re-cloned it, pulled and updated it several times. Browsed both bare and non-bare repos in Diffusion.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2230

Differential Revision: https://secure.phabricator.com/D7430
This commit is contained in:
epriestley
2013-10-26 21:08:24 -07:00
parent d8bda7c66e
commit 59922b78b9
6 changed files with 17 additions and 14 deletions

View File

@@ -40,6 +40,7 @@ final class DiffusionRepositoryController extends DiffusionController {
}
}
}
$history_exception = null;
} catch (Exception $ex) {
$history_results = null;
$history = null;
@@ -68,6 +69,7 @@ final class DiffusionRepositoryController extends DiffusionController {
}
}
$browse_exception = null;
} catch (Exception $ex) {
$browse_results = null;
$browse_paths = null;