Header file of Utils.
More...
#include "UI/ConflictsWindow.h"
#include <AppKit.h>
#include <SupportKit.h>
#include <vector.h>
#include <git2.h>
Go to the source code of this file.
|
enum | {
kQuitWindow,
kClone,
kInitHere,
kStatus,
kAdd,
kAddAll,
kCommit,
kPull,
kPush,
kShowConflicts,
kCreateBranch,
kSwitchBranch,
kLog
} |
|
|
void | extract_selected_paths (const BMessage *msg, vector< char *> &selected) |
| Get selected files. More...
|
|
BString | extract_current_directory (const BMessage *msg) |
| Get current directory. More...
|
|
BString | get_root_of_repo (BString dirPath) |
| Get the root of repo of current directory. More...
|
|
int | perform_fastforward (git_repository *, const git_oid *, int) |
| This performs fastforward on given repo, branch id. More...
|
|
int | create_commit (git_repository *, git_index *, const char *) |
| Creates a commit on given repo, index and message. More...
|
|
void | output_conflicts (git_index *) |
| Shows conflicts in current repo index in a window. More...
|
|
int | cred_acquire_cb (git_cred **, const char *, const char *, unsigned int, void *) |
| This functions gets username and password from the user in case credentials are required. More...
|
|
Header file of Utils.
This file contains common functions and enums used by app.
- Author
- Hrishikesh Hiraskar hrish.nosp@m.ihir.nosp@m.askar.nosp@m.@gma.nosp@m.il.co.nosp@m.m
Definition in file Utils.h.
◆ ADDON_NAME
#define ADDON_NAME "TrackGit" |
The addon name.
Will be used in menu item.
Definition at line 40 of file Utils.h.
◆ APP_SIGN
#define APP_SIGN "application/x-vnd.Haiku-TrackGit" |
The Application signature.
Definition at line 45 of file Utils.h.
◆ anonymous enum
Enumerator |
---|
kQuitWindow | |
kClone | |
kInitHere | |
kStatus | |
kAdd | |
kAddAll | |
kCommit | |
kPull | |
kPush | |
kShowConflicts | |
kCreateBranch | |
kSwitchBranch | |
kLog | |
Definition at line 20 of file Utils.h.
◆ create_commit()
int create_commit |
( |
git_repository * |
repo, |
|
|
git_index * |
index, |
|
|
const char * |
message |
|
) |
| |
Creates a commit on given repo, index and message.
- Parameters
-
repo | The git repository. |
index | The git index. |
message | The commit message. |
- Returns
- 0 or error code.
Definition at line 186 of file Utils.cpp.
◆ cred_acquire_cb()
int cred_acquire_cb |
( |
git_cred ** |
, |
|
|
const char * |
, |
|
|
const char * |
, |
|
|
unsigned |
int, |
|
|
void * |
|
|
) |
| |
This functions gets username and password from the user in case credentials are required.
Definition at line 299 of file Utils.cpp.
◆ extract_current_directory()
BString extract_current_directory |
( |
const BMessage * |
msg | ) |
|
Get current directory.
- Parameters
-
msg | The BMessage containing ref to current directory. |
- Returns
- The current directory.
Definition at line 28 of file Utils.cpp.
◆ extract_selected_paths()
void extract_selected_paths |
( |
const BMessage * |
msg, |
|
|
vector< char *> & |
selected |
|
) |
| |
Get selected files.
- Parameters
-
msg | The BMessage containing refs to selected files. |
selected | The vector of selected file paths. |
Definition at line 50 of file Utils.cpp.
◆ get_root_of_repo()
BString get_root_of_repo |
( |
BString |
dirPath | ) |
|
Get the root of repo of current directory.
- Parameters
-
dirPath | The current directory. |
- Returns
- The repo root if found else current directory.
Definition at line 81 of file Utils.cpp.
◆ output_conflicts()
void output_conflicts |
( |
git_index * |
index | ) |
|
Shows conflicts in current repo index in a window.
- Parameters
-
index | The git index with conflicts. |
Definition at line 248 of file Utils.cpp.
◆ perform_fastforward()
int perform_fastforward |
( |
git_repository * |
repo, |
|
|
const git_oid * |
target_oid, |
|
|
int |
is_unborn |
|
) |
| |
This performs fastforward on given repo, branch id.
- Parameters
-
repo | The git repository. |
target_oid | The target branch id. |
is_unborn | True if HEAD isn't born yet. |
- Returns
- 0 or error code.
Definition at line 103 of file Utils.cpp.