diff options
author | Documentation Generation <libgit2@users.noreply.github.com> | 2019-10-17 16:42:53 +0000 |
---|---|---|
committer | Documentation Generation <libgit2@users.noreply.github.com> | 2019-10-17 16:42:53 +0000 |
commit | b37dc4771cfeef8d43979a6641ea7e91354303b6 (patch) | |
tree | e2d48b99744c3a8448099a1c141f4385c4b4ef0f /ex/v0.21.1/init.html | |
parent | 53c7df8f09a4e7fdfbe4e0ae51c2f4431531eb35 (diff) | |
download | libgit2-b37dc4771cfeef8d43979a6641ea7e91354303b6.tar.gz |
generated docs
Diffstat (limited to 'ex/v0.21.1/init.html')
-rw-r--r-- | ex/v0.21.1/init.html | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/ex/v0.21.1/init.html b/ex/v0.21.1/init.html index 2757ad026..058923f37 100644 --- a/ex/v0.21.1/init.html +++ b/ex/v0.21.1/init.html @@ -119,7 +119,7 @@ That is demonstrated in the "create<em>initial</em>commit" helper func <span class="n">git_repository</span> <span class="o">*</span><span class="n">repo</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span> <span class="k">struct</span> <span class="n">opts</span> <span class="n">o</span> <span class="o">=</span> <span class="p">{</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">GIT_REPOSITORY_INIT_SHARED_UMASK</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span> <span class="p">};</span> - <span class="n"><a name="git_threads_init-12" class="fnlink" href="../../#v0.21.1/group/threads/git_threads_init">git_threads_init</a></span><span class="p">();</span> + <span class="n"><a name="git_threads_init-6" class="fnlink" href="../../#v0.21.1/group/threads/git_threads_init">git_threads_init</a></span><span class="p">();</span> <span class="n">parse_opts</span><span class="p">(</span><span class="o">&</span><span class="n">o</span><span class="p">,</span> <span class="n">argc</span><span class="p">,</span> <span class="n">argv</span><span class="p">);</span> @@ -137,7 +137,7 @@ That is demonstrated in the "create<em>initial</em>commit" helper func simple case of git<em>repository</em>init() API usage...</p> </td> <td class=code> - <div class='highlight'><pre> <span class="n">check_lg2</span><span class="p">(</span><span class="n"><a name="git_repository_init-5" class="fnlink" href="../../#v0.21.1/group/repository/git_repository_init">git_repository_init</a></span><span class="p">(</span><span class="o">&</span><span class="n">repo</span><span class="p">,</span> <span class="n">o</span><span class="p">.</span><span class="n">dir</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> + <div class='highlight'><pre> <span class="n">check_lg2</span><span class="p">(</span><span class="n">git_repository_init</span><span class="p">(</span><span class="o">&</span><span class="n">repo</span><span class="p">,</span> <span class="n">o</span><span class="p">.</span><span class="n">dir</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="s">"Could not initialize repository"</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span></pre></div> @@ -183,7 +183,7 @@ working directory of the repository (with a git-link file)</p> <span class="k">if</span> <span class="p">(</span><span class="n">o</span><span class="p">.</span><span class="n">shared</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">)</span> <span class="n">initopts</span><span class="p">.</span><span class="n">mode</span> <span class="o">=</span> <span class="n">o</span><span class="p">.</span><span class="n">shared</span><span class="p">;</span> - <span class="n">check_lg2</span><span class="p">(</span><span class="n"><a name="git_repository_init_ext-6" class="fnlink" href="../../#v0.21.1/group/repository/git_repository_init_ext">git_repository_init_ext</a></span><span class="p">(</span><span class="o">&</span><span class="n">repo</span><span class="p">,</span> <span class="n">o</span><span class="p">.</span><span class="n">dir</span><span class="p">,</span> <span class="o">&</span><span class="n">initopts</span><span class="p">),</span> + <span class="n">check_lg2</span><span class="p">(</span><span class="n">git_repository_init_ext</span><span class="p">(</span><span class="o">&</span><span class="n">repo</span><span class="p">,</span> <span class="n">o</span><span class="p">.</span><span class="n">dir</span><span class="p">,</span> <span class="o">&</span><span class="n">initopts</span><span class="p">),</span> <span class="s">"Could not initialize repository"</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span> <span class="p">}</span></pre></div> </td> @@ -198,9 +198,9 @@ working directory of the repository (with a git-link file)</p> <td class=code> <div class='highlight'><pre> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">o</span><span class="p">.</span><span class="n">quiet</span><span class="p">)</span> <span class="p">{</span> <span class="k">if</span> <span class="p">(</span><span class="n">o</span><span class="p">.</span><span class="n">bare</span> <span class="o">||</span> <span class="n">o</span><span class="p">.</span><span class="n">gitdir</span><span class="p">)</span> - <span class="n">o</span><span class="p">.</span><span class="n">dir</span> <span class="o">=</span> <span class="n"><a name="git_repository_path-7" class="fnlink" href="../../#v0.21.1/group/repository/git_repository_path">git_repository_path</a></span><span class="p">(</span><span class="n">repo</span><span class="p">);</span> + <span class="n">o</span><span class="p">.</span><span class="n">dir</span> <span class="o">=</span> <span class="n">git_repository_path</span><span class="p">(</span><span class="n">repo</span><span class="p">);</span> <span class="k">else</span> - <span class="n">o</span><span class="p">.</span><span class="n">dir</span> <span class="o">=</span> <span class="n"><a name="git_repository_workdir-8" class="fnlink" href="../../#v0.21.1/group/repository/git_repository_workdir">git_repository_workdir</a></span><span class="p">(</span><span class="n">repo</span><span class="p">);</span> + <span class="n">o</span><span class="p">.</span><span class="n">dir</span> <span class="o">=</span> <span class="n">git_repository_workdir</span><span class="p">(</span><span class="n">repo</span><span class="p">);</span> <span class="n">printf</span><span class="p">(</span><span class="s">"Initialized empty Git repository in %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">o</span><span class="p">.</span><span class="n">dir</span><span class="p">);</span> <span class="p">}</span></pre></div> @@ -222,8 +222,8 @@ people like to have that empty base commit in their repo.</p> <span class="n">printf</span><span class="p">(</span><span class="s">"Created empty initial commit</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span> <span class="p">}</span> - <span class="n"><a name="git_repository_free-4" class="fnlink" href="../../#v0.21.1/group/repository/git_repository_free">git_repository_free</a></span><span class="p">(</span><span class="n">repo</span><span class="p">);</span> - <span class="n"><a name="git_threads_shutdown-13" class="fnlink" href="../../#v0.21.1/group/threads/git_threads_shutdown">git_threads_shutdown</a></span><span class="p">();</span> + <span class="n">git_repository_free</span><span class="p">(</span><span class="n">repo</span><span class="p">);</span> + <span class="n"><a name="git_threads_shutdown-7" class="fnlink" href="../../#v0.21.1/group/threads/git_threads_shutdown">git_threads_shutdown</a></span><span class="p">();</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="p">}</span></pre></div> @@ -255,13 +255,13 @@ that.</p> <p>First use the config to initialize a commit signature for the user.</p> </td> <td class=code> - <div class='highlight'><pre> <span class="k">if</span> <span class="p">(</span><span class="n"><a name="git_signature_default-10" class="fnlink" href="../../#v0.21.1/group/signature/git_signature_default">git_signature_default</a></span><span class="p">(</span><span class="o">&</span><span class="n">sig</span><span class="p">,</span> <span class="n">repo</span><span class="p">)</span> <span class="o"><</span> <span class="mi">0</span><span class="p">)</span> + <div class='highlight'><pre> <span class="k">if</span> <span class="p">(</span><span class="n"><a name="git_signature_default-4" class="fnlink" href="../../#v0.21.1/group/signature/git_signature_default">git_signature_default</a></span><span class="p">(</span><span class="o">&</span><span class="n">sig</span><span class="p">,</span> <span class="n">repo</span><span class="p">)</span> <span class="o"><</span> <span class="mi">0</span><span class="p">)</span> <span class="n">fatal</span><span class="p">(</span><span class="s">"Unable to create a commit signature."</span><span class="p">,</span> <span class="s">"Perhaps 'user.name' and 'user.email' are not set"</span><span class="p">);</span> <span class="cm">/* Now let's create an empty tree for this commit */</span> - <span class="k">if</span> <span class="p">(</span><span class="n"><a name="git_repository_index-9" class="fnlink" href="../../#v0.21.1/group/repository/git_repository_index">git_repository_index</a></span><span class="p">(</span><span class="o">&</span><span class="n">index</span><span class="p">,</span> <span class="n">repo</span><span class="p">)</span> <span class="o"><</span> <span class="mi">0</span><span class="p">)</span> + <span class="k">if</span> <span class="p">(</span><span class="n">git_repository_index</span><span class="p">(</span><span class="o">&</span><span class="n">index</span><span class="p">,</span> <span class="n">repo</span><span class="p">)</span> <span class="o"><</span> <span class="mi">0</span><span class="p">)</span> <span class="n">fatal</span><span class="p">(</span><span class="s">"Could not open repository index"</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span></pre></div> </td> </tr> @@ -280,7 +280,7 @@ leave it empty for now.</p> <span class="n"><a name="git_index_free-2" class="fnlink" href="../../#v0.21.1/group/index/git_index_free">git_index_free</a></span><span class="p">(</span><span class="n">index</span><span class="p">);</span> - <span class="k">if</span> <span class="p">(</span><span class="n"><a name="git_tree_lookup-14" class="fnlink" href="../../#v0.21.1/group/tree/git_tree_lookup">git_tree_lookup</a></span><span class="p">(</span><span class="o">&</span><span class="n">tree</span><span class="p">,</span> <span class="n">repo</span><span class="p">,</span> <span class="o">&</span><span class="n">tree_id</span><span class="p">)</span> <span class="o"><</span> <span class="mi">0</span><span class="p">)</span> + <span class="k">if</span> <span class="p">(</span><span class="n"><a name="git_tree_lookup-8" class="fnlink" href="../../#v0.21.1/group/tree/git_tree_lookup">git_tree_lookup</a></span><span class="p">(</span><span class="o">&</span><span class="n">tree</span><span class="p">,</span> <span class="n">repo</span><span class="p">,</span> <span class="o">&</span><span class="n">tree_id</span><span class="p">)</span> <span class="o"><</span> <span class="mi">0</span><span class="p">)</span> <span class="n">fatal</span><span class="p">(</span><span class="s">"Could not look up initial tree"</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span></pre></div> </td> </tr> @@ -310,8 +310,8 @@ but here this is the first commit so there will be no parent.</p> <p>Clean up so we don't leak memory.</p> </td> <td class=code> - <div class='highlight'><pre> <span class="n"><a name="git_tree_free-15" class="fnlink" href="../../#v0.21.1/group/tree/git_tree_free">git_tree_free</a></span><span class="p">(</span><span class="n">tree</span><span class="p">);</span> - <span class="n"><a name="git_signature_free-11" class="fnlink" href="../../#v0.21.1/group/signature/git_signature_free">git_signature_free</a></span><span class="p">(</span><span class="n">sig</span><span class="p">);</span> + <div class='highlight'><pre> <span class="n"><a name="git_tree_free-9" class="fnlink" href="../../#v0.21.1/group/tree/git_tree_free">git_tree_free</a></span><span class="p">(</span><span class="n">tree</span><span class="p">);</span> + <span class="n"><a name="git_signature_free-5" class="fnlink" href="../../#v0.21.1/group/signature/git_signature_free">git_signature_free</a></span><span class="p">(</span><span class="n">sig</span><span class="p">);</span> <span class="p">}</span> <span class="k">static</span> <span class="kt">void</span> <span class="nf">usage</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">error</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">arg</span><span class="p">)</span> |