summaryrefslogtreecommitdiff
path: root/lockfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'lockfile.c')
-rw-r--r--lockfile.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/lockfile.c b/lockfile.c
index 8d8d5ed4b2..7121370e6d 100644
--- a/lockfile.c
+++ b/lockfile.c
@@ -98,6 +98,27 @@ static void resolve_symlink(struct strbuf *path)
strbuf_reset(&link);
}
+static void unable_to_lock_message(const char *path, int flags, int err,
+ struct strbuf *buf)
+{
+ if (err != EEXIST) {
+ strbuf_addf(buf, "Unable to create '%s.lock': %s",
+ absolute_path(path), strerror(err));
+ } else if (flags & LOCK_OUTSIDE_REPOSITORY) {
+ strbuf_addf(buf, "Unable to create '%s.lock': %s.\n\n"
+ "If no other git process is currently running, this probably means\n"
+ "another git process crashed earlier. Make sure no other git process\n"
+ "is running and remove the file manually to continue.",
+ absolute_path(path), strerror(err));
+ } else {
+ strbuf_addf(buf, "Unable to create '%s.lock': %s.\n\n"
+ "If no other git process is currently running, this probably means a\n"
+ "git process crashed in this repository earlier. Make sure no other git\n"
+ "process is running and remove the file manually to continue.",
+ absolute_path(path), strerror(err));
+ }
+}
+
static int lock_file(struct lock_file *lk, const char *path,
int flags, struct strbuf *err)
{
@@ -149,27 +170,6 @@ static int lock_file(struct lock_file *lk, const char *path,
return lk->fd;
}
-void unable_to_lock_message(const char *path, int flags, int err,
- struct strbuf *buf)
-{
- if (err != EEXIST) {
- strbuf_addf(buf, "Unable to create '%s.lock': %s",
- absolute_path(path), strerror(err));
- } else if (flags & LOCK_OUTSIDE_REPOSITORY) {
- strbuf_addf(buf, "Unable to create '%s.lock': %s.\n\n"
- "If no other git process is currently running, this probably means\n"
- "another git process crashed earlier. Make sure no other git process\n"
- "is running and remove the file manually to continue.",
- absolute_path(path), strerror(err));
- } else {
- strbuf_addf(buf, "Unable to create '%s.lock': %s.\n\n"
- "If no other git process is currently running, this probably means a\n"
- "git process crashed in this repository earlier. Make sure no other git\n"
- "process is running and remove the file manually to continue.",
- absolute_path(path), strerror(err));
- }
-}
-
int hold_lock_file_for_update(struct lock_file *lk, const char *path,
int flags, struct strbuf *err)
{