Merge "jirix: Remove ManifestFile and ManifestDir."
diff --git a/jiri/.api b/jiri/.api
index 438c53d..384b799 100644
--- a/jiri/.api
+++ b/jiri/.api
@@ -11,8 +11,6 @@
 pkg jiri, method (*X) BinDir() string
 pkg jiri, method (*X) Clone(tool.ContextOpts) *X
 pkg jiri, method (*X) JiriManifestFile() string
-pkg jiri, method (*X) ManifestDir() string
-pkg jiri, method (*X) ManifestFile(string) string
 pkg jiri, method (*X) ResolveManifestPath(string) (string, error)
 pkg jiri, method (*X) RootMetaDir() string
 pkg jiri, method (*X) UpdateHistoryDir() string
diff --git a/jiri/x.go b/jiri/x.go
index 18c7f8e..20133dd 100644
--- a/jiri/x.go
+++ b/jiri/x.go
@@ -136,16 +136,6 @@
 	return filepath.Join(x.RootMetaDir(), "update_history")
 }
 
-// ManifestDir returns the path to the manifest directory.
-func (x *X) ManifestDir() string {
-	return filepath.Join(x.Root, ".manifest", "v2")
-}
-
-// ManifestFile returns the path to the manifest file with the given name.
-func (x *X) ManifestFile(name string) string {
-	return filepath.Join(x.ManifestDir(), name)
-}
-
 // ResolveManifestPath resolves the given manifest name to an absolute path in
 // the local filesystem.
 func (x *X) ResolveManifestPath(name string) (string, error) {
@@ -162,18 +152,19 @@
 //
 // TODO(toddw): Remove this logic when the transition to .jiri_manifest is done.
 func (x *X) resolveManifestPathDeprecated(name string) (string, error) {
+	manifestDir := filepath.Join(x.Root, ".manifest", "v2")
 	if name != "" {
 		if filepath.IsAbs(name) {
 			return name, nil
 		}
-		return x.ManifestFile(name), nil
+		return filepath.Join(manifestDir, name), nil
 	}
 	path := filepath.Join(x.Root, ".local_manifest")
 	switch _, err := os.Stat(path); {
 	case err == nil:
 		return path, nil
 	case os.IsNotExist(err):
-		return x.ManifestFile("default"), nil
+		return filepath.Join(manifestDir, "default"), nil
 	default:
 		return "", fmt.Errorf("Stat(%v) failed: %v", path, err)
 	}
diff --git a/project/project.go b/project/project.go
index 276aeba..a877633 100644
--- a/project/project.go
+++ b/project/project.go
@@ -1851,7 +1851,12 @@
 		if found && strings.HasPrefix(op.project.Remote, host.Location) {
 			gitHookDir := filepath.Join(tmpDir, ".git", "hooks")
 			for _, githook := range host.GitHooks {
-				mdir := jirix.ManifestDir()
+				// TODO(nlacasse): GitHook paths are relative to the manifest
+				// file.  Currently all manifests live in
+				// JIRI_ROOT/.manifest/v2, but that is changing.  I think
+				// GitHooks should be associated with projects, and their paths
+				// should be relative to the project root.
+				mdir := filepath.Join(jirix.Root, ".manifest", "v2")
 				src, err := s.ReadFile(filepath.Join(mdir, githook.Path))
 				if err != nil {
 					return err
diff --git a/snapshot.go b/snapshot.go
index c4b9560..3238615 100644
--- a/snapshot.go
+++ b/snapshot.go
@@ -141,7 +141,7 @@
 
 	// TODO(nlacasse): Remove once there are no more user of the -remote flag.
 	if remoteFlag {
-		dir = filepath.Join(jirix.ManifestDir(), "snapshot")
+		dir = filepath.Join(jirix.Root, ".manifest", "v2", "snapshot")
 	}
 
 	if !filepath.IsAbs(dir) {
diff --git a/snapshot_test.go b/snapshot_test.go
index cd33273..7fb99d1 100644
--- a/snapshot_test.go
+++ b/snapshot_test.go
@@ -319,10 +319,11 @@
 	fake.EnableRemoteManifestPush()
 	defer fake.DisableRemoteManifestPush()
 
-	snapshotDir := filepath.Join(fake.X.ManifestDir(), "snapshot")
+	manifestDir := filepath.Join(fake.X.Root, ".manifest")
+	snapshotDir := filepath.Join(manifestDir, "snapshot")
 	label := "test"
 
-	git := gitutil.New(fake.X.NewSeq(), fake.X.ManifestDir())
+	git := gitutil.New(fake.X.NewSeq(), manifestDir)
 	commitCount, err := git.CountCommits("master", "")
 	if err != nil {
 		t.Fatalf("git.CountCommits(\"master\", \"\") failed: %v", err)